forked from aullman/opentok-layout-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opentok-layout.min.js.map
1 lines (1 loc) · 33.4 KB
/
opentok-layout.min.js.map
1
{"version":3,"sources":["webpack://initLayoutContainer/webpack/universalModuleDefinition","webpack://initLayoutContainer/webpack/bootstrap","webpack://initLayoutContainer/./src/getLayout.js","webpack://initLayoutContainer/./src/layout.js","webpack://initLayoutContainer/./src/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","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","getBestDimensions","minRatio","maxRatio","Width","Height","count","maxWidth","maxHeight","maxArea","targetCols","targetRows","targetHeight","targetWidth","tWidth","tHeight","tRatio","cols","rows","Math","ceil","floor","area","min","undefined","ratio","getLayout","opts","elements","fixedRatio","containerWidth","containerHeight","_opts$offsetLeft","offsetLeft","_opts$offsetTop","offsetTop","_opts$alignItems","alignItems","_opts$maxWidth","Infinity","_opts$maxHeight","ratios","map","element","height","width","length","dimensions","x","y","row","boxes","push","totalRowHeight","remainingShortRows","remainingHeightDiff","extraHeight","rowMarginLeft","j","left","top","_opts$maxRatio","_opts$minRatio","_opts$fixedRatio","_opts$bigPercentage","bigPercentage","_opts$bigFixedRatio","bigFixedRatio","_opts$bigMaxRatio","bigMaxRatio","_opts$bigMinRatio","bigMinRatio","_opts$bigFirst","bigFirst","_opts$containerWidth","_opts$containerHeight","_opts$alignItems2","_opts$bigAlignItems","bigAlignItems","_opts$smallAlignItems","smallAlignItems","_opts$maxWidth2","_opts$maxHeight2","_opts$smallMaxWidth","smallMaxWidth","_opts$smallMaxHeight","smallMaxHeight","_opts$bigMaxWidth","bigMaxWidth","_opts$bigMaxHeight","bigMaxHeight","availableRatio","bigOffsetTop","bigOffsetLeft","bigIndices","bigOnes","filter","idx","big","smallOnes","bigBoxes","smallBoxes","bigWidth","bigHeight","showBigFirst","getVideoRatio","bigBoxesIdx","smallBoxesIdx","forEach","indexOf","container","css","el","propertyName","style","NaN","_typeof","keys","currentValue","window","getComputedStyle","getPropertyValue","getCSSNumber","elem","prop","cssStr","parseInt","_opts$animate","animate","_opts$bigClass","bigClass","_opts$ignoreClass","ignoreClass","id","getAttribute","random","toFixed","setAttribute","heightStr","offsetHeight","getHeight","widthStr","offsetWidth","getWidth","children","Array","querySelectorAll","res","child","videoHeight","videoWidth","video","querySelector","getChildDims","classList","contains","box","actualWidth","actualHeight","w","h","_this","targetPosition","fixAspectRatio","sub","oldWidth","$","stop","duration","easing","complete","add","positionElement","layout","win","document","HTMLElement"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,oBAAAD,IAEAD,EAAA,oBAAAC,IARA,CASC,oBAAAK,UAAAC,KAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAR,QAGA,IAAAC,EAAAK,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAV,YAUA,OANAW,EAAAH,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAS,GAAA,EAGAT,EAAAD,QA0DA,OArDAO,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAvB,GACA,oBAAAwB,eAAAC,aACAN,OAAAC,eAAApB,EAAAwB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAApB,EAAA,cAAiD0B,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAE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K6B,cAAc,YAC/B,GAAIY,EAAK,CAIP,IAAMC,EAAWD,EAAIlD,MAAMrE,MAC3BuH,EAAIlD,MAAMrE,MAAWkH,EAArB,KAEAK,EAAIlD,MAAMrE,MAAQwH,GAAY,KAI9BrC,GAAwB,oBAANsC,GACpBA,EAAE3C,GAAM4C,OACRD,EAAE3C,GAAMK,QAAQkC,EAAgBlC,EAAQwC,UAAY,IAAKxC,EAAQyC,QAAU,QACzE,WACEN,IACInC,EAAQ0C,UAAU1C,EAAQ0C,SAAStM,KAAK6L,OAGhDlD,EAAIY,EAAMuC,GACLvC,EAAK+B,UAAUC,SAAS,cAC3BhC,EAAK+B,UAAUiB,IAAI,cAGvBR,IA+FAS,CAAgBjD,EAAMiC,EAAIjG,KAAMiG,EAAIhG,IAAKiG,EAAaC,EACpD9B;;;;;;;;;;KC9JN,IAAMtG,EAAY3D,EAAQ,GACpB8M,EAAS9M,EAAQ,GAEvBN,EAAOD,QAAU,SAA6BsJ,EAAWnF,GACvD,IAAMmJ,EAAOnJ,GAAQA,EAAK4F,SAA8B,oBAAXA,YAAyB/F,EAAY+F,QASlF,OARAT,EAAiC,iBAAdA,EAAyBgE,EAAIC,SAASvB,cAAc1C,GAAaA,OAC1C,KAA5BgE,GAAOA,EAAIE,cAAgClE,aAAqBgE,EAAIE,aAAiBrJ,EAGvFA,IACVA,MAFAA,EAAOmF,GAMP+D,OAAQA,EAAOpL,KAAK5B,KAAMiJ,EAAWnF,GACrCD,UAAWA,EAAUjC,KAAK5B,KAAM8D","file":"opentok-layout.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"initLayoutContainer\"] = factory();\n\telse\n\t\troot[\"initLayoutContainer\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn "," \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 = 2);\n","const getBestDimensions = (minRatio, maxRatio, Width, Height, count, maxWidth, maxHeight) => {\n let maxArea;\n let targetCols;\n let targetRows;\n let targetHeight;\n let targetWidth;\n let tWidth;\n let tHeight;\n let tRatio;\n\n // Iterate through every possible combination of rows and columns\n // and see which one has the least amount of whitespace\n for (let i = 1; i <= count; i += 1) {\n const cols = i;\n const rows = Math.ceil(count / cols);\n\n // Try taking up the whole height and width\n tHeight = Math.floor(Height / rows);\n tWidth = Math.floor(Width / cols);\n\n tRatio = tHeight / tWidth;\n if (tRatio > maxRatio) {\n // We went over decrease the height\n tRatio = maxRatio;\n tHeight = tWidth * tRatio;\n } else if (tRatio < minRatio) {\n // We went under decrease the width\n tRatio = minRatio;\n tWidth = tHeight / tRatio;\n }\n\n tWidth = Math.min(maxWidth, tWidth);\n tHeight = Math.min(maxHeight, tHeight);\n\n const area = (tWidth * tHeight) * count;\n\n // If this width and height takes up the most space then we're going with that\n if (maxArea === undefined || (area >= maxArea)) {\n maxArea = area;\n targetHeight = tHeight;\n targetWidth = tWidth;\n targetCols = cols;\n targetRows = rows;\n }\n }\n return {\n maxArea,\n targetCols,\n targetRows,\n targetHeight,\n targetWidth,\n ratio: targetHeight / targetWidth,\n };\n};\n\nconst getLayout = (opts, elements) => {\n const {\n maxRatio,\n minRatio,\n fixedRatio,\n containerWidth,\n containerHeight,\n offsetLeft = 0,\n offsetTop = 0,\n alignItems = 'center',\n maxWidth = Infinity,\n maxHeight = Infinity,\n } = opts;\n const ratios = elements.map(element => element.height / element.width);\n const count = ratios.length;\n\n\n let dimensions;\n\n if (!fixedRatio) {\n dimensions = getBestDimensions(minRatio, maxRatio, containerWidth, containerHeight, count,\n maxWidth, maxHeight);\n } else {\n // Use the ratio of the first video element we find to approximate\n const ratio = ratios.length > 0 ? ratios[0] : null;\n dimensions = getBestDimensions(ratio, ratio, containerWidth, containerHeight, count,\n maxWidth, maxHeight);\n }\n\n // Loop through each stream in the container and place it inside\n let x = 0;\n let y = 0;\n const rows = [];\n let row;\n const boxes = [];\n // Iterate through the children and create an array with a new item for each row\n // and calculate the width of each row so that we know if we go over the size and need\n // to adjust\n for (let i = 0; i < ratios.length; i += 1) {\n if (i % dimensions.targetCols === 0) {\n // This is a new row\n row = {\n ratios: [],\n width: 0,\n height: 0,\n };\n rows.push(row);\n }\n const ratio = ratios[i];\n row.ratios.push(ratio);\n let targetWidth = dimensions.targetWidth;\n const targetHeight = dimensions.targetHeight;\n // If we're using a fixedRatio then we need to set the correct ratio for this element\n if (fixedRatio) {\n targetWidth = targetHeight / ratio;\n }\n row.width += targetWidth;\n row.height = targetHeight;\n }\n // Calculate total row height adjusting if we go too wide\n let totalRowHeight = 0;\n let remainingShortRows = 0;\n for (let i = 0; i < rows.length; i += 1) {\n row = rows[i];\n if (row.width > containerWidth) {\n // Went over on the width, need to adjust the height proportionally\n row.height = Math.floor(row.height * (containerWidth / row.width));\n row.width = containerWidth;\n } else if (row.width < containerWidth && row.height < maxHeight) {\n remainingShortRows += 1;\n }\n totalRowHeight += row.height;\n }\n if (totalRowHeight < containerHeight && remainingShortRows > 0) {\n // We can grow some of the rows, we're not taking up the whole height\n let remainingHeightDiff = containerHeight - totalRowHeight;\n totalRowHeight = 0;\n for (let i = 0; i < rows.length; i += 1) {\n row = rows[i];\n if (row.width < containerWidth) {\n // Evenly distribute the extra height between the short rows\n let extraHeight = remainingHeightDiff / remainingShortRows;\n if ((extraHeight / row.height) > ((containerWidth - row.width) / row.width)) {\n // We can't go that big or we'll go too wide\n extraHeight = Math.floor(((containerWidth - row.width) / row.width) * row.height);\n }\n row.width += Math.floor((extraHeight / row.height) * row.width);\n row.height += extraHeight;\n remainingHeightDiff -= extraHeight;\n remainingShortRows -= 1;\n }\n totalRowHeight += row.height;\n }\n }\n switch (alignItems) {\n case 'start':\n y = 0;\n break;\n case 'end':\n y = containerHeight - totalRowHeight;\n break;\n case 'center':\n default:\n y = ((containerHeight - (totalRowHeight)) / 2);\n break;\n }\n // Iterate through each row and place each child\n for (let i = 0; i < rows.length; i += 1) {\n row = rows[i];\n let rowMarginLeft;\n switch (alignItems) {\n case 'start':\n rowMarginLeft = 0;\n break;\n case 'end':\n rowMarginLeft = containerWidth - row.width;\n break;\n case 'center':\n default:\n rowMarginLeft = ((containerWidth - row.width) / 2);\n break;\n }\n x = rowMarginLeft;\n let targetHeight;\n for (let j = 0; j < row.ratios.length; j += 1) {\n const ratio = row.ratios[j];\n\n let targetWidth = dimensions.targetWidth;\n targetHeight = row.height;\n // If we're using a fixedRatio then we need to set the correct ratio for this element\n if (fixedRatio) {\n targetWidth = Math.floor(targetHeight / ratio);\n } else if ((targetHeight / targetWidth)\n !== (dimensions.targetHeight / dimensions.targetWidth)) {\n // We grew this row, we need to adjust the width to account for the increase in height\n targetWidth = Math.floor((dimensions.targetWidth / dimensions.targetHeight) * targetHeight);\n }\n\n boxes.push({\n left: x + offsetLeft,\n top: y + offsetTop,\n width: targetWidth,\n height: targetHeight,\n });\n x += targetWidth;\n }\n y += targetHeight;\n }\n return boxes;\n};\n\nconst getVideoRatio = element => element.height / element.width;\n\nmodule.exports = (opts, elements) => {\n const {\n maxRatio = 3 / 2,\n minRatio = 9 / 16,\n fixedRatio = false,\n bigPercentage = 0.8,\n bigFixedRatio = false,\n bigMaxRatio = 3 / 2,\n bigMinRatio = 9 / 16,\n bigFirst = true,\n containerWidth = 640,\n containerHeight = 480,\n alignItems = 'center',\n bigAlignItems = 'center',\n smallAlignItems = 'center',\n maxWidth = Infinity,\n maxHeight = Infinity,\n smallMaxWidth = Infinity,\n smallMaxHeight = Infinity,\n bigMaxWidth = Infinity,\n bigMaxHeight = Infinity,\n } = opts;\n\n const availableRatio = containerHeight / containerWidth;\n let offsetLeft = 0;\n let offsetTop = 0;\n let bigOffsetTop = 0;\n let bigOffsetLeft = 0;\n const bigIndices = [];\n const bigOnes = elements.filter((element, idx) => {\n if (element.big) {\n bigIndices.push(idx);\n return true;\n }\n return false;\n });\n const smallOnes = elements.filter(element => !element.big);\n let bigBoxes = [];\n let smallBoxes = [];\n if (bigOnes.length > 0 && smallOnes.length > 0) {\n let bigWidth;\n let bigHeight;\n let showBigFirst = bigFirst === true;\n\n if (availableRatio > getVideoRatio(bigOnes[0])) {\n // We are tall, going to take up the whole width and arrange small\n // guys at the bottom\n bigWidth = containerWidth;\n bigHeight = Math.floor(containerHeight * bigPercentage);\n offsetTop = bigHeight;\n bigOffsetTop = containerHeight - offsetTop;\n if (bigFirst === 'column') {\n showBigFirst = false;\n } else if (bigFirst === 'row') {\n showBigFirst = true;\n }\n } else {\n // We are wide, going to take up the whole height and arrange the small\n // guys on the right\n bigHeight = containerHeight;\n bigWidth = Math.floor(containerWidth * bigPercentage);\n offsetLeft = bigWidth;\n bigOffsetLeft = containerWidth - offsetLeft;\n if (bigFirst === 'column') {\n showBigFirst = true;\n } else if (bigFirst === 'row') {\n showBigFirst = false;\n }\n }\n if (showBigFirst) {\n bigBoxes = getLayout({\n containerWidth: bigWidth,\n containerHeight: bigHeight,\n offsetLeft: 0,\n offsetTop: 0,\n fixedRatio: bigFixedRatio,\n minRatio: bigMinRatio,\n maxRatio: bigMaxRatio,\n alignItems: bigAlignItems,\n maxWidth: bigMaxWidth,\n maxHeight: bigMaxHeight,\n }, bigOnes);\n smallBoxes = getLayout({\n containerWidth: containerWidth - offsetLeft,\n containerHeight: containerHeight - offsetTop,\n offsetLeft,\n offsetTop,\n fixedRatio,\n minRatio,\n maxRatio,\n alignItems: smallAlignItems,\n maxWidth: smallMaxWidth,\n maxHeight: smallMaxHeight,\n }, smallOnes);\n } else {\n smallBoxes = getLayout({\n containerWidth: containerWidth - offsetLeft,\n containerHeight: containerHeight - offsetTop,\n offsetLeft: 0,\n offsetTop: 0,\n fixedRatio,\n minRatio,\n maxRatio,\n alignItems: smallAlignItems,\n maxWidth: smallMaxWidth,\n maxHeight: smallMaxHeight,\n }, smallOnes);\n bigBoxes = getLayout({\n containerWidth: bigWidth,\n containerHeight: bigHeight,\n offsetLeft: bigOffsetLeft,\n offsetTop: bigOffsetTop,\n fixedRatio: bigFixedRatio,\n minRatio: bigMinRatio,\n alignItems: bigAlignItems,\n maxWidth: bigMaxWidth,\n maxHeight: bigMaxHeight,\n }, bigOnes);\n }\n } else if (bigOnes.length > 0 && smallOnes.length === 0) {\n // We only have one bigOne just center it\n bigBoxes = getLayout({\n containerWidth,\n containerHeight,\n fixedRatio: bigFixedRatio,\n minRatio: bigMinRatio,\n maxRatio: bigMaxRatio,\n alignItems: bigAlignItems,\n maxWidth: bigMaxWidth,\n maxHeight: bigMaxHeight,\n }, bigOnes);\n } else {\n smallBoxes = getLayout({\n containerWidth: containerWidth - offsetLeft,\n containerHeight: containerHeight - offsetTop,\n offsetLeft,\n offsetTop,\n fixedRatio,\n minRatio,\n maxRatio,\n alignItems,\n maxWidth,\n maxHeight,\n }, smallOnes);\n }\n\n const boxes = [];\n let bigBoxesIdx = 0;\n let smallBoxesIdx = 0;\n // Rebuild the array in the right order based on where the bigIndices should be\n elements.forEach((element, idx) => {\n if (bigIndices.indexOf(idx) > -1) {\n boxes[idx] = bigBoxes[bigBoxesIdx];\n bigBoxesIdx += 1;\n } else {\n boxes[idx] = smallBoxes[smallBoxesIdx];\n smallBoxesIdx += 1;\n }\n });\n return boxes;\n};\n","const getLayout = require('./getLayout');\n\nmodule.exports = (container, opts) => {\n function css(el, propertyName, value) {\n if (value) {\n // We are setting one css property\n el.style[propertyName] = value;\n return NaN;\n }\n if (typeof propertyName === 'object') {\n // We are setting several CSS properties at once\n Object.keys(propertyName).forEach((key) => {\n css(el, key, propertyName[key]);\n });\n return NaN;\n }\n // We are getting the css property\n const computedStyle = ((opts && opts.window) || window).getComputedStyle(el);\n let currentValue = computedStyle.getPropertyValue(propertyName);\n\n if (currentValue === '') {\n currentValue = el.style[propertyName];\n }\n\n return currentValue;\n }\n\n const filterDisplayNone = element => css(element, 'display') !== 'none';\n\n function height(el) {\n if (el.offsetHeight > 0) {\n return `${el.offsetHeight}px`;\n }\n return css(el, 'height');\n }\n\n function width(el) {\n if (el.offsetWidth > 0) {\n return `${el.offsetWidth}px`;\n }\n return css(el, 'width');\n }\n\n const positionElement = function positionElement(elem, x, y, w, h, animate) {\n const targetPosition = {\n left: `${x}px`,\n top: `${y}px`,\n width: `${w}px`,\n height: `${h}px`,\n };\n\n const fixAspectRatio = function fixAspectRatio() {\n const sub = elem.querySelector('.OT_root');\n if (sub) {\n // If this is the parent of a subscriber or publisher then we need\n // to force the mutation observer on the publisher or subscriber to\n // trigger to get it to fix it's layout\n const oldWidth = sub.style.width;\n sub.style.width = `${w}px`;\n // sub.style.height = height + 'px';\n sub.style.width = oldWidth || '';\n }\n };\n\n if (animate && typeof $ !== 'undefined') {\n $(elem).stop();\n $(elem).animate(targetPosition, animate.duration || 200, animate.easing || 'swing',\n () => {\n fixAspectRatio();\n if (animate.complete) animate.complete.call(this);\n });\n } else {\n css(elem, targetPosition);\n if (!elem.classList.contains('ot-layout')) {\n elem.classList.add('ot-layout');\n }\n }\n fixAspectRatio();\n };\n\n const getChildDims = function getChildDims(child) {\n if (child) {\n if (child.videoHeight && child.videoWidth) {\n return {\n height: child.videoHeight,\n width: child.videoWidth,\n };\n }\n const video = child.querySelector('video');\n if (video && video.videoHeight && video.videoWidth) {\n return {\n height: video.videoHeight,\n width: video.videoWidth,\n };\n }\n }\n return {\n height: 480,\n width: 640,\n };\n };\n\n const getCSSNumber = function getCSSNumber(elem, prop) {\n const cssStr = css(elem, prop);\n return cssStr ? parseInt(cssStr, 10) : 0;\n };\n\n // Really cheap UUID function\n const cheapUUID = function cheapUUID() {\n return (Math.random() * 100000000).toFixed(0);\n };\n\n const getHeight = function getHeight(elem) {\n const heightStr = height(elem);\n return heightStr ? parseInt(heightStr, 10) : 0;\n };\n\n const getWidth = function getWidth(elem) {\n const widthStr = width(elem);\n return widthStr ? parseInt(widthStr, 10) : 0;\n };\n\n const {\n animate = false,\n bigClass = 'OT_big',\n ignoreClass = 'OT_ignore',\n } = opts;\n\n if (css(container, 'display') === 'none') {\n return;\n }\n let id = container.getAttribute('id');\n if (!id) {\n id = `OT_${cheapUUID()}`;\n container.setAttribute('id', id);\n }\n\n opts.containerHeight = getHeight(container)\n - getCSSNumber(container, 'borderTop')\n - getCSSNumber(container, 'borderBottom');\n opts.containerWidth = getWidth(container)\n - getCSSNumber(container, 'borderLeft')\n - getCSSNumber(container, 'borderRight');\n\n const children = Array.prototype.filter.call(\n container.querySelectorAll(`#${id}>*:not(.${ignoreClass})`),\n filterDisplayNone\n );\n const elements = children.map((element) => {\n const res = getChildDims(element);\n res.big = element.classList.contains(bigClass);\n return res;\n });\n\n const boxes = getLayout(opts, elements);\n boxes.forEach((box, idx) => {\n const elem = children[idx];\n css(elem, 'position', 'absolute');\n const actualWidth = box.width - getCSSNumber(elem, 'paddingLeft')\n - getCSSNumber(elem, 'paddingRight')\n - getCSSNumber(elem, 'marginLeft')\n - getCSSNumber(elem, 'marginRight')\n - getCSSNumber(elem, 'borderLeft')\n - getCSSNumber(elem, 'borderRight');\n\n const actualHeight = box.height - getCSSNumber(elem, 'paddingTop')\n - getCSSNumber(elem, 'paddingBottom')\n - getCSSNumber(elem, 'marginTop')\n - getCSSNumber(elem, 'marginBottom')\n - getCSSNumber(elem, 'borderTop')\n - getCSSNumber(elem, 'borderBottom');\n\n positionElement(elem, box.left, box.top, actualWidth, actualHeight,\n animate);\n });\n};\n","/*!\n * opentok-layout-js (http://github.com/aullman/opentok-layout-js)\n *\n * Automatic layout of video elements (publisher and subscriber) minimising\n * white-space for the OpenTok on WebRTC API.\n *\n * @Author: Adam Ullman (http://github.com/aullman)\n * @Copyright (c) 2014 Adam Ullman\n * @License: Released under the MIT license (http://opensource.org/licenses/MIT)\n * */\n\n// in CommonJS context, this should be a `require()`d dependency.\n// in browser globals context, ...? (when using bower, there are dependencies that it has handled\n// for you, so these might be safe to assume)\n\nconst getLayout = require('./getLayout');\nconst layout = require('./layout');\n\nmodule.exports = function initLayoutContainer(container, opts) {\n const win = (opts && opts.window) || (typeof window === 'undefined' ? undefined : window);\n container = typeof container === 'string' ? win.document.querySelector(container) : container;\n if (!(typeof (win && win.HTMLElement) === 'undefined' || container instanceof win.HTMLElement) && !opts) {\n // container is actually the options\n opts = container;\n } else if (!opts) {\n opts = {};\n }\n\n return {\n layout: layout.bind(this, container, opts),\n getLayout: getLayout.bind(this, opts),\n };\n};\n"],"sourceRoot":""}