!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],o):"object"==typeof exports?exports["openstack-uicore-foundation"]=o():e["openstack-uicore-foundation"]=o()}(this,(()=>(()=>{"use strict";var e={8362:e=>{e.exports=require("moment-timezone")},6530:e=>{e.exports=require("urijs")}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var a=o[t]={exports:{}};return e[t](a,a.exports,n),a.exports}(()=>{n.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return n.d(o,{a:o}),o}})(),(()=>{n.d=(e,o)=>{for(var t in o)n.o(o,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})}})(),(()=>{n.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o)})(),(()=>{n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};return(()=>{n.r(t),n.d(t,{arraysEqual:()=>T,base64URLEncode:()=>A,buildAPIBaseUrl:()=>S,convertSVGtoImg:()=>B,epochToMoment:()=>l,epochToMomentTimeZone:()=>u,findElementPos:()=>i,formatEpoch:()=>d,getAllowedUserGroups:()=>v,getAuthCallback:()=>w,getBackURL:()=>g,getCurrentHref:()=>h,getCurrentLocation:()=>p,getCurrentPathName:()=>y,getCurrentUserLanguage:()=>j,getEventHosts:()=>M,getEventLocation:()=>R,getFromLocalStorage:()=>E,getOrigin:()=>m,getTimeServiceUrl:()=>x,hasErrors:()=>O,isClearingSessionState:()=>_,isEmpty:()=>U,objectToQueryString:()=>c,parseLocationHour:()=>s,putOnLocalStorage:()=>b,removeFromLocalStorage:()=>L,retryPromise:()=>C,scrollToError:()=>k,setSessionClearingState:()=>I,shallowEqual:()=>P,toSlug:()=>f});var e=n(8362),o=n.n(e),r=n(6530),a=n.n(r);const i=e=>{var o=-70;if(e.offsetParent){do{o+=e.offsetTop}while(e=e.offsetParent);return[o]}},l=e=>e?(e*=1e3,o()(e)):e,u=(e,n)=>e?(e*=1e3,o()(e).tz(n)):e,d=(e,o="M/D/YYYY h:mm a")=>e?l(e).format(o):e,s=e=>{let o=e.toString();return o.length<4&&(o=`0${o}`),o=o.match(/.{2}/g),o=o.join(":"),o},c=e=>{var o="";for(var n in e)""!=o&&(o+="&"),o+=n+"="+encodeURIComponent(e[n]);return o},g=()=>{let e=a()(window.location.href),o=e.search(!0),n=e.fragment(),t=o.hasOwnProperty("BackUrl")?o.BackUrl:null;return null!=n&&""!=n&&(t+=`#${n}`),t},f=e=>(e=e.toLowerCase()).replace(/[^a-zA-Z0-9]+/g,"_"),w=()=>"undefined"!=typeof window?`${window.location.origin}/auth/callback`:null,p=()=>{let e="";return"undefined"!=typeof window&&(e=window.location,window.top&&(e=window.top.location)),e},m=()=>"undefined"!=typeof window?window.location.origin:null,y=()=>"undefined"!=typeof window?window.location.pathname:null,h=()=>"undefined"!=typeof window?window.location.href:null,v=()=>"undefined"!=typeof window?window.ALLOWED_USER_GROUPS||"":null,S=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,b=(e,o)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,o)},E=(e,o)=>{if("undefined"!=typeof window){let n=window.localStorage.getItem(e);return o&&(console.log(`getFromLocalStorage removing key ${e}`),L(e)),n}return null},L=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},_=()=>"undefined"!=typeof window&&window.clearing_session_state,I=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},j=()=>{let e="en";return"undefined"!=typeof navigator&&(e=navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage),e},k=e=>{if(Object.keys(e).length>0){const o=Object.keys(e)[0],n=document.getElementById(o);n&&window.scrollTo(0,i(n))}},O=(e,o)=>e in o?o[e]:"",P=(e,o)=>{const n=Object.keys(e),t=Object.keys(o);if(n.length!==t.length)return!1;for(let t of n)if(e[t]!==o[t])return!1;return!0},T=(e,o)=>e.length===o.length&&e.every(((e,n)=>P(e,o[n]))),U=e=>0===Object.keys(e).length,A=e=>e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),C=async(e,o=3)=>{for(let n=0;n<o;n++)if(await e())return!0;return!1},x=()=>"undefined"!=typeof window?window.TIMEINTERVALSINCE1970_API_URL||process.env.TIMEINTERVALSINCE1970_API_URL:null,R=(e,o,n=null,t=null)=>{var r,a;const i=!n||!t||1e3*n<t,l=[],{location:u}=e;return i&&u?(o>1&&null!==(r=u.venue)&&void 0!==r&&r.name&&l.push(u.venue.name),null!==(a=u.floor)&&void 0!==a&&a.name&&l.push(u.floor.name),u.name&&l.push(u.name),l.length>0?l.join(" - "):"TBA"):"TBA"},M=e=>{var o;let n=[];return(null===(o=e.speakers)||void 0===o?void 0:o.length)>0&&(n=[...e.speakers]),e.moderator&&n.push(e.moderator),n},B=async e=>{const o=await(async e=>{const o=document.createElement("img");return o.src=e,o.crossOrigin="anonymous",new Promise(((e,n)=>{o.onload=()=>e(o),o.onerror=n}))})(e),n=100,t=Math.floor(100*o.naturalHeight/o.naturalWidth),r=document.createElement("canvas");r.width=n,r.height=t,r.getContext("2d").drawImage(o,0,0,n,t);const a=await r.toDataURL("image/png",1);return console.log(a,n,t),{url:a,width:n,height:t}}})(),t})()));
//# sourceMappingURL=methods.js.map