LennardZuendorf commited on
Commit
75d6174
1 Parent(s): 0b22c73

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,9 +1,9 @@
1
 
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
- title: gradio_iframe V0.0.3
5
- colorFrom: indigo
6
- colorTo: purple
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
 
1
 
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
+ title: gradio_iframe V0.0.4
5
+ colorFrom: blue
6
+ colorTo: gray
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
requirements.txt CHANGED
@@ -1 +1 @@
1
- gradio_iframe-0.0.3-py3-none-any.whl
 
1
+ gradio_iframe-0.0.4-py3-none-any.whl
src/.gitignore CHANGED
@@ -5,4 +5,4 @@ __pycache__/
5
  *$py.class
6
  __tmp/*
7
  *.pyi
8
- node_modules
 
5
  *$py.class
6
  __tmp/*
7
  *.pyi
8
+ node_modules
src/README.md CHANGED
@@ -34,5 +34,3 @@ Also this component is still a work in progress and not fully tested. Use at you
34
 
35
  - Height does not grow according to the inner component.
36
  - ...
37
-
38
-
 
34
 
35
  - Height does not grow according to the inner component.
36
  - ...
 
 
src/backend/gradio_iframe/iframe.py CHANGED
@@ -36,6 +36,7 @@ class iFrame(Component):
36
  elem_id: str | None = None,
37
  elem_classes: list[str] | str | None = None,
38
  render: bool = True,
 
39
  ):
40
  """
41
  Parameters:
@@ -47,6 +48,7 @@ class iFrame(Component):
47
  elem_id: An optional string that is assigned as the id of this component in the iFrame DOM. Can be used for targeting CSS styles.
48
  elem_classes: An optional list of strings that are assigned as the classes of this component in the iFrame DOM. Can be used for targeting CSS styles.
49
  render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
 
50
  """
51
  super().__init__(
52
  label=label,
@@ -59,6 +61,8 @@ class iFrame(Component):
59
  value=value,
60
  )
61
 
 
 
62
  def example_inputs(self) -> Any:
63
  return "<p>Hello</p>"
64
 
 
36
  elem_id: str | None = None,
37
  elem_classes: list[str] | str | None = None,
38
  render: bool = True,
39
+ height: str | None = None,
40
  ):
41
  """
42
  Parameters:
 
48
  elem_id: An optional string that is assigned as the id of this component in the iFrame DOM. Can be used for targeting CSS styles.
49
  elem_classes: An optional list of strings that are assigned as the classes of this component in the iFrame DOM. Can be used for targeting CSS styles.
50
  render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
51
+ height: The height of the iFrame in valid css (i.e "10px). If None, the height will be automatically set to 100%
52
  """
53
  super().__init__(
54
  label=label,
 
61
  value=value,
62
  )
63
 
64
+ self.height = height
65
+
66
  def example_inputs(self) -> Any:
67
  return "<p>Hello</p>"
68
 
src/backend/gradio_iframe/iframe.pyi CHANGED
@@ -37,6 +37,7 @@ class iFrame(Component):
37
  elem_id: str | None = None,
38
  elem_classes: list[str] | str | None = None,
39
  render: bool = True,
 
40
  ):
41
  """
42
  Parameters:
@@ -48,6 +49,7 @@ class iFrame(Component):
48
  elem_id: An optional string that is assigned as the id of this component in the iFrame DOM. Can be used for targeting CSS styles.
49
  elem_classes: An optional list of strings that are assigned as the classes of this component in the iFrame DOM. Can be used for targeting CSS styles.
50
  render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
 
51
  """
52
  super().__init__(
53
  label=label,
@@ -60,6 +62,8 @@ class iFrame(Component):
60
  value=value,
61
  )
62
 
 
 
63
  def example_inputs(self) -> Any:
64
  return "<p>Hello</p>"
65
 
 
37
  elem_id: str | None = None,
38
  elem_classes: list[str] | str | None = None,
39
  render: bool = True,
40
+ height: str | None = None,
41
  ):
42
  """
43
  Parameters:
 
49
  elem_id: An optional string that is assigned as the id of this component in the iFrame DOM. Can be used for targeting CSS styles.
50
  elem_classes: An optional list of strings that are assigned as the classes of this component in the iFrame DOM. Can be used for targeting CSS styles.
51
  render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
52
+ height: The height of the iFrame in pixels. If None, the height will be automatically set to 100%
53
  """
54
  super().__init__(
55
  label=label,
 
62
  value=value,
63
  )
64
 
65
+ self.height = height
66
+
67
  def example_inputs(self) -> Any:
68
  return "<p>Hello</p>"
69
 
src/backend/gradio_iframe/templates/component/index.js CHANGED
@@ -1,10 +1,10 @@
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
- attr: B,
5
- detach: st,
6
  element: we,
7
- init: ft,
8
  insert: ot,
9
  noop: ve,
10
  safe_not_equal: at,
@@ -14,12 +14,17 @@ function _t(n) {
14
  let t, e, l;
15
  return {
16
  c() {
17
- t = we("div"), e = we("iframe"), B(e, "title", "iframe component"), B(e, "width", "100%"), B(e, "height", "100%"), B(
 
 
 
 
 
18
  e,
19
  "srcdoc",
20
  /*value*/
21
  n[1]
22
- ), B(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, B(t, "class", l = "prose " + /*elem_classes*/
23
  n[0].join(" ") + " svelte-2qygph"), x(
24
  t,
25
  "min",
@@ -28,52 +33,59 @@ function _t(n) {
28
  ), x(t, "hide", !/*visible*/
29
  n[2]);
30
  },
31
- m(i, f) {
32
- ot(i, t, f), it(t, e);
33
  },
34
- p(i, [f]) {
35
- f & /*value*/
36
- 2 && B(
 
 
 
 
 
 
37
  e,
38
  "srcdoc",
39
  /*value*/
40
  i[1]
41
- ), f & /*elem_classes*/
42
  1 && l !== (l = "prose " + /*elem_classes*/
43
- i[0].join(" ") + " svelte-2qygph") && B(t, "class", l), f & /*elem_classes, min_height*/
44
  9 && x(
45
  t,
46
  "min",
47
  /*min_height*/
48
  i[3]
49
- ), f & /*elem_classes, visible*/
50
  5 && x(t, "hide", !/*visible*/
51
  i[2]);
52
  },
53
  i: ve,
54
  o: ve,
55
  d(i) {
56
- i && st(t);
57
  }
58
  };
59
  }
60
- function ct(n, t, e) {
61
- let { elem_classes: l = [] } = t, { value: i } = t, { visible: f = !0 } = t, { min_height: o = !1 } = t;
62
- const a = rt();
63
- return n.$$set = (r) => {
64
- "elem_classes" in r && e(0, l = r.elem_classes), "value" in r && e(1, i = r.value), "visible" in r && e(2, f = r.visible), "min_height" in r && e(3, o = r.min_height);
65
  }, n.$$.update = () => {
66
  n.$$.dirty & /*value*/
67
- 2 && a("change");
68
- }, [l, i, f, o];
69
  }
70
- class ut extends nt {
71
  constructor(t) {
72
- super(), ft(this, t, ct, _t, at, {
73
  elem_classes: 0,
74
  value: 1,
75
  visible: 2,
76
- min_height: 3
 
77
  });
78
  }
79
  }
@@ -90,7 +102,7 @@ function dt(n, t) {
90
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
91
  }
92
  const Re = typeof window < "u";
93
- let pe = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
94
  const G = /* @__PURE__ */ new Set();
95
  function Je(n) {
96
  G.forEach((t) => {
@@ -115,77 +127,77 @@ function bt(n, t = te) {
115
  function i(a) {
116
  if (dt(n, a) && (n = a, e)) {
117
  const r = !X.length;
118
- for (const s of l)
119
- s[1](), X.push(s, n);
120
  if (r) {
121
- for (let s = 0; s < X.length; s += 2)
122
- X[s][0](X[s + 1]);
123
  X.length = 0;
124
  }
125
  }
126
  }
127
- function f(a) {
128
  i(a(n));
129
  }
130
  function o(a, r = te) {
131
- const s = [a, r];
132
- return l.add(s), l.size === 1 && (e = t(i, f) || te), a(n), () => {
133
- l.delete(s), l.size === 0 && e && (e(), e = null);
134
  };
135
  }
136
- return { set: i, update: f, subscribe: o };
137
  }
138
- function ye(n) {
139
  return Object.prototype.toString.call(n) === "[object Date]";
140
  }
141
- function fe(n, t, e, l) {
142
- if (typeof e == "number" || ye(e)) {
143
- const i = l - e, f = (e - t) / (n.dt || 1 / 60), o = n.opts.stiffness * i, a = n.opts.damping * f, r = (o - a) * n.inv_mass, s = (f + r) * n.dt;
144
- return Math.abs(s) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, ye(e) ? new Date(e.getTime() + s) : e + s);
145
  } else {
146
  if (Array.isArray(e))
147
  return e.map(
148
- (i, f) => fe(n, t[f], e[f], l[f])
149
  );
150
  if (typeof e == "object") {
151
  const i = {};
152
- for (const f in e)
153
- i[f] = fe(n, t[f], e[f], l[f]);
154
  return i;
155
  } else
156
  throw new Error(`Cannot spring ${typeof e} values`);
157
  }
158
  }
159
- function ke(n, t = {}) {
160
- const e = bt(n), { stiffness: l = 0.15, damping: i = 0.8, precision: f = 0.01 } = t;
161
- let o, a, r, s = n, _ = n, u = 1, w = 0, h = !1;
162
- function p(k, L = {}) {
163
- _ = k;
164
  const F = r = {};
165
- return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (h = !0, o = pe(), s = k, e.set(n = _), Promise.resolve()) : (L.soft && (w = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), u = 0), a || (o = pe(), h = !1, a = mt((c) => {
166
- if (h)
167
- return h = !1, a = null, !1;
168
- u = Math.min(u + w, 1);
169
- const y = {
170
- inv_mass: u,
171
  opts: C,
172
  settled: !0,
173
- dt: (c - o) * 60 / 1e3
174
- }, m = fe(y, s, n, _);
175
- return o = c, s = n, e.set(n = m), y.settled && (a = null), !y.settled;
176
- })), new Promise((c) => {
177
  a.promise.then(() => {
178
- F === r && c();
179
  });
180
  }));
181
  }
182
  const C = {
183
- set: p,
184
- update: (k, L) => p(k(_, n), L),
185
  subscribe: e.subscribe,
186
  stiffness: l,
187
  damping: i,
188
- precision: f
189
  };
190
  return C;
191
  }
@@ -197,20 +209,20 @@ const {
197
  detach: ht,
198
  element: wt,
199
  init: vt,
200
- insert: pt,
201
  noop: Fe,
202
- safe_not_equal: yt,
203
  set_style: $,
204
  svg_element: z,
205
  toggle_class: Le
206
- } = window.__gradio__svelte__internal, { onMount: kt } = window.__gradio__svelte__internal;
207
  function qt(n) {
208
- let t, e, l, i, f, o, a, r, s, _, u, w;
209
  return {
210
  c() {
211
- t = wt("div"), e = z("svg"), l = z("g"), i = z("path"), f = z("path"), o = z("path"), a = z("path"), r = z("g"), s = z("path"), _ = z("path"), u = z("path"), w = z("path"), v(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), v(i, "fill", "#FF7C00"), v(i, "fill-opacity", "0.4"), v(i, "class", "svelte-43sxxs"), v(f, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), v(f, "fill", "#FF7C00"), v(f, "class", "svelte-43sxxs"), v(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), v(o, "fill", "#FF7C00"), v(o, "fill-opacity", "0.4"), v(o, "class", "svelte-43sxxs"), v(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), v(a, "fill", "#FF7C00"), v(a, "class", "svelte-43sxxs"), $(l, "transform", "translate(" + /*$top*/
212
  n[1][0] + "px, " + /*$top*/
213
- n[1][1] + "px)"), v(s, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), v(s, "fill", "#FF7C00"), v(s, "fill-opacity", "0.4"), v(s, "class", "svelte-43sxxs"), v(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), v(_, "fill", "#FF7C00"), v(_, "class", "svelte-43sxxs"), v(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), v(u, "fill", "#FF7C00"), v(u, "fill-opacity", "0.4"), v(u, "class", "svelte-43sxxs"), v(w, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), v(w, "fill", "#FF7C00"), v(w, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
214
  n[2][0] + "px, " + /*$bottom*/
215
  n[2][1] + "px)"), v(e, "viewBox", "-1200 -1200 3000 3000"), v(e, "fill", "none"), v(e, "xmlns", "http://www.w3.org/2000/svg"), v(e, "class", "svelte-43sxxs"), v(t, "class", "svelte-43sxxs"), Le(
216
  t,
@@ -219,54 +231,54 @@ function qt(n) {
219
  n[0]
220
  );
221
  },
222
- m(h, p) {
223
- pt(h, t, p), N(t, e), N(e, l), N(l, i), N(l, f), N(l, o), N(l, a), N(e, r), N(r, s), N(r, _), N(r, u), N(r, w);
224
  },
225
- p(h, [p]) {
226
- p & /*$top*/
227
  2 && $(l, "transform", "translate(" + /*$top*/
228
- h[1][0] + "px, " + /*$top*/
229
- h[1][1] + "px)"), p & /*$bottom*/
230
  4 && $(r, "transform", "translate(" + /*$bottom*/
231
- h[2][0] + "px, " + /*$bottom*/
232
- h[2][1] + "px)"), p & /*margin*/
233
  1 && Le(
234
  t,
235
  "margin",
236
  /*margin*/
237
- h[0]
238
  );
239
  },
240
  i: Fe,
241
  o: Fe,
242
- d(h) {
243
- h && ht(t);
244
  }
245
  };
246
  }
247
  function Ft(n, t, e) {
248
- let l, i, { margin: f = !0 } = t;
249
- const o = ke([0, 0]);
250
- qe(n, o, (w) => e(1, l = w));
251
- const a = ke([0, 0]);
252
- qe(n, a, (w) => e(2, i = w));
253
  let r;
254
- async function s() {
255
  await Promise.all([o.set([125, 140]), a.set([-125, -140])]), await Promise.all([o.set([-125, 140]), a.set([125, -140])]), await Promise.all([o.set([-125, 0]), a.set([125, -0])]), await Promise.all([o.set([125, 0]), a.set([-125, 0])]);
256
  }
257
  async function _() {
258
- await s(), r || _();
259
  }
260
- async function u() {
261
  await Promise.all([o.set([125, 0]), a.set([-125, 0])]), _();
262
  }
263
- return kt(() => (u(), () => r = !0)), n.$$set = (w) => {
264
- "margin" in w && e(0, f = w.margin);
265
- }, [f, l, i, o, a];
266
  }
267
  class Lt extends gt {
268
  constructor(t) {
269
- super(), vt(this, t, Ft, qt, yt, { margin: 0 });
270
  }
271
  }
272
  const {
@@ -279,15 +291,15 @@ const {
279
  create_slot: Vt,
280
  destroy_component: St,
281
  destroy_each: Qe,
282
- detach: b,
283
- element: P,
284
  empty: U,
285
  ensure_array_like: le,
286
  get_all_dirty_from_scope: Nt,
287
  get_slot_changes: zt,
288
  group_outros: We,
289
  init: Tt,
290
- insert: g,
291
  mount_component: jt,
292
  noop: oe,
293
  safe_not_equal: Pt,
@@ -312,7 +324,7 @@ function Et(n) {
312
  let t, e = (
313
  /*i18n*/
314
  n[1]("common.error") + ""
315
- ), l, i, f;
316
  const o = (
317
  /*#slots*/
318
  n[29].error
@@ -325,26 +337,26 @@ function Et(n) {
325
  );
326
  return {
327
  c() {
328
- t = P("span"), l = q(e), i = j(), a && a.c(), T(t, "class", "error svelte-1txqlrd");
329
  },
330
- m(r, s) {
331
- g(r, t, s), H(t, l), g(r, i, s), a && a.m(r, s), f = !0;
332
  },
333
- p(r, s) {
334
- (!f || s[0] & /*i18n*/
335
  2) && e !== (e = /*i18n*/
336
- r[1]("common.error") + "") && S(l, e), a && a.p && (!f || s[0] & /*$$scope*/
337
  268435456) && Zt(
338
  a,
339
  o,
340
  r,
341
  /*$$scope*/
342
  r[28],
343
- f ? zt(
344
  o,
345
  /*$$scope*/
346
  r[28],
347
- s,
348
  Dt
349
  ) : Nt(
350
  /*$$scope*/
@@ -354,62 +366,62 @@ function Et(n) {
354
  );
355
  },
356
  i(r) {
357
- f || (O(a, r), f = !0);
358
  },
359
  o(r) {
360
- R(a, r), f = !1;
361
  },
362
  d(r) {
363
- r && (b(t), b(i)), a && a.d(r);
364
  }
365
  };
366
  }
367
  function It(n) {
368
- let t, e, l, i, f, o, a, r, s, _ = (
369
  /*variant*/
370
  n[8] === "default" && /*show_eta_bar*/
371
  n[18] && /*show_progress*/
372
  n[6] === "full" && Ne(n)
373
  );
374
- function u(c, y) {
375
  if (
376
  /*progress*/
377
- c[7]
378
  )
379
  return Yt;
380
  if (
381
  /*queue_position*/
382
- c[2] !== null && /*queue_size*/
383
- c[3] !== void 0 && /*queue_position*/
384
- c[2] >= 0
385
  )
386
  return Xt;
387
  if (
388
  /*queue_position*/
389
- c[2] === 0
390
  )
391
  return Ht;
392
  }
393
- let w = u(n), h = w && w(n), p = (
394
  /*timer*/
395
  n[5] && je(n)
396
  );
397
- const C = [Ut, Rt], k = [];
398
- function L(c, y) {
399
  return (
400
  /*last_progress_level*/
401
- c[15] != null ? 0 : (
402
  /*show_progress*/
403
- c[6] === "full" ? 1 : -1
404
  )
405
  );
406
  }
407
- ~(f = L(n)) && (o = k[f] = C[f](n));
408
  let F = !/*timer*/
409
  n[5] && Ie(n);
410
  return {
411
  c() {
412
- _ && _.c(), t = j(), e = P("div"), h && h.c(), l = j(), p && p.c(), i = j(), o && o.c(), a = j(), F && F.c(), r = U(), T(e, "class", "progress-text svelte-1txqlrd"), V(
413
  e,
414
  "meta-text-center",
415
  /*variant*/
@@ -421,41 +433,41 @@ function It(n) {
421
  n[8] === "default"
422
  );
423
  },
424
- m(c, y) {
425
- _ && _.m(c, y), g(c, t, y), g(c, e, y), h && h.m(e, null), H(e, l), p && p.m(e, null), g(c, i, y), ~f && k[f].m(c, y), g(c, a, y), F && F.m(c, y), g(c, r, y), s = !0;
426
  },
427
- p(c, y) {
428
  /*variant*/
429
- c[8] === "default" && /*show_eta_bar*/
430
- c[18] && /*show_progress*/
431
- c[6] === "full" ? _ ? _.p(c, y) : (_ = Ne(c), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), w === (w = u(c)) && h ? h.p(c, y) : (h && h.d(1), h = w && w(c), h && (h.c(), h.m(e, l))), /*timer*/
432
- c[5] ? p ? p.p(c, y) : (p = je(c), p.c(), p.m(e, null)) : p && (p.d(1), p = null), (!s || y[0] & /*variant*/
433
  256) && V(
434
  e,
435
  "meta-text-center",
436
  /*variant*/
437
- c[8] === "center"
438
- ), (!s || y[0] & /*variant*/
439
  256) && V(
440
  e,
441
  "meta-text",
442
  /*variant*/
443
- c[8] === "default"
444
  );
445
- let m = f;
446
- f = L(c), f === m ? ~f && k[f].p(c, y) : (o && (We(), R(k[m], 1, 1, () => {
447
- k[m] = null;
448
- }), Ke()), ~f ? (o = k[f], o ? o.p(c, y) : (o = k[f] = C[f](c), o.c()), O(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
449
- c[5] ? F && (F.d(1), F = null) : F ? F.p(c, y) : (F = Ie(c), F.c(), F.m(r.parentNode, r));
450
  },
451
- i(c) {
452
- s || (O(o), s = !0);
453
  },
454
- o(c) {
455
- R(o), s = !1;
456
  },
457
- d(c) {
458
- c && (b(t), b(e), b(i), b(a), b(r)), _ && _.d(c), h && h.d(), p && p.d(), ~f && k[f].d(c), F && F.d(c);
459
  }
460
  };
461
  }
@@ -464,10 +476,10 @@ function Ne(n) {
464
  (n[17] || 0) * 100 - 100}%)`;
465
  return {
466
  c() {
467
- t = P("div"), T(t, "class", "eta-bar svelte-1txqlrd"), D(t, "transform", e);
468
  },
469
  m(l, i) {
470
- g(l, t, i);
471
  },
472
  p(l, i) {
473
  i[0] & /*eta_level*/
@@ -475,7 +487,7 @@ function Ne(n) {
475
  (l[17] || 0) * 100 - 100}%)`) && D(t, "transform", e);
476
  },
477
  d(l) {
478
- l && b(t);
479
  }
480
  };
481
  }
@@ -486,11 +498,11 @@ function Ht(n) {
486
  t = q("processing |");
487
  },
488
  m(e, l) {
489
- g(e, t, l);
490
  },
491
  p: oe,
492
  d(e) {
493
- e && b(t);
494
  }
495
  };
496
  }
@@ -498,29 +510,29 @@ function Xt(n) {
498
  let t, e = (
499
  /*queue_position*/
500
  n[2] + 1 + ""
501
- ), l, i, f, o;
502
  return {
503
  c() {
504
- t = q("queue: "), l = q(e), i = q("/"), f = q(
505
  /*queue_size*/
506
  n[3]
507
  ), o = q(" |");
508
  },
509
  m(a, r) {
510
- g(a, t, r), g(a, l, r), g(a, i, r), g(a, f, r), g(a, o, r);
511
  },
512
  p(a, r) {
513
  r[0] & /*queue_position*/
514
  4 && e !== (e = /*queue_position*/
515
  a[2] + 1 + "") && S(l, e), r[0] & /*queue_size*/
516
  8 && S(
517
- f,
518
  /*queue_size*/
519
  a[3]
520
  );
521
  },
522
  d(a) {
523
- a && (b(t), b(l), b(i), b(f), b(o));
524
  }
525
  };
526
  }
@@ -537,13 +549,13 @@ function Yt(n) {
537
  l[i].c();
538
  t = U();
539
  },
540
- m(i, f) {
541
  for (let o = 0; o < l.length; o += 1)
542
- l[o] && l[o].m(i, f);
543
- g(i, t, f);
544
  },
545
- p(i, f) {
546
- if (f[0] & /*progress*/
547
  128) {
548
  e = le(
549
  /*progress*/
@@ -552,7 +564,7 @@ function Yt(n) {
552
  let o;
553
  for (o = 0; o < e.length; o += 1) {
554
  const a = Se(i, e, o);
555
- l[o] ? l[o].p(a, f) : (l[o] = Te(a), l[o].c(), l[o].m(t.parentNode, t));
556
  }
557
  for (; o < l.length; o += 1)
558
  l[o].d(1);
@@ -560,7 +572,7 @@ function Yt(n) {
560
  }
561
  },
562
  d(i) {
563
- i && b(t), Qe(l, i);
564
  }
565
  };
566
  }
@@ -568,28 +580,28 @@ function ze(n) {
568
  let t, e = (
569
  /*p*/
570
  n[38].unit + ""
571
- ), l, i, f = " ", o;
572
- function a(_, u) {
573
  return (
574
  /*p*/
575
  _[38].length != null ? Ot : Gt
576
  );
577
  }
578
- let r = a(n), s = r(n);
579
  return {
580
  c() {
581
- s.c(), t = j(), l = q(e), i = q(" | "), o = q(f);
582
  },
583
- m(_, u) {
584
- s.m(_, u), g(_, t, u), g(_, l, u), g(_, i, u), g(_, o, u);
585
  },
586
- p(_, u) {
587
- r === (r = a(_)) && s ? s.p(_, u) : (s.d(1), s = r(_), s && (s.c(), s.m(t.parentNode, t))), u[0] & /*progress*/
588
  128 && e !== (e = /*p*/
589
  _[38].unit + "") && S(l, e);
590
  },
591
  d(_) {
592
- _ && (b(t), b(l), b(i), b(o)), s.d(_);
593
  }
594
  };
595
  }
@@ -603,7 +615,7 @@ function Gt(n) {
603
  e = q(t);
604
  },
605
  m(l, i) {
606
- g(l, e, i);
607
  },
608
  p(l, i) {
609
  i[0] & /*progress*/
@@ -613,7 +625,7 @@ function Gt(n) {
613
  ) + "") && S(e, t);
614
  },
615
  d(l) {
616
- l && b(e);
617
  }
618
  };
619
  }
@@ -624,13 +636,13 @@ function Ot(n) {
624
  ) + "", e, l, i = Y(
625
  /*p*/
626
  n[38].length
627
- ) + "", f;
628
  return {
629
  c() {
630
- e = q(t), l = q("/"), f = q(i);
631
  },
632
  m(o, a) {
633
- g(o, e, a), g(o, l, a), g(o, f, a);
634
  },
635
  p(o, a) {
636
  a[0] & /*progress*/
@@ -641,10 +653,10 @@ function Ot(n) {
641
  128 && i !== (i = Y(
642
  /*p*/
643
  o[38].length
644
- ) + "") && S(f, i);
645
  },
646
  d(o) {
647
- o && (b(e), b(l), b(f));
648
  }
649
  };
650
  }
@@ -658,14 +670,14 @@ function Te(n) {
658
  e && e.c(), t = U();
659
  },
660
  m(l, i) {
661
- e && e.m(l, i), g(l, t, i);
662
  },
663
  p(l, i) {
664
  /*p*/
665
  l[38].index != null ? e ? e.p(l, i) : (e = ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
666
  },
667
  d(l) {
668
- l && b(t), e && e.d(l);
669
  }
670
  };
671
  }
@@ -682,22 +694,22 @@ function je(n) {
682
  n[20]
683
  ), l = q(e), i = q("s");
684
  },
685
- m(f, o) {
686
- g(f, t, o), g(f, l, o), g(f, i, o);
687
  },
688
- p(f, o) {
689
  o[0] & /*formatted_timer*/
690
  1048576 && S(
691
  t,
692
  /*formatted_timer*/
693
- f[20]
694
  ), o[0] & /*eta, formatted_eta*/
695
  524289 && e !== (e = /*eta*/
696
- f[0] ? `/${/*formatted_eta*/
697
- f[19]}` : "") && S(l, e);
698
  },
699
- d(f) {
700
- f && (b(t), b(l), b(i));
701
  }
702
  };
703
  }
@@ -716,10 +728,10 @@ function Rt(n) {
716
  jt(t, l, i), e = !0;
717
  },
718
  p(l, i) {
719
- const f = {};
720
  i[0] & /*variant*/
721
- 256 && (f.margin = /*variant*/
722
- l[8] === "default"), t.$set(f);
723
  },
724
  i(l) {
725
  e || (O(t.$$.fragment, l), e = !0);
@@ -733,28 +745,28 @@ function Rt(n) {
733
  };
734
  }
735
  function Ut(n) {
736
- let t, e, l, i, f, o = `${/*last_progress_level*/
737
  n[15] * 100}%`, a = (
738
  /*progress*/
739
  n[7] != null && Pe(n)
740
  );
741
  return {
742
  c() {
743
- t = P("div"), e = P("div"), a && a.c(), l = j(), i = P("div"), f = P("div"), T(e, "class", "progress-level-inner svelte-1txqlrd"), T(f, "class", "progress-bar svelte-1txqlrd"), D(f, "width", o), T(i, "class", "progress-bar-wrap svelte-1txqlrd"), T(t, "class", "progress-level svelte-1txqlrd");
744
  },
745
- m(r, s) {
746
- g(r, t, s), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, f), n[30](f);
747
  },
748
- p(r, s) {
749
  /*progress*/
750
- r[7] != null ? a ? a.p(r, s) : (a = Pe(r), a.c(), a.m(e, null)) : a && (a.d(1), a = null), s[0] & /*last_progress_level*/
751
  32768 && o !== (o = `${/*last_progress_level*/
752
- r[15] * 100}%`) && D(f, "width", o);
753
  },
754
  i: oe,
755
  o: oe,
756
  d(r) {
757
- r && b(t), a && a.d(), n[30](null);
758
  }
759
  };
760
  }
@@ -771,13 +783,13 @@ function Pe(n) {
771
  l[i].c();
772
  t = U();
773
  },
774
- m(i, f) {
775
  for (let o = 0; o < l.length; o += 1)
776
- l[o] && l[o].m(i, f);
777
- g(i, t, f);
778
  },
779
- p(i, f) {
780
- if (f[0] & /*progress_level, progress*/
781
  16512) {
782
  e = le(
783
  /*progress*/
@@ -786,7 +798,7 @@ function Pe(n) {
786
  let o;
787
  for (o = 0; o < e.length; o += 1) {
788
  const a = Ve(i, e, o);
789
- l[o] ? l[o].p(a, f) : (l[o] = Ee(a), l[o].c(), l[o].m(t.parentNode, t));
790
  }
791
  for (; o < l.length; o += 1)
792
  l[o].d(1);
@@ -794,12 +806,12 @@ function Pe(n) {
794
  }
795
  },
796
  d(i) {
797
- i && b(t), Qe(l, i);
798
  }
799
  };
800
  }
801
  function Ze(n) {
802
- let t, e, l, i, f = (
803
  /*i*/
804
  n[40] !== 0 && Jt()
805
  ), o = (
@@ -819,24 +831,24 @@ function Ze(n) {
819
  );
820
  return {
821
  c() {
822
- f && f.c(), t = j(), o && o.c(), e = j(), a && a.c(), l = j(), r && r.c(), i = U();
823
  },
824
- m(s, _) {
825
- f && f.m(s, _), g(s, t, _), o && o.m(s, _), g(s, e, _), a && a.m(s, _), g(s, l, _), r && r.m(s, _), g(s, i, _);
826
  },
827
- p(s, _) {
828
  /*p*/
829
- s[38].desc != null ? o ? o.p(s, _) : (o = Be(s), o.c(), o.m(e.parentNode, e)) : o && (o.d(1), o = null), /*p*/
830
- s[38].desc != null && /*progress_level*/
831
- s[14] && /*progress_level*/
832
- s[14][
833
  /*i*/
834
- s[40]
835
  ] != null ? a || (a = Ae(), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null), /*progress_level*/
836
- s[14] != null ? r ? r.p(s, _) : (r = De(s), r.c(), r.m(i.parentNode, i)) : r && (r.d(1), r = null);
837
  },
838
- d(s) {
839
- s && (b(t), b(e), b(l), b(i)), f && f.d(s), o && o.d(s), a && a.d(s), r && r.d(s);
840
  }
841
  };
842
  }
@@ -847,10 +859,10 @@ function Jt(n) {
847
  t = q(" /");
848
  },
849
  m(e, l) {
850
- g(e, t, l);
851
  },
852
  d(e) {
853
- e && b(t);
854
  }
855
  };
856
  }
@@ -864,7 +876,7 @@ function Be(n) {
864
  e = q(t);
865
  },
866
  m(l, i) {
867
- g(l, e, i);
868
  },
869
  p(l, i) {
870
  i[0] & /*progress*/
@@ -872,7 +884,7 @@ function Be(n) {
872
  l[38].desc + "") && S(e, t);
873
  },
874
  d(l) {
875
- l && b(e);
876
  }
877
  };
878
  }
@@ -883,10 +895,10 @@ function Ae(n) {
883
  t = q("-");
884
  },
885
  m(e, l) {
886
- g(e, t, l);
887
  },
888
  d(e) {
889
- e && b(t);
890
  }
891
  };
892
  }
@@ -900,11 +912,11 @@ function De(n) {
900
  c() {
901
  e = q(t), l = q("%");
902
  },
903
- m(i, f) {
904
- g(i, e, f), g(i, l, f);
905
  },
906
- p(i, f) {
907
- f[0] & /*progress_level*/
908
  16384 && t !== (t = (100 * /*progress_level*/
909
  (i[14][
910
  /*i*/
@@ -912,7 +924,7 @@ function De(n) {
912
  ] || 0)).toFixed(1) + "") && S(e, t);
913
  },
914
  d(i) {
915
- i && (b(e), b(l));
916
  }
917
  };
918
  }
@@ -931,7 +943,7 @@ function Ee(n) {
931
  e && e.c(), t = U();
932
  },
933
  m(l, i) {
934
- e && e.m(l, i), g(l, t, i);
935
  },
936
  p(l, i) {
937
  /*p*/
@@ -943,7 +955,7 @@ function Ee(n) {
943
  ] != null ? e ? e.p(l, i) : (e = Ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
944
  },
945
  d(l) {
946
- l && b(t), e && e.d(l);
947
  }
948
  };
949
  }
@@ -951,13 +963,13 @@ function Ie(n) {
951
  let t, e;
952
  return {
953
  c() {
954
- t = P("p"), e = q(
955
  /*loading_text*/
956
  n[9]
957
  ), T(t, "class", "loading svelte-1txqlrd");
958
  },
959
  m(l, i) {
960
- g(l, t, i), H(t, e);
961
  },
962
  p(l, i) {
963
  i[0] & /*loading_text*/
@@ -968,25 +980,25 @@ function Ie(n) {
968
  );
969
  },
970
  d(l) {
971
- l && b(t);
972
  }
973
  };
974
  }
975
  function Kt(n) {
976
- let t, e, l, i, f;
977
  const o = [It, Et], a = [];
978
- function r(s, _) {
979
  return (
980
  /*status*/
981
- s[4] === "pending" ? 0 : (
982
  /*status*/
983
- s[4] === "error" ? 1 : -1
984
  )
985
  );
986
  }
987
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
988
  c() {
989
- t = P("div"), l && l.c(), T(t, "class", i = "wrap " + /*variant*/
990
  n[8] + " " + /*show_progress*/
991
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
992
  n[4] || /*status*/
@@ -1022,86 +1034,86 @@ function Kt(n) {
1022
  n[10] ? "0" : "var(--size-8) 0"
1023
  );
1024
  },
1025
- m(s, _) {
1026
- g(s, t, _), ~e && a[e].m(t, null), n[31](t), f = !0;
1027
  },
1028
- p(s, _) {
1029
- let u = e;
1030
- e = r(s), e === u ? ~e && a[e].p(s, _) : (l && (We(), R(a[u], 1, 1, () => {
1031
- a[u] = null;
1032
- }), Ke()), ~e ? (l = a[e], l ? l.p(s, _) : (l = a[e] = o[e](s), l.c()), O(l, 1), l.m(t, null)) : l = null), (!f || _[0] & /*variant, show_progress*/
1033
  320 && i !== (i = "wrap " + /*variant*/
1034
- s[8] + " " + /*show_progress*/
1035
- s[6] + " svelte-1txqlrd")) && T(t, "class", i), (!f || _[0] & /*variant, show_progress, status, show_progress*/
1036
  336) && V(t, "hide", !/*status*/
1037
- s[4] || /*status*/
1038
- s[4] === "complete" || /*show_progress*/
1039
- s[6] === "hidden"), (!f || _[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
1040
  2384) && V(
1041
  t,
1042
  "translucent",
1043
  /*variant*/
1044
- s[8] === "center" && /*status*/
1045
- (s[4] === "pending" || /*status*/
1046
- s[4] === "error") || /*translucent*/
1047
- s[11] || /*show_progress*/
1048
- s[6] === "minimal"
1049
- ), (!f || _[0] & /*variant, show_progress, status*/
1050
  336) && V(
1051
  t,
1052
  "generating",
1053
  /*status*/
1054
- s[4] === "generating"
1055
- ), (!f || _[0] & /*variant, show_progress, border*/
1056
  4416) && V(
1057
  t,
1058
  "border",
1059
  /*border*/
1060
- s[12]
1061
  ), _[0] & /*absolute*/
1062
  1024 && D(
1063
  t,
1064
  "position",
1065
  /*absolute*/
1066
- s[10] ? "absolute" : "static"
1067
  ), _[0] & /*absolute*/
1068
  1024 && D(
1069
  t,
1070
  "padding",
1071
  /*absolute*/
1072
- s[10] ? "0" : "var(--size-8) 0"
1073
  );
1074
  },
1075
- i(s) {
1076
- f || (O(l), f = !0);
1077
  },
1078
- o(s) {
1079
- R(l), f = !1;
1080
  },
1081
- d(s) {
1082
- s && b(t), ~e && a[e].d(), n[31](null);
1083
  }
1084
  };
1085
  }
1086
- let ee = [], se = !1;
1087
  async function Qt(n, t = !0) {
1088
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
1089
- if (ee.push(n), !se)
1090
- se = !0;
1091
  else
1092
  return;
1093
  await Bt(), requestAnimationFrame(() => {
1094
  let e = [0, 0];
1095
  for (let l = 0; l < ee.length; l++) {
1096
- const f = ee[l].getBoundingClientRect();
1097
- (l === 0 || f.top + window.scrollY <= e[0]) && (e[0] = f.top + window.scrollY, e[1] = l);
1098
  }
1099
- window.scrollTo({ top: e[0] - 20, behavior: "smooth" }), se = !1, ee = [];
1100
  });
1101
  }
1102
  }
1103
  function Wt(n, t, e) {
1104
- let l, { $$slots: i = {}, $$scope: f } = t, { i18n: o } = t, { eta: a = null } = t, { queue: r = !1 } = t, { queue_position: s } = t, { queue_size: _ } = t, { status: u } = t, { scroll_to_output: w = !1 } = t, { timer: h = !0 } = t, { show_progress: p = "full" } = t, { message: C = null } = t, { progress: k = null } = t, { variant: L = "default" } = t, { loading_text: F = "Loading..." } = t, { absolute: c = !0 } = t, { translucent: y = !1 } = t, { border: m = !1 } = t, { autoscroll: ne } = t, J, K = !1, W = 0, E = 0, ie = null, de = 0, I = null, Q, Z = null, me = !0;
1105
  const et = () => {
1106
  e(25, W = performance.now()), e(26, E = 0), K = !0, be();
1107
  };
@@ -1119,7 +1131,7 @@ function Wt(n, t, e) {
1119
  let he = null;
1120
  function tt(d) {
1121
  Ce[d ? "unshift" : "push"](() => {
1122
- Z = d, e(16, Z), e(7, k), e(14, I), e(15, Q);
1123
  });
1124
  }
1125
  function lt(d) {
@@ -1128,52 +1140,52 @@ function Wt(n, t, e) {
1128
  });
1129
  }
1130
  return n.$$set = (d) => {
1131
- "i18n" in d && e(1, o = d.i18n), "eta" in d && e(0, a = d.eta), "queue" in d && e(21, r = d.queue), "queue_position" in d && e(2, s = d.queue_position), "queue_size" in d && e(3, _ = d.queue_size), "status" in d && e(4, u = d.status), "scroll_to_output" in d && e(22, w = d.scroll_to_output), "timer" in d && e(5, h = d.timer), "show_progress" in d && e(6, p = d.show_progress), "message" in d && e(23, C = d.message), "progress" in d && e(7, k = d.progress), "variant" in d && e(8, L = d.variant), "loading_text" in d && e(9, F = d.loading_text), "absolute" in d && e(10, c = d.absolute), "translucent" in d && e(11, y = d.translucent), "border" in d && e(12, m = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, f = d.$$scope);
1132
  }, n.$$.update = () => {
1133
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1134
  169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - W) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
1135
  67108865 && e(17, de = a === null || a <= 0 || !E ? null : Math.min(E / a, 1)), n.$$.dirty[0] & /*progress*/
1136
- 128 && k != null && e(18, me = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1137
- 114816 && (k != null ? e(14, I = k.map((d) => {
1138
  if (d.index != null && d.length != null)
1139
  return d.index / d.length;
1140
  if (d.progress != null)
1141
  return d.progress;
1142
- })) : e(14, I = null), I ? (e(15, Q = I[I.length - 1]), Z && (Q === 0 ? e(16, Z.style.transition = "0", Z) : e(16, Z.style.transition = "150ms", Z))) : e(15, Q = void 0)), n.$$.dirty[0] & /*status*/
1143
- 16 && (u === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1144
- 20979728 && J && w && (u === "pending" || u === "complete") && Qt(J, ne), n.$$.dirty[0] & /*status, message*/
1145
  8388624, n.$$.dirty[0] & /*timer_diff*/
1146
  67108864 && e(20, l = E.toFixed(1));
1147
  }, [
1148
  a,
1149
  o,
1150
- s,
1151
  _,
1152
- u,
1153
- h,
 
1154
  p,
1155
- k,
1156
  L,
1157
  F,
1158
- c,
1159
- y,
1160
- m,
1161
  J,
1162
  I,
1163
  Q,
1164
- Z,
1165
  de,
1166
  me,
1167
  he,
1168
  l,
1169
  r,
1170
- w,
1171
  C,
1172
  ne,
1173
  W,
1174
  E,
1175
  ie,
1176
- f,
1177
  i,
1178
  tt,
1179
  lt
@@ -1218,8 +1230,8 @@ const {
1218
  detach: ll,
1219
  element: nl,
1220
  get_all_dirty_from_scope: il,
1221
- get_slot_changes: sl,
1222
- get_spread_update: fl,
1223
  init: ol,
1224
  insert: al,
1225
  safe_not_equal: rl,
@@ -1230,12 +1242,12 @@ const {
1230
  transition_out: $e,
1231
  update_slot_base: _l
1232
  } = window.__gradio__svelte__internal;
1233
- function cl(n) {
1234
  let t, e, l;
1235
  const i = (
1236
  /*#slots*/
1237
  n[17].default
1238
- ), f = tl(
1239
  i,
1240
  n,
1241
  /*$$scope*/
@@ -1263,7 +1275,7 @@ function cl(n) {
1263
  t = nl(
1264
  /*tag*/
1265
  n[14]
1266
- ), f && f.c(), He(
1267
  /*tag*/
1268
  n[14]
1269
  )(t, a), A(
@@ -1307,22 +1319,22 @@ function cl(n) {
1307
  ), M(t, "min-width", `calc(min(${/*min_width*/
1308
  n[13]}px, 100%))`), M(t, "border-width", "var(--block-border-width)");
1309
  },
1310
- m(r, s) {
1311
- al(r, t, s), f && f.m(t, null), l = !0;
1312
  },
1313
- p(r, s) {
1314
- f && f.p && (!l || s & /*$$scope*/
1315
  65536) && _l(
1316
- f,
1317
  i,
1318
  r,
1319
  /*$$scope*/
1320
  r[16],
1321
- l ? sl(
1322
  i,
1323
  /*$$scope*/
1324
  r[16],
1325
- s,
1326
  null
1327
  ) : il(
1328
  /*$$scope*/
@@ -1332,18 +1344,18 @@ function cl(n) {
1332
  ), He(
1333
  /*tag*/
1334
  r[14]
1335
- )(t, a = fl(o, [
1336
- (!l || s & /*test_id*/
1337
  128) && { "data-testid": (
1338
  /*test_id*/
1339
  r[7]
1340
  ) },
1341
- (!l || s & /*elem_id*/
1342
  4) && { id: (
1343
  /*elem_id*/
1344
  r[2]
1345
  ) },
1346
- (!l || s & /*elem_classes*/
1347
  8 && e !== (e = "block " + /*elem_classes*/
1348
  r[3].join(" ") + " svelte-1t38q2d")) && { class: e }
1349
  ])), A(
@@ -1363,51 +1375,51 @@ function cl(n) {
1363
  r[5] === "focus"
1364
  ), A(t, "hide-container", !/*explicit_call*/
1365
  r[8] && !/*container*/
1366
- r[9]), s & /*height*/
1367
  1 && M(t, "height", typeof /*height*/
1368
  r[0] == "number" ? (
1369
  /*height*/
1370
  r[0] + "px"
1371
- ) : void 0), s & /*width*/
1372
  2 && M(t, "width", typeof /*width*/
1373
  r[1] == "number" ? `calc(min(${/*width*/
1374
- r[1]}px, 100%))` : void 0), s & /*variant*/
1375
  16 && M(
1376
  t,
1377
  "border-style",
1378
  /*variant*/
1379
  r[4]
1380
- ), s & /*allow_overflow*/
1381
  2048 && M(
1382
  t,
1383
  "overflow",
1384
  /*allow_overflow*/
1385
  r[11] ? "visible" : "hidden"
1386
- ), s & /*scale*/
1387
  4096 && M(
1388
  t,
1389
  "flex-grow",
1390
  /*scale*/
1391
  r[12]
1392
- ), s & /*min_width*/
1393
  8192 && M(t, "min-width", `calc(min(${/*min_width*/
1394
  r[13]}px, 100%))`);
1395
  },
1396
  i(r) {
1397
- l || (xe(f, r), l = !0);
1398
  },
1399
  o(r) {
1400
- $e(f, r), l = !1;
1401
  },
1402
  d(r) {
1403
- r && ll(t), f && f.d(r);
1404
  }
1405
  };
1406
  }
1407
- function ul(n) {
1408
  let t, e = (
1409
  /*tag*/
1410
- n[14] && cl(n)
1411
  );
1412
  return {
1413
  c() {
@@ -1432,33 +1444,33 @@ function ul(n) {
1432
  };
1433
  }
1434
  function dl(n, t, e) {
1435
- let { $$slots: l = {}, $$scope: i } = t, { height: f = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: r = [] } = t, { variant: s = "solid" } = t, { border_mode: _ = "base" } = t, { padding: u = !0 } = t, { type: w = "normal" } = t, { test_id: h = void 0 } = t, { explicit_call: p = !1 } = t, { container: C = !0 } = t, { visible: k = !0 } = t, { allow_overflow: L = !0 } = t, { scale: F = null } = t, { min_width: c = 0 } = t, y = w === "fieldset" ? "fieldset" : "div";
1436
- return n.$$set = (m) => {
1437
- "height" in m && e(0, f = m.height), "width" in m && e(1, o = m.width), "elem_id" in m && e(2, a = m.elem_id), "elem_classes" in m && e(3, r = m.elem_classes), "variant" in m && e(4, s = m.variant), "border_mode" in m && e(5, _ = m.border_mode), "padding" in m && e(6, u = m.padding), "type" in m && e(15, w = m.type), "test_id" in m && e(7, h = m.test_id), "explicit_call" in m && e(8, p = m.explicit_call), "container" in m && e(9, C = m.container), "visible" in m && e(10, k = m.visible), "allow_overflow" in m && e(11, L = m.allow_overflow), "scale" in m && e(12, F = m.scale), "min_width" in m && e(13, c = m.min_width), "$$scope" in m && e(16, i = m.$$scope);
1438
  }, [
1439
- f,
1440
  o,
1441
  a,
1442
  r,
1443
- s,
1444
  _,
1445
- u,
1446
- h,
1447
- p,
1448
  C,
1449
- k,
1450
  L,
1451
  F,
 
 
1452
  c,
1453
- y,
1454
- w,
1455
  i,
1456
  l
1457
  ];
1458
  }
1459
  class ml extends $t {
1460
  constructor(t) {
1461
- super(), ol(this, t, dl, ul, rl, {
1462
  height: 0,
1463
  width: 1,
1464
  elem_id: 2,
@@ -1799,42 +1811,42 @@ const {
1799
  destroy_component: re,
1800
  detach: Ye,
1801
  element: vl,
1802
- get_spread_object: pl,
1803
- get_spread_update: yl,
1804
- init: kl,
1805
  insert: Ge,
1806
  mount_component: _e,
1807
  safe_not_equal: ql,
1808
  space: Fl,
1809
  toggle_class: Oe,
1810
- transition_in: ce,
1811
- transition_out: ue
1812
  } = window.__gradio__svelte__internal;
1813
  function Ll(n) {
1814
  var r;
1815
- let t, e, l, i, f;
1816
  const o = [
1817
  { autoscroll: (
1818
  /*gradio*/
1819
- n[5].autoscroll
1820
  ) },
1821
  { i18n: (
1822
  /*gradio*/
1823
- n[5].i18n
1824
  ) },
1825
  /*loading_status*/
1826
- n[4],
1827
  { variant: "center" }
1828
  ];
1829
  let a = {};
1830
- for (let s = 0; s < o.length; s += 1)
1831
- a = hl(a, o[s]);
1832
- return t = new xt({ props: a }), i = new ut({
1833
  props: {
1834
  min_height: (
1835
  /*loading_status*/
1836
- n[4] && /*loading_status*/
1837
- ((r = n[4]) == null ? void 0 : r.status) !== "complete"
1838
  ),
1839
  value: (
1840
  /*value*/
@@ -1847,73 +1859,79 @@ function Ll(n) {
1847
  visible: (
1848
  /*visible*/
1849
  n[2]
 
 
 
 
1850
  )
1851
  }
1852
  }), i.$on(
1853
  "change",
1854
  /*change_handler*/
1855
- n[7]
1856
  ), {
1857
  c() {
1858
- var s;
1859
  ae(t.$$.fragment), e = Fl(), l = vl("div"), ae(i.$$.fragment), wl(l, "class", "svelte-gqsrr7"), Oe(
1860
  l,
1861
  "pending",
1862
  /*loading_status*/
1863
- ((s = n[4]) == null ? void 0 : s.status) === "pending"
1864
  );
1865
  },
1866
- m(s, _) {
1867
- _e(t, s, _), Ge(s, e, _), Ge(s, l, _), _e(i, l, null), f = !0;
1868
  },
1869
- p(s, _) {
1870
- var h, p;
1871
- const u = _ & /*gradio, loading_status*/
1872
- 48 ? yl(o, [
1873
  _ & /*gradio*/
1874
- 32 && { autoscroll: (
1875
  /*gradio*/
1876
- s[5].autoscroll
1877
  ) },
1878
  _ & /*gradio*/
1879
- 32 && { i18n: (
1880
  /*gradio*/
1881
- s[5].i18n
1882
  ) },
1883
  _ & /*loading_status*/
1884
- 16 && pl(
1885
  /*loading_status*/
1886
- s[4]
1887
  ),
1888
  o[3]
1889
  ]) : {};
1890
- t.$set(u);
1891
- const w = {};
1892
  _ & /*loading_status*/
1893
- 16 && (w.min_height = /*loading_status*/
1894
- s[4] && /*loading_status*/
1895
- ((h = s[4]) == null ? void 0 : h.status) !== "complete"), _ & /*value*/
1896
- 8 && (w.value = /*value*/
1897
- s[3]), _ & /*elem_classes*/
1898
- 2 && (w.elem_classes = /*elem_classes*/
1899
- s[1]), _ & /*visible*/
1900
- 4 && (w.visible = /*visible*/
1901
- s[2]), i.$set(w), (!f || _ & /*loading_status*/
1902
- 16) && Oe(
 
 
1903
  l,
1904
  "pending",
1905
  /*loading_status*/
1906
- ((p = s[4]) == null ? void 0 : p.status) === "pending"
1907
  );
1908
  },
1909
- i(s) {
1910
- f || (ce(t.$$.fragment, s), ce(i.$$.fragment, s), f = !0);
1911
  },
1912
- o(s) {
1913
- ue(t.$$.fragment, s), ue(i.$$.fragment, s), f = !1;
1914
  },
1915
- d(s) {
1916
- s && (Ye(e), Ye(l)), re(t, s), re(i);
1917
  }
1918
  };
1919
  }
@@ -1945,21 +1963,21 @@ function Cl(n) {
1945
  _e(t, l, i), e = !0;
1946
  },
1947
  p(l, [i]) {
1948
- const f = {};
1949
  i & /*visible*/
1950
- 4 && (f.visible = /*visible*/
1951
  l[2]), i & /*elem_id*/
1952
- 1 && (f.elem_id = /*elem_id*/
1953
  l[0]), i & /*elem_classes*/
1954
- 2 && (f.elem_classes = /*elem_classes*/
1955
- l[1]), i & /*$$scope, loading_status, value, elem_classes, visible, gradio*/
1956
- 318 && (f.$$scope = { dirty: i, ctx: l }), t.$set(f);
1957
  },
1958
  i(l) {
1959
- e || (ce(t.$$.fragment, l), e = !0);
1960
  },
1961
  o(l) {
1962
- ue(t.$$.fragment, l), e = !1;
1963
  },
1964
  d(l) {
1965
  re(t, l);
@@ -1967,34 +1985,36 @@ function Cl(n) {
1967
  };
1968
  }
1969
  function Ml(n, t, e) {
1970
- let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: f = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { loading_status: r } = t, { gradio: s } = t;
1971
- const _ = () => s.dispatch("change");
1972
- return n.$$set = (u) => {
1973
- "label" in u && e(6, l = u.label), "elem_id" in u && e(0, i = u.elem_id), "elem_classes" in u && e(1, f = u.elem_classes), "visible" in u && e(2, o = u.visible), "value" in u && e(3, a = u.value), "loading_status" in u && e(4, r = u.loading_status), "gradio" in u && e(5, s = u.gradio);
1974
  }, n.$$.update = () => {
1975
  n.$$.dirty & /*label, gradio*/
1976
- 96 && s.dispatch("change");
1977
  }, [
1978
  i,
1979
- f,
1980
  o,
1981
  a,
1982
  r,
1983
- s,
 
1984
  l,
1985
- _
1986
  ];
1987
  }
1988
  class Vl extends gl {
1989
  constructor(t) {
1990
- super(), kl(this, t, Ml, Cl, ql, {
1991
- label: 6,
1992
  elem_id: 0,
1993
  elem_classes: 1,
1994
  visible: 2,
1995
  value: 3,
1996
- loading_status: 4,
1997
- gradio: 5
 
1998
  });
1999
  }
2000
  }
 
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
+ attr: P,
5
+ detach: ft,
6
  element: we,
7
+ init: st,
8
  insert: ot,
9
  noop: ve,
10
  safe_not_equal: at,
 
14
  let t, e, l;
15
  return {
16
  c() {
17
+ t = we("div"), e = we("iframe"), P(e, "title", "iframe component"), P(e, "width", "100%"), P(
18
+ e,
19
+ "height",
20
+ /*height*/
21
+ n[4]
22
+ ), P(
23
  e,
24
  "srcdoc",
25
  /*value*/
26
  n[1]
27
+ ), P(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, P(t, "class", l = "prose " + /*elem_classes*/
28
  n[0].join(" ") + " svelte-2qygph"), x(
29
  t,
30
  "min",
 
33
  ), x(t, "hide", !/*visible*/
34
  n[2]);
35
  },
36
+ m(i, s) {
37
+ ot(i, t, s), it(t, e);
38
  },
39
+ p(i, [s]) {
40
+ s & /*height*/
41
+ 16 && P(
42
+ e,
43
+ "height",
44
+ /*height*/
45
+ i[4]
46
+ ), s & /*value*/
47
+ 2 && P(
48
  e,
49
  "srcdoc",
50
  /*value*/
51
  i[1]
52
+ ), s & /*elem_classes*/
53
  1 && l !== (l = "prose " + /*elem_classes*/
54
+ i[0].join(" ") + " svelte-2qygph") && P(t, "class", l), s & /*elem_classes, min_height*/
55
  9 && x(
56
  t,
57
  "min",
58
  /*min_height*/
59
  i[3]
60
+ ), s & /*elem_classes, visible*/
61
  5 && x(t, "hide", !/*visible*/
62
  i[2]);
63
  },
64
  i: ve,
65
  o: ve,
66
  d(i) {
67
+ i && ft(t);
68
  }
69
  };
70
  }
71
+ function ut(n, t, e) {
72
+ let { elem_classes: l = [] } = t, { value: i } = t, { visible: s = !0 } = t, { min_height: o = !1 } = t, { height: a = "100%" } = t;
73
+ const r = rt();
74
+ return n.$$set = (f) => {
75
+ "elem_classes" in f && e(0, l = f.elem_classes), "value" in f && e(1, i = f.value), "visible" in f && e(2, s = f.visible), "min_height" in f && e(3, o = f.min_height), "height" in f && e(4, a = f.height);
76
  }, n.$$.update = () => {
77
  n.$$.dirty & /*value*/
78
+ 2 && r("change");
79
+ }, [l, i, s, o, a];
80
  }
81
+ class ct extends nt {
82
  constructor(t) {
83
+ super(), st(this, t, ut, _t, at, {
84
  elem_classes: 0,
85
  value: 1,
86
  visible: 2,
87
+ min_height: 3,
88
+ height: 4
89
  });
90
  }
91
  }
 
102
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
103
  }
104
  const Re = typeof window < "u";
105
+ let ye = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
106
  const G = /* @__PURE__ */ new Set();
107
  function Je(n) {
108
  G.forEach((t) => {
 
127
  function i(a) {
128
  if (dt(n, a) && (n = a, e)) {
129
  const r = !X.length;
130
+ for (const f of l)
131
+ f[1](), X.push(f, n);
132
  if (r) {
133
+ for (let f = 0; f < X.length; f += 2)
134
+ X[f][0](X[f + 1]);
135
  X.length = 0;
136
  }
137
  }
138
  }
139
+ function s(a) {
140
  i(a(n));
141
  }
142
  function o(a, r = te) {
143
+ const f = [a, r];
144
+ return l.add(f), l.size === 1 && (e = t(i, s) || te), a(n), () => {
145
+ l.delete(f), l.size === 0 && e && (e(), e = null);
146
  };
147
  }
148
+ return { set: i, update: s, subscribe: o };
149
  }
150
+ function ke(n) {
151
  return Object.prototype.toString.call(n) === "[object Date]";
152
  }
153
+ function se(n, t, e, l) {
154
+ if (typeof e == "number" || ke(e)) {
155
+ const i = l - e, s = (e - t) / (n.dt || 1 / 60), o = n.opts.stiffness * i, a = n.opts.damping * s, r = (o - a) * n.inv_mass, f = (s + r) * n.dt;
156
+ return Math.abs(f) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, ke(e) ? new Date(e.getTime() + f) : e + f);
157
  } else {
158
  if (Array.isArray(e))
159
  return e.map(
160
+ (i, s) => se(n, t[s], e[s], l[s])
161
  );
162
  if (typeof e == "object") {
163
  const i = {};
164
+ for (const s in e)
165
+ i[s] = se(n, t[s], e[s], l[s]);
166
  return i;
167
  } else
168
  throw new Error(`Cannot spring ${typeof e} values`);
169
  }
170
  }
171
+ function pe(n, t = {}) {
172
+ const e = bt(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
173
+ let o, a, r, f = n, _ = n, m = 1, c = 0, w = !1;
174
+ function y(p, L = {}) {
175
+ _ = p;
176
  const F = r = {};
177
+ return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (w = !0, o = ye(), f = p, e.set(n = _), Promise.resolve()) : (L.soft && (c = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), m = 0), a || (o = ye(), w = !1, a = mt((u) => {
178
+ if (w)
179
+ return w = !1, a = null, !1;
180
+ m = Math.min(m + c, 1);
181
+ const k = {
182
+ inv_mass: m,
183
  opts: C,
184
  settled: !0,
185
+ dt: (u - o) * 60 / 1e3
186
+ }, b = se(k, f, n, _);
187
+ return o = u, f = n, e.set(n = b), k.settled && (a = null), !k.settled;
188
+ })), new Promise((u) => {
189
  a.promise.then(() => {
190
+ F === r && u();
191
  });
192
  }));
193
  }
194
  const C = {
195
+ set: y,
196
+ update: (p, L) => y(p(_, n), L),
197
  subscribe: e.subscribe,
198
  stiffness: l,
199
  damping: i,
200
+ precision: s
201
  };
202
  return C;
203
  }
 
209
  detach: ht,
210
  element: wt,
211
  init: vt,
212
+ insert: yt,
213
  noop: Fe,
214
+ safe_not_equal: kt,
215
  set_style: $,
216
  svg_element: z,
217
  toggle_class: Le
218
+ } = window.__gradio__svelte__internal, { onMount: pt } = window.__gradio__svelte__internal;
219
  function qt(n) {
220
+ let t, e, l, i, s, o, a, r, f, _, m, c;
221
  return {
222
  c() {
223
+ t = wt("div"), e = z("svg"), l = z("g"), i = z("path"), s = z("path"), o = z("path"), a = z("path"), r = z("g"), f = z("path"), _ = z("path"), m = z("path"), c = z("path"), v(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), v(i, "fill", "#FF7C00"), v(i, "fill-opacity", "0.4"), v(i, "class", "svelte-43sxxs"), v(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), v(s, "fill", "#FF7C00"), v(s, "class", "svelte-43sxxs"), v(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), v(o, "fill", "#FF7C00"), v(o, "fill-opacity", "0.4"), v(o, "class", "svelte-43sxxs"), v(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), v(a, "fill", "#FF7C00"), v(a, "class", "svelte-43sxxs"), $(l, "transform", "translate(" + /*$top*/
224
  n[1][0] + "px, " + /*$top*/
225
+ n[1][1] + "px)"), v(f, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), v(f, "fill", "#FF7C00"), v(f, "fill-opacity", "0.4"), v(f, "class", "svelte-43sxxs"), v(_, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), v(_, "fill", "#FF7C00"), v(_, "class", "svelte-43sxxs"), v(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), v(m, "fill", "#FF7C00"), v(m, "fill-opacity", "0.4"), v(m, "class", "svelte-43sxxs"), v(c, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), v(c, "fill", "#FF7C00"), v(c, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
226
  n[2][0] + "px, " + /*$bottom*/
227
  n[2][1] + "px)"), v(e, "viewBox", "-1200 -1200 3000 3000"), v(e, "fill", "none"), v(e, "xmlns", "http://www.w3.org/2000/svg"), v(e, "class", "svelte-43sxxs"), v(t, "class", "svelte-43sxxs"), Le(
228
  t,
 
231
  n[0]
232
  );
233
  },
234
+ m(w, y) {
235
+ yt(w, t, y), N(t, e), N(e, l), N(l, i), N(l, s), N(l, o), N(l, a), N(e, r), N(r, f), N(r, _), N(r, m), N(r, c);
236
  },
237
+ p(w, [y]) {
238
+ y & /*$top*/
239
  2 && $(l, "transform", "translate(" + /*$top*/
240
+ w[1][0] + "px, " + /*$top*/
241
+ w[1][1] + "px)"), y & /*$bottom*/
242
  4 && $(r, "transform", "translate(" + /*$bottom*/
243
+ w[2][0] + "px, " + /*$bottom*/
244
+ w[2][1] + "px)"), y & /*margin*/
245
  1 && Le(
246
  t,
247
  "margin",
248
  /*margin*/
249
+ w[0]
250
  );
251
  },
252
  i: Fe,
253
  o: Fe,
254
+ d(w) {
255
+ w && ht(t);
256
  }
257
  };
258
  }
259
  function Ft(n, t, e) {
260
+ let l, i, { margin: s = !0 } = t;
261
+ const o = pe([0, 0]);
262
+ qe(n, o, (c) => e(1, l = c));
263
+ const a = pe([0, 0]);
264
+ qe(n, a, (c) => e(2, i = c));
265
  let r;
266
+ async function f() {
267
  await Promise.all([o.set([125, 140]), a.set([-125, -140])]), await Promise.all([o.set([-125, 140]), a.set([125, -140])]), await Promise.all([o.set([-125, 0]), a.set([125, -0])]), await Promise.all([o.set([125, 0]), a.set([-125, 0])]);
268
  }
269
  async function _() {
270
+ await f(), r || _();
271
  }
272
+ async function m() {
273
  await Promise.all([o.set([125, 0]), a.set([-125, 0])]), _();
274
  }
275
+ return pt(() => (m(), () => r = !0)), n.$$set = (c) => {
276
+ "margin" in c && e(0, s = c.margin);
277
+ }, [s, l, i, o, a];
278
  }
279
  class Lt extends gt {
280
  constructor(t) {
281
+ super(), vt(this, t, Ft, qt, kt, { margin: 0 });
282
  }
283
  }
284
  const {
 
291
  create_slot: Vt,
292
  destroy_component: St,
293
  destroy_each: Qe,
294
+ detach: g,
295
+ element: Z,
296
  empty: U,
297
  ensure_array_like: le,
298
  get_all_dirty_from_scope: Nt,
299
  get_slot_changes: zt,
300
  group_outros: We,
301
  init: Tt,
302
+ insert: h,
303
  mount_component: jt,
304
  noop: oe,
305
  safe_not_equal: Pt,
 
324
  let t, e = (
325
  /*i18n*/
326
  n[1]("common.error") + ""
327
+ ), l, i, s;
328
  const o = (
329
  /*#slots*/
330
  n[29].error
 
337
  );
338
  return {
339
  c() {
340
+ t = Z("span"), l = q(e), i = j(), a && a.c(), T(t, "class", "error svelte-1txqlrd");
341
  },
342
+ m(r, f) {
343
+ h(r, t, f), H(t, l), h(r, i, f), a && a.m(r, f), s = !0;
344
  },
345
+ p(r, f) {
346
+ (!s || f[0] & /*i18n*/
347
  2) && e !== (e = /*i18n*/
348
+ r[1]("common.error") + "") && S(l, e), a && a.p && (!s || f[0] & /*$$scope*/
349
  268435456) && Zt(
350
  a,
351
  o,
352
  r,
353
  /*$$scope*/
354
  r[28],
355
+ s ? zt(
356
  o,
357
  /*$$scope*/
358
  r[28],
359
+ f,
360
  Dt
361
  ) : Nt(
362
  /*$$scope*/
 
366
  );
367
  },
368
  i(r) {
369
+ s || (O(a, r), s = !0);
370
  },
371
  o(r) {
372
+ R(a, r), s = !1;
373
  },
374
  d(r) {
375
+ r && (g(t), g(i)), a && a.d(r);
376
  }
377
  };
378
  }
379
  function It(n) {
380
+ let t, e, l, i, s, o, a, r, f, _ = (
381
  /*variant*/
382
  n[8] === "default" && /*show_eta_bar*/
383
  n[18] && /*show_progress*/
384
  n[6] === "full" && Ne(n)
385
  );
386
+ function m(u, k) {
387
  if (
388
  /*progress*/
389
+ u[7]
390
  )
391
  return Yt;
392
  if (
393
  /*queue_position*/
394
+ u[2] !== null && /*queue_size*/
395
+ u[3] !== void 0 && /*queue_position*/
396
+ u[2] >= 0
397
  )
398
  return Xt;
399
  if (
400
  /*queue_position*/
401
+ u[2] === 0
402
  )
403
  return Ht;
404
  }
405
+ let c = m(n), w = c && c(n), y = (
406
  /*timer*/
407
  n[5] && je(n)
408
  );
409
+ const C = [Ut, Rt], p = [];
410
+ function L(u, k) {
411
  return (
412
  /*last_progress_level*/
413
+ u[15] != null ? 0 : (
414
  /*show_progress*/
415
+ u[6] === "full" ? 1 : -1
416
  )
417
  );
418
  }
419
+ ~(s = L(n)) && (o = p[s] = C[s](n));
420
  let F = !/*timer*/
421
  n[5] && Ie(n);
422
  return {
423
  c() {
424
+ _ && _.c(), t = j(), e = Z("div"), w && w.c(), l = j(), y && y.c(), i = j(), o && o.c(), a = j(), F && F.c(), r = U(), T(e, "class", "progress-text svelte-1txqlrd"), V(
425
  e,
426
  "meta-text-center",
427
  /*variant*/
 
433
  n[8] === "default"
434
  );
435
  },
436
+ m(u, k) {
437
+ _ && _.m(u, k), h(u, t, k), h(u, e, k), w && w.m(e, null), H(e, l), y && y.m(e, null), h(u, i, k), ~s && p[s].m(u, k), h(u, a, k), F && F.m(u, k), h(u, r, k), f = !0;
438
  },
439
+ p(u, k) {
440
  /*variant*/
441
+ u[8] === "default" && /*show_eta_bar*/
442
+ u[18] && /*show_progress*/
443
+ u[6] === "full" ? _ ? _.p(u, k) : (_ = Ne(u), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), c === (c = m(u)) && w ? w.p(u, k) : (w && w.d(1), w = c && c(u), w && (w.c(), w.m(e, l))), /*timer*/
444
+ u[5] ? y ? y.p(u, k) : (y = je(u), y.c(), y.m(e, null)) : y && (y.d(1), y = null), (!f || k[0] & /*variant*/
445
  256) && V(
446
  e,
447
  "meta-text-center",
448
  /*variant*/
449
+ u[8] === "center"
450
+ ), (!f || k[0] & /*variant*/
451
  256) && V(
452
  e,
453
  "meta-text",
454
  /*variant*/
455
+ u[8] === "default"
456
  );
457
+ let b = s;
458
+ s = L(u), s === b ? ~s && p[s].p(u, k) : (o && (We(), R(p[b], 1, 1, () => {
459
+ p[b] = null;
460
+ }), Ke()), ~s ? (o = p[s], o ? o.p(u, k) : (o = p[s] = C[s](u), o.c()), O(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
461
+ u[5] ? F && (F.d(1), F = null) : F ? F.p(u, k) : (F = Ie(u), F.c(), F.m(r.parentNode, r));
462
  },
463
+ i(u) {
464
+ f || (O(o), f = !0);
465
  },
466
+ o(u) {
467
+ R(o), f = !1;
468
  },
469
+ d(u) {
470
+ u && (g(t), g(e), g(i), g(a), g(r)), _ && _.d(u), w && w.d(), y && y.d(), ~s && p[s].d(u), F && F.d(u);
471
  }
472
  };
473
  }
 
476
  (n[17] || 0) * 100 - 100}%)`;
477
  return {
478
  c() {
479
+ t = Z("div"), T(t, "class", "eta-bar svelte-1txqlrd"), D(t, "transform", e);
480
  },
481
  m(l, i) {
482
+ h(l, t, i);
483
  },
484
  p(l, i) {
485
  i[0] & /*eta_level*/
 
487
  (l[17] || 0) * 100 - 100}%)`) && D(t, "transform", e);
488
  },
489
  d(l) {
490
+ l && g(t);
491
  }
492
  };
493
  }
 
498
  t = q("processing |");
499
  },
500
  m(e, l) {
501
+ h(e, t, l);
502
  },
503
  p: oe,
504
  d(e) {
505
+ e && g(t);
506
  }
507
  };
508
  }
 
510
  let t, e = (
511
  /*queue_position*/
512
  n[2] + 1 + ""
513
+ ), l, i, s, o;
514
  return {
515
  c() {
516
+ t = q("queue: "), l = q(e), i = q("/"), s = q(
517
  /*queue_size*/
518
  n[3]
519
  ), o = q(" |");
520
  },
521
  m(a, r) {
522
+ h(a, t, r), h(a, l, r), h(a, i, r), h(a, s, r), h(a, o, r);
523
  },
524
  p(a, r) {
525
  r[0] & /*queue_position*/
526
  4 && e !== (e = /*queue_position*/
527
  a[2] + 1 + "") && S(l, e), r[0] & /*queue_size*/
528
  8 && S(
529
+ s,
530
  /*queue_size*/
531
  a[3]
532
  );
533
  },
534
  d(a) {
535
+ a && (g(t), g(l), g(i), g(s), g(o));
536
  }
537
  };
538
  }
 
549
  l[i].c();
550
  t = U();
551
  },
552
+ m(i, s) {
553
  for (let o = 0; o < l.length; o += 1)
554
+ l[o] && l[o].m(i, s);
555
+ h(i, t, s);
556
  },
557
+ p(i, s) {
558
+ if (s[0] & /*progress*/
559
  128) {
560
  e = le(
561
  /*progress*/
 
564
  let o;
565
  for (o = 0; o < e.length; o += 1) {
566
  const a = Se(i, e, o);
567
+ l[o] ? l[o].p(a, s) : (l[o] = Te(a), l[o].c(), l[o].m(t.parentNode, t));
568
  }
569
  for (; o < l.length; o += 1)
570
  l[o].d(1);
 
572
  }
573
  },
574
  d(i) {
575
+ i && g(t), Qe(l, i);
576
  }
577
  };
578
  }
 
580
  let t, e = (
581
  /*p*/
582
  n[38].unit + ""
583
+ ), l, i, s = " ", o;
584
+ function a(_, m) {
585
  return (
586
  /*p*/
587
  _[38].length != null ? Ot : Gt
588
  );
589
  }
590
+ let r = a(n), f = r(n);
591
  return {
592
  c() {
593
+ f.c(), t = j(), l = q(e), i = q(" | "), o = q(s);
594
  },
595
+ m(_, m) {
596
+ f.m(_, m), h(_, t, m), h(_, l, m), h(_, i, m), h(_, o, m);
597
  },
598
+ p(_, m) {
599
+ r === (r = a(_)) && f ? f.p(_, m) : (f.d(1), f = r(_), f && (f.c(), f.m(t.parentNode, t))), m[0] & /*progress*/
600
  128 && e !== (e = /*p*/
601
  _[38].unit + "") && S(l, e);
602
  },
603
  d(_) {
604
+ _ && (g(t), g(l), g(i), g(o)), f.d(_);
605
  }
606
  };
607
  }
 
615
  e = q(t);
616
  },
617
  m(l, i) {
618
+ h(l, e, i);
619
  },
620
  p(l, i) {
621
  i[0] & /*progress*/
 
625
  ) + "") && S(e, t);
626
  },
627
  d(l) {
628
+ l && g(e);
629
  }
630
  };
631
  }
 
636
  ) + "", e, l, i = Y(
637
  /*p*/
638
  n[38].length
639
+ ) + "", s;
640
  return {
641
  c() {
642
+ e = q(t), l = q("/"), s = q(i);
643
  },
644
  m(o, a) {
645
+ h(o, e, a), h(o, l, a), h(o, s, a);
646
  },
647
  p(o, a) {
648
  a[0] & /*progress*/
 
653
  128 && i !== (i = Y(
654
  /*p*/
655
  o[38].length
656
+ ) + "") && S(s, i);
657
  },
658
  d(o) {
659
+ o && (g(e), g(l), g(s));
660
  }
661
  };
662
  }
 
670
  e && e.c(), t = U();
671
  },
672
  m(l, i) {
673
+ e && e.m(l, i), h(l, t, i);
674
  },
675
  p(l, i) {
676
  /*p*/
677
  l[38].index != null ? e ? e.p(l, i) : (e = ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
678
  },
679
  d(l) {
680
+ l && g(t), e && e.d(l);
681
  }
682
  };
683
  }
 
694
  n[20]
695
  ), l = q(e), i = q("s");
696
  },
697
+ m(s, o) {
698
+ h(s, t, o), h(s, l, o), h(s, i, o);
699
  },
700
+ p(s, o) {
701
  o[0] & /*formatted_timer*/
702
  1048576 && S(
703
  t,
704
  /*formatted_timer*/
705
+ s[20]
706
  ), o[0] & /*eta, formatted_eta*/
707
  524289 && e !== (e = /*eta*/
708
+ s[0] ? `/${/*formatted_eta*/
709
+ s[19]}` : "") && S(l, e);
710
  },
711
+ d(s) {
712
+ s && (g(t), g(l), g(i));
713
  }
714
  };
715
  }
 
728
  jt(t, l, i), e = !0;
729
  },
730
  p(l, i) {
731
+ const s = {};
732
  i[0] & /*variant*/
733
+ 256 && (s.margin = /*variant*/
734
+ l[8] === "default"), t.$set(s);
735
  },
736
  i(l) {
737
  e || (O(t.$$.fragment, l), e = !0);
 
745
  };
746
  }
747
  function Ut(n) {
748
+ let t, e, l, i, s, o = `${/*last_progress_level*/
749
  n[15] * 100}%`, a = (
750
  /*progress*/
751
  n[7] != null && Pe(n)
752
  );
753
  return {
754
  c() {
755
+ t = Z("div"), e = Z("div"), a && a.c(), l = j(), i = Z("div"), s = Z("div"), T(e, "class", "progress-level-inner svelte-1txqlrd"), T(s, "class", "progress-bar svelte-1txqlrd"), D(s, "width", o), T(i, "class", "progress-bar-wrap svelte-1txqlrd"), T(t, "class", "progress-level svelte-1txqlrd");
756
  },
757
+ m(r, f) {
758
+ h(r, t, f), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, s), n[30](s);
759
  },
760
+ p(r, f) {
761
  /*progress*/
762
+ r[7] != null ? a ? a.p(r, f) : (a = Pe(r), a.c(), a.m(e, null)) : a && (a.d(1), a = null), f[0] & /*last_progress_level*/
763
  32768 && o !== (o = `${/*last_progress_level*/
764
+ r[15] * 100}%`) && D(s, "width", o);
765
  },
766
  i: oe,
767
  o: oe,
768
  d(r) {
769
+ r && g(t), a && a.d(), n[30](null);
770
  }
771
  };
772
  }
 
783
  l[i].c();
784
  t = U();
785
  },
786
+ m(i, s) {
787
  for (let o = 0; o < l.length; o += 1)
788
+ l[o] && l[o].m(i, s);
789
+ h(i, t, s);
790
  },
791
+ p(i, s) {
792
+ if (s[0] & /*progress_level, progress*/
793
  16512) {
794
  e = le(
795
  /*progress*/
 
798
  let o;
799
  for (o = 0; o < e.length; o += 1) {
800
  const a = Ve(i, e, o);
801
+ l[o] ? l[o].p(a, s) : (l[o] = Ee(a), l[o].c(), l[o].m(t.parentNode, t));
802
  }
803
  for (; o < l.length; o += 1)
804
  l[o].d(1);
 
806
  }
807
  },
808
  d(i) {
809
+ i && g(t), Qe(l, i);
810
  }
811
  };
812
  }
813
  function Ze(n) {
814
+ let t, e, l, i, s = (
815
  /*i*/
816
  n[40] !== 0 && Jt()
817
  ), o = (
 
831
  );
832
  return {
833
  c() {
834
+ s && s.c(), t = j(), o && o.c(), e = j(), a && a.c(), l = j(), r && r.c(), i = U();
835
  },
836
+ m(f, _) {
837
+ s && s.m(f, _), h(f, t, _), o && o.m(f, _), h(f, e, _), a && a.m(f, _), h(f, l, _), r && r.m(f, _), h(f, i, _);
838
  },
839
+ p(f, _) {
840
  /*p*/
841
+ f[38].desc != null ? o ? o.p(f, _) : (o = Be(f), o.c(), o.m(e.parentNode, e)) : o && (o.d(1), o = null), /*p*/
842
+ f[38].desc != null && /*progress_level*/
843
+ f[14] && /*progress_level*/
844
+ f[14][
845
  /*i*/
846
+ f[40]
847
  ] != null ? a || (a = Ae(), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null), /*progress_level*/
848
+ f[14] != null ? r ? r.p(f, _) : (r = De(f), r.c(), r.m(i.parentNode, i)) : r && (r.d(1), r = null);
849
  },
850
+ d(f) {
851
+ f && (g(t), g(e), g(l), g(i)), s && s.d(f), o && o.d(f), a && a.d(f), r && r.d(f);
852
  }
853
  };
854
  }
 
859
  t = q(" /");
860
  },
861
  m(e, l) {
862
+ h(e, t, l);
863
  },
864
  d(e) {
865
+ e && g(t);
866
  }
867
  };
868
  }
 
876
  e = q(t);
877
  },
878
  m(l, i) {
879
+ h(l, e, i);
880
  },
881
  p(l, i) {
882
  i[0] & /*progress*/
 
884
  l[38].desc + "") && S(e, t);
885
  },
886
  d(l) {
887
+ l && g(e);
888
  }
889
  };
890
  }
 
895
  t = q("-");
896
  },
897
  m(e, l) {
898
+ h(e, t, l);
899
  },
900
  d(e) {
901
+ e && g(t);
902
  }
903
  };
904
  }
 
912
  c() {
913
  e = q(t), l = q("%");
914
  },
915
+ m(i, s) {
916
+ h(i, e, s), h(i, l, s);
917
  },
918
+ p(i, s) {
919
+ s[0] & /*progress_level*/
920
  16384 && t !== (t = (100 * /*progress_level*/
921
  (i[14][
922
  /*i*/
 
924
  ] || 0)).toFixed(1) + "") && S(e, t);
925
  },
926
  d(i) {
927
+ i && (g(e), g(l));
928
  }
929
  };
930
  }
 
943
  e && e.c(), t = U();
944
  },
945
  m(l, i) {
946
+ e && e.m(l, i), h(l, t, i);
947
  },
948
  p(l, i) {
949
  /*p*/
 
955
  ] != null ? e ? e.p(l, i) : (e = Ze(l), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
956
  },
957
  d(l) {
958
+ l && g(t), e && e.d(l);
959
  }
960
  };
961
  }
 
963
  let t, e;
964
  return {
965
  c() {
966
+ t = Z("p"), e = q(
967
  /*loading_text*/
968
  n[9]
969
  ), T(t, "class", "loading svelte-1txqlrd");
970
  },
971
  m(l, i) {
972
+ h(l, t, i), H(t, e);
973
  },
974
  p(l, i) {
975
  i[0] & /*loading_text*/
 
980
  );
981
  },
982
  d(l) {
983
+ l && g(t);
984
  }
985
  };
986
  }
987
  function Kt(n) {
988
+ let t, e, l, i, s;
989
  const o = [It, Et], a = [];
990
+ function r(f, _) {
991
  return (
992
  /*status*/
993
+ f[4] === "pending" ? 0 : (
994
  /*status*/
995
+ f[4] === "error" ? 1 : -1
996
  )
997
  );
998
  }
999
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
1000
  c() {
1001
+ t = Z("div"), l && l.c(), T(t, "class", i = "wrap " + /*variant*/
1002
  n[8] + " " + /*show_progress*/
1003
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
1004
  n[4] || /*status*/
 
1034
  n[10] ? "0" : "var(--size-8) 0"
1035
  );
1036
  },
1037
+ m(f, _) {
1038
+ h(f, t, _), ~e && a[e].m(t, null), n[31](t), s = !0;
1039
  },
1040
+ p(f, _) {
1041
+ let m = e;
1042
+ e = r(f), e === m ? ~e && a[e].p(f, _) : (l && (We(), R(a[m], 1, 1, () => {
1043
+ a[m] = null;
1044
+ }), Ke()), ~e ? (l = a[e], l ? l.p(f, _) : (l = a[e] = o[e](f), l.c()), O(l, 1), l.m(t, null)) : l = null), (!s || _[0] & /*variant, show_progress*/
1045
  320 && i !== (i = "wrap " + /*variant*/
1046
+ f[8] + " " + /*show_progress*/
1047
+ f[6] + " svelte-1txqlrd")) && T(t, "class", i), (!s || _[0] & /*variant, show_progress, status, show_progress*/
1048
  336) && V(t, "hide", !/*status*/
1049
+ f[4] || /*status*/
1050
+ f[4] === "complete" || /*show_progress*/
1051
+ f[6] === "hidden"), (!s || _[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
1052
  2384) && V(
1053
  t,
1054
  "translucent",
1055
  /*variant*/
1056
+ f[8] === "center" && /*status*/
1057
+ (f[4] === "pending" || /*status*/
1058
+ f[4] === "error") || /*translucent*/
1059
+ f[11] || /*show_progress*/
1060
+ f[6] === "minimal"
1061
+ ), (!s || _[0] & /*variant, show_progress, status*/
1062
  336) && V(
1063
  t,
1064
  "generating",
1065
  /*status*/
1066
+ f[4] === "generating"
1067
+ ), (!s || _[0] & /*variant, show_progress, border*/
1068
  4416) && V(
1069
  t,
1070
  "border",
1071
  /*border*/
1072
+ f[12]
1073
  ), _[0] & /*absolute*/
1074
  1024 && D(
1075
  t,
1076
  "position",
1077
  /*absolute*/
1078
+ f[10] ? "absolute" : "static"
1079
  ), _[0] & /*absolute*/
1080
  1024 && D(
1081
  t,
1082
  "padding",
1083
  /*absolute*/
1084
+ f[10] ? "0" : "var(--size-8) 0"
1085
  );
1086
  },
1087
+ i(f) {
1088
+ s || (O(l), s = !0);
1089
  },
1090
+ o(f) {
1091
+ R(l), s = !1;
1092
  },
1093
+ d(f) {
1094
+ f && g(t), ~e && a[e].d(), n[31](null);
1095
  }
1096
  };
1097
  }
1098
+ let ee = [], fe = !1;
1099
  async function Qt(n, t = !0) {
1100
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
1101
+ if (ee.push(n), !fe)
1102
+ fe = !0;
1103
  else
1104
  return;
1105
  await Bt(), requestAnimationFrame(() => {
1106
  let e = [0, 0];
1107
  for (let l = 0; l < ee.length; l++) {
1108
+ const s = ee[l].getBoundingClientRect();
1109
+ (l === 0 || s.top + window.scrollY <= e[0]) && (e[0] = s.top + window.scrollY, e[1] = l);
1110
  }
1111
+ window.scrollTo({ top: e[0] - 20, behavior: "smooth" }), fe = !1, ee = [];
1112
  });
1113
  }
1114
  }
1115
  function Wt(n, t, e) {
1116
+ let l, { $$slots: i = {}, $$scope: s } = t, { i18n: o } = t, { eta: a = null } = t, { queue: r = !1 } = t, { queue_position: f } = t, { queue_size: _ } = t, { status: m } = t, { scroll_to_output: c = !1 } = t, { timer: w = !0 } = t, { show_progress: y = "full" } = t, { message: C = null } = t, { progress: p = null } = t, { variant: L = "default" } = t, { loading_text: F = "Loading..." } = t, { absolute: u = !0 } = t, { translucent: k = !1 } = t, { border: b = !1 } = t, { autoscroll: ne } = t, J, K = !1, W = 0, E = 0, ie = null, de = 0, I = null, Q, B = null, me = !0;
1117
  const et = () => {
1118
  e(25, W = performance.now()), e(26, E = 0), K = !0, be();
1119
  };
 
1131
  let he = null;
1132
  function tt(d) {
1133
  Ce[d ? "unshift" : "push"](() => {
1134
+ B = d, e(16, B), e(7, p), e(14, I), e(15, Q);
1135
  });
1136
  }
1137
  function lt(d) {
 
1140
  });
1141
  }
1142
  return n.$$set = (d) => {
1143
+ "i18n" in d && e(1, o = d.i18n), "eta" in d && e(0, a = d.eta), "queue" in d && e(21, r = d.queue), "queue_position" in d && e(2, f = d.queue_position), "queue_size" in d && e(3, _ = d.queue_size), "status" in d && e(4, m = d.status), "scroll_to_output" in d && e(22, c = d.scroll_to_output), "timer" in d && e(5, w = d.timer), "show_progress" in d && e(6, y = d.show_progress), "message" in d && e(23, C = d.message), "progress" in d && e(7, p = d.progress), "variant" in d && e(8, L = d.variant), "loading_text" in d && e(9, F = d.loading_text), "absolute" in d && e(10, u = d.absolute), "translucent" in d && e(11, k = d.translucent), "border" in d && e(12, b = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, s = d.$$scope);
1144
  }, n.$$.update = () => {
1145
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1146
  169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - W) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
1147
  67108865 && e(17, de = a === null || a <= 0 || !E ? null : Math.min(E / a, 1)), n.$$.dirty[0] & /*progress*/
1148
+ 128 && p != null && e(18, me = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1149
+ 114816 && (p != null ? e(14, I = p.map((d) => {
1150
  if (d.index != null && d.length != null)
1151
  return d.index / d.length;
1152
  if (d.progress != null)
1153
  return d.progress;
1154
+ })) : e(14, I = null), I ? (e(15, Q = I[I.length - 1]), B && (Q === 0 ? e(16, B.style.transition = "0", B) : e(16, B.style.transition = "150ms", B))) : e(15, Q = void 0)), n.$$.dirty[0] & /*status*/
1155
+ 16 && (m === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1156
+ 20979728 && J && c && (m === "pending" || m === "complete") && Qt(J, ne), n.$$.dirty[0] & /*status, message*/
1157
  8388624, n.$$.dirty[0] & /*timer_diff*/
1158
  67108864 && e(20, l = E.toFixed(1));
1159
  }, [
1160
  a,
1161
  o,
1162
+ f,
1163
  _,
1164
+ m,
1165
+ w,
1166
+ y,
1167
  p,
 
1168
  L,
1169
  F,
1170
+ u,
1171
+ k,
1172
+ b,
1173
  J,
1174
  I,
1175
  Q,
1176
+ B,
1177
  de,
1178
  me,
1179
  he,
1180
  l,
1181
  r,
1182
+ c,
1183
  C,
1184
  ne,
1185
  W,
1186
  E,
1187
  ie,
1188
+ s,
1189
  i,
1190
  tt,
1191
  lt
 
1230
  detach: ll,
1231
  element: nl,
1232
  get_all_dirty_from_scope: il,
1233
+ get_slot_changes: fl,
1234
+ get_spread_update: sl,
1235
  init: ol,
1236
  insert: al,
1237
  safe_not_equal: rl,
 
1242
  transition_out: $e,
1243
  update_slot_base: _l
1244
  } = window.__gradio__svelte__internal;
1245
+ function ul(n) {
1246
  let t, e, l;
1247
  const i = (
1248
  /*#slots*/
1249
  n[17].default
1250
+ ), s = tl(
1251
  i,
1252
  n,
1253
  /*$$scope*/
 
1275
  t = nl(
1276
  /*tag*/
1277
  n[14]
1278
+ ), s && s.c(), He(
1279
  /*tag*/
1280
  n[14]
1281
  )(t, a), A(
 
1319
  ), M(t, "min-width", `calc(min(${/*min_width*/
1320
  n[13]}px, 100%))`), M(t, "border-width", "var(--block-border-width)");
1321
  },
1322
+ m(r, f) {
1323
+ al(r, t, f), s && s.m(t, null), l = !0;
1324
  },
1325
+ p(r, f) {
1326
+ s && s.p && (!l || f & /*$$scope*/
1327
  65536) && _l(
1328
+ s,
1329
  i,
1330
  r,
1331
  /*$$scope*/
1332
  r[16],
1333
+ l ? fl(
1334
  i,
1335
  /*$$scope*/
1336
  r[16],
1337
+ f,
1338
  null
1339
  ) : il(
1340
  /*$$scope*/
 
1344
  ), He(
1345
  /*tag*/
1346
  r[14]
1347
+ )(t, a = sl(o, [
1348
+ (!l || f & /*test_id*/
1349
  128) && { "data-testid": (
1350
  /*test_id*/
1351
  r[7]
1352
  ) },
1353
+ (!l || f & /*elem_id*/
1354
  4) && { id: (
1355
  /*elem_id*/
1356
  r[2]
1357
  ) },
1358
+ (!l || f & /*elem_classes*/
1359
  8 && e !== (e = "block " + /*elem_classes*/
1360
  r[3].join(" ") + " svelte-1t38q2d")) && { class: e }
1361
  ])), A(
 
1375
  r[5] === "focus"
1376
  ), A(t, "hide-container", !/*explicit_call*/
1377
  r[8] && !/*container*/
1378
+ r[9]), f & /*height*/
1379
  1 && M(t, "height", typeof /*height*/
1380
  r[0] == "number" ? (
1381
  /*height*/
1382
  r[0] + "px"
1383
+ ) : void 0), f & /*width*/
1384
  2 && M(t, "width", typeof /*width*/
1385
  r[1] == "number" ? `calc(min(${/*width*/
1386
+ r[1]}px, 100%))` : void 0), f & /*variant*/
1387
  16 && M(
1388
  t,
1389
  "border-style",
1390
  /*variant*/
1391
  r[4]
1392
+ ), f & /*allow_overflow*/
1393
  2048 && M(
1394
  t,
1395
  "overflow",
1396
  /*allow_overflow*/
1397
  r[11] ? "visible" : "hidden"
1398
+ ), f & /*scale*/
1399
  4096 && M(
1400
  t,
1401
  "flex-grow",
1402
  /*scale*/
1403
  r[12]
1404
+ ), f & /*min_width*/
1405
  8192 && M(t, "min-width", `calc(min(${/*min_width*/
1406
  r[13]}px, 100%))`);
1407
  },
1408
  i(r) {
1409
+ l || (xe(s, r), l = !0);
1410
  },
1411
  o(r) {
1412
+ $e(s, r), l = !1;
1413
  },
1414
  d(r) {
1415
+ r && ll(t), s && s.d(r);
1416
  }
1417
  };
1418
  }
1419
+ function cl(n) {
1420
  let t, e = (
1421
  /*tag*/
1422
+ n[14] && ul(n)
1423
  );
1424
  return {
1425
  c() {
 
1444
  };
1445
  }
1446
  function dl(n, t, e) {
1447
+ let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: r = [] } = t, { variant: f = "solid" } = t, { border_mode: _ = "base" } = t, { padding: m = !0 } = t, { type: c = "normal" } = t, { test_id: w = void 0 } = t, { explicit_call: y = !1 } = t, { container: C = !0 } = t, { visible: p = !0 } = t, { allow_overflow: L = !0 } = t, { scale: F = null } = t, { min_width: u = 0 } = t, k = c === "fieldset" ? "fieldset" : "div";
1448
+ return n.$$set = (b) => {
1449
+ "height" in b && e(0, s = b.height), "width" in b && e(1, o = b.width), "elem_id" in b && e(2, a = b.elem_id), "elem_classes" in b && e(3, r = b.elem_classes), "variant" in b && e(4, f = b.variant), "border_mode" in b && e(5, _ = b.border_mode), "padding" in b && e(6, m = b.padding), "type" in b && e(15, c = b.type), "test_id" in b && e(7, w = b.test_id), "explicit_call" in b && e(8, y = b.explicit_call), "container" in b && e(9, C = b.container), "visible" in b && e(10, p = b.visible), "allow_overflow" in b && e(11, L = b.allow_overflow), "scale" in b && e(12, F = b.scale), "min_width" in b && e(13, u = b.min_width), "$$scope" in b && e(16, i = b.$$scope);
1450
  }, [
1451
+ s,
1452
  o,
1453
  a,
1454
  r,
1455
+ f,
1456
  _,
1457
+ m,
1458
+ w,
1459
+ y,
1460
  C,
1461
+ p,
1462
  L,
1463
  F,
1464
+ u,
1465
+ k,
1466
  c,
 
 
1467
  i,
1468
  l
1469
  ];
1470
  }
1471
  class ml extends $t {
1472
  constructor(t) {
1473
+ super(), ol(this, t, dl, cl, rl, {
1474
  height: 0,
1475
  width: 1,
1476
  elem_id: 2,
 
1811
  destroy_component: re,
1812
  detach: Ye,
1813
  element: vl,
1814
+ get_spread_object: yl,
1815
+ get_spread_update: kl,
1816
+ init: pl,
1817
  insert: Ge,
1818
  mount_component: _e,
1819
  safe_not_equal: ql,
1820
  space: Fl,
1821
  toggle_class: Oe,
1822
+ transition_in: ue,
1823
+ transition_out: ce
1824
  } = window.__gradio__svelte__internal;
1825
  function Ll(n) {
1826
  var r;
1827
+ let t, e, l, i, s;
1828
  const o = [
1829
  { autoscroll: (
1830
  /*gradio*/
1831
+ n[6].autoscroll
1832
  ) },
1833
  { i18n: (
1834
  /*gradio*/
1835
+ n[6].i18n
1836
  ) },
1837
  /*loading_status*/
1838
+ n[5],
1839
  { variant: "center" }
1840
  ];
1841
  let a = {};
1842
+ for (let f = 0; f < o.length; f += 1)
1843
+ a = hl(a, o[f]);
1844
+ return t = new xt({ props: a }), i = new ct({
1845
  props: {
1846
  min_height: (
1847
  /*loading_status*/
1848
+ n[5] && /*loading_status*/
1849
+ ((r = n[5]) == null ? void 0 : r.status) !== "complete"
1850
  ),
1851
  value: (
1852
  /*value*/
 
1859
  visible: (
1860
  /*visible*/
1861
  n[2]
1862
+ ),
1863
+ height: (
1864
+ /*height*/
1865
+ n[4]
1866
  )
1867
  }
1868
  }), i.$on(
1869
  "change",
1870
  /*change_handler*/
1871
+ n[8]
1872
  ), {
1873
  c() {
1874
+ var f;
1875
  ae(t.$$.fragment), e = Fl(), l = vl("div"), ae(i.$$.fragment), wl(l, "class", "svelte-gqsrr7"), Oe(
1876
  l,
1877
  "pending",
1878
  /*loading_status*/
1879
+ ((f = n[5]) == null ? void 0 : f.status) === "pending"
1880
  );
1881
  },
1882
+ m(f, _) {
1883
+ _e(t, f, _), Ge(f, e, _), Ge(f, l, _), _e(i, l, null), s = !0;
1884
  },
1885
+ p(f, _) {
1886
+ var w, y;
1887
+ const m = _ & /*gradio, loading_status*/
1888
+ 96 ? kl(o, [
1889
  _ & /*gradio*/
1890
+ 64 && { autoscroll: (
1891
  /*gradio*/
1892
+ f[6].autoscroll
1893
  ) },
1894
  _ & /*gradio*/
1895
+ 64 && { i18n: (
1896
  /*gradio*/
1897
+ f[6].i18n
1898
  ) },
1899
  _ & /*loading_status*/
1900
+ 32 && yl(
1901
  /*loading_status*/
1902
+ f[5]
1903
  ),
1904
  o[3]
1905
  ]) : {};
1906
+ t.$set(m);
1907
+ const c = {};
1908
  _ & /*loading_status*/
1909
+ 32 && (c.min_height = /*loading_status*/
1910
+ f[5] && /*loading_status*/
1911
+ ((w = f[5]) == null ? void 0 : w.status) !== "complete"), _ & /*value*/
1912
+ 8 && (c.value = /*value*/
1913
+ f[3]), _ & /*elem_classes*/
1914
+ 2 && (c.elem_classes = /*elem_classes*/
1915
+ f[1]), _ & /*visible*/
1916
+ 4 && (c.visible = /*visible*/
1917
+ f[2]), _ & /*height*/
1918
+ 16 && (c.height = /*height*/
1919
+ f[4]), i.$set(c), (!s || _ & /*loading_status*/
1920
+ 32) && Oe(
1921
  l,
1922
  "pending",
1923
  /*loading_status*/
1924
+ ((y = f[5]) == null ? void 0 : y.status) === "pending"
1925
  );
1926
  },
1927
+ i(f) {
1928
+ s || (ue(t.$$.fragment, f), ue(i.$$.fragment, f), s = !0);
1929
  },
1930
+ o(f) {
1931
+ ce(t.$$.fragment, f), ce(i.$$.fragment, f), s = !1;
1932
  },
1933
+ d(f) {
1934
+ f && (Ye(e), Ye(l)), re(t, f), re(i);
1935
  }
1936
  };
1937
  }
 
1963
  _e(t, l, i), e = !0;
1964
  },
1965
  p(l, [i]) {
1966
+ const s = {};
1967
  i & /*visible*/
1968
+ 4 && (s.visible = /*visible*/
1969
  l[2]), i & /*elem_id*/
1970
+ 1 && (s.elem_id = /*elem_id*/
1971
  l[0]), i & /*elem_classes*/
1972
+ 2 && (s.elem_classes = /*elem_classes*/
1973
+ l[1]), i & /*$$scope, loading_status, value, elem_classes, visible, height, gradio*/
1974
+ 638 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
1975
  },
1976
  i(l) {
1977
+ e || (ue(t.$$.fragment, l), e = !0);
1978
  },
1979
  o(l) {
1980
+ ce(t.$$.fragment, l), e = !1;
1981
  },
1982
  d(l) {
1983
  re(t, l);
 
1985
  };
1986
  }
1987
  function Ml(n, t, e) {
1988
+ let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: s = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { height: r = "100%" } = t, { loading_status: f } = t, { gradio: _ } = t;
1989
+ const m = () => _.dispatch("change");
1990
+ return n.$$set = (c) => {
1991
+ "label" in c && e(7, l = c.label), "elem_id" in c && e(0, i = c.elem_id), "elem_classes" in c && e(1, s = c.elem_classes), "visible" in c && e(2, o = c.visible), "value" in c && e(3, a = c.value), "height" in c && e(4, r = c.height), "loading_status" in c && e(5, f = c.loading_status), "gradio" in c && e(6, _ = c.gradio);
1992
  }, n.$$.update = () => {
1993
  n.$$.dirty & /*label, gradio*/
1994
+ 192 && _.dispatch("change");
1995
  }, [
1996
  i,
1997
+ s,
1998
  o,
1999
  a,
2000
  r,
2001
+ f,
2002
+ _,
2003
  l,
2004
+ m
2005
  ];
2006
  }
2007
  class Vl extends gl {
2008
  constructor(t) {
2009
+ super(), pl(this, t, Ml, Cl, ql, {
2010
+ label: 7,
2011
  elem_id: 0,
2012
  elem_classes: 1,
2013
  visible: 2,
2014
  value: 3,
2015
+ height: 4,
2016
+ loading_status: 5,
2017
+ gradio: 6
2018
  });
2019
  }
2020
  }
src/frontend/Index.svelte CHANGED
@@ -10,6 +10,7 @@
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
 
13
  export let loading_status: LoadingStatus;
14
  export let gradio: Gradio<{
15
  change: never;
@@ -31,6 +32,7 @@
31
  {value}
32
  {elem_classes}
33
  {visible}
 
34
  on:change={() => gradio.dispatch("change")}
35
  />
36
  </div>
 
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
13
+ export let height: string = "100%";
14
  export let loading_status: LoadingStatus;
15
  export let gradio: Gradio<{
16
  change: never;
 
32
  {value}
33
  {elem_classes}
34
  {visible}
35
+ {height}
36
  on:change={() => gradio.dispatch("change")}
37
  />
38
  </div>
src/frontend/package.json CHANGED
@@ -17,4 +17,4 @@
17
  "./example": "./Example.svelte",
18
  "./package.json": "./package.json"
19
  }
20
- }
 
17
  "./example": "./Example.svelte",
18
  "./package.json": "./package.json"
19
  }
20
+ }
src/frontend/shared/HTML.svelte CHANGED
@@ -5,6 +5,8 @@
5
  export let visible = true;
6
  export let min_height = false;
7
 
 
 
8
  const dispatch = createEventDispatcher<{ change: undefined }>();
9
 
10
  $: value, dispatch("change");
@@ -15,7 +17,7 @@
15
  class:min={min_height}
16
  class:hide={!visible}
17
  >
18
- <iframe title="iframe component" width="100%" height="100%" srcdoc={value} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
19
  </div>
20
 
21
  <style>
 
5
  export let visible = true;
6
  export let min_height = false;
7
 
8
+ export let height = "100%";
9
+
10
  const dispatch = createEventDispatcher<{ change: undefined }>();
11
 
12
  $: value, dispatch("change");
 
17
  class:min={min_height}
18
  class:hide={!visible}
19
  >
20
+ <iframe title="iframe component" width="100%" height={height} srcdoc={value} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
21
  </div>
22
 
23
  <style>
src/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_iframe"
11
- version = "0.0.3"
12
  description = "Experimental empowered iFrame component based on existing HTML gradio component."
13
  readme = "README.md"
14
  license = "MIT"
@@ -36,7 +36,7 @@ classifiers = [
36
  dev = ["build", "twine"]
37
 
38
  [tool.hatch.build]
39
- artifacts = ["/backend/gradio_iframe/templates", "*.pyi", "backend/gradio_iframe/templates", "home/lennard/.virtualenvs/thesis/lib/python3.11/site-packages/gradio_iframe/templates", "backend/gradio_iframe/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_iframe"]
 
8
 
9
  [project]
10
  name = "gradio_iframe"
11
+ version = "0.0.4"
12
  description = "Experimental empowered iFrame component based on existing HTML gradio component."
13
  readme = "README.md"
14
  license = "MIT"
 
36
  dev = ["build", "twine"]
37
 
38
  [tool.hatch.build]
39
+ artifacts = ["/backend/gradio_iframe/templates", "*.pyi", "backend/gradio_iframe/templates", "home/lennard/.virtualenvs/thesis/lib/python3.11/site-packages/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_iframe"]