@seams/voiceid 0.53.0 → 0.55.0
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.
- package/README.md +1 -1
- package/dist/public/sdk/voiceid/{addVoiceId-DgFmNO4V.js → addVoiceId-BzirvbVh.js} +1 -1
- package/dist/public/sdk/voiceid/deviceBridge-D8R6eVEE.js +1 -0
- package/dist/public/sdk/voiceid/host.js +2 -2
- package/dist/public/sdk/voiceid/{operation-B-Hwg9al.js → operation-CObNRH_J.js} +1 -1
- package/dist/public/sdk/voiceid/phrase-CArJ-DH1.js +1 -0
- package/dist/public/sdk/voiceid/phrase-DSVab8JP.js +1 -0
- package/dist/public/sdk/voiceid/prompt-BPtSdsWi.js +640 -0
- package/dist/public/sdk/voiceid/{unlock-Zmv1aA7R.js → unlock-CPiLZCsY.js} +1 -1
- package/dist/types/capture/phrase.d.ts +9 -0
- package/dist/types/host.d.ts +1 -1
- package/package.json +2 -2
- package/dist/public/sdk/voiceid/deviceBridge-Cqb5arWN.js +0 -1
- package/dist/public/sdk/voiceid/prompt-bUX1mWKl.js +0 -640
- /package/dist/public/sdk/voiceid/{ort.wasm.bundle.min-7y-hlRN8.js → ort.wasm.bundle.min-BH_0rOm8.js} +0 -0
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
import{WorkerDeferred as e,createCspStylesheetManager as t,getDefaultCspNonce as n,isPlainObject as r,readVoiceMicrophonePreference as i,saveVoiceMicrophonePreference as a}from"../voiceid-host.js";const o=3e4;var s=class extends Error{constructor(e,t,n){super(t,n),this.kind=e,this.name=`VoiceIdLoadError`}};async function c(){try{return await caches.open(`seams-voiceid-models-v1`)}catch{return null}}var l=class{pending=null;progress={kind:`checking_cache`};listeners=new Set;constructor(e){this.asset=e}get size(){return this.asset.bytes}async download(e){e&&(this.listeners.add(e),e(this.progress));try{this.pending||=this.bytes().catch(this.failed);let e=await this.pending;return this.publish({kind:`ready`}),e}finally{e&&this.listeners.delete(e)}}failed=e=>{throw this.pending=null,this.progress={kind:`checking_cache`},e};publish(e){this.progress=e;for(let t of this.listeners)t(e)}async valid(e){if(e.byteLength!==this.asset.bytes)return!1;let t=new Uint8Array(await crypto.subtle.digest(`SHA-256`,e)),n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return n===this.asset.sha256}async bytes(){let{path:e,sha256:t}=this.asset;this.publish({kind:`checking_cache`});let n=await c(),r=new URL(`${e}?sha256=${t}`,location.origin).href;try{let e=await n?.match(r);if(e){let t=await e.arrayBuffer();if(await this.valid(t))return t;await n?.delete(r)}}catch{}let i;try{i=await this.fetchBytes()}catch(e){if(!(e instanceof s)||e.kind!==`connection`)throw e;i=await this.fetchBytes()}if(n)try{await n.put(r,new Response(i,{headers:{"Content-Type":`application/octet-stream`}}))}catch{}return i}async fetchBytes(){let{label:e,path:t}=this.asset,n=new AbortController,r=setTimeout(u.bind(null,n),o);this.publish({kind:`downloading`,received:0});try{let i=await fetch(t,{credentials:`omit`,cache:`reload`,signal:n.signal});if(!i.ok||!i.body){let t=[408,429,500,502,503,504].includes(i.status);throw new s(t?`connection`:`unavailable`,t?`${e} download was interrupted. Check your connection and retry.`:`${e} is unavailable from this Wallet. Reload the page or use a passkey.`)}let a=i.body.getReader(),c=new Uint8Array(this.asset.bytes),l=0;try{for(;;){let t=await a.read();if(t.done)break;if(clearTimeout(r),r=setTimeout(u.bind(null,n),o),l+t.value.length>c.length)throw new s(`integrity`,`${e} size is invalid. Retry loading.`);c.set(t.value,l),l+=t.value.length,this.publish({kind:`downloading`,received:l})}}finally{await a.cancel().catch(d),a.releaseLock()}if(l!==c.length||!await this.valid(c.buffer))throw new s(`integrity`,`${e} integrity check failed. Retry loading.`);return c.buffer}catch(t){throw t instanceof s?t:new s(`connection`,`${e} download was interrupted. Check your connection and retry.`,{cause:t})}finally{clearTimeout(r),n.abort()}}};function u(e){e.abort()}function d(){}const f=new l({path:`/sdk/voiceid/ort-wasm-simd-threaded.wasm`,sha256:`3398c10d07d229bd91b364548e130e0e51a8e5704b88c7c083ebbeb78842dee2`,bytes:14239897,label:`VoiceID engine`});var p=class{asset;session=null;constructor(e){this.asset=new l(e)}prepare(){return this.session||=this.load().catch(this.failed),this.session}failed=e=>{throw this.session=null,e};async load(){try{let e=await import(`./ort.wasm.bundle.min-BH_0rOm8.js`);e.env.wasm.numThreads=1,e.env.wasm.wasmPaths=new URL(`/sdk/voiceid/`,location.origin).href,e.env.wasm.wasmBinary=await f.download();let t=await this.asset.download();return await e.InferenceSession.create(t,{executionProviders:[`wasm`]})}catch(e){throw e instanceof s?e:(console.error(`[VoiceID] inference engine could not start`,e),new s(`initialization`,`VoiceID could not start. Retry loading. If it still fails, reload the page or use a passkey.`,{cause:e}))}}};const m=`please sign this trade now.confirm my order for today.please review my order.dump on them slowly.send this order to market.i'm here for the tech.keep this trade on track.the market is open.if you panic panic early.i check the latest quote.exit liquidity for all passengers.no crying in the casino.this trade fits my plan.approve this transfer at once.check the price before trading.let this trade go through.be retarded when others are fearful.be fearful when others are retarded.life is short go long to hedge.sign this swap right now.sign this swap with care.sign this swap today.check my order right now.check my order with care.check my order today.confirm the trade right now.confirm the trade with care.confirm the trade today.review this transfer right now.review this transfer with care.review this transfer today`.split(`.`),h={sale:[`please confirm this sale`,`the sale is ready`],purchase:[`this purchase has my approval`,`please confirm my purchase`],swap:[`confirm my swap today`,`the swap is ready to proceed`],transfer:[`confirm this transfer today`,`please send this transfer now`]},g=[...m,...h.sale,...h.purchase,...h.swap,...h.transfer],_=`.<unk>.▁t.he.▁a.▁the.in.▁s.▁w.▁o.re.nd.▁b.▁h.er.▁m.▁i.ou.▁c.▁f.at.ed.▁and.en.▁to.▁of.on.is.▁d.ing.▁th.▁p.▁he.or.▁l.es.▁in.ll.it.ar.as.an.▁n.▁g.om.▁be.▁ha.▁e.le.ot.▁y.ut.ow.ic.▁wh.▁it.ld.ve.▁that.ly.▁was.id.se.st.▁on.gh.ent.▁re.▁you.im.ce.▁u.ver.ion.▁as.et.▁for.ay.▁we.▁his.ith.al.ir.▁r.▁with.▁st.ad.ur.ght.▁an.▁her.▁not.▁had.▁is.ter.her.ac.am.▁at.oo.▁but.ould.▁she.▁k.▁se.▁sa.▁sh.▁fr.▁him.▁so.ill.▁me.ain.▁su.ight.ch.red.ct.all.ro.ke.ess.il.ore.▁de.▁they.▁my.▁whe.▁all.ich.▁ne.ri.▁by.▁have.ome.pp.▁this.▁li.▁do.▁con.us.▁which.▁ch.ul.qu.▁j.▁up.▁said.▁from.ard.ge.▁or.▁v.▁one.th.▁no.▁ex.▁were.▁there.pe.and.est.▁man.▁who.ble.ant.ie.▁al.res.ous.ust.very.ation.▁fe.▁them.lf.▁when.ind.nt.ame.ra.▁go.ers.ast.fe.ood.▁kn.▁int.ist.art.▁are.out.▁would.▁le.os.▁their.ong.▁what.our.▁if.ound.▁com.▁ab.▁out.▁wor.em.▁will.ak.▁mis.ate.ol.um.un.itt.ough.ked.ap.ig.one.▁been.own.ive.▁then.▁br.ven.if.▁ar.▁tr.self.▁.e.t.a.o.n.i.h.s.r.d.l.u.m.c.w.f.g.y.p.b.v.k.'.x.j.q.z`.split(`.`),v=new p({path:`/sdk/voiceid/silero-vad.onnx`,sha256:`2623a2953f6ff3d2c1e61740c6cdb7168133479b267dfef114a4a3cc5bdd788f`,bytes:2327524,label:`Speech detection`});async function y(){return new b(await v.prepare(),await import(`./ort.wasm.bundle.min-BH_0rOm8.js`))}var b=class{state=new Float32Array(256);context=new Float32Array(64);constructor(e,t){this.session=e,this.ort=t}async probability(e){if(e.length!==512)throw Error(`Speech detection requires a 512-sample frame.`);let t=new Float32Array(576);t.set(this.context),t.set(e,64);let n=new this.ort.Tensor(`float32`,t,[1,576]),r=new this.ort.Tensor(`float32`,this.state,[2,1,128]),i=new this.ort.Tensor(`int64`,BigInt64Array.of(16000n),[]);try{let t=await this.session.run({input:n,state:r,sr:i});try{let n=t.output?.data,r=t.stateN?.data;if(!(n instanceof Float32Array)||n.length!==1||!Number.isFinite(n[0])||n[0]<0||n[0]>1||!(r instanceof Float32Array)||r.length!==256)throw Error(`Speech detection returned an invalid result.`);return this.state.set(r),this.context.set(e.subarray(448)),n[0]}finally{for(let e of Object.values(t))e.dispose()}}finally{n.dispose(),r.dispose(),i.dispose(),t.fill(0)}}clear(){this.state.fill(0),this.context.fill(0)}};let x={kind:`unread`};function S(e){return typeof e==`string`&&e.length>0&&e!==`default`&&e!==`communications`}async function C(){if(x.kind!==`unread`)return x;let e={kind:`system_default`};try{let t=await i();r(t)&&t.kind===`device`&&S(t.deviceId)&&(e={kind:`device`,deviceId:t.deviceId})}catch{}return x.kind===`unread`&&(x=e),x}function w(e){let t={channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0};return e.kind===`device`&&(t.deviceId={exact:e.deviceId}),{audio:t,video:!1}}async function T(e){if(S(e.deviceId))return{kind:`device`,deviceId:e.deviceId};if(e.groupId)try{let t=await navigator.mediaDevices.enumerateDevices();for(let n of t)if(n.kind===`audioinput`&&n.groupId===e.groupId&&S(n.deviceId))return{kind:`device`,deviceId:n.deviceId}}catch{}return{kind:`system_default`}}async function E(e){e.throwIfAborted();let t=await C();e.throwIfAborted();let n,r=t.kind===`device`?`preferred`:`default`;try{n=await navigator.mediaDevices.getUserMedia(w(t))}catch(i){if(e.throwIfAborted(),t.kind!==`device`||!(i instanceof DOMException)||i.name!==`OverconstrainedError`&&i.name!==`NotFoundError`)throw i;n=await navigator.mediaDevices.getUserMedia(w({kind:`system_default`})),r=`replacement`}let i=ee.bind(null,n);e.addEventListener(`abort`,i,{once:!0});try{e.throwIfAborted();let t=n.getAudioTracks()[0];if(!t||t.readyState!==`live`)throw new k;let i=t.getSettings(),a=await T(i);if(e.throwIfAborted(),t.readyState!==`live`)throw new k;return{stream:n,preference:a,selection:r,label:t.label||`Default microphone`,processing:{noiseSuppression:i.noiseSuppression??null,echoCancellation:i.echoCancellation??null,autoGainControl:i.autoGainControl??null,sampleRate:i.sampleRate??null}}}catch(e){throw i(),e}finally{e.removeEventListener(`abort`,i)}}function ee(e){for(let t of e.getTracks())t.stop()}async function te(e){e.preference.kind!==`device`||e.selection===`replacement`||await O(e.preference)}async function D(){await O({kind:`system_default`})}async function O(e){x=e;try{await a(e)}catch{}}var k=class extends Error{constructor(){super(`The microphone disconnected or stopped. Check your microphone and try again.`),this.name=`VoiceMicrophoneInterruptedError`}};function ne(e){return e.noise===`high`?`Background noise is high. Move closer to the microphone and try again.`:`Audio too brief or quiet: ${(e.voicedMs/1e3).toFixed(2)} of ${(e.requiredVoicedMs/1e3).toFixed(2)} seconds detected.`}var A=class extends Error{constructor(e){super(ne(e)),this.quality=e,this.name=`InsufficientVoiceAudioError`}};const j=16e3,M=.006,re=8e3;function N(){if(P(),!navigator.userActivation.isActive)throw Error(`Open the Wallet and select Record to use VoiceID.`)}function P(){if(document.visibilityState!==`visible`||!document.hasFocus())throw Error(`Keep the Wallet open and focused to use VoiceID.`)}async function F(e,t){if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let n=crypto.randomUUID();t({kind:`opening`});let r=await E(e),{stream:i}=r;try{if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let a=await new ie(i,e,t).result.finally(t.bind(null,{kind:`processing`}));if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let o=await new OfflineAudioContext(1,j,j).decodeAudioData(a.bytes),s=new OfflineAudioContext(1,Math.ceil(o.duration*j),j),c=s.createBufferSource();c.buffer=o,c.connect(s.destination),c.start();try{let i=await s.startRendering();try{if(e.aborted)throw Error(`VoiceID recording was cancelled.`);let o=i.getChannelData(0),s=await ae(o,e),c={attemptId:n,capturedAtMs:Date.now(),durationMs:i.duration*1e3,recordingMs:a.recordingMs,endedBy:a.endedBy,voicedMs:s.voicedMs,peakFrameRms:s.peakFrameRms,levelThreshold:M,requiredVoicedMs:600,microphone:r.label,microphoneSelection:r.selection,processing:r.processing,backgroundRms:s.backgroundRms,speechToBackgroundDb:s.speechToBackgroundDb,noise:s.noise};if(t({kind:`measured`,quality:c}),s.kind===`insufficient_audio`)return{kind:`insufficient_audio`,quality:c};let l=o.slice(Math.max(0,s.first-3200),Math.min(o.length,s.last+3200));return await te(r),e.aborted&&(l.fill(0),e.throwIfAborted()),{kind:`captured`,samples:l,quality:c}}finally{oe(i)}}finally{oe(o)}}finally{for(let e of i.getTracks())e.stop()}}var ie=class{recorder;chunks=[];timer=null;completion=new e;startedAtMs=performance.now();ended=null;activity={kind:`waiting`,activeMs:0};audioContext=null;worklet=null;detector=null;pending=Promise.resolve();queuedFrames=0;closed=!1;result=this.completion.promise;constructor(e,t,n){this.stream=e,this.signal=t,this.onCapture=n,this.recorder=new MediaRecorder(e),this.recorder.addEventListener(`dataavailable`,this.data),this.recorder.addEventListener(`stop`,this.stopped),this.recorder.addEventListener(`error`,this.failed);for(let t of e.getAudioTracks())t.addEventListener(`ended`,this.interrupted),t.addEventListener(`mute`,this.interrupted);t.addEventListener(`abort`,this.cancelled,{once:!0}),this.timer=setTimeout(this.startupFailed,re),this.start()}async start(){try{if(await this.startPauseDetection(),this.signal.throwIfAborted(),this.startedAtMs=performance.now(),this.closed)return;this.recorder.start(),this.timer!==null&&clearTimeout(this.timer),this.timer=setTimeout(this.stop.bind(this,`limit`),re),this.onCapture({kind:`listening`})}catch(e){this.cleanup(),this.completion.reject(e instanceof Error?e:Error(`Speech detection could not start.`))}}data=e=>{this.chunks.push(e.data)};stop=e=>{this.recorder.state!==`inactive`&&(this.ended={endedBy:e,recordingMs:performance.now()-this.startedAtMs},this.recorder.stop(),this.stopTracks())};cancelled=()=>{if(this.recorder.state===`inactive`){this.cleanup(),this.completion.reject(Error(`VoiceID recording was cancelled.`));return}this.stop(`stream_ended`)};startupFailed=()=>{this.cleanup(),this.completion.reject(Error(`Speech detection startup timed out. Please try again.`))};detectorFailed=e=>{this.cleanup(),this.completion.reject(e instanceof Error?e:Error(`Speech detection failed.`))};failed=()=>{this.cleanup(),this.completion.reject(Error(`VoiceID could not record this microphone.`))};interrupted=()=>{this.cleanup(),this.completion.reject(new k)};stopped=()=>{let e=this.ended;if(this.cleanup(),this.signal.aborted){this.completion.reject(Error(`VoiceID recording was cancelled.`));return}if(e===null){this.completion.reject(new k);return}new Blob(this.chunks,{type:this.recorder.mimeType}).arrayBuffer().then(this.complete.bind(this,e),this.completion.reject.bind(this.completion))};complete=(e,t)=>{if(this.signal.aborted){this.completion.reject(Error(`VoiceID recording was cancelled.`));return}this.completion.resolve({bytes:t,recordingMs:e.recordingMs,endedBy:e.endedBy})};async startPauseDetection(){let e=new AudioContext({sampleRate:j});this.audioContext=e;let t=e.resume();if(this.detector=await y(),this.signal.throwIfAborted(),e.sampleRate!==j)throw Error(`Speech detection requires 16 kHz audio.`);await e.audioWorklet.addModule(`/sdk/voiceid/voice-activity-worklet.js`),this.signal.throwIfAborted();let n=new AudioWorkletNode(e,`voice-activity-frames`);this.worklet=n,n.port.onmessage=this.receiveFrame,e.createMediaStreamSource(this.stream).connect(n),n.connect(e.destination),await t}receiveFrame=e=>{if(!(e.data instanceof Float32Array)||e.data.length!==512){this.failed();return}if(this.closed||this.recorder.state!==`recording`){e.data.fill(0);return}if(++this.queuedFrames>32){e.data.fill(0),this.failed();return}this.pending=this.pending.then(this.processFrame.bind(this,e.data)).catch(this.detectorFailed)};async processFrame(e){let t=this.detector;try{if(this.closed||!t)return;let n=await t.probability(e);if(this.closed){t.clear();return}let r=0;for(let t of e)r+=t*t;let i=Math.sqrt(r/e.length),a=n>=.5&&i>=M;this.updateActivity(a),this.onCapture({kind:`activity`,rms:i,speech:a})}finally{e.fill(0),--this.queuedFrames}}updateActivity(e){let t=performance.now();switch(this.activity.kind){case`waiting`:{let n=e?this.activity.activeMs+32:0;this.activity=n>=100?{kind:`speaking`,lastSoundAtMs:t}:{kind:`waiting`,activeMs:n};return}case`speaking`:e?this.activity={kind:`speaking`,lastSoundAtMs:t}:t-this.activity.lastSoundAtMs>=1500&&this.stop(`pause`);return;default:return ce(this.activity)}}stopPauseDetection=()=>{this.closed=!0,this.worklet&&(this.worklet.port.onmessage=null,this.worklet.port.close(),this.worklet.disconnect()),this.worklet=null,this.detector?.clear(),this.detector=null;let e=this.audioContext;this.audioContext=null,e&&e.close().catch(se)};stopTracks(){for(let e of this.stream.getTracks())e.stop()}cleanup(){for(let e of this.stream.getAudioTracks())e.removeEventListener(`ended`,this.interrupted),e.removeEventListener(`mute`,this.interrupted);this.stopPauseDetection(),this.stopTracks(),this.timer!==null&&clearTimeout(this.timer),this.signal.removeEventListener(`abort`,this.cancelled),this.recorder.removeEventListener(`dataavailable`,this.data),this.recorder.removeEventListener(`stop`,this.stopped),this.recorder.removeEventListener(`error`,this.failed)}};async function ae(e,t){let n=await y(),r=-1,i=0,a=0,o=0,s=0,c=0,l=0,u=new Float32Array(512);try{for(let d=0;d<e.length;d+=u.length){t.throwIfAborted(),u.fill(0);let f=Math.min(u.length,e.length-d);u.set(e.subarray(d,d+f));let p=0;for(let e of u)p+=e*e;let m=Math.sqrt(p/f);if(o=Math.max(o,m),!(await n.probability(u)>=.5&&m>=M)){s+=p,c+=f;continue}r<0&&(r=d),i=d+f,a+=f,l+=p}}finally{u.fill(0),n.clear()}let d=Math.sqrt(s/Math.max(1,c)),f=Math.sqrt(l/Math.max(1,a)),p=a&&c?20*Math.log10(Math.max(f,1e-8)/Math.max(d,1e-8)):null,m={backgroundRms:d,speechToBackgroundDb:p,noise:d>=M&&(p===null||p<10)?`high`:c?`normal`:`unknown`},h=a/j*1e3;return r<0||h<600?{kind:`insufficient_audio`,voicedMs:h,peakFrameRms:o,...m}:{kind:`captured`,first:r,last:i,voicedMs:h,peakFrameRms:o,...m}}function oe(e){for(let t=0;t<e.numberOfChannels;t+=1)e.getChannelData(t).fill(0)}function se(){}function ce(e){throw Error(`Unexpected speech activity: ${String(e)}`)}var le,I,ue,L,de,fe,pe,me,he,R,ge,_e,ve,ye,be={},z=[],xe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Se=Array.isArray;function B(e,t){for(var n in t)e[n]=t[n];return e}function Ce(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function we(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?le.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return Te(e,o,r,i,null)}function Te(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ue,__i:-1,__u:0};return i==null&&I.vnode!=null&&I.vnode(a),a}function Ee(e){return e.children}function V(e,t){this.props=e,this.context=t}function De(e,t){if(t==null)return e.__?De(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?De(e):null}function Oe(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],a=B({},t);a.__v=t.__v+1,I.vnode&&I.vnode(a),ze(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??De(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,W(r,a,i),t.__e=t.__=null,a.__e!=n&&ke(a)}}function ke(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),ke(e)}function Ae(e){(!e.__d&&(e.__d=!0)&&L.push(e)&&!je.__r++||de!=I.debounceRendering)&&((de=I.debounceRendering)||fe)(je)}function je(){try{for(var e,t=1;L.length;)L.length>t&&L.sort(pe),e=L.shift(),t=L.length,Oe(e)}finally{L.length=je.__r=0}}function Me(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_=r&&r.__k||z,v=t.length;for(c=Ne(n,t,_,c,v),d=0;d<v;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&_[p.__i]||be,p.__i=d,g=ze(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&He(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),4&p.__u?(c=Pe(p,c,e),f.__e&&=null):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function Ne(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=Te(null,o,null,null,null):Se(o)?o=e.__k[a]=Te(Ee,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=Te(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=Ie(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=De(s)),Ue(s,s));return r}function Pe(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=Pe(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=De(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Fe(e,t){return t||=[],e==null||typeof e==`boolean`||(Se(e)?e.some(function(e){Fe(e,t)}):t.push(e)),t}function Ie(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Le(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||xe.test(t)?n:n+`px`}function H(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Le(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Le(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(ge,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[R]=r[R]:(n[R]=_e,e.addEventListener(t,a?ye:ve,a)):e.removeEventListener(t,a?ye:ve,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Re(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[he]==null)t[he]=_e++;else if(t[he]<n[R])return;return n(I.event?I.event(t):t)}}}function ze(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=I.__b)&&u(t);n:if(typeof E==`function`){d=o.length;try{if(v=t.props,y=E.prototype&&E.prototype.render,b=(u=E.contextType)&&r[u.__c],x=u?b?b.props.value:u.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(y?t.__c=f=new E(v,x):(t.__c=f=new V(v,x),f.constructor=E,f.render=We),b&&b.sub(f),f.state||={},f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&E.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=B({},f.__s)),B(f.__s,E.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&E.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&E.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),z.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f),s=De(n);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__e=!1,S=I.__r,C=0,y)f.state=f.__s,f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),z.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(t),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++C<25);f.state=f.__s,f.getChildContext!=null&&(r=B(B({},r),f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=u!=null&&u.type===Ee&&u.key==null?Be(u.props.children):u,s=Me(e,Se(w)?w:[w],t,n,r,i,a,o,s,c,l),f.base=t.__e,t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__E=f.__=null)}catch(e){if(o.length=d,t.__v=null,c||a!=null){if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a!=null&&(a[a.indexOf(s)]=null),t.__e=s}else if(a!=null)for(T=a.length;T--;)Ce(a[T])}else t.__e=n.__e;t.__k??=n.__k||[],e.then||U(t),I.__e(e,t,n)}}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Ve(n.__e,t,n,r,i,a,o,c,l);return(u=I.diffed)&&u(t),128&t.__u?void 0:s}function U(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(U))}function W(e,t,n){for(var r=0;r<n.length;r++)He(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){I.__e(e,t.__v)}})}function Be(e){return typeof e!=`object`||!e||e.__b>0?e:Se(e)?e.map(Be):e.constructor===void 0?B({},e):null}function Ve(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props||be,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&=(I.__m&&I.__m(t,a),!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=v==`textarea`&&_.defaultValue!=null?null:a&&le.call(e.childNodes),!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],l==`dangerouslySetInnerHTML`?d=p:l==`children`||l in _||l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _||H(e,l,null,p,i);for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||H(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),Me(t.type==`template`?e.content:e,Se(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&De(n,0),s,c),a!=null)for(l=a.length;l--;)Ce(a[l]);s&&v!=`textarea`||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&H(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&H(e,l,h,g[l],i))}return e}function He(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){I.__e(e,n)}}function Ue(e,t,n){var r,i;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||He(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){I.__e(e,t)}r.base=r.__P=r.__n=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ue(r[i],t,n||typeof e.type!=`function`);n||Ce(e.__e),e.__c=e.__=e.__e=void 0}function We(e,t,n){return this.constructor(e,n)}function Ge(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),I.__&&I.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],ze(t,e=(!r&&n||t).__k=we(Ee,null,[e]),i||be,be,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?le.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),W(a,e,o),e.props.children=null}le=z.slice,I={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},ue=0,V.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=B({},this.state);typeof e==`function`&&(e=e(B({},n),this.props)),e&&B(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ae(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ae(this))},V.prototype.render=Ee,L=[],fe=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pe=function(e,t){return e.__v.__b-t.__v.__b},je.__r=0,me=Math.random().toString(8),he=`__d`+me,R=`__a`+me,ge=/(PointerCapture)$|Capture$/i,_e=0,ve=Re(!1),ye=Re(!0);var Ke,G,qe,Je,Ye=0,Xe=[],K=I,Ze=K.__b,Qe=K.__r,$e=K.diffed,et=K.__c,tt=K.unmount,nt=K.__;function rt(e,t){K.__h&&K.__h(G,e,Ye||t),Ye=0;var n=G.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function it(e){return Ye=1,at(_t,e)}function at(e,t,n){var r=rt(Ke++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):_t(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=G,!G.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};G.__f=!0;var a=G.shouldComponentUpdate,o=G.componentWillUpdate;G.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},G.shouldComponentUpdate=i}return r.__N||r.__}function ot(e,t){var n=rt(Ke++,3);!K.__s&>(n.__H,t)&&(n.__=e,n.u=t,G.__H.__h.push(n))}function st(e){return Ye=5,ct(function(){return{current:e}},[])}function ct(e,t){var n=rt(Ke++,7);return gt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function lt(e,t){return Ye=8,ct(function(){return e},t)}function ut(){var e=rt(Ke++,11);if(!e.__){for(var t=G.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||=[0,0];e.__=`P`+n[0]+`-`+ n[1]++}return e.__}function dt(){for(var e;e=Xe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(mt),t.__h.some(ht),t.__h=[]}catch(n){t.__h=[],K.__e(n,e.__v)}}}K.__b=function(e){G=null,Ze&&Ze(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nt&&nt(e,t)},K.__r=function(e){Qe&&Qe(e),Ke=0;var t=(G=e.__c).__H;t&&(qe===G?(t.__h=[],G.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(mt),t.__h.some(ht),t.__h=[],Ke=0)),qe=G},K.diffed=function(e){$e&&$e(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Xe.push(t)!==1&&Je===K.requestAnimationFrame||((Je=K.requestAnimationFrame)||pt)(dt)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),qe=G=null},K.__c=function(e,t){t.some(function(e){try{e.__h.some(mt),e.__h=e.__h.filter(function(e){return!e.__||ht(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],K.__e(n,e.__v)}}),et&&et(e,t)},K.unmount=function(e){tt&&tt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{mt(e)}catch(e){t=e}}),n.__H=void 0,t&&K.__e(t,n.__v))};var ft=typeof requestAnimationFrame==`function`;function pt(e){var t,n=function(){clearTimeout(r),ft&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ft&&(t=requestAnimationFrame(n))}function mt(e){var t=G,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),G=t}function ht(e){var t=G;e.__c=e.__(),G=t}function gt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function _t(e,t){return typeof t==`function`?t(e):t}function vt(e,t){for(var n in t)e[n]=t[n];return e}function yt(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function bt(e,t){this.props=e,this.context=t}(bt.prototype=new V).isPureReactComponent=!0,bt.prototype.shouldComponentUpdate=function(e,t){return yt(this.props,e)||yt(this.state,t)};var xt=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),xt&&xt(e)};var St=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.forward_ref`)||3911;function Ct(e){function t(t){var n=vt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=St,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}var wt=I.__e;I.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k||[]),i.__c(e,t)}wt(e,t,n,r)};var Tt=I.unmount;function Et(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=vt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Et(e,t,n)})),e}function Dt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Dt(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ot(){this.__u=0,this.o=null,this.__b=null}function kt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function At(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Tt&&Tt(e)},(Ot.prototype=new V).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=kt(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Dt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Ot.prototype.componentWillUnmount=function(){this.o=[]},Ot.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Et(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&we(Ee,null,e.fallback);return i&&(i.__u&=-33),[we(Ee,null,t.__a?null:e.children),i]};var jt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(At.prototype=new V).__a=function(e){var t=this,n=kt(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),jt(t,e,r)):i()};n?n(a):a()}},At.prototype.render=function(e){this.i=null,this.l=new Map;var t=Fe(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},At.prototype.componentDidUpdate=At.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){jt(e,n,t)})};var Mt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Nt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Pt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ft=/[A-Z0-9]/g,It=typeof document<`u`,Lt=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Rt=I.event;I.event=function(e){return Rt&&(e=Rt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var zt={configurable:!0,get:function(){return this.class}},Bt=I.vnode;I.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||It&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||Lt(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Pt.test(a)&&(a=s):s=a=`oninput`:i&&Nt.test(a)?a=a.replace(Ft,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=Fe(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=Fe(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,zt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Mt,Bt&&Bt(e)};var Vt=I.__r;I.__r=function(e){Vt&&Vt(e),e.__c};var Ht=I.diffed;I.diffed=function(e){Ht&&Ht(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};var Ut=0;Array.isArray;function q(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ut,__i:-1,__u:0,__source:i,__self:a};if(typeof e==`function`&&(o=e.defaultProps))for(s in o)c[s]===void 0&&(c[s]=o[s]);return I.vnode&&I.vnode(l),l}function Wt(e){let t=e.trim(),n=t.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(n){let e=n[1].length===3?n[1].split(``).map(e=>e+e).join(``):n[1];return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}let r=t.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return r?[Math.round(+r[1]),Math.round(+r[2]),Math.round(+r[3])]:null}function Gt(e){let t=Wt(e);return t?`rgb(${t[0]}, ${t[1]}, ${t[2]})`:null}function Kt(e){let t=Wt(e);return t?`${t[0]}, ${t[1]}, ${t[2]}`:null}const qt={dark:{strokeOpacity:1.16,innerOpacity:.47,bloomOpacity:.89,innerShadow:`rgba(255, 255, 255, 0.1)`,saturation:1.2,brightness:1.1},light:{strokeOpacity:1.2,innerOpacity:.85,bloomOpacity:.5,innerShadow:`rgba(0, 0, 0, 0.08)`,saturation:1.6,brightness:.95,hueRange:40,hueDuration:8.5,hueBase:5,strength:.8,bandStrength:1.7}},Jt=[{x:0,w:74,h:46,band:0},{x:-36,w:54,h:40,band:1},{x:36,w:54,h:40,band:1},{x:-72,w:48,h:32,band:2},{x:72,w:48,h:32,band:2},{x:-108,w:42,h:26,band:1},{x:108,w:42,h:26,band:1}],J=36*Jt.length,Yt={colorful:{dark:[`rgb(255, 70, 120)`,`rgb(60, 190, 255)`,`rgb(175, 70, 255)`,`rgb(60, 220, 130)`,`rgb(255, 150, 40)`,`rgb(90, 100, 255)`,`rgb(40, 200, 190)`],light:[`rgb(255, 201, 21)`,`rgb(126, 196, 255)`,`rgb(180, 40, 230)`,`rgb(235, 100, 160)`,`rgb(255, 176, 122)`,`rgb(154, 160, 255)`,`rgb(127, 217, 238)`]},mono:{dark:[`rgb(215, 215, 215)`,`rgb(180, 180, 180)`,`rgb(190, 190, 190)`,`rgb(160, 160, 160)`,`rgb(170, 170, 170)`,`rgb(150, 150, 150)`,`rgb(155, 155, 155)`],light:[`rgb(60, 60, 60)`,`rgb(90, 90, 90)`,`rgb(85, 85, 85)`,`rgb(110, 110, 110)`,`rgb(105, 105, 105)`,`rgb(125, 125, 125)`,`rgb(120, 120, 120)`]},ocean:{dark:[`rgb(80, 140, 255)`,`rgb(40, 200, 230)`,`rgb(120, 90, 255)`,`rgb(30, 170, 210)`,`rgb(160, 80, 240)`,`rgb(60, 110, 255)`,`rgb(40, 190, 180)`],light:[`rgb(40, 100, 240)`,`rgb(20, 160, 200)`,`rgb(90, 60, 230)`,`rgb(20, 130, 180)`,`rgb(130, 50, 220)`,`rgb(40, 80, 230)`,`rgb(20, 150, 150)`]},sunset:{dark:[`rgb(255, 110, 60)`,`rgb(255, 180, 40)`,`rgb(255, 60, 90)`,`rgb(255, 210, 80)`,`rgb(240, 70, 140)`,`rgb(255, 140, 50)`,`rgb(230, 50, 110)`],light:[`rgb(235, 80, 30)`,`rgb(230, 150, 10)`,`rgb(230, 30, 70)`,`rgb(225, 175, 30)`,`rgb(215, 40, 110)`,`rgb(235, 110, 20)`,`rgb(205, 30, 90)`]},forest:{dark:[`rgb(70, 220, 120)`,`rgb(40, 200, 180)`,`rgb(140, 230, 80)`,`rgb(30, 170, 140)`,`rgb(190, 235, 70)`,`rgb(50, 190, 110)`,`rgb(30, 150, 120)`],light:[`rgb(30, 170, 80)`,`rgb(20, 150, 130)`,`rgb(90, 180, 30)`,`rgb(20, 130, 100)`,`rgb(130, 180, 20)`,`rgb(30, 150, 80)`,`rgb(20, 120, 90)`]},candy:{dark:[`rgb(255, 90, 170)`,`rgb(255, 120, 220)`,`rgb(210, 80, 255)`,`rgb(255, 150, 190)`,`rgb(180, 110, 255)`,`rgb(255, 70, 140)`,`rgb(230, 100, 240)`],light:[`rgb(235, 40, 140)`,`rgb(230, 70, 190)`,`rgb(180, 40, 230)`,`rgb(235, 100, 160)`,`rgb(150, 70, 230)`,`rgb(230, 30, 110)`,`rgb(200, 60, 210)`]},ice:{dark:[`rgb(150, 230, 255)`,`rgb(90, 200, 255)`,`rgb(190, 240, 255)`,`rgb(120, 190, 255)`,`rgb(160, 220, 250)`,`rgb(80, 170, 255)`,`rgb(200, 235, 255)`],light:[`rgb(30, 160, 220)`,`rgb(20, 130, 210)`,`rgb(60, 180, 230)`,`rgb(40, 120, 220)`,`rgb(50, 160, 220)`,`rgb(20, 110, 220)`,`rgb(70, 170, 230)`]},gold:{dark:[`rgb(255, 200, 70)`,`rgb(255, 170, 40)`,`rgb(255, 220, 110)`,`rgb(240, 150, 30)`,`rgb(255, 235, 140)`,`rgb(230, 160, 40)`,`rgb(250, 210, 90)`],light:[`rgb(200, 140, 10)`,`rgb(190, 120, 0)`,`rgb(210, 160, 30)`,`rgb(180, 110, 0)`,`rgb(205, 170, 40)`,`rgb(175, 115, 5)`,`rgb(195, 150, 20)`]}};function Xt(e,t){let n=e.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);return n?`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t.toFixed(2)})`:e}function Zt(e,t=1){return Math.max(.5,Math.round(e*t*100)/100)}function Qt(e,t){return`calc(50% + (var(--vb-cx-${t}) + var(--vb-x${e}-${t})) * var(--vb-w-${t}) * var(--vb-z-${t}, 1))`}function $t({id:e,colors:t,alpha:n,sw:r,sh:i,y:a,fade:o,count:s}){return(s?Jt.slice(0,s):Jt).map((s,c)=>{let l=n>=1?t[c%t.length]:Xt(t[c%t.length],n),u=`calc(${Math.round(s.w*r)}px * var(--vb-w-${e}) * var(--vb-z-${e}, 1))`,d=`calc(${Math.round(s.h*i)}px * var(--vb-h-${e}) * var(--vb-l${c}-${e}) * var(--vb-z-${e}, 1))`,f=`calc(100% + (${a}px + var(--vb-y${c}-${e})) * var(--vb-z-${e}, 1))`;return`radial-gradient(ellipse ${u} ${d} at ${Qt(c,e)} ${f}, ${l} 0%, transparent ${o}%)`}).join(`,
|
|
2
|
+
`)}function en(e){let{id:t,borderRadius:n,borderWidth:r,strokeOpacity:i,innerOpacity:a,bloomOpacity:o,innerShadow:s,colorVariant:c,colors:l,brightness:u,saturation:d,theme:f,hueBase:p=0,glowSize:m=1,glowWidth:h=1,glowHeight:g=1,strokeScale:_=1,innerScale:v=1,innerHeight:y=1,bloomScale:b=1,bloomHeight:x=1,coreSize:S=1,coreLight:C=0,coreLightWidth:w=1,coreLightHeight:T=1,rangeWidth:E=1,rangeHeight:ee=1,softness:te=1,distortion:D=!1,scale:O=1}=e,k=Math.round(28*O*10)/10,ne=Math.round(9*O*10)/10,A=Math.max(0,n-r),j=Math.round(Math.max(40,Math.min(95,70*te))),M=e=>h*e,re=e=>g*e,N=e=>Math.round(e*10)/10,P=`var(--vb-z-${t}, 1)`,F=e=>`calc(${N(e)}px * ${P})`,ie=f===`dark`,ae=Yt[c][ie?`dark`:`light`].map((e,t)=>{let n=l?.[t];return n&&Gt(n)||e}),oe=c===`mono`?.6:1,se=(i*oe).toFixed(2),ce=(a*oe).toFixed(2),le=(o*oe).toFixed(2),I=u.toFixed(2),ue=d.toFixed(2),L=`hue-rotate(calc(var(--voice-hue-base, ${p}deg) + var(--vb-hue-${t})))`,de=D?` url(#vb-distort-${t})`:``,fe=`filter: ${L} brightness(${I}) saturate(${ue});`,pe=`filter: ${L} brightness(${I}) saturate(${ue})${de};`,me=`filter: blur(${F(Zt(10,m))}) ${L} brightness(${I}) saturate(${ue});`,he=`filter: blur(${F(Zt(10,m))}) ${L} brightness(${I}) saturate(${ue})${de};`,R=`calc(50% + var(--vb-cx-${t}) * var(--vb-w-${t}) * ${P})`,ge=`calc(100% + (2px + var(--vb-cy-${t})) * ${P})`,_e=ie?`radial-gradient(ellipse calc(${N(30*S)}px * var(--vb-w-${t}) * ${P}) calc(${N(30*S)}px * var(--vb-h-${t}) * ${P}) at ${R} ${ge}, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.14) 30%, transparent 65%)`:`radial-gradient(ellipse calc(${N(40*S)}px * var(--vb-w-${t}) * ${P}) calc(${N(30*S)}px * var(--vb-h-${t}) * ${P}) at ${R} ${ge}, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.22) 35%, transparent 70%)`,ve=$t({id:t,colors:ae,alpha:1,sw:M(_),sh:re(_),y:2,fade:j}),ye=$t({id:t,colors:ae,alpha:.46,sw:M(.9*v),sh:re(.9*v*y),y:0,fade:j}),be=$t({id:t,colors:ae,alpha:ie?.9:.7,sw:M(1.15*b),sh:re(1.5*b*x),y:0,fade:Math.min(95,j+2)}),z=(e,n,r,i=0)=>`radial-gradient(ellipse calc(${N(e*E)}px * var(--vb-w-${t}) * var(--vb-mw-${t}) * ${P}) calc((${N(n*ee)}px * var(--vb-h-${t}) + var(--vb-bh-${t})) * ${P}) at ${R} calc(100% + var(--vb-cy-${t}) * ${P}), white 0%, rgba(255, 255, 255, 0.5) ${r}%${i>0?`, rgba(255, 255, 255, ${i}) 85%`:``}, transparent 100%)`,xe=(e,n)=>`opacity: calc(var(--vb-opacity-${t}, 1) * var(--vb-glow-${t}) * ${n} * var(--voice-${e}-opacity, 1) * var(--voice-strength, 1));`,Se=(e,t,r,i)=>`${e} {
|
|
3
|
+
${t}
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
border-radius: ${F(n)};
|
|
7
|
+
background: ${ye};
|
|
8
|
+
box-shadow: inset 0 0 ${F(ne)} 1px ${s};
|
|
9
|
+
-webkit-mask-image:
|
|
10
|
+
${z(170,64,45,.3)},
|
|
11
|
+
linear-gradient(white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white),
|
|
12
|
+
linear-gradient(to right, white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white);
|
|
13
|
+
-webkit-mask-composite: source-in, source-over;
|
|
14
|
+
mask-image:
|
|
15
|
+
${z(170,64,45,.3)},
|
|
16
|
+
linear-gradient(white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white),
|
|
17
|
+
linear-gradient(to right, white, transparent ${F(k)}, transparent calc(100% - ${k}px * ${P}), white);
|
|
18
|
+
mask-composite: intersect, add;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
/* Its own compositing layer: WebKit otherwise re-rasterizes the
|
|
21
|
+
filtered layer into the parent every frame on the CPU (a phone-sized
|
|
22
|
+
host runs at a sixth of the frame rate without this). */
|
|
23
|
+
will-change: transform;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
${r}
|
|
26
|
+
${xe(`inner`,ce)}
|
|
27
|
+
${i}
|
|
28
|
+
}`;return`
|
|
29
|
+
@property --vb-opacity-${t} {
|
|
30
|
+
syntax: "<number>";
|
|
31
|
+
initial-value: 0;
|
|
32
|
+
inherits: true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-voice-beam="${t}"] {
|
|
36
|
+
position: relative;
|
|
37
|
+
border-radius: ${n}px;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
--vb-h-${t}: 0.8;
|
|
40
|
+
--vb-w-${t}: 1;
|
|
41
|
+
${Jt.map((e,n)=>` --vb-x${n}-${t}: ${e.x}px;
|
|
42
|
+
--vb-l${n}-${t}: 1;
|
|
43
|
+
--vb-y${n}-${t}: 0px;`).join(`
|
|
44
|
+
`)}
|
|
45
|
+
--vb-glow-${t}: 0.4;
|
|
46
|
+
--vb-z-${t}: 1;
|
|
47
|
+
--vb-cx-${t}: 0px;
|
|
48
|
+
--vb-cy-${t}: 0px;
|
|
49
|
+
--vb-bh-${t}: 0px;
|
|
50
|
+
--vb-bendA-${t}: 0;
|
|
51
|
+
--vb-mw-${t}: 1;
|
|
52
|
+
--vb-hue-${t}: 0deg;
|
|
53
|
+
--vb-level-${t}: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[data-voice-beam="${t}"][data-active] {
|
|
57
|
+
animation: vb-fade-in-${t} 0.6s ease forwards;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-voice-beam="${t}"][data-fading] {
|
|
61
|
+
animation: vb-fade-out-${t} 0.5s ease forwards;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Stroke — the colours painted into the 1px edge ring, masked to the centred ellipse. */
|
|
65
|
+
[data-voice-beam="${t}"][data-active]::after,
|
|
66
|
+
[data-voice-beam="${t}"][data-fading]::after {
|
|
67
|
+
content: "";
|
|
68
|
+
position: absolute;
|
|
69
|
+
inset: 0;
|
|
70
|
+
border-radius: ${F(A)};
|
|
71
|
+
padding: ${F(r)};
|
|
72
|
+
clip-path: inset(0 round ${F(n)});
|
|
73
|
+
background:
|
|
74
|
+
${_e},
|
|
75
|
+
${ve};
|
|
76
|
+
-webkit-mask:
|
|
77
|
+
${z(170,64,45)},
|
|
78
|
+
linear-gradient(#fff 0 0) content-box,
|
|
79
|
+
linear-gradient(#fff 0 0);
|
|
80
|
+
-webkit-mask-composite: source-in, xor;
|
|
81
|
+
mask:
|
|
82
|
+
${z(170,64,45)},
|
|
83
|
+
linear-gradient(#fff 0 0) content-box,
|
|
84
|
+
linear-gradient(#fff 0 0);
|
|
85
|
+
mask-composite: intersect, exclude;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
/* Its own compositing layer: WebKit otherwise re-rasterizes the
|
|
88
|
+
filtered layer into the parent every frame on the CPU (a phone-sized
|
|
89
|
+
host runs at a sixth of the frame rate without this). */
|
|
90
|
+
will-change: transform;
|
|
91
|
+
z-index: 2;
|
|
92
|
+
${xe(`stroke`,se)}
|
|
93
|
+
${fe}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Inner glow — soft light inside the element, faded off at the corners.
|
|
97
|
+
With distortion on, this copy is clipped to ABOVE the band line (the
|
|
98
|
+
polygon the driver writes each frame) and a mirror layer below carries
|
|
99
|
+
the displacement filter, so only the glow under the line warps. */
|
|
100
|
+
${Se(`[data-voice-beam="${t}"][data-active]::before,
|
|
101
|
+
[data-voice-beam="${t}"][data-fading]::before`,`content: "";`,D?`clip-path: var(--vb-clip-above-${t}, inset(0 round ${n}px));`:`clip-path: inset(0 round ${n}px);`,fe)}
|
|
102
|
+
${D?Se(`[data-voice-beam="${t}"][data-active] [data-voice-beam-warp="inner"],
|
|
103
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-warp="inner"]`,`display: block;`,`clip-path: var(--vb-clip-below-${t}, inset(0 round ${n}px));`,pe):``}
|
|
104
|
+
|
|
105
|
+
/* Bloom — the blurred halo, tallest of the three, above the content. */
|
|
106
|
+
[data-voice-beam="${t}"] [data-voice-beam-bloom],
|
|
107
|
+
[data-voice-beam="${t}"] [data-voice-beam-warp] {
|
|
108
|
+
display: none;
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
border-radius: ${F(A)};
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
/* Its own compositing layer: WebKit otherwise re-rasterizes the
|
|
114
|
+
filtered layer into the parent every frame on the CPU (a phone-sized
|
|
115
|
+
host runs at a sixth of the frame rate without this). */
|
|
116
|
+
will-change: transform;
|
|
117
|
+
opacity: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-voice-beam="${t}"] [data-voice-beam-bloom],
|
|
121
|
+
[data-voice-beam="${t}"] [data-voice-beam-warp="bloom"] {
|
|
122
|
+
-webkit-mask: ${z(200,130,35)};
|
|
123
|
+
mask: ${z(200,130,35)};
|
|
124
|
+
background: ${be};
|
|
125
|
+
z-index: 3;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-bloom],
|
|
129
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-bloom] {
|
|
130
|
+
display: block;
|
|
131
|
+
clip-path: ${D?`var(--vb-clip-above-${t}, inset(0 round ${n}px))`:`inset(0 round ${n}px)`};
|
|
132
|
+
${xe(`bloom`,le)}
|
|
133
|
+
${me}
|
|
134
|
+
}
|
|
135
|
+
${D?`
|
|
136
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-warp="bloom"],
|
|
137
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-warp="bloom"] {
|
|
138
|
+
display: block;
|
|
139
|
+
clip-path: var(--vb-clip-below-${t}, inset(0 round ${n}px));
|
|
140
|
+
${xe(`bloom`,le)}
|
|
141
|
+
${he}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Processing drops the distortion: the driver marks the wrapper once the
|
|
145
|
+
warp has faded out, the warp layers leave the paint and the base layers
|
|
146
|
+
give up their split at the band line. */
|
|
147
|
+
[data-voice-beam="${t}"][data-voice-warp="off"]::before,
|
|
148
|
+
[data-voice-beam="${t}"][data-voice-warp="off"] [data-voice-beam-bloom] {
|
|
149
|
+
clip-path: inset(0 round ${n}px);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[data-voice-beam="${t}"][data-voice-warp="off"] [data-voice-beam-warp] {
|
|
153
|
+
display: none;
|
|
154
|
+
}`:``}
|
|
155
|
+
|
|
156
|
+
/* Epicentre — a soft white wash at the source, under the band line (the
|
|
157
|
+
driver's clip; unclipped when no line is drawn), sitting above every
|
|
158
|
+
glow layer and the band's halo so the centre reads lighter than the
|
|
159
|
+
band (same z as the band canvases, painted after them). Sized by the voice like the
|
|
160
|
+
other layers; off unless \`coreLight\` is set (the light theme sets it).
|
|
161
|
+
Up to 1 it is the wash's opacity; past 1 the solid white core widens
|
|
162
|
+
too, for a centre that stays lighter than a strong band. It follows the
|
|
163
|
+
glow's presence but not \`strength\`, which would only dim it. */
|
|
164
|
+
${C>0?(()=>{let e=Math.max(0,Math.min(2,C-1)),n=Math.min(1,e),r=Math.max(0,e-1),i=1+.3*e,a=N(45*n+27*r),o=N(40+25*n+15*r),s=Math.min(1,.55+.35*n+.1*r).toFixed(2),c=N(72+14*n+8*r);return`[data-voice-beam="${t}"] [data-voice-beam-core] {
|
|
165
|
+
display: none;
|
|
166
|
+
position: absolute;
|
|
167
|
+
inset: 0;
|
|
168
|
+
border-radius: ${F(A)};
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
/* Its own compositing layer: WebKit otherwise re-rasterizes the
|
|
172
|
+
filtered layer into the parent every frame on the CPU (a phone-sized
|
|
173
|
+
host runs at a sixth of the frame rate without this). */
|
|
174
|
+
will-change: transform;
|
|
175
|
+
/* The blur sits on this wrapper and the band-line clip on the child,
|
|
176
|
+
so the cut edge is blurred too rather than left hard. */
|
|
177
|
+
filter: blur(${F(Zt(8,m))});
|
|
178
|
+
z-index: 4;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
[data-voice-beam="${t}"] [data-voice-beam-core] > div {
|
|
182
|
+
position: absolute;
|
|
183
|
+
inset: 0;
|
|
184
|
+
background: radial-gradient(ellipse calc(${N(120*w*i*O)}px * var(--vb-w-${t}) * ${P}) calc((${N(70*T*i*O)}px * var(--vb-h-${t}) + var(--vb-bh-${t})) * ${P}) at ${R} calc(100% + var(--vb-cy-${t}) * ${P}), white 0%, white ${a}%, rgba(255, 255, 255, ${s}) ${o}%, transparent ${c}%);
|
|
185
|
+
clip-path: var(--vb-clip-below-${t}, none);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-core],
|
|
189
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-core] {
|
|
190
|
+
display: block;
|
|
191
|
+
opacity: calc(var(--vb-opacity-${t}, 1) * min(1, var(--vb-glow-${t}) * ${Math.min(1,C).toFixed(2)} * ${(1.6+1.4*e).toFixed(2)}) * var(--voice-core-light-opacity, 1));
|
|
192
|
+
}
|
|
193
|
+
`})():``}
|
|
194
|
+
/* Band — the canvas the driver draws the bend's contour on: an organic
|
|
195
|
+
bell with chromatic fringes. Fades with the root, follows the strength
|
|
196
|
+
and turns with the hue drift like the other layers. */
|
|
197
|
+
[data-voice-beam="${t}"] [data-voice-beam-band],
|
|
198
|
+
[data-voice-beam="${t}"] [data-voice-beam-band-halo] {
|
|
199
|
+
display: none;
|
|
200
|
+
position: absolute;
|
|
201
|
+
inset: 0;
|
|
202
|
+
width: 100%;
|
|
203
|
+
height: 100%;
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
/* Its own compositing layer: WebKit otherwise re-rasterizes the
|
|
206
|
+
filtered layer into the parent every frame on the CPU (a phone-sized
|
|
207
|
+
host runs at a sixth of the frame rate without this). */
|
|
208
|
+
will-change: transform;
|
|
209
|
+
z-index: 4;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-band],
|
|
213
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-band],
|
|
214
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-band-halo],
|
|
215
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-band-halo] {
|
|
216
|
+
display: block;
|
|
217
|
+
opacity: calc(var(--vb-opacity-${t}, 1) * var(--voice-band-opacity, 1) * var(--voice-strength, 1));
|
|
218
|
+
/* The blur vars are 0 where the canvas blurs its own strokes; where the
|
|
219
|
+
2D context has no filter (WebKit) the driver sets them and the layers
|
|
220
|
+
are blurred here instead — the ridge on the band canvas, its wider
|
|
221
|
+
halo on the canvas beneath. */
|
|
222
|
+
filter: blur(var(--vb-band-blur-${t}, 0px)) ${L} brightness(${I}) saturate(${ue});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
[data-voice-beam="${t}"][data-active] [data-voice-beam-band-halo],
|
|
226
|
+
[data-voice-beam="${t}"][data-fading] [data-voice-beam-band-halo] {
|
|
227
|
+
filter: blur(var(--vb-band-halo-blur-${t}, 0px)) ${L} brightness(${I}) saturate(${ue});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Resolution. The soft layers — inner light and its warp mirror, bloom and
|
|
231
|
+
its mirror, the epicentre — are rastered at half size and scaled back
|
|
232
|
+
up by the compositor: the box is halved, every length inside rides the
|
|
233
|
+
layer's factor \`--vb-z\` at 0.5 (the driver also writes the band-line
|
|
234
|
+
clips at half scale), and the will-change transform is rastered
|
|
235
|
+
pre-scale where the engine does that (Chromium, Safari 18). For blurred
|
|
236
|
+
gradients that is the same picture at a quarter of the raster and
|
|
237
|
+
filter work, which is what a phone at 3x runs out of. The 1px stroke
|
|
238
|
+
stays full-res on every screen: at half size it is half a CSS pixel,
|
|
239
|
+
which a 3x phone rasters into a faint smear instead of the hairline,
|
|
240
|
+
and the layer is cheap (no blur). The component sets
|
|
241
|
+
\`data-voice-halfres\`. */
|
|
242
|
+
[data-voice-beam="${t}"][data-voice-halfres]::before,
|
|
243
|
+
[data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-warp],
|
|
244
|
+
[data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-bloom],
|
|
245
|
+
[data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-core] {
|
|
246
|
+
--vb-z-${t}: 0.5;
|
|
247
|
+
inset: auto;
|
|
248
|
+
left: 0;
|
|
249
|
+
top: 0;
|
|
250
|
+
width: 50%;
|
|
251
|
+
height: 50%;
|
|
252
|
+
transform: translateZ(0) scale(2);
|
|
253
|
+
transform-origin: 0 0;
|
|
254
|
+
}
|
|
255
|
+
${D?`[data-voice-beam="${t}"][data-voice-halfres][data-active]::before,
|
|
256
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-fading]::before,
|
|
257
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-bloom],
|
|
258
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-bloom] {
|
|
259
|
+
clip-path: var(--vb-clip-above-z-${t}, inset(0 round ${F(n)}));
|
|
260
|
+
}
|
|
261
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-warp],
|
|
262
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-warp] {
|
|
263
|
+
clip-path: var(--vb-clip-below-z-${t}, inset(0 round ${F(n)}));
|
|
264
|
+
}
|
|
265
|
+
/* Processing (warp off): the mirrors are gone, so the base layers paint
|
|
266
|
+
the whole box again — this must outweigh the split above. */
|
|
267
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-voice-warp="off"]::before,
|
|
268
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-voice-warp="off"] [data-voice-beam-bloom] {
|
|
269
|
+
clip-path: inset(0 round ${F(n)});
|
|
270
|
+
}`:`[data-voice-beam="${t}"][data-voice-halfres][data-active]::before,
|
|
271
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-fading]::before,
|
|
272
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-active] [data-voice-beam-bloom],
|
|
273
|
+
[data-voice-beam="${t}"][data-voice-halfres][data-fading] [data-voice-beam-bloom] {
|
|
274
|
+
clip-path: inset(0 round ${F(n)});
|
|
275
|
+
}`}
|
|
276
|
+
[data-voice-beam="${t}"][data-voice-halfres] [data-voice-beam-core] > div {
|
|
277
|
+
clip-path: var(--vb-clip-below-z-${t}, none);
|
|
278
|
+
}
|
|
279
|
+
@keyframes vb-fade-in-${t} {
|
|
280
|
+
to { --vb-opacity-${t}: 1; }
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@keyframes vb-fade-out-${t} {
|
|
284
|
+
from { --vb-opacity-${t}: 1; }
|
|
285
|
+
to { --vb-opacity-${t}: 0; }
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
[data-voice-beam="${t}"][data-paused],
|
|
289
|
+
[data-voice-beam="${t}"][data-paused]::after,
|
|
290
|
+
[data-voice-beam="${t}"][data-paused]::before,
|
|
291
|
+
[data-voice-beam="${t}"][data-paused] [data-voice-beam-bloom] {
|
|
292
|
+
animation-play-state: paused !important;
|
|
293
|
+
}
|
|
294
|
+
`}let tn=null;function nn(){if(typeof window>`u`)return null;let e=window;return e.AudioContext??e.webkitAudioContext??null}function rn(){let e=nn();return e?(tn||=new e,tn.state===`suspended`&&tn.resume().catch(()=>{}),tn):null}const an=new WeakMap;function on(e){let t=rn();if(!t||e.getAudioTracks().length===0)return null;let n=an.get(e);n||(n={node:t.createMediaStreamSource(e),refs:0},an.set(e,n)),n.refs+=1;let r=t.createAnalyser();r.fftSize=1024,r.smoothingTimeConstant=.5,n.node.connect(r);let i=!1;return{analyser:r,release:()=>{if(!i){i=!0;try{n.node.disconnect(r)}catch{}if(--n.refs,n.refs<=0){try{n.node.disconnect()}catch{}an.delete(e)}}}}}const sn=new WeakMap;function cn(e){let t=sn.get(e);return t||(t={level:0,bands:[0,0,0],phase:0,scanA:0,scanT:0,t:0,lastTs:0,warp:1},sn.set(e,t)),t}const ln=new Set;let un=null,dn=0,fn=0,pn=!1,mn=!1,hn=0,gn=0;const _n=Math.PI*2,vn=[[80,300],[300,2e3],[2e3,6e3]];function yn(e){return e<0?0:e>1?1:e}function bn(e,t){let n=t/2;return((e+n)%t+t)%t-n}function xn(e,t){let n=e/(t/2+4);return Math.max(0,1-n*n)}function Sn(e,t){if(e<=t)return 0;let n=(e-t)/Math.max(.001,1-t);return yn((1-Math.exp(-3*n))/(1-Math.exp(-3)))}function Cn(e,t,n,r,i){let a=t>e?r:i,o=1-Math.exp(-n/Math.max(.001,a));return e+(t-e)*o}const wn=!(typeof navigator<`u`&&/AppleWebKit/.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\/|OPR\//.test(navigator.userAgent)),Tn=.05,En=.1;function Dn(e,t,n,r){let i=e<0?1-r:1+r,a=Math.max(.05,n*i),o=Math.exp(-((Math.abs(e)/a)**+t)),s=Math.exp(-((1/a)**t));return Math.max(0,(o-s)/(1-s))}function On(e,t,n,r,i){if(n<=0||t<=0)return 0;let a=t*Math.max(0,Math.min(.98,r));return e<=a?0:n*Math.min(1,(e-a)/Math.max(1,t-a))**+Math.max(.5,i)}function kn(e,t,n){return Math.max(0,Math.min(e,t/2,n/2))}function An(e,t,n,r=0){if(n<=0)return 0;let i=Math.min(e,t-e)-r;if(i>=n)return 0;if(i<=0)return n;let a=n-i;return n-Math.sqrt(Math.max(0,n*n-a*a))}function jn(e,t,n,r){let i=n/2+t.cx*t.w,a=170*e.rangeWidth*t.w*t.mw,o=r*.82*Math.min(1,e.scale),s=Math.min(o,(64*e.rangeHeight*t.h+t.lift)*e.bandPosition),c=r-e.bandOffset,l=Math.min(1,t.corner*4),u=e.bandTail*(1-l*l*(3-2*l)),d=u>.001,f=d?e.bandTailOverflow:0,p=d?-f:i-a,m=d?n+f:i+a,h=[];for(let o=0;o<=56;o++){let l=p+(m-p)*o/56,d=Math.max(-1,Math.min(1,(l-i)/Math.max(1,a))),g=(l<i?i:n-i)+f,_=Dn(d,e.bandCurve,e.bandSpread,e.bandSkew)+On(Math.abs(l-i),g,u,e.bandTailPosition,e.bandTailCurve),v=t.corner>0?An(l,n,kn(e.radius,n,r))*t.corner:0;h.push([l,c-s*_-v])}return h}function Mn(e,t,n,r,i){for(let[a,o]of[[``,1],[`-z`,.5]]){let s=e=>(e*o).toFixed(1)+`px`,c=n.map(([e,t])=>`${s(e)} ${s(t)}`),l=`polygon(0 ${s(i)}, ${c.join(`, `)}, ${s(r)} ${s(i)})`,u=`polygon(0 0, ${s(r)} 0, ${s(r)} ${s(i)}, ${c.slice().reverse().join(`, `)}, 0 ${s(i)})`;e.style.setProperty(`--vb-clip-below${a}-${t}`,l),e.style.setProperty(`--vb-clip-above${a}-${t}`,u)}}function Nn(e,t,n){let r=n;for(let e=0;e<t.length;e++)t[e][1]<r&&(r=t[e][1]);let i=Math.max(0,Math.min(.9,Math.floor((r-6)/n/Tn)*Tn));if(i===e.filterTop)return;e.filterTop=i;let a=1+Math.max(.1,12/n),o=e.filter;o.setAttribute(`x`,`${-En*100}%`),o.setAttribute(`width`,`${(1+2*En)*100}%`),o.setAttribute(`y`,`${(i*100).toFixed(0)}%`),o.setAttribute(`height`,`${((a-i)*100).toFixed(1)}%`)}function Pn(e,t,n){let{canvas:r,ctx:i,el:a,config:o}=e;if(!r||!i)return;let s=a.clientWidth,c=a.clientHeight;if(!s||!c)return;let l=Math.min(2,typeof window<`u`&&window.devicePixelRatio||1),u=Math.round(s*l),d=Math.round(c*l);(r.width!==u||r.height!==d)&&(r.width=u,r.height=d),i.setTransform(l,0,0,l,0,0),i.clearRect(0,0,s,c);let f=e.haloCanvas,p=e.haloCtx;f&&p&&((f.width!==u||f.height!==d)&&(f.width=u,f.height=d),p.setTransform(l,0,0,l,0,0),p.clearRect(0,0,s,c));let m=Math.min(1,.6*o.bandStrength*t.strength);if(m<.005||o.bandWidth<=0)return;let h=o.theme===`dark`,g=o.bandWidth*(1+.35*t.level),_=o.bandAberration*(.35+.65*t.level),v=(4+12*_)*o.scale,y=4*_*o.scale,b=(e,t)=>{i.beginPath(),i.moveTo(n[0][0]+e,n[0][1]+t);for(let r=1;r<n.length;r++)i.lineTo(n[r][0]+e,n[r][1]+t)},x={r:o.bandColors.above,g:o.bandColors.mid,c:o.bandColors.core,b:o.bandColors.below},S=(h?.42:.4)*m,C=14*g,w=3.5*o.bandWidth/2,T=w*l,E=typeof i.filter==`string`,ee=E?`0px`:`${w.toFixed(2)}px`;e.cssBlur!==ee&&(a.style.setProperty(`--vb-band-blur-${o.id}`,ee),a.style.setProperty(`--vb-band-halo-blur-${o.id}`,E?`0px`:`${(w*3).toFixed(2)}px`),e.cssBlur=ee);let te=[[1,.16],[.72,.2],[.46,.26],[.22,.34]],D=[{rgb:x.r,a:1,ox:y,oy:-v},{rgb:x.g,a:.55,ox:y*.35,oy:-v*.35},{rgb:x.b,a:1,ox:-y,oy:v},{rgb:x.c,a:.9,ox:0,oy:0}];i.lineCap=`round`,i.lineJoin=`round`,i.globalCompositeOperation=`source-over`;let O=n[0][0],k=n[n.length-1][0],ne=(e,t)=>{let n=i.createLinearGradient(O,0,k,0),r=o.bandTail>0?.015:.18;return n.addColorStop(0,`rgba(${e}, 0)`),n.addColorStop(r,`rgba(${e}, ${t.toFixed(3)})`),n.addColorStop(1-r,`rgba(${e}, ${t.toFixed(3)})`),n.addColorStop(1,`rgba(${e}, 0)`),n},A=!E&&p?p:i;E&&(i.filter=`blur(${(T*3).toFixed(1)}px)`),A.lineCap=`round`,A.lineJoin=`round`,A.strokeStyle=ne(x.c,S*.3),A.lineWidth=C*2.2,A.beginPath(),A.moveTo(n[0][0],n[0][1]);for(let e=1;e<n.length;e++)A.lineTo(n[e][0],n[e][1]);A.stroke(),E&&(i.filter=`blur(${T.toFixed(1)}px)`);for(let e of D)for(let[t,n]of te)i.strokeStyle=ne(e.rgb,S*e.a*n),i.lineWidth=Math.max(.6,C*t),b(e.ox,e.oy),i.stroke();E&&(i.filter=`none`),i.globalCompositeOperation=`source-over`}function Fn(e){return(1-Math.cos(_n*e))/2}function In(e,t){let n=e.analyser,r=e.time,i=e.freq;n.getFloatTimeDomainData(r);let a=0;for(let e=0;e<r.length;e++)a+=r[e]*r[e];t.level=Math.sqrt(a/r.length)*5*e.config.sensitivity,n.getByteFrequencyData(i);let o=n.context.sampleRate/n.fftSize;for(let n=0;n<3;n++){let[r,a]=vn[n],s=Math.max(0,Math.floor(r/o)),c=Math.min(i.length-1,Math.ceil(a/o)),l=0;for(let e=s;e<=c;e++)l+=i[e];let u=c>=s?l/(c-s+1)/255:0;t.bands[n]=u*1.7*e.config.sensitivity}}const Ln={level:0,bands:[0,0,0]};function Rn(e){un=requestAnimationFrame(Rn);let t=fn?e-fn:0;if(fn=e,pn){if(mn=!mn,mn)return;e>=gn&&(pn=!1,hn=0)}else t>22?hn?e-hn>500&&(pn=!0,mn=!1,gn=e+4e3):hn=e:hn=0;e-dn<14.666666666666668||(dn=e,ln.forEach(t=>{var n;let{el:r,config:i,source:a,s:o}=t,s=i.paused;if(s&&t.paintedConfig===i)return;let c=s?0:o.lastTs?Math.min(.05,(e-o.lastTs)/1e3):1/60;o.lastTs=e,o.t+=c;let l=o.t;if(!s)if(t.analyser)In(t,Ln);else{let e=a.getLevel?yn(a.getLevel()):0;Ln.level=e,Ln.bands[0]=e,Ln.bands[1]=e*(.72+.28*Math.sin(l*9.1)),Ln.bands[2]=e*(.6+.4*Math.sin(l*13.7+2))}let u=Sn(Ln.level,i.threshold);o.level=Cn(o.level,u,c,i.attack,i.release);for(let e=0;e<3;e++){let t=Sn(Ln.bands[e],i.threshold*.6);o.bands[e]=Cn(o.bands[e],t,c,i.attack,i.release*1.15)}let d=J*i.lobeSpacing;i.processing&&o.scanA<.001&&o.scanT===0&&(o.scanT=Math.max(.05,i.processingDuration)/2);let f=Math.max(.05,i.processingEase);o.scanA=Cn(o.scanA,i.processing?1:0,c,f*.9,f*.8),i.processing?o.scanT+=c:o.scanA<.001&&(o.scanT=0);let p=o.scanA*o.scanA*(3-2*o.scanA),m=r.clientWidth,h=r.clientHeight,g=d/2*i.processingTravel,_=o.scanT/Math.max(.05,i.processingDuration),v=Math.floor(_),y=_-v,b=Math.max(1,i.processingCurve),x=y<.5?.5*(2*y)**b:1-.5*(2-2*y)**b,S=i.reducedMotion?0:v%2==0?2*x-1:1-2*x,C=p*g*S,w=1-p*.6,T=1-p*.45,E=1+p*.3*(1-S*S),ee=i.reducedMotion?.5:.5+.5*Math.sin(_n*l/i.breatheDuration),te=o.level+(1-o.level)*i.idle*ee,D=Math.max(0,Math.min(1,(p-.25)/.75)),O=D*D*(3-2*D),k=Math.max(te,i.processingLevel*O),ne=.15+.85*k,A=.5+i.reach*k,j=(.85+i.spread*k)*E;i.flow!==0&&!i.reducedMotion&&(o.phase=((o.phase+i.flow*k*c)%d+d)%d),r.style.setProperty(`--vb-level-${i.id}`,o.level.toFixed(3)),r.style.setProperty(`--vb-cx-${i.id}`,`${C.toFixed(1)}px`),r.style.setProperty(`--vb-mw-${i.id}`,T.toFixed(3));let M=i.bend*k;r.style.setProperty(`--vb-bh-${i.id}`,`${Math.max(0,M).toFixed(1)}px`);let re=i.bend>0?Math.min(1,M/i.bend):0;r.style.setProperty(`--vb-bendA-${i.id}`,re.toFixed(3));let N={cx:C,w:j,h:A,mw:T,lift:M,strength:re,level:o.level,corner:p},P=m/2+C*j,F=30*i.scale*j,ie=kn(i.radius,m,h),ae=p*i.cornerFollow;r.style.setProperty(`--vb-cy-${i.id}`,`${(-An(P,m,ie,F*1.4)*ae).toFixed(1)}px`),o.warp=Cn(o.warp,i.processing?0:1,c,.35,.06);let oe=o.warp,se=t.displace!=null&&oe<.03;if(se!==t.warpOff&&(t.warpOff=se,se?r.setAttribute(`data-voice-warp`,`off`):r.removeAttribute(`data-voice-warp`)),m&&h&&(t.ctx||t.displace)){let e=jn(i,N,m,h);(t.displace&&!se||i.coreLight>0)&&Mn(r,i.id,e,m,h),t.filter&&!se&&wn&&Nn(t,e,h),t.ctx&&Pn(t,N,e)}if(t.displace&&!se){let e=i.reducedMotion?0:i.distortion*120*i.scale*(.15+.85*k)*oe;t.displace.scale.baseVal=e,t.noiseShift&&(t.noiseShift.dx.baseVal=8*i.scale*Math.sin(l*.9),t.noiseShift.dy.baseVal=4*i.scale*Math.sin(l*.6+1.3))}r.style.setProperty(`--vb-glow-${i.id}`,ne.toFixed(3)),r.style.setProperty(`--vb-h-${i.id}`,A.toFixed(3)),r.style.setProperty(`--vb-w-${i.id}`,j.toFixed(3));for(let e=0;e<Jt.length;e++){let t=Jt[e],n=bn(t.x*i.lobeSpacing+o.phase,d),a=i.bands?.6+.7*o.bands[t.band]:1;r.style.setProperty(`--vb-x${e}-${i.id}`,`${(n*w).toFixed(1)}px`),r.style.setProperty(`--vb-l${e}-${i.id}`,(a*xn(n,d)).toFixed(3));let s=m/2+(C+n*w)*j;r.style.setProperty(`--vb-y${e}-${i.id}`,`${(-An(s,m,ie,F)*ae).toFixed(1)}px`)}let ce=i.staticColors||i.reducedMotion||i.hueRange===0?0:-i.hueRange+2*i.hueRange*Fn(l/i.hueDuration);r.style.setProperty(`--vb-hue-${i.id}`,`${ce.toFixed(2)}deg`),(n=t.onLevel)==null||n.call(t,o.level),t.paintedConfig=i}))}function zn(){un??=(dn=0,fn=0,hn=0,requestAnimationFrame(Rn))}function Bn(){ln.size===0&&un!=null&&(cancelAnimationFrame(un),un=null)}function Vn(e,t,n,r){let i={el:e,config:t,source:n,onLevel:r,analyser:null,releaseAnalyser:null,time:null,freq:null,canvas:null,ctx:null,haloCanvas:null,haloCtx:null,displace:null,noiseShift:null,filter:null,filterTop:-1,s:cn(e),paintedConfig:null,cssBlur:null,warpOff:e.hasAttribute(`data-voice-warp`)};t.distortion>0&&(i.displace=e.querySelector(`:scope > svg feDisplacementMap`),i.noiseShift=e.querySelector(`:scope > svg feOffset`),i.filter=e.querySelector(`:scope > svg filter`));let a=e.querySelector(`:scope > [data-voice-beam-band]`);if(a){i.canvas=a,i.ctx=a.getContext(`2d`);let t=e.querySelector(`:scope > [data-voice-beam-band-halo]`);t&&(i.haloCanvas=t,i.haloCtx=t.getContext(`2d`))}if(i.s.lastTs=0,n.stream){let e=on(n.stream);e&&(i.analyser=e.analyser,i.releaseAnalyser=e.release,i.time=new Float32Array(e.analyser.fftSize),i.freq=new Uint8Array(e.analyser.frequencyBinCount))}return ln.add(i),zn(),()=>{var e;ln.delete(i),(e=i.releaseAnalyser)==null||e.call(i),Bn()}}const Hn={scale:1,glowSize:1,processingDuration:1.1,processingLevel:.55,processingTravel:1.55,processingCurve:2.1,cornerFollow:.45,strokeOpacity:1,innerOpacity:1,bloomOpacity:1,idle:.18,reach:1.2,spread:1.05,flow:48,bend:60,bandStrength:1.55,bandWidth:2.15,bandPosition:.35,bandCurve:1.75,bandSpread:.87,bandSkew:.12,bandOffset:-27,bandTail:.59,bandTailPosition:.67,bandTailCurve:2.4,bandTailOverflow:15,bandAberration:.89,distortion:.62,distortionDetail:2.3,glowWidth:.65,glowHeight:1.25,lobeSpacing:.85,rangeWidth:.75,rangeHeight:1,softness:1.07,coreSize:1,coreLight:0,coreLightWidth:1,coreLightHeight:1,strokeScale:1,innerScale:1,innerHeight:1,bloomScale:1,bloomHeight:1},Un={default:{},pill:{scale:.45,glowSize:.95,strokeOpacity:1.2,innerOpacity:.85,reach:1.35,spread:1.1,flow:0,bend:23,bandStrength:1.55,bandWidth:1.85,bandCurve:1.95,bandSpread:.38,bandOffset:-16,bandTail:0,processingTravel:2,cornerFollow:0,distortion:.45,distortionDetail:3,glowWidth:.65,glowHeight:.95,lobeSpacing:.45,rangeWidth:.8,rangeHeight:.7,softness:.88,coreSize:.25,strokeScale:1.25,innerScale:.95,bloomScale:1.05,bloomHeight:2.25},mobile:{scale:1.25,spread:.45,reach:3,flow:60,bend:70,bandWidth:2.4,bandCurve:1.55,bandSpread:.9,bandOffset:-50,bandTail:.62,bandTailPosition:.42,bandTailCurve:2.7,bandTailOverflow:22,processingDuration:1.05,processingLevel:.35,processingTravel:1,cornerFollow:.4,bandStrength:1.8,distortionDetail:2,glowWidth:1.15,glowHeight:2.1,lobeSpacing:1.35,rangeWidth:1.25,rangeHeight:1.2,softness:1.1}},Wn={default:{brightness:1.15},pill:{brightness:1.35,saturation:1.5},mobile:{strength:1,brightness:1.2,saturation:1.5}},Gn={default:{},pill:{},mobile:{strength:1}};function Kn(e=`default`,t=`dark`){return(t===`light`?Gn[e]:void 0)??Wn[e]}const qn={default:{bandStrength:1.7},pill:{bandStrength:2},mobile:{bandStrength:1.7}};function Jn(e=`default`,t=`dark`){let n=Un[e],r={};return t===`light`&&(n.reach===void 0&&(r.reach=1.8),n.spread===void 0&&(r.spread=.8),n.coreLight===void 0&&(r.coreLight=1.8)),{...Hn,...r,...n,...t===`light`?qn[e]:void 0}}const Yn={dark:{core:`255, 255, 255`,above:`255, 70, 80`,mid:`90, 255, 150`,below:`80, 140, 255`},light:{core:`197, 139, 255`,above:`255, 122, 182`,mid:`126, 196, 255`,below:`45, 255, 171`}},Xn=typeof navigator<`u`&&/AppleWebKit/.test(navigator.userAgent)&&!/Chrome\/|Chromium\/|Edg\/|OPR\//.test(navigator.userAgent),Zn=(()=>{if(typeof document>`u`)return!0;let e=document.createElement(`canvas`).getContext(`2d`);return!!e&&typeof e.filter==`string`})();function Qn(){let[e,t]=it(()=>typeof window>`u`||window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`);return ot(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=e=>t(e.matches?`dark`:`light`);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function $n(){let[e,t]=it(()=>typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);return ot(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function er(e,t){return e===`auto`?t:e}const tr=Ct(function({children:e,type:t=`default`,scale:n,stream:r=null,level:i=0,sensitivity:a=3.1,threshold:o=.015,attack:s=.325,release:c=.86,idle:l,breatheDuration:u=5.2,reach:d,spread:f,bands:p=!0,flow:m,processing:h=!1,processingDuration:g,processingLevel:_,processingTravel:v,processingCurve:y,cornerFollow:b,processingEase:x=.6,colorVariant:S=`colorful`,colors:C,bandColors:w,theme:T=`dark`,staticColors:E=!1,hueRange:ee,hueDuration:te,active:D=!0,paused:O=!1,borderRadius:k,brightness:ne,saturation:A,glowSize:j,strokeOpacity:M,innerOpacity:re,bloomOpacity:N,bend:P,bandStrength:F,bandWidth:ie,bandPosition:ae,bandCurve:oe,bandSpread:se,bandSkew:ce,bandOffset:le,bandTail:I,bandTailPosition:ue,bandTailCurve:L,bandTailOverflow:de,bandAberration:fe,distortion:pe,distortionDetail:me,glowWidth:he,glowHeight:R,lobeSpacing:ge,rangeWidth:_e,rangeHeight:ve,softness:ye,coreSize:be,coreLight:z,coreLightWidth:xe,coreLightHeight:Se,strokeScale:B,innerScale:Ce,innerHeight:we,bloomScale:Te,bloomHeight:V,strength:De,className:Oe,style:ke,css:Ae,onLevel:je,onActivate:Me,onDeactivate:Ne,onAnimationEnd:Pe,...Fe},Ie){let Le=ut().replace(/:/g,`-`),H=er(T,Qn()),Re=C?C.join(`|`):``,ze=w?[w.core,w.above,w.mid,w.below].join(`|`):``,U=Jn(t,H),W=Math.max(.05,n??U.scale),Be=j??U.glowSize,Ve=M??U.strokeOpacity,He=re??U.innerOpacity,Ue=N??U.bloomOpacity,We=g??U.processingDuration,Ge=_??U.processingLevel,Ke=v??U.processingTravel,G=y??U.processingCurve,qe=b??U.cornerFollow,Je=l??U.idle,Ye=d??U.reach,Xe=f??U.spread,K=(m??U.flow)*W,Ze=(P??U.bend)*W,Qe=F??U.bandStrength,$e=(ie??U.bandWidth)*W,et=ae??U.bandPosition,tt=oe??U.bandCurve,nt=se??U.bandSpread,rt=ce??U.bandSkew,at=(le??U.bandOffset)*W,dt=I??U.bandTail,ft=ue??U.bandTailPosition,pt=L??U.bandTailCurve,mt=(de??U.bandTailOverflow)*W,ht=fe??U.bandAberration,gt=pe??U.distortion,_t=(me??U.distortionDetail)/W,vt=(he??U.glowWidth)*W,yt=(R??U.glowHeight)*W,bt=(ge??U.lobeSpacing)*W,xt=(_e??U.rangeWidth)*W,St=(ve??U.rangeHeight)*W,Ct=ye??U.softness,wt=(be??U.coreSize)*W,Tt=Math.max(0,Math.min(3,z??U.coreLight)),Et=xe??U.coreLightWidth,Dt=Se??U.coreLightHeight,Ot=B??U.strokeScale,kt=Ce??U.innerScale,At=we??U.innerHeight,jt=Te??U.bloomScale,Mt=V??U.bloomHeight,Nt=$n(),Pt=st(null),[Ft,It]=it(D),[Lt,Rt]=it(!1),[zt,Bt]=it(!0),[Vt,Ht]=it(null),[Ut,Wt]=it(0);ot(()=>{if(!Xn)return;let e=Pt.current;if(!e)return;let t=()=>Wt(e.clientWidth*e.clientHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let Gt=Xn&&Ut>6e4?0:gt;ot(()=>{if(k!=null)return;let e=Pt.current;if(!e)return;let t=()=>{let t=e.firstElementChild;if(!t)return;let n=getComputedStyle(t),r=parseFloat(n.borderTopLeftRadius);!isNaN(r)&&r>0&&Ht(r)};t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!1}),()=>n.disconnect()},[k,e]),ot(()=>{D&&!Ft&&!Lt?It(!0):!D&&Ft&&!Lt&&Rt(!0)},[D,Ft,Lt]),ot(()=>{let e=Pt.current;if(!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(e=>{for(let t of e)Bt(t.isIntersecting)},{rootMargin:`256px`});return t.observe(e),()=>t.disconnect()},[]);let Jt=lt(e=>{let t=e.animationName;t.includes(`fade-out`)?(It(!1),Rt(!1),Ne?.()):t.includes(`fade-in`)&&Me?.(),Pe?.(e)},[Me,Ne,Pe]),J=qt[H],Yt=k??Vt??16,Xt=Kn(t,H),Zt=De??Xt.strength??J.strength??1,Qt=ee??J.hueRange??24,$t=te??J.hueDuration??12,tn=ne??Xt.brightness??J.brightness,nn=A??Xt.saturation??J.saturation,rn=ct(()=>en({id:Le,borderRadius:Yt,borderWidth:1,strokeOpacity:J.strokeOpacity*Ve,innerOpacity:J.innerOpacity*He,bloomOpacity:J.bloomOpacity*Ue,innerShadow:J.innerShadow,colorVariant:S,colors:C,brightness:tn,saturation:nn,theme:H,hueBase:J.hueBase??0,glowSize:Be*W,glowWidth:vt,glowHeight:yt,strokeScale:Ot,innerScale:kt,innerHeight:At,bloomScale:jt,bloomHeight:Mt,coreSize:wt,coreLight:Tt,coreLightWidth:Et,coreLightHeight:Dt,rangeWidth:xt,rangeHeight:St,softness:Ct,distortion:Gt>0,scale:W}),[Le,Yt,J,S,Re,tn,nn,H,U,Be,Ve,He,Ue,W,vt,yt,Ot,kt,At,jt,Mt,wt,Tt,Et,Dt,xt,St,Ct,Gt>0]),an=ct(()=>({id:Le,sensitivity:Math.max(0,a),threshold:Math.max(0,Math.min(.95,o)),attack:Math.max(0,s),release:Math.max(0,c),idle:Math.max(0,Math.min(1,Je)),breatheDuration:Math.max(.2,u),reach:Math.max(0,Ye),spread:Math.max(0,Xe),bands:p,flow:K,lobeSpacing:Math.max(.1,bt),bend:Math.max(0,Ze),bandStrength:Math.max(0,Qe),bandWidth:Math.max(0,$e),bandPosition:Math.max(0,et),bandCurve:Math.max(.3,tt),bandSpread:Math.max(.05,nt),bandSkew:Math.max(-.9,Math.min(.9,rt)),bandOffset:at,bandTail:Math.max(0,Math.min(1.5,dt)),bandTailPosition:Math.max(0,Math.min(.98,ft)),bandTailCurve:Math.max(.5,pt),bandTailOverflow:Math.max(0,mt),bandAberration:Math.max(0,Math.min(1,ht)),rangeWidth:xt,rangeHeight:St,theme:H,bandColors:{core:w?.core&&Kt(w.core)||Yn[H].core,above:w?.above&&Kt(w.above)||Yn[H].above,mid:w?.mid&&Kt(w.mid)||Yn[H].mid,below:w?.below&&Kt(w.below)||Yn[H].below},distortion:Math.max(0,Math.min(1,Gt)),coreLight:Tt,scale:W,radius:Yt,processing:h,processingDuration:Math.max(.05,We),processingLevel:Math.max(0,Math.min(1,Ge)),processingEase:Math.max(.05,x),processingTravel:Math.max(0,Ke),processingCurve:Math.max(1,G),cornerFollow:Math.max(0,Math.min(1,qe)),hueRange:Math.max(0,Qt),hueDuration:Math.max(.5,$t),staticColors:S===`mono`?!0:E,reducedMotion:Nt,paused:O}),[Le,a,o,s,c,Je,u,Ye,Xe,p,K,bt,Ze,Qe,$e,et,tt,nt,rt,at,dt,ft,pt,mt,ht,xt,St,H,ze,Gt,Tt,W,Yt,h,We,Ge,x,Ke,G,qe,Qt,$t,E,S,Nt,O]),on=st(i);on.current=i;let sn=st(je);sn.current=je,ot(()=>{if(!(Ft||Lt)||!zt)return;let e=Pt.current;return e?Vn(e,an,{stream:r,getLevel:()=>{let e=on.current;return typeof e==`function`?e():e}},e=>sn.current?.call(sn,e)):void 0},[an,r,Ft,Lt,zt]);let cn=lt(e=>{Pt.current=e,typeof Ie==`function`?Ie(e):Ie&&(Ie.current=e)},[Ie]),ln={...ke??{},"--voice-strength":Math.max(0,Math.min(1,Zt))};return q(Ee,{children:[q(`style`,{children:Ae?`${rn}
|
|
295
|
+
${Ae.split(`{id}`).join(Le)}`:rn}),q(`div`,{...Fe,ref:cn,"data-voice-beam":Le,"data-voice-type":t,"data-voice-halfres":``,"data-active":Ft&&!Lt?``:void 0,"data-fading":Lt?``:void 0,"data-paused":Ft&&!Lt&&(!zt||O)?``:void 0,"data-listening":r?``:void 0,"data-processing":h?``:void 0,className:Oe,style:ln,onAnimationEnd:Jt,children:[e,q(`div`,{"data-voice-beam-bloom":!0}),Gt>0&&q(Ee,{children:[q(`div`,{"data-voice-beam-warp":`inner`}),q(`div`,{"data-voice-beam-warp":`bloom`})]}),!Zn&&q(`canvas`,{"data-voice-beam-band-halo":!0,"aria-hidden":`true`}),q(`canvas`,{"data-voice-beam-band":!0,"aria-hidden":`true`}),Tt>0&&q(`div`,{"data-voice-beam-core":!0,children:q(`div`,{})}),Gt>0&&q(`svg`,{"aria-hidden":`true`,width:`0`,height:`0`,style:{position:`absolute`,pointerEvents:`none`},children:q(`filter`,{id:`vb-distort-${Le}`,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,colorInterpolationFilters:`sRGB`,children:[q(`feTurbulence`,{type:`fractalNoise`,baseFrequency:`${(.012*_t).toFixed(4)} ${(.05*_t).toFixed(4)}`,numOctaves:2,seed:7,result:`noise`}),q(`feOffset`,{in:`noise`,dx:`0`,dy:`0`,result:`moved`}),q(`feColorMatrix`,{in:`moved`,type:`matrix`,values:`1 0 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 0 0 1`,result:`map`}),q(`feDisplacementMap`,{in:`SourceGraphic`,in2:`map`,scale:0,xChannelSelector:`R`,yChannelSelector:`G`})]})})]})]})}),nr=`http://www.w3.org/2000/svg`,Y=Math.PI*2,X=21.5,rr=Math.sqrt(12)*X,ir=154-rr,Z=vr(),ar=ir+Z.length,or=.56*Y*X/2,sr=.75,cr=.35,lr=.55,ur=22.5,dr=xr(.65,0,.35,1),fr=xr(.4,0,.2,1),pr=xr(.34,1.56,.64,1),mr=xr(.2,0,0,1);var hr=class{element;lines=[];ripple;track;middle;top;bottom;seal;check;motion=matchMedia(`(prefers-reduced-motion: reduce)`);phase=`idle`;stage={kind:`line`};settleSuccess=null;successBegun=null;frame=0;previousTime=0;position=0;target=0;level=0;stopped=!1;constructor(e,t=`ring`){this.checking=t,this.element=e.createElementNS(nr,`svg`),this.element.classList.add(`seams-voiceid-ribbon`),this.element.setAttribute(`viewBox`,`0 0 308 64`),this.element.setAttribute(`aria-hidden`,`true`),this.ripple=this.append(e,`circle`,`1.5`),this.track=this.append(e,`circle`,`2`),this.middle=this.append(e,`path`,`1`),this.top=this.append(e,`path`,`2`),this.bottom=this.append(e,`path`,`2`),this.seal=this.append(e,`circle`,`0`),this.seal.setAttribute(`fill`,`currentColor`),this.seal.setAttribute(`stroke`,`none`),this.check=this.append(e,`path`,`2.6`),this.check.classList.add(`seams-voiceid-ribbon-check`),this.check.setAttribute(`d`,`M161 26.8 151.4 36.3 147.1 32`),this.check.setAttribute(`stroke-linejoin`,`round`),this.check.setAttribute(`pathLength`,`1`),this.check.setAttribute(`stroke-dasharray`,`1`);for(let e of[this.ripple,this.track,this.seal])e.setAttribute(`cx`,`154`),e.setAttribute(`cy`,`32`);if(this.track.setAttribute(`r`,`21.5`),t===`segments`){this.element.dataset.seamsProgressLine=``;for(let[e,t]of[this.top,this.middle,this.bottom].entries())t.dataset.seamsProgressSegment=String(e)}for(let t=3;t>=0;--t)this.lines.push(this.append(e,`path`,t===0?`1`:`0.65`));this.paint(performance.now())}readLevel=()=>this.level;setPhase(e){if(e===`processing`&&this.stage.kind===`line`){let e=Math.max(this.level,this.idleAmplitude(performance.now()));this.stage={kind:this.checking===`segments`?`segments`:`capture`,startedAt:performance.now(),amplitude:e}}else e!==`processing`&&(this.stage={kind:`line`},this.settle());this.phase=e,this.target=0,this.element.dataset.phase=e,this.wake()}succeed(e){if(this.stopped||this.stage.kind===`sealed`)return Promise.resolve();this.stage.kind===`line`&&this.setPhase(`processing`);let t=new Promise(this.awaitSuccess);return this.successBegun=e,this.stage.kind===`spin`&&this.beginSuccess(performance.now()),this.wake(),t}add(e){if(this.phase!==`listening`||this.stopped)return;let t=Math.max(0,e.rms-.003);this.target=(t/(t+.055))**.65*(e.speech?1:.15),this.element.dataset.speech=String(e.speech),this.wake()}dispose(){this.stopped=!0,cancelAnimationFrame(this.frame),this.frame=0,this.level=0,this.target=0,this.settle()}awaitSuccess=e=>{this.settle(),this.settleSuccess=e};settle(){let e=this.settleSuccess;this.settleSuccess=null,this.successBegun=null,e?.()}append(e,t,n){let r=e.createElementNS(nr,t);return r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-width`,n),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`vector-effect`,`non-scaling-stroke`),r.setAttribute(`opacity`,`0`),this.element.append(r),r}wake(){!this.stopped&&this.frame===0&&(this.previousTime=performance.now(),this.frame=requestAnimationFrame(this.draw))}draw=e=>{if(this.frame=0,this.stopped)return;let t=Math.min(50,Math.max(0,e-this.previousTime));this.previousTime=e,this.level+=(this.target-this.level)*(1-Math.exp(-t/(this.target>this.level?55:200))),this.motion.matches||(this.position+=t*(.0012+this.level*.003)),this.paint(e),!this.element.isConnected||this.stage.kind===`sealed`||this.stage.kind===`line`&&this.phase===`idle`&&this.level<=.001||(this.frame=requestAnimationFrame(this.draw))};idleAmplitude(e){return this.phase!==`listening`||this.motion.matches?0:.085*(.72+.28*Math.sin(e/2600*Y))}paint(e){for(let e of[this.ripple,this.track,this.middle,this.top,this.bottom,this.seal,this.check])e.setAttribute(`opacity`,`0`);for(let e of this.lines)e.setAttribute(`opacity`,`0`);switch(this.stage.kind){case`line`:this.paintLine(Math.max(this.level,this.idleAmplitude(e)));return;case`capture`:this.paintCapture(e,this.stage);return;case`segments`:this.paintSegments(e,this.stage);return;case`spin`:this.paintArc(this.spinnerArc(e,this.stage),1);return;case`success`:this.paintSuccess(e,this.stage);return;case`sealed`:this.paintSeal({start:0,sweep:Y},1,1);return}}paintLine(e){for(let t=0;t<this.lines.length;t+=1){let n=3-t;this.lines[t].setAttribute(`d`,this.linePath(n,e,0,308,1)),this.lines[t].setAttribute(`opacity`,String(n===0?lr+e*.4:.1+e*.1))}}paintSegments(e,t){let n=e-t.startedAt;if(!this.motion.matches&&n<200){this.paintLine(t.amplitude*(1-mr(n/200)));return}let r=n-200,i=8*(this.motion.matches?1:mr(Q(r/200))),a=(308-2*i)/3;for(let[e,t]of[this.top,this.middle,this.bottom].entries()){let n=e*(a+i);t.setAttribute(`d`,`M${n.toFixed(2)} 32H${(n+a).toFixed(2)}`),t.setAttribute(`stroke-width`,`1`),t.setAttribute(`opacity`,this.segmentOpacity(r,e))}}segmentOpacity(e,t){if(this.motion.matches)return`0.8`;let n=.5+.5*Math.cos(Y*(e-t*150)/900);return $(lr,cr+(1-cr)*n,mr(Q(e/200))).toFixed(3)}paintCapture(e,t){let n=this.motion.matches?920:e-t.startedAt;if(n>=560){this.paintJoin(e,Math.min(n-560,360));return}let r=t.amplitude,i=n/560,a=1-mr(Q(n/150)),o=dr(Q(i/.6)),s=gr(!1)*X*560,c=br(i,ar,s),l=ir+br(i,ar+or-ir,s),u=lr+r*.4;for(let[e,t]of[[this.top,!1],[this.bottom,!0]])e.setAttribute(`d`,this.halfPath(c,l,t,r,a)),e.setAttribute(`stroke-width`,$(1,2,o).toFixed(2)),e.setAttribute(`opacity`,$(u,1,o).toFixed(3));this.middle.setAttribute(`d`,this.linePath(0,r,ir,308-ir,a)),this.middle.setAttribute(`opacity`,(u*(1-mr(Q(n/180)))).toFixed(3));for(let e=0;e<3;e+=1){let t=3-e;this.lines[e].setAttribute(`d`,this.linePath(t,r,0,308,a)),this.lines[e].setAttribute(`opacity`,((.1+r*.1)*(1-Q(n/200))).toFixed(3))}this.track.setAttribute(`opacity`,(.1*Q((i-.4)/.6)).toFixed(3))}paintJoin(e,t){let n=(1-Math.cos(Math.PI*t/360))/2,r=-Math.PI/2+gr(!1)*t,i=or/X,a=Math.PI-i,o=this.motion.matches?-Math.PI/2:r+sr*a*n;if(this.motion.matches||t>=360){this.stage={kind:`spin`,startedAt:e,base:o-Y*.14},this.settleSuccess&&this.beginSuccess(e),this.paint(e);return}this.track.setAttribute(`opacity`,`0.1`);for(let[e,t]of[[this.top,o],[this.bottom,r+Math.PI-(1-sr)*a*n]])e.setAttribute(`d`,yr({start:t,sweep:i})),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`opacity`,`1`)}spinnerArc(e,t){let n=e-t.startedAt,r=this.motion.matches?2600:1500,i=(n+r/2)%r/r,a=i<.5,o=fr(a?i/.5:(i-.5)/.5),s=a?$(1,56,o):$(56,1,o),c=a?$(0,-14,o):$(-14,-99,o);return{start:t.base+gr(this.motion.matches)*n-Y*c/100,sweep:Y*s/100}}beginSuccess(e){if(this.stage.kind!==`spin`)return;this.stage={kind:`success`,startedAt:e,from:this.spinnerArc(e,this.stage)};let t=this.successBegun;this.successBegun=null,t?.()}paintSuccess(e,t){let n=e-t.startedAt;if(n>=1140){this.stage={kind:`sealed`},this.settle(),this.paint(e);return}let r=Q(n/650),i=this.motion.matches?0:gr(!1)*650*(r-r*r/2),a=dr(Q((n-150)/500));this.paintSeal({start:t.from.start+i,sweep:$(t.from.sweep,Y,a)},pr(Q((n-600)/420)),dr(Q((n-820)/320)));let o=Q((n-700)/700);if(!this.motion.matches&&o>0&&o<1){let e=mr(o);this.ripple.setAttribute(`r`,$(ur,34,e).toFixed(2)),this.ripple.setAttribute(`opacity`,((1-e)*.45).toFixed(3))}}paintSeal(e,t,n){this.paintArc(e,1),this.seal.setAttribute(`r`,(ur*Math.max(0,t)).toFixed(2)),this.seal.setAttribute(`opacity`,t>0?`1`:`0`),this.check.setAttribute(`stroke-dashoffset`,(1-n).toFixed(3)),this.check.setAttribute(`opacity`,n>0?`1`:`0`)}paintArc(e,t){this.track.setAttribute(`opacity`,String(.1*t)),this.top.setAttribute(`d`,yr(e)),this.top.setAttribute(`stroke-width`,`2`),this.top.setAttribute(`opacity`,`1`)}displacement(e,t,n){let r=n/308,i=Math.sin(Math.PI*r)**1.7;if(this.motion.matches)return t*5*i;let a=Math.sin(r*Math.PI*4-this.position+e*.5)*.7+Math.sin(r*Math.PI*7+this.position*.7+e)*.3;return t*(26-e*4)*i*a}linePath(e,t,n,r,i){let a=``,o=Math.max(2,Math.ceil((r-n)/2));for(let s=0;s<=o;s+=1){let c=n+(r-n)*s/o,l=32+this.displacement(e,t,c)*i;a+=`${s===0?`M`:`L`}${c.toFixed(2)},${l.toFixed(2)} `}return a}halfPath(e,t,n,r,i){let a=``,o=Math.max(2,Math.ceil((t-e)/1.5));for(let s=0;s<=o;s+=1){let c=_r(e+(t-e)*s/o),l=n?308-c.x:c.x,u=n?64-c.y:c.y;c.onLine&&(u+=this.displacement(0,r,l)*i),a+=`${s===0?`M`:`L`}${l.toFixed(2)},${u.toFixed(2)} `}return a}};function gr(e){return Y/(e?3200:1800)}function _r(e){if(e<=ir)return{x:e,y:32,onLine:!0};if(e<ar){let t=e-ir,n=0,r=Z.lengths.length-1;for(;r-n>1;){let e=n+r>>1;Z.lengths[e]<t?n=e:r=e}let i=(t-Z.lengths[n])/(Z.lengths[r]-Z.lengths[n]||1);return{x:$(Z.points[n][0],Z.points[r][0],i),y:$(Z.points[n][1],Z.points[r][1],i),onLine:!1}}let t=-Math.PI/2+(e-ar)/X;return{x:154+X*Math.cos(t),y:32+X*Math.sin(t),onLine:!1}}function vr(){let e=[[ir,32]],t=[0],n=0;for(let r=1;r<=240;r+=1){let i=r/240,a=[ir+rr*i,32-X*(4*i**3-3*i**4)],o=e[e.length-1];n+=Math.hypot(a[0]-o[0],a[1]-o[1]),e.push(a),t.push(n)}return{points:e,lengths:t,length:n}}function yr(e){let t=Math.max(2,Math.ceil(80*e.sweep/Y)),n=``;for(let r=0;r<=t;r+=1){let i=e.start+e.sweep*r/t,a=154+X*Math.cos(i),o=32+X*Math.sin(i);n+=`${r===0?`M`:`L`}${a.toFixed(2)},${o.toFixed(2)} `}return n}function br(e,t,n){let r=e*e;return t*(3*r-2*r*e)+n*(r*e-r)}function xr(e,t,n,r){let i=(e,t,n)=>((1-3*n+3*t)*e+(3*n-6*t))*e*e+3*t*e,a=(e,t,n)=>3*(1-3*n+3*t)*e*e+2*(3*n-6*t)*e+3*t;return o=>{if(o<=0)return 0;if(o>=1)return 1;let s=o;for(let t=0;t<6;t+=1){let t=a(s,e,n);if(t===0)break;s-=(i(s,e,n)-o)/t}return i(Q(s),t,r)}}function Q(e){return e<0?0:e>1?1:e}function $(e,t,n){return e+(t-e)*n}const Sr=tr;var Cr=class{element;glow;ribbon;prompt;themeObserver;phase=`idle`;disposed=!1;constructor(e,t,r){this.prompt=t,this.ribbon=new hr(e,r),this.element=this.ribbon.element,this.glow=e.createElement(`div`),this.glow.className=`seams-voiceid-glow`,this.glow.setAttribute(`aria-hidden`,`true`),this.render();let i=n();if(i)for(let e of this.glow.querySelectorAll(`style`))e.nonce=i;this.themeObserver=new MutationObserver(this.render),this.themeObserver.observe(e.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),this.themeObserver.observe(e.body,{attributes:!0,attributeFilter:[`data-theme`]})}listen(){this.setPhase(`listening`)}add(e){this.ribbon.add(e)}checking(){this.setPhase(`processing`)}accept(){this.setPhase(`idle`)}ready(){this.setPhase(`idle`)}succeed(e){return this.disposed?Promise.resolve():(this.phase=`idle`,this.render(),this.ribbon.succeed(e))}stop(){this.disposed||(this.disposed=!0,this.themeObserver.disconnect(),this.ribbon.dispose(),Ge(null,this.glow))}setPhase(e){this.disposed||(this.phase=e,this.ribbon.setPhase(e),this.render())}render=()=>{this.disposed||Ge(we(Sr,{className:`seams-voiceid-beam`,theme:(this.prompt.closest(`[data-theme]`)?.getAttribute(`data-theme`)??this.prompt.ownerDocument.documentElement.getAttribute(`data-theme`))===`light`?`light`:`dark`,level:this.ribbon.readLevel,processing:this.phase===`processing`,active:this.phase!==`idle`,staticColors:!0,colorVariant:`ocean`,borderRadius:Number.parseFloat(getComputedStyle(this.prompt).borderRadius)||16,children:null}),this.glow)}};const wr=new WeakMap,Tr=new Map([[`if you panic panic early`,`if you panic, panic early`],[`life is short go long to hedge`,`life is short, go long to hedge`]]);var Er=class{element;title;phrase;status;record;cancel;progress;microphone;microphoneRequested=!1;visual;disposed=!1;constructor(e,r,i,a=`ring`){let o=wr.get(e);o||(o=t({doc:e,baseCss:`
|
|
296
|
+
.seams-voiceid-activation-surface { width: min(100%, 26.25rem); margin: 0 auto; background: transparent; }
|
|
297
|
+
/* Inside an operation's card the card is the frame: the prompt fills it edge to edge. */
|
|
298
|
+
.seams-voiceid-activation-surface.seams-voiceid-in-card { width: 100%; }
|
|
299
|
+
.seams-voiceid-in-card .seams-voiceid-prompt {
|
|
300
|
+
width: 100%;
|
|
301
|
+
padding-top: 0.75rem;
|
|
302
|
+
border: 0;
|
|
303
|
+
border-radius: 0;
|
|
304
|
+
background: transparent;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.seams-voiceid-prompt {
|
|
308
|
+
box-sizing: border-box;
|
|
309
|
+
position: relative;
|
|
310
|
+
width: min(100%, 26.25rem);
|
|
311
|
+
margin: 0 auto;
|
|
312
|
+
padding: 3.5rem 1.5rem 1.5rem;
|
|
313
|
+
display: grid;
|
|
314
|
+
grid-template-rows: auto minmax(6rem, auto) 5rem minmax(3.375rem, auto) minmax(5rem, auto);
|
|
315
|
+
border: 1px solid var(--seams-colors-borderPrimary, #303b41);
|
|
316
|
+
border-radius: var(--seams-shape-card, 16px);
|
|
317
|
+
background: var(--seams-colors-colorBackground, #192024);
|
|
318
|
+
color: var(--seams-colors-textPrimary, #eff2f3);
|
|
319
|
+
text-align: center;
|
|
320
|
+
font-family: var(--seams-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
|
|
321
|
+
-webkit-font-smoothing: antialiased;
|
|
322
|
+
}
|
|
323
|
+
.seams-voiceid-prompt {
|
|
324
|
+
transition: opacity 180ms var(--seams-ease-out, cubic-bezier(0.23, 1, 0.32, 1)), transform 180ms var(--seams-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
325
|
+
}
|
|
326
|
+
@starting-style {
|
|
327
|
+
.seams-voiceid-prompt { opacity: 0; transform: translateY(4px); }
|
|
328
|
+
}
|
|
329
|
+
.seams-voiceid-progress-slot { grid-row: 5; grid-column: 1; min-width: 0; align-self: center; }
|
|
330
|
+
.seams-voiceid-progress-slot:empty { visibility: hidden; }
|
|
331
|
+
.seams-voiceid-activation-surface[data-preparation="loading"] .seams-voiceid-record-slot { visibility: hidden; }
|
|
332
|
+
@media (prefers-reduced-motion: reduce) {
|
|
333
|
+
.seams-voiceid-prompt { transform: none; transition: opacity 150ms ease; }
|
|
334
|
+
@starting-style { .seams-voiceid-prompt { transform: none; } }
|
|
335
|
+
.seams-voiceid-ribbon { transition: none !important; }
|
|
336
|
+
}
|
|
337
|
+
.seams-voiceid-prompt h2 {
|
|
338
|
+
font-size: 0.85rem;
|
|
339
|
+
line-height: 1.4;
|
|
340
|
+
font-weight: 500;
|
|
341
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
342
|
+
margin: 0.5rem 0 1rem;
|
|
343
|
+
}
|
|
344
|
+
.seams-voiceid-prompt.seams-voiceid-management {
|
|
345
|
+
display: flex;
|
|
346
|
+
flex-direction: column;
|
|
347
|
+
gap: 0.75rem;
|
|
348
|
+
padding: 1.25rem 1.25rem 1.375rem;
|
|
349
|
+
border-radius: var(--seams-shape-card, 1.5rem);
|
|
350
|
+
text-align: start;
|
|
351
|
+
font-size: 0.875rem;
|
|
352
|
+
line-height: 1.5;
|
|
353
|
+
}
|
|
354
|
+
.seams-voiceid-management-header {
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
gap: 0.25rem;
|
|
358
|
+
margin-inline-start: -0.5rem;
|
|
359
|
+
}
|
|
360
|
+
.seams-voiceid-management h2 {
|
|
361
|
+
margin: 0;
|
|
362
|
+
color: var(--seams-colors-textPrimary, #eff2f3);
|
|
363
|
+
font-size: 1.375rem;
|
|
364
|
+
font-weight: 600;
|
|
365
|
+
letter-spacing: -0.02em;
|
|
366
|
+
line-height: 1.25;
|
|
367
|
+
}
|
|
368
|
+
.seams-voiceid-management .seams-voiceid-management-intro {
|
|
369
|
+
margin: -0.125rem 0 0.25rem;
|
|
370
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
371
|
+
}
|
|
372
|
+
.seams-voiceid-management button {
|
|
373
|
+
appearance: none;
|
|
374
|
+
margin: 0;
|
|
375
|
+
color: var(--seams-colors-textPrimary, #eff2f3);
|
|
376
|
+
font: inherit;
|
|
377
|
+
transition: background-color 140ms ease;
|
|
378
|
+
}
|
|
379
|
+
.seams-voiceid-management button:disabled { opacity: 0.5; cursor: default; }
|
|
380
|
+
.seams-voiceid-management .seams-voiceid-management-back {
|
|
381
|
+
display: grid;
|
|
382
|
+
place-items: center;
|
|
383
|
+
width: 2.25rem;
|
|
384
|
+
height: 2.25rem;
|
|
385
|
+
padding: 0;
|
|
386
|
+
border: 0;
|
|
387
|
+
border-radius: var(--seams-shape-control, 10px);
|
|
388
|
+
background: transparent;
|
|
389
|
+
}
|
|
390
|
+
.seams-voiceid-management-enrollment {
|
|
391
|
+
display: grid;
|
|
392
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
393
|
+
align-items: center;
|
|
394
|
+
gap: 0.125rem 0.75rem;
|
|
395
|
+
padding: 0.75rem 0.875rem;
|
|
396
|
+
border-radius: 0.75rem;
|
|
397
|
+
background: var(--seams-colors-surface, #202b31);
|
|
398
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
399
|
+
}
|
|
400
|
+
.seams-voiceid-management-summary { text-align: end; }
|
|
401
|
+
.seams-voiceid-management-value { color: var(--seams-colors-textPrimary, #eff2f3); font-weight: 500; }
|
|
402
|
+
.seams-voiceid-management-enrollment-detail:not(:empty)::before { content: ' · '; }
|
|
403
|
+
.seams-voiceid-management-enrollment[data-enrollment="adapted"] > .seams-voiceid-management-summary {
|
|
404
|
+
grid-area: 2 / 1;
|
|
405
|
+
text-align: start;
|
|
406
|
+
font-size: 0.8125rem;
|
|
407
|
+
}
|
|
408
|
+
.seams-voiceid-management-enrollment > .seams-voiceid-management-reset { grid-area: 1 / 2 / 3; }
|
|
409
|
+
.seams-voiceid-management-enrollment[data-state] .seams-voiceid-management-value { display: none; }
|
|
410
|
+
.seams-voiceid-management-enrollment[data-state] .seams-voiceid-management-enrollment-detail::before { content: none; }
|
|
411
|
+
.seams-voiceid-management .seams-voiceid-management-reset {
|
|
412
|
+
padding: 0.375rem 0.75rem;
|
|
413
|
+
border: 1px solid var(--seams-colors-borderPrimary, #303b41);
|
|
414
|
+
border-radius: var(--seams-shape-control, 10px);
|
|
415
|
+
background: transparent;
|
|
416
|
+
font-size: 0.8125rem;
|
|
417
|
+
font-weight: 600;
|
|
418
|
+
}
|
|
419
|
+
.seams-voiceid-management .seams-voiceid-management-action {
|
|
420
|
+
display: grid;
|
|
421
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
422
|
+
align-items: center;
|
|
423
|
+
gap: 0.75rem;
|
|
424
|
+
width: 100%;
|
|
425
|
+
min-height: 44px;
|
|
426
|
+
padding: 0.75rem 0.875rem;
|
|
427
|
+
border: 1px solid var(--seams-colors-borderPrimary, #303b41);
|
|
428
|
+
border-radius: 0.75rem;
|
|
429
|
+
background: transparent;
|
|
430
|
+
text-align: start;
|
|
431
|
+
}
|
|
432
|
+
.seams-voiceid-management-action > svg { color: var(--seams-colors-textSecondary, #9cabb3); }
|
|
433
|
+
.seams-voiceid-management-action-heading {
|
|
434
|
+
display: flex;
|
|
435
|
+
flex-wrap: wrap;
|
|
436
|
+
align-items: center;
|
|
437
|
+
gap: 0.25rem 0.5rem;
|
|
438
|
+
font-weight: 600;
|
|
439
|
+
}
|
|
440
|
+
.seams-voiceid-management-chip {
|
|
441
|
+
padding: 0.125rem 0.5rem;
|
|
442
|
+
border-radius: 6px;
|
|
443
|
+
background: color-mix(in srgb, var(--seams-colors-textPrimary, #eff2f3), transparent 93%);
|
|
444
|
+
font-size: 0.75rem;
|
|
445
|
+
font-weight: 500;
|
|
446
|
+
}
|
|
447
|
+
.seams-voiceid-management-action-detail {
|
|
448
|
+
display: block;
|
|
449
|
+
margin-top: 0.125rem;
|
|
450
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
451
|
+
font-size: 0.8125rem;
|
|
452
|
+
}
|
|
453
|
+
.seams-voiceid-management .seams-voiceid-management-action[data-state="pending"] {
|
|
454
|
+
opacity: 1;
|
|
455
|
+
border-color: var(--seams-colors-borderHover, #46545b);
|
|
456
|
+
background: var(--seams-colors-surface, #202b31);
|
|
457
|
+
}
|
|
458
|
+
.seams-voiceid-management-action[data-state="pending"] > svg { visibility: hidden; }
|
|
459
|
+
.seams-voiceid-management [data-state="pending"] .seams-voiceid-management-action-detail,
|
|
460
|
+
.seams-voiceid-management [data-state="pending"] .seams-voiceid-management-enrollment-detail {
|
|
461
|
+
color: var(--seams-colors-textPrimary, #eff2f3);
|
|
462
|
+
}
|
|
463
|
+
.seams-voiceid-management [data-state="error"] .seams-voiceid-management-action-detail,
|
|
464
|
+
.seams-voiceid-management [data-state="error"] .seams-voiceid-management-enrollment-detail {
|
|
465
|
+
color: var(--seams-colors-error, oklch(0.74 0.166 19));
|
|
466
|
+
}
|
|
467
|
+
.seams-voiceid-management .seams-voiceid-management-section {
|
|
468
|
+
margin: 0.5rem 0 -0.25rem;
|
|
469
|
+
padding-inline-start: 0.125rem;
|
|
470
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
471
|
+
font-size: 0.6875rem;
|
|
472
|
+
font-weight: 600;
|
|
473
|
+
letter-spacing: 0.08em;
|
|
474
|
+
text-transform: uppercase;
|
|
475
|
+
}
|
|
476
|
+
/* The status line is read by assistive technology; a message for a hidden row is also shown. */
|
|
477
|
+
.seams-voiceid-prompt.seams-voiceid-management > [role="status"] {
|
|
478
|
+
position: absolute;
|
|
479
|
+
width: 1px;
|
|
480
|
+
height: 1px;
|
|
481
|
+
margin: -1px;
|
|
482
|
+
overflow: hidden;
|
|
483
|
+
clip-path: inset(50%);
|
|
484
|
+
white-space: nowrap;
|
|
485
|
+
}
|
|
486
|
+
.seams-voiceid-prompt.seams-voiceid-management > [role="status"][data-placement="dialog"] {
|
|
487
|
+
position: relative;
|
|
488
|
+
width: auto;
|
|
489
|
+
height: auto;
|
|
490
|
+
margin: 0;
|
|
491
|
+
overflow: visible;
|
|
492
|
+
clip-path: none;
|
|
493
|
+
white-space: normal;
|
|
494
|
+
color: var(--seams-colors-error, oklch(0.74 0.166 19));
|
|
495
|
+
font-size: 0.8125rem;
|
|
496
|
+
overflow-wrap: anywhere;
|
|
497
|
+
}
|
|
498
|
+
[dir='rtl'] .seams-voiceid-management svg { transform: scaleX(-1); }
|
|
499
|
+
@media (hover: hover) {
|
|
500
|
+
.seams-voiceid-management button:hover:not(:disabled) {
|
|
501
|
+
background: var(--seams-colors-surface2, var(--seams-colors-surface, #202b31));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
.seams-voiceid-prompt .seams-voiceid-phrase {
|
|
505
|
+
font-size: clamp(1.75rem, 6vw, 2.25rem);
|
|
506
|
+
font-weight: 600;
|
|
507
|
+
line-height: 1.17;
|
|
508
|
+
letter-spacing: -0.035em;
|
|
509
|
+
text-wrap: balance;
|
|
510
|
+
max-width: 21rem;
|
|
511
|
+
align-self: center;
|
|
512
|
+
margin: 0 auto;
|
|
513
|
+
transition: opacity 180ms var(--seams-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
514
|
+
}
|
|
515
|
+
.seams-voiceid-ribbon {
|
|
516
|
+
display: block;
|
|
517
|
+
width: 308px;
|
|
518
|
+
max-width: 100%;
|
|
519
|
+
height: 64px;
|
|
520
|
+
margin: auto;
|
|
521
|
+
overflow: visible;
|
|
522
|
+
}
|
|
523
|
+
.seams-voiceid-ribbon .seams-voiceid-ribbon-check { stroke: var(--seams-colors-colorBackground, #192024); }
|
|
524
|
+
.seams-voiceid-prompt .seams-voiceid-phrase.seams-voiceid-success-headline {
|
|
525
|
+
display: grid;
|
|
526
|
+
align-content: end;
|
|
527
|
+
font-size: 18px;
|
|
528
|
+
letter-spacing: normal;
|
|
529
|
+
line-height: 1.4;
|
|
530
|
+
}
|
|
531
|
+
.seams-voiceid-prompt .seams-voiceid-status.seams-voiceid-success-message { font-size: 0.8125rem; }
|
|
532
|
+
/* The glow is decorative and cannot intercept record, retry or cancel controls. */
|
|
533
|
+
.seams-voiceid-glow { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 0; }
|
|
534
|
+
.seams-voiceid-beam { width: 100%; height: 100%; border-radius: inherit; }
|
|
535
|
+
.seams-voiceid-prompt > :not(.seams-voiceid-glow) { position: relative; z-index: 1; }
|
|
536
|
+
.seams-voiceid-prompt > .seams-voiceid-close { position: absolute; }
|
|
537
|
+
.seams-voiceid-prompt .seams-voiceid-status {
|
|
538
|
+
font-size: 0.75rem;
|
|
539
|
+
line-height: 1.5;
|
|
540
|
+
min-height: 3.375rem;
|
|
541
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
542
|
+
margin: 0;
|
|
543
|
+
}
|
|
544
|
+
.seams-voiceid-prompt button {
|
|
545
|
+
font: inherit;
|
|
546
|
+
cursor: pointer;
|
|
547
|
+
touch-action: manipulation;
|
|
548
|
+
}
|
|
549
|
+
.seams-voiceid-prompt button:focus-visible {
|
|
550
|
+
outline: 2px solid currentColor;
|
|
551
|
+
outline-offset: 2px;
|
|
552
|
+
}
|
|
553
|
+
.seams-voiceid-prompt .seams-voiceid-close {
|
|
554
|
+
position: absolute;
|
|
555
|
+
right: 0.75rem;
|
|
556
|
+
top: 0.75rem;
|
|
557
|
+
width: 2.5rem;
|
|
558
|
+
height: 2.5rem;
|
|
559
|
+
background: transparent;
|
|
560
|
+
border: 0;
|
|
561
|
+
border-radius: var(--seams-shape-control, 10px);
|
|
562
|
+
color: inherit;
|
|
563
|
+
display: grid;
|
|
564
|
+
place-items: center;
|
|
565
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
566
|
+
}
|
|
567
|
+
.seams-voiceid-prompt .seams-voiceid-record-slot {
|
|
568
|
+
grid-row: 5;
|
|
569
|
+
grid-column: 1;
|
|
570
|
+
align-self: center;
|
|
571
|
+
width: 100%;
|
|
572
|
+
box-sizing: border-box;
|
|
573
|
+
}
|
|
574
|
+
.seams-voiceid-prompt .seams-voiceid-primary {
|
|
575
|
+
width: 100%;
|
|
576
|
+
min-height: var(--seams-shape-controlHeight, 44px);
|
|
577
|
+
padding: 0.75rem 1rem;
|
|
578
|
+
font-size: 0.875rem;
|
|
579
|
+
font-weight: 500;
|
|
580
|
+
border: 0;
|
|
581
|
+
border-radius: var(--seams-shape-control, 10px);
|
|
582
|
+
background: var(--seams-colors-textPrimary, #eff2f3);
|
|
583
|
+
color: var(--seams-colors-colorBackground, #192024);
|
|
584
|
+
}
|
|
585
|
+
.seams-voiceid-prompt .seams-voiceid-primary:disabled {
|
|
586
|
+
opacity: 0.5;
|
|
587
|
+
cursor: wait;
|
|
588
|
+
}
|
|
589
|
+
.seams-voiceid-prompt .seams-voiceid-microphone {
|
|
590
|
+
margin-top: 0.5rem;
|
|
591
|
+
padding: 0.25rem;
|
|
592
|
+
border: 0;
|
|
593
|
+
background: transparent;
|
|
594
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
595
|
+
font-size: 0.75rem;
|
|
596
|
+
}
|
|
597
|
+
.seams-voiceid-prompt button[hidden],
|
|
598
|
+
.seams-voiceid-prompt [hidden] {
|
|
599
|
+
display: none !important;
|
|
600
|
+
}
|
|
601
|
+
/* While VoiceID loads, its bar takes the answer line's place, its message the status line's,
|
|
602
|
+
and its retry the record button's. */
|
|
603
|
+
.seams-voiceid-progress-slot:has(> .seams-voiceid-model-download),
|
|
604
|
+
.seams-voiceid-progress-slot > .seams-voiceid-model-download { display: contents; }
|
|
605
|
+
.seams-voiceid-model-download > * { position: relative; z-index: 1; grid-column: 1; align-self: center; }
|
|
606
|
+
.seams-voiceid-prompt:has(.seams-voiceid-model-download:not([data-state="ready"])) > .seams-voiceid-ribbon,
|
|
607
|
+
.seams-voiceid-prompt:has(.seams-voiceid-model-download:not([data-state="ready"])) > .seams-voiceid-status { visibility: hidden; }
|
|
608
|
+
.seams-voiceid-prompt:has(.seams-voiceid-model-download:not([data-state="ready"])) > .seams-voiceid-phrase { opacity: 0.35; }
|
|
609
|
+
.seams-voiceid-prompt:has(.seams-voiceid-model-download[data-state="failed"]) > .seams-voiceid-record-slot { display: none; }
|
|
610
|
+
.seams-voiceid-model-download progress {
|
|
611
|
+
grid-row: 3;
|
|
612
|
+
justify-self: center;
|
|
613
|
+
appearance: none;
|
|
614
|
+
display: block;
|
|
615
|
+
width: min(100%, 308px);
|
|
616
|
+
height: 6px;
|
|
617
|
+
border: 0;
|
|
618
|
+
border-radius: 999px;
|
|
619
|
+
overflow: hidden;
|
|
620
|
+
background: var(--seams-colors-surface, #202b31);
|
|
621
|
+
color: var(--seams-colors-textPrimary, #eff2f3);
|
|
622
|
+
}
|
|
623
|
+
.seams-voiceid-model-download progress::-webkit-progress-bar { background: var(--seams-colors-surface, #202b31); }
|
|
624
|
+
.seams-voiceid-model-download progress::-webkit-progress-value { background: var(--seams-colors-textPrimary, #eff2f3); border-radius: 999px; transition: width 200ms linear; }
|
|
625
|
+
.seams-voiceid-model-download progress::-moz-progress-bar { background: var(--seams-colors-textPrimary, #eff2f3); border-radius: 999px; }
|
|
626
|
+
.seams-voiceid-model-download p {
|
|
627
|
+
grid-row: 4;
|
|
628
|
+
align-self: start;
|
|
629
|
+
margin: 0;
|
|
630
|
+
font-size: 0.75rem;
|
|
631
|
+
line-height: 1.5;
|
|
632
|
+
color: var(--seams-colors-textSecondary, #9cabb3);
|
|
633
|
+
font-variant-numeric: tabular-nums;
|
|
634
|
+
}
|
|
635
|
+
.seams-voiceid-model-download button { grid-row: 5; }
|
|
636
|
+
@media (hover: hover) and (pointer: fine) {
|
|
637
|
+
.seams-voiceid-close:hover { background: var(--seams-colors-surface, #202b31); }
|
|
638
|
+
.seams-voiceid-primary:hover:not(:disabled) { opacity: 0.9; }
|
|
639
|
+
}
|
|
640
|
+
`,nonce:n}),wr.set(e,o)),o.ensureBase(),this.element=e.createElement(`section`),this.element.className=`seams-voiceid-prompt`,this.element.setAttribute(`aria-label`,r),this.title=e.createElement(`h2`),this.title.textContent=`Read aloud`,this.phrase=e.createElement(`p`),this.phrase.className=`seams-voiceid-phrase`,this.phrase.dataset.voiceidPhrase=``,this.phrase.setAttribute(`aria-live`,`polite`),this.setPhrase(i),this.visual=new Cr(e,this.element,a),this.status=e.createElement(`p`),this.status.className=`seams-voiceid-status`,this.status.setAttribute(`role`,`status`),this.record=e.createElement(`button`),this.record.type=`button`,this.record.className=`seams-voiceid-primary`,this.record.textContent=`Record`,this.cancel=e.createElement(`button`),this.cancel.type=`button`,this.cancel.className=`seams-voiceid-close`;let s=e.createElementNS(`http://www.w3.org/2000/svg`,`svg`);s.setAttribute(`viewBox`,`0 0 24 24`),s.setAttribute(`width`,`20`),s.setAttribute(`height`,`20`),s.setAttribute(`aria-hidden`,`true`);let c=e.createElementNS(`http://www.w3.org/2000/svg`,`path`);c.setAttribute(`d`,`M6 6l12 12M18 6L6 18`),c.setAttribute(`fill`,`none`),c.setAttribute(`stroke`,`currentColor`),c.setAttribute(`stroke-width`,`1.75`),c.setAttribute(`stroke-linecap`,`round`),s.append(c),this.cancel.append(s),this.cancel.setAttribute(`aria-label`,`Cancel`),this.progress=e.createElement(`div`),this.progress.className=`seams-voiceid-progress-slot`;let l=e.createElement(`div`);l.className=`seams-voiceid-record-slot`,this.microphone=e.createElement(`button`),this.microphone.type=`button`,this.microphone.className=`seams-voiceid-microphone`,this.microphone.textContent=`Use system microphone`,this.microphone.hidden=!0,this.microphone.addEventListener(`click`,this.changeMicrophone),l.append(this.record,this.microphone),this.element.append(this.visual.glow,this.cancel,this.title,this.phrase,this.visual.element,this.status,l,this.progress)}setPhrase(e){let t=Tr.get(e)??e;this.phrase.textContent=t.charAt(0).toUpperCase()+t.slice(1)+`.`,this.phrase.dataset.voiceidPhrase=e}capture=e=>{if(!this.disposed)switch(e.kind){case`opening`:this.microphoneRequested=!0,this.microphone.hidden=!0;return;case`listening`:this.microphone.hidden=!0,this.element.dataset.capture=`listening`,this.record.hidden=!0,this.status.textContent=`Listening`,this.visual.listen();return;case`activity`:this.visual.add(e);return;case`measured`:e.quality.noise===`high`&&(this.status.textContent=`Background noise is high. Move closer to the microphone.`);return;case`processing`:this.element.dataset.capture=`processing`,this.lockLayout(),this.visual.checking(),this.status.textContent=`Checking your voice…`;return;default:return Mr(e)}};accepted(){this.visual.accept()}async succeed(e,t,n=this.element.getBoundingClientRect()){this.disposed||(this.element.dataset.capture=`succeeded`,this.record.hidden=!0,this.microphone.hidden=!0,await this.visual.succeed(this.beginSuccess.bind(this,e,t,n)))}ready(e){this.unlockLayout(),this.visual.ready(),this.element.dataset.capture=`ready`,this.status.textContent=e,this.record.hidden=!1,this.record.disabled=!1,this.microphone.hidden=!this.microphoneRequested}changeMicrophone=()=>{this.useSystemMicrophone()};async useSystemMicrophone(){this.record.disabled=!0,this.microphone.disabled=!0,await D(),!this.disposed&&(this.status.textContent=`The next recording will use your system microphone.`,this.record.disabled=!1,this.microphone.disabled=!1,this.microphone.hidden=!0,this.record.focus())}dispose(){this.disposed=!0,this.microphone.removeEventListener(`click`,this.changeMicrophone),this.visual.stop()}lockLayout(){for(let e of[this.element,this.phrase,this.status])e.style.minHeight=`${e.getBoundingClientRect().height}px`;this.element.style.height=this.element.style.minHeight}async beginSuccess(e,t,n){if(this.disposed)return;let r=this.visual.element.getBoundingClientRect(),i=(n.top+n.bottom-r.top-r.bottom)/2;if(this.visual.element.animate([{translate:`0 0`},{translate:`0 ${i}px`}],{duration:600,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`forwards`}),await Promise.all([this.title,this.phrase,this.status].map(Ar)),this.disposed)return;this.phrase.textContent=e,this.phrase.classList.add(`seams-voiceid-success-headline`),this.status.textContent=t,this.status.classList.add(`seams-voiceid-success-message`);let a=matchMedia(`(prefers-reduced-motion: reduce)`).matches;for(let[e,t]of[this.phrase,this.status].entries())t.style.translate=`0 ${i}px`,jr(t,a,Or-Dr+e*kr)}unlockLayout(){for(let e of[this.element,this.phrase,this.status])e.style.minHeight=``;this.element.style.height=``}};const Dr=150,Or=450,kr=40;function Ar(e){return e.animate([{opacity:1},{opacity:0}],{duration:150,easing:`ease-in`,fill:`forwards`}).finished}function jr(e,t,n){e.animate([{opacity:0,transform:t?`none`:`translateY(4px)`},{opacity:1,transform:`none`}],{delay:n,duration:300,easing:`cubic-bezier(0.2, 0, 0, 1)`,fill:`both`})}function Mr(e){throw Error(`Unexpected capture event: ${String(e)}`)}export{F as a,ne as c,m as d,_ as f,f as g,s as h,A as i,k as l,p as m,Ge as n,P as o,g as p,we as r,N as s,Er as t,v as u};
|