mirror of
https://github.com/Ladebeze66/projetcbaollm.git
synced 2025-12-18 22:37:50 +01:00
3 lines
14 KiB
JavaScript
3 lines
14 KiB
JavaScript
import qe from"./StaticAudio-CZ6AMUc4.js";import{I as Ge}from"./InteractiveAudio-BkFfk1o9.js";import{S as $}from"./index-B1gfMDT9.js";import"./IconButtonWrapper.svelte_svelte_type_style_lang-BOpxTcdu.js";import"./StreamingBar.svelte_svelte_type_style_lang-CDNxkBIr.js";import{B as x}from"./Block-DZqtZLFP.js";import"./MarkdownCode.svelte_svelte_type_style_lang-3tofWDHK.js";import{U as Me}from"./UploadText-BwEsatWu.js";import{A as Dt}from"./AudioPlayer-k2pQKAn1.js";import{default as Ht}from"./Example-BQyGztrG.js";import"./utils-BsGrhMNe.js";import"./BlockLabel-DqHge3FF.js";import"./IconButton-B-aAVSzy.js";import"./Empty-CxRQfWXb.js";import"./ShareButton-CKIdzpwI.js";import"./Community-Dw1micSV.js";import"./Download-DVtk-Jv3.js";import"./Music-CDm0RGMk.js";import"./IconButtonWrapper-Cg16aIPK.js";import"./DownloadLink-IzUam-rM.js";import"./context-TgWPFwN2.js";import"./file-url-DgijyRSD.js";/* empty css */import"./prism-python-qapVsvY8.js";import"./index-C7PS0jJm.js";import"./svelte/svelte.js";import"./Trim-JQYgj7Jd.js";import"./Play-B0Q0U1Qz.js";import"./Undo-DCjBnnSO.js";import"./hls-CnVhpNcu.js";import"./Upload-DeO6qHmq.js";/* empty css */import"./ModifyUpload-CMNONuNr.js";import"./Clear-By3xiIwg.js";import"./Edit-BpRIf5rU.js";import"./SelectSource-B90qmKix.js";import"./Upload-DXgDHKDd.js";import"./StreamingBar-BU9S4hA7.js";const{SvelteComponent:Ve,add_flush_callback:P,assign:ee,bind:E,binding_callbacks:N,check_outros:De,create_component:z,destroy_component:B,detach:K,empty:Fe,flush:m,get_spread_object:te,get_spread_update:ie,group_outros:He,init:Ke,insert:L,mount_component:C,safe_not_equal:Le,space:se,transition_in:v,transition_out:k}=window.__gradio__svelte__internal,{afterUpdate:Qe,onMount:Xe}=window.__gradio__svelte__internal;function Ye(t){let e,o;return e=new x({props:{variant:t[0]===null&&t[25]==="upload"?"dashed":"solid",border_mode:t[27]?"focus":"base",padding:!1,allow_overflow:!1,elem_id:t[4],elem_classes:t[5],visible:t[6],container:t[12],scale:t[13],min_width:t[14],$$slots:{default:[$e]},$$scope:{ctx:t}}}),{c(){z(e.$$.fragment)},m(i,a){C(e,i,a),o=!0},p(i,a){const _={};a[0]&33554433&&(_.variant=i[0]===null&&i[25]==="upload"?"dashed":"solid"),a[0]&134217728&&(_.border_mode=i[27]?"focus":"base"),a[0]&16&&(_.elem_id=i[4]),a[0]&32&&(_.elem_classes=i[5]),a[0]&64&&(_.visible=i[6]),a[0]&4096&&(_.container=i[12]),a[0]&8192&&(_.scale=i[13]),a[0]&16384&&(_.min_width=i[14]),a[0]&536710927|a[2]&128&&(_.$$scope={dirty:a,ctx:i}),e.$set(_)},i(i){o||(v(e.$$.fragment,i),o=!0)},o(i){k(e.$$.fragment,i),o=!1},d(i){B(e,i)}}}function Ze(t){let e,o;return e=new x({props:{variant:"solid",border_mode:t[27]?"focus":"base",padding:!1,allow_overflow:!1,elem_id:t[4],elem_classes:t[5],visible:t[6],container:t[12],scale:t[13],min_width:t[14],$$slots:{default:[xe]},$$scope:{ctx:t}}}),{c(){z(e.$$.fragment)},m(i,a){C(e,i,a),o=!0},p(i,a){const _={};a[0]&134217728&&(_.border_mode=i[27]?"focus":"base"),a[0]&16&&(_.elem_id=i[4]),a[0]&32&&(_.elem_classes=i[5]),a[0]&64&&(_.visible=i[6]),a[0]&4096&&(_.container=i[12]),a[0]&8192&&(_.scale=i[13]),a[0]&16384&&(_.min_width=i[14]),a[0]&277842435|a[2]&128&&(_.$$scope={dirty:a,ctx:i}),e.$set(_)},i(i){o||(v(e.$$.fragment,i),o=!0)},o(i){k(e.$$.fragment,i),o=!1},d(i){B(e,i)}}}function ye(t){let e,o;return e=new Me({props:{i18n:t[23].i18n,type:"audio"}}),{c(){z(e.$$.fragment)},m(i,a){C(e,i,a),o=!0},p(i,a){const _={};a[0]&8388608&&(_.i18n=i[23].i18n),e.$set(_)},i(i){o||(v(e.$$.fragment,i),o=!0)},o(i){k(e.$$.fragment,i),o=!1},d(i){B(e,i)}}}function $e(t){let e,o,i,a,_,c,l,r,h;const g=[{autoscroll:t[23].autoscroll},{i18n:t[23].i18n},t[1]];let I={};for(let n=0;n<g.length;n+=1)I=ee(I,g[n]);e=new $({props:I}),e.$on("clear_status",t[45]);function U(n){t[48](n)}function J(n){t[49](n)}function O(n){t[50](n)}function R(n){t[51](n)}function b(n){t[52](n)}let w={label:t[9],show_label:t[11],show_download_button:t[16],value:t[0],root:t[10],sources:t[8],active_source:t[25],pending:t[20],streaming:t[21],loop:t[15],max_file_size:t[23].max_file_size,handle_reset_value:t[29],editable:t[18],i18n:t[23].i18n,waveform_settings:t[28],waveform_options:t[19],trim_region_settings:t[30],stream_every:t[22],upload:t[46],stream_handler:t[47],$$slots:{default:[ye]},$$scope:{ctx:t}};return t[2]!==void 0&&(w.recording=t[2]),t[27]!==void 0&&(w.dragging=t[27]),t[24]!==void 0&&(w.uploading=t[24]),t[26]!==void 0&&(w.modify_stream=t[26]),t[3]!==void 0&&(w.set_time_limit=t[3]),i=new Ge({props:w}),N.push(()=>E(i,"recording",U)),N.push(()=>E(i,"dragging",J)),N.push(()=>E(i,"uploading",O)),N.push(()=>E(i,"modify_stream",R)),N.push(()=>E(i,"set_time_limit",b)),i.$on("change",t[53]),i.$on("stream",t[54]),i.$on("drag",t[55]),i.$on("edit",t[56]),i.$on("play",t[57]),i.$on("pause",t[58]),i.$on("stop",t[59]),i.$on("start_recording",t[60]),i.$on("pause_recording",t[61]),i.$on("stop_recording",t[62]),i.$on("upload",t[63]),i.$on("clear",t[64]),i.$on("error",t[31]),i.$on("close_stream",t[65]),{c(){z(e.$$.fragment),o=se(),z(i.$$.fragment)},m(n,u){C(e,n,u),L(n,o,u),C(i,n,u),h=!0},p(n,u){const T=u[0]&8388610?ie(g,[u[0]&8388608&&{autoscroll:n[23].autoscroll},u[0]&8388608&&{i18n:n[23].i18n},u[0]&2&&te(n[1])]):{};e.$set(T);const f={};u[0]&512&&(f.label=n[9]),u[0]&2048&&(f.show_label=n[11]),u[0]&65536&&(f.show_download_button=n[16]),u[0]&1&&(f.value=n[0]),u[0]&1024&&(f.root=n[10]),u[0]&256&&(f.sources=n[8]),u[0]&33554432&&(f.active_source=n[25]),u[0]&1048576&&(f.pending=n[20]),u[0]&2097152&&(f.streaming=n[21]),u[0]&32768&&(f.loop=n[15]),u[0]&8388608&&(f.max_file_size=n[23].max_file_size),u[0]&262144&&(f.editable=n[18]),u[0]&8388608&&(f.i18n=n[23].i18n),u[0]&268435456&&(f.waveform_settings=n[28]),u[0]&524288&&(f.waveform_options=n[19]),u[0]&4194304&&(f.stream_every=n[22]),u[0]&8388608&&(f.upload=n[46]),u[0]&8388608&&(f.stream_handler=n[47]),u[0]&8388608|u[2]&128&&(f.$$scope={dirty:u,ctx:n}),!a&&u[0]&4&&(a=!0,f.recording=n[2],P(()=>a=!1)),!_&&u[0]&134217728&&(_=!0,f.dragging=n[27],P(()=>_=!1)),!c&&u[0]&16777216&&(c=!0,f.uploading=n[24],P(()=>c=!1)),!l&&u[0]&67108864&&(l=!0,f.modify_stream=n[26],P(()=>l=!1)),!r&&u[0]&8&&(r=!0,f.set_time_limit=n[3],P(()=>r=!1)),i.$set(f)},i(n){h||(v(e.$$.fragment,n),v(i.$$.fragment,n),h=!0)},o(n){k(e.$$.fragment,n),k(i.$$.fragment,n),h=!1},d(n){n&&K(o),B(e,n),B(i,n)}}}function xe(t){let e,o,i,a;const _=[{autoscroll:t[23].autoscroll},{i18n:t[23].i18n},t[1]];let c={};for(let l=0;l<_.length;l+=1)c=ee(c,_[l]);return e=new $({props:c}),e.$on("clear_status",t[39]),i=new qe({props:{i18n:t[23].i18n,show_label:t[11],show_download_button:t[16],show_share_button:t[17],value:t[0],label:t[9],loop:t[15],waveform_settings:t[28],waveform_options:t[19],editable:t[18]}}),i.$on("share",t[40]),i.$on("error",t[41]),i.$on("play",t[42]),i.$on("pause",t[43]),i.$on("stop",t[44]),{c(){z(e.$$.fragment),o=se(),z(i.$$.fragment)},m(l,r){C(e,l,r),L(l,o,r),C(i,l,r),a=!0},p(l,r){const h=r[0]&8388610?ie(_,[r[0]&8388608&&{autoscroll:l[23].autoscroll},r[0]&8388608&&{i18n:l[23].i18n},r[0]&2&&te(l[1])]):{};e.$set(h);const g={};r[0]&8388608&&(g.i18n=l[23].i18n),r[0]&2048&&(g.show_label=l[11]),r[0]&65536&&(g.show_download_button=l[16]),r[0]&131072&&(g.show_share_button=l[17]),r[0]&1&&(g.value=l[0]),r[0]&512&&(g.label=l[9]),r[0]&32768&&(g.loop=l[15]),r[0]&268435456&&(g.waveform_settings=l[28]),r[0]&524288&&(g.waveform_options=l[19]),r[0]&262144&&(g.editable=l[18]),i.$set(g)},i(l){a||(v(e.$$.fragment,l),v(i.$$.fragment,l),a=!0)},o(l){k(e.$$.fragment,l),k(i.$$.fragment,l),a=!1},d(l){l&&K(o),B(e,l),B(i,l)}}}function et(t){let e,o,i,a;const _=[Ze,Ye],c=[];function l(r,h){return r[7]?1:0}return e=l(t),o=c[e]=_[e](t),{c(){o.c(),i=Fe()},m(r,h){c[e].m(r,h),L(r,i,h),a=!0},p(r,h){let g=e;e=l(r),e===g?c[e].p(r,h):(He(),k(c[g],1,1,()=>{c[g]=null}),De(),o=c[e],o?o.p(r,h):(o=c[e]=_[e](r),o.c()),v(o,1),o.m(i.parentNode,i))},i(r){a||(v(o),a=!0)},o(r){k(o),a=!1},d(r){r&&K(i),c[e].d(r)}}}function tt(t,e,o){let{value_is_output:i=!1}=e,{elem_id:a=""}=e,{elem_classes:_=[]}=e,{visible:c=!0}=e,{interactive:l}=e,{value:r=null}=e,{sources:h}=e,{label:g}=e,{root:I}=e,{show_label:U}=e,{container:J=!0}=e,{scale:O=null}=e,{min_width:R=void 0}=e,{loading_status:b}=e,{autoplay:w=!1}=e,{loop:n=!1}=e,{show_download_button:u}=e,{show_share_button:T=!1}=e,{editable:f=!0}=e,{waveform_options:S={show_recording_waveform:!0}}=e,{pending:Q}=e,{streaming:X}=e,{stream_every:Y}=e,{input_ready:V}=e,{recording:W=!1}=e,j=!1,Z="closed",q;function oe(s){Z=s,q(s)}const ne=()=>Z;let{set_time_limit:G}=e,{gradio:d}=e,D=null,F,A=r;const re=()=>{A===null||r===A||o(0,r=A)};let M,p,H="darkorange";Xe(()=>{H=getComputedStyle(document?.documentElement).getPropertyValue("--color-accent"),ae(),o(28,p.waveColor=S.waveform_color||"#9ca3af",p),o(28,p.progressColor=S.waveform_progress_color||H,p),o(28,p.mediaControls=S.show_controls,p),o(28,p.sampleRate=S.sample_rate||44100,p)});const y={color:S.trim_region_color,drag:!0,resize:!0};function ae(){document.documentElement.style.setProperty("--trim-region-color",y.color||H)}function le({detail:s}){const[We,je]=s.includes("Invalid file type")?["warning","complete"]:["error","error"];o(1,b=b||{}),o(1,b.status=je,b),o(1,b.message=s,b),d.dispatch(We,s)}Qe(()=>{o(32,i=!1)});const _e=()=>d.dispatch("clear_status",b),ue=s=>d.dispatch("share",s.detail),fe=s=>d.dispatch("error",s.detail),me=()=>d.dispatch("play"),de=()=>d.dispatch("pause"),ge=()=>d.dispatch("stop"),ce=()=>d.dispatch("clear_status",b),he=(...s)=>d.client.upload(...s),be=(...s)=>d.client.stream(...s);function we(s){W=s,o(2,W)}function pe(s){M=s,o(27,M)}function ve(s){j=s,o(24,j)}function ke(s){q=s,o(26,q)}function Se(s){G=s,o(3,G)}const ze=({detail:s})=>o(0,r=s),Be=({detail:s})=>{o(0,r=s),d.dispatch("stream",r)},Ce=({detail:s})=>o(27,M=s),Ie=()=>d.dispatch("edit"),Ae=()=>d.dispatch("play"),Pe=()=>d.dispatch("pause"),Ee=()=>d.dispatch("stop"),Ne=()=>d.dispatch("start_recording"),Ue=()=>d.dispatch("pause_recording"),Je=s=>d.dispatch("stop_recording"),Oe=()=>d.dispatch("upload"),Re=()=>d.dispatch("clear"),Te=()=>d.dispatch("close_stream","stream");return t.$$set=s=>{"value_is_output"in s&&o(32,i=s.value_is_output),"elem_id"in s&&o(4,a=s.elem_id),"elem_classes"in s&&o(5,_=s.elem_classes),"visible"in s&&o(6,c=s.visible),"interactive"in s&&o(7,l=s.interactive),"value"in s&&o(0,r=s.value),"sources"in s&&o(8,h=s.sources),"label"in s&&o(9,g=s.label),"root"in s&&o(10,I=s.root),"show_label"in s&&o(11,U=s.show_label),"container"in s&&o(12,J=s.container),"scale"in s&&o(13,O=s.scale),"min_width"in s&&o(14,R=s.min_width),"loading_status"in s&&o(1,b=s.loading_status),"autoplay"in s&&o(34,w=s.autoplay),"loop"in s&&o(15,n=s.loop),"show_download_button"in s&&o(16,u=s.show_download_button),"show_share_button"in s&&o(17,T=s.show_share_button),"editable"in s&&o(18,f=s.editable),"waveform_options"in s&&o(19,S=s.waveform_options),"pending"in s&&o(20,Q=s.pending),"streaming"in s&&o(21,X=s.streaming),"stream_every"in s&&o(22,Y=s.stream_every),"input_ready"in s&&o(33,V=s.input_ready),"recording"in s&&o(2,W=s.recording),"set_time_limit"in s&&o(3,G=s.set_time_limit),"gradio"in s&&o(23,d=s.gradio)},t.$$.update=()=>{t.$$.dirty[0]&16777216&&o(33,V=!j),t.$$.dirty[0]&1|t.$$.dirty[1]&128&&r&&A===null&&o(38,A=r),t.$$.dirty[0]&8388609|t.$$.dirty[1]&66&&JSON.stringify(r)!==JSON.stringify(D)&&(o(37,D=r),d.dispatch("change"),i||d.dispatch("input")),t.$$.dirty[0]&33554688&&!F&&h&&o(25,F=h[0]),t.$$.dirty[1]&8&&o(28,p={height:50,barWidth:2,barGap:3,cursorWidth:2,cursorColor:"#ddd5e9",autoplay:w,barRadius:10,dragToSeek:!0,normalize:!0,minPxPerSec:20})},[r,b,W,G,a,_,c,l,h,g,I,U,J,O,R,n,u,T,f,S,Q,X,Y,d,j,F,q,M,p,re,y,le,i,V,w,oe,ne,D,A,_e,ue,fe,me,de,ge,ce,he,be,we,pe,ve,ke,Se,ze,Be,Ce,Ie,Ae,Pe,Ee,Ne,Ue,Je,Oe,Re,Te]}class it extends Ve{constructor(e){super(),Ke(this,e,tt,et,Le,{value_is_output:32,elem_id:4,elem_classes:5,visible:6,interactive:7,value:0,sources:8,label:9,root:10,show_label:11,container:12,scale:13,min_width:14,loading_status:1,autoplay:34,loop:15,show_download_button:16,show_share_button:17,editable:18,waveform_options:19,pending:20,streaming:21,stream_every:22,input_ready:33,recording:2,modify_stream_state:35,get_stream_state:36,set_time_limit:3,gradio:23},null,[-1,-1,-1])}get value_is_output(){return this.$$.ctx[32]}set value_is_output(e){this.$$set({value_is_output:e}),m()}get elem_id(){return this.$$.ctx[4]}set elem_id(e){this.$$set({elem_id:e}),m()}get elem_classes(){return this.$$.ctx[5]}set elem_classes(e){this.$$set({elem_classes:e}),m()}get visible(){return this.$$.ctx[6]}set visible(e){this.$$set({visible:e}),m()}get interactive(){return this.$$.ctx[7]}set interactive(e){this.$$set({interactive:e}),m()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),m()}get sources(){return this.$$.ctx[8]}set sources(e){this.$$set({sources:e}),m()}get label(){return this.$$.ctx[9]}set label(e){this.$$set({label:e}),m()}get root(){return this.$$.ctx[10]}set root(e){this.$$set({root:e}),m()}get show_label(){return this.$$.ctx[11]}set show_label(e){this.$$set({show_label:e}),m()}get container(){return this.$$.ctx[12]}set container(e){this.$$set({container: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 loading_status(){return this.$$.ctx[1]}set loading_status(e){this.$$set({loading_status:e}),m()}get autoplay(){return this.$$.ctx[34]}set autoplay(e){this.$$set({autoplay:e}),m()}get loop(){return this.$$.ctx[15]}set loop(e){this.$$set({loop:e}),m()}get show_download_button(){return this.$$.ctx[16]}set show_download_button(e){this.$$set({show_download_button:e}),m()}get show_share_button(){return this.$$.ctx[17]}set show_share_button(e){this.$$set({show_share_button:e}),m()}get editable(){return this.$$.ctx[18]}set editable(e){this.$$set({editable:e}),m()}get waveform_options(){return this.$$.ctx[19]}set waveform_options(e){this.$$set({waveform_options:e}),m()}get pending(){return this.$$.ctx[20]}set pending(e){this.$$set({pending:e}),m()}get streaming(){return this.$$.ctx[21]}set streaming(e){this.$$set({streaming:e}),m()}get stream_every(){return this.$$.ctx[22]}set stream_every(e){this.$$set({stream_every:e}),m()}get input_ready(){return this.$$.ctx[33]}set input_ready(e){this.$$set({input_ready:e}),m()}get recording(){return this.$$.ctx[2]}set recording(e){this.$$set({recording:e}),m()}get modify_stream_state(){return this.$$.ctx[35]}get get_stream_state(){return this.$$.ctx[36]}get set_time_limit(){return this.$$.ctx[3]}set set_time_limit(e){this.$$set({set_time_limit:e}),m()}get gradio(){return this.$$.ctx[23]}set gradio(e){this.$$set({gradio:e}),m()}}const Gt=it;export{Ht as BaseExample,Ge as BaseInteractiveAudio,Dt as BasePlayer,qe as BaseStaticAudio,Gt as default};
|
|
//# sourceMappingURL=index-T2Ec2Xwb.js.map
|