PageSourceSearch

https://www.pepsico.com/_next/static/chunks/reactPlayerYouTube.55fa745fcd5cec96.js

js pepsico.com collected 2026-09-24 08:24:37 UTC 10,895 bytes, 17 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[439],{173:function(e,t,i){i.r(t),i.d(t,{default:function(){return k}});var s=i(7294);let n=/(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})/,o=/(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/.*?[?&]list=)([\w_-]+)/;function a(e,t={}){let i={src:r(e,t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"};return t.config&&(i["data-config"]=JSON.stringify(t.config)),`
2    <style>
3      :host {
4        display: inline-block;
5        line-height: 0;
6        position: relative;
7        min-width: 300px;
8        min-height: 150px;
9      }
10      iframe {
11        position: absolute;
12        top: 0;
13        left: 0;
14      }
15    </style>
16    <iframe${function(e){let t="";for(let i in e){let s=e[i];""===s?t+=` ${u(i)}`:t+=` ${u(i)}="${u(`${s}`)}"`}return t}(i)}></iframe>
17  `}function r(e,t){if(!e.src)return;let i=e.src.includes("-nocookie")?"https://www.youtube-nocookie.com/embed":"https://www.youtube.com/embed",s={controls:""===e.controls?null:0,autoplay:e.autoplay,loop:e.loop,mute:e.muted,playsinline:e.playsinline,preload:e.preload??"metadata",enablejsapi:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1,...t.config};if(n.test(e.src)){let t=e.src.match(n),o=t&&t[1];return`${i}/${o}?${h(s)}`}let a=e.src.match(o),r={listType:"playlist",list:a&&a[1],...s};return`${i}?${h(r)}`}class l extends(globalThis.HTMLElement??class{}){static getTemplateHTML=a;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src"];loadComplete=new v;#e;#t;#i=0;#s=!1;#n;isLoaded=!1;#o=null;#a=null;constructor(){super(),this.#r("config")}get config(){return this.#a}set config(e){this.#a=e}async load(){let e;if(this.#e)return;this.shadowRoot||this.attachShadow({mode:"open"});let t=!this.#t;this.#t&&(this.loadComplete=new v,this.isLoaded=!1),this.#t=!0,await (this.#e=Promise.resolve()),this.#e=null,this.#i=0,this.dispatchEvent(new Event("emptied"));let i=this.api;if(this.api=null,!this.src){null==i||i.destroy();return}this.dispatchEvent(new Event("loadstart"));let s=this.shadowRoot.querySelector("iframe"),n=function(e){let t={};for(let i of e)t[i.name]=i.value;return t}(this.attributes);t&&s&&(this.#a=JSON.parse(s.getAttribute("data-config")||"{}")),(null==s?void 0:s.src)&&s.src===r(n,this)||(this.shadowRoot.innerHTML=a(n,this),s=this.shadowRoot.querySelector("iframe"));let o=await c("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady");this.api=new o.Player(s,{events:{onReady:()=>{this.#i=1,this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("volumechange")),this.dispatchEvent(new Event("loadcomplete")),this.isLoaded=!0,this.loadComplete.resolve()},onError:e=>{console.error(e),this.#o={code:e.data,message:`YouTube iframe player error #${e.data}; visit https://developers.google.com/youtube/iframe_api_reference#onError for the full error message.`},this.dispatchEvent(new Event("error"))}}});let l=!1;this.api.addEventListener("onStateChange",e=>{var t;let i=e.data;if(i!==o.PlayerState.PLAYING&&i!==o.PlayerState.BUFFERING||l||(l=!0,this.dispatchEvent(new Event("play"))),i===o.PlayerState.PLAYING)this.seeking&&(this.#s=!1,null==(t=this.#n)||t.resolve(),this.dispatchEvent(new Event("seeked"))),this.#i=3,this.dispatchEvent(new Event("playing"));else if(i===o.PlayerState.PAUSED){let e=Math.abs(this.currentTime-u);!this.seeking&&e>.1&&(this.#s=!0,this.dispatchEvent(new Event("seeking"))),l=!1,this.dispatchEvent(new Event("pause"))}i===o.PlayerState.ENDED&&(l=!1,this.dispatchEvent(new Event("pause")),this.dispatchEvent(new Event("ended")),this.loop&&this.play())}),this.api.addEventListener("onPlaybackRateChange",()=>{this.dispatchEvent(new Event("ratechange"))}),this.api.addEventListener("onVolumeChange",()=>{this.dispatchEvent(new Event("volumechange"))}),this.api.addEventListener("onVideoProgress",()=>{this.dispatchEvent(new Event("timeupdate"))}),await this.loadComplete;let u=0;setInterval(()=>{var e;let t=Math.abs(this.currentTime-u),i=this.buffered.end(this.buffered.length-1);this.seeking&&i>.1?(this.#s=!1,null==(e=this.#n)||e.resolve(),this.dispatchEvent(new Event("seeked"))):!this.seeking&&t>.1&&(this.#s=!0,this.dispatchEvent(new Event("seeking"))),u=this.currentTime},50);let h=setInterval(()=>{let t=this.buffered.end(this.buffered.length-1);t>=this.duration&&(clearInterval(h),this.#i=4),e!=t&&(e=t,this.dispatchEvent(new Event("progress")))},100)}async attributeChangedCallback(e,t,i){if(t!==i)switch(e){case"src":case"auto
17play":case"controls":case"loop":case"playsinline":this.load()}}async play(){var e,t,i;return this.#n=null,await this.loadComplete,null==(e=this.api)||e.playVideo(),t=this,(i=(e,i)=>{let s;t.addEventListener(e,s=()=>{t.removeEventListener(e,s),i()})},(...e)=>new Promise(t=>{i(...e,(...e)=>{e.length>1?t(e):t(e[0])})}))("playing")}async pause(){var e;return await this.loadComplete,null==(e=this.api)?void 0:e.pauseVideo()}get seeking(){return this.#s}get readyState(){return this.#i}get src(){return this.getAttribute("src")}set src(e){this.src!=e&&this.setAttribute("src",e)}get error(){return this.#o}get paused(){var e,t;return this.isLoaded?[-1,0,2,5].includes(null==(t=null==(e=this.api)?void 0:e.getPlayerState)?void 0:t.call(e)):!this.autoplay}get duration(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getDuration)?void 0:t.call(e))??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(e){this.autoplay!=e&&this.toggleAttribute("autoplay",!!e)}get buffered(){var e,t;if(!this.isLoaded)return f();let i=(null==(e=this.api)?void 0:e.getVideoLoadedFraction())*(null==(t=this.api)?void 0:t.getDuration());return i>0?f(0,i):f()}get controls(){return this.hasAttribute("controls")}set controls(e){this.controls!=e&&this.toggleAttribute("controls",!!e)}get currentTime(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getCurrentTime)?void 0:t.call(e))??0}set currentTime(e){this.currentTime!=e&&(this.#n=new v,this.loadComplete.then(()=>{var t,i;null==(t=this.api)||t.seekTo(e,!0),this.paused&&(null==(i=this.#n)||i.then(()=>{var e;this.#n&&(null==(e=this.api)||e.pauseVideo())}))}))}set defaultMuted(e){this.defaultMuted!=e&&this.toggleAttribute("muted",!!e)}get defaultMuted(){return this.hasAttribute("muted")}get loop(){return this.hasAttribute("loop")}set loop(e){this.loop!=e&&this.toggleAttribute("loop",!!e)}set muted(e){this.muted!=e&&this.loadComplete.then(()=>{var t,i;e?null==(t=this.api)||t.mute():null==(i=this.api)||i.unMute()})}get muted(){var e,t;return this.isLoaded?null==(t=null==(e=this.api)?void 0:e.isMuted)?void 0:t.call(e):this.defaultMuted}get playbackRate(){var e,t;return(null==(t=null==(e=this.api)?void 0:e.getPlaybackRate)?void 0:t.call(e))??1}set playbackRate(e){this.playbackRate!=e&&this.loadComplete.then(()=>{var t;null==(t=this.api)||t.setPlaybackRate(e)})}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(e){this.playsInline!=e&&this.toggleAttribute("playsinline",!!e)}get poster(){return this.getAttribute("poster")}set poster(e){this.poster!=e&&this.setAttribute("poster",`${e}`)}set volume(e){this.volume!=e&&this.loadComplete.then(()=>{var t;null==(t=this.api)||t.setVolume(100*e)})}get volume(){var e;return this.isLoaded?(null==(e=this.api)?void 0:e.getVolume())/100:1}#r(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}}function u(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/`/g,"&#x60;")}function h(e){return String(new URLSearchParams(function(e){let t={};for(let i in e){let s=e[i];!0===s||""===s?t[i]=1:!1===s?t[i]=0:null!=s&&(t[i]=s)}return t}(e)))}let d={};async function c(e,t,i){return d[e]?d[e]:t&&self[t]?(await p(0),self[t]):d[e]=new Promise(function(s,n){let o=document.createElement("script");o.src=e;let a=()=>s(self[t]);i&&(self[i]=a),o.onload=()=>!i&&a(),o.onerror=n,document.head.append(o)})}let p=e=>new Promise(t=>setTimeout(t,e));class v extends Promise{constructor(e=()=>{}){let t,i;super((s,n)=>{e(s,n),t=s,i=n}),this.resolve=t,this.reject=i}}function f(e,t){return Array.isArray(e)?m(e):null==e||null==t||0===e&&0===t?m([[0,0]]):m([[e,t]])}function m(e){return Object.defineProperties(e,{start:{value:t=>e[t][0]},end:{value:t=>e[t][1]}}),e}globalThis.customElements&&!globalThis.customElements.get("youtube-video")&&globalThis.customElements.define("youtube-video",l);var g=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),y={className:"class",htmlFor:"for"};function w(e){return e.toLowerCase()}function b(e){return"boolean"==typeof e?e?"":void 0:"function"==typeof e?void 0:"object"!=typeof e||null===e?e:void 0}function E(e,t,i){var s;e[t]=i,null==i&&t in((null==(s=globalThis.HTMLElement)?void 0:s.prototype)??{})&&e.removeAttribute(t)}var k=function({react:e,tagName:t,elementClass:i,events:s,displayName:n,defaultProps:o,toAttributeName:a=w,toAttributeValue:r=b}){let l=Number.parseInt(e.version)>=19,u=e.forwardRef((n,u)=>{var h,d;let c=e.useRef(null),p=e.useRef(new Map),v={},f={},m={},w={};for(let[e,t]of Object.entries(n)){if(g.has(e)){m[e]=t;continue}let s=a(y[e]??e);if(i.prototype&&e in i.prototype&&!(e in((null==(h=globalThis.HTMLElement)?void 0:h.prototype)??{}))&&!(null==(d=i.observedAttributes)?void 0:d.some(e=>e===s))){w[e]=t;continue}if(e.startsWith("on")){v[e]=t;continue}let n=r(t);s&&null!=n&&(f[s]=String(n),l||(m[s]=n)),s&&l&&(n!==b(t)?m[s]=n:m[s]=t)}if("undefined"!=typeof window){for(let t in v){let i=v[t],n=t.endsWith("Capture"),o=((null==s?void 0:s[t])??t.slice(2).toLowerCase()).slice(0,n?-7:void 0);e.useLayoutEffect(()=>{let e=null==c?void 0:c.current;if(e&&"function"==typeof i)return e.addEventListener(o,i,n),()=>{e.removeEventListener(o,i,n)}},[null==c?void 0:c.current,i])}e.useLayoutEffect(()=>{if(null===c.current)return;let e=new Map;for(let t in w)E(c.current,t,w[t]),p.current.delete(t),e.set(t,w[t]);for(let[e,t]of p.current)E(c.current,e,void 0);p.current=e})}if("undefined"==typeof window&&(null==i?void 0:i.getTemplateHTML)&&(null==i?void 0:i.shadowRootOptions)){let{mode:t,delegatesFocus:s}=i.shadowRootOptions,o=e.createElement("template",{shadowrootmode:t,shadowrootdelegatesfocus:s,dangerouslySetInnerHTML:{__html:i.getTemplateHTML(f,n)}});m.children=[o,m.children]}return e.createElement(t,{...o,...m,ref:e.useCallback(e=>{c.current=e,"function"==typeof u?u(e):null!==u&&(u.current=e)},[u])})});return u.displayName=n??i.name,u}({react:s,tagName:"youtube-video",elementClass:l,toAttributeName:e=>"muted"===e?"":"defaultMuted"===e?"muted":w(e)})}}]);

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.