Thu, 13 Dec 2018 15:15
23andMe Informed Me My Husband and I Are Related Intelligencer The Cut Vulture Grub Street Sign In Subscribe Strategist After 38 years of marriage, I thought I knew my spouse. Then I got an email from the personalized genomics company 23AndMe with the subject line, ''You have new DNA relatives.'' Which is how I discovered that my husband Marc and I are related through more than mere marriage. We're third cousins.
When we finally stopped laughing, we texted our 30-year-old-son, Jonathan. ''I don't know how I feel about this,'' he said.
''You were the one who pushed us to get tested,'' I pointed out. ''You said, 'It'll be fun. Let's see how much of me is Dad and how much is you.'''
''Do I need to get genetic counseling?'' he fretted.
I shared my news on Facebook, with the hashtag #OurForbiddenLove. Sixty-three people quickly clicked the Like, Love, or LOL emojis, followed by a chorus of ''Get out!'' and ''No freakin' way!'' and ''How is that possible?''
''Just like the queen and Prince Phillip!''
''Or the Roosevelts.''
''You can't make this stuff up!!!!''
This being Facebook, it didn't take long before people started arguing.
John: ''Everyone has a ton of third cousins. No one on Earth is farther apart than 20th cousins.''
Ann: ''In the shtetl, we Jews all pretty much married each other.''
Doug: (mansplaining): ''What Ann means is that everyone was shtupping in the shtetl.''
Kirk: ''Family shrub. Very common where I'm from.''
Sharon tried to play nicely. ''Maybe this explains why you got engaged so fast.''
Stacy shot back: ''Yeah '... cause Marc felt like family!''
Actually, he did. Marc and I met rom-com cute, on a Club Med vacation in Nassau. I was 25; he was two years older. Initially, he was chasing my roommate. We struck up an intense conversation on the plane home, and by the time we landed at JFK, I had the unbidden thought, ''I could marry a guy like this.'' He insisted on carrying my luggage. I saw my parents chatting with a woman I didn't recognize, and pointed. ''There's my mother, but I don't know the woman she's with.''
''I do,'' he said. ''That's my mother.''
''We just ran into each other,'' my mother explained. Not only did our folks already know each other; I discovered I'd traveled 1,000 miles to the Bahamas, only to meet a man whose Manhattan apartment was just one block away from mine.
''We're moving too fast,'' I said to him on our first date, pulling out of a long kiss. ''I think we should put the brakes on.''
It was eerie how the coincidences kept accumulating. ''It's like we're two bodies with one mind,'' he said.He said, ''We can put on the physical brakes, but please don't put on the emotional ones.''
A man who welcomed intimacy, unlike all the emotionally unavailable guys I'd ever dated? It was intoxicating. On that same date, he read me an e.e. cummings poem because he said he loved the language: ''In Just-spring/when the world is mud-luscious the little/lame balloonman/whistles far and wee'....'' Entranced, I quoted back, ''And the world is puddle-wonderful.'' It might just as well have been cummings's famous ''I carry your heart with me (I carry it in my heart),'' so sure a way was it to win over my English major's heart.
That weekend as we drove out to the North Shore of Long Island for brunch, Marc said, ''Can we detour first? I want to show you one of my favorite places.''
I suddenly pictured water, weeping willows and mud. ''I'm not wearing the right shoes to get wet.''
''Where do you think I'm taking you?''
''A duck pond.''
His eyes got big. ''How do you know that?''
I hummed the Twilight Zone theme music and we laughed. But it was eerie how the coincidences kept accumulating. It was more than the fact that we both loved the southern gothic stories of Flannery O'Connor, or screwball comedies from the 1930s. We finished each other's sentences.
''It's like we're two bodies with one mind,'' he marveled.
Ten days later, we stood hand in hand in the hot summer night, watching Fourth of July fireworks over the Hudson River. Afterward, we strolled through the plaza at Lincoln Center. When we stopped to cool ourselves in the delicious mist of the fountain, he pulled me close and asked, ''Will you marry me?''
''What took you so long?'' I said.
''But you've only been dating two weeks!'' my friend Pat said. ''Are you crazy?''
Apparently.
Yet here we were, together four decades and two children later. Was it really possible that my beloved soul mate was also my relative? Marc and I made jokes about the movie Chinatown '-- ''She's my sister/my daughter/my sister/my daughter/she's both!'' '-- but was this a bit too Flowers in the Attic for comfort? ''You're my cousin-husband,'' I said. ''Better than being a sister-wife,'' he said. Every time our eyes met, we cracked up laughing. Was our newfound connection romantic '... or creepy?
''I'm not sure I believe it,'' Marc said. ''It's not like we got this report from the Institutes of Medicine.'' I saw his point: the IOM is part of the U.S. National Academy of Sciences and provides evidence-based research; 23andMe is a commercial enterprise selling ancestry and health information.
''They at least got something right,'' I said. ''They pegged Jonathan as our kid.'' According to the report, our son shared 50.1 percent of his DNA with me. It was reassuring '-- but not just because it validated our saliva samples. The night of Jonathan's birth, a nurse's aide shuffled into my hospital room and handed me a bundle for the 2 a.m. feeding. Still doped up from surgery, I unbuttoned my gown to nurse. Then my spidey sense kicked in. I twirled the plastic name bracelet around the infant's tiny wrist and stared woozily at it.
It said: ''GIRL.''
I kept a death grip on the call button till the aide shuffled back.
''This isn't my baby!''
She peered briefly and shrugged. ''Well, it looks like yours.''
So, yes, maybe for the last 30 years there'd been just the tiniest smidgen of doubt whether the hospital gave us the right child.
What I never doubted, though, was that Marc was meant to be a dad. He'd lost his father when he was only 13 years old; having a child of his own helped fill a void in his heart. He'd been ready to start a family as soon as we returned from our honeymoon; I was ambivalent. I loved our life exactly as it was. Marc, with both a Master's in English and an MBA in accounting, was working at a major medical center in health-care finance; I was a book publicist, and with Marc as my plus-one, went to glamorous literary events: dancing at Carl Sagan's book launch at Area, a celebrity-studded nightclub that blazed briefly in the '80s; swinging to the sweet jazz of the Count Basie Orchestra at Palladium; listening spellbound to legendary cabaret performer Bobby Short sing ''Don't Like Goodbyes'' at an invitation-only memorial service for Truman Capote. It was the era of Bright Lights, Big City, and I felt I was at the white-hot center of the literary establishment.
It was heady stuff, but eventually I had enough. We were both thrilled when I got pregnant at 32. My doctor, who jarringly referred to me as an ''elderly primigravida,'' insisted we have amniocentesis to rule out chromosomal abnormalities. All went well. At 37, I conceived again, but this time the pregnancy was rocky. I bled through the first trimester. During the amnio, it took three punctures before the doctor was able to extract fluid, which triggered a cascade of contractions. The doctor ordered me home to bed rest. Terrified, Marc hovered, plying me with tea and toast. I squeezed his hand. ''Sit down and listen to me,'' I said. ''It will be okay. This baby isn't going anywhere. It's a fighter.''
And it was okay. Until it wasn't. We worried that our second son Mickey, a loving and sweet toddler, wasn't talking. We took him for a comprehensive evaluation, expecting to be reassured. Instead, the doctor said, ''Don't expect higher education for your son.''
We knew that many marriages implode after a child is diagnosed with special needs. We were determined ours wouldn't be one of them. ''We're still two bodies, one mind,'' Marc said. Sometimes we worked so hard to give each child what he needed that there wasn't much left to give each other. But for our 30th anniversary, we finally took our first real vacation since our children had been born. For a whole week, we savored Paris and each other, remembering exactly why we'd fallen in love in the first place.
Which is why our implausible DNA match seemed entirely fitting to everyone who knew us. It was a fun story, and we dined out on it for weeks.
Then our friend Ed emailed an article titled ''No, You Don't Really Have 7,900 4th Cousins: Some DNA Basics for Those With Jewish Heritage.'' According to a 2014 international study published in the journal Nature Communications, all Ashkenazi Jews (Jewish individuals from Central and Eastern Europe) are at least 30th cousins, descended from a founding population of 350 people from the Middle Ages. We are an endogamous population, i.e., one that tended to marry within its own culture. Ashkenazi Jews share more DNA with one another than the average population does, which can skew the data. I learned about haplogroups and centimorgans and polymorphic markers. I dug deep into the technical data. With disappointment, I realized the science is not yet complete. It's unclear if Marc and I actually share a set of great-great-grandparents or not.
What I do know is this: We've forged an ordinary family life, even while dealing with the extraordinary needs of an autistic child. I don't need the imprimatur of 23andMe to tell me what I already know with bone-deep certainty: our connection is a decades' long conversation that continues to nurture and sustain us both.
There's an old saying that chance makes our relatives, but choice makes our friends.
Sometimes, it can even make both.
23andMe Informed Me My Husband and I Are Related Promoted links by Taboola "]:[0,"",""]};function parse(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var a=/",""],map.option=map.optgroup=[1,'"],map.thead=map.tbody=map.colgroup=map.caption=map.tfoot=[1,""],map.polyline=map.ellipse=map.polygon=map.circle=map.text=map.line=map.path=map.rect=map.g=[1,'',""];}, {}];window.modules["252"] = [function(require,module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^\/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^\/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=n0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=n():r.urljoin=n()}),i=r(function(t,e){var r=Object.prototype.hasOwnProperty,n=function(){for(var t=[],e=0;e=48&&o=65&&o=97&&o>6]+n[128|63&o]:o=57344?r+=n[224|o>>12]+n[128|o>>6&63]+n[128|63&o]:(i+=1,o=65536+((1023&o)>18]+n[128|o>>12&63]+n[128|o>>6&63]+n[128|63&o])}return r},e.compact=function(t,r){if("object"!=typeof t||null===t)return t;var n=r||[],i=n.indexOf(t);if(-1!==i)return n[i];if(n.push(t),Array.isArray(t)){for(var o=[],s=0;s=0&&r.parseArrays&&s=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!=e.status)return!0;if(t){if(t.code&&~_.indexOf(t.code))return!0;if(t.timeout&&"ECONNABORTED"==t.code)return!0;if(t.crossDomain)return!0}return!1},w.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},w.prototype.then=function(t,e){if(!this._fullfilledPromise){var r=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(t,e){r.end(function(r,n){r?e(r):t(n)})})}return this._fullfilledPromise.then(t,e)},w.prototype.catch=function(t){return this.then(void 0,t)},w.prototype.use=function(t){return t(this),this},w.prototype.ok=function(t){if("function"!=typeof t)throw Error("Callback required");return this._okCallback=t,this},w.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status=0?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.substring(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.substring(0,e)+"?"+r.join("&")}}},w.prototype._appendQueryString=function(){console.trace("Unsupported")},w.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error(t+e+"ms exceeded");n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.abort(),this.callback(n)}},w.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var T=O;function O(t){if(t)return function(t){for(var e in O.prototype)t[e]=O.prototype[e];return t}(t)}function k(){this._defaults=[]}O.prototype.get=function(t){return this.header[t.toLowerCase()]},O.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=e.split(/ *; */).shift();var r=function(t){return t.split(/ *; */).reduce(function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t},{})}(e);for(var n in r)this[n]=r[n];this.links={};try{t.link&&(this.links=function(t){return t.split(/ *, */).reduce(function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t},{})}(t.link))}catch(t){}},O.prototype._setStatusProperties=function(t){var e=t/100|0;this.status=this.statusCode=t,this.statusType=e,this.info=1==e,this.ok=2==e,this.redirect=3==e,this.clientError=4==e,this.serverError=5==e,this.error=(4==e||5==e)&&this.toError(),this.accepted=202==t,this.noContent=204==t,this.badRequest=400==t,this.unauthorized=401==t,this.notAcceptable=406==t,this.forbidden=403==t,this.notFound=404==t},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(t){k.prototype[t]=function(){return this._defaults.push({fn:t,arguments:arguments}),this}}),k.prototype._setDefaults=function(t){this._defaults.forEach(function(e){t[e.fn].apply(t,e.arguments)})};for(var C=k,A=r(function(t,r){var n;function i(){}"undefined"!=typeof window?n=window:"undefined"!=typeof self?n=self:(console.warn("Using browser-only version of superagent in non-browser environment"),n=e);var o=r=t.exports=function(t,e){return"function"==typeof e?new r.Request("GET",t).end(e):1==arguments.length?new r.Request("GET",t):new r.Request(t,e)};r.Request=l,o.getXHR=function(){if(!(!n.XMLHttpRequest||n.location&&"file:"==n.location.protocol&&n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw Error("Browser-only version of superagent could not find XHR")};var s="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function a(t){if(!v(t))return t;var e=[];for(var r in t)p(e,r,t[r]);return e.join("&")}function p(t,e,r){if(null!=r)if(Array.isArray(r))r.forEach(function(r){p(t,e,r)});else if(v(r))for(var n in r)p(t,e+"["+n+"]",r[n]);else t.push(encodeURIComponent(e)+"="+encodeURIComponent(r));else null===r&&t.push(encodeURIComponent(e))}function u(t){for(var e,r,n={},i=t.split("&"),o=0,s=i.length;o=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4==r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.onprogress=n.bind(null,"download"),e.upload&&(e.upload.onprogress=n.bind(null,"upload"))}catch(t){}try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],s=this._serializer||o.serialize[i?i.split(";")[0]:""];!s&&c(i)&&(s=o.serialize["application/json"]),s&&(r=s(r))}for(var a in this.header)null!=this.header[a]&&this.header.hasOwnProperty(a)&&e.setRequestHeader(a,this.header[a]);return this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0!==r?r:null),this},o.agent=function(){return new C},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(t){C.prototype[t.toLowerCase()]=function(e,r){var n=new o.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}}),C.prototype.del=C.prototype.delete,o.get=function(t,e,r){var n=o("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.head=function(t,e,r){var n=o("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.options=function(t,e,r){var n=o("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.del=d,o.delete=d,o.patch=function(t,e,r){var n=o("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.post=function(t,e,r){var n=o("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.put=function(t,e,r){var n=o("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}}),D=(A.Request,[]),S=[],x="undefined"!=typeof Uint8Array?Uint8Array:Array,E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=0,q=E.length;j0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function R(t,e,r){for(var n,i,o=[],s=e;s>18&63]+D[i>>12&63]+D[i>>6&63]+D[63&i]);return o.join("")}S["-".charCodeAt(0)]=62,S["_".charCodeAt(0)]=63;var U=function(t){var e,r,n,i,o,s,a=t.length;o=I(t),s=new x(3*a/4-o),n=o>0?a-4:a;var p=0;for(e=0,r=0;e>16&255,s[p++]=i>>8&255,s[p++]=255&i;return 2===o?(i=S[t.charCodeAt(e)]>4,s[p++]=255&i):1===o&&(i=S[t.charCodeAt(e)]>2,s[p++]=i>>8&255,s[p++]=255&i),s},M=function(t){for(var e,r=t.length,n=r%3,i="",o=[],s=0,a=r-n;sa?a:s+16383));return 1===n?(e=t[r-1],i+=D[e>>2],i+=D[e>10],i+=D[e>>4&63],i+=D[e0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var r=this.headers;t=t.set("Content-Type","application/json");for(var n=Object.keys(this.headers),i=0;i=65&&e=48&&e=48&&e=65&&e1){if("number"==typeof(o=t({path:"/"},n.defaults,o)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}o.expires=o.expires?o.expires.toUTCString():"";try{s=JSON.stringify(i),/^[\{\[]/.test(s)&&(i=s)}catch(t){}i=r.write?r.write(i,e):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var p="";for(var u in o)o[u]&&(p+="; "+u,!0!==o[u]&&(p+="="+o[u]));return document.cookie=e+"="+i+p}e||(s={});for(var c=document.cookie?document.cookie.split("; "):[],h=/(%[0-9A-Z]{2})+/g,l=0;l0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+r.join(",")+"]"),e},yt=r(function(t,e){var r;t.exports=r=r||function(t,e){var r=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||p).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=s>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295>16)&n)>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))>>7)^(f>>18)^f>>>3,m=u[d-2],g=(m>>17)^(m>>19)^m>>>10;u[d]=y+u[d-7]+g+u[d-16]}var v=n&i^n&o^i&o,b=(n>>2)^(n>>13)^(n>>22),w=l+((a>>6)^(a>>11)^(a>>25))+(a&c^~a&h)+p[d]+u[d];l=h,h=c,c=a,a=s+w|0,s=o,o=i,i=n,n=w+(b+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+c|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128>>9>>9>>2]>>>24-o%4*8&255)>>2]>>>24-(o+1)%4*8&255)>>2]>>>24-(o+2)%4*8&255,a=0;a>>6*(3-a)&63));var p=n.charAt(64);if(p)for(;i.length%4;)i.push(p);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-s%4*2;n[o>>>2]|=(a|p)>15;--o>=0;){var p=32767&this[t],u=this[t++]>>15,c=a*p+u*s;i=((p=s*p+((32767&c)>>30)+(c>>>15)+a*u+(i>>>30),r[n++]=1073741823&p}return i},e=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},e=26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var p=16383&this[t],u=this[t++]>>14,c=a*p+u*s;i=((p=s*p+((16383&c)>28)+(c>>14)+a*u,r[n++]=268435455&p}return i},e=28),r.prototype.DB=e,r.prototype.DM=(1>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function d(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function w(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function _(){}function T(t){return t}function O(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}d.prototype.convert=function(t){return t.s=0?t.mod(this.m):t},d.prototype.revert=function(t){return t},d.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s0&&this.m.subTo(e,e),e},f.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t>15)*this.mpl&this.um)=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t0?this[0]=t:t=0;){var a=8==n?255&t[i]:c(t,i);athis.DB?(this[this.t-1]|=(a&(1>this.DB-s):this[this.t-1]|=a=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(10&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1>n;for(var s=r+1;s>n;n>0&&(e[this.t-r-1]|=(this.s&o)>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t0?(o.lShiftTo(c,a),s.lShiftTo(c,i)):(o.copyTo(a),s.copyTo(i));var h=a.t,d=a[h-1];if(0!=d){var f=d*(11?a[h-2]>>this.F2:0),y=this.FV/f,m=(1=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t=0;){var _=i[--v]==d?this.DM:Math.floor(i[v]*y+(i[v-1]+g)*m);if((i[v]+=a.am(0,_,i,b,0,h))0&&i.rShiftTo(c,i),p0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t=0;)if(e.sqrTo(i,o),(t&10)e.mulTo(o,s,i);else{var p=i;i=o,o=p}return e.revert(i)},r.prototype.toString=function(t){if(this.s0)for(a>a)>0&&(i=!0,o=u(r));s>=0;)a>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)=0;)t.subTo(this.m,t)},O.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},O.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var k,C,A,D=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],S=(1>8&255,C[A++]^=t>>16&255,C[A++]^=t>>24&255,A>=M&&(A-=M)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=h(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,p=0;p=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(tt&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n0?e[r++]=n:n=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i>1)>D.length&&(t=D.length);for(var s=n(),a=0;a>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]>16},r.prototype.signum=function(){return this.s0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s=0;)n>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,v,e),e},r.prototype.not=function(){for(var t=n(),e=0;e=this.t?0!=this.s:0!=(this[e]&11){var y=n();for(i.sqrTo(a[1],y);p=0;){for(o>=u?m=t[v]>>o-u&c:(m=(t[v]&(10&&(m|=t[v-1]>>this.DB+o-u)),p=r;0==(1&m);)m>>=1,--p;if((o-=p)1;)i.sqrTo(s,w),i.sqrTo(w,s),p-=2;p>0?i.sqrTo(s,w):(g=s,s=w,w=g),i.mulTo(w,a[m],s)}for(;v>=0&&0==(t[v]&1=0?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(p,s)):(i.subTo(n,i),e&&a.subTo(o,a),p.subTo(s,p))}return 0!=i.compareTo(r.ONE)?r.ZERO:p.compareTo(t)>=0?p.subtract(t):p.signum()0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]>>8,C[A++]=255&E;A=0,x()}function I(){if(null==k){for(x(),(k=new U).init(C),A=0;A0&&e.length>0))throw new Error("Invalid key data");this.n=new bt(t,16),this.e=parseInt(e,16)}Tt.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new bt(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function(t){for(var e in wt){var r=wt[e],n=r.length;if(t.substring(0,n)===r)return{alg:e,hash:t.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===n.length)return!1;if(!_t.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var i=_t[n.alg](t).toString();return n.hash===i};var Ot=Tt;function kt(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function Ct(t){for(var e="",r=0;r60)throw new Rt.ConfigurationError("The leeway should be positive and lower than a minute.");if(-1===Bt.indexOf(this.expectedAlg))throw new Rt.ConfigurationError("Algorithm "+this.expectedAlg+" is not supported. (Expected algs: ["+Bt.join(",")+"])")}Pt.prototype.verify=function(t,e,r){var n=this.decode(t);if(n instanceof Error)return r(n,!1);var i=n.encoded.header+"."+n.encoded.payload,o=St.decodeToHEX(n.encoded.signature),s=n.header.alg,a=n.header.kid,p=n.payload.aud,u=n.payload.iss,c=n.payload.exp,h=n.payload.nbf,l=n.payload.nonce||null;if(this.issuer!==u)return r(new Rt.TokenValidationError("Issuer "+u+" is not valid."),!1);if(this.audience!==p)return r(new Rt.TokenValidationError("Audience "+p+" is not valid."),!1);if(this.expectedAlg!==s)return r(new Rt.TokenValidationError("Algorithm "+s+" is not supported. (Expected algs: ["+Bt.join(",")+"])"),!1);if(l!==e)return r(new Rt.TokenValidationError("Nonce does not match."),!1);var d=this.verifyExpAndNbf(c,h);return d?r(d,!1):this.getRsaVerifier(u,a,function(t,e){return t?r(t):e.verify(i,o)?r(null,n.payload):r(new Rt.TokenValidationError("Invalid signature."))})},Pt.prototype.verifyExpAndNbf=function(t,e){var r=new Date,n=new Date(0),i=new Date(0);return this.__disableExpirationCheck?null:(n.setUTCSeconds(t+this.leeway),r>n?new Rt.TokenValidationError("Expired token."):void 0===e?null:(i.setUTCSeconds(e-this.leeway),rn?new Rt.TokenValidationError("Expired token."):(i.setUTCSeconds(e-this.leeway),r-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(o,s){if(!s)throw"missing required callback argument";var a,p;o.url||(a="missing required 'url' parameter"),o.relay_url||(a="missing required 'relay_url' parameter"),a&&setTimeout(function(){s(a)},0),o.window_name||(o.window_name=null),o.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(o.window_features=void 0);var u,c=o.origin||n(o.url);if(c!==n(o.relay_url))return setTimeout(function(){s("invalid arguments: origin of url and relay_url must match")},0);i&&((p=document.createElement("iframe")).setAttribute("src",o.relay_url),p.style.display="none",p.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(p),u=p.contentWindow);var h=o.popup||window.open(o.url,o.window_name,o.window_features);o.popup&&(h.location.href=o.url),u||(u=h);var l=setInterval(function(){h&&h.closed&&(f(),s&&(s("User closed the popup window"),s=null))},500),d=JSON.stringify({a:"request",d:o.params});function f(){if(p&&document.body.removeChild(p),p=void 0,l&&(l=clearInterval(l)),r(window,"message",y),r(window,"unload",f),h)try{h.close()}catch(e){u.postMessage(t,c)}h=u=void 0}function y(t){if(t.origin===c){try{var e=JSON.parse(t.data)}catch(t){if(s)return s(t);throw t}"ready"===e.a?u.postMessage(d,c):"error"===e.a?(f(),s&&(s(e.d),s=null)):"response"===e.a&&(f(),s&&(s(null,e.d),s=null))}}return e(window,"unload",f),e(window,"message",y),{close:f,focus:function(){if(h)try{h.focus()}catch(t){}}}},onOpen:function(n){var o="*",s=i?function(){window.location;for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!s)throw"can't find relay frame";function a(t){t=JSON.stringify(t),i?s.doPost(t,o):s.postMessage(t,o)}function p(e){if(e.data===t)try{window.close()}catch(t){}}e(i?s:window,"message",function t(e){var i;try{i=JSON.parse(e.data)}catch(t){}i&&"request"===i.a&&(r(window,"message",t),o=e.origin,n&&setTimeout(function(){n(o,i.d,function(t){n=void 0,a({a:"response",d:t})})},0))}),e(i?s:window,"message",p);try{a({a:"ready"})}catch(t){e(s,"load",function(t){a({a:"ready"})})}var u=function(){try{r(i?s:window,"message",p)}catch(t){}n&&a({a:"error",d:"client closed window"}),n=void 0;try{window.close()}catch(t){}};return e(window,"unload",u),{detach:function(){r(window,"unload",u)}}}}:{open:function(t,e,r,n){setTimeout(function(){n("unsupported browser")},0)},onOpen:function(t){setTimeout(function(){t("unsupported browser")},0)}}}();t.exports&&(t.exports=e)}),Kt=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t};function Gt(){this._current_popup=null}function Qt(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new Wt(this.baseOptions),this.crossOriginAuthentication=new Jt(t,this.baseOptions),this.warn=new it({disableWarnings:!!e._disableDeprecationWarnings})}function Yt(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||tt.getWindow().location.origin||tt.getWindow().location.protocol+"//"+tt.getWindow().location.hostname+(tt.getWindow().location.port?":"+tt.getWindow().location.port:"")}function te(t){this.baseOptions=t,this.request=new N(t),this.transactionManager=new Wt(this.baseOptions)}function ee(t,e){this.baseOptions=e,this.client=t,this.request=new N(this.baseOptions),this.warn=new it({disableWarnings:!!e._disableDeprecationWarnings})}function re(t){J.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&&J.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new Ht(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests,0):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,this.transactionManager=new Wt(this.baseOptions),this.client=new oe(this.baseOptions),this.redirect=new Xt(this,this.baseOptions),this.popup=new Qt(this,this.baseOptions),this.crossOriginAuthentication=new Jt(this,this.baseOptions),this.webMessageHandler=new Ft(this),this._universalLogin=new ee(this,this.baseOptions),this.ssodataStorage=new at(this.baseOptions)}function ne(t,e){this.baseOptions=e,this.request=t}function ie(t,e){this.baseOptions=e,this.request=t}function oe(t,e){2===arguments.length?this.auth0=t:e=t,J.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl="https://"+this.baseOptions.domain,this.request=new N(this.baseOptions),this.passwordless=new ne(this.request,this.baseOptions),this.dbConnection=new ie(this.request,this.baseOptions),this.warn=new it({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new at(this.baseOptions)}function se(t){J.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new N(this.baseOptions),this.baseOptions.rootUrl=n("https://"+this.baseOptions.domain,"api","v2")}Gt.prototype.calculatePosition=function(t){var e=t.width||500,r=t.height||600,n=tt.getWindow(),i=void 0!==n.screenX?n.screenX:n.screenLeft,o=void 0!==n.screenY?n.screenY:n.screenTop;return{width:e,height:r,left:i+((void 0!==n.outerWidth?n.outerWidth:n.document.body.clientWidth)-e)/2,top:o+((void 0!==n.outerHeight?n.outerHeight:n.document.body.clientHeight)-r)/2}},Gt.prototype.preload=function(t){var e=this,r=tt.getWindow(),n=this.calculatePosition(t.popupOptions||{}),i=Q.merge(n).with(t.popupOptions),o=t.url||"about:blank",s=m(i,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed?this._current_popup:(this._current_popup=r.open(o,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null},this._current_popup)},Gt.prototype.load=function(t,e,r,n){var i=this,o=this.calculatePosition(r.popupOptions||{}),s=Q.merge(o).with(r.popupOptions),a=Q.merge({url:t,relay_url:e,window_features:m(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(r),p=Zt.open(a,function(t,e){return i._current_popup=null,n(t,e)});return p.focus(),p},Qt.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new Gt},Qt.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},Qt.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},Qt.prototype.callback=function(t){var e=this,r=tt.getWindow(),n=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||tt.getOrigin();r.opener?Zt.onOpen(function(r,i,o){if(r!==n)return o({error:"origin_mismatch",error_description:"The popup's origin ("+r+") should match the `popupOrigin` parameter ("+n+")."});e.webAuth.parseHash(t||{},function(t,e){return o(t||e)})}):r.doPost=function(t){r.parent&&r.parent.postMessage(t,n)}},Qt.prototype.authorize=function(t,e){var r,i,o={},s=this.baseOptions.plugins.get("popup.authorize"),a=Q.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(Q.blacklist(t,["popupHandler"]));return J.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),i=n(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(o.origin=Kt(a.redirectUri),i=a.redirectUri),t.popupOptions&&(o.popupOptions=Q.pick(t.popupOptions,["width","height"])),s&&(a=s.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,r=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(r,i,o,ct(e))},Qt.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=Q.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(Q.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},Qt.prototype.passwordlessVerify=function(t,e){var r=this;return this.client.passwordless.verify(Q.blacklist(t,["popupHandler"]),function(n){if(n)return e(n);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,r.client.loginWithResourceOwner(t,e)})},Qt.prototype.signupAndLogin=function(t,e){var r=this,n=this.getPopupHandler(t,!0);return t.popupHandler=n,this.client.dbConnection.signup(Q.blacklist(t,["popupHandler"]),function(i){if(i)return n._current_popup&&n._current_popup.kill(),e(i);r.loginWithCredentials(t,e)})},Yt.create=function(t){return new Yt(t)},Yt.prototype.login=function(t,e){this.handler=new zt({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},Yt.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},Yt.prototype.getCallbackHandler=function(t,e){return function(r){var n;n=e?"object"==typeof r.event.data&&r.event.data.hash?r.event.data.hash:r.event.data:r.sourceObject.contentWindow.location.hash,t(null,n)}},te.prototype.login=function(t,e){var r,i;return r=n(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=Q.blacklist(t,["email"]),i=Q.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),i=this.transactionManager.process(i),i=Q.toSnakeCase(i,["auth0Client"]),this.request.post(r).send(i).end(ct(e))},te.prototype.callback=function(t){var e,r=tt.getDocument();(e=r.createElement("div")).innerHTML=t,r.body.appendChild(e).children[0].submit()},ee.prototype.login=function(t,e){if(tt.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var r,n=Q.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return J.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(r=new te(this.baseOptions)).login(n,function(t,n){return t?e(t):r.callback(n)})},ee.prototype.signupAndLogin=function(t,e){var r=this;return r.client.client.dbConnection.signup(t,function(n){return n?e(n):r.login(t,e)})},ee.prototype.getSSOData=function(t,e){var r,i="";return"function"==typeof t&&(e=t,t=!1),J.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(i="?"+m({ldaps:1,client_id:this.baseOptions.clientID})),r=n(this.baseOptions.rootUrl,"user","ssodata",i),this.request.get(r,{noHeaders:!0}).withCredentials().end(ct(e))},re.prototype.parseHash=function(t,e){var r,n;e||"function"!=typeof t?t=t||{}:(e=t,t={});var o=tt.getWindow(),s=void 0===t.hash?o.location.hash:t.hash;if((r=function(t,e){var r=e||{};if(null!==r.decoder&&void 0!==r.decoder&&"function"!=typeof r.decoder)throw new TypeError("Decoder has to be a function.");if(r.delimiter="string"==typeof r.delimiter||i.isRegExp(r.delimiter)?r.delimiter:d.delimiter,r.depth="number"==typeof r.depth?r.depth:d.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:d.arrayLimit,r.parseArrays=!1!==r.parseArrays,r.decoder="function"==typeof r.decoder?r.decoder:d.decoder,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:d.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:d.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:d.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:d.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:d.strictNullHandling,""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){for(var r={},n=t.split(e.delimiter,e.parameterLimit===1/0?void 0:e.parameterLimit),i=0;i0&&-1!==a.indexOf("token")&&!r.hasOwnProperty("access_token")?e(ut.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):a.length>0&&-1!==a.indexOf("id_token")&&!r.hasOwnProperty("id_token")?e(ut.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,r,e)},re.prototype.validateAuthenticationResponse=function(t,e,r){var n=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var i=e.state,o=this.transactionManager.getStoredTransaction(i),s=t.state||o&&o.state||null,a=s===i;if((i||s||!t.__enableIdPInitiatedLogin)&&!a)return r({error:"invalid_token",errorDescription:"`state` does not match."});var p=t.nonce||o&&o.nonce||null,u=t.state||o&&o.appState||null,c=function(t,i){return t?r(t):(o&&o.lastUsedConnection&&(i&&(s=i.sub),n.ssodataStorage.set(o.lastUsedConnection,s)),r(null,function(t,e,r){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:r||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,u,i)));var s};return e.id_token?this.validateToken(e.id_token,p,function(t,r){return t?"invalid_token"!==t.error?c(t):"HS256"!==(new Lt).decode(e.id_token).header.alg?c(t):e.access_token?n.client.userInfo(e.access_token,function(t,e){return t?c(t):c(null,e)}):c({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can't store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"}):e.access_token&&r.at_hash?(new Lt).validateAccessToken(e.access_token,"RS256",r.at_hash,function(t){return t?c(ut.invalidToken(t.message)):c(null,r)}):c(null,r)}):c(null,null)},re.prototype.validateToken=function(t,e,r){new Lt({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||0,__disableExpirationCheck:this.baseOptions.__disableExpirationCheck}).verify(t,e,function(t,e){if(t)return r(ut.invalidToken(t.message));r(null,e)})},re.prototype.renewAuth=function(t,e){var r=!!t.usePostMessage,n=t.postMessageDataType||!1,i=t.postMessageOrigin||tt.getWindow().origin,o=t.timeout,s=this,a=Q.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),J.check(a,{type:"object",message:"options parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=Q.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),Yt.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:n,postMessageOrigin:i,timeout:o}).login(r,function(t,r){if("object"==typeof r)return e(t,r);s.parseHash({hash:r},e)})},re.prototype.checkSession=function(t,e){var r=Q.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===r.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(r=this.transactionManager.process(r)),r.redirectUri?(J.check(r,{type:"object",message:"options parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=Q.blacklist(r,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(r,e)):e({error:"error",error_description:"redirectUri can't be empty"}))},re.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},re.prototype.passwordlessStart=function(t,e){var r=Q.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(r),this.client.passwordless.start(t,e)},re.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},re.prototype.authorize=function(t){var e=Q.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);J.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",tt.redirect(this.client.buildAuthorizeUrl(e))},re.prototype.signupAndAuthorize=function(t,e){var r=this;return this.client.dbConnection.signup(Q.blacklist(t,["popupHandler"]),function(n){if(n)return e(n);t.realm=t.connection,t.username||(t.username=t.email),r.client.login(t,e)})},re.prototype.login=function(t,e){var r=Q.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);r=this.transactionManager.process(r),tt.getWindow().location.host===this.baseOptions.domain?(r.connection=r.realm,delete r.realm,this._universalLogin.login(r,e)):this.crossOriginAuthentication.login(r,e)},re.prototype.passwordlessLogin=function(t,e){var r=Q.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(r=this.transactionManager.process(r),tt.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(r,e);else{var n=Q.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:r.connection,username:r.email||r.phoneNumber,otp:r.verificationCode},Q.blacklist(r,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(n,e)}},re.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},re.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},re.prototype.logout=function(t){tt.redirect(this.client.buildLogoutUrl(t))},re.prototype.passwordlessVerify=function(t,e){var r=this,n=Q.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return J.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=this.transactionManager.process(n),this.client.passwordless.verify(n,function(t){return t?e(t):tt.redirect(r.client.passwordless.buildVerifyUrl(n))})},ne.prototype.buildVerifyUrl=function(t){var e,r;return J.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=Q.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=Q.toSnakeCase(e,["auth0Client"]),r=m(e),n(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+r)},ne.prototype.start=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"passwordless","start"),(i=Q.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(i.authParams=i.authParams||{},i.authParams.scope=i.scope),i.redirectUri&&(i.authParams=i.authParams||{},i.authParams.redirect_uri=i.redirectUri),i.responseType&&(i.authParams=i.authParams||{},i.authParams.response_type=i.responseType),delete i.redirectUri,delete i.responseType,delete i.scope,i=Q.toSnakeCase(i,["auth0Client","authParams"]),this.request.post(r).send(i).end(ct(e))},ne.prototype.verify=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),i=Q.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),i=Q.toSnakeCase(i,["auth0Client"]),r=n(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(r).send(i).end(ct(e))},ie.prototype.signup=function(t,e){var r,i,o;return J.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"dbconnections","signup"),o=(i=Q.merge(this.baseOptions,["clientID"]).with(t)).user_metadata||i.userMetadata,i=Q.blacklist(i,["scope","userMetadata","user_metadata"]),i=Q.toSnakeCase(i,["auth0Client"]),o&&(i.user_metadata=o),this.request.post(r).send(i).end(ct(e))},ie.prototype.changePassword=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"dbconnections","change_password"),i=Q.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),i=Q.toSnakeCase(i,["auth0Client"]),this.request.post(r).send(i).end(ct(e))},oe.prototype.buildAuthorizeUrl=function(t){var e,r;return J.check(t,{type:"object",message:"options parameter is not valid"}),e=Q.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),J.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&&J.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=Q.blacklist(e,["username","popupOptions","domain","tenant","timeout"]),e=Q.toSnakeCase(e,["auth0Client"]),e=ft(this.warn,e),r=m(e),n(this.baseOptions.rootUrl,"authorize","?"+r)},oe.prototype.buildLogoutUrl=function(t){var e,r;return J.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=Q.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=Q.toSnakeCase(e,["auth0Client","returnTo"]),r=m(Q.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(r+="&federated"),n(this.baseOptions.rootUrl,"v2","logout","?"+r)},oe.prototype.loginWithDefaultDirectory=function(t,e){return J.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},oe.prototype.login=function(t,e){return J.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},oe.prototype.oauthToken=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"oauth","token"),i=Q.merge(this.baseOptions,["clientID","scope","audience"]).with(t),J.check(i,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),i=Q.toSnakeCase(i,["auth0Client"]),i=dt(this.warn,i),this.request.post(r).send(i).end(ct(e))},oe.prototype.loginWithResourceOwner=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"oauth","ro"),i=Q.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(i=Q.toSnakeCase(i,["auth0Client"])).grant_type=i.grant_type||"password",this.request.post(r).send(i).end(ct(e))},oe.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new re(this.baseOptions)),tt.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),J.check(e,{type:"function",message:"cb parameter is not valid"});var r=this.baseOptions.clientID,n=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:n.lastUsedConnection,timeout:5e3},function(t,i){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):n.lastUsedSub&&n.lastUsedSub!==i.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:n.lastUsedConnection},lastUsedUserID:i.idTokenPayload.sub,lastUsedUsername:i.idTokenPayload.email||i.idTokenPayload.name,lastUsedClientID:r,sessionClients:[r],sso:!0})})},oe.prototype.userInfo=function(t,e){var r;return J.check(t,{type:"string",message:"accessToken parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"userinfo"),this.request.get(r).set("Authorization","Bearer "+t).end(ct(e,{ignoreCasing:!0}))},oe.prototype.delegation=function(t,e){var r,i;return J.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"delegation"),i=Q.merge(this.baseOptions,["clientID"]).with(t),i=Q.toSnakeCase(i,["auth0Client"]),this.request.post(r).send(i).end(ct(e))},oe.prototype.getUserCountry=function(t){var e;return J.check(t,{type:"function",message:"cb parameter is not valid"}),e=n(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(ct(t))},se.prototype.getUser=function(t,e){var r;return J.check(t,{type:"string",message:"userId parameter is not valid"}),J.check(e,{type:"function",message:"cb parameter is not valid"}),r=n(this.baseOptions.rootUrl,"users",t),this.request.get(r).end(ct(e,{ignoreCasing:!0}))},se.prototype.patchUserMetadata=function(t,e,r){var i;return J.check(t,{type:"string",message:"userId parameter is not valid"}),J.check(e,{type:"object",message:"userMetadata parameter is not valid"}),J.check(r,{type:"function",message:"cb parameter is not valid"}),i=n(this.baseOptions.rootUrl,"users",t),this.request.patch(i).send({user_metadata:e}).end(ct(r,{ignoreCasing:!0}))},se.prototype.linkUser=function(t,e,r){var i;return J.check(t,{type:"string",message:"userId parameter is not valid"}),J.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),J.check(r,{type:"function",message:"cb parameter is not valid"}),i=n(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(i).send({link_with:e}).end(ct(r,{ignoreCasing:!0}))};var ae={Authentication:oe,Management:se,WebAuth:re,version:P};t.Authentication=oe,t.Management=se,t.WebAuth=re,t.version=P,t.default=ae,Object.defineProperty(t,"__esModule",{value:!0})});}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})}, {}];window.modules["266"] = [function(require,module,exports){}, {}];window.modules["306"] = [function(require,module,exports){}, {}];window.modules["604"] = [function(require,module,exports){!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})}(this,function(t){"use strict";var e={searchParams:"URLSearchParams"in self,iterable:"Symbol"in self&&"iterator"in Symbol,blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in self,arrayBuffer:"ArrayBuffer"in self};if(e.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function i(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e.iterable&&(r[Symbol.iterator]=function(){return r}),r}function a(t){this.map={},t instanceof a?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function h(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function u(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function d(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(t){var r;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((r=t)&&DataView.prototype.isPrototypeOf(r))?(this._bodyArrayBuffer=d(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=d(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=h(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var t,e,r,o=h(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=f(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.statuse.position}),e=0;c.length>e;e+=1)c[e]=c[e].data;c.unshift(null),n.apply(null,c)},o=function(o,i){e(a[l],function(e,o){if(!t){if(t=e,e)return n(e);c.push({data:o,position:i}),c.length===a.length&&r()}})},l=0;a.length>l;l+=1)o(a[l],l)};i.noConflict=function(){return n.jsonpClient=t,i},e=o?function(){var n,e,t=document.getElementsByTagName("head")[0];return e=function(n,e){var o=document.createElement("script"),r=!1;o.src=n,o.async=!0,o.onload=o.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,o.onload=o.onreadystatechange=null,o&&o.parentNode&&o.parentNode.removeChild(o),e())},t.appendChild(o)},n=function(n,e){var t=n.match(r);if(!t)return e(new Error("Could not find callback on URL"));e(null,t[1])},function(t,o){n(t,function(n,r){var i,a=window[r];if(n)return o(n);window[r]=function(n){i=n},e(t,function(n){if(n||i||(n=new Error("Calling to "+r+" did not returned a JSON response.Make sure the callback "+r+" exists and is properly formatted.")),a)window[r]=a;else try{delete window[r]}catch(n){window[r]=void 0}o(n,i)})})}}():require(636),"undefined"!=typeof module&&module.exports?module.exports=i:n.jsonpClient=i}(this);}).call(this,require(86))}, {"86":86,"636":636}];window.modules["636"] = [function(require,module,exports){(function (process,global){"use strict";var evalJsonp,parseJsonp,evalOrParseJavascript,fetchRemoteJsonp,fetchUrl,fetchLocalJsonp,request=require(266),vm=require(252),fs=require(306),parensRegex=/(^\(|\);?\s*$)/,functionRegex=/^[a-z\d_]*\(/i,functionNameRegex=/([\w\d_]*)\(/,enableLocalFileSupport="test"===window.process.env.NODE_ENV||window.process.env.JSONP_CLIENT_ENABLE_LOCAL_SUPPORT;if("test"===window.process.env.NODE_ENV&&window.process.env.SUPERAGENT_MOCK){var mockConfig=global.superAgentMockConfig||require(window.process.env.SUPERAGENT_MOCK);require(266)(request,mockConfig)}parseJsonp=function(e,t){var r,n,o=null;try{r=e.replace(functionRegex,"").replace(parensRegex,""),n=JSON.parse(r)}catch(e){o=e}t(o,n)},evalJsonp=function(e,t){var r,n;e=(e||"")+"",r=vm.createContext({error:null,cbData:null}),n="function "+(e.match(functionNameRegex)||[null,!1])[1]+" (data) { cbData = data } try { "+e+" } catch(e) { error = e;} ";try{vm.runInContext(n,r)}catch(e){t(new Error(e))}if(r.error)return t(new Error(r.error));t(null,r.cbData)},evalOrParseJavascript=function(e,t){e=e.toString(),parseJsonp(e,function(r,n){if(r)return evalJsonp(e,function(e,r){t(e,r)});t(r,n)})},fetchUrl=function(e,t){request.get(e).buffer(!0).accept("application/javascript").parse(function(e,t){e.text="",e.setEncoding("utf8"),e.on("data",function(t){e.text=e.text+t}),e.on("end",t)}).end(function(r,n){!r&&n&&n.status&&n.status>=400&&(r=new Error("Could not fetch url "+e+", with status "+(n&&n.status||"unknown")+". Got error: "+(r&&r.message)+".")),t(r,n&&n.text||"cb({})")})},fetchRemoteJsonp=function(e,t){fetchUrl(e,function(e,r){if(e)return t(e);evalOrParseJavascript(r,t)})},fetchLocalJsonp=enableLocalFileSupport?function(e,t){e=e.split("?")[0],fs.readFile(e,function(e,r){if(e)return t(e);evalOrParseJavascript(r,t)})}:fetchRemoteJsonp,module.exports=function(e,t){e.match(/^http/)?fetchRemoteJsonp(e,t):fetchLocalJsonp(e,t)};}).call(this,require(86),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})}, {"86":86,"252":252,"266":266,"306":306}];window.modules["638"] = [function(require,module,exports){var getNative=require(640),root=require(639),DataView=getNative(root,"DataView");module.exports=DataView;}, {"639":639,"640":640}];window.modules["639"] = [function(require,module,exports){var freeGlobal=require(863),freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")();module.exports=root;}, {"863":863}];window.modules["640"] = [function(require,module,exports){var baseIsNative=require(768),getValue=require(868);function getNative(e,a){var t=getValue(e,a);return baseIsNative(t)?t:void 0}module.exports=getNative;}, {"768":768,"868":868}];window.modules["641"] = [function(require,module,exports){var hashClear=require(646),hashDelete=require(642),hashGet=require(643),hashHas=require(644),hashSet=require(645);function Hash(e){var h=-1,a=null==e?0:e.length;for(this.clear();++h-1}module.exports=listCacheHas;}, {"704":704}];window.modules["654"] = [function(require,module,exports){var assocIndexOf=require(704);function listCacheSet(s,e){var t=this.__data__,a=assocIndexOf(t,s);return a-1&&e%1==0&&e=o?e:o)),e}module.exports=baseClamp;}, {}];window.modules["711"] = [function(require,module,exports){var Stack=require(669),arrayEach=require(679),assignValue=require(703),baseAssign=require(705),baseAssignIn=require(707),cloneBuffer=require(716),copyArray=require(712),copySymbols=require(719),copySymbolsIn=require(717),getAllKeys=require(718),getAllKeysIn=require(714),getTag=require(713),initCloneArray=require(715),initCloneByTag=require(723),initCloneObject=require(720),isArray=require(123),isBuffer=require(687),isMap=require(721),isObject=require(73),isSet=require(722),keys=require(122),CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,a,r,n,t,g){var o,l=a&CLONE_DEEP_FLAG,i=a&CLONE_FLAT_FLAG,s=a&CLONE_SYMBOLS_FLAG;if(r&&(o=t?r(e,n,t,g):r(e)),void 0!==o)return o;if(!isObject(e))return e;var c=isArray(e);if(c){if(o=initCloneArray(e),!l)return copyArray(e,o)}else{var T=getTag(e),b=T==funcTag||T==genTag;if(isBuffer(e))return cloneBuffer(e,l);if(T==objectTag||T==argsTag||b&&!t){if(o=i||b?{}:initCloneObject(e),!l)return i?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}else{if(!cloneableTags[T])return t?e:{};o=initCloneByTag(e,T,l)}}g||(g=new Stack);var u=g.get(e);if(u)return u;if(g.set(e,o),isSet(e))return e.forEach(function(n){o.add(baseClone(n,a,r,n,e,g))}),o;if(isMap(e))return e.forEach(function(n,t){o.set(t,baseClone(n,a,r,t,e,g))}),o;var y=s?i?getAllKeysIn:getAllKeys:i?keysIn:keys,f=c?void 0:y(e);return arrayEach(f||e,function(n,t){f&&(n=e[t=n]),assignValue(o,t,baseClone(n,a,r,t,e,g))}),o}cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1,module.exports=baseClone;}, {"73":73,"122":122,"123":123,"669":669,"679":679,"687":687,"703":703,"705":705,"707":707,"712":712,"713":713,"714":714,"715":715,"716":716,"717":717,"718":718,"719":719,"720":720,"721":721,"722":722,"723":723}];window.modules["712"] = [function(require,module,exports){function copyArray(r,o){var y=-1,a=r.length;for(o||(o=Array(a));++y0&&r(u)?e>1?baseFlatten(u,e-1,r,t,l):arrayPush(l,u):t||(l[l.length]=u)}return l}module.exports=baseFlatten;}, {"692":692,"739":739}];window.modules["739"] = [function(require,module,exports){var Symbol=require(675),isArguments=require(686),isArray=require(123),spreadableSymbol=Symbol?Symbol.isConcatSpreadable:void 0;function isFlattenable(e){return isArray(e)||isArguments(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}module.exports=isFlattenable;}, {"123":123,"675":675,"686":686}];window.modules["740"] = [function(require,module,exports){var createBaseFor=require(741),baseFor=createBaseFor();module.exports=baseFor;}, {"741":741}];window.modules["741"] = [function(require,module,exports){function createBaseFor(e){return function(r,t,a){for(var n=-1,o=Object(r),c=a(r),u=c.length;u--;){var f=c[e?u:++n];if(!1===t(o[f],f,o))break}return r}}module.exports=createBaseFor;}, {}];window.modules["743"] = [function(require,module,exports){var castPath=require(744),toKey=require(745);function baseGet(e,t){for(var a=0,r=(t=castPath(t,e)).length;null!=e&&at}module.exports=baseGt;}, {}];window.modules["752"] = [function(require,module,exports){function baseHasIn(n,e){return null!=n&&e in Object(n)}module.exports=baseHasIn;}, {}];window.modules["753"] = [function(require,module,exports){function baseIsNaN(e){return e!=e}module.exports=baseIsNaN;}, {}];window.modules["754"] = [function(require,module,exports){function strictIndexOf(r,t,e){for(var n=e-1,f=r.length;++nn))return!1;var f=u.get(e);if(f&&u.get(r))return f==r;var o=-1,_=!0,s=a&COMPARE_UNORDERED_FLAG?new SetCache:void 0;for(u.set(e,r),u.set(r,e);++o-1&&e%1==0&&e=o?p:p*("desc"==i[n]?-1:1)}return e.index-r.index}module.exports=compareMultiple;}, {"837":837}];window.modules["804"] = [function(require,module,exports){var baseGet=require(743),baseSet=require(805),castPath=require(744);function basePickBy(e,a,t){for(var r=-1,s=a.length,b={};++rn?0:n+r),(a=a>n?n:a)a?0:a-r>>>0,r>>>=0;for(var o=Array(n);++lr||l&&u&&s&&!m&&!c||n&&u&&s||!e&&s||!o)return 1;if(!n&&!l&&!c&&i1?r[i-1]:void 0,n=i>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,n&&isIterateeCall(r[0],r[1],n)&&(s=i-1?a[n?r[s]:s]:void 0}}module.exports=createFind;}, {"122":122,"775":775,"787":787}];window.modules["858"] = [function(require,module,exports){var toNumber=require(888),INFINITY=1/0,MAX_INTEGER=1.7976931348623157e308;function toFinite(e){return e?(e=toNumber(e))===INFINITY||e===-INFINITY?(e0){if(++r>=HOT_COUNT)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}module.exports=shortOut;}, {}];window.modules["885"] = [function(require,module,exports){var toFinite=require(858);function toInteger(t){var e=toFinite(t),r=e%1;return e==e?r?e-r:e:0}module.exports=toInteger;}, {"858":858}];window.modules["887"] = [function(require,module,exports){var root=require(639),now=function(){return root.Date.now()};module.exports=now;}, {"639":639}];window.modules["888"] = [function(require,module,exports){var isObject=require(73),isSymbol=require(734),NAN=NaN,reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return NAN;if(isObject(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=isObject(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(reTrim,"");var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}module.exports=toNumber;}, {"73":73,"734":734}];window.modules["889"] = [function(require,module,exports){var baseRest=require(814),eq=require(702),isIterateeCall=require(842),keysIn=require(708),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,defaults=baseRest(function(e,r){e=Object(e);var t=-1,o=r.length,a=o>2?r[2]:void 0;for(a&&isIterateeCall(r[0],r[1],a)&&(o=1);++t0&&p>s&&(p=s);for(var y=0;y=0?(u=f.substr(0,v),c=f.substr(v+1)):(u=f,c=""),i=decodeURIComponent(u),l=decodeURIComponent(c),hasOwnProperty(o,i)?isArray(o[i])?o[i].push(l):o[i]=[o[i],l]:o[i]=l}return o};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};}, {}];window.modules["1127"] = [function(require,module,exports){"use strict";var stringifyPrimitive=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}};module.exports=function(r,e,t,n){return e=e||"&",t=t||"=",null===r&&(r=void 0),"object"==typeof r?map(objectKeys(r),function(n){var i=encodeURIComponent(stringifyPrimitive(n))+t;return isArray(r[n])?map(r[n],function(r){return i+encodeURIComponent(stringifyPrimitive(r))}).join(e):i+encodeURIComponent(stringifyPrimitive(r[n]))}).join(e):n?encodeURIComponent(stringifyPrimitive(n))+t+encodeURIComponent(stringifyPrimitive(r)):""};var isArray=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)};function map(r,e){if(r.map)return r.map(e);for(var t=[],n=0;n=0;r--){var l=localStorage().key(r);e(read(l),l)}}function remove(e){return localStorage().removeItem(e)}function clearAll(){return localStorage().clear()}module.exports={name:"localStorage",read:read,write:write,each:each,remove:remove,clearAll:clearAll};}, {"1167":1167}];window.modules["1169"] = [function(require,module,exports){module.exports={name:"memoryStorage",read:read,write:write,each:each,remove:remove,clearAll:clearAll};var memoryStorage={};function read(e){return memoryStorage[e]}function write(e,r){memoryStorage[e]=r}function each(e){for(var r in memoryStorage)memoryStorage.hasOwnProperty(r)&&e(memoryStorage[r],r)}function remove(e){delete memoryStorage[e]}function clearAll(e){memoryStorage={}}}, {}];window.modules["article-nav.client"] = [function(require,module,exports){"use strict";var dom=require(1),_throttle=require(23),$visibility=require(28),$popup=require(41),$gtm=require(40);DS.controller("article-nav",[function(){return function(t){var e=dom.find(".page-header"),i=dom.find(".article-content"),o=dom.find(t,".deepscroll-headline"),r=dom.find(t,".deepscroll-rubric"),n=dom.find(t,".deepscroll-rubric-sponsored"),l=dom.find(".article .article-header .rubric"),s=dom.find("#deepscroll_center_divider"),a=dom.find(".clay-paragraph"),d=dom.find(t,".logo"),c=dom.find(t,".dyn-cut-logo"),p=dom.find(t,".article-nav-top"),u=dom.find(t,".article-nav-deepscroll"),m=dom.find('link[rel="canonical"]'),f=m&&m.getAttribute("href"),g=dom.find('meta[property="og:image"]')?dom.find('meta[property="og:image"]').getAttribute("content"):"",h=dom.find('meta[property="og:title"]')?dom.find('meta[property="og:title"]').getAttribute("content"):"",y=dom.find(t,".share-link.facebook"),v=dom.find(t,".share-link.twitter"),w=dom.find(t,".share-link.pinterest"),b=t.classList.contains("header-simple"),x=window.getComputedStyle(d,null).getPropertyValue("--targetFlexBasis"),C=window.getComputedStyle(d,null).getPropertyValue("--verticalStart")||0,L=window.getComputedStyle(d,null).getPropertyValue("--verticalEnd")||0;function _(){!1,$()}function $(){var o,r,n,l=t.getBoundingClientRect().top,s=window.getComputedStyle(d,null).getPropertyValue("--baseFlexBasis"),m=s-x,f=(e.getBoundingClientRect().top-55)/-106,g=Math.abs(f),h=C-L-2,y=Math.round(C-(h*g+2)),v=Math.ceil(s-m*g);if(fl?t.classList.add("after-scroll"):t.classList.remove("after-scroll"),window.scrollY>l?e.classList.add("header-after-scroll"):e.classList.remove("header-after-scroll"),$visibility.getViewportWidth()>=1180&&i&&(o=a?$visibility.getPageOffset(a).top-70:0,r=$visibility.getPageOffset(i).top,n=Math.max(r,o),Math.max(window.scrollY,document.body.scrollTop)>=n)?t.classList.add("deep-scroll"):t.classList.remove("deep-scroll")}function k(t){var e=t.currentTarget,i=e.getAttribute("href"),o=e.getAttribute("data-handle"),r=$popup.getPopupClass(e.classList),n=$visibility.isBelowPrimaryContent(e)?"bottom":"top";$gtm.reportNow({event:"social-share-widget",clickLocation:n,socialNetwork:r}),$visibility.getViewportWidth()>=768&&r&&(t.preventDefault(),$popup.popWindow(r,o,i))}!function(){var e=_throttle($,30);if(dom.findAll(t,".share-link").forEach(function(t){return t.addEventListener("click",k)}),y&&(y.href="http://www.facebook.com/sharer/sharer.php?u="+f+"?utm_source=fb&utm_medium=s3&utm_campaign=sharebutton-t"),v&&(v.href="https://twitter.com/share?text="+encodeURIComponent(h)+"&url="+f+"?utm_source=tw&utm_medium=s3&utm_campaign=sharebutton-t&via="+v.getAttribute("data-handle")),w&&(w.href="http://pinterest.com/pin/create/button/?url="+f+"?utm_source=pin&utm_medium=s3&utm_campaign=sharebutton-t&description="+encodeURIComponent(h)+"&media="+g),b)return;window.addEventListener("scroll",e),window.addEventListener("resize",_),l?l.classList.contains("rubric-sponsor-story")&&n?(r.classList.remove("visible"),n.classList.add("visible"),n.textContent=l.text||l.textContent):(r.textContent=l.text||l.textContent,r.href=l.href||"#"):(s.style.display="none",r.style.display="none");_(),o.textContent=h}()}}]);}, {"1":1,"23":23,"28":28,"40":40,"41":41}];window.modules["nav-dropdown-button.client"] = [function(require,module,exports){"use strict";var dom=require(1);function getNextSiblings(n){for(var t=[],e=n;e=e.nextElementSibling;)t.push(e);return t}module.exports=function(n){var t,e=n.querySelector(".nav-dropdown-button-trigger"),o=dom.find("body"),i=dom.find("header.page-header"),s=dom.find('[data-editable="main"]');function d(){var e,d=window.innerWidth0&&(this.isNavVariation&&e1?"s":""),this.el.classList.remove("no-comments"))},n.prototype.shouldRenderCommentStream=function(){return-1!==e.indexOf("@published")},n}]);}, {"1":1,"34":34,"80":80,"81":81}];window.modules["ad.client"] = [function(require,module,exports){"use strict";var _forEach=require(27),_max=require(29),$visibility=require(28),flaggedComponentsOnPage=function(){var e,t=document.querySelector(".article-content"),n=[];return t&&_forEach(['.article-sidebar[data-width="large"]'],function(a){e=t.querySelectorAll(a),_forEach(e,function(e){n.push(e)})}),n}();function getElementsVerticalOverlap(e,t){var n=e.getBoundingClientRect(),a=t.getBoundingClientRect();return!(n.top>a.bottom||n.righta.right)?a.bottom-n.top:0}function getElementsOverlapAmount(e,t){var n,a=[];return _forEach(t,function(t){n=getElementsVerticalOverlap(e,t),a.push(n)}),_max(a)}function getCutAdChannel(e){return{all:"",animals:"Self/SoU",beauty:"Style/Beauty","career money productivity":"Power/Money",celebrity:"Culture/Celebrity","crime-assault":"Power","culture-media":"Culture",fashion:"Style/Fashion","feminism-politics-identity":"Power/Politics","relationships-friends family":"Self","health-wellness":"Self/Health","home design":"Style/Design_Hunting","learning creativity":"Self/SoU",living:"Style",other:"",parenting:"Self/Motherhood","mental health personality social behavior":"Self","relationships-sex dating marriage":"Self/sex_relationships",shopping:"Style/Shopping",weddings:"Style/Weddings"}[e]||""}function getVultureAdChannel(e){var t="";switch(e){case"tv":case"music":case"movies":case"books":case"comedy":case"art":case"theater":t=e;break;default:t=""}return t}function getIntelligencerAdChannel(e){var t="";switch(e){case"politics-domestic":case"politics-international":t="Politics";break;case"business":case"internet-culture":case"products-apps-software":case"products-consumer-electronics":t="Business";break;case"tech-industry":case"tech-society":t="Technology";break;default:t=""}return t}function getNYMagAdChannel(e){var t="";switch(e){case"all":t=e;break;case"company information":t="company";break;case"new york guides & things to do":t="to-do";break;case"other":t=e;break;case"sponsored guides":t="s-guides";break;default:t=""}return t}function appendSectionToDfpAds(){var e,t,n,a=document.querySelector("meta[property='og:site_name']"),i=document.querySelector("article[data-content-channel]"),o=document.querySelectorAll('[data-name^="/4088/"]');a&&(e=a.content),i&&(t=i.getAttribute("data-content-channel").toLowerCase()),t&&("The Cut"===e?n=getCutAdChannel(t):"Vulture"===e?n=getVultureAdChannel(t):"Intelligencer"===e?n=getIntelligencerAdChannel(t):"New York Magazine"===e&&(n=getNYMagAdChannel(t)),n&&_forEach(o,function(e){e.setAttribute("data-name",e.getAttribute("data-name")+"/"+n)}))}function injectGoogleScripts(){var e=document.createElement("script"),t=document.createElement("script"),n=document.createDocumentFragment();e.src="https://www.googletagservices.com/tag/js/gpt.js",e.async="async",t.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",t.async="async",n.appendChild(e),n.appendChild(t),document.getElementsByTagName("body")[0].appendChild(n)}appendSectionToDfpAds(),injectGoogleScripts(),DS.controller("ad",["adService",function(e){return function(t){var n,a,i=e.create(t),o=t.getAttribute("data-offload"),r=new $visibility.Visible(t,{preloadThreshold:o?window.innerHeight/2:200}),s=!1;function l(){window.innerWidth>=1180&&t.parentElement.classList.contains("ad-repeat")&&flaggedComponentsOnPage.length&&(n=getElementsOverlapAmount(t,flaggedComponentsOnPage),a=parseInt(t.parentElement.getAttribute("data-gap"),10),t.style.marginTop=a+30+n+"px")}function c(){l(),e.refresh(i)}function d(){e.remove(i),s||(s=!0,r.on("shown",c))}r.preload&&$visibility.isElementNotHidden(t)?(e.addToPageLoadQueue(i),o&&r.on("hidden",d)):(r.on("preload",function(){!i.slot&&$visibility.isElementNotHidden(t)&&(l(),e.load(i))}),o&&r.on("hidden",d)),this.adData=i}}]);}, {"27":27,"28":28,"29":29}];window.modules["coral-talk.client"] = [function(require,module,exports){"use strict";var coralEmbed,dom=require(1),store=require(89),visibility=require(28),auth0=require(7),TALK_AUTH="talk:auth_token",hasEmbedScriptLoaded=!1,hasCoralTalkRendered=!1;function renderComments(e){if(hasEmbedScriptLoaded&&!hasCoralTalkRendered){var t={talk:"".concat(window.location.protocol,"//").concat(e.CORAL_TALK_HOST),auth_token:store.get(TALK_AUTH),asset_url:e.TALK_ASSET_URL};hasCoralTalkRendered=!0,coralEmbed=window.Coral.Talk.render(e.commentStreamContainer,t)}}function coralLogin(){coralEmbed.login(store.get(TALK_AUTH))}function embedScript(e,t){var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.addEventListener("load",function(){hasEmbedScriptLoaded=!0,renderComments(t)}),document.getElementsByTagName("head")[0].appendChild(n)}function attemptScriptEmbedding(e){hasEmbedScriptLoaded?renderComments(e):embedScript(e.EMBED_URL,e)}function addVisibilityListener(e,t){new visibility.Visible(e,{preloadThreshold:750}).on("preload",function(){return attemptScriptEmbedding(t)})}function removeSignInButton(e){e&&e.parentNode&&dom.removeElement(e)}function init(e){var t=e.getAttribute("data-coral-talk-host"),n="".concat(window.location.protocol,"//").concat(t,"/embed.js"),i=document.documentElement.getAttribute("data-uri"),o="http://".concat(i,".html"),r="true"===e.getAttribute("data-maintenance"),a=-1!==o.indexOf("@published"),c=e.querySelector(".coral-talk-container"),d=e.querySelector(".coral-talk-btn-signin"),l={CORAL_TALK_HOST:t,EMBED_URL:n,commentStreamContainer:c,signInButton:d,TALK_ASSET_URL:o};!r&&a&&(auth0.on("init",function(){addVisibilityListener(e,l),d.addEventListener("click",function(){return auth0.showLogin()}),auth0.isAuthenticated()&&removeSignInButton(d)}),auth0.on("login",function(t,n){removeSignInButton(d),store.set(TALK_AUTH,t["http://nymag.com/coral_talk"],n),visibility.isElementInViewport(e)&&attemptScriptEmbedding(l),hasCoralTalkRendered&&coralLogin()}),auth0.on("logout",function(){store.remove(TALK_AUTH)}))}module.exports=init;}, {"1":1,"7":7,"28":28,"89":89}];window.modules["choreographer.client"] = [function(require,module,exports){"use strict";var cookie=require(26),_require=require(65),insertSpeedBumpComponents=_require.insertSpeedBumpComponents,_require2=require(64),generateGrowl=_require2.generateGrowl,gtm=require(40),_require3=require(61),getLocalStorage=_require3.getLocalStorage,_require4=require(66),getClientHistory=_require4.getClientHistory,updateClientHistoryWithPageData=_require4.updateClientHistoryWithPageData,auth0=require(7),_require5=require(62),Scenario=_require5.Scenario,cidReadyEvent="nymcid-set",cidKey="nymcid",logger=require(63).Logger(function(){return getLocalStorage("show_choreographer_logs")});function initializeChoreographer(e){var o=e.getAttribute("data-site-slug"),t=pageShouldCountAsView(),r=auth0.isSubscriber();return o?getClientId(cidKey,8e3).then(function(e){return logger.h1("Choreographer initialized"),logger.log("clientId: ".concat(e)),logger.log("page counts as a view: ".concat(t)),t?updateClientHistoryWithPageData(e,o):getClientHistory(e)}).then(function(n){if(logger.group(),logger.h2("Client history"),logger.table(n),logger.groupEnd(),!isNCR()){var i=readJSONFromScript(e.querySelector("script")),c=i.scenarios,a=i.touts,l=c.map(function(e){return Scenario(e,n,o,r)}).filter(function(e){return logger.group(),logger.h2("Evaluating scenarios"),logger.log(e),logger.groupEnd(),e.shouldShow}).reduce(function(e,o){var t=o.action,r=o.min,n=o.count,i=a.find(function(e){return e.value===t});return!i||e[i.type]?e:(e[i.type]=i,e[i.type].viewCount=n-r,e)},{});logger.group(),logger.h2("Active Touts"),logger.log(l),logger.groupEnd(),executeTouts(e,t,l,n)}}).catch(console.error):console.error("siteSlug not found.")}function documentIncludesComponent(e){return document.querySelector('[data-uri*="/'.concat(e,'/"]'))}function pageShouldCountAsView(){return!documentIncludesComponent("product")}function executeTouts(e,o){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0,n=r.global,i={totalArticleCount:n.total||0,standardArticleCount:n.Article||0,featureArticleCount:n.Feature||0,magazineArticleCount:n.Magazine||0};o&&t["content-cliff"]?cliff(findTemplate(e,"content-cliff"),t["content-cliff"],t["content-cliff"].viewsLeft,r):t["growl-newletter"]||!t["promo-growl"]?t["speed-bump"]&&insertSpeedBumpComponents(findTemplate(e,"speed-bump"),t["speed-bump"],i):promoGrowl(findTemplate(e,"growl-message"),{contentClass:"promo-content",title:void 0,name:t["promo-growl"].name,scrollDepth:t["promo-growl"].promoGrowlScrollDepth,cta:t["promo-growl"].promoGrowlCTA,body:t["promo-growl"].promoGrowlMessage,link:t["promo-growl"].promoGrowlLink,baseTrackingData:i})}function promoGrowl(e,o){var t=o.contentClass,r=o.scrollDepth,n=o.name,i=o.title,c=o.body,a=o.cta,l=o.link,u=o.baseTrackingData;var g,s=(g='\n \n "),document.createRange().createContextualFragment(g));s.querySelector("a").addEventListener("click",function(){var e=u;e.event="eec.promotionClick",e.ecommerce={promoClick:{promotions:[{name:n,creative:c,id:"promo growl",position:"growl"}]}},gtm.reportNow(e)}),generateGrowl(e,"#growl-message",{content:s,scrollDepth:r,onShow:function(){var e=u;e.event="eec.promotionView",e.ecommerce={promoView:{promotions:[{name:n,creative:c,id:"promo growl",position:"growl"}]}},gtm.reportNow(e)}})}function cliff(e,o,t,r){var n=r.first_visit,i=r.global,c={totalArticleCount:i.total||0,standardArticleCount:i.Article||0,featureArticleCount:i.Feature||0,magazineArticleCount:i.Magazine||0},a=o.name,l=o.contentCliffWarningBody,u=o.contentCliffBody,g=document.importNode(e,!0).querySelector(".content-cliff"),s=document.querySelector(".article-content > .clay-paragraph");g&&(s.insertAdjacentHTML("afterend",g.outerHTML),require("content-cliff.client")(document.querySelector(".content-cliff"),{cliffOptions:o,viewsLeft:t,firstVisit:Number(n),onWarn:function(){var e=c;e.event="eec.promotionView",e.ecommerce={promoView:{promotions:[{name:a,creative:l,id:"warning growl",position:"growl"}]}},gtm.reportNow(e)},onClickWarn:function(){var e=c;e.event="eec.promotionClick",e.ecommerce={promoClick:{promotions:[{name:a,creative:l,id:"warning growl",position:"growl"}]}},gtm.reportNow(e)},onShow:function(){var e=c;e.event="eec.promotionView",e.ecommerce={promoView:{promotions:[{name:a,creative:u,id:"content cliff",position:"in-article"}]}},gtm.reportNow(e)},onClickCliff:function(){var e=c;e.event="eec.promotionClick",e.ecommerce={promoClick:{promotions:[{name:a,creative:u,id:"content cliff",position:"in-article"}]}},gtm.reportNow(e)}}))}function getClientId(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8e3,t=cookie.get(e);return t?Promise.resolve(t):new Promise(function(t,r){var n=setTimeout(function(){r("could not find key: ".concat(e," on cookie after ").concat(o,"ms"))},o);window.addEventListener(cidReadyEvent,function(){clearTimeout(n),t(cookie.get(e))})})}function readJSONFromScript(e){try{return JSON.parse(e.innerHTML)}catch(e){return{touts:[],scenarios:[]}}}function findTemplate(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=e&&e.querySelector('[data-template-id="'.concat(o,'"]'));return t&&t.content}function isNCR(){return/[?&]source=ncr/.test(location.search)}module.exports=function(e){auth0.on("init",function(){initializeChoreographer(e)})};}, {"7":7,"26":26,"40":40,"61":61,"62":62,"63":63,"64":64,"65":65,"66":66,"content-cliff.client":"content-cliff.client"}];window.modules["growl.client"] = [function(require,module,exports){"use strict";require(112);var _some=require(113),dom=require(1),localStorageKeyRoot="slideout-",_require=require(61),getLocalStorage=_require.getLocalStorage,setLocalStorage=_require.setLocalStorage;module.exports=function(e,t){var o=t.content,r=t.onShow,i=t.scrollDepth,n=void 0===i?50:i,s=t.dismissable,a=void 0!==s&&s,l=Number(n||e.getAttribute("data-display-at-page-scroll-percentage")),c=dom.find(e,".modal"),d=t.id||e.getAttribute("id"),u=localStorageKeyRoot+d,g=getLocalStorage(u);function m(){c.classList.add("hidden")}function v(){setLocalStorage(u,!0),m()}a&&g?e.remove():(o&&e.querySelector("[data-content]").appendChild(o),l&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=new IntersectionObserver(function(e){_some(e,"isIntersecting")&&(c.style.top="inherit",c.classList.remove("hidden","initial"),"function"==typeof r&&r(),t.unobserve(c))});c.style.top="".concat(document.querySelector("body").scrollHeight/(100/e),"px"),t.observe(c)}(l),e.querySelector(".dismiss-modal").addEventListener("click",function(){return a?v():m()}),e.addEventListener("growl:hide",m),e.addEventListener("growl:dismiss",v))};}, {"1":1,"61":61,"112":112,"113":113}];window.modules["speed-bump.client"] = [function(require,module,exports){"use strict";var gtm=require(40),visibility=require(28);module.exports=function(e,i){if(i&&e){var o=i.name,r=i.speedbumpDescription,t=i.speedbumpMessage,n=i.speedbumpLink,s=i.baseTrackingData,c=new visibility.Visible(e,{shownThreshold:.5});e.querySelector(".description").innerHTML=r,e.querySelector(".promo-link").innerHTML=t,e.querySelector(".promo-link").href=n,e.classList.remove("collapsed"),c.on("shown",function(){if(visibility.isElementNotHidden(e)){var i=s;i.event="eec.promotionView",i.ecommerce={promoView:{promotions:[{name:o,creative:r,id:"speed bump",position:"in-article"}]}},gtm.reportNow(i),c.destroy()}}),e.querySelector(".promo-link").addEventListener("click",function(){var e=s;e.event="eec.promotionClick",e.ecommerce={promoClick:{promotions:[{name:o,creative:r,id:"speed bump",position:"in-article"}]}},gtm.reportNow(e)})}};}, {"28":28,"40":40}];window.modules["content-cliff.client"] = [function(require,module,exports){"use strict";var _require=require(64),generateGrowl=_require.generateGrowl,auth0=require(7),isProduction=require(6)(),_require2=require(61),getLocalStorage=_require2.getLocalStorage,setLocalStorage=_require2.setLocalStorage,logger=require(63).Logger(function(){return!isProduction});function findTemplate(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.querySelector('[data-template-id="'.concat(t,'"]'));return n&&n.content}module.exports=function(e,t){if(t){logger.group(),logger.h2("Content Cliff");var n,o=t.cliffOptions,r=t.viewCount,c=t.firstVisit,i=t.onWarn,a=t.onClickWarn,l=t.onShow,u=t.onClickCliff,f=o.contentCliffWarningTitle,s=o.contentCliffWarningBody,d=o.contentCliffWarningCTA,g=o.contentCliffWarningLink,v=o.contentCliffWarningScrollDepth,h=findTemplate(e,"content-cliff-warning-growl"),w=300,p=["taboola"],m="#content-cliff",q=e,C=(n=0,document.querySelectorAll("[data-word-count]").forEach(function(e){n+=Number(e.getAttribute("data-word-count")||0,10)||0}),n),S=function(e,t){function n(e){return Math.round(e.getTime()/1e3/60)}var o=n(e),r=n(t);return o-r}(new Date,new Date(c))\n \n\n
').concat(c,'
\n
').concat(u,'
\n
').concat(s," \n
\n \n \n "),document.createRange().createContextualFragment(q));var q;function C(){var e=new Date,t=e.getMonth(),n=e.getFullYear();return"content-cliff-warning-displayed-".concat(n,"-").concat(t)}return m.querySelector("a").addEventListener("click",a),{warn:function(){generateGrowl(e,"#content-cliff-warning-growl",{content:m,onShow:function(){var e;i(),e=C(),setLocalStorage(e,"true")},scrollDepth:h})},shouldWarn:function(e){return t=C(),!("true"===getLocalStorage(t))||e0&&void 0!==arguments[0]?arguments[0]:"";return document.querySelectorAll("".concat(e," ~ *"))}(m)).forEach(function(e){return e.remove()}),t=o.contentCliffStatus,n=o.contentCliffPromo,r=o.contentCliffCTA,c=o.contentCliffURL,i=e.querySelector("[data-content-cliff-status]"),a=e.querySelector("[data-content-cliff-promo]"),(f=e.querySelector("[data-content-cliff-cta]"))&&f.setAttribute("href",c),f&&f.insertAdjacentHTML("afterbegin",r),i&&i.insertAdjacentHTML("afterbegin",t),a&&a.insertAdjacentHTML("afterbegin",n),f&&f.addEventListener("click",u),q.classList.remove("collapsed"),p.forEach(function(e){var t=document.querySelector('[data-uri*="/'.concat(e,'/"]'));t&&t.remove()}),A.addEventListener("click",function(){return auth0.showLogin()})}}[function(){if(C1&&i.classList.add("multi-children"),a=0;a=1180?t.push({mode:a?"thumbnails-f":"thumbnails-b",container:"taboola-desktop-below-article-thumbnails",placement:"Desktop Below Article Thumbnails",target_type:"mix"}):window.innerWidth>=768?t.push({mode:a?"thumbnails-g":"thumbnails-c",container:"taboola-tablet-below-article-thumbnails",placement:"Tablet Below Article Thumbnails",target_type:"mix"}):t.push({mode:a?"thumbnails-h":"thumbnails-d",container:"taboola-mobile-below-article-thumbnails",placement:"Mobile Below Article Thumbnails",target_type:"mix"})}module.exports=function(t){var e,a,o,i,n=t.getAttribute("data-taboolaId"),l=t.getAttribute("data-site-slug");t.classList.contains("disabled")||(window._taboola=window._taboola||[],window._taboola.push({article:"auto"}),e=document.createElement("script"),a=document.getElementsByTagName("script")[0],o="//cdn.taboola.com/libtrc/".concat(n,"/loader.js"),i="tb_loader_script",document.getElementById(i)||(e.async=1,e.src=o,e.id=i,a.parentNode.insertBefore(e,a)),window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("tbl_ic"),pushUnits(window._taboola,l),window._taboola.push({flush:!0}))};}, {}];window.modules["article.client"] = [function(require,module,exports){"use strict";var $visibility=require(28),$gtm=require(40);DS.controller("article",[function(){var e=40;function t(t){var i=document.querySelector(".wrapper > .tertiary"),n=t.querySelector(".article-header"),r=n?n.querySelector("img"):null,o=function(){i.style.paddingTop=n.getBoundingClientRect().height+e+"px"};i&&n&&(window.innerWidth-1,o=new RegExp("[\\?&]tag=[^&]+");if(r&&n)return(i=_get(e,"search","")).match(o)||(e.search=(i?i+"&":"?")+"tag="+n),e.href}(u,r)||f(s,r,u))&&(u.href=i))}function h(e){var t,n,r=dom.closest(e.target,"a"),o=r&&r.href;o&&o.length&&(r.href=(n=(t=o).split(i)).length>1?decodeURIComponent(n[1]):t)}return function(e){var i=function(e){return!!(r=e.getAttribute("data-skimlinks"))}(e),a=function(e){return!!(n=e.getAttribute("data-amazon"))}(e);visit.onceReady(function(e){o=e}),(i||a)&&(!function(e){t=(e.getAttribute("data-excluded-hostnames")||"").toLowerCase().split(",")}(e),globalClick.addHandler(_,h))}}]);}, {"1":1,"30":30,"31":31,"32":32,"33":33,"34":34,"35":35,"36":36}];window.modules["gtm.client"] = [function(require,module,exports){"use strict";var $gtm=require(40);DS.controller("gtm",[function(){return function(t){$gtm.init(t.getAttribute("data-container-id"))}}]);}, {"40":40}];window.modules["sailthru-personalization-pixel.client"] = [function(require,module,exports){"use strict";DS.controller("sailthru-personalization-pixel",[function(){return function(){var t,e=document.querySelector(".sailthru-personalization-pixel"),o=e.getAttribute("data-horizon");(t=document.createElement("script")).type="text/javascript",t.async=!0,t.src="https://ak.sail-horizon.com/horizon/v1.js",t.onload=function(){Sailthru.setup({domain:o,useStoredTags:!1})},e.appendChild(t)}}]);}, {}];window.modules["global-nav.client"] = [function(require,module,exports){"use strict";var dom=require(1),auth0=require(7),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find(".global-nav"),gtm=require(40),pageUri=require(110).getPageUri();function gtmSendReport(t,e,n){var i={eventCategory:"ecommerce",eventAction:"componentClick",brand:t,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"vertical-link"===n&&(i.eventLabel=e.href),gtm.reportNow(i)}function init(t){auth0.on("init",function(){t.querySelectorAll(".user-link").forEach(function(t){t.classList.add("active")}),signInButton.addEventListener("click",function(t){t.preventDefault(),auth0.showLogin(function(e){e||gtmSendReport("Sign In",t.target,"user-info-link")})}),signOutButton.addEventListener("click",function(t){t.preventDefault(),auth0.logout(),gtmSendReport("Sign Out",t.target,"user-info-link")}),auth0.isAuthenticated()&&t.classList.add("signed-in"),auth0.isSubscriber()&&t.classList.add("subscribed")}),auth0.on("login",function(){t.classList.add("signed-in"),auth0.isSubscriber()&&t.classList.add("subscribed")}),auth0.on("logout",function(){t.classList.remove("signed-in"),t.classList.remove("subscribed")})}globalNav.addEventListener("click",function(t){var e=t.target;e.classList.contains("global-nav-track")&>mSendReport(e.text,e,"vertical-link")}),module.exports=init;}, {"1":1,"7":7,"40":40,"110":110}];window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";var eventify=require(136),_pickBy=require(57),_each=require(210),fingerprintjs2=require(209),DS=require(208);function registerGlobals(){window.DS=DS,window.Eventify=eventify,window.Fingerprint2=fingerprintjs2,DS.value("Eventify",eventify),DS.value("Fingerprint2",fingerprintjs2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var r=_pickBy(n.definitions,function(e){return e.providerStrategy===n.providers.controller}),o=Object.keys(r);function t(e){return function(r){try{n.get(e,r)}catch(e){logMountError(r,e)}}}_each(o,function(n){var r=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),o=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(r,t(n)),_each(o,t(n))}),this.components=o}]),DS.get("components")}function logMountError(e,n){var r=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+r,n)}registerGlobals(),document.addEventListener("DOMContentLoaded",function(){mountDollarSliceComponents()});}, {"57":57,"136":136,"208":208,"209":209,"210":210}];window.modules["ads.legacy"] = [function(require,module,exports){"use strict";var _map=require(37),_forEach=require(27),_isString=require(156),_each=require(210),_debounce=require(102),_sortBy=require(96),page=require(110),visit=require(35);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var n,r,o,s,d,u,c={},l=this,g=[],f=visit.getQueryParamsObject(["utm_campaign"]);i.NYM={},i.NYM.analytics={},i.NYM.analytics.adStartTime=i.performance.now(),i.googletag=i.googletag||{},i.googletag.cmd=i.googletag.cmd||[],u=i.googletag,n=function(e){var t,a,n=e.data;return n.loaded?e:(n.loaded=!0,t=null,(t=n.sizes?u.defineSlot(n.name,n.sizes,n.id).addService(u.pubads()):u.defineOutOfPageSlot(n.name,n.id).addService(u.pubads())).setTargeting("adid",n.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=l.getAdCount(n.label),t.setTargeting("label",n.label+"_"+n.site+"-"+a),u.display(n.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),e.slot=t,e)},r=function(e){var a,i,n,r=t(),o=e.getAttribute("data-name"),s=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),u=e.getAttribute("data-site");r=e.id,s&&s.length?(s=s.split(","),a=[],_map(s,function(e){e=e.split("x"),i=parseInt(e[0]),n=parseInt(e[1]),a.push([i,n])})):(e.classList.add("oop"),a=!1),this.data={id:r,name:o,sizes:a,loaded:!1,label:d,site:u},c[r]=this},s=function(e){u.cmd.push(function(){var t=n(e);c[e.data.id]=t})},o=function(e){e.slot?u.pubads().refresh([e.slot],{changeCorrelator:!1}):e&&s(e)},u.cmd.push(function(){var e,t,n,r=page.getMeta("article:tag"),o=page.getMeta("author"),s=i.location.href,d=(e=a.head.querySelector(".head-gtm"),t=a.body.querySelector(".gtm"),e&&"top"===e.getAttribute("data-gtm")?"gtmtop":t&&"bottom"===t.getAttribute("data-gtm")?"gtmbottom":"");n=[],_forEach([r,o,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\'/g,"")).length&&n.push(e)})}),u.pubads().setTargeting("kw",n),s=s.slice(s.lastIndexOf("/")+1),u.pubads().setTargeting("pn",s),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=s,this.create=function(e){return new r(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),o(t)):o(e)},this.remove=function(e){var t=e.data.id;a.getElementById(t).innerHTML=""},this.getAdCount=function(e){var t,a=0,i=Object.keys(c);return _each(i,function(i){(t=c[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return c[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(g,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?s(e):i.setTimeout(function(){s(e)},1200)}),g=[]},10),this.addToPageLoadQueue=function(e){g.push(e),d()}}]);}, {"27":27,"35":35,"37":37,"96":96,"102":102,"110":110,"156":156,"210":210}];window.modules["chartbeat.legacy"] = [function(require,module,exports){"use strict";var page=require(110),auth0=require(7);DS.service("chartbeat",["$document","$window",function(t,e){var a,n,o,i,c,s=t.getElementById("cb-sponsor-data");function r(){var a=t.createElement("script");e._sf_endpt=(new Date).getTime(),a.setAttribute("language","javascript"),a.setAttribute("type","text/javascript"),a.setAttribute("src","//static.chartbeat.com/js/chartbeat.js"),t.body.appendChild(a)}e._sf_async_config={uid:19989,useCanonical:!0,domain:"nymag.com",sections:(a=page.getSiteBase(),n=page.getSiteName(),o=n||a,"The Cut"!==o&&"Vulture"!==o||(o+=[",",o,page.getChannel()].join(" ")),o)},(i=page.getPrimaryPageComponent())&&"Sponsored Story"===i.getAttribute("data-type")?(e._sf_async_config.sponsorName=s&&s.getAttribute("data-sponsor"),e._sf_async_config.type="Sponsored"):e._sf_async_config.sponsorName=void 0,(c=t.querySelectorAll(".article-author")).length&&(e._sf_async_config.authors=c[0].textContent.trim()),e._cbq=e._cbq||[],auth0.on("init",function(){var a,n;e._cbq.push(["_acct",auth0.isAuthenticated()?"lgdin":"anon"]),a=r,"complete"===t.readyState?a():(n="function"==typeof e.onload?e.onload:function(){},e.onload=function(){n(),a()})})}]),setTimeout(function(){DS.get("chartbeat")},0);}, {"7":7,"110":110}];window.modules["cid.legacy"] = [function(require,module,exports){"use strict";DS.service("$cid",function(){var r=Math.floor(100*Math.random());return function(){return"cid-"+ ++r}});}, {}];window.modules["facebook.legacy"] = [function(require,module,exports){"use strict";DS.service("facebook",[function(){this.fb=function(i){window.FB&&window.FB[i].apply(this,Array.prototype.slice.call(arguments,1))}}]);}, {}];require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o typeof key === 'string' && key.match(/\.legacy$/)) .forEach((key) => window.require(key));}function tryToMount(fn, el, name) { try { fn(el); // init the controller } catch (e) { const elementTag = el.outerHTML.slice(0, el.outerHTML.indexOf(el.innerHTML)); console.error(`Error initializing controller for "${name}" on "${elementTag}"`, e); }}/** * mount client.js component controllers */function mountComponentModules() { Object.keys(window.modules) .filter((key) => typeof key === 'string' && key.match(/\.client$/)) .forEach((key) => { let controllerFn = window.require(key); if (typeof controllerFn === 'function') { const name = key.replace('.client', ''), instancesSelector = `[data-uri*="_components/${name}/"]`, defaultSelector = `[data-uri$="_components${name}"]`, instances = document.querySelectorAll(instancesSelector), defaults = document.querySelectorAll(defaultSelector); for (let el of instances) { tryToMount(controllerFn, el, name); } for (let el of defaults) { tryToMount(controllerFn, el, name); } } });}// Make sure that a `window.process.env.NODE_ENV` is available in the client for any dependencies,// services, or components that could require it// note: the `` value is swapped for the actual environment variable in /lib/cmd/compile/scripts.jswindow.process = window.process || {};window.process.env = window.process.env || {};if (!window.process.env.NODE_ENV) { window.process.env.NODE_ENV = '';}// note: legacy controllers that require legacy services (e.g. dollar-slice) must// wait for DOMContentLoaded to initialize themselves, as the files themselves must be mounted firstmountLegacyServices();mountComponentModules(); // ]]