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jBC,QAAS,OACTC,WAAY,SACZC,eAAgB,UAEZC,EAAS,CACbC,QAAS,CACPC,MAAO,OACPC,OAAQ,OACRC,gBAAiBpC,IAAU2B,EAAY,OAAO3B,UAAW,EACzDqC,eAAgB,QAChBC,mBAAoB,SACpBC,OAAQ,aACLX,GAELY,OAAQ,CACNC,WAAY,2DACZC,aAAcjD,EACdyC,MAAOzC,EACP0C,OAAQ1C,EACRkD,SAAUhB,EAAY,gBAAa,KAChCC,GAELJ,SAAU,CACRoB,YAAa,QACbC,YAAa,mBACbC,YAAa,4CACbC,WAAY,QAGVC,EAAiC3D,EAAaJ,QAAQgE,cAAc,MAAO,CAC/EC,MAAOlB,EAAOQ,OACdW,UAAW,wBACK9D,EAAaJ,QAAQgE,cAAc,MAAO,CAC1DC,MAAOlB,EAAOR,SACd2B,UAAW,6BAEb,OAAsB9D,EAAaJ,QAAQgE,cAAc,MAAO,CAC9DC,MAAOlB,EAAOC,QACdkB,UAAW,wBACXhD,UACAiD,SAAU3B,EACV4B,WAAYtD,KAAKuD,gBAChB3B,EAAYjB,EAAQ,KAAMc,GAAYwB,EAC3C,E","sources":["../node_modules/react-player/lazy/Preview.js"],"sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {\n enumerable: true,\n configurable: true,\n writable: true,\n value\n}) : obj[key] = value;\nvar __export = (target, all) => {\n for (var name in all) __defProp(target, name, {\n get: all[name],\n enumerable: true\n });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n get: () => from[key],\n enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n// If the importer is in node compatibility mode or this is not an ESM\n// file that has been converted to a CommonJS file using a Babel-\n// compatible transform (i.e. \"__esModule\" has not been set), then set\n// \"default\" to the CommonJS \"module.exports\" for node compatibility.\nisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n value: mod,\n enumerable: true\n}) : target, mod));\nvar __toCommonJS = mod => __copyProps(__defProp({}, \"__esModule\", {\n value: true\n}), mod);\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nvar Preview_exports = {};\n__export(Preview_exports, {\n default: () => Preview\n});\nmodule.exports = __toCommonJS(Preview_exports);\nvar import_react = __toESM(require(\"react\"));\nconst ICON_SIZE = \"64px\";\nconst cache = {};\nclass Preview extends import_react.Component {\n constructor() {\n super(...arguments);\n __publicField(this, \"mounted\", false);\n __publicField(this, \"state\", {\n image: null\n });\n __publicField(this, \"handleKeyPress\", e => {\n if (e.key === \"Enter\" || e.key === \" \") {\n this.props.onClick();\n }\n });\n }\n componentDidMount() {\n this.mounted = true;\n this.fetchImage(this.props);\n }\n componentDidUpdate(prevProps) {\n const {\n url,\n light\n } = this.props;\n if (prevProps.url !== url || prevProps.light !== light) {\n this.fetchImage(this.props);\n }\n }\n componentWillUnmount() {\n this.mounted = false;\n }\n fetchImage({\n url,\n light,\n oEmbedUrl\n }) {\n if (import_react.default.isValidElement(light)) {\n return;\n }\n if (typeof light === \"string\") {\n this.setState({\n image: light\n });\n return;\n }\n if (cache[url]) {\n this.setState({\n image: cache[url]\n });\n return;\n }\n this.setState({\n image: null\n });\n return window.fetch(oEmbedUrl.replace(\"{url}\", url)).then(response => response.json()).then(data => {\n if (data.thumbnail_url && this.mounted) {\n const image = data.thumbnail_url.replace(\"height=100\", \"height=480\").replace(\"-d_295x166\", \"-d_640\");\n this.setState({\n image\n });\n cache[url] = image;\n }\n });\n }\n render() {\n const {\n light,\n onClick,\n playIcon,\n previewTabIndex\n } = this.props;\n const {\n image\n } = this.state;\n const isElement = import_react.default.isValidElement(light);\n const flexCenter = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\"\n };\n const styles = {\n preview: {\n width: \"100%\",\n height: \"100%\",\n backgroundImage: image && !isElement ? `url(${image})` : void 0,\n backgroundSize: \"cover\",\n backgroundPosition: \"center\",\n cursor: \"pointer\",\n ...flexCenter\n },\n shadow: {\n background: \"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)\",\n borderRadius: ICON_SIZE,\n width: ICON_SIZE,\n height: ICON_SIZE,\n position: isElement ? \"absolute\" : void 0,\n ...flexCenter\n },\n playIcon: {\n borderStyle: \"solid\",\n borderWidth: \"16px 0 16px 26px\",\n borderColor: \"transparent transparent transparent white\",\n marginLeft: \"7px\"\n }\n };\n const defaultPlayIcon = /* @__PURE__ */import_react.default.createElement(\"div\", {\n style: styles.shadow,\n className: \"react-player__shadow\"\n }, /* @__PURE__ */import_react.default.createElement(\"div\", {\n style: styles.playIcon,\n className: \"react-player__play-icon\"\n }));\n return /* @__PURE__ */import_react.default.createElement(\"div\", {\n style: styles.preview,\n className: \"react-player__preview\",\n onClick,\n tabIndex: previewTabIndex,\n onKeyPress: this.handleKeyPress\n }, isElement ? light : null, playIcon || defaultPlayIcon);\n }\n}"],"names":["mod","__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__publicField","obj","value","configurable","writable","__defNormalProp","Preview_exports","target","all","name","__export","default","Preview","module","exports","import_react","isNodeMode","__esModule","__toESM","ICON_SIZE","cache","Component","constructor","super","arguments","this","image","e","props","onClick","componentDidMount","mounted","fetchImage","componentDidUpdate","prevProps","url","light","componentWillUnmount","oEmbedUrl","isValidElement","setState","window","fetch","replace","then","response","json","data","thumbnail_url","render","playIcon","previewTabIndex","state","isElement","flexCenter","display","alignItems","justifyContent","styles","preview","width","height","backgroundImage","backgroundSize","backgroundPosition","cursor","shadow","background","borderRadius","position","borderStyle","borderWidth","borderColor","marginLeft","defaultPlayIcon","createElement","style","className","tabIndex","onKeyPress","handleKeyPress"],"sourceRoot":""}