PageSourceSearch

https://noiz.ai/assets/tts-BZqLly7H.js

js noiz.ai collected 2026-10-05 07:13:08 UTC 16,296 bytes, 1 lines download raw bytes

1import{cQ as i,dn as b,e5 as K}from"./index-DsiSMK2M.js";/*! Capacitor: https://capacitorjs.com/ - MIT License */var C;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(C||(C={}));class U extends Error{constructor(t,s,r){super(t),this.message=t,this.code=s,this.data=r}}const z=e=>{var t,s;return e!=null&&e.androidBridge?"android":!((s=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||s===void 0)&&s.bridge?"ios":"web"},J=e=>{const t=e.CapacitorCustomPlatform||null,s=e.Capacitor||{},r=s.Plugins=s.Plugins||{},n=()=>t!==null?t.name:z(e),a=()=>n()!=="web",d=l=>{const u=y.get(l);return!!(u!=null&&u.platforms.has(n())||h(l))},h=l=>{var u;return(u=s.PluginHeaders)===null||u===void 0?void 0:u.find(E=>E.name===l)},g=l=>e.console.error(l),y=new Map,P=(l,u={})=>{const E=y.get(l);if(E)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),E.proxy;const x=n(),k=h(l);let _;const B=async()=>(!_&&x in u?_=typeof u[x]=="function"?_=await u[x]():_=u[x]:t!==null&&!_&&"web"in u&&(_=typeof u.web=="function"?_=await u.web():_=u.web),_),W=(f,m)=>{var v,w;if(k){const T=k==null?void 0:k.methods.find(p=>m===p.name);if(T)return T.rtype==="promise"?p=>s.nativePromise(l,m.toString(),p):(p,$)=>s.nativeCallback(l,m.toString(),p,$);if(f)return(v=f[m])===null||v===void 0?void 0:v.bind(f)}else{if(f)return(w=f[m])===null||w===void 0?void 0:w.bind(f);throw new U(`"${l}" plugin is not implemented on ${x}`,C.Unimplemented)}},O=f=>{let m;const v=(...w)=>{const T=B().then(p=>{const $=W(p,f);if($){const L=$(...w);return m=L==null?void 0:L.remove,L}else throw new U(`"${l}.${f}()" is not implemented on ${x}`,C.Unimplemented)});return f==="addListener"&&(T.remove=async()=>m()),T};return v.toString=()=>`${f.toString()}() { [capacitor code] }`,Object.defineProperty(v,"name",{value:f,writable:!1,configurable:!1}),v},F=O("addListener"),H=O("removeListener"),M=(f,m)=>{const v=F({eventName:f},m),w=async()=>{const p=await v;H({eventName:f,callbackId:p},m)},T=new Promise(p=>v.then(()=>p({remove:w})));return T.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await w()},T},A=new Proxy({},{get(f,m){switch(m){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return k?M:F;case"removeListener":return H;default:return O(m)}}});return r[l]=A,y.set(l,{name:l,proxy:A,platforms:new Set([...Object.keys(u),...k?[x]:[]])}),A};return s.convertFileSrc||(s.convertFileSrc=l=>l),s.getPlatform=n,s.handleError=g,s.isNativePlatform=a,s.isPluginAvailable=d,s.registerPlugin=P,s.Exception=U,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s},Q=e=>e.Capacitor=J(e),S=Q(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),I=S.registerPlugin;class D{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,s){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(s);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),r&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,s);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,s,r){const n=this.listeners[t];if(!n){if(r){let a=this.retainedEventArguments[t];a||(a=[]),a.push(s),this.retainedEventArguments[t]=a}return}n.forEach(a=>a(s))}hasListeners(t){var s;return!!(!((s=this.listeners[t])===null||s===void 0)&&s.length)}registerWindowListener(t,s){this.windowListeners[s]={registered:!1,windowEventName:t,pluginEventName:s,handler:r=>{this.notifyListeners(s,r)}}}unimplemented(t="not implemented"){return new S.Exception(t,C.Unimplemented)}unavailable(t="not available"){return new S.Exception(t,C.Unavailable)}async removeListener(t,s){const r=this.listeners[t];if(!r)return;const n=r.indexOf(s);this.listeners[t].splice(n,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}
1addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const s=this.retainedEventArguments[t];s&&(delete this.retainedEventArguments[t],s.forEach(r=>{this.notifyListeners(t,r)}))}}const R=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),G=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class X extends D{async getCookies(){const t=document.cookie,s={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[n,a]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=G(n).trim(),a=G(a).trim(),s[n]=a}),s}async setCookie(t){try{const s=R(t.key),r=R(t.value),n=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${s}=${r||""}${n}; path=${a}; ${d};`}catch(s){return Promise.reject(s)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(s){return Promise.reject(s)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const s of t)document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}I("CapacitorCookies",{web:()=>new X});const Y=async e=>new Promise((t,s)=>{const r=new FileReader;r.onload=()=>{const n=r.result;t(n.indexOf(",")>=0?n.split(",")[1]:n)},r.onerror=n=>s(n),r.readAsDataURL(e)}),Z=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(n=>n.toLocaleLowerCase()).reduce((n,a,d)=>(n[a]=e[t[d]],n),{})},N=(e,t=!0)=>e?Object.entries(e).reduce((r,n)=>{const[a,d]=n;let h,g;return Array.isArray(d)?(g="",d.forEach(y=>{h=t?encodeURIComponent(y):y,g+=`${a}=${h}&`}),g.slice(0,-1)):(h=t?encodeURIComponent(d):d,g=`${a}=${h}`),`${r}&${g}`},"").substr(1):null,ee=(e,t={})=>{const s=Object.assign({method:e.method||"GET",headers:e.headers},t),n=Z(e.headers)["content-type"]||"";if(typeof e.data=="string")s.body=e.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[d,h]of Object.entries(e.data||{}))a.set(d,h);s.body=a.toString()}else if(n.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((h,g)=>{a.append(g,h)});else for(const h of Object.keys(e.data))a.append(h,e.data[h]);s.body=a;const d=new Headers(s.headers);d.delete("content-type"),s.headers=d}else(n.includes("application/json")||typeof e.data=="object")&&(s.body=JSON.stringify(e.data));return s};class te extends D{async request(t){const s=ee(t,t.webFetchExtra),r=N(t.params,t.shouldEncodeUrlParams),n=r?`${t.url}?${r}`:t.url,a=await fetch(n,s),d=a.headers.get("content-type")||"";let{responseType:h="text"}=a.ok?t:{};d.includes("application/json")&&(h="json");let g,y;switch(h){case"arraybuffer":case"blob":y=await a.blob(),g=await Y(y);break;case"json":g=await a.json();break;case"document":case"text":default:g=await a.text()}const P={};return a.headers.forEach((l,u)=>{P[u]=l}),{data:g,headers:P,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}I("CapacitorHttp",{web:()=>new te});var V;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(V||(V={}));var q;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(q||(q={}));class se extends D{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}I("SystemBars",{web:()=>new se});const re=I("FirebaseAnalytics"),ae=()=>S.isNativePlatform();async function o(e,t){var r,n;const s=window;if((n=(r=s.webkit)==null?void 0:r.messageHandlers)!=null&&n.analyticsEvent){try{s.webkit.messageHandlers.analyticsEvent.postMessage({name:e+"_app",params:t??{}})}catch{}return}if(ae())try{await re.logEvent({name:e,params:t})}catch{}}const ne={modelSwitchClick:()=>o("tts_modelswitch_click"),speechRateClick:()=>o("tts_speechrate_click"),multipleVariationsClick:()=>o("tts_multiplevariations_click"),outputFormatClick:()=>o("tts_outputformat_click"),emotionSelectClick:e=>o("tts_emotionselect_click",{emotion:e}),emotionDetectClick:(e="single")=>o("tts_emotiondetect_click",{scope:e}),generateClick:(e,t)=>{const s=typeof e=="string"?{voice_id:e,...t}:e;return o("tts_generate_click",{voice_id:s.voice_id,voice_name:s.voice_name??"",text:s.text??"",text_length:s.text_length??0,language:s.language??"",model:s.model??"",generation_request_id:s.generation_request_id??"",gen_type:s.gen_type??"tts",source:s.source??"tts_creation"})},inputDetail:e=>o("tts_inputdetail",{model_selection:e.modelSelection,character_count:e.characterCount,language:e.language,speech_rate:e.speechRate,output_format:e.outputFormat}),playbackClick:e=>o("tts_playback_click",{voice_id:(e==null?void 0:e.voice_id)??"",voice_name:(e==null?void 0:e.voice_name)??"",duration:(e==null?void 0:e.duration)??0}),downloadClick:(e,t)=>{const s=typeof e=="string"?{voice_id:e,...t}:e;return o("tts_download_click",{voice_id:s.voice_id,voice_name:s.voice_name??"",text:s.text??"",text_length:s.text_length??0,format:s.format??"",gen_product_id:s.gen_product_id??"",generation_request_id:s.generation_request_id??"",gen_type:s.gen_type??"tts",source:s.source??"current"})},stopClick:()=>o("tts_stop_click"),myVoicesClick:()=>o("tts_myvoices_click"),voiceLibrarySelectClick:()=>o("tts_voicelibraryselect_click")},oe={pageExposure:()=>o("page_voice_lib_exposure"),stayDuration:e=>o("voice_library_page_duration",{duration:e}),playClick:e=>o("voice_play_click",{id:e}),tabClick:e=>o("voice_library_nav_tab_click",{tab:e}),navTabClick:e=>o("click_nav_tab",{tab:e}),cloneClick:()=>o("voice_library_voice_clone_click"),designClick:()=>o("voice_library_voice_design_click"),favoriteAdd:e=>o("voice_explore_favorite_add",{id:e}),favoriteRemove:e=>o("voice_explore_favorite_remove",{id:e}),download:e=>o("voice_download",{id:e}),generateClick:e=>o("voice_generate_click",{id:e}),playEnd:(e,t)=>o("voice_card_play_end",{voice_id:e,duration:t}),searchResultExposure:()=>o("voice_search_result_exposure"),filterClick:()=>o("voice_filter_click"),creationGenerateClick:e=>o("voice_creation_generate_click",{id:e}),creationVoiceCardClick:()=>o("creation_voice_card_click"),creationVoiceModalClose:()=>o("creation_voice_modal_close")},ce={guidancePlayClick:e=>o("guide_click",{guidance_title:e})},c="api/v1",j=e=>e.data,le={getModels:()=>i.axiosInstance({url:`/${c}/model-list`,method:"GET",desc:"获取tts模型列表"}),getVoices:e=>i.axiosInstance({url:`/${c}/voices`,method:"GET",desc:"获取语音列表",...e}),getEmotions:()=>i.axiosInstance({url:`/${c}/emotions`,method:"GET",desc:"获取情绪列表"}),getTtsHistory:e=>i.axiosInstance({url:`/${c}/text-to-speech-history`,method:"GET",desc:"获取历史记录",...e}),guestTextToSpeech:e=>i.axiosInstance({method:"POST",desc:"Guest TTS",url:`/${c}/guest/text-to-speech`,all:!0,headers:{"Content-Type":"multipart/form-data"},responseType:"blob",data:e}),tryTTS:e=>i.axiosInstance({timeout:-1,method:"POST",desc:"合成声音(试听)",url:`/${c}/text-to-speech`,all:!0,headers:{"Content-Type":"multipart/form-data"},responseType:"blob",data:e}),createLongTts:(e,t={})=>{const s=t.refreshPaymentInfo!==!1;return s&&b("tts"),i.axiosInstance({timeout:-1,method:"POST",desc:"合成声音",url:`/${c}/text-to-speech-long`,all:!0,notNotify:!0,headers:{"Content-Type":"multipart/form-data"},responseType:"blob",data:e}).then(r=>(s&&b("tts"),r))},refreshTtsPaymentInfo:()=>b("tts"),createBatchTTS:e=>(b("tts"),i.axiosInstance({timeout:-1,method:"POST",desc:"合成声音 batch",url:`/${c}/text-to-speech-batch`,notNotify:!0,notClassified:!0,headers:{"Content-Type":"multipart/form-data"},data:e}).then(t=>(b("tts"),(Array.isArray(t)?t:(t==null?void 0:t.data)??[]).map(r=>({...r,signed_url:r.signed_url||r.url||"",fallbackurl:r.fallbackurl||""}))))),createLargeTTS:e=>(b("tts"),i.axiosInstance({method:"POST",desc:"合成长文本",url:"/api/v2/text-to-speech-large",notNotify:!0,notClassified:!0,headers:{"Content-Type":"multipart/form-data"},data:e}).then(t=>(t==null?void 0:t.data)??t)),getLargeTTSStatus:e=>i.axiosInstance({url:"/api/v2/text-to-speech-large-progress",method:"POST",desc:"批量获取长文本job进度/结果",notNotify:!0,notClassified:!0,...e}).then(t=>(b("tts"),t)),getLargeTTSInfo:e=>i.axiosInstance({url:`/api/v2/text-to-speech-large/gen_products/${e}`,method:"GET",desc:"获取长文本详情"}),setLargeTTS:e=>i.axiosInstance({url:"/api/v2/text-to-speech-large-concat",method:"PUT",desc:"保存长文本",...e}),regenTTS:e=>(b("tts"),i.axiosInstance({timeout:-1,method:"POST",desc:"合成声音(片段)",url:"/api/v2/text-to-speech-large-regen",headers:{"Content-Type":"multipart/form-data"},data:e}).then(t=>(b("tts"),t))),getSentenceHistory:e=>i.axiosInstance({url:"/api/v2/text-to-speech-large-candidates",method:"GET",desc:"单段历史候选选择下拉列",...e}),selectSentence:e=>i.axiosInstance({url:"/api/v2/text-to-speech-large-candidates",method:"PUT",desc:"单段历史选中",...e}),stopLargeTTS:e=>i.axiosInstance({url:"/api/v2/text-to-speech-large-stop",method:"PUT",desc:"停止生成长文本",data:{gen_product_id:e}}).then(t=>(K.ttsStopClick(),ne.stopClick(),t)),addVoice:(e,t,s,r)=>
1i.axiosInstance({method:t,desc:"新建声音",timeout:18e4,url:s?`/${c}/voices/${s}`:`/${c}/voices`,headers:{"Content-Type":"multipart/form-data"},data:e,...r}),deleteUserVoices:e=>i.axiosInstance({url:`/${c}/voices/${e}`,method:"DELETE",desc:"删除语音"}),publishVoice:e=>i.axiosInstance({url:`/${c}/voices/${e}/publish`,method:"POST",desc:"发布语音"}),unpublishVoice:e=>{const t=new FormData;return t.append("voice_type","custom"),i.axiosInstance({url:`/${c}/voices/${e}`,method:"PUT",desc:"下架语音",headers:{"Content-Type":"multipart/form-data"},data:t})},deleteHistoryVoices:e=>i.axiosInstance({url:`/${c}/text-to-speech/${e}`,method:"DELETE",desc:"删除历史记录语音"}),asrUserVoices:e=>i.axiosInstance({url:`/${c}/voices/asr`,method:"POST",desc:"asr语音",timeout:18e4,headers:{"Content-Type":"multipart/form-data"},data:e}),logDownload:e=>i.axiosInstance({url:`/${c}/text-to-speech/download`,method:"POST",desc:"上报用户下载",notNotify:!0,...e}),feedbackTTS:(e,t)=>i.axiosInstance({url:`/${c}/text-to-speech/${e}/like`,method:"PUT",desc:"提交反馈",...t}),emotionEnhance:e=>i.axiosInstance({url:`/${c}/emotion-enhance`,method:"POST",desc:"情绪检测",...e}),casualize:e=>i.axiosInstance({url:`/${c}/casualize`,method:"POST",desc:"口语化改写",...e}),submitTtsCreationParse:e=>i.axiosInstance({url:`/${c}/tts-creation/parse`,method:"POST",desc:"提交文本角色识别任务",notNotify:!0,notClassified:!0,...e}).then(j),submitTtsCreationCreate:e=>i.axiosInstance({url:`/${c}/tts-creation/create`,method:"POST",desc:"提交场景创作任务",notNotify:!0,notClassified:!0,...e}).then(j),getTtsCreationTask:e=>i.axiosInstance({url:`/${c}/tts-creation/tasks/${e}`,method:"GET",desc:"获取创作任务状态",notNotify:!0,notClassified:!0}).then(j),trackCoreFeatureUsage:e=>i.axiosInstance({url:`/${c}/track_core_feature_usage`,method:"POST",desc:"是否使用了核心功能",...e}),applyFilter:e=>i.axiosInstance({method:"POST",url:"/api/v1/apply-filter",desc:"后处理滤镜",all:!0,responseType:"blob",data:e}),updateGenProductFilter:(e,t)=>i.axiosInstance({method:"PATCH",url:`/api/v1/gen-products/${e}/filter`,desc:"写回滤镜类型",notNotify:!0,data:{filter_type:t}})};export{ne as a,oe as b,ce as f,le as t};

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.