{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./_src/js/media.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","$","_","smush_media","wp","media","template","prepareTemplate","smushHTML","label","smush_vars","strings","view","Attachment","Details","TwoColumn","smushMediaTwoColumn","extend","initialize","this","listenTo","model","render","apply","arguments","fetch","views","detach","$el","find","append","smushAttachmentDetails","jQuery"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAA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SAAUD,KAAKE,MAAO,eAAgBF,KAAKG,SAGjDA,OAAQ,WAEPnB,EAAYS,KAAKC,WAAWhB,UAAUyB,OAAOC,MAAOJ,KAAMK,WAE1D,IAAMhB,EAAYW,KAAKE,MAAMvC,IAAK,SAClC,YAA0B,IAAd0B,EACJW,MAGRA,KAAKE,MAAMI,QAMXN,KAAKO,MAAMC,SACXR,KAAKS,IAAIE,OAAQvB,EAAiBC,IAE3BW,SAjGV,CAmJIa,OAAQ9B","file":"media.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 141);\n","/**\n * Adds a Smush Now button and displays stats in Media Attachment Details Screen\n */\n(function ( $, _ ) {\n\t'use strict';\n\n\t// Local reference to the WordPress media namespace.\n\tconst smush_media = wp.media,\n\t\tsharedTemplate = \"\",\n\t\ttemplate = _.template( sharedTemplate );\n\n\t/**\n\t * Create the template.\n\t *\n\t * @param {string} smushHTML\n\t * @returns {Object}\n\t */\n\tconst prepareTemplate = function ( smushHTML ) {\n\t\t/**\n\t\t * @var {array} smush_vars.strings Localization strings.\n\t\t * @var {object} smush_vars Object from wp_localize_script()\n\t\t */\n\t\treturn template( {\n\t\t\tlabel: smush_vars.strings['stats_label'],\n\t\t\tvalue: smushHTML\n\t\t} );\n\t};\n\n\tif ( 'undefined' !== typeof smush_media.view &&\n\t\t'undefined' !== typeof smush_media.view.Attachment.Details.TwoColumn ) {\n\t\t// Local instance of the Attachment Details TwoColumn used in the edit attachment modal view\n\t\tlet smushMediaTwoColumn = smush_media.view.Attachment.Details.TwoColumn;\n\n\t\t/**\n\t\t * Add Smush details to attachment.\n\t\t *\n\t\t * A similar view to media.view.Attachment.Details\n\t\t * for use in the Edit Attachment modal.\n\t\t *\n\t\t * @see wp-includes/js/media-grid.js\n\t\t */\n\t\tsmush_media.view.Attachment.Details.TwoColumn = smushMediaTwoColumn.extend( {\n\t\t\tinitialize: function () {\n\t\t\t\tthis.listenTo( this.model, 'change:smush', this.render );\n\t\t\t},\n\n\t\t\trender: function () {\n\t\t\t\t// Ensure that the main attachment fields are rendered.\n\t\t\t\tsmush_media.view.Attachment.prototype.render.apply( this, arguments );\n\n\t\t\t\tconst smushHTML = this.model.get( 'smush' );\n\t\t\t\tif ( typeof smushHTML === 'undefined' ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t\tthis.model.fetch();\n\n\t\t\t\t/**\n\t\t\t\t * Detach the views, append our custom fields, make sure that our data is fully updated\n\t\t\t\t * and re-render the updated view.\n\t\t\t\t */\n\t\t\t\tthis.views.detach();\n\t\t\t\tthis.$el.find( '.settings' ).append( prepareTemplate( smushHTML ) );\n\t\t\t\tthis.views.render();\n\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Local instance of the Attachment Details TwoColumn used in the edit attachment modal view\n\tlet smushAttachmentDetails = smush_media.view.Attachment.Details;\n\n\t/**\n\t * Add Smush details to attachment.\n\t */\n\tsmush_media.view.Attachment.Details = smushAttachmentDetails.extend( {\n\t\tinitialize: function () {\n\t\t\tsmushAttachmentDetails.prototype.initialize.apply( this, arguments );\n\t\t\tthis.listenTo( this.model, 'change:smush', this.render );\n\t\t},\n\n\t\trender: function () {\n\t\t\t// Ensure that the main attachment fields are rendered.\n\t\t\tsmush_media.view.Attachment.prototype.render.apply( this, arguments );\n\n\t\t\tconst smushHTML = this.model.get( 'smush' );\n\t\t\tif ( typeof smushHTML === 'undefined' ) {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tthis.model.fetch();\n\n\t\t\t/**\n\t\t\t * Detach the views, append our custom fields, make sure that our data is fully updated\n\t\t\t * and re-render the updated view.\n\t\t\t */\n\t\t\tthis.views.detach();\n\t\t\tthis.$el.append( prepareTemplate( smushHTML ) );\n\n\t\t\treturn this;\n\t\t}\n\t} );\n\n\t/**\n\t * Create a new MediaLibraryTaxonomyFilter we later will instantiate\n\t *\n\t * @since 2.9.0\n\t */\n/*\n\tconst MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({\n\t\tid: 'media-attachment-smush-filter',\n\n\t\tcreateFilters: function() {\n\t\t\tthis.filters = {\n\t\t\t\tall: {\n\t\t\t\t\ttext: smush_vars.strings['filter_all'],\n\t\t\t\t\tprops: { stats: 'all' },\n\t\t\t\t\tpriority: 10\n\t\t\t\t},\n\n\t\t\t\texcluded: {\n\t\t\t\t\ttext: smush_vars.strings['filter_excl'],\n\t\t\t\t\tprops: { stats: 'null' },\n\t\t\t\t\tpriority: 20\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t});\n*/\n\t/**\n\t * Extend and override wp.media.view.AttachmentsBrowser to include our new filter.\n\t *\n\t * @since 2.9.0\n\t */\n/*\n\tlet AttachmentsBrowser = wp.media.view.AttachmentsBrowser;\n\twp.media.view.AttachmentsBrowser = wp.media.view.AttachmentsBrowser.extend({\n\t\tcreateToolbar: function() {\n\t\t\t// Make sure to load the original toolbar\n\t\t\tAttachmentsBrowser.prototype.createToolbar.call( this );\n\t\t\tthis.toolbar.set( 'MediaLibraryTaxonomyFilter', new MediaLibraryTaxonomyFilter({\n\t\t\t\tcontroller: this.controller,\n\t\t\t\tmodel: this.collection.props,\n\t\t\t\tpriority: -75\n\t\t\t}).render() );\n\t\t}\n\t});\n*/\n\n})( jQuery, _ );"],"sourceRoot":""}