(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("react"));
	else if(typeof define === 'function' && define.amd)
		define(["react"], factory);
	else if(typeof exports === 'object')
		exports["components/related-apps-banner-iframe/index"] = factory(require("react"));
	else
		root["components/related-apps-banner-iframe/index"] = factory(root["react"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 114);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_0__;

/***/ }),

/***/ 114:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__related_apps_banner_iframe__ = __webpack_require__(115);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__related_apps_banner_iframe__["a"]; });



/***/ }),

/***/ 115:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utilities_routes__ = __webpack_require__(16);


const { PAGES_BASE_PATH } = __WEBPACK_IMPORTED_MODULE_1__utilities_routes__["a" /* paths */];
class RelatedAppsBannerIframe extends __WEBPACK_IMPORTED_MODULE_0_react___default.a.Component {
    constructor() {
        super(...arguments);
        this.state = {
            width: 210,
            height: 260
        };
    }
    updateFrameDimensions() {
        const { iframe } = this;
        this.setState({
            width: iframe.contentWindow.document.body.scrollWidth,
            height: iframe.contentWindow.document.body.scrollHeight
        });
    }
    componentDidMount() {
        this.iframe.addEventListener('load', this.updateFrameDimensions.bind(this));
    }
    render() {
        let url = `${PAGES_BASE_PATH}/pages/related-apps-banner?utm_source=cf-dashboard`;
        url += this.props.categories.map(category => `&app-category=${category}`);
        return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("iframe", { ref: (iframe) => this.iframe = iframe, src: url, seamless: true, width: this.state.width, height: this.state.height, frameBorder: '0', style: { backgroundColor: 'transparent', border: '0 none transparent', padding: 0 } });
    }
}
/* harmony export (immutable) */ __webpack_exports__["a"] = RelatedAppsBannerIframe;



/***/ }),

/***/ 16:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return paths; });
let APPS_BASE_PATH;
let API_BASE_PATH;
let PAGES_BASE_PATH;
let CF_DASHBOARD_BASE_PATH;
let environment = "production" || 'development';
if (typeof window !== 'undefined' && window.localStorage && window.localStorage.SABLE_ENV) {
    environment = window.localStorage.SABLE_ENV;
}
const port = Object({"NODE_ENV":"production"}).PORT || 9005;
/* unused harmony export port */

if (environment === 'development') {
    APPS_BASE_PATH = 'https://local.cloudflareapps.com:9000/apps';
    // TODO: The current staging DB doesn't include any apps.
    // This should instead be regularly kept in sync with production.
    // API_BASE_PATH = 'https://api.cloudflareapps.com'
    API_BASE_PATH = 'https://api-staging.appstore.cfdata.org';
    PAGES_BASE_PATH = `http://localhost:${port}/pages`;
    CF_DASHBOARD_BASE_PATH = 'https://www.staging.cloudflare.com/a';
}
else {
    APPS_BASE_PATH = 'https://cloudflare.com/apps';
    API_BASE_PATH = 'https://api.cloudflareapps.com';
    PAGES_BASE_PATH = 'https://cloudflare-apps.github.io/sable';
    CF_DASHBOARD_BASE_PATH = 'https://www.cloudflare.com/a';
}
const paths = {
    APPS_BASE_PATH,
    API_BASE_PATH,
    PAGES_BASE_PATH,
    CF_DASHBOARD_BASE_PATH
};



/***/ })

/******/ });
});
//# sourceMappingURL=index.js.map