text: function setGlobalOptions(){var e=window.location.search.split("?")[1].split("&"),t={};e.forEach(function(e){var n=e.split("=")[0],a=e.split("=")[1];switch(n){case"feat":t.featureID=a,t.dataSource=0===t.featureID.indexOf("mdn-")?"mdn":"caniuse";break;case"periods":t.periods=a.split(",");break;case"accessible-colours":t.accessibleColours="true"===a;break;case"image-base":"none"!==a&&(t.imageBase=a);break;case"screenshot":t.screenshot="true"===a}}),t.periods||(t.periods=["future_1","current","past_1","past_2"]),OPTIONS=t}function getShortenedBrowserVersion(e){return e&&e.indexOf("-")>-1&&(e=e.split("-")[1]),e}function get(e){return new Promise(function(t,n){var a=new XMLHttpRequest;a.open("GET",e,!0),a.onload=function(){200===a.status?t(JSON.parse(a.response)):n(Error(a.statusText))},a.onerror=function(){n(Error("Network Error"))},a.send()})}function post(e,t){return new Promise(function(n,a){var r=new XMLHttpRequest;r.open("POST",e,!0),r.setRequestHeader("Content-type","application/json; charset=utf-8"),r.onload=function(){200===r.status?n(JSON.parse(r.response)):a(Error(r.statusText))},r.onerror=function(){a(Error("Network Error"))},r.send(JSON.stringify(t))})}function getFeature(){switch(OPTIONS.dataSource){case"mdn":return post(embedAPI+"/mdn-browser-compat-data",{feature:OPTIONS.featureID}).then(function(e){return FEATURE=Object.assign({url:e.mdn_url},e),getBrowserData()});case"caniuse":return get(caniuseDataUrl).then(function(e){return FEATURE=Object.assign({url:"https://caniuse.com/#feat="+OPTIONS.featureID},e.data[OPTIONS.featureID]),getBrowserData(e.agents)})}}function getBrowserData(e){return Promise.resolve().then(function(){return e||get(caniuseDataUrl).then(function(e){return e.agents})}).then(function(e){return parseBrowserData(e)})}function parseBrowserData(e){for(var t={},a=0;a<BROWSERS.length;a++){for(var r,s=BROWSERS[a],o=e[s].current_version,i=0;i<e[s].version_list.length;i++)if(0===e[s].version_list[i].era){r=i;break}r=parseInt(r),t[s]={};for(var i=0;i<OPTIONS.periods.length;i++){var c=OPTIONS.periods[i];"current"===c?t[s][c]=o:c.indexOf("past")>-1?(n=parseInt(c.split("_")[1]),t[s][c]=e[s].version_list[r-n]?e[s].version_list[r-n].version:null):c.indexOf("future")>-1&&(n=parseInt(c.split("_")[1]),t[s][c]=e[s].version_list[r+n]?e[s].version_list[r+n].version:null)}}for(var u={},a=0;a<BROWSERS.length;a++){var s=BROWSERS[a];u[s]={};for(var i=0;i<OPTIONS.periods.length;i++){var c=OPTIONS.periods[i],d=t[s][c],l=e[s].usage_global[d];l=l?l.toFixed(2):0,u[s][c]=l}}return BROWSER_DATA={versions:t,usage:u}}function parseSupportData(){function e(e,t){n[e][t]=FEATURE.stats[e][BROWSER_DATA.versions[e][t]]}function t(e,t){function a(e){var t;return r[e]?t=r[e]:r[0]&&r[0][e]?t=r[0][e]:r[1]&&r[1][e]&&(t=r[1][e]),t&&(t=t.replace(/≤/g,"")),t}if(BROWSER_DATA.versions[e][t]){var r=FEATURE.support[MDN_BROWSERS_KEY[e]];if(!r)return void(n[e][t]=FEATURE_IDENTIFIERS.unknown);var s=BROWSER_DATA.versions[e][t],o=a("version_added"),i=a("version_removed"),c=!1;!0===o?c=!0:"TP"===s&&o>0?c=!0:parseFloat(s)>=parseFloat(o)&&(c=!0),i&&parseFloat(s)<=parseFloat(i)&&(c=!1);var u=c?FEATURE_IDENTIFIERS.supported:FEATURE_IDENTIFIERS.unsupported;n[e][t]=u}}for(var n={},a=0;a<BROWSERS.length;a++){var r=BROWSERS[a];n[r]={};for(var s=0;s<OPTIONS.periods.length;s++){var o=OPTIONS.periods[s];switch(OPTIONS.dataSource){case"mdn":t(r,o);break;case"caniuse":e(r,o)}}}return n}function displayLoadingMessage(){var e;e=OPTIONS.featureID?OPTIONS.imageBase?'<picture><source type="image/webp" srcset="'+OPTIONS.imageBase+'.webp"><source type="image/png" srcset="'+OPTIONS.imageBase+'.png"><source type="image/jpeg" srcset="'+OPTIONS.imageBase+'.jpg"><img src="'+OPTIONS.imageBase+'.png" alt="Data on support for the '+OPTIONS.featureID+' feature across the major browsers"></picture>':"Can I Use "+OPTIONS.featureID+"? Data on support for the "+OPTIONS.featureID+" feature across the major browsers. (Embed Loading)":"No feature ID was specified",document.getElementById("defaultMessage").innerHTML=e}function displayFeatureInformation(){if(document.getElementById("featureTitle").textContent=FEATURE.title,document.getElementById("featureLink").href=FEATURE.url,FEATURE.description){var e=FEATURE.description;e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/&lt;code&gt;/g,""),e=e.replace(/&lt;\/code&gt;/g,""),document.getElementById("featureDescription").innerHTML=e}if(FEATURE.usage_perc_y){var t=FEATURE.usage_perc_y,n=FEATURE.usage_perc_a,a=t+n;a=a.toFixed(2),document.getElementById("note").innerHTML='Global: <span class="y">'+t+'%</span> + <span class="a">'+n+"%</span> = "+a+"%"}else FEATURE.status&&(FEATURE.status.experimental&&(document.getElementById("note").innerHTML="<strong>Experimental</strong> feature"),FEATURE.status.deprecated&&(document.getElementById("note").innerHTML="<strong>Deprecated</strong> feature"));if(OPTIONS.accessibleColours&&document.body.classList.add("accessible-colours"),OPTIONS.screenshot){document.body.classList.add("screenshot");var r=new Date,s=["January","February","March","April","May","June","July","August","September","October","November","December"];document.getElementById("footer-right").innerHTML=r.getDate()+" "+s[r.getMonth()]+" "+r.getFullYear(),document.querySelector(".icon-external-link").setAttribute("hidden","true")}else document.getElementById("accessibleColoursToggle").addEventListener("click",function(){document.body.classList.toggle("accessible-colours")});switch(OPTIONS.dataSource){case"mdn":document.getElementById("footer-left").innerHTML='Data from <a href="https://github.com/mdn/browser-compat-data">mozilla.org</a> | Embed from <a href="https://caniuse.bitsofco.de">caniuse.bitsofco.de</a>';break;case"caniuse":document.getElementById("footer-left").innerHTML='Data from <a href="https://caniuse.com">caniuse.com</a> | Embed from <a href="https://caniuse.bitsofco.de">caniuse.bitsofco.de</a>'}document.body.classList.add(OPTIONS.dataSource)}function displayTable(e){for(var t=OPTIONS.periods.length-1;t>-1;t--){for(var n="",a=0;a<BROWSERS.length;a++)n+='<td class="'+BROWSERS[a]+'"></td>';var r=document.createElement("tr");r.className="statistics "+OPTIONS.periods[t],r.innerHTML=n,document.getElementById("tableBody").appendChild(r)}for(var s=!1,o=!1,i=!1,t=0;t<BROWSERS.length;t++)for(var c=BROWSERS[t],u=0;u<OPTIONS.periods.length;u++){for(var d,l=OPTIONS.periods[u],r=document.getElementsByClassName(l)[0],f=r.childNodes,p=0;p<f.length;p++)f[p].className.indexOf(c)>-1&&(d=f[p]);void 0!=e[c][l]&&(d.className+=" "+e[c][l]);var g=getShortenedBrowserVersion(BROWSER_DATA.versions[c][l]),m="<span>"+g+'</span><span class="usage">'+BROWSER_DATA.usage[c][l]+"%</span>";void 0!=BROWSER_DATA.versions[c][l]?d.innerHTML=m:d.innerHTML="<span></span>",void 0!=e[c][l]&&e[c][l].indexOf(FEATURE_IDENTIFIERS.prefixed)>-1&&(s=!0),void 0!=e[c][l]&&e[c][l].indexOf(FEATURE_IDENTIFIERS.unknown)>-1&&(o=!0),void 0!=e[c][l]&&e[c][l].indexOf(FEATURE_IDENTIFIERS.flagged)>-1&&(i=!0)}document.getElementById("legendX").style.display=s?"inline-block":"none",document.getElementById("legendU").style.display=o?"inline-block":"none",document.getElementById("legendD").style.display=i?"inline-block":"none"}function postDocumentHeight(){var e=document.getElementsByClassName("feature")[0].scrollHeight,t="ciu_embed:"+OPTIONS.featureID+":"+e;parent.postMessage(t,"*"),window.onresize=function(t){e=document.getElementsByClassName("feature")[0].scrollHeight;var n="ciu_embed:"+OPTIONS.featureID+":"+e;parent.postMessage(n,"*")}}var OPTIONS,BROWSER_DATA,FEATURE,caniuseDataUrl="https://raw.githubusercontent.com/Fyrd/caniuse/master/fulldata-json/data-2.0.json",embedAPI="https://api.caniuse.bitsofco.de",BROWSERS=["ie","edge","firefox","chrome","safari","ios_saf","op_mini","and_chr","android","samsung"],MDN_BROWSERS_KEY={ie:"ie",edge:"edge",firefox:"firefox",chrome:"chrome",safari:"safari",ios_saf:"safari_ios",op_mini:"op_mini",and_chr:"chrome_android",android:"android",samsung:"samsunginternet_android"},FEATURE_IDENTIFIERS={supported:"y",unsupported:"n",partial:"a",unknown:"u",prefixed:"x",flagged:"d"};!function(){setGlobalOptions(),displayLoadingMessage(),getFeature().then(function(){return parseSupportData()}).then(function(e){console.log(FEATURE),console.log(e),displayFeatureInformation(),displayTable(e),document.getElementById("defaultMessage").style.display="none",document.getElementsByClassName("feature")[0].style.display="block",postDocumentHeight()}).catch(function(e){document.getElementById("defaultMessage").innerHTML="Feature not found...",console.error(e)})}();