streamlit-nightly 1.41.2.dev20250108__py2.py3-none-any.whl → 1.41.2.dev20250110__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/config.py +3 -2
- streamlit/config_option.py +9 -18
- streamlit/dataframe_util.py +2 -2
- streamlit/delta_generator.py +6 -2
- streamlit/elements/exception.py +7 -9
- streamlit/elements/widgets/button_group.py +5 -3
- streamlit/elements/widgets/data_editor.py +4 -1
- streamlit/emojis.py +1 -1
- streamlit/proto/ForwardMsg_pb2.py +3 -1
- streamlit/proto/ForwardMsg_pb2.pyi +23 -0
- streamlit/runtime/app_session.py +23 -3
- streamlit/runtime/caching/cache_data_api.py +2 -2
- streamlit/runtime/caching/cache_utils.py +4 -3
- streamlit/runtime/caching/storage/local_disk_cache_storage.py +4 -4
- streamlit/runtime/credentials.py +4 -4
- streamlit/runtime/forward_msg_cache.py +3 -1
- streamlit/runtime/forward_msg_queue.py +32 -4
- streamlit/runtime/fragment.py +1 -1
- streamlit/runtime/pages_manager.py +3 -1
- streamlit/runtime/scriptrunner/exec_code.py +33 -0
- streamlit/runtime/scriptrunner/script_runner.py +5 -3
- streamlit/runtime/scriptrunner_utils/script_requests.py +1 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CXWFIN7B.js → FileDownload.esm.DgMBFvxE.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.dauERNYc.js → FormClearHelper.C-kz8EZa.js} +1 -1
- streamlit/static/static/js/{Hooks.CqBCxxzg.js → Hooks.BaEjlpBt.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Dm8zppD9.js → InputInstructions.2kJ3lLP5.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CQTs8xxT.js → ProgressBar.BmX5Bd8z.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BIVWPcSk.js → RenderInPortalIfExists.DvbHx6rz.js} +1 -1
- streamlit/static/static/js/{Toolbar.D_9Mp69H.js → Toolbar.Cs7p2Lp9.js} +1 -1
- streamlit/static/static/js/{base-input.JrivAGt5.js → base-input.CmWUWSJc.js} +4 -4
- streamlit/static/static/js/{createSuper.BLkfEjg8.js → createSuper.D46anxnG.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.4d_NBoKr.js → data-grid-overlay-editor.BspRPTtu.js} +1 -1
- streamlit/static/static/js/{downloader.i394ggfM.js → downloader.BX0QN5eD.js} +1 -1
- streamlit/static/static/js/{es6.BPf5kpFH.js → es6.BlW--gnF.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.DcAVjrh9.js → getPrototypeOf.BYTPPQIp.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.YDN8GVx9.js → iframeResizer.contentWindow.CNHQyyTg.js} +1 -1
- streamlit/static/static/js/{index.DxsOgtLc.js → index.-JIbeXZC.js} +11 -11
- streamlit/static/static/js/{index.Bj7LBigw.js → index.2kexLuIU.js} +62 -62
- streamlit/static/static/js/{index.D1qR2sOA.js → index.5f81IBZP.js} +1 -1
- streamlit/static/static/js/{index.HktO7F0v.js → index.7441r-sL.js} +1 -1
- streamlit/static/static/js/index.AzFWl1A_.js +3 -0
- streamlit/static/static/js/{index.Df7nX4KF.js → index.B1RTO67W.js} +1 -1
- streamlit/static/static/js/{index.CSmBE6cg.js → index.B2lUWG_g.js} +1 -1
- streamlit/static/static/js/{index.g_BxiUns.js → index.B3F-o9ex.js} +1 -1
- streamlit/static/static/js/{index.DgOwxLz5.js → index.BBK0SZBc.js} +3 -3
- streamlit/static/static/js/{index.DsKBnIk-.js → index.BBQgDj4i.js} +16 -16
- streamlit/static/static/js/{index.SKaK1lYU.js → index.BHVs7_wn.js} +1 -1
- streamlit/static/static/js/{index.kc3Ycvjj.js → index.BRwmGBP4.js} +10 -10
- streamlit/static/static/js/{index.Dz6VQ3qN.js → index.BSabhp-S.js} +2 -2
- streamlit/static/static/js/{index.YfuWGKrN.js → index.BX4DPcrq.js} +1 -1
- streamlit/static/static/js/{index.DyNkf5tM.js → index.BhQrqdv2.js} +1 -1
- streamlit/static/static/js/index.BhRQ3Irc.js +1 -0
- streamlit/static/static/js/index.BqCCfwZM.js +1 -0
- streamlit/static/static/js/{index.BidgRpd5.js → index.BtaWfSZN.js} +1 -1
- streamlit/static/static/js/{index.D7EG5vd0.js → index.BwvnBWfd.js} +2 -2
- streamlit/static/static/js/{index.PriAkdhw.js → index.CAmkSLgk.js} +1 -1
- streamlit/static/static/js/{index.BB2p9KgS.js → index.CKhEFCMB.js} +1 -1
- streamlit/static/static/js/index.CdjxQOw-.js +1 -0
- streamlit/static/static/js/index.ClU6Toj3.js +1 -0
- streamlit/static/static/js/{index.C-TBipT2.js → index.D4cEoG-b.js} +3 -3
- streamlit/static/static/js/{index.D_bHPQ8s.js → index.D7zDVCSD.js} +1 -1
- streamlit/static/static/js/{index.DWU1GWqY.js → index.D8V0ZERG.js} +1 -1
- streamlit/static/static/js/{index.CgkfCbvP.js → index.DAlH7XAu.js} +1 -1
- streamlit/static/static/js/index.DGXjFinj.js +1 -0
- streamlit/static/static/js/{index.B3dyGG7q.js → index.DKFY5Ha1.js} +3 -3
- streamlit/static/static/js/{index.D1CJOG3s.js → index.DRm6hoq7.js} +1 -1
- streamlit/static/static/js/index.DhCGDinQ.js +2 -0
- streamlit/static/static/js/index.Drqk1Tqs.js +1 -0
- streamlit/static/static/js/{index.CMAjN-j5.js → index.DuEIfrbC.js} +1 -1
- streamlit/static/static/js/{index.B6GM885g.js → index.a4u3c2yA.js} +1 -1
- streamlit/static/static/js/{index.DE-FOSSU.js → index.d1dU1FHw.js} +1 -1
- streamlit/static/static/js/{index.B_o9A-oO.js → index.tQ3BfkaX.js} +1 -1
- streamlit/static/static/js/{index.DmHQeMtj.js → index.y-VLJ65m.js} +1 -1
- streamlit/static/static/js/{input.CqdNsSbL.js → input.C7wSNGte.js} +2 -2
- streamlit/static/static/js/{memory.Bkvk-eRa.js → memory.BF0Xc-rJ.js} +1 -1
- streamlit/static/static/js/{mergeWith.DtsbyD6H.js → mergeWith.CHIovAKI.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CR4D4kK1.js → number-overlay-editor.DfAWep9y.js} +1 -1
- streamlit/static/static/js/{sandbox.C5M8yw5Z.js → sandbox.CM0H2h0v.js} +1 -1
- streamlit/static/static/js/{slicedToArray.BL5-s74J.js → slicedToArray.BOBOh4VJ.js} +1 -1
- streamlit/static/static/js/{textarea.DrGlWUDC.js → textarea.CINkGDSQ.js} +2 -2
- streamlit/static/static/js/{timepicker.Bdf2lGHx.js → timepicker.eZuQgQCF.js} +1 -1
- streamlit/static/static/js/{uniqueId.LGvQ35eR.js → uniqueId.vdNgUDff.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.TTzKcGCs.js → useBasicWidgetState.De0NYf9Y.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.ChvkrwHU.js → useOnInputChange.cRNtiNHf.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.ChQqb1TZ.js → withFullScreenWrapper.D4HXFzaF.js} +1 -1
- streamlit/watcher/local_sources_watcher.py +4 -2
- streamlit/web/server/browser_websocket_handler.py +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/RECORD +94 -96
- streamlit/static/static/js/index.57g5CAPC.js +0 -1
- streamlit/static/static/js/index.BOBIcAmK.js +0 -1
- streamlit/static/static/js/index.BfABFd7-.js +0 -3
- streamlit/static/static/js/index.C4muCvfN.js +0 -1
- streamlit/static/static/js/index.CAZAG6f3.js +0 -2
- streamlit/static/static/js/index.CJlBME-_.js +0 -1
- streamlit/static/static/js/index.DalTq5GL.js +0 -1
- streamlit/static/static/js/index.V5OLP0n7.js +0 -1
- streamlit/vendor/ipython/__init__.py +0 -0
- streamlit/vendor/ipython/modified_sys_path.py +0 -67
- {streamlit_nightly-1.41.2.dev20250108.data → streamlit_nightly-1.41.2.dev20250110.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250110.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import{r as u,E as H,_ as V,aL as ut,b4 as Vt,b5 as $t,b6 as jt,A as G,D as X,R as yt,al as Gt,n as x,b7 as Xt,am as N,j as v,b8 as qt,aU as Yt,b9 as Kt,ba as Zt,a2 as Jt,a0 as Qt,bb as Q,ab as te,ae as ee,bc as ie,bd as ne,aY as se,be as re}from"./index.kc3Ycvjj.js";import{u as oe,F as ae}from"./FormClearHelper.dauERNYc.js";import{T as le,a as pt}from"./Toolbar.D_9Mp69H.js";import{u as ce}from"./Hooks.CqBCxxzg.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.CXWFIN7B.js";var wt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(n,t,e,i){return new(e||(e=Promise))(function(r,s){function a(c){try{d(i.next(c))}catch(l){s(l)}}function o(c){try{d(i.throw(c))}catch(l){s(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let $=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(n,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let s=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>s&&(s=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=s}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,r]of Object.entries(t))if(i==="children")for(const[s,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(s,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(n,t,e){const i=xt(n,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(n,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(r,s){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);s(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends ${constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends ${constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,s]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;return[r/i.width,s/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,s=e/i,a=(e+r)/i;this.emit("scroll",s,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,s=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>s||Math.abs(A)>s){const I=t.getBoundingClientRect(),{left:F,top:L}=I;f||(i==null||i(h-F,m-L),f=!0),e(M,A,D-F,W-L),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const s=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?s/r:s}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
1
|
+
import{r as u,E as H,_ as V,aV as ut,be as Vt,bf as $t,bg as jt,A as G,D as X,R as yt,aw as Gt,n as x,bh as Xt,ax as N,j as v,bi as qt,b2 as Yt,bj as Kt,bk as Zt,ad as Jt,ab as Qt,bl as Q,am as te,ap as ee,bm as ie,bn as ne,b6 as se,bo as re}from"./index.BRwmGBP4.js";import{u as oe,F as ae}from"./FormClearHelper.C-kz8EZa.js";import{T as le,a as pt}from"./Toolbar.Cs7p2Lp9.js";import{u as ce}from"./Hooks.BaEjlpBt.js";import{c as de}from"./createDownloadLinkElement.DZMwyjvU.js";import{F as he,D as ue}from"./FileDownload.esm.DgMBFvxE.js";var wt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),u.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});wt.displayName="Mic";var Ct=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});Ct.displayName="Pause";var St=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("rect",{width:24,height:24,fill:"none"}),u.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});St.displayName="PlayArrow";var Rt=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),u.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Rt.displayName="Refresh";var Et=u.forwardRef(function(n,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return u.createElement(H,V({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),u.createElement("g",{fill:"none"},u.createElement("rect",{width:24,height:24}),u.createElement("rect",{width:24,height:24})),u.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Et.displayName="StopCircle";function E(n,t,e,i){return new(e||(e=Promise))(function(r,s){function a(c){try{d(i.next(c))}catch(l){s(l)}}function o(c){try{d(i.throw(c))}catch(l){s(l)}}function d(c){var l;c.done?r(c.value):(l=c.value,l instanceof e?l:new e(function(p){p(l)})).then(a,o)}d((i=i.apply(n,t||[])).next())})}let $=class{constructor(){this.listeners={}}on(t,e,i){if(this.listeners[t]||(this.listeners[t]=new Set),this.listeners[t].add(e),i==null?void 0:i.once){const r=()=>{this.un(t,r),this.un(t,e)};return this.on(t,r),r}return()=>this.un(t,e)}un(t,e){var i;(i=this.listeners[t])===null||i===void 0||i.delete(e)}once(t,e){return this.on(t,e,{once:!0})}unAll(){this.listeners={}}emit(t,...e){this.listeners[t]&&this.listeners[t].forEach(i=>i(...e))}};const mt={decode:function(n,t){return E(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});return e.decodeAudioData(n).finally(()=>e.close())})},createBuffer:function(n,t){return typeof n[0]=="number"&&(n=[n]),function(e){const i=e[0];if(i.some(r=>r>1||r<-1)){const r=i.length;let s=0;for(let a=0;a<r;a++){const o=Math.abs(i[a]);o>s&&(s=o)}for(const a of e)for(let o=0;o<r;o++)a[o]/=s}}(n),{duration:t,length:n[0].length,sampleRate:n[0].length/t,numberOfChannels:n.length,getChannelData:e=>n==null?void 0:n[e],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function xt(n,t){const e=t.xmlns?document.createElementNS(t.xmlns,n):document.createElement(n);for(const[i,r]of Object.entries(t))if(i==="children")for(const[s,a]of Object.entries(t))typeof a=="string"?e.appendChild(document.createTextNode(a)):e.appendChild(xt(s,a));else i==="style"?Object.assign(e.style,r):i==="textContent"?e.textContent=r:e.setAttribute(i,r.toString());return e}function ft(n,t,e){const i=xt(n,t||{});return e==null||e.appendChild(i),i}var pe=Object.freeze({__proto__:null,createElement:ft,default:ft});const me={fetchBlob:function(n,t,e){return E(this,void 0,void 0,function*(){const i=yield fetch(n,e);if(i.status>=400)throw new Error(`Failed to fetch ${n}: ${i.status} (${i.statusText})`);return function(r,s){E(this,void 0,void 0,function*(){if(!r.body||!r.headers)return;const a=r.body.getReader(),o=Number(r.headers.get("Content-Length"))||0;let d=0;const c=p=>E(this,void 0,void 0,function*(){d+=(p==null?void 0:p.length)||0;const h=Math.round(d/o*100);s(h)}),l=()=>E(this,void 0,void 0,function*(){let p;try{p=yield a.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),t),i.blob()})}};class fe extends ${constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;try{this.media.src=r}catch{this.media.src=t}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(t){this.media=t}play(){return E(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=t}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}class U extends ${constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[r,s]=this.initHtml();i.appendChild(r),this.container=r,this.scrollContainer=s.querySelector(".scroll"),this.wrapper=s.querySelector(".wrapper"),this.canvasWrapper=s.querySelector(".canvases"),this.progressWrapper=s.querySelector(".progress"),this.cursor=s.querySelector(".cursor"),e&&s.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){const t=e=>{const i=this.wrapper.getBoundingClientRect(),r=e.clientX-i.left,s=e.clientY-i.top;return[r/i.width,s/i.height]};if(this.wrapper.addEventListener("click",e=>{const[i,r]=t(e);this.emit("click",i,r)}),this.wrapper.addEventListener("dblclick",e=>{const[i,r]=t(e);this.emit("dblclick",i,r)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:e,scrollWidth:i,clientWidth:r}=this.scrollContainer,s=e/i,a=(e+r)/i;this.emit("scroll",s,a,e,e+r)}),typeof ResizeObserver=="function"){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{e().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender())}initDrag(){this.subscriptions.push(function(t,e,i,r,s=3,a=0,o=100){if(!t)return()=>{};const d=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==a)return;p.preventDefault(),p.stopPropagation();let h=p.clientX,m=p.clientY,f=!1;const b=Date.now(),g=C=>{if(C.preventDefault(),C.stopPropagation(),d&&Date.now()-b<o)return;const D=C.clientX,W=C.clientY,M=D-h,A=W-m;if(f||Math.abs(M)>s||Math.abs(A)>s){const I=t.getBoundingClientRect(),{left:F,top:L}=I;f||(i==null||i(h-F,m-L),f=!0),e(M,A,D-F,W-L),h=D,m=W}},w=C=>{if(f){const D=C.clientX,W=C.clientY,M=t.getBoundingClientRect(),{left:A,top:I}=M;r==null||r(D-A,W-I)}c()},y=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||w(C)},P=C=>{f&&(C.stopPropagation(),C.preventDefault())},T=C=>{f&&C.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",w),document.addEventListener("pointerout",y),document.addEventListener("pointercancel",y),document.addEventListener("touchmove",T,{passive:!1}),document.addEventListener("click",P,{capture:!0}),c=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",w),document.removeEventListener("pointerout",y),document.removeEventListener("pointercancel",y),document.removeEventListener("touchmove",T),setTimeout(()=>{document.removeEventListener("click",P,{capture:!0})},10)}};return t.addEventListener("pointerdown",l),()=>{c(),t.removeEventListener("pointerdown",l)}}(this.wrapper,(t,e,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))},t=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,t/this.wrapper.getBoundingClientRect().width)))}))}getHeight(t,e){var i;const r=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(t==null)return 128;if(!isNaN(Number(t)))return Number(t);if(t==="auto"){const s=this.parent.clientHeight||128;return e!=null&&e.every(a=>!a.overlay)?s/r:s}return 128}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
2
2
|
<style${i?` nonce="${i}"`:""}>
|
3
3
|
:host {
|
4
4
|
user-select: none;
|