PageSourceSearch

https://dext.com/_next/static/chunks/reactPlayerTwitch.57b9d7e486ae9ee9.js

js dext.com collected 2026-09-24 08:33:32 UTC 8,663 bytes, 21 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2042],{44841:(t,e,i)=>{i.r(e),i.d(e,{default:()=>w});var s=i(12115);let a="https://player.twitch.tv",n=/(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/,r=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/;function o(t,e={}){let i={src:l(t,e),frameborder:"0",width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; picture-in-picture;",sandbox:"allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",scrolling:"no"};return e.config&&(i["data-config"]=JSON.stringify(e.config)),`
2    <style>
3      :host {
4        display: inline-block;
5        min-width: 300px;
6        min-height: 150px;
7        position: relative;
8      }
9      iframe {
10        position: absolute;
11        top: 0;
12        left: 0;
13        width: 100%;
14        height: 100%;
15      }
16      :host(:not([controls])) {
17        pointer-events: none;
18      }
19    </style>
20    <iframe${function(t){let e="";for(let i in t){let s=t[i];""===s?e+=` ${d(i)}`:e+=` ${d(i)}="${d(`${s}`)}"`}return e}(i)}></iframe>
21  `}function l(t,e){var i;if(!t.src)return;let s=t.src.match(n),o=t.src.match(r),l={parent:null==(i=globalThis.location)?void 0:i.hostname,controls:""===t.controls&&null,autoplay:""===t.autoplay&&null,muted:t.muted,preload:t.preload,...e.config};if(s){let t=s[1];return`${a}/?video=v${t}&${h(l)}`}if(o){let t=o[1];return`${a}/?channel=${t}&${h(l)}`}return""}class u extends(globalThis.HTMLElement??class{}){static getTemplateHTML=o;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","loop","muted","playsinline","preload","src"];loadComplete=new c;#t;#e;#i;#s={};#a=0;#n=!1;#r=1;#o=!this.autoplay;#l=!1;#u=0;#d=null;constructor(){super(),this.#h("config")}get config(){return this.#d}set config(t){this.#d=t}async load(){if(this.#t)return;this.shadowRoot||this.attachShadow({mode:"open"});let t=!this.#e;if(this.#e&&(this.loadComplete=new c),this.#e=!0,await (this.#t=Promise.resolve()),this.#t=null,this.#u=0,this.dispatchEvent(new Event("emptied")),!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",this.#c);return}this.dispatchEvent(new Event("loadstart"));let e=this.shadowRoot.querySelector("iframe"),i=function(t){let e={};for(let i of t)e[i.name]=i.value;return e}(this.attributes);t&&e&&(this.#d=JSON.parse(e.getAttribute("data-config")||"{}")),(null==e?void 0:e.src)&&e.src===l(i,this)||(this.shadowRoot.innerHTML=o(i,this),e=this.shadowRoot.querySelector("iframe")),this.#i=e,globalThis.addEventListener("message",this.#c)}attributeChangedCallback(t,e,i){if(e!==i)switch(t){case"src":case"controls":this.load()}}getVideoPlaybackQuality(){return this.#s.stats.videoStats}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}get readyState(){return this.#u}get seeking(){return this.#l}get buffered(){var t,e,i;return i=(null==(e=null==(t=this.#s.stats)?void 0:t.videoStats)?void 0:e.bufferSize)??0,Array.isArray(0)?p(0):null==i||0===i?p([[0,0]]):p([[0,i]])}get paused(){return this.#s.playback?"Idle"===this.#s.playback:this.#o}get ended(){return!!this.#s.playback&&"Ended"===this.#s.playback}get duration(){return this.#s.duration??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(t){this.autoplay!=t&&this.toggleAttribute("autoplay",!!t)}get controls(){return this.hasAttribute("controls")}set controls(t){this.controls!=t&&this.toggleAttribute("controls",!!t)}get currentTime(){return this.#s.currentTime?this.#s.currentTime:this.#a}set currentTime(t){this.#a=t,this.loadComplete.then(()=>{this.#p(4,t)})}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(t){this.toggleAttribute("muted",!!t)}get loop(){return this.hasAttribute("loop")}set loop(t){this.toggleAttribute("loop",!!t)}get muted(){return this.#n}set muted(t){this.#n=t,this.loadComplete.then(()=>{this.#p(10,t)})}get volume(){return this.#r}set volume(t){this.#r=t,this.loadComplete.then(()=>{this.#p(11,t)})}get playsInline(){return this.hasAttribute("playsinline")}
21set playsInline(t){this.toggleAttribute("playsinline",!!t)}play(){this.#o=!1,this.#p(3)}pause(){this.#o=!0,this.#p(2)}#c=async t=>{var e,i,s,a;if(!this.#i.contentWindow)return;let{data:n,source:r}=t;if(r===this.#i.contentWindow){if("twitch-embed"===n.namespace)await new Promise(t=>setTimeout(t,10)),"ready"===n.eventName?(this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve(),this.#u=1,this.dispatchEvent(new Event("loadedmetadata"))):"seek"===n.eventName?(this.#l=!0,this.dispatchEvent(new Event("seeking"))):"playing"===n.eventName?(this.#l&&(this.#l=!1,this.dispatchEvent(new Event("seeked"))),this.#u=3,this.dispatchEvent(new Event("playing"))):this.dispatchEvent(new Event(n.eventName));else if("twitch-embed-player-proxy"===n.namespace&&"UPDATE_STATE"===n.eventName){let t=this.#s.duration,r=this.#s.currentTime,o=this.#s.volume,l=this.#s.muted,u=null==(i=null==(e=this.#s.stats)?void 0:e.videoStats)?void 0:i.bufferSize;this.#s={...this.#s,...n.params},t!==this.#s.duration&&this.dispatchEvent(new Event("durationchange")),r!==this.#s.currentTime&&this.dispatchEvent(new Event("timeupdate")),(o!==this.#s.volume||l!==this.#s.muted)&&(void 0!==this.#s.volume&&(this.#r=this.#s.volume),void 0!==this.#s.muted&&(this.#n=this.#s.muted),this.dispatchEvent(new Event("volumechange"))),u!==(null==(a=null==(s=this.#s.stats)?void 0:s.videoStats)?void 0:a.bufferSize)&&this.dispatchEvent(new Event("progress"))}}};#p(t,e){this.#i.contentWindow&&this.#i.contentWindow.postMessage({eventName:t,params:e,namespace:"twitch-embed-player-proxy"},a)}#h(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}}function d(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}function h(t){return String(new URLSearchParams(function(t){let e={};for(let i in t){let s=t[i];!0===s||""===s?e[i]=!0:!1===s?e[i]=!1:null!=s&&(e[i]=s)}return e}(t)))}class c extends Promise{constructor(t=()=>{}){let e,i;super((s,a)=>{t(s,a),e=s,i=a}),this.resolve=e,this.reject=i}}function p(t){return Object.defineProperties(t,{start:{value:e=>t[e][0]},end:{value:e=>t[e][1]}}),t}globalThis.customElements&&!globalThis.customElements.get("twitch-video")&&globalThis.customElements.define("twitch-video",u);var m=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),f={className:"class",htmlFor:"for"};function v(t){return t.toLowerCase()}function g(t){return"boolean"==typeof t?t?"":void 0:"function"==typeof t?void 0:"object"!=typeof t||null===t?t:void 0}function y(t,e,i){var s;t[e]=i,null==i&&e in((null==(s=globalThis.HTMLElement)?void 0:s.prototype)??{})&&t.removeAttribute(e)}var w=function({react:t,tagName:e,elementClass:i,events:s,displayName:a,defaultProps:n,toAttributeName:r=v,toAttributeValue:o=g}){let l=Number.parseInt(t.version)>=19,u=t.forwardRef((a,u)=>{var d,h;let c=t.useRef(null),p=t.useRef(new Map),v={},w={},b={},S={};for(let[t,e]of Object.entries(a)){if(m.has(t)){b[t]=e;continue}let s=r(f[t]??t);if(i.prototype&&t in i.prototype&&!(t in((null==(d=globalThis.HTMLElement)?void 0:d.prototype)??{}))&&!(null==(h=i.observedAttributes)?void 0:h.some(t=>t===s))){S[t]=e;continue}if(t.startsWith("on")){v[t]=e;continue}let a=o(e);s&&null!=a&&(w[s]=String(a),l||(b[s]=a)),s&&l&&(a!==g(e)?b[s]=a:b[s]=e)}if("u">typeof window){for(let e in v){let i=v[e],a=e.endsWith("Capture"),n=((null==s?void 0:s[e])??e.slice(2).toLowerCase()).slice(0,a?-7:void 0);t.useLayoutEffect(()=>{let t=null==c?void 0:c.current;if(t&&"function"==typeof i)return t.addEventListener(n,i,a),()=>{t.removeEventListener(n,i,a)}},[null==c?void 0:c.current,i])}t.useLayoutEffect(()=>{if(null===c.current)return;let t=new Map;for(let e in S)y(c.current,e,S[e]),p.current.delete(e),t.set(e,S[e]);for(let[t,e]of p.current)y(c.current,t,void 0);p.current=t})}if("u"<typeof window&&(null==i?void 0:i.getTemplateHTML)&&(null==i?void 0:i.shadowRootOptions)){let{mode:e,delegatesFocus:s}=i.shadowRootOptions;b.children=[t.createElement("template",{shadowrootmode:e,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:i.getTemplateHTML(w,a)},key:"ce-la-react-ssr-template-shadow-root"}),b.children]}return t.createElement(e,{...n,...b,ref:t.useCallback(t=>{c.current=t,"function"==typeof u?u(t):null!==u&&(u.current=t)},[u])},b.children)});return u.displayName=a??i.name,u}({react:s,tagName:"twitch-video",elementClass:u,toAttributeName:t=>"muted"===t?"":"defaultMuted"===t?"muted":v(t)})}}]);

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