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EAAC,wBAAwB,EACtB,CAAA,CACN;;QAIV,QACE,CACE,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EACzB,IAAI,EAAC,OAAO,EACZ,GAAG,EAAE,IAAI,CAAC,MAAM,wBACG,OAAO,EAAA,oBAAA,EACN,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAClB,sBAAA,EAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAA,CACzC;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement"],"sources":["src/components/core/providers/presto-vimeo/presto-vimeo.css?tag=presto-vimeo","src/components/core/providers/presto-vimeo/presto-vimeo.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { isAndroidWebView } from '../../../../util';\n\n@Component({\n tag: 'presto-vimeo',\n styleUrl: 'presto-vimeo.css',\n shadow: false,\n})\nexport class PrestoVimeo {\n @Prop() src: string;\n @Prop() poster: string;\n @Prop() player: any;\n @Prop({ mutable: true }) getRef?: (elm?: HTMLIFrameElement) => void;\n\n getId(url) {\n const regExp = /^.*(vimeo\\.com\\/)((channels\\/[A-z]+\\/)|(groups\\/[A-z]+\\/videos\\/))?([0-9]+)/;\n const parseUrl = regExp.exec(url || '');\n return parseUrl?.[5] || '';\n }\n\n // Try to extract a hash for private videos from the URL\n parseHash(url) {\n /* This regex matches a hexadecimal hash if given in any of these forms:\n * - [https://player.]vimeo.com/video/{id}/{hash}[?params]\n * - [https://player.]vimeo.com/video/{id}?h={hash}[¶ms]\n * - [https://player.]vimeo.com/video/{id}?[params]&h={hash}\n * - video/{id}/{hash}\n * If matched, the hash is available in the named group `hash`\n */\n const regex = /^.*(?:vimeo.com\\/|video\\/)(?:\\d+)(?:\\?.*\\&*h=|\\/)+(?<hash>[\\d,a-f]+)/;\n const found = url.match(regex);\n\n if (found) {\n return found.groups.hash;\n }\n\n return null;\n }\n\n render() {\n if (!this.src) {\n return;\n }\n\n /*\n Our player is not working on Android WebView.\n https://github.com/prestomade/presto-player/issues/124\n */\n if (isAndroidWebView()) {\n return (\n <div class=\"presto-iframe-fallback-container\">\n <iframe\n src={`https://player.vimeo.com/video/${this.getId(this.src)}?h=${this.parseHash(\n this.src,\n )}&loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media`}\n allowFullScreen\n allowTransparency\n allow=\"autoplay\"\n style={{ width: '100%' }}\n class=\"presto-fallback-iframe\"\n ></iframe>\n </div>\n );\n }\n\n return (\n <div\n class=\"plyr__video-embed\"\n part=\"embed\"\n ref={this.getRef}\n data-plyr-provider=\"vimeo\"\n data-plyr-embed-id={this.getId(this.src)}\n data-plyr-embed-hash={this.parseHash(this.src)}\n ></div>\n );\n }\n}\n"],"version":3}