{"version":3,"file":"./blocks/file/interactivity.min.js","mappings":"6HAMO,MAyCDA,EAAwBC,IAC7B,IAAIC,EACJ,IACCA,EAAK,IAAIC,OAAOC,cAAeH,EAC/B,CAAC,MAAQI,GACTH,OAAKI,CACL,CACD,OAAOJ,CAAP,GChDDK,EAAAA,EAAAA,GAAO,CACNC,UAAW,CACVC,KAAM,CACLC,KAAM,CACLC,cDJ+B,MAE7BR,OAAOS,UAAUC,UAAUC,QAAS,SAAY,GAKhDX,OAAOS,UAAUC,UAAUC,QAAS,YAAe,GAMvDX,OAAOS,UAAUC,UAAUC,QAAS,cAAiB,GACrDX,OAAOS,UAAUG,gBACjBZ,OAAOS,UAAUG,eAAiB,IAO7BZ,OAAOC,eAAiB,kBAAmBD,UAE/CH,EAAqB,iBACrBA,EAAqB,oB","sources":["webpack://wp/./packages/block-library/src/file/utils/index.js","webpack://wp/./packages/block-library/src/file/interactivity.js"],"sourcesContent":["/**\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 * Internal dependencies\n */\nimport { store } from '../utils/interactivity';\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":["createActiveXObject","type","ax","window","ActiveXObject","e","undefined","store","selectors","core","file","hasPdfPreview","navigator","userAgent","indexOf","maxTouchPoints"],"sourceRoot":""}