radames commited on
Commit
810d44e
·
verified ·
1 Parent(s): ffc50b3

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,9 +1,9 @@
1
 
2
  ---
3
  tags: [gradio-custom-component,diffusion model,UI,text-to-image,prompt weighting,editor]
4
- title: gradio_promptweighting V0.0.1
5
- colorFrom: gray
6
- colorTo: indigo
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
 
1
 
2
  ---
3
  tags: [gradio-custom-component,diffusion model,UI,text-to-image,prompt weighting,editor]
4
+ title: gradio_promptweighting V0.0.2
5
+ colorFrom: purple
6
+ colorTo: pink
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
requirements.txt CHANGED
@@ -1 +1 @@
1
- gradio_promptweighting==0.0.1
 
1
+ gradio_promptweighting==0.0.2
space.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'PromptWeighting': {'description': 'Creates a very simple textbox for user to enter string input or display string output.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': '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.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,7 +21,7 @@ with gr.Blocks(
21
  # `gradio_promptweighting`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
25
  </div>
26
 
27
  Simple component for creating prompt weighting for real-time generation.
@@ -53,7 +53,13 @@ with gr.Blocks() as demo:
53
  with gr.Row():
54
  with gr.Column():
55
  prompt = PromptWeighting(
56
- value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
 
 
 
 
 
 
57
  )
58
  btn = gr.Button("Update Prompt")
59
  with gr.Column():
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'PromptWeighting': {'description': 'Enables multi text input with a vertical drag to adjust the weight of each prompt.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': '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.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_promptweighting`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
25
  </div>
26
 
27
  Simple component for creating prompt weighting for real-time generation.
 
53
  with gr.Row():
54
  with gr.Column():
55
  prompt = PromptWeighting(
56
+ value=[
57
+ {"prompt": "a cat", "scale": 1.5},
58
+ {"prompt": "a dog", "scale": 1},
59
+ {"prompt": "a bird", "scale": 0.5},
60
+ ],
61
+ step=0.001,
62
+ info="Please drag up or down to adjust the weight of the prompt.",
63
  )
64
  btn = gr.Button("Update Prompt")
65
  with gr.Column():
src/README.md CHANGED
@@ -1,6 +1,6 @@
1
 
2
  # `gradio_promptweighting`
3
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
4
 
5
  Simple component for creating prompt weighting for real-time generation.
6
 
@@ -28,7 +28,13 @@ with gr.Blocks() as demo:
28
  with gr.Row():
29
  with gr.Column():
30
  prompt = PromptWeighting(
31
- value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
 
 
 
 
 
 
32
  )
33
  btn = gr.Button("Update Prompt")
34
  with gr.Column():
@@ -135,6 +141,19 @@ bool | None
135
  <td align="left">if True, will display label.</td>
136
  </tr>
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  <tr>
139
  <td align="left"><code>scale</code></td>
140
  <td align="left" style="width: 25%;">
 
1
 
2
  # `gradio_promptweighting`
3
+ <a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
4
 
5
  Simple component for creating prompt weighting for real-time generation.
6
 
 
28
  with gr.Row():
29
  with gr.Column():
30
  prompt = PromptWeighting(
31
+ value=[
32
+ {"prompt": "a cat", "scale": 1.5},
33
+ {"prompt": "a dog", "scale": 1},
34
+ {"prompt": "a bird", "scale": 0.5},
35
+ ],
36
+ step=0.001,
37
+ info="Please drag up or down to adjust the weight of the prompt.",
38
  )
39
  btn = gr.Button("Update Prompt")
40
  with gr.Column():
 
141
  <td align="left">if True, will display label.</td>
142
  </tr>
143
 
144
+ <tr>
145
+ <td align="left"><code>info</code></td>
146
+ <td align="left" style="width: 25%;">
147
+
148
+ ```python
149
+ str | None
150
+ ```
151
+
152
+ </td>
153
+ <td align="left"><code>None</code></td>
154
+ <td align="left">None</td>
155
+ </tr>
156
+
157
  <tr>
158
  <td align="left"><code>scale</code></td>
159
  <td align="left" style="width: 25%;">
src/backend/gradio_promptweighting/templates/component/index.js CHANGED
@@ -13,8 +13,8 @@ const {
13
  element: dn,
14
  get_all_dirty_from_scope: mn,
15
  get_slot_changes: hn,
16
- get_spread_update: pn,
17
- init: gn,
18
  insert: bn,
19
  safe_not_equal: wn,
20
  set_dynamic_element_data: Ge,
@@ -141,7 +141,7 @@ function yn(e) {
141
  ), Ge(
142
  /*tag*/
143
  o[14]
144
- )(t, r = pn(f, [
145
  (!l || a & /*test_id*/
146
  128) && { "data-testid": (
147
  /*test_id*/
@@ -256,17 +256,17 @@ function kn(e) {
256
  };
257
  }
258
  function Cn(e, t, n) {
259
- let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: f = void 0 } = t, { elem_id: r = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: u = "base" } = t, { padding: m = !0 } = t, { type: h = "normal" } = t, { test_id: d = void 0 } = t, { explicit_call: p = !1 } = t, { container: b = !0 } = t, { visible: v = !0 } = t, { allow_overflow: w = !0 } = t, { scale: k = null } = t, { min_width: g = 0 } = t, _ = h === "fieldset" ? "fieldset" : "div";
260
- const C = (c) => {
261
- if (c !== void 0) {
262
- if (typeof c == "number")
263
- return c + "px";
264
- if (typeof c == "string")
265
- return c;
266
  }
267
  };
268
- return e.$$set = (c) => {
269
- "height" in c && n(0, s = c.height), "width" in c && n(1, f = c.width), "elem_id" in c && n(2, r = c.elem_id), "elem_classes" in c && n(3, o = c.elem_classes), "variant" in c && n(4, a = c.variant), "border_mode" in c && n(5, u = c.border_mode), "padding" in c && n(6, m = c.padding), "type" in c && n(16, h = c.type), "test_id" in c && n(7, d = c.test_id), "explicit_call" in c && n(8, p = c.explicit_call), "container" in c && n(9, b = c.container), "visible" in c && n(10, v = c.visible), "allow_overflow" in c && n(11, w = c.allow_overflow), "scale" in c && n(12, k = c.scale), "min_width" in c && n(13, g = c.min_width), "$$scope" in c && n(17, i = c.$$scope);
270
  }, [
271
  s,
272
  f,
@@ -274,24 +274,24 @@ function Cn(e, t, n) {
274
  o,
275
  a,
276
  u,
277
- m,
278
  d,
279
- p,
280
- b,
281
- v,
282
- w,
283
- k,
284
- g,
285
  _,
 
 
 
 
286
  C,
287
- h,
 
 
 
288
  i,
289
  l
290
  ];
291
  }
292
  class An extends an {
293
  constructor(t) {
294
- super(), gn(this, t, Cn, kn, wn, {
295
  height: 0,
296
  width: 1,
297
  elem_id: 2,
@@ -408,7 +408,7 @@ const {
408
  space: tl,
409
  text: nl,
410
  toggle_class: ie,
411
- transition_in: ge,
412
  transition_out: qe,
413
  update_slot_base: ll
414
  } = window.__gradio__svelte__internal;
@@ -432,7 +432,7 @@ function Je(e) {
432
  10 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
433
  },
434
  i(l) {
435
- n || (ge(t.$$.fragment, l), n = !0);
436
  },
437
  o(l) {
438
  qe(t.$$.fragment, l), n = !1;
@@ -528,12 +528,12 @@ function sl(e) {
528
  o[1] != null
529
  ), /*info*/
530
  o[1] ? r ? (r.p(o, a), a & /*info*/
531
- 2 && ge(r, 1)) : (r = Je(o), r.c(), ge(r, 1), r.m(l.parentNode, l)) : r && (Qn(), qe(r, 1, 1, () => {
532
  r = null;
533
  }), Zn());
534
  },
535
  i(o) {
536
- i || (ge(f, o), ge(r), i = !0);
537
  },
538
  o(o) {
539
  qe(f, o), qe(r), i = !1;
@@ -949,98 +949,98 @@ function Oe(e, t, n, l) {
949
  }
950
  function $e(e, t = {}) {
951
  const n = cl(e), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
952
- let f, r, o, a = e, u = e, m = 1, h = 0, d = !1;
953
- function p(v, w = {}) {
954
- u = v;
955
- const k = o = {};
956
- return e == null || w.hard || b.stiffness >= 1 && b.damping >= 1 ? (d = !0, f = je(), a = v, n.set(e = u), Promise.resolve()) : (w.soft && (h = 1 / ((w.soft === !0 ? 0.5 : +w.soft) * 60), m = 0), r || (f = je(), d = !1, r = ul((g) => {
957
- if (d)
958
- return d = !1, r = null, !1;
959
- m = Math.min(m + h, 1);
960
- const _ = {
961
- inv_mass: m,
962
- opts: b,
963
  settled: !0,
964
- dt: (g - f) * 60 / 1e3
965
- }, C = Oe(_, a, e, u);
966
- return f = g, a = e, n.set(e = C), _.settled && (r = null), !_.settled;
967
- })), new Promise((g) => {
968
  r.promise.then(() => {
969
- k === o && g();
970
  });
971
  }));
972
  }
973
- const b = {
974
- set: p,
975
- update: (v, w) => p(v(u, e), w),
976
  subscribe: n.subscribe,
977
  stiffness: l,
978
  damping: i,
979
  precision: s
980
  };
981
- return b;
982
  }
983
  const {
984
  SvelteComponent: _l,
985
  append: O,
986
- attr: L,
987
  component_subscribe: et,
988
  detach: dl,
989
  element: ml,
990
  init: hl,
991
- insert: pl,
992
  noop: tt,
993
- safe_not_equal: gl,
994
  set_style: Ce,
995
  svg_element: U,
996
  toggle_class: nt
997
  } = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal;
998
  function wl(e) {
999
- let t, n, l, i, s, f, r, o, a, u, m, h;
1000
  return {
1001
  c() {
1002
- t = ml("div"), n = U("svg"), l = U("g"), i = U("path"), s = U("path"), f = U("path"), r = U("path"), o = U("g"), a = U("path"), u = U("path"), m = U("path"), h = U("path"), L(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), L(i, "fill", "#FF7C00"), L(i, "fill-opacity", "0.4"), L(i, "class", "svelte-43sxxs"), L(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), L(s, "fill", "#FF7C00"), L(s, "class", "svelte-43sxxs"), L(f, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), L(f, "fill", "#FF7C00"), L(f, "fill-opacity", "0.4"), L(f, "class", "svelte-43sxxs"), L(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), L(r, "fill", "#FF7C00"), L(r, "class", "svelte-43sxxs"), Ce(l, "transform", "translate(" + /*$top*/
1003
  e[1][0] + "px, " + /*$top*/
1004
- e[1][1] + "px)"), L(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), L(a, "fill", "#FF7C00"), L(a, "fill-opacity", "0.4"), L(a, "class", "svelte-43sxxs"), L(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), L(u, "fill", "#FF7C00"), L(u, "class", "svelte-43sxxs"), L(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), L(m, "fill", "#FF7C00"), L(m, "fill-opacity", "0.4"), L(m, "class", "svelte-43sxxs"), L(h, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), L(h, "fill", "#FF7C00"), L(h, "class", "svelte-43sxxs"), Ce(o, "transform", "translate(" + /*$bottom*/
1005
  e[2][0] + "px, " + /*$bottom*/
1006
- e[2][1] + "px)"), L(n, "viewBox", "-1200 -1200 3000 3000"), L(n, "fill", "none"), L(n, "xmlns", "http://www.w3.org/2000/svg"), L(n, "class", "svelte-43sxxs"), L(t, "class", "svelte-43sxxs"), nt(
1007
  t,
1008
  "margin",
1009
  /*margin*/
1010
  e[0]
1011
  );
1012
  },
1013
- m(d, p) {
1014
- pl(d, t, p), O(t, n), O(n, l), O(l, i), O(l, s), O(l, f), O(l, r), O(n, o), O(o, a), O(o, u), O(o, m), O(o, h);
1015
  },
1016
- p(d, [p]) {
1017
- p & /*$top*/
1018
  2 && Ce(l, "transform", "translate(" + /*$top*/
1019
- d[1][0] + "px, " + /*$top*/
1020
- d[1][1] + "px)"), p & /*$bottom*/
1021
  4 && Ce(o, "transform", "translate(" + /*$bottom*/
1022
- d[2][0] + "px, " + /*$bottom*/
1023
- d[2][1] + "px)"), p & /*margin*/
1024
  1 && nt(
1025
  t,
1026
  "margin",
1027
  /*margin*/
1028
- d[0]
1029
  );
1030
  },
1031
  i: tt,
1032
  o: tt,
1033
- d(d) {
1034
- d && dl(t);
1035
  }
1036
  };
1037
  }
1038
  function vl(e, t, n) {
1039
  let l, i, { margin: s = !0 } = t;
1040
  const f = $e([0, 0]);
1041
- et(e, f, (h) => n(1, l = h));
1042
  const r = $e([0, 0]);
1043
- et(e, r, (h) => n(2, i = h));
1044
  let o;
1045
  async function a() {
1046
  await Promise.all([f.set([125, 140]), r.set([-125, -140])]), await Promise.all([f.set([-125, 140]), r.set([125, -140])]), await Promise.all([f.set([-125, 0]), r.set([125, -0])]), await Promise.all([f.set([125, 0]), r.set([-125, 0])]);
@@ -1048,16 +1048,16 @@ function vl(e, t, n) {
1048
  async function u() {
1049
  await a(), o || u();
1050
  }
1051
- async function m() {
1052
  await Promise.all([f.set([125, 0]), r.set([-125, 0])]), u();
1053
  }
1054
- return bl(() => (m(), () => o = !0)), e.$$set = (h) => {
1055
- "margin" in h && n(0, s = h.margin);
1056
  }, [s, l, i, f, r];
1057
  }
1058
  class yl extends _l {
1059
  constructor(t) {
1060
- super(), hl(this, t, vl, wl, gl, { margin: 0 });
1061
  }
1062
  }
1063
  const {
@@ -1070,7 +1070,7 @@ const {
1070
  create_slot: Al,
1071
  destroy_component: Sl,
1072
  destroy_each: Ut,
1073
- detach: A,
1074
  element: Q,
1075
  empty: de,
1076
  ensure_array_like: Ve,
@@ -1078,7 +1078,7 @@ const {
1078
  get_slot_changes: Ll,
1079
  group_outros: Zt,
1080
  init: El,
1081
- insert: S,
1082
  mount_component: ql,
1083
  noop: Ue,
1084
  safe_not_equal: Fl,
@@ -1119,7 +1119,7 @@ function zl(e) {
1119
  t = Q("span"), l = q(n), i = W(), r && r.c(), G(t, "class", "error svelte-1yserjw");
1120
  },
1121
  m(o, a) {
1122
- S(o, t, a), ne(t, l), S(o, i, a), r && r.m(o, a), s = !0;
1123
  },
1124
  p(o, a) {
1125
  (!s || a[0] & /*i18n*/
@@ -1151,7 +1151,7 @@ function zl(e) {
1151
  _e(r, o), s = !1;
1152
  },
1153
  d(o) {
1154
- o && (A(t), A(i)), r && r.d(o);
1155
  }
1156
  };
1157
  }
@@ -1162,45 +1162,45 @@ function Bl(e) {
1162
  e[18] && /*show_progress*/
1163
  e[6] === "full" && ot(e)
1164
  );
1165
- function m(g, _) {
1166
  if (
1167
  /*progress*/
1168
- g[7]
1169
  )
1170
  return Il;
1171
  if (
1172
  /*queue_position*/
1173
- g[2] !== null && /*queue_size*/
1174
- g[3] !== void 0 && /*queue_position*/
1175
- g[2] >= 0
1176
  )
1177
  return Rl;
1178
  if (
1179
  /*queue_position*/
1180
- g[2] === 0
1181
  )
1182
  return Dl;
1183
  }
1184
- let h = m(e), d = h && h(e), p = (
1185
  /*timer*/
1186
  e[5] && ut(e)
1187
  );
1188
- const b = [Hl, Zl], v = [];
1189
- function w(g, _) {
1190
  return (
1191
  /*last_progress_level*/
1192
- g[15] != null ? 0 : (
1193
  /*show_progress*/
1194
- g[6] === "full" ? 1 : -1
1195
  )
1196
  );
1197
  }
1198
- ~(s = w(e)) && (f = v[s] = b[s](e));
1199
- let k = !/*timer*/
1200
- e[5] && gt(e);
1201
  return {
1202
  c() {
1203
- u && u.c(), t = W(), n = Q("div"), d && d.c(), l = W(), p && p.c(), i = W(), f && f.c(), r = W(), k && k.c(), o = de(), G(n, "class", "progress-text svelte-1yserjw"), D(
1204
  n,
1205
  "meta-text-center",
1206
  /*variant*/
@@ -1212,41 +1212,41 @@ function Bl(e) {
1212
  e[8] === "default"
1213
  );
1214
  },
1215
- m(g, _) {
1216
- u && u.m(g, _), S(g, t, _), S(g, n, _), d && d.m(n, null), ne(n, l), p && p.m(n, null), S(g, i, _), ~s && v[s].m(g, _), S(g, r, _), k && k.m(g, _), S(g, o, _), a = !0;
1217
  },
1218
- p(g, _) {
1219
  /*variant*/
1220
- g[8] === "default" && /*show_eta_bar*/
1221
- g[18] && /*show_progress*/
1222
- g[6] === "full" ? u ? u.p(g, _) : (u = ot(g), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null), h === (h = m(g)) && d ? d.p(g, _) : (d && d.d(1), d = h && h(g), d && (d.c(), d.m(n, l))), /*timer*/
1223
- g[5] ? p ? p.p(g, _) : (p = ut(g), p.c(), p.m(n, null)) : p && (p.d(1), p = null), (!a || _[0] & /*variant*/
1224
  256) && D(
1225
  n,
1226
  "meta-text-center",
1227
  /*variant*/
1228
- g[8] === "center"
1229
- ), (!a || _[0] & /*variant*/
1230
  256) && D(
1231
  n,
1232
  "meta-text",
1233
  /*variant*/
1234
- g[8] === "default"
1235
  );
1236
- let C = s;
1237
- s = w(g), s === C ? ~s && v[s].p(g, _) : (f && (Zt(), _e(v[C], 1, 1, () => {
1238
- v[C] = null;
1239
- }), Ot()), ~s ? (f = v[s], f ? f.p(g, _) : (f = v[s] = b[s](g), f.c()), ce(f, 1), f.m(r.parentNode, r)) : f = null), /*timer*/
1240
- g[5] ? k && (k.d(1), k = null) : k ? k.p(g, _) : (k = gt(g), k.c(), k.m(o.parentNode, o));
1241
  },
1242
- i(g) {
1243
  a || (ce(f), a = !0);
1244
  },
1245
- o(g) {
1246
  _e(f), a = !1;
1247
  },
1248
- d(g) {
1249
- g && (A(t), A(n), A(i), A(r), A(o)), u && u.d(g), d && d.d(), p && p.d(), ~s && v[s].d(g), k && k.d(g);
1250
  }
1251
  };
1252
  }
@@ -1258,7 +1258,7 @@ function ot(e) {
1258
  t = Q("div"), G(t, "class", "eta-bar svelte-1yserjw"), ee(t, "transform", n);
1259
  },
1260
  m(l, i) {
1261
- S(l, t, i);
1262
  },
1263
  p(l, i) {
1264
  i[0] & /*eta_level*/
@@ -1266,7 +1266,7 @@ function ot(e) {
1266
  (l[17] || 0) * 100 - 100}%)`) && ee(t, "transform", n);
1267
  },
1268
  d(l) {
1269
- l && A(t);
1270
  }
1271
  };
1272
  }
@@ -1277,11 +1277,11 @@ function Dl(e) {
1277
  t = q("processing |");
1278
  },
1279
  m(n, l) {
1280
- S(n, t, l);
1281
  },
1282
  p: Ue,
1283
  d(n) {
1284
- n && A(t);
1285
  }
1286
  };
1287
  }
@@ -1298,7 +1298,7 @@ function Rl(e) {
1298
  ), f = q(" |");
1299
  },
1300
  m(r, o) {
1301
- S(r, t, o), S(r, l, o), S(r, i, o), S(r, s, o), S(r, f, o);
1302
  },
1303
  p(r, o) {
1304
  o[0] & /*queue_position*/
@@ -1311,7 +1311,7 @@ function Rl(e) {
1311
  );
1312
  },
1313
  d(r) {
1314
- r && (A(t), A(l), A(i), A(s), A(f));
1315
  }
1316
  };
1317
  }
@@ -1331,7 +1331,7 @@ function Il(e) {
1331
  m(i, s) {
1332
  for (let f = 0; f < l.length; f += 1)
1333
  l[f] && l[f].m(i, s);
1334
- S(i, t, s);
1335
  },
1336
  p(i, s) {
1337
  if (s[0] & /*progress*/
@@ -1351,7 +1351,7 @@ function Il(e) {
1351
  }
1352
  },
1353
  d(i) {
1354
- i && A(t), Ut(l, i);
1355
  }
1356
  };
1357
  }
@@ -1360,7 +1360,7 @@ function ft(e) {
1360
  /*p*/
1361
  e[38].unit + ""
1362
  ), l, i, s = " ", f;
1363
- function r(u, m) {
1364
  return (
1365
  /*p*/
1366
  u[38].length != null ? Ul : Ol
@@ -1371,16 +1371,16 @@ function ft(e) {
1371
  c() {
1372
  a.c(), t = W(), l = q(n), i = q(" | "), f = q(s);
1373
  },
1374
- m(u, m) {
1375
- a.m(u, m), S(u, t, m), S(u, l, m), S(u, i, m), S(u, f, m);
1376
  },
1377
- p(u, m) {
1378
- o === (o = r(u)) && a ? a.p(u, m) : (a.d(1), a = o(u), a && (a.c(), a.m(t.parentNode, t))), m[0] & /*progress*/
1379
  128 && n !== (n = /*p*/
1380
  u[38].unit + "") && R(l, n);
1381
  },
1382
  d(u) {
1383
- u && (A(t), A(l), A(i), A(f)), a.d(u);
1384
  }
1385
  };
1386
  }
@@ -1394,7 +1394,7 @@ function Ol(e) {
1394
  n = q(t);
1395
  },
1396
  m(l, i) {
1397
- S(l, n, i);
1398
  },
1399
  p(l, i) {
1400
  i[0] & /*progress*/
@@ -1404,7 +1404,7 @@ function Ol(e) {
1404
  ) + "") && R(n, t);
1405
  },
1406
  d(l) {
1407
- l && A(n);
1408
  }
1409
  };
1410
  }
@@ -1421,7 +1421,7 @@ function Ul(e) {
1421
  n = q(t), l = q("/"), s = q(i);
1422
  },
1423
  m(f, r) {
1424
- S(f, n, r), S(f, l, r), S(f, s, r);
1425
  },
1426
  p(f, r) {
1427
  r[0] & /*progress*/
@@ -1435,7 +1435,7 @@ function Ul(e) {
1435
  ) + "") && R(s, i);
1436
  },
1437
  d(f) {
1438
- f && (A(n), A(l), A(s));
1439
  }
1440
  };
1441
  }
@@ -1449,14 +1449,14 @@ function at(e) {
1449
  n && n.c(), t = de();
1450
  },
1451
  m(l, i) {
1452
- n && n.m(l, i), S(l, t, i);
1453
  },
1454
  p(l, i) {
1455
  /*p*/
1456
  l[38].index != null ? n ? n.p(l, i) : (n = ft(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
1457
  },
1458
  d(l) {
1459
- l && A(t), n && n.d(l);
1460
  }
1461
  };
1462
  }
@@ -1474,7 +1474,7 @@ function ut(e) {
1474
  ), l = q(n), i = q("s");
1475
  },
1476
  m(s, f) {
1477
- S(s, t, f), S(s, l, f), S(s, i, f);
1478
  },
1479
  p(s, f) {
1480
  f[0] & /*formatted_timer*/
@@ -1488,7 +1488,7 @@ function ut(e) {
1488
  s[19]}` : "") && R(l, n);
1489
  },
1490
  d(s) {
1491
- s && (A(t), A(l), A(i));
1492
  }
1493
  };
1494
  }
@@ -1534,7 +1534,7 @@ function Hl(e) {
1534
  t = Q("div"), n = Q("div"), r && r.c(), l = W(), i = Q("div"), s = Q("div"), G(n, "class", "progress-level-inner svelte-1yserjw"), G(s, "class", "progress-bar svelte-1yserjw"), ee(s, "width", f), G(i, "class", "progress-bar-wrap svelte-1yserjw"), G(t, "class", "progress-level svelte-1yserjw");
1535
  },
1536
  m(o, a) {
1537
- S(o, t, a), ne(t, n), r && r.m(n, null), ne(t, l), ne(t, i), ne(i, s), e[30](s);
1538
  },
1539
  p(o, a) {
1540
  /*progress*/
@@ -1545,7 +1545,7 @@ function Hl(e) {
1545
  i: Ue,
1546
  o: Ue,
1547
  d(o) {
1548
- o && A(t), r && r.d(), e[30](null);
1549
  }
1550
  };
1551
  }
@@ -1555,7 +1555,7 @@ function ct(e) {
1555
  e[7]
1556
  ), l = [];
1557
  for (let i = 0; i < n.length; i += 1)
1558
- l[i] = pt(st(e, n, i));
1559
  return {
1560
  c() {
1561
  for (let i = 0; i < l.length; i += 1)
@@ -1565,7 +1565,7 @@ function ct(e) {
1565
  m(i, s) {
1566
  for (let f = 0; f < l.length; f += 1)
1567
  l[f] && l[f].m(i, s);
1568
- S(i, t, s);
1569
  },
1570
  p(i, s) {
1571
  if (s[0] & /*progress_level, progress*/
@@ -1577,7 +1577,7 @@ function ct(e) {
1577
  let f;
1578
  for (f = 0; f < n.length; f += 1) {
1579
  const r = st(i, n, f);
1580
- l[f] ? l[f].p(r, s) : (l[f] = pt(r), l[f].c(), l[f].m(t.parentNode, t));
1581
  }
1582
  for (; f < l.length; f += 1)
1583
  l[f].d(1);
@@ -1585,7 +1585,7 @@ function ct(e) {
1585
  }
1586
  },
1587
  d(i) {
1588
- i && A(t), Ut(l, i);
1589
  }
1590
  };
1591
  }
@@ -1613,7 +1613,7 @@ function _t(e) {
1613
  s && s.c(), t = W(), f && f.c(), n = W(), r && r.c(), l = W(), o && o.c(), i = de();
1614
  },
1615
  m(a, u) {
1616
- s && s.m(a, u), S(a, t, u), f && f.m(a, u), S(a, n, u), r && r.m(a, u), S(a, l, u), o && o.m(a, u), S(a, i, u);
1617
  },
1618
  p(a, u) {
1619
  /*p*/
@@ -1627,7 +1627,7 @@ function _t(e) {
1627
  a[14] != null ? o ? o.p(a, u) : (o = ht(a), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
1628
  },
1629
  d(a) {
1630
- a && (A(t), A(n), A(l), A(i)), s && s.d(a), f && f.d(a), r && r.d(a), o && o.d(a);
1631
  }
1632
  };
1633
  }
@@ -1638,10 +1638,10 @@ function Xl(e) {
1638
  t = q(" /");
1639
  },
1640
  m(n, l) {
1641
- S(n, t, l);
1642
  },
1643
  d(n) {
1644
- n && A(t);
1645
  }
1646
  };
1647
  }
@@ -1655,7 +1655,7 @@ function dt(e) {
1655
  n = q(t);
1656
  },
1657
  m(l, i) {
1658
- S(l, n, i);
1659
  },
1660
  p(l, i) {
1661
  i[0] & /*progress*/
@@ -1663,7 +1663,7 @@ function dt(e) {
1663
  l[38].desc + "") && R(n, t);
1664
  },
1665
  d(l) {
1666
- l && A(n);
1667
  }
1668
  };
1669
  }
@@ -1674,10 +1674,10 @@ function mt(e) {
1674
  t = q("-");
1675
  },
1676
  m(n, l) {
1677
- S(n, t, l);
1678
  },
1679
  d(n) {
1680
- n && A(t);
1681
  }
1682
  };
1683
  }
@@ -1692,7 +1692,7 @@ function ht(e) {
1692
  n = q(t), l = q("%");
1693
  },
1694
  m(i, s) {
1695
- S(i, n, s), S(i, l, s);
1696
  },
1697
  p(i, s) {
1698
  s[0] & /*progress_level*/
@@ -1703,11 +1703,11 @@ function ht(e) {
1703
  ] || 0)).toFixed(1) + "") && R(n, t);
1704
  },
1705
  d(i) {
1706
- i && (A(n), A(l));
1707
  }
1708
  };
1709
  }
1710
- function pt(e) {
1711
  let t, n = (
1712
  /*p*/
1713
  (e[38].desc != null || /*progress_level*/
@@ -1722,7 +1722,7 @@ function pt(e) {
1722
  n && n.c(), t = de();
1723
  },
1724
  m(l, i) {
1725
- n && n.m(l, i), S(l, t, i);
1726
  },
1727
  p(l, i) {
1728
  /*p*/
@@ -1734,11 +1734,11 @@ function pt(e) {
1734
  ] != null ? n ? n.p(l, i) : (n = _t(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
1735
  },
1736
  d(l) {
1737
- l && A(t), n && n.d(l);
1738
  }
1739
  };
1740
  }
1741
- function gt(e) {
1742
  let t, n;
1743
  return {
1744
  c() {
@@ -1748,7 +1748,7 @@ function gt(e) {
1748
  ), G(t, "class", "loading svelte-1yserjw");
1749
  },
1750
  m(l, i) {
1751
- S(l, t, i), ne(t, n);
1752
  },
1753
  p(l, i) {
1754
  i[0] & /*loading_text*/
@@ -1759,7 +1759,7 @@ function gt(e) {
1759
  );
1760
  },
1761
  d(l) {
1762
- l && A(t);
1763
  }
1764
  };
1765
  }
@@ -1814,12 +1814,12 @@ function Yl(e) {
1814
  );
1815
  },
1816
  m(a, u) {
1817
- S(a, t, u), ~n && r[n].m(t, null), e[31](t), s = !0;
1818
  },
1819
  p(a, u) {
1820
- let m = n;
1821
- n = o(a), n === m ? ~n && r[n].p(a, u) : (l && (Zt(), _e(r[m], 1, 1, () => {
1822
- r[m] = null;
1823
  }), Ot()), ~n ? (l = r[n], l ? l.p(a, u) : (l = r[n] = f[n](a), l.c()), ce(l, 1), l.m(t, null)) : l = null), (!s || u[0] & /*variant, show_progress*/
1824
  320 && i !== (i = "wrap " + /*variant*/
1825
  a[8] + " " + /*show_progress*/
@@ -1870,7 +1870,7 @@ function Yl(e) {
1870
  _e(l), s = !1;
1871
  },
1872
  d(a) {
1873
- a && A(t), ~n && r[n].d(), e[31](null);
1874
  }
1875
  };
1876
  }
@@ -1892,47 +1892,47 @@ async function Kl(e, t = !0) {
1892
  }
1893
  }
1894
  function Gl(e, t, n) {
1895
- let l, { $$slots: i = {}, $$scope: s } = t, { i18n: f } = t, { eta: r = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: u } = t, { scroll_to_output: m = !1 } = t, { timer: h = !0 } = t, { show_progress: d = "full" } = t, { message: p = null } = t, { progress: b = null } = t, { variant: v = "default" } = t, { loading_text: w = "Loading..." } = t, { absolute: k = !0 } = t, { translucent: g = !1 } = t, { border: _ = !1 } = t, { autoscroll: C } = t, c, E = !1, N = 0, F = 0, T = null, M = null, me = 0, H = null, X, Y = null, le = !0;
1896
  const ye = () => {
1897
- n(0, r = n(26, T = n(19, j = null))), n(24, N = performance.now()), n(25, F = 0), E = !0, ke();
1898
  };
1899
  function ke() {
1900
  requestAnimationFrame(() => {
1901
- n(25, F = (performance.now() - N) / 1e3), E && ke();
1902
  });
1903
  }
1904
  function he() {
1905
- n(25, F = 0), n(0, r = n(26, T = n(19, j = null))), E && (E = !1);
1906
  }
1907
  Vl(() => {
1908
- E && he();
1909
  });
1910
  let j = null;
1911
- function sn(y) {
1912
- lt[y ? "unshift" : "push"](() => {
1913
- Y = y, n(16, Y), n(7, b), n(14, H), n(15, X);
1914
  });
1915
  }
1916
- function rn(y) {
1917
- lt[y ? "unshift" : "push"](() => {
1918
- c = y, n(13, c);
1919
  });
1920
  }
1921
- return e.$$set = (y) => {
1922
- "i18n" in y && n(1, f = y.i18n), "eta" in y && n(0, r = y.eta), "queue_position" in y && n(2, o = y.queue_position), "queue_size" in y && n(3, a = y.queue_size), "status" in y && n(4, u = y.status), "scroll_to_output" in y && n(21, m = y.scroll_to_output), "timer" in y && n(5, h = y.timer), "show_progress" in y && n(6, d = y.show_progress), "message" in y && n(22, p = y.message), "progress" in y && n(7, b = y.progress), "variant" in y && n(8, v = y.variant), "loading_text" in y && n(9, w = y.loading_text), "absolute" in y && n(10, k = y.absolute), "translucent" in y && n(11, g = y.translucent), "border" in y && n(12, _ = y.border), "autoscroll" in y && n(23, C = y.autoscroll), "$$scope" in y && n(28, s = y.$$scope);
1923
  }, e.$$.update = () => {
1924
  e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
1925
- 218103809 && (r === null && n(0, r = T), r != null && T !== r && (n(27, M = (performance.now() - N) / 1e3 + r), n(19, j = M.toFixed(1)), n(26, T = r))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/
1926
  167772160 && n(17, me = M === null || M <= 0 || !F ? null : Math.min(F / M, 1)), e.$$.dirty[0] & /*progress*/
1927
- 128 && b != null && n(18, le = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1928
- 114816 && (b != null ? n(14, H = b.map((y) => {
1929
- if (y.index != null && y.length != null)
1930
- return y.index / y.length;
1931
- if (y.progress != null)
1932
- return y.progress;
1933
  })) : n(14, H = null), H ? (n(15, X = H[H.length - 1]), Y && (X === 0 ? n(16, Y.style.transition = "0", Y) : n(16, Y.style.transition = "150ms", Y))) : n(15, X = void 0)), e.$$.dirty[0] & /*status*/
1934
  16 && (u === "pending" ? ye() : he()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1935
- 10493968 && c && m && (u === "pending" || u === "complete") && Kl(c, C), e.$$.dirty[0] & /*status, message*/
1936
  4194320, e.$$.dirty[0] & /*timer_diff*/
1937
  33554432 && n(20, l = F.toFixed(1));
1938
  }, [
@@ -1941,15 +1941,15 @@ function Gl(e, t, n) {
1941
  o,
1942
  a,
1943
  u,
1944
- h,
1945
- d,
1946
- b,
1947
- v,
1948
- w,
1949
- k,
1950
- g,
1951
  _,
 
 
 
 
 
1952
  c,
 
1953
  H,
1954
  X,
1955
  Y,
@@ -1957,10 +1957,10 @@ function Gl(e, t, n) {
1957
  le,
1958
  j,
1959
  l,
1960
- m,
1961
- p,
1962
- C,
1963
- N,
1964
  F,
1965
  T,
1966
  M,
@@ -2175,7 +2175,7 @@ function mi(e) {
2175
  function hi(e) {
2176
  return this.selectAll(e == null ? di : mi(typeof e == "function" ? e : Gt(e)));
2177
  }
2178
- function pi(e) {
2179
  typeof e != "function" && (e = oi(e));
2180
  for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
2181
  for (var s = t[i], f = s.length, r = l[i] = [], o, a = 0; a < f; ++a)
@@ -2185,7 +2185,7 @@ function pi(e) {
2185
  function Wt(e) {
2186
  return new Array(e.length);
2187
  }
2188
- function gi() {
2189
  return new I(this._enter || this._groups.map(Wt), this._parents);
2190
  }
2191
  function Te(e, t) {
@@ -2218,13 +2218,13 @@ function wi(e, t, n, l, i, s) {
2218
  (r = t[f]) && (i[f] = r);
2219
  }
2220
  function vi(e, t, n, l, i, s, f) {
2221
- var r, o, a = /* @__PURE__ */ new Map(), u = t.length, m = s.length, h = new Array(u), d;
2222
  for (r = 0; r < u; ++r)
2223
- (o = t[r]) && (h[r] = d = f.call(o, o.__data__, r, t) + "", a.has(d) ? i[r] = o : a.set(d, o));
2224
- for (r = 0; r < m; ++r)
2225
- d = f.call(e, s[r], r, s) + "", (o = a.get(d)) ? (l[r] = o, o.__data__ = s[r], a.delete(d)) : n[r] = new Te(e, s[r]);
2226
  for (r = 0; r < u; ++r)
2227
- (o = t[r]) && a.get(h[r]) === o && (i[r] = o);
2228
  }
2229
  function yi(e) {
2230
  return e.__data__;
@@ -2235,13 +2235,13 @@ function ki(e, t) {
2235
  var n = t ? vi : wi, l = this._parents, i = this._groups;
2236
  typeof e != "function" && (e = bi(e));
2237
  for (var s = i.length, f = new Array(s), r = new Array(s), o = new Array(s), a = 0; a < s; ++a) {
2238
- var u = l[a], m = i[a], h = m.length, d = Ci(e.call(u, u && u.__data__, a, l)), p = d.length, b = r[a] = new Array(p), v = f[a] = new Array(p), w = o[a] = new Array(h);
2239
- n(u, m, b, v, w, d, t);
2240
- for (var k = 0, g = 0, _, C; k < p; ++k)
2241
- if (_ = b[k]) {
2242
- for (k >= g && (g = k + 1); !(C = v[g]) && ++g < p; )
2243
  ;
2244
- _._next = C || null;
2245
  }
2246
  }
2247
  return f = new I(f, l), f._enter = r, f._exit = o, f;
@@ -2258,8 +2258,8 @@ function Si(e, t, n) {
2258
  }
2259
  function Ni(e) {
2260
  for (var t = e.selection ? e.selection() : e, n = this._groups, l = t._groups, i = n.length, s = l.length, f = Math.min(i, s), r = new Array(i), o = 0; o < f; ++o)
2261
- for (var a = n[o], u = l[o], m = a.length, h = r[o] = new Array(m), d, p = 0; p < m; ++p)
2262
- (d = a[p] || u[p]) && (h[p] = d);
2263
  for (; o < i; ++o)
2264
  r[o] = n[o];
2265
  return new I(r, this._parents);
@@ -2272,8 +2272,8 @@ function Li() {
2272
  }
2273
  function Ei(e) {
2274
  e || (e = qi);
2275
- function t(m, h) {
2276
- return m && h ? e(m.__data__, h.__data__) : !m - !h;
2277
  }
2278
  for (var n = this._groups, l = n.length, i = new Array(l), s = 0; s < l; ++s) {
2279
  for (var f = n[s], r = f.length, o = i[s] = new Array(r), a, u = 0; u < r; ++u)
@@ -2510,18 +2510,18 @@ function ms(e) {
2510
  function hs() {
2511
  return null;
2512
  }
2513
- function ps(e, t) {
2514
  var n = typeof e == "function" ? e : Yt(e), l = t == null ? hs : typeof t == "function" ? t : Kt(t);
2515
  return this.select(function() {
2516
  return this.insertBefore(n.apply(this, arguments), l.apply(this, arguments) || null);
2517
  });
2518
  }
2519
- function gs() {
2520
  var e = this.parentNode;
2521
  e && e.removeChild(this);
2522
  }
2523
  function bs() {
2524
- return this.each(gs);
2525
  }
2526
  function ws() {
2527
  var e = this.cloneNode(!1), t = this.parentNode;
@@ -2622,9 +2622,9 @@ I.prototype = {
2622
  selectAll: ri,
2623
  selectChild: ci,
2624
  selectChildren: hi,
2625
- filter: pi,
2626
  data: ki,
2627
- enter: gi,
2628
  exit: Ai,
2629
  join: Si,
2630
  merge: Ni,
@@ -2646,7 +2646,7 @@ I.prototype = {
2646
  raise: cs,
2647
  lower: ds,
2648
  append: ms,
2649
- insert: ps,
2650
  remove: bs,
2651
  clone: ys,
2652
  datum: ks,
@@ -2738,78 +2738,78 @@ function Us() {
2738
  return navigator.maxTouchPoints || "ontouchstart" in this;
2739
  }
2740
  function Zs() {
2741
- var e = Rs, t = Is, n = Os, l = Us, i = {}, s = Ht("start", "drag", "end"), f = 0, r, o, a, u, m = 0;
2742
- function h(_) {
2743
- _.on("mousedown.drag", d).filter(l).on("touchstart.drag", v).on("touchmove.drag", w, zs).on("touchend.drag touchcancel.drag", k).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2744
- }
2745
- function d(_, C) {
2746
- if (!(u || !e.call(this, _, C))) {
2747
- var c = g(this, t.call(this, _, C), _, C, "mouse");
2748
- c && (we(_.view).on("mousemove.drag", p, ve).on("mouseup.drag", b, ve), Bs(_.view), Ie(_), a = !1, r = _.clientX, o = _.clientY, c("start", _));
2749
  }
2750
  }
2751
- function p(_) {
2752
- if (ue(_), !a) {
2753
- var C = _.clientX - r, c = _.clientY - o;
2754
- a = C * C + c * c > m;
2755
  }
2756
- i.mouse("drag", _);
2757
  }
2758
- function b(_) {
2759
- we(_.view).on("mousemove.drag mouseup.drag", null), Ds(_.view, a), ue(_), i.mouse("end", _);
2760
  }
2761
- function v(_, C) {
2762
- if (e.call(this, _, C)) {
2763
- var c = _.changedTouches, E = t.call(this, _, C), N = c.length, F, T;
2764
- for (F = 0; F < N; ++F)
2765
- (T = g(this, E, _, C, c[F].identifier, c[F])) && (Ie(_), T("start", _, c[F]));
2766
  }
2767
  }
2768
- function w(_) {
2769
- var C = _.changedTouches, c = C.length, E, N;
2770
- for (E = 0; E < c; ++E)
2771
- (N = i[C[E].identifier]) && (ue(_), N("drag", _, C[E]));
2772
  }
2773
- function k(_) {
2774
- var C = _.changedTouches, c = C.length, E, N;
2775
  for (u && clearTimeout(u), u = setTimeout(function() {
2776
  u = null;
2777
- }, 500), E = 0; E < c; ++E)
2778
- (N = i[C[E].identifier]) && (Ie(_), N("end", _, C[E]));
2779
- }
2780
- function g(_, C, c, E, N, F) {
2781
- var T = s.copy(), M = vt(F || c, C), me, H, X;
2782
- if ((X = n.call(_, new He("beforestart", {
2783
- sourceEvent: c,
2784
- target: h,
2785
- identifier: N,
2786
  active: f,
2787
  x: M[0],
2788
  y: M[1],
2789
  dx: 0,
2790
  dy: 0,
2791
  dispatch: T
2792
- }), E)) != null)
2793
  return me = X.x - M[0] || 0, H = X.y - M[1] || 0, function Y(le, ye, ke) {
2794
  var he = M, j;
2795
  switch (le) {
2796
  case "start":
2797
- i[N] = Y, j = f++;
2798
  break;
2799
  case "end":
2800
- delete i[N], --f;
2801
  case "drag":
2802
- M = vt(ke || ye, C), j = f;
2803
  break;
2804
  }
2805
  T.call(
2806
  le,
2807
- _,
2808
  new He(le, {
2809
  sourceEvent: ye,
2810
  subject: X,
2811
- target: h,
2812
- identifier: N,
2813
  active: j,
2814
  x: M[0] + me,
2815
  y: M[1] + H,
@@ -2817,24 +2817,24 @@ function Zs() {
2817
  dy: M[1] - he[1],
2818
  dispatch: T
2819
  }),
2820
- E
2821
  );
2822
  };
2823
  }
2824
- return h.filter = function(_) {
2825
- return arguments.length ? (e = typeof _ == "function" ? _ : Se(!!_), h) : e;
2826
- }, h.container = function(_) {
2827
- return arguments.length ? (t = typeof _ == "function" ? _ : Se(_), h) : t;
2828
- }, h.subject = function(_) {
2829
- return arguments.length ? (n = typeof _ == "function" ? _ : Se(_), h) : n;
2830
- }, h.touchable = function(_) {
2831
- return arguments.length ? (l = typeof _ == "function" ? _ : Se(!!_), h) : l;
2832
- }, h.on = function() {
2833
- var _ = s.on.apply(s, arguments);
2834
- return _ === s ? h : _;
2835
- }, h.clickDistance = function(_) {
2836
- return arguments.length ? (m = (_ = +_) * _, h) : Math.sqrt(m);
2837
- }, h;
2838
  }
2839
  const {
2840
  SvelteComponent: Hs,
@@ -2915,38 +2915,38 @@ function dr(e) {
2915
  let t, n, l, i, s, f, r, o, a = (
2916
  /*prompt*/
2917
  e[0].scale.toFixed(1) + ""
2918
- ), u, m, h, d, p, b, v, w, k, g, _, C;
2919
- return w = new js({}), {
2920
  c() {
2921
- t = Z("div"), n = Z("div"), l = Z("div"), i = Z("div"), s = Z("div"), f = Z("span"), r = Z("span"), o = Z("span"), u = fr(a), m = Nt(), h = Z("div"), d = Z("input"), b = Nt(), v = Z("button"), $s(w.$$.fragment), V(o, "class", "text-black svelte-1wmphae"), V(r, "class", "text-black svelte-1wmphae"), V(f, "class", "flex text-[0.5rem] font-mono text-black dark:group-hover:text-white svelte-1wmphae"), V(s, "class", "bottom-full p-1 svelte-1wmphae"), V(i, "class", "relative svelte-1wmphae"), V(l, "class", "absolute z-10 flex items-center justify-center w-[2.5em] svelte-1wmphae"), V(d, "type", "text"), V(d, "placeholder", "Prompt"), V(d, "class", p = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
2922
- (e[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae"), St(d, "width", "calc(" + Math.max(
2923
  14,
2924
  /*prompt*/
2925
  e[0].prompt.length + 1
2926
- ) + "ch + 2em) "), V(h, "class", "relative flex z-0 svelte-1wmphae"), V(v, "class", "absolute z-1 right-1 text text-black hover:text-red-500 invisible group-hover:visible svelte-1wmphae"), V(v, "title", "Remove prompt"), V(n, "class", k = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
2927
  (e[1] || /*isHovering*/
2928
  e[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae"), V(t, "class", "w-min flex flex-col group relative svelte-1wmphae");
2929
  },
2930
- m(c, E) {
2931
- lr(c, t, E), B(t, n), B(n, l), B(l, i), B(i, s), B(s, f), B(f, r), B(r, o), B(o, u), B(n, m), B(n, h), B(h, d), e[10](d), At(
2932
- d,
2933
  /*prompt*/
2934
  e[0].prompt
2935
- ), B(n, b), B(n, v), ir(w, v, null), e[13](t), g = !0, _ || (C = [
2936
  J(
2937
- d,
2938
  "keypress",
2939
  /*onKeyPress*/
2940
  e[6]
2941
  ),
2942
  J(
2943
- d,
2944
  "input",
2945
  /*input_input_handler*/
2946
  e[11]
2947
  ),
2948
  J(
2949
- v,
2950
  "click",
2951
  /*click_handler*/
2952
  e[12]
@@ -2987,75 +2987,75 @@ function dr(e) {
2987
  /*pointerenter_handler_1*/
2988
  e[19]
2989
  )
2990
- ], _ = !0);
2991
  },
2992
- p(c, [E]) {
2993
- (!g || E & /*prompt*/
2994
  1) && a !== (a = /*prompt*/
2995
- c[0].scale.toFixed(1) + "") && or(u, a), (!g || E & /*prompt*/
2996
- 1 && p !== (p = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
2997
- (c[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae")) && V(d, "class", p), (!g || E & /*prompt*/
2998
- 1) && St(d, "width", "calc(" + Math.max(
2999
  14,
3000
  /*prompt*/
3001
- c[0].prompt.length + 1
3002
- ) + "ch + 2em) "), E & /*prompt*/
3003
- 1 && d.value !== /*prompt*/
3004
- c[0].prompt && At(
3005
- d,
3006
  /*prompt*/
3007
- c[0].prompt
3008
- ), (!g || E & /*isDragging, isHovering*/
3009
- 10 && k !== (k = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
3010
- (c[1] || /*isHovering*/
3011
- c[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae")) && V(n, "class", k);
3012
  },
3013
- i(c) {
3014
- g || (ar(w.$$.fragment, c), g = !0);
3015
  },
3016
- o(c) {
3017
- ur(w.$$.fragment, c), g = !1;
3018
  },
3019
- d(c) {
3020
- c && tr(t), e[10](null), er(w), e[13](null), _ = !1, sr(C);
3021
  }
3022
  };
3023
  }
3024
  function mr(e, t, n) {
3025
  let { prompt: l } = t, { min: i = 0 } = t, { max: s = 2 } = t, { step: f = 0.01 } = t, r, o = !1, a = !1;
3026
  const u = _r();
3027
- let m = 0, h;
3028
  cr(() => {
3029
- const N = Zs().on("start", (F) => {
3030
- m = l.scale, n(1, o = !0);
3031
  }).on("drag", (F) => {
3032
  const { dx: T, dy: M } = F;
3033
- m -= M * f, m = Math.min(m, s), m = Math.max(m, i), n(0, l.scale = m, l);
3034
  }).on("end", (F) => {
3035
  n(1, o = !1);
3036
  });
3037
- we(h).call(N), r.focus();
3038
  });
3039
- function d(N) {
3040
- N.key === "Enter" && u("add");
3041
  }
3042
- function p(N) {
3043
- Ct[N ? "unshift" : "push"](() => {
3044
- r = N, n(2, r);
3045
  });
3046
  }
3047
- function b() {
3048
  l.prompt = this.value, n(0, l);
3049
  }
3050
- const v = () => u("remove");
3051
- function w(N) {
3052
- Ct[N ? "unshift" : "push"](() => {
3053
- h = N, n(4, h);
3054
  });
3055
  }
3056
- const k = () => n(3, a = !0), g = () => n(3, a = !1), _ = () => n(3, a = !1), C = () => n(3, a = !0), c = () => n(3, a = !1), E = () => n(3, a = !0);
3057
- return e.$$set = (N) => {
3058
- "prompt" in N && n(0, l = N.prompt), "min" in N && n(7, i = N.min), "max" in N && n(8, s = N.max), "step" in N && n(9, f = N.step);
3059
  }, e.$$.update = () => {
3060
  e.$$.dirty & /*isDragging*/
3061
  2 && (o ? document.body.classList.add("grabbing") : document.body.classList.remove("grabbing"));
@@ -3064,22 +3064,22 @@ function mr(e, t, n) {
3064
  o,
3065
  r,
3066
  a,
3067
- h,
3068
  u,
3069
- d,
3070
  i,
3071
  s,
3072
  f,
3073
- p,
3074
- b,
3075
- v,
3076
- w,
3077
- k,
3078
  g,
3079
- _,
 
 
3080
  C,
 
3081
  c,
3082
- E
 
 
3083
  ];
3084
  }
3085
  class hr extends xs {
@@ -3088,8 +3088,8 @@ class hr extends xs {
3088
  }
3089
  }
3090
  const {
3091
- SvelteComponent: pr,
3092
- append: gr,
3093
  attr: $,
3094
  detach: br,
3095
  init: wr,
@@ -3110,7 +3110,7 @@ function kr(e) {
3110
  );
3111
  },
3112
  m(l, i) {
3113
- vr(l, t, i), gr(t, n);
3114
  },
3115
  p(l, [i]) {
3116
  i & /*classNames*/
@@ -3134,7 +3134,7 @@ function Cr(e, t, n) {
3134
  "classNames" in i && n(0, l = i.classNames);
3135
  }, [l];
3136
  }
3137
- class Ar extends pr {
3138
  constructor(t) {
3139
  super(), wr(this, t, Cr, kr, yr, { classNames: 0 });
3140
  }
@@ -3142,7 +3142,7 @@ class Ar extends pr {
3142
  const {
3143
  SvelteComponent: Sr,
3144
  add_flush_callback: Nr,
3145
- append: pe,
3146
  attr: re,
3147
  bind: Lr,
3148
  binding_callbacks: Er,
@@ -3243,95 +3243,95 @@ function Pt(e) {
3243
  );
3244
  }
3245
  function Rr(e) {
3246
- let t, n, l, i, s, f, r, o, a, u, m, h = qt(
3247
  /*promptsList*/
3248
  e[0]
3249
- ), d = [];
3250
- for (let b = 0; b < h.length; b += 1)
3251
- d[b] = Pt(Mt(e, h, b));
3252
- const p = (b) => Pe(d[b], 1, 1, () => {
3253
- d[b] = null;
3254
  });
3255
  return s = new Ar({}), {
3256
  c() {
3257
  t = Ne("div");
3258
- for (let b = 0; b < d.length; b += 1)
3259
- d[b].c();
3260
  n = Ft(), l = Ne("div"), i = Ne("button"), tn(s.$$.fragment), f = Ft(), r = Ne("h2"), r.textContent = "Add Prompt", re(r, "class", "text-xs font-normal px-1 svelte-9vwpr1"), re(i, "title", "Add Concept"), re(i, "class", "flex items-center text-base text-black hover-text-cyan-500 dark:text-white svelte-9vwpr1"), re(l, "class", "flex flex-col gap-1 svelte-9vwpr1"), re(t, "class", o = "flex items-center gap-1 flex-wrap " + /*classNames*/
3261
  e[1] + " svelte-9vwpr1");
3262
  },
3263
- m(b, v) {
3264
- Tr(b, t, v);
3265
- for (let w = 0; w < d.length; w += 1)
3266
- d[w] && d[w].m(t, null);
3267
- pe(t, n), pe(t, l), pe(l, i), ln(s, i, null), pe(i, f), pe(i, r), a = !0, u || (m = zr(
3268
  i,
3269
  "click",
3270
  /*click_handler*/
3271
  e[10]
3272
  ), u = !0);
3273
  },
3274
- p(b, [v]) {
3275
- if (v & /*min, max, step, promptsList, removeConcept, addPrompt*/
3276
  125) {
3277
- h = qt(
3278
  /*promptsList*/
3279
- b[0]
3280
  );
3281
- let w;
3282
- for (w = 0; w < h.length; w += 1) {
3283
- const k = Mt(b, h, w);
3284
- d[w] ? (d[w].p(k, v), be(d[w], 1)) : (d[w] = Pt(k), d[w].c(), be(d[w], 1), d[w].m(t, n));
3285
  }
3286
- for (Pr(), w = h.length; w < d.length; w += 1)
3287
- p(w);
3288
  qr();
3289
  }
3290
- (!a || v & /*classNames*/
3291
  2 && o !== (o = "flex items-center gap-1 flex-wrap " + /*classNames*/
3292
- b[1] + " svelte-9vwpr1")) && re(t, "class", o);
3293
  },
3294
- i(b) {
3295
  if (!a) {
3296
- for (let v = 0; v < h.length; v += 1)
3297
- be(d[v]);
3298
- be(s.$$.fragment, b), a = !0;
3299
  }
3300
  },
3301
- o(b) {
3302
- d = d.filter(Boolean);
3303
- for (let v = 0; v < d.length; v += 1)
3304
- Pe(d[v]);
3305
- Pe(s.$$.fragment, b), a = !1;
3306
  },
3307
- d(b) {
3308
- b && Mr(t), Fr(d, b), nn(s), u = !1, m();
3309
  }
3310
  };
3311
  }
3312
  function Ir(e, t, n) {
3313
  let { classNames: l = "" } = t, { promptsList: i = [] } = t, { min: s } = t, { max: f } = t, { step: r } = t;
3314
- function o(p) {
3315
- n(0, i = i.filter((b) => b.id !== p.id));
3316
  }
3317
- function a(p = !1) {
3318
  n(0, i = [
3319
  ...i,
3320
  {
3321
  id: fn(),
3322
  prompt: "",
3323
  scale: 1,
3324
- negative: p
3325
  }
3326
  ]);
3327
  }
3328
  Dr();
3329
- function u(p, b, v, w) {
3330
- v[w] = p, n(0, i);
3331
  }
3332
- const m = (p) => o(p), h = () => a(), d = () => a(!1);
3333
- return e.$$set = (p) => {
3334
- "classNames" in p && n(1, l = p.classNames), "promptsList" in p && n(0, i = p.promptsList), "min" in p && n(2, s = p.min), "max" in p && n(3, f = p.max), "step" in p && n(4, r = p.step);
3335
  }, [
3336
  i,
3337
  l,
@@ -3341,9 +3341,9 @@ function Ir(e, t, n) {
3341
  o,
3342
  a,
3343
  u,
 
3344
  m,
3345
- h,
3346
- d
3347
  ];
3348
  }
3349
  class Or extends Sr {
@@ -3397,7 +3397,7 @@ function Tt(e) {
3397
  e[1].i18n
3398
  ) },
3399
  /*loading_status*/
3400
- e[9]
3401
  ];
3402
  let i = {};
3403
  for (let s = 0; s < l.length; s += 1)
@@ -3411,7 +3411,7 @@ function Tt(e) {
3411
  },
3412
  p(s, f) {
3413
  const r = f & /*gradio, loading_status*/
3414
- 514 ? jr(l, [
3415
  f & /*gradio*/
3416
  2 && { autoscroll: (
3417
  /*gradio*/
@@ -3423,9 +3423,9 @@ function Tt(e) {
3423
  s[1].i18n
3424
  ) },
3425
  f & /*loading_status*/
3426
- 512 && Qr(
3427
  /*loading_status*/
3428
- s[9]
3429
  )
3430
  ]) : {};
3431
  t.$set(r);
@@ -3447,7 +3447,7 @@ function io(e) {
3447
  c() {
3448
  t = no(
3449
  /*label*/
3450
- e[2]
3451
  );
3452
  },
3453
  m(n, l) {
@@ -3455,10 +3455,10 @@ function io(e) {
3455
  },
3456
  p(n, l) {
3457
  l & /*label*/
3458
- 4 && to(
3459
  t,
3460
  /*label*/
3461
- n[2]
3462
  );
3463
  },
3464
  d(n) {
@@ -3469,34 +3469,37 @@ function io(e) {
3469
  function so(e) {
3470
  let t, n, l, i, s, f, r, o = (
3471
  /*loading_status*/
3472
- e[9] && Tt(e)
3473
  );
3474
  l = new ol({
3475
  props: {
3476
  show_label: (
3477
  /*show_label*/
3478
- e[6]
 
 
 
 
3479
  ),
3480
- info: void 0,
3481
  $$slots: { default: [io] },
3482
  $$scope: { ctx: e }
3483
  }
3484
  });
3485
- function a(m) {
3486
- e[17](m);
3487
  }
3488
  let u = {
3489
  min: (
3490
  /*min*/
3491
- e[10]
3492
  ),
3493
  max: (
3494
  /*max*/
3495
- e[11]
3496
  ),
3497
  step: (
3498
  /*step*/
3499
- e[12]
3500
  ),
3501
  classNames: "py-5"
3502
  };
@@ -3507,39 +3510,41 @@ function so(e) {
3507
  c() {
3508
  o && o.c(), t = Vt(), n = Jr("label"), ze(l.$$.fragment), i = Vt(), ze(s.$$.fragment), Yr(n, "class", "relative"), lo(n, "container", oo);
3509
  },
3510
- m(m, h) {
3511
- o && o.m(m, h), Ye(m, t, h), Ye(m, n, h), De(l, n, null), Hr(n, i), De(s, n, null), r = !0;
3512
  },
3513
- p(m, h) {
3514
  /*loading_status*/
3515
- m[9] ? o ? (o.p(m, h), h & /*loading_status*/
3516
- 512 && te(o, 1)) : (o = Tt(m), o.c(), te(o, 1), o.m(t.parentNode, t)) : o && (xr(), fe(o, 1, 1, () => {
3517
  o = null;
3518
  }), Wr());
3519
- const d = {};
3520
- h & /*show_label*/
3521
- 64 && (d.show_label = /*show_label*/
3522
- m[6]), h & /*$$scope, label*/
3523
- 4194308 && (d.$$scope = { dirty: h, ctx: m }), l.$set(d);
3524
- const p = {};
3525
- h & /*min*/
3526
- 1024 && (p.min = /*min*/
3527
- m[10]), h & /*max*/
3528
- 2048 && (p.max = /*max*/
3529
- m[11]), h & /*step*/
3530
- 4096 && (p.step = /*step*/
3531
- m[12]), !f && h & /*value*/
3532
- 1 && (f = !0, p.promptsList = /*value*/
3533
- m[0], Zr(() => f = !1)), s.$set(p);
 
 
3534
  },
3535
- i(m) {
3536
- r || (te(o), te(l.$$.fragment, m), te(s.$$.fragment, m), r = !0);
3537
  },
3538
- o(m) {
3539
- fe(o), fe(l.$$.fragment, m), fe(s.$$.fragment, m), r = !1;
3540
  },
3541
- d(m) {
3542
- m && (Xe(t), Xe(n)), o && o.d(m), Be(l), Be(s);
3543
  }
3544
  }
3545
  );
@@ -3550,23 +3555,23 @@ function ro(e) {
3550
  props: {
3551
  visible: (
3552
  /*visible*/
3553
- e[5]
3554
  ),
3555
  elem_id: (
3556
  /*elem_id*/
3557
- e[3]
3558
  ),
3559
  elem_classes: (
3560
  /*elem_classes*/
3561
- e[4]
3562
  ),
3563
  scale: (
3564
  /*scale*/
3565
- e[7]
3566
  ),
3567
  min_width: (
3568
  /*min_width*/
3569
- e[8]
3570
  ),
3571
  allow_overflow: !1,
3572
  padding: !0,
@@ -3583,17 +3588,17 @@ function ro(e) {
3583
  p(l, [i]) {
3584
  const s = {};
3585
  i & /*visible*/
3586
- 32 && (s.visible = /*visible*/
3587
- l[5]), i & /*elem_id*/
3588
- 8 && (s.elem_id = /*elem_id*/
3589
- l[3]), i & /*elem_classes*/
3590
- 16 && (s.elem_classes = /*elem_classes*/
3591
- l[4]), i & /*scale*/
3592
- 128 && (s.scale = /*scale*/
3593
- l[7]), i & /*min_width*/
3594
- 256 && (s.min_width = /*min_width*/
3595
- l[8]), i & /*$$scope, min, max, step, value, show_label, label, gradio, loading_status*/
3596
- 4202055 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
3597
  },
3598
  i(l) {
3599
  n || (te(t.$$.fragment, l), n = !0);
@@ -3608,60 +3613,62 @@ function ro(e) {
3608
  }
3609
  const oo = !1;
3610
  function fo(e, t, n) {
3611
- let { gradio: l } = t, { label: i = "Prompt Weighting" } = t, { elem_id: s = "" } = t, { elem_classes: f = [] } = t, { visible: r = !0 } = t, { value: o = [] } = t, { placeholder: a = "" } = t, { show_label: u } = t, { scale: m = null } = t, { min_width: h = void 0 } = t, { loading_status: d = void 0 } = t, { value_is_output: p = !1 } = t, { interactive: b } = t, { rtl: v = !1 } = t, { min: w = 0 } = t, { max: k = 2 } = t, { step: g = 0.01 } = t;
3612
- function _() {
3613
- l.dispatch("change", o), p || (l.dispatch("input"), l.dispatch("submit"));
3614
  }
3615
- function C(c) {
3616
- o = c, n(0, o);
3617
  }
3618
- return e.$$set = (c) => {
3619
- "gradio" in c && n(1, l = c.gradio), "label" in c && n(2, i = c.label), "elem_id" in c && n(3, s = c.elem_id), "elem_classes" in c && n(4, f = c.elem_classes), "visible" in c && n(5, r = c.visible), "value" in c && n(0, o = c.value), "placeholder" in c && n(13, a = c.placeholder), "show_label" in c && n(6, u = c.show_label), "scale" in c && n(7, m = c.scale), "min_width" in c && n(8, h = c.min_width), "loading_status" in c && n(9, d = c.loading_status), "value_is_output" in c && n(14, p = c.value_is_output), "interactive" in c && n(15, b = c.interactive), "rtl" in c && n(16, v = c.rtl), "min" in c && n(10, w = c.min), "max" in c && n(11, k = c.max), "step" in c && n(12, g = c.step);
3620
  }, e.$$.update = () => {
3621
  e.$$.dirty & /*value*/
3622
- 1 && o === null && n(0, o = []), e.$$.dirty & /*value*/
3623
- 1 && _();
3624
  }, [
3625
- o,
3626
  l,
3627
  i,
3628
  s,
3629
  f,
3630
  r,
3631
- u,
3632
- m,
3633
- h,
3634
  d,
3635
- w,
3636
- k,
3637
  g,
3638
- a,
3639
  p,
3640
- b,
 
 
 
3641
  v,
3642
- C
3643
  ];
3644
  }
3645
  class ao extends Ur {
3646
  constructor(t) {
3647
  super(), $r(this, t, fo, ro, eo, {
3648
  gradio: 1,
3649
- label: 2,
3650
- elem_id: 3,
3651
- elem_classes: 4,
3652
- visible: 5,
 
3653
  value: 0,
3654
- placeholder: 13,
3655
- show_label: 6,
3656
- scale: 7,
3657
- min_width: 8,
3658
- loading_status: 9,
3659
- value_is_output: 14,
3660
- interactive: 15,
3661
- rtl: 16,
3662
- min: 10,
3663
- max: 11,
3664
- step: 12
3665
  });
3666
  }
3667
  get gradio() {
@@ -3670,26 +3677,32 @@ class ao extends Ur {
3670
  set gradio(t) {
3671
  this.$$set({ gradio: t }), P();
3672
  }
3673
- get label() {
3674
  return this.$$.ctx[2];
3675
  }
 
 
 
 
 
 
3676
  set label(t) {
3677
  this.$$set({ label: t }), P();
3678
  }
3679
  get elem_id() {
3680
- return this.$$.ctx[3];
3681
  }
3682
  set elem_id(t) {
3683
  this.$$set({ elem_id: t }), P();
3684
  }
3685
  get elem_classes() {
3686
- return this.$$.ctx[4];
3687
  }
3688
  set elem_classes(t) {
3689
  this.$$set({ elem_classes: t }), P();
3690
  }
3691
  get visible() {
3692
- return this.$$.ctx[5];
3693
  }
3694
  set visible(t) {
3695
  this.$$set({ visible: t }), P();
@@ -3701,67 +3714,67 @@ class ao extends Ur {
3701
  this.$$set({ value: t }), P();
3702
  }
3703
  get placeholder() {
3704
- return this.$$.ctx[13];
3705
  }
3706
  set placeholder(t) {
3707
  this.$$set({ placeholder: t }), P();
3708
  }
3709
  get show_label() {
3710
- return this.$$.ctx[6];
3711
  }
3712
  set show_label(t) {
3713
  this.$$set({ show_label: t }), P();
3714
  }
3715
  get scale() {
3716
- return this.$$.ctx[7];
3717
  }
3718
  set scale(t) {
3719
  this.$$set({ scale: t }), P();
3720
  }
3721
  get min_width() {
3722
- return this.$$.ctx[8];
3723
  }
3724
  set min_width(t) {
3725
  this.$$set({ min_width: t }), P();
3726
  }
3727
  get loading_status() {
3728
- return this.$$.ctx[9];
3729
  }
3730
  set loading_status(t) {
3731
  this.$$set({ loading_status: t }), P();
3732
  }
3733
  get value_is_output() {
3734
- return this.$$.ctx[14];
3735
  }
3736
  set value_is_output(t) {
3737
  this.$$set({ value_is_output: t }), P();
3738
  }
3739
  get interactive() {
3740
- return this.$$.ctx[15];
3741
  }
3742
  set interactive(t) {
3743
  this.$$set({ interactive: t }), P();
3744
  }
3745
  get rtl() {
3746
- return this.$$.ctx[16];
3747
  }
3748
  set rtl(t) {
3749
  this.$$set({ rtl: t }), P();
3750
  }
3751
  get min() {
3752
- return this.$$.ctx[10];
3753
  }
3754
  set min(t) {
3755
  this.$$set({ min: t }), P();
3756
  }
3757
  get max() {
3758
- return this.$$.ctx[11];
3759
  }
3760
  set max(t) {
3761
  this.$$set({ max: t }), P();
3762
  }
3763
  get step() {
3764
- return this.$$.ctx[12];
3765
  }
3766
  set step(t) {
3767
  this.$$set({ step: t }), P();
 
13
  element: dn,
14
  get_all_dirty_from_scope: mn,
15
  get_slot_changes: hn,
16
+ get_spread_update: gn,
17
+ init: pn,
18
  insert: bn,
19
  safe_not_equal: wn,
20
  set_dynamic_element_data: Ge,
 
141
  ), Ge(
142
  /*tag*/
143
  o[14]
144
+ )(t, r = gn(f, [
145
  (!l || a & /*test_id*/
146
  128) && { "data-testid": (
147
  /*test_id*/
 
256
  };
257
  }
258
  function Cn(e, t, n) {
259
+ let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: f = void 0 } = t, { elem_id: r = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: u = "base" } = t, { padding: d = !0 } = t, { type: m = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: g = !1 } = t, { container: w = !0 } = t, { visible: y = !0 } = t, { allow_overflow: v = !0 } = t, { scale: C = null } = t, { min_width: p = 0 } = t, c = m === "fieldset" ? "fieldset" : "div";
260
+ const A = (h) => {
261
+ if (h !== void 0) {
262
+ if (typeof h == "number")
263
+ return h + "px";
264
+ if (typeof h == "string")
265
+ return h;
266
  }
267
  };
268
+ return e.$$set = (h) => {
269
+ "height" in h && n(0, s = h.height), "width" in h && n(1, f = h.width), "elem_id" in h && n(2, r = h.elem_id), "elem_classes" in h && n(3, o = h.elem_classes), "variant" in h && n(4, a = h.variant), "border_mode" in h && n(5, u = h.border_mode), "padding" in h && n(6, d = h.padding), "type" in h && n(16, m = h.type), "test_id" in h && n(7, _ = h.test_id), "explicit_call" in h && n(8, g = h.explicit_call), "container" in h && n(9, w = h.container), "visible" in h && n(10, y = h.visible), "allow_overflow" in h && n(11, v = h.allow_overflow), "scale" in h && n(12, C = h.scale), "min_width" in h && n(13, p = h.min_width), "$$scope" in h && n(17, i = h.$$scope);
270
  }, [
271
  s,
272
  f,
 
274
  o,
275
  a,
276
  u,
 
277
  d,
 
 
 
 
 
 
278
  _,
279
+ g,
280
+ w,
281
+ y,
282
+ v,
283
  C,
284
+ p,
285
+ c,
286
+ A,
287
+ m,
288
  i,
289
  l
290
  ];
291
  }
292
  class An extends an {
293
  constructor(t) {
294
+ super(), pn(this, t, Cn, kn, wn, {
295
  height: 0,
296
  width: 1,
297
  elem_id: 2,
 
408
  space: tl,
409
  text: nl,
410
  toggle_class: ie,
411
+ transition_in: pe,
412
  transition_out: qe,
413
  update_slot_base: ll
414
  } = window.__gradio__svelte__internal;
 
432
  10 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
433
  },
434
  i(l) {
435
+ n || (pe(t.$$.fragment, l), n = !0);
436
  },
437
  o(l) {
438
  qe(t.$$.fragment, l), n = !1;
 
528
  o[1] != null
529
  ), /*info*/
530
  o[1] ? r ? (r.p(o, a), a & /*info*/
531
+ 2 && pe(r, 1)) : (r = Je(o), r.c(), pe(r, 1), r.m(l.parentNode, l)) : r && (Qn(), qe(r, 1, 1, () => {
532
  r = null;
533
  }), Zn());
534
  },
535
  i(o) {
536
+ i || (pe(f, o), pe(r), i = !0);
537
  },
538
  o(o) {
539
  qe(f, o), qe(r), i = !1;
 
949
  }
950
  function $e(e, t = {}) {
951
  const n = cl(e), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
952
+ let f, r, o, a = e, u = e, d = 1, m = 0, _ = !1;
953
+ function g(y, v = {}) {
954
+ u = y;
955
+ const C = o = {};
956
+ return e == null || v.hard || w.stiffness >= 1 && w.damping >= 1 ? (_ = !0, f = je(), a = y, n.set(e = u), Promise.resolve()) : (v.soft && (m = 1 / ((v.soft === !0 ? 0.5 : +v.soft) * 60), d = 0), r || (f = je(), _ = !1, r = ul((p) => {
957
+ if (_)
958
+ return _ = !1, r = null, !1;
959
+ d = Math.min(d + m, 1);
960
+ const c = {
961
+ inv_mass: d,
962
+ opts: w,
963
  settled: !0,
964
+ dt: (p - f) * 60 / 1e3
965
+ }, A = Oe(c, a, e, u);
966
+ return f = p, a = e, n.set(e = A), c.settled && (r = null), !c.settled;
967
+ })), new Promise((p) => {
968
  r.promise.then(() => {
969
+ C === o && p();
970
  });
971
  }));
972
  }
973
+ const w = {
974
+ set: g,
975
+ update: (y, v) => g(y(u, e), v),
976
  subscribe: n.subscribe,
977
  stiffness: l,
978
  damping: i,
979
  precision: s
980
  };
981
+ return w;
982
  }
983
  const {
984
  SvelteComponent: _l,
985
  append: O,
986
+ attr: E,
987
  component_subscribe: et,
988
  detach: dl,
989
  element: ml,
990
  init: hl,
991
+ insert: gl,
992
  noop: tt,
993
+ safe_not_equal: pl,
994
  set_style: Ce,
995
  svg_element: U,
996
  toggle_class: nt
997
  } = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal;
998
  function wl(e) {
999
+ let t, n, l, i, s, f, r, o, a, u, d, m;
1000
  return {
1001
  c() {
1002
+ t = ml("div"), n = U("svg"), l = U("g"), i = U("path"), s = U("path"), f = U("path"), r = U("path"), o = U("g"), a = U("path"), u = U("path"), d = U("path"), m = U("path"), E(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), E(i, "fill", "#FF7C00"), E(i, "fill-opacity", "0.4"), E(i, "class", "svelte-43sxxs"), E(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), E(s, "fill", "#FF7C00"), E(s, "class", "svelte-43sxxs"), E(f, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), E(f, "fill", "#FF7C00"), E(f, "fill-opacity", "0.4"), E(f, "class", "svelte-43sxxs"), E(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), E(r, "fill", "#FF7C00"), E(r, "class", "svelte-43sxxs"), Ce(l, "transform", "translate(" + /*$top*/
1003
  e[1][0] + "px, " + /*$top*/
1004
+ e[1][1] + "px)"), E(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), E(a, "fill", "#FF7C00"), E(a, "fill-opacity", "0.4"), E(a, "class", "svelte-43sxxs"), E(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), E(u, "fill", "#FF7C00"), E(u, "class", "svelte-43sxxs"), E(d, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), E(d, "fill", "#FF7C00"), E(d, "fill-opacity", "0.4"), E(d, "class", "svelte-43sxxs"), E(m, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), E(m, "fill", "#FF7C00"), E(m, "class", "svelte-43sxxs"), Ce(o, "transform", "translate(" + /*$bottom*/
1005
  e[2][0] + "px, " + /*$bottom*/
1006
+ e[2][1] + "px)"), E(n, "viewBox", "-1200 -1200 3000 3000"), E(n, "fill", "none"), E(n, "xmlns", "http://www.w3.org/2000/svg"), E(n, "class", "svelte-43sxxs"), E(t, "class", "svelte-43sxxs"), nt(
1007
  t,
1008
  "margin",
1009
  /*margin*/
1010
  e[0]
1011
  );
1012
  },
1013
+ m(_, g) {
1014
+ gl(_, t, g), O(t, n), O(n, l), O(l, i), O(l, s), O(l, f), O(l, r), O(n, o), O(o, a), O(o, u), O(o, d), O(o, m);
1015
  },
1016
+ p(_, [g]) {
1017
+ g & /*$top*/
1018
  2 && Ce(l, "transform", "translate(" + /*$top*/
1019
+ _[1][0] + "px, " + /*$top*/
1020
+ _[1][1] + "px)"), g & /*$bottom*/
1021
  4 && Ce(o, "transform", "translate(" + /*$bottom*/
1022
+ _[2][0] + "px, " + /*$bottom*/
1023
+ _[2][1] + "px)"), g & /*margin*/
1024
  1 && nt(
1025
  t,
1026
  "margin",
1027
  /*margin*/
1028
+ _[0]
1029
  );
1030
  },
1031
  i: tt,
1032
  o: tt,
1033
+ d(_) {
1034
+ _ && dl(t);
1035
  }
1036
  };
1037
  }
1038
  function vl(e, t, n) {
1039
  let l, i, { margin: s = !0 } = t;
1040
  const f = $e([0, 0]);
1041
+ et(e, f, (m) => n(1, l = m));
1042
  const r = $e([0, 0]);
1043
+ et(e, r, (m) => n(2, i = m));
1044
  let o;
1045
  async function a() {
1046
  await Promise.all([f.set([125, 140]), r.set([-125, -140])]), await Promise.all([f.set([-125, 140]), r.set([125, -140])]), await Promise.all([f.set([-125, 0]), r.set([125, -0])]), await Promise.all([f.set([125, 0]), r.set([-125, 0])]);
 
1048
  async function u() {
1049
  await a(), o || u();
1050
  }
1051
+ async function d() {
1052
  await Promise.all([f.set([125, 0]), r.set([-125, 0])]), u();
1053
  }
1054
+ return bl(() => (d(), () => o = !0)), e.$$set = (m) => {
1055
+ "margin" in m && n(0, s = m.margin);
1056
  }, [s, l, i, f, r];
1057
  }
1058
  class yl extends _l {
1059
  constructor(t) {
1060
+ super(), hl(this, t, vl, wl, pl, { margin: 0 });
1061
  }
1062
  }
1063
  const {
 
1070
  create_slot: Al,
1071
  destroy_component: Sl,
1072
  destroy_each: Ut,
1073
+ detach: S,
1074
  element: Q,
1075
  empty: de,
1076
  ensure_array_like: Ve,
 
1078
  get_slot_changes: Ll,
1079
  group_outros: Zt,
1080
  init: El,
1081
+ insert: N,
1082
  mount_component: ql,
1083
  noop: Ue,
1084
  safe_not_equal: Fl,
 
1119
  t = Q("span"), l = q(n), i = W(), r && r.c(), G(t, "class", "error svelte-1yserjw");
1120
  },
1121
  m(o, a) {
1122
+ N(o, t, a), ne(t, l), N(o, i, a), r && r.m(o, a), s = !0;
1123
  },
1124
  p(o, a) {
1125
  (!s || a[0] & /*i18n*/
 
1151
  _e(r, o), s = !1;
1152
  },
1153
  d(o) {
1154
+ o && (S(t), S(i)), r && r.d(o);
1155
  }
1156
  };
1157
  }
 
1162
  e[18] && /*show_progress*/
1163
  e[6] === "full" && ot(e)
1164
  );
1165
+ function d(p, c) {
1166
  if (
1167
  /*progress*/
1168
+ p[7]
1169
  )
1170
  return Il;
1171
  if (
1172
  /*queue_position*/
1173
+ p[2] !== null && /*queue_size*/
1174
+ p[3] !== void 0 && /*queue_position*/
1175
+ p[2] >= 0
1176
  )
1177
  return Rl;
1178
  if (
1179
  /*queue_position*/
1180
+ p[2] === 0
1181
  )
1182
  return Dl;
1183
  }
1184
+ let m = d(e), _ = m && m(e), g = (
1185
  /*timer*/
1186
  e[5] && ut(e)
1187
  );
1188
+ const w = [Hl, Zl], y = [];
1189
+ function v(p, c) {
1190
  return (
1191
  /*last_progress_level*/
1192
+ p[15] != null ? 0 : (
1193
  /*show_progress*/
1194
+ p[6] === "full" ? 1 : -1
1195
  )
1196
  );
1197
  }
1198
+ ~(s = v(e)) && (f = y[s] = w[s](e));
1199
+ let C = !/*timer*/
1200
+ e[5] && pt(e);
1201
  return {
1202
  c() {
1203
+ u && u.c(), t = W(), n = Q("div"), _ && _.c(), l = W(), g && g.c(), i = W(), f && f.c(), r = W(), C && C.c(), o = de(), G(n, "class", "progress-text svelte-1yserjw"), D(
1204
  n,
1205
  "meta-text-center",
1206
  /*variant*/
 
1212
  e[8] === "default"
1213
  );
1214
  },
1215
+ m(p, c) {
1216
+ u && u.m(p, c), N(p, t, c), N(p, n, c), _ && _.m(n, null), ne(n, l), g && g.m(n, null), N(p, i, c), ~s && y[s].m(p, c), N(p, r, c), C && C.m(p, c), N(p, o, c), a = !0;
1217
  },
1218
+ p(p, c) {
1219
  /*variant*/
1220
+ p[8] === "default" && /*show_eta_bar*/
1221
+ p[18] && /*show_progress*/
1222
+ p[6] === "full" ? u ? u.p(p, c) : (u = ot(p), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null), m === (m = d(p)) && _ ? _.p(p, c) : (_ && _.d(1), _ = m && m(p), _ && (_.c(), _.m(n, l))), /*timer*/
1223
+ p[5] ? g ? g.p(p, c) : (g = ut(p), g.c(), g.m(n, null)) : g && (g.d(1), g = null), (!a || c[0] & /*variant*/
1224
  256) && D(
1225
  n,
1226
  "meta-text-center",
1227
  /*variant*/
1228
+ p[8] === "center"
1229
+ ), (!a || c[0] & /*variant*/
1230
  256) && D(
1231
  n,
1232
  "meta-text",
1233
  /*variant*/
1234
+ p[8] === "default"
1235
  );
1236
+ let A = s;
1237
+ s = v(p), s === A ? ~s && y[s].p(p, c) : (f && (Zt(), _e(y[A], 1, 1, () => {
1238
+ y[A] = null;
1239
+ }), Ot()), ~s ? (f = y[s], f ? f.p(p, c) : (f = y[s] = w[s](p), f.c()), ce(f, 1), f.m(r.parentNode, r)) : f = null), /*timer*/
1240
+ p[5] ? C && (C.d(1), C = null) : C ? C.p(p, c) : (C = pt(p), C.c(), C.m(o.parentNode, o));
1241
  },
1242
+ i(p) {
1243
  a || (ce(f), a = !0);
1244
  },
1245
+ o(p) {
1246
  _e(f), a = !1;
1247
  },
1248
+ d(p) {
1249
+ p && (S(t), S(n), S(i), S(r), S(o)), u && u.d(p), _ && _.d(), g && g.d(), ~s && y[s].d(p), C && C.d(p);
1250
  }
1251
  };
1252
  }
 
1258
  t = Q("div"), G(t, "class", "eta-bar svelte-1yserjw"), ee(t, "transform", n);
1259
  },
1260
  m(l, i) {
1261
+ N(l, t, i);
1262
  },
1263
  p(l, i) {
1264
  i[0] & /*eta_level*/
 
1266
  (l[17] || 0) * 100 - 100}%)`) && ee(t, "transform", n);
1267
  },
1268
  d(l) {
1269
+ l && S(t);
1270
  }
1271
  };
1272
  }
 
1277
  t = q("processing |");
1278
  },
1279
  m(n, l) {
1280
+ N(n, t, l);
1281
  },
1282
  p: Ue,
1283
  d(n) {
1284
+ n && S(t);
1285
  }
1286
  };
1287
  }
 
1298
  ), f = q(" |");
1299
  },
1300
  m(r, o) {
1301
+ N(r, t, o), N(r, l, o), N(r, i, o), N(r, s, o), N(r, f, o);
1302
  },
1303
  p(r, o) {
1304
  o[0] & /*queue_position*/
 
1311
  );
1312
  },
1313
  d(r) {
1314
+ r && (S(t), S(l), S(i), S(s), S(f));
1315
  }
1316
  };
1317
  }
 
1331
  m(i, s) {
1332
  for (let f = 0; f < l.length; f += 1)
1333
  l[f] && l[f].m(i, s);
1334
+ N(i, t, s);
1335
  },
1336
  p(i, s) {
1337
  if (s[0] & /*progress*/
 
1351
  }
1352
  },
1353
  d(i) {
1354
+ i && S(t), Ut(l, i);
1355
  }
1356
  };
1357
  }
 
1360
  /*p*/
1361
  e[38].unit + ""
1362
  ), l, i, s = " ", f;
1363
+ function r(u, d) {
1364
  return (
1365
  /*p*/
1366
  u[38].length != null ? Ul : Ol
 
1371
  c() {
1372
  a.c(), t = W(), l = q(n), i = q(" | "), f = q(s);
1373
  },
1374
+ m(u, d) {
1375
+ a.m(u, d), N(u, t, d), N(u, l, d), N(u, i, d), N(u, f, d);
1376
  },
1377
+ p(u, d) {
1378
+ o === (o = r(u)) && a ? a.p(u, d) : (a.d(1), a = o(u), a && (a.c(), a.m(t.parentNode, t))), d[0] & /*progress*/
1379
  128 && n !== (n = /*p*/
1380
  u[38].unit + "") && R(l, n);
1381
  },
1382
  d(u) {
1383
+ u && (S(t), S(l), S(i), S(f)), a.d(u);
1384
  }
1385
  };
1386
  }
 
1394
  n = q(t);
1395
  },
1396
  m(l, i) {
1397
+ N(l, n, i);
1398
  },
1399
  p(l, i) {
1400
  i[0] & /*progress*/
 
1404
  ) + "") && R(n, t);
1405
  },
1406
  d(l) {
1407
+ l && S(n);
1408
  }
1409
  };
1410
  }
 
1421
  n = q(t), l = q("/"), s = q(i);
1422
  },
1423
  m(f, r) {
1424
+ N(f, n, r), N(f, l, r), N(f, s, r);
1425
  },
1426
  p(f, r) {
1427
  r[0] & /*progress*/
 
1435
  ) + "") && R(s, i);
1436
  },
1437
  d(f) {
1438
+ f && (S(n), S(l), S(s));
1439
  }
1440
  };
1441
  }
 
1449
  n && n.c(), t = de();
1450
  },
1451
  m(l, i) {
1452
+ n && n.m(l, i), N(l, t, i);
1453
  },
1454
  p(l, i) {
1455
  /*p*/
1456
  l[38].index != null ? n ? n.p(l, i) : (n = ft(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
1457
  },
1458
  d(l) {
1459
+ l && S(t), n && n.d(l);
1460
  }
1461
  };
1462
  }
 
1474
  ), l = q(n), i = q("s");
1475
  },
1476
  m(s, f) {
1477
+ N(s, t, f), N(s, l, f), N(s, i, f);
1478
  },
1479
  p(s, f) {
1480
  f[0] & /*formatted_timer*/
 
1488
  s[19]}` : "") && R(l, n);
1489
  },
1490
  d(s) {
1491
+ s && (S(t), S(l), S(i));
1492
  }
1493
  };
1494
  }
 
1534
  t = Q("div"), n = Q("div"), r && r.c(), l = W(), i = Q("div"), s = Q("div"), G(n, "class", "progress-level-inner svelte-1yserjw"), G(s, "class", "progress-bar svelte-1yserjw"), ee(s, "width", f), G(i, "class", "progress-bar-wrap svelte-1yserjw"), G(t, "class", "progress-level svelte-1yserjw");
1535
  },
1536
  m(o, a) {
1537
+ N(o, t, a), ne(t, n), r && r.m(n, null), ne(t, l), ne(t, i), ne(i, s), e[30](s);
1538
  },
1539
  p(o, a) {
1540
  /*progress*/
 
1545
  i: Ue,
1546
  o: Ue,
1547
  d(o) {
1548
+ o && S(t), r && r.d(), e[30](null);
1549
  }
1550
  };
1551
  }
 
1555
  e[7]
1556
  ), l = [];
1557
  for (let i = 0; i < n.length; i += 1)
1558
+ l[i] = gt(st(e, n, i));
1559
  return {
1560
  c() {
1561
  for (let i = 0; i < l.length; i += 1)
 
1565
  m(i, s) {
1566
  for (let f = 0; f < l.length; f += 1)
1567
  l[f] && l[f].m(i, s);
1568
+ N(i, t, s);
1569
  },
1570
  p(i, s) {
1571
  if (s[0] & /*progress_level, progress*/
 
1577
  let f;
1578
  for (f = 0; f < n.length; f += 1) {
1579
  const r = st(i, n, f);
1580
+ l[f] ? l[f].p(r, s) : (l[f] = gt(r), l[f].c(), l[f].m(t.parentNode, t));
1581
  }
1582
  for (; f < l.length; f += 1)
1583
  l[f].d(1);
 
1585
  }
1586
  },
1587
  d(i) {
1588
+ i && S(t), Ut(l, i);
1589
  }
1590
  };
1591
  }
 
1613
  s && s.c(), t = W(), f && f.c(), n = W(), r && r.c(), l = W(), o && o.c(), i = de();
1614
  },
1615
  m(a, u) {
1616
+ s && s.m(a, u), N(a, t, u), f && f.m(a, u), N(a, n, u), r && r.m(a, u), N(a, l, u), o && o.m(a, u), N(a, i, u);
1617
  },
1618
  p(a, u) {
1619
  /*p*/
 
1627
  a[14] != null ? o ? o.p(a, u) : (o = ht(a), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
1628
  },
1629
  d(a) {
1630
+ a && (S(t), S(n), S(l), S(i)), s && s.d(a), f && f.d(a), r && r.d(a), o && o.d(a);
1631
  }
1632
  };
1633
  }
 
1638
  t = q(" /");
1639
  },
1640
  m(n, l) {
1641
+ N(n, t, l);
1642
  },
1643
  d(n) {
1644
+ n && S(t);
1645
  }
1646
  };
1647
  }
 
1655
  n = q(t);
1656
  },
1657
  m(l, i) {
1658
+ N(l, n, i);
1659
  },
1660
  p(l, i) {
1661
  i[0] & /*progress*/
 
1663
  l[38].desc + "") && R(n, t);
1664
  },
1665
  d(l) {
1666
+ l && S(n);
1667
  }
1668
  };
1669
  }
 
1674
  t = q("-");
1675
  },
1676
  m(n, l) {
1677
+ N(n, t, l);
1678
  },
1679
  d(n) {
1680
+ n && S(t);
1681
  }
1682
  };
1683
  }
 
1692
  n = q(t), l = q("%");
1693
  },
1694
  m(i, s) {
1695
+ N(i, n, s), N(i, l, s);
1696
  },
1697
  p(i, s) {
1698
  s[0] & /*progress_level*/
 
1703
  ] || 0)).toFixed(1) + "") && R(n, t);
1704
  },
1705
  d(i) {
1706
+ i && (S(n), S(l));
1707
  }
1708
  };
1709
  }
1710
+ function gt(e) {
1711
  let t, n = (
1712
  /*p*/
1713
  (e[38].desc != null || /*progress_level*/
 
1722
  n && n.c(), t = de();
1723
  },
1724
  m(l, i) {
1725
+ n && n.m(l, i), N(l, t, i);
1726
  },
1727
  p(l, i) {
1728
  /*p*/
 
1734
  ] != null ? n ? n.p(l, i) : (n = _t(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
1735
  },
1736
  d(l) {
1737
+ l && S(t), n && n.d(l);
1738
  }
1739
  };
1740
  }
1741
+ function pt(e) {
1742
  let t, n;
1743
  return {
1744
  c() {
 
1748
  ), G(t, "class", "loading svelte-1yserjw");
1749
  },
1750
  m(l, i) {
1751
+ N(l, t, i), ne(t, n);
1752
  },
1753
  p(l, i) {
1754
  i[0] & /*loading_text*/
 
1759
  );
1760
  },
1761
  d(l) {
1762
+ l && S(t);
1763
  }
1764
  };
1765
  }
 
1814
  );
1815
  },
1816
  m(a, u) {
1817
+ N(a, t, u), ~n && r[n].m(t, null), e[31](t), s = !0;
1818
  },
1819
  p(a, u) {
1820
+ let d = n;
1821
+ n = o(a), n === d ? ~n && r[n].p(a, u) : (l && (Zt(), _e(r[d], 1, 1, () => {
1822
+ r[d] = null;
1823
  }), Ot()), ~n ? (l = r[n], l ? l.p(a, u) : (l = r[n] = f[n](a), l.c()), ce(l, 1), l.m(t, null)) : l = null), (!s || u[0] & /*variant, show_progress*/
1824
  320 && i !== (i = "wrap " + /*variant*/
1825
  a[8] + " " + /*show_progress*/
 
1870
  _e(l), s = !1;
1871
  },
1872
  d(a) {
1873
+ a && S(t), ~n && r[n].d(), e[31](null);
1874
  }
1875
  };
1876
  }
 
1892
  }
1893
  }
1894
  function Gl(e, t, n) {
1895
+ let l, { $$slots: i = {}, $$scope: s } = t, { i18n: f } = t, { eta: r = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: u } = t, { scroll_to_output: d = !1 } = t, { timer: m = !0 } = t, { show_progress: _ = "full" } = t, { message: g = null } = t, { progress: w = null } = t, { variant: y = "default" } = t, { loading_text: v = "Loading..." } = t, { absolute: C = !0 } = t, { translucent: p = !1 } = t, { border: c = !1 } = t, { autoscroll: A } = t, h, b = !1, L = 0, F = 0, T = null, M = null, me = 0, H = null, X, Y = null, le = !0;
1896
  const ye = () => {
1897
+ n(0, r = n(26, T = n(19, j = null))), n(24, L = performance.now()), n(25, F = 0), b = !0, ke();
1898
  };
1899
  function ke() {
1900
  requestAnimationFrame(() => {
1901
+ n(25, F = (performance.now() - L) / 1e3), b && ke();
1902
  });
1903
  }
1904
  function he() {
1905
+ n(25, F = 0), n(0, r = n(26, T = n(19, j = null))), b && (b = !1);
1906
  }
1907
  Vl(() => {
1908
+ b && he();
1909
  });
1910
  let j = null;
1911
+ function sn(k) {
1912
+ lt[k ? "unshift" : "push"](() => {
1913
+ Y = k, n(16, Y), n(7, w), n(14, H), n(15, X);
1914
  });
1915
  }
1916
+ function rn(k) {
1917
+ lt[k ? "unshift" : "push"](() => {
1918
+ h = k, n(13, h);
1919
  });
1920
  }
1921
+ return e.$$set = (k) => {
1922
+ "i18n" in k && n(1, f = k.i18n), "eta" in k && n(0, r = k.eta), "queue_position" in k && n(2, o = k.queue_position), "queue_size" in k && n(3, a = k.queue_size), "status" in k && n(4, u = k.status), "scroll_to_output" in k && n(21, d = k.scroll_to_output), "timer" in k && n(5, m = k.timer), "show_progress" in k && n(6, _ = k.show_progress), "message" in k && n(22, g = k.message), "progress" in k && n(7, w = k.progress), "variant" in k && n(8, y = k.variant), "loading_text" in k && n(9, v = k.loading_text), "absolute" in k && n(10, C = k.absolute), "translucent" in k && n(11, p = k.translucent), "border" in k && n(12, c = k.border), "autoscroll" in k && n(23, A = k.autoscroll), "$$scope" in k && n(28, s = k.$$scope);
1923
  }, e.$$.update = () => {
1924
  e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
1925
+ 218103809 && (r === null && n(0, r = T), r != null && T !== r && (n(27, M = (performance.now() - L) / 1e3 + r), n(19, j = M.toFixed(1)), n(26, T = r))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/
1926
  167772160 && n(17, me = M === null || M <= 0 || !F ? null : Math.min(F / M, 1)), e.$$.dirty[0] & /*progress*/
1927
+ 128 && w != null && n(18, le = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
1928
+ 114816 && (w != null ? n(14, H = w.map((k) => {
1929
+ if (k.index != null && k.length != null)
1930
+ return k.index / k.length;
1931
+ if (k.progress != null)
1932
+ return k.progress;
1933
  })) : n(14, H = null), H ? (n(15, X = H[H.length - 1]), Y && (X === 0 ? n(16, Y.style.transition = "0", Y) : n(16, Y.style.transition = "150ms", Y))) : n(15, X = void 0)), e.$$.dirty[0] & /*status*/
1934
  16 && (u === "pending" ? ye() : he()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
1935
+ 10493968 && h && d && (u === "pending" || u === "complete") && Kl(h, A), e.$$.dirty[0] & /*status, message*/
1936
  4194320, e.$$.dirty[0] & /*timer_diff*/
1937
  33554432 && n(20, l = F.toFixed(1));
1938
  }, [
 
1941
  o,
1942
  a,
1943
  u,
1944
+ m,
 
 
 
 
 
 
1945
  _,
1946
+ w,
1947
+ y,
1948
+ v,
1949
+ C,
1950
+ p,
1951
  c,
1952
+ h,
1953
  H,
1954
  X,
1955
  Y,
 
1957
  le,
1958
  j,
1959
  l,
1960
+ d,
1961
+ g,
1962
+ A,
1963
+ L,
1964
  F,
1965
  T,
1966
  M,
 
2175
  function hi(e) {
2176
  return this.selectAll(e == null ? di : mi(typeof e == "function" ? e : Gt(e)));
2177
  }
2178
+ function gi(e) {
2179
  typeof e != "function" && (e = oi(e));
2180
  for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
2181
  for (var s = t[i], f = s.length, r = l[i] = [], o, a = 0; a < f; ++a)
 
2185
  function Wt(e) {
2186
  return new Array(e.length);
2187
  }
2188
+ function pi() {
2189
  return new I(this._enter || this._groups.map(Wt), this._parents);
2190
  }
2191
  function Te(e, t) {
 
2218
  (r = t[f]) && (i[f] = r);
2219
  }
2220
  function vi(e, t, n, l, i, s, f) {
2221
+ var r, o, a = /* @__PURE__ */ new Map(), u = t.length, d = s.length, m = new Array(u), _;
2222
  for (r = 0; r < u; ++r)
2223
+ (o = t[r]) && (m[r] = _ = f.call(o, o.__data__, r, t) + "", a.has(_) ? i[r] = o : a.set(_, o));
2224
+ for (r = 0; r < d; ++r)
2225
+ _ = f.call(e, s[r], r, s) + "", (o = a.get(_)) ? (l[r] = o, o.__data__ = s[r], a.delete(_)) : n[r] = new Te(e, s[r]);
2226
  for (r = 0; r < u; ++r)
2227
+ (o = t[r]) && a.get(m[r]) === o && (i[r] = o);
2228
  }
2229
  function yi(e) {
2230
  return e.__data__;
 
2235
  var n = t ? vi : wi, l = this._parents, i = this._groups;
2236
  typeof e != "function" && (e = bi(e));
2237
  for (var s = i.length, f = new Array(s), r = new Array(s), o = new Array(s), a = 0; a < s; ++a) {
2238
+ var u = l[a], d = i[a], m = d.length, _ = Ci(e.call(u, u && u.__data__, a, l)), g = _.length, w = r[a] = new Array(g), y = f[a] = new Array(g), v = o[a] = new Array(m);
2239
+ n(u, d, w, y, v, _, t);
2240
+ for (var C = 0, p = 0, c, A; C < g; ++C)
2241
+ if (c = w[C]) {
2242
+ for (C >= p && (p = C + 1); !(A = y[p]) && ++p < g; )
2243
  ;
2244
+ c._next = A || null;
2245
  }
2246
  }
2247
  return f = new I(f, l), f._enter = r, f._exit = o, f;
 
2258
  }
2259
  function Ni(e) {
2260
  for (var t = e.selection ? e.selection() : e, n = this._groups, l = t._groups, i = n.length, s = l.length, f = Math.min(i, s), r = new Array(i), o = 0; o < f; ++o)
2261
+ for (var a = n[o], u = l[o], d = a.length, m = r[o] = new Array(d), _, g = 0; g < d; ++g)
2262
+ (_ = a[g] || u[g]) && (m[g] = _);
2263
  for (; o < i; ++o)
2264
  r[o] = n[o];
2265
  return new I(r, this._parents);
 
2272
  }
2273
  function Ei(e) {
2274
  e || (e = qi);
2275
+ function t(d, m) {
2276
+ return d && m ? e(d.__data__, m.__data__) : !d - !m;
2277
  }
2278
  for (var n = this._groups, l = n.length, i = new Array(l), s = 0; s < l; ++s) {
2279
  for (var f = n[s], r = f.length, o = i[s] = new Array(r), a, u = 0; u < r; ++u)
 
2510
  function hs() {
2511
  return null;
2512
  }
2513
+ function gs(e, t) {
2514
  var n = typeof e == "function" ? e : Yt(e), l = t == null ? hs : typeof t == "function" ? t : Kt(t);
2515
  return this.select(function() {
2516
  return this.insertBefore(n.apply(this, arguments), l.apply(this, arguments) || null);
2517
  });
2518
  }
2519
+ function ps() {
2520
  var e = this.parentNode;
2521
  e && e.removeChild(this);
2522
  }
2523
  function bs() {
2524
+ return this.each(ps);
2525
  }
2526
  function ws() {
2527
  var e = this.cloneNode(!1), t = this.parentNode;
 
2622
  selectAll: ri,
2623
  selectChild: ci,
2624
  selectChildren: hi,
2625
+ filter: gi,
2626
  data: ki,
2627
+ enter: pi,
2628
  exit: Ai,
2629
  join: Si,
2630
  merge: Ni,
 
2646
  raise: cs,
2647
  lower: ds,
2648
  append: ms,
2649
+ insert: gs,
2650
  remove: bs,
2651
  clone: ys,
2652
  datum: ks,
 
2738
  return navigator.maxTouchPoints || "ontouchstart" in this;
2739
  }
2740
  function Zs() {
2741
+ var e = Rs, t = Is, n = Os, l = Us, i = {}, s = Ht("start", "drag", "end"), f = 0, r, o, a, u, d = 0;
2742
+ function m(c) {
2743
+ c.on("mousedown.drag", _).filter(l).on("touchstart.drag", y).on("touchmove.drag", v, zs).on("touchend.drag touchcancel.drag", C).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2744
+ }
2745
+ function _(c, A) {
2746
+ if (!(u || !e.call(this, c, A))) {
2747
+ var h = p(this, t.call(this, c, A), c, A, "mouse");
2748
+ h && (we(c.view).on("mousemove.drag", g, ve).on("mouseup.drag", w, ve), Bs(c.view), Ie(c), a = !1, r = c.clientX, o = c.clientY, h("start", c));
2749
  }
2750
  }
2751
+ function g(c) {
2752
+ if (ue(c), !a) {
2753
+ var A = c.clientX - r, h = c.clientY - o;
2754
+ a = A * A + h * h > d;
2755
  }
2756
+ i.mouse("drag", c);
2757
  }
2758
+ function w(c) {
2759
+ we(c.view).on("mousemove.drag mouseup.drag", null), Ds(c.view, a), ue(c), i.mouse("end", c);
2760
  }
2761
+ function y(c, A) {
2762
+ if (e.call(this, c, A)) {
2763
+ var h = c.changedTouches, b = t.call(this, c, A), L = h.length, F, T;
2764
+ for (F = 0; F < L; ++F)
2765
+ (T = p(this, b, c, A, h[F].identifier, h[F])) && (Ie(c), T("start", c, h[F]));
2766
  }
2767
  }
2768
+ function v(c) {
2769
+ var A = c.changedTouches, h = A.length, b, L;
2770
+ for (b = 0; b < h; ++b)
2771
+ (L = i[A[b].identifier]) && (ue(c), L("drag", c, A[b]));
2772
  }
2773
+ function C(c) {
2774
+ var A = c.changedTouches, h = A.length, b, L;
2775
  for (u && clearTimeout(u), u = setTimeout(function() {
2776
  u = null;
2777
+ }, 500), b = 0; b < h; ++b)
2778
+ (L = i[A[b].identifier]) && (Ie(c), L("end", c, A[b]));
2779
+ }
2780
+ function p(c, A, h, b, L, F) {
2781
+ var T = s.copy(), M = vt(F || h, A), me, H, X;
2782
+ if ((X = n.call(c, new He("beforestart", {
2783
+ sourceEvent: h,
2784
+ target: m,
2785
+ identifier: L,
2786
  active: f,
2787
  x: M[0],
2788
  y: M[1],
2789
  dx: 0,
2790
  dy: 0,
2791
  dispatch: T
2792
+ }), b)) != null)
2793
  return me = X.x - M[0] || 0, H = X.y - M[1] || 0, function Y(le, ye, ke) {
2794
  var he = M, j;
2795
  switch (le) {
2796
  case "start":
2797
+ i[L] = Y, j = f++;
2798
  break;
2799
  case "end":
2800
+ delete i[L], --f;
2801
  case "drag":
2802
+ M = vt(ke || ye, A), j = f;
2803
  break;
2804
  }
2805
  T.call(
2806
  le,
2807
+ c,
2808
  new He(le, {
2809
  sourceEvent: ye,
2810
  subject: X,
2811
+ target: m,
2812
+ identifier: L,
2813
  active: j,
2814
  x: M[0] + me,
2815
  y: M[1] + H,
 
2817
  dy: M[1] - he[1],
2818
  dispatch: T
2819
  }),
2820
+ b
2821
  );
2822
  };
2823
  }
2824
+ return m.filter = function(c) {
2825
+ return arguments.length ? (e = typeof c == "function" ? c : Se(!!c), m) : e;
2826
+ }, m.container = function(c) {
2827
+ return arguments.length ? (t = typeof c == "function" ? c : Se(c), m) : t;
2828
+ }, m.subject = function(c) {
2829
+ return arguments.length ? (n = typeof c == "function" ? c : Se(c), m) : n;
2830
+ }, m.touchable = function(c) {
2831
+ return arguments.length ? (l = typeof c == "function" ? c : Se(!!c), m) : l;
2832
+ }, m.on = function() {
2833
+ var c = s.on.apply(s, arguments);
2834
+ return c === s ? m : c;
2835
+ }, m.clickDistance = function(c) {
2836
+ return arguments.length ? (d = (c = +c) * c, m) : Math.sqrt(d);
2837
+ }, m;
2838
  }
2839
  const {
2840
  SvelteComponent: Hs,
 
2915
  let t, n, l, i, s, f, r, o, a = (
2916
  /*prompt*/
2917
  e[0].scale.toFixed(1) + ""
2918
+ ), u, d, m, _, g, w, y, v, C, p, c, A;
2919
+ return v = new js({}), {
2920
  c() {
2921
+ t = Z("div"), n = Z("div"), l = Z("div"), i = Z("div"), s = Z("div"), f = Z("span"), r = Z("span"), o = Z("span"), u = fr(a), d = Nt(), m = Z("div"), _ = Z("input"), w = Nt(), y = Z("button"), $s(v.$$.fragment), V(o, "class", "text-black svelte-1wmphae"), V(r, "class", "text-black svelte-1wmphae"), V(f, "class", "flex text-[0.5rem] font-mono text-black dark:group-hover:text-white svelte-1wmphae"), V(s, "class", "bottom-full p-1 svelte-1wmphae"), V(i, "class", "relative svelte-1wmphae"), V(l, "class", "absolute z-10 flex items-center justify-center w-[2.5em] svelte-1wmphae"), V(_, "type", "text"), V(_, "placeholder", "Prompt"), V(_, "class", g = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
2922
+ (e[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae"), St(_, "width", "calc(" + Math.max(
2923
  14,
2924
  /*prompt*/
2925
  e[0].prompt.length + 1
2926
+ ) + "ch + 2em) "), V(m, "class", "relative flex z-0 svelte-1wmphae"), V(y, "class", "absolute z-1 right-1 text text-black hover:text-red-500 invisible group-hover:visible svelte-1wmphae"), V(y, "title", "Remove prompt"), V(n, "class", C = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
2927
  (e[1] || /*isHovering*/
2928
  e[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae"), V(t, "class", "w-min flex flex-col group relative svelte-1wmphae");
2929
  },
2930
+ m(h, b) {
2931
+ lr(h, t, b), B(t, n), B(n, l), B(l, i), B(i, s), B(s, f), B(f, r), B(r, o), B(o, u), B(n, d), B(n, m), B(m, _), e[10](_), At(
2932
+ _,
2933
  /*prompt*/
2934
  e[0].prompt
2935
+ ), B(n, w), B(n, y), ir(v, y, null), e[13](t), p = !0, c || (A = [
2936
  J(
2937
+ _,
2938
  "keypress",
2939
  /*onKeyPress*/
2940
  e[6]
2941
  ),
2942
  J(
2943
+ _,
2944
  "input",
2945
  /*input_input_handler*/
2946
  e[11]
2947
  ),
2948
  J(
2949
+ y,
2950
  "click",
2951
  /*click_handler*/
2952
  e[12]
 
2987
  /*pointerenter_handler_1*/
2988
  e[19]
2989
  )
2990
+ ], c = !0);
2991
  },
2992
+ p(h, [b]) {
2993
+ (!p || b & /*prompt*/
2994
  1) && a !== (a = /*prompt*/
2995
+ h[0].scale.toFixed(1) + "") && or(u, a), (!p || b & /*prompt*/
2996
+ 1 && g !== (g = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
2997
+ (h[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae")) && V(_, "class", g), (!p || b & /*prompt*/
2998
+ 1) && St(_, "width", "calc(" + Math.max(
2999
  14,
3000
  /*prompt*/
3001
+ h[0].prompt.length + 1
3002
+ ) + "ch + 2em) "), b & /*prompt*/
3003
+ 1 && _.value !== /*prompt*/
3004
+ h[0].prompt && At(
3005
+ _,
3006
  /*prompt*/
3007
+ h[0].prompt
3008
+ ), (!p || b & /*isDragging, isHovering*/
3009
+ 10 && C !== (C = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
3010
+ (h[1] || /*isHovering*/
3011
+ h[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae")) && V(n, "class", C);
3012
  },
3013
+ i(h) {
3014
+ p || (ar(v.$$.fragment, h), p = !0);
3015
  },
3016
+ o(h) {
3017
+ ur(v.$$.fragment, h), p = !1;
3018
  },
3019
+ d(h) {
3020
+ h && tr(t), e[10](null), er(v), e[13](null), c = !1, sr(A);
3021
  }
3022
  };
3023
  }
3024
  function mr(e, t, n) {
3025
  let { prompt: l } = t, { min: i = 0 } = t, { max: s = 2 } = t, { step: f = 0.01 } = t, r, o = !1, a = !1;
3026
  const u = _r();
3027
+ let d = 0, m;
3028
  cr(() => {
3029
+ const L = Zs().on("start", (F) => {
3030
+ d = l.scale, n(1, o = !0);
3031
  }).on("drag", (F) => {
3032
  const { dx: T, dy: M } = F;
3033
+ d -= M * f, d = Math.min(d, s), d = Math.max(d, i), n(0, l.scale = d, l);
3034
  }).on("end", (F) => {
3035
  n(1, o = !1);
3036
  });
3037
+ we(m).call(L), r.focus();
3038
  });
3039
+ function _(L) {
3040
+ L.key === "Enter" && u("add");
3041
  }
3042
+ function g(L) {
3043
+ Ct[L ? "unshift" : "push"](() => {
3044
+ r = L, n(2, r);
3045
  });
3046
  }
3047
+ function w() {
3048
  l.prompt = this.value, n(0, l);
3049
  }
3050
+ const y = () => u("remove");
3051
+ function v(L) {
3052
+ Ct[L ? "unshift" : "push"](() => {
3053
+ m = L, n(4, m);
3054
  });
3055
  }
3056
+ const C = () => n(3, a = !0), p = () => n(3, a = !1), c = () => n(3, a = !1), A = () => n(3, a = !0), h = () => n(3, a = !1), b = () => n(3, a = !0);
3057
+ return e.$$set = (L) => {
3058
+ "prompt" in L && n(0, l = L.prompt), "min" in L && n(7, i = L.min), "max" in L && n(8, s = L.max), "step" in L && n(9, f = L.step);
3059
  }, e.$$.update = () => {
3060
  e.$$.dirty & /*isDragging*/
3061
  2 && (o ? document.body.classList.add("grabbing") : document.body.classList.remove("grabbing"));
 
3064
  o,
3065
  r,
3066
  a,
3067
+ m,
3068
  u,
3069
+ _,
3070
  i,
3071
  s,
3072
  f,
 
 
 
 
 
3073
  g,
3074
+ w,
3075
+ y,
3076
+ v,
3077
  C,
3078
+ p,
3079
  c,
3080
+ A,
3081
+ h,
3082
+ b
3083
  ];
3084
  }
3085
  class hr extends xs {
 
3088
  }
3089
  }
3090
  const {
3091
+ SvelteComponent: gr,
3092
+ append: pr,
3093
  attr: $,
3094
  detach: br,
3095
  init: wr,
 
3110
  );
3111
  },
3112
  m(l, i) {
3113
+ vr(l, t, i), pr(t, n);
3114
  },
3115
  p(l, [i]) {
3116
  i & /*classNames*/
 
3134
  "classNames" in i && n(0, l = i.classNames);
3135
  }, [l];
3136
  }
3137
+ class Ar extends gr {
3138
  constructor(t) {
3139
  super(), wr(this, t, Cr, kr, yr, { classNames: 0 });
3140
  }
 
3142
  const {
3143
  SvelteComponent: Sr,
3144
  add_flush_callback: Nr,
3145
+ append: ge,
3146
  attr: re,
3147
  bind: Lr,
3148
  binding_callbacks: Er,
 
3243
  );
3244
  }
3245
  function Rr(e) {
3246
+ let t, n, l, i, s, f, r, o, a, u, d, m = qt(
3247
  /*promptsList*/
3248
  e[0]
3249
+ ), _ = [];
3250
+ for (let w = 0; w < m.length; w += 1)
3251
+ _[w] = Pt(Mt(e, m, w));
3252
+ const g = (w) => Pe(_[w], 1, 1, () => {
3253
+ _[w] = null;
3254
  });
3255
  return s = new Ar({}), {
3256
  c() {
3257
  t = Ne("div");
3258
+ for (let w = 0; w < _.length; w += 1)
3259
+ _[w].c();
3260
  n = Ft(), l = Ne("div"), i = Ne("button"), tn(s.$$.fragment), f = Ft(), r = Ne("h2"), r.textContent = "Add Prompt", re(r, "class", "text-xs font-normal px-1 svelte-9vwpr1"), re(i, "title", "Add Concept"), re(i, "class", "flex items-center text-base text-black hover-text-cyan-500 dark:text-white svelte-9vwpr1"), re(l, "class", "flex flex-col gap-1 svelte-9vwpr1"), re(t, "class", o = "flex items-center gap-1 flex-wrap " + /*classNames*/
3261
  e[1] + " svelte-9vwpr1");
3262
  },
3263
+ m(w, y) {
3264
+ Tr(w, t, y);
3265
+ for (let v = 0; v < _.length; v += 1)
3266
+ _[v] && _[v].m(t, null);
3267
+ ge(t, n), ge(t, l), ge(l, i), ln(s, i, null), ge(i, f), ge(i, r), a = !0, u || (d = zr(
3268
  i,
3269
  "click",
3270
  /*click_handler*/
3271
  e[10]
3272
  ), u = !0);
3273
  },
3274
+ p(w, [y]) {
3275
+ if (y & /*min, max, step, promptsList, removeConcept, addPrompt*/
3276
  125) {
3277
+ m = qt(
3278
  /*promptsList*/
3279
+ w[0]
3280
  );
3281
+ let v;
3282
+ for (v = 0; v < m.length; v += 1) {
3283
+ const C = Mt(w, m, v);
3284
+ _[v] ? (_[v].p(C, y), be(_[v], 1)) : (_[v] = Pt(C), _[v].c(), be(_[v], 1), _[v].m(t, n));
3285
  }
3286
+ for (Pr(), v = m.length; v < _.length; v += 1)
3287
+ g(v);
3288
  qr();
3289
  }
3290
+ (!a || y & /*classNames*/
3291
  2 && o !== (o = "flex items-center gap-1 flex-wrap " + /*classNames*/
3292
+ w[1] + " svelte-9vwpr1")) && re(t, "class", o);
3293
  },
3294
+ i(w) {
3295
  if (!a) {
3296
+ for (let y = 0; y < m.length; y += 1)
3297
+ be(_[y]);
3298
+ be(s.$$.fragment, w), a = !0;
3299
  }
3300
  },
3301
+ o(w) {
3302
+ _ = _.filter(Boolean);
3303
+ for (let y = 0; y < _.length; y += 1)
3304
+ Pe(_[y]);
3305
+ Pe(s.$$.fragment, w), a = !1;
3306
  },
3307
+ d(w) {
3308
+ w && Mr(t), Fr(_, w), nn(s), u = !1, d();
3309
  }
3310
  };
3311
  }
3312
  function Ir(e, t, n) {
3313
  let { classNames: l = "" } = t, { promptsList: i = [] } = t, { min: s } = t, { max: f } = t, { step: r } = t;
3314
+ function o(g) {
3315
+ n(0, i = i.filter((w) => w.id !== g.id));
3316
  }
3317
+ function a(g = !1) {
3318
  n(0, i = [
3319
  ...i,
3320
  {
3321
  id: fn(),
3322
  prompt: "",
3323
  scale: 1,
3324
+ negative: g
3325
  }
3326
  ]);
3327
  }
3328
  Dr();
3329
+ function u(g, w, y, v) {
3330
+ y[v] = g, n(0, i);
3331
  }
3332
+ const d = (g) => o(g), m = () => a(), _ = () => a(!1);
3333
+ return e.$$set = (g) => {
3334
+ "classNames" in g && n(1, l = g.classNames), "promptsList" in g && n(0, i = g.promptsList), "min" in g && n(2, s = g.min), "max" in g && n(3, f = g.max), "step" in g && n(4, r = g.step);
3335
  }, [
3336
  i,
3337
  l,
 
3341
  o,
3342
  a,
3343
  u,
3344
+ d,
3345
  m,
3346
+ _
 
3347
  ];
3348
  }
3349
  class Or extends Sr {
 
3397
  e[1].i18n
3398
  ) },
3399
  /*loading_status*/
3400
+ e[10]
3401
  ];
3402
  let i = {};
3403
  for (let s = 0; s < l.length; s += 1)
 
3411
  },
3412
  p(s, f) {
3413
  const r = f & /*gradio, loading_status*/
3414
+ 1026 ? jr(l, [
3415
  f & /*gradio*/
3416
  2 && { autoscroll: (
3417
  /*gradio*/
 
3423
  s[1].i18n
3424
  ) },
3425
  f & /*loading_status*/
3426
+ 1024 && Qr(
3427
  /*loading_status*/
3428
+ s[10]
3429
  )
3430
  ]) : {};
3431
  t.$set(r);
 
3447
  c() {
3448
  t = no(
3449
  /*label*/
3450
+ e[3]
3451
  );
3452
  },
3453
  m(n, l) {
 
3455
  },
3456
  p(n, l) {
3457
  l & /*label*/
3458
+ 8 && to(
3459
  t,
3460
  /*label*/
3461
+ n[3]
3462
  );
3463
  },
3464
  d(n) {
 
3469
  function so(e) {
3470
  let t, n, l, i, s, f, r, o = (
3471
  /*loading_status*/
3472
+ e[10] && Tt(e)
3473
  );
3474
  l = new ol({
3475
  props: {
3476
  show_label: (
3477
  /*show_label*/
3478
+ e[7]
3479
+ ),
3480
+ info: (
3481
+ /*info*/
3482
+ e[2]
3483
  ),
 
3484
  $$slots: { default: [io] },
3485
  $$scope: { ctx: e }
3486
  }
3487
  });
3488
+ function a(d) {
3489
+ e[18](d);
3490
  }
3491
  let u = {
3492
  min: (
3493
  /*min*/
3494
+ e[11]
3495
  ),
3496
  max: (
3497
  /*max*/
3498
+ e[12]
3499
  ),
3500
  step: (
3501
  /*step*/
3502
+ e[13]
3503
  ),
3504
  classNames: "py-5"
3505
  };
 
3510
  c() {
3511
  o && o.c(), t = Vt(), n = Jr("label"), ze(l.$$.fragment), i = Vt(), ze(s.$$.fragment), Yr(n, "class", "relative"), lo(n, "container", oo);
3512
  },
3513
+ m(d, m) {
3514
+ o && o.m(d, m), Ye(d, t, m), Ye(d, n, m), De(l, n, null), Hr(n, i), De(s, n, null), r = !0;
3515
  },
3516
+ p(d, m) {
3517
  /*loading_status*/
3518
+ d[10] ? o ? (o.p(d, m), m & /*loading_status*/
3519
+ 1024 && te(o, 1)) : (o = Tt(d), o.c(), te(o, 1), o.m(t.parentNode, t)) : o && (xr(), fe(o, 1, 1, () => {
3520
  o = null;
3521
  }), Wr());
3522
+ const _ = {};
3523
+ m & /*show_label*/
3524
+ 128 && (_.show_label = /*show_label*/
3525
+ d[7]), m & /*info*/
3526
+ 4 && (_.info = /*info*/
3527
+ d[2]), m & /*$$scope, label*/
3528
+ 8388616 && (_.$$scope = { dirty: m, ctx: d }), l.$set(_);
3529
+ const g = {};
3530
+ m & /*min*/
3531
+ 2048 && (g.min = /*min*/
3532
+ d[11]), m & /*max*/
3533
+ 4096 && (g.max = /*max*/
3534
+ d[12]), m & /*step*/
3535
+ 8192 && (g.step = /*step*/
3536
+ d[13]), !f && m & /*value*/
3537
+ 1 && (f = !0, g.promptsList = /*value*/
3538
+ d[0], Zr(() => f = !1)), s.$set(g);
3539
  },
3540
+ i(d) {
3541
+ r || (te(o), te(l.$$.fragment, d), te(s.$$.fragment, d), r = !0);
3542
  },
3543
+ o(d) {
3544
+ fe(o), fe(l.$$.fragment, d), fe(s.$$.fragment, d), r = !1;
3545
  },
3546
+ d(d) {
3547
+ d && (Xe(t), Xe(n)), o && o.d(d), Be(l), Be(s);
3548
  }
3549
  }
3550
  );
 
3555
  props: {
3556
  visible: (
3557
  /*visible*/
3558
+ e[6]
3559
  ),
3560
  elem_id: (
3561
  /*elem_id*/
3562
+ e[4]
3563
  ),
3564
  elem_classes: (
3565
  /*elem_classes*/
3566
+ e[5]
3567
  ),
3568
  scale: (
3569
  /*scale*/
3570
+ e[8]
3571
  ),
3572
  min_width: (
3573
  /*min_width*/
3574
+ e[9]
3575
  ),
3576
  allow_overflow: !1,
3577
  padding: !0,
 
3588
  p(l, [i]) {
3589
  const s = {};
3590
  i & /*visible*/
3591
+ 64 && (s.visible = /*visible*/
3592
+ l[6]), i & /*elem_id*/
3593
+ 16 && (s.elem_id = /*elem_id*/
3594
+ l[4]), i & /*elem_classes*/
3595
+ 32 && (s.elem_classes = /*elem_classes*/
3596
+ l[5]), i & /*scale*/
3597
+ 256 && (s.scale = /*scale*/
3598
+ l[8]), i & /*min_width*/
3599
+ 512 && (s.min_width = /*min_width*/
3600
+ l[9]), i & /*$$scope, min, max, step, value, show_label, info, label, gradio, loading_status*/
3601
+ 8404111 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
3602
  },
3603
  i(l) {
3604
  n || (te(t.$$.fragment, l), n = !0);
 
3613
  }
3614
  const oo = !1;
3615
  function fo(e, t, n) {
3616
+ let { gradio: l } = t, { info: i = void 0 } = t, { label: s = "Prompt Weighting" } = t, { elem_id: f = "" } = t, { elem_classes: r = [] } = t, { visible: o = !0 } = t, { value: a = [] } = t, { placeholder: u = "" } = t, { show_label: d } = t, { scale: m = null } = t, { min_width: _ = void 0 } = t, { loading_status: g = void 0 } = t, { value_is_output: w = !1 } = t, { interactive: y } = t, { rtl: v = !1 } = t, { min: C = 0 } = t, { max: p = 2 } = t, { step: c = 0.01 } = t;
3617
+ function A() {
3618
+ l.dispatch("change", a), w || (l.dispatch("input"), l.dispatch("submit"));
3619
  }
3620
+ function h(b) {
3621
+ a = b, n(0, a);
3622
  }
3623
+ return e.$$set = (b) => {
3624
+ "gradio" in b && n(1, l = b.gradio), "info" in b && n(2, i = b.info), "label" in b && n(3, s = b.label), "elem_id" in b && n(4, f = b.elem_id), "elem_classes" in b && n(5, r = b.elem_classes), "visible" in b && n(6, o = b.visible), "value" in b && n(0, a = b.value), "placeholder" in b && n(14, u = b.placeholder), "show_label" in b && n(7, d = b.show_label), "scale" in b && n(8, m = b.scale), "min_width" in b && n(9, _ = b.min_width), "loading_status" in b && n(10, g = b.loading_status), "value_is_output" in b && n(15, w = b.value_is_output), "interactive" in b && n(16, y = b.interactive), "rtl" in b && n(17, v = b.rtl), "min" in b && n(11, C = b.min), "max" in b && n(12, p = b.max), "step" in b && n(13, c = b.step);
3625
  }, e.$$.update = () => {
3626
  e.$$.dirty & /*value*/
3627
+ 1 && a === null && n(0, a = []), e.$$.dirty & /*value*/
3628
+ 1 && A();
3629
  }, [
3630
+ a,
3631
  l,
3632
  i,
3633
  s,
3634
  f,
3635
  r,
3636
+ o,
 
 
3637
  d,
3638
+ m,
3639
+ _,
3640
  g,
3641
+ C,
3642
  p,
3643
+ c,
3644
+ u,
3645
+ w,
3646
+ y,
3647
  v,
3648
+ h
3649
  ];
3650
  }
3651
  class ao extends Ur {
3652
  constructor(t) {
3653
  super(), $r(this, t, fo, ro, eo, {
3654
  gradio: 1,
3655
+ info: 2,
3656
+ label: 3,
3657
+ elem_id: 4,
3658
+ elem_classes: 5,
3659
+ visible: 6,
3660
  value: 0,
3661
+ placeholder: 14,
3662
+ show_label: 7,
3663
+ scale: 8,
3664
+ min_width: 9,
3665
+ loading_status: 10,
3666
+ value_is_output: 15,
3667
+ interactive: 16,
3668
+ rtl: 17,
3669
+ min: 11,
3670
+ max: 12,
3671
+ step: 13
3672
  });
3673
  }
3674
  get gradio() {
 
3677
  set gradio(t) {
3678
  this.$$set({ gradio: t }), P();
3679
  }
3680
+ get info() {
3681
  return this.$$.ctx[2];
3682
  }
3683
+ set info(t) {
3684
+ this.$$set({ info: t }), P();
3685
+ }
3686
+ get label() {
3687
+ return this.$$.ctx[3];
3688
+ }
3689
  set label(t) {
3690
  this.$$set({ label: t }), P();
3691
  }
3692
  get elem_id() {
3693
+ return this.$$.ctx[4];
3694
  }
3695
  set elem_id(t) {
3696
  this.$$set({ elem_id: t }), P();
3697
  }
3698
  get elem_classes() {
3699
+ return this.$$.ctx[5];
3700
  }
3701
  set elem_classes(t) {
3702
  this.$$set({ elem_classes: t }), P();
3703
  }
3704
  get visible() {
3705
+ return this.$$.ctx[6];
3706
  }
3707
  set visible(t) {
3708
  this.$$set({ visible: t }), P();
 
3714
  this.$$set({ value: t }), P();
3715
  }
3716
  get placeholder() {
3717
+ return this.$$.ctx[14];
3718
  }
3719
  set placeholder(t) {
3720
  this.$$set({ placeholder: t }), P();
3721
  }
3722
  get show_label() {
3723
+ return this.$$.ctx[7];
3724
  }
3725
  set show_label(t) {
3726
  this.$$set({ show_label: t }), P();
3727
  }
3728
  get scale() {
3729
+ return this.$$.ctx[8];
3730
  }
3731
  set scale(t) {
3732
  this.$$set({ scale: t }), P();
3733
  }
3734
  get min_width() {
3735
+ return this.$$.ctx[9];
3736
  }
3737
  set min_width(t) {
3738
  this.$$set({ min_width: t }), P();
3739
  }
3740
  get loading_status() {
3741
+ return this.$$.ctx[10];
3742
  }
3743
  set loading_status(t) {
3744
  this.$$set({ loading_status: t }), P();
3745
  }
3746
  get value_is_output() {
3747
+ return this.$$.ctx[15];
3748
  }
3749
  set value_is_output(t) {
3750
  this.$$set({ value_is_output: t }), P();
3751
  }
3752
  get interactive() {
3753
+ return this.$$.ctx[16];
3754
  }
3755
  set interactive(t) {
3756
  this.$$set({ interactive: t }), P();
3757
  }
3758
  get rtl() {
3759
+ return this.$$.ctx[17];
3760
  }
3761
  set rtl(t) {
3762
  this.$$set({ rtl: t }), P();
3763
  }
3764
  get min() {
3765
+ return this.$$.ctx[11];
3766
  }
3767
  set min(t) {
3768
  this.$$set({ min: t }), P();
3769
  }
3770
  get max() {
3771
+ return this.$$.ctx[12];
3772
  }
3773
  set max(t) {
3774
  this.$$set({ max: t }), P();
3775
  }
3776
  get step() {
3777
+ return this.$$.ctx[13];
3778
  }
3779
  set step(t) {
3780
  this.$$set({ step: t }), P();
src/demo/space.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  from app import demo as app
4
  import os
5
 
6
- _docs = {'PromptWeighting': {'description': 'Creates a very simple textbox for user to enter string input or display string output.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': '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.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
@@ -21,7 +21,7 @@ with gr.Blocks(
21
  # `gradio_promptweighting`
22
 
23
  <div style="display: flex; gap: 7px;">
24
- <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
25
  </div>
26
 
27
  Simple component for creating prompt weighting for real-time generation.
@@ -53,7 +53,13 @@ with gr.Blocks() as demo:
53
  with gr.Row():
54
  with gr.Column():
55
  prompt = PromptWeighting(
56
- value=[{"prompt": "a cat", "scale": 1.5}], step=0.001
 
 
 
 
 
 
57
  )
58
  btn = gr.Button("Update Prompt")
59
  with gr.Column():
 
3
  from app import demo as app
4
  import os
5
 
6
+ _docs = {'PromptWeighting': {'description': 'Enables multi text input with a vertical drag to adjust the weight of each prompt.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': '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.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
7
 
8
  abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
 
 
21
  # `gradio_promptweighting`
22
 
23
  <div style="display: flex; gap: 7px;">
24
+ <a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
25
  </div>
26
 
27
  Simple component for creating prompt weighting for real-time generation.
 
53
  with gr.Row():
54
  with gr.Column():
55
  prompt = PromptWeighting(
56
+ value=[
57
+ {"prompt": "a cat", "scale": 1.5},
58
+ {"prompt": "a dog", "scale": 1},
59
+ {"prompt": "a bird", "scale": 0.5},
60
+ ],
61
+ step=0.001,
62
+ info="Please drag up or down to adjust the weight of the prompt.",
63
  )
64
  btn = gr.Button("Update Prompt")
65
  with gr.Column():
src/pyproject.toml CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
 
9
  [project]
10
  name = "gradio_promptweighting"
11
- version = "0.0.1"
12
  description = "Simple component for creating prompt weighting for real-time generation."
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_promptweighting/templates", "*.pyi", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_promptweighting"]
 
8
 
9
  [project]
10
  name = "gradio_promptweighting"
11
+ version = "0.0.2"
12
  description = "Simple component for creating prompt weighting for real-time generation."
13
  readme = "README.md"
14
  license = "MIT"
 
36
  dev = ["build", "twine"]
37
 
38
  [tool.hatch.build]
39
+ artifacts = ["/backend/gradio_promptweighting/templates", "*.pyi", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates"]
40
 
41
  [tool.hatch.build.targets.wheel]
42
  packages = ["/backend/gradio_promptweighting"]