1import { w as writable, p as prop, m as setup_stores, b as set_class, f as set_style, q as store_get, i as if_block, d as bind_this, k as each, u as index, s as slot } from './i18n-CMo5lpzy.js'; 2import { R as push, y as user_effect, x as set, t as template_effect, a as append, T as pop, u as state, X as sibling, W as from_html, w as get, V as child, Y as reset, z as untrack, a5 as user_derived, a0 as set_text, S as first_child, a6 as comment, M as tick, a7 as text } from './index-BvBk1Iap.js'; 3import { r as raf$1, l as loop } from './StreamingBar.svelte_svelte_type_style_lang-CdFIGsJa.js'; 4import { I as IconButton } from './ScrollFade.svelte_svelte_type_style_lang-Xm-PLg9E.js'; 5import { C as Clear } from './Clear-Dgs5UhTO.js'; 6 7function pretty_si(num) { 8 let units = ["", "k", "M", "G", "T", "P", "E", "Z"]; 9 let i = 0; 10 while (num > 1e3 && i < units.length - 1) { 11 num /= 1e3; 12 i++; 13 } 14 let unit = units[i]; 15 return (Number.isInteger(num) ? num : num.toFixed(1)) + unit; 16} 17 18/** 19 * @param {any} obj 20 * @returns {obj is Date} 21 */ 22function is_date(obj) { 23 return Object.prototype.toString.call(obj) === '[object Date]'; 24} 25 26/** @import { Task } from '#client' */ 27/** @import { SpringOpts, SpringUpdateOpts, TickContext } from './private.js' */ 28/** @import { Spring as SpringStore } from './public.js' */ 29 30/** 31 * @template T 32 * @param {TickContext} ctx 33 * @param {T} last_value 34 * @param {T} current_value 35 * @param {T} target_value 36 * @returns {T} 37 */ 38function tick_spring(ctx, last_value, current_value, target_value) { 39 if (typeof current_value === 'number' || is_date(current_value)) { 40 // @ts-ignore 41 const delta = target_value - current_value; 42 // @ts-ignore 43 const velocity = (current_value - last_value) / (ctx.dt || 1 / 60); // guard div by 0 44 const spring = ctx.opts.stiffness * delta; 45 const damper = ctx.opts.damping * velocity; 46 const acceleration = (spring - damper) * ctx.inv_mass; 47 const d = (velocity + acceleration) * ctx.dt; 48 if (Math.abs(d) < ctx.opts.precision && Math.abs(delta) < ctx.opts.precision) { 49 return target_value; // settled 50 } else { 51 ctx.settled = false; // signal loop to keep ticking 52 // @ts-ignore 53 return is_date(current_value) ? new Date(current_value.getTime() + d) : current_value + d; 54 } 55 } else if (Array.isArray(current_value)) { 56 // @ts-ignore 57 return current_value.map((_, i) => 58 // @ts-ignore 59 tick_spring(ctx, last_value[i], current_value[i], target_value[i]) 60 ); 61 } else if (typeof current_value === 'object') { 62 const next_value = {}; 63 for (const k in current_value) { 64 // @ts-ignore 65 next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]); 66 } 67 // @ts-ignore 68 return next_value; 69 } else { 70 throw new Error(`Cannot spring ${typeof current_value} values`); 71 } 72} 73 74/** 75 * The spring function in Svelte creates a store whose value is animated, with a motion that simulates the behavior of a spring. This means when the value changes, instead of transitioning at a steady rate, it "bounces" like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience. 76 * 77 * @deprecated Use [`Spring`](https://svelte.dev/docs/svelte/svelte-motion#Spring) instead 78 * @template [T=any] 79 * @param {T} [value] 80 * @param {SpringOpts} [opts] 81 * @returns {SpringStore<T>} 82 */ 83function spring(value, opts = {}) { 84 const store = writable(value); 85 const { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts; 86 /** @type {number} */ 87 let last_time; 88 /** @type {Task | null} */ 89 let task; 90 /** @type {object} */ 91 let current_token; 92 93 let last_value = /** @type {T} */ (value); 94 let target_value = /** @type {T | undefined} */ (value); 95 96 let inv_mass = 1; 97 let inv_mass_recovery_rate = 0; 98 let cancel_task = false; 99 /** 100 * @param {T} new_value 101 * @param {SpringUpdateOpts} opts 102 * @returns {Promise<void>} 103 */ 104 function set(new_value, opts = {}) { 105 target_value = new_value; 106 const token = (current_token = {}); 107 if (value == null || opts.hard || (spring.stiffness >= 1 && spring.damping >= 1)) { 108 cancel_task = true; // cancel any running animation 109 last_time = raf$1.now(); 110 last_value = new_value; 111 store.set((value = target_value)); 112 return Promise.resolve(); 113 } else if (opts.soft) { 114 const rate = opts.soft === true ? 0.5 : +opts.soft; 115 inv_mass_recovery_rate = 1 / (rate * 60); 116 inv_mass = 0; // infinite mass, unaffected by spring forces 117 } 118 if (!task) { 119 last_time = raf$1.now(); 120 cancel_task = false;
121 task = loop((now) => { 122 if (cancel_task) { 123 cancel_task = false; 124 task = null; 125 return false; 126 } 127 inv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1); 128 129 // clamp elapsed time to 1/30th of a second, so that longer pauses 130 // (blocked thread or inactive tab) don't cause the spring to go haywire 131 const elapsed = Math.min(now - last_time, 1000 / 30); 132 133 /** @type {TickContext} */ 134 const ctx = { 135 inv_mass, 136 opts: spring, 137 settled: true, 138 dt: (elapsed * 60) / 1000 139 }; 140 // @ts-ignore 141 const next_value = tick_spring(ctx, last_value, value, target_value); 142 last_time = now; 143 last_value = /** @type {T} */ (value); 144 store.set((value = /** @type {T} */ (next_value))); 145 if (ctx.settled) { 146 task = null; 147 } 148 return !ctx.settled; 149 }); 150 } 151 return new Promise((fulfil) => { 152 /** @type {Task} */ (task).promise.then(() => { 153 if (token === current_token) fulfil(); 154 }); 155 }); 156 } 157 /** @type {SpringStore<T>} */ 158 // @ts-expect-error - class-only properties are missing 159 const spring = { 160 set, 161 update: (fn, opts) => set(fn(/** @type {T} */ (target_value), /** @type {T} */ (value)), opts), 162 subscribe: store.subscribe, 163 stiffness, 164 damping, 165 precision 166 }; 167 return spring; 168} 169 170var root$1 = from_html(`<div><svg viewBox="-1200 -1200 3000 3000" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-1vhirvf"><g><path d="M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z" fill="#FF7C00" fill-opacity="0.4" class="svelte-1vhirvf"></path><path d="M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z" fill="#FF7C00" class="svelte-1vhirvf"></path><path d="M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z" fill="#FF7C00" fill-opacity="0.4" class="svelte-1vhirvf"></path><path d="M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z" fill="#FF7C00" class="svelte-1vhirvf"></path></g><g><path d="M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z" fill="#FF7C00" fill-opacity="0.4" class="svelte-1vhirvf"></path><path d="M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z" fill="#FF7C00" class="svelte-1vhirvf"></path><path d="M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z" fill="#FF7C00" fill-opacity="0.4" class="svelte-1vhirvf"></path><path d="M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z" fill="#FF7C00" class="svelte-1vhirvf"></path></g></svg></div>`); 171 172function Loader($$anchor, $$props) { 173 push($$props, true); 174 175 const $top = () => store_get(top, '$top', $$stores); 176 const $bottom = () => store_get(bottom, '$bottom', $$stores); 177 const [$$stores, $$cleanup] = setup_stores(); 178 let margin = prop($$props, 'margin', 3, true); 179 const top = spring([0, 0]); 180 const bottom = spring([0, 0]); 181 let dismounted = state(false); 182 183 async function animate() { 184 await Promise.all([top.set([125, 140]), bottom.set([-125, -140])]); 185 await Promise.all([top.set([-125, 140]), bottom.set([125, -140])]); 186 await Promise.all([top.set([-125, 0]), bottom.set([125, -0])]); 187 await Promise.all([top.set([125, 0]), bottom.set([-125, 0])]); 188 } 189 190 async function run() { 191 await animate(); 192 193 if (!get(dismounted)) run(); 194 } 195 196 async function loading() { 197 await Promise.all([top.set([125, 0]), bottom.set([-125, 0])]); 198 run(); 199 } 200 201 user_effect(() => { 202 loading(); 203 204 return () => { 205 set(dismounted, true); 206 }; 207 }); 208 209 var div = root$1(); 210 let classes; 211 var svg = child(div); 212 var g = child(svg); 213 var g_1 = sibling(g); 214 215 reset(svg); 216 reset(div); 217 218 template_effect(() => { 219 classes = set_class(div, 1, 'svelte-1vhirvf', null, classes, { margin: margin() }); 220 set_style(g, `transform: translate(${$top()[0] ?? ''}px, ${$top()[1] ?? ''}px);`); 221 set_style(g_1, `transform: translate(${$bottom()[0] ?? ''}px, ${$bottom()[1] ?? ''}px);`); 222 }); 223 224 append($$anchor, div); 225 pop(); 226 $$cleanup(); 227} 228 229let items = []; 230let called = false; 231const is_browser = typeof window !== "undefined"; 232const raf = is_browser ? window.requestAnimationFrame : (cb) => {}; 233 234async function scroll_into_view(el, enable = true) { 235 if (window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && enable !== true) { 236 return; 237 } 238 239 items.push(el); 240 241 if (!called) called = true; else return; 242 243 await tick(); 244 245 raf(() => { 246 let min = [0, 0]; 247 248 for (let i = 0; i < items.length; i++) { 249 const element = items[i]; 250 const box = element.getBoundingClientRect(); 251 252 if (i === 0 || box.top + window.scrollY <= min[0]) { 253 min[0] = box.top + window.scrollY; 254 min[1] = i; 255 } 256 } 257 258 window.scrollTo({ top: min[0] - 20, behavior: "smooth" }); 259 called = false;
260 items = []; 261 }); 262} 263 264var root_1 = from_html(`<div class="validation-error svelte-1uj8rng"> <button class="svelte-1uj8rng"><!></button></div>`); 265var root_3 = from_html(`<div class="eta-bar svelte-1uj8rng"></div>`); 266var root_6 = from_html(`<!> `, 1); 267var root_17 = from_html(`<!> <!> <!> <!>`, 1); 268var root_14 = from_html(`<div class="progress-level svelte-1uj8rng"><div class="progress-level-inner svelte-1uj8rng"><!></div> <div class="progress-bar-wrap svelte-1uj8rng"><div class="progress-bar svelte-1uj8rng"></div></div></div>`); 269var root_24 = from_html(`<p class="loading svelte-1uj8rng"> </p> <!>`, 1); 270var root_2 = from_html(`<!> <div><!> <!></div> <!> <!>`, 1); 271var root_26 = from_html(`<div class="clear-status svelte-1uj8rng"><!></div> <span class="error svelte-1uj8rng"> </span> <!>`, 1); 272var root = from_html(`<div data-testid="status-tracker"><!> <!></div>`); 273 274function Static($$anchor, $$props) { 275 push($$props, true); 276 277 let eta = prop($$props, 'eta', 7, null), 278 scroll_to_output = prop($$props, 'scroll_to_output', 3, false), 279 timer = prop($$props, 'timer', 3, true), 280 show_progress = prop($$props, 'show_progress', 3, "full"), 281 message = prop($$props, 'message', 3, null), 282 progress = prop($$props, 'progress', 3, null), 283 variant = prop($$props, 'variant', 3, "default"), 284 loading_text = prop($$props, 'loading_text', 3, "Loading..."), 285 absolute = prop($$props, 'absolute', 3, true), 286 translucent = prop($$props, 'translucent', 3, false), 287 border = prop($$props, 'border', 3, false), 288 validation_error = prop($$props, 'validation_error', 7, null), 289 show_validation_error = prop($$props, 'show_validation_error', 3, true), 290 type = prop($$props, 'type', 3, null); 291 292 let el; 293 let _timer = false; 294 let timer_start = state(0); 295 let old_eta = state(null); 296 let eta_from_start = state(null); 297 let message_visible = state(false); 298 let formatted_eta = state(null); 299 const should_hide = user_derived(() => type() === "input" || !$$props.status || $$props.status === "complete" || show_progress() === "hidden" || $$props.status == "streaming" || !!(show_validation_error() && validation_error())); 300 let timer_diff = state(0); 301 302 const eta_level = user_derived(() => get(eta_from_start) === null || get(eta_from_start) <= 0 || !get(timer_diff) 303 ? 0 304 : Math.min(get(timer_diff) / get(eta_from_start), 1)); 305 306 const formatted_timer = user_derived(() => get(timer_diff).toFixed(1)); 307 let show_eta_bar = user_derived(() => progress() != null ? false : true); 308 309 function run() { 310 raf(() => { 311 set(timer_diff, (performance.now() - get(timer_start)) / 1000); 312 313 if (_timer) run(); 314 }); 315 } 316 317 let progress_level = user_derived(() => { 318 let _progress_level = null; 319 320 if (progress() != null) { 321 _progress_level = progress().map((p) => { 322 if (p.index != null && p.length != null) { 323 return p.index / p.length; 324 } else if (p.progress != null) { 325 return p.progress; 326 } 327 328 return undefined; 329 }); 330 } else { 331 _progress_level = null; 332 } 333 334 let _last_progress_level; 335 let transition = ""; 336 337 if (_progress_level) { 338 _last_progress_level = _progress_level[_progress_level.length - 1]; 339 340 if (_last_progress_level === 0) { 341 transition = "0"; 342 } else { 343 transition = "150ms"; 344 } 345 } else { 346 _last_progress_level = undefined; 347 } 348 349 return { 350 progress_level: _progress_level, 351 last_progress_level: _last_progress_level, 352 progress_bar_transition: transition 353 }; 354 }); 355 356 function start_timer() { 357 if (_timer) return; 358 359 set(old_eta, set(formatted_eta, null), true); 360 set(timer_start, performance.now(), true); 361 _timer = true; 362 run(); 363 } 364 365 function stop_timer() { 366 set(old_eta, set(formatted_eta, null), true); 367 368 if (!_timer) return; 369 370 _timer = false; 371 } 372 373 user_effect(() => { 374 if ($$props.status === "pending") { 375 start_timer(); 376 } else { 377 untrack(() => { 378 stop_timer(); 379 }); 380 } 381 }); 382 383 user_effect(() => { 384 if (el && scroll_to_output() && ($$props.status === "pending" || $$props.status === "complete")) { 385 scroll_into_view(el, $$props.autoscroll); 386 } 387 }); 388 389 user_effect(() => { 390 if (eta() === null) { 391 eta(get(old_eta)); 392 } 393 394 if (eta() != null && get(old_eta) !== eta()) { 395 set(eta_from_start, (performance.now() - get(timer_start)) / 1000 + eta()); 396 set(formatted_eta, get(eta_from_start).toFixed(1), true); 397 set(old_eta, eta(), true); 398 } 399 }); 400 401 function close_message() { 402 set(message_visible, false); 403 } 404 405 user_effect(() => { 406 untrack(() => { 407 close_message(); 408 }); 409 410 if ($$props.status === "error" && message()) { 411 set(message_visible, true); 412 } 413 }); 414 415 var div = root(); 416 let classes; 417 let styles; 418 var node = child(div); 419 420 { 421 var consequent = ($$anchor) => { 422 var div_1 = root_1(); 423 var text = child(div_1); 424 var button = sibling(text);
425 var node_1 = child(button); 426 427 { 428 let $0 = user_derived(() => $$props.i18n ? $$props.i18n("common.clear") : "Clear"); 429 430 IconButton(node_1, { 431 get Icon() { 432 return Clear; 433 }, 434 435 get label() { 436 return get($0); 437 }, 438 disabled: false, 439 size: 'x-small', 440 background: 'var(--background-fill-primary)', 441 color: 'var(--error-background-text)', 442 border: 'var(--border-color-primary)', 443 onclick: () => validation_error(null) 444 }); 445 } 446 447 reset(button); 448 reset(div_1); 449 template_effect(() => set_text(text, `${validation_error() ?? ''} `)); 450 append($$anchor, div_1); 451 }; 452 453 if_block(node, ($$render) => { 454 if (validation_error() && show_validation_error()) $$render(consequent); 455 }); 456 } 457 458 var node_2 = sibling(node, 2); 459 460 { 461 var consequent_17 = ($$anchor) => { 462 var fragment = root_2(); 463 var node_3 = first_child(fragment); 464 465 { 466 var consequent_1 = ($$anchor) => { 467 var div_2 = root_3(); 468 let styles_1; 469 470 template_effect(() => styles_1 = set_style(div_2, '', styles_1, { 471 transform: `translateX(${(get(eta_level) || 0) * 100 - 100}%)` 472 })); 473 474 append($$anchor, div_2); 475 }; 476 477 if_block(node_3, ($$render) => { 478 if (variant() === "default" && get(show_eta_bar) && show_progress() === "full") $$render(consequent_1); 479 }); 480 } 481 482 var div_3 = sibling(node_3, 2); 483 let classes_1; 484 var node_4 = child(div_3); 485 486 { 487 var consequent_4 = ($$anchor) => { 488 var fragment_1 = comment(); 489 var node_5 = first_child(fragment_1); 490 491 each(node_5, 17, progress, index, ($$anchor, p) => { 492 var fragment_2 = comment(); 493 var node_6 = first_child(fragment_2); 494 495 { 496 var consequent_3 = ($$anchor) => { 497 var fragment_3 = root_6(); 498 var node_7 = first_child(fragment_3); 499 500 { 501 var consequent_2 = ($$anchor) => { 502 var text_1 = text(); 503 504 template_effect(($0, $1) => set_text(text_1, `${$0 ?? ''}/${$1 ?? ''}`), [ 505 () => pretty_si(get(p).index || 0), 506 () => pretty_si(get(p).length) 507 ]); 508 509 append($$anchor, text_1); 510 }; 511 512 var alternate = ($$anchor) => { 513 var text_2 = text(); 514 515 template_effect(($0) => set_text(text_2, $0), [() => pretty_si(get(p).index || 0)]); 516 append($$anchor, text_2); 517 }; 518 519 if_block(node_7, ($$render) => { 520 if (get(p).length != null) $$render(consequent_2); else $$render(alternate, false); 521 }); 522 } 523 524 var text_3 = sibling(node_7); 525 526 template_effect(() => set_text(text_3, ` ${get(p).unit ?? ''} | `)); 527 append($$anchor, fragment_3); 528 }; 529 530 if_block(node_6, ($$render) => { 531 if (get(p).index != null) $$render(consequent_3); 532 }); 533 } 534 535 append($$anchor, fragment_2); 536 }); 537 538 append($$anchor, fragment_1); 539 }; 540 541 var alternate_2 = ($$anchor) => { 542 var fragment_6 = comment(); 543 var node_8 = first_child(fragment_6); 544 545 { 546 var consequent_5 = ($$anchor) => { 547 var text_4 = text(); 548 549 template_effect(() => set_text(text_4, `queue: ${$$props.queue_position + 1}/${$$props.queue_size ?? ''} |`)); 550 append($$anchor, text_4); 551 }; 552 553 var alternate_1 = ($$anchor) => { 554 var fragment_8 = comment(); 555 var node_9 = first_child(fragment_8); 556 557 { 558 var consequent_6 = ($$anchor) => { 559 var text_5 = text('processing |'); 560 561 append($$anchor, text_5); 562 }; 563 564 if_block( 565 node_9, 566 ($$render) => { 567 if ($$props.queue_position === 0) $$render(consequent_6); 568 }, 569 true 570 ); 571 } 572 573 append($$anchor, fragment_8); 574 }; 575 576 if_block( 577 node_8, 578 ($$render) => { 579 if ($$props.queue_position !== null && $$props.queue_size !== undefined && $$props.queue_position >= 0) $$render(consequent_5); else $$render(alternate_1, false); 580 }, 581 true 582 ); 583 } 584 585 append($$anchor, fragment_6); 586 }; 587 588 if_block(node_4, ($$render) => { 589 if (progress()) $$render(consequent_4); else $$render(alternate_2, false); 590 }); 591 } 592
593 var node_10 = sibling(node_4, 2); 594 595 { 596 var consequent_7 = ($$anchor) => { 597 var text_6 = text(); 598 599 template_effect(() => set_text(text_6, `${get(formatted_timer) ?? ''}${eta() ? `/${get(formatted_eta)}` : ""}s`)); 600 append($$anchor, text_6); 601 }; 602 603 if_block(node_10, ($$render) => { 604 if (timer()) $$render(consequent_7); 605 }); 606 } 607 608 reset(div_3); 609 610 var node_11 = sibling(div_3, 2); 611 612 { 613 var consequent_14 = ($$anchor) => { 614 var div_4 = root_14(); 615 var div_5 = child(div_4); 616 var node_12 = child(div_5); 617 618 { 619 var consequent_13 = ($$anchor) => { 620 var fragment_10 = comment(); 621 var node_13 = first_child(fragment_10); 622 623 each(node_13, 17, progress, index, ($$anchor, p, i) => { 624 var fragment_11 = comment(); 625 var node_14 = first_child(fragment_11); 626 627 { 628 var consequent_12 = ($$anchor) => { 629 var fragment_12 = root_17(); 630 var node_15 = first_child(fragment_12); 631 632 { 633 var consequent_8 = ($$anchor) => { 634 var text_7 = text('Â /'); 635 636 append($$anchor, text_7); 637 }; 638 639 if_block(node_15, ($$render) => { 640 if (i !== 0) $$render(consequent_8); 641 }); 642 } 643
644 var node_16 = sibling(node_15, 2); 645 646 { 647 var consequent_9 = ($$anchor) => { 648 var text_8 = text(); 649 650 template_effect(() => set_text(text_8, get(p).desc)); 651 append($$anchor, text_8); 652 }; 653 654 if_block(node_16, ($$render) => { 655 if (get(p).desc != null) $$render(consequent_9); 656 }); 657 } 658 659 var node_17 = sibling(node_16, 2); 660 661 { 662 var consequent_10 = ($$anchor) => { 663 var text_9 = text('-'); 664 665 append($$anchor, text_9); 666 }; 667 668 if_block(node_17, ($$render) => { 669 if (get(p).desc != null && get(progress_level).progress_level && get(progress_level).progress_level[i] != null) $$render(consequent_10); 670 }); 671 } 672 673 var node_18 = sibling(node_17, 2); 674 675 { 676 var consequent_11 = ($$anchor) => { 677 var text_10 = text(); 678 679 template_effect(($0) => set_text(text_10, `${$0 ?? ''}%`), [ 680 () => (100 * (get(progress_level).progress_level[i] || 0)).toFixed(1) 681 ]); 682 683 append($$anchor, text_10); 684 }; 685 686 if_block(node_18, ($$render) => { 687 if (get(progress_level).progress_level != null) $$render(consequent_11); 688 }); 689 } 690 691 append($$anchor, fragment_12); 692 }; 693 694 if_block(node_14, ($$render) => { 695 if (get(p).desc != null || get(progress_level).progress_level && get(progress_level).progress_level[i] != null) $$render(consequent_12); 696 }); 697 } 698 699 append($$anchor, fragment_11); 700 }); 701 702 append($$anchor, fragment_10); 703 }; 704 705 if_block(node_12, ($$render) => { 706 if (progress() != null) $$render(consequent_13); 707 }); 708 } 709 710 reset(div_5); 711 712 var div_6 = sibling(div_5, 2); 713 var div_7 = child(div_6); 714 let styles_2; 715 716 reset(div_6); 717 reset(div_4); 718 719 template_effect(() => styles_2 = set_style(div_7, '', styles_2, { 720 width: `${get(progress_level).last_progress_level * 100}%`, 721 transition: get(progress_level).progress_bar_transition 722 })); 723 724 append($$anchor, div_4); 725 }; 726 727 var alternate_3 = ($$anchor) => { 728 var fragment_15 = comment();
729 var node_19 = first_child(fragment_15); 730 731 { 732 var consequent_15 = ($$anchor) => { 733 { 734 let $0 = user_derived(() => variant() === "default"); 735 736 Loader($$anchor, { 737 get margin() { 738 return get($0); 739 } 740 }); 741 } 742 }; 743 744 if_block( 745 node_19, 746 ($$render) => { 747 if (show_progress() === "full") $$render(consequent_15); 748 }, 749 true 750 ); 751 } 752 753 append($$anchor, fragment_15); 754 }; 755 756 if_block(node_11, ($$render) => { 757 if (get(progress_level).last_progress_level != null) $$render(consequent_14); else $$render(alternate_3, false); 758 }); 759 } 760 761 var node_20 = sibling(node_11, 2); 762 763 { 764 var consequent_16 = ($$anchor) => { 765 var fragment_17 = root_24(); 766 var p_1 = first_child(fragment_17); 767 var text_11 = child(p_1, true); 768 769 reset(p_1); 770 771 var node_21 = sibling(p_1, 2); 772 773 slot(node_21, $$props, 'additional-loading-text', {}); 774 template_effect(() => set_text(text_11, loading_text())); 775 append($$anchor, fragment_17); 776 }; 777 778 if_block(node_20, ($$render) => { 779 if (!timer()) $$render(consequent_16); 780 }); 781 } 782 783 template_effect(() => classes_1 = set_class(div_3, 1, 'progress-text svelte-1uj8rng', null, classes_1, { 784 'meta-text-center': variant() === "center", 785 'meta-text': variant() === "default" 786 })); 787 788 append($$anchor, fragment); 789 }; 790 791 var alternate_4 = ($$anchor) => { 792 var fragment_18 = comment(); 793 var node_22 = first_child(fragment_18); 794 795 { 796 var consequent_18 = ($$anchor) => { 797 var fragment_19 = root_26(); 798 var div_8 = first_child(fragment_19); 799 var node_23 = child(div_8); 800 801 { 802 let $0 = user_derived(() => $$props.i18n("common.clear")); 803 804 IconButton(node_23, { 805 get Icon() { 806 return Clear; 807 }, 808 809 get label() { 810 return get($0); 811 }, 812 disabled: false, 813 $$events: { 814 click: () => { 815 $$props.on_clear_status?.(); 816 } 817 } 818 }); 819 } 820 821 reset(div_8); 822 823 var span = sibling(div_8, 2); 824 var text_12 = child(span, true); 825 826 reset(span); 827 828 var node_24 = sibling(span, 2); 829 830 slot(node_24, $$props, 'error', {}); 831 template_effect(($0) => set_text(text_12, $0), [() => $$props.i18n("common.error")]); 832 append($$anchor, fragment_19); 833 }; 834 835 if_block( 836 node_22, 837 ($$render) => { 838 if ($$props.status === "error") $$render(consequent_18); 839 }, 840 true 841 ); 842 } 843 844 append($$anchor, fragment_18); 845 }; 846 847 if_block(node_2, ($$render) => { 848 if ($$props.status === "pending") $$render(consequent_17); else $$render(alternate_4, false); 849 }); 850 } 851 852 reset(div); 853 bind_this(div, ($$value) => el = $$value, () => el); 854 855 template_effect(() => { 856 classes = set_class(div, 1, `wrap ${variant() ?? ''} ${show_progress() ?? ''}`, 'svelte-1uj8rng', classes, { 857 'no-click': validation_error() && show_validation_error(), 858 hide: get(should_hide), 859 translucent: variant() === "center" && ($$props.status === "pending" || $$props.status === "error") || translucent() || show_progress() === "minimal" || validation_error(), 860 generating: $$props.status === "generating" && show_progress() === "full", 861 border: border() 862 }); 863 864 styles = set_style(div, '', styles, { 865 position: absolute() ? "absolute" : "static", 866 padding: absolute() ? "0" : "var(--size-8) 0" 867 }); 868 }); 869 870 append($$anchor, div); 871 pop(); 872} 873 874export { Loader as L, Static as S, is_date as i, spring as s }; 875//# sourceMappingURL=index-Lz7fsHFt.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.