{"version":3,"file":"react-lite-youtube-embed-r_LKmalF.js","sources":["../../node_modules/react-lite-youtube-embed/dist/index.es.js"],"sourcesContent":["/**\n* react-lite-youtube-embed v2.4.0\n* https://github.com/ibrahimcesar/react-lite-youtube-embed.git\n*\n* Copyright (c) Ibrahim Cesar < email@ibrahimcesar.com > and project contributors.\n*\n* This source code is licensed under the MIT license found in the\n* LICENSE file in the root directory of this source tree.\n*\n* Author site: https://ibrahimcesar.cloud\n*/\n import * as React from 'react';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nfunction LiteYouTubeEmbedComponent(props, ref) {\n var _a = React.useState(false), preconnected = _a[0], setPreconnected = _a[1];\n var _b = React.useState(false), iframe = _b[0], setIframe = _b[1];\n var videoId = encodeURIComponent(props.id);\n var videoPlaylisCovertId = typeof props.playlistCoverId === 'string' ? encodeURIComponent(props.playlistCoverId) : null;\n var videoTitle = props.title;\n var posterImp = props.poster || \"hqdefault\";\n var paramsImp = \"&\".concat(props.params) || \"\";\n var mutedImp = props.muted ? \"&mute=1\" : \"\";\n var announceWatch = props.announce || \"Watch\";\n var format = props.webp ? 'webp' : 'jpg';\n var vi = props.webp ? 'vi_webp' : 'vi';\n var posterUrl = props.thumbnail || (!props.playlist\n ? \"https://i.ytimg.com/\".concat(vi, \"/\").concat(videoId, \"/\").concat(posterImp, \".\").concat(format)\n : \"https://i.ytimg.com/\".concat(vi, \"/\").concat(videoPlaylisCovertId, \"/\").concat(posterImp, \".\").concat(format));\n var ytUrl = props.noCookie\n ? \"https://www.youtube-nocookie.com\"\n : \"https://www.youtube.com\";\n ytUrl = props.cookie\n ? \"https://www.youtube.com\"\n : \"https://www.youtube-nocookie.com\";\n var iframeSrc = !props.playlist\n ? \"\".concat(ytUrl, \"/embed/\").concat(videoId, \"?autoplay=1&state=1\").concat(mutedImp).concat(paramsImp)\n : \"\".concat(ytUrl, \"/embed/videoseries?autoplay=1\").concat(mutedImp, \"&list=\").concat(videoId).concat(paramsImp);\n var activatedClassImp = props.activatedClass || \"lyt-activated\";\n var adNetworkImp = props.adNetwork || false;\n var aspectHeight = props.aspectHeight || 9;\n var aspectWidth = props.aspectWidth || 16;\n var iframeClassImp = props.iframeClass || \"\";\n var playerClassImp = props.playerClass || \"lty-playbtn\";\n var wrapperClassImp = props.wrapperClass || \"yt-lite\";\n var onIframeAdded = props.onIframeAdded || function () { };\n var rel = props.rel ? 'prefetch' : 'preload';\n var ContainerElement = props.containerElement || 'article';\n var warmConnections = function () {\n if (preconnected)\n return;\n setPreconnected(true);\n };\n var addIframe = function () {\n if (iframe)\n return;\n setIframe(true);\n };\n React.useEffect(function () {\n if (iframe) {\n onIframeAdded();\n }\n }, [iframe]);\n return (React.createElement(React.Fragment, null,\n React.createElement(\"link\", { rel: rel, href: posterUrl, as: \"image\" }),\n React.createElement(React.Fragment, null, preconnected && (React.createElement(React.Fragment, null,\n React.createElement(\"link\", { rel: \"preconnect\", href: ytUrl }),\n React.createElement(\"link\", { rel: \"preconnect\", href: \"https://www.google.com\" }),\n adNetworkImp && (React.createElement(React.Fragment, null,\n React.createElement(\"link\", { rel: \"preconnect\", href: \"https://static.doubleclick.net\" }),\n React.createElement(\"link\", { rel: \"preconnect\", href: \"https://googleads.g.doubleclick.net\" })))))),\n React.createElement(ContainerElement, { onPointerOver: warmConnections, onClick: addIframe, className: \"\".concat(wrapperClassImp, \" \").concat(iframe ? activatedClassImp : \"\"), \"data-title\": videoTitle, style: __assign({ backgroundImage: \"url(\".concat(posterUrl, \")\") }, {\n '--aspect-ratio': \"\".concat((aspectHeight / aspectWidth) * 100, \"%\"),\n }) },\n React.createElement(\"button\", { type: \"button\", className: playerClassImp, \"aria-label\": \"\".concat(announceWatch, \" \").concat(videoTitle) }),\n iframe && (React.createElement(\"iframe\", { ref: ref, className: iframeClassImp, title: videoTitle, width: \"560\", height: \"315\", frameBorder: \"0\", allow: \"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\", allowFullScreen: true, src: iframeSrc })))));\n}\nvar index = React.forwardRef(LiteYouTubeEmbedComponent);\n\nexport { index as default };\n//# sourceMappingURL=index.es.js.map\n"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","this","index","React.forwardRef","forwardRef","props","ref","_a","React.useState","preconnected","setPreconnected","_b","iframe","setIframe","videoId","encodeURIComponent","id","videoPlaylisCovertId","playlistCoverId","videoTitle","title","posterImp","poster","paramsImp","concat","params","mutedImp","muted","announceWatch","announce","format","webp","vi","posterUrl","thumbnail","playlist","ytUrl","noCookie","cookie","iframeSrc","activatedClassImp","activatedClass","adNetworkImp","adNetwork","aspectHeight","aspectWidth","iframeClassImp","iframeClass","playerClassImp","playerClass","wrapperClassImp","wrapperClass","onIframeAdded","rel","ContainerElement","containerElement","React.useEffect","React.createElement","React.Fragment","href","as","createElement","Fragment","onPointerOver","onClick","className","style","backgroundImage","type","width","height","frameBorder","allow","allowFullScreen","src"],"mappings":";;;;;;;;;;;;;;gFA4BA,IAAIA,EAAW,WAQJ,OAPPA,EAAWC,OAAOC,QAAU,SAAkBC,GACjC,IAAA,IAAAC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAA,IAASI,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KAAMN,EAAAM,GAAKL,EAAEK,IAEvE,OAAAN,CACf,EACWH,EAASa,MAAMC,KAAMP,UAChC,EAiEG,IAACQ,EAAQC,EAAgBC,YA/D5B,SAAmCC,EAAOC,GAClC,IAAAC,EAAKC,EAAAA,UAAe,GAAQC,EAAeF,EAAG,GAAIG,EAAkBH,EAAG,GACvEI,EAAKH,EAAAA,UAAe,GAAQI,EAASD,EAAG,GAAIE,EAAYF,EAAG,GAC3DG,EAAUC,mBAAmBV,EAAMW,IACnCC,EAAwD,iBAA1BZ,EAAMa,gBAA+BH,mBAAmBV,EAAMa,iBAAmB,KAC/GC,EAAad,EAAMe,MACnBC,EAAYhB,EAAMiB,QAAU,YAC5BC,EAAY,IAAIC,OAAOnB,EAAMoB,SAAW,GACxCC,EAAWrB,EAAMsB,MAAQ,UAAY,GACrCC,EAAgBvB,EAAMwB,UAAY,QAClCC,EAASzB,EAAM0B,KAAO,OAAS,MAC/BC,EAAK3B,EAAM0B,KAAO,UAAY,KAC9BE,EAAY5B,EAAM6B,YAAe7B,EAAM8B,SAErC,uBAAuBX,OAAOQ,EAAI,KAAKR,OAAOP,EAAsB,KAAKO,OAAOH,EAAW,KAAKG,OAAOM,GADvG,uBAAuBN,OAAOQ,EAAI,KAAKR,OAAOV,EAAS,KAAKU,OAAOH,EAAW,KAAKG,OAAOM,IAE5FM,EAAQ/B,EAAMgC,SAGVD,EAAA/B,EAAMiC,OACR,0BACA,mCACN,IAAIC,EAAalC,EAAM8B,SAEjB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