vendor: 33,164 bytes, lines 1-2
1import"./IconButtonWrapper.svelte_svelte_type_style_lang-Dn324h3u.js";import{B as St}from"./BlockTitle-Bznni5NZ.js";import"./MarkdownCode.svelte_svelte_type_style_lang-C4fBIMNi.js";import{C as qt}from"./Clear-By3xiIwg.js";import{F as zt}from"./File-BQ_9P3Ye.js";import{M as Mt}from"./SelectSource-Ce_27dAp.js";import{M as Tt}from"./Music-CDm0RGMk.js";import{S as Dt}from"./Send-DyoOovnk.js";import{S as Bt}from"./Square-oAGqOwsh.js";import{V as Et}from"./Video-fsmLZWjA.js";import{a as Ht}from"./Upload-B_zkKtR-.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import{I as Ft}from"./Image-CnqB5dbD.js";/* empty css */import{I as Rt}from"./InteractiveAudio-D-dIBzGF.js";import{B as Vt}from"./Block-CygNNd5z.js";import{S as At}from"./index-Dk7BRz4q.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{default as vi}from"./Example-a9ZmXG15.js";import"./Info-B6Y9MYYe.js";import"./MarkdownCode-qms8blzp.js";import"./index-Do3LSwBC.js";import"./svelte/svelte.js";import"./prism-python-Cp7Xa0u5.js";/* empty css */import"./file-url-DoxvUUVV.js";import"./ModifyUpload-DFAMaPCH.js";import"./IconButton-DSs-aBrk.js";import"./Download-DVtk-Jv3.js";import"./Edit-BpRIf5rU.js";import"./Undo-DCjBnnSO.js";import"./IconButtonWrapper-jknaAjP6.js";import"./DownloadLink-QIttOhoR.js";import"./BlockLabel-8WtM61r3.js";import"./StreamingBar-BU9S4hA7.js";import"./AudioPlayer-DG1QBBp6.js";import"./utils-BsGrhMNe.js";import"./Trim-JQYgj7Jd.js";import"./Play-B0Q0U1Qz.js";import"./Empty-AVq7jL0F.js";import"./hls-CnVhpNcu.js";import"./Video-C-llMUaJ.js";const{SvelteComponent:Pt,append:we,attr:Y,detach:It,init:Ut,insert:jt,noop:je,safe_not_equal:Gt,svg_element:ge}=window.__gradio__svelte__internal;function Lt(t){let e,l,i,o,s;return{c(){e=ge("svg"),l=ge("g"),i=ge("g"),o=ge("g"),s=ge("path"),Y(l,"id","SVGRepo_bgCarrier"),Y(l,"stroke-width","0"),Y(i,"id","SVGRepo_tracerCarrier"),Y(i,"stroke-linecap","round"),Y(i,"stroke-linejoin","round"),Y(s,"d","M1752.768 221.109C1532.646.986 1174.283.986 954.161 221.109l-838.588 838.588c-154.052 154.165-154.052 404.894 0 558.946 149.534 149.421 409.976 149.308 559.059 0l758.738-758.626c87.982-88.094 87.982-231.417 0-319.51-88.32-88.208-231.642-87.982-319.51 0l-638.796 638.908 79.85 79.849 638.795-638.908c43.934-43.821 115.539-43.934 159.812 0 43.934 44.047 43.934 115.877 0 159.812l-758.739 758.625c-110.23 110.118-289.355 110.005-399.36 0-110.118-110.117-110.005-289.242 0-399.247l838.588-838.588c175.963-175.962 462.382-176.188 638.909 0 176.075 176.188 176.075 462.833 0 638.908l-798.607 798.72 79.849 79.85 798.607-798.72c220.01-220.123 220.01-578.485 0-798.607"),Y(s,"fill-rule","evenodd"),Y(o,"id","SVGRepo_iconCarrier"),Y(e,"fill","currentColor"),Y(e,"width","100%"),Y(e,"height","100%"),Y(e,"viewBox","0 0 1920 1920"),Y(e,"xmlns","http://www.w3.org/2000/svg")},m(c,f){jt(c,e,f),we(e,l),we(e,i),we(e,o),we(o,s)},p:je,i:je,o:je,d(c){c&&It(e)}}}class Wt extends Pt{constructor(e){super(),Ut(this,e,null,Lt,Gt,{})}}const{tick:Kt}=window.__gradio__svelte__internal;async function Ge(t,e,l){if(await Kt(),e===l)return;const i=window.getComputedStyle(t),o=parseFloat(i.paddingTop),s=parseFloat(i.paddingBottom),c=parseFloat(i.lineHeight);let f=l===void 0?!1:o+s+c*l,r=o+s+e*c;t.style.height="1px";let d;f&&t.scrollHeight>f?d=f:t.scrollHeight<r?d=r:d=t.scrollHeight,t.style.height=`${d}px`}function Yt(t,e){if(e.lines===e.max_lines)return;t.style.overflowY="scroll";function l(i){Ge(i.target,e.lines,e.max_lines)}if(t.addEventListener("input",l),!!e.text.trim())return Ge(t,e.lines,e.max_lines),{destroy:()=>t.removeEventListener("input",l)}}const{SvelteComponent:Nt,action_destroyer:Xt,add_flush_callback:Xe,append:N,attr:q,bind:Je,binding_callbacks:he,bubble:ve,check_outros:ie,create_component:O,destroy_component:Q,destroy_each:Jt,detach:Z,element:J,ensure_array_like:Oe,flush:z,group_outros:ne,init:Ot,insert:y,is_function:qe,listen:L,mount_component:x,noop:se,prevent_default:Qt,run_all:Zt,safe_not_equal:yt,set_data:Le,set_input_value:Qe,set_style:Ze,space:le,text:We,toggle_class:$,transition_in:v,transition_out:S}=window.__gradio__svelte__internal,{onMount:xt,beforeUpdate:$t,afterUpdate:el,createEventDispatcher:tl,tick:ye}=window.__gradio__svelte__internal;function xe(t,e,l){const i=t.slice();return i[69]=e[l],i[71]=l,i}function ll(t){let e;return{c(){e=We(t[7])},m(l,i){y(l,e,i)},p(l,i){i[0]&128&&Le(e,l[7])},d(l){l&&Z(e)}}}function $e(t){let e,l,i,o=Oe(t[0].files),s=[];for(let r=0;r<o.length;r+=1)s[r]=et(xe(t,o,r));const c=r=>S(s[r],1,1,()=>{s[r]=null});let f=t[27]&&tt();return{c(){e=J("div");for(let r=0;r<s.length;r+=1)s[r].c();l=le(),f&&f.c(),q(e,"class","thumbnails scroll-hide svelte-5gfv2q"),q(e,"aria-label","Uploaded files"),q(e,"data-testid","container_el"),Ze(e,"display",t[0].files.length>0||t[27]?"flex":"none")},m(r,d){y(r,e,d);for(let _=0;_<s.length;_+=1)s[_]&&s[_].m(e,null);N(e,l),f&&f.m(e,null),i=!0},p(r,d){if(d[0]&65|d[1]&16){o=Oe(r[0].files);let _;for(_=0;_<o.length;_+=1){const C=xe(r,o,_);s[_]?(s[_].p(C,d),v(s[_],1)):(s[_]=et(C),s[_].c(),v(s[_],1),s[_].m(e,l))}for(ne(),_=o.length;_<s.length;_+=1)c(_);ie()}r[27]?f||(f=tt(),f.c(),f.m(e,null)):f&&(f.d(1),f=null),(!i||d[0]&134217729)&&Ze(e,"display",r[0].files.length>0||r[27]?"flex":"none")},i(r){if(!i){for(let d=0;d<o.length;d+=1)v(s[d]);i=!0}},o(r){s=s.filter(Boolean);for(let d=0;d<s.length;d+=1)S(s[d]);i=!1},d(r){r&&Z(e),Jt(s,r),f&&f.d()}}}function il(t){let e,l;return e=new zt({}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p:se,i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function nl(t){let e,l;return e=new Et({}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p:se,i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function sl(t){let e,l;return e=new Tt({}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p:se,i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function ol(t){let e,l;return e=new Ft({props:{src:t[69].url,title:null,alt:"",loading:"lazy",class:"thumbnail-image"}}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p(i,o){const s={};o[0]&1&&(s.src=i[69].url),e.$set(s)},i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function et(t){let e,l,i,o,s,c,f,r,d,_,C,m,k;o=new qt({});function u(...w){return t[50](t[71],...w)}const g=[ol,sl,nl,il],b=[];function X(w,V){return V[0]&1&&(c=null),V[0]&1&&(f=null),V[0]&1&&(r=null),c==null&&(c=!!(w[69].mime_type&&w[69].mime_type.includes("image"))),c?0:(f==null&&(f=!!(w[69].mime_type&&w[69].mime_type.includes("audio"))),f?1:(r==null&&(r=!!(w[69].mime_type&&w[69].mime_type.includes("video"))),r?2:3))}return d=X(t,[-1,-1,-1]),_=b[d]=g[d](t),{c(){e=J("span"),l=J("button"),i=J("button"),O(o.$$.fragment),s=le(),_.c(),q(i,"class","delete-button svelte-5gfv2q"),$(i,"disabled",t[6]),q(l,"class","thumbnail-item thumbnail-small svelte-5gfv2q"),q(e,"role","listitem"),q(e,"aria-label","File thumbnail")},m(w,V){y(w,e,V),N(e,l),N(l,i),x(o,i,null),N(l,s),b[d].m(l,null),C=!0,m||(k=L(i,"click",u),m=!0)},p(w,V){t=w,(!C||V[0]&64)&&$(i,"disabled",t[6]);let P=d;d=X(t,V),d===P?b[d].p(t,V):(ne(),S(b[P],1,1,()=>{b[P]=null}),ie(),_=b[d],_?_.p(t,V):(_=b[d]=g[d](t),_.c()),v(_,1),_.m(l,null))},i(w){C||(v(o.$$.fragment,w),v(_),C=!0)},o(w){S(o.$$.fragment,w),S(_),C=!1},d(w){w&&Z(e),Q(o),b[d].d(),m=!1,k()}}}function tt(t){let e;return{c(){e=J("div"),q(e,"class","loader svelte-5gfv2q"),q(e,"role","status"),q(e,"aria-label","Uploading")},m(l,i){y(l,e,i)},d(l){l&&Z(e)}}}function lt(t){let e,l;return e=new Rt({props:{sources:["microphone"],class_name:"compact-audio",recording:ut,waveform_settings:t[22],waveform_options:t[23],i18n:t[4],active_source:t[2],upload:t[19],stream_handler:t[20],stream_every:1,editable:!0,label:t[7],root:t[16],loop:!1,show_label:!1,show_download_button:!1,dragging:!1}}),e.$on("change",t[51]),e.$on("clear",t[52]),e.$on("start_recording",t[53]),e.$on("pause_recording",t[54]),e.$on("stop_recording",t[55]),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p(i,o){const s={};o[0]&4194304&&(s.waveform_settings=i[22]),o[0]&8388608&&(s.waveform_options=i[23]),o[0]&16&&(s.i18n=i[4]),o[0]&4&&(s.active_source=i[2]),o[0]&524288&&(s.upload=i[19]),o[0]&1048576&&(s.stream_handler=i[20]),o[0]&128&&(s.label=i[7]),o[0]&65536&&(s.root=i[16]),e.$set(s)},i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function it(t){let e,l,i,o,s,c,f,r,d;function _(k){t[57](k)}function C(k){t[58](k)}let m={file_count:t[21],filetype:t[17],root:t[16],max_file_size:t[18],show_progress:!1,disable_click:!0,hidden:!0,upload:t[19],stream_handler:t[20]};return t[1]!==void 0&&(m.dragging=t[1]),t[27]!==void 0&&(m.uploading=t[27]),e=new Ht({props:m}),t[56](e),he.push(()=>Je(e,"dragging",_)),he.push(()=>Je(e,"uploading",C)),e.$on("load",t[34]),e.$on("error",t[59]),c=new Wt({}),{c(){O(e.$$.fragment),o=le(),s=J("button"),O(c.$$.fragment),q(s,"data-testid","upload-button"),q(s,"class","upload-button svelte-5gfv2q"),s.disabled=t[6]},m(k,u){x(e,k,u),y(k,o,u),y(k,s,u),x(c,s,null),f=!0,r||(d=L(s,"click",function(){qe(t[6]?void 0:t[36])&&(t[6]?void 0:t[36]).apply(this,arguments)}),r=!0)},p(k,u){t=k;const g={};u[0]&2097152&&(g.file_count=t[21]),u[0]&131072&&(g.filetype=t[17]),u[0]&65536&&(g.root=t[16]),u[0]&262144&&(g.max_file_size=t[18]),u[0]&524288&&(g.upload=t[19]),u[0]&1048576&&(g.stream_handler=t[20]),!l&&u[0]&2&&(l=!0,g.dragging=t[1],Xe(()=>l=!1)),!i&&u[0]&134217728&&(i=!0,g.uploading=t[27],Xe(()=>i=!1)),e.$set(g),(!f||u[0]&64)&&(s.disabled=t[6])},i(k){f||(v(e.$$.fragment,k),v(c.$$.fragment,k),f=!0)},o(k){S(e.$$.fragment,k),S(c.$$.fragment,k),f=!1},d(k){k&&(Z(o),Z(s)),t[56](null),Q(e,k),Q(c),r=!1,d()}}}function nt(t){let e,l,i,o,s;return l=new Mt({}),{c(){e=J("button"),O(l.$$.fragment),q(e,"data-testid","microphone-button"),q(e,"class","microphone-button svelte-5gfv2q"),e.disabled=t[6],$(e,"recording",ut)},m(c,f){y(c,e,f),x(l,e,null),i=!0,o||(s=L(e,"click",function(){qe(t[6]?void 0:t[60])&&(t[6]?void 0:t[60]).apply(this,arguments)}),o=!0)},p(c,f){t=c,(!i||f[0]&64)&&(e.disabled=t[6])},i(c){i||(v(l.$$.fragment,c),i=!0)},o(c){S(l.$$.fragment,c),i=!1},d(c){c&&Z(e),Q(l),o=!1,s()}}}function st(t){let e,l,i,o,s,c;const f=[ul,rl],r=[];function d(_,C){return _[11]===!0?0:1}return l=d(t),i=r[l]=f[l](t),{c(){e=J("button"),i.c(),q(e,"class","submit-button svelte-5gfv2q"),e.disabled=t[6],$(e,"padded-button",t[11]!==!0)},m(_,C){y(_,e,C),r[l].m(e,null),o=!0,s||(c=L(e,"click",function(){qe(t[6]?void 0:t[38])&&(t[6]?void 0:t[38]).apply(this,arguments)}),s=!0)},p(_,C){t=_;let m=l;l=d(t),l===m?r[l].p(t,C):(ne(),S(r[m],1,1,()=>{r[m]=null}),ie(),i=r[l],i?i.p(t,C):(i=r[l]=f[l](t),i.c()),v(i,1),i.m(e,null)),(!o||C[0]&64)&&(e.disabled=t[6]),(!o||C[0]&2048)&&$(e,"padded-button",t[11]!==!0)},i(_){o||(v(i),o=!0)},o(_){S(i),o=!1},d(_){_&&Z(e),r[l].d(),s=!1,c()}}}function rl(t){let e;return{c(){e=We(t[11])},m(l,i){y(l,e,i)},p(l,i){i[0]&2048&&Le(e,l[11])},i:se,o:se,d(l){l&&Z(e)}}}function ul(t){let e,l;return e=new Dt({}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p:se,i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function ot(t){let e,l,i,o,s,c;const f=[fl,al],r=[];function d(_,C){return _[12]===!0?0:1}return l=d(t),i=r[l]=f[l](t),{c(){e=J("button"),i.c(),q(e,"class","stop-button svelte-5gfv2q"),$(e,"padded-button",t[12]!==!0)},m(_,C){y(_,e,C),r[l].m(e,null),o=!0,s||(c=L(e,"click",t[37]),s=!0)},p(_,C){let m=l;l=d(_),l===m?r[l].p(_,C):(ne(),S(r[m],1,1,()=>{r[m]=null}),ie(),i=r[l],i?i.p(_,C):(i=r[l]=f[l](_),i.c()),v(i,1),i.m(e,null)),(!o||C[0]&4096)&&$(e,"padded-button",_[12]!==!0)},i(_){o||(v(i),o=!0)},o(_){S(i),o=!1},d(_){_&&Z(e),r[l].d(),s=!1,c()}}}function al(t){let e;return{c(){e=We(t[12])},m(l,i){y(l,e,i)},p(l,i){i[0]&4096&&Le(e,l[12])},i:se,o:se,d(l){l&&Z(e)}}}function fl(t){let e,l;return e=new Bt({props:{fill:"none",stroke_width:2.5}}),{c(){O(e.$$.fragment)},m(i,o){x(e,i,o),l=!0},p:se,i(i){l||(v(e.$$.fragment,i),l=!0)},o(i){S(e.$$.fragment,i),l=!1},d(i){Q(e,i)}}}function _l(t){let e,l,i,o,s=t[24]&&t[24].includes("microphone")&&t[2]==="microphone",c,f,r=t[24]&&t[24].includes("upload")&&!(t[21]==="single"&&t[0].files.length>0),d,_=t[24]&&t[24].includes("microphone"),C,m,k,u,g,b,X,w,V,P;l=new St({props:{root:t[16],show_label:t[9],info:t[8],rtl:t[13],$$slots:{default:[ll]},$$scope:{ctx:t}}});let B=(t[0].files.length>0||t[27])&&$e(t),E=s&<(t),H=r&&it(t),F=_&&nt(t),T=t[11]&&st(t),R=t[12]&&ot(t);return{c(){e=J("div"),O(l.$$.fragment),i=le(),B&&B.c(),o=le(),E&&E.c(),c=le(),f=J("div"),H&&H.c(),d=le(),F&&F.c(),C=le(),m=J("textarea"),b=le(),T&&T.c(),X=le(),R&&R.c(),q(m,"data-testid","textbox"),q(m,"class","scroll-hide svelte-5gfv2q"),q(m,"dir",k=t[13]?"rtl":"ltr"),q(m,"placeholder",t[5]),q(m,"rows",t[3]),m.disabled=t[6],m.autofocus=t[14],q(m,"style",u=t[15]?"text-align: "+t[15]:""),$(m,"no-label",!t[9]),q(f,"class","input-container svelte-5gfv2q"),q(e,"class","full-container svelte-5gfv2q"),q(e,"role","group"),q(e,"aria-label","Multimedia input field"),$(e,"dragging",t[1])},m(h,p){y(h,e,p),x(l,e,null),N(e,i),B&&B.m(e,null),N(e,o),E&&E.m(e,null),N(e,c),N(e,f),H&&H.m(f,null),N(f,d),F&&F.m(f,null),N(f,C),N(f,m),Qe(m,t[0].text),t[62](m),N(f,b),T&&T.m(f,null),N(f,X),R&&R.m(f,null),t[63](e),w=!0,t[14]&&m.focus(),V||(P=[Xt(g=Yt.call(null,m,{text:t[0].text,lines:t[3],max_lines:t[10]})),L(m,"input",t[61]),L(m,"keypress",t[32]),L(m,"blur",t[48]),L(m,"select",t[31]),L(m,"focus",t[49]),L(m,"scroll",t[33]),L(m,"paste",t[39]),L(e,"dragenter",t[40]),L(e,"dragleave",t[41]),L(e,"dragover",Qt(t[47])),L(e,"drop",t[42])],V=!0)},p(h,p){const I={};p[0]&65536&&(I.root=h[16]),p[0]&512&&(I.show_label=h[9]),p[0]&256&&(I.info=h[8]),p[0]&8192&&(I.rtl=h[13]),p[0]&128|p[2]&1024&&(I.$$scope={dirty:p,ctx:h}),l.$set(I),h[0].files.length>0||h[27]?B?(B.p(h,p),p[0]&134217729&&v(B,1)):(B=$e(h),B.c(),v(B,1),B.m(e,o)):B&&(ne(),S(B,1,1,()=>{B=null}),ie()),p[0]&16777220&&(s=h[24]&&h[24].includes("microphone")&&h[2]==="microphone"),s?E?(E.p(h,p),p[0]&16777220&&v(E,1)):(E=lt(h),E.c(),v(E,1),E.m(e,c)):E&&(ne(),S(E,1,1,()=>{E=null}),ie()),p[0]&18874369&&(r=h[24]&&h[24].includes("upload")&&!(h[21]==="single"&&h[0].files.length>0)),r?H?(H.p(h,p),p[0]&18874369&&v(H,1)):(H=it(h),H.c(),v(H,1),H.m(f,d)):H&&(ne(),S(H,1,1,()=>{H=null}),ie()),p[0]&16777216&&(_=h[24]&&h[24].includes("microphone")),_?F?(F.p(h,p),p[0]&16777216&&v(F,1)):(F=nt(h),F.c(),v(F,1),F.m(f,C)):F&&(ne(),S(F,1,1,()=>{F=null}),ie()),(!w||p[0]&8192&&k!==(k=h[13]?"rtl":"ltr"))&&q(m,"dir",k),(!w||p[0]&32)&&q(m,"placeholder",h[5]),(!w||p[0]&8)&&q(m,"rows",h[3]),(!w||p[0]&64)&&(m.disabled=h[6]),(!w||p[0]&16384)&&(m.autofocus=h[14]),(!w||p[0]&32768&&u!==(u=h[15]?"text-align: "+h[15]:""))&&q(m,"style",u),g&&qe(g.update)&&p[0]&1033&&g.update.call(null,{text:h[0].text,lines:h[3],max_lines:h[10]}),p[0]&1&&Qe(m,h[0].text),(!w||p[0]&512)&&$(m,"no-label",!h[9]),h[11]?T?(T.p(h,p),p[0]&2048&&v(T,1)):(T=st(h),T.c(),v(T,1),T.m(f,X)):T&&(ne(),S(T,1,1,()=>{T=null}),ie()),h[12]?R?(R.p(h,p),p[0]&4096&&v(R,1)):(R=ot(h),R.c(),v(R,1),R.m(f,null)):R&&(ne(),S(R,1,1,()=>{R=null}),ie()),(!w||p[0]&2)&&$(e,"dragging",h[1])},i(h){w||(v(l.$$.fragment,h),v(B),v(E),v(H),v(F),v(T),v(R),w=!0)},o(h){S(l.$$.fragment,h),S(B),S(E),S(H),S(F),S(T),S(R),w=!1},d(h){h&&Z(e),Q(l),B&&B.d(),E&&E.d(),H&&H.d(),F&&F.d(),t[62](null),T&&T.d(),R&&R.d(),t[63](null),V=!1,Zt(P)}}}let ut=!1;function cl(t,e,l){let{value:i={text:"",files:[]}}=e,{value_is_output:o=!1}=e,{lines:s=1}=e,{i18n:c}=e,{placeholder:f="Type here..."}=e,{disabled:r=!1}=e,{label:d}=e,{info:_=void 0}=e,{show_label:C=!0}=e,{max_lines:m}=e,{submit_btn:k=null}=e,{stop_btn:u=null}=e,{rtl:g=!1}=e,{autofocus:b=!1}=e,{text_align:X=void 0}=e,{autoscroll:w=!0}=e,{root:V}=e,{file_types:P=null}=e,{max_file_size:B=null}=e,{upload:E}=e,{stream_handler:H}=e,{file_count:F="multiple"}=e,{max_plain_text_length:T=1e3}=e,{waveform_settings:R}=e,{waveform_options:h={show_recording_waveform:!0}}=e,{sources:p=["upload"]}=e,{active_source:I=null}=e,U,j,oe,K=0,re=!1,{dragging:ee=!1}=e,ce=!1,me=i.text,te=null,ae;const A=tl();$t(()=>{oe=j&&j.offsetHeight+j.scrollTop>j.scrollHeight-100});const ze=()=>{oe&&w&&!re&&j.scrollTo(0,j.scrollHeight)};async function be(){A("change",i),o||A("input")}xt(()=>{b&&j!==null&&j.focus()}),el(()=>{oe&&w&&ze(),l(43,o=!1)});function Me(n){const D=n.target,G=D.value,W=[D.selectionStart,D.selectionEnd];A("select",{value:G.substring(...W),index:W})}async function Te(n){await ye(),n.key==="Enter"&&n.shiftKey&&s>1?(n.preventDefault(),A("submit")):n.key==="Enter"&&!n.shiftKey&&s===1&&m>=1&&(n.preventDefault(),A("submit"),l(2,I=null),te&&(i.files.push(te),l(0,i),l(28,te=null)))}function De(n){const D=n.target,G=D.scrollTop;G<K&&(re=!0),K=G;const W=D.scrollHeight-D.clientHeight;G>=W&&(re=!1)}async function Be({detail:n}){if(be(),Array.isArray(n)){for(let D of n)i.files.push(D);l(0,i)}else i.files.push(n),l(0,i);await ye(),A("change",i),A("upload",n)}function pe(n,D){be(),n.stopPropagation(),i.files.splice(D,1),l(0,i)}function Ee(){U.open_upload()}function He(){A("stop")}function Fe(){A("submit"),l(2,I=null),te&&(i.files.push(te),l(0,i),l(28,te=null))}async function Re(n){if(!n.clipboardData)return;const D=n.clipboardData.items,G=n.clipboardData.getData("text");if(G&&G.length>T){n.preventDefault();const W=new window.File([G],"pasted_text.txt",{type:"text/plain",lastModified:Date.now()});U&&U.load_files([W]);return}for(let W in D){const ue=D[W];if(ue.kind==="file"&&ue.type.includes("image")){const fe=ue.getAsFile();fe&&U.load_files([fe])}}}function Ve(n){n.preventDefault(),l(1,ee=!0)}function Ae(n){n.preventDefault();const D=ae.getBoundingClientRect(),{clientX:G,clientY:W}=n;(G<=D.left||G>=D.right||W<=D.top||W>=D.bottom)&&l(1,ee=!1)}function Pe(n){if(n.preventDefault(),l(1,ee=!1),n.dataTransfer&&n.dataTransfer.files){const D=Array.from(n.dataTransfer.files);if(P){const G=D.filter(ue=>P.some(fe=>fe.startsWith(".")?ue.name.toLowerCase().endsWith(fe.toLowerCase()):ue.type.match(new RegExp(fe.replace("*",".*"))))),W=D.length-G.length;W>0&&A("error",`${W} file(s) were rejected. Accepted formats: ${P.join(", ")}`),G.length>0&&U.load_files(G)}else U.load_files(D)}}function Ie(n){ve.call(this,t,n)}function Ue(n){ve.call(this,t,n)}function a(n){ve.call(this,t,n)}const at=(n,D)=>pe(D,n),ft=({detail:n})=>{n!==null&&l(28,te=n)},_t=()=>{l(2,I=null)},ct=()=>A("start_recording"),mt=()=>A("pause_recording"),gt=()=>A("stop_recording");function ht(n){he[n?"unshift":"push"](()=>{U=n,l(26,U)})}function dt(n){ee=n,l(1,ee)}function bt(n){ce=n,l(27,ce)}function pt(n){ve.call(this,t,n)}const wt=()=>{l(2,I=I!=="microphone"?"microphone":null)};function vt(){i.text=this.value,l(0,i)}function kt(n){he[n?"unshift":"push"](()=>{j=n,l(25,j)})}function Ct(n){he[n?"unshift":"push"](()=>{ae=n,l(29,ae)})}return t.$$set=n=>{"value"in n&&l(0,i=n.value),"value_is_output"in n&&l(43,o=n.value_is_output),"lines"in n&&l(3,s=n.lines),"i18n"in n&&l(4,c=n.i18n),"placeholder"in n&&l(5,f=n.placeholder),"disabled"in n&&l(6,r=n.disabled),"label"in n&&l(7,d=n.label),"info"in n&&l(8,_=n.info),"show_label"in n&&l(9,C=n.show_label),"max_lines"in n&&l(10,m=n.max_lines),"submit_btn"in n&&l(11,k=n.submit_btn),"stop_btn"in n&&l(12,u=n.stop_btn),"rtl"in n&&l(13,g=n.rtl),"autofocus"in n&&l(14,b=n.autofocus),"text_align"in n&&l(15,X=n.text_align),"autoscroll"in n&&l(44,w=n.autoscroll),"root"in n&&l(16,V=n.root),"file_types"in n&&l(17,P=n.file_types),"max_file_size"in n&&l(18,B=n.max_file_size),"upload"in n&&l(19,E=n.upload),"stream_handler"in n&&l(20,H=n.stream_handler),"file_count"in n&&l(21,F=n.file_count),"max_plain_text_length"in n&&l(45,T=n.max_plain_text_length),"waveform_settings"in n&&l(22,R=n.waveform_settings),"waveform_options"in n&&l(23,h=n.waveform_options),"sources"in n&&l(24,p=n.sources),"active_source"in n&&l(2,I=n.active_source),"dragging"in n&&l(1,ee=n.dragging)},t.$$.update=()=>{t.$$.dirty[0]&2&&A("drag",ee),t.$$.dirty[0]&1&&i===null&&l(0,i={text:"",files:[]}),t.$$.dirty[0]&1|t.$$.dirty[1]&32768&&me!==i.text&&(A("change",i),l(46,me=i.text)),t.$$.dirty[0]&33555465&&j&&s!==m&&Ge(j,s,m)},[i,ee,I,s,c,f,r,d,_,C,m,k,u,g,b,X,V,P,B,E,H,F,R,h,p,j,U,ce,te,ae,A,Me,Te,De,Be,pe,Ee,He,Fe,Re,Ve,Ae,Pe,o,w,T,me,Ie,Ue,a,at,ft,_t,ct,mt,gt,ht,dt,bt,pt,wt,vt,kt,Ct]}class ml extends Nt{constructor(e){super(),Ot(this,e,cl,_l,yt,{value:0,value_is_output:43,lines:3,i18n:4,placeholder:5,disabled:6,label:7,info:8,show_label:9,max_lines:10,submit_btn:11,stop_btn:12,rtl:13,autofocus:14,text_align:15,autoscroll:44,root:16,file_types:17,max_file_size:18,upload:19,stream_handler:20,file_count:21,max_plain_text_length:45,waveform_settings:22,waveform_options:23,sources:24,active_source:2,dragging:1},null,[-1,-1,-1])}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),z()}get value_is_output(){return this.$$.ctx[43]}set value_is_output(e){this.$$set({value_is_output:e}),z()}get lines(){return this.$$.ctx[3]}set lines(e){this.$$set({lines:e}),z()}get i18n(){return this.$$.ctx[4]}set i18n(e){this.$$set({i18n:e}),z()}get placeholder(){return this.$$.ctx[5]}set placeholder(e){this.$$set({placeholder:e}),z()}get disabled(){return this.$$.ctx[6]}set disabled(e){this.$$set({disabled:e}),z()}get label(){return this.$$.ctx[7]}set label(e){this.$$set({label:e}),z()}get info(){return this.$$.ctx[8]}set info(e){this.$$set({info:e}),z()}get show_label(){return this.$$.ctx[9]}set show_label(e){this.$$set({show_label:e}),z()}get max_lines(){return this.$$.ctx[10]}set max_lines(e){this.$$set({max_lines:e}),z()}get submit_btn(){return this.$$.ctx[11]}set submit_btn(e){this.$$set({submit_btn:e}),z()}get stop_btn(){return this.$$.ctx[12]}set stop_btn(e){this.$$set({stop_btn:e}),z()}get rtl(){return this.$$.ctx[13]}set rtl(e){this.$$set({rtl:e}),z()}get autofocus(){return this.$$.ctx[14]}set autofocus(e){this.$$set({autofocus:e}),z()}get text_align(){return this.$$.ctx[15]}set text_align(e){this.$$set({text_align:e}),z()}get autoscroll(){return this.$$.ctx[44]}set autoscroll(e){this.$$set({autoscroll:e}),z()}get root(){return this.$$.ctx[16]}set root(e){this.$$set({root:e}),z()}get file_types(){return this.$$.ctx[17]}set file_types(e){this.$$set({file_types:e}),z()}get max_file_size(){return this.$$.ctx[18]}set max_file_size(e){this.$$set({max_file_size:e}),z()}get upload(){return this.$$.ctx[19]}set upload(e){this.$$set({upload:e}),z()}get stream_handler(){return this.$$.ctx[20]}set stream_handler(e){this.$$set({stream_handler:e}),z()}get file_count(){return this.$$.ctx[21]}set file_count(e){this.$$set({file_count:e}),z()}get max_plain_text_length(){return this.$$.ctx[45]}set max_plain_text_length(e){this.$$set({max_plain_text_length:e}),z()}get waveform_settings(){return this.$$.ctx[22]}set waveform_settings(e){this.$$set({waveform_settings:e}),z()}get waveform_options(){return this.$$.ctx[23]}set waveform_options(e){this.$$set({waveform_options:e}),z()}get sources(){return this.$$.ctx[24]}set sources(e){this.$$set({sources:e}),z()}get active_source(){return this.$$.ctx[2]}set active_source(e){this.$$set({active_source:e}),z()}get dragging(){return this.$$.ctx[1]}set dragging(e){this.$$set({dragging:e}),z()}}const gl=ml,{SvelteComponent:hl,add_flush_callback:ke,assign:dl,bind:Ce,binding_callbacks:Se,check_outros:bl,create_component:Ke,destroy_component:Ye,detach:pl,flush:M,get_spread_object:wl,get_spread_update:vl,group_outros:kl,init:Cl,insert:Sl,mount_component:Ne,safe_not_equal:ql,space:zl,transition_in:_e,transition_out:de}=window.__gradio__svelte__internal,{onMount:Ml}=window.__gradio__svelte__internal;function rt(t){let e,l;const i=[{autoscroll:t[2].autoscroll},{i18n:t[2].i18n},t[17]];let o={};for(let s=0;s<i.length;s+=1)o=dl(o,i[s]);return e=new At({props:o}),e.$on("clear_status",t[31]),{c(){Ke(e.$$.fragment)},m(s,c){Ne(e,s,c),l=!0},p(s,c){const f=c[0]&131076?vl(i,[c[0]&4&&{autoscroll:s[2].autoscroll},c[0]&4&&{i18n:s[2].i18n},c[0]&131072&&wl(s[17])]):{};e.$set(f)},i(s){l||(_e(e.$$.fragment,s),l=!0)},o(s){de(e.$$.fragment,s),l=!1},d(s){Ye(e,s)}}}function Tl(t){let e,l,i,o,s,c,f,r=t[17]&&rt(t);function d(u){t[34](u)}function _(u){t[35](u)}function C(u){t[36](u)}function m(u){t[37](u)}let k={file_types:t[6],root:t[23],label:t[9],info:t[10],show_label:t[11],lines:t[7],rtl:t[18],text_align:t[19],waveform_settings:t[29],i18n:t[2].i18n,max_lines:t[12]?t[12]:t[7]+1,placeholder:t[8],submit_btn:t[15],stop_btn:t[16],autofocus:t[20],autoscroll:t[21],file_count:t[24],sources:t[26],max_file_size:t[2].max_file_size,disabled:!t[22],upload:t[32],stream_handler:t[33],max_plain_text_length:t[25]};return t[0]!==void 0&&(k.value=t[0]),t[1]!==void 0&&(k.value_is_output=t[1]),t[27]!==void 0&&(k.dragging=t[27]),t[28]!==void 0&&(k.active_source=t[28]),l=new gl({props:k}),Se.push(()=>Ce(l,"value",d)),Se.push(()=>Ce(l,"value_is_output",_)),Se.push(()=>Ce(l,"dragging",C)),Se.push(()=>Ce(l,"active_source",m)),l.$on("change",t[38]),l.$on("input",t[39]),l.$on("submit",t[40]),l.$on("stop",t[41]),l.$on("blur",t[42]),l.$on("select",t[43]),l.$on("focus",t[44]),l.$on("error",t[45]),l.$on("start_recording",t[46]),l.$on("pause_recording",t[47]),l.$on("stop_recording",t[48]),l.$on("upload",t[49]),l.$on("clear",t[50]),{c(){r&&r.c(),e=zl(),Ke(l.$$.fragment)},m(u,g){r&&r.m(u,g),Sl(u,e,g),Ne(l,u,g),f=!0},p(u,g){u[17]?r?(r.p(u,g),g[0]&131072&&_e(r,1)):(r=rt(u),r.c(),_e(r,1),r.m(e.parentNode,e)):r&&(kl(),de(r,1,1,()=>{r=null}),bl());const b={};g[0]&64&&(b.file_types=u[6]),g[0]&8388608&&(b.root=u[23]),g[0]&512&&(b.label=u[9]),g[0]&1024&&(b.info=u[10]),g[0]&2048&&(b.show_label=u[11]),g[0]&128&&(b.lines=u[7]),g[0]&262144&&(b.rtl=u[18]),g[0]&524288&&(b.text_align=u[19]),g[0]&536870912&&(b.waveform_settings=u[29]),g[0]&4&&(b.i18n=u[2].i18n),g[0]&4224&&(b.max_lines=u[12]?u[12]:u[7]+1),g[0]&256&&(b.placeholder=u[8]),g[0]&32768&&(b.submit_btn=u[15]),g[0]&65536&&(b.stop_btn=u[16]),g[0]&1048576&&(b.autofocus=u[20]),g[0]&2097152&&(b.autoscroll=u[21]),g[0]&16777216&&(b.file_count=u[24]),g[0]&67108864&&(b.sources=u[26]),g[0]&4&&(b.max_file_size=u[2].max_file_size),g[0]&4194304&&(b.disabled=!u[22]),g[0]&4&&(b.upload=u[32]),g[0]&4&&(b.stream_handler=u[33]),g[0]&33554432&&(b.max_plain_text_length=u[25]),!i&&g[0]&1&&(i=!0,b.value=u[0],ke(()=>i=!1)),!o&&g[0]&2&&(o=!0,b.value_is_output=u[1],ke(()=>o=!1)),!s&&g[0]&134217728&&(s=!0,b.dragging=u[27],ke(()=>s=!1)),!c&&g[0]&268435456&&(c=!0,b.active_source=u[28],ke(()=>c=!1)),l.$set(b)},i(u){f||(_e(r),_e(l.$$.fragment,u),f=!0)},o(u){de(r),de(l.$$.fragment,u),f=!1},d(u){u&&pl(e),r&&r.d(u),Ye(l,u)}}}function Dl(t){let e,l;return e=new Vt({props:{visible:t[5],elem_id:t[3],elem_classes:[...t[4],"multimodal-textbox"],scale:t[13],min_width:t[14],allow_overflow:!1,padding:!1,border_mode:t[27]?"focus":"base",$$slots:{default:[Tl]},$$scope:{ctx:t}}}),{c(){Ke(e.$$.fragment)},m(i,o){Ne(e,i,o),l=!0},p(i,o){const s={};o[0]&32&&(s.visible=i[5]),o[0]&8&&(s.elem_id=i[3]),o[0]&16&&(s.elem_classes=[...i[4],"multimodal-textbox"]),o[0]&8192&&(s.scale=i[13]),o[0]&16384&&(s.min_width=i[14]),o[0]&134217728&&(s.border_mode=i[27]?"focus":"base"),o[0]&1073717191|o[1]&8388608&&(s.$$scope={dirty:o,ctx:i}),e.$set(s)},i(i){l||(_e(e.$$.fragment,i),l=!0)},o(i){de(e.$$.fragment,i),l=!1},d(i){Ye(e,i)}}}function Bl(t,e,l){let{gradio:i}=e,{elem_id:o=""}=e,{elem_classes:s=[]}=e,{visible:c=!0}=e,{value:f={text:"",files:[]}}=e,{file_types:r=null}=e,{lines:d}=e,{placeholder:_=""}=e,{label:C="MultimodalTextbox"}=e,{info:m=void 0}=e,{show_label:k}=e,{max_lines:u}=e,{scale:g=null}=e,{min_width:b=void 0}=e,{submit_btn:X=null}=e,{stop_btn:w=null}=e,{loading_status:V=void 0}=e,{value_is_output:P=!1}=e,{rtl:B=!1}=e,{text_align:E=void 0}=e,{autofocus:H=!1}=e,{autoscroll:F=!0}=e,{interactive:T}=e,{root:R}=e,{file_count:h}=e,{max_plain_text_length:p}=e,{sources:I=["upload"]}=e,{waveform_options:U={}}=e,j,oe=null,K,re="darkorange";Ml(()=>{re=getComputedStyle(document?.documentElement).getPropertyValue("--color-accent"),ce(),l(29,K.waveColor=U.waveform_color||"#9ca3af",K),l(29,K.progressColor=U.waveform_progress_color||re,K),l(29,K.mediaControls=U.show_controls,K),l(29,K.sampleRate=U.sample_rate||44100,K)});const ee={color:U.trim_region_color,drag:!0,resize:!0};function ce(){document.documentElement.style.setProperty("--trim-region-color",ee.color||re)}const me=()=>i.dispatch("clear_status",V),te=(...a)=>i.client.upload(...a),ae=(...a)=>i.client.stream(...a);function A(a){f=a,l(0,f)}function ze(a){P=a,l(1,P)}function be(a){j=a,l(27,j)}function Me(a){oe=a,l(28,oe)}const Te=()=>i.dispatch("change",f),De=()=>i.dispatch("input"),Be=()=>i.dispatch("submit"),pe=()=>i.dispatch("stop"),Ee=()=>i.dispatch("blur"),He=a=>i.dispatch("select",a.detail),Fe=()=>i.dispatch("focus"),Re=({detail:a})=>{i.dispatch("error",a)},Ve=()=>i.dispatch("start_recording"),Ae=()=>i.dispatch("pause_recording"),Pe=()=>i.dispatch("stop_recording"),Ie=a=>i.dispatch("upload",a.detail),Ue=()=>i.dispatch("clear");return t.$$set=a=>{"gradio"in a&&l(2,i=a.gradio),"elem_id"in a&&l(3,o=a.elem_id),"elem_classes"in a&&l(4,s=a.elem_classes),"visible"in a&&l(5,c=a.visible),"value"in a&&l(0,f=a.value),"file_types"in a&&l(6,r=a.file_types),"lines"in a&&l(7,d=a.lines),"placeholder"in a&&l(8,_=a.placeholder),"label"in a&&l(9,C=a.label),"info"in a&&l(10,m=a.info),"show_label"in a&&l(11,k=a.show_label),"max_lines"in a&&l(12,u=a.max_lines),"scale"in a&&l(13,g=a.scale),"min_width"in a&&l(14,b=a.min_width),"submit_btn"in a&&l(15,X=a.submit_btn),"stop_btn"in a&&l(16,w=a.stop_btn),"loading_status"in a&&l(17,V=a.loading_status),"value_is_output"in a&&l(1,P=a.value_is_output),"rtl"in a&&l(18,B=a.rtl),"text_align"in a&&l(19,E=a.text_align),"autofocus"in a&&l(20,H=a.autofocus),"autoscroll"in a&&l(21,F=a.autoscroll),"interactive"in a&&l(22,T=a.interactive),"root"in a&&l(23,R=a.root),"file_count"in a&&l(24,h=a.file_count),"max_plain_text_length"in a&&l(25,p=a.max_plain_text_length),"sources"in a&&l(26,I=a.sources),"waveform_options"in a&&l(30,U=a.waveform_options)},l(29,K={height:50,barWidth:2,barGap:3,cursorWidth:2,cursorColor:"#ddd5e9",autoplay:!1,barRadius:10,dragToSeek:!0,normalize:!0,minPxPerSec:20}),[f,P,i,o,s,c,r,d,_,C,m,k,u,g,b,X,w,V,B,E,H,F,T,R,h,p,I,j,oe,K,U,me,te,ae,A,ze,be,Me,Te,De,Be,pe,Ee,He,Fe,Re,Ve,Ae,Pe,Ie,Ue]}class bi extends hl{constructor(e){super(),Cl(this,e,Bl,Dl,ql,{gradio:2,elem_id:3,elem_classes:4,visible:5,value:0,file_types:6,lines:7,placeholder:8,label:9,info:10,show_label:11,max_lines:12,scale:13,min_width:14,submit_btn:15,stop_btn:16,loading_status:17,value_is_output:1,rtl:18,text_align:19,autofocus:20,autoscroll:21,interactive:22,root:23,file_count:24,max_plain_text_length:25,sources:26,waveform_options:30},null,[-1,-1])}get gradio(){return this.$$.ctx[2]}set gradio(e){this.$$set({gradio:e}),M()}get elem_id(){return this.$$.ctx[3]}set elem_id(e){this.$$set({elem_id:e}),M()}get elem_classes(){return this.$$.ctx[4]}set elem_classes(e){this.$$set({elem_classes:e}),M()}get visible(){return this.$$.ctx[5]}set visible(e){this.$$set({visible:e}),M()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),M()}get file_types(){return this.$$.ctx[6]}set file_types(e){this.$$set({file_types:e}),M()}get lines(){return this.$$.ctx[7]}set lines(e){this.$$set({lines:e}),M()}get placeholder(){return this.$$.ctx[8]}set placeholder(e){this.$$set({placeholder:e}),M()}get label(){return this.$$.ctx[9]}set label(e){this.$$set({label:e}),M()}get info(){return this.$$.ctx[10]}set info(e){this.$$set({info:e}),M()}get show_label(){return this.$$.ctx[11]}set show_label(e){this.$$set({show_label:e}),M()}get max_lines(){return this.$$.ctx[12]}set max_lines(e){this.$$set({max_lines:e}),M()}get scale(){return this.$$.ctx[13]}set scale(e){this.$$set({scale:e}),M()}get min_width(){return this.$$.ctx[14]}set min_width(e){this.$$set({min_width:e}),M()}get submit_btn(){return this.$$.ctx[15]}set submit_btn(e){this.$$set({submit_btn:e}),M()}get stop_btn(){return this.$$.ctx[16]}set stop_btn(e){this.$$set({stop_btn:e}),M()}get loading_status(){return this.$$.ctx[17]}set loading_status(e){this.$$set({loading_status:e}),M()}get value_is_output(){return this.$$.ctx[1]}set value_is_output(e){this.$$set({value_is_output:e}),M()}get rtl(){return this.$$.ctx[18]}set rtl(e){this.$$set({rtl:e}),M()}get text_align(){return this.$$.ctx[19]}set text_align(e){this.$$set({text_align:e}),M()}get autofocus(){return this.$$.ctx[20]}set autofocus(e){this.$$set({autofocus:e}),M()}get autoscroll(){return this.$$.ctx[21]}set autoscroll(e){this.$$set({autoscroll:e}),M()}get interactive(){return this.$$.ctx[22]}set interactive(e){this.$$set({interactive:e}),M()}get root(){return this.$$.ctx[23]}set root(e){this.$$set({root:e}),M()}get file_count(){return this.$$.ctx[24]}set file_count(e){this.$$set({file_count:e}),M()}get max_plain_text_length(){return this.$$.ctx[25]}set max_plain_text_length(e){this.$$set({max_plain_text_length:e}),M()}get sources(){return this.$$.ctx[26]}set sources(e){this.$$set({sources:e}),M()}get waveform_options(){return this.$$.ctx[30]}set waveform_options(e){this.$$set({waveform_options:e}),M()}}export{vi as BaseExample,gl as BaseMultimodalTextbox,bi as default}; 2//# sourceMappingURL=Index-C91thz2E.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.