PageSourceSearch

https://dyte-audio.netlify.app/static/js/9244.9a766a49.chunk.js

js dyte-audio.netlify.app collected 2026-10-03 10:40:25 UTC 8,485 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9244,5710],{9244:function(e,t,i){i.r(t),i.d(t,{dyte_audio_visualizer:function(){return v},dyte_switch:function(){return k}});var a,n=i(5671),s=i(3144),r=i(7762),o=i(3433),c=i(2304),l=i(5855),h=i(7622),d=u;function u(){}u.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,i){this.callbacks=this.callbacks||{};var a=3===arguments.length,n=a?arguments[1]:void 0,s=a?arguments[2]:arguments[1];return s._groupName=n,(this.callbacks[e]=this.callbacks[e]||[]).push(s),this},t.once=function(e,t,i){var a=this,n=3===arguments.length,s=n?arguments[1]:void 0,r=n?arguments[2]:arguments[1];return this.on(e,s,(function t(){a.off(e,t),r.apply(this,arguments)})),this},t.releaseGroup=function(e){var t,i,a,n;for(t in this.callbacks=this.callbacks||{},this.callbacks)for(i=0,a=(n=this.callbacks[t]).length;i<a;i++)n[i]._groupName===e&&(n.splice(i,1),i--,a--);return this},t.off=function(e,t){this.callbacks=this.callbacks||{};var i,a=this.callbacks[e];return a?1===arguments.length?(delete this.callbacks[e],this):(-1!==(i=a.indexOf(t))&&(a.splice(i,1),0===a.length&&delete this.callbacks[e]),this):this},t.emit=function(e){this.callbacks=this.callbacks||{};var t,i,a,n=[].slice.call(arguments,1),s=this.callbacks[e],r=this.getWildcardCallbacks(e);if(s)for(t=0,i=(a=s.slice()).length;t<i&&a[t];++t)a[t].apply(this,n);if(r)for(i=r.length,t=0,i=(a=r.slice()).length;t<i&&a[t];++t)a[t].apply(this,[e].concat(n));return this},t.getWildcardCallbacks=function(e){this.callbacks=this.callbacks||{};var t,i,a=[];for(t in this.callbacks)i=t.split("*"),("*"===t||2===i.length&&e.slice(0,i[0].length)===i[0])&&(a=a.concat(this.callbacks[t]));return a}},u.mixin(u),"undefined"!==typeof window&&(a=window.AudioContext||window.webkitAudioContext);var p=null,f=function(e,t){if(null!=e){var i=Math.round(1.5),a=(0,o.Z)(Array(3)).map((function(e,a){var n=a;return n>i-1&&(n=3-n-1),Math.round((n+1)/(i+1)*t)})),n=e.width,s=e.height,c=e.getContext("2d"),l=2,h=1*n/a.length,d=h-4;c.clearRect(0,0,n,s),c.fillStyle="rgb(0,0,0,0.0)",c.fillRect(0,0,n,s);var u=getComputedStyle(e).getPropertyValue("color");c.fillStyle=u,c.strokeStyle=u,c.lineCap="round",c.lineWidth=4,c.beginPath();var p,f=(0,r.Z)(a);try{for(f.s();!(p=f.n()).done;){var v=p.value,k=Math.min(-Math.abs(1.2*v/10*s)+s/2,s/2-2.5),y=Math.max(2*(s/2-k),5);c.moveTo(l+d/2,k),c.lineTo(l+d/2,k+y),l+=h}}catch(g){f.e(g)}finally{f.f()}c.stroke()}},v=function(){function e(t){(0,n.Z)(this,e),(0,c.r)(this,t),this.variant="bars",this.participant=void 0,this.size=void 0,this.iconPack=l.d,this.t=(0,h.u)(),this.isScreenShare=!1,this.audioEnabled=void 0,this.volume=0}return(0,s.Z)(e,[{key:"connectedCallback",value:function(){this.participantChanged(this.participant)}},{key:"componentDidLoad",value:function(){f(this.visualizer,0)}},{key:"disconnectedCallback",value:function(){var e,t,i;null===(e=this.hark)||void 0===e||e.stop(),this.audioUpdateListener&&(null===(t=this.participant)||void 0===t||t.removeListener("audioUpdate",this.audioUpdateListener)),this.screenShareUpdateListener&&(null===(i=this.participant)||void 0===i||i.removeListener("screenShareUpdate",this.screenShareUpdateListener))}},{key:"participantChanged",value:function(e){var t=this;null!=e&&(this.audioUpdateListener=function(e){var i,a=e.audioEnabled,n=e.audioTrack;if(null===(i=t.hark)||void 0===i||i.stop(),a&&null!=n){t.audioEnabled=!0;var s=new MediaStream;s.addTrack(n),t.calcVolume(s),f(t.visualizer,0)}else t.volume=0,t.audioEnabled=!1},this.isScreenShare?(this.screenShareUpdateListener=function(e){var i=e.screenShareEnabled,a=e.screenShareTracks;t.audioUpdateListener({audioEnabled:i&&null!=a.audio,audioTrack:a.audio})},this.screenShareUpdateListener(e),e.addListener("screenShareUpdate",this.screenShareUpdateListener)):(this.audioUpdateListener(e),e.addListener("audioUpdate",this.audioUpdateListener)))}},{key:"calcVolume",value:function(e){var t=this;this.hark=function(e,t){var i=new d;if(!a)return i;var n,s,r,o=(t=t||{}).smoothing||.1,c=t.interval||50,l=t.threshold,h=t.play,u=t.history||10,f=!0;p=t.audioContext||p||new a,(r=p.createAnalyser()).fftSize=512,r.smoothingTimeConstant=o,s=new Float32Array(r.frequencyBinCount),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(n=p.createMediaElementSource(e),"undefined"===typeof h&&(h=!0),l=l||-50):(n=p.createMediaStreamSource(e),l=l||-50),n.connect(r),h&&r.connect(p.destination),i.speaking=!1,i.suspend=function(){return p.suspend()},i.resume=function(){return p.resume()},Object.defineProperty(i,"state",{get:function(){return p.state}}),p.onstatechange=function(){i.emit("state_change",p.state)},i.setThreshold=function(e){l=e},i.setInterval=function(e){c=e},i.stop=function(){f=!1,i.emit("volume_change",-100,l),i.speaking&&(i.speaking=!1,i.emit("stopped_speaking")),r.disconnect(),n.disconnect()},i.speakingHistory=[];for(var v=0;v<u;v++)i.speakingHistory.push(0);return function e(){setTimeout((function(){if(f){var t=function(e,t){var i=-1/0;e.getFloatFrequencyData(t);for(var a=4,n=t.length;a<n;a++)t[a]>i&&t[a]<0&&(i=t[a]);return i}(r,s);i.emit("volume_change",t,l);var a=0;if(t>l&&!i.speaking){for(var n=i.speakingHistory.length-3;n<i.speakingHistory.length;n++)a+=i.speakingHistory[n];a>=2&&(i.speaking=!0,i.emit("speaking"))}else if(t<l&&i.speaking){for(n=0;n<i.speakingHistory.length;n++)a+=i.speakingHistory[n];0==a&&(i.speaking=!1,i.emit("stopped_speaking"))}i.speakingHistory.shift(),i.speakingHistory.push(0+(t>l)),e()}}),c)}(),i}(e,{play:!1,interval:100}),this.hark.on("volume_change",(function(e){var i=t.volume,a=Math.round(10*Math.pow(10,e/115));a<3&&(a=0);var n=Math.round((2*i+a)/3);i!==n&&(t.volume=n,f(t.visualizer,t.volume))}))}},{key:"render",value:function(){var e=this;return(0,c.h)(c.H,null,(0,c.h)("canvas",{width:"24",height:"24",class:{bars:!0,visible:this.audioEnabled},ref:function(t){return e.visualizer=t},part:"canvas"}),!this.isScreenShare&&!this.audioEnabled&&(0,c.h)("dyte-icon",{icon:this.iconPack.mic_off,part:"mic-off-icon",iconPack:this.iconPack,t:this.t}))}}],[{key:"watchers",get:function(){return{participant:["participantChanged"]}}}]),e}();v.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;height:var(--dyte-space-6, 24px);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}canvas,dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([size='sm']){transform:scale(0.9)}
1canvas{display:none}canvas.visible{display:block}canvas.bars{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var k=function(){function e(t){var i=this;(0,n.Z)(this,e),(0,c.r)(this,t),this.dyteChange=(0,c.c)(this,"dyteChange",4),this.onClick=function(){i.readonly||i.disabled||(i.checked=!i.checked)},this.onKeyPress=function(e){if(!i.readonly)switch(e.key){case"Enter":case" ":i.checked=!i.checked}},this.checked=!1,this.readonly=!1,this.disabled=!1,this.iconPack=l.d,this.t=(0,h.u)()}return(0,s.Z)(e,[{key:"checkedChange",value:function(e){this.dyteChange.emit(e)}},{key:"render",value:function(){return(0,c.h)(c.H,{role:"switch",tabIndex:this.disabled&&0,"aria-readonly":this.readonly,"aria-checked":this.checked,"aria-disabled":this.disabled,class:{checked:this.checked},onClick:this.onClick,onKeyPress:this.onKeyPress},(0,c.h)("div",{class:"switch",part:"switch"}))}}],[{key:"watchers",get:function(){return{checked:["checkedChange"]}}}]),e}();k.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:inline-flex;height:var(--dyte-space-6, 24px);width:var(--dyte-space-10, 40px);align-items:center;padding:var(--dyte-space-1, 4px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));cursor:pointer}.switch{box-sizing:border-box;height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);background-color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)));border-radius:9999px;transition-property:var(--dyte-transition-property, all);transition-duration:200ms}:host(.checked){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host(.checked) .switch{transform:translateX(100%)}:host([readonly]),:host([disabled]){cursor:not-allowed;opacity:0.6}"}}]);
2//# sourceMappingURL=9244.9a766a49.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.