LennardZuendorf commited on
Commit
ee6aff9
1 Parent(s): 9e3b05b

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -2,7 +2,7 @@
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
  title: gradio_iframe V0.0.9
5
- colorFrom: red
6
  colorTo: indigo
7
  sdk: docker
8
  pinned: false
 
2
  ---
3
  tags: [gradio-custom-component,gradio-template-HTML,HTML,iFrame]
4
  title: gradio_iframe V0.0.9
5
+ colorFrom: purple
6
  colorTo: indigo
7
  sdk: docker
8
  pinned: false
app.py CHANGED
@@ -6,9 +6,11 @@ from gradio_iframe import iFrame
6
  example = iFrame().example_inputs()
7
 
8
  with gr.Blocks() as demo:
 
 
9
  with gr.Row():
10
  iFrame(label="Blank"), # blank component
11
- iFrame(value=example, label="Populated", height="1000px"), # populated component
12
 
13
 
14
  demo.launch()
 
6
  example = iFrame().example_inputs()
7
 
8
  with gr.Blocks() as demo:
9
+ with gr.Row():
10
+ gr.Markdown("## Blank iFrame and iFrame with another iFrame inside")
11
  with gr.Row():
12
  iFrame(label="Blank"), # blank component
13
+ iFrame(value=example, label="Populated"), # populated component
14
 
15
 
16
  demo.launch()
src/backend/gradio_iframe/templates/component/index.js CHANGED
@@ -1,7 +1,7 @@
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
- attr: D,
5
  binding_callbacks: ft,
6
  detach: st,
7
  element: we,
@@ -11,22 +11,27 @@ const {
11
  noop: ve,
12
  safe_not_equal: _t,
13
  toggle_class: X
14
- } = window.__gradio__svelte__internal, { createEventDispatcher: ct } = window.__gradio__svelte__internal;
15
- function ut(n) {
16
  let t, e, l, i, s;
17
  return {
18
  c() {
19
- t = we("div"), e = we("iframe"), D(e, "title", "iframe component"), D(
20
  e,
21
  "width",
22
  /*width*/
23
  n[5]
24
- ), D(
25
  e,
26
  "srcdoc",
27
  /*value*/
28
  n[1]
29
- ), D(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, D(t, "class", l = "prose " + /*elem_classes*/
 
 
 
 
 
30
  n[0].join(" ") + " svelte-2qygph"), X(
31
  t,
32
  "min",
@@ -50,20 +55,26 @@ function ut(n) {
50
  },
51
  p(o, [a]) {
52
  a & /*width*/
53
- 32 && D(
54
  e,
55
  "width",
56
  /*width*/
57
  o[5]
58
  ), a & /*value*/
59
- 2 && D(
60
  e,
61
  "srcdoc",
62
  /*value*/
63
  o[1]
 
 
 
 
 
 
64
  ), a & /*elem_classes*/
65
  1 && l !== (l = "prose " + /*elem_classes*/
66
- o[0].join(" ") + " svelte-2qygph") && D(t, "class", l), a & /*elem_classes, min_height*/
67
  9 && X(
68
  t,
69
  "min",
@@ -88,23 +99,23 @@ function ut(n) {
88
  }
89
  function dt(n, t, e) {
90
  let { elem_classes: l = [] } = t, { value: i } = t, { visible: s = !0 } = t, { min_height: o = !1 } = t, { height: a = "100%" } = t, { width: r = "100%" } = t;
91
- const f = ct();
92
  let _;
93
  const m = () => {
94
  try {
95
- const c = _.contentDocument || _.contentWindow.document;
96
- a === "100%" ? e(6, _.style.height = `${c.documentElement.scrollHeight}px`, _) : e(6, _.style.height = a, _);
97
- } catch (c) {
98
- console.error("Error accessing iframe content:", c);
99
  }
100
  };
101
- function b(c) {
102
- ft[c ? "unshift" : "push"](() => {
103
- _ = c, e(6, _);
104
  });
105
  }
106
- return n.$$set = (c) => {
107
- "elem_classes" in c && e(0, l = c.elem_classes), "value" in c && e(1, i = c.value), "visible" in c && e(2, s = c.visible), "min_height" in c && e(3, o = c.min_height), "height" in c && e(4, a = c.height), "width" in c && e(5, r = c.width);
108
  }, n.$$.update = () => {
109
  n.$$.dirty & /*value*/
110
  2 && f("change");
@@ -122,7 +133,7 @@ function dt(n, t, e) {
122
  }
123
  class mt extends nt {
124
  constructor(t) {
125
- super(), ot(this, t, dt, ut, _t, {
126
  elem_classes: 0,
127
  value: 1,
128
  visible: 2,
@@ -145,7 +156,7 @@ function bt(n, t) {
145
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
146
  }
147
  const Re = typeof window < "u";
148
- let ye = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
149
  const O = /* @__PURE__ */ new Set();
150
  function We(n) {
151
  O.forEach((t) => {
@@ -190,13 +201,13 @@ function ht(n, t = te) {
190
  }
191
  return { set: i, update: s, subscribe: o };
192
  }
193
- function ke(n) {
194
  return Object.prototype.toString.call(n) === "[object Date]";
195
  }
196
  function se(n, t, e, l) {
197
- if (typeof e == "number" || ke(e)) {
198
  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;
199
- 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);
200
  } else {
201
  if (Array.isArray(e))
202
  return e.map(
@@ -213,30 +224,30 @@ function se(n, t, e, l) {
213
  }
214
  function pe(n, t = {}) {
215
  const e = ht(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
216
- let o, a, r, f = n, _ = n, m = 1, b = 0, c = !1;
217
- function y(p, L = {}) {
218
  _ = p;
219
  const F = r = {};
220
- return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (c = !0, o = ye(), f = p, e.set(n = _), Promise.resolve()) : (L.soft && (b = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), m = 0), a || (o = ye(), c = !1, a = gt((u) => {
221
- if (c)
222
- return c = !1, a = null, !1;
223
  m = Math.min(m + b, 1);
224
- const k = {
225
  inv_mass: m,
226
  opts: C,
227
  settled: !0,
228
- dt: (u - o) * 60 / 1e3
229
- }, g = se(k, f, n, _);
230
- return o = u, f = n, e.set(n = g), k.settled && (a = null), !k.settled;
231
- })), new Promise((u) => {
232
  a.promise.then(() => {
233
- F === r && u();
234
  });
235
  }));
236
  }
237
  const C = {
238
- set: y,
239
- update: (p, L) => y(p(_, n), L),
240
  subscribe: e.subscribe,
241
  stiffness: l,
242
  damping: i,
@@ -250,8 +261,8 @@ const {
250
  attr: v,
251
  component_subscribe: qe,
252
  detach: vt,
253
- element: yt,
254
- init: kt,
255
  insert: pt,
256
  noop: Fe,
257
  safe_not_equal: qt,
@@ -263,7 +274,7 @@ function Lt(n) {
263
  let t, e, l, i, s, o, a, r, f, _, m, b;
264
  return {
265
  c() {
266
- t = yt("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"), b = 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*/
267
  n[1][0] + "px, " + /*$top*/
268
  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(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), v(b, "fill", "#FF7C00"), v(b, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
269
  n[2][0] + "px, " + /*$bottom*/
@@ -274,28 +285,28 @@ function Lt(n) {
274
  n[0]
275
  );
276
  },
277
- m(c, y) {
278
- pt(c, 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, b);
279
  },
280
- p(c, [y]) {
281
- y & /*$top*/
282
  2 && $(l, "transform", "translate(" + /*$top*/
283
- c[1][0] + "px, " + /*$top*/
284
- c[1][1] + "px)"), y & /*$bottom*/
285
  4 && $(r, "transform", "translate(" + /*$bottom*/
286
- c[2][0] + "px, " + /*$bottom*/
287
- c[2][1] + "px)"), y & /*margin*/
288
  1 && Le(
289
  t,
290
  "margin",
291
  /*margin*/
292
- c[0]
293
  );
294
  },
295
  i: Fe,
296
  o: Fe,
297
- d(c) {
298
- c && vt(t);
299
  }
300
  };
301
  }
@@ -321,13 +332,13 @@ function Ct(n, t, e) {
321
  }
322
  class Mt extends wt {
323
  constructor(t) {
324
- super(), kt(this, t, Ct, Lt, qt, { margin: 0 });
325
  }
326
  }
327
  const {
328
  SvelteComponent: Vt,
329
  append: H,
330
- attr: T,
331
  binding_callbacks: Ce,
332
  check_outros: Je,
333
  create_component: St,
@@ -335,7 +346,7 @@ const {
335
  destroy_component: zt,
336
  destroy_each: Ke,
337
  detach: h,
338
- element: P,
339
  empty: W,
340
  ensure_array_like: le,
341
  get_all_dirty_from_scope: Tt,
@@ -348,7 +359,7 @@ const {
348
  safe_not_equal: Dt,
349
  set_data: S,
350
  set_style: B,
351
- space: j,
352
  text: q,
353
  toggle_class: V,
354
  transition_in: R,
@@ -380,7 +391,7 @@ function Ht(n) {
380
  );
381
  return {
382
  c() {
383
- t = P("span"), l = q(e), i = j(), a && a.c(), T(t, "class", "error svelte-1txqlrd");
384
  },
385
  m(r, f) {
386
  w(r, t, f), H(t, l), w(r, i, f), a && a.m(r, f), s = !0;
@@ -426,36 +437,36 @@ function Xt(n) {
426
  n[18] && /*show_progress*/
427
  n[6] === "full" && Ne(n)
428
  );
429
- function m(u, k) {
430
  if (
431
  /*progress*/
432
- u[7]
433
  )
434
  return Ot;
435
  if (
436
  /*queue_position*/
437
- u[2] !== null && /*queue_size*/
438
- u[3] !== void 0 && /*queue_position*/
439
- u[2] >= 0
440
  )
441
  return Gt;
442
  if (
443
  /*queue_position*/
444
- u[2] === 0
445
  )
446
  return Yt;
447
  }
448
- let b = m(n), c = b && b(n), y = (
449
  /*timer*/
450
  n[5] && je(n)
451
  );
452
  const C = [Jt, Wt], p = [];
453
- function L(u, k) {
454
  return (
455
  /*last_progress_level*/
456
- u[15] != null ? 0 : (
457
  /*show_progress*/
458
- u[6] === "full" ? 1 : -1
459
  )
460
  );
461
  }
@@ -464,7 +475,7 @@ function Xt(n) {
464
  n[5] && Ie(n);
465
  return {
466
  c() {
467
- _ && _.c(), t = j(), e = P("div"), c && c.c(), l = j(), y && y.c(), i = j(), o && o.c(), a = j(), F && F.c(), r = W(), T(e, "class", "progress-text svelte-1txqlrd"), V(
468
  e,
469
  "meta-text-center",
470
  /*variant*/
@@ -476,41 +487,41 @@ function Xt(n) {
476
  n[8] === "default"
477
  );
478
  },
479
- m(u, k) {
480
- _ && _.m(u, k), w(u, t, k), w(u, e, k), c && c.m(e, null), H(e, l), y && y.m(e, null), w(u, i, k), ~s && p[s].m(u, k), w(u, a, k), F && F.m(u, k), w(u, r, k), f = !0;
481
  },
482
- p(u, k) {
483
  /*variant*/
484
- u[8] === "default" && /*show_eta_bar*/
485
- u[18] && /*show_progress*/
486
- u[6] === "full" ? _ ? _.p(u, k) : (_ = Ne(u), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), b === (b = m(u)) && c ? c.p(u, k) : (c && c.d(1), c = b && b(u), c && (c.c(), c.m(e, l))), /*timer*/
487
- 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*/
488
  256) && V(
489
  e,
490
  "meta-text-center",
491
  /*variant*/
492
- u[8] === "center"
493
- ), (!f || k[0] & /*variant*/
494
  256) && V(
495
  e,
496
  "meta-text",
497
  /*variant*/
498
- u[8] === "default"
499
  );
500
  let g = s;
501
- s = L(u), s === g ? ~s && p[s].p(u, k) : (o && (Qe(), U(p[g], 1, 1, () => {
502
  p[g] = null;
503
- }), Je()), ~s ? (o = p[s], o ? o.p(u, k) : (o = p[s] = C[s](u), o.c()), R(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
504
- u[5] ? F && (F.d(1), F = null) : F ? F.p(u, k) : (F = Ie(u), F.c(), F.m(r.parentNode, r));
505
  },
506
- i(u) {
507
  f || (R(o), f = !0);
508
  },
509
- o(u) {
510
  U(o), f = !1;
511
  },
512
- d(u) {
513
- u && (h(t), h(e), h(i), h(a), h(r)), _ && _.d(u), c && c.d(), y && y.d(), ~s && p[s].d(u), F && F.d(u);
514
  }
515
  };
516
  }
@@ -519,7 +530,7 @@ function Ne(n) {
519
  (n[17] || 0) * 100 - 100}%)`;
520
  return {
521
  c() {
522
- t = P("div"), T(t, "class", "eta-bar svelte-1txqlrd"), B(t, "transform", e);
523
  },
524
  m(l, i) {
525
  w(l, t, i);
@@ -633,7 +644,7 @@ function ze(n) {
633
  let r = a(n), f = r(n);
634
  return {
635
  c() {
636
- f.c(), t = j(), l = q(e), i = q(" | "), o = q(s);
637
  },
638
  m(_, m) {
639
  f.m(_, m), w(_, t, m), w(_, l, m), w(_, i, m), w(_, o, m);
@@ -795,7 +806,7 @@ function Jt(n) {
795
  );
796
  return {
797
  c() {
798
- t = P("div"), e = P("div"), a && a.c(), l = j(), i = P("div"), s = P("div"), T(e, "class", "progress-level-inner svelte-1txqlrd"), T(s, "class", "progress-bar svelte-1txqlrd"), B(s, "width", o), T(i, "class", "progress-bar-wrap svelte-1txqlrd"), T(t, "class", "progress-level svelte-1txqlrd");
799
  },
800
  m(r, f) {
801
  w(r, t, f), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, s), n[30](s);
@@ -874,7 +885,7 @@ function Ze(n) {
874
  );
875
  return {
876
  c() {
877
- s && s.c(), t = j(), o && o.c(), e = j(), a && a.c(), l = j(), r && r.c(), i = W();
878
  },
879
  m(f, _) {
880
  s && s.m(f, _), w(f, t, _), o && o.m(f, _), w(f, e, _), a && a.m(f, _), w(f, l, _), r && r.m(f, _), w(f, i, _);
@@ -1006,10 +1017,10 @@ function Ie(n) {
1006
  let t, e;
1007
  return {
1008
  c() {
1009
- t = P("p"), e = q(
1010
  /*loading_text*/
1011
  n[9]
1012
- ), T(t, "class", "loading svelte-1txqlrd");
1013
  },
1014
  m(l, i) {
1015
  w(l, t, i), H(t, e);
@@ -1041,7 +1052,7 @@ function Qt(n) {
1041
  }
1042
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
1043
  c() {
1044
- t = P("div"), l && l.c(), T(t, "class", i = "wrap " + /*variant*/
1045
  n[8] + " " + /*show_progress*/
1046
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
1047
  n[4] || /*status*/
@@ -1087,7 +1098,7 @@ function Qt(n) {
1087
  }), Je()), ~e ? (l = a[e], l ? l.p(f, _) : (l = a[e] = o[e](f), l.c()), R(l, 1), l.m(t, null)) : l = null), (!s || _[0] & /*variant, show_progress*/
1088
  320 && i !== (i = "wrap " + /*variant*/
1089
  f[8] + " " + /*show_progress*/
1090
- f[6] + " svelte-1txqlrd")) && T(t, "class", i), (!s || _[0] & /*variant, show_progress, status, show_progress*/
1091
  336) && V(t, "hide", !/*status*/
1092
  f[4] || /*status*/
1093
  f[4] === "complete" || /*show_progress*/
@@ -1156,7 +1167,7 @@ async function xt(n, t = !0) {
1156
  }
1157
  }
1158
  function $t(n, t, e) {
1159
- 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: b = !1 } = t, { timer: c = !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: g = !1 } = t, { autoscroll: ne } = t, J, K = !1, x = 0, A = 0, ie = null, de = 0, I = null, Q, Z = null, me = !0;
1160
  const et = () => {
1161
  e(25, x = performance.now()), e(26, A = 0), K = !0, be();
1162
  };
@@ -1174,7 +1185,7 @@ function $t(n, t, e) {
1174
  let he = null;
1175
  function tt(d) {
1176
  Ce[d ? "unshift" : "push"](() => {
1177
- Z = d, e(16, Z), e(7, p), e(14, I), e(15, Q);
1178
  });
1179
  }
1180
  function lt(d) {
@@ -1183,7 +1194,7 @@ function $t(n, t, e) {
1183
  });
1184
  }
1185
  return n.$$set = (d) => {
1186
- "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, b = d.scroll_to_output), "timer" in d && e(5, c = 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, g = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, s = d.$$scope);
1187
  }, n.$$.update = () => {
1188
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1189
  169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - x) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
@@ -1194,7 +1205,7 @@ function $t(n, t, e) {
1194
  return d.index / d.length;
1195
  if (d.progress != null)
1196
  return d.progress;
1197
- })) : 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*/
1198
  16 && (m === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1199
  20979728 && J && b && (m === "pending" || m === "complete") && xt(J, ne), n.$$.dirty[0] & /*status, message*/
1200
  8388624, n.$$.dirty[0] & /*timer_diff*/
@@ -1205,18 +1216,18 @@ function $t(n, t, e) {
1205
  f,
1206
  _,
1207
  m,
1208
- c,
1209
- y,
1210
  p,
1211
  L,
1212
  F,
1213
- u,
1214
- k,
1215
  g,
1216
  J,
1217
  I,
1218
  Q,
1219
- Z,
1220
  de,
1221
  me,
1222
  he,
@@ -1277,13 +1288,13 @@ const {
1277
  get_spread_update: al,
1278
  init: rl,
1279
  insert: _l,
1280
- safe_not_equal: cl,
1281
  set_dynamic_element_data: He,
1282
  set_style: M,
1283
  toggle_class: E,
1284
  transition_in: xe,
1285
  transition_out: $e,
1286
- update_slot_base: ul
1287
  } = window.__gradio__svelte__internal;
1288
  function dl(n) {
1289
  let t, e, l;
@@ -1367,7 +1378,7 @@ function dl(n) {
1367
  },
1368
  p(r, f) {
1369
  s && s.p && (!l || f & /*$$scope*/
1370
- 65536) && ul(
1371
  s,
1372
  i,
1373
  r,
@@ -1487,9 +1498,9 @@ function ml(n) {
1487
  };
1488
  }
1489
  function bl(n, t, e) {
1490
- 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: b = "normal" } = t, { test_id: c = 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 = b === "fieldset" ? "fieldset" : "div";
1491
  return n.$$set = (g) => {
1492
- "height" in g && e(0, s = g.height), "width" in g && e(1, o = g.width), "elem_id" in g && e(2, a = g.elem_id), "elem_classes" in g && e(3, r = g.elem_classes), "variant" in g && e(4, f = g.variant), "border_mode" in g && e(5, _ = g.border_mode), "padding" in g && e(6, m = g.padding), "type" in g && e(15, b = g.type), "test_id" in g && e(7, c = g.test_id), "explicit_call" in g && e(8, y = g.explicit_call), "container" in g && e(9, C = g.container), "visible" in g && e(10, p = g.visible), "allow_overflow" in g && e(11, L = g.allow_overflow), "scale" in g && e(12, F = g.scale), "min_width" in g && e(13, u = g.min_width), "$$scope" in g && e(16, i = g.$$scope);
1493
  }, [
1494
  s,
1495
  o,
@@ -1498,14 +1509,14 @@ function bl(n, t, e) {
1498
  f,
1499
  _,
1500
  m,
1501
- c,
1502
- y,
1503
  C,
1504
  p,
1505
  L,
1506
  F,
1507
- u,
1508
- k,
1509
  b,
1510
  i,
1511
  l
@@ -1513,7 +1524,7 @@ function bl(n, t, e) {
1513
  }
1514
  class gl extends tl {
1515
  constructor(t) {
1516
- super(), rl(this, t, bl, ml, cl, {
1517
  height: 0,
1518
  width: 1,
1519
  elem_id: 2,
@@ -1849,11 +1860,11 @@ hl.reduce(
1849
  const {
1850
  SvelteComponent: wl,
1851
  assign: vl,
1852
- attr: yl,
1853
  create_component: ae,
1854
  destroy_component: re,
1855
  detach: Ye,
1856
- element: kl,
1857
  get_spread_object: pl,
1858
  get_spread_update: ql,
1859
  init: Fl,
@@ -1862,8 +1873,8 @@ const {
1862
  safe_not_equal: Ll,
1863
  space: Cl,
1864
  toggle_class: Oe,
1865
- transition_in: ce,
1866
- transition_out: ue
1867
  } = window.__gradio__svelte__internal;
1868
  function Ml(n) {
1869
  var r;
@@ -1919,7 +1930,7 @@ function Ml(n) {
1919
  ), {
1920
  c() {
1921
  var f;
1922
- ae(t.$$.fragment), e = Cl(), l = kl("div"), ae(i.$$.fragment), yl(l, "class", "svelte-gqsrr7"), Oe(
1923
  l,
1924
  "pending",
1925
  /*loading_status*/
@@ -1930,7 +1941,7 @@ function Ml(n) {
1930
  _e(t, f, _), Ge(f, e, _), Ge(f, l, _), _e(i, l, null), s = !0;
1931
  },
1932
  p(f, _) {
1933
- var c, y;
1934
  const m = _ & /*gradio, loading_status*/
1935
  192 ? ql(o, [
1936
  _ & /*gradio*/
@@ -1955,7 +1966,7 @@ function Ml(n) {
1955
  _ & /*loading_status*/
1956
  64 && (b.min_height = /*loading_status*/
1957
  f[6] && /*loading_status*/
1958
- ((c = f[6]) == null ? void 0 : c.status) !== "complete"), _ & /*value*/
1959
  8 && (b.value = /*value*/
1960
  f[3]), _ & /*elem_classes*/
1961
  2 && (b.elem_classes = /*elem_classes*/
@@ -1970,14 +1981,14 @@ function Ml(n) {
1970
  l,
1971
  "pending",
1972
  /*loading_status*/
1973
- ((y = f[6]) == null ? void 0 : y.status) === "pending"
1974
  );
1975
  },
1976
  i(f) {
1977
- s || (ce(t.$$.fragment, f), ce(i.$$.fragment, f), s = !0);
1978
  },
1979
  o(f) {
1980
- ue(t.$$.fragment, f), ue(i.$$.fragment, f), s = !1;
1981
  },
1982
  d(f) {
1983
  f && (Ye(e), Ye(l)), re(t, f), re(i);
@@ -2001,6 +2012,10 @@ function Vl(n) {
2001
  n[1]
2002
  ),
2003
  container: !1,
 
 
 
 
2004
  $$slots: { default: [Ml] },
2005
  $$scope: { ctx: n }
2006
  }
@@ -2019,14 +2034,16 @@ function Vl(n) {
2019
  1 && (s.elem_id = /*elem_id*/
2020
  l[0]), i & /*elem_classes*/
2021
  2 && (s.elem_classes = /*elem_classes*/
2022
- l[1]), i & /*$$scope, loading_status, value, elem_classes, visible, height, width, gradio*/
 
 
2023
  1278 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
2024
  },
2025
  i(l) {
2026
- e || (ce(t.$$.fragment, l), e = !0);
2027
  },
2028
  o(l) {
2029
- ue(t.$$.fragment, l), e = !1;
2030
  },
2031
  d(l) {
2032
  re(t, l);
@@ -2034,10 +2051,10 @@ function Vl(n) {
2034
  };
2035
  }
2036
  function Sl(n, t, e) {
2037
- let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: s = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { height: r } = t, { width: f = "100%" } = t, { loading_status: _ } = t, { gradio: m } = t;
2038
  const b = () => m.dispatch("change");
2039
- return n.$$set = (c) => {
2040
- "label" in c && e(8, 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), "width" in c && e(5, f = c.width), "loading_status" in c && e(6, _ = c.loading_status), "gradio" in c && e(7, m = c.gradio);
2041
  }, n.$$.update = () => {
2042
  n.$$.dirty & /*label, gradio*/
2043
  384 && m.dispatch("change");
 
1
  const {
2
  SvelteComponent: nt,
3
  append: it,
4
+ attr: T,
5
  binding_callbacks: ft,
6
  detach: st,
7
  element: we,
 
11
  noop: ve,
12
  safe_not_equal: _t,
13
  toggle_class: X
14
+ } = window.__gradio__svelte__internal, { createEventDispatcher: ut } = window.__gradio__svelte__internal;
15
+ function ct(n) {
16
  let t, e, l, i, s;
17
  return {
18
  c() {
19
+ t = we("div"), e = we("iframe"), T(e, "title", "iframe component"), T(
20
  e,
21
  "width",
22
  /*width*/
23
  n[5]
24
+ ), T(
25
  e,
26
  "srcdoc",
27
  /*value*/
28
  n[1]
29
+ ), T(
30
+ e,
31
+ "height",
32
+ /*height*/
33
+ n[4]
34
+ ), T(e, "allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"), e.allowFullscreen = !0, T(t, "class", l = "prose " + /*elem_classes*/
35
  n[0].join(" ") + " svelte-2qygph"), X(
36
  t,
37
  "min",
 
55
  },
56
  p(o, [a]) {
57
  a & /*width*/
58
+ 32 && T(
59
  e,
60
  "width",
61
  /*width*/
62
  o[5]
63
  ), a & /*value*/
64
+ 2 && T(
65
  e,
66
  "srcdoc",
67
  /*value*/
68
  o[1]
69
+ ), a & /*height*/
70
+ 16 && T(
71
+ e,
72
+ "height",
73
+ /*height*/
74
+ o[4]
75
  ), a & /*elem_classes*/
76
  1 && l !== (l = "prose " + /*elem_classes*/
77
+ o[0].join(" ") + " svelte-2qygph") && T(t, "class", l), a & /*elem_classes, min_height*/
78
  9 && X(
79
  t,
80
  "min",
 
99
  }
100
  function dt(n, t, e) {
101
  let { elem_classes: l = [] } = t, { value: i } = t, { visible: s = !0 } = t, { min_height: o = !1 } = t, { height: a = "100%" } = t, { width: r = "100%" } = t;
102
+ const f = ut();
103
  let _;
104
  const m = () => {
105
  try {
106
+ const u = _.contentDocument || _.contentWindow.document;
107
+ a === "100%" ? e(6, _.style.height = `${u.documentElement.scrollHeight}px`, _) : e(6, _.style.height = a, _);
108
+ } catch (u) {
109
+ console.error("Error accessing iframe content:", u);
110
  }
111
  };
112
+ function b(u) {
113
+ ft[u ? "unshift" : "push"](() => {
114
+ _ = u, e(6, _);
115
  });
116
  }
117
+ return n.$$set = (u) => {
118
+ "elem_classes" in u && e(0, l = u.elem_classes), "value" in u && e(1, i = u.value), "visible" in u && e(2, s = u.visible), "min_height" in u && e(3, o = u.min_height), "height" in u && e(4, a = u.height), "width" in u && e(5, r = u.width);
119
  }, n.$$.update = () => {
120
  n.$$.dirty & /*value*/
121
  2 && f("change");
 
133
  }
134
  class mt extends nt {
135
  constructor(t) {
136
+ super(), ot(this, t, dt, ct, _t, {
137
  elem_classes: 0,
138
  value: 1,
139
  visible: 2,
 
156
  return n != n ? t == t : n !== t || n && typeof n == "object" || typeof n == "function";
157
  }
158
  const Re = typeof window < "u";
159
+ let ke = Re ? () => window.performance.now() : () => Date.now(), Ue = Re ? (n) => requestAnimationFrame(n) : te;
160
  const O = /* @__PURE__ */ new Set();
161
  function We(n) {
162
  O.forEach((t) => {
 
201
  }
202
  return { set: i, update: s, subscribe: o };
203
  }
204
+ function ye(n) {
205
  return Object.prototype.toString.call(n) === "[object Date]";
206
  }
207
  function se(n, t, e, l) {
208
+ if (typeof e == "number" || ye(e)) {
209
  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;
210
+ return Math.abs(f) < n.opts.precision && Math.abs(i) < n.opts.precision ? l : (n.settled = !1, ye(e) ? new Date(e.getTime() + f) : e + f);
211
  } else {
212
  if (Array.isArray(e))
213
  return e.map(
 
224
  }
225
  function pe(n, t = {}) {
226
  const e = ht(n), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
227
+ let o, a, r, f = n, _ = n, m = 1, b = 0, u = !1;
228
+ function k(p, L = {}) {
229
  _ = p;
230
  const F = r = {};
231
+ return n == null || L.hard || C.stiffness >= 1 && C.damping >= 1 ? (u = !0, o = ke(), f = p, e.set(n = _), Promise.resolve()) : (L.soft && (b = 1 / ((L.soft === !0 ? 0.5 : +L.soft) * 60), m = 0), a || (o = ke(), u = !1, a = gt((c) => {
232
+ if (u)
233
+ return u = !1, a = null, !1;
234
  m = Math.min(m + b, 1);
235
+ const y = {
236
  inv_mass: m,
237
  opts: C,
238
  settled: !0,
239
+ dt: (c - o) * 60 / 1e3
240
+ }, g = se(y, f, n, _);
241
+ return o = c, f = n, e.set(n = g), y.settled && (a = null), !y.settled;
242
+ })), new Promise((c) => {
243
  a.promise.then(() => {
244
+ F === r && c();
245
  });
246
  }));
247
  }
248
  const C = {
249
+ set: k,
250
+ update: (p, L) => k(p(_, n), L),
251
  subscribe: e.subscribe,
252
  stiffness: l,
253
  damping: i,
 
261
  attr: v,
262
  component_subscribe: qe,
263
  detach: vt,
264
+ element: kt,
265
+ init: yt,
266
  insert: pt,
267
  noop: Fe,
268
  safe_not_equal: qt,
 
274
  let t, e, l, i, s, o, a, r, f, _, m, b;
275
  return {
276
  c() {
277
+ t = kt("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"), b = 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*/
278
  n[1][0] + "px, " + /*$top*/
279
  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(b, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), v(b, "fill", "#FF7C00"), v(b, "class", "svelte-43sxxs"), $(r, "transform", "translate(" + /*$bottom*/
280
  n[2][0] + "px, " + /*$bottom*/
 
285
  n[0]
286
  );
287
  },
288
+ m(u, k) {
289
+ pt(u, t, k), 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, b);
290
  },
291
+ p(u, [k]) {
292
+ k & /*$top*/
293
  2 && $(l, "transform", "translate(" + /*$top*/
294
+ u[1][0] + "px, " + /*$top*/
295
+ u[1][1] + "px)"), k & /*$bottom*/
296
  4 && $(r, "transform", "translate(" + /*$bottom*/
297
+ u[2][0] + "px, " + /*$bottom*/
298
+ u[2][1] + "px)"), k & /*margin*/
299
  1 && Le(
300
  t,
301
  "margin",
302
  /*margin*/
303
+ u[0]
304
  );
305
  },
306
  i: Fe,
307
  o: Fe,
308
+ d(u) {
309
+ u && vt(t);
310
  }
311
  };
312
  }
 
332
  }
333
  class Mt extends wt {
334
  constructor(t) {
335
+ super(), yt(this, t, Ct, Lt, qt, { margin: 0 });
336
  }
337
  }
338
  const {
339
  SvelteComponent: Vt,
340
  append: H,
341
+ attr: j,
342
  binding_callbacks: Ce,
343
  check_outros: Je,
344
  create_component: St,
 
346
  destroy_component: zt,
347
  destroy_each: Ke,
348
  detach: h,
349
+ element: Z,
350
  empty: W,
351
  ensure_array_like: le,
352
  get_all_dirty_from_scope: Tt,
 
359
  safe_not_equal: Dt,
360
  set_data: S,
361
  set_style: B,
362
+ space: P,
363
  text: q,
364
  toggle_class: V,
365
  transition_in: R,
 
391
  );
392
  return {
393
  c() {
394
+ t = Z("span"), l = q(e), i = P(), a && a.c(), j(t, "class", "error svelte-1txqlrd");
395
  },
396
  m(r, f) {
397
  w(r, t, f), H(t, l), w(r, i, f), a && a.m(r, f), s = !0;
 
437
  n[18] && /*show_progress*/
438
  n[6] === "full" && Ne(n)
439
  );
440
+ function m(c, y) {
441
  if (
442
  /*progress*/
443
+ c[7]
444
  )
445
  return Ot;
446
  if (
447
  /*queue_position*/
448
+ c[2] !== null && /*queue_size*/
449
+ c[3] !== void 0 && /*queue_position*/
450
+ c[2] >= 0
451
  )
452
  return Gt;
453
  if (
454
  /*queue_position*/
455
+ c[2] === 0
456
  )
457
  return Yt;
458
  }
459
+ let b = m(n), u = b && b(n), k = (
460
  /*timer*/
461
  n[5] && je(n)
462
  );
463
  const C = [Jt, Wt], p = [];
464
+ function L(c, y) {
465
  return (
466
  /*last_progress_level*/
467
+ c[15] != null ? 0 : (
468
  /*show_progress*/
469
+ c[6] === "full" ? 1 : -1
470
  )
471
  );
472
  }
 
475
  n[5] && Ie(n);
476
  return {
477
  c() {
478
+ _ && _.c(), t = P(), e = Z("div"), u && u.c(), l = P(), k && k.c(), i = P(), o && o.c(), a = P(), F && F.c(), r = W(), j(e, "class", "progress-text svelte-1txqlrd"), V(
479
  e,
480
  "meta-text-center",
481
  /*variant*/
 
487
  n[8] === "default"
488
  );
489
  },
490
+ m(c, y) {
491
+ _ && _.m(c, y), w(c, t, y), w(c, e, y), u && u.m(e, null), H(e, l), k && k.m(e, null), w(c, i, y), ~s && p[s].m(c, y), w(c, a, y), F && F.m(c, y), w(c, r, y), f = !0;
492
  },
493
+ p(c, y) {
494
  /*variant*/
495
+ c[8] === "default" && /*show_eta_bar*/
496
+ c[18] && /*show_progress*/
497
+ c[6] === "full" ? _ ? _.p(c, y) : (_ = Ne(c), _.c(), _.m(t.parentNode, t)) : _ && (_.d(1), _ = null), b === (b = m(c)) && u ? u.p(c, y) : (u && u.d(1), u = b && b(c), u && (u.c(), u.m(e, l))), /*timer*/
498
+ c[5] ? k ? k.p(c, y) : (k = je(c), k.c(), k.m(e, null)) : k && (k.d(1), k = null), (!f || y[0] & /*variant*/
499
  256) && V(
500
  e,
501
  "meta-text-center",
502
  /*variant*/
503
+ c[8] === "center"
504
+ ), (!f || y[0] & /*variant*/
505
  256) && V(
506
  e,
507
  "meta-text",
508
  /*variant*/
509
+ c[8] === "default"
510
  );
511
  let g = s;
512
+ s = L(c), s === g ? ~s && p[s].p(c, y) : (o && (Qe(), U(p[g], 1, 1, () => {
513
  p[g] = null;
514
+ }), Je()), ~s ? (o = p[s], o ? o.p(c, y) : (o = p[s] = C[s](c), o.c()), R(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/
515
+ c[5] ? F && (F.d(1), F = null) : F ? F.p(c, y) : (F = Ie(c), F.c(), F.m(r.parentNode, r));
516
  },
517
+ i(c) {
518
  f || (R(o), f = !0);
519
  },
520
+ o(c) {
521
  U(o), f = !1;
522
  },
523
+ d(c) {
524
+ c && (h(t), h(e), h(i), h(a), h(r)), _ && _.d(c), u && u.d(), k && k.d(), ~s && p[s].d(c), F && F.d(c);
525
  }
526
  };
527
  }
 
530
  (n[17] || 0) * 100 - 100}%)`;
531
  return {
532
  c() {
533
+ t = Z("div"), j(t, "class", "eta-bar svelte-1txqlrd"), B(t, "transform", e);
534
  },
535
  m(l, i) {
536
  w(l, t, i);
 
644
  let r = a(n), f = r(n);
645
  return {
646
  c() {
647
+ f.c(), t = P(), l = q(e), i = q(" | "), o = q(s);
648
  },
649
  m(_, m) {
650
  f.m(_, m), w(_, t, m), w(_, l, m), w(_, i, m), w(_, o, m);
 
806
  );
807
  return {
808
  c() {
809
+ t = Z("div"), e = Z("div"), a && a.c(), l = P(), i = Z("div"), s = Z("div"), j(e, "class", "progress-level-inner svelte-1txqlrd"), j(s, "class", "progress-bar svelte-1txqlrd"), B(s, "width", o), j(i, "class", "progress-bar-wrap svelte-1txqlrd"), j(t, "class", "progress-level svelte-1txqlrd");
810
  },
811
  m(r, f) {
812
  w(r, t, f), H(t, e), a && a.m(e, null), H(t, l), H(t, i), H(i, s), n[30](s);
 
885
  );
886
  return {
887
  c() {
888
+ s && s.c(), t = P(), o && o.c(), e = P(), a && a.c(), l = P(), r && r.c(), i = W();
889
  },
890
  m(f, _) {
891
  s && s.m(f, _), w(f, t, _), o && o.m(f, _), w(f, e, _), a && a.m(f, _), w(f, l, _), r && r.m(f, _), w(f, i, _);
 
1017
  let t, e;
1018
  return {
1019
  c() {
1020
+ t = Z("p"), e = q(
1021
  /*loading_text*/
1022
  n[9]
1023
+ ), j(t, "class", "loading svelte-1txqlrd");
1024
  },
1025
  m(l, i) {
1026
  w(l, t, i), H(t, e);
 
1052
  }
1053
  return ~(e = r(n)) && (l = a[e] = o[e](n)), {
1054
  c() {
1055
+ t = Z("div"), l && l.c(), j(t, "class", i = "wrap " + /*variant*/
1056
  n[8] + " " + /*show_progress*/
1057
  n[6] + " svelte-1txqlrd"), V(t, "hide", !/*status*/
1058
  n[4] || /*status*/
 
1098
  }), Je()), ~e ? (l = a[e], l ? l.p(f, _) : (l = a[e] = o[e](f), l.c()), R(l, 1), l.m(t, null)) : l = null), (!s || _[0] & /*variant, show_progress*/
1099
  320 && i !== (i = "wrap " + /*variant*/
1100
  f[8] + " " + /*show_progress*/
1101
+ f[6] + " svelte-1txqlrd")) && j(t, "class", i), (!s || _[0] & /*variant, show_progress, status, show_progress*/
1102
  336) && V(t, "hide", !/*status*/
1103
  f[4] || /*status*/
1104
  f[4] === "complete" || /*show_progress*/
 
1167
  }
1168
  }
1169
  function $t(n, t, e) {
1170
+ 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: b = !1 } = t, { timer: u = !0 } = t, { show_progress: k = "full" } = t, { message: C = null } = t, { progress: p = null } = t, { variant: L = "default" } = t, { loading_text: F = "Loading..." } = t, { absolute: c = !0 } = t, { translucent: y = !1 } = t, { border: g = !1 } = t, { autoscroll: ne } = t, J, K = !1, x = 0, A = 0, ie = null, de = 0, I = null, Q, D = null, me = !0;
1171
  const et = () => {
1172
  e(25, x = performance.now()), e(26, A = 0), K = !0, be();
1173
  };
 
1185
  let he = null;
1186
  function tt(d) {
1187
  Ce[d ? "unshift" : "push"](() => {
1188
+ D = d, e(16, D), e(7, p), e(14, I), e(15, Q);
1189
  });
1190
  }
1191
  function lt(d) {
 
1194
  });
1195
  }
1196
  return n.$$set = (d) => {
1197
+ "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, b = d.scroll_to_output), "timer" in d && e(5, u = d.timer), "show_progress" in d && e(6, k = 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, c = d.absolute), "translucent" in d && e(11, y = d.translucent), "border" in d && e(12, g = d.border), "autoscroll" in d && e(24, ne = d.autoscroll), "$$scope" in d && e(28, s = d.$$scope);
1198
  }, n.$$.update = () => {
1199
  n.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
1200
  169869313 && (a === null ? e(0, a = ie) : r && e(0, a = (performance.now() - x) / 1e3 + a), a != null && (e(19, he = a.toFixed(1)), e(27, ie = a))), n.$$.dirty[0] & /*eta, timer_diff*/
 
1205
  return d.index / d.length;
1206
  if (d.progress != null)
1207
  return d.progress;
1208
+ })) : e(14, I = null), I ? (e(15, Q = I[I.length - 1]), D && (Q === 0 ? e(16, D.style.transition = "0", D) : e(16, D.style.transition = "150ms", D))) : e(15, Q = void 0)), n.$$.dirty[0] & /*status*/
1209
  16 && (m === "pending" ? et() : ge()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1210
  20979728 && J && b && (m === "pending" || m === "complete") && xt(J, ne), n.$$.dirty[0] & /*status, message*/
1211
  8388624, n.$$.dirty[0] & /*timer_diff*/
 
1216
  f,
1217
  _,
1218
  m,
1219
+ u,
1220
+ k,
1221
  p,
1222
  L,
1223
  F,
1224
+ c,
1225
+ y,
1226
  g,
1227
  J,
1228
  I,
1229
  Q,
1230
+ D,
1231
  de,
1232
  me,
1233
  he,
 
1288
  get_spread_update: al,
1289
  init: rl,
1290
  insert: _l,
1291
+ safe_not_equal: ul,
1292
  set_dynamic_element_data: He,
1293
  set_style: M,
1294
  toggle_class: E,
1295
  transition_in: xe,
1296
  transition_out: $e,
1297
+ update_slot_base: cl
1298
  } = window.__gradio__svelte__internal;
1299
  function dl(n) {
1300
  let t, e, l;
 
1378
  },
1379
  p(r, f) {
1380
  s && s.p && (!l || f & /*$$scope*/
1381
+ 65536) && cl(
1382
  s,
1383
  i,
1384
  r,
 
1498
  };
1499
  }
1500
  function bl(n, t, e) {
1501
+ 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: b = "normal" } = t, { test_id: u = void 0 } = t, { explicit_call: k = !1 } = t, { container: C = !0 } = t, { visible: p = !0 } = t, { allow_overflow: L = !0 } = t, { scale: F = null } = t, { min_width: c = 0 } = t, y = b === "fieldset" ? "fieldset" : "div";
1502
  return n.$$set = (g) => {
1503
+ "height" in g && e(0, s = g.height), "width" in g && e(1, o = g.width), "elem_id" in g && e(2, a = g.elem_id), "elem_classes" in g && e(3, r = g.elem_classes), "variant" in g && e(4, f = g.variant), "border_mode" in g && e(5, _ = g.border_mode), "padding" in g && e(6, m = g.padding), "type" in g && e(15, b = g.type), "test_id" in g && e(7, u = g.test_id), "explicit_call" in g && e(8, k = g.explicit_call), "container" in g && e(9, C = g.container), "visible" in g && e(10, p = g.visible), "allow_overflow" in g && e(11, L = g.allow_overflow), "scale" in g && e(12, F = g.scale), "min_width" in g && e(13, c = g.min_width), "$$scope" in g && e(16, i = g.$$scope);
1504
  }, [
1505
  s,
1506
  o,
 
1509
  f,
1510
  _,
1511
  m,
1512
+ u,
1513
+ k,
1514
  C,
1515
  p,
1516
  L,
1517
  F,
1518
+ c,
1519
+ y,
1520
  b,
1521
  i,
1522
  l
 
1524
  }
1525
  class gl extends tl {
1526
  constructor(t) {
1527
+ super(), rl(this, t, bl, ml, ul, {
1528
  height: 0,
1529
  width: 1,
1530
  elem_id: 2,
 
1860
  const {
1861
  SvelteComponent: wl,
1862
  assign: vl,
1863
+ attr: kl,
1864
  create_component: ae,
1865
  destroy_component: re,
1866
  detach: Ye,
1867
+ element: yl,
1868
  get_spread_object: pl,
1869
  get_spread_update: ql,
1870
  init: Fl,
 
1873
  safe_not_equal: Ll,
1874
  space: Cl,
1875
  toggle_class: Oe,
1876
+ transition_in: ue,
1877
+ transition_out: ce
1878
  } = window.__gradio__svelte__internal;
1879
  function Ml(n) {
1880
  var r;
 
1930
  ), {
1931
  c() {
1932
  var f;
1933
+ ae(t.$$.fragment), e = Cl(), l = yl("div"), ae(i.$$.fragment), kl(l, "class", "svelte-gqsrr7"), Oe(
1934
  l,
1935
  "pending",
1936
  /*loading_status*/
 
1941
  _e(t, f, _), Ge(f, e, _), Ge(f, l, _), _e(i, l, null), s = !0;
1942
  },
1943
  p(f, _) {
1944
+ var u, k;
1945
  const m = _ & /*gradio, loading_status*/
1946
  192 ? ql(o, [
1947
  _ & /*gradio*/
 
1966
  _ & /*loading_status*/
1967
  64 && (b.min_height = /*loading_status*/
1968
  f[6] && /*loading_status*/
1969
+ ((u = f[6]) == null ? void 0 : u.status) !== "complete"), _ & /*value*/
1970
  8 && (b.value = /*value*/
1971
  f[3]), _ & /*elem_classes*/
1972
  2 && (b.elem_classes = /*elem_classes*/
 
1981
  l,
1982
  "pending",
1983
  /*loading_status*/
1984
+ ((k = f[6]) == null ? void 0 : k.status) === "pending"
1985
  );
1986
  },
1987
  i(f) {
1988
+ s || (ue(t.$$.fragment, f), ue(i.$$.fragment, f), s = !0);
1989
  },
1990
  o(f) {
1991
+ ce(t.$$.fragment, f), ce(i.$$.fragment, f), s = !1;
1992
  },
1993
  d(f) {
1994
  f && (Ye(e), Ye(l)), re(t, f), re(i);
 
2012
  n[1]
2013
  ),
2014
  container: !1,
2015
+ height: (
2016
+ /*height*/
2017
+ n[4]
2018
+ ),
2019
  $$slots: { default: [Ml] },
2020
  $$scope: { ctx: n }
2021
  }
 
2034
  1 && (s.elem_id = /*elem_id*/
2035
  l[0]), i & /*elem_classes*/
2036
  2 && (s.elem_classes = /*elem_classes*/
2037
+ l[1]), i & /*height*/
2038
+ 16 && (s.height = /*height*/
2039
+ l[4]), i & /*$$scope, loading_status, value, elem_classes, visible, height, width, gradio*/
2040
  1278 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
2041
  },
2042
  i(l) {
2043
+ e || (ue(t.$$.fragment, l), e = !0);
2044
  },
2045
  o(l) {
2046
+ ce(t.$$.fragment, l), e = !1;
2047
  },
2048
  d(l) {
2049
  re(t, l);
 
2051
  };
2052
  }
2053
  function Sl(n, t, e) {
2054
+ let { label: l } = t, { elem_id: i = "" } = t, { elem_classes: s = [] } = t, { visible: o = !0 } = t, { value: a = "" } = t, { height: r = "100%" } = t, { width: f = "100%" } = t, { loading_status: _ } = t, { gradio: m } = t;
2055
  const b = () => m.dispatch("change");
2056
+ return n.$$set = (u) => {
2057
+ "label" in u && e(8, l = u.label), "elem_id" in u && e(0, i = u.elem_id), "elem_classes" in u && e(1, s = u.elem_classes), "visible" in u && e(2, o = u.visible), "value" in u && e(3, a = u.value), "height" in u && e(4, r = u.height), "width" in u && e(5, f = u.width), "loading_status" in u && e(6, _ = u.loading_status), "gradio" in u && e(7, m = u.gradio);
2058
  }, n.$$.update = () => {
2059
  n.$$.dirty & /*label, gradio*/
2060
  384 && m.dispatch("change");
src/demo/app.py CHANGED
@@ -6,9 +6,11 @@ from gradio_iframe import iFrame
6
  example = iFrame().example_inputs()
7
 
8
  with gr.Blocks() as demo:
 
 
9
  with gr.Row():
10
  iFrame(label="Blank"), # blank component
11
- iFrame(value=example, label="Populated", height="1000px"), # populated component
12
 
13
 
14
  demo.launch()
 
6
  example = iFrame().example_inputs()
7
 
8
  with gr.Blocks() as demo:
9
+ with gr.Row():
10
+ gr.Markdown("## Blank iFrame and iFrame with another iFrame inside")
11
  with gr.Row():
12
  iFrame(label="Blank"), # blank component
13
+ iFrame(value=example, label="Populated"), # populated component
14
 
15
 
16
  demo.launch()
src/frontend/Index.svelte CHANGED
@@ -10,7 +10,7 @@
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
13
- export let height: string;
14
  export let width: string = "100%";
15
  export let loading_status: LoadingStatus;
16
  export let gradio: Gradio<{
@@ -20,7 +20,7 @@
20
  $: label, gradio.dispatch("change");
21
  </script>
22
 
23
- <Block {visible} {elem_id} {elem_classes} container={false}>
24
  <StatusTracker
25
  autoscroll={gradio.autoscroll}
26
  i18n={gradio.i18n}
 
10
  export let elem_classes: string[] = [];
11
  export let visible = true;
12
  export let value = "";
13
+ export let height: string = "100%";
14
  export let width: string = "100%";
15
  export let loading_status: LoadingStatus;
16
  export let gradio: Gradio<{
 
20
  $: label, gradio.dispatch("change");
21
  </script>
22
 
23
+ <Block {visible} {elem_id} {elem_classes} container={false} height={height}>
24
  <StatusTracker
25
  autoscroll={gradio.autoscroll}
26
  i18n={gradio.i18n}
src/frontend/shared/HTML.svelte CHANGED
@@ -39,6 +39,7 @@
39
  title="iframe component"
40
  width={width}
41
  srcdoc={value}
 
42
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
43
  allowfullscreen
44
  on:load={onLoad}
 
39
  title="iframe component"
40
  width={width}
41
  srcdoc={value}
42
+ height={height}
43
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
44
  allowfullscreen
45
  on:load={onLoad}
src/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_iframe"
11
- version = "0.0.9"
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", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/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"]
 
8
 
9
  [project]
10
  name = "gradio_iframe"
11
+ version = "0.0.10"
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", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/gradio_iframe/templates", "backend/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"]