{"version":3,"file":"./build/block-library/blocks/file/view.min.js","mappings":"mBAAA,MAAM,EAA+BA,OAAW,GAAiB,cC+C3DC,EAAwBC,IAC7B,IAAIC,EACJ,IACCA,EAAK,IAAIH,OAAOI,cAAeF,EAC/B,CAAC,MAAQG,GACTF,OAAKG,CACL,CACD,OAAOH,CAAP,GC7CDI,EAAAA,EAAAA,OAAO,CACNC,UAAW,CACVC,KAAM,CACLC,KAAM,CACLC,cDP+B,MAE7BX,OAAOY,UAAUC,UAAUC,QAAS,SAAY,GAKhDd,OAAOY,UAAUC,UAAUC,QAAS,YAAe,GAMvDd,OAAOY,UAAUC,UAAUC,QAAS,cAAiB,GACrDd,OAAOY,UAAUG,gBACjBf,OAAOY,UAAUG,eAAiB,IAO7Bf,OAAOI,eAAiB,kBAAmBJ,UAE/CC,EAAqB,iBACrBA,EAAqB,oB","sources":["webpack://wp/external window [\"wp\",\"interactivity\"]","webpack://wp/./packages/block-library/build-module/file/utils/@wordpress/block-library/src/file/utils/index.js","webpack://wp/./packages/block-library/build-module/file/@wordpress/block-library/src/file/view.js"],"sourcesContent":["const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"interactivity\"];","/**\n * Uses a combination of user agent matching and feature detection to determine whether\n * the current browser supports rendering PDFs inline.\n *\n * @return {boolean} Whether or not the browser supports inline PDFs.\n */\nexport const browserSupportsPdfs = () => {\n\t// Most mobile devices include \"Mobi\" in their UA.\n\tif ( window.navigator.userAgent.indexOf( 'Mobi' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// Android tablets are the noteable exception.\n\tif ( window.navigator.userAgent.indexOf( 'Android' ) > -1 ) {\n\t\treturn false;\n\t}\n\n\t// iPad pretends to be a Mac.\n\tif (\n\t\twindow.navigator.userAgent.indexOf( 'Macintosh' ) > -1 &&\n\t\twindow.navigator.maxTouchPoints &&\n\t\twindow.navigator.maxTouchPoints > 2\n\t) {\n\t\treturn false;\n\t}\n\n\t// IE only supports PDFs when there's an ActiveX object available for it.\n\tif (\n\t\t!! ( window.ActiveXObject || 'ActiveXObject' in window ) &&\n\t\t! (\n\t\t\tcreateActiveXObject( 'AcroPDF.PDF' ) ||\n\t\t\tcreateActiveXObject( 'PDF.PdfCtrl' )\n\t\t)\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\n/**\n * Helper function for creating ActiveX objects, catching any errors that are thrown\n * when it's generated.\n *\n * @param {string} type The name of the ActiveX object to create.\n * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed.\n */\nconst createActiveXObject = ( type ) => {\n\tlet ax;\n\ttry {\n\t\tax = new window.ActiveXObject( type );\n\t} catch ( e ) {\n\t\tax = undefined;\n\t}\n\treturn ax;\n};\n\n/**\n * Hides all .wp-block-file__embed elements on the document. This function is only intended\n * to be run on the front-end, it may have weird side effects running in the block editor.\n */\nexport const hidePdfEmbedsOnUnsupportedBrowsers = () => {\n\tif ( ! browserSupportsPdfs() ) {\n\t\tconst embeds = document.getElementsByClassName(\n\t\t\t'wp-block-file__embed'\n\t\t);\n\t\tArray.from( embeds ).forEach( ( embed ) => {\n\t\t\tembed.style.display = 'none';\n\t\t} );\n\t}\n};\n","/**\n * WordPress dependencies\n */\nimport { store } from '@wordpress/interactivity';\n/**\n * Internal dependencies\n */\nimport { browserSupportsPdfs as hasPdfPreview } from './utils';\n\nstore( {\n\tselectors: {\n\t\tcore: {\n\t\t\tfile: {\n\t\t\t\thasPdfPreview,\n\t\t\t},\n\t\t},\n\t},\n} );\n"],"names":["window","createActiveXObject","type","ax","ActiveXObject","e","undefined","store","selectors","core","file","hasPdfPreview","navigator","userAgent","indexOf","maxTouchPoints"],"sourceRoot":""}