Ryan Hardy was just about to rescue Joey last week, all he had to do was go up a set of stairs, when Paul popped up and pointed a gun at his head. Paul can’t actually shoot him, though, since Joe’s game is for Hardy’s benefit and so he instead makes him move into the living room. Thing is, that’s where Paul, Emma, and Jacob always have their tense relationship discussions and Hardy’s presence sort of interferes with that. They still have those conversations, right in front of him, but they also look really annoyed when he tries to join in.
Paul wants Jacob to tie Hardy up, but Hardy mind games Jacob out of doing it, by telling him that he’ll break his bones if he tries it. Hardy doesn’t care if Paul shoots him; he knows that they won’t hurt Joey and that’s his only concern. Besides, the whole farmhouse is about to be surrounded by the FBI. No, seriously, here they come. Their helicopters probably just hit all red lights, that’s why it’s taking so long. Any minute now.
I get that the show is invested in keeping this kidnap plotline going, but it’s really pushing it to have our hero find Joey, spend the whole episode in the same house with a bunch of killers who are not allowed to kill, while every law-enforcement officer in the state, if not country, knows exactly where they are and what the situation is and still doesn’t manage rescue him. The only thing I can think of is that The Following takes place in an alternate world, sort of like how zombie movies don’t exist inside zombie movies, where all these people were trained by one bumbling teacher who was just the most epically terrible juggler of time ever. Like, this guy wore his watch over his forehead like an old-timey doctor, that’s what he thought watches were for.
Kevin Bacon did seem like he was having a lot of fun this episode, screwing with the nutty threesome. Hardy figures out that they all slept together and that the power dynamics are off. There are a lot of “Get a hold of these guys” over to Megan, the girl from the basement. She, in turn, threw him her share of “Just get me out of here already. I’m having the worst week.”
Meanwhile, Weston is doing his computer-whiz thing in some FBI makeshift headquarters that appears to be, like, in the farmhouse’s front yard. All the local cops are freaking out because one of their men died last week. The rube local police have never seen a dead body, which has been Xeroxed to death by this point, to the point of where we’re making copies of copies. The show does throw in a nice twist involving one of them, though — the female cop who had been scouting the area with Weston, but we’ll get to that in a minute (or half a day, same difference). Clickity clack, Weston’s intercepted an e-mail from the farmhouse. But it’s encoded! It’s going to take an hour to upload! And the SWAT team is going to take an hour, too! What should we do to kill the time? I know, let’s have Agent Parker call up Emma and talk about painting and mother issues with her. “Parental influence defines us,” Parker informs Weston. That’s a good one, he should write that down, but he can’t spare the fingers. His keyboard needs all ten of them. Emma says she isn’t falling for Parker’s weak Kevin Spacey impersonation and hangs up. But then she calls back. “She’s stalling,” Parker tells her team. No, you’re stalling lady. Also, you’re fired, right? Parker is the head of a kidnapping investigation that has no contingency plan in the case of the child being found. That just has to be a fireable offense. That agent from the first episode was fired for less than that. For hurting Hardy’s feelings? For having a Gmail account instead of a Hotmail?
While we wait for the four SWAT team members to arrive, let’s go to a flashback really quick. It involves Agent Parker. At the beginning of the episode, I kept thinking that her hair looked especially done. Like her casually tousled curls were all down and framing her face just so. I understood why as soon as we were in flashback land when her hair is straight so that we know she is younger, I guess? Putting a year or even writing “this scene took place two to ten years ago” would’ve been more effective. For starters, her hair is severely straightened. It’s what happens when you’re a freelancer and you splurge on a blowout and insist that the stylist both blow-dries and flat-irons it so you get your money’s worth. But Agent Parker has a steady job (for now) and so why would she have insisted the stylist do that. It’s completely unrealistic.
In the flashback, Parker sees some guy whose her age but who (we eventually find out) is supposed to be a lot older than, like twenty years. This is conveyed by some gray at his temples. I’m really going to need to mail in my comment card soon, the one that asks my opinions about all things hair-related on this show and whether I find the choices convincing or distracting.
Anyway, this Freaky Friday of a man asks Parker what she’s doing there. She says she’s come to see her family, and he’s all, “Why would you think they would want to see you?” And then the show pulls a stunt that I’m sure Damon Lindelof felt wherever he was last night: It does a flashback within a flashback. Suddenly we’re watching the memory of Parker’s memory. She’s about 14, it looks like, wearing a long, white nightgown and walking down the hallway of a house. She opens the door to a bedroom and that same gray hair on the temples guy is in there, sitting on the bed, surrounded by candles. She stands there fiddling with her necklace, which is a medallion that I’m sure is, like, interwoven chains of energy or whatever. He goes to hug her and she wigs out and goes running out of the room.
There’s also another plotline involving Claire. I hate to give Parker any credit for her nonsense lesson but in the case of kidnapped Joey, whose mother willingly gets into a stranger’s van and then, without protest, allows herself to be locked in a cage, maybe parental influence does define him. The guy driving the van is named Charlie. He’s an ex-military guy. He helped Joe send e-mails from jail to his followers. “I can easily slice through the prison library server, creating a separate server,” he tells Joe in one of those prison visit/therapy/job interview flashbacks. “It’s very similar to the covert systems we had in Baghdad, sir.” Weston is going to emoticon all over the place when he meets this dude.
Charlie’s creepy and repressed and barely moves his face, but he’s oddly a lot more fun to watch than the farmhouse gang. Claire keeps asking when she’s going to see Joey. “Soon,” Charlie tells her and then he calls up Roderick, one of the new followers from last week’s episode. Claire steals the keys out of his coat pocket and then tries to run away but gets caught right away. She then spends a little while drying her hair, since it got wet from some leaking pipes. Frizz control is very important in these situations. See, this is why I never mailed that comment card in there. There’s always more follicle-related comments to add.
Claire finds a folder full of photos of herself. She wants to know why he has those, but my question is, Why are people still printing out photos? Unless they’re going to be hanging them on a big board like Weston did, so she can live out her art-school fantasies. What’s the point of just keeping them in a folder? Those photos will be be a good conversation in for Weston, “Do you use Flickr? I love it.” It’ll be subtle but if you look really close at Charlie’s (whose platoon was embedded inside Instagram) dead, damaged eyes in that scene, you’ll see them ever so faintly roll.
I guess in Charlie’s case, he could’ve printed out the photos so he could stare at them while he lay in bed, after he brushed his teeth but before he did his nightly head bashing against wall. He tells Claire that he’s not Joe’s follower but hers. She doesn’t understand what that means. We don’t really yet either but it feels sort of like a cool development. I’m into it. Then he tries to kiss her. She pushes him away. Forehead, meet wall. Wall, meet forehead. Then somehow that (actually older) gray-haired FBI man busts in with several more agents than the ones involved in Joey’s rescue. Charlie throws a smoke grenade (I know it’s not called that) and slips out a door. An agent peers through, we’re talking immediately after, and is all, “Yeah, he’s gone.” Claire curses herself for choosing the leaky pipe, dead-end route over the magic portal. That is just so her. Always making poor choices. That’s how she ended up marrying a serial killer.
Back at the farmhouse, Emma leaves the room to make a call. Hardy notices. Megan, the tied-up girl, notices. Paul and Jacob do not. She comes back and says she’s going to get Joey ready to leave. While she’s up there, sirens appear outside. Jacob and Paul start getting nervous: “What’s taking her so long?!!” Hardy, who has cut through the ropes around his wrists, jumps up, stabs Paul, and sends Megan running safely out the door. That had to be the show’s way of throwing us a bone. There would’ve been a riot in my apartment if another person had died because of Hardy taking too long to save them. He goes after Emma and Joey.
Paul goes outside and lasers settle on his chest. The farmhouse is surrounded. Two SWAT team members appear, and it looks like there’s no way out for him and Jacob. Now there’s two more SWAT team guys. I knew the FBI wouldn’t just send a couple. Oh, but wait, those other two are followers. The fake SWAT team guys kill the real ones. Which means that Joe Carroll was able to orchestrate from prison, thanks to that Poe quote trigger that he made his lawyer say, a team of killers who were able to arrive at the farmhouse quicker than the FBI. “Who are these people?” Weston asks Agent Parker later. He’s impressed and scared. But is it that Joe’s cult is so well organized, connected, calm-headed, and efficient? The answer is no: There’s Charlie, but there’s also the bickering threesome and the unhinged Maggie who tried to kill Hardy with magnets. The reason they seem so good at what they do is because the authorities after them are just so sucky.
In the woods, Emma is pulling Joey along. She comes face-to-face with Weston and the female local cop. They have their guns trained on her. Here we go. Joey is getting rescued at last. But then the female cop turns and shoots Weston in the chest! She’s a follower. More, more, more of this! I want a new follower revealed in every scene. I want follower reveals within follower reveals, which is a thing that I just invented. Weston goes down (he still might be a follower himself, since he was wearing a bullet-proof vest). Emma and the new follower lady get into a SUV. Hardy emerges from the woods, points his gun, can’t get a good shot, let’s them drive off. He looks around for Megan, the tied-up girl, so he can give her a “Well, whatcha going to do?” shoulder shrug, but she’s already relocated to another city, like Los Angeles, where the cops don’t bumble things up as bad.
Another flashback for Parker. She’s with her parents, inside some sort of gathering place. Her mom’s eyes linger on her hair. “Why make it so straight?” she thinks, “Is this how the evil city people wear it?” “No, no, no, Mother Agent Parker,” I want to tell her, to soothe her, to put my hand on her hand while cooing, “city people are really good at hair.” Parker’s parents ask if she’s come to ask back into whatever it is that they belong to. They were almost kicked out because of her, does she want their forgiveness? She’s taken aback. No way, she says, she just wanted to tell them that she loved and missed them and that it’s her who is the one who has chosen to forgive. Flashback within a flashback! Fourteen-year-old Parker is running away from that creep and into her mother’s arms. She’s crying and shaking and saying she doesn’t want to do it but her mother forces her back into the guy’s room, where he leads her to the bed her while she tries to fight him off. Flashback within a flashback with a flash forward to the first flashback! Parker gets up from where she’s sitting with her parents and, as she’s opening the door to outside, you see a sign with the same snakey symbol that was on her necklace. Under are the words: Love. Give. Purity. Agent Parker was raised in a cult!
In the present, she opens up her purse and takes out a velvet pouch and inside is the necklace. Maybe she put it in there because she’s annoyed that everyone keeps talking about Joe’s cult when she has her own cult stories to tell. Maybe she’s going to show him the necklace when she goes to turn in her Poe homework to him next week. Maybe this proves she’s one of his followers, because like Emma, she believes that it’s her choice to follow Joe, that she’s doing it because she wants to, not because someone’s making her. Or maybe that’s just a really old purse that she never uses and the necklace has been in there for twenty years. If that purse is old, though, why isn’t it more graying on its sides?
Joe meets with his lawyer. She tells him that his people and Joey are safe (Let me ask you, is there anyway Claire can still be into Hardy after he’s failed to rescue her son again?) and that the FBI has no idea where he is. Hasn’t this lady ever heard of the term “white lie?” Does she have to be so honest with him about everything? Then he tells her it’s time for the next part of the story (are we really going to keep the part that this is all part of Joe’s master literary work going too? I hoped the show might have forgotten about that.) We see the agents watching a press announcement by the lawyer. She filed a motion alleging abuse by the FBI toward Joe. Which mean, soon someone will unscramble an e-mail with a phony witness testimony or zoom in on an affidavit and he’ll be free.
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()}});
}, {"1":1,"6":6,"12":12,"35":35,"40":40}];
window.modules["global-nav.client"] = [function(require,module,exports){"use strict";const dom=require(4),auth=require(12),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(1),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 o=t.querySelector(".dropdown");!n||t.contains(e.target)&&27!==e.keyCode||o.classList.remove("open")})}function gtmSendReport(e,n,t){let o={eventCategory:"ecommerce",eventAction:"componentClick",brand:e,dimension23:"global-nav",list:pageUri,pageZone:"header",variant:"nav-link"};"global-nav-link"===t&&(o.eventLabel=n.href),gtm.reportNow(o)}function updateElementTargetUrlsIfQueryStrings(e){if(searchString){const n=new URLSearchParams(searchString);let t=e.href;if(t.includes("?")){const o=t.split("?"),i=new URLSearchParams(o[1]);for(let e of n.entries())i.set(e[0],e[1]);t=`${o[0]}?${i.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()&&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;
}, {"1":1,"4":4,"12":12,"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();
// ]]