1import{F as Y,A as j,i as t,af as z,M as C,ae as Q,x as E,y as X,z as Z,w as H,H as G,_ as J,c as y,aq as ee,W as A,cq as te,bM as le}from"./2025.4.1-nijimiss.7-13fa15e96a.DfhntQAE.js";import{M as D}from"./2025.4.1-nijimiss.7-13fa15e96a.Dd9tm6vO.js";import{b as L,a as F,a9 as ae,w as se,z as U,g as k,l as V,C as a,j as e,L as O,M as K,A as i,q as n,N as d,i as h,s as g,B as ne,c as oe,h as B,Y as N,a1 as ue}from"./2025.4.1-nijimiss.7-13fa15e96a.D97khAA0.js";import{F as ie}from"./2025.4.1-nijimiss.7-13fa15e96a.r9qB9zar.js";import{M as re}from"./2025.4.1-nijimiss.7-13fa15e96a.CXT-Az-G.js";import{M as R}from"./2025.4.1-nijimiss.7-13fa15e96a.t-atOt7Q.js";import{M as de}from"./2025.4.1-nijimiss.7-13fa15e96a.BUE0nZ68.js";import"./2025.4.1-nijimiss.7-13fa15e96a.CIcFxiKL.js";const ce={class:"_gaps_m"},ve=["value"],fe={class:"_buttons"},me=L({__name:"sounds.sound",props:{type:{},fileId:{},fileUrl:{},volume:{}},emits:["update"],async setup(T,{emit:x}){let M,w;const v=T,$=x,c=F(v.type),p=F(v.fileId),s=F(v.fileUrl),l=F(""),m=F(!1),S=F(!1),_=F(v.volume);c.value==="_driveFile_"&&p.value&&([M,w]=ae(()=>Y("drive/files/show",{fileId:p.value}).then(u=>{l.value=u.name}).catch(u=>{m.value=!0})),await M,w());function W(u){switch(u){case null:return t.ts.none;case"_driveFile_":return t.ts._soundSettings.driveFile;default:return u}}const o=oe(()=>l.value?l.value:s.value?s.value:t.ts._soundSettings.driveFileWarn);function I(u){Q(u.currentTarget??u.target,t.ts._soundSettings.driveFile).then(async r=>{if(!r.type.startsWith("audio")){E({type:"warning",title:t.ts._soundSettings.driveFileTypeWarn,text:t.ts._soundSettings.driveFileTypeWarnDescription});return}if(await X(r.url)>=2e3){const{canceled:f}=await Z({type:"warning",title:t.ts._soundSettings.driveFileDurationWarn,text:t.ts._soundSettings.driveFileDurationWarnDescription,okText:t.ts.continue,cancelText:t.ts.cancel});if(f)return}s.value=r.url,l.value=r.name,p.value=r.id,m.value=!1,S.value=!0})}se([c,_],([u,r],[b,f])=>{b!==u&&u!=="_driveFile_"&&(s.value=void 0,l.value="",p.value=void 0,m.value=!1),S.value=!0});function q(){if(c.value==="_driveFile_"&&(!s.value||!p.value)){E({type:"warning",text:t.ts._soundSettings.driveFileWarn});return}H(c.value==="_driveFile_"?{type:"_driveFile_",fileId:p.value,fileUrl:s.value,volume:_.value}:{type:c.value,volume:_.value})}function P(){if(!(S.value===!1||m.value===!0)){if(c.value==="_driveFile_"&&!s.value){E({type:"warning",text:t.ts._soundSettings.driveFileWarn});return}c.value!=="_driveFile_"&&(s.value=void 0,l.value="",p.value=void 0),$("update",{type:c.value,fileId:p.value,fileUrl:s.value,volume:_.value}),G()}}return(u,r)=>{const b=U("MkCondensedLine");return k(),V("div",ce,[a(z,{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=f=>c.value=f)},{label:e(()=>[d(i(n(t).ts.sound),1)]),default:e(()=>[(k(!0),V(O,null,K(n(j),f=>(k(),V("option",{key:f??"null",value:f},i(W(f)),9,ve))),128))]),_:1},8,["modelValue"]),c.value==="_driveFile_"&&m.value===!0?(k(),V("div",{key:0,class:h(u.$style.fileSelectorRoot)},[a(C,{class:h(u.$style.fileSelectorButton),inline:"",rounded:"",primary:"",onClick:I},{default:e(()=>[d(i(n(t).ts.selectFile),1)]),_:1},8,["class"]),g("div",{class:h(u.$style.fileErrorRoot)},[a(b,null,{default:e(()=>[d(i(n(t).ts._soundSettings.driveFileError),1)]),_:1})],2)],2)):c.value==="_driveFile_"?(k(),V("div",{key:1,class:h(u.$style.fileSelectorRoot)},[a(C,{class:h(u.$style.fileSelectorButton),inline:"",rounded:"",primary:"",onClick:I},{default:e(()=>[d(i(n(t).ts.selectFile),1)]),_:1},8,["class"]),g("div",{class:h(["_nowrap",!s.value&&u.$style.fileNotSelected])},i(o.value),3)],2)):ne("",!0),a(D,{modelValue:_.value,"onUpdate:modelValue":r[1]||(r[1]=f=>_.value=f),min:0,max:1,step:.05,textConverter:f=>`${Math.floor(f*100)}%`},{label:e(()=>[d(i(n(t).ts.volume),1)]),_:1},8,["modelValue","textConverter"]),g("div",fe,[a(C,{inline:"",onClick:q},{default:e(()=>[r[2]||(r[2]=g("i",{class:"ti ti-player-play"},null,-1)),d(" "+i(n(t).ts.listen),1)]),_:1}),a(C,{inline:"",primary:"",disabled:!S.value||m.value,onClick:P},{default:e(()=>[r[3]||(r[3]=g("i",{class:"ti ti-check"},null,-1)),d(" "+i(n(t).ts.save),1)]),_:1},8,["disabled"])])])}}}),_e="xDBOW",pe="xiWjC",ye="xlArr",ke="x2Pqw",Se={fileSelectorRoot:_e,fileErrorRoot:pe,fileSelectorButton:ye,fileNotSelected:ke},Fe={$style:Se},ge=J(me,[["__cssModules",Fe]]),Me={class:"_gaps_m"},we={class:"_gaps_s"}
1,We=L({__name:"sounds",setup(T){const x=y.model("sound.notUseSound"),M=y.model("sound.useSoundOnlyWhenActive"),w=y.model("sound.masterVolume"),v=F({note:y.r["sound.on.note"],noteMy:y.r["sound.on.noteMy"],notification:y.r["sound.on.notification"],reaction:y.r["sound.on.reaction"],chatMessage:y.r["sound.on.chatMessage"]});function $(s){switch(s){case null:return t.ts.none;case"_driveFile_":return t.ts._soundSettings.driveFile;default:return s}}async function c(s,l){const m={type:l.type,fileId:l.fileId,fileUrl:l.fileUrl,volume:l.volume};y.commit(`sound.on.${s}`,m),v.value[s]=m}function p(){for(const s of Object.keys(v.value)){const l=le[`sound.on.${s}`].default;y.commit(`sound.on.${s}`,l),v.value[s]=l}}return ee(()=>({title:t.ts.sounds,icon:"ti ti-music"})),(s,l)=>{const m=U("SearchKeyword"),S=U("SearchLabel"),_=U("SearchMarker"),W=U("MkLoading");return k(),B(_,{path:"/settings/sounds",label:n(t).ts.sounds,keywords:["sounds"],icon:"ti ti-music",markerId:"6fFIRXUww","data-in-app-search-marker-id":"6fFIRXUww",children:["EcwZE7dCl","9MxYVIf7k","94afQxKat"]},{default:e(()=>[g("div",Me,[a(de,{icon:"/client-assets/speaker_high_volume_3d.png",color:"#ff006f"},{default:e(()=>[a(m,null,{default:e(()=>[d(i(n(t).ts._settings.soundsBanner),1)]),_:1})]),_:1}),a(_,{keywords:["mute"],markerId:"EcwZE7dCl","data-in-app-search-marker-id":"EcwZE7dCl"},{default:e(()=>[a(R,{k:"sound.notUseSound"},{default:e(()=>[a(A,{modelValue:n(x),"onUpdate:modelValue":l[0]||(l[0]=o=>N(x)?x.value=o:null)},{label:e(()=>[a(S,null,{default:e(()=>[d(i(n(t).ts.notUseSound),1)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(_,{keywords:["active","mute"],markerId:"9MxYVIf7k","data-in-app-search-marker-id":"9MxYVIf7k"},{default:e(()=>[a(R,{k:"sound.useSoundOnlyWhenActive"},{default:e(()=>[a(A,{modelValue:n(M),"onUpdate:modelValue":l[1]||(l[1]=o=>N(M)?M.value=o:null)},{label:e(()=>[a(S,null,{default:e(()=>[d(i(n(t).ts.useSoundOnlyWhenActive),1)]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),a(_,{keywords:["volume","master"],markerId:"94afQxKat","data-in-app-search-marker-id":"94afQxKat"},{default:e(()=>[a(R,{k:"sound.masterVolume"},{default:e(()=>[a(D,{modelValue:n(w),"onUpdate:modelValue":l[2]||(l[2]=o=>N(w)?w.value=o:null),min:0,max:1,step:.05,textConverter:o=>`${Math.floor(o*100)}%`},{label:e(()=>[a(S,null,{default:e(()=>[d(i(n(t).ts.masterVolume),1)]),_:1})]),_:1},8,["modelValue","textConverter"])]),_:1})]),_:1}),a(ie,null,{label:e(()=>[d(i(n(t).ts.sounds),1)]),default:e(()=>[g("div",we,[(k(!0),V(O,null,K(n(te),o=>(k(),B(re,{key:o},{label:e(()=>[d(i(n(t).ts._sfx[o]),1)]),suffix:e(()=>[d(i($(v.value[o].type)),1)]),default:e(()=>[(k(),B(ue,null,{default:e(()=>[a(ge,{type:v.value[o].type,volume:v.value[o].volume,fileId:v.value[o].fileId,fileUrl:v.value[o].fileUrl,onUpdate:I=>c(o,I)},null,8,["type","volume","fileId","fileUrl","onUpdate"])]),fallback:e(()=>[a(W)]),_:2},1024))]),_:2},1024))),128))])]),_:1}),a(C,{danger:"",onClick:l[3]||(l[3]=o=>p())},{default:e(()=>[l[4]||(l[4]=g("i",{class:"ti ti-reload"},null,-1)),d(" "+i(n(t).ts.default),1)]),_:1})])]),_:1},8,["label"])}}});export{We as default}; 2//# sourceMappingURL=2025.4.1-nijimiss.7-13fa15e96a.DlJxAgjM.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.