@industry-theme/github-panels 0.1.47 → 0.1.49

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.
@@ -130,7 +130,7 @@ const createLucideIcon = (iconName, iconNode) => {
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
132
  */
133
- const __iconNode$E = [
133
+ const __iconNode$D = [
134
134
  ["path", { d: "M12 7v14", key: "1akyts" }],
135
135
  [
136
136
  "path",
@@ -140,14 +140,14 @@ const __iconNode$E = [
140
140
  }
141
141
  ]
142
142
  ];
143
- const BookOpen = createLucideIcon("book-open", __iconNode$E);
143
+ const BookOpen = createLucideIcon("book-open", __iconNode$D);
144
144
  /**
145
145
  * @license lucide-react v0.552.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
149
  */
150
- const __iconNode$D = [
150
+ const __iconNode$C = [
151
151
  ["path", { d: "M10 12h4", key: "a56b0p" }],
152
152
  ["path", { d: "M10 8h4", key: "1sr2af" }],
153
153
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -160,97 +160,97 @@ const __iconNode$D = [
160
160
  ],
161
161
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
162
162
  ];
163
- const Building2 = createLucideIcon("building-2", __iconNode$D);
163
+ const Building2 = createLucideIcon("building-2", __iconNode$C);
164
164
  /**
165
165
  * @license lucide-react v0.552.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
169
  */
170
- const __iconNode$C = [
170
+ const __iconNode$B = [
171
171
  ["path", { d: "M8 2v4", key: "1cmpym" }],
172
172
  ["path", { d: "M16 2v4", key: "4m81vk" }],
173
173
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
174
174
  ["path", { d: "M3 10h18", key: "8toen8" }]
175
175
  ];
176
- const Calendar = createLucideIcon("calendar", __iconNode$C);
176
+ const Calendar = createLucideIcon("calendar", __iconNode$B);
177
177
  /**
178
178
  * @license lucide-react v0.552.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
182
  */
183
- const __iconNode$B = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
- const Check = createLucideIcon("check", __iconNode$B);
183
+ const __iconNode$A = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
+ const Check = createLucideIcon("check", __iconNode$A);
185
185
  /**
186
186
  * @license lucide-react v0.552.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
190
  */
191
- const __iconNode$A = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$A);
191
+ const __iconNode$z = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$z);
193
193
  /**
194
194
  * @license lucide-react v0.552.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
198
  */
199
- const __iconNode$z = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$z);
199
+ const __iconNode$y = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$y);
201
201
  /**
202
202
  * @license lucide-react v0.552.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const __iconNode$y = [
207
+ const __iconNode$x = [
208
208
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
209
209
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
210
210
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
211
211
  ];
212
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$y);
212
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$x);
213
213
  /**
214
214
  * @license lucide-react v0.552.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const __iconNode$x = [
219
+ const __iconNode$w = [
220
220
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
221
221
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
222
222
  ];
223
- const CircleDot = createLucideIcon("circle-dot", __iconNode$x);
223
+ const CircleDot = createLucideIcon("circle-dot", __iconNode$w);
224
224
  /**
225
225
  * @license lucide-react v0.552.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const __iconNode$w = [
230
+ const __iconNode$v = [
231
231
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
232
232
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
233
233
  ];
234
- const Copy = createLucideIcon("copy", __iconNode$w);
234
+ const Copy = createLucideIcon("copy", __iconNode$v);
235
235
  /**
236
236
  * @license lucide-react v0.552.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
240
  */
241
- const __iconNode$v = [
241
+ const __iconNode$u = [
242
242
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
243
243
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
244
244
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
245
245
  ];
246
- const Download = createLucideIcon("download", __iconNode$v);
246
+ const Download = createLucideIcon("download", __iconNode$u);
247
247
  /**
248
248
  * @license lucide-react v0.552.0 - ISC
249
249
  *
250
250
  * This source code is licensed under the ISC license.
251
251
  * See the LICENSE file in the root directory of this source tree.
252
252
  */
253
- const __iconNode$u = [
253
+ const __iconNode$t = [
254
254
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
255
255
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
256
256
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -260,26 +260,26 @@ const __iconNode$u = [
260
260
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
261
261
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
262
262
  ];
263
- const Expand = createLucideIcon("expand", __iconNode$u);
263
+ const Expand = createLucideIcon("expand", __iconNode$t);
264
264
  /**
265
265
  * @license lucide-react v0.552.0 - ISC
266
266
  *
267
267
  * This source code is licensed under the ISC license.
268
268
  * See the LICENSE file in the root directory of this source tree.
269
269
  */
270
- const __iconNode$t = [
270
+ const __iconNode$s = [
271
271
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
272
272
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
273
273
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
274
274
  ];
275
- const ExternalLink = createLucideIcon("external-link", __iconNode$t);
275
+ const ExternalLink = createLucideIcon("external-link", __iconNode$s);
276
276
  /**
277
277
  * @license lucide-react v0.552.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
281
  */
282
- const __iconNode$s = [
282
+ const __iconNode$r = [
283
283
  [
284
284
  "path",
285
285
  {
@@ -289,14 +289,14 @@ const __iconNode$s = [
289
289
  ],
290
290
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
291
291
  ];
292
- const Eye = createLucideIcon("eye", __iconNode$s);
292
+ const Eye = createLucideIcon("eye", __iconNode$r);
293
293
  /**
294
294
  * @license lucide-react v0.552.0 - ISC
295
295
  *
296
296
  * This source code is licensed under the ISC license.
297
297
  * See the LICENSE file in the root directory of this source tree.
298
298
  */
299
- const __iconNode$r = [
299
+ const __iconNode$q = [
300
300
  [
301
301
  "path",
302
302
  {
@@ -309,14 +309,14 @@ const __iconNode$r = [
309
309
  ["path", { d: "M16 13H8", key: "t4e002" }],
310
310
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
311
311
  ];
312
- const FileText = createLucideIcon("file-text", __iconNode$r);
312
+ const FileText = createLucideIcon("file-text", __iconNode$q);
313
313
  /**
314
314
  * @license lucide-react v0.552.0 - ISC
315
315
  *
316
316
  * This source code is licensed under the ISC license.
317
317
  * See the LICENSE file in the root directory of this source tree.
318
318
  */
319
- const __iconNode$q = [
319
+ const __iconNode$p = [
320
320
  [
321
321
  "path",
322
322
  {
@@ -325,14 +325,14 @@ const __iconNode$q = [
325
325
  }
326
326
  ]
327
327
  ];
328
- const FolderOpen = createLucideIcon("folder-open", __iconNode$q);
328
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$p);
329
329
  /**
330
330
  * @license lucide-react v0.552.0 - ISC
331
331
  *
332
332
  * This source code is licensed under the ISC license.
333
333
  * See the LICENSE file in the root directory of this source tree.
334
334
  */
335
- const __iconNode$p = [
335
+ const __iconNode$o = [
336
336
  ["path", { d: "M12 10v6", key: "1bos4e" }],
337
337
  ["path", { d: "M9 13h6", key: "1uhe8q" }],
338
338
  [
@@ -343,14 +343,14 @@ const __iconNode$p = [
343
343
  }
344
344
  ]
345
345
  ];
346
- const FolderPlus = createLucideIcon("folder-plus", __iconNode$p);
346
+ const FolderPlus = createLucideIcon("folder-plus", __iconNode$o);
347
347
  /**
348
348
  * @license lucide-react v0.552.0 - ISC
349
349
  *
350
350
  * This source code is licensed under the ISC license.
351
351
  * See the LICENSE file in the root directory of this source tree.
352
352
  */
353
- const __iconNode$o = [
353
+ const __iconNode$n = [
354
354
  [
355
355
  "path",
356
356
  {
@@ -359,45 +359,33 @@ const __iconNode$o = [
359
359
  }
360
360
  ]
361
361
  ];
362
- const Folder = createLucideIcon("folder", __iconNode$o);
362
+ const Folder = createLucideIcon("folder", __iconNode$n);
363
363
  /**
364
364
  * @license lucide-react v0.552.0 - ISC
365
365
  *
366
366
  * This source code is licensed under the ISC license.
367
367
  * See the LICENSE file in the root directory of this source tree.
368
368
  */
369
- const __iconNode$n = [
369
+ const __iconNode$m = [
370
370
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
371
371
  ["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
372
372
  ["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
373
373
  ];
374
- const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$n);
374
+ const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$m);
375
375
  /**
376
376
  * @license lucide-react v0.552.0 - ISC
377
377
  *
378
378
  * This source code is licensed under the ISC license.
379
379
  * See the LICENSE file in the root directory of this source tree.
380
380
  */
381
- const __iconNode$m = [
381
+ const __iconNode$l = [
382
382
  ["circle", { cx: "12", cy: "18", r: "3", key: "1mpf1b" }],
383
383
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
384
384
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
385
385
  ["path", { d: "M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9", key: "1uq4wg" }],
386
386
  ["path", { d: "M12 12v3", key: "158kv8" }]
387
387
  ];
388
- const GitFork = createLucideIcon("git-fork", __iconNode$m);
389
- /**
390
- * @license lucide-react v0.552.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */
395
- const __iconNode$l = [
396
- ["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
397
- ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
398
- ["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
399
- ];
400
- const GitMerge = createLucideIcon("git-merge", __iconNode$l);
388
+ const GitFork = createLucideIcon("git-fork", __iconNode$l);
401
389
  /**
402
390
  * @license lucide-react v0.552.0 - ISC
403
391
  *
@@ -407,10 +395,9 @@ const GitMerge = createLucideIcon("git-merge", __iconNode$l);
407
395
  const __iconNode$k = [
408
396
  ["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
409
397
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
410
- ["path", { d: "M13 6h3a2 2 0 0 1 2 2v7", key: "1yeb86" }],
411
- ["line", { x1: "6", x2: "6", y1: "9", y2: "21", key: "rroup" }]
398
+ ["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
412
399
  ];
413
- const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$k);
400
+ const GitMerge = createLucideIcon("git-merge", __iconNode$k);
414
401
  /**
415
402
  * @license lucide-react v0.552.0 - ISC
416
403
  *
@@ -2181,7 +2168,7 @@ const GitHubIssuesPanelContent = ({
2181
2168
  context,
2182
2169
  events
2183
2170
  }) => {
2184
- var _a, _b, _c, _d, _e;
2171
+ var _a, _b, _c, _d, _e2;
2185
2172
  const { theme: theme2 } = useTheme();
2186
2173
  const issuesSlice = context.getSlice("github-issues");
2187
2174
  const isLoading = context.isSliceLoading("github-issues");
@@ -2190,7 +2177,7 @@ const GitHubIssuesPanelContent = ({
2190
2177
  const owner = ((_b = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _b.owner) ?? "";
2191
2178
  const repo = ((_c = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _c.repo) ?? "";
2192
2179
  const isAuthenticated = ((_d = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _d.isAuthenticated) ?? false;
2193
- const sliceError = (_e = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _e.error;
2180
+ const sliceError = (_e2 = issuesSlice == null ? void 0 : issuesSlice.data) == null ? void 0 : _e2.error;
2194
2181
  const [selectedLabel, setSelectedLabel] = useState("");
2195
2182
  const [isDropdownOpen, setIsDropdownOpen] = useState(false);
2196
2183
  const [selectedIssueId, setSelectedIssueId] = useState(null);
@@ -39532,20 +39519,20 @@ class EditMap {
39532
39519
  this.map.length = 0;
39533
39520
  }
39534
39521
  }
39535
- function addImplementation(editMap, at, remove, add) {
39522
+ function addImplementation(editMap, at2, remove, add) {
39536
39523
  let index2 = 0;
39537
39524
  if (remove === 0 && add.length === 0) {
39538
39525
  return;
39539
39526
  }
39540
39527
  while (index2 < editMap.map.length) {
39541
- if (editMap.map[index2][0] === at) {
39528
+ if (editMap.map[index2][0] === at2) {
39542
39529
  editMap.map[index2][1] += remove;
39543
39530
  editMap.map[index2][2].push(...add);
39544
39531
  return;
39545
39532
  }
39546
39533
  index2 += 1;
39547
39534
  }
39548
- editMap.map.push([at, remove, add]);
39535
+ editMap.map.push([at2, remove, add]);
39549
39536
  }
39550
39537
  function gfmTableAlign(events, index2) {
39551
39538
  let inDelimiterRow = false;
@@ -41702,7 +41689,7 @@ var css_248z = ".transform-component-module_wrapper__SPB86 {\n position: relati
41702
41689
  var styles = { "wrapper": "transform-component-module_wrapper__SPB86", "content": "transform-component-module_content__FBWxo" };
41703
41690
  styleInject(css_248z);
41704
41691
  var TransformComponent = function(_a) {
41705
- var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e = _a.contentProps, contentProps = _e === void 0 ? {} : _e;
41692
+ var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e2 = _a.contentProps, contentProps = _e2 === void 0 ? {} : _e2;
41706
41693
  var _f = useContext(Context), init = _f.init, cleanupWindowEvents = _f.cleanupWindowEvents;
41707
41694
  var wrapperRef = useRef(null);
41708
41695
  var contentRef = useRef(null);
@@ -43109,7 +43096,8 @@ var createIndustryMarkdownComponents = ({
43109
43096
  enableHtmlPopout,
43110
43097
  slideHeaderMarginTopOverride,
43111
43098
  index: index2,
43112
- repositoryInfo
43099
+ repositoryInfo,
43100
+ editable = false
43113
43101
  }) => {
43114
43102
  const getLuminance = (hex) => {
43115
43103
  const rgb = hex.replace("#", "").match(/.{2}/g);
@@ -43197,7 +43185,7 @@ var createIndustryMarkdownComponents = ({
43197
43185
  ...props
43198
43186
  }, children2),
43199
43187
  li: ({ children: children2, ...props }) => {
43200
- var _a, _b, _c, _d, _e, _f, _g, _h;
43188
+ var _a, _b, _c, _d, _e2, _f, _g, _h;
43201
43189
  const isTaskListItem = Array.isArray(children2) && children2.length > 0 && React2__default.isValidElement(children2[0]) && ((_b = (_a = children2[0]) == null ? void 0 : _a.props) == null ? void 0 : _b.type) === "checkbox";
43202
43190
  if (isTaskListItem) {
43203
43191
  const checkbox = children2[0];
@@ -43212,7 +43200,7 @@ var createIndustryMarkdownComponents = ({
43212
43200
  }
43213
43201
  });
43214
43202
  const checked = ((_c = checkbox == null ? void 0 : checkbox.props) == null ? void 0 : _c.checked) || false;
43215
- const lineNumber = ((_e = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
43203
+ const lineNumber = ((_e2 = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e2.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
43216
43204
  const id = `${slideIdPrefix}-checkbox-${lineNumber}`;
43217
43205
  const isChecked = checkedItems[id] ?? checked;
43218
43206
  const handleChange = (e) => {
@@ -43241,19 +43229,20 @@ var createIndustryMarkdownComponents = ({
43241
43229
  checked: isChecked,
43242
43230
  onChange: handleChange,
43243
43231
  onClick: (e) => e.stopPropagation(),
43232
+ disabled: !editable,
43244
43233
  style: {
43245
43234
  marginRight: theme2.space[2],
43246
43235
  marginTop: theme2.space[1],
43247
43236
  width: "16px",
43248
43237
  height: "16px",
43249
- cursor: "pointer"
43238
+ cursor: editable ? "pointer" : "default"
43250
43239
  },
43251
43240
  id
43252
43241
  }), /* @__PURE__ */ React2__default.createElement("label", {
43253
43242
  htmlFor: id,
43254
43243
  style: {
43255
43244
  flex: 1,
43256
- cursor: "pointer",
43245
+ cursor: editable ? "pointer" : "default",
43257
43246
  color: isChecked ? theme2.colors.textMuted : "inherit",
43258
43247
  lineHeight: theme2.lineHeights.relaxed
43259
43248
  }
@@ -43356,7 +43345,7 @@ var createIndustryMarkdownComponents = ({
43356
43345
  });
43357
43346
  },
43358
43347
  code: ({ node: node2, className, children: children2, ...props }) => {
43359
- var _a, _b, _c, _d, _e, _f;
43348
+ var _a, _b, _c, _d, _e2, _f;
43360
43349
  const hasLanguageClass = className && (className.includes("language-") || className.includes("hljs"));
43361
43350
  const codeString = extractTextFromChildren(children2);
43362
43351
  const matchLang = /language-(\w+)/.exec(className || "");
@@ -43568,7 +43557,7 @@ var createIndustryMarkdownComponents = ({
43568
43557
  ...props
43569
43558
  }, children2)));
43570
43559
  }
43571
- const cleanClassName = (_f = (_e = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
43560
+ const cleanClassName = (_f = (_e2 = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e2.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
43572
43561
  return /* @__PURE__ */ React2__default.createElement("code", {
43573
43562
  style: {
43574
43563
  color: theme2.colors.accent,
@@ -44335,7 +44324,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44335
44324
  maxScreenWidth: _maxScreenWidth,
44336
44325
  enableKeyboardScrolling = true,
44337
44326
  keyboardScrollConfig,
44338
- repositoryInfo
44327
+ repositoryInfo,
44328
+ editable = false
44339
44329
  }) {
44340
44330
  const slideRef = useRef(null);
44341
44331
  const scrollPositionsRef = useRef(/* @__PURE__ */ new Map());
@@ -44606,7 +44596,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44606
44596
  }
44607
44597
  }, [slideIndex]);
44608
44598
  const sanitizeSchema = useMemo(() => {
44609
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
44599
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
44610
44600
  return {
44611
44601
  ...defaultSchema,
44612
44602
  tagNames: [...defaultSchema.tagNames || [], "picture", "source", "mark"],
@@ -44617,7 +44607,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44617
44607
  span: [...((_b = defaultSchema.attributes) == null ? void 0 : _b.span) || [], "className", "style"],
44618
44608
  pre: [...((_c = defaultSchema.attributes) == null ? void 0 : _c.pre) || [], "className", "style"],
44619
44609
  div: [...((_d = defaultSchema.attributes) == null ? void 0 : _d.div) || [], "style", "className", "id"],
44620
- p: [...((_e = defaultSchema.attributes) == null ? void 0 : _e.p) || [], "style", "className", "id"],
44610
+ p: [...((_e2 = defaultSchema.attributes) == null ? void 0 : _e2.p) || [], "style", "className", "id"],
44621
44611
  h1: [...((_f = defaultSchema.attributes) == null ? void 0 : _f.h1) || [], "style", "className", "id"],
44622
44612
  h2: [...((_g = defaultSchema.attributes) == null ? void 0 : _g.h2) || [], "style", "className", "id"],
44623
44613
  h3: [...((_h = defaultSchema.attributes) == null ? void 0 : _h.h3) || [], "style", "className", "id"],
@@ -44691,7 +44681,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44691
44681
  enableHtmlPopout,
44692
44682
  slideHeaderMarginTopOverride,
44693
44683
  index: chunkIndex,
44694
- repositoryInfo
44684
+ repositoryInfo,
44685
+ editable
44695
44686
  });
44696
44687
  if (searchQuery) {
44697
44688
  return {
@@ -44724,7 +44715,8 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44724
44715
  enableHtmlPopout,
44725
44716
  slideHeaderMarginTopOverride,
44726
44717
  repositoryInfo,
44727
- searchQuery
44718
+ searchQuery,
44719
+ editable
44728
44720
  ]);
44729
44721
  return /* @__PURE__ */ React2__default.createElement("div", {
44730
44722
  className: "markdown-slide",
@@ -44809,9 +44801,9 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
44809
44801
  theme: theme2
44810
44802
  }));
44811
44803
  });
44812
- var PanelGroupContext = createContext(null);
44813
- PanelGroupContext.displayName = "PanelGroupContext";
44814
- var DATA_ATTRIBUTES = {
44804
+ var PanelGroupContext$1 = createContext(null);
44805
+ PanelGroupContext$1.displayName = "PanelGroupContext";
44806
+ var DATA_ATTRIBUTES$1 = {
44815
44807
  group: "data-panel-group",
44816
44808
  groupDirection: "data-panel-group-direction",
44817
44809
  groupId: "data-panel-group-id",
@@ -44821,20 +44813,20 @@ var DATA_ATTRIBUTES = {
44821
44813
  panelSize: "data-panel-size",
44822
44814
  resizeHandleId: "data-panel-resize-handle-id"
44823
44815
  };
44824
- var PRECISION = 10;
44825
- var useIsomorphicLayoutEffect = useLayoutEffect;
44826
- var useId = React2["useId".toString()];
44827
- var wrappedUseId = typeof useId === "function" ? useId : () => null;
44828
- var counter = 0;
44829
- function useUniqueId(idFromParams = null) {
44830
- const idFromUseId = wrappedUseId();
44816
+ var PRECISION$1 = 10;
44817
+ var useIsomorphicLayoutEffect$1 = useLayoutEffect;
44818
+ var useId$1 = React2["useId".toString()];
44819
+ var wrappedUseId$1 = typeof useId$1 === "function" ? useId$1 : () => null;
44820
+ var counter$1 = 0;
44821
+ function useUniqueId$1(idFromParams = null) {
44822
+ const idFromUseId = wrappedUseId$1();
44831
44823
  const idRef = useRef(idFromParams || idFromUseId || null);
44832
44824
  if (idRef.current === null) {
44833
- idRef.current = "" + counter++;
44825
+ idRef.current = "" + counter$1++;
44834
44826
  }
44835
44827
  return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
44836
44828
  }
44837
- function PanelWithForwardedRef({
44829
+ function PanelWithForwardedRef$1({
44838
44830
  children: children2,
44839
44831
  className: classNameFromProps = "",
44840
44832
  collapsedSize,
@@ -44852,7 +44844,7 @@ function PanelWithForwardedRef({
44852
44844
  tagName: Type = "div",
44853
44845
  ...rest
44854
44846
  }) {
44855
- const context = useContext(PanelGroupContext);
44847
+ const context = useContext(PanelGroupContext$1);
44856
44848
  if (context === null) {
44857
44849
  throw Error(`Panel components must be rendered within a PanelGroup container`);
44858
44850
  }
@@ -44868,7 +44860,7 @@ function PanelWithForwardedRef({
44868
44860
  resizePanel: resizePanel2,
44869
44861
  unregisterPanel
44870
44862
  } = context;
44871
- const panelId = useUniqueId(idFromProps);
44863
+ const panelId = useUniqueId$1(idFromProps);
44872
44864
  const panelDataRef = useRef({
44873
44865
  callbacks: {
44874
44866
  onCollapse,
@@ -44893,7 +44885,7 @@ function PanelWithForwardedRef({
44893
44885
  if (!devWarningsRef.current.didLogMissingDefaultSizeWarning)
44894
44886
  ;
44895
44887
  }
44896
- useIsomorphicLayoutEffect(() => {
44888
+ useIsomorphicLayoutEffect$1(() => {
44897
44889
  const {
44898
44890
  callbacks,
44899
44891
  constraints
@@ -44916,7 +44908,7 @@ function PanelWithForwardedRef({
44916
44908
  reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
44917
44909
  }
44918
44910
  });
44919
- useIsomorphicLayoutEffect(() => {
44911
+ useIsomorphicLayoutEffect$1(() => {
44920
44912
  const panelData = panelDataRef.current;
44921
44913
  registerPanel(panelData);
44922
44914
  return () => {
@@ -44956,37 +44948,37 @@ function PanelWithForwardedRef({
44956
44948
  ...style2,
44957
44949
  ...styleFromProps
44958
44950
  },
44959
- [DATA_ATTRIBUTES.groupId]: groupId,
44960
- [DATA_ATTRIBUTES.panel]: "",
44961
- [DATA_ATTRIBUTES.panelCollapsible]: collapsible || void 0,
44962
- [DATA_ATTRIBUTES.panelId]: panelId,
44963
- [DATA_ATTRIBUTES.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
44951
+ [DATA_ATTRIBUTES$1.groupId]: groupId,
44952
+ [DATA_ATTRIBUTES$1.panel]: "",
44953
+ [DATA_ATTRIBUTES$1.panelCollapsible]: collapsible || void 0,
44954
+ [DATA_ATTRIBUTES$1.panelId]: panelId,
44955
+ [DATA_ATTRIBUTES$1.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
44964
44956
  });
44965
44957
  }
44966
- var Panel = forwardRef((props, ref) => createElement(PanelWithForwardedRef, {
44958
+ var Panel$1 = forwardRef((props, ref) => createElement(PanelWithForwardedRef$1, {
44967
44959
  ...props,
44968
44960
  forwardedRef: ref
44969
44961
  }));
44970
- PanelWithForwardedRef.displayName = "Panel";
44971
- Panel.displayName = "forwardRef(Panel)";
44972
- function isKeyDown(event) {
44962
+ PanelWithForwardedRef$1.displayName = "Panel";
44963
+ Panel$1.displayName = "forwardRef(Panel)";
44964
+ function isKeyDown$1(event) {
44973
44965
  return event.type === "keydown";
44974
44966
  }
44975
- function isPointerEvent(event) {
44967
+ function isPointerEvent$1(event) {
44976
44968
  return event.type.startsWith("pointer");
44977
44969
  }
44978
- function isMouseEvent(event) {
44970
+ function isMouseEvent$1(event) {
44979
44971
  return event.type.startsWith("mouse");
44980
44972
  }
44981
- function getResizeEventCoordinates(event) {
44982
- if (isPointerEvent(event)) {
44973
+ function getResizeEventCoordinates$1(event) {
44974
+ if (isPointerEvent$1(event)) {
44983
44975
  if (event.isPrimary) {
44984
44976
  return {
44985
44977
  x: event.clientX,
44986
44978
  y: event.clientY
44987
44979
  };
44988
44980
  }
44989
- } else if (isMouseEvent(event)) {
44981
+ } else if (isMouseEvent$1(event)) {
44990
44982
  return {
44991
44983
  x: event.clientX,
44992
44984
  y: event.clientY
@@ -44997,74 +44989,74 @@ function getResizeEventCoordinates(event) {
44997
44989
  y: Infinity
44998
44990
  };
44999
44991
  }
45000
- function getInputType() {
44992
+ function getInputType$1() {
45001
44993
  if (typeof matchMedia === "function") {
45002
44994
  return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
45003
44995
  }
45004
44996
  }
45005
- var EXCEEDED_HORIZONTAL_MIN = 1;
45006
- var EXCEEDED_HORIZONTAL_MAX = 2;
45007
- var EXCEEDED_VERTICAL_MIN = 4;
45008
- var EXCEEDED_VERTICAL_MAX = 8;
45009
- getInputType() === "coarse";
45010
- var panelConstraintFlags = /* @__PURE__ */ new Map();
45011
- function reportConstraintsViolation(resizeHandleId, flag) {
45012
- panelConstraintFlags.set(resizeHandleId, flag);
44997
+ var EXCEEDED_HORIZONTAL_MIN$1 = 1;
44998
+ var EXCEEDED_HORIZONTAL_MAX$1 = 2;
44999
+ var EXCEEDED_VERTICAL_MIN$1 = 4;
45000
+ var EXCEEDED_VERTICAL_MAX$1 = 8;
45001
+ getInputType$1() === "coarse";
45002
+ var panelConstraintFlags$1 = /* @__PURE__ */ new Map();
45003
+ function reportConstraintsViolation$1(resizeHandleId, flag) {
45004
+ panelConstraintFlags$1.set(resizeHandleId, flag);
45013
45005
  }
45014
45006
  new AbortController();
45015
- function useForceUpdate() {
45007
+ function useForceUpdate$1() {
45016
45008
  const [_, setCount] = useState(0);
45017
45009
  return useCallback(() => setCount((prevCount) => prevCount + 1), []);
45018
45010
  }
45019
- function assert(expectedCondition, message) {
45011
+ function assert$1(expectedCondition, message) {
45020
45012
  if (!expectedCondition) {
45021
45013
  console.error(message);
45022
45014
  throw Error(message);
45023
45015
  }
45024
45016
  }
45025
- function fuzzyCompareNumbers(actual, expected, fractionDigits = PRECISION) {
45017
+ function fuzzyCompareNumbers$1(actual, expected, fractionDigits = PRECISION$1) {
45026
45018
  if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
45027
45019
  return 0;
45028
45020
  } else {
45029
45021
  return actual > expected ? 1 : -1;
45030
45022
  }
45031
45023
  }
45032
- function fuzzyNumbersEqual$1(actual, expected, fractionDigits = PRECISION) {
45033
- return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
45024
+ function fuzzyNumbersEqual$1$1(actual, expected, fractionDigits = PRECISION$1) {
45025
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
45034
45026
  }
45035
- function fuzzyNumbersEqual(actual, expected, fractionDigits) {
45036
- return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
45027
+ function fuzzyNumbersEqual$2(actual, expected, fractionDigits) {
45028
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
45037
45029
  }
45038
- function fuzzyLayoutsEqual(actual, expected, fractionDigits) {
45030
+ function fuzzyLayoutsEqual$1(actual, expected, fractionDigits) {
45039
45031
  if (actual.length !== expected.length) {
45040
45032
  return false;
45041
45033
  }
45042
45034
  for (let index2 = 0; index2 < actual.length; index2++) {
45043
45035
  const actualSize = actual[index2];
45044
45036
  const expectedSize = expected[index2];
45045
- if (!fuzzyNumbersEqual(actualSize, expectedSize, fractionDigits)) {
45037
+ if (!fuzzyNumbersEqual$2(actualSize, expectedSize, fractionDigits)) {
45046
45038
  return false;
45047
45039
  }
45048
45040
  }
45049
45041
  return true;
45050
45042
  }
45051
- function resizePanel({
45043
+ function resizePanel$1({
45052
45044
  panelConstraints: panelConstraintsArray,
45053
45045
  panelIndex,
45054
45046
  size
45055
45047
  }) {
45056
45048
  const panelConstraints = panelConstraintsArray[panelIndex];
45057
- assert(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
45049
+ assert$1(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
45058
45050
  let {
45059
45051
  collapsedSize = 0,
45060
45052
  collapsible,
45061
45053
  maxSize = 100,
45062
45054
  minSize = 0
45063
45055
  } = panelConstraints;
45064
- if (fuzzyCompareNumbers(size, minSize) < 0) {
45056
+ if (fuzzyCompareNumbers$1(size, minSize) < 0) {
45065
45057
  if (collapsible) {
45066
45058
  const halfwayPoint = (collapsedSize + minSize) / 2;
45067
- if (fuzzyCompareNumbers(size, halfwayPoint) < 0) {
45059
+ if (fuzzyCompareNumbers$1(size, halfwayPoint) < 0) {
45068
45060
  size = collapsedSize;
45069
45061
  } else {
45070
45062
  size = minSize;
@@ -45074,10 +45066,10 @@ function resizePanel({
45074
45066
  }
45075
45067
  }
45076
45068
  size = Math.min(maxSize, size);
45077
- size = parseFloat(size.toFixed(PRECISION));
45069
+ size = parseFloat(size.toFixed(PRECISION$1));
45078
45070
  return size;
45079
45071
  }
45080
- function adjustLayoutByDelta({
45072
+ function adjustLayoutByDelta$1({
45081
45073
  delta,
45082
45074
  initialLayout,
45083
45075
  panelConstraints: panelConstraintsArray,
@@ -45085,20 +45077,20 @@ function adjustLayoutByDelta({
45085
45077
  prevLayout,
45086
45078
  trigger
45087
45079
  }) {
45088
- if (fuzzyNumbersEqual(delta, 0)) {
45080
+ if (fuzzyNumbersEqual$2(delta, 0)) {
45089
45081
  return initialLayout;
45090
45082
  }
45091
45083
  const nextLayout = [...initialLayout];
45092
45084
  const [firstPivotIndex, secondPivotIndex] = pivotIndices;
45093
- assert(firstPivotIndex != null, "Invalid first pivot index");
45094
- assert(secondPivotIndex != null, "Invalid second pivot index");
45085
+ assert$1(firstPivotIndex != null, "Invalid first pivot index");
45086
+ assert$1(secondPivotIndex != null, "Invalid second pivot index");
45095
45087
  let deltaApplied = 0;
45096
45088
  {
45097
45089
  if (trigger === "keyboard") {
45098
45090
  {
45099
45091
  const index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
45100
45092
  const panelConstraints = panelConstraintsArray[index2];
45101
- assert(panelConstraints, `Panel constraints not found for index ${index2}`);
45093
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
45102
45094
  const {
45103
45095
  collapsedSize = 0,
45104
45096
  collapsible,
@@ -45106,10 +45098,10 @@ function adjustLayoutByDelta({
45106
45098
  } = panelConstraints;
45107
45099
  if (collapsible) {
45108
45100
  const prevSize = initialLayout[index2];
45109
- assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
45110
- if (fuzzyNumbersEqual(prevSize, collapsedSize)) {
45101
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
45102
+ if (fuzzyNumbersEqual$2(prevSize, collapsedSize)) {
45111
45103
  const localDelta = minSize - prevSize;
45112
- if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
45104
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
45113
45105
  delta = delta < 0 ? 0 - localDelta : localDelta;
45114
45106
  }
45115
45107
  }
@@ -45118,7 +45110,7 @@ function adjustLayoutByDelta({
45118
45110
  {
45119
45111
  const index2 = delta < 0 ? firstPivotIndex : secondPivotIndex;
45120
45112
  const panelConstraints = panelConstraintsArray[index2];
45121
- assert(panelConstraints, `No panel constraints found for index ${index2}`);
45113
+ assert$1(panelConstraints, `No panel constraints found for index ${index2}`);
45122
45114
  const {
45123
45115
  collapsedSize = 0,
45124
45116
  collapsible,
@@ -45126,10 +45118,10 @@ function adjustLayoutByDelta({
45126
45118
  } = panelConstraints;
45127
45119
  if (collapsible) {
45128
45120
  const prevSize = initialLayout[index2];
45129
- assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
45130
- if (fuzzyNumbersEqual(prevSize, minSize)) {
45121
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
45122
+ if (fuzzyNumbersEqual$2(prevSize, minSize)) {
45131
45123
  const localDelta = prevSize - collapsedSize;
45132
- if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
45124
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
45133
45125
  delta = delta < 0 ? 0 - localDelta : localDelta;
45134
45126
  }
45135
45127
  }
@@ -45143,8 +45135,8 @@ function adjustLayoutByDelta({
45143
45135
  let maxAvailableDelta = 0;
45144
45136
  while (true) {
45145
45137
  const prevSize = initialLayout[index2];
45146
- assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
45147
- const maxSafeSize = resizePanel({
45138
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
45139
+ const maxSafeSize = resizePanel$1({
45148
45140
  panelConstraints: panelConstraintsArray,
45149
45141
  panelIndex: index2,
45150
45142
  size: 100
@@ -45165,14 +45157,14 @@ function adjustLayoutByDelta({
45165
45157
  while (index2 >= 0 && index2 < panelConstraintsArray.length) {
45166
45158
  const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
45167
45159
  const prevSize = initialLayout[index2];
45168
- assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
45160
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
45169
45161
  const unsafeSize = prevSize - deltaRemaining;
45170
- const safeSize = resizePanel({
45162
+ const safeSize = resizePanel$1({
45171
45163
  panelConstraints: panelConstraintsArray,
45172
45164
  panelIndex: index2,
45173
45165
  size: unsafeSize
45174
45166
  });
45175
- if (!fuzzyNumbersEqual(prevSize, safeSize)) {
45167
+ if (!fuzzyNumbersEqual$2(prevSize, safeSize)) {
45176
45168
  deltaApplied += prevSize - safeSize;
45177
45169
  nextLayout[index2] = safeSize;
45178
45170
  if (deltaApplied.toPrecision(3).localeCompare(Math.abs(delta).toPrecision(3), void 0, {
@@ -45188,38 +45180,38 @@ function adjustLayoutByDelta({
45188
45180
  }
45189
45181
  }
45190
45182
  }
45191
- if (fuzzyLayoutsEqual(prevLayout, nextLayout)) {
45183
+ if (fuzzyLayoutsEqual$1(prevLayout, nextLayout)) {
45192
45184
  return prevLayout;
45193
45185
  }
45194
45186
  {
45195
45187
  const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
45196
45188
  const prevSize = initialLayout[pivotIndex];
45197
- assert(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
45189
+ assert$1(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
45198
45190
  const unsafeSize = prevSize + deltaApplied;
45199
- const safeSize = resizePanel({
45191
+ const safeSize = resizePanel$1({
45200
45192
  panelConstraints: panelConstraintsArray,
45201
45193
  panelIndex: pivotIndex,
45202
45194
  size: unsafeSize
45203
45195
  });
45204
45196
  nextLayout[pivotIndex] = safeSize;
45205
- if (!fuzzyNumbersEqual(safeSize, unsafeSize)) {
45197
+ if (!fuzzyNumbersEqual$2(safeSize, unsafeSize)) {
45206
45198
  let deltaRemaining = unsafeSize - safeSize;
45207
45199
  const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
45208
45200
  let index2 = pivotIndex2;
45209
45201
  while (index2 >= 0 && index2 < panelConstraintsArray.length) {
45210
45202
  const prevSize2 = nextLayout[index2];
45211
- assert(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
45203
+ assert$1(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
45212
45204
  const unsafeSize2 = prevSize2 + deltaRemaining;
45213
- const safeSize2 = resizePanel({
45205
+ const safeSize2 = resizePanel$1({
45214
45206
  panelConstraints: panelConstraintsArray,
45215
45207
  panelIndex: index2,
45216
45208
  size: unsafeSize2
45217
45209
  });
45218
- if (!fuzzyNumbersEqual(prevSize2, safeSize2)) {
45210
+ if (!fuzzyNumbersEqual$2(prevSize2, safeSize2)) {
45219
45211
  deltaRemaining -= safeSize2 - prevSize2;
45220
45212
  nextLayout[index2] = safeSize2;
45221
45213
  }
45222
- if (fuzzyNumbersEqual(deltaRemaining, 0)) {
45214
+ if (fuzzyNumbersEqual$2(deltaRemaining, 0)) {
45223
45215
  break;
45224
45216
  }
45225
45217
  if (delta > 0) {
@@ -45231,12 +45223,12 @@ function adjustLayoutByDelta({
45231
45223
  }
45232
45224
  }
45233
45225
  const totalSize = nextLayout.reduce((total, size) => size + total, 0);
45234
- if (!fuzzyNumbersEqual(totalSize, 100)) {
45226
+ if (!fuzzyNumbersEqual$2(totalSize, 100)) {
45235
45227
  return prevLayout;
45236
45228
  }
45237
45229
  return nextLayout;
45238
45230
  }
45239
- function calculateAriaValues({
45231
+ function calculateAriaValues$1({
45240
45232
  layout,
45241
45233
  panelsArray,
45242
45234
  pivotIndices
@@ -45246,7 +45238,7 @@ function calculateAriaValues({
45246
45238
  let totalMinSize = 0;
45247
45239
  let totalMaxSize = 0;
45248
45240
  const firstIndex = pivotIndices[0];
45249
- assert(firstIndex != null, "No pivot index found");
45241
+ assert$1(firstIndex != null, "No pivot index found");
45250
45242
  panelsArray.forEach((panelData, index2) => {
45251
45243
  const {
45252
45244
  constraints
@@ -45272,19 +45264,19 @@ function calculateAriaValues({
45272
45264
  valueNow
45273
45265
  };
45274
45266
  }
45275
- function getResizeHandleElementsForGroup(groupId, scope = document) {
45276
- return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES.resizeHandleId}][data-panel-group-id="${groupId}"]`));
45267
+ function getResizeHandleElementsForGroup$1(groupId, scope = document) {
45268
+ return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES$1.resizeHandleId}][data-panel-group-id="${groupId}"]`));
45277
45269
  }
45278
- function getResizeHandleElementIndex(groupId, id, scope = document) {
45279
- const handles = getResizeHandleElementsForGroup(groupId, scope);
45280
- const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES.resizeHandleId) === id);
45270
+ function getResizeHandleElementIndex$1(groupId, id, scope = document) {
45271
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
45272
+ const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId) === id);
45281
45273
  return index2 !== null && index2 !== void 0 ? index2 : null;
45282
45274
  }
45283
- function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
45284
- const index2 = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
45275
+ function determinePivotIndices$1(groupId, dragHandleId, panelGroupElement) {
45276
+ const index2 = getResizeHandleElementIndex$1(groupId, dragHandleId, panelGroupElement);
45285
45277
  return index2 != null ? [index2, index2 + 1] : [-1, -1];
45286
45278
  }
45287
- function getPanelGroupElement(id, rootElement = document) {
45279
+ function getPanelGroupElement$1(id, rootElement = document) {
45288
45280
  var _dataset;
45289
45281
  if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) {
45290
45282
  return rootElement;
@@ -45295,23 +45287,23 @@ function getPanelGroupElement(id, rootElement = document) {
45295
45287
  }
45296
45288
  return null;
45297
45289
  }
45298
- function getResizeHandleElement(id, scope = document) {
45299
- const element2 = scope.querySelector(`[${DATA_ATTRIBUTES.resizeHandleId}="${id}"]`);
45290
+ function getResizeHandleElement$1(id, scope = document) {
45291
+ const element2 = scope.querySelector(`[${DATA_ATTRIBUTES$1.resizeHandleId}="${id}"]`);
45300
45292
  if (element2) {
45301
45293
  return element2;
45302
45294
  }
45303
45295
  return null;
45304
45296
  }
45305
- function getResizeHandlePanelIds(groupId, handleId, panelsArray, scope = document) {
45297
+ function getResizeHandlePanelIds$1(groupId, handleId, panelsArray, scope = document) {
45306
45298
  var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
45307
- const handle2 = getResizeHandleElement(handleId, scope);
45308
- const handles = getResizeHandleElementsForGroup(groupId, scope);
45299
+ const handle2 = getResizeHandleElement$1(handleId, scope);
45300
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
45309
45301
  const index2 = handle2 ? handles.indexOf(handle2) : -1;
45310
45302
  const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index2]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null;
45311
45303
  const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index2 + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null;
45312
45304
  return [idBefore, idAfter];
45313
45305
  }
45314
- function useWindowSplitterPanelGroupBehavior({
45306
+ function useWindowSplitterPanelGroupBehavior$1({
45315
45307
  committedValuesRef,
45316
45308
  eagerValuesRef,
45317
45309
  groupId,
@@ -45323,17 +45315,17 @@ function useWindowSplitterPanelGroupBehavior({
45323
45315
  const devWarningsRef = useRef({
45324
45316
  didWarnAboutMissingResizeHandle: false
45325
45317
  });
45326
- useIsomorphicLayoutEffect(() => {
45318
+ useIsomorphicLayoutEffect$1(() => {
45327
45319
  if (!panelGroupElement) {
45328
45320
  return;
45329
45321
  }
45330
- const resizeHandleElements = getResizeHandleElementsForGroup(groupId, panelGroupElement);
45322
+ const resizeHandleElements = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
45331
45323
  for (let index2 = 0; index2 < panelDataArray.length - 1; index2++) {
45332
45324
  const {
45333
45325
  valueMax,
45334
45326
  valueMin,
45335
45327
  valueNow
45336
- } = calculateAriaValues({
45328
+ } = calculateAriaValues$1({
45337
45329
  layout,
45338
45330
  panelsArray: panelDataArray,
45339
45331
  pivotIndices: [index2, index2 + 1]
@@ -45351,7 +45343,7 @@ function useWindowSplitterPanelGroupBehavior({
45351
45343
  }
45352
45344
  } else {
45353
45345
  const panelData = panelDataArray[index2];
45354
- assert(panelData, `No panel data found for index "${index2}"`);
45346
+ assert$1(panelData, `No panel data found for index "${index2}"`);
45355
45347
  resizeHandleElement.setAttribute("aria-controls", panelData.id);
45356
45348
  resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
45357
45349
  resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
@@ -45372,18 +45364,18 @@ function useWindowSplitterPanelGroupBehavior({
45372
45364
  return;
45373
45365
  }
45374
45366
  const eagerValues = eagerValuesRef.current;
45375
- assert(eagerValues, `Eager values not found`);
45367
+ assert$1(eagerValues, `Eager values not found`);
45376
45368
  const {
45377
45369
  panelDataArray: panelDataArray2
45378
45370
  } = eagerValues;
45379
- const groupElement = getPanelGroupElement(groupId, panelGroupElement);
45380
- assert(groupElement != null, `No group found for id "${groupId}"`);
45381
- const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
45382
- assert(handles, `No resize handles found for group id "${groupId}"`);
45371
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
45372
+ assert$1(groupElement != null, `No group found for id "${groupId}"`);
45373
+ const handles = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
45374
+ assert$1(handles, `No resize handles found for group id "${groupId}"`);
45383
45375
  const cleanupFunctions = handles.map((handle2) => {
45384
- const handleId = handle2.getAttribute(DATA_ATTRIBUTES.resizeHandleId);
45385
- assert(handleId, `Resize handle element has no handle id attribute`);
45386
- const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelDataArray2, panelGroupElement);
45376
+ const handleId = handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId);
45377
+ assert$1(handleId, `Resize handle element has no handle id attribute`);
45378
+ const [idBefore, idAfter] = getResizeHandlePanelIds$1(groupId, handleId, panelDataArray2, panelGroupElement);
45387
45379
  if (idBefore == null || idAfter == null) {
45388
45380
  return () => {
45389
45381
  };
@@ -45398,7 +45390,7 @@ function useWindowSplitterPanelGroupBehavior({
45398
45390
  const index2 = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
45399
45391
  if (index2 >= 0) {
45400
45392
  const panelData = panelDataArray2[index2];
45401
- assert(panelData, `No panel data found for index ${index2}`);
45393
+ assert$1(panelData, `No panel data found for index ${index2}`);
45402
45394
  const size = layout[index2];
45403
45395
  const {
45404
45396
  collapsedSize = 0,
@@ -45406,11 +45398,11 @@ function useWindowSplitterPanelGroupBehavior({
45406
45398
  minSize = 0
45407
45399
  } = panelData.constraints;
45408
45400
  if (size != null && collapsible) {
45409
- const nextLayout = adjustLayoutByDelta({
45410
- delta: fuzzyNumbersEqual(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
45401
+ const nextLayout = adjustLayoutByDelta$1({
45402
+ delta: fuzzyNumbersEqual$2(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
45411
45403
  initialLayout: layout,
45412
45404
  panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
45413
- pivotIndices: determinePivotIndices(groupId, handleId, panelGroupElement),
45405
+ pivotIndices: determinePivotIndices$1(groupId, handleId, panelGroupElement),
45414
45406
  prevLayout: layout,
45415
45407
  trigger: "keyboard"
45416
45408
  });
@@ -45433,7 +45425,7 @@ function useWindowSplitterPanelGroupBehavior({
45433
45425
  };
45434
45426
  }, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
45435
45427
  }
45436
- function areEqual(arrayA, arrayB) {
45428
+ function areEqual$1(arrayA, arrayB) {
45437
45429
  if (arrayA.length !== arrayB.length) {
45438
45430
  return false;
45439
45431
  }
@@ -45444,34 +45436,34 @@ function areEqual(arrayA, arrayB) {
45444
45436
  }
45445
45437
  return true;
45446
45438
  }
45447
- function getResizeEventCursorPosition(direction, event) {
45439
+ function getResizeEventCursorPosition$1(direction, event) {
45448
45440
  const isHorizontal = direction === "horizontal";
45449
45441
  const {
45450
45442
  x,
45451
45443
  y
45452
- } = getResizeEventCoordinates(event);
45444
+ } = getResizeEventCoordinates$1(event);
45453
45445
  return isHorizontal ? x : y;
45454
45446
  }
45455
- function calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement) {
45447
+ function calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement) {
45456
45448
  const isHorizontal = direction === "horizontal";
45457
- const handleElement = getResizeHandleElement(dragHandleId, panelGroupElement);
45458
- assert(handleElement, `No resize handle element found for id "${dragHandleId}"`);
45459
- const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
45460
- assert(groupId, `Resize handle element has no group id attribute`);
45449
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElement);
45450
+ assert$1(handleElement, `No resize handle element found for id "${dragHandleId}"`);
45451
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES$1.groupId);
45452
+ assert$1(groupId, `Resize handle element has no group id attribute`);
45461
45453
  let {
45462
45454
  initialCursorPosition
45463
45455
  } = initialDragState;
45464
- const cursorPosition = getResizeEventCursorPosition(direction, event);
45465
- const groupElement = getPanelGroupElement(groupId, panelGroupElement);
45466
- assert(groupElement, `No group element found for id "${groupId}"`);
45456
+ const cursorPosition = getResizeEventCursorPosition$1(direction, event);
45457
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
45458
+ assert$1(groupElement, `No group element found for id "${groupId}"`);
45467
45459
  const groupRect = groupElement.getBoundingClientRect();
45468
45460
  const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
45469
45461
  const offsetPixels = cursorPosition - initialCursorPosition;
45470
45462
  const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
45471
45463
  return offsetPercentage;
45472
45464
  }
45473
- function calculateDeltaPercentage(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
45474
- if (isKeyDown(event)) {
45465
+ function calculateDeltaPercentage$1(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
45466
+ if (isKeyDown$1(event)) {
45475
45467
  const isHorizontal = direction === "horizontal";
45476
45468
  let delta = 0;
45477
45469
  if (event.shiftKey) {
@@ -45507,10 +45499,10 @@ function calculateDeltaPercentage(event, dragHandleId, direction, initialDragSta
45507
45499
  if (initialDragState == null) {
45508
45500
  return 0;
45509
45501
  }
45510
- return calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement);
45502
+ return calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement);
45511
45503
  }
45512
45504
  }
45513
- function calculateUnsafeDefaultLayout({
45505
+ function calculateUnsafeDefaultLayout$1({
45514
45506
  panelDataArray
45515
45507
  }) {
45516
45508
  const layout = Array(panelDataArray.length);
@@ -45519,7 +45511,7 @@ function calculateUnsafeDefaultLayout({
45519
45511
  let remainingSize = 100;
45520
45512
  for (let index2 = 0; index2 < panelDataArray.length; index2++) {
45521
45513
  const panelConstraints = panelConstraintsArray[index2];
45522
- assert(panelConstraints, `Panel constraints not found for index ${index2}`);
45514
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
45523
45515
  const {
45524
45516
  defaultSize
45525
45517
  } = panelConstraints;
@@ -45531,7 +45523,7 @@ function calculateUnsafeDefaultLayout({
45531
45523
  }
45532
45524
  for (let index2 = 0; index2 < panelDataArray.length; index2++) {
45533
45525
  const panelConstraints = panelConstraintsArray[index2];
45534
- assert(panelConstraints, `Panel constraints not found for index ${index2}`);
45526
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
45535
45527
  const {
45536
45528
  defaultSize
45537
45529
  } = panelConstraints;
@@ -45546,10 +45538,10 @@ function calculateUnsafeDefaultLayout({
45546
45538
  }
45547
45539
  return layout;
45548
45540
  }
45549
- function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
45541
+ function callPanelCallbacks$1(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
45550
45542
  layout.forEach((size, index2) => {
45551
45543
  const panelData = panelsArray[index2];
45552
- assert(panelData, `Panel data not found for index ${index2}`);
45544
+ assert$1(panelData, `Panel data not found for index ${index2}`);
45553
45545
  const {
45554
45546
  callbacks,
45555
45547
  constraints,
@@ -45571,17 +45563,17 @@ function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
45571
45563
  onResize(size, lastNotifiedSize);
45572
45564
  }
45573
45565
  if (collapsible && (onCollapse || onExpand)) {
45574
- if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1(size, collapsedSize)) {
45566
+ if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1$1(size, collapsedSize)) {
45575
45567
  onExpand();
45576
45568
  }
45577
- if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1(size, collapsedSize)) {
45569
+ if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1$1(size, collapsedSize)) {
45578
45570
  onCollapse();
45579
45571
  }
45580
45572
  }
45581
45573
  }
45582
45574
  });
45583
45575
  }
45584
- function compareLayouts(a, b) {
45576
+ function compareLayouts$1(a, b) {
45585
45577
  if (a.length !== b.length) {
45586
45578
  return false;
45587
45579
  } else {
@@ -45593,7 +45585,7 @@ function compareLayouts(a, b) {
45593
45585
  }
45594
45586
  return true;
45595
45587
  }
45596
- function computePanelFlexBoxStyle({
45588
+ function computePanelFlexBoxStyle$1({
45597
45589
  defaultSize,
45598
45590
  dragState,
45599
45591
  layout,
@@ -45618,7 +45610,7 @@ function computePanelFlexBoxStyle({
45618
45610
  pointerEvents: dragState !== null ? "none" : void 0
45619
45611
  };
45620
45612
  }
45621
- function debounce(callback, durationMs = 10) {
45613
+ function debounce$1(callback, durationMs = 10) {
45622
45614
  let timeoutId = null;
45623
45615
  let callable = (...args) => {
45624
45616
  if (timeoutId !== null) {
@@ -45630,7 +45622,7 @@ function debounce(callback, durationMs = 10) {
45630
45622
  };
45631
45623
  return callable;
45632
45624
  }
45633
- function initializeDefaultStorage(storageObject) {
45625
+ function initializeDefaultStorage$1(storageObject) {
45634
45626
  try {
45635
45627
  if (typeof localStorage !== "undefined") {
45636
45628
  storageObject.getItem = (name2) => {
@@ -45649,10 +45641,10 @@ function initializeDefaultStorage(storageObject) {
45649
45641
  };
45650
45642
  }
45651
45643
  }
45652
- function getPanelGroupKey(autoSaveId) {
45644
+ function getPanelGroupKey$1(autoSaveId) {
45653
45645
  return `react-resizable-panels:${autoSaveId}`;
45654
45646
  }
45655
- function getPanelKey(panels2) {
45647
+ function getPanelKey$1(panels2) {
45656
45648
  return panels2.map((panel) => {
45657
45649
  const {
45658
45650
  constraints,
@@ -45667,9 +45659,9 @@ function getPanelKey(panels2) {
45667
45659
  }
45668
45660
  }).sort((a, b) => a.localeCompare(b)).join(",");
45669
45661
  }
45670
- function loadSerializedPanelGroupState(autoSaveId, storage) {
45662
+ function loadSerializedPanelGroupState$1(autoSaveId, storage) {
45671
45663
  try {
45672
- const panelGroupKey = getPanelGroupKey(autoSaveId);
45664
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
45673
45665
  const serialized = storage.getItem(panelGroupKey);
45674
45666
  if (serialized) {
45675
45667
  const parsed = JSON.parse(serialized);
@@ -45681,17 +45673,17 @@ function loadSerializedPanelGroupState(autoSaveId, storage) {
45681
45673
  }
45682
45674
  return null;
45683
45675
  }
45684
- function loadPanelGroupState(autoSaveId, panels2, storage) {
45676
+ function loadPanelGroupState$1(autoSaveId, panels2, storage) {
45685
45677
  var _loadSerializedPanelG, _state$panelKey;
45686
- const state = (_loadSerializedPanelG = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
45687
- const panelKey = getPanelKey(panels2);
45678
+ const state = (_loadSerializedPanelG = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
45679
+ const panelKey = getPanelKey$1(panels2);
45688
45680
  return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
45689
45681
  }
45690
- function savePanelGroupState(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
45682
+ function savePanelGroupState$1(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
45691
45683
  var _loadSerializedPanelG2;
45692
- const panelGroupKey = getPanelGroupKey(autoSaveId);
45693
- const panelKey = getPanelKey(panels2);
45694
- const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
45684
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
45685
+ const panelKey = getPanelKey$1(panels2);
45686
+ const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
45695
45687
  state[panelKey] = {
45696
45688
  expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
45697
45689
  layout: sizes
@@ -45710,7 +45702,7 @@ function validatePanelConstraints({
45710
45702
  {
45711
45703
  const warnings = [];
45712
45704
  const panelConstraints = panelConstraintsArray[panelIndex];
45713
- assert(panelConstraints, `No panel constraints found for index ${panelIndex}`);
45705
+ assert$1(panelConstraints, `No panel constraints found for index ${panelIndex}`);
45714
45706
  const {
45715
45707
  collapsedSize = 0,
45716
45708
  collapsible = false,
@@ -45747,7 +45739,7 @@ ${warnings.join(`
45747
45739
  }
45748
45740
  return true;
45749
45741
  }
45750
- function validatePanelGroupLayout({
45742
+ function validatePanelGroupLayout$1({
45751
45743
  layout: prevLayout,
45752
45744
  panelConstraints
45753
45745
  }) {
@@ -45755,13 +45747,13 @@ function validatePanelGroupLayout({
45755
45747
  const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
45756
45748
  if (nextLayout.length !== panelConstraints.length) {
45757
45749
  throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
45758
- } else if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
45750
+ } else if (!fuzzyNumbersEqual$2(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
45759
45751
  {
45760
45752
  console.warn(`WARNING: Invalid layout total size: ${nextLayout.map((size) => `${size}%`).join(", ")}. Layout normalization will be applied.`);
45761
45753
  }
45762
45754
  for (let index2 = 0; index2 < panelConstraints.length; index2++) {
45763
45755
  const unsafeSize = nextLayout[index2];
45764
- assert(unsafeSize != null, `No layout data found for index ${index2}`);
45756
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
45765
45757
  const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
45766
45758
  nextLayout[index2] = safeSize;
45767
45759
  }
@@ -45769,8 +45761,8 @@ function validatePanelGroupLayout({
45769
45761
  let remainingSize = 0;
45770
45762
  for (let index2 = 0; index2 < panelConstraints.length; index2++) {
45771
45763
  const unsafeSize = nextLayout[index2];
45772
- assert(unsafeSize != null, `No layout data found for index ${index2}`);
45773
- const safeSize = resizePanel({
45764
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
45765
+ const safeSize = resizePanel$1({
45774
45766
  panelConstraints,
45775
45767
  panelIndex: index2,
45776
45768
  size: unsafeSize
@@ -45780,12 +45772,12 @@ function validatePanelGroupLayout({
45780
45772
  nextLayout[index2] = safeSize;
45781
45773
  }
45782
45774
  }
45783
- if (!fuzzyNumbersEqual(remainingSize, 0)) {
45775
+ if (!fuzzyNumbersEqual$2(remainingSize, 0)) {
45784
45776
  for (let index2 = 0; index2 < panelConstraints.length; index2++) {
45785
45777
  const prevSize = nextLayout[index2];
45786
- assert(prevSize != null, `No layout data found for index ${index2}`);
45778
+ assert$1(prevSize != null, `No layout data found for index ${index2}`);
45787
45779
  const unsafeSize = prevSize + remainingSize;
45788
- const safeSize = resizePanel({
45780
+ const safeSize = resizePanel$1({
45789
45781
  panelConstraints,
45790
45782
  panelIndex: index2,
45791
45783
  size: unsafeSize
@@ -45793,7 +45785,7 @@ function validatePanelGroupLayout({
45793
45785
  if (prevSize !== safeSize) {
45794
45786
  remainingSize -= safeSize - prevSize;
45795
45787
  nextLayout[index2] = safeSize;
45796
- if (fuzzyNumbersEqual(remainingSize, 0)) {
45788
+ if (fuzzyNumbersEqual$2(remainingSize, 0)) {
45797
45789
  break;
45798
45790
  }
45799
45791
  }
@@ -45801,19 +45793,19 @@ function validatePanelGroupLayout({
45801
45793
  }
45802
45794
  return nextLayout;
45803
45795
  }
45804
- var LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100;
45805
- var defaultStorage = {
45796
+ var LOCAL_STORAGE_DEBOUNCE_INTERVAL$1 = 100;
45797
+ var defaultStorage$1 = {
45806
45798
  getItem: (name2) => {
45807
- initializeDefaultStorage(defaultStorage);
45808
- return defaultStorage.getItem(name2);
45799
+ initializeDefaultStorage$1(defaultStorage$1);
45800
+ return defaultStorage$1.getItem(name2);
45809
45801
  },
45810
45802
  setItem: (name2, value) => {
45811
- initializeDefaultStorage(defaultStorage);
45812
- defaultStorage.setItem(name2, value);
45803
+ initializeDefaultStorage$1(defaultStorage$1);
45804
+ defaultStorage$1.setItem(name2, value);
45813
45805
  }
45814
45806
  };
45815
- var debounceMap = {};
45816
- function PanelGroupWithForwardedRef({
45807
+ var debounceMap$1 = {};
45808
+ function PanelGroupWithForwardedRef$1({
45817
45809
  autoSaveId = null,
45818
45810
  children: children2,
45819
45811
  className: classNameFromProps = "",
@@ -45822,16 +45814,16 @@ function PanelGroupWithForwardedRef({
45822
45814
  id: idFromProps = null,
45823
45815
  onLayout = null,
45824
45816
  keyboardResizeBy = null,
45825
- storage = defaultStorage,
45817
+ storage = defaultStorage$1,
45826
45818
  style: styleFromProps,
45827
45819
  tagName: Type = "div",
45828
45820
  ...rest
45829
45821
  }) {
45830
- const groupId = useUniqueId(idFromProps);
45822
+ const groupId = useUniqueId$1(idFromProps);
45831
45823
  const panelGroupElementRef = useRef(null);
45832
45824
  const [dragState, setDragState] = useState(null);
45833
45825
  const [layout, setLayout] = useState([]);
45834
- const forceUpdate = useForceUpdate();
45826
+ const forceUpdate = useForceUpdate$1();
45835
45827
  const panelIdToLastNotifiedSizeMapRef = useRef({});
45836
45828
  const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
45837
45829
  const prevDeltaRef = useRef(0);
@@ -45870,21 +45862,21 @@ function PanelGroupWithForwardedRef({
45870
45862
  layout: prevLayout,
45871
45863
  panelDataArray
45872
45864
  } = eagerValuesRef.current;
45873
- const safeLayout = validatePanelGroupLayout({
45865
+ const safeLayout = validatePanelGroupLayout$1({
45874
45866
  layout: unsafeLayout,
45875
45867
  panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
45876
45868
  });
45877
- if (!areEqual(prevLayout, safeLayout)) {
45869
+ if (!areEqual$1(prevLayout, safeLayout)) {
45878
45870
  setLayout(safeLayout);
45879
45871
  eagerValuesRef.current.layout = safeLayout;
45880
45872
  if (onLayout2) {
45881
45873
  onLayout2(safeLayout);
45882
45874
  }
45883
- callPanelCallbacks(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
45875
+ callPanelCallbacks$1(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
45884
45876
  }
45885
45877
  }
45886
45878
  }), []);
45887
- useIsomorphicLayoutEffect(() => {
45879
+ useIsomorphicLayoutEffect$1(() => {
45888
45880
  committedValuesRef.current.autoSaveId = autoSaveId;
45889
45881
  committedValuesRef.current.direction = direction;
45890
45882
  committedValuesRef.current.dragState = dragState;
@@ -45892,7 +45884,7 @@ function PanelGroupWithForwardedRef({
45892
45884
  committedValuesRef.current.onLayout = onLayout;
45893
45885
  committedValuesRef.current.storage = storage;
45894
45886
  });
45895
- useWindowSplitterPanelGroupBehavior({
45887
+ useWindowSplitterPanelGroupBehavior$1({
45896
45888
  committedValuesRef,
45897
45889
  eagerValuesRef,
45898
45890
  groupId,
@@ -45909,10 +45901,10 @@ function PanelGroupWithForwardedRef({
45909
45901
  if (layout.length === 0 || layout.length !== panelDataArray.length) {
45910
45902
  return;
45911
45903
  }
45912
- let debouncedSave = debounceMap[autoSaveId];
45904
+ let debouncedSave = debounceMap$1[autoSaveId];
45913
45905
  if (debouncedSave == null) {
45914
- debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL);
45915
- debounceMap[autoSaveId] = debouncedSave;
45906
+ debouncedSave = debounce$1(savePanelGroupState$1, LOCAL_STORAGE_DEBOUNCE_INTERVAL$1);
45907
+ debounceMap$1[autoSaveId] = debouncedSave;
45916
45908
  }
45917
45909
  const clonedPanelDataArray = [...panelDataArray];
45918
45910
  const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
@@ -45934,7 +45926,7 @@ function PanelGroupWithForwardedRef({
45934
45926
  id
45935
45927
  }) => id);
45936
45928
  devWarningsRef.current.prevPanelIds = panelIds;
45937
- const panelsHaveChanged = prevPanelIds.length > 0 && !areEqual(prevPanelIds, panelIds);
45929
+ const panelsHaveChanged = prevPanelIds.length > 0 && !areEqual$1(prevPanelIds, panelIds);
45938
45930
  if (panelsHaveChanged) {
45939
45931
  if (panelDataArray.find(({
45940
45932
  idIsFromProps,
@@ -45949,7 +45941,7 @@ function PanelGroupWithForwardedRef({
45949
45941
  const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
45950
45942
  for (let panelIndex = 0; panelIndex < panelConstraints.length; panelIndex++) {
45951
45943
  const panelData = panelDataArray[panelIndex];
45952
- assert(panelData, `Panel data not found for index ${panelIndex}`);
45944
+ assert$1(panelData, `Panel data not found for index ${panelIndex}`);
45953
45945
  const isValid = validatePanelConstraints({
45954
45946
  panelConstraints,
45955
45947
  panelId: panelData.id,
@@ -45977,13 +45969,13 @@ function PanelGroupWithForwardedRef({
45977
45969
  collapsedSize = 0,
45978
45970
  panelSize,
45979
45971
  pivotIndices
45980
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
45981
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
45982
- if (!fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
45972
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
45973
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
45974
+ if (!fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
45983
45975
  panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
45984
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
45976
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
45985
45977
  const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
45986
- const nextLayout = adjustLayoutByDelta({
45978
+ const nextLayout = adjustLayoutByDelta$1({
45987
45979
  delta,
45988
45980
  initialLayout: prevLayout,
45989
45981
  panelConstraints: panelConstraintsArray,
@@ -45991,13 +45983,13 @@ function PanelGroupWithForwardedRef({
45991
45983
  prevLayout,
45992
45984
  trigger: "imperative-api"
45993
45985
  });
45994
- if (!compareLayouts(prevLayout, nextLayout)) {
45986
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
45995
45987
  setLayout(nextLayout);
45996
45988
  eagerValuesRef.current.layout = nextLayout;
45997
45989
  if (onLayout2) {
45998
45990
  onLayout2(nextLayout);
45999
45991
  }
46000
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
45992
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46001
45993
  }
46002
45994
  }
46003
45995
  }
@@ -46017,14 +46009,14 @@ function PanelGroupWithForwardedRef({
46017
46009
  panelSize = 0,
46018
46010
  minSize: minSizeFromProps = 0,
46019
46011
  pivotIndices
46020
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
46012
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
46021
46013
  const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
46022
- if (fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
46014
+ if (fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
46023
46015
  const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
46024
46016
  const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
46025
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
46017
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
46026
46018
  const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
46027
- const nextLayout = adjustLayoutByDelta({
46019
+ const nextLayout = adjustLayoutByDelta$1({
46028
46020
  delta,
46029
46021
  initialLayout: prevLayout,
46030
46022
  panelConstraints: panelConstraintsArray,
@@ -46032,13 +46024,13 @@ function PanelGroupWithForwardedRef({
46032
46024
  prevLayout,
46033
46025
  trigger: "imperative-api"
46034
46026
  });
46035
- if (!compareLayouts(prevLayout, nextLayout)) {
46027
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
46036
46028
  setLayout(nextLayout);
46037
46029
  eagerValuesRef.current.layout = nextLayout;
46038
46030
  if (onLayout2) {
46039
46031
  onLayout2(nextLayout);
46040
46032
  }
46041
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46033
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46042
46034
  }
46043
46035
  }
46044
46036
  }
@@ -46050,16 +46042,16 @@ function PanelGroupWithForwardedRef({
46050
46042
  } = eagerValuesRef.current;
46051
46043
  const {
46052
46044
  panelSize
46053
- } = panelDataHelper(panelDataArray, panelData, layout2);
46054
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46045
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
46046
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46055
46047
  return panelSize;
46056
46048
  }, []);
46057
46049
  const getPanelStyle = useCallback((panelData, defaultSize) => {
46058
46050
  const {
46059
46051
  panelDataArray
46060
46052
  } = eagerValuesRef.current;
46061
- const panelIndex = findPanelDataIndex(panelDataArray, panelData);
46062
- return computePanelFlexBoxStyle({
46053
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
46054
+ return computePanelFlexBoxStyle$1({
46063
46055
  defaultSize,
46064
46056
  dragState,
46065
46057
  layout,
@@ -46076,9 +46068,9 @@ function PanelGroupWithForwardedRef({
46076
46068
  collapsedSize = 0,
46077
46069
  collapsible,
46078
46070
  panelSize
46079
- } = panelDataHelper(panelDataArray, panelData, layout2);
46080
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46081
- return collapsible === true && fuzzyNumbersEqual$1(panelSize, collapsedSize);
46071
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
46072
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46073
+ return collapsible === true && fuzzyNumbersEqual$1$1(panelSize, collapsedSize);
46082
46074
  }, []);
46083
46075
  const isPanelExpanded = useCallback((panelData) => {
46084
46076
  const {
@@ -46089,9 +46081,9 @@ function PanelGroupWithForwardedRef({
46089
46081
  collapsedSize = 0,
46090
46082
  collapsible,
46091
46083
  panelSize
46092
- } = panelDataHelper(panelDataArray, panelData, layout2);
46093
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46094
- return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0;
46084
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
46085
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46086
+ return !collapsible || fuzzyCompareNumbers$1(panelSize, collapsedSize) > 0;
46095
46087
  }, []);
46096
46088
  const registerPanel = useCallback((panelData) => {
46097
46089
  const {
@@ -46114,7 +46106,7 @@ function PanelGroupWithForwardedRef({
46114
46106
  eagerValuesRef.current.panelDataArrayChanged = true;
46115
46107
  forceUpdate();
46116
46108
  }, [forceUpdate]);
46117
- useIsomorphicLayoutEffect(() => {
46109
+ useIsomorphicLayoutEffect$1(() => {
46118
46110
  if (eagerValuesRef.current.panelDataArrayChanged) {
46119
46111
  eagerValuesRef.current.panelDataArrayChanged = false;
46120
46112
  const {
@@ -46128,32 +46120,32 @@ function PanelGroupWithForwardedRef({
46128
46120
  } = eagerValuesRef.current;
46129
46121
  let unsafeLayout = null;
46130
46122
  if (autoSaveId2) {
46131
- const state = loadPanelGroupState(autoSaveId2, panelDataArray, storage2);
46123
+ const state = loadPanelGroupState$1(autoSaveId2, panelDataArray, storage2);
46132
46124
  if (state) {
46133
46125
  panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
46134
46126
  unsafeLayout = state.layout;
46135
46127
  }
46136
46128
  }
46137
46129
  if (unsafeLayout == null) {
46138
- unsafeLayout = calculateUnsafeDefaultLayout({
46130
+ unsafeLayout = calculateUnsafeDefaultLayout$1({
46139
46131
  panelDataArray
46140
46132
  });
46141
46133
  }
46142
- const nextLayout = validatePanelGroupLayout({
46134
+ const nextLayout = validatePanelGroupLayout$1({
46143
46135
  layout: unsafeLayout,
46144
46136
  panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
46145
46137
  });
46146
- if (!areEqual(prevLayout, nextLayout)) {
46138
+ if (!areEqual$1(prevLayout, nextLayout)) {
46147
46139
  setLayout(nextLayout);
46148
46140
  eagerValuesRef.current.layout = nextLayout;
46149
46141
  if (onLayout2) {
46150
46142
  onLayout2(nextLayout);
46151
46143
  }
46152
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46144
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46153
46145
  }
46154
46146
  }
46155
46147
  });
46156
- useIsomorphicLayoutEffect(() => {
46148
+ useIsomorphicLayoutEffect$1(() => {
46157
46149
  const eagerValues = eagerValuesRef.current;
46158
46150
  return () => {
46159
46151
  eagerValues.layout = [];
@@ -46188,33 +46180,33 @@ function PanelGroupWithForwardedRef({
46188
46180
  const {
46189
46181
  initialLayout
46190
46182
  } = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
46191
- const pivotIndices = determinePivotIndices(groupId2, dragHandleId, panelGroupElement2);
46192
- let delta = calculateDeltaPercentage(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
46183
+ const pivotIndices = determinePivotIndices$1(groupId2, dragHandleId, panelGroupElement2);
46184
+ let delta = calculateDeltaPercentage$1(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
46193
46185
  const isHorizontal = direction2 === "horizontal";
46194
46186
  if (isHorizontal && isRTL) {
46195
46187
  delta = -delta;
46196
46188
  }
46197
46189
  const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
46198
- const nextLayout = adjustLayoutByDelta({
46190
+ const nextLayout = adjustLayoutByDelta$1({
46199
46191
  delta,
46200
46192
  initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
46201
46193
  panelConstraints,
46202
46194
  pivotIndices,
46203
46195
  prevLayout,
46204
- trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
46196
+ trigger: isKeyDown$1(event) ? "keyboard" : "mouse-or-touch"
46205
46197
  });
46206
- const layoutChanged = !compareLayouts(prevLayout, nextLayout);
46207
- if (isPointerEvent(event) || isMouseEvent(event)) {
46198
+ const layoutChanged = !compareLayouts$1(prevLayout, nextLayout);
46199
+ if (isPointerEvent$1(event) || isMouseEvent$1(event)) {
46208
46200
  if (prevDeltaRef.current != delta) {
46209
46201
  prevDeltaRef.current = delta;
46210
46202
  if (!layoutChanged && delta !== 0) {
46211
46203
  if (isHorizontal) {
46212
- reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
46204
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN$1 : EXCEEDED_HORIZONTAL_MAX$1);
46213
46205
  } else {
46214
- reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
46206
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN$1 : EXCEEDED_VERTICAL_MAX$1);
46215
46207
  }
46216
46208
  } else {
46217
- reportConstraintsViolation(dragHandleId, 0);
46209
+ reportConstraintsViolation$1(dragHandleId, 0);
46218
46210
  }
46219
46211
  }
46220
46212
  }
@@ -46224,7 +46216,7 @@ function PanelGroupWithForwardedRef({
46224
46216
  if (onLayout2) {
46225
46217
  onLayout2(nextLayout);
46226
46218
  }
46227
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46219
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46228
46220
  }
46229
46221
  };
46230
46222
  }, []);
@@ -46240,11 +46232,11 @@ function PanelGroupWithForwardedRef({
46240
46232
  const {
46241
46233
  panelSize,
46242
46234
  pivotIndices
46243
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
46244
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46245
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
46235
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
46236
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
46237
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
46246
46238
  const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
46247
- const nextLayout = adjustLayoutByDelta({
46239
+ const nextLayout = adjustLayoutByDelta$1({
46248
46240
  delta,
46249
46241
  initialLayout: prevLayout,
46250
46242
  panelConstraints: panelConstraintsArray,
@@ -46252,13 +46244,13 @@ function PanelGroupWithForwardedRef({
46252
46244
  prevLayout,
46253
46245
  trigger: "imperative-api"
46254
46246
  });
46255
- if (!compareLayouts(prevLayout, nextLayout)) {
46247
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
46256
46248
  setLayout(nextLayout);
46257
46249
  eagerValuesRef.current.layout = nextLayout;
46258
46250
  if (onLayout2) {
46259
46251
  onLayout2(nextLayout);
46260
46252
  }
46261
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46253
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
46262
46254
  }
46263
46255
  }, []);
46264
46256
  const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
@@ -46278,12 +46270,12 @@ function PanelGroupWithForwardedRef({
46278
46270
  } = panelData.constraints;
46279
46271
  const {
46280
46272
  panelSize: prevPanelSize
46281
- } = panelDataHelper(panelDataArray, panelData, layout2);
46273
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
46282
46274
  if (prevPanelSize == null) {
46283
46275
  return;
46284
46276
  }
46285
- if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
46286
- if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) {
46277
+ if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1$1(prevPanelSize, prevCollapsedSize)) {
46278
+ if (!fuzzyNumbersEqual$1$1(prevCollapsedSize, nextCollapsedSize)) {
46287
46279
  resizePanel2(panelData, nextCollapsedSize);
46288
46280
  }
46289
46281
  } else if (prevPanelSize < nextMinSize) {
@@ -46302,9 +46294,9 @@ function PanelGroupWithForwardedRef({
46302
46294
  if (!panelGroupElementRef.current) {
46303
46295
  return;
46304
46296
  }
46305
- const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
46306
- assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
46307
- const initialCursorPosition = getResizeEventCursorPosition(direction2, event);
46297
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElementRef.current);
46298
+ assert$1(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
46299
+ const initialCursorPosition = getResizeEventCursorPosition$1(direction2, event);
46308
46300
  setDragState({
46309
46301
  dragHandleId,
46310
46302
  dragHandleRect: handleElement.getBoundingClientRect(),
@@ -46319,7 +46311,7 @@ function PanelGroupWithForwardedRef({
46319
46311
  const {
46320
46312
  panelDataArray
46321
46313
  } = eagerValuesRef.current;
46322
- const index2 = findPanelDataIndex(panelDataArray, panelData);
46314
+ const index2 = findPanelDataIndex$1(panelDataArray, panelData);
46323
46315
  if (index2 >= 0) {
46324
46316
  panelDataArray.splice(index2, 1);
46325
46317
  delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
@@ -46353,7 +46345,7 @@ function PanelGroupWithForwardedRef({
46353
46345
  overflow: "hidden",
46354
46346
  width: "100%"
46355
46347
  };
46356
- return createElement(PanelGroupContext.Provider, {
46348
+ return createElement(PanelGroupContext$1.Provider, {
46357
46349
  value: context
46358
46350
  }, createElement(Type, {
46359
46351
  ...rest,
@@ -46365,22 +46357,22 @@ function PanelGroupWithForwardedRef({
46365
46357
  ...style2,
46366
46358
  ...styleFromProps
46367
46359
  },
46368
- [DATA_ATTRIBUTES.group]: "",
46369
- [DATA_ATTRIBUTES.groupDirection]: direction,
46370
- [DATA_ATTRIBUTES.groupId]: groupId
46360
+ [DATA_ATTRIBUTES$1.group]: "",
46361
+ [DATA_ATTRIBUTES$1.groupDirection]: direction,
46362
+ [DATA_ATTRIBUTES$1.groupId]: groupId
46371
46363
  }));
46372
46364
  }
46373
- var PanelGroup = forwardRef((props2, ref) => createElement(PanelGroupWithForwardedRef, {
46365
+ var PanelGroup$1 = forwardRef((props2, ref) => createElement(PanelGroupWithForwardedRef$1, {
46374
46366
  ...props2,
46375
46367
  forwardedRef: ref
46376
46368
  }));
46377
- PanelGroupWithForwardedRef.displayName = "PanelGroup";
46378
- PanelGroup.displayName = "forwardRef(PanelGroup)";
46379
- function findPanelDataIndex(panelDataArray, panelData) {
46369
+ PanelGroupWithForwardedRef$1.displayName = "PanelGroup";
46370
+ PanelGroup$1.displayName = "forwardRef(PanelGroup)";
46371
+ function findPanelDataIndex$1(panelDataArray, panelData) {
46380
46372
  return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
46381
46373
  }
46382
- function panelDataHelper(panelDataArray, panelData, layout) {
46383
- const panelIndex = findPanelDataIndex(panelDataArray, panelData);
46374
+ function panelDataHelper$1(panelDataArray, panelData, layout) {
46375
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
46384
46376
  const isLastPanel = panelIndex === panelDataArray.length - 1;
46385
46377
  const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
46386
46378
  const panelSize = layout[panelIndex];
@@ -46430,14 +46422,14 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
46430
46422
  const y2 = o2.length, w2 = 2 * u2;
46431
46423
  let x2;
46432
46424
  x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
46433
- const C = React2__default.useId().replace(/:/g, "_");
46425
+ const C2 = React2__default.useId().replace(/:/g, "_");
46434
46426
  return jsxs(Fragment, { children: [
46435
46427
  y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
46436
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
46428
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
46437
46429
  width: 100%;
46438
46430
  }
46439
46431
  @container (min-width: ${w2}px) {
46440
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
46432
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
46441
46433
  width: 50%;
46442
46434
  }
46443
46435
  }
@@ -46452,41 +46444,41 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
46452
46444
  a3 < o3 && (o3 = a3, r2 = i2);
46453
46445
  }
46454
46446
  m2(r2);
46455
- }, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
46447
+ }, "data-panel-count": y2, "data-carousel-id": C2, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
46456
46448
  ] });
46457
46449
  });
46458
46450
  M.displayName = "SnapCarousel";
46459
- var se;
46451
+ var se$1;
46460
46452
  var ce;
46461
- (ce = se || (se = {})).DragStart = "dragStart", ce.DragMove = "dragMove", ce.DragEnd = "dragEnd", ce.DragCancel = "dragCancel", ce.DragOver = "dragOver", ce.RegisterDroppable = "registerDroppable", ce.SetDroppableDisabled = "setDroppableDisabled", ce.UnregisterDroppable = "unregisterDroppable";
46453
+ (ce = se$1 || (se$1 = {})).DragStart = "dragStart", ce.DragMove = "dragMove", ce.DragEnd = "dragEnd", ce.DragCancel = "dragCancel", ce.DragOver = "dragOver", ce.RegisterDroppable = "registerDroppable", ce.SetDroppableDisabled = "setDroppableDisabled", ce.UnregisterDroppable = "unregisterDroppable";
46462
46454
  var ue = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
46463
- var Te;
46455
+ var Te$1;
46464
46456
  var ke;
46465
- (ke = Te || (Te = {}))[ke.Forward = 1] = "Forward", ke[ke.Backward = -1] = "Backward";
46466
- var je;
46467
- var He;
46468
- var Ke;
46457
+ (ke = Te$1 || (Te$1 = {}))[ke.Forward = 1] = "Forward", ke[ke.Backward = -1] = "Backward";
46458
+ var je$1;
46459
+ var He$1;
46460
+ var Ke$1;
46469
46461
  var Ue;
46470
- (He = je || (je = {})).Click = "click", He.DragStart = "dragstart", He.Keydown = "keydown", He.ContextMenu = "contextmenu", He.Resize = "resize", He.SelectionChange = "selectionchange", He.VisibilityChange = "visibilitychange", (Ue = Ke || (Ke = {})).Space = "Space", Ue.Down = "ArrowDown", Ue.Right = "ArrowRight", Ue.Left = "ArrowLeft", Ue.Up = "ArrowUp", Ue.Esc = "Escape", Ue.Enter = "Enter", Ue.Tab = "Tab";
46471
- ({ start: [Ke.Space, Ke.Enter], cancel: [Ke.Esc], end: [Ke.Space, Ke.Enter, Ke.Tab] });
46472
- var ot;
46462
+ (He$1 = je$1 || (je$1 = {})).Click = "click", He$1.DragStart = "dragstart", He$1.Keydown = "keydown", He$1.ContextMenu = "contextmenu", He$1.Resize = "resize", He$1.SelectionChange = "selectionchange", He$1.VisibilityChange = "visibilitychange", (Ue = Ke$1 || (Ke$1 = {})).Space = "Space", Ue.Down = "ArrowDown", Ue.Right = "ArrowRight", Ue.Left = "ArrowLeft", Ue.Up = "ArrowUp", Ue.Esc = "Escape", Ue.Enter = "Enter", Ue.Tab = "Tab";
46463
+ ({ start: [Ke$1.Space, Ke$1.Enter], cancel: [Ke$1.Esc], end: [Ke$1.Space, Ke$1.Enter, Ke$1.Tab] });
46464
+ var ot$1;
46473
46465
  var it;
46474
- (it = ot || (ot = {}))[it.RightClick = 2] = "RightClick";
46475
- var lt;
46476
- var st;
46477
- var ct;
46466
+ (it = ot$1 || (ot$1 = {}))[it.RightClick = 2] = "RightClick";
46467
+ var lt$1;
46468
+ var st$1;
46469
+ var ct$1;
46478
46470
  var dt;
46479
- (st = lt || (lt = {}))[st.Pointer = 0] = "Pointer", st[st.DraggableRect = 1] = "DraggableRect", (dt = ct || (ct = {}))[dt.TreeOrder = 0] = "TreeOrder", dt[dt.ReversedTreeOrder = 1] = "ReversedTreeOrder";
46480
- ({ x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } });
46481
- var ht;
46482
- var mt;
46471
+ (st$1 = lt$1 || (lt$1 = {}))[st$1.Pointer = 0] = "Pointer", st$1[st$1.DraggableRect = 1] = "DraggableRect", (dt = ct$1 || (ct$1 = {}))[dt.TreeOrder = 0] = "TreeOrder", dt[dt.ReversedTreeOrder = 1] = "ReversedTreeOrder";
46472
+ ({ x: { [Te$1.Backward]: false, [Te$1.Forward]: false }, y: { [Te$1.Backward]: false, [Te$1.Forward]: false } });
46473
+ var ht$1;
46474
+ var mt$1;
46483
46475
  var ft;
46484
- (mt = ht || (ht = {}))[mt.Always = 0] = "Always", mt[mt.BeforeDragging = 1] = "BeforeDragging", mt[mt.WhileDragging = 2] = "WhileDragging", (ft || (ft = {})).Optimized = "optimized";
46485
- ({ droppable: { strategy: ht.WhileDragging, frequency: ft.Optimized } });
46476
+ (mt$1 = ht$1 || (ht$1 = {}))[mt$1.Always = 0] = "Always", mt$1[mt$1.BeforeDragging = 1] = "BeforeDragging", mt$1[mt$1.WhileDragging = 2] = "WhileDragging", (ft || (ft = {})).Optimized = "optimized";
46477
+ ({ droppable: { strategy: ht$1.WhileDragging, frequency: ft.Optimized } });
46486
46478
  /* @__PURE__ */ createContext({ ...ue, scaleX: 1, scaleY: 1 });
46487
- var Bt;
46479
+ var Bt$1;
46488
46480
  var Ot;
46489
- (Ot = Bt || (Bt = {}))[Ot.Uninitialized = 0] = "Uninitialized", Ot[Ot.Initializing = 1] = "Initializing", Ot[Ot.Initialized = 2] = "Initialized";
46481
+ (Ot = Bt$1 || (Bt$1 = {}))[Ot.Uninitialized = 0] = "Uninitialized", Ot[Ot.Initializing = 1] = "Initializing", Ot[Ot.Initialized = 2] = "Initialized";
46490
46482
  var Vt;
46491
46483
  (() => {
46492
46484
  if (typeof window != "undefined") {
@@ -46509,7 +46501,8 @@ var DocumentView = ({
46509
46501
  repositoryInfo,
46510
46502
  fontSizeScale,
46511
46503
  theme: theme2,
46512
- transparentBackground = false
46504
+ transparentBackground = false,
46505
+ editable = false
46513
46506
  }) => {
46514
46507
  const containerRef = useRef(null);
46515
46508
  const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
@@ -46541,7 +46534,8 @@ var DocumentView = ({
46541
46534
  fontSizeScale,
46542
46535
  handlePromptCopy,
46543
46536
  repositoryInfo,
46544
- transparentBackground
46537
+ transparentBackground,
46538
+ editable
46545
46539
  })));
46546
46540
  };
46547
46541
  const formatDate$1 = (dateString) => {
@@ -46571,305 +46565,2367 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
46571
46565
  setOwner(event.payload.owner);
46572
46566
  setRepo(event.payload.repo);
46573
46567
  };
46574
- const unsubscribe = events.on("issue:selected", handleIssueSelected);
46575
- return () => {
46576
- if (typeof unsubscribe === "function") {
46577
- unsubscribe();
46578
- }
46568
+ const unsubscribe = events.on("issue:selected", handleIssueSelected);
46569
+ return () => {
46570
+ if (typeof unsubscribe === "function") {
46571
+ unsubscribe();
46572
+ }
46573
+ };
46574
+ }, [events]);
46575
+ const handleBack = () => {
46576
+ setSelectedIssue(null);
46577
+ setOwner("");
46578
+ setRepo("");
46579
+ if (events) {
46580
+ events.emit({
46581
+ type: "issue:deselected",
46582
+ source: "github-issue-detail-panel",
46583
+ timestamp: Date.now(),
46584
+ payload: {}
46585
+ });
46586
+ }
46587
+ };
46588
+ const containerStyle = {
46589
+ display: "flex",
46590
+ flexDirection: "column",
46591
+ height: "100%",
46592
+ backgroundColor: theme2.colors.background,
46593
+ overflow: "hidden"
46594
+ };
46595
+ if (!selectedIssue) {
46596
+ return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
46597
+ "div",
46598
+ {
46599
+ style: {
46600
+ flex: 1,
46601
+ display: "flex",
46602
+ flexDirection: "column",
46603
+ alignItems: "center",
46604
+ justifyContent: "center",
46605
+ gap: "16px",
46606
+ padding: "24px",
46607
+ textAlign: "center"
46608
+ },
46609
+ children: [
46610
+ /* @__PURE__ */ jsx(Github, { size: 48, style: { color: theme2.colors.textMuted } }),
46611
+ /* @__PURE__ */ jsxs("div", { children: [
46612
+ /* @__PURE__ */ jsx(
46613
+ "h3",
46614
+ {
46615
+ style: {
46616
+ margin: 0,
46617
+ marginBottom: "8px",
46618
+ fontFamily: theme2.fonts.heading,
46619
+ fontSize: theme2.fontSizes[3],
46620
+ fontWeight: 600,
46621
+ color: theme2.colors.text
46622
+ },
46623
+ children: "No Issue Selected"
46624
+ }
46625
+ ),
46626
+ /* @__PURE__ */ jsx(
46627
+ "p",
46628
+ {
46629
+ style: {
46630
+ margin: 0,
46631
+ fontFamily: theme2.fonts.body,
46632
+ fontSize: theme2.fontSizes[1],
46633
+ color: theme2.colors.textSecondary,
46634
+ lineHeight: 1.5
46635
+ },
46636
+ children: "Click on an issue in the Issues panel to view its details."
46637
+ }
46638
+ )
46639
+ ] })
46640
+ ]
46641
+ }
46642
+ ) });
46643
+ }
46644
+ const isOpen = selectedIssue.state === "open";
46645
+ const statusColor = isOpen ? theme2.colors.success || "#22c55e" : theme2.colors.error || "#ef4444";
46646
+ const statusBg = `${statusColor}20`;
46647
+ const statusLabel = isOpen ? "Open" : "Closed";
46648
+ return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
46649
+ /* @__PURE__ */ jsxs(
46650
+ "div",
46651
+ {
46652
+ style: {
46653
+ height: "40px",
46654
+ minHeight: "40px",
46655
+ padding: "0 12px",
46656
+ borderBottom: `1px solid ${theme2.colors.border}`,
46657
+ backgroundColor: theme2.colors.backgroundSecondary,
46658
+ display: "flex",
46659
+ alignItems: "center",
46660
+ gap: "12px",
46661
+ boxSizing: "border-box"
46662
+ },
46663
+ children: [
46664
+ /* @__PURE__ */ jsxs(
46665
+ "span",
46666
+ {
46667
+ style: {
46668
+ fontFamily: theme2.fonts.monospace,
46669
+ fontSize: theme2.fontSizes[0],
46670
+ color: theme2.colors.textSecondary
46671
+ },
46672
+ children: [
46673
+ "#",
46674
+ selectedIssue.number
46675
+ ]
46676
+ }
46677
+ ),
46678
+ /* @__PURE__ */ jsx(
46679
+ "span",
46680
+ {
46681
+ style: {
46682
+ display: "inline-flex",
46683
+ alignItems: "center",
46684
+ gap: "6px",
46685
+ padding: "4px 10px",
46686
+ borderRadius: "999px",
46687
+ backgroundColor: statusBg,
46688
+ color: statusColor,
46689
+ fontFamily: theme2.fonts.heading,
46690
+ fontSize: theme2.fontSizes[0],
46691
+ fontWeight: 600,
46692
+ textTransform: "uppercase"
46693
+ },
46694
+ children: statusLabel
46695
+ }
46696
+ ),
46697
+ /* @__PURE__ */ jsxs(
46698
+ "span",
46699
+ {
46700
+ style: {
46701
+ color: theme2.colors.textSecondary,
46702
+ fontSize: theme2.fontSizes[0],
46703
+ fontFamily: theme2.fonts.body
46704
+ },
46705
+ children: [
46706
+ "by ",
46707
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: selectedIssue.user.login }),
46708
+ " ",
46709
+ formatDate$1(selectedIssue.created_at)
46710
+ ]
46711
+ }
46712
+ ),
46713
+ selectedIssue.comments > 0 && /* @__PURE__ */ jsxs(
46714
+ "span",
46715
+ {
46716
+ style: {
46717
+ display: "inline-flex",
46718
+ alignItems: "center",
46719
+ gap: "4px",
46720
+ color: theme2.colors.textSecondary,
46721
+ fontSize: theme2.fontSizes[0]
46722
+ },
46723
+ children: [
46724
+ /* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
46725
+ selectedIssue.comments
46726
+ ]
46727
+ }
46728
+ ),
46729
+ selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
46730
+ "span",
46731
+ {
46732
+ style: {
46733
+ display: "inline-flex",
46734
+ alignItems: "center",
46735
+ gap: "4px",
46736
+ color: theme2.colors.textSecondary,
46737
+ fontSize: theme2.fontSizes[0],
46738
+ fontFamily: theme2.fonts.body
46739
+ },
46740
+ children: [
46741
+ "assigned to",
46742
+ " ",
46743
+ selectedIssue.assignees.map((assignee, index2) => /* @__PURE__ */ jsxs("span", { children: [
46744
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: assignee.login }),
46745
+ index2 < selectedIssue.assignees.length - 1 && ", "
46746
+ ] }, assignee.login))
46747
+ ]
46748
+ }
46749
+ ),
46750
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
46751
+ /* @__PURE__ */ jsx(
46752
+ "a",
46753
+ {
46754
+ href: selectedIssue.html_url,
46755
+ target: "_blank",
46756
+ rel: "noopener noreferrer",
46757
+ title: "View on GitHub",
46758
+ style: {
46759
+ display: "inline-flex",
46760
+ alignItems: "center",
46761
+ justifyContent: "center",
46762
+ width: "28px",
46763
+ height: "28px",
46764
+ padding: 0,
46765
+ border: `1px solid ${theme2.colors.border}`,
46766
+ borderRadius: "6px",
46767
+ backgroundColor: theme2.colors.background,
46768
+ color: theme2.colors.textSecondary,
46769
+ textDecoration: "none"
46770
+ },
46771
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
46772
+ }
46773
+ ),
46774
+ /* @__PURE__ */ jsx(
46775
+ "button",
46776
+ {
46777
+ type: "button",
46778
+ onClick: handleBack,
46779
+ title: "Close",
46780
+ style: {
46781
+ display: "inline-flex",
46782
+ alignItems: "center",
46783
+ justifyContent: "center",
46784
+ width: "28px",
46785
+ height: "28px",
46786
+ padding: 0,
46787
+ border: `1px solid ${theme2.colors.border}`,
46788
+ borderRadius: "6px",
46789
+ backgroundColor: theme2.colors.background,
46790
+ color: theme2.colors.textSecondary,
46791
+ cursor: "pointer"
46792
+ },
46793
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
46794
+ }
46795
+ )
46796
+ ]
46797
+ }
46798
+ ),
46799
+ /* @__PURE__ */ jsx(
46800
+ "div",
46801
+ {
46802
+ style: {
46803
+ padding: "16px",
46804
+ borderBottom: `1px solid ${theme2.colors.border}`
46805
+ },
46806
+ children: /* @__PURE__ */ jsx(
46807
+ "h1",
46808
+ {
46809
+ style: {
46810
+ margin: 0,
46811
+ fontFamily: theme2.fonts.heading,
46812
+ fontSize: theme2.fontSizes[4] || 20,
46813
+ fontWeight: 600,
46814
+ color: theme2.colors.text,
46815
+ lineHeight: 1.3
46816
+ },
46817
+ children: selectedIssue.title
46818
+ }
46819
+ )
46820
+ }
46821
+ ),
46822
+ /* @__PURE__ */ jsx(
46823
+ "div",
46824
+ {
46825
+ style: {
46826
+ flex: 1,
46827
+ overflow: "auto"
46828
+ },
46829
+ children: selectedIssue.body ? /* @__PURE__ */ jsx(
46830
+ DocumentView,
46831
+ {
46832
+ content: selectedIssue.body,
46833
+ theme: theme2,
46834
+ maxWidth: "100%",
46835
+ transparentBackground: true
46836
+ }
46837
+ ) : /* @__PURE__ */ jsx(
46838
+ "div",
46839
+ {
46840
+ style: {
46841
+ padding: "40px",
46842
+ textAlign: "center",
46843
+ color: theme2.colors.textMuted,
46844
+ fontFamily: theme2.fonts.body,
46845
+ fontSize: theme2.fontSizes[1],
46846
+ fontStyle: "italic"
46847
+ },
46848
+ children: "No description provided."
46849
+ }
46850
+ )
46851
+ }
46852
+ )
46853
+ ] });
46854
+ };
46855
+ const GitHubIssueDetailPanel = (props) => {
46856
+ return /* @__PURE__ */ jsx(GitHubIssueDetailPanelContent, { ...props });
46857
+ };
46858
+ const GitHubIssueDetailPanelMetadata = {
46859
+ id: "github-issue-detail",
46860
+ name: "GitHub Issue Details",
46861
+ description: "View detailed information about a GitHub issue",
46862
+ icon: "circle-dot",
46863
+ version: "0.1.0",
46864
+ slices: [],
46865
+ surfaces: ["panel"]
46866
+ };
46867
+ const PanelGroupContext = createContext(null);
46868
+ PanelGroupContext.displayName = "PanelGroupContext";
46869
+ const DATA_ATTRIBUTES = {
46870
+ group: "data-panel-group",
46871
+ groupDirection: "data-panel-group-direction",
46872
+ groupId: "data-panel-group-id",
46873
+ panel: "data-panel",
46874
+ panelCollapsible: "data-panel-collapsible",
46875
+ panelId: "data-panel-id",
46876
+ panelSize: "data-panel-size",
46877
+ resizeHandleId: "data-panel-resize-handle-id"
46878
+ };
46879
+ const PRECISION = 10;
46880
+ const useIsomorphicLayoutEffect = useLayoutEffect;
46881
+ const useId = React2["useId".toString()];
46882
+ const wrappedUseId = typeof useId === "function" ? useId : () => null;
46883
+ let counter = 0;
46884
+ function useUniqueId(idFromParams = null) {
46885
+ const idFromUseId = wrappedUseId();
46886
+ const idRef = useRef(idFromParams || idFromUseId || null);
46887
+ if (idRef.current === null) {
46888
+ idRef.current = "" + counter++;
46889
+ }
46890
+ return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
46891
+ }
46892
+ function PanelWithForwardedRef({
46893
+ children: children2,
46894
+ className: classNameFromProps = "",
46895
+ collapsedSize,
46896
+ collapsible,
46897
+ defaultSize,
46898
+ forwardedRef,
46899
+ id: idFromProps,
46900
+ maxSize,
46901
+ minSize,
46902
+ onCollapse,
46903
+ onExpand,
46904
+ onResize,
46905
+ order: order2,
46906
+ style: styleFromProps,
46907
+ tagName: Type = "div",
46908
+ ...rest
46909
+ }) {
46910
+ const context = useContext(PanelGroupContext);
46911
+ if (context === null) {
46912
+ throw Error(`Panel components must be rendered within a PanelGroup container`);
46913
+ }
46914
+ const {
46915
+ collapsePanel,
46916
+ expandPanel,
46917
+ getPanelSize,
46918
+ getPanelStyle,
46919
+ groupId,
46920
+ isPanelCollapsed,
46921
+ reevaluatePanelConstraints,
46922
+ registerPanel,
46923
+ resizePanel: resizePanel2,
46924
+ unregisterPanel
46925
+ } = context;
46926
+ const panelId = useUniqueId(idFromProps);
46927
+ const panelDataRef = useRef({
46928
+ callbacks: {
46929
+ onCollapse,
46930
+ onExpand,
46931
+ onResize
46932
+ },
46933
+ constraints: {
46934
+ collapsedSize,
46935
+ collapsible,
46936
+ defaultSize,
46937
+ maxSize,
46938
+ minSize
46939
+ },
46940
+ id: panelId,
46941
+ idIsFromProps: idFromProps !== void 0,
46942
+ order: order2
46943
+ });
46944
+ useRef({
46945
+ didLogMissingDefaultSizeWarning: false
46946
+ });
46947
+ useIsomorphicLayoutEffect(() => {
46948
+ const {
46949
+ callbacks,
46950
+ constraints
46951
+ } = panelDataRef.current;
46952
+ const prevConstraints = {
46953
+ ...constraints
46954
+ };
46955
+ panelDataRef.current.id = panelId;
46956
+ panelDataRef.current.idIsFromProps = idFromProps !== void 0;
46957
+ panelDataRef.current.order = order2;
46958
+ callbacks.onCollapse = onCollapse;
46959
+ callbacks.onExpand = onExpand;
46960
+ callbacks.onResize = onResize;
46961
+ constraints.collapsedSize = collapsedSize;
46962
+ constraints.collapsible = collapsible;
46963
+ constraints.defaultSize = defaultSize;
46964
+ constraints.maxSize = maxSize;
46965
+ constraints.minSize = minSize;
46966
+ if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) {
46967
+ reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
46968
+ }
46969
+ });
46970
+ useIsomorphicLayoutEffect(() => {
46971
+ const panelData = panelDataRef.current;
46972
+ registerPanel(panelData);
46973
+ return () => {
46974
+ unregisterPanel(panelData);
46975
+ };
46976
+ }, [order2, panelId, registerPanel, unregisterPanel]);
46977
+ useImperativeHandle(forwardedRef, () => ({
46978
+ collapse: () => {
46979
+ collapsePanel(panelDataRef.current);
46980
+ },
46981
+ expand: (minSize2) => {
46982
+ expandPanel(panelDataRef.current, minSize2);
46983
+ },
46984
+ getId() {
46985
+ return panelId;
46986
+ },
46987
+ getSize() {
46988
+ return getPanelSize(panelDataRef.current);
46989
+ },
46990
+ isCollapsed() {
46991
+ return isPanelCollapsed(panelDataRef.current);
46992
+ },
46993
+ isExpanded() {
46994
+ return !isPanelCollapsed(panelDataRef.current);
46995
+ },
46996
+ resize: (size) => {
46997
+ resizePanel2(panelDataRef.current, size);
46998
+ }
46999
+ }), [collapsePanel, expandPanel, getPanelSize, isPanelCollapsed, panelId, resizePanel2]);
47000
+ const style2 = getPanelStyle(panelDataRef.current, defaultSize);
47001
+ return createElement(Type, {
47002
+ ...rest,
47003
+ children: children2,
47004
+ className: classNameFromProps,
47005
+ id: panelId,
47006
+ style: {
47007
+ ...style2,
47008
+ ...styleFromProps
47009
+ },
47010
+ // CSS selectors
47011
+ [DATA_ATTRIBUTES.groupId]: groupId,
47012
+ [DATA_ATTRIBUTES.panel]: "",
47013
+ [DATA_ATTRIBUTES.panelCollapsible]: collapsible || void 0,
47014
+ [DATA_ATTRIBUTES.panelId]: panelId,
47015
+ [DATA_ATTRIBUTES.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
47016
+ });
47017
+ }
47018
+ const Panel = forwardRef((props, ref) => createElement(PanelWithForwardedRef, {
47019
+ ...props,
47020
+ forwardedRef: ref
47021
+ }));
47022
+ PanelWithForwardedRef.displayName = "Panel";
47023
+ Panel.displayName = "forwardRef(Panel)";
47024
+ function isKeyDown(event) {
47025
+ return event.type === "keydown";
47026
+ }
47027
+ function isPointerEvent(event) {
47028
+ return event.type.startsWith("pointer");
47029
+ }
47030
+ function isMouseEvent(event) {
47031
+ return event.type.startsWith("mouse");
47032
+ }
47033
+ function getResizeEventCoordinates(event) {
47034
+ if (isPointerEvent(event)) {
47035
+ if (event.isPrimary) {
47036
+ return {
47037
+ x: event.clientX,
47038
+ y: event.clientY
47039
+ };
47040
+ }
47041
+ } else if (isMouseEvent(event)) {
47042
+ return {
47043
+ x: event.clientX,
47044
+ y: event.clientY
47045
+ };
47046
+ }
47047
+ return {
47048
+ x: Infinity,
47049
+ y: Infinity
47050
+ };
47051
+ }
47052
+ function getInputType() {
47053
+ if (typeof matchMedia === "function") {
47054
+ return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
47055
+ }
47056
+ }
47057
+ const EXCEEDED_HORIZONTAL_MIN = 1;
47058
+ const EXCEEDED_HORIZONTAL_MAX = 2;
47059
+ const EXCEEDED_VERTICAL_MIN = 4;
47060
+ const EXCEEDED_VERTICAL_MAX = 8;
47061
+ getInputType() === "coarse";
47062
+ let panelConstraintFlags = /* @__PURE__ */ new Map();
47063
+ function reportConstraintsViolation(resizeHandleId, flag) {
47064
+ panelConstraintFlags.set(resizeHandleId, flag);
47065
+ }
47066
+ function useForceUpdate() {
47067
+ const [_, setCount] = useState(0);
47068
+ return useCallback(() => setCount((prevCount) => prevCount + 1), []);
47069
+ }
47070
+ function assert(expectedCondition, message) {
47071
+ if (!expectedCondition) {
47072
+ console.error(message);
47073
+ throw Error(message);
47074
+ }
47075
+ }
47076
+ function fuzzyCompareNumbers(actual, expected, fractionDigits = PRECISION) {
47077
+ if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
47078
+ return 0;
47079
+ } else {
47080
+ return actual > expected ? 1 : -1;
47081
+ }
47082
+ }
47083
+ function fuzzyNumbersEqual$1(actual, expected, fractionDigits = PRECISION) {
47084
+ return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
47085
+ }
47086
+ function fuzzyNumbersEqual(actual, expected, fractionDigits) {
47087
+ return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
47088
+ }
47089
+ function fuzzyLayoutsEqual(actual, expected, fractionDigits) {
47090
+ if (actual.length !== expected.length) {
47091
+ return false;
47092
+ }
47093
+ for (let index2 = 0; index2 < actual.length; index2++) {
47094
+ const actualSize = actual[index2];
47095
+ const expectedSize = expected[index2];
47096
+ if (!fuzzyNumbersEqual(actualSize, expectedSize, fractionDigits)) {
47097
+ return false;
47098
+ }
47099
+ }
47100
+ return true;
47101
+ }
47102
+ function resizePanel({
47103
+ panelConstraints: panelConstraintsArray,
47104
+ panelIndex,
47105
+ size
47106
+ }) {
47107
+ const panelConstraints = panelConstraintsArray[panelIndex];
47108
+ assert(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
47109
+ let {
47110
+ collapsedSize = 0,
47111
+ collapsible,
47112
+ maxSize = 100,
47113
+ minSize = 0
47114
+ } = panelConstraints;
47115
+ if (fuzzyCompareNumbers(size, minSize) < 0) {
47116
+ if (collapsible) {
47117
+ const halfwayPoint = (collapsedSize + minSize) / 2;
47118
+ if (fuzzyCompareNumbers(size, halfwayPoint) < 0) {
47119
+ size = collapsedSize;
47120
+ } else {
47121
+ size = minSize;
47122
+ }
47123
+ } else {
47124
+ size = minSize;
47125
+ }
47126
+ }
47127
+ size = Math.min(maxSize, size);
47128
+ size = parseFloat(size.toFixed(PRECISION));
47129
+ return size;
47130
+ }
47131
+ function adjustLayoutByDelta({
47132
+ delta,
47133
+ initialLayout,
47134
+ panelConstraints: panelConstraintsArray,
47135
+ pivotIndices,
47136
+ prevLayout,
47137
+ trigger
47138
+ }) {
47139
+ if (fuzzyNumbersEqual(delta, 0)) {
47140
+ return initialLayout;
47141
+ }
47142
+ const nextLayout = [...initialLayout];
47143
+ const [firstPivotIndex, secondPivotIndex] = pivotIndices;
47144
+ assert(firstPivotIndex != null, "Invalid first pivot index");
47145
+ assert(secondPivotIndex != null, "Invalid second pivot index");
47146
+ let deltaApplied = 0;
47147
+ {
47148
+ if (trigger === "keyboard") {
47149
+ {
47150
+ const index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
47151
+ const panelConstraints = panelConstraintsArray[index2];
47152
+ assert(panelConstraints, `Panel constraints not found for index ${index2}`);
47153
+ const {
47154
+ collapsedSize = 0,
47155
+ collapsible,
47156
+ minSize = 0
47157
+ } = panelConstraints;
47158
+ if (collapsible) {
47159
+ const prevSize = initialLayout[index2];
47160
+ assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
47161
+ if (fuzzyNumbersEqual(prevSize, collapsedSize)) {
47162
+ const localDelta = minSize - prevSize;
47163
+ if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
47164
+ delta = delta < 0 ? 0 - localDelta : localDelta;
47165
+ }
47166
+ }
47167
+ }
47168
+ }
47169
+ {
47170
+ const index2 = delta < 0 ? firstPivotIndex : secondPivotIndex;
47171
+ const panelConstraints = panelConstraintsArray[index2];
47172
+ assert(panelConstraints, `No panel constraints found for index ${index2}`);
47173
+ const {
47174
+ collapsedSize = 0,
47175
+ collapsible,
47176
+ minSize = 0
47177
+ } = panelConstraints;
47178
+ if (collapsible) {
47179
+ const prevSize = initialLayout[index2];
47180
+ assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
47181
+ if (fuzzyNumbersEqual(prevSize, minSize)) {
47182
+ const localDelta = prevSize - collapsedSize;
47183
+ if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
47184
+ delta = delta < 0 ? 0 - localDelta : localDelta;
47185
+ }
47186
+ }
47187
+ }
47188
+ }
47189
+ }
47190
+ }
47191
+ {
47192
+ const increment2 = delta < 0 ? 1 : -1;
47193
+ let index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
47194
+ let maxAvailableDelta = 0;
47195
+ while (true) {
47196
+ const prevSize = initialLayout[index2];
47197
+ assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
47198
+ const maxSafeSize = resizePanel({
47199
+ panelConstraints: panelConstraintsArray,
47200
+ panelIndex: index2,
47201
+ size: 100
47202
+ });
47203
+ const delta2 = maxSafeSize - prevSize;
47204
+ maxAvailableDelta += delta2;
47205
+ index2 += increment2;
47206
+ if (index2 < 0 || index2 >= panelConstraintsArray.length) {
47207
+ break;
47208
+ }
47209
+ }
47210
+ const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
47211
+ delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
47212
+ }
47213
+ {
47214
+ const pivotIndex = delta < 0 ? firstPivotIndex : secondPivotIndex;
47215
+ let index2 = pivotIndex;
47216
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
47217
+ const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
47218
+ const prevSize = initialLayout[index2];
47219
+ assert(prevSize != null, `Previous layout not found for panel index ${index2}`);
47220
+ const unsafeSize = prevSize - deltaRemaining;
47221
+ const safeSize = resizePanel({
47222
+ panelConstraints: panelConstraintsArray,
47223
+ panelIndex: index2,
47224
+ size: unsafeSize
47225
+ });
47226
+ if (!fuzzyNumbersEqual(prevSize, safeSize)) {
47227
+ deltaApplied += prevSize - safeSize;
47228
+ nextLayout[index2] = safeSize;
47229
+ if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), void 0, {
47230
+ numeric: true
47231
+ }) >= 0) {
47232
+ break;
47233
+ }
47234
+ }
47235
+ if (delta < 0) {
47236
+ index2--;
47237
+ } else {
47238
+ index2++;
47239
+ }
47240
+ }
47241
+ }
47242
+ if (fuzzyLayoutsEqual(prevLayout, nextLayout)) {
47243
+ return prevLayout;
47244
+ }
47245
+ {
47246
+ const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
47247
+ const prevSize = initialLayout[pivotIndex];
47248
+ assert(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
47249
+ const unsafeSize = prevSize + deltaApplied;
47250
+ const safeSize = resizePanel({
47251
+ panelConstraints: panelConstraintsArray,
47252
+ panelIndex: pivotIndex,
47253
+ size: unsafeSize
47254
+ });
47255
+ nextLayout[pivotIndex] = safeSize;
47256
+ if (!fuzzyNumbersEqual(safeSize, unsafeSize)) {
47257
+ let deltaRemaining = unsafeSize - safeSize;
47258
+ const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
47259
+ let index2 = pivotIndex2;
47260
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
47261
+ const prevSize2 = nextLayout[index2];
47262
+ assert(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
47263
+ const unsafeSize2 = prevSize2 + deltaRemaining;
47264
+ const safeSize2 = resizePanel({
47265
+ panelConstraints: panelConstraintsArray,
47266
+ panelIndex: index2,
47267
+ size: unsafeSize2
47268
+ });
47269
+ if (!fuzzyNumbersEqual(prevSize2, safeSize2)) {
47270
+ deltaRemaining -= safeSize2 - prevSize2;
47271
+ nextLayout[index2] = safeSize2;
47272
+ }
47273
+ if (fuzzyNumbersEqual(deltaRemaining, 0)) {
47274
+ break;
47275
+ }
47276
+ if (delta > 0) {
47277
+ index2--;
47278
+ } else {
47279
+ index2++;
47280
+ }
47281
+ }
47282
+ }
47283
+ }
47284
+ const totalSize = nextLayout.reduce((total, size) => size + total, 0);
47285
+ if (!fuzzyNumbersEqual(totalSize, 100)) {
47286
+ return prevLayout;
47287
+ }
47288
+ return nextLayout;
47289
+ }
47290
+ function calculateAriaValues({
47291
+ layout,
47292
+ panelsArray,
47293
+ pivotIndices
47294
+ }) {
47295
+ let currentMinSize = 0;
47296
+ let currentMaxSize = 100;
47297
+ let totalMinSize = 0;
47298
+ let totalMaxSize = 0;
47299
+ const firstIndex = pivotIndices[0];
47300
+ assert(firstIndex != null, "No pivot index found");
47301
+ panelsArray.forEach((panelData, index2) => {
47302
+ const {
47303
+ constraints
47304
+ } = panelData;
47305
+ const {
47306
+ maxSize = 100,
47307
+ minSize = 0
47308
+ } = constraints;
47309
+ if (index2 === firstIndex) {
47310
+ currentMinSize = minSize;
47311
+ currentMaxSize = maxSize;
47312
+ } else {
47313
+ totalMinSize += minSize;
47314
+ totalMaxSize += maxSize;
47315
+ }
47316
+ });
47317
+ const valueMax = Math.min(currentMaxSize, 100 - totalMinSize);
47318
+ const valueMin = Math.max(currentMinSize, 100 - totalMaxSize);
47319
+ const valueNow = layout[firstIndex];
47320
+ return {
47321
+ valueMax,
47322
+ valueMin,
47323
+ valueNow
47324
+ };
47325
+ }
47326
+ function getResizeHandleElementsForGroup(groupId, scope = document) {
47327
+ return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES.resizeHandleId}][data-panel-group-id="${groupId}"]`));
47328
+ }
47329
+ function getResizeHandleElementIndex(groupId, id, scope = document) {
47330
+ const handles = getResizeHandleElementsForGroup(groupId, scope);
47331
+ const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES.resizeHandleId) === id);
47332
+ return index2 !== null && index2 !== void 0 ? index2 : null;
47333
+ }
47334
+ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
47335
+ const index2 = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
47336
+ return index2 != null ? [index2, index2 + 1] : [-1, -1];
47337
+ }
47338
+ function isHTMLElement(target) {
47339
+ if (target instanceof HTMLElement) {
47340
+ return true;
47341
+ }
47342
+ return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
47343
+ }
47344
+ function getPanelGroupElement(id, rootElement = document) {
47345
+ if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
47346
+ return rootElement;
47347
+ }
47348
+ const element2 = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
47349
+ if (element2) {
47350
+ return element2;
47351
+ }
47352
+ return null;
47353
+ }
47354
+ function getResizeHandleElement(id, scope = document) {
47355
+ const element2 = scope.querySelector(`[${DATA_ATTRIBUTES.resizeHandleId}="${id}"]`);
47356
+ if (element2) {
47357
+ return element2;
47358
+ }
47359
+ return null;
47360
+ }
47361
+ function getResizeHandlePanelIds(groupId, handleId, panelsArray, scope = document) {
47362
+ var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
47363
+ const handle2 = getResizeHandleElement(handleId, scope);
47364
+ const handles = getResizeHandleElementsForGroup(groupId, scope);
47365
+ const index2 = handle2 ? handles.indexOf(handle2) : -1;
47366
+ const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index2]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null;
47367
+ const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index2 + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null;
47368
+ return [idBefore, idAfter];
47369
+ }
47370
+ function useWindowSplitterPanelGroupBehavior({
47371
+ committedValuesRef,
47372
+ eagerValuesRef,
47373
+ groupId,
47374
+ layout,
47375
+ panelDataArray,
47376
+ panelGroupElement,
47377
+ setLayout
47378
+ }) {
47379
+ useRef({
47380
+ didWarnAboutMissingResizeHandle: false
47381
+ });
47382
+ useIsomorphicLayoutEffect(() => {
47383
+ if (!panelGroupElement) {
47384
+ return;
47385
+ }
47386
+ const resizeHandleElements = getResizeHandleElementsForGroup(groupId, panelGroupElement);
47387
+ for (let index2 = 0; index2 < panelDataArray.length - 1; index2++) {
47388
+ const {
47389
+ valueMax,
47390
+ valueMin,
47391
+ valueNow
47392
+ } = calculateAriaValues({
47393
+ layout,
47394
+ panelsArray: panelDataArray,
47395
+ pivotIndices: [index2, index2 + 1]
47396
+ });
47397
+ const resizeHandleElement = resizeHandleElements[index2];
47398
+ if (resizeHandleElement == null) ;
47399
+ else {
47400
+ const panelData = panelDataArray[index2];
47401
+ assert(panelData, `No panel data found for index "${index2}"`);
47402
+ resizeHandleElement.setAttribute("aria-controls", panelData.id);
47403
+ resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
47404
+ resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
47405
+ resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
47406
+ }
47407
+ }
47408
+ return () => {
47409
+ resizeHandleElements.forEach((resizeHandleElement, index2) => {
47410
+ resizeHandleElement.removeAttribute("aria-controls");
47411
+ resizeHandleElement.removeAttribute("aria-valuemax");
47412
+ resizeHandleElement.removeAttribute("aria-valuemin");
47413
+ resizeHandleElement.removeAttribute("aria-valuenow");
47414
+ });
47415
+ };
47416
+ }, [groupId, layout, panelDataArray, panelGroupElement]);
47417
+ useEffect(() => {
47418
+ if (!panelGroupElement) {
47419
+ return;
47420
+ }
47421
+ const eagerValues = eagerValuesRef.current;
47422
+ assert(eagerValues, `Eager values not found`);
47423
+ const {
47424
+ panelDataArray: panelDataArray2
47425
+ } = eagerValues;
47426
+ const groupElement = getPanelGroupElement(groupId, panelGroupElement);
47427
+ assert(groupElement != null, `No group found for id "${groupId}"`);
47428
+ const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
47429
+ assert(handles, `No resize handles found for group id "${groupId}"`);
47430
+ const cleanupFunctions = handles.map((handle2) => {
47431
+ const handleId = handle2.getAttribute(DATA_ATTRIBUTES.resizeHandleId);
47432
+ assert(handleId, `Resize handle element has no handle id attribute`);
47433
+ const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelDataArray2, panelGroupElement);
47434
+ if (idBefore == null || idAfter == null) {
47435
+ return () => {
47436
+ };
47437
+ }
47438
+ const onKeyDown = (event) => {
47439
+ if (event.defaultPrevented) {
47440
+ return;
47441
+ }
47442
+ switch (event.key) {
47443
+ case "Enter": {
47444
+ event.preventDefault();
47445
+ const index2 = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
47446
+ if (index2 >= 0) {
47447
+ const panelData = panelDataArray2[index2];
47448
+ assert(panelData, `No panel data found for index ${index2}`);
47449
+ const size = layout[index2];
47450
+ const {
47451
+ collapsedSize = 0,
47452
+ collapsible,
47453
+ minSize = 0
47454
+ } = panelData.constraints;
47455
+ if (size != null && collapsible) {
47456
+ const nextLayout = adjustLayoutByDelta({
47457
+ delta: fuzzyNumbersEqual(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
47458
+ initialLayout: layout,
47459
+ panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
47460
+ pivotIndices: determinePivotIndices(groupId, handleId, panelGroupElement),
47461
+ prevLayout: layout,
47462
+ trigger: "keyboard"
47463
+ });
47464
+ if (layout !== nextLayout) {
47465
+ setLayout(nextLayout);
47466
+ }
47467
+ }
47468
+ }
47469
+ break;
47470
+ }
47471
+ }
47472
+ };
47473
+ handle2.addEventListener("keydown", onKeyDown);
47474
+ return () => {
47475
+ handle2.removeEventListener("keydown", onKeyDown);
47476
+ };
47477
+ });
47478
+ return () => {
47479
+ cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
47480
+ };
47481
+ }, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
47482
+ }
47483
+ function areEqual(arrayA, arrayB) {
47484
+ if (arrayA.length !== arrayB.length) {
47485
+ return false;
47486
+ }
47487
+ for (let index2 = 0; index2 < arrayA.length; index2++) {
47488
+ if (arrayA[index2] !== arrayB[index2]) {
47489
+ return false;
47490
+ }
47491
+ }
47492
+ return true;
47493
+ }
47494
+ function getResizeEventCursorPosition(direction, event) {
47495
+ const isHorizontal = direction === "horizontal";
47496
+ const {
47497
+ x,
47498
+ y
47499
+ } = getResizeEventCoordinates(event);
47500
+ return isHorizontal ? x : y;
47501
+ }
47502
+ function calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement) {
47503
+ const isHorizontal = direction === "horizontal";
47504
+ const handleElement = getResizeHandleElement(dragHandleId, panelGroupElement);
47505
+ assert(handleElement, `No resize handle element found for id "${dragHandleId}"`);
47506
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
47507
+ assert(groupId, `Resize handle element has no group id attribute`);
47508
+ let {
47509
+ initialCursorPosition
47510
+ } = initialDragState;
47511
+ const cursorPosition = getResizeEventCursorPosition(direction, event);
47512
+ const groupElement = getPanelGroupElement(groupId, panelGroupElement);
47513
+ assert(groupElement, `No group element found for id "${groupId}"`);
47514
+ const groupRect = groupElement.getBoundingClientRect();
47515
+ const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
47516
+ const offsetPixels = cursorPosition - initialCursorPosition;
47517
+ const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
47518
+ return offsetPercentage;
47519
+ }
47520
+ function calculateDeltaPercentage(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
47521
+ if (isKeyDown(event)) {
47522
+ const isHorizontal = direction === "horizontal";
47523
+ let delta = 0;
47524
+ if (event.shiftKey) {
47525
+ delta = 100;
47526
+ } else if (keyboardResizeBy != null) {
47527
+ delta = keyboardResizeBy;
47528
+ } else {
47529
+ delta = 10;
47530
+ }
47531
+ let movement = 0;
47532
+ switch (event.key) {
47533
+ case "ArrowDown":
47534
+ movement = isHorizontal ? 0 : delta;
47535
+ break;
47536
+ case "ArrowLeft":
47537
+ movement = isHorizontal ? -delta : 0;
47538
+ break;
47539
+ case "ArrowRight":
47540
+ movement = isHorizontal ? delta : 0;
47541
+ break;
47542
+ case "ArrowUp":
47543
+ movement = isHorizontal ? 0 : -delta;
47544
+ break;
47545
+ case "End":
47546
+ movement = 100;
47547
+ break;
47548
+ case "Home":
47549
+ movement = -100;
47550
+ break;
47551
+ }
47552
+ return movement;
47553
+ } else {
47554
+ if (initialDragState == null) {
47555
+ return 0;
47556
+ }
47557
+ return calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement);
47558
+ }
47559
+ }
47560
+ function calculateUnsafeDefaultLayout({
47561
+ panelDataArray
47562
+ }) {
47563
+ const layout = Array(panelDataArray.length);
47564
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
47565
+ let numPanelsWithSizes = 0;
47566
+ let remainingSize = 100;
47567
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
47568
+ const panelConstraints = panelConstraintsArray[index2];
47569
+ assert(panelConstraints, `Panel constraints not found for index ${index2}`);
47570
+ const {
47571
+ defaultSize
47572
+ } = panelConstraints;
47573
+ if (defaultSize != null) {
47574
+ numPanelsWithSizes++;
47575
+ layout[index2] = defaultSize;
47576
+ remainingSize -= defaultSize;
47577
+ }
47578
+ }
47579
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
47580
+ const panelConstraints = panelConstraintsArray[index2];
47581
+ assert(panelConstraints, `Panel constraints not found for index ${index2}`);
47582
+ const {
47583
+ defaultSize
47584
+ } = panelConstraints;
47585
+ if (defaultSize != null) {
47586
+ continue;
47587
+ }
47588
+ const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
47589
+ const size = remainingSize / numRemainingPanels;
47590
+ numPanelsWithSizes++;
47591
+ layout[index2] = size;
47592
+ remainingSize -= size;
47593
+ }
47594
+ return layout;
47595
+ }
47596
+ function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
47597
+ layout.forEach((size, index2) => {
47598
+ const panelData = panelsArray[index2];
47599
+ assert(panelData, `Panel data not found for index ${index2}`);
47600
+ const {
47601
+ callbacks,
47602
+ constraints,
47603
+ id: panelId
47604
+ } = panelData;
47605
+ const {
47606
+ collapsedSize = 0,
47607
+ collapsible
47608
+ } = constraints;
47609
+ const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
47610
+ if (lastNotifiedSize == null || size !== lastNotifiedSize) {
47611
+ panelIdToLastNotifiedSizeMap[panelId] = size;
47612
+ const {
47613
+ onCollapse,
47614
+ onExpand,
47615
+ onResize
47616
+ } = callbacks;
47617
+ if (onResize) {
47618
+ onResize(size, lastNotifiedSize);
47619
+ }
47620
+ if (collapsible && (onCollapse || onExpand)) {
47621
+ if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1(size, collapsedSize)) {
47622
+ onExpand();
47623
+ }
47624
+ if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1(size, collapsedSize)) {
47625
+ onCollapse();
47626
+ }
47627
+ }
47628
+ }
47629
+ });
47630
+ }
47631
+ function compareLayouts(a, b) {
47632
+ if (a.length !== b.length) {
47633
+ return false;
47634
+ } else {
47635
+ for (let index2 = 0; index2 < a.length; index2++) {
47636
+ if (a[index2] != b[index2]) {
47637
+ return false;
47638
+ }
47639
+ }
47640
+ }
47641
+ return true;
47642
+ }
47643
+ function computePanelFlexBoxStyle({
47644
+ defaultSize,
47645
+ dragState,
47646
+ layout,
47647
+ panelData,
47648
+ panelIndex,
47649
+ precision = 3
47650
+ }) {
47651
+ const size = layout[panelIndex];
47652
+ let flexGrow;
47653
+ if (size == null) {
47654
+ flexGrow = defaultSize != void 0 ? defaultSize.toFixed(precision) : "1";
47655
+ } else if (panelData.length === 1) {
47656
+ flexGrow = "1";
47657
+ } else {
47658
+ flexGrow = size.toFixed(precision);
47659
+ }
47660
+ return {
47661
+ flexBasis: 0,
47662
+ flexGrow,
47663
+ flexShrink: 1,
47664
+ // Without this, Panel sizes may be unintentionally overridden by their content
47665
+ overflow: "hidden",
47666
+ // Disable pointer events inside of a panel during resize
47667
+ // This avoid edge cases like nested iframes
47668
+ pointerEvents: dragState !== null ? "none" : void 0
47669
+ };
47670
+ }
47671
+ function debounce(callback, durationMs = 10) {
47672
+ let timeoutId = null;
47673
+ let callable = (...args) => {
47674
+ if (timeoutId !== null) {
47675
+ clearTimeout(timeoutId);
47676
+ }
47677
+ timeoutId = setTimeout(() => {
47678
+ callback(...args);
47679
+ }, durationMs);
47680
+ };
47681
+ return callable;
47682
+ }
47683
+ function initializeDefaultStorage(storageObject) {
47684
+ try {
47685
+ if (typeof localStorage !== "undefined") {
47686
+ storageObject.getItem = (name2) => {
47687
+ return localStorage.getItem(name2);
47688
+ };
47689
+ storageObject.setItem = (name2, value) => {
47690
+ localStorage.setItem(name2, value);
47691
+ };
47692
+ } else {
47693
+ throw new Error("localStorage not supported in this environment");
47694
+ }
47695
+ } catch (error) {
47696
+ console.error(error);
47697
+ storageObject.getItem = () => null;
47698
+ storageObject.setItem = () => {
47699
+ };
47700
+ }
47701
+ }
47702
+ function getPanelGroupKey(autoSaveId) {
47703
+ return `react-resizable-panels:${autoSaveId}`;
47704
+ }
47705
+ function getPanelKey(panels2) {
47706
+ return panels2.map((panel) => {
47707
+ const {
47708
+ constraints,
47709
+ id,
47710
+ idIsFromProps,
47711
+ order: order2
47712
+ } = panel;
47713
+ if (idIsFromProps) {
47714
+ return id;
47715
+ } else {
47716
+ return order2 ? `${order2}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
47717
+ }
47718
+ }).sort((a, b) => a.localeCompare(b)).join(",");
47719
+ }
47720
+ function loadSerializedPanelGroupState(autoSaveId, storage) {
47721
+ try {
47722
+ const panelGroupKey = getPanelGroupKey(autoSaveId);
47723
+ const serialized = storage.getItem(panelGroupKey);
47724
+ if (serialized) {
47725
+ const parsed = JSON.parse(serialized);
47726
+ if (typeof parsed === "object" && parsed != null) {
47727
+ return parsed;
47728
+ }
47729
+ }
47730
+ } catch (error) {
47731
+ }
47732
+ return null;
47733
+ }
47734
+ function loadPanelGroupState(autoSaveId, panels2, storage) {
47735
+ var _loadSerializedPanelG, _state$panelKey;
47736
+ const state = (_loadSerializedPanelG = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
47737
+ const panelKey = getPanelKey(panels2);
47738
+ return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
47739
+ }
47740
+ function savePanelGroupState(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
47741
+ var _loadSerializedPanelG2;
47742
+ const panelGroupKey = getPanelGroupKey(autoSaveId);
47743
+ const panelKey = getPanelKey(panels2);
47744
+ const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
47745
+ state[panelKey] = {
47746
+ expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
47747
+ layout: sizes
47748
+ };
47749
+ try {
47750
+ storage.setItem(panelGroupKey, JSON.stringify(state));
47751
+ } catch (error) {
47752
+ console.error(error);
47753
+ }
47754
+ }
47755
+ function validatePanelGroupLayout({
47756
+ layout: prevLayout,
47757
+ panelConstraints
47758
+ }) {
47759
+ const nextLayout = [...prevLayout];
47760
+ const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
47761
+ if (nextLayout.length !== panelConstraints.length) {
47762
+ throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
47763
+ } else if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
47764
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
47765
+ const unsafeSize = nextLayout[index2];
47766
+ assert(unsafeSize != null, `No layout data found for index ${index2}`);
47767
+ const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
47768
+ nextLayout[index2] = safeSize;
47769
+ }
47770
+ }
47771
+ let remainingSize = 0;
47772
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
47773
+ const unsafeSize = nextLayout[index2];
47774
+ assert(unsafeSize != null, `No layout data found for index ${index2}`);
47775
+ const safeSize = resizePanel({
47776
+ panelConstraints,
47777
+ panelIndex: index2,
47778
+ size: unsafeSize
47779
+ });
47780
+ if (unsafeSize != safeSize) {
47781
+ remainingSize += unsafeSize - safeSize;
47782
+ nextLayout[index2] = safeSize;
47783
+ }
47784
+ }
47785
+ if (!fuzzyNumbersEqual(remainingSize, 0)) {
47786
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
47787
+ const prevSize = nextLayout[index2];
47788
+ assert(prevSize != null, `No layout data found for index ${index2}`);
47789
+ const unsafeSize = prevSize + remainingSize;
47790
+ const safeSize = resizePanel({
47791
+ panelConstraints,
47792
+ panelIndex: index2,
47793
+ size: unsafeSize
47794
+ });
47795
+ if (prevSize !== safeSize) {
47796
+ remainingSize -= safeSize - prevSize;
47797
+ nextLayout[index2] = safeSize;
47798
+ if (fuzzyNumbersEqual(remainingSize, 0)) {
47799
+ break;
47800
+ }
47801
+ }
47802
+ }
47803
+ }
47804
+ return nextLayout;
47805
+ }
47806
+ const LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100;
47807
+ const defaultStorage = {
47808
+ getItem: (name2) => {
47809
+ initializeDefaultStorage(defaultStorage);
47810
+ return defaultStorage.getItem(name2);
47811
+ },
47812
+ setItem: (name2, value) => {
47813
+ initializeDefaultStorage(defaultStorage);
47814
+ defaultStorage.setItem(name2, value);
47815
+ }
47816
+ };
47817
+ const debounceMap = {};
47818
+ function PanelGroupWithForwardedRef({
47819
+ autoSaveId = null,
47820
+ children: children2,
47821
+ className: classNameFromProps = "",
47822
+ direction,
47823
+ forwardedRef,
47824
+ id: idFromProps = null,
47825
+ onLayout = null,
47826
+ keyboardResizeBy = null,
47827
+ storage = defaultStorage,
47828
+ style: styleFromProps,
47829
+ tagName: Type = "div",
47830
+ ...rest
47831
+ }) {
47832
+ const groupId = useUniqueId(idFromProps);
47833
+ const panelGroupElementRef = useRef(null);
47834
+ const [dragState, setDragState] = useState(null);
47835
+ const [layout, setLayout] = useState([]);
47836
+ const forceUpdate = useForceUpdate();
47837
+ const panelIdToLastNotifiedSizeMapRef = useRef({});
47838
+ const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
47839
+ const prevDeltaRef = useRef(0);
47840
+ const committedValuesRef = useRef({
47841
+ autoSaveId,
47842
+ direction,
47843
+ dragState,
47844
+ id: groupId,
47845
+ keyboardResizeBy,
47846
+ onLayout,
47847
+ storage
47848
+ });
47849
+ const eagerValuesRef = useRef({
47850
+ layout,
47851
+ panelDataArray: [],
47852
+ panelDataArrayChanged: false
47853
+ });
47854
+ useRef({
47855
+ didLogIdAndOrderWarning: false,
47856
+ didLogPanelConstraintsWarning: false,
47857
+ prevPanelIds: []
47858
+ });
47859
+ useImperativeHandle(forwardedRef, () => ({
47860
+ getId: () => committedValuesRef.current.id,
47861
+ getLayout: () => {
47862
+ const {
47863
+ layout: layout2
47864
+ } = eagerValuesRef.current;
47865
+ return layout2;
47866
+ },
47867
+ setLayout: (unsafeLayout) => {
47868
+ const {
47869
+ onLayout: onLayout2
47870
+ } = committedValuesRef.current;
47871
+ const {
47872
+ layout: prevLayout,
47873
+ panelDataArray
47874
+ } = eagerValuesRef.current;
47875
+ const safeLayout = validatePanelGroupLayout({
47876
+ layout: unsafeLayout,
47877
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
47878
+ });
47879
+ if (!areEqual(prevLayout, safeLayout)) {
47880
+ setLayout(safeLayout);
47881
+ eagerValuesRef.current.layout = safeLayout;
47882
+ if (onLayout2) {
47883
+ onLayout2(safeLayout);
47884
+ }
47885
+ callPanelCallbacks(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
47886
+ }
47887
+ }
47888
+ }), []);
47889
+ useIsomorphicLayoutEffect(() => {
47890
+ committedValuesRef.current.autoSaveId = autoSaveId;
47891
+ committedValuesRef.current.direction = direction;
47892
+ committedValuesRef.current.dragState = dragState;
47893
+ committedValuesRef.current.id = groupId;
47894
+ committedValuesRef.current.onLayout = onLayout;
47895
+ committedValuesRef.current.storage = storage;
47896
+ });
47897
+ useWindowSplitterPanelGroupBehavior({
47898
+ committedValuesRef,
47899
+ eagerValuesRef,
47900
+ groupId,
47901
+ layout,
47902
+ panelDataArray: eagerValuesRef.current.panelDataArray,
47903
+ setLayout,
47904
+ panelGroupElement: panelGroupElementRef.current
47905
+ });
47906
+ useEffect(() => {
47907
+ const {
47908
+ panelDataArray
47909
+ } = eagerValuesRef.current;
47910
+ if (autoSaveId) {
47911
+ if (layout.length === 0 || layout.length !== panelDataArray.length) {
47912
+ return;
47913
+ }
47914
+ let debouncedSave = debounceMap[autoSaveId];
47915
+ if (debouncedSave == null) {
47916
+ debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL);
47917
+ debounceMap[autoSaveId] = debouncedSave;
47918
+ }
47919
+ const clonedPanelDataArray = [...panelDataArray];
47920
+ const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
47921
+ debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
47922
+ }
47923
+ }, [autoSaveId, layout, storage]);
47924
+ useEffect(() => {
47925
+ });
47926
+ const collapsePanel = useCallback((panelData) => {
47927
+ const {
47928
+ onLayout: onLayout2
47929
+ } = committedValuesRef.current;
47930
+ const {
47931
+ layout: prevLayout,
47932
+ panelDataArray
47933
+ } = eagerValuesRef.current;
47934
+ if (panelData.constraints.collapsible) {
47935
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
47936
+ const {
47937
+ collapsedSize = 0,
47938
+ panelSize,
47939
+ pivotIndices
47940
+ } = panelDataHelper(panelDataArray, panelData, prevLayout);
47941
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
47942
+ if (!fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
47943
+ panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
47944
+ const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
47945
+ const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
47946
+ const nextLayout = adjustLayoutByDelta({
47947
+ delta,
47948
+ initialLayout: prevLayout,
47949
+ panelConstraints: panelConstraintsArray,
47950
+ pivotIndices,
47951
+ prevLayout,
47952
+ trigger: "imperative-api"
47953
+ });
47954
+ if (!compareLayouts(prevLayout, nextLayout)) {
47955
+ setLayout(nextLayout);
47956
+ eagerValuesRef.current.layout = nextLayout;
47957
+ if (onLayout2) {
47958
+ onLayout2(nextLayout);
47959
+ }
47960
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
47961
+ }
47962
+ }
47963
+ }
47964
+ }, []);
47965
+ const expandPanel = useCallback((panelData, minSizeOverride) => {
47966
+ const {
47967
+ onLayout: onLayout2
47968
+ } = committedValuesRef.current;
47969
+ const {
47970
+ layout: prevLayout,
47971
+ panelDataArray
47972
+ } = eagerValuesRef.current;
47973
+ if (panelData.constraints.collapsible) {
47974
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
47975
+ const {
47976
+ collapsedSize = 0,
47977
+ panelSize = 0,
47978
+ minSize: minSizeFromProps = 0,
47979
+ pivotIndices
47980
+ } = panelDataHelper(panelDataArray, panelData, prevLayout);
47981
+ const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
47982
+ if (fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
47983
+ const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
47984
+ const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
47985
+ const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
47986
+ const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
47987
+ const nextLayout = adjustLayoutByDelta({
47988
+ delta,
47989
+ initialLayout: prevLayout,
47990
+ panelConstraints: panelConstraintsArray,
47991
+ pivotIndices,
47992
+ prevLayout,
47993
+ trigger: "imperative-api"
47994
+ });
47995
+ if (!compareLayouts(prevLayout, nextLayout)) {
47996
+ setLayout(nextLayout);
47997
+ eagerValuesRef.current.layout = nextLayout;
47998
+ if (onLayout2) {
47999
+ onLayout2(nextLayout);
48000
+ }
48001
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
48002
+ }
48003
+ }
48004
+ }
48005
+ }, []);
48006
+ const getPanelSize = useCallback((panelData) => {
48007
+ const {
48008
+ layout: layout2,
48009
+ panelDataArray
48010
+ } = eagerValuesRef.current;
48011
+ const {
48012
+ panelSize
48013
+ } = panelDataHelper(panelDataArray, panelData, layout2);
48014
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
48015
+ return panelSize;
48016
+ }, []);
48017
+ const getPanelStyle = useCallback((panelData, defaultSize) => {
48018
+ const {
48019
+ panelDataArray
48020
+ } = eagerValuesRef.current;
48021
+ const panelIndex = findPanelDataIndex(panelDataArray, panelData);
48022
+ return computePanelFlexBoxStyle({
48023
+ defaultSize,
48024
+ dragState,
48025
+ layout,
48026
+ panelData: panelDataArray,
48027
+ panelIndex
48028
+ });
48029
+ }, [dragState, layout]);
48030
+ const isPanelCollapsed = useCallback((panelData) => {
48031
+ const {
48032
+ layout: layout2,
48033
+ panelDataArray
48034
+ } = eagerValuesRef.current;
48035
+ const {
48036
+ collapsedSize = 0,
48037
+ collapsible,
48038
+ panelSize
48039
+ } = panelDataHelper(panelDataArray, panelData, layout2);
48040
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
48041
+ return collapsible === true && fuzzyNumbersEqual$1(panelSize, collapsedSize);
48042
+ }, []);
48043
+ const isPanelExpanded = useCallback((panelData) => {
48044
+ const {
48045
+ layout: layout2,
48046
+ panelDataArray
48047
+ } = eagerValuesRef.current;
48048
+ const {
48049
+ collapsedSize = 0,
48050
+ collapsible,
48051
+ panelSize
48052
+ } = panelDataHelper(panelDataArray, panelData, layout2);
48053
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
48054
+ return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0;
48055
+ }, []);
48056
+ const registerPanel = useCallback((panelData) => {
48057
+ const {
48058
+ panelDataArray
48059
+ } = eagerValuesRef.current;
48060
+ panelDataArray.push(panelData);
48061
+ panelDataArray.sort((panelA, panelB) => {
48062
+ const orderA = panelA.order;
48063
+ const orderB = panelB.order;
48064
+ if (orderA == null && orderB == null) {
48065
+ return 0;
48066
+ } else if (orderA == null) {
48067
+ return -1;
48068
+ } else if (orderB == null) {
48069
+ return 1;
48070
+ } else {
48071
+ return orderA - orderB;
48072
+ }
48073
+ });
48074
+ eagerValuesRef.current.panelDataArrayChanged = true;
48075
+ forceUpdate();
48076
+ }, [forceUpdate]);
48077
+ useIsomorphicLayoutEffect(() => {
48078
+ if (eagerValuesRef.current.panelDataArrayChanged) {
48079
+ eagerValuesRef.current.panelDataArrayChanged = false;
48080
+ const {
48081
+ autoSaveId: autoSaveId2,
48082
+ onLayout: onLayout2,
48083
+ storage: storage2
48084
+ } = committedValuesRef.current;
48085
+ const {
48086
+ layout: prevLayout,
48087
+ panelDataArray
48088
+ } = eagerValuesRef.current;
48089
+ let unsafeLayout = null;
48090
+ if (autoSaveId2) {
48091
+ const state = loadPanelGroupState(autoSaveId2, panelDataArray, storage2);
48092
+ if (state) {
48093
+ panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
48094
+ unsafeLayout = state.layout;
48095
+ }
48096
+ }
48097
+ if (unsafeLayout == null) {
48098
+ unsafeLayout = calculateUnsafeDefaultLayout({
48099
+ panelDataArray
48100
+ });
48101
+ }
48102
+ const nextLayout = validatePanelGroupLayout({
48103
+ layout: unsafeLayout,
48104
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
48105
+ });
48106
+ if (!areEqual(prevLayout, nextLayout)) {
48107
+ setLayout(nextLayout);
48108
+ eagerValuesRef.current.layout = nextLayout;
48109
+ if (onLayout2) {
48110
+ onLayout2(nextLayout);
48111
+ }
48112
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
48113
+ }
48114
+ }
48115
+ });
48116
+ useIsomorphicLayoutEffect(() => {
48117
+ const eagerValues = eagerValuesRef.current;
48118
+ return () => {
48119
+ eagerValues.layout = [];
48120
+ };
48121
+ }, []);
48122
+ const registerResizeHandle = useCallback((dragHandleId) => {
48123
+ let isRTL = false;
48124
+ const panelGroupElement = panelGroupElementRef.current;
48125
+ if (panelGroupElement) {
48126
+ const style3 = window.getComputedStyle(panelGroupElement, null);
48127
+ if (style3.getPropertyValue("direction") === "rtl") {
48128
+ isRTL = true;
48129
+ }
48130
+ }
48131
+ return function resizeHandler(event) {
48132
+ event.preventDefault();
48133
+ const panelGroupElement2 = panelGroupElementRef.current;
48134
+ if (!panelGroupElement2) {
48135
+ return () => null;
48136
+ }
48137
+ const {
48138
+ direction: direction2,
48139
+ dragState: dragState2,
48140
+ id: groupId2,
48141
+ keyboardResizeBy: keyboardResizeBy2,
48142
+ onLayout: onLayout2
48143
+ } = committedValuesRef.current;
48144
+ const {
48145
+ layout: prevLayout,
48146
+ panelDataArray
48147
+ } = eagerValuesRef.current;
48148
+ const {
48149
+ initialLayout
48150
+ } = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
48151
+ const pivotIndices = determinePivotIndices(groupId2, dragHandleId, panelGroupElement2);
48152
+ let delta = calculateDeltaPercentage(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
48153
+ const isHorizontal = direction2 === "horizontal";
48154
+ if (isHorizontal && isRTL) {
48155
+ delta = -delta;
48156
+ }
48157
+ const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
48158
+ const nextLayout = adjustLayoutByDelta({
48159
+ delta,
48160
+ initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
48161
+ panelConstraints,
48162
+ pivotIndices,
48163
+ prevLayout,
48164
+ trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
48165
+ });
48166
+ const layoutChanged = !compareLayouts(prevLayout, nextLayout);
48167
+ if (isPointerEvent(event) || isMouseEvent(event)) {
48168
+ if (prevDeltaRef.current != delta) {
48169
+ prevDeltaRef.current = delta;
48170
+ if (!layoutChanged && delta !== 0) {
48171
+ if (isHorizontal) {
48172
+ reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
48173
+ } else {
48174
+ reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
48175
+ }
48176
+ } else {
48177
+ reportConstraintsViolation(dragHandleId, 0);
48178
+ }
48179
+ }
48180
+ }
48181
+ if (layoutChanged) {
48182
+ setLayout(nextLayout);
48183
+ eagerValuesRef.current.layout = nextLayout;
48184
+ if (onLayout2) {
48185
+ onLayout2(nextLayout);
48186
+ }
48187
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
48188
+ }
48189
+ };
48190
+ }, []);
48191
+ const resizePanel2 = useCallback((panelData, unsafePanelSize) => {
48192
+ const {
48193
+ onLayout: onLayout2
48194
+ } = committedValuesRef.current;
48195
+ const {
48196
+ layout: prevLayout,
48197
+ panelDataArray
48198
+ } = eagerValuesRef.current;
48199
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
48200
+ const {
48201
+ panelSize,
48202
+ pivotIndices
48203
+ } = panelDataHelper(panelDataArray, panelData, prevLayout);
48204
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
48205
+ const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
48206
+ const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
48207
+ const nextLayout = adjustLayoutByDelta({
48208
+ delta,
48209
+ initialLayout: prevLayout,
48210
+ panelConstraints: panelConstraintsArray,
48211
+ pivotIndices,
48212
+ prevLayout,
48213
+ trigger: "imperative-api"
48214
+ });
48215
+ if (!compareLayouts(prevLayout, nextLayout)) {
48216
+ setLayout(nextLayout);
48217
+ eagerValuesRef.current.layout = nextLayout;
48218
+ if (onLayout2) {
48219
+ onLayout2(nextLayout);
48220
+ }
48221
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
48222
+ }
48223
+ }, []);
48224
+ const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
48225
+ const {
48226
+ layout: layout2,
48227
+ panelDataArray
48228
+ } = eagerValuesRef.current;
48229
+ const {
48230
+ collapsedSize: prevCollapsedSize = 0,
48231
+ collapsible: prevCollapsible
48232
+ } = prevConstraints;
48233
+ const {
48234
+ collapsedSize: nextCollapsedSize = 0,
48235
+ collapsible: nextCollapsible,
48236
+ maxSize: nextMaxSize = 100,
48237
+ minSize: nextMinSize = 0
48238
+ } = panelData.constraints;
48239
+ const {
48240
+ panelSize: prevPanelSize
48241
+ } = panelDataHelper(panelDataArray, panelData, layout2);
48242
+ if (prevPanelSize == null) {
48243
+ return;
48244
+ }
48245
+ if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
48246
+ if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) {
48247
+ resizePanel2(panelData, nextCollapsedSize);
48248
+ }
48249
+ } else if (prevPanelSize < nextMinSize) {
48250
+ resizePanel2(panelData, nextMinSize);
48251
+ } else if (prevPanelSize > nextMaxSize) {
48252
+ resizePanel2(panelData, nextMaxSize);
48253
+ }
48254
+ }, [resizePanel2]);
48255
+ const startDragging = useCallback((dragHandleId, event) => {
48256
+ const {
48257
+ direction: direction2
48258
+ } = committedValuesRef.current;
48259
+ const {
48260
+ layout: layout2
48261
+ } = eagerValuesRef.current;
48262
+ if (!panelGroupElementRef.current) {
48263
+ return;
48264
+ }
48265
+ const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
48266
+ assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
48267
+ const initialCursorPosition = getResizeEventCursorPosition(direction2, event);
48268
+ setDragState({
48269
+ dragHandleId,
48270
+ dragHandleRect: handleElement.getBoundingClientRect(),
48271
+ initialCursorPosition,
48272
+ initialLayout: layout2
48273
+ });
48274
+ }, []);
48275
+ const stopDragging = useCallback(() => {
48276
+ setDragState(null);
48277
+ }, []);
48278
+ const unregisterPanel = useCallback((panelData) => {
48279
+ const {
48280
+ panelDataArray
48281
+ } = eagerValuesRef.current;
48282
+ const index2 = findPanelDataIndex(panelDataArray, panelData);
48283
+ if (index2 >= 0) {
48284
+ panelDataArray.splice(index2, 1);
48285
+ delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
48286
+ eagerValuesRef.current.panelDataArrayChanged = true;
48287
+ forceUpdate();
48288
+ }
48289
+ }, [forceUpdate]);
48290
+ const context = useMemo(() => ({
48291
+ collapsePanel,
48292
+ direction,
48293
+ dragState,
48294
+ expandPanel,
48295
+ getPanelSize,
48296
+ getPanelStyle,
48297
+ groupId,
48298
+ isPanelCollapsed,
48299
+ isPanelExpanded,
48300
+ reevaluatePanelConstraints,
48301
+ registerPanel,
48302
+ registerResizeHandle,
48303
+ resizePanel: resizePanel2,
48304
+ startDragging,
48305
+ stopDragging,
48306
+ unregisterPanel,
48307
+ panelGroupElement: panelGroupElementRef.current
48308
+ }), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle, resizePanel2, startDragging, stopDragging, unregisterPanel]);
48309
+ const style2 = {
48310
+ display: "flex",
48311
+ flexDirection: direction === "horizontal" ? "row" : "column",
48312
+ height: "100%",
48313
+ overflow: "hidden",
48314
+ width: "100%"
48315
+ };
48316
+ return createElement(PanelGroupContext.Provider, {
48317
+ value: context
48318
+ }, createElement(Type, {
48319
+ ...rest,
48320
+ children: children2,
48321
+ className: classNameFromProps,
48322
+ id: idFromProps,
48323
+ ref: panelGroupElementRef,
48324
+ style: {
48325
+ ...style2,
48326
+ ...styleFromProps
48327
+ },
48328
+ // CSS selectors
48329
+ [DATA_ATTRIBUTES.group]: "",
48330
+ [DATA_ATTRIBUTES.groupDirection]: direction,
48331
+ [DATA_ATTRIBUTES.groupId]: groupId
48332
+ }));
48333
+ }
48334
+ const PanelGroup = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef, {
48335
+ ...props,
48336
+ forwardedRef: ref
48337
+ }));
48338
+ PanelGroupWithForwardedRef.displayName = "PanelGroup";
48339
+ PanelGroup.displayName = "forwardRef(PanelGroup)";
48340
+ function findPanelDataIndex(panelDataArray, panelData) {
48341
+ return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
48342
+ }
48343
+ function panelDataHelper(panelDataArray, panelData, layout) {
48344
+ const panelIndex = findPanelDataIndex(panelDataArray, panelData);
48345
+ const isLastPanel = panelIndex === panelDataArray.length - 1;
48346
+ const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
48347
+ const panelSize = layout[panelIndex];
48348
+ return {
48349
+ ...panelData.constraints,
48350
+ panelSize,
48351
+ pivotIndices
48352
+ };
48353
+ }
48354
+ function C(e) {
48355
+ return { "--panel-background": e.colors.background, "--panel-border": e.colors.border, "--panel-handle": e.colors.backgroundSecondary, "--panel-handle-hover": e.colors.backgroundHover, "--panel-handle-active": e.colors.primary, "--panel-button-bg": e.colors.surface, "--panel-button-hover": e.colors.backgroundHover, "--panel-button-border": e.colors.border, "--panel-button-icon": e.colors.textSecondary, "--panel-accent-bg": e.colors.primary + "15" };
48356
+ }
48357
+ const z = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, minPanelWidth: u = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m, preventKeyboardScroll: f = true, disableSwipe: g = false }, v) => {
48358
+ const b = useRef(null), y = C(d);
48359
+ useImperativeHandle(v, () => ({ scrollToPanel: (e) => {
48360
+ if (!b.current) return;
48361
+ const t = b.current, n = t.children[e];
48362
+ if (n) {
48363
+ const e2 = n.offsetLeft;
48364
+ t.scrollTo({ left: e2, behavior: "smooth" });
48365
+ }
48366
+ }, getCurrentPanel: () => {
48367
+ if (!b.current || 0 === b.current.children.length) return 0;
48368
+ const e = b.current, t = e.getBoundingClientRect().left;
48369
+ let n = 0, r2 = 1 / 0;
48370
+ for (let o2 = 0; o2 < e.children.length; o2++) {
48371
+ const i = e.children[o2].getBoundingClientRect(), a2 = Math.abs(i.left - t);
48372
+ a2 < r2 && (r2 = a2, n = o2);
48373
+ }
48374
+ return n;
48375
+ } }));
48376
+ useEffect(() => {
48377
+ if (!f || !b.current) return;
48378
+ const e = b.current, t = (e2) => {
48379
+ const t2 = e2.target;
48380
+ if ("INPUT" === t2.tagName || "TEXTAREA" === t2.tagName || "SELECT" === t2.tagName || t2.isContentEditable || null !== t2.closest(".xterm") || null !== t2.closest('[contenteditable="true"]')) return;
48381
+ [" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e2.key) && e2.preventDefault();
48382
+ };
48383
+ return e.addEventListener("keydown", t), () => {
48384
+ e.removeEventListener("keydown", t);
46579
48385
  };
46580
- }, [events]);
46581
- const handleBack = () => {
46582
- setSelectedIssue(null);
46583
- setOwner("");
46584
- setRepo("");
46585
- if (events) {
46586
- events.emit({
46587
- type: "issue:deselected",
46588
- source: "github-issue-detail-panel",
46589
- timestamp: Date.now(),
46590
- payload: {}
46591
- });
46592
- }
46593
- };
46594
- const containerStyle = {
46595
- display: "flex",
46596
- flexDirection: "column",
46597
- height: "100%",
46598
- backgroundColor: theme2.colors.background,
46599
- overflow: "hidden"
46600
- };
46601
- if (!selectedIssue) {
46602
- return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
46603
- "div",
46604
- {
46605
- style: {
46606
- flex: 1,
46607
- display: "flex",
46608
- flexDirection: "column",
46609
- alignItems: "center",
46610
- justifyContent: "center",
46611
- gap: "16px",
46612
- padding: "24px",
46613
- textAlign: "center"
46614
- },
46615
- children: [
46616
- /* @__PURE__ */ jsx(Github, { size: 48, style: { color: theme2.colors.textMuted } }),
46617
- /* @__PURE__ */ jsxs("div", { children: [
46618
- /* @__PURE__ */ jsx(
46619
- "h3",
46620
- {
46621
- style: {
46622
- margin: 0,
46623
- marginBottom: "8px",
46624
- fontFamily: theme2.fonts.heading,
46625
- fontSize: theme2.fontSizes[3],
46626
- fontWeight: 600,
46627
- color: theme2.colors.text
46628
- },
46629
- children: "No Issue Selected"
46630
- }
46631
- ),
46632
- /* @__PURE__ */ jsx(
46633
- "p",
46634
- {
46635
- style: {
46636
- margin: 0,
46637
- fontFamily: theme2.fonts.body,
46638
- fontSize: theme2.fontSizes[1],
46639
- color: theme2.colors.textSecondary,
46640
- lineHeight: 1.5
46641
- },
46642
- children: "Click on an issue in the Issues panel to view its details."
46643
- }
46644
- )
46645
- ] })
46646
- ]
46647
- }
46648
- ) });
46649
- }
46650
- const isOpen = selectedIssue.state === "open";
46651
- const statusColor = isOpen ? theme2.colors.success || "#22c55e" : theme2.colors.error || "#ef4444";
46652
- const statusBg = `${statusColor}20`;
46653
- const statusLabel = isOpen ? "Open" : "Closed";
46654
- return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
46655
- /* @__PURE__ */ jsxs(
46656
- "div",
46657
- {
46658
- style: {
46659
- height: "40px",
46660
- minHeight: "40px",
46661
- padding: "0 12px",
46662
- borderBottom: `1px solid ${theme2.colors.border}`,
46663
- backgroundColor: theme2.colors.backgroundSecondary,
46664
- display: "flex",
46665
- alignItems: "center",
46666
- gap: "12px",
46667
- boxSizing: "border-box"
46668
- },
46669
- children: [
46670
- /* @__PURE__ */ jsxs(
46671
- "span",
46672
- {
46673
- style: {
46674
- fontFamily: theme2.fonts.monospace,
46675
- fontSize: theme2.fontSizes[0],
46676
- color: theme2.colors.textSecondary
46677
- },
46678
- children: [
46679
- "#",
46680
- selectedIssue.number
46681
- ]
46682
- }
46683
- ),
46684
- /* @__PURE__ */ jsx(
46685
- "span",
46686
- {
46687
- style: {
46688
- display: "inline-flex",
46689
- alignItems: "center",
46690
- gap: "6px",
46691
- padding: "4px 10px",
46692
- borderRadius: "999px",
46693
- backgroundColor: statusBg,
46694
- color: statusColor,
46695
- fontFamily: theme2.fonts.heading,
46696
- fontSize: theme2.fontSizes[0],
46697
- fontWeight: 600,
46698
- textTransform: "uppercase"
46699
- },
46700
- children: statusLabel
46701
- }
46702
- ),
46703
- /* @__PURE__ */ jsxs(
46704
- "span",
46705
- {
46706
- style: {
46707
- color: theme2.colors.textSecondary,
46708
- fontSize: theme2.fontSizes[0],
46709
- fontFamily: theme2.fonts.body
46710
- },
46711
- children: [
46712
- "by ",
46713
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: selectedIssue.user.login }),
46714
- " ",
46715
- formatDate$1(selectedIssue.created_at)
46716
- ]
46717
- }
46718
- ),
46719
- selectedIssue.comments > 0 && /* @__PURE__ */ jsxs(
46720
- "span",
46721
- {
46722
- style: {
46723
- display: "inline-flex",
46724
- alignItems: "center",
46725
- gap: "4px",
46726
- color: theme2.colors.textSecondary,
46727
- fontSize: theme2.fontSizes[0]
46728
- },
46729
- children: [
46730
- /* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
46731
- selectedIssue.comments
46732
- ]
46733
- }
46734
- ),
46735
- selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
46736
- "span",
46737
- {
46738
- style: {
46739
- display: "inline-flex",
46740
- alignItems: "center",
46741
- gap: "4px",
46742
- color: theme2.colors.textSecondary,
46743
- fontSize: theme2.fontSizes[0],
46744
- fontFamily: theme2.fonts.body
46745
- },
46746
- children: [
46747
- "assigned to",
46748
- " ",
46749
- selectedIssue.assignees.map((assignee, index2) => /* @__PURE__ */ jsxs("span", { children: [
46750
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: assignee.login }),
46751
- index2 < selectedIssue.assignees.length - 1 && ", "
46752
- ] }, assignee.login))
46753
- ]
48386
+ }, [f]);
48387
+ const w = o.length, x = 2 * u;
48388
+ let S2;
48389
+ S2 = 1 === w || 2 === w ? "100%" : `max(${u}px, ${100 * p2}%)`;
48390
+ const R = React2__default.useId().replace(/:/g, "_");
48391
+ return jsxs(Fragment, { children: [
48392
+ 2 === w && /* @__PURE__ */ jsx("style", { children: `
48393
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
48394
+ width: 100%;
46754
48395
  }
46755
- ),
46756
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
46757
- /* @__PURE__ */ jsx(
46758
- "a",
46759
- {
46760
- href: selectedIssue.html_url,
46761
- target: "_blank",
46762
- rel: "noopener noreferrer",
46763
- title: "View on GitHub",
46764
- style: {
46765
- display: "inline-flex",
46766
- alignItems: "center",
46767
- justifyContent: "center",
46768
- width: "28px",
46769
- height: "28px",
46770
- padding: 0,
46771
- border: `1px solid ${theme2.colors.border}`,
46772
- borderRadius: "6px",
46773
- backgroundColor: theme2.colors.background,
46774
- color: theme2.colors.textSecondary,
46775
- textDecoration: "none"
46776
- },
46777
- children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
48396
+ @container (min-width: ${x}px) {
48397
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
48398
+ width: 50%;
48399
+ }
46778
48400
  }
46779
- ),
46780
- /* @__PURE__ */ jsx(
46781
- "button",
46782
- {
46783
- type: "button",
46784
- onClick: handleBack,
46785
- title: "Close",
46786
- style: {
46787
- display: "inline-flex",
46788
- alignItems: "center",
46789
- justifyContent: "center",
46790
- width: "28px",
46791
- height: "28px",
46792
- padding: 0,
46793
- border: `1px solid ${theme2.colors.border}`,
46794
- borderRadius: "6px",
46795
- backgroundColor: theme2.colors.background,
46796
- color: theme2.colors.textSecondary,
46797
- cursor: "pointer"
46798
- },
46799
- children: /* @__PURE__ */ jsx(X, { size: 16 })
48401
+ ` }),
48402
+ /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...y, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": S2, "--snap-carousel-panel-count": w, "--snap-carousel-two-panel-threshold": `${x}px` }, onScroll: (e) => {
48403
+ if (!m || !b.current || 0 === b.current.children.length) return;
48404
+ const t = b.current, n = t.getBoundingClientRect().left;
48405
+ let r2 = 0, o2 = 1 / 0;
48406
+ for (let i = 0; i < t.children.length; i++) {
48407
+ const e2 = t.children[i].getBoundingClientRect(), a2 = Math.abs(e2.left - n);
48408
+ a2 < o2 && (o2 = a2, r2 = i);
48409
+ }
48410
+ m(r2);
48411
+ }, "data-panel-count": w, "data-carousel-id": R, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
48412
+ ] });
48413
+ });
48414
+ z.displayName = "SnapCarousel";
48415
+ var le$1, se;
48416
+ (se = le$1 || (le$1 = {})).DragStart = "dragStart", se.DragMove = "dragMove", se.DragEnd = "dragEnd", se.DragCancel = "dragCancel", se.DragOver = "dragOver", se.RegisterDroppable = "registerDroppable", se.SetDroppableDisabled = "setDroppableDisabled", se.UnregisterDroppable = "unregisterDroppable";
48417
+ const de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
48418
+ var Te, Ae;
48419
+ (Ae = Te || (Te = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
48420
+ var _e$1, je, He, Ke;
48421
+ (je = _e$1 || (_e$1 = {})).Click = "click", je.DragStart = "dragstart", je.Keydown = "keydown", je.ContextMenu = "contextmenu", je.Resize = "resize", je.SelectionChange = "selectionchange", je.VisibilityChange = "visibilitychange", (Ke = He || (He = {})).Space = "Space", Ke.Down = "ArrowDown", Ke.Right = "ArrowRight", Ke.Left = "ArrowLeft", Ke.Up = "ArrowUp", Ke.Esc = "Escape", Ke.Enter = "Enter", Ke.Tab = "Tab";
48422
+ ({ start: [He.Space, He.Enter], cancel: [He.Esc], end: [He.Space, He.Enter, He.Tab] });
48423
+ var rt, ot;
48424
+ (ot = rt || (rt = {}))[ot.RightClick = 2] = "RightClick";
48425
+ var at, lt, st, ct;
48426
+ (lt = at || (at = {}))[lt.Pointer = 0] = "Pointer", lt[lt.DraggableRect = 1] = "DraggableRect", (ct = st || (st = {}))[ct.TreeOrder = 0] = "TreeOrder", ct[ct.ReversedTreeOrder = 1] = "ReversedTreeOrder";
48427
+ ({ x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } });
48428
+ var pt, ht, mt;
48429
+ (ht = pt || (pt = {}))[ht.Always = 0] = "Always", ht[ht.BeforeDragging = 1] = "BeforeDragging", ht[ht.WhileDragging = 2] = "WhileDragging", (mt || (mt = {})).Optimized = "optimized";
48430
+ ({ droppable: { strategy: pt.WhileDragging, frequency: mt.Optimized } });
48431
+ /* @__PURE__ */ createContext({ ...de, scaleX: 1, scaleY: 1 });
48432
+ var $t, Bt;
48433
+ (Bt = $t || ($t = {}))[Bt.Uninitialized = 0] = "Uninitialized", Bt[Bt.Initializing = 1] = "Initializing", Bt[Bt.Initialized = 2] = "Initialized";
48434
+ var Ut;
48435
+ (() => {
48436
+ if ("undefined" != typeof window) {
48437
+ const e = window;
48438
+ return e.__principlemd_theme_context__ || (e.__principlemd_theme_context__ = createContext(void 0)), e.__principlemd_theme_context__;
48439
+ }
48440
+ return Ut || (Ut = createContext(void 0)), Ut;
48441
+ })();
48442
+ var _e = Object.defineProperty;
48443
+ var Ee = (o, e, t) => e in o ? _e(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
48444
+ var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
48445
+ class De {
48446
+ constructor() {
48447
+ le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
48448
+ le(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
48449
+ }
48450
+ /**
48451
+ * Load all user-created workspace presets
48452
+ */
48453
+ async loadWorkspacePresets() {
48454
+ try {
48455
+ const e = localStorage.getItem(this.PRESETS_KEY);
48456
+ return e ? JSON.parse(e) : {};
48457
+ } catch (e) {
48458
+ return console.error("Failed to load workspace presets:", e), {};
48459
+ }
48460
+ }
48461
+ /**
48462
+ * Save workspace presets
48463
+ */
48464
+ async saveWorkspacePresets(e) {
48465
+ try {
48466
+ localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
48467
+ } catch (t) {
48468
+ throw console.error("Failed to save workspace presets:", t), t;
48469
+ }
48470
+ }
48471
+ /**
48472
+ * Load repository-specific workspace state
48473
+ */
48474
+ async loadRepositoryState(e) {
48475
+ try {
48476
+ const t = `${this.REPO_STATE_PREFIX}${e}`, r2 = localStorage.getItem(t);
48477
+ return r2 ? JSON.parse(r2) : null;
48478
+ } catch (t) {
48479
+ return console.error(
48480
+ `Failed to load repository state for ${e}:`,
48481
+ t
48482
+ ), null;
48483
+ }
48484
+ }
48485
+ /**
48486
+ * Save repository-specific workspace state
48487
+ */
48488
+ async saveRepositoryState(e, t) {
48489
+ try {
48490
+ const r2 = `${this.REPO_STATE_PREFIX}${e}`;
48491
+ localStorage.setItem(r2, JSON.stringify(t));
48492
+ } catch (r2) {
48493
+ throw console.error(
48494
+ `Failed to save repository state for ${e}:`,
48495
+ r2
48496
+ ), r2;
48497
+ }
48498
+ }
48499
+ /**
48500
+ * Load all repository states
48501
+ */
48502
+ async loadAllRepositoryStates() {
48503
+ try {
48504
+ const e = {};
48505
+ for (let t = 0; t < localStorage.length; t++) {
48506
+ const r2 = localStorage.key(t);
48507
+ if (r2 && r2.startsWith(this.REPO_STATE_PREFIX)) {
48508
+ const s2 = r2.substring(this.REPO_STATE_PREFIX.length), i = localStorage.getItem(r2);
48509
+ if (i)
48510
+ try {
48511
+ e[s2] = JSON.parse(i);
48512
+ } catch (l) {
48513
+ console.error(
48514
+ `Failed to parse repository state for ${s2}:`,
48515
+ l
48516
+ );
46800
48517
  }
46801
- )
46802
- ]
48518
+ }
46803
48519
  }
46804
- ),
46805
- /* @__PURE__ */ jsx(
46806
- "div",
46807
- {
46808
- style: {
46809
- padding: "16px",
46810
- borderBottom: `1px solid ${theme2.colors.border}`
48520
+ return e;
48521
+ } catch (e) {
48522
+ return console.error("Failed to load all repository states:", e), {};
48523
+ }
48524
+ }
48525
+ }
48526
+ class O {
48527
+ /**
48528
+ * Configure a custom storage adapter (for Electron IPC or remote storage)
48529
+ */
48530
+ static setAdapter(e) {
48531
+ this.adapter = e;
48532
+ }
48533
+ /**
48534
+ * Get all workspace layouts (including built-in)
48535
+ */
48536
+ static async getWorkspaceLayouts() {
48537
+ const e = this.getBuiltInWorkspaceLayouts();
48538
+ return {
48539
+ ...await this.adapter.loadWorkspacePresets(),
48540
+ ...e
48541
+ };
48542
+ }
48543
+ /**
48544
+ * Get a specific workspace layout by ID
48545
+ */
48546
+ static async getWorkspaceLayout(e) {
48547
+ return (await this.getWorkspaceLayouts())[e] || null;
48548
+ }
48549
+ /**
48550
+ * Create a new workspace layout
48551
+ */
48552
+ static async createWorkspaceLayout(e) {
48553
+ const t = await this.adapter.loadWorkspacePresets(), r2 = this.generateWorkspaceId(e.name), s2 = {
48554
+ id: r2,
48555
+ name: e.name,
48556
+ description: e.description,
48557
+ layout: e.layout,
48558
+ defaultSizes: e.defaultSizes,
48559
+ defaultCollapsed: e.defaultCollapsed,
48560
+ createdAt: Date.now(),
48561
+ updatedAt: Date.now(),
48562
+ isBuiltIn: false
48563
+ }, i = {
48564
+ ...t,
48565
+ [r2]: s2
48566
+ };
48567
+ return await this.adapter.saveWorkspacePresets(i), s2;
48568
+ }
48569
+ /**
48570
+ * Update an existing workspace layout
48571
+ */
48572
+ static async updateWorkspaceLayout(e, t) {
48573
+ const r2 = await this.adapter.loadWorkspacePresets(), s2 = r2[e];
48574
+ if (!s2)
48575
+ return console.error(`Workspace layout ${e} not found`), null;
48576
+ if (s2.isBuiltIn)
48577
+ return console.error(`Cannot update built-in workspace layout ${e}`), null;
48578
+ const i = {
48579
+ ...s2,
48580
+ ...t,
48581
+ id: e,
48582
+ // Preserve ID
48583
+ createdAt: s2.createdAt,
48584
+ // Preserve creation time
48585
+ updatedAt: Date.now()
48586
+ }, l = {
48587
+ ...r2,
48588
+ [e]: i
48589
+ };
48590
+ return await this.adapter.saveWorkspacePresets(l), i;
48591
+ }
48592
+ /**
48593
+ * Delete a workspace layout
48594
+ */
48595
+ static async deleteWorkspaceLayout(e) {
48596
+ const t = await this.adapter.loadWorkspacePresets(), r2 = t[e];
48597
+ if (!r2)
48598
+ return console.error(`Workspace layout ${e} not found`), false;
48599
+ if (r2.isBuiltIn)
48600
+ return console.error(`Cannot delete built-in workspace layout ${e}`), false;
48601
+ const s2 = { ...t };
48602
+ return delete s2[e], await this.adapter.saveWorkspacePresets(s2), true;
48603
+ }
48604
+ /**
48605
+ * Get repository state (which workspace + current sizes/collapsed)
48606
+ */
48607
+ static async getRepositoryState(e) {
48608
+ return await this.adapter.loadRepositoryState(e);
48609
+ }
48610
+ /**
48611
+ * Set repository state (which workspace + current sizes/collapsed/layout)
48612
+ */
48613
+ static async setRepositoryState(e, t) {
48614
+ await this.adapter.saveRepositoryState(e, t);
48615
+ }
48616
+ /**
48617
+ * Update only sizes in repository state
48618
+ */
48619
+ static async updateRepositorySizes(e, t) {
48620
+ const r2 = await this.getRepositoryState(e);
48621
+ r2 && await this.setRepositoryState(e, {
48622
+ ...r2,
48623
+ sizes: t
48624
+ });
48625
+ }
48626
+ /**
48627
+ * Update only collapsed state in repository state
48628
+ */
48629
+ static async updateRepositoryCollapsed(e, t) {
48630
+ const r2 = await this.getRepositoryState(e);
48631
+ r2 && await this.setRepositoryState(e, {
48632
+ ...r2,
48633
+ collapsed: t
48634
+ });
48635
+ }
48636
+ /**
48637
+ * Check if repository state differs from workspace defaults
48638
+ */
48639
+ static hasStateDeviation(e, t) {
48640
+ const r2 = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : false, s2 = t.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(t.defaultCollapsed) : false;
48641
+ return { hasSizeDeviation: r2, hasCollapsedDeviation: s2 };
48642
+ }
48643
+ /**
48644
+ * Update workspace defaults from repository state
48645
+ */
48646
+ static async updateWorkspaceFromRepositoryState(e, t) {
48647
+ const r2 = await this.getWorkspaceLayout(e), s2 = await this.getRepositoryState(t);
48648
+ if (!r2 || !s2 || r2.isBuiltIn) {
48649
+ console.error(
48650
+ "Cannot update built-in workspace or workspace/state not found"
48651
+ );
48652
+ return;
48653
+ }
48654
+ await this.updateWorkspaceLayout(e, {
48655
+ defaultSizes: s2.sizes,
48656
+ defaultCollapsed: s2.collapsed
48657
+ });
48658
+ }
48659
+ /**
48660
+ * Reset repository state to workspace defaults
48661
+ */
48662
+ static async resetRepositoryToWorkspaceDefaults(e, t) {
48663
+ const r2 = await this.getWorkspaceLayout(t);
48664
+ if (!r2) {
48665
+ console.error(`Workspace ${t} not found`);
48666
+ return;
48667
+ }
48668
+ const s2 = await this.getRepositoryState(e);
48669
+ s2 && await this.setRepositoryState(e, {
48670
+ ...s2,
48671
+ sizes: r2.defaultSizes || { left: 20, middle: 45, right: 35 },
48672
+ collapsed: r2.defaultCollapsed || { left: false, right: false }
48673
+ });
48674
+ }
48675
+ /**
48676
+ * Check if a layout matches a workspace layout
48677
+ */
48678
+ static isLayoutMatchingWorkspace(e, t) {
48679
+ return this.areLayoutsEqual(e, t.layout);
48680
+ }
48681
+ /**
48682
+ * Find workspace ID that matches the given layout
48683
+ */
48684
+ static async findMatchingWorkspace(e) {
48685
+ const t = await this.getWorkspaceLayouts();
48686
+ for (const [r2, s2] of Object.entries(t))
48687
+ if (this.isLayoutMatchingWorkspace(e, s2))
48688
+ return r2;
48689
+ return null;
48690
+ }
48691
+ /**
48692
+ * Deep comparison of two panel layouts
48693
+ */
48694
+ static areLayoutsEqual(e, t) {
48695
+ return JSON.stringify(e) === JSON.stringify(t);
48696
+ }
48697
+ /**
48698
+ * Generate a unique ID from a workspace name
48699
+ */
48700
+ static generateWorkspaceId(e) {
48701
+ return `${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}-${Date.now()}`;
48702
+ }
48703
+ /**
48704
+ * Get built-in workspace layouts
48705
+ */
48706
+ static getBuiltInWorkspaceLayouts() {
48707
+ const e = Date.now();
48708
+ return {
48709
+ "project-management": {
48710
+ id: "project-management",
48711
+ name: "Project Management",
48712
+ description: "Tasks, dependencies, issues, file tree, docs, drawings, multi terminal, city visualization, code viewer, markdown slides, and excalidraw",
48713
+ layout: {
48714
+ left: {
48715
+ type: "tabs",
48716
+ panels: [
48717
+ "tasks",
48718
+ "dependencies",
48719
+ "gitIssues",
48720
+ "fileTree",
48721
+ "docs",
48722
+ "drawings"
48723
+ ],
48724
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48725
+ },
48726
+ middle: "multiTerminal",
48727
+ right: {
48728
+ type: "tabs",
48729
+ panels: [
48730
+ "cityVisualization",
48731
+ "codeViewer",
48732
+ "markdownViewer",
48733
+ "excalidrawDiagram"
48734
+ ],
48735
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48736
+ }
46811
48737
  },
46812
- children: /* @__PURE__ */ jsx(
46813
- "h1",
46814
- {
46815
- style: {
46816
- margin: 0,
46817
- fontFamily: theme2.fonts.heading,
46818
- fontSize: theme2.fontSizes[4] || 20,
46819
- fontWeight: 600,
46820
- color: theme2.colors.text,
46821
- lineHeight: 1.3
46822
- },
46823
- children: selectedIssue.title
48738
+ defaultSizes: { left: 20, middle: 45, right: 35 },
48739
+ defaultCollapsed: { left: false, right: false },
48740
+ createdAt: e,
48741
+ updatedAt: e,
48742
+ isBuiltIn: true
48743
+ },
48744
+ "code-review": {
48745
+ id: "code-review",
48746
+ name: "Code Review",
48747
+ description: "Git changes, pull requests, and file tree on left, git diff and code viewer in middle, city map on right",
48748
+ layout: {
48749
+ left: {
48750
+ type: "tabs",
48751
+ panels: ["gitChanges", "gitPullRequests", "fileTree"],
48752
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48753
+ },
48754
+ middle: {
48755
+ type: "tabs",
48756
+ panels: ["gitDiff", "codeViewer"],
48757
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48758
+ },
48759
+ right: "cityVisualization"
48760
+ },
48761
+ defaultSizes: { left: 20, middle: 50, right: 30 },
48762
+ defaultCollapsed: { left: false, right: false },
48763
+ createdAt: e,
48764
+ updatedAt: e,
48765
+ isBuiltIn: true
48766
+ },
48767
+ documentation: {
48768
+ id: "documentation",
48769
+ name: "Documentation",
48770
+ description: "Docs, markdown viewer, and code viewer",
48771
+ layout: {
48772
+ left: "docs",
48773
+ middle: "markdownViewer",
48774
+ right: "codeViewer"
48775
+ },
48776
+ defaultSizes: { left: 20, middle: 50, right: 30 },
48777
+ defaultCollapsed: { left: false, right: true },
48778
+ createdAt: e,
48779
+ updatedAt: e,
48780
+ isBuiltIn: true
48781
+ },
48782
+ "agent-work": {
48783
+ id: "agent-work",
48784
+ name: "Agent Work",
48785
+ description: "Tasks, agent sessions, file tree, agent context, git changes, docs, multi terminal, city map, agent events, code viewer, and markdown slides",
48786
+ layout: {
48787
+ left: {
48788
+ type: "tabs",
48789
+ panels: [
48790
+ "tasks",
48791
+ "agentSessions",
48792
+ "fileTree",
48793
+ "agentContext",
48794
+ "gitChanges",
48795
+ "docs"
48796
+ ],
48797
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48798
+ },
48799
+ middle: "multiTerminal",
48800
+ right: {
48801
+ type: "tabs",
48802
+ panels: [
48803
+ "cityVisualization",
48804
+ "agentEvents",
48805
+ "codeViewer",
48806
+ "markdownViewer"
48807
+ ],
48808
+ config: { defaultActiveTab: 0, tabPosition: "top" }
46824
48809
  }
46825
- )
46826
- }
46827
- ),
46828
- /* @__PURE__ */ jsx(
46829
- "div",
46830
- {
46831
- style: {
46832
- flex: 1,
46833
- overflow: "auto"
46834
48810
  },
46835
- children: selectedIssue.body ? /* @__PURE__ */ jsx(
46836
- DocumentView,
46837
- {
46838
- content: selectedIssue.body,
46839
- theme: theme2,
46840
- maxWidth: "100%",
46841
- transparentBackground: true
48811
+ defaultSizes: { left: 20, middle: 45, right: 35 },
48812
+ defaultCollapsed: { left: false, right: false },
48813
+ createdAt: e,
48814
+ updatedAt: e,
48815
+ isBuiltIn: true
48816
+ },
48817
+ "quality-check": {
48818
+ id: "quality-check",
48819
+ name: "Quality Check",
48820
+ description: "Package information, tools, and dependencies on left; city visualization map in middle; multi terminal and code viewer on right (collapsed)",
48821
+ layout: {
48822
+ left: {
48823
+ type: "tabs",
48824
+ panels: ["packageInfo", "tools", "dependencies"],
48825
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48826
+ },
48827
+ middle: "cityVisualization",
48828
+ right: {
48829
+ type: "tabs",
48830
+ panels: ["multiTerminal", "codeViewer"],
48831
+ config: { defaultActiveTab: 0, tabPosition: "top" }
46842
48832
  }
46843
- ) : /* @__PURE__ */ jsx(
46844
- "div",
46845
- {
46846
- style: {
46847
- padding: "40px",
46848
- textAlign: "center",
46849
- color: theme2.colors.textMuted,
46850
- fontFamily: theme2.fonts.body,
46851
- fontSize: theme2.fontSizes[1],
46852
- fontStyle: "italic"
46853
- },
46854
- children: "No description provided."
48833
+ },
48834
+ defaultSizes: { left: 20, middle: 45, right: 35 },
48835
+ defaultCollapsed: { left: false, right: true },
48836
+ createdAt: e,
48837
+ updatedAt: e,
48838
+ isBuiltIn: true
48839
+ },
48840
+ drawing: {
48841
+ id: "drawing",
48842
+ name: "Drawing",
48843
+ description: "Drawings and docs, excalidraw diagram, multi terminal and markdown viewer",
48844
+ layout: {
48845
+ left: {
48846
+ type: "tabs",
48847
+ panels: ["drawings", "docs"],
48848
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48849
+ },
48850
+ middle: "excalidrawDiagram",
48851
+ right: {
48852
+ type: "tabs",
48853
+ panels: ["multiTerminal", "markdownViewer"],
48854
+ config: { defaultActiveTab: 0, tabPosition: "top" }
46855
48855
  }
46856
- )
48856
+ },
48857
+ defaultSizes: { left: 20, middle: 50, right: 30 },
48858
+ defaultCollapsed: { left: false, right: true },
48859
+ createdAt: e,
48860
+ updatedAt: e,
48861
+ isBuiltIn: true
48862
+ },
48863
+ "old-school": {
48864
+ id: "old-school",
48865
+ name: "Old School",
48866
+ description: "File tree, search, git changes, and docs on left; code viewer and markdown viewer in middle; multi terminal and city map on right (collapsed)",
48867
+ layout: {
48868
+ left: {
48869
+ type: "tabs",
48870
+ panels: ["fileTree", "search", "gitChanges", "docs"],
48871
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48872
+ },
48873
+ middle: {
48874
+ type: "tabs",
48875
+ panels: ["codeViewer", "markdownViewer"],
48876
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48877
+ },
48878
+ right: {
48879
+ type: "tabs",
48880
+ panels: ["multiTerminal", "cityVisualization"],
48881
+ config: { defaultActiveTab: 0, tabPosition: "top" }
48882
+ }
48883
+ },
48884
+ defaultSizes: { left: 20, middle: 50, right: 30 },
48885
+ defaultCollapsed: { left: false, right: true },
48886
+ createdAt: e,
48887
+ updatedAt: e,
48888
+ isBuiltIn: true
48889
+ },
48890
+ "principal-office": {
48891
+ id: "principal-office",
48892
+ name: "Principal Office",
48893
+ description: "Alexandria docs on left, MDX editor in middle, multi terminal on right",
48894
+ layout: {
48895
+ left: "docs",
48896
+ middle: "mdxEditor",
48897
+ right: "multiTerminal"
48898
+ },
48899
+ defaultSizes: { left: 20, middle: 50, right: 30 },
48900
+ defaultCollapsed: { left: false, right: false },
48901
+ createdAt: e,
48902
+ updatedAt: e,
48903
+ isBuiltIn: true
46857
48904
  }
46858
- )
46859
- ] });
46860
- };
46861
- const GitHubIssueDetailPanel = (props) => {
46862
- return /* @__PURE__ */ jsx(GitHubIssueDetailPanelContent, { ...props });
46863
- };
46864
- const GitHubIssueDetailPanelMetadata = {
46865
- id: "github-issue-detail",
46866
- name: "GitHub Issue Details",
46867
- description: "View detailed information about a GitHub issue",
46868
- icon: "circle-dot",
46869
- version: "0.1.0",
46870
- slices: [],
46871
- surfaces: ["panel"]
46872
- };
48905
+ };
48906
+ }
48907
+ /**
48908
+ * Initialize workspace layouts with built-in defaults if none exist
48909
+ */
48910
+ static async initializeWorkspaceLayouts() {
48911
+ const e = await this.adapter.loadWorkspacePresets();
48912
+ Object.keys(e).length;
48913
+ }
48914
+ }
48915
+ le(O, "adapter", new De());
48916
+ function gt(o, e, t, r2) {
48917
+ useEffect(() => {
48918
+ const s2 = e.on(
48919
+ "panel:focus",
48920
+ (l) => {
48921
+ l.payload.panelId === o && t();
48922
+ }
48923
+ );
48924
+ return () => {
48925
+ s2();
48926
+ };
48927
+ }, [o, e, t, r2]);
48928
+ }
46873
48929
  const formatDate = (dateString) => {
46874
48930
  const date = new Date(dateString);
46875
48931
  const now = /* @__PURE__ */ new Date();
@@ -46952,7 +49008,7 @@ const ReactionsDisplay = ({ reactions }) => {
46952
49008
  },
46953
49009
  children: [
46954
49010
  /* @__PURE__ */ jsx("span", { children: emoji }),
46955
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: count })
49011
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: theme2.colors.textSecondary }, children: count })
46956
49012
  ]
46957
49013
  },
46958
49014
  emoji
@@ -46999,6 +49055,7 @@ const CommentEvent = ({ event }) => {
46999
49055
  "span",
47000
49056
  {
47001
49057
  style: {
49058
+ fontFamily: theme2.fonts.body,
47002
49059
  color: theme2.colors.textMuted,
47003
49060
  fontSize: theme2.fontSizes[0]
47004
49061
  },
@@ -47016,6 +49073,7 @@ const CommentEvent = ({ event }) => {
47016
49073
  borderRadius: "4px",
47017
49074
  backgroundColor: theme2.colors.backgroundSecondary,
47018
49075
  border: `1px solid ${theme2.colors.border}`,
49076
+ fontFamily: theme2.fonts.body,
47019
49077
  fontSize: theme2.fontSizes[0],
47020
49078
  color: theme2.colors.textSecondary,
47021
49079
  textTransform: "uppercase"
@@ -47116,6 +49174,7 @@ const ReviewEvent = ({ event }) => {
47116
49174
  "span",
47117
49175
  {
47118
49176
  style: {
49177
+ fontFamily: theme2.fonts.body,
47119
49178
  color: config.color,
47120
49179
  fontWeight: 500,
47121
49180
  fontSize: theme2.fontSizes[1]
@@ -47127,6 +49186,7 @@ const ReviewEvent = ({ event }) => {
47127
49186
  "span",
47128
49187
  {
47129
49188
  style: {
49189
+ fontFamily: theme2.fonts.body,
47130
49190
  color: theme2.colors.textMuted,
47131
49191
  fontSize: theme2.fontSizes[0]
47132
49192
  },
@@ -47265,6 +49325,7 @@ const CommitEvent = ({ event }) => {
47265
49325
  {
47266
49326
  style: {
47267
49327
  marginTop: "4px",
49328
+ fontFamily: theme2.fonts.body,
47268
49329
  fontSize: theme2.fontSizes[0],
47269
49330
  color: theme2.colors.textMuted
47270
49331
  },
@@ -47277,6 +49338,7 @@ const CommitEvent = ({ event }) => {
47277
49338
  {
47278
49339
  style: {
47279
49340
  marginLeft: "8px",
49341
+ fontFamily: theme2.fonts.body,
47280
49342
  color: theme2.colors.success || "#22c55e"
47281
49343
  },
47282
49344
  children: [
@@ -47304,6 +49366,7 @@ const SimpleEvent = ({ icon, actor, action, timestamp }) => {
47304
49366
  gap: "12px",
47305
49367
  padding: "8px 16px",
47306
49368
  borderBottom: `1px solid ${theme2.colors.border}`,
49369
+ fontFamily: theme2.fonts.body,
47307
49370
  fontSize: theme2.fontSizes[0],
47308
49371
  color: theme2.colors.textSecondary
47309
49372
  },
@@ -47320,9 +49383,9 @@ const SimpleEvent = ({ icon, actor, action, timestamp }) => {
47320
49383
  }
47321
49384
  ),
47322
49385
  /* @__PURE__ */ jsx(Avatar, { user: actor, size: 20 }),
47323
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, color: theme2.colors.text }, children: actor.login }),
49386
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, fontWeight: 500, color: theme2.colors.text }, children: actor.login }),
47324
49387
  action,
47325
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textMuted, marginLeft: "auto" }, children: formatDate(timestamp) })
49388
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: theme2.colors.textMuted, marginLeft: "auto" }, children: formatDate(timestamp) })
47326
49389
  ]
47327
49390
  }
47328
49391
  );
@@ -47336,7 +49399,7 @@ const LabelEvent = ({ event }) => {
47336
49399
  icon: /* @__PURE__ */ jsx(Tag, { size: 14, style: { color: theme2.colors.textMuted } }),
47337
49400
  actor: event.actor,
47338
49401
  action: /* @__PURE__ */ jsxs(Fragment, { children: [
47339
- /* @__PURE__ */ jsx("span", { children: isLabeled ? "added" : "removed" }),
49402
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body }, children: isLabeled ? "added" : "removed" }),
47340
49403
  /* @__PURE__ */ jsx(
47341
49404
  "span",
47342
49405
  {
@@ -47345,6 +49408,7 @@ const LabelEvent = ({ event }) => {
47345
49408
  borderRadius: "12px",
47346
49409
  backgroundColor: `#${event.label.color}`,
47347
49410
  color: parseInt(event.label.color, 16) > 8388607 ? "#000" : "#fff",
49411
+ fontFamily: theme2.fonts.body,
47348
49412
  fontSize: "11px",
47349
49413
  fontWeight: 500
47350
49414
  },
@@ -47365,8 +49429,8 @@ const AssignEvent = ({ event }) => {
47365
49429
  icon: isAssigned ? /* @__PURE__ */ jsx(UserPlus, { size: 14, style: { color: theme2.colors.textMuted } }) : /* @__PURE__ */ jsx(UserMinus, { size: 14, style: { color: theme2.colors.textMuted } }),
47366
49430
  actor: event.actor,
47367
49431
  action: /* @__PURE__ */ jsxs(Fragment, { children: [
47368
- /* @__PURE__ */ jsx("span", { children: isAssigned ? "assigned" : "unassigned" }),
47369
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, color: theme2.colors.text }, children: event.assignee.login })
49432
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body }, children: isAssigned ? "assigned" : "unassigned" }),
49433
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, fontWeight: 500, color: theme2.colors.text }, children: event.assignee.login })
47370
49434
  ] }),
47371
49435
  timestamp: event.created_at
47372
49436
  }
@@ -47383,8 +49447,8 @@ const ReviewRequestEvent = ({ event }) => {
47383
49447
  icon: /* @__PURE__ */ jsx(Eye, { size: 14, style: { color: theme2.colors.textMuted } }),
47384
49448
  actor: event.review_requester,
47385
49449
  action: /* @__PURE__ */ jsxs(Fragment, { children: [
47386
- /* @__PURE__ */ jsx("span", { children: isRequested ? "requested review from" : "removed review request from" }),
47387
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, color: theme2.colors.text }, children: reviewer })
49450
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body }, children: isRequested ? "requested review from" : "removed review request from" }),
49451
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, fontWeight: 500, color: theme2.colors.text }, children: reviewer })
47388
49452
  ] }),
47389
49453
  timestamp: event.created_at
47390
49454
  }
@@ -47398,8 +49462,8 @@ const MergeEvent = ({ event }) => {
47398
49462
  icon: /* @__PURE__ */ jsx(GitMerge, { size: 14, style: { color: theme2.colors.success || "#22c55e" } }),
47399
49463
  actor: event.actor,
47400
49464
  action: /* @__PURE__ */ jsxs(Fragment, { children: [
47401
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.success || "#22c55e", fontWeight: 500 }, children: "merged" }),
47402
- /* @__PURE__ */ jsx("span", { children: "commit" }),
49465
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: theme2.colors.success || "#22c55e", fontWeight: 500 }, children: "merged" }),
49466
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body }, children: "commit" }),
47403
49467
  /* @__PURE__ */ jsx(
47404
49468
  "code",
47405
49469
  {
@@ -47430,6 +49494,7 @@ const StateEvent = ({ event }) => {
47430
49494
  "span",
47431
49495
  {
47432
49496
  style: {
49497
+ fontFamily: theme2.fonts.body,
47433
49498
  color: isClosed ? theme2.colors.error || "#ef4444" : theme2.colors.success || "#22c55e",
47434
49499
  fontWeight: 500
47435
49500
  },
@@ -47452,7 +49517,7 @@ const RefEvent = ({ event }) => {
47452
49517
  {
47453
49518
  icon: /* @__PURE__ */ jsx(Rocket, { size: 14, style: { color: theme2.colors.textMuted } }),
47454
49519
  actor: event.actor,
47455
- action: /* @__PURE__ */ jsx("span", { children: labels[event.event] || event.event }),
49520
+ action: /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body }, children: labels[event.event] || event.event }),
47456
49521
  timestamp: event.created_at
47457
49522
  }
47458
49523
  );
@@ -47486,6 +49551,7 @@ const InlineReviewComment = ({ comment: comment2 }) => {
47486
49551
  "span",
47487
49552
  {
47488
49553
  style: {
49554
+ fontFamily: theme2.fonts.body,
47489
49555
  fontWeight: 600,
47490
49556
  color: theme2.colors.text,
47491
49557
  fontSize: theme2.fontSizes[0]
@@ -47497,6 +49563,7 @@ const InlineReviewComment = ({ comment: comment2 }) => {
47497
49563
  "span",
47498
49564
  {
47499
49565
  style: {
49566
+ fontFamily: theme2.fonts.body,
47500
49567
  color: theme2.colors.textMuted,
47501
49568
  fontSize: theme2.fontSizes[0]
47502
49569
  },
@@ -47517,7 +49584,7 @@ const InlineReviewComment = ({ comment: comment2 }) => {
47517
49584
  children: comment2.path
47518
49585
  }
47519
49586
  ),
47520
- comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
49587
+ comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
47521
49588
  "line ",
47522
49589
  comment2.line
47523
49590
  ] })
@@ -47600,6 +49667,15 @@ const TimelineEventRenderer = ({ event }) => {
47600
49667
  };
47601
49668
  const GitHubMessagesPanelContent = ({ context, events }) => {
47602
49669
  const { theme: theme2 } = useTheme();
49670
+ const panelRef = useRef(null);
49671
+ gt(
49672
+ "github-messages",
49673
+ events,
49674
+ () => {
49675
+ var _a;
49676
+ return (_a = panelRef.current) == null ? void 0 : _a.focus();
49677
+ }
49678
+ );
47603
49679
  const messagesSlice = context.getSlice("github-messages");
47604
49680
  const isLoading = context.isSliceLoading("github-messages");
47605
49681
  const hasData = context.hasSlice("github-messages");
@@ -47644,10 +49720,11 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47644
49720
  flexDirection: "column",
47645
49721
  height: "100%",
47646
49722
  backgroundColor: theme2.colors.background,
47647
- overflow: "hidden"
49723
+ overflow: "hidden",
49724
+ outline: "none"
47648
49725
  };
47649
49726
  if (isLoading && !hasData) {
47650
- return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
49727
+ return /* @__PURE__ */ jsx("div", { ref: panelRef, tabIndex: -1, style: containerStyle, children: /* @__PURE__ */ jsx(
47651
49728
  "div",
47652
49729
  {
47653
49730
  style: {
@@ -47655,6 +49732,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47655
49732
  display: "flex",
47656
49733
  alignItems: "center",
47657
49734
  justifyContent: "center",
49735
+ fontFamily: theme2.fonts.body,
47658
49736
  color: theme2.colors.textSecondary
47659
49737
  },
47660
49738
  children: "Loading conversation..."
@@ -47662,7 +49740,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47662
49740
  ) });
47663
49741
  }
47664
49742
  if (!messagesData || !messagesData.target) {
47665
- return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
49743
+ return /* @__PURE__ */ jsx("div", { ref: panelRef, tabIndex: -1, style: containerStyle, children: /* @__PURE__ */ jsxs(
47666
49744
  "div",
47667
49745
  {
47668
49746
  style: {
@@ -47711,7 +49789,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47711
49789
  ) });
47712
49790
  }
47713
49791
  if (messagesData.error) {
47714
- return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
49792
+ return /* @__PURE__ */ jsx("div", { ref: panelRef, tabIndex: -1, style: containerStyle, children: /* @__PURE__ */ jsxs(
47715
49793
  "div",
47716
49794
  {
47717
49795
  style: {
@@ -47721,6 +49799,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47721
49799
  alignItems: "center",
47722
49800
  justifyContent: "center",
47723
49801
  gap: "8px",
49802
+ fontFamily: theme2.fonts.body,
47724
49803
  color: theme2.colors.error || "#ef4444"
47725
49804
  },
47726
49805
  children: [
@@ -47731,31 +49810,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47731
49810
  ) });
47732
49811
  }
47733
49812
  const { target, timeline, reviewComments } = messagesData;
47734
- const isPR = target.type === "pull_request";
47735
- const getStatusConfig = () => {
47736
- if (isPR && target.merged) {
47737
- return {
47738
- icon: /* @__PURE__ */ jsx(GitMerge, { size: 14 }),
47739
- color: "#a855f7",
47740
- // purple for merged
47741
- label: "Merged"
47742
- };
47743
- }
47744
- if (target.state === "open") {
47745
- return {
47746
- icon: isPR ? /* @__PURE__ */ jsx(GitPullRequest, { size: 14 }) : /* @__PURE__ */ jsx(CircleDot, { size: 14 }),
47747
- color: theme2.colors.success || "#22c55e",
47748
- label: target.draft ? "Draft" : "Open"
47749
- };
47750
- }
47751
- return {
47752
- icon: /* @__PURE__ */ jsx(CircleDot, { size: 14 }),
47753
- color: theme2.colors.error || "#ef4444",
47754
- label: "Closed"
47755
- };
47756
- };
47757
- const statusConfig = getStatusConfig();
47758
- return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
49813
+ return /* @__PURE__ */ jsxs("div", { ref: panelRef, tabIndex: -1, style: containerStyle, children: [
47759
49814
  /* @__PURE__ */ jsxs(
47760
49815
  "div",
47761
49816
  {
@@ -47771,45 +49826,6 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47771
49826
  boxSizing: "border-box"
47772
49827
  },
47773
49828
  children: [
47774
- /* @__PURE__ */ jsxs(
47775
- "span",
47776
- {
47777
- style: {
47778
- display: "inline-flex",
47779
- alignItems: "center",
47780
- gap: "6px",
47781
- fontFamily: theme2.fonts.monospace,
47782
- fontSize: theme2.fontSizes[0],
47783
- color: theme2.colors.textSecondary
47784
- },
47785
- children: [
47786
- isPR ? /* @__PURE__ */ jsx(GitPullRequest, { size: 14 }) : /* @__PURE__ */ jsx(CircleDot, { size: 14 }),
47787
- "#",
47788
- target.number
47789
- ]
47790
- }
47791
- ),
47792
- /* @__PURE__ */ jsxs(
47793
- "span",
47794
- {
47795
- style: {
47796
- display: "inline-flex",
47797
- alignItems: "center",
47798
- gap: "6px",
47799
- padding: "4px 10px",
47800
- borderRadius: "999px",
47801
- backgroundColor: `${statusConfig.color}20`,
47802
- color: statusConfig.color,
47803
- fontFamily: theme2.fonts.heading,
47804
- fontSize: theme2.fontSizes[0],
47805
- fontWeight: 600
47806
- },
47807
- children: [
47808
- statusConfig.icon,
47809
- statusConfig.label
47810
- ]
47811
- }
47812
- ),
47813
49829
  /* @__PURE__ */ jsx(
47814
49830
  "span",
47815
49831
  {
@@ -47818,28 +49834,13 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47818
49834
  overflow: "hidden",
47819
49835
  textOverflow: "ellipsis",
47820
49836
  whiteSpace: "nowrap",
49837
+ fontFamily: theme2.fonts.heading,
47821
49838
  color: theme2.colors.text,
47822
49839
  fontSize: theme2.fontSizes[1]
47823
49840
  },
47824
49841
  children: target.title
47825
49842
  }
47826
49843
  ),
47827
- /* @__PURE__ */ jsxs(
47828
- "span",
47829
- {
47830
- style: {
47831
- display: "inline-flex",
47832
- alignItems: "center",
47833
- gap: "4px",
47834
- color: theme2.colors.textSecondary,
47835
- fontSize: theme2.fontSizes[0]
47836
- },
47837
- children: [
47838
- /* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
47839
- timeline.filter((e) => e.event === "commented" || e.event === "reviewed").length
47840
- ]
47841
- }
47842
- ),
47843
49844
  /* @__PURE__ */ jsx(
47844
49845
  "a",
47845
49846
  {
@@ -47895,6 +49896,7 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
47895
49896
  padding: "12px 16px",
47896
49897
  backgroundColor: theme2.colors.backgroundSecondary,
47897
49898
  borderBottom: `1px solid ${theme2.colors.border}`,
49899
+ fontFamily: theme2.fonts.heading,
47898
49900
  fontWeight: 600,
47899
49901
  fontSize: theme2.fontSizes[0],
47900
49902
  color: theme2.colors.textSecondary,
@@ -47933,7 +49935,7 @@ const OwnerRepositoriesPanelContent = ({
47933
49935
  selectedRepository,
47934
49936
  defaultShowSearch = false
47935
49937
  }) => {
47936
- var _a, _b, _c, _d, _e, _f;
49938
+ var _a, _b, _c, _d, _e2, _f;
47937
49939
  const { theme: theme2 } = useTheme();
47938
49940
  const [selectedRepoId, setSelectedRepoId] = useState(null);
47939
49941
  const [sortField, setSortField] = useState("updated");
@@ -47956,7 +49958,7 @@ const OwnerRepositoriesPanelContent = ({
47956
49958
  const isLoading = context.isSliceLoading("owner-repositories");
47957
49959
  ((_c = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _c.owner) ?? null;
47958
49960
  const repositories = ((_d = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _d.repositories) ?? [];
47959
- const error = ((_e = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _e.error) ?? null;
49961
+ const error = ((_e2 = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _e2.error) ?? null;
47960
49962
  ((_f = ownerSlice == null ? void 0 : ownerSlice.data) == null ? void 0 : _f.isAuthenticated) ?? false;
47961
49963
  const handleRefresh = useCallback(() => {
47962
49964
  events.emit({