PageSourceSearch

https://showlab-showui.hf.space/assets/Index-Ciyw3CZ4.js

js showlab-showui.hf.space collected 2026-10-03 10:21:41 UTC 77,283 bytes, 11 lines download raw bytes

1import"./IconButtonWrapper.svelte_svelte_type_style_lang-DAP8_Zsr.js";import{u as Gt,S as kl,a as pl}from"./utils-BsGrhMNe.js";import{I as Rt}from"./Image-BRVH1yXn.js";import{M as Ft}from"./MarkdownCode-UKT7Q0jB.js";/* empty css                                                   */import"./index-Dj1xzGVg.js";/* empty css                                                   */import"./MarkdownCode.svelte_svelte_type_style_lang-CRfeLYV9.js";import{I as ae}from"./IconButton-DtUbToT-.js";import{C as vt}from"./Check-BiRlaMNo.js";import{C as $t}from"./Copy-CxQ9EyK2.js";import{U as vl}from"./Undo-DCjBnnSO.js";import{I as Ot}from"./IconButtonWrapper-fdTarNL8.js";import{D as $l}from"./DownloadLink-IzUam-rM.js";import{d as Cl}from"./index-CnqicUFC.js";import{C as yl}from"./Clear-By3xiIwg.js";import{C as tl}from"./Community-Dw1micSV.js";import{D as Sl}from"./Download-DVtk-Jv3.js";import{T as Hl}from"./Trash-RbZEwH-j.js";import{B as ql}from"./Block-rEXcgPfT.js";import{B as zl}from"./BlockLabel-CnzaitFN.js";import{S as Ml}from"./index-CAS_VNRG.js";import"./StreamingBar.svelte_svelte_type_style_lang-CxOfZBE-.js";import"./file-url-DgijyRSD.js";import"./context-TgWPFwN2.js";import"./svelte/svelte.js";import"./prism-python-VskFp_Cc.js";const{SvelteComponent:Vl,append:Wt,attr:Q,detach:Ll,init:Il,insert:Nl,noop:Lt,safe_not_equal:Bl,svg_element:It}=window.__gradio__svelte__internal;function Al(n){let e,t,l;return{c(){e=It("svg"),t=It("path"),l=It("path"),Q(t,"fill","currentColor"),Q(t,"d","M17.74 30L16 29l4-7h6a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4h20a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4h-4.84Z"),Q(l,"fill","currentColor"),Q(l,"d","M8 10h16v2H8zm0 6h10v2H8z"),Q(e,"xmlns","http://www.w3.org/2000/svg"),Q(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),Q(e,"aria-hidden","true"),Q(e,"role","img"),Q(e,"class","iconify iconify--carbon"),Q(e,"width","100%"),Q(e,"height","100%"),Q(e,"preserveAspectRatio","xMidYMid meet"),Q(e,"viewBox","0 0 32 32")},m(i,s){Nl(i,e,s),Wt(e,t),Wt(e,l)},p:Lt,i:Lt,o:Lt,d(i){i&&Ll(e)}}}class Tl extends Vl{constructor(e){super(),Il(this,e,null,Al,Bl,{})}}const{SvelteComponent:Dl,append:wt,attr:M,detach:jl,init:El,insert:Zl,noop:Nt,safe_not_equal:Ul,svg_element:tt}=window.__gradio__svelte__internal;function Pl(n){let e,t,l,i,s;return{c(){e=tt("svg"),t=tt("path"),l=tt("path"),i=tt("path"),s=tt("path"),M(t,"d","M19.1679 9C18.0247 6.46819 15.3006 4.5 11.9999 4.5C8.31459 4.5 5.05104 7.44668 4.54932 11"),M(t,"stroke","currentColor"),M(t,"stroke-width","1.5"),M(t,"stroke-linecap","round"),M(t,"stroke-linejoin","round"),M(l,"d","M16 9H19.4C19.7314 9 20 8.73137 20 8.4V5"),M(l,"stroke","currentColor"),M(l,"stroke-width","1.5"),M(l,"stroke-linecap","round"),M(l,"stroke-linejoin","round"),M(i,"d","M4.88146 15C5.92458 17.5318 8.64874 19.5 12.0494 19.5C15.7347 19.5 18.9983 16.5533 19.5 13"),M(i,"stroke","currentColor"),M(i,"stroke-width","1.5"),M(i,"stroke-linecap","round"),M(i,"stroke-linejoin","round"),M(s,"d","M8.04932 15H4.64932C4.31795 15 4.04932 15.2686 4.04932 15.6V19"),M(s,"stroke","currentColor"),M(s,"stroke-width","1.5"),M(s,"stroke-linecap","round"),M(s,"stroke-linejoin","round"),M(e,"width","100%"),M(e,"height","100%"),M(e,"stroke-width","1.5"),M(e,"viewBox","0 0 24 24"),M(e,"fill","none"),M(e,"xmlns","http://www.w3.org/2000/svg"),M(e,"color","currentColor")},m(o,a){Zl(o,e,a),wt(e,t),wt(e,l),wt(e,i),wt(e,s)},p:Nt,i:Nt,o:Nt,d(o){o&&jl(e)}}}class Rl extends Dl{constructor(e){super(),El(this,e,null,Pl,Ul,{})}}const{SvelteComponent:Fl,append:Ol,attr:ue,detach:Jl,init:Gl,insert:Wl,noop:Bt,safe_not_equal:Yl,svg_element:Yt}=window.__gradio__svelte__internal;function Kl(n){let e,t;return{c(){e=Yt("svg"),t=Yt("path"),ue(t,"d","M12 20L12 4M12 20L7 15M12 20L17 15"),ue(t,"stroke","currentColor"),ue(t,"stroke-width","2"),ue(t,"stroke-linecap","round"),ue(t,"stroke-linejoin","round"),ue(e,"width","100%"),ue(e,"height","100%"),ue(e,"viewBox","0 0 24 24"),ue(e,"fill","none"),ue(e,"xmlns","http://www.w3.org/2000/svg")},m(l,i){Wl(l,e,i),Ol(e,t)},p:Bt,i:Bt,o:Bt,d(l){l&&Jl(e)}}}class Ql extends Fl{constructor(e){super(),Gl(this,e,null,Kl,Yl,{})}}const Xl=async n=>(await Promise.all(n.map(async t=>await Promise.all(t.map(async(l,i)=>{if(l===null)return"";let s=i===0?"😃":"🤖",o="";if(typeof l=="string"){const a={audio:/<audio.*?src="(\/file=.*?)"/g,video:/<video.*?src="(\/file=.*?)"/g,image:/<img.*?src="(\/file=.*?)".*?\/>|!\[.*?\]\((\/file=.*?)\)/g};o=l;for(let[r,_]of Object.entries(a)){let u;for(;(u=_.exec(l))!==null;){const f=u[1]||u[2],w=await Gt(f);o=o.replace(f,w)}}}else{if(!l?.url)return"";const a=await Gt(l.url);l.mime_type?.includes("audio")?o=`<audio controls src="${a}"></audio>`:l.mime_type?.includes("video")?o=a:l.mime_type?.includes("image")&&(o=`<img src="${a}" />`)}return`${s}: ${o}`}))))).map(t=>t.join(t[0]!==""&&t[1]!==""?`
2`:"")).join(`
3`),nl=(n,e)=>n.replace('src="/file',`src="${e}file`);function xl(n){return n?n.includes("audio")?"audio":n.includes("video")?"video":n.includes("image")?"image":"file":"file"}function ll(n){const e=Array.isArray(n.file)?n.file[0]:n.file;return{component:xl(e?.mime_type),value:n.file,alt_text:n.alt_text,constructor_args:{},props:{}}}function ei(n,e){return n===null?n:n.map((t,l)=>typeof t.content=="string"?{role:t.role,metadata:t.metadata,content:nl(t.content,e),t
3ype:"text",index:l}:"file"in t.content?{content:ll(t.content),metadata:t.metadata,role:t.role,type:"component",index:l}:{type:"component",...t})}function ti(n,e){return n===null?n:n.flatMap((l,i)=>l.map((s,o)=>{if(s==null)return null;const a=o==0?"user":"assistant";return typeof s=="string"?{role:a,type:"text",content:nl(s,e),metadata:{title:null},index:[i,o]}:"file"in s?{content:ll(s),role:a,type:"component",index:[i,o]}:{role:a,content:s,type:"component",index:[i,o]}})).filter(l=>l!=null)}function nt(n){return n.type==="component"}function We(n,e){const t=n[n.length-1].role==="assistant",l=n[n.length-1].index;return JSON.stringify(l)===JSON.stringify(e[e.length-1].index)&&t}function ni(n,e){const t=[];let l=[],i=null;for(const s of n)e==="tuples"&&(i=null),(s.role==="assistant"||s.role==="user")&&(s.role===i?l.push(s):(l.length>0&&t.push(l),l=[s],i=s.role));return l.length>0&&t.push(l),t}async function li(n,e,t){let l=[],i=[];return n.forEach(o=>{if(e[o]||o==="file")return;const{name:a,component:r}=t(o,"base");l.push(a),i.push(r)}),(await Promise.all(i)).forEach((o,a)=>{e[l[a]]=o.default}),e}function ii(n){if(!n)return[];let e=new Set;return n.forEach(t=>{t.type==="component"&&e.add(t.content.component)}),Array.from(e)}const{SvelteComponent:oi,attr:si,bubble:Je,check_outros:Ee,construct_svelte_component:ee,create_component:te,destroy_component:ne,detach:ze,element:ai,empty:Ze,flush:fe,group_outros:Ue,init:ri,insert:Me,mount_component:le,noop:_i,safe_not_equal:ui,transition_in:W,transition_out:Y}=window.__gradio__svelte__internal;function fi(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_share_button:!0,i18n:o[6],gradio:{dispatch:ki}}}}return i&&(e=ee(i,s(n)),e.$on("load",n[15])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0},p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[15]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2]),a&64&&(r.i18n=o[6]),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function ci(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{value:o[2],show_label:!1,label:"chatbot-image",show_download_button:o[9],i18n:o[6]}}}return i&&(e=ee(i,s(n)),e.$on("load",n[14])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0},p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[14]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2]),a&512&&(r.show_download_button=o[9]),a&64&&(r.i18n=o[6]),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function mi(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{autoplay:!0,value:o[2].video||o[2],show_label:!1,show_share_button:!0,i18n:o[6],upload:o[7],show_download_button:o[9],$$slots:{default:[bi]},$$scope:{ctx:o}}}}return i&&(e=ee(i,s(n)),e.$on("load",n[13])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0},p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[13]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2].video||o[2]),a&64&&(r.i18n=o[6]),a&128&&(r.upload=o[7]),a&512&&(r.show_download_button=o[9]),a&65536&&(r.$$scope={dirty:a,ctx:o}),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function hi(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{value:o[2],show_label:!1,show_share_button:!0,i18n:o[6],label:"",waveform_settings:{},waveform_options:{},show_download_button:o[9]}}}return i&&(e=ee(i,s(n)),e.$on("load",n[12])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0},p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[12]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2]),a&64&&(r.i18n=o[6]),a&512&&(r.show_download_button=o[9]),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function di(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{value:o[2],target:o[3],theme_mode:o[4],bokeh_version:o[5].bokeh_version,caption:"",show_actions_button:!0}}}return i&&(e=ee(i,s(n)),e.$on("load",n[11])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0}
3,p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[11]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2]),a&8&&(r.target=o[3]),a&16&&(r.theme_mode=o[4]),a&32&&(r.bokeh_version=o[5].bokeh_version),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function gi(n){let e,t,l;var i=n[1][n[0]];function s(o,a){return{props:{value:o[2],show_label:!1,i18n:o[6],label:"",_fetch:o[8],allow_preview:!1,interactive:!1,mode:"minimal",fixed_height:1}}}return i&&(e=ee(i,s(n)),e.$on("load",n[10])),{c(){e&&te(e.$$.fragment),t=Ze()},m(o,a){e&&le(e,o,a),Me(o,t,a),l=!0},p(o,a){if(a&3&&i!==(i=o[1][o[0]])){if(e){Ue();const r=e;Y(r.$$.fragment,1,0,()=>{ne(r,1)}),Ee()}i?(e=ee(i,s(o)),e.$on("load",o[10]),te(e.$$.fragment),W(e.$$.fragment,1),le(e,t.parentNode,t)):e=null}else if(i){const r={};a&4&&(r.value=o[2]),a&64&&(r.i18n=o[6]),a&256&&(r._fetch=o[8]),e.$set(r)}},i(o){l||(e&&W(e.$$.fragment,o),l=!0)},o(o){e&&Y(e.$$.fragment,o),l=!1},d(o){o&&ze(t),e&&ne(e,o)}}}function bi(n){let e;return{c(){e=ai("track"),si(e,"kind","captions")},m(t,l){Me(t,e,l)},p:_i,d(t){t&&ze(e)}}}function wi(n){let e,t,l,i;const s=[gi,di,hi,mi,ci,fi],o=[];function a(r,_){return r[0]==="gallery"?0:r[0]==="plot"?1:r[0]==="audio"?2:r[0]==="video"?3:r[0]==="image"?4:r[0]==="html"?5:-1}return~(e=a(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),l=Ze()},m(r,_){~e&&o[e].m(r,_),Me(r,l,_),i=!0},p(r,[_]){let u=e;e=a(r),e===u?~e&&o[e].p(r,_):(t&&(Ue(),Y(o[u],1,1,()=>{o[u]=null}),Ee()),~e?(t=o[e],t?t.p(r,_):(t=o[e]=s[e](r),t.c()),W(t,1),t.m(l.parentNode,l)):t=null)},i(r){i||(W(t),i=!0)},o(r){Y(t),i=!1},d(r){r&&ze(l),~e&&o[e].d(r)}}}const ki=()=>{};function pi(n,e,t){let{type:l}=e,{components:i}=e,{value:s}=e,{target:o}=e,{theme_mode:a}=e,{props:r}=e,{i18n:_}=e,{upload:u}=e,{_fetch:f}=e,{allow_file_downloads:w}=e;function m(b){Je.call(this,n,b)}function h(b){Je.call(this,n,b)}function k(b){Je.call(this,n,b)}function S(b){Je.call(this,n,b)}function C(b){Je.call(this,n,b)}function H(b){Je.call(this,n,b)}return n.$$set=b=>{"type"in b&&t(0,l=b.type),"components"in b&&t(1,i=b.components),"value"in b&&t(2,s=b.value),"target"in b&&t(3,o=b.target),"theme_mode"in b&&t(4,a=b.theme_mode),"props"in b&&t(5,r=b.props),"i18n"in b&&t(6,_=b.i18n),"upload"in b&&t(7,u=b.upload),"_fetch"in b&&t(8,f=b._fetch),"allow_file_downloads"in b&&t(9,w=b.allow_file_downloads)},[l,i,s,o,a,r,_,u,f,w,m,h,k,S,C,H]}class vi extends oi{constructor(e){super(),ri(this,e,pi,wi,ui,{type:0,components:1,value:2,target:3,theme_mode:4,props:5,i18n:6,upload:7,_fetch:8,allow_file_downloads:9})}get type(){return this.$$.ctx[0]}set type(e){this.$$set({type:e}),fe()}get components(){return this.$$.ctx[1]}set components(e){this.$$set({components:e}),fe()}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),fe()}get target(){return this.$$.ctx[3]}set target(e){this.$$set({target:e}),fe()}get theme_mode(){return this.$$.ctx[4]}set theme_mode(e){this.$$set({theme_mode:e}),fe()}get props(){return this.$$.ctx[5]}set props(e){this.$$set({props:e}),fe()}get i18n(){return this.$$.ctx[6]}set i18n(e){this.$$set({i18n:e}),fe()}get upload(){return this.$$.ctx[7]}set upload(e){this.$$set({upload:e}),fe()}get _fetch(){return this.$$.ctx[8]}set _fetch(e){this.$$set({_fetch:e}),fe()}get allow_file_downloads(){return this.$$.ctx[9]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),fe()}}const{SvelteComponent:$i,append:Ge,attr:lt,check_outros:Ci,create_slot:yi,detach:il,element:it,flush:Kt,get_all_dirty_from_scope:Si,get_slot_changes:Hi,group_outros:qi,init:zi,insert:ol,listen:Mi,safe_not_equal:Vi,set_data:Li,set_style:Qt,space:Xt,text:Ii,transition_in:pt,transition_out:Ut,update_slot_base:Ni}=window.__gradio__svelte__internal;function xt(n){let e,t;const l=n[4].default,i=yi(l,n,n[3],null);return{c(){e=it("div"),i&&i.c(),lt(e,"class","content svelte-1e60bn1")},m(s,o){ol(s,e,o),i&&i.m(e,null),t=!0},p(s,o){i&&i.p&&(!t||o&8)&&Ni(i,l,s,s[3],t?Hi(l,s[3],o,null):Si(s[3]),null)},i(s){t||(pt(i,s),t=!0)},o(s){Ut(i,s),t=!1},d(s){s&&il(e),i&&i.d(s)}}}function Bi(n){let e,t,l,i,s,o,a,r,_,u,f=n[0]&&xt(n);return{c(){e=it("button"),t=it("div"),l=it("span"),i=Ii(n[1]),s=Xt(),o=it("span"),o.textContent="▼",a=Xt(),f&&f.c(),lt(l,"class","title-text svelte-1e60bn1"),lt(o,"class","arrow svelte-1e60bn1"),Qt(o,"transform",n[0]?"rotate(0)":"rotate(90deg)"),lt(t,"class","title svelte-1e60bn1"),lt(e,"class","box svelte-1e60bn1")},m(w,m){ol(w,e,m),Ge(e,t),Ge(t,l),Ge(l,i),Ge(t,s),Ge(t,o),Ge(e,a),f&&f.m(e,null),r=!0,_||(u=Mi(e,"click",n[2]),_=!0)},p(w,[m]){(!r||m&2)&&Li(i,w[1]),m&1&&Qt(o,"transform",w[0]?"rotate(0)":"rotate(90deg)"),w[0]?f?(f.p(w,m),m&1&&pt(f,1)):(f=xt(w),f.c(),pt(f,1),f.m(e,null)):f&&(qi(),Ut(f,1,1,()=>{f=null}),Ci())},i(w){r||(pt(f),r=!0)},o(w){Ut(f),r=!1},d(w){w&&il(e),f&&f.d(),_=!1,u()}}}function Ai(n,e,t){let{$$slots:l={},$$scope:i}=e,{expanded:s=!1}
3=e,{title:o}=e;function a(){t(0,s=!s)}return n.$$set=r=>{"expanded"in r&&t(0,s=r.expanded),"title"in r&&t(1,o=r.title),"$$scope"in r&&t(3,i=r.$$scope)},[s,o,a,i,l]}class Ti extends $i{constructor(e){super(),zi(this,e,Ai,Bi,Vi,{expanded:0,title:1})}get expanded(){return this.$$.ctx[0]}set expanded(e){this.$$set({expanded:e}),Kt()}get title(){return this.$$.ctx[1]}set title(e){this.$$set({title:e}),Kt()}}const{SvelteComponent:Di,append:ji,attr:Ne,detach:Ei,init:Zi,insert:Ui,noop:At,safe_not_equal:Pi,svg_element:en}=window.__gradio__svelte__internal;function Ri(n){let e,t;return{c(){e=en("svg"),t=en("path"),Ne(t,"d","M11.25 6.61523H9.375V1.36523H11.25V6.61523ZM3.375 1.36523H8.625V6.91636L7.48425 8.62748L7.16737 10.8464C7.14108 11.0248 7.05166 11.1879 6.91535 11.3061C6.77904 11.4242 6.60488 11.4896 6.4245 11.4902H6.375C6.07672 11.4899 5.79075 11.3713 5.57983 11.1604C5.36892 10.9495 5.2503 10.6635 5.25 10.3652V8.11523H2.25C1.85233 8.11474 1.47109 7.95654 1.18989 7.67535C0.908691 7.39415 0.750496 7.01291 0.75 6.61523V3.99023C0.750992 3.29435 1.02787 2.62724 1.51994 2.13517C2.01201 1.64311 2.67911 1.36623 3.375 1.36523Z"),Ne(t,"fill","currentColor"),Ne(e,"width","100%"),Ne(e,"height","100%"),Ne(e,"viewBox","0 0 12 12"),Ne(e,"fill","none"),Ne(e,"xmlns","http://www.w3.org/2000/svg")},m(l,i){Ui(l,e,i),ji(e,t)},p:At,i:At,o:At,d(l){l&&Ei(e)}}}class tn extends Di{constructor(e){super(),Zi(this,e,null,Ri,Pi,{})}}const{SvelteComponent:Fi,append:Oi,attr:Be,detach:Ji,init:Gi,insert:Wi,noop:Tt,safe_not_equal:Yi,svg_element:nn}=window.__gradio__svelte__internal;function Ki(n){let e,t;return{c(){e=nn("svg"),t=nn("path"),Be(t,"d","M2.25 8.11523H4.5V10.3652C4.5003 10.6635 4.61892 10.9495 4.82983 11.1604C5.04075 11.3713 5.32672 11.4899 5.625 11.4902H6.42488C6.60519 11.4895 6.77926 11.4241 6.91549 11.3059C7.05172 11.1878 7.14109 11.0248 7.16737 10.8464L7.48425 8.62748L8.82562 6.61523H11.25V1.36523H3.375C2.67911 1.36623 2.01201 1.64311 1.51994 2.13517C1.02787 2.62724 0.750992 3.29435 0.75 3.99023V6.61523C0.750496 7.01291 0.908691 7.39415 1.18989 7.67535C1.47109 7.95654 1.85233 8.11474 2.25 8.11523ZM9 2.11523H10.5V5.86523H9V2.11523ZM1.5 3.99023C1.5006 3.49314 1.69833 3.01657 2.04983 2.66507C2.40133 2.31356 2.8779 2.11583 3.375 2.11523H8.25V6.12661L6.76575 8.35298L6.4245 10.7402H5.625C5.52554 10.7402 5.43016 10.7007 5.35983 10.6304C5.28951 10.5601 5.25 10.4647 5.25 10.3652V7.36523H2.25C2.05118 7.36494 1.86059 7.28582 1.72 7.14524C1.57941 7.00465 1.5003 6.81406 1.5 6.61523V3.99023Z"),Be(t,"fill","currentColor"),Be(e,"width","100%"),Be(e,"height","100%"),Be(e,"viewBox","0 0 12 12"),Be(e,"fill","none"),Be(e,"xmlns","http://www.w3.org/2000/svg")},m(l,i){Wi(l,e,i),Oi(e,t)},p:Tt,i:Tt,o:Tt,d(l){l&&Ji(e)}}}class ln extends Fi{constructor(e){super(),Gi(this,e,null,Ki,Yi,{})}}const{SvelteComponent:Qi,append:Xi,attr:Ae,detach:xi,init:eo,insert:to,noop:Dt,safe_not_equal:no,svg_element:on}=window.__gradio__svelte__internal;function lo(n){let e,t;return{c(){e=on("svg"),t=on("path"),Ae(t,"d","M0.75 6.24023H2.625V11.4902H0.75V6.24023ZM8.625 11.4902H3.375V5.93911L4.51575 4.22798L4.83263 2.00911C4.85892 1.83065 4.94834 1.66754 5.08465 1.5494C5.22096 1.43125 5.39512 1.36591 5.5755 1.36523H5.625C5.92328 1.36553 6.20925 1.48415 6.42017 1.69507C6.63108 1.90598 6.7497 2.19196 6.75 2.49023V4.74023H9.75C10.1477 4.74073 10.5289 4.89893 10.8101 5.18012C11.0913 5.46132 11.2495 5.84256 11.25 6.24023V8.86523C11.249 9.56112 10.9721 10.2282 10.4801 10.7203C9.98799 11.2124 9.32089 11.4892 8.625 11.4902Z"),Ae(t,"fill","currentColor"),Ae(e,"width","100%"),Ae(e,"height","100%"),Ae(e,"viewBox","0 0 12 12"),Ae(e,"fill","none"),Ae(e,"xmlns","http://www.w3.org/2000/svg")},m(l,i){to(l,e,i),Xi(e,t)},p:Dt,i:Dt,o:Dt,d(l){l&&xi(e)}}}class sn extends Qi{constructor(e){super(),eo(this,e,null,lo,no,{})}}const{SvelteComponent:io,append:oo,attr:Te,detach:so,init:ao,insert:ro,noop:jt,safe_not_equal:_o,svg_element:an}=window.__gradio__svelte__internal;function uo(n){let e,t;return{c(){e=an("svg"),t=an("path"),Te(t,"d","M9.75 4.74023H7.5V2.49023C7.4997 2.19196 7.38108 1.90598 7.17017 1.69507C6.95925 1.48415 6.67328 1.36553 6.375 1.36523H5.57512C5.39481 1.366 5.22074 1.43138 5.08451 1.54952C4.94828 1.66766 4.85891 1.83072 4.83262 2.00911L4.51575 4.22798L3.17438 6.24023H0.75V11.4902H8.625C9.32089 11.4892 9.98799 11.2124 10.4801 10.7203C10.9721 10.2282 11.249 9.56112 11.25 8.86523V6.24023C11.2495 5.84256 11.0913 5.46132 10.8101 5.18012C10.5289 4.89893 10.1477 4.74073 9.75 4.74023ZM3 10.7402H1.5V6.99
3023H3V10.7402ZM10.5 8.86523C10.4994 9.36233 10.3017 9.8389 9.95017 10.1904C9.59867 10.5419 9.1221 10.7396 8.625 10.7402H3.75V6.72886L5.23425 4.50248L5.5755 2.11523H6.375C6.47446 2.11523 6.56984 2.15474 6.64017 2.22507C6.71049 2.2954 6.75 2.39078 6.75 2.49023V5.49023H9.75C9.94882 5.49053 10.1394 5.56965 10.28 5.71023C10.4206 5.85082 10.4997 6.04141 10.5 6.24023V8.86523Z"),Te(t,"fill","currentColor"),Te(e,"width","100%"),Te(e,"height","100%"),Te(e,"viewBox","0 0 12 12"),Te(e,"fill","none"),Te(e,"xmlns","http://www.w3.org/2000/svg")},m(l,i){ro(l,e,i),oo(e,t)},p:jt,i:jt,o:jt,d(l){l&&so(e)}}}class rn extends io{constructor(e){super(),ao(this,e,null,uo,_o,{})}}const{SvelteComponent:fo,create_component:_n,destroy_component:un,detach:co,flush:mo,init:ho,insert:go,mount_component:fn,safe_not_equal:bo,space:wo,transition_in:cn,transition_out:mn}=window.__gradio__svelte__internal;function ko(n){let e,t,l,i;return e=new ae({props:{Icon:n[1]==="dislike"?tn:ln,label:n[1]==="dislike"?"clicked dislike":"dislike",color:n[1]==="dislike"?"var(--color-accent)":"var(--block-label-text-color)"}}),e.$on("click",n[2]),l=new ae({props:{Icon:n[1]==="like"?sn:rn,label:n[1]==="like"?"clicked like":"like",color:n[1]==="like"?"var(--color-accent)":"var(--block-label-text-color)"}}),l.$on("click",n[3]),{c(){_n(e.$$.fragment),t=wo(),_n(l.$$.fragment)},m(s,o){fn(e,s,o),go(s,t,o),fn(l,s,o),i=!0},p(s,[o]){const a={};o&2&&(a.Icon=s[1]==="dislike"?tn:ln),o&2&&(a.label=s[1]==="dislike"?"clicked dislike":"dislike"),o&2&&(a.color=s[1]==="dislike"?"var(--color-accent)":"var(--block-label-text-color)"),e.$set(a);const r={};o&2&&(r.Icon=s[1]==="like"?sn:rn),o&2&&(r.label=s[1]==="like"?"clicked like":"like"),o&2&&(r.color=s[1]==="like"?"var(--color-accent)":"var(--block-label-text-color)"),l.$set(r)},i(s){i||(cn(e.$$.fragment,s),cn(l.$$.fragment,s),i=!0)},o(s){mn(e.$$.fragment,s),mn(l.$$.fragment,s),i=!1},d(s){s&&co(t),un(e,s),un(l,s)}}}function po(n,e,t){let{handle_action:l}=e,i=null;const s=()=>{t(1,i="dislike"),l(i)},o=()=>{t(1,i="like"),l(i)};return n.$$set=a=>{"handle_action"in a&&t(0,l=a.handle_action)},[l,i,s,o]}class vo extends fo{constructor(e){super(),ho(this,e,po,ko,bo,{handle_action:0})}get handle_action(){return this.$$.ctx[0]}set handle_action(e){this.$$set({handle_action:e}),mo()}}const{SvelteComponent:$o,create_component:Co,destroy_component:yo,flush:So,init:Ho,mount_component:qo,safe_not_equal:zo,transition_in:Mo,transition_out:Vo}=window.__gradio__svelte__internal,{onDestroy:Lo}=window.__gradio__svelte__internal;function Io(n){let e,t;return e=new ae({props:{label:n[0]?"Copied message":"Copy message",Icon:n[0]?vt:$t}}),e.$on("click",n[1]),{c(){Co(e.$$.fragment)},m(l,i){qo(e,l,i),t=!0},p(l,[i]){const s={};i&1&&(s.label=l[0]?"Copied message":"Copy message"),i&1&&(s.Icon=l[0]?vt:$t),e.$set(s)},i(l){t||(Mo(e.$$.fragment,l),t=!0)},o(l){Vo(e.$$.fragment,l),t=!1},d(l){yo(e,l)}}}function No(n,e,t){let l=!1,{value:i}=e,s;function o(){t(0,l=!0),s&&clearTimeout(s),s=setTimeout(()=>{t(0,l=!1)},2e3)}async function a(){if("clipboard"in navigator)await navigator.clipboard.writeText(i),o();else{const r=document.createElement("textarea");r.value=i,r.style.position="absolute",r.style.left="-999999px",document.body.prepend(r),r.select();try{document.execCommand("copy"),o()}catch(_){console.error(_)}finally{r.remove()}}}return Lo(()=>{s&&clearTimeout(s)}),n.$$set=r=>{"value"in r&&t(2,i=r.value)},[l,a,i]}class Bo extends $o{constructor(e){super(),Ho(this,e,No,Io,zo,{value:2})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),So()}}const{SvelteComponent:Ao,attr:hn,check_outros:ot,create_component:rt,destroy_component:_t,detach:Ye,element:To,empty:sl,flush:ce,group_outros:st,init:Do,insert:Ke,mount_component:ut,safe_not_equal:jo,space:Et,transition_in:D,transition_out:U}=window.__gradio__svelte__internal;function dn(n){let e,t,l,i;return t=new Ot({props:{top_panel:!1,$$slots:{default:[Eo]},$$scope:{ctx:n}}}),{c(){e=To("div"),rt(t.$$.fragment),hn(e,"class",l="message-buttons-"+n[3]+" "+n[7]+" message-buttons "+(n[4]!==null&&"with-avatar")+" svelte-1ibfe7l")},m(s,o){Ke(s,e,o),ut(t,e,null),i=!0},p(s,o){const a={};o&33639&&(a.$$scope={dirty:o,ctx:s}),t.$set(a),(!i||o&152&&l!==(l="message-buttons-"+s[3]+" "+s[7]+" message-buttons "+(s[4]!==null&&"with-avatar")+" svelte-1ibfe7l"))&&hn(e,"class",l)},i(s){i||(D(t.$$.fragment,s),i=!0)},o(s){U(t.$$.fragment,s),i=!1},d(s){s&&Ye(e),_t(t)}}}function gn(n){let e,t;return e=new Bo({props:{value:n[9]}}),{c(){rt(e.$$.fragment)},m(l,i){ut(e,l,i),t=!0},p(l,i){const s={};i&512&&(s.value=l[9]),e.$set(s)},i(l){t||(D(e.$$.fragment,l),t=!0)},o(l){U(e.$$.fragment,l),t=!1},d(l){_t(e,l)}}}function bn(n){let e,t;return e=new ae({props:{Icon:Rl,label:"Retry",disabled:n[5]}}),e.$on("click",n[12]),{c(){rt(e.$$.fragment)},m(l,i){ut(e,l,i),t=!0},p(l,i){const s={};i&32&&(s.disabled=l[5]),e.$set(s)},i(l){t||(D(e.$$.fragment,l),t=!0)},o(l){U(e.$$.fragment,l),t=!1},d(l){_t(e,l)}}}function wn(n){let e,t;return e=new ae({props:{label:"Undo",Icon:vl,disabled:n[5]}}),e.$on("click",n[13]),{c(){rt(e.$$.fragment)},m(l,i){ut(e,l,i),t=!0},p(l,i){const s={};i&32&&(s.disabled=l[5]),e.$set(s)},i(l){t||(D(e.$$.fragment,l),t=!0)},o(l){U(e.$$.fragment,l),t=!1},d(l){_t(e,l)}}}function kn(n){let e,t;return e=new vo({props:{handle_action:n[6]}}),{c(){rt(e.$$.fragment)},m(l,i){ut(e,l,i),t=!0},p(l,i){const s={};i&64&&(s.handle_action=l[6]),e.$set(s)},i(l){t||(D(e.$$.fragment,l),t=!0)},o(l){U(e.$$.fragment,l),t=!1},d(l){_t(e,l)}}}function Eo(n){let e,t,l,i,s,o=n[8]&&gn(n),a=n[1]&&bn(n),r=n[2]&&wn(n),_=n[0]&&kn(n);return{c(){o&&o.c(),e=Et(),a&&a.c(),t=Et(),r&&r.c(),l=Et(),_&&_.c(),i=sl()},m(u,f){o&&o.m(u,f),Ke(u,e,f),a&&a.m(u,f),Ke(u,t,f),r&&r.m(u,f),Ke(u,l,f),_&&_.m(u,f),Ke(u,i,f),s=!0},p(u,f){u[8]?o?(o.p(u,f),f&256&&D(o,1)):(o=gn(u),o.c(),D(o,1),o.m(e.parentNode,e)):o&&(st(),U(o,1,1,()=>{o=null}),ot()),u[1]?a?(a.p(u,f),f&2&&D(a,1)):(a=bn(u),a.c(),D(a,1),a.m(t.parentNode,t)):a&&(st(),U(a,1,1,()=>{a=null}),ot()),u[2]?r?(r.p(u,f),f&4&&D(r,1)):(r=wn(u),r.c(),D(r,1),r.m(l.parentNode,l)):r&&(st(),U(r,1,1,()=>{r=null}),ot()),u[0]?_?(_.p(u,f),f&1&&D(_,1)):(_=kn(u),_.c(),D(_,1),_.m(i.parentNode,i)):_&&(st(),U(_,1,1,()=>{_=null}),ot())},i(u){s||(D(o),D(a),D(r),D(_),s=!0)},o(u){U(o),U(a),U(r),U(_),s=!1},d(u){u&&(Ye(e),Ye(t),Ye(l),Ye(i)),o&&o.d(u),a&&a.d(u),r&&r.d(u),_&&_.d(u)}}}function Zo(n){let e,t,l=(n[8]||n[1]||n[2]||n[0])&&dn(n);return{c(){l&&l.c(),e=sl()},m(i,s){l&&l.m(i,s),Ke(i,e,s),t=!0},p(i,[s]){i[8]||i[1]||i[2]||i[0]?l?(l.p(i,s),s&263&&D(l,1)):(l=dn(i),l.c(),D(l,1),l.m(e.parentNode,e)):l&&(st(),U(l,1,1,()=>{l=null}),ot())},i(i){t||(D(l),t=!0)},o(i){U(l),t=!1},d(i){i&&Ye(e),l&&l.d(i)}}}function pn(n){return Array.isArray(n)&&n.every(e=>typeof e.content=="string")||!Array.isArray(n)&&typeof n.content=="string"}function Uo(n){return Array.isArray(n)?n.map(e=>e.content).join(`
4`):n.content}function Po(n,e,t){let l,i,{likeable:s}=e,{show_retry:o}=e,{show_undo:a}=e,{show_copy_button:r}=e,{message:_}=e,{position:u}=e,{avatar:f}=e,{generating:w}=e,{handle_action:m}=e,{layout:h}=e;const k=()=>m("retry"),S=()=>m("undo");return n.$$set=C=>{"likeable"in C&&t(0,s=C.likeable),"show_retry"in C&&t(1,o=C.show_retry),"show_undo"in C&&t(2,a=C.show_undo),"show_copy_button"in C&&t(10,r=C.show_copy_button),"message"in C&&t(11,_=C.message),"position"in C&&t(3,u=C.position),"avatar"in C&&t(4,f=C.avatar),"generating"in C&&t(5,w=C.generating),"handle_action"in C&&t(6,m=C.handle_action),"layout"in C&&t(7,h=C.layout)},n.$$.update=()=>{n.$$.dirty&2048&&t(9,l=pn(_)?Uo(_):""),n.$$.dirty&3072&&t(8,i=r&&_&&pn(_)),n.$$.dirty&2048&&!Array.isArray(_)&&nt(_)&&_.content.value?.url},[s,o,a,u,f,w,m,h,i,l,r,_,k,S]}class al extends Ao{constructor(e){super(),Do(this,e,Po,Zo,jo,{likeable:0,show_retry:1,show_undo:2,show_copy_button:10,message:11,position:3,avatar:4,generating:5,handle_action:6,layout:7})}get likeable(){return this.$$.ctx[0]}set likeable(e){this.$$set({likeable:e}),ce()}get show_retry(){return this.$$.ctx[1]}set show_retry(e){this.$$set({show_retry:e}),ce()}get show_undo(){return this.$$.ctx[2]}set show_undo(e){this.$$set({show_undo:e}),ce()}get show_copy_button(){return this.$$.ctx[10]}set show_copy_button(e){this.$$set({show_copy_button:e}),ce()}get message(){return this.$$.ctx[11]}set message(e){this.$$set({message:e}),ce()}get position(){return this.$$.ctx[3]}set position(e){this.$$set({position:e}),ce()}get avatar(){return this.$$.ctx[4]}set avatar(e){this.$$set({avatar:e}),ce()}
4get generating(){return this.$$.ctx[5]}set generating(e){this.$$set({generating:e}),ce()}get handle_action(){return this.$$.ctx[6]}set handle_action(e){this.$$set({handle_action:e}),ce()}get layout(){return this.$$.ctx[7]}set layout(e){this.$$set({layout:e}),ce()}}const{SvelteComponent:Ro,append:Ct,assign:rl,attr:T,check_outros:Qe,create_component:Pe,destroy_component:Re,destroy_each:Fo,detach:ve,element:je,empty:_l,ensure_array_like:vn,flush:q,get_spread_object:ul,get_spread_update:fl,group_outros:Xe,init:Oo,insert:$e,is_function:cl,listen:$n,mount_component:Fe,noop:Cn,run_all:Jo,safe_not_equal:Go,set_data:Wo,set_style:De,space:Pt,text:Yo,toggle_class:V,transition_in:L,transition_out:j}=window.__gradio__svelte__internal;function yn(n,e,t){const l=n.slice();return l[36]=e[t],l[38]=t,l}function Sn(n){let e,t,l;return t=new Rt({props:{class:"avatar-image",src:n[1]?.url,alt:n[3]+" avatar"}}),{c(){e=je("div"),Pe(t.$$.fragment),T(e,"class","avatar-container svelte-pbswnk")},m(i,s){$e(i,e,s),Fe(t,e,null),l=!0},p(i,s){const o={};s[0]&2&&(o.src=i[1]?.url),s[0]&8&&(o.alt=i[3]+" avatar"),t.$set(o)},i(i){l||(L(t.$$.fragment,i),l=!0)},o(i){j(t.$$.fragment,i),l=!1},d(i){i&&ve(e),Re(t)}}}function Ko(n){let e,t=(n[36].content.value?.orig_name||n[36].content.value?.path.split("/").pop()||"file")+"",l,i,s;return{c(){e=je("a"),l=Yo(t),T(e,"data-testid","chatbot-file"),T(e,"class","file-pil svelte-pbswnk"),T(e,"href",i=n[36].content.value.url),T(e,"target","_blank"),T(e,"download",s=window.__is_colab__?null:n[36].content.value?.orig_name||n[36].content.value?.path.split("/").pop()||"file")},m(o,a){$e(o,e,a),Ct(e,l)},p(o,a){a[0]&16&&t!==(t=(o[36].content.value?.orig_name||o[36].content.value?.path.split("/").pop()||"file")+"")&&Wo(l,t),a[0]&16&&i!==(i=o[36].content.value.url)&&T(e,"href",i),a[0]&16&&s!==(s=window.__is_colab__?null:o[36].content.value?.orig_name||o[36].content.value?.path.split("/").pop()||"file")&&T(e,"download",s)},i:Cn,o:Cn,d(o){o&&ve(e)}}}function Qo(n){let e,t;return e=new vi({props:{target:n[16],theme_mode:n[18],props:n[36].content.props,type:n[36].content.component,components:n[19],value:n[36].content.value,i18n:n[13],upload:n[15],_fetch:n[11],allow_file_downloads:n[22]}}),e.$on("load",n[33]),{c(){Pe(e.$$.fragment)},m(l,i){Fe(e,l,i),t=!0},p(l,i){const s={};i[0]&65536&&(s.target=l[16]),i[0]&262144&&(s.theme_mode=l[18]),i[0]&16&&(s.props=l[36].content.props),i[0]&16&&(s.type=l[36].content.component),i[0]&524288&&(s.components=l[19]),i[0]&16&&(s.value=l[36].content.value),i[0]&8192&&(s.i18n=l[13]),i[0]&32768&&(s.upload=l[15]),i[0]&2048&&(s._fetch=l[11]),i[0]&4194304&&(s.allow_file_downloads=l[22]),e.$set(s)},i(l){t||(L(e.$$.fragment,l),t=!0)},o(l){j(e.$$.fragment,l),t=!1},d(l){Re(e,l)}}}function Xo(n){let e,t,l,i;const s=[es,xo],o=[];function a(r,_){return r[36].metadata.title?0:1}return t=a(n),l=o[t]=s[t](n),{c(){e=je("div"),l.c(),T(e,"class","message-content svelte-pbswnk")},m(r,_){$e(r,e,_),o[t].m(e,null),i=!0},p(r,_){let u=t;t=a(r),t===u?o[t].p(r,_):(Xe(),j(o[u],1,1,()=>{o[u]=null}),Qe(),l=o[t],l?l.p(r,_):(l=o[t]=s[t](r),l.c()),L(l,1),l.m(e,null))},i(r){i||(L(l),i=!0)},o(r){j(l),i=!1},d(r){r&&ve(e),o[t].d()}}}function xo(n){let e,t;return e=new Ft({props:{message:n[36].content,latex_delimiters:n[8],sanitize_html:n[9],render_markdown:n[7],line_breaks:n[14],root:n[17]}}),e.$on("load",function(){cl(n[21])&&n[21].apply(this,arguments)}),{c(){Pe(e.$$.fragment)},m(l,i){Fe(e,l,i),t=!0},p(l,i){n=l;const s={};i[0]&16&&(s.message=n[36].content),i[0]&256&&(s.latex_delimiters=n[8]),i[0]&512&&(s.sanitize_html=n[9]),i[0]&128&&(s.render_markdown=n[7]),i[0]&16384&&(s.line_breaks=n[14]),i[0]&131072&&(s.root=n[17]),e.$set(s)},i(l){t||(L(e.$$.fragment,l),t=!0)},o(l){j(e.$$.fragment,l),t=!1},d(l){Re(e,l)}}}function es(n){let e,t;return e=new Ti({props:{title:n[36].metadata.title,expanded:We([n[36]],n[0]),$$slots:{default:[ts]},$$scope:{ctx:n}}}),{c(){Pe(e.$$.fragment)},m(l,i){Fe(e,l,i),t=!0},p(l,i){const s={};i[0]&16&&(s.title=l[36].metadata.title),i[0]&17&&(s.expanded=We([l[36]],l[0])),i[0]&2245520|i[1]&256&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){t||(L(e.$$.fragment,l),t=!0)},o(l){j(e.$$.fragment,l),t=!1},d(l){Re(e,l)}}}function ts(n){let e,t;return e=new Ft({props:{message:n[36].content,latex_delimiters:n[8],sanitize_html:n[9],render_markdown:n[7],line_breaks:n[14],root:n[17]}}),e.$on("load",function(){cl(n[21])&&n[21].apply(this,arguments)}),{c(){Pe(e.$$.fragment)},m(l,i){Fe(e,l,i),t=!0},p(l,i){n=l;const s={};i[0]&16&&(s.message=n[36].content),i[0]&256&&(s.latex_delimiters=n[8]),i[0]&512&&(s.sanitize_html=n[9]),i[0]&128&&(s.render_markdown=n[7]),i[0]&16384&&(s.line_breaks=n[14]),i[0]&131072&&(s.root=n[17]),e.$set(s)},i(l){t||(L(e.$$.fragment,l),t=!0)},o(l){j(e.$$.fragment,l),t=!1},d(l){Re(e,l)}}}function Hn(n){let e,t;const l=[n[23]];let i={};for(let s=0;s<l.length;s+=1)i=rl(i,l[s]);return e=new al({props:i}),{c(){Pe(e.$$.fragment)},m(s,o){Fe(e,s,o),t=!0},p(s,o){const a=o[0]&8388608?fl(l,[ul(s[23])]):{};
vendor: 7,908 bytes, line 4
4e.$set(a)},i(s){t||(L(e.$$.fragment,s),t=!0)},o(s){j(e.$$.fragment,s),t=!1},d(s){Re(e,s)}}}function qn(n){let e,t,l,i,s,o,a,r,_,u,f,w;const m=[Xo,Qo,Ko],h=[];function k(b,v){return b[36].type==="text"?0:b[36].type==="component"&&b[36].content.component in b[19]?1:b[36].type==="component"&&b[36].content.component==="file"?2:-1}~(l=k(n))&&(i=h[l]=m[l](n));function S(){return n[34](n[36])}function C(...b){return n[35](n[36],...b)}let H=n[5]==="panel"&&Hn(n);return{c(){e=je("div"),t=je("button"),i&&i.c(),r=Pt(),H&&H.c(),_=_l(),T(t,"data-testid",n[3]),T(t,"dir",s=n[12]?"rtl":"ltr"),T(t,"aria-label",o=n[3]+"'s message: "+Mn(n[36])),T(t,"class","svelte-pbswnk"),V(t,"latest",n[20]===n[0].length-1),V(t,"message-markdown-disabled",!n[7]),V(t,"selectable",n[10]),De(t,"user-select","text"),De(t,"cursor",n[10]?"pointer":"default"),De(t,"text-align",n[12]?"right":"left"),T(e,"class",a="message "+n[3]+" "+(nt(n[36])?n[36]?.content.component:"")+" svelte-pbswnk"),V(e,"message-fit",n[5]==="bubble"&&!n[6]),V(e,"panel-full-width",!0),V(e,"message-markdown-disabled",!n[7]),V(e,"component",n[36].type==="component"),V(e,"html",nt(n[36])&&n[36].content.component==="html"),V(e,"thought",n[38]>0),De(e,"text-align",n[12]&&n[3]==="user"?"left":"right")},m(b,v){$e(b,e,v),Ct(e,t),~l&&h[l].m(t,null),$e(b,r,v),H&&H.m(b,v),$e(b,_,v),u=!0,f||(w=[$n(t,"click",S),$n(t,"keydown",C)],f=!0)},p(b,v){n=b;let E=l;l=k(n),l===E?~l&&h[l].p(n,v):(i&&(Xe(),j(h[E],1,1,()=>{h[E]=null}),Qe()),~l?(i=h[l],i?i.p(n,v):(i=h[l]=m[l](n),i.c()),L(i,1),i.m(t,null)):i=null),(!u||v[0]&8)&&T(t,"data-testid",n[3]),(!u||v[0]&4096&&s!==(s=n[12]?"rtl":"ltr"))&&T(t,"dir",s),(!u||v[0]&24&&o!==(o=n[3]+"'s message: "+Mn(n[36])))&&T(t,"aria-label",o),(!u||v[0]&1048577)&&V(t,"latest",n[20]===n[0].length-1),(!u||v[0]&128)&&V(t,"message-markdown-disabled",!n[7]),(!u||v[0]&1024)&&V(t,"selectable",n[10]),v[0]&1024&&De(t,"cursor",n[10]?"pointer":"default"),v[0]&4096&&De(t,"text-align",n[12]?"right":"left"),(!u||v[0]&24&&a!==(a="message "+n[3]+" "+(nt(n[36])?n[36]?.content.component:"")+" svelte-pbswnk"))&&T(e,"class",a),(!u||v[0]&120)&&V(e,"message-fit",n[5]==="bubble"&&!n[6]),(!u||v[0]&24)&&V(e,"panel-full-width",!0),(!u||v[0]&152)&&V(e,"message-markdown-disabled",!n[7]),(!u||v[0]&24)&&V(e,"component",n[36].type==="component"),(!u||v[0]&24)&&V(e,"html",nt(n[36])&&n[36].content.component==="html"),(!u||v[0]&24)&&V(e,"thought",n[38]>0),v[0]&4104&&De(e,"text-align",n[12]&&n[3]==="user"?"left":"right"),n[5]==="panel"?H?(H.p(n,v),v[0]&32&&L(H,1)):(H=Hn(n),H.c(),L(H,1),H.m(_.parentNode,_)):H&&(Xe(),j(H,1,1,()=>{H=null}),Qe())},i(b){u||(L(i),L(H),u=!0)},o(b){j(i),j(H),u=!1},d(b){b&&(ve(e),ve(r),ve(_)),~l&&h[l].d(),H&&H.d(b),f=!1,Jo(w)}}}function zn(n){let e,t;const l=[n[23]];let i={};for(let s=0;s<l.length;s+=1)i=rl(i,l[s]);return e=new al({props:i}),{c(){Pe(e.$$.fragment)},m(s,o){Fe(e,s,o),t=!0},p(s,o){const a=o[0]&8388608?fl(l,[ul(s[23])]):{};e.$set(a)},i(s){t||(L(e.$$.fragment,s),t=!0)},o(s){j(e.$$.fragment,s),t=!1},d(s){Re(e,s)}}}function ns(n){let e,t,l,i,s,o,a,r=n[1]!==null&&Sn(n),_=vn(n[4]),u=[];for(let m=0;m<_.length;m+=1)u[m]=qn(yn(n,_,m));const f=m=>j(u[m],1,1,()=>{u[m]=null});let w=n[5]==="bubble"&&zn(n);return{c(){e=je("div"),r&&r.c(),t=Pt(),l=je("div");for(let m=0;m<u.length;m+=1)u[m].c();s=Pt(),w&&w.c(),o=_l(),T(l,"class","flex-wrap svelte-pbswnk"),V(l,"role",n[3]),V(l,"component-wrap",n[4][0].type==="component"),T(e,"class",i="message-row "+n[5]+" "+n[3]+"-row svelte-pbswnk"),V(e,"with_avatar",n[1]!==null),V(e,"with_opposite_avatar",n[2]!==null)},m(m,h){$e(m,e,h),r&&r.m(e,null),Ct(e,t),Ct(e,l);for(let k=0;k<u.length;k+=1)u[k]&&u[k].m(l,null);$e(m,s,h),w&&w.m(m,h),$e(m,o,h),a=!0},p(m,h){if(m[1]!==null?r?(r.p(m,h),h[0]&2&&L(r,1)):(r=Sn(m),r.c(),L(r,1),r.m(e,t)):r&&(Xe(),j(r,1,1,()=>{r=null}),Qe()),h[0]&33554425){_=vn(m[4]);let k;for(k=0;k<_.length;k+=1){const S=yn(m,_,k);u[k]?(u[k].p(S,h),L(u[k],1)):(u[k]=qn(S),u[k].c(),L(u[k],1),u[k].m(l,null))}for(Xe(),k=_.length;k<u.length;k+=1)f(k);Qe()}(!a||h[0]&8)&&V(l,"role",m[3]),(!a||h[0]&16)&&V(l,"component-wrap",m[4][0].type==="component"),(!a||h[0]&40&&i!==(i="message-row "+m[5]+" "+m[3]+"-row svelte-pbswnk"))&&T(e,"class",i),(!a||h[0]&42)&&V(e,"with_avatar",m[1]!==null),(!a||h[0]&44)&&V(e,"with_opposite_avatar",m[2]!==null),m[5]==="bubble"?w?(w.p(m,h),h[0]&32&&L(w,1)):(w=zn(m),w.c(),L(w,1),w.m(o.parentNode,o)):w&&(Xe(),j(w,1,1,()=>{w=null}),Qe())},i(m){if(!a){L(r);for(let h=0;h<_.length;h+=1)L(u[h]);L(w),a=!0}},o(m){j(r),u=u.filter(Boolean);for(let h=0;h<u.length;h+=1)j(u[h]);j(w),a=!1},d(m){m&&(ve(e),ve(s),ve(o)),r&&r.d(),Fo(u,m),w&&w.d(m)}}}function Mn(n){return n.type==="text"?n.content:n.type==="component"&&n.content.component==="file"?Array.isArray(n.content.value)?`file of extension type: ${n.content.value[0].orig_name?.split(".").pop()}`:`file of extension type: ${n.content.value?.orig_name?.split(".").pop()}`+(n.content.value?.orig_name??""):`a component of type ${n.content.component??"unknown"}`}function ls(n,e,t){let{value:l}=e,{avatar_img:i}=e,{opposite_avatar_img:s=null}=e,{role:o="user"}=e,{messages:a=[]}=e,{layout:r}=e,{bubble_full_width:_}=e,{render_markdown:u}=e,{latex_delimiters:f}=e,{sanitize_html:w}=e,{selectable:m}=e,{_fetch:h}=e,{rtl:k}=e,{dispatch:S}=e,{i18n:C}=e,{line_breaks:H}=e,{upload:b}=e,{target:v}=e,{root:E}=e,{theme_mode:Ce}=e,{_components:ye}=e,{i:re}=e,{show_copy_button:he}=e,{generating:_e}=e,{show_like:de}=e,{show_retry:A}=e,{show_undo:ge}=e,{msg_format:be}=e,{handle_action:we}=e,{scroll:X}=e,{allow_file_downloads:Se}=e;function ke(d,ie){S("select",{index:ie.index,value:ie.content})}let He;const Ve=()=>X(),Le=d=>ke(re,d),Ie=(d,ie)=>{ie.key==="Enter"&&ke(re,d)};return n.$$set=d=>{"value"in d&&t(0,l=d.value),"avatar_img"in d&&t(1,i=d.avatar_img),"opposite_avatar_img"in d&&t(2,s=d.opposite_avatar_img),"role"in d&&t(3,o=d.role),"messages"in d&&t(4,a=d.messages),"layout"in d&&t(5,r=d.layout),"bubble_full_width"in d&&t(6,_=d.bubble_full_width),"render_markdown"in d&&t(7,u=d.render_markdown),"latex_delimiters"in d&&t(8,f=d.latex_delimiters),"sanitize_html"in d&&t(9,w=d.sanitize_html),"selectable"in d&&t(10,m=d.selectable),"_fetch"in d&&t(11,h=d._fetch),"rtl"in d&&t(12,k=d.rtl),"dispatch"in d&&t(25,S=d.dispatch),"i18n"in d&&t(13,C=d.i18n),"line_breaks"in d&&t(14,H=d.line_breaks),"upload"in d&&t(15,b=d.upload),"target"in d&&t(16,v=d.target),"root"in d&&t(17,E=d.root),"theme_mode"in d&&t(18,Ce=d.theme_mode),"_components"in d&&t(19,ye=d._components),"i"in d&&t(20,re=d.i),"show_copy_button"in d&&t(26,he=d.show_copy_button),"generating"in d&&t(27,_e=d.generating),"show_like"in d&&t(28,de=d.show_like),"show_retry"in d&&t(29,A=d.show_retry),"show_undo"in d&&t(30,ge=d.show_undo),"msg_format"in d&&t(31,be=d.msg_format),"handle_action"in d&&t(32,we=d.handle_action),"scroll"in d&&t(21,X=d.scroll),"allow_file_downloads"in d&&t(22,Se=d.allow_file_downloads)},n.$$.update=()=>{n.$$.dirty[0]&2080374842|n.$$.dirty[1]&3&&t(23,He={handle_action:we,likeable:de,show_retry:A,show_undo:ge,generating:_e,show_copy_button:he,message:be==="tuples"?a[0]:a,position:o==="user"?"right":"left",avatar:i,layout:r})},[l,i,s,o,a,r,_,u,f,w,m,h,k,C,H,b,v,E,Ce,ye,re,X,Se,He,ke,S,he,_e,de,A,ge,be,we,Ve,Le,Ie]}class is extends Ro{constructor(e){super(),Oo(this,e,ls,ns,Go,{value:0,avatar_img:1,opposite_avatar_img:2,role:3,messages:4,layout:5,bubble_full_width:6,render_markdown:7,latex_delimiters:8,sanitize_html:9,selectable:10,_fetch:11,rtl:12,dispatch:25,i18n:13,line_breaks:14,upload:15,target:16,root:17,theme_mode:18,_components:19,i:20,show_copy_button:26,generating:27,show_like:28,show_retry:29,show_undo:30,msg_format:31,handle_action:32,scroll:21,allow_file_downloads:22},null,[-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),q()}get avatar_img(){return this.$$.ctx[1]}set avatar_img(e){this.$$set({avatar_img:e}),q()}get opposite_avatar_img(){return this.$$.ctx[2]}
4set opposite_avatar_img(e){this.$$set({opposite_avatar_img:e}),q()}get role(){return this.$$.ctx[3]}set role(e){this.$$set({role:e}),q()}get messages(){return this.$$.ctx[4]}set messages(e){this.$$set({messages:e}),q()}get layout(){return this.$$.ctx[5]}set layout(e){this.$$set({layout:e}),q()}get bubble_full_width(){return this.$$.ctx[6]}set bubble_full_width(e){this.$$set({bubble_full_width:e}),q()}get render_markdown(){return this.$$.ctx[7]}set render_markdown(e){this.$$set({render_markdown:e}),q()}get latex_delimiters(){return this.$$.ctx[8]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),q()}get sanitize_html(){return this.$$.ctx[9]}set sanitize_html(e){this.$$set({sanitize_html:e}),q()}get selectable(){return this.$$.ctx[10]}set selectable(e){this.$$set({selectable:e}),q()}get _fetch(){return this.$$.ctx[11]}set _fetch(e){this.$$set({_fetch:e}),q()}get rtl(){return this.$$.ctx[12]}set rtl(e){this.$$set({rtl:e}),q()}get dispatch(){return this.$$.ctx[25]}set dispatch(e){this.$$set({dispatch:e}),q()}get i18n(){return this.$$.ctx[13]}set i18n(e){this.$$set({i18n:e}),q()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),q()}get upload(){return this.$$.ctx[15]}set upload(e){this.$$set({upload:e}),q()}get target(){return this.$$.ctx[16]}set target(e){this.$$set({target:e}),q()}get root(){return this.$$.ctx[17]}set root(e){this.$$set({root:e}),q()}get theme_mode(){return this.$$.ctx[18]}set theme_mode(e){this.$$set({theme_mode:e}),q()}get _components(){return this.$$.ctx[19]}set _components(e){this.$$set({_components:e}),q()}get i(){return this.$$.ctx[20]}set i(e){this.$$set({i:e}),q()}get show_copy_button(){return this.$$.ctx[26]}set show_copy_button(e){this.$$set({show_copy_button:e}),q()}
4get generating(){return this.$$.ctx[27]}set generating(e){this.$$set({generating:e}),q()}get show_like(){return this.$$.ctx[28]}set show_like(e){this.$$set({show_like:e}),q()}get show_retry(){return this.$$.ctx[29]}set show_retry(e){this.$$set({show_retry:e}),q()}get show_undo(){return this.$$.ctx[30]}set show_undo(e){this.$$set({show_undo:e}),q()}get msg_format(){return this.$$.ctx[31]}set msg_format(e){this.$$set({msg_format:e}),q()}get handle_action(){return this.$$.ctx[32]}set handle_action(e){this.$$set({handle_action:e}),q()}get scroll(){return this.$$.ctx[21]}set scroll(e){this.$$set({scroll:e}),q()}get allow_file_downloads(){return this.$$.ctx[22]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),q()}}const{SvelteComponent:os,attr:kt,detach:ss,element:as,flush:rs,init:_s,insert:us,noop:Vn,safe_not_equal:fs,set_style:Ln}=window.__gradio__svelte__internal;function cs(n){let e;return{c(){e=as("div"),e.innerHTML=`<span class="sr-only">Loading content</span> <div class="dot-flashing svelte-1gpwetz"></div>
5	 
6	<div class="dot-flashing svelte-1gpwetz"></div>
7	 
8	<div class="dot-flashing svelte-1gpwetz"></div>`,kt(e,"class","message pending svelte-1gpwetz"),kt(e,"role","status"),kt(e,"aria-label","Loading response"),kt(e,"aria-live","polite"),Ln(e,"border-radius",n[0]==="bubble"?"var(--radius-xxl)":"none")},m(t,l){us(t,e,l)},p(t,[l]){l&1&&Ln(e,"border-radius",t[0]==="bubble"?"var(--radius-xxl)":"none")},i:Vn,o:Vn,d(t){t&&ss(e)}}}function ms(n,e,t){let{layout:l="bubble"}=e;return n.$$set=i=>{"layout"in i&&t(0,l=i.layout)},[l]}class hs extends os{constructor(e){super(),_s(this,e,ms,cs,fs,{layout:0})}get layout(){return this.$$.ctx[0]}set layout(e){this.$$set({layout:e}),rs()}}const{SvelteComponent:ds,create_component:gs,destroy_component:bs,flush:ws,init:ks,mount_component:ps,safe_not_equal:vs,transition_in:$s,transition_out:Cs}=window.__gradio__svelte__internal,{onDestroy:ys}=window.__gradio__svelte__internal;function Ss(n){let e,t;return e=new ae({props:{Icon:n[0]?vt:$t,label:n[0]?"Copied conversation":"Copy conversation"}}),e.$on("click",n[1]),{c(){gs(e.$$.fragment)},m(l,i){ps(e,l,i),t=!0},p(l,[i]){const s={};i&1&&(s.Icon=l[0]?vt:$t),i&1&&(s.label=l[0]?"Copied conversation":"Copy conversation"),e.$set(s)},i(l){t||($s(e.$$.fragment,l),t=!0)},o(l){Cs(e.$$.fragment,l),t=!1},d(l){bs(e,l)}}}function Hs(n,e,t){let l=!1,{value:i}=e,s;function o(){t(0,l=!0),s&&clearTimeout(s),s=setTimeout(()=>{t(0,l=!1)},1e3)}const a=()=>{if(i){const _=i.map(u=>u.type==="text"?`${u.role}: ${u.content}`:`${u.role}: ${u.content.value.url}`).join(`
9
10`);navigator.clipboard.writeText(_).catch(u=>{console.error("Failed to copy conversation: ",u)})}};async function r(){"clipboard"in navigator&&(a(),o())}return ys(()=>{s&&clearTimeout(s)}),n.$$set=_=>{"value"in _&&t(2,i=_.value)},[l,r,i]}class qs extends ds{constructor(e){super(),ks(this,e,Hs,Ss,vs,{value:2})}get value(){return this.$$.ctx[2]}set value(e){this.$$set({value:e}),ws()}}const{SvelteComponent:zs,action_destroyer:Ms,append:O,attr:B,binding_callbacks:Vs,check_outros:J,create_component:P,destroy_component:R,destroy_each:ml,detach:I,element:Z,empty:Jt,ensure_array_like:yt,flush:z,group_outros:G,init:Ls,insert:N,listen:Is,mount_component:F,noop:xe,null_to_empty:In,safe_not_equal:Ns,set_data:St,space:x,src_url_equal:Nn,text:at,transition_in:p,transition_out:$}=window.__gradio__svelte__internal,{afterUpdate:Bs,createEventDispatcher:As,tick:Ts,onMount:Zt}=window.__gradio__svelte__internal;function Bn(n,e,t){const l=n.slice();return l[61]=e[t],l[60]=t,l}function An(n,e,t){const l=n.slice();l[55]=e[t],l[60]=t;const i=l[55][0].role==="user"?"user":"bot";l[56]=i;const s=l[12][l[56]==="user"?0:1];l[57]=s;const o=l[12][l[56]==="user"?0:1];return l[58]=o,l}function Tn(n){let e,t;return e=new Ot({props:{$$slots:{default:[js]},$$scope:{ctx:n}}}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p(l,i){const s={};i[0]&769|i[2]&2&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function Dn(n){let e,t;return e=new ae({props:{Icon:tl,$$slots:{default:[Ds]},$$scope:{ctx:n}}}),e.$on("click",n[44]),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p(l,i){const s={};i[2]&2&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function Ds(n){let e,t;return e=new tl({}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function jn(n){let e,t;return e=new qs({props:{value:n[0]}}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p(l,i){const s={};i[0]&1&&(s.value=l[0]),e.$set(s)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function js(n){let e,t,l,i,s,o=n[8]&&Dn(n);t=new ae({props:{Icon:Hl,label:"Clear"}}),t.$on("click",n[45]);let a=n[9]&&jn(n);return{c(){o&&o.c(),e=x(),P(t.$$.fragment),l=x(),a&&a.c(),i=Jt()},m(r,_){o&&o.m(r,_),N(r,e,_),F(t,r,_),N(r,l,_),a&&a.m(r,_),N(r,i,_),s=!0}
vendor: 2,785 bytes, line 10
10,p(r,_){r[8]?o?(o.p(r,_),_[0]&256&&p(o,1)):(o=Dn(r),o.c(),p(o,1),o.m(e.parentNode,e)):o&&(G(),$(o,1,1,()=>{o=null}),J()),r[9]?a?(a.p(r,_),_[0]&512&&p(a,1)):(a=jn(r),a.c(),p(a,1),a.m(i.parentNode,i)):a&&(G(),$(a,1,1,()=>{a=null}),J())},i(r){s||(p(o),p(t.$$.fragment,r),p(a),s=!0)},o(r){$(o),$(t.$$.fragment,r),$(a),s=!1},d(r){r&&(I(e),I(l),I(i)),o&&o.d(r),R(t,r),a&&a.d(r)}}}function Es(n){let e,t,l,i=n[20]!==null&&En(n),s=n[23]!==null&&Zn(n);return{c(){e=Z("div"),i&&i.c(),t=x(),s&&s.c(),B(e,"class","placeholder-content svelte-vxn3uw")},m(o,a){N(o,e,a),i&&i.m(e,null),O(e,t),s&&s.m(e,null),l=!0},p(o,a){o[20]!==null?i?(i.p(o,a),a[0]&1048576&&p(i,1)):(i=En(o),i.c(),p(i,1),i.m(e,t)):i&&(G(),$(i,1,1,()=>{i=null}),J()),o[23]!==null?s?(s.p(o,a),a[0]&8388608&&p(s,1)):(s=Zn(o),s.c(),p(s,1),s.m(e,null)):s&&(G(),$(s,1,1,()=>{s=null}),J())},i(o){l||(p(i),p(s),l=!0)},o(o){$(i),$(s),l=!1},d(o){o&&I(e),i&&i.d(),s&&s.d()}}}function Zs(n){let e,t,l,i,s,o=yt(n[35]),a=[];for(let u=0;u<o.length;u+=1)a[u]=On(An(n,o,u));const r=u=>$(a[u],1,1,()=>{a[u]=null});let _=n[4]&&Jn(n);return{c(){e=Z("div");for(let u=0;u<a.length;u+=1)a[u].c();t=x(),_&&_.c(),B(e,"class","message-wrap svelte-vxn3uw")},m(u,f){N(u,e,f);for(let w=0;w<a.length;w+=1)a[w]&&a[w].m(e,null);O(e,t),_&&_.m(e,null),l=!0,i||(s=Ms(pl.call(null,e)),i=!0)},p(u,f){if(f[0]&1064303855|f[1]&638){o=yt(u[35]);let w;for(w=0;w<o.length;w+=1){const m=An(u,o,w);a[w]?(a[w].p(m,f),p(a[w],1)):(a[w]=On(m),a[w].c(),p(a[w],1),a[w].m(e,t))}for(G(),w=o.length;w<a.length;w+=1)r(w);J()}u[4]?_?(_.p(u,f),f[0]&16&&p(_,1)):(_=Jn(u),_.c(),p(_,1),_.m(e,null)):_&&(G(),$(_,1,1,()=>{_=null}),J())},i(u){if(!l){for(let f=0;f<o.length;f+=1)p(a[f]);p(_),l=!0}},o(u){a=a.filter(Boolean);for(let f=0;f<a.length;f+=1)$(a[f]);$(_),l=!1},d(u){u&&I(e),ml(a,u),_&&_.d(),i=!1,s()}}}function En(n){let e,t,l;return t=new Ft({props:{message:n[20],latex_delimiters:n[3],root:n[27]}}),{c(){e=Z("div"),P(t.$$.fragment),B(e,"class","placeholder svelte-vxn3uw")},m(i,s){N(i,e,s),F(t,e,null),l=!0},p(i,s){const o={};s[0]&1048576&&(o.message=i[20]),s[0]&8&&(o.latex_delimiters=i[3]),s[0]&134217728&&(o.root=i[27]),t.$set(o)},i(i){l||(p(t.$$.fragment,i),l=!0)},o(i){$(t.$$.fragment,i),l=!1},d(i){i&&I(e),R(t)}}}function Zn(n){let e,t,l=yt(n[23]),i=[];for(let o=0;o<l.length;o+=1)i[o]=Pn(Bn(n,l,o));const s=o=>$(i[o],1,1,()=>{i[o]=null});return{c(){e=Z("div");for(let o=0;o<i.length;o+=1)i[o].c();B(e,"class","examples svelte-vxn3uw")},m(o,a){N(o,e,a);for(let r=0;r<i.length;r+=1)i[r]&&i[r].m(e,null);t=!0},p(o,a){if(a[0]&8388608|a[1]&256){l=yt(o[23]);let r;for(r=0;r<l.length;r+=1){const _=Bn(o,l,r);i[r]?(i[r].p(_,a),p(i[r],1)):(i[r]=Pn(_),i[r].c(),p(i[r],1),i[r].m(e,null))}for(G(),r=l.length;r<i.length;r+=1)s(r);J()}},i(o){if(!t){for(let a=0;a<l.length;a+=1)p(i[a]);t=!0}}
10,o(o){i=i.filter(Boolean);for(let a=0;a<i.length;a+=1)$(i[a]);t=!1},d(o){o&&I(e),ml(i,o)}}}function Un(n){let e,t,l;return t=new Rt({props:{class:"example-icon",src:n[61].icon.url,alt:"example-icon"}}),{c(){e=Z("div"),P(t.$$.fragment),B(e,"class","example-icon-container svelte-vxn3uw")},m(i,s){N(i,e,s),F(t,e,null),l=!0},p(i,s){const o={};s[0]&8388608&&(o.src=i[61].icon.url),t.$set(o)},i(i){l||(p(t.$$.fragment,i),l=!0)},o(i){$(t.$$.fragment,i),l=!1},d(i){i&&I(e),R(t)}}}function Us(n){let e,t=n[61].text+"",l;return{c(){e=Z("span"),l=at(t),B(e,"class","example-text svelte-vxn3uw")},m(i,s){N(i,e,s),O(e,l)},p(i,s){s[0]&8388608&&t!==(t=i[61].text+"")&&St(l,t)},d(i){i&&I(e)}}}function Ps(n){let e,t=n[61].display_text+"",l;return{c(){e=Z("span"),l=at(t),B(e,"class","example-display-text svelte-vxn3uw")},m(i,s){N(i,e,s),O(e,l)},p(i,s){s[0]&8388608&&t!==(t=i[61].display_text+"")&&St(l,t)},d(i){i&&I(e)}}}function Rs(n){let e,t,l=n[61].files[0].orig_name+"",i;return{c(){e=Z("span"),t=Z("em"),i=at(l),B(e,"class","example-file svelte-vxn3uw")},m(s,o){N(s,e,o),O(e,t),O(t,i)},p(s,o){o[0]&8388608&&l!==(l=s[61].files[0].orig_name+"")&&St(i,l)},i:xe,o:xe,d(s){s&&I(e)}}}function Fs(n){let e,t,l;return t=new Rt({props:{class:"example-image",src:n[61].files[0].url,alt:"example-image"}}),{c(){e=Z("div"),P(t.$$.fragment),B(e,"class","example-image-container svelte-vxn3uw")},m(i,s){N(i,e,s),F(t,e,null),l=!0},p(i,s){const o={};s[0]&8388608&&(o.src=i[61].files[0].url),t.$set(o)},i(i){l||(p(t.$$.fragment,i),l=!0)},o(i){$(t.$$.fragment,i),l=!1},d(i){i&&I(e),R(t)}}}function Os(n){let e,t,l=n[61].files.length+"",i,s;return{c(){e=Z("span"),t=Z("em"),i=at(l),s=at(" Files"),B(e,"class","example-file svelte-vxn3uw")},m(o,a){N(o,e,a),O(e,t),O(t,i),O(t,s)},p(o,a){a[0]&8388608&&l!==(l=o[61].files.length+"")&&St(i,l)},i:xe,o:xe,d(o){o&&I(e)}}}function Pn(n){let e,t,l,i,s,o,a,r,_,u,f=n[61].icon!==void 0&&Un(n);function w(b,v){return b[61].display_text!==void 0?Ps:Us}let m=w(n),h=m(n);const k=[Os,Fs,Rs],S=[];function C(b,v){return v[0]&8388608&&(i=null),b[61].files!==void 0&&b[61].files.length>1?0:(i==null&&(i=!!(b[61].files!==void 0&&b[61].files[0]!==void 0&&b[61].files[0].mime_type?.includes("image"))),i?1:b[61].files!==void 0&&b[61].files[0]!==void 0?2:-1)}~(s=C(n,[-1,-1,-1]))&&(o=S[s]=k[s](n));function H(){return n[48](n[60],n[61])}return{c(){e=Z("button"),f&&f.c(),t=x(),h.c(),l=x(),o&&o.c(),a=x(),B(e,"class","example svelte-vxn3uw")},m(b,v){N(b,e,v),f&&f.m(e,null),O(e,t),h.m(e,null),O(e,l),~s&&S[s].m(e,null),O(e,a),r=!0,_||(u=Is(e,"click",H),_=!0)},p(b,v){n=b,n[61].icon!==void 0?f?(f.p(n,v),v[0]&8388608&&p(f,1)):(f=Un(n),f.c(),p(f,1),f.m(e,t)):f&&(G(),$(f,1,1,()=>{f=null}),J()),m===(m=w(n))&&h?h.p(n,v):(h.d(1),h=m(n),h&&(h.c(),h.m(e,l)));let E=s;s=C(n,v),s===E?~s&&S[s].p(n,v):(o&&(G(),$(S[E],1,1,()=>{S[E]=null}),J()),~s?(o=S[s],o?o.p(n,v):(o=S[s]=k[s](n),o.c()),p(o,1),o.m(e,a)):o=null)},i(b){r||(p(f),p(o),r=!0)},o(b){$(f),$(o),r=!1},d(b){b&&I(e),f&&f.d(),h.d(),~s&&S[s].d(),_=!1,u()}}}function Rn(n){let e,t,l,i,s,o;return s=new Ot({props:{$$slots:{default:[Gs]},$$scope:{ctx:n}}}),{c(){e=Z("div"),t=Z("img"),i=x(),P(s.$$.fragment),Nn(t.src,l=n[32])||B(t,"src",l),B(t,"alt",n[33]),B(e,"class","image-preview svelte-vxn3uw")},m(a,r){N(a,e,r),O(e,t),O(e,i),F(s,e,null),o=!0},p(a,r){(!o||r[1]&2&&!Nn(t.src,l=a[32]))&&B(t,"src",l),(!o||r[1]&4)&&B(t,"alt",a[33]);const _={};r[0]&4|r[1]&14|r[2]&2&&(_.$$scope={dirty:r,ctx:a}),s.$set(_)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){$(s.$$.fragment,a),o=!1},d(a){a&&I(e),R(s)}}}function Fn(n){let e,t;return e=new $l({props:{href:n[32],download:n[33]||"image",$$slots:{default:[Js]},$$scope:{ctx:n}}}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p(l,i){const s={};i[1]&2&&(s.href=l[32]),i[1]&4&&(s.download=l[33]||"image"),i[2]&2&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function Js(n){let e,t;return e=new ae({props:{Icon:Sl,label:"Download"}}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p:xe,i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function Gs(n){let e,t,l,i;e=new ae({props:{Icon:yl,label:"Clear"}}),e.$on("click",n[46]);let s=n[2]&&Fn(n);return{c(){P(e.$$.fragment),t=x(),s&&s.c(),l=Jt()},m(o,a){F(e,o,a),N(o,t,a),s&&s.m(o,a),N(o,l,a),i=!0},p(o,a){o[2]?s?(s.p(o,a),a[0]&4&&p(s,1)):(s=Fn(o),s.c(),p(s,1),s.m(l.parentNode,l)):s&&(G(),$(s,1,1,()=>{s=null}),J())},i(o){i||(p(e.$$.fragment,o),p(s),i=!0)},o(o){$(e.$$.fragment,o),$(s),i=!1},d(o){o&&(I(t),I(l)),R(e,o),s&&s.d(o)}}}function On(n){let e,t,l,i=n[34]&&Rn(n);function s(...o){return n[47](n[60],n[55],...o)}return t=new is({props:{messages:n[55],opposite_avatar_img:n[58],avatar_img:n[57],role:n[56],layout:n[19],dispatch:n[37],i18n:n[18],_fetch:n[1],line_breaks:n[16],theme_mode:n[17],target:n[29],root:n[27],upload:n[21],selectable:n[6],sanitize_html:n[13],bubble_full_width:n[14],render_markdown:n[15],rtl:n[10],i:n[60],value:n[0],latex_delimiters:n[3],_components:n[28],generating:n[5],msg_format:n[22],show_like:n[56]==="user"?n[7]&&n[26]:n[7],show_retry:n[24]&&We(n[55],n[0]),show_undo:n[25]&&We(n[55],n[0]),show_copy_button:n[11],handle_action:s,scroll:n[36]?scroll:Ys,allow_file_downloads:n[2]}}
vendor: 4,136 bytes, line 10
10),{c(){i&&i.c(),e=x(),P(t.$$.fragment)},m(o,a){i&&i.m(o,a),N(o,e,a),F(t,o,a),l=!0},p(o,a){n=o,n[34]?i?(i.p(n,a),a[1]&8&&p(i,1)):(i=Rn(n),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(G(),$(i,1,1,()=>{i=null}),J());const r={};a[1]&16&&(r.messages=n[55]),a[0]&4096|a[1]&16&&(r.opposite_avatar_img=n[58]),a[0]&4096|a[1]&16&&(r.avatar_img=n[57]),a[1]&16&&(r.role=n[56]),a[0]&524288&&(r.layout=n[19]),a[0]&262144&&(r.i18n=n[18]),a[0]&2&&(r._fetch=n[1]),a[0]&65536&&(r.line_breaks=n[16]),a[0]&131072&&(r.theme_mode=n[17]),a[0]&536870912&&(r.target=n[29]),a[0]&134217728&&(r.root=n[27]),a[0]&2097152&&(r.upload=n[21]),a[0]&64&&(r.selectable=n[6]),a[0]&8192&&(r.sanitize_html=n[13]),a[0]&16384&&(r.bubble_full_width=n[14]),a[0]&32768&&(r.render_markdown=n[15]),a[0]&1024&&(r.rtl=n[10]),a[0]&1&&(r.value=n[0]),a[0]&8&&(r.latex_delimiters=n[3]),a[0]&268435456&&(r._components=n[28]),a[0]&32&&(r.generating=n[5]),a[0]&4194304&&(r.msg_format=n[22]),a[0]&67108992|a[1]&16&&(r.show_like=n[56]==="user"?n[7]&&n[26]:n[7]),a[0]&16777217|a[1]&16&&(r.show_retry=n[24]&&We(n[55],n[0])),a[0]&33554433|a[1]&16&&(r.show_undo=n[25]&&We(n[55],n[0])),a[0]&2048&&(r.show_copy_button=n[11]),a[1]&16&&(r.handle_action=s),a[0]&4&&(r.allow_file_downloads=n[2]),t.$set(r)},i(o){l||(p(i),p(t.$$.fragment,o),l=!0)},o(o){$(i),$(t.$$.fragment,o),l=!1},d(o){o&&I(e),i&&i.d(o),R(t,o)}}}function Jn(n){let e,t;return e=new hs({props:{layout:n[19]}}),{c(){P(e.$$.fragment)},m(l,i){F(e,l,i),t=!0},p(l,i){const s={};i[0]&524288&&(s.layout=l[19]),e.$set(s)},i(l){t||(p(e.$$.fragment,l),t=!0)},o(l){$(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function Gn(n){let e,t,l;return t=new ae({props:{Icon:Ql,label:"Scroll down",size:"large"}}),t.$on("click",n[38]),{c(){e=Z("div"),P(t.$$.fragment),B(e,"class","scroll-down-button-container svelte-vxn3uw")},m(i,s){N(i,e,s),F(t,e,null),l=!0},p:xe,i(i){l||(p(t.$$.fragment,i),l=!0)},o(i){$(t.$$.fragment,i),l=!1},d(i){i&&I(e),R(t)}}}function Ws(n){let e,t,l,i,s,o,a,r,_=n[0]!==null&&n[0].length>0&&Tn(n);const u=[Zs,Es],f=[];function w(h,k){return h[0]!==null&&h[0].length>0&&h[35]!==null?0:1}l=w(n),i=f[l]=u[l](n);let m=n[31]&&Gn(n);return{c(){_&&_.c(),e=x(),t=Z("div"),i.c(),o=x(),m&&m.c(),a=Jt(),B(t,"class",s=In(n[19]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-vxn3uw"),B(t,"role","log"),B(t,"aria-label","chatbot conversation"),B(t,"aria-live","polite")},m(h,k){_&&_.m(h,k),N(h,e,k),N(h,t,k),f[l].m(t,null),n[49](t),N(h,o,k),m&&m.m(h,k),N(h,a,k),r=!0},p(h,k){h[0]!==null&&h[0].length>0?_?(_.p(h,k),k[0]&1&&p(_,1)):(_=Tn(h),_.c(),p(_,1),_.m(e.parentNode,e)):_&&(G(),$(_,1,1,()=>{_=null}),J());let S=l;l=w(h),l===S?f[l].p(h,k):(G(),$(f[S],1,1,()=>{f[S]=null}),J(),i=f[l],i?i.p(h,k):(i=f[l]=u[l](h),i.c()),p(i,1),i.m(t,null)),(!r||k[0]&524288&&s!==(s=In(h[19]==="bubble"?"bubble-wrap":"panel-wrap")+" svelte-vxn3uw"))&&B(t,"class",s),h[31]?m?(m.p(h,k),k[1]&1&&p(m,1)):(m=Gn(h),m.c(),p(m,1),m.m(a.parentNode,a)):m&&(G(),$(m,1,1,()=>{m=null}),J())},i(h){r||(p(_),p(i),p(m),r=!0)},o(h){$(_),$(i),$(m),r=!1},d(h){h&&(I(e),I(t),I(o),I(a)),_&&_.d(h),f[l].d(),n[49](null),m&&m.d(h)}}}const Ys=()=>{};function Ks(n,e,t){let l,{value:i=[]}=e,s=null,{_fetch:o}=e,{load_component:a}=e,{allow_file_downloads:r}=e,_={};const u=typeof window<"u";async function f(){t(28,_=await li(ii(i),_,a))}let{latex_delimiters:w}=e,{pending_message:m=!1}=e,{generating:h=!1}=e,{selectable:k=!1}=e,{likeable:S=!1}=e,{show_share_button:C=!1}=e,{show_copy_all_button:H=!1}=e,{rtl:b=!1}=e,{show_copy_button:v=!1}=e,{avatar_images:E=[null,null]}=e,{sanitize_html:Ce=!0}=e,{bubble_full_width:ye=!0}=e,{render_markdown:re=!0}=e,{line_breaks:he=!0}=e,{autoscroll:_e=!0}=e,{theme_mode:de}=e,{i18n:A}=e,{layout:ge="bubble"}=e,{placeholder:be=null}=e,{upload:we}=e,{msg_format:X="tuples"}=e,{examples:Se=null}=e,{_retryable:ke=!1}=e,{_undoable:He=!1}=e,{like_user_message:Ve=!1}=e,{root:Le}=e,Ie=null;Zt(()=>{t(29,Ie=document.querySelector("div.gradio-container"))});let d,ie=!1;const oe=As();function ft(){return d&&d.offsetHeight+d.scrollTop>d.scrollHeight-100}function ct(){d&&(d.scrollTo(0,d.scrollHeight),t(31,ie=!1))}async function mt(){_e&&(ft()?(await Ts(),ct()):t(31,ie=!0))}
10Zt(()=>{mt()}),Zt(()=>{function g(){ft()&&t(31,ie=!1)}return d?.addEventListener("scroll",g),()=>{d?.removeEventListener("scroll",g)}});let ht,dt,et=!1;Bs(()=>{d&&d.querySelectorAll("img").forEach(g=>{g.addEventListener("click",K=>{const se=K.target;se&&(t(32,ht=se.src),t(33,dt=se.alt),t(34,et=!0))})})});function gt(g,K){oe("example_select",{index:g,value:{text:K.text,files:K.files}})}function bt(g,K,se){if(se==="undo"||se==="retry"){const pe=i;let Oe=pe.length-1;for(;pe[Oe].role==="assistant";)Oe--;oe(se,{index:pe[Oe].index,value:pe[Oe].content});return}if(X==="tuples")oe("like",{index:K.index,value:K.content,liked:se==="like"});else{if(!l)return;const pe=l[g],[Oe,bl]=[pe[0],pe[pe.length-1]];oe("like",{index:[Oe.index,bl.index],value:pe.map(wl=>wl.content),liked:se==="like"})}}const Mt=async()=>{try{const g=await Xl(i);oe("share",{description:g})}catch(g){console.error(g);let K=g instanceof kl?g.message:"Share failed.";oe("error",K)}},Vt=()=>oe("clear"),c=()=>t(34,et=!1),hl=(g,K,se)=>bt(g,K[0],se),dl=(g,K)=>gt(g,K);function gl(g){Vs[g?"unshift":"push"](()=>{d=g,t(30,d)})}return n.$$set=g=>{"value"in g&&t(0,i=g.value),"_fetch"in g&&t(1,o=g._fetch),"load_component"in g&&t(41,a=g.load_component),"allow_file_downloads"in g&&t(2,r=g.allow_file_downloads),"latex_delimiters"in g&&t(3,w=g.latex_delimiters),"pending_message"in g&&t(4,m=g.pending_message),"generating"in g&&t(5,h=g.generating),"selectable"in g&&t(6,k=g.selectable),"likeable"in g&&t(7,S=g.likeable),"show_share_button"in g&&t(8,C=g.show_share_button),"show_copy_all_button"in g&&t(9,H=g.show_copy_all_button),"rtl"in g&&t(10,b=g.rtl),"show_copy_button"in g&&t(11,v=g.show_copy_button),"avatar_images"in g&&t(12,E=g.avatar_images),"sanitize_html"in g&&t(13,Ce=g.sanitize_html),"bubble_full_width"in g&&t(14,ye=g.bubble_full_width),"render_markdown"in g&&t(15,re=g.render_markdown),"line_breaks"in g&&t(16,he=g.line_breaks),"autoscroll"in g&&t(42,_e=g.autoscroll),"theme_mode"in g&&t(17,de=g.theme_mode),"i18n"in g&&t(18,A=g.i18n),"layout"in g&&t(19,ge=g.layout),"placeholder"in g&&t(20,be=g.placeholder),"upload"in g&&t(21,we=g.upload),"msg_format"in g&&t(22,X=g.msg_format),"examples"in g&&t(23,Se=g.examples),"_retryable"in g&&t(24,ke=g._retryable),"_undoable"in g&&t(25,He=g._undoable),"like_user_message"in g&&t(26,Ve=g.like_user_message),"root"in g&&t(27,Le=g.root)},n.$$.update=()=>{n.$$.dirty[0]&1&&f(),n.$$.dirty[0]&268435473&&(i||m||_)&&mt(),n.$$.dirty[0]&1|n.$$.dirty[1]&4096&&(Cl(i,s)||(t(43,s=i),oe("change"))),n.$$.dirty[0]&4194305&&t(35,l=i&&ni(i,X))},[i,o,r,w,m,h,k,S,C,H,b,v,E,Ce,ye,re,he,de,A,ge,be,we,X,Se,ke,He,Ve,Le,_,Ie,d,ie,ht,dt,et,l,u,oe,ct,gt,bt,a,_e,s,Mt,Vt,c,hl,dl,gl]}class Qs extends zs{constructor(e){super(),Ls(this,e,Ks,Ws,Ns,{value:0,_fetch:1,load_component:41,allow_file_downloads:2,latex_delimiters:3,pending_message:4,generating:5,selectable:6,likeable:7,show_share_button:8,show_copy_all_button:9,rtl:10,show_copy_button:11,avatar_images:12,sanitize_html:13,bubble_full_width:14,render_markdown:15,line_breaks:16,autoscroll:42,theme_mode:17,i18n:18,layout:19,placeholder:20,upload:21,msg_format:22,examples:23,_retryable:24,_undoable:25,like_user_message:26,root:27},null,[-1,-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),z()}get _fetch(){return this.$$.ctx[1]}set _fetch(e){this.$$set({_fetch:e}),z()}get load_component(){return this.$$.ctx[41]}set load_component(e){this.$$set({load_component:e}),z()}get allow_file_downloads(){return this.$$.ctx[2]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),z()}get latex_delimiters(){return this.$$.ctx[3]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),z()}get pending_message(){return this.$$.ctx[4]}set pending_message(e){this.$$set({pending_message:e}),z()}
vendor: 13,591 bytes, lines 10-11
10get generating(){return this.$$.ctx[5]}set generating(e){this.$$set({generating:e}),z()}get selectable(){return this.$$.ctx[6]}set selectable(e){this.$$set({selectable:e}),z()}get likeable(){return this.$$.ctx[7]}set likeable(e){this.$$set({likeable:e}),z()}get show_share_button(){return this.$$.ctx[8]}set show_share_button(e){this.$$set({show_share_button:e}),z()}get show_copy_all_button(){return this.$$.ctx[9]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),z()}get rtl(){return this.$$.ctx[10]}set rtl(e){this.$$set({rtl:e}),z()}get show_copy_button(){return this.$$.ctx[11]}set show_copy_button(e){this.$$set({show_copy_button:e}),z()}get avatar_images(){return this.$$.ctx[12]}set avatar_images(e){this.$$set({avatar_images:e}),z()}get sanitize_html(){return this.$$.ctx[13]}set sanitize_html(e){this.$$set({sanitize_html:e}),z()}get bubble_full_width(){return this.$$.ctx[14]}set bubble_full_width(e){this.$$set({bubble_full_width:e}),z()}get render_markdown(){return this.$$.ctx[15]}set render_markdown(e){this.$$set({render_markdown:e}),z()}get line_breaks(){return this.$$.ctx[16]}set line_breaks(e){this.$$set({line_breaks:e}),z()}get autoscroll(){return this.$$.ctx[42]}set autoscroll(e){this.$$set({autoscroll:e}),z()}get theme_mode(){return this.$$.ctx[17]}set theme_mode(e){this.$$set({theme_mode:e}),z()}get i18n(){return this.$$.ctx[18]}set i18n(e){this.$$set({i18n:e}),z()}get layout(){return this.$$.ctx[19]}set layout(e){this.$$set({layout:e}),z()}get placeholder(){return this.$$.ctx[20]}set placeholder(e){this.$$set({placeholder:e}),z()}get upload(){return this.$$.ctx[21]}set upload(e){this.$$set({upload:e}),z()}get msg_format(){return this.$$.ctx[22]}set msg_format(e){this.$$set({msg_format:e}),z()}get examples(){return this.$$.ctx[23]}set examples(e){this.$$set({examples:e}),z()}get _retryable(){return this.$$.ctx[24]}set _retryable(e){this.$$set({_retryable:e}),z()}get _undoable(){return this.$$.ctx[25]}set _undoable(e){this.$$set({_undoable:e}),z()}get like_user_message(){return this.$$.ctx[26]}set like_user_message(e){this.$$set({like_user_message:e}),z()}get root(){return this.$$.ctx[27]}set root(e){this.$$set({root:e}),z()}}const Xs=Qs,{SvelteComponent:xs,append:ea,assign:ta,attr:na,check_outros:Wn,create_component:Ht,destroy_component:qt,detach:Yn,element:la,flush:y,get_spread_object:ia,get_spread_update:oa,group_outros:Kn,init:sa,insert:Qn,mount_component:zt,safe_not_equal:aa,space:Xn,transition_in:me,transition_out:qe}=window.__gradio__svelte__internal;function xn(n){let e,t;const l=[{autoscroll:n[24].autoscroll},{i18n:n[24].i18n},n[27],{show_progress:n[27].show_progress==="hidden"?"hidden":"minimal"}];let i={};for(let s=0;s<l.length;s+=1)i=ta(i,l[s]);return e=new Ml({props:i}),e.$on("clear_status",n[37]),{c(){Ht(e.$$.fragment)},m(s,o){zt(e,s,o),t=!0},p(s,o){const a=o[0]&150994944?oa(l,[o[0]&16777216&&{autoscroll:s[24].autoscroll},o[0]&16777216&&{i18n:s[24].i18n},o[0]&134217728&&ia(s[27]),o[0]&134217728&&{show_progress:s[27].show_progress==="hidden"?"hidden":"minimal"}]):{};e.$set(a)},i(s){t||(me(e.$$.fragment,s),t=!0)},o(s){qe(e.$$.fragment,s),t=!1},d(s){qt(e,s)}}}function el(n){let e,t;return e=new zl({props:{show_label:n[7],Icon:Tl,float:!0,label:n[6]||"Chatbot"}}),{c(){Ht(e.$$.fragment)},m(l,i){zt(e,l,i),t=!0},p(l,i){const s={};i[0]&128&&(s.show_label=l[7]),i[0]&64&&(s.label=l[6]||"Chatbot"),e.$set(s)},i(l){t||(me(e.$$.fragment,l),t=!0)},o(l){qe(e.$$.fragment,l),t=!1},d(l){qt(e,l)}}}function ra(n){let e,t,l,i,s,o=n[27]&&xn(n),a=n[7]&&el(n);return i=new Xs({props:{i18n:n[24].i18n,selectable:n[8],likeable:n[9],show_share_button:n[10],show_copy_all_button:n[13],value:n[35],latex_delimiters:n[23],render_markdown:n[18],theme_mode:n[33],pending_message:n[27]?.status==="pending",generating:n[27]?.status==="generating",rtl:n[11],show_copy_button:n[12],like_user_message:n[26],avatar_images:n[25],sanitize_html:n[14],bubble_full_width:n[15],line_breaks:n[19],autoscroll:n[20],layout:n[16],placeholder:n[31],examples:n[32],_retryable:n[21],_undoable:n[22],upload:n[38],_fetch:n[39],load_component:n[24].load_component,msg_format:n[17],root:n[24].root,allow_file_downloads:n[34]}}),i.$on("change",n[40]),i.$on("select",n[41]),i.$on("like",n[42]),i.$on("share",n[43]),i.$on("error",n[44]),i.$on("example_select",n[45]),i.$on("retry",n[46]),i.$on("undo",n[47]),i.$on("clear",n[48]),{c(){o&&o.c(),e=Xn(),t=la("div"),a&&a.c(),l=Xn(),Ht(i.$$.fragment),na(t,"class","wrapper svelte-g3p8na")},m(r,_){o&&o.m(r,_),Qn(r,e,_),Qn(r,t,_),a&&a.m(t,null),ea(t,l),zt(i,t,null),s=!0},p(r,_){r[27]?o?(o.p(r,_),_[0]&134217728&&me(o,1)):(o=xn(r),o.c(),me(o,1),o.m(e.parentNode,e)):o&&(Kn(),qe(o,1,1,()=>{o=null}),Wn()),r[7]?a?(a.p(r,_),_[0]&128&&me(a,1)):(a=el(r),a.c(),me(a,1),a.m(t,l)):a&&(Kn(),qe(a,1,1,()=>{a=null}),Wn());const u={};_[0]&16777216&&(u.i18n=r[24].i18n),_[0]&256&&(u.selectable=r[8]),_[0]&512&&(u.likeable=r[9]),_[0]&1024&&(u.show_share_button=r[10]),_[0]&8192&&(u.show_copy_all_button=r[13]),_[1]&16&&(u.value=r[35]),_[0]&8388608&&(u.latex_delimiters=r[23]),_[0]&262144&&(u.render_markdown=r[18]),_[1]&4&&(u.theme_mode=r[33]),_[0]&134217728&&(u.pending_message=r[27]?.status==="pending"),_[0]&134217728&&(u.generating=r[27]?.status==="generating"),_[0]&2048&&(u.rtl=r[11]),_[0]&4096&&(u.show_copy_button=r[12]),_[0]&67108864&&(u.like_user_message=r[26]),_[0]&33554432&&(u.avatar_images=r[25]),_[0]&16384&&(u.sanitize_html=r[14]),_[0]&32768&&(u.bubble_full_width=r[15]),_[0]&524288&&(u.line_breaks=r[19]),_[0]&1048576&&(u.autoscroll=r[20]),_[0]&65536&&(u.layout=r[16]),_[1]&1&&(u.placeholder=r[31]),_[1]&2&&(u.examples=r[32]),_[0]&2097152&&(u._retryable=r[21]),_[0]&4194304&&(u._undoable=r[22]),_[0]&16777216&&(u.upload=r[38]),_[0]&16777216&&(u._fetch=r[39]),_[0]&16777216&&(u.load_component=r[24].load_component),_[0]&131072&&(u.msg_format=r[17]),_[0]&16777216&&(u.root=r[24].root),_[1]&8&&(u.allow_file_downloads=r[34]),i.$set(u)},i(r){s||(me(o),me(a),me(i.$$.fragment,r),s=!0)},o(r){qe(o),qe(a),qe(i.$$.fragment,r),s=!1},d(r){r&&(Yn(e),Yn(t)),o&&o.d(r),a&&a.d(),qt(i)}}}function _a(n){let e,t;return e=new ql({props:{elem_id:n[1],elem_classes:n[2],visible:n[3],padding:!1,scale:n[4],min_width:n[5],height:n[28],min_height:n[29],max_height:n[30],allow_overflow:!0,flex:!0,overflow_behavior:"auto",$$slots:{default:[ra]},$$scope:{ctx:n}}}),{c(){Ht(e.$$.fragment)},m(l,i){zt(e,l,i),t=!0},p(l,i){const s={};i[0]&2&&(s.elem_id=l[1]),i[0]&4&&(s.elem_classes=l[2]),i[0]&8&&(s.visible=l[3]),i[0]&16&&(s.scale=l[4]),i[0]&32&&(s.min_width=l[5]),i[0]&268435456&&(s.height=l[28]),i[0]&536870912&&(s.min_height=l[29]),i[0]&1073741824&&(s.max_height=l[30]),i[0]&268435393|i[1]&262175&&(s.$$scope={dirty:i,ctx:l}),e.$set(s)},i(l){t||(me(e.$$.fragment,l),t=!0)},o(l){qe(e.$$.fragment,l),t=!1},d(l){qt(e,l)}}}function ua(n,e,t){let{elem_id:l=""}=e,{elem_classes:i=[]}=e,{visible:s=!0}=e,{value:o=[]}=e,{scale:a=null}=e,{min_width:r=void 0}=e,{label:_}=e,{show_label:u=!0}=e,{root:f}=e,{_selectable:w=!1}=e,{likeable:m=!1}=e,{show_share_button:h=!1}=e,{rtl:k=!1}=e,{show_copy_button:S=!0}=e,{show_copy_all_button:C=!1}=e,{sanitize_html:H=!0}=e,{bubble_full_width:b=!0}=e,{layout:v="bubble"}=e,{type:E="tuples"}=e,{render_markdown:Ce=!0}=e,{line_breaks:ye=!0}=e,{autoscroll:re=!0}=e,{_retryable:he=!1}=e,{_undoable:_e=!1}=e,{latex_delimiters:de}=e,{gradio:A}=e,ge=[],{avatar_images:be=[null,null]}=e,{like_user_message:we=!1}=e,{loading_status:X=void 0}=e,{height:Se}=e,{min_height:ke}=e,{max_height:He}=e,{placeholder:Ve=null}=e,{examples:Le=null}=e,{theme_mode:Ie}=e,{allow_file_downloads:d=!0}=e;const ie=()=>A.dispatch("clear_status",X),oe=(...c)=>A.client.upload(...c),ft=(...c)=>A.client.fetch(...c),ct=()=>A.dispatch("change",o),mt=c=>A.dispatch("select",c.detail),ht=c=>A.dispatch("like",c.detail),dt=c=>A.dispatch("share",c.detail),et=c=>A.dispatch("error",c.detail),gt=c=>A.dispatch("example_select",c.detail),bt=c=>A.dispatch("retry",c.detail),Mt=c=>A.dispatch("undo",c.detail),Vt=()=>{t(0,o=[]),A.dispatch("clear")};return n.$$set=c=>{"elem_id"in c&&t(1,l=c.elem_id),"elem_classes"in c&&t(2,i=c.elem_classes),"visible"in c&&t(3,s=c.visible),"value"in c&&t(0,o=c.value),"scale"in c&&t(4,a=c.scale),"min_width"in c&&t(5,r=c.min_width),"label"in c&&t(6,_=c.label),"show_label"in c&&t(7,u=c.show_label),"root"in c&&t(36,f=c.root),"_selectable"in c&&t(8,w=c._selectable),"likeable"in c&&t(9,m=c.likeable),"show_share_button"in c&&t(10,h=c.show_share_button),"rtl"in c&&t(11,k=c.rtl),"show_copy_button"in c&&t(12,S=c.show_copy_button),"show_copy_all_button"in c&&t(13,C=c.show_copy_all_button),"sanitize_html"in c&&t(14,H=c.sanitize_html),"bubble_full_width"in c&&t(15,b=c.bubble_full_width),"layout"in c&&t(16,v=c.layout),"type"in c&&t(17,E=c.type),"render_markdown"in c&&t(18,Ce=c.render_markdown),"line_breaks"in c&&t(19,ye=c.line_breaks),"autoscroll"in c&&t(20,re=c.autoscroll),"_retryable"in c&&t(21,he=c._retryable),"_undoable"in c&&t(22,_e=c._undoable),"latex_delimiters"in c&&t(23,de=c.latex_delimiters),"gradio"in c&&t(24,A=c.gradio),"avatar_images"in c&&t(25,be=c.avatar_images),"like_user_message"in c&&t(26,we=c.like_user_message),"loading_status"in c&&t(27,X=c.loading_status),"height"in c&&t(28,Se=c.height),"min_height"in c&&t(29,ke=c.min_height),"max_height"in c&&t(30,He=c.max_height),"placeholder"in c&&t(31,Ve=c.placeholder),"examples"in c&&t(32,Le=c.examples),"theme_mode"in c&&t(33,Ie=c.theme_mode),"allow_file_downloads"in c&&t(34,d=c.allow_file_downloads)},n.$$.update=()=>{n.$$.dirty[0]&131073|n.$$.dirty[1]&32&&t(35,ge=E==="tuples"?ti(o,f):ei(o,f))},[o,l,i,s,a,r,_,u,w,m,h,k,S,C,H,b,v,E,Ce,ye,re,he,_e,de,A,be,we,X,Se,ke,He,Ve,Le,Ie,d,ge,f,ie,oe,ft,ct,mt,ht,dt,et,gt,bt,Mt,Vt]}class ja extends xs{constructor(e){super(),sa(this,e,ua,_a,aa,{elem_id:1,elem_classes:2,visible:3,value:0,scale:4,min_width:5,label:6,show_label:7,root:36,_selectable:8,likeable:9,show_share_button:10,rtl:11,show_copy_button:12,show_copy_all_button:13,sanitize_html:14,bubble_full_width:15,layout:16,type:17,render_markdown:18,line_breaks:19,autoscroll:20,_retryable:21,_undoable:22,latex_delimiters:23,gradio:24,avatar_images:25,like_user_message:26,loading_status:27,height:28,min_height:29,max_height:30,placeholder:31,examples:32,theme_mode:33,allow_file_downloads:34},null,[-1,-1])}get elem_id(){return this.$$.ctx[1]}set elem_id(e){this.$$set({elem_id:e}),y()}get elem_classes(){return this.$$.ctx[2]}set elem_classes(e){this.$$set({elem_classes:e}),y()}get visible(){return this.$$.ctx[3]}set visible(e){this.$$set({visible:e}),y()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),y()}get scale(){return this.$$.ctx[4]}set scale(e){this.$$set({scale:e}),y()}get min_width(){return this.$$.ctx[5]}set min_width(e){this.$$set({min_width:e}),y()}get label(){return this.$$.ctx[6]}set label(e){this.$$set({label:e}),y()}get show_label(){return this.$$.ctx[7]}set show_label(e){this.$$set({show_label:e}),y()}get root(){return this.$$.ctx[36]}set root(e){this.$$set({root:e}),y()}get _selectable(){return this.$$.ctx[8]}set _selectable(e){this.$$set({_selectable:e}),y()}get likeable(){return this.$$.ctx[9]}set likeable(e){this.$$set({likeable:e}),y()}get show_share_button(){return this.$$.ctx[10]}set show_share_button(e){this.$$set({show_share_button:e}),y()}get rtl(){return this.$$.ctx[11]}set rtl(e){this.$$set({rtl:e}),y()}get show_copy_button(){return this.$$.ctx[12]}set show_copy_button(e){this.$$set({show_copy_button:e}),y()}get show_copy_all_button(){return this.$$.ctx[13]}set show_copy_all_button(e){this.$$set({show_copy_all_button:e}),y()}get sanitize_html(){return this.$$.ctx[14]}set sanitize_html(e){this.$$set({sanitize_html:e}),y()}get bubble_full_width(){return this.$$.ctx[15]}set bubble_full_width(e){this.$$set({bubble_full_width:e}),y()}get layout(){return this.$$.ctx[16]}set layout(e){this.$$set({layout:e}),y()}get type(){return this.$$.ctx[17]}set type(e){this.$$set({type:e}),y()}get render_markdown(){return this.$$.ctx[18]}set render_markdown(e){this.$$set({render_markdown:e}),y()}get line_breaks(){return this.$$.ctx[19]}set line_breaks(e){this.$$set({line_breaks:e}),y()}get autoscroll(){return this.$$.ctx[20]}set autoscroll(e){this.$$set({autoscroll:e}),y()}get _retryable(){return this.$$.ctx[21]}set _retryable(e){this.$$set({_retryable:e}),y()}get _undoable(){return this.$$.ctx[22]}set _undoable(e){this.$$set({_undoable:e}),y()}get latex_delimiters(){return this.$$.ctx[23]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),y()}get gradio(){return this.$$.ctx[24]}set gradio(e){this.$$set({gradio:e}),y()}get avatar_images(){return this.$$.ctx[25]}set avatar_images(e){this.$$set({avatar_images:e}),y()}get like_user_message(){return this.$$.ctx[26]}set like_user_message(e){this.$$set({like_user_message:e}),y()}get loading_status(){return this.$$.ctx[27]}set loading_status(e){this.$$set({loading_status:e}),y()}get height(){return this.$$.ctx[28]}set height(e){this.$$set({height:e}),y()}get min_height(){return this.$$.ctx[29]}set min_height(e){this.$$set({min_height:e}),y()}get max_height(){return this.$$.ctx[30]}set max_height(e){this.$$set({max_height:e}),y()}get placeholder(){return this.$$.ctx[31]}set placeholder(e){this.$$set({placeholder:e}),y()}get examples(){return this.$$.ctx[32]}set examples(e){this.$$set({examples:e}),y()}get theme_mode(){return this.$$.ctx[33]}set theme_mode(e){this.$$set({theme_mode:e}),y()}get allow_file_downloads(){return this.$$.ctx[34]}set allow_file_downloads(e){this.$$set({allow_file_downloads:e}),y()}}export{Xs as BaseChatBot,ja as default};
11//# sourceMappingURL=Index-Ciyw3CZ4.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.