“The show must never feel old. It must always feel brand new, and a 50th anniversary can play against that. The show must be seen to be going forward. It’s all about the next 50 years, not about the last 50 years. If you start putting a full stop on it, if you start thinking it’s all about nostalgia, then you’re finished. It’s about moving forward. The Doctor is moving forward as he always does, and he wants to solve the mystery of Clara. He’s not thinking about all his previous incarnations and his previous adventures, he’s thinking about the future. And that, for me, is important.” — Steven Moffat
I don’t always agree with Moffat, and my initial reaction to this statement was, “This is just his rationalization for not including the classic Doctors in the 50th!” But I thought on it, and then thought some more, and realized that wasn’t what he was addressing. No producer of Doctor Who wants to see the show die on their watch. A big part of the Who producer’s job – even if it’s not implicitly stated in the contract – is to keep the show healthy, and keep it moving forward, so that there’s something for the next person to work with.
“The Name of the Doctor” is that kind of story. It’s less about summing up this season, and more about looking towards the future by showing us the Doctor’s eventual fate, revealed by pointing the spotlight on the place his remains will end up at the close of his mind-bogglingly long life. The death of the Doctor is of paramount importance at this stage of Doctor Who, and it’s central to this particular story in which numerous characters die and are brought back to life, which I didn’t care for, but we’ll get to that. Right now I want to discuss a specific fanxiety I’ve felt since the series started again in 2005, and how “The Name of the Doctor” has helped alleviate it to a degree.
“I’m a time traveler. I’ve probably time traveled more than anyone else … my grave is potentially the most dangerous place in the universe.” — The Doctor
Many years ago in a story entitled “The Deadly Assassin” — which is cornerstone, Doctor Who 101 — writer Robert Holmes revealed that Time Lords have a maximum of thirteen lives. It was presented not as a pivotal, game-changing moment, but rather as an almost throwaway line. Regardless, people (on both sides of the TV screen) latched onto it, and it became this hard, serious piece of Who mythology — one that came to be referenced again and again within the series in the years that followed … until the new series came along.
It’s disconcerting that the thirteen-lives limit has not even once been addressed in the seven seasons and change the new series has been on the air; it’s almost as though there’s a conspiracy among The Powers That Be, intent on running the series for as long as financially advantageous, to ignore it, hoping this essential, definitive piece of canon might go away. The rule can be circumvented, as in “The Five Doctors,” when the Master was offered a new life cycle by the Time Lords, but the Doctor, as the character we’ve come to know and trust, must never be seen making choices that show him actively avoiding, or attempting to change his eventual end.
Immortality bestowed upon the Time Lord is anathema to the very core of this series, which often celebrates life, and the delicate, fleeting nature of it. The Doctor must be acutely aware that someday he will die, and “The Name of the Doctor” puts as fine a point on the issue as anything the series has ever done. By showcasing the Doctor’s finality, the series will hopefully imbue him with even more life. It’s long been my belief that this version of Doctor Who should end at the close of the thirteenth Doctor’s life (though after this episode’s cliffhanger, perhaps I should prepare to amend my belief system). For now, though, it’s reasonably satisfying knowing there is an end to the Time Lord in sight, whenever or however it may be, and that we’ve been witness to a major aspect of his fate.
“I’m Clara Oswald. I’m the Impossible Girl. I was born to save the Doctor.” — Clara
“The Name of the Doctor” gets a fair amount of mileage out of fate, or at least the Who equivalent of it. It begins by going back to the very beginning — back to before we came in on the action in 1963, by showing the First Doctor (William Hartnell) and his granddaughter Susan, stealing a TARDIS and running away from Gallifrey — only Clara (Jenna-Louise Coleman) is also there. Soon enough all sorts of different Claras intersect with all the old Doctors, in a dizzying (though not entirely seamless) display of technological morphing of past and present.
Some moments in the sequence work better than others; the Sixth Doctor striding behind Clara in the TARDIS nailed it, while the stuff with the Second Doctor running around what appeared to be Venice Beach didn’t gel at all. In any case, what was refreshing about this showcase of classic Who was that it made no apologies for the low-fi, sometimes clunky version that existed prior to the slick one of today, embracing it as is, to wit: They dared highlight a truly terrible classic Who moment, the literal cliffhanger in which Seventh Doctor Sylvester McCoy hangs off a cliff by his umbrella from “Dragonfire.”
“It’s like my mom always said: ‘A soufflé isn’t a soufflé – the soufflé is the recipe.’” — Clara
Following the eye-catching opening, the entire affair pulls back and segues into an unusually disciplined season finale by Moffat standards. There isn’t an immense amount of running around, or massive space battles, or even loads of wibbly-wobbly. It’s a streamlined, inaction-packed season finale of modern Doctor Who. Driven by out of this world ideas, imagery and dialogue, Moffat goes to town instilling his players with all manner of foreboding poetry, both literal and figurative.
Act I largely consists of a buildup toward, and the eventual meeting of, the Eleventh Doctor’s confidants - Vastra, Strax, Jenny, Clara, and River Song — via an effective hallucinatory conference call, culminating in the kidnapping of the space age Victorian trio. Act II traces the Doctor’s journey to Trenzalore with Clara in tow, as well as mounting a confrontation between the Great Intelligence and the Doctor. Act III takes place mostly inside the Doctor’s tomb, and finally, briefly, inside the remains of the Doctor — or rather the “scar tissue” of his many journeys, as he describes it. (You didn’t tune in looking for scientific accuracy, did you?) “The Name of the Doctor” is a 45-minute journey to the core being of the Doctor himself, and it leaves us there, hanging, hungry to know more.
“When a TARDIS is dying, sometimes the dimension dams start breaking down. Used to call it a size leak. All the bigger on the inside starts leaking to the outside.” — The Doctor
While the return of Alex Kingston’s River Song was expected, the form in which she appeared wasn’t. We’ve crossed a threshold, and are now dealing with the undead digital afterthought River Song the Doctor left in the Library. I guess this means the flesh and blood River is no more as far as the series is concerned? Even though the kiss she and the Doctor exchanged felt definitive, like the sort of thing that closes a book or a movie, her presence was left open-ended, for a potential return. We never even got to see River’s best moment here — her uttering of the Doctor’s name so that the tomb would open. Did anyone actually expect for the series to give our central character a name beyond the one he’s known by? I was skeptical they would, and am really rather relieved that road went untraveled. Of course, in not naming the Doctor, the power behind his real name feels almost greater than before.
The return of the Great Intelligence, embodied by the visage of the late Dr. Simeon (Richard E. Grant), was perhaps the least surprising aspect of the episode, and not just because Grant appeared in the “Next week!” trailers. It seemed a foregone conclusion after “The Bells of St. John” that the GI would be back for the finale, given that the idea seems to be Moffat’s baby, and the finale was the only script of his left in the season. Grant does great, imposing work here, redeeming his less impressive showing in “The Snowmen.” It seems as though ultimately the GI was chosen by Moffat simply to be a spokesperson for all of the Doctor’s enemies. Though well delivered by Grant, much of his speechifying has a something of a “been there, done that” quality to it. Didn’t we hear similar words in “The Pandorica Opens,” when all the enemies worked together?
“The Doctor lives his life in darker hues, day upon day. And he will have other names before the end: The Storm, The Beast, The Valeyard.” — The Great Intelligence
The biggest mystery of the season — that of the Impossible Girl, Clara — finally came into full focus, as did her character, who may be the first companion to inspire melancholy. I came to love Clara here in a big way, but in a way that’s normally reserved for people viewed with an amount of sadness. Particularly moving are her feelings and memories of her mother. It’s as though after her mother died, Clara’s life had only one purpose, and that was to sacrifice herself for the Doctor (and countless billions of others.) Everything she ever was, is and could be added up to her decision in that moment — to give herself so that he may live. It’s a beautiful and highly moving series of events, marred by Moffat’s complete inability to be courageous and do the right dramatic thing, which of course, would have been to kill Clara.
Clara should have died here, and the sum total of her tale would have been considered one of the brave Doctor Who flourishes if she had. We’re already dealing with a story in which Jenny died twice, Strax once, and gigantic portions of the universe itself were reordered and changed — all of which were reversed. There should have been a price paid for all of this, and it should have been Clara’s life. It would have been a thing of heartbreaking beauty that would ultimately have elevated season seven and taken it right up over the top. This was already a story about death, and what it really needed was for someone important to die, and to die doing something important. It even felt throughout like that’s where it was heading, and it’s as though the ending was changed. (Amazing how moving the material plays regardless.) Like I said, it takes courage to go there, but given that this show is ending its seventh season, it would have been a perfect time to inflict this sort of heroic tragedy on the series. Sooner or later this version of Doctor Who is going to have to have an Adric, and this episode should have been the sooner. I must assign star ratings, and it’s because Clara is still alive that “Name” got four instead of five.
“Run! Run you clever boy…and remember me.” — Clara
Finally, the cliffhanger reveal of the Doctor’s greatest secret — surely the one thing everyone talked about as soon as the episode ended — must be discussed. Beyond his casting in the anniversary special, there have been rumors floating around concerning John Hurt playing an alternate version of the Doctor. Is this Doctor from his future or his past? Is this the Doctor that ended the Time War? Is this Doctor a modern incarnation of the Valeyard — the shadowy, dark version of the Doctor that plagued the Sixth Doctor, and existed somewhere between his final two lives?
The reveal’s actually a bit of cheat. Had it been a no name actor, the moment would be less thrilling, but the scene trades scripted dramatic thrust for an amount of star power, as one is simply dazzled by Hurt turning around, and seeing the words, “Introducing John Hurt as The Doctor” onscreen. Sci-fi probably hasn’t seen this exciting of a season-ending cliffhanger since Picard was turned into Locutus. November feels like forever from now.
“What I did, I did without choice…in the name of peace and sanity.” — John Hurt as the Doctor
“The Name of the Doctor” is as much a prequel to the 50th anniversary special, as it is a finale to the season. Reactions will be divided, as well they should be. It will start arguments, and people will threaten to stop watching the show because of it (but with that cliffhanger, there’s no way in hell that’ll happen). You know what other story divided fan opinion? “The Deadly Assassin.” Upon broadcast, the 1977 serial was deemed “incredibly, utterly wasted”; it “shattered … illusions of the Time Lords, and lowered them to ordinary people”; and perhaps most harshly, “As a Doctor Who story, ‘The Deadly Assassin’ is just not worth considering.” Doctor Who has a lengthy history of vitriolic anger coming at it from its most devout fans. I can’t remember a time when people weren’t saying “It’s not as good as it used to be,” and maybe the most surefire sign that Doctor Who is doing something right is that it’s pissing off its fanbase.
Odds and Ends
Who was serial killer Clarence Demarco, and did he have any connection to the Doctor beyond the Great Intelligence and the Whisper Men?
The Whisper Men — eerie manifestations of the Intelligence — were an outstanding one-off creation; little more than pure mood and atmosphere, yes, but what presence they had.
The episode indicated that the Doctor remembered considerably more of “Journey to the Centre of the TARDIS” than Clara. Also, the journey taken through the TARDIS here felt like a delayed payoff from the previous episode.
It’s difficult to believe that the TARDIS console room will have the same desktop theme upon the Doctor’s death as it does now.
If River must return, for the love of all that is Gallifreyan, Steven Moffat, please ditch the “Spoilers” gag!
Clara: (to River) “I’m sorry, I never realized you were a woman.” Strax: (beat) “Neither did I.” The only thing missing was the rimshot.
How exactly did Clara’s entering of the Doctor’s timestream negate all the wickedness done to it by the Great Intelligence?
Sometimes, such as with this episode, Doctor Who feels like the world’s longest running TV experiment.
By submitting your email, you agree to our
Terms and Privacy Notice
and to receive email correspondence from us. This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
or
Already a subscriber?
What is your email?
This email will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
Password must be at least 8 characters and contain:
Lower case letters (a-z)
Upper case letters (A-Z)
Numbers (0-9)
Special Characters (!@#$%^&*)
This password will be used to sign into all New York sites. By submitting your email, you agree to our Terms and Privacy Policy and to receive email correspondence from us.
You’re in!
As part of your account, you’ll receive occasional updates and offers from New York, which you can opt out of anytime.
Already a subscriber?
Already a subscriber?
`;
// integrate Sub(x) scripts and elements
if (hostname !== 'subs.nymag.com') { // do not integrate on this subdomain
document.head.appendChild(trackingScript);
document.body.insertAdjacentHTML('beforeend', subXAnimationElements);
}
There was an error processing the request. Please try again later."}).catch(e=>console.error("Error verifying email: ",e)))(r.querySelector(".content"),o.bannerCTAVerification)})):(l.remove(),s.remove()),o.dismissable||n.remove(),o.useAlertIcon||a.remove(),r.classList.add("show"),n.addEventListener("click",()=>{u(),r.classList.remove("show")})}else r.remove()}});
}, {"3":3,"6":6,"17":17,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(17),signInButton=dom.find(".user-signin"),signOutButton=dom.find(".user-signout"),globalNav=dom.find('[class^="global-nav"]'),body=dom.find("body"),dropdownItems=dom.findAll(".dropdown-wrap"),gtm=require(3),appendLandingPageParams=require(135),pageUri=require(124).getPageUri(),subscriptionPromoLinks=dom.findAll(".persist-params"),searchString=window.location.search||"";function closeDropdowns(e){let n=globalNav.querySelectorAll(".dropdown.open");dropdownItems.forEach(function(t){let i=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||i.classList.remove("open")})}function gtmSendReport(e,n,t){let i={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(i.eventLabel=n.href),gtm.reportNow(i)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const i=t.split("?"),o=new URLSearchParams(i[1]);for(let e of n.entries())o.set(e[0],e[1]);t=`${i[0]}?${o.toString()}`,e.href=t}else e.href=`${t}?${n.toString()}`}}function init(e){const n=e.querySelectorAll(".to-landing-page");window.addEventListener("auth:init",()=>{signInButton.addEventListener("click",function(e){e.preventDefault(),auth.showEmbeddedLoginFlow("top navigation")}),signOutButton.addEventListener("click",function(e){e.preventDefault(),gtmSendReport("Sign Out",e.target,"user-info-link"),auth.logout()}),auth.isAuthenticated()&&e.classList.add("signed-in"),(auth.isSubscriber()||auth.isMobileAppRequest())&&e.classList.add("subscribed"),e.querySelectorAll(".user-link").forEach(e=>{e.classList.add("active")}),subscriptionPromoLinks.forEach(e=>{updateElementTargetUrlsIfQueryStrings(e)}),appendLandingPageParams(n)})}dropdownItems.forEach(function(e){e.addEventListener("click",function(){e.querySelector(".dropdown").classList.toggle("open")})}),body.addEventListener("click",closeDropdowns),document.addEventListener("keydown",closeDropdowns),globalNav.addEventListener("click",function(e){let n=e.target;n.classList.contains("global-nav-track")&>mSendReport(n.text,n,"global-nav-link")}),module.exports=init;
}, {"3":3,"4":4,"17":17,"124":124,"135":135}];
window.modules["aaa-module-mounting.legacy"] = [function(require,module,exports){"use strict";const _pickBy=require(221),_each=require(406),Fingerprint2=require(408),DS=require(407),Eventify=require(246);function registerGlobals(){window.DS=DS,window.Eventify=Eventify,window.Fingerprint2=Fingerprint2,DS.value("Eventify",Eventify),DS.value("Fingerprint2",Fingerprint2),DS.value("$document",window.document),DS.value("$window",window)}function mountDollarSliceComponents(){DS.service("components",["$document","$module",function(e,n){var o=_pickBy(n.definitions,e=>e.providerStrategy===n.providers.controller),r=Object.keys(o);function t(e){return o=>{try{n.get(e,o)}catch(e){logMountError(o,e)}}}_each(r,n=>{var o=e.querySelectorAll('[data-uri*="/_components/'+n+'/"]'),r=e.querySelectorAll('[data-uri$="/_components/'+n+'"]');_each(o,t(n)),_each(r,t(n))}),this.components=r}]),DS.get("components")}function logMountError(e,n){const o=e.outerHTML.slice(0,e.outerHTML.indexOf(e.innerHTML));console.error("Error attaching controller to "+o,n)}registerGlobals(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mountDollarSliceComponents()}):mountDollarSliceComponents();
}, {"221":221,"246":246,"406":406,"407":407,"408":408}];
window.modules["ads.legacy"] = [function(require,module,exports){"use strict";const _map=require(118),_forEach=require(107),_isString=require(268),_intersectionWith=require(409),_isEqual=require(274),_each=require(406),_debounce=require(182),_sortBy=require(205),page=require(124),visit=require(114);DS.service("adService",["Eventify","$cid","$document","$window",function(e,t,a,i){var o,n,s,r,d,c,u,l,g={},p=this,h=[],f=visit.getQueryParamsObject(["utm_campaign"]),m=document.querySelector('script[data-type="ad-a9"]'),b=[],w=!1,v=[],y=document.querySelector('script[data-name="ad-doubleverify"]');document.querySelector('script[data-name="concert-ads"]')||(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,(m||y)&&(i.googletag.cmd=i.googletag.cmd||[],i.googletag.cmd.push(function(){i.googletag.pubads().disableInitialLoad()})),m&&(l=i.setInterval(function(){void 0!==window.apstag&&void 0!==window.apstag.timeout&&(i.clearInterval(l),window.apstag.cleared=!0,l=null)},10),setTimeout(function(){l&&(i.clearInterval(l),i.googletag.pubads().refresh(),window.apstag||console.log("MESSAGE: Timeout for A9 load exceeded, aborting"))},500)),y&&(b.push(new Promise(function(e){w?e():v.push(e)})),c=i.setTimeout(T,2500)),o=function(e){var t,a,o=e.data,n=[];return o.loaded?e:(o.loaded=!0,t=null,(t=o.sizes?u.defineSlot(o.name,o.sizes,o.id).addService(u.pubads()):u.defineOutOfPageSlot(o.name,o.id).addService(u.pubads())).setTargeting("adid",o.id),f.hasOwnProperty("utm_campaign")&&t.setTargeting("utmcamp",f.utm_campaign),a=p.getAdCount(o.label),t.setTargeting("label",o.label+"_"+o.site+"-"+a),u.display(o.id),u.pubads().addEventListener("slotOnload",function(){i.NYM.analytics.firstAdLoadTime||(i.NYM.analytics.firstAdLoadTime=i.performance.now(),i.NYM.analytics.firstAdLoadLabel=e.data.label)}),n=_(o),Promise.all(b).then(function(){n?window.apstag&&window.apstag.cleared?window.apstag.fetchBids({slots:[n],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([t],{changeCorrelator:!1})})}):y&&u.pubads().refresh([t],{changeCorrelator:!1}):u.pubads().refresh([t],{changeCorrelator:!1})}),e.slot=t,e)},n=function(e){var a,i,o,n=t(),s=e.getAttribute("data-name"),r=e.getAttribute("data-sizes"),d=e.getAttribute("data-label"),c=e.getAttribute("data-site");n=e.id,r&&r.length?(r=r.split(","),a=[],_map(r,function(e){e=e.split("x"),i=parseInt(e[0]),o=parseInt(e[1]),a.push([i,o])})):(e.classList.add("oop"),a=!1),this.data={id:n,name:s,sizes:a,loaded:!1,label:d,site:c},g[n]=this},r=function(e){u.cmd.push(function(){var t=o(e);g[e.data.id]=t})},s=function(e){var t=[];e.slot?(t=_(e))&&window.apstag&&window.apstag.cleared&&window.apstag.fetchBids({slots:[t],timeout:window.apstag.timeout},function(){u.cmd.push(function(){window.apstag.setDisplayBids(),u.pubads().refresh([e.slot],{changeCorrelator:!1})})}):e&&r(e)},u.cmd.push(function(){var e,t,o,n=page.getMeta("article:tag"),s=page.getMeta("author"),r=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":"");o=[],_forEach([n,s,d],function(e){_forEach(e.split(","),function(e){(e=e.trim().toLowerCase().replace(/\s/g,"-").replace(/\'|\’/g,"")).length&&o.push(e)})}),u.pubads().setTargeting("kw",o),u.pubads().setTargeting("entry_group",o),r=r.slice(r.lastIndexOf("/")+1),u.pubads().setTargeting("pn",r),u.companionAds().setRefreshUnfilledSlots(!0),u.pubads().enableAsyncRendering(),u.enableServices()}),this.load=r,this.create=function(e){return new n(e)},this.refresh=function(e){var t;_isString(e)?(t=this.getById(e),s(t)):s(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(g);return _each(i,function(i){(t=g[i]).data.loaded&&t.data.label===e&&a++}),a},this.getById=function(e){return g[e]},d=_debounce(function(){var e={TopLeaderboard:1,RightColTopMPU:2,outOfPage:99,"homepageTakeover/TopLeaderboard":1},t=_sortBy(h,function(t){return e[t.data.label]||10});_forEach(t,function(e){return e.data.sizes?r(e):i.setTimeout(function(){r(e)},2e3)}),y&&window.PQ.cmd.push(()=>{try{window.PQ.loadSignals(["ids","bsc","vlp"],T)}catch(e){T(),console.error(`There has been an error loading Double Verify signals: ${e}`)}}),h=[]},10),this.addToPageLoadQueue=function(e){h.push(e),d()});function _(e){var t,a=e.sizes;return a=_intersectionWith(a,[[970,250],[970,90],[728,90],[300,600],[300,250],[320,100],[320,50]],_isEqual),e.sizes&&e.sizes.length&&(t={slotID:e.id,sizes:a,slotName:e.label}),t}function T(){i.clearTimeout(c),w=!0,_forEach(v,function(e){e()})}}]);
}, {"107":107,"114":114,"118":118,"124":124,"182":182,"205":205,"268":268,"274":274,"406":406,"409":409}];
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["client.legacy"] = [function(require,module,exports){"use strict";require("cid.legacy"),require("ads.legacy"),require("facebook.legacy"),require("aaa-module-mounting.legacy");
}, {"cid.legacy":"cid.legacy","ads.legacy":"ads.legacy","facebook.legacy":"facebook.legacy","aaa-module-mounting.legacy":"aaa-module-mounting.legacy"}];
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.js
window.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 first
mountLegacyServices();
mountComponentModules();
// ]]