/*! * viewport-units-buggyfill v0.6.2 * @web: https://github.com/rodneyrehm/viewport-units-buggyfill/ * @author: Rodney Rehm - http://rodneyrehm.de/en/ */ !function(){!function(e,t){"use strict";"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.viewportUnitsBuggyfill=t()}(this,function(){"use strict";var e,t,n,i,r,o=!1,a=window.navigator.userAgent,s=/([+-]?[0-9.]+)(vh|vw|vmin|vmax)/g,c=/(https?:)?\/\//,u=[].forEach,d=/MSIE [0-9]\./i.test(a),l=/MSIE [0-8]\./i.test(a),f=a.indexOf("Opera Mini")>-1,h=/(iPhone|iPod|iPad).+AppleWebKit/i.test(a)&&((r=a.match(/OS (\d+)/))&&r.length>1&&parseInt(r[1])<10),p=a.indexOf(" Android ")>-1&&a.indexOf("Version/")>-1&&parseFloat((a.match("Android ([0-9.]+)")||[])[1])<=4.4;d||(d=!!navigator.userAgent.match(/MSIE 10\.|Trident.*rv[ :]*1[01]\.| Edge\/1\d\./));try{new w("test")}catch(P){var w=function(e,t){var n;return t=t||{bubbles:!1,cancelable:!1,detail:undefined},(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n};w.prototype=window.Event.prototype,window.CustomEvent=w}function v(e,t){var n;return function(){var i=this,r=arguments,o=function(){e.apply(i,r)};clearTimeout(n),n=setTimeout(o,t)}}function m(){try{return window.self!==window.top}catch(P){return!0}}function g(t){if(!o){if(!0===t&&(t={force:!0}),(e=t||{}).isMobileSafari=h,e.isBadStockAndroid=p,!e.ignoreVmax||e.force||l||(d=!1),l||!e.force&&!h&&!d&&!p&&!f&&(!e.hacks||!e.hacks.required(e)))return window.console&&l&&console.info("viewport-units-buggyfill requires a proper CSSOM and basic viewport unit support, which are not available in IE8 and below"),{init:function(){}};window.dispatchEvent(new w("viewport-units-buggyfill-init")),e.hacks&&e.hacks.initialize(e),o=!0,(i=document.createElement("style")).id="patched-viewport",document[e.appendToBody?"body":"head"].appendChild(i),S(function(){var t=v(b,e.refreshDebounceWait||100);window.addEventListener("orientationchange",t,!0),window.addEventListener("pageshow",t,!0),(e.force||d||m())&&(window.addEventListener("resize",t,!0),e._listeningToResize=!0),e.hacks&&e.hacks.initializeEvents(e,b,t),b()})}}function y(){i.textContent=k(),i.parentNode.appendChild(i),window.dispatchEvent(new w("viewport-units-buggyfill-style"))}function b(){o&&(E(),setTimeout(function(){y()},1))}function x(e){try{if(!e.cssRules)return}catch(P){if("SecurityError"!==P.name)throw P;return}for(var t=[],n=0;n