gsarti commited on
Commit
9a0e9d6
1 Parent(s): 8250853
src/backend/gradio_highlightedtextbox/templates/component/index.js CHANGED
@@ -7,34 +7,34 @@ const {
7
  detach: fe,
8
  element: de,
9
  empty: Sl,
10
- ensure_array_like: tt,
11
  get_all_dirty_from_scope: Tl,
12
  get_slot_changes: Ll,
13
  init: jl,
14
  insert: _e,
15
  safe_not_equal: Fl,
16
- set_data: Je,
17
  space: Me,
18
- text: Ke,
19
  toggle_class: V,
20
  transition_in: Hl,
21
  transition_out: Ml,
22
  update_slot_base: Nl
23
  } = window.__gradio__svelte__internal;
24
- function lt(l, e, t) {
25
  const n = l.slice();
26
  return n[8] = e[t][0], n[9] = e[t][1], n[11] = t, n;
27
  }
28
- function nt(l) {
29
- let e, t, n, i, o, s, f = tt(Object.entries(
30
  /*_color_map*/
31
  l[4]
32
  )), a = [];
33
  for (let _ = 0; _ < f.length; _ += 1)
34
- a[_] = it(lt(l, f, _));
35
  return {
36
  c() {
37
- e = de("span"), e.textContent = "·", t = Me(), n = de("div"), i = de("span"), o = Ke(
38
  /*legend_label*/
39
  l[3]
40
  ), s = Me();
@@ -72,7 +72,7 @@ function nt(l) {
72
  /*info*/
73
  _[5] != null
74
  ), r & /*legend_label*/
75
- 8 && Je(
76
  o,
77
  /*legend_label*/
78
  _[3]
@@ -86,14 +86,14 @@ function nt(l) {
86
  _[5] != null
87
  ), r & /*Object, _color_map, info*/
88
  48) {
89
- f = tt(Object.entries(
90
  /*_color_map*/
91
  _[4]
92
  ));
93
  let u;
94
  for (u = 0; u < f.length; u += 1) {
95
- const c = lt(_, f, u);
96
- a[u] ? a[u].p(c, r) : (a[u] = it(c), a[u].c(), a[u].m(n, null));
97
  }
98
  for (; u < a.length; u += 1)
99
  a[u].d(1);
@@ -108,14 +108,14 @@ function nt(l) {
108
  }
109
  };
110
  }
111
- function it(l) {
112
  let e, t = (
113
  /*category*/
114
  l[8] + ""
115
  ), n, i, o;
116
  return {
117
  c() {
118
- e = de("div"), n = Ke(t), i = Me(), U(e, "class", "category-label svelte-vm3q5z"), U(e, "style", o = "background-color:" + /*color*/
119
  l[9].secondary), V(
120
  e,
121
  "has-info",
@@ -129,7 +129,7 @@ function it(l) {
129
  p(s, f) {
130
  f & /*_color_map*/
131
  16 && t !== (t = /*category*/
132
- s[8] + "") && Je(n, t), f & /*_color_map*/
133
  16 && o !== (o = "background-color:" + /*color*/
134
  s[9].secondary) && U(e, "style", o), f & /*info*/
135
  32 && V(
@@ -144,11 +144,11 @@ function it(l) {
144
  }
145
  };
146
  }
147
- function ot(l) {
148
  let e, t;
149
  return {
150
  c() {
151
- e = de("div"), t = Ke(
152
  /*info*/
153
  l[5]
154
  ), U(e, "class", "title-with-highlights-info svelte-vm3q5z");
@@ -158,7 +158,7 @@ function ot(l) {
158
  },
159
  p(n, i) {
160
  i & /*info*/
161
- 32 && Je(
162
  t,
163
  /*info*/
164
  n[5]
@@ -184,9 +184,9 @@ function Vl(l) {
184
  l[6],
185
  null
186
  );
187
- let r = i && nt(l), u = (
188
  /*info*/
189
- l[5] && ot(l)
190
  );
191
  return {
192
  c() {
@@ -235,8 +235,8 @@ function Vl(l) {
235
  16 && (i = Object.keys(
236
  /*_color_map*/
237
  c[4]
238
- ).length !== 0), i ? r ? r.p(c, m) : (r = nt(c), r.c(), r.m(e, null)) : r && (r.d(1), r = null), /*info*/
239
- c[5] ? u ? u.p(c, m) : (u = ot(c), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null);
240
  },
241
  i(c) {
242
  f || (Hl(_, c), f = !0);
@@ -282,17 +282,17 @@ const Rl = (l) => l;
282
  function Dl(l, e) {
283
  return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function";
284
  }
285
- const tl = typeof window < "u";
286
- let st = tl ? () => window.performance.now() : () => Date.now(), ll = tl ? (l) => requestAnimationFrame(l) : Re;
287
  const Ce = /* @__PURE__ */ new Set();
288
- function nl(l) {
289
  Ce.forEach((e) => {
290
  e.c(l) || (Ce.delete(e), e.f());
291
- }), Ce.size !== 0 && ll(nl);
292
  }
293
  function Bl(l) {
294
  let e;
295
- return Ce.size === 0 && ll(nl), {
296
  promise: new Promise((t) => {
297
  Ce.add(e = { c: l, f: t });
298
  }),
@@ -301,7 +301,7 @@ function Bl(l) {
301
  }
302
  };
303
  }
304
- function ft(l, { delay: e = 0, duration: t = 400, easing: n = Rl } = {}) {
305
  const i = +getComputedStyle(l).opacity;
306
  return {
307
  delay: e,
@@ -337,34 +337,34 @@ function Pl(l, e = Re) {
337
  }
338
  return { set: i, update: o, subscribe: s };
339
  }
340
- function _t(l) {
341
  return Object.prototype.toString.call(l) === "[object Date]";
342
  }
343
- function Ye(l, e, t, n) {
344
- if (typeof t == "number" || _t(t)) {
345
  const i = n - t, o = (t - e) / (l.dt || 1 / 60), s = l.opts.stiffness * i, f = l.opts.damping * o, a = (s - f) * l.inv_mass, _ = (o + a) * l.dt;
346
- return Math.abs(_) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, _t(t) ? new Date(t.getTime() + _) : t + _);
347
  } else {
348
  if (Array.isArray(t))
349
  return t.map(
350
- (i, o) => Ye(l, e[o], t[o], n[o])
351
  );
352
  if (typeof t == "object") {
353
  const i = {};
354
  for (const o in t)
355
- i[o] = Ye(l, e[o], t[o], n[o]);
356
  return i;
357
  } else
358
  throw new Error(`Cannot spring ${typeof t} values`);
359
  }
360
  }
361
- function at(l, e = {}) {
362
  const t = Pl(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e;
363
  let s, f, a, _ = l, r = l, u = 1, c = 0, m = !1;
364
  function k(T, S = {}) {
365
  r = T;
366
  const y = a = {};
367
- return l == null || S.hard || j.stiffness >= 1 && j.damping >= 1 ? (m = !0, s = st(), _ = T, t.set(l = r), Promise.resolve()) : (S.soft && (c = 1 / ((S.soft === !0 ? 0.5 : +S.soft) * 60), u = 0), f || (s = st(), m = !1, f = Bl((d) => {
368
  if (m)
369
  return m = !1, f = null, !1;
370
  u = Math.min(u + c, 1);
@@ -373,7 +373,7 @@ function at(l, e = {}) {
373
  opts: j,
374
  settled: !0,
375
  dt: (d - s) * 60 / 1e3
376
- }, L = Ye(C, _, l, r);
377
  return s = d, _ = l, t.set(l = L), C.settled && (f = null), !C.settled;
378
  })), new Promise((d) => {
379
  f.promise.then(() => {
@@ -400,13 +400,13 @@ const {
400
  insert: Il,
401
  noop: We,
402
  safe_not_equal: Ul,
403
- svg_element: rt
404
  } = window.__gradio__svelte__internal;
405
  function Xl(l) {
406
  let e, t;
407
  return {
408
  c() {
409
- e = rt("svg"), t = rt("polyline"), le(t, "points", "20 6 9 17 4 12"), le(e, "xmlns", "http://www.w3.org/2000/svg"), le(e, "viewBox", "2 0 20 20"), le(e, "fill", "none"), le(e, "stroke", "currentColor"), le(e, "stroke-width", "3"), le(e, "stroke-linecap", "round"), le(e, "stroke-linejoin", "round");
410
  },
411
  m(n, i) {
412
  Il(n, e, i), Ol(e, t);
@@ -419,69 +419,69 @@ function Xl(l) {
419
  }
420
  };
421
  }
422
- class il extends Zl {
423
  constructor(e) {
424
  super(), Wl(this, e, null, Xl, Ul, {});
425
  }
426
  }
427
  const {
428
- SvelteComponent: Yl,
429
- append: ut,
430
  attr: re,
431
- detach: Gl,
432
- init: Jl,
433
- insert: Kl,
434
  noop: Ie,
435
- safe_not_equal: Ql,
436
  svg_element: Ue
437
  } = window.__gradio__svelte__internal;
438
- function xl(l) {
439
  let e, t, n;
440
  return {
441
  c() {
442
  e = Ue("svg"), t = Ue("path"), n = Ue("path"), re(t, "fill", "currentColor"), re(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), re(n, "fill", "currentColor"), re(n, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), re(e, "xmlns", "http://www.w3.org/2000/svg"), re(e, "viewBox", "0 0 33 33"), re(e, "color", "currentColor");
443
  },
444
  m(i, o) {
445
- Kl(i, e, o), ut(e, t), ut(e, n);
446
  },
447
  p: Ie,
448
  i: Ie,
449
  o: Ie,
450
  d(i) {
451
- i && Gl(e);
452
  }
453
  };
454
  }
455
- class $l extends Yl {
456
  constructor(e) {
457
- super(), Jl(this, e, null, xl, Ql, {});
458
  }
459
  }
460
  const {
461
- SvelteComponent: en,
462
- add_render_callback: tn,
463
- append: ln,
464
  attr: ue,
465
- check_outros: nn,
466
- create_bidirectional_transition: ct,
467
  create_component: ol,
468
  destroy_component: sl,
469
  detach: fl,
470
  element: _l,
471
- group_outros: on,
472
- init: sn,
473
  insert: al,
474
- listen: fn,
475
  mount_component: rl,
476
- safe_not_equal: _n,
477
- space: an,
478
- toggle_class: dt,
479
  transition_in: Fe,
480
  transition_out: De
481
- } = window.__gradio__svelte__internal, { onDestroy: rn } = window.__gradio__svelte__internal;
482
- function mt(l) {
483
  let e, t, n, i;
484
- return t = new il({}), {
485
  c() {
486
  e = _l("span"), ol(t.$$.fragment), ue(e, "class", "check svelte-qjb524"), ue(e, "aria-roledescription", "Value copied"), ue(e, "aria-label", "Copied");
487
  },
@@ -489,28 +489,28 @@ function mt(l) {
489
  al(o, e, s), rl(t, e, null), i = !0;
490
  },
491
  i(o) {
492
- i || (Fe(t.$$.fragment, o), o && tn(() => {
493
- i && (n || (n = ct(e, ft, {}, !0)), n.run(1));
494
  }), i = !0);
495
  },
496
  o(o) {
497
- De(t.$$.fragment, o), o && (n || (n = ct(e, ft, {}, !1)), n.run(0)), i = !1;
498
  },
499
  d(o) {
500
  o && fl(e), sl(t), o && n && n.end();
501
  }
502
  };
503
  }
504
- function un(l) {
505
  let e, t, n, i, o, s;
506
- t = new $l({});
507
  let f = (
508
  /*copied*/
509
- l[0] && mt()
510
  );
511
  return {
512
  c() {
513
- e = _l("button"), ol(t.$$.fragment), n = an(), f && f.c(), ue(e, "title", "Copy text to clipboard"), ue(e, "aria-roledescription", "Copy value"), ue(e, "aria-label", "Copy"), ue(e, "class", "svelte-qjb524"), dt(
514
  e,
515
  "copied",
516
  /*copied*/
@@ -518,7 +518,7 @@ function un(l) {
518
  );
519
  },
520
  m(a, _) {
521
- al(a, e, _), rl(t, e, null), ln(e, n), f && f.m(e, null), i = !0, o || (s = fn(
522
  e,
523
  "click",
524
  /*handle_copy*/
@@ -528,10 +528,10 @@ function un(l) {
528
  p(a, [_]) {
529
  /*copied*/
530
  a[0] ? f ? _ & /*copied*/
531
- 1 && Fe(f, 1) : (f = mt(), f.c(), Fe(f, 1), f.m(e, null)) : f && (on(), De(f, 1, 1, () => {
532
  f = null;
533
- }), nn()), (!i || _ & /*copied*/
534
- 1) && dt(
535
  e,
536
  "copied",
537
  /*copied*/
@@ -549,7 +549,7 @@ function un(l) {
549
  }
550
  };
551
  }
552
- function cn(l, e, t) {
553
  let n = !1, { value: i } = e, o;
554
  function s() {
555
  t(0, n = !0), o && clearTimeout(o), o = setTimeout(
@@ -562,90 +562,81 @@ function cn(l, e, t) {
562
  async function f() {
563
  "clipboard" in navigator && (await navigator.clipboard.writeText(i), s());
564
  }
565
- return rn(() => {
566
  o && clearTimeout(o);
567
  }), l.$$set = (a) => {
568
  "value" in a && t(2, i = a.value);
569
  }, [n, f, i];
570
  }
571
- class dn extends en {
572
  constructor(e) {
573
- super(), sn(this, e, cn, un, _n, { value: 2 });
574
  }
575
  }
576
  const {
577
- SvelteComponent: mn,
578
  attr: Ve,
579
- create_component: gn,
580
- destroy_component: hn,
581
- detach: bn,
582
- element: wn,
583
- init: vn,
584
- insert: pn,
585
- listen: kn,
586
- mount_component: yn,
587
- noop: Cn,
588
- safe_not_equal: qn,
589
- transition_in: Sn,
590
- transition_out: Tn
591
- } = window.__gradio__svelte__internal, { createEventDispatcher: Ln } = window.__gradio__svelte__internal;
592
- function jn(l) {
593
- let e, t, n, i, o;
594
- return t = new il({}), {
595
  c() {
596
- e = wn("button"), gn(t.$$.fragment), Ve(e, "title", "Remove highlights"), Ve(e, "aria-roledescription", "Remove highlights"), Ve(e, "aria-label", "Remove highlights"), Ve(e, "class", "svelte-1ga0gmr");
597
  },
598
- m(s, f) {
599
- pn(s, e, f), yn(t, e, null), n = !0, i || (o = kn(
600
  e,
601
  "click",
602
  /*click_handler*/
603
  l[1]
604
- ), i = !0);
605
- },
606
- p: Cn,
607
- i(s) {
608
- n || (Sn(t.$$.fragment, s), n = !0);
609
- },
610
- o(s) {
611
- Tn(t.$$.fragment, s), n = !1;
612
  },
613
- d(s) {
614
- s && bn(e), hn(t), i = !1, o();
 
 
 
615
  }
616
  };
617
  }
618
- function Fn(l) {
619
- const e = Ln();
620
  return [e, () => e("clear")];
621
  }
622
- class Hn extends mn {
623
  constructor(e) {
624
- super(), vn(this, e, Fn, jn, qn, {});
625
  }
626
  }
627
  const {
628
- SvelteComponent: Mn,
629
- append: Nn,
630
- attr: Vn,
631
- check_outros: gt,
632
  create_component: ul,
633
  destroy_component: cl,
634
- detach: zn,
635
- element: En,
636
- group_outros: ht,
637
- init: Rn,
638
- insert: Dn,
639
  mount_component: dl,
640
- noop: Bn,
641
- safe_not_equal: Pn,
642
- space: Zn,
643
  transition_in: ie,
644
  transition_out: pe
645
- } = window.__gradio__svelte__internal, { createEventDispatcher: On } = window.__gradio__svelte__internal;
646
- function bt(l) {
647
  let e, t;
648
- return e = new Hn({}), e.$on(
649
  "clear",
650
  /*clear_handler*/
651
  l[4]
@@ -656,7 +647,7 @@ function bt(l) {
656
  m(n, i) {
657
  dl(e, n, i), t = !0;
658
  },
659
- p: Bn,
660
  i(n) {
661
  t || (ie(e.$$.fragment, n), t = !0);
662
  },
@@ -668,9 +659,9 @@ function bt(l) {
668
  }
669
  };
670
  }
671
- function wt(l) {
672
  let e, t;
673
- return e = new dn({ props: { value: (
674
  /*value*/
675
  l[0]
676
  ) } }), {
@@ -697,31 +688,31 @@ function wt(l) {
697
  }
698
  };
699
  }
700
- function An(l) {
701
  let e, t, n, i = (
702
  /*show_remove_tags_button*/
703
- l[2] && bt(l)
704
  ), o = (
705
  /*show_copy_button*/
706
- l[1] && wt(l)
707
  );
708
  return {
709
  c() {
710
- e = En("div"), i && i.c(), t = Zn(), o && o.c(), Vn(e, "class", "svelte-1bqqv16");
711
  },
712
  m(s, f) {
713
- Dn(s, e, f), i && i.m(e, null), Nn(e, t), o && o.m(e, null), n = !0;
714
  },
715
  p(s, [f]) {
716
  /*show_remove_tags_button*/
717
  s[2] ? i ? (i.p(s, f), f & /*show_remove_tags_button*/
718
- 4 && ie(i, 1)) : (i = bt(s), i.c(), ie(i, 1), i.m(e, t)) : i && (ht(), pe(i, 1, 1, () => {
719
  i = null;
720
- }), gt()), /*show_copy_button*/
721
  s[1] ? o ? (o.p(s, f), f & /*show_copy_button*/
722
- 2 && ie(o, 1)) : (o = wt(s), o.c(), ie(o, 1), o.m(e, null)) : o && (ht(), pe(o, 1, 1, () => {
723
  o = null;
724
- }), gt());
725
  },
726
  i(s) {
727
  n || (ie(i), ie(o), n = !0);
@@ -730,27 +721,27 @@ function An(l) {
730
  pe(i), pe(o), n = !1;
731
  },
732
  d(s) {
733
- s && zn(e), i && i.d(), o && o.d();
734
  }
735
  };
736
  }
737
- function Wn(l, e, t) {
738
  let { value: n } = e, { show_copy_button: i = !1 } = e, { show_remove_tags_button: o = !1 } = e;
739
- const s = On(), f = () => s("clear");
740
  return l.$$set = (a) => {
741
  "value" in a && t(0, n = a.value), "show_copy_button" in a && t(1, i = a.show_copy_button), "show_remove_tags_button" in a && t(2, o = a.show_remove_tags_button);
742
  }, [n, i, o, s, f];
743
  }
744
- class In extends Mn {
745
  constructor(e) {
746
- super(), Rn(this, e, Wn, An, Pn, {
747
  value: 0,
748
  show_copy_button: 1,
749
  show_remove_tags_button: 2
750
  });
751
  }
752
  }
753
- const vt = [
754
  "red",
755
  "green",
756
  "blue",
@@ -761,7 +752,7 @@ const vt = [
761
  "cyan",
762
  "lime",
763
  "pink"
764
- ], Un = [
765
  { color: "red", primary: 600, secondary: 100 },
766
  { color: "green", primary: 600, secondary: 100 },
767
  { color: "blue", primary: 600, secondary: 100 },
@@ -772,7 +763,7 @@ const vt = [
772
  { color: "cyan", primary: 600, secondary: 100 },
773
  { color: "lime", primary: 500, secondary: 100 },
774
  { color: "pink", primary: 600, secondary: 100 }
775
- ], pt = {
776
  inherit: "inherit",
777
  current: "currentColor",
778
  transparent: "transparent",
@@ -1064,17 +1055,17 @@ const vt = [
1064
  900: "#881337",
1065
  950: "#4c0519"
1066
  }
1067
- }, kt = Un.reduce(
1068
  (l, { color: e, primary: t, secondary: n }) => ({
1069
  ...l,
1070
  [e]: {
1071
- primary: pt[e][t],
1072
- secondary: pt[e][n]
1073
  }
1074
  }),
1075
  {}
1076
- ), Xn = (l) => vt[l % vt.length];
1077
- function yt(l, e, t) {
1078
  if (!t) {
1079
  var n = document.createElement("canvas");
1080
  t = n.getContext("2d");
@@ -1083,24 +1074,24 @@ function yt(l, e, t) {
1083
  const [i, o, s] = t.getImageData(0, 0, 1, 1).data;
1084
  return t.clearRect(0, 0, 1, 1), `rgba(${i}, ${o}, ${s}, ${255 / e})`;
1085
  }
1086
- function Yn(l, e, t) {
1087
  var n = {};
1088
  for (const i in l) {
1089
  const o = l[i].trim();
1090
- o in kt ? n[i] = kt[o] : n[i] = {
1091
- primary: e ? yt(l[i], 1, t) : l[i],
1092
- secondary: e ? yt(l[i], 0.5, t) : l[i]
1093
  };
1094
  }
1095
  return n;
1096
  }
1097
- function Gn(l, e) {
1098
  let t = [], n = null, i = null;
1099
  for (const [o, s] of l)
1100
  e === "empty" && s === null || e === "equal" && i === s ? n = n ? n + o : o : (n !== null && t.push([n, i]), n = o, i = s);
1101
  return n !== null && t.push([n, i]), t;
1102
  }
1103
- function Jn(l) {
1104
  const e = window.getSelection();
1105
  if (e.rangeCount > 0) {
1106
  const t = document.createRange();
@@ -1108,7 +1099,7 @@ function Jn(l) {
1108
  }
1109
  return -1;
1110
  }
1111
- function Kn(l, e) {
1112
  var t = document.createTreeWalker(l, NodeFilter.SHOW_TEXT), n = t.nextNode();
1113
  if (!n || !n.textContent)
1114
  return null;
@@ -1121,34 +1112,34 @@ function Kn(l, e) {
1121
  return { node: n, offset: o };
1122
  }
1123
  const {
1124
- SvelteComponent: Qn,
1125
  add_render_callback: ml,
1126
- append: Ct,
1127
  attr: X,
1128
- binding_callbacks: qt,
1129
  bubble: je,
1130
- create_component: St,
1131
- destroy_component: Tt,
1132
  detach: Pe,
1133
- element: Qe,
1134
- init: xn,
1135
  insert: Ze,
1136
  listen: x,
1137
- mount_component: Lt,
1138
- run_all: $n,
1139
- safe_not_equal: ei,
1140
- set_data: ti,
1141
- space: jt,
1142
- text: li,
1143
- toggle_class: Ft,
1144
- transition_in: Ht,
1145
- transition_out: Mt
1146
- } = window.__gradio__svelte__internal, { beforeUpdate: ni, afterUpdate: ii, createEventDispatcher: oi } = window.__gradio__svelte__internal;
1147
- function si(l) {
1148
  let e;
1149
  return {
1150
  c() {
1151
- e = li(
1152
  /*label*/
1153
  l[0]
1154
  );
@@ -1158,7 +1149,7 @@ function si(l) {
1158
  },
1159
  p(t, n) {
1160
  n[0] & /*label*/
1161
- 1 && ti(
1162
  e,
1163
  /*label*/
1164
  t[0]
@@ -1169,11 +1160,11 @@ function si(l) {
1169
  }
1170
  };
1171
  }
1172
- function fi(l) {
1173
  let e, t, n;
1174
  return {
1175
  c() {
1176
- e = Qe("div"), X(e, "class", "textfield svelte-1atky07"), X(e, "data-testid", "highlighted-textbox"), X(e, "contenteditable", "true"), X(e, "role", "textbox"), X(e, "tabindex", "0"), /*el_text*/
1177
  (l[11] === void 0 || /*marked_el_text*/
1178
  l[12] === void 0) && ml(() => (
1179
  /*div_input_handler_1*/
@@ -1246,15 +1237,15 @@ function fi(l) {
1246
  i[12]);
1247
  },
1248
  d(i) {
1249
- i && Pe(e), l[28](null), t = !1, $n(n);
1250
  }
1251
  };
1252
  }
1253
- function _i(l) {
1254
  let e, t, n;
1255
  return {
1256
  c() {
1257
- e = Qe("div"), X(e, "class", "textfield svelte-1atky07"), X(e, "data-testid", "highlighted-textbox"), X(e, "contenteditable", "false"), /*el_text*/
1258
  (l[11] === void 0 || /*marked_el_text*/
1259
  l[12] === void 0) && ml(() => (
1260
  /*div_input_handler*/
@@ -1287,7 +1278,7 @@ function _i(l) {
1287
  }
1288
  };
1289
  }
1290
- function ai(l) {
1291
  let e, t, n, i, o, s;
1292
  t = new El({
1293
  props: {
@@ -1315,10 +1306,10 @@ function ai(l) {
1315
  /*info*/
1316
  l[2]
1317
  ),
1318
- $$slots: { default: [si] },
1319
  $$scope: { ctx: l }
1320
  }
1321
- }), i = new In({
1322
  props: {
1323
  show_copy_button: (
1324
  /*show_copy_button*/
@@ -1342,13 +1333,13 @@ function ai(l) {
1342
  function f(r, u) {
1343
  return (
1344
  /*disabled*/
1345
- r[9] ? _i : fi
1346
  );
1347
  }
1348
  let a = f(l), _ = a(l);
1349
  return {
1350
  c() {
1351
- e = Qe("label"), St(t.$$.fragment), n = jt(), St(i.$$.fragment), o = jt(), _.c(), X(e, "for", "highlighted-textbox"), X(e, "class", "svelte-1atky07"), Ft(
1352
  e,
1353
  "container",
1354
  /*container*/
@@ -1356,7 +1347,7 @@ function ai(l) {
1356
  );
1357
  },
1358
  m(r, u) {
1359
- Ze(r, e, u), Lt(t, e, null), Ct(e, n), Lt(i, e, null), Ct(e, o), _.m(e, null), s = !0;
1360
  },
1361
  p(r, u) {
1362
  const c = {};
@@ -1384,7 +1375,7 @@ function ai(l) {
1384
  r[14]), u[0] & /*tagged_text*/
1385
  32768 && (m.value = /*tagged_text*/
1386
  r[15]), i.$set(m), a === (a = f(r)) && _ ? _.p(r, u) : (_.d(1), _ = a(r), _ && (_.c(), _.m(e, null))), (!s || u[0] & /*container*/
1387
- 64) && Ft(
1388
  e,
1389
  "container",
1390
  /*container*/
@@ -1392,17 +1383,17 @@ function ai(l) {
1392
  );
1393
  },
1394
  i(r) {
1395
- s || (Ht(t.$$.fragment, r), Ht(i.$$.fragment, r), s = !0);
1396
  },
1397
  o(r) {
1398
- Mt(t.$$.fragment, r), Mt(i.$$.fragment, r), s = !1;
1399
  },
1400
  d(r) {
1401
- r && Pe(e), Tt(t), Tt(i), _.d();
1402
  }
1403
  };
1404
  }
1405
- function ri(l, e, t) {
1406
  const n = typeof document < "u";
1407
  let { value: i = [] } = e, { value_is_output: o = !1 } = e, { label: s } = e, { legend_label: f } = e, { info: a = void 0 } = e, { show_label: _ = !0 } = e, { show_legend: r = !1 } = e, { show_legend_label: u = !1 } = e, { container: c = !0 } = e, { color_map: m = {} } = e, { show_copy_button: k = !1 } = e, { show_remove_tags_button: j = !1 } = e, { disabled: T } = e, S, y = "", d = "", C, L, h = {}, Z = !1, J = "";
1408
  function E() {
@@ -1412,23 +1403,23 @@ function ri(l, e, t) {
1412
  if (i.length > 0) {
1413
  for (let [g, M] of i)
1414
  if (M !== null && !(M in L)) {
1415
- let F = Xn(Object.keys(L).length);
1416
  L[M] = F;
1417
  }
1418
  }
1419
- t(13, h = Yn(L, n, C));
1420
  }
1421
  function O(g) {
1422
  i.length > 0 && g && (t(11, y = i.map(([M, F]) => M).join("")), t(12, d = i.map(([M, F]) => F !== null ? `<mark class="hl ${F}" style="background-color:${h[F].secondary}">${M}</mark>` : M).join("")), t(15, J = i.map(([M, F]) => F !== null ? `<${F}>${M}</${F}>` : M).join("")));
1423
  }
1424
- const R = oi();
1425
- ni(() => {
1426
  S && S.offsetHeight + S.scrollTop > S.scrollHeight - 100;
1427
  });
1428
  function ae() {
1429
  D(), A(), R("change", i), o || R("input", i);
1430
  }
1431
- ii(() => {
1432
  E(), O(o), t(19, o = !1);
1433
  });
1434
  function A() {
@@ -1467,8 +1458,8 @@ function ri(l, e, t) {
1467
  var ee = F.parentElement, be = document.createTextNode(Ne);
1468
  ee.replaceChild(be, F), t(12, d = ee.innerHTML);
1469
  var we = document.createRange(), te = window.getSelection();
1470
- const kl = M + Jn(ee);
1471
- var Q = Kn(ee, kl);
1472
  we.setStart(Q.node, Q.offset), we.setEnd(Q.node, Q.offset), te.removeAllRanges(), te.addRange(we);
1473
  }
1474
  }
@@ -1489,7 +1480,7 @@ function ri(l, e, t) {
1489
  je.call(this, l, g);
1490
  }
1491
  function Oe(g) {
1492
- qt[g ? "unshift" : "push"](() => {
1493
  S = g, t(10, S);
1494
  });
1495
  }
@@ -1497,7 +1488,7 @@ function ri(l, e, t) {
1497
  y = this.textContent, d = this.innerHTML, t(11, y), t(12, d);
1498
  }
1499
  function w(g) {
1500
- qt[g ? "unshift" : "push"](() => {
1501
  S = g, t(10, S);
1502
  });
1503
  }
@@ -1539,14 +1530,14 @@ function ri(l, e, t) {
1539
  pl
1540
  ];
1541
  }
1542
- class ui extends Qn {
1543
  constructor(e) {
1544
- super(), xn(
1545
  this,
1546
  e,
1547
- ri,
1548
- ai,
1549
- ei,
1550
  {
1551
  value: 18,
1552
  value_is_output: 19,
@@ -1568,30 +1559,30 @@ class ui extends Qn {
1568
  }
1569
  }
1570
  const {
1571
- SvelteComponent: ci,
1572
- assign: di,
1573
- create_slot: mi,
1574
- detach: gi,
1575
- element: hi,
1576
- get_all_dirty_from_scope: bi,
1577
- get_slot_changes: wi,
1578
- get_spread_update: vi,
1579
- init: pi,
1580
- insert: ki,
1581
- safe_not_equal: yi,
1582
- set_dynamic_element_data: Nt,
1583
  set_style: z,
1584
  toggle_class: ne,
1585
  transition_in: gl,
1586
  transition_out: hl,
1587
- update_slot_base: Ci
1588
  } = window.__gradio__svelte__internal;
1589
- function qi(l) {
1590
  let e, t, n;
1591
  const i = (
1592
  /*#slots*/
1593
  l[18].default
1594
- ), o = mi(
1595
  i,
1596
  l,
1597
  /*$$scope*/
@@ -1613,13 +1604,13 @@ function qi(l) {
1613
  }
1614
  ], f = {};
1615
  for (let a = 0; a < s.length; a += 1)
1616
- f = di(f, s[a]);
1617
  return {
1618
  c() {
1619
- e = hi(
1620
  /*tag*/
1621
  l[14]
1622
- ), o && o.c(), Nt(
1623
  /*tag*/
1624
  l[14]
1625
  )(e, f), ne(
@@ -1674,31 +1665,31 @@ function qi(l) {
1674
  l[13]}px, 100%))`), z(e, "border-width", "var(--block-border-width)");
1675
  },
1676
  m(a, _) {
1677
- ki(a, e, _), o && o.m(e, null), n = !0;
1678
  },
1679
  p(a, _) {
1680
  o && o.p && (!n || _ & /*$$scope*/
1681
- 131072) && Ci(
1682
  o,
1683
  i,
1684
  a,
1685
  /*$$scope*/
1686
  a[17],
1687
- n ? wi(
1688
  i,
1689
  /*$$scope*/
1690
  a[17],
1691
  _,
1692
  null
1693
- ) : bi(
1694
  /*$$scope*/
1695
  a[17]
1696
  ),
1697
  null
1698
- ), Nt(
1699
  /*tag*/
1700
  a[14]
1701
- )(e, f = vi(s, [
1702
  (!n || _ & /*test_id*/
1703
  128) && { "data-testid": (
1704
  /*test_id*/
@@ -1776,14 +1767,14 @@ function qi(l) {
1776
  hl(o, a), n = !1;
1777
  },
1778
  d(a) {
1779
- a && gi(e), o && o.d(a);
1780
  }
1781
  };
1782
  }
1783
- function Si(l) {
1784
  let e, t = (
1785
  /*tag*/
1786
- l[14] && qi(l)
1787
  );
1788
  return {
1789
  c() {
@@ -1807,7 +1798,7 @@ function Si(l) {
1807
  }
1808
  };
1809
  }
1810
- function Ti(l, e, t) {
1811
  let { $$slots: n = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: s = void 0 } = e, { elem_id: f = "" } = e, { elem_classes: a = [] } = e, { variant: _ = "solid" } = e, { border_mode: r = "base" } = e, { padding: u = !0 } = e, { type: c = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: k = !1 } = e, { container: j = !0 } = e, { visible: T = !0 } = e, { allow_overflow: S = !0 } = e, { scale: y = null } = e, { min_width: d = 0 } = e, C = c === "fieldset" ? "fieldset" : "div";
1812
  const L = (h) => {
1813
  if (h !== void 0) {
@@ -1841,9 +1832,9 @@ function Ti(l, e, t) {
1841
  n
1842
  ];
1843
  }
1844
- class Li extends ci {
1845
  constructor(e) {
1846
- super(), pi(this, e, Ti, Si, yi, {
1847
  height: 0,
1848
  width: 1,
1849
  elem_id: 2,
@@ -1870,29 +1861,29 @@ function ke(l) {
1870
  return (Number.isInteger(l) ? l : l.toFixed(1)) + n;
1871
  }
1872
  const {
1873
- SvelteComponent: ji,
1874
  append: W,
1875
  attr: q,
1876
- component_subscribe: Vt,
1877
- detach: Fi,
1878
- element: Hi,
1879
- init: Mi,
1880
- insert: Ni,
1881
- noop: zt,
1882
- safe_not_equal: Vi,
1883
  set_style: ze,
1884
  svg_element: I,
1885
- toggle_class: Et
1886
- } = window.__gradio__svelte__internal, { onMount: zi } = window.__gradio__svelte__internal;
1887
- function Ei(l) {
1888
  let e, t, n, i, o, s, f, a, _, r, u, c;
1889
  return {
1890
  c() {
1891
- e = Hi("div"), t = I("svg"), n = I("g"), i = I("path"), o = I("path"), s = I("path"), f = I("path"), a = I("g"), _ = I("path"), r = I("path"), u = I("path"), c = I("path"), q(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), q(i, "fill", "#FF7C00"), q(i, "fill-opacity", "0.4"), q(i, "class", "svelte-43sxxs"), q(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), q(o, "fill", "#FF7C00"), q(o, "class", "svelte-43sxxs"), q(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), q(s, "fill", "#FF7C00"), q(s, "fill-opacity", "0.4"), q(s, "class", "svelte-43sxxs"), q(f, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), q(f, "fill", "#FF7C00"), q(f, "class", "svelte-43sxxs"), ze(n, "transform", "translate(" + /*$top*/
1892
  l[1][0] + "px, " + /*$top*/
1893
  l[1][1] + "px)"), q(_, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), q(_, "fill", "#FF7C00"), q(_, "fill-opacity", "0.4"), q(_, "class", "svelte-43sxxs"), q(r, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), q(r, "fill", "#FF7C00"), q(r, "class", "svelte-43sxxs"), q(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), q(u, "fill", "#FF7C00"), q(u, "fill-opacity", "0.4"), q(u, "class", "svelte-43sxxs"), q(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), q(c, "fill", "#FF7C00"), q(c, "class", "svelte-43sxxs"), ze(a, "transform", "translate(" + /*$bottom*/
1894
  l[2][0] + "px, " + /*$bottom*/
1895
- l[2][1] + "px)"), q(t, "viewBox", "-1200 -1200 3000 3000"), q(t, "fill", "none"), q(t, "xmlns", "http://www.w3.org/2000/svg"), q(t, "class", "svelte-43sxxs"), q(e, "class", "svelte-43sxxs"), Et(
1896
  e,
1897
  "margin",
1898
  /*margin*/
@@ -1900,7 +1891,7 @@ function Ei(l) {
1900
  );
1901
  },
1902
  m(m, k) {
1903
- Ni(m, e, k), W(e, t), W(t, n), W(n, i), W(n, o), W(n, s), W(n, f), W(t, a), W(a, _), W(a, r), W(a, u), W(a, c);
1904
  },
1905
  p(m, [k]) {
1906
  k & /*$top*/
@@ -1910,26 +1901,26 @@ function Ei(l) {
1910
  4 && ze(a, "transform", "translate(" + /*$bottom*/
1911
  m[2][0] + "px, " + /*$bottom*/
1912
  m[2][1] + "px)"), k & /*margin*/
1913
- 1 && Et(
1914
  e,
1915
  "margin",
1916
  /*margin*/
1917
  m[0]
1918
  );
1919
  },
1920
- i: zt,
1921
- o: zt,
1922
  d(m) {
1923
- m && Fi(e);
1924
  }
1925
  };
1926
  }
1927
- function Ri(l, e, t) {
1928
  let n, i, { margin: o = !0 } = e;
1929
- const s = at([0, 0]);
1930
- Vt(l, s, (c) => t(1, n = c));
1931
- const f = at([0, 0]);
1932
- Vt(l, f, (c) => t(2, i = c));
1933
  let a;
1934
  async function _() {
1935
  await Promise.all([s.set([125, 140]), f.set([-125, -140])]), await Promise.all([s.set([-125, 140]), f.set([125, -140])]), await Promise.all([s.set([-125, 0]), f.set([125, -0])]), await Promise.all([s.set([125, 0]), f.set([-125, 0])]);
@@ -1940,37 +1931,37 @@ function Ri(l, e, t) {
1940
  async function u() {
1941
  await Promise.all([s.set([125, 0]), f.set([-125, 0])]), r();
1942
  }
1943
- return zi(() => (u(), () => a = !0)), l.$$set = (c) => {
1944
  "margin" in c && t(0, o = c.margin);
1945
  }, [o, n, i, s, f];
1946
  }
1947
- class Di extends ji {
1948
  constructor(e) {
1949
- super(), Mi(this, e, Ri, Ei, Vi, { margin: 0 });
1950
  }
1951
  }
1952
  const {
1953
- SvelteComponent: Bi,
1954
  append: ce,
1955
  attr: Y,
1956
- binding_callbacks: Rt,
1957
  check_outros: bl,
1958
- create_component: Pi,
1959
- create_slot: Zi,
1960
- destroy_component: Oi,
1961
  destroy_each: wl,
1962
  detach: v,
1963
  element: $,
1964
  empty: Te,
1965
  ensure_array_like: Be,
1966
- get_all_dirty_from_scope: Ai,
1967
- get_slot_changes: Wi,
1968
  group_outros: vl,
1969
- init: Ii,
1970
  insert: p,
1971
- mount_component: Ui,
1972
- noop: Ge,
1973
- safe_not_equal: Xi,
1974
  set_data: P,
1975
  set_style: oe,
1976
  space: G,
@@ -1978,17 +1969,17 @@ const {
1978
  toggle_class: B,
1979
  transition_in: qe,
1980
  transition_out: Se,
1981
- update_slot_base: Yi
1982
- } = window.__gradio__svelte__internal, { tick: Gi } = window.__gradio__svelte__internal, { onDestroy: Ji } = window.__gradio__svelte__internal, Ki = (l) => ({}), Dt = (l) => ({});
1983
- function Bt(l, e, t) {
1984
  const n = l.slice();
1985
  return n[38] = e[t], n[40] = t, n;
1986
  }
1987
- function Pt(l, e, t) {
1988
  const n = l.slice();
1989
  return n[38] = e[t], n;
1990
  }
1991
- function Qi(l) {
1992
  let e, t = (
1993
  /*i18n*/
1994
  l[1]("common.error") + ""
@@ -1996,12 +1987,12 @@ function Qi(l) {
1996
  const s = (
1997
  /*#slots*/
1998
  l[29].error
1999
- ), f = Zi(
2000
  s,
2001
  l,
2002
  /*$$scope*/
2003
  l[28],
2004
- Dt
2005
  );
2006
  return {
2007
  c() {
@@ -2014,23 +2005,23 @@ function Qi(l) {
2014
  (!o || _[0] & /*i18n*/
2015
  2) && t !== (t = /*i18n*/
2016
  a[1]("common.error") + "") && P(n, t), f && f.p && (!o || _[0] & /*$$scope*/
2017
- 268435456) && Yi(
2018
  f,
2019
  s,
2020
  a,
2021
  /*$$scope*/
2022
  a[28],
2023
- o ? Wi(
2024
  s,
2025
  /*$$scope*/
2026
  a[28],
2027
  _,
2028
- Ki
2029
- ) : Ai(
2030
  /*$$scope*/
2031
  a[28]
2032
  ),
2033
- Dt
2034
  );
2035
  },
2036
  i(a) {
@@ -2044,37 +2035,37 @@ function Qi(l) {
2044
  }
2045
  };
2046
  }
2047
- function xi(l) {
2048
  let e, t, n, i, o, s, f, a, _, r = (
2049
  /*variant*/
2050
  l[8] === "default" && /*show_eta_bar*/
2051
  l[18] && /*show_progress*/
2052
- l[6] === "full" && Zt(l)
2053
  );
2054
  function u(d, C) {
2055
  if (
2056
  /*progress*/
2057
  d[7]
2058
  )
2059
- return to;
2060
  if (
2061
  /*queue_position*/
2062
  d[2] !== null && /*queue_size*/
2063
  d[3] !== void 0 && /*queue_position*/
2064
  d[2] >= 0
2065
  )
2066
- return eo;
2067
  if (
2068
  /*queue_position*/
2069
  d[2] === 0
2070
  )
2071
- return $i;
2072
  }
2073
  let c = u(l), m = c && c(l), k = (
2074
  /*timer*/
2075
- l[5] && Wt(l)
2076
  );
2077
- const j = [oo, io], T = [];
2078
  function S(d, C) {
2079
  return (
2080
  /*last_progress_level*/
@@ -2086,7 +2077,7 @@ function xi(l) {
2086
  }
2087
  ~(o = S(l)) && (s = T[o] = j[o](l));
2088
  let y = !/*timer*/
2089
- l[5] && Kt(l);
2090
  return {
2091
  c() {
2092
  r && r.c(), e = G(), t = $("div"), m && m.c(), n = G(), k && k.c(), i = G(), s && s.c(), f = G(), y && y.c(), a = Te(), Y(t, "class", "progress-text svelte-1txqlrd"), B(
@@ -2108,8 +2099,8 @@ function xi(l) {
2108
  /*variant*/
2109
  d[8] === "default" && /*show_eta_bar*/
2110
  d[18] && /*show_progress*/
2111
- d[6] === "full" ? r ? r.p(d, C) : (r = Zt(d), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null), c === (c = u(d)) && m ? m.p(d, C) : (m && m.d(1), m = c && c(d), m && (m.c(), m.m(t, n))), /*timer*/
2112
- d[5] ? k ? k.p(d, C) : (k = Wt(d), k.c(), k.m(t, null)) : k && (k.d(1), k = null), (!_ || C[0] & /*variant*/
2113
  256) && B(
2114
  t,
2115
  "meta-text-center",
@@ -2126,7 +2117,7 @@ function xi(l) {
2126
  o = S(d), o === L ? ~o && T[o].p(d, C) : (s && (vl(), Se(T[L], 1, 1, () => {
2127
  T[L] = null;
2128
  }), bl()), ~o ? (s = T[o], s ? s.p(d, C) : (s = T[o] = j[o](d), s.c()), qe(s, 1), s.m(f.parentNode, f)) : s = null), /*timer*/
2129
- d[5] ? y && (y.d(1), y = null) : y ? y.p(d, C) : (y = Kt(d), y.c(), y.m(a.parentNode, a));
2130
  },
2131
  i(d) {
2132
  _ || (qe(s), _ = !0);
@@ -2139,7 +2130,7 @@ function xi(l) {
2139
  }
2140
  };
2141
  }
2142
- function Zt(l) {
2143
  let e, t = `translateX(${/*eta_level*/
2144
  (l[17] || 0) * 100 - 100}%)`;
2145
  return {
@@ -2159,7 +2150,7 @@ function Zt(l) {
2159
  }
2160
  };
2161
  }
2162
- function $i(l) {
2163
  let e;
2164
  return {
2165
  c() {
@@ -2168,13 +2159,13 @@ function $i(l) {
2168
  m(t, n) {
2169
  p(t, e, n);
2170
  },
2171
- p: Ge,
2172
  d(t) {
2173
  t && v(e);
2174
  }
2175
  };
2176
  }
2177
- function eo(l) {
2178
  let e, t = (
2179
  /*queue_position*/
2180
  l[2] + 1 + ""
@@ -2204,13 +2195,13 @@ function eo(l) {
2204
  }
2205
  };
2206
  }
2207
- function to(l) {
2208
  let e, t = Be(
2209
  /*progress*/
2210
  l[7]
2211
  ), n = [];
2212
  for (let i = 0; i < t.length; i += 1)
2213
- n[i] = At(Pt(l, t, i));
2214
  return {
2215
  c() {
2216
  for (let i = 0; i < n.length; i += 1)
@@ -2231,8 +2222,8 @@ function to(l) {
2231
  );
2232
  let s;
2233
  for (s = 0; s < t.length; s += 1) {
2234
- const f = Pt(i, t, s);
2235
- n[s] ? n[s].p(f, o) : (n[s] = At(f), n[s].c(), n[s].m(e.parentNode, e));
2236
  }
2237
  for (; s < n.length; s += 1)
2238
  n[s].d(1);
@@ -2244,7 +2235,7 @@ function to(l) {
2244
  }
2245
  };
2246
  }
2247
- function Ot(l) {
2248
  let e, t = (
2249
  /*p*/
2250
  l[38].unit + ""
@@ -2252,7 +2243,7 @@ function Ot(l) {
2252
  function f(r, u) {
2253
  return (
2254
  /*p*/
2255
- r[38].length != null ? no : lo
2256
  );
2257
  }
2258
  let a = f(l), _ = a(l);
@@ -2273,7 +2264,7 @@ function Ot(l) {
2273
  }
2274
  };
2275
  }
2276
- function lo(l) {
2277
  let e = ke(
2278
  /*p*/
2279
  l[38].index || 0
@@ -2297,7 +2288,7 @@ function lo(l) {
2297
  }
2298
  };
2299
  }
2300
- function no(l) {
2301
  let e = ke(
2302
  /*p*/
2303
  l[38].index || 0
@@ -2328,10 +2319,10 @@ function no(l) {
2328
  }
2329
  };
2330
  }
2331
- function At(l) {
2332
  let e, t = (
2333
  /*p*/
2334
- l[38].index != null && Ot(l)
2335
  );
2336
  return {
2337
  c() {
@@ -2342,14 +2333,14 @@ function At(l) {
2342
  },
2343
  p(n, i) {
2344
  /*p*/
2345
- n[38].index != null ? t ? t.p(n, i) : (t = Ot(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
2346
  },
2347
  d(n) {
2348
  n && v(e), t && t.d(n);
2349
  }
2350
  };
2351
  }
2352
- function Wt(l) {
2353
  let e, t = (
2354
  /*eta*/
2355
  l[0] ? `/${/*formatted_eta*/
@@ -2381,19 +2372,19 @@ function Wt(l) {
2381
  }
2382
  };
2383
  }
2384
- function io(l) {
2385
  let e, t;
2386
- return e = new Di({
2387
  props: { margin: (
2388
  /*variant*/
2389
  l[8] === "default"
2390
  ) }
2391
  }), {
2392
  c() {
2393
- Pi(e.$$.fragment);
2394
  },
2395
  m(n, i) {
2396
- Ui(e, n, i), t = !0;
2397
  },
2398
  p(n, i) {
2399
  const o = {};
@@ -2408,15 +2399,15 @@ function io(l) {
2408
  Se(e.$$.fragment, n), t = !1;
2409
  },
2410
  d(n) {
2411
- Oi(e, n);
2412
  }
2413
  };
2414
  }
2415
- function oo(l) {
2416
  let e, t, n, i, o, s = `${/*last_progress_level*/
2417
  l[15] * 100}%`, f = (
2418
  /*progress*/
2419
- l[7] != null && It(l)
2420
  );
2421
  return {
2422
  c() {
@@ -2427,24 +2418,24 @@ function oo(l) {
2427
  },
2428
  p(a, _) {
2429
  /*progress*/
2430
- a[7] != null ? f ? f.p(a, _) : (f = It(a), f.c(), f.m(t, null)) : f && (f.d(1), f = null), _[0] & /*last_progress_level*/
2431
  32768 && s !== (s = `${/*last_progress_level*/
2432
  a[15] * 100}%`) && oe(o, "width", s);
2433
  },
2434
- i: Ge,
2435
- o: Ge,
2436
  d(a) {
2437
  a && v(e), f && f.d(), l[30](null);
2438
  }
2439
  };
2440
  }
2441
- function It(l) {
2442
  let e, t = Be(
2443
  /*progress*/
2444
  l[7]
2445
  ), n = [];
2446
  for (let i = 0; i < t.length; i += 1)
2447
- n[i] = Jt(Bt(l, t, i));
2448
  return {
2449
  c() {
2450
  for (let i = 0; i < n.length; i += 1)
@@ -2465,8 +2456,8 @@ function It(l) {
2465
  );
2466
  let s;
2467
  for (s = 0; s < t.length; s += 1) {
2468
- const f = Bt(i, t, s);
2469
- n[s] ? n[s].p(f, o) : (n[s] = Jt(f), n[s].c(), n[s].m(e.parentNode, e));
2470
  }
2471
  for (; s < n.length; s += 1)
2472
  n[s].d(1);
@@ -2478,13 +2469,13 @@ function It(l) {
2478
  }
2479
  };
2480
  }
2481
- function Ut(l) {
2482
  let e, t, n, i, o = (
2483
  /*i*/
2484
- l[40] !== 0 && so()
2485
  ), s = (
2486
  /*p*/
2487
- l[38].desc != null && Xt(l)
2488
  ), f = (
2489
  /*p*/
2490
  l[38].desc != null && /*progress_level*/
@@ -2492,10 +2483,10 @@ function Ut(l) {
2492
  l[14][
2493
  /*i*/
2494
  l[40]
2495
- ] != null && Yt()
2496
  ), a = (
2497
  /*progress_level*/
2498
- l[14] != null && Gt(l)
2499
  );
2500
  return {
2501
  c() {
@@ -2506,21 +2497,21 @@ function Ut(l) {
2506
  },
2507
  p(_, r) {
2508
  /*p*/
2509
- _[38].desc != null ? s ? s.p(_, r) : (s = Xt(_), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/
2510
  _[38].desc != null && /*progress_level*/
2511
  _[14] && /*progress_level*/
2512
  _[14][
2513
  /*i*/
2514
  _[40]
2515
- ] != null ? f || (f = Yt(), f.c(), f.m(n.parentNode, n)) : f && (f.d(1), f = null), /*progress_level*/
2516
- _[14] != null ? a ? a.p(_, r) : (a = Gt(_), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null);
2517
  },
2518
  d(_) {
2519
  _ && (v(e), v(t), v(n), v(i)), o && o.d(_), s && s.d(_), f && f.d(_), a && a.d(_);
2520
  }
2521
  };
2522
  }
2523
- function so(l) {
2524
  let e;
2525
  return {
2526
  c() {
@@ -2534,7 +2525,7 @@ function so(l) {
2534
  }
2535
  };
2536
  }
2537
- function Xt(l) {
2538
  let e = (
2539
  /*p*/
2540
  l[38].desc + ""
@@ -2556,7 +2547,7 @@ function Xt(l) {
2556
  }
2557
  };
2558
  }
2559
- function Yt(l) {
2560
  let e;
2561
  return {
2562
  c() {
@@ -2570,7 +2561,7 @@ function Yt(l) {
2570
  }
2571
  };
2572
  }
2573
- function Gt(l) {
2574
  let e = (100 * /*progress_level*/
2575
  (l[14][
2576
  /*i*/
@@ -2596,7 +2587,7 @@ function Gt(l) {
2596
  }
2597
  };
2598
  }
2599
- function Jt(l) {
2600
  let e, t = (
2601
  /*p*/
2602
  (l[38].desc != null || /*progress_level*/
@@ -2604,7 +2595,7 @@ function Jt(l) {
2604
  l[14][
2605
  /*i*/
2606
  l[40]
2607
- ] != null) && Ut(l)
2608
  );
2609
  return {
2610
  c() {
@@ -2620,14 +2611,14 @@ function Jt(l) {
2620
  n[14][
2621
  /*i*/
2622
  n[40]
2623
- ] != null ? t ? t.p(n, i) : (t = Ut(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
2624
  },
2625
  d(n) {
2626
  n && v(e), t && t.d(n);
2627
  }
2628
  };
2629
  }
2630
- function Kt(l) {
2631
  let e, t;
2632
  return {
2633
  c() {
@@ -2652,9 +2643,9 @@ function Kt(l) {
2652
  }
2653
  };
2654
  }
2655
- function fo(l) {
2656
  let e, t, n, i, o;
2657
- const s = [xi, Qi], f = [];
2658
  function a(_, r) {
2659
  return (
2660
  /*status*/
@@ -2763,24 +2754,24 @@ function fo(l) {
2763
  }
2764
  };
2765
  }
2766
- let Ee = [], Xe = !1;
2767
- async function _o(l, e = !0) {
2768
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
2769
- if (Ee.push(l), !Xe)
2770
- Xe = !0;
2771
  else
2772
  return;
2773
- await Gi(), requestAnimationFrame(() => {
2774
  let t = [0, 0];
2775
  for (let n = 0; n < Ee.length; n++) {
2776
  const o = Ee[n].getBoundingClientRect();
2777
  (n === 0 || o.top + window.scrollY <= t[0]) && (t[0] = o.top + window.scrollY, t[1] = n);
2778
  }
2779
- window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), Xe = !1, Ee = [];
2780
  });
2781
  }
2782
  }
2783
- function ao(l, e, t) {
2784
  let n, { $$slots: i = {}, $$scope: o } = e, { i18n: s } = e, { eta: f = null } = e, { queue_position: a } = e, { queue_size: _ } = e, { status: r } = e, { scroll_to_output: u = !1 } = e, { timer: c = !0 } = e, { show_progress: m = "full" } = e, { message: k = null } = e, { progress: j = null } = e, { variant: T = "default" } = e, { loading_text: S = "Loading..." } = e, { absolute: y = !0 } = e, { translucent: d = !1 } = e, { border: C = !1 } = e, { autoscroll: L } = e, h, Z = !1, J = 0, E = 0, O = null, R = null, ae = 0, A = null, K, D = null, me = !0;
2785
  const Le = () => {
2786
  t(0, f = t(26, O = t(19, he = null))), t(24, J = performance.now()), t(25, E = 0), Z = !0, ge();
@@ -2793,17 +2784,17 @@ function ao(l, e, t) {
2793
  function b() {
2794
  t(25, E = 0), t(0, f = t(26, O = t(19, he = null))), Z && (Z = !1);
2795
  }
2796
- Ji(() => {
2797
  Z && b();
2798
  });
2799
  let he = null;
2800
  function Oe(w) {
2801
- Rt[w ? "unshift" : "push"](() => {
2802
  D = w, t(16, D), t(7, j), t(14, A), t(15, K);
2803
  });
2804
  }
2805
  function Ae(w) {
2806
- Rt[w ? "unshift" : "push"](() => {
2807
  h = w, t(13, h);
2808
  });
2809
  }
@@ -2821,7 +2812,7 @@ function ao(l, e, t) {
2821
  return w.progress;
2822
  })) : t(14, A = null), A ? (t(15, K = A[A.length - 1]), D && (K === 0 ? t(16, D.style.transition = "0", D) : t(16, D.style.transition = "150ms", D))) : t(15, K = void 0)), l.$$.dirty[0] & /*status*/
2823
  16 && (r === "pending" ? Le() : b()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
2824
- 10493968 && h && u && (r === "pending" || r === "complete") && _o(h, L), l.$$.dirty[0] & /*status, message*/
2825
  4194320, l.$$.dirty[0] & /*timer_diff*/
2826
  33554432 && t(20, n = E.toFixed(1));
2827
  }, [
@@ -2859,14 +2850,14 @@ function ao(l, e, t) {
2859
  Ae
2860
  ];
2861
  }
2862
- class ro extends Bi {
2863
  constructor(e) {
2864
- super(), Ii(
2865
  this,
2866
  e,
2867
- ao,
2868
- fo,
2869
- Xi,
2870
  {
2871
  i18n: 1,
2872
  eta: 0,
@@ -2891,28 +2882,28 @@ class ro extends Bi {
2891
  }
2892
  }
2893
  const {
2894
- SvelteComponent: uo,
2895
- add_flush_callback: Qt,
2896
- assign: co,
2897
- bind: xt,
2898
- binding_callbacks: $t,
2899
- check_outros: mo,
2900
- create_component: xe,
2901
- destroy_component: $e,
2902
- detach: go,
2903
  flush: N,
2904
- get_spread_object: ho,
2905
- get_spread_update: bo,
2906
- group_outros: wo,
2907
- init: vo,
2908
- insert: po,
2909
- mount_component: et,
2910
- safe_not_equal: ko,
2911
- space: yo,
2912
  transition_in: ye,
2913
  transition_out: He
2914
  } = window.__gradio__svelte__internal;
2915
- function el(l) {
2916
  let e, t;
2917
  const n = [
2918
  { autoscroll: (
@@ -2928,17 +2919,17 @@ function el(l) {
2928
  ];
2929
  let i = {};
2930
  for (let o = 0; o < n.length; o += 1)
2931
- i = co(i, n[o]);
2932
- return e = new ro({ props: i }), {
2933
  c() {
2934
- xe(e.$$.fragment);
2935
  },
2936
  m(o, s) {
2937
- et(e, o, s), t = !0;
2938
  },
2939
  p(o, s) {
2940
  const f = s[0] & /*gradio, loading_status*/
2941
- 262152 ? bo(n, [
2942
  s[0] & /*gradio*/
2943
  8 && { autoscroll: (
2944
  /*gradio*/
@@ -2950,7 +2941,7 @@ function el(l) {
2950
  o[3].i18n
2951
  ) },
2952
  s[0] & /*loading_status*/
2953
- 262144 && ho(
2954
  /*loading_status*/
2955
  o[18]
2956
  )
@@ -2964,14 +2955,14 @@ function el(l) {
2964
  He(e.$$.fragment, o), t = !1;
2965
  },
2966
  d(o) {
2967
- $e(e, o);
2968
  }
2969
  };
2970
  }
2971
- function Co(l) {
2972
  let e, t, n, i, o, s = (
2973
  /*loading_status*/
2974
- l[18] && el(l)
2975
  );
2976
  function f(r) {
2977
  l[23](r);
@@ -3028,7 +3019,7 @@ function Co(l) {
3028
  l[0] !== void 0 && (_.value = /*value*/
3029
  l[0]), /*value_is_output*/
3030
  l[2] !== void 0 && (_.value_is_output = /*value_is_output*/
3031
- l[2]), t = new ui({ props: _ }), $t.push(() => xt(t, "value", f)), $t.push(() => xt(t, "value_is_output", a)), t.$on(
3032
  "change",
3033
  /*change_handler*/
3034
  l[25]
@@ -3058,17 +3049,17 @@ function Co(l) {
3058
  l[31]
3059
  ), {
3060
  c() {
3061
- s && s.c(), e = yo(), xe(t.$$.fragment);
3062
  },
3063
  m(r, u) {
3064
- s && s.m(r, u), po(r, e, u), et(t, r, u), o = !0;
3065
  },
3066
  p(r, u) {
3067
  /*loading_status*/
3068
  r[18] ? s ? (s.p(r, u), u[0] & /*loading_status*/
3069
- 262144 && ye(s, 1)) : (s = el(r), s.c(), ye(s, 1), s.m(e.parentNode, e)) : s && (wo(), He(s, 1, 1, () => {
3070
  s = null;
3071
- }), mo());
3072
  const c = {};
3073
  u[0] & /*label*/
3074
  16 && (c.label = /*label*/
@@ -3094,9 +3085,9 @@ function Co(l) {
3094
  524288 && (c.disabled = !/*interactive*/
3095
  r[19]), !n && u[0] & /*value*/
3096
  1 && (n = !0, c.value = /*value*/
3097
- r[0], Qt(() => n = !1)), !i && u[0] & /*value_is_output*/
3098
  4 && (i = !0, c.value_is_output = /*value_is_output*/
3099
- r[2], Qt(() => i = !1)), t.$set(c);
3100
  },
3101
  i(r) {
3102
  o || (ye(s), ye(t.$$.fragment, r), o = !0);
@@ -3105,14 +3096,14 @@ function Co(l) {
3105
  He(s), He(t.$$.fragment, r), o = !1;
3106
  },
3107
  d(r) {
3108
- r && go(e), s && s.d(r), $e(t, r);
3109
  }
3110
  }
3111
  );
3112
  }
3113
- function qo(l) {
3114
  let e, t;
3115
- return e = new Li({
3116
  props: {
3117
  visible: (
3118
  /*visible*/
@@ -3139,15 +3130,15 @@ function qo(l) {
3139
  /*container*/
3140
  l[13]
3141
  ),
3142
- $$slots: { default: [Co] },
3143
  $$scope: { ctx: l }
3144
  }
3145
  }), {
3146
  c() {
3147
- xe(e.$$.fragment);
3148
  },
3149
  m(n, i) {
3150
- et(e, n, i), t = !0;
3151
  },
3152
  p(n, i) {
3153
  const o = {};
@@ -3174,11 +3165,11 @@ function qo(l) {
3174
  He(e.$$.fragment, n), t = !1;
3175
  },
3176
  d(n) {
3177
- $e(e, n);
3178
  }
3179
  };
3180
  }
3181
- function So(l, e, t) {
3182
  let { gradio: n } = e, { label: i = "Highlighted Textbox" } = e, { legend_label: o = "Highlights:" } = e, { info: s = void 0 } = e, { elem_id: f = "" } = e, { elem_classes: a = [] } = e, { visible: _ = !0 } = e, { value: r } = e, { show_label: u } = e, { show_legend: c } = e, { show_legend_label: m } = e, { color_map: k = {} } = e, { container: j = !0 } = e, { scale: T = null } = e, { min_width: S = void 0 } = e, { show_copy_button: y = !1 } = e, { show_remove_tags_button: d = !1 } = e, { loading_status: C = void 0 } = e, { value_is_output: L = !1 } = e, { combine_adjacent: h = !1 } = e, { interactive: Z = !0 } = e;
3183
  const J = !1, E = !0;
3184
  function O(b) {
@@ -3195,7 +3186,7 @@ function So(l, e, t) {
3195
  }, l.$$.update = () => {
3196
  l.$$.dirty[0] & /*color_map*/
3197
  2 && !k && Object.keys(k).length && t(1, k), l.$$.dirty[0] & /*value, combine_adjacent*/
3198
- 1048577 && r && h && t(0, r = Gn(r, "equal"));
3199
  }, [
3200
  r,
3201
  k,
@@ -3231,14 +3222,14 @@ function So(l, e, t) {
3231
  ge
3232
  ];
3233
  }
3234
- class To extends uo {
3235
  constructor(e) {
3236
- super(), vo(
3237
  this,
3238
  e,
3239
- So,
3240
- qo,
3241
- ko,
3242
  {
3243
  gradio: 3,
3244
  label: 4,
@@ -3402,5 +3393,5 @@ class To extends uo {
3402
  }
3403
  }
3404
  export {
3405
- To as default
3406
  };
 
7
  detach: fe,
8
  element: de,
9
  empty: Sl,
10
+ ensure_array_like: lt,
11
  get_all_dirty_from_scope: Tl,
12
  get_slot_changes: Ll,
13
  init: jl,
14
  insert: _e,
15
  safe_not_equal: Fl,
16
+ set_data: Ke,
17
  space: Me,
18
+ text: Qe,
19
  toggle_class: V,
20
  transition_in: Hl,
21
  transition_out: Ml,
22
  update_slot_base: Nl
23
  } = window.__gradio__svelte__internal;
24
+ function nt(l, e, t) {
25
  const n = l.slice();
26
  return n[8] = e[t][0], n[9] = e[t][1], n[11] = t, n;
27
  }
28
+ function it(l) {
29
+ let e, t, n, i, o, s, f = lt(Object.entries(
30
  /*_color_map*/
31
  l[4]
32
  )), a = [];
33
  for (let _ = 0; _ < f.length; _ += 1)
34
+ a[_] = ot(nt(l, f, _));
35
  return {
36
  c() {
37
+ e = de("span"), e.textContent = "·", t = Me(), n = de("div"), i = de("span"), o = Qe(
38
  /*legend_label*/
39
  l[3]
40
  ), s = Me();
 
72
  /*info*/
73
  _[5] != null
74
  ), r & /*legend_label*/
75
+ 8 && Ke(
76
  o,
77
  /*legend_label*/
78
  _[3]
 
86
  _[5] != null
87
  ), r & /*Object, _color_map, info*/
88
  48) {
89
+ f = lt(Object.entries(
90
  /*_color_map*/
91
  _[4]
92
  ));
93
  let u;
94
  for (u = 0; u < f.length; u += 1) {
95
+ const c = nt(_, f, u);
96
+ a[u] ? a[u].p(c, r) : (a[u] = ot(c), a[u].c(), a[u].m(n, null));
97
  }
98
  for (; u < a.length; u += 1)
99
  a[u].d(1);
 
108
  }
109
  };
110
  }
111
+ function ot(l) {
112
  let e, t = (
113
  /*category*/
114
  l[8] + ""
115
  ), n, i, o;
116
  return {
117
  c() {
118
+ e = de("div"), n = Qe(t), i = Me(), U(e, "class", "category-label svelte-vm3q5z"), U(e, "style", o = "background-color:" + /*color*/
119
  l[9].secondary), V(
120
  e,
121
  "has-info",
 
129
  p(s, f) {
130
  f & /*_color_map*/
131
  16 && t !== (t = /*category*/
132
+ s[8] + "") && Ke(n, t), f & /*_color_map*/
133
  16 && o !== (o = "background-color:" + /*color*/
134
  s[9].secondary) && U(e, "style", o), f & /*info*/
135
  32 && V(
 
144
  }
145
  };
146
  }
147
+ function st(l) {
148
  let e, t;
149
  return {
150
  c() {
151
+ e = de("div"), t = Qe(
152
  /*info*/
153
  l[5]
154
  ), U(e, "class", "title-with-highlights-info svelte-vm3q5z");
 
158
  },
159
  p(n, i) {
160
  i & /*info*/
161
+ 32 && Ke(
162
  t,
163
  /*info*/
164
  n[5]
 
184
  l[6],
185
  null
186
  );
187
+ let r = i && it(l), u = (
188
  /*info*/
189
+ l[5] && st(l)
190
  );
191
  return {
192
  c() {
 
235
  16 && (i = Object.keys(
236
  /*_color_map*/
237
  c[4]
238
+ ).length !== 0), i ? r ? r.p(c, m) : (r = it(c), r.c(), r.m(e, null)) : r && (r.d(1), r = null), /*info*/
239
+ c[5] ? u ? u.p(c, m) : (u = st(c), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null);
240
  },
241
  i(c) {
242
  f || (Hl(_, c), f = !0);
 
282
  function Dl(l, e) {
283
  return l != l ? e == e : l !== e || l && typeof l == "object" || typeof l == "function";
284
  }
285
+ const ll = typeof window < "u";
286
+ let ft = ll ? () => window.performance.now() : () => Date.now(), nl = ll ? (l) => requestAnimationFrame(l) : Re;
287
  const Ce = /* @__PURE__ */ new Set();
288
+ function il(l) {
289
  Ce.forEach((e) => {
290
  e.c(l) || (Ce.delete(e), e.f());
291
+ }), Ce.size !== 0 && nl(il);
292
  }
293
  function Bl(l) {
294
  let e;
295
+ return Ce.size === 0 && nl(il), {
296
  promise: new Promise((t) => {
297
  Ce.add(e = { c: l, f: t });
298
  }),
 
301
  }
302
  };
303
  }
304
+ function _t(l, { delay: e = 0, duration: t = 400, easing: n = Rl } = {}) {
305
  const i = +getComputedStyle(l).opacity;
306
  return {
307
  delay: e,
 
337
  }
338
  return { set: i, update: o, subscribe: s };
339
  }
340
+ function at(l) {
341
  return Object.prototype.toString.call(l) === "[object Date]";
342
  }
343
+ function Ge(l, e, t, n) {
344
+ if (typeof t == "number" || at(t)) {
345
  const i = n - t, o = (t - e) / (l.dt || 1 / 60), s = l.opts.stiffness * i, f = l.opts.damping * o, a = (s - f) * l.inv_mass, _ = (o + a) * l.dt;
346
+ return Math.abs(_) < l.opts.precision && Math.abs(i) < l.opts.precision ? n : (l.settled = !1, at(t) ? new Date(t.getTime() + _) : t + _);
347
  } else {
348
  if (Array.isArray(t))
349
  return t.map(
350
+ (i, o) => Ge(l, e[o], t[o], n[o])
351
  );
352
  if (typeof t == "object") {
353
  const i = {};
354
  for (const o in t)
355
+ i[o] = Ge(l, e[o], t[o], n[o]);
356
  return i;
357
  } else
358
  throw new Error(`Cannot spring ${typeof t} values`);
359
  }
360
  }
361
+ function rt(l, e = {}) {
362
  const t = Pl(l), { stiffness: n = 0.15, damping: i = 0.8, precision: o = 0.01 } = e;
363
  let s, f, a, _ = l, r = l, u = 1, c = 0, m = !1;
364
  function k(T, S = {}) {
365
  r = T;
366
  const y = a = {};
367
+ return l == null || S.hard || j.stiffness >= 1 && j.damping >= 1 ? (m = !0, s = ft(), _ = T, t.set(l = r), Promise.resolve()) : (S.soft && (c = 1 / ((S.soft === !0 ? 0.5 : +S.soft) * 60), u = 0), f || (s = ft(), m = !1, f = Bl((d) => {
368
  if (m)
369
  return m = !1, f = null, !1;
370
  u = Math.min(u + c, 1);
 
373
  opts: j,
374
  settled: !0,
375
  dt: (d - s) * 60 / 1e3
376
+ }, L = Ge(C, _, l, r);
377
  return s = d, _ = l, t.set(l = L), C.settled && (f = null), !C.settled;
378
  })), new Promise((d) => {
379
  f.promise.then(() => {
 
400
  insert: Il,
401
  noop: We,
402
  safe_not_equal: Ul,
403
+ svg_element: ut
404
  } = window.__gradio__svelte__internal;
405
  function Xl(l) {
406
  let e, t;
407
  return {
408
  c() {
409
+ e = ut("svg"), t = ut("polyline"), le(t, "points", "20 6 9 17 4 12"), le(e, "xmlns", "http://www.w3.org/2000/svg"), le(e, "viewBox", "2 0 20 20"), le(e, "fill", "none"), le(e, "stroke", "currentColor"), le(e, "stroke-width", "3"), le(e, "stroke-linecap", "round"), le(e, "stroke-linejoin", "round");
410
  },
411
  m(n, i) {
412
  Il(n, e, i), Ol(e, t);
 
419
  }
420
  };
421
  }
422
+ class Yl extends Zl {
423
  constructor(e) {
424
  super(), Wl(this, e, null, Xl, Ul, {});
425
  }
426
  }
427
  const {
428
+ SvelteComponent: Gl,
429
+ append: ct,
430
  attr: re,
431
+ detach: Jl,
432
+ init: Kl,
433
+ insert: Ql,
434
  noop: Ie,
435
+ safe_not_equal: xl,
436
  svg_element: Ue
437
  } = window.__gradio__svelte__internal;
438
+ function $l(l) {
439
  let e, t, n;
440
  return {
441
  c() {
442
  e = Ue("svg"), t = Ue("path"), n = Ue("path"), re(t, "fill", "currentColor"), re(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), re(n, "fill", "currentColor"), re(n, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), re(e, "xmlns", "http://www.w3.org/2000/svg"), re(e, "viewBox", "0 0 33 33"), re(e, "color", "currentColor");
443
  },
444
  m(i, o) {
445
+ Ql(i, e, o), ct(e, t), ct(e, n);
446
  },
447
  p: Ie,
448
  i: Ie,
449
  o: Ie,
450
  d(i) {
451
+ i && Jl(e);
452
  }
453
  };
454
  }
455
+ class en extends Gl {
456
  constructor(e) {
457
+ super(), Kl(this, e, null, $l, xl, {});
458
  }
459
  }
460
  const {
461
+ SvelteComponent: tn,
462
+ add_render_callback: ln,
463
+ append: nn,
464
  attr: ue,
465
+ check_outros: on,
466
+ create_bidirectional_transition: dt,
467
  create_component: ol,
468
  destroy_component: sl,
469
  detach: fl,
470
  element: _l,
471
+ group_outros: sn,
472
+ init: fn,
473
  insert: al,
474
+ listen: _n,
475
  mount_component: rl,
476
+ safe_not_equal: an,
477
+ space: rn,
478
+ toggle_class: mt,
479
  transition_in: Fe,
480
  transition_out: De
481
+ } = window.__gradio__svelte__internal, { onDestroy: un } = window.__gradio__svelte__internal;
482
+ function gt(l) {
483
  let e, t, n, i;
484
+ return t = new Yl({}), {
485
  c() {
486
  e = _l("span"), ol(t.$$.fragment), ue(e, "class", "check svelte-qjb524"), ue(e, "aria-roledescription", "Value copied"), ue(e, "aria-label", "Copied");
487
  },
 
489
  al(o, e, s), rl(t, e, null), i = !0;
490
  },
491
  i(o) {
492
+ i || (Fe(t.$$.fragment, o), o && ln(() => {
493
+ i && (n || (n = dt(e, _t, {}, !0)), n.run(1));
494
  }), i = !0);
495
  },
496
  o(o) {
497
+ De(t.$$.fragment, o), o && (n || (n = dt(e, _t, {}, !1)), n.run(0)), i = !1;
498
  },
499
  d(o) {
500
  o && fl(e), sl(t), o && n && n.end();
501
  }
502
  };
503
  }
504
+ function cn(l) {
505
  let e, t, n, i, o, s;
506
+ t = new en({});
507
  let f = (
508
  /*copied*/
509
+ l[0] && gt()
510
  );
511
  return {
512
  c() {
513
+ e = _l("button"), ol(t.$$.fragment), n = rn(), f && f.c(), ue(e, "title", "Copy text to clipboard"), ue(e, "aria-roledescription", "Copy value"), ue(e, "aria-label", "Copy"), ue(e, "class", "svelte-qjb524"), mt(
514
  e,
515
  "copied",
516
  /*copied*/
 
518
  );
519
  },
520
  m(a, _) {
521
+ al(a, e, _), rl(t, e, null), nn(e, n), f && f.m(e, null), i = !0, o || (s = _n(
522
  e,
523
  "click",
524
  /*handle_copy*/
 
528
  p(a, [_]) {
529
  /*copied*/
530
  a[0] ? f ? _ & /*copied*/
531
+ 1 && Fe(f, 1) : (f = gt(), f.c(), Fe(f, 1), f.m(e, null)) : f && (sn(), De(f, 1, 1, () => {
532
  f = null;
533
+ }), on()), (!i || _ & /*copied*/
534
+ 1) && mt(
535
  e,
536
  "copied",
537
  /*copied*/
 
549
  }
550
  };
551
  }
552
+ function dn(l, e, t) {
553
  let n = !1, { value: i } = e, o;
554
  function s() {
555
  t(0, n = !0), o && clearTimeout(o), o = setTimeout(
 
562
  async function f() {
563
  "clipboard" in navigator && (await navigator.clipboard.writeText(i), s());
564
  }
565
+ return un(() => {
566
  o && clearTimeout(o);
567
  }), l.$$set = (a) => {
568
  "value" in a && t(2, i = a.value);
569
  }, [n, f, i];
570
  }
571
+ class mn extends tn {
572
  constructor(e) {
573
+ super(), fn(this, e, dn, cn, an, { value: 2 });
574
  }
575
  }
576
  const {
577
+ SvelteComponent: gn,
578
  attr: Ve,
579
+ detach: hn,
580
+ element: bn,
581
+ init: wn,
582
+ insert: vn,
583
+ listen: pn,
584
+ noop: Xe,
585
+ safe_not_equal: kn
586
+ } = window.__gradio__svelte__internal, { createEventDispatcher: yn } = window.__gradio__svelte__internal;
587
+ function Cn(l) {
588
+ let e, t, n;
589
+ return {
 
 
 
 
 
590
  c() {
591
+ e = bn("button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="2 0 20 20" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>', Ve(e, "title", "Remove highlights"), Ve(e, "aria-roledescription", "Remove highlights"), Ve(e, "aria-label", "Remove highlights"), Ve(e, "class", "svelte-1ga0gmr");
592
  },
593
+ m(i, o) {
594
+ vn(i, e, o), t || (n = pn(
595
  e,
596
  "click",
597
  /*click_handler*/
598
  l[1]
599
+ ), t = !0);
 
 
 
 
 
 
 
600
  },
601
+ p: Xe,
602
+ i: Xe,
603
+ o: Xe,
604
+ d(i) {
605
+ i && hn(e), t = !1, n();
606
  }
607
  };
608
  }
609
+ function qn(l) {
610
+ const e = yn();
611
  return [e, () => e("clear")];
612
  }
613
+ class Sn extends gn {
614
  constructor(e) {
615
+ super(), wn(this, e, qn, Cn, kn, {});
616
  }
617
  }
618
  const {
619
+ SvelteComponent: Tn,
620
+ append: Ln,
621
+ attr: jn,
622
+ check_outros: ht,
623
  create_component: ul,
624
  destroy_component: cl,
625
+ detach: Fn,
626
+ element: Hn,
627
+ group_outros: bt,
628
+ init: Mn,
629
+ insert: Nn,
630
  mount_component: dl,
631
+ noop: Vn,
632
+ safe_not_equal: zn,
633
+ space: En,
634
  transition_in: ie,
635
  transition_out: pe
636
+ } = window.__gradio__svelte__internal, { createEventDispatcher: Rn } = window.__gradio__svelte__internal;
637
+ function wt(l) {
638
  let e, t;
639
+ return e = new Sn({}), e.$on(
640
  "clear",
641
  /*clear_handler*/
642
  l[4]
 
647
  m(n, i) {
648
  dl(e, n, i), t = !0;
649
  },
650
+ p: Vn,
651
  i(n) {
652
  t || (ie(e.$$.fragment, n), t = !0);
653
  },
 
659
  }
660
  };
661
  }
662
+ function vt(l) {
663
  let e, t;
664
+ return e = new mn({ props: { value: (
665
  /*value*/
666
  l[0]
667
  ) } }), {
 
688
  }
689
  };
690
  }
691
+ function Dn(l) {
692
  let e, t, n, i = (
693
  /*show_remove_tags_button*/
694
+ l[2] && wt(l)
695
  ), o = (
696
  /*show_copy_button*/
697
+ l[1] && vt(l)
698
  );
699
  return {
700
  c() {
701
+ e = Hn("div"), i && i.c(), t = En(), o && o.c(), jn(e, "class", "svelte-1bqqv16");
702
  },
703
  m(s, f) {
704
+ Nn(s, e, f), i && i.m(e, null), Ln(e, t), o && o.m(e, null), n = !0;
705
  },
706
  p(s, [f]) {
707
  /*show_remove_tags_button*/
708
  s[2] ? i ? (i.p(s, f), f & /*show_remove_tags_button*/
709
+ 4 && ie(i, 1)) : (i = wt(s), i.c(), ie(i, 1), i.m(e, t)) : i && (bt(), pe(i, 1, 1, () => {
710
  i = null;
711
+ }), ht()), /*show_copy_button*/
712
  s[1] ? o ? (o.p(s, f), f & /*show_copy_button*/
713
+ 2 && ie(o, 1)) : (o = vt(s), o.c(), ie(o, 1), o.m(e, null)) : o && (bt(), pe(o, 1, 1, () => {
714
  o = null;
715
+ }), ht());
716
  },
717
  i(s) {
718
  n || (ie(i), ie(o), n = !0);
 
721
  pe(i), pe(o), n = !1;
722
  },
723
  d(s) {
724
+ s && Fn(e), i && i.d(), o && o.d();
725
  }
726
  };
727
  }
728
+ function Bn(l, e, t) {
729
  let { value: n } = e, { show_copy_button: i = !1 } = e, { show_remove_tags_button: o = !1 } = e;
730
+ const s = Rn(), f = () => s("clear");
731
  return l.$$set = (a) => {
732
  "value" in a && t(0, n = a.value), "show_copy_button" in a && t(1, i = a.show_copy_button), "show_remove_tags_button" in a && t(2, o = a.show_remove_tags_button);
733
  }, [n, i, o, s, f];
734
  }
735
+ class Pn extends Tn {
736
  constructor(e) {
737
+ super(), Mn(this, e, Bn, Dn, zn, {
738
  value: 0,
739
  show_copy_button: 1,
740
  show_remove_tags_button: 2
741
  });
742
  }
743
  }
744
+ const pt = [
745
  "red",
746
  "green",
747
  "blue",
 
752
  "cyan",
753
  "lime",
754
  "pink"
755
+ ], Zn = [
756
  { color: "red", primary: 600, secondary: 100 },
757
  { color: "green", primary: 600, secondary: 100 },
758
  { color: "blue", primary: 600, secondary: 100 },
 
763
  { color: "cyan", primary: 600, secondary: 100 },
764
  { color: "lime", primary: 500, secondary: 100 },
765
  { color: "pink", primary: 600, secondary: 100 }
766
+ ], kt = {
767
  inherit: "inherit",
768
  current: "currentColor",
769
  transparent: "transparent",
 
1055
  900: "#881337",
1056
  950: "#4c0519"
1057
  }
1058
+ }, yt = Zn.reduce(
1059
  (l, { color: e, primary: t, secondary: n }) => ({
1060
  ...l,
1061
  [e]: {
1062
+ primary: kt[e][t],
1063
+ secondary: kt[e][n]
1064
  }
1065
  }),
1066
  {}
1067
+ ), On = (l) => pt[l % pt.length];
1068
+ function Ct(l, e, t) {
1069
  if (!t) {
1070
  var n = document.createElement("canvas");
1071
  t = n.getContext("2d");
 
1074
  const [i, o, s] = t.getImageData(0, 0, 1, 1).data;
1075
  return t.clearRect(0, 0, 1, 1), `rgba(${i}, ${o}, ${s}, ${255 / e})`;
1076
  }
1077
+ function An(l, e, t) {
1078
  var n = {};
1079
  for (const i in l) {
1080
  const o = l[i].trim();
1081
+ o in yt ? n[i] = yt[o] : n[i] = {
1082
+ primary: e ? Ct(l[i], 1, t) : l[i],
1083
+ secondary: e ? Ct(l[i], 0.5, t) : l[i]
1084
  };
1085
  }
1086
  return n;
1087
  }
1088
+ function Wn(l, e) {
1089
  let t = [], n = null, i = null;
1090
  for (const [o, s] of l)
1091
  e === "empty" && s === null || e === "equal" && i === s ? n = n ? n + o : o : (n !== null && t.push([n, i]), n = o, i = s);
1092
  return n !== null && t.push([n, i]), t;
1093
  }
1094
+ function In(l) {
1095
  const e = window.getSelection();
1096
  if (e.rangeCount > 0) {
1097
  const t = document.createRange();
 
1099
  }
1100
  return -1;
1101
  }
1102
+ function Un(l, e) {
1103
  var t = document.createTreeWalker(l, NodeFilter.SHOW_TEXT), n = t.nextNode();
1104
  if (!n || !n.textContent)
1105
  return null;
 
1112
  return { node: n, offset: o };
1113
  }
1114
  const {
1115
+ SvelteComponent: Xn,
1116
  add_render_callback: ml,
1117
+ append: qt,
1118
  attr: X,
1119
+ binding_callbacks: St,
1120
  bubble: je,
1121
+ create_component: Tt,
1122
+ destroy_component: Lt,
1123
  detach: Pe,
1124
+ element: xe,
1125
+ init: Yn,
1126
  insert: Ze,
1127
  listen: x,
1128
+ mount_component: jt,
1129
+ run_all: Gn,
1130
+ safe_not_equal: Jn,
1131
+ set_data: Kn,
1132
+ space: Ft,
1133
+ text: Qn,
1134
+ toggle_class: Ht,
1135
+ transition_in: Mt,
1136
+ transition_out: Nt
1137
+ } = window.__gradio__svelte__internal, { beforeUpdate: xn, afterUpdate: $n, createEventDispatcher: ei } = window.__gradio__svelte__internal;
1138
+ function ti(l) {
1139
  let e;
1140
  return {
1141
  c() {
1142
+ e = Qn(
1143
  /*label*/
1144
  l[0]
1145
  );
 
1149
  },
1150
  p(t, n) {
1151
  n[0] & /*label*/
1152
+ 1 && Kn(
1153
  e,
1154
  /*label*/
1155
  t[0]
 
1160
  }
1161
  };
1162
  }
1163
+ function li(l) {
1164
  let e, t, n;
1165
  return {
1166
  c() {
1167
+ e = xe("div"), X(e, "class", "textfield svelte-1atky07"), X(e, "data-testid", "highlighted-textbox"), X(e, "contenteditable", "true"), X(e, "role", "textbox"), X(e, "tabindex", "0"), /*el_text*/
1168
  (l[11] === void 0 || /*marked_el_text*/
1169
  l[12] === void 0) && ml(() => (
1170
  /*div_input_handler_1*/
 
1237
  i[12]);
1238
  },
1239
  d(i) {
1240
+ i && Pe(e), l[28](null), t = !1, Gn(n);
1241
  }
1242
  };
1243
  }
1244
+ function ni(l) {
1245
  let e, t, n;
1246
  return {
1247
  c() {
1248
+ e = xe("div"), X(e, "class", "textfield svelte-1atky07"), X(e, "data-testid", "highlighted-textbox"), X(e, "contenteditable", "false"), /*el_text*/
1249
  (l[11] === void 0 || /*marked_el_text*/
1250
  l[12] === void 0) && ml(() => (
1251
  /*div_input_handler*/
 
1278
  }
1279
  };
1280
  }
1281
+ function ii(l) {
1282
  let e, t, n, i, o, s;
1283
  t = new El({
1284
  props: {
 
1306
  /*info*/
1307
  l[2]
1308
  ),
1309
+ $$slots: { default: [ti] },
1310
  $$scope: { ctx: l }
1311
  }
1312
+ }), i = new Pn({
1313
  props: {
1314
  show_copy_button: (
1315
  /*show_copy_button*/
 
1333
  function f(r, u) {
1334
  return (
1335
  /*disabled*/
1336
+ r[9] ? ni : li
1337
  );
1338
  }
1339
  let a = f(l), _ = a(l);
1340
  return {
1341
  c() {
1342
+ e = xe("label"), Tt(t.$$.fragment), n = Ft(), Tt(i.$$.fragment), o = Ft(), _.c(), X(e, "for", "highlighted-textbox"), X(e, "class", "svelte-1atky07"), Ht(
1343
  e,
1344
  "container",
1345
  /*container*/
 
1347
  );
1348
  },
1349
  m(r, u) {
1350
+ Ze(r, e, u), jt(t, e, null), qt(e, n), jt(i, e, null), qt(e, o), _.m(e, null), s = !0;
1351
  },
1352
  p(r, u) {
1353
  const c = {};
 
1375
  r[14]), u[0] & /*tagged_text*/
1376
  32768 && (m.value = /*tagged_text*/
1377
  r[15]), i.$set(m), a === (a = f(r)) && _ ? _.p(r, u) : (_.d(1), _ = a(r), _ && (_.c(), _.m(e, null))), (!s || u[0] & /*container*/
1378
+ 64) && Ht(
1379
  e,
1380
  "container",
1381
  /*container*/
 
1383
  );
1384
  },
1385
  i(r) {
1386
+ s || (Mt(t.$$.fragment, r), Mt(i.$$.fragment, r), s = !0);
1387
  },
1388
  o(r) {
1389
+ Nt(t.$$.fragment, r), Nt(i.$$.fragment, r), s = !1;
1390
  },
1391
  d(r) {
1392
+ r && Pe(e), Lt(t), Lt(i), _.d();
1393
  }
1394
  };
1395
  }
1396
+ function oi(l, e, t) {
1397
  const n = typeof document < "u";
1398
  let { value: i = [] } = e, { value_is_output: o = !1 } = e, { label: s } = e, { legend_label: f } = e, { info: a = void 0 } = e, { show_label: _ = !0 } = e, { show_legend: r = !1 } = e, { show_legend_label: u = !1 } = e, { container: c = !0 } = e, { color_map: m = {} } = e, { show_copy_button: k = !1 } = e, { show_remove_tags_button: j = !1 } = e, { disabled: T } = e, S, y = "", d = "", C, L, h = {}, Z = !1, J = "";
1399
  function E() {
 
1403
  if (i.length > 0) {
1404
  for (let [g, M] of i)
1405
  if (M !== null && !(M in L)) {
1406
+ let F = On(Object.keys(L).length);
1407
  L[M] = F;
1408
  }
1409
  }
1410
+ t(13, h = An(L, n, C));
1411
  }
1412
  function O(g) {
1413
  i.length > 0 && g && (t(11, y = i.map(([M, F]) => M).join("")), t(12, d = i.map(([M, F]) => F !== null ? `<mark class="hl ${F}" style="background-color:${h[F].secondary}">${M}</mark>` : M).join("")), t(15, J = i.map(([M, F]) => F !== null ? `<${F}>${M}</${F}>` : M).join("")));
1414
  }
1415
+ const R = ei();
1416
+ xn(() => {
1417
  S && S.offsetHeight + S.scrollTop > S.scrollHeight - 100;
1418
  });
1419
  function ae() {
1420
  D(), A(), R("change", i), o || R("input", i);
1421
  }
1422
+ $n(() => {
1423
  E(), O(o), t(19, o = !1);
1424
  });
1425
  function A() {
 
1458
  var ee = F.parentElement, be = document.createTextNode(Ne);
1459
  ee.replaceChild(be, F), t(12, d = ee.innerHTML);
1460
  var we = document.createRange(), te = window.getSelection();
1461
+ const kl = M + In(ee);
1462
+ var Q = Un(ee, kl);
1463
  we.setStart(Q.node, Q.offset), we.setEnd(Q.node, Q.offset), te.removeAllRanges(), te.addRange(we);
1464
  }
1465
  }
 
1480
  je.call(this, l, g);
1481
  }
1482
  function Oe(g) {
1483
+ St[g ? "unshift" : "push"](() => {
1484
  S = g, t(10, S);
1485
  });
1486
  }
 
1488
  y = this.textContent, d = this.innerHTML, t(11, y), t(12, d);
1489
  }
1490
  function w(g) {
1491
+ St[g ? "unshift" : "push"](() => {
1492
  S = g, t(10, S);
1493
  });
1494
  }
 
1530
  pl
1531
  ];
1532
  }
1533
+ class si extends Xn {
1534
  constructor(e) {
1535
+ super(), Yn(
1536
  this,
1537
  e,
1538
+ oi,
1539
+ ii,
1540
+ Jn,
1541
  {
1542
  value: 18,
1543
  value_is_output: 19,
 
1559
  }
1560
  }
1561
  const {
1562
+ SvelteComponent: fi,
1563
+ assign: _i,
1564
+ create_slot: ai,
1565
+ detach: ri,
1566
+ element: ui,
1567
+ get_all_dirty_from_scope: ci,
1568
+ get_slot_changes: di,
1569
+ get_spread_update: mi,
1570
+ init: gi,
1571
+ insert: hi,
1572
+ safe_not_equal: bi,
1573
+ set_dynamic_element_data: Vt,
1574
  set_style: z,
1575
  toggle_class: ne,
1576
  transition_in: gl,
1577
  transition_out: hl,
1578
+ update_slot_base: wi
1579
  } = window.__gradio__svelte__internal;
1580
+ function vi(l) {
1581
  let e, t, n;
1582
  const i = (
1583
  /*#slots*/
1584
  l[18].default
1585
+ ), o = ai(
1586
  i,
1587
  l,
1588
  /*$$scope*/
 
1604
  }
1605
  ], f = {};
1606
  for (let a = 0; a < s.length; a += 1)
1607
+ f = _i(f, s[a]);
1608
  return {
1609
  c() {
1610
+ e = ui(
1611
  /*tag*/
1612
  l[14]
1613
+ ), o && o.c(), Vt(
1614
  /*tag*/
1615
  l[14]
1616
  )(e, f), ne(
 
1665
  l[13]}px, 100%))`), z(e, "border-width", "var(--block-border-width)");
1666
  },
1667
  m(a, _) {
1668
+ hi(a, e, _), o && o.m(e, null), n = !0;
1669
  },
1670
  p(a, _) {
1671
  o && o.p && (!n || _ & /*$$scope*/
1672
+ 131072) && wi(
1673
  o,
1674
  i,
1675
  a,
1676
  /*$$scope*/
1677
  a[17],
1678
+ n ? di(
1679
  i,
1680
  /*$$scope*/
1681
  a[17],
1682
  _,
1683
  null
1684
+ ) : ci(
1685
  /*$$scope*/
1686
  a[17]
1687
  ),
1688
  null
1689
+ ), Vt(
1690
  /*tag*/
1691
  a[14]
1692
+ )(e, f = mi(s, [
1693
  (!n || _ & /*test_id*/
1694
  128) && { "data-testid": (
1695
  /*test_id*/
 
1767
  hl(o, a), n = !1;
1768
  },
1769
  d(a) {
1770
+ a && ri(e), o && o.d(a);
1771
  }
1772
  };
1773
  }
1774
+ function pi(l) {
1775
  let e, t = (
1776
  /*tag*/
1777
+ l[14] && vi(l)
1778
  );
1779
  return {
1780
  c() {
 
1798
  }
1799
  };
1800
  }
1801
+ function ki(l, e, t) {
1802
  let { $$slots: n = {}, $$scope: i } = e, { height: o = void 0 } = e, { width: s = void 0 } = e, { elem_id: f = "" } = e, { elem_classes: a = [] } = e, { variant: _ = "solid" } = e, { border_mode: r = "base" } = e, { padding: u = !0 } = e, { type: c = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: k = !1 } = e, { container: j = !0 } = e, { visible: T = !0 } = e, { allow_overflow: S = !0 } = e, { scale: y = null } = e, { min_width: d = 0 } = e, C = c === "fieldset" ? "fieldset" : "div";
1803
  const L = (h) => {
1804
  if (h !== void 0) {
 
1832
  n
1833
  ];
1834
  }
1835
+ class yi extends fi {
1836
  constructor(e) {
1837
+ super(), gi(this, e, ki, pi, bi, {
1838
  height: 0,
1839
  width: 1,
1840
  elem_id: 2,
 
1861
  return (Number.isInteger(l) ? l : l.toFixed(1)) + n;
1862
  }
1863
  const {
1864
+ SvelteComponent: Ci,
1865
  append: W,
1866
  attr: q,
1867
+ component_subscribe: zt,
1868
+ detach: qi,
1869
+ element: Si,
1870
+ init: Ti,
1871
+ insert: Li,
1872
+ noop: Et,
1873
+ safe_not_equal: ji,
1874
  set_style: ze,
1875
  svg_element: I,
1876
+ toggle_class: Rt
1877
+ } = window.__gradio__svelte__internal, { onMount: Fi } = window.__gradio__svelte__internal;
1878
+ function Hi(l) {
1879
  let e, t, n, i, o, s, f, a, _, r, u, c;
1880
  return {
1881
  c() {
1882
+ e = Si("div"), t = I("svg"), n = I("g"), i = I("path"), o = I("path"), s = I("path"), f = I("path"), a = I("g"), _ = I("path"), r = I("path"), u = I("path"), c = I("path"), q(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), q(i, "fill", "#FF7C00"), q(i, "fill-opacity", "0.4"), q(i, "class", "svelte-43sxxs"), q(o, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), q(o, "fill", "#FF7C00"), q(o, "class", "svelte-43sxxs"), q(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), q(s, "fill", "#FF7C00"), q(s, "fill-opacity", "0.4"), q(s, "class", "svelte-43sxxs"), q(f, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), q(f, "fill", "#FF7C00"), q(f, "class", "svelte-43sxxs"), ze(n, "transform", "translate(" + /*$top*/
1883
  l[1][0] + "px, " + /*$top*/
1884
  l[1][1] + "px)"), q(_, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), q(_, "fill", "#FF7C00"), q(_, "fill-opacity", "0.4"), q(_, "class", "svelte-43sxxs"), q(r, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), q(r, "fill", "#FF7C00"), q(r, "class", "svelte-43sxxs"), q(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), q(u, "fill", "#FF7C00"), q(u, "fill-opacity", "0.4"), q(u, "class", "svelte-43sxxs"), q(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), q(c, "fill", "#FF7C00"), q(c, "class", "svelte-43sxxs"), ze(a, "transform", "translate(" + /*$bottom*/
1885
  l[2][0] + "px, " + /*$bottom*/
1886
+ l[2][1] + "px)"), q(t, "viewBox", "-1200 -1200 3000 3000"), q(t, "fill", "none"), q(t, "xmlns", "http://www.w3.org/2000/svg"), q(t, "class", "svelte-43sxxs"), q(e, "class", "svelte-43sxxs"), Rt(
1887
  e,
1888
  "margin",
1889
  /*margin*/
 
1891
  );
1892
  },
1893
  m(m, k) {
1894
+ Li(m, e, k), W(e, t), W(t, n), W(n, i), W(n, o), W(n, s), W(n, f), W(t, a), W(a, _), W(a, r), W(a, u), W(a, c);
1895
  },
1896
  p(m, [k]) {
1897
  k & /*$top*/
 
1901
  4 && ze(a, "transform", "translate(" + /*$bottom*/
1902
  m[2][0] + "px, " + /*$bottom*/
1903
  m[2][1] + "px)"), k & /*margin*/
1904
+ 1 && Rt(
1905
  e,
1906
  "margin",
1907
  /*margin*/
1908
  m[0]
1909
  );
1910
  },
1911
+ i: Et,
1912
+ o: Et,
1913
  d(m) {
1914
+ m && qi(e);
1915
  }
1916
  };
1917
  }
1918
+ function Mi(l, e, t) {
1919
  let n, i, { margin: o = !0 } = e;
1920
+ const s = rt([0, 0]);
1921
+ zt(l, s, (c) => t(1, n = c));
1922
+ const f = rt([0, 0]);
1923
+ zt(l, f, (c) => t(2, i = c));
1924
  let a;
1925
  async function _() {
1926
  await Promise.all([s.set([125, 140]), f.set([-125, -140])]), await Promise.all([s.set([-125, 140]), f.set([125, -140])]), await Promise.all([s.set([-125, 0]), f.set([125, -0])]), await Promise.all([s.set([125, 0]), f.set([-125, 0])]);
 
1931
  async function u() {
1932
  await Promise.all([s.set([125, 0]), f.set([-125, 0])]), r();
1933
  }
1934
+ return Fi(() => (u(), () => a = !0)), l.$$set = (c) => {
1935
  "margin" in c && t(0, o = c.margin);
1936
  }, [o, n, i, s, f];
1937
  }
1938
+ class Ni extends Ci {
1939
  constructor(e) {
1940
+ super(), Ti(this, e, Mi, Hi, ji, { margin: 0 });
1941
  }
1942
  }
1943
  const {
1944
+ SvelteComponent: Vi,
1945
  append: ce,
1946
  attr: Y,
1947
+ binding_callbacks: Dt,
1948
  check_outros: bl,
1949
+ create_component: zi,
1950
+ create_slot: Ei,
1951
+ destroy_component: Ri,
1952
  destroy_each: wl,
1953
  detach: v,
1954
  element: $,
1955
  empty: Te,
1956
  ensure_array_like: Be,
1957
+ get_all_dirty_from_scope: Di,
1958
+ get_slot_changes: Bi,
1959
  group_outros: vl,
1960
+ init: Pi,
1961
  insert: p,
1962
+ mount_component: Zi,
1963
+ noop: Je,
1964
+ safe_not_equal: Oi,
1965
  set_data: P,
1966
  set_style: oe,
1967
  space: G,
 
1969
  toggle_class: B,
1970
  transition_in: qe,
1971
  transition_out: Se,
1972
+ update_slot_base: Ai
1973
+ } = window.__gradio__svelte__internal, { tick: Wi } = window.__gradio__svelte__internal, { onDestroy: Ii } = window.__gradio__svelte__internal, Ui = (l) => ({}), Bt = (l) => ({});
1974
+ function Pt(l, e, t) {
1975
  const n = l.slice();
1976
  return n[38] = e[t], n[40] = t, n;
1977
  }
1978
+ function Zt(l, e, t) {
1979
  const n = l.slice();
1980
  return n[38] = e[t], n;
1981
  }
1982
+ function Xi(l) {
1983
  let e, t = (
1984
  /*i18n*/
1985
  l[1]("common.error") + ""
 
1987
  const s = (
1988
  /*#slots*/
1989
  l[29].error
1990
+ ), f = Ei(
1991
  s,
1992
  l,
1993
  /*$$scope*/
1994
  l[28],
1995
+ Bt
1996
  );
1997
  return {
1998
  c() {
 
2005
  (!o || _[0] & /*i18n*/
2006
  2) && t !== (t = /*i18n*/
2007
  a[1]("common.error") + "") && P(n, t), f && f.p && (!o || _[0] & /*$$scope*/
2008
+ 268435456) && Ai(
2009
  f,
2010
  s,
2011
  a,
2012
  /*$$scope*/
2013
  a[28],
2014
+ o ? Bi(
2015
  s,
2016
  /*$$scope*/
2017
  a[28],
2018
  _,
2019
+ Ui
2020
+ ) : Di(
2021
  /*$$scope*/
2022
  a[28]
2023
  ),
2024
+ Bt
2025
  );
2026
  },
2027
  i(a) {
 
2035
  }
2036
  };
2037
  }
2038
+ function Yi(l) {
2039
  let e, t, n, i, o, s, f, a, _, r = (
2040
  /*variant*/
2041
  l[8] === "default" && /*show_eta_bar*/
2042
  l[18] && /*show_progress*/
2043
+ l[6] === "full" && Ot(l)
2044
  );
2045
  function u(d, C) {
2046
  if (
2047
  /*progress*/
2048
  d[7]
2049
  )
2050
+ return Ki;
2051
  if (
2052
  /*queue_position*/
2053
  d[2] !== null && /*queue_size*/
2054
  d[3] !== void 0 && /*queue_position*/
2055
  d[2] >= 0
2056
  )
2057
+ return Ji;
2058
  if (
2059
  /*queue_position*/
2060
  d[2] === 0
2061
  )
2062
+ return Gi;
2063
  }
2064
  let c = u(l), m = c && c(l), k = (
2065
  /*timer*/
2066
+ l[5] && It(l)
2067
  );
2068
+ const j = [eo, $i], T = [];
2069
  function S(d, C) {
2070
  return (
2071
  /*last_progress_level*/
 
2077
  }
2078
  ~(o = S(l)) && (s = T[o] = j[o](l));
2079
  let y = !/*timer*/
2080
+ l[5] && Qt(l);
2081
  return {
2082
  c() {
2083
  r && r.c(), e = G(), t = $("div"), m && m.c(), n = G(), k && k.c(), i = G(), s && s.c(), f = G(), y && y.c(), a = Te(), Y(t, "class", "progress-text svelte-1txqlrd"), B(
 
2099
  /*variant*/
2100
  d[8] === "default" && /*show_eta_bar*/
2101
  d[18] && /*show_progress*/
2102
+ d[6] === "full" ? r ? r.p(d, C) : (r = Ot(d), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null), c === (c = u(d)) && m ? m.p(d, C) : (m && m.d(1), m = c && c(d), m && (m.c(), m.m(t, n))), /*timer*/
2103
+ d[5] ? k ? k.p(d, C) : (k = It(d), k.c(), k.m(t, null)) : k && (k.d(1), k = null), (!_ || C[0] & /*variant*/
2104
  256) && B(
2105
  t,
2106
  "meta-text-center",
 
2117
  o = S(d), o === L ? ~o && T[o].p(d, C) : (s && (vl(), Se(T[L], 1, 1, () => {
2118
  T[L] = null;
2119
  }), bl()), ~o ? (s = T[o], s ? s.p(d, C) : (s = T[o] = j[o](d), s.c()), qe(s, 1), s.m(f.parentNode, f)) : s = null), /*timer*/
2120
+ d[5] ? y && (y.d(1), y = null) : y ? y.p(d, C) : (y = Qt(d), y.c(), y.m(a.parentNode, a));
2121
  },
2122
  i(d) {
2123
  _ || (qe(s), _ = !0);
 
2130
  }
2131
  };
2132
  }
2133
+ function Ot(l) {
2134
  let e, t = `translateX(${/*eta_level*/
2135
  (l[17] || 0) * 100 - 100}%)`;
2136
  return {
 
2150
  }
2151
  };
2152
  }
2153
+ function Gi(l) {
2154
  let e;
2155
  return {
2156
  c() {
 
2159
  m(t, n) {
2160
  p(t, e, n);
2161
  },
2162
+ p: Je,
2163
  d(t) {
2164
  t && v(e);
2165
  }
2166
  };
2167
  }
2168
+ function Ji(l) {
2169
  let e, t = (
2170
  /*queue_position*/
2171
  l[2] + 1 + ""
 
2195
  }
2196
  };
2197
  }
2198
+ function Ki(l) {
2199
  let e, t = Be(
2200
  /*progress*/
2201
  l[7]
2202
  ), n = [];
2203
  for (let i = 0; i < t.length; i += 1)
2204
+ n[i] = Wt(Zt(l, t, i));
2205
  return {
2206
  c() {
2207
  for (let i = 0; i < n.length; i += 1)
 
2222
  );
2223
  let s;
2224
  for (s = 0; s < t.length; s += 1) {
2225
+ const f = Zt(i, t, s);
2226
+ n[s] ? n[s].p(f, o) : (n[s] = Wt(f), n[s].c(), n[s].m(e.parentNode, e));
2227
  }
2228
  for (; s < n.length; s += 1)
2229
  n[s].d(1);
 
2235
  }
2236
  };
2237
  }
2238
+ function At(l) {
2239
  let e, t = (
2240
  /*p*/
2241
  l[38].unit + ""
 
2243
  function f(r, u) {
2244
  return (
2245
  /*p*/
2246
+ r[38].length != null ? xi : Qi
2247
  );
2248
  }
2249
  let a = f(l), _ = a(l);
 
2264
  }
2265
  };
2266
  }
2267
+ function Qi(l) {
2268
  let e = ke(
2269
  /*p*/
2270
  l[38].index || 0
 
2288
  }
2289
  };
2290
  }
2291
+ function xi(l) {
2292
  let e = ke(
2293
  /*p*/
2294
  l[38].index || 0
 
2319
  }
2320
  };
2321
  }
2322
+ function Wt(l) {
2323
  let e, t = (
2324
  /*p*/
2325
+ l[38].index != null && At(l)
2326
  );
2327
  return {
2328
  c() {
 
2333
  },
2334
  p(n, i) {
2335
  /*p*/
2336
+ n[38].index != null ? t ? t.p(n, i) : (t = At(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
2337
  },
2338
  d(n) {
2339
  n && v(e), t && t.d(n);
2340
  }
2341
  };
2342
  }
2343
+ function It(l) {
2344
  let e, t = (
2345
  /*eta*/
2346
  l[0] ? `/${/*formatted_eta*/
 
2372
  }
2373
  };
2374
  }
2375
+ function $i(l) {
2376
  let e, t;
2377
+ return e = new Ni({
2378
  props: { margin: (
2379
  /*variant*/
2380
  l[8] === "default"
2381
  ) }
2382
  }), {
2383
  c() {
2384
+ zi(e.$$.fragment);
2385
  },
2386
  m(n, i) {
2387
+ Zi(e, n, i), t = !0;
2388
  },
2389
  p(n, i) {
2390
  const o = {};
 
2399
  Se(e.$$.fragment, n), t = !1;
2400
  },
2401
  d(n) {
2402
+ Ri(e, n);
2403
  }
2404
  };
2405
  }
2406
+ function eo(l) {
2407
  let e, t, n, i, o, s = `${/*last_progress_level*/
2408
  l[15] * 100}%`, f = (
2409
  /*progress*/
2410
+ l[7] != null && Ut(l)
2411
  );
2412
  return {
2413
  c() {
 
2418
  },
2419
  p(a, _) {
2420
  /*progress*/
2421
+ a[7] != null ? f ? f.p(a, _) : (f = Ut(a), f.c(), f.m(t, null)) : f && (f.d(1), f = null), _[0] & /*last_progress_level*/
2422
  32768 && s !== (s = `${/*last_progress_level*/
2423
  a[15] * 100}%`) && oe(o, "width", s);
2424
  },
2425
+ i: Je,
2426
+ o: Je,
2427
  d(a) {
2428
  a && v(e), f && f.d(), l[30](null);
2429
  }
2430
  };
2431
  }
2432
+ function Ut(l) {
2433
  let e, t = Be(
2434
  /*progress*/
2435
  l[7]
2436
  ), n = [];
2437
  for (let i = 0; i < t.length; i += 1)
2438
+ n[i] = Kt(Pt(l, t, i));
2439
  return {
2440
  c() {
2441
  for (let i = 0; i < n.length; i += 1)
 
2456
  );
2457
  let s;
2458
  for (s = 0; s < t.length; s += 1) {
2459
+ const f = Pt(i, t, s);
2460
+ n[s] ? n[s].p(f, o) : (n[s] = Kt(f), n[s].c(), n[s].m(e.parentNode, e));
2461
  }
2462
  for (; s < n.length; s += 1)
2463
  n[s].d(1);
 
2469
  }
2470
  };
2471
  }
2472
+ function Xt(l) {
2473
  let e, t, n, i, o = (
2474
  /*i*/
2475
+ l[40] !== 0 && to()
2476
  ), s = (
2477
  /*p*/
2478
+ l[38].desc != null && Yt(l)
2479
  ), f = (
2480
  /*p*/
2481
  l[38].desc != null && /*progress_level*/
 
2483
  l[14][
2484
  /*i*/
2485
  l[40]
2486
+ ] != null && Gt()
2487
  ), a = (
2488
  /*progress_level*/
2489
+ l[14] != null && Jt(l)
2490
  );
2491
  return {
2492
  c() {
 
2497
  },
2498
  p(_, r) {
2499
  /*p*/
2500
+ _[38].desc != null ? s ? s.p(_, r) : (s = Yt(_), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/
2501
  _[38].desc != null && /*progress_level*/
2502
  _[14] && /*progress_level*/
2503
  _[14][
2504
  /*i*/
2505
  _[40]
2506
+ ] != null ? f || (f = Gt(), f.c(), f.m(n.parentNode, n)) : f && (f.d(1), f = null), /*progress_level*/
2507
+ _[14] != null ? a ? a.p(_, r) : (a = Jt(_), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null);
2508
  },
2509
  d(_) {
2510
  _ && (v(e), v(t), v(n), v(i)), o && o.d(_), s && s.d(_), f && f.d(_), a && a.d(_);
2511
  }
2512
  };
2513
  }
2514
+ function to(l) {
2515
  let e;
2516
  return {
2517
  c() {
 
2525
  }
2526
  };
2527
  }
2528
+ function Yt(l) {
2529
  let e = (
2530
  /*p*/
2531
  l[38].desc + ""
 
2547
  }
2548
  };
2549
  }
2550
+ function Gt(l) {
2551
  let e;
2552
  return {
2553
  c() {
 
2561
  }
2562
  };
2563
  }
2564
+ function Jt(l) {
2565
  let e = (100 * /*progress_level*/
2566
  (l[14][
2567
  /*i*/
 
2587
  }
2588
  };
2589
  }
2590
+ function Kt(l) {
2591
  let e, t = (
2592
  /*p*/
2593
  (l[38].desc != null || /*progress_level*/
 
2595
  l[14][
2596
  /*i*/
2597
  l[40]
2598
+ ] != null) && Xt(l)
2599
  );
2600
  return {
2601
  c() {
 
2611
  n[14][
2612
  /*i*/
2613
  n[40]
2614
+ ] != null ? t ? t.p(n, i) : (t = Xt(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
2615
  },
2616
  d(n) {
2617
  n && v(e), t && t.d(n);
2618
  }
2619
  };
2620
  }
2621
+ function Qt(l) {
2622
  let e, t;
2623
  return {
2624
  c() {
 
2643
  }
2644
  };
2645
  }
2646
+ function lo(l) {
2647
  let e, t, n, i, o;
2648
+ const s = [Yi, Xi], f = [];
2649
  function a(_, r) {
2650
  return (
2651
  /*status*/
 
2754
  }
2755
  };
2756
  }
2757
+ let Ee = [], Ye = !1;
2758
+ async function no(l, e = !0) {
2759
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
2760
+ if (Ee.push(l), !Ye)
2761
+ Ye = !0;
2762
  else
2763
  return;
2764
+ await Wi(), requestAnimationFrame(() => {
2765
  let t = [0, 0];
2766
  for (let n = 0; n < Ee.length; n++) {
2767
  const o = Ee[n].getBoundingClientRect();
2768
  (n === 0 || o.top + window.scrollY <= t[0]) && (t[0] = o.top + window.scrollY, t[1] = n);
2769
  }
2770
+ window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), Ye = !1, Ee = [];
2771
  });
2772
  }
2773
  }
2774
+ function io(l, e, t) {
2775
  let n, { $$slots: i = {}, $$scope: o } = e, { i18n: s } = e, { eta: f = null } = e, { queue_position: a } = e, { queue_size: _ } = e, { status: r } = e, { scroll_to_output: u = !1 } = e, { timer: c = !0 } = e, { show_progress: m = "full" } = e, { message: k = null } = e, { progress: j = null } = e, { variant: T = "default" } = e, { loading_text: S = "Loading..." } = e, { absolute: y = !0 } = e, { translucent: d = !1 } = e, { border: C = !1 } = e, { autoscroll: L } = e, h, Z = !1, J = 0, E = 0, O = null, R = null, ae = 0, A = null, K, D = null, me = !0;
2776
  const Le = () => {
2777
  t(0, f = t(26, O = t(19, he = null))), t(24, J = performance.now()), t(25, E = 0), Z = !0, ge();
 
2784
  function b() {
2785
  t(25, E = 0), t(0, f = t(26, O = t(19, he = null))), Z && (Z = !1);
2786
  }
2787
+ Ii(() => {
2788
  Z && b();
2789
  });
2790
  let he = null;
2791
  function Oe(w) {
2792
+ Dt[w ? "unshift" : "push"](() => {
2793
  D = w, t(16, D), t(7, j), t(14, A), t(15, K);
2794
  });
2795
  }
2796
  function Ae(w) {
2797
+ Dt[w ? "unshift" : "push"](() => {
2798
  h = w, t(13, h);
2799
  });
2800
  }
 
2812
  return w.progress;
2813
  })) : t(14, A = null), A ? (t(15, K = A[A.length - 1]), D && (K === 0 ? t(16, D.style.transition = "0", D) : t(16, D.style.transition = "150ms", D))) : t(15, K = void 0)), l.$$.dirty[0] & /*status*/
2814
  16 && (r === "pending" ? Le() : b()), l.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
2815
+ 10493968 && h && u && (r === "pending" || r === "complete") && no(h, L), l.$$.dirty[0] & /*status, message*/
2816
  4194320, l.$$.dirty[0] & /*timer_diff*/
2817
  33554432 && t(20, n = E.toFixed(1));
2818
  }, [
 
2850
  Ae
2851
  ];
2852
  }
2853
+ class oo extends Vi {
2854
  constructor(e) {
2855
+ super(), Pi(
2856
  this,
2857
  e,
2858
+ io,
2859
+ lo,
2860
+ Oi,
2861
  {
2862
  i18n: 1,
2863
  eta: 0,
 
2882
  }
2883
  }
2884
  const {
2885
+ SvelteComponent: so,
2886
+ add_flush_callback: xt,
2887
+ assign: fo,
2888
+ bind: $t,
2889
+ binding_callbacks: el,
2890
+ check_outros: _o,
2891
+ create_component: $e,
2892
+ destroy_component: et,
2893
+ detach: ao,
2894
  flush: N,
2895
+ get_spread_object: ro,
2896
+ get_spread_update: uo,
2897
+ group_outros: co,
2898
+ init: mo,
2899
+ insert: go,
2900
+ mount_component: tt,
2901
+ safe_not_equal: ho,
2902
+ space: bo,
2903
  transition_in: ye,
2904
  transition_out: He
2905
  } = window.__gradio__svelte__internal;
2906
+ function tl(l) {
2907
  let e, t;
2908
  const n = [
2909
  { autoscroll: (
 
2919
  ];
2920
  let i = {};
2921
  for (let o = 0; o < n.length; o += 1)
2922
+ i = fo(i, n[o]);
2923
+ return e = new oo({ props: i }), {
2924
  c() {
2925
+ $e(e.$$.fragment);
2926
  },
2927
  m(o, s) {
2928
+ tt(e, o, s), t = !0;
2929
  },
2930
  p(o, s) {
2931
  const f = s[0] & /*gradio, loading_status*/
2932
+ 262152 ? uo(n, [
2933
  s[0] & /*gradio*/
2934
  8 && { autoscroll: (
2935
  /*gradio*/
 
2941
  o[3].i18n
2942
  ) },
2943
  s[0] & /*loading_status*/
2944
+ 262144 && ro(
2945
  /*loading_status*/
2946
  o[18]
2947
  )
 
2955
  He(e.$$.fragment, o), t = !1;
2956
  },
2957
  d(o) {
2958
+ et(e, o);
2959
  }
2960
  };
2961
  }
2962
+ function wo(l) {
2963
  let e, t, n, i, o, s = (
2964
  /*loading_status*/
2965
+ l[18] && tl(l)
2966
  );
2967
  function f(r) {
2968
  l[23](r);
 
3019
  l[0] !== void 0 && (_.value = /*value*/
3020
  l[0]), /*value_is_output*/
3021
  l[2] !== void 0 && (_.value_is_output = /*value_is_output*/
3022
+ l[2]), t = new si({ props: _ }), el.push(() => $t(t, "value", f)), el.push(() => $t(t, "value_is_output", a)), t.$on(
3023
  "change",
3024
  /*change_handler*/
3025
  l[25]
 
3049
  l[31]
3050
  ), {
3051
  c() {
3052
+ s && s.c(), e = bo(), $e(t.$$.fragment);
3053
  },
3054
  m(r, u) {
3055
+ s && s.m(r, u), go(r, e, u), tt(t, r, u), o = !0;
3056
  },
3057
  p(r, u) {
3058
  /*loading_status*/
3059
  r[18] ? s ? (s.p(r, u), u[0] & /*loading_status*/
3060
+ 262144 && ye(s, 1)) : (s = tl(r), s.c(), ye(s, 1), s.m(e.parentNode, e)) : s && (co(), He(s, 1, 1, () => {
3061
  s = null;
3062
+ }), _o());
3063
  const c = {};
3064
  u[0] & /*label*/
3065
  16 && (c.label = /*label*/
 
3085
  524288 && (c.disabled = !/*interactive*/
3086
  r[19]), !n && u[0] & /*value*/
3087
  1 && (n = !0, c.value = /*value*/
3088
+ r[0], xt(() => n = !1)), !i && u[0] & /*value_is_output*/
3089
  4 && (i = !0, c.value_is_output = /*value_is_output*/
3090
+ r[2], xt(() => i = !1)), t.$set(c);
3091
  },
3092
  i(r) {
3093
  o || (ye(s), ye(t.$$.fragment, r), o = !0);
 
3096
  He(s), He(t.$$.fragment, r), o = !1;
3097
  },
3098
  d(r) {
3099
+ r && ao(e), s && s.d(r), et(t, r);
3100
  }
3101
  }
3102
  );
3103
  }
3104
+ function vo(l) {
3105
  let e, t;
3106
+ return e = new yi({
3107
  props: {
3108
  visible: (
3109
  /*visible*/
 
3130
  /*container*/
3131
  l[13]
3132
  ),
3133
+ $$slots: { default: [wo] },
3134
  $$scope: { ctx: l }
3135
  }
3136
  }), {
3137
  c() {
3138
+ $e(e.$$.fragment);
3139
  },
3140
  m(n, i) {
3141
+ tt(e, n, i), t = !0;
3142
  },
3143
  p(n, i) {
3144
  const o = {};
 
3165
  He(e.$$.fragment, n), t = !1;
3166
  },
3167
  d(n) {
3168
+ et(e, n);
3169
  }
3170
  };
3171
  }
3172
+ function po(l, e, t) {
3173
  let { gradio: n } = e, { label: i = "Highlighted Textbox" } = e, { legend_label: o = "Highlights:" } = e, { info: s = void 0 } = e, { elem_id: f = "" } = e, { elem_classes: a = [] } = e, { visible: _ = !0 } = e, { value: r } = e, { show_label: u } = e, { show_legend: c } = e, { show_legend_label: m } = e, { color_map: k = {} } = e, { container: j = !0 } = e, { scale: T = null } = e, { min_width: S = void 0 } = e, { show_copy_button: y = !1 } = e, { show_remove_tags_button: d = !1 } = e, { loading_status: C = void 0 } = e, { value_is_output: L = !1 } = e, { combine_adjacent: h = !1 } = e, { interactive: Z = !0 } = e;
3174
  const J = !1, E = !0;
3175
  function O(b) {
 
3186
  }, l.$$.update = () => {
3187
  l.$$.dirty[0] & /*color_map*/
3188
  2 && !k && Object.keys(k).length && t(1, k), l.$$.dirty[0] & /*value, combine_adjacent*/
3189
+ 1048577 && r && h && t(0, r = Wn(r, "equal"));
3190
  }, [
3191
  r,
3192
  k,
 
3222
  ge
3223
  ];
3224
  }
3225
+ class ko extends so {
3226
  constructor(e) {
3227
+ super(), mo(
3228
  this,
3229
  e,
3230
+ po,
3231
+ vo,
3232
+ ho,
3233
  {
3234
  gradio: 3,
3235
  label: 4,
 
3393
  }
3394
  }
3395
  export {
3396
+ ko as default
3397
  };
src/frontend/RemoveTags.svelte CHANGED
@@ -1,5 +1,4 @@
1
  <script lang="ts">
2
- import { Check } from "@gradio/icons";
3
  import { createEventDispatcher } from 'svelte';
4
 
5
  const dispatch = createEventDispatcher()
@@ -11,7 +10,15 @@
11
  aria-roledescription="Remove highlights"
12
  aria-label="Remove highlights"
13
  >
14
- <Check />
 
 
 
 
 
 
 
 
15
  </button>
16
 
17
  <style>
 
1
  <script lang="ts">
 
2
  import { createEventDispatcher } from 'svelte';
3
 
4
  const dispatch = createEventDispatcher()
 
10
  aria-roledescription="Remove highlights"
11
  aria-label="Remove highlights"
12
  >
13
+ <svg
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ viewBox="2 0 20 20"
16
+ fill="none"
17
+ stroke="white"
18
+ stroke-width="3"
19
+ stroke-linecap="round"
20
+ stroke-linejoin="round"><polyline points="20 6 9 17 4 12" /></svg
21
+ >
22
  </button>
23
 
24
  <style>
src/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_highlightedtextbox"
11
- version = "0.0.11"
12
  description = "Editable Gradio textarea supporting highlighting"
13
  readme = "README.md"
14
  license = "MIT"
@@ -39,7 +39,7 @@ dev = ["build", "twine"]
39
  space = "https://huggingface.co/spaces/gsarti/gradio_highlightedtextbox"
40
 
41
  [tool.hatch.build]
42
- artifacts = ["/backend/gradio_highlightedtextbox/templates", "*.pyi", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "Users/gsarti/Documents/projects/highlightedtextbox/backend/gradio_highlightedtextbox/templates", "Users/gsarti/Documents/projects/highlightedtextbox/backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates"]
43
 
44
  [tool.hatch.build.targets.wheel]
45
  packages = ["/backend/gradio_highlightedtextbox"]
 
8
 
9
  [project]
10
  name = "gradio_highlightedtextbox"
11
+ version = "0.0.12"
12
  description = "Editable Gradio textarea supporting highlighting"
13
  readme = "README.md"
14
  license = "MIT"
 
39
  space = "https://huggingface.co/spaces/gsarti/gradio_highlightedtextbox"
40
 
41
  [tool.hatch.build]
42
+ artifacts = ["backend/gradio_highlightedtextbox/templates", "backend/gradio_highlightedtextbox/templates"]
43
 
44
  [tool.hatch.build.targets.wheel]
45
  packages = ["/backend/gradio_highlightedtextbox"]