1import{C as e,D as t,E as a,Et as l,Gt as i,J as n,Lt as u,N as s,Q as r,T as o,Tt as c,Y as v,_ as d,hn as p,it as m,tt as f,w as g}from"./B8XHxhss.js";import{Bt as x,Pt as y,_ as b}from"#entry";import{t as k}from"./CB9WeAtJ.js";import{t as h}from"./DXNx4Ry-.js";import{t as w}from"./tKPW4sCS.js";var M={class:"c-audio-player"},T={class:"flex gap-3xs h-60 justify-center print:!hidden"},j=["data-playing"],_={class:"hidden print:block"},A={class:"flex flex-wrap >=1280:flex-nowrap items-center w-full relative grow print:!hidden"},S=["src"],C=["max","value"],E={key:0,class:"w-full flex justify-between >=1280:absolute 1280:bottom-0 text-caption-md-regular text-medium"},L={__name:"AudioPlayer",props:{audio:{type:Object,required:!0}},setup(n,{expose:o}){const k=u(!1),w=u(null),L=u(null),$=u(null),H=u(null),B=u(0),I=u(0),O=e(()=>B.value?J(L.value?.currentTime):"0:00"),z=e(()=>I.value?J(I.value):"0:00");function P(e){const{currentTime:t}=L.value;"backwards"===e?L.value.currentTime=Math.ceil(Math.max(0,t-30)):"forwards"===e&&(L.value.currentTime=Math.ceil(Math.min(I.value,t+30)))}function q(){"suspended"===$.value.state&&$.value.resume(),"false"===w.value.dataset.playing&&(L.value?.play(),k.value=!0),"true"===w.value.dataset.playing&&(L.value.pause(),k.value=!1)}function D(e){B.value=Math.ceil(e.target.value),F(e)}function F(e){L.value.currentTime=Math.ceil(e.target.value)}function G(e){"true"===w.value.dataset.playing&&e.target&&(B.value=Math.ceil(L.value.currentTime))}function J(e){const t=Math.floor(e),a=t%60;return`${Math.round((t-a)/60)}:${a<10?"0"+a:a}`}function N(){H.value&&(H.value.disconnect(),H.value=null),$.value&&($.value.close(),$.value=null)}return f(()=>{N(),$.value=new AudioContext,H.value=$.value.createMediaElementSource(L.value),H.value.connect($.value.destination),v(()=>{B.value=L.value?.currentTime,I.value=Math.ceil(L.value?.duration)})}),r(()=>{N()}),o({$el:L,context:$,track:H,controls:{play:function(){"suspended"===$.value.state&&$.value.resume(),"false"===w.value.dataset.playing&&(L.value?.play(),k.value=!0)},pause:function(){"true"===w.value.dataset.playing&&(L.value.pause(),k.value=!1)}},isPlaying:k}),(e,u)=>{const r=h;return m(),t("div",M,[g("div",T,[g("button",{class:"block text-interactive hover:text-interactiveHover active:text-interactiveActive",onClick:u[0]||(u[0]=e=>P("backwards"))},[s(r,{name:"backward-30",class:"h-32 w-32"})]),g("button",{ref_key:"audioControl",ref:w,class:"block text-interactive hover:text-interactiveHover active:text-interactiveActive","data-playing":i(k),onClick:q},[l(s(r,{name:"rounded/play",class:"inline-block w-60 h-60"},null,512),[[x,!1===i(k)]]),l(s(r,{name:"pause",class:"inline-block w-60 h-60 p-4xs"},null,512),[[x,!0===i(k)]])],8,j),g("button",{class:"block text-interactive hover:text-interactiveHover active:text-interactiveActive",onClick:u[1]||(u[1]=e=>P("forwards"))},[s(r,{name:"forward-30",class:"inline-block h-32 w-32"})])]),n.audio?.url?(m(),t(d,{key:0},[g("p",_,p(("localize"in e?e.localize:i(b))("FILE",{capitalize:!0}))+": "+p(n.audio.url),1),g("div",A,[g("audio",{ref_key:"audioElement",ref:L,class:"invisible",src:n.audio.url,crossorigin:"anonymous",onEnded:u[2]||(u[2]=e=>k.value=!1),onTimeupdate:G},null,40,S),g("input",{type:"range",min:"0",max:i(I),value:i(B),onInput:F,onMouseup:D},null,40,C),s(y,{name:"t-audio-timestamps"},{default:c(()=>[i(I)?(m(),t("div",E,[g("span",null,p(i(O)),1),g("span",null,p(i(z)),1)])):a("",!0)]),_:1})])],64)):a("",!0)])}}},$=["id"],H=["innerHTML"],B=Object.assign({inheritAttrs:!1},{__name:"BlockListBlocksBlockListAudio",props:{id:String,context:String,title:String,label:String,settings:Object,file:Object},setup:e=>(l,u)=>{const r=k,v=L;return m(),t("div",n({id:e.id,class:["c-block-list-audio",[`c-block-list-audio--ctx--${e.context}`,l.$attrs.class]]},("useAttrsSome"in l?l.useAttrsSome:i(w))(["style","data-n-ids"],l.$attrs)),[e.title?(m(),o(r,{key:0,class:"w-full",overline:e.label,"long-read-id":e.settings?.includeInToc&&e.id,"long-read-title":e.settings?.includeInToc&&e.title},{default:c(()=>[g("span",{innerHTML:e.title},null,8,H)]),_:1},8,["overline","long-read-id","long-read-title"])):a("",!0),s(v,{audio:e.file},null,8,["audio"])],16,$)}});export{B as default};
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.