@times-components/ssr 2.64.15-82bc6796129e892c1eb22c6257c5e3809c159767.3 → 2.64.15-ba869e18affc80b8c7e732420edcc908c92ef44e.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|
|
5
5
|
@license MIT
|
|
6
|
-
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=o(e),s=1;s<arguments.length;s++){for(var c in n=Object(arguments[s]))i.call(n,c)&&(u[c]=n[c]);if(r){l=r(n);for(var d=0;d<l.length;d++)a.call(n,l[d])&&(u[l[d]]=n[l[d]])}}return u}},185:function(e,t,n){"use strict";n.r(t),n.d(t,"ApolloConsumer",(function(){return m})),n.d(t,"ApolloContext",(function(){return f})),n.d(t,"ApolloProvider",(function(){return v})),n.d(t,"Mutation",(function(){return T})),n.d(t,"Query",(function(){return w})),n.d(t,"RenderPromises",(function(){return M})),n.d(t,"Subscription",(function(){return C})),n.d(t,"compose",(function(){return q})),n.d(t,"getDataFromTree",(function(){return L})),n.d(t,"getMarkupFromTree",(function(){return B})),n.d(t,"graphql",(function(){return D})),n.d(t,"renderToStringWithData",(function(){return V})),n.d(t,"withApollo",(function(){return R})),n.d(t,"withMutation",(function(){return _})),n.d(t,"withQuery",(function(){return A})),n.d(t,"withSubscription",(function(){return I}));var r=n(1),i=n(0),a=n(12),o=n(2),l=n(112),u=n(240),s=n.n(u),c=n(80),d=n.n(c),f=r.createContext?Object(r.createContext)(void 0):null,m=function(e,t){function n(t){if(!t||!t.client)throw new a.a;return e.children(t.client)}return f?Object(r.createElement)(f.Consumer,null,n):n(t)};m.contextTypes={client:i.object.isRequired},m.propTypes={children:i.func.isRequired};var p,v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.operations=new Map,Object(a.b)(t.client),t.client.__operations_cache__||(t.client.__operations_cache__=r.operations),r}return Object(o.c)(t,e),t.prototype.getChildContext=function(){return{client:this.props.client,operations:this.props.client.__operations_cache__}},t.prototype.render=function(){return f?Object(r.createElement)(f.Provider,{value:this.getChildContext()},this.props.children):this.props.children},t.propTypes={client:i.object.isRequired,children:i.node.isRequired},t.childContextTypes={client:i.object.isRequired,operations:i.object},t}(r.Component);!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(p||(p={}));var h=new Map;function y(e){var t,n,r=h.get(e);if(r)return r;Object(a.b)(!!e&&!!e.kind);var i=e.definitions.filter((function(e){return"FragmentDefinition"===e.kind})),o=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"query"===e.operation})),l=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})),u=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"subscription"===e.operation}));Object(a.b)(!i.length||o.length||l.length||u.length),Object(a.b)(o.length+l.length+u.length<=1),n=o.length?p.Query:p.Mutation,o.length||l.length||(n=p.Subscription);var s=o.length?o:l.length?l:u;Object(a.b)(1===s.length);var c=s[0];t=c.variableDefinitions||[];var d={name:c.name&&"Name"===c.name.kind?c.name.value:"data",type:n,variables:t};return h.set(e,d),d}function g(e,t){var n=e.client||t.client;return Object(a.b)(!!n),n}var k=Object.prototype.hasOwnProperty;function b(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function S(e){return null!==e&&"object"==typeof e}function O(e,t){if(b(e,t))return!0;if(!S(e)||!S(t))return!1;var n=Object.keys(e);return n.length===Object.keys(t).length&&n.every((function(n){return k.call(t,n)&&b(e[n],t[n])}))}var w=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.previousData={},r.hasMounted=!1,r.lastResult=null,r.startQuerySubscription=function(e){if(void 0===e&&(e=!1),e||(r.lastResult=r.queryObservable.getLastResult()),!r.querySubscription){var t=r.getQueryResult();r.querySubscription=r.queryObservable.subscribe({next:function(e){var n=e.loading,i=e.networkStatus,a=e.data;t&&7===t.networkStatus&&O(t.data,a)?t=void 0:r.lastResult&&r.lastResult.loading===n&&r.lastResult.networkStatus===i&&O(r.lastResult.data,a)||(t=void 0,r.lastResult&&(r.lastResult=r.queryObservable.getLastResult()),r.updateCurrentData())},error:function(e){if(r.lastResult||r.resubscribeToQuery(),!e.hasOwnProperty("graphQLErrors"))throw e;r.updateCurrentData()}})}},r.removeQuerySubscription=function(){r.querySubscription&&(r.lastResult=r.queryObservable.getLastResult(),r.querySubscription.unsubscribe(),delete r.querySubscription)},r.updateCurrentData=function(){r.handleErrorOrCompleted(),r.hasMounted&&r.forceUpdate()},r.handleErrorOrCompleted=function(){var e=r.queryObservable.currentResult(),t=e.data,n=e.loading,i=e.error,a=r.props,o=a.onCompleted,l=a.onError;!o||n||i?l&&!n&&i&&l(i):o(t)},r.getQueryResult=function(){var e,t={data:Object.create(null)};if(Object.assign(t,{variables:(e=r.queryObservable).variables,refetch:e.refetch.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}),r.props.skip)t=Object(o.a)({},t,{data:void 0,error:void 0,loading:!1});else{var n=r.queryObservable.currentResult(),i=n.loading,a=n.partial,u=n.networkStatus,s=n.errors,c=n.error;s&&s.length>0&&(c=new l.ApolloError({graphQLErrors:s}));var d=r.queryObservable.options.fetchPolicy;if(Object.assign(t,{loading:i,networkStatus:u,error:c}),i)Object.assign(t.data,r.previousData,n.data);else if(c)Object.assign(t,{data:(r.queryObservable.getLastResult()||{}).data});else if("no-cache"===d&&0===Object.keys(n.data).length)t.data=r.previousData;else{if(r.props.partialRefetch&&0===Object.keys(n.data).length&&a&&"cache-only"!==d)return Object.assign(t,{loading:!0,networkStatus:l.NetworkStatus.loading}),t.refetch(),t;Object.assign(t.data,n.data),r.previousData=n.data}}if(!r.querySubscription){var f=t.refetch;t.refetch=function(e){return r.querySubscription?f(e):new Promise((function(t,n){r.refetcherQueue={resolve:t,reject:n,args:e}}))}}return t.client=r.client,t},r.client=g(t,n),r.initializeQueryObservable(t),r}return Object(o.c)(t,e),t.prototype.fetchData=function(){if(this.props.skip)return!1;var e=this.props,t=(e.children,e.ssr),n=(e.displayName,e.skip,e.client,e.onCompleted,e.onError,e.partialRefetch,Object(o.e)(e,["children","ssr","displayName","skip","client","onCompleted","onError","partialRefetch"])),r=n.fetchPolicy;if(!1===t)return!1;"network-only"!==r&&"cache-and-network"!==r||(r="cache-first");var i=this.client.watchQuery(Object(o.a)({},n,{fetchPolicy:r}));return this.context&&this.context.renderPromises&&this.context.renderPromises.registerSSRObservable(this,i),!!this.queryObservable.currentResult().loading&&i.result()},t.prototype.componentDidMount=function(){if(this.hasMounted=!0,!this.props.skip&&(this.startQuerySubscription(!0),this.refetcherQueue)){var e=this.refetcherQueue,t=e.args,n=e.resolve,r=e.reject;this.queryObservable.refetch(t).then(n).catch(r)}},t.prototype.componentWillReceiveProps=function(e,t){if(!e.skip||this.props.skip){var n=g(e,t);O(this.props,e)&&this.client===n||(this.client!==n&&(this.client=n,this.removeQuerySubscription(),this.queryObservable=null,this.previousData={},this.updateQuery(e)),this.props.query!==e.query&&this.removeQuerySubscription(),this.updateQuery(e),e.skip||this.startQuerySubscription())}else this.removeQuerySubscription()},t.prototype.componentWillUnmount=function(){this.removeQuerySubscription(),this.hasMounted=!1},t.prototype.componentDidUpdate=function(e){(!s()(e.query,this.props.query)||!s()(e.variables,this.props.variables))&&this.handleErrorOrCompleted()},t.prototype.render=function(){var e=this,t=this.context,n=function(){return e.props.children(e.getQueryResult())};return t&&t.renderPromises?t.renderPromises.addQueryPromise(this,n):n()},t.prototype.extractOptsFromProps=function(e){this.operation=y(e.query),Object(a.b)(this.operation.type===p.Query);var t=e.displayName||"Query";return Object(o.a)({},e,{displayName:t,context:e.context||{},metadata:{reactComponent:{displayName:t}}})},t.prototype.initializeQueryObservable=function(e){var t=this.extractOptsFromProps(e);this.setOperations(t),this.context&&this.context.renderPromises&&(this.queryObservable=this.context.renderPromises.getSSRObservable(this)),this.queryObservable||(this.queryObservable=this.client.watchQuery(t))},t.prototype.setOperations=function(e){this.context.operations&&this.context.operations.set(this.operation.name,{query:e.query,variables:e.variables})},t.prototype.updateQuery=function(e){this.queryObservable?this.setOperations(e):this.initializeQueryObservable(e),this.queryObservable.setOptions(this.extractOptsFromProps(e)).catch((function(){return null}))},t.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var e=this.queryObservable.getLastError(),t=this.queryObservable.getLastResult();this.queryObservable.resetLastResults(),this.startQuerySubscription(),Object.assign(this.queryObservable,{lastError:e,lastResult:t})},t.contextTypes={client:i.object,operations:i.object,renderPromises:i.object},t.propTypes={client:i.object,children:i.func.isRequired,fetchPolicy:i.string,notifyOnNetworkStatusChange:i.bool,onCompleted:i.func,onError:i.func,pollInterval:i.number,query:i.object.isRequired,variables:i.object,ssr:i.bool,partialRefetch:i.bool},t}(r.Component),N={loading:!1,called:!1,error:void 0,data:void 0},T=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.hasMounted=!1,r.runMutation=function(e){void 0===e&&(e={}),r.onMutationStart();var t=r.generateNewMutationId();return r.mutate(e).then((function(e){return r.onMutationCompleted(e,t),e})).catch((function(e){if(r.onMutationError(e,t),!r.props.onError)throw e}))},r.mutate=function(e){var t=r.props,n=t.mutation,i=t.variables,a=t.optimisticResponse,l=t.update,u=t.context,s=void 0===u?{}:u,c=t.awaitRefetchQueries,d=void 0!==c&&c,f=t.fetchPolicy,m=Object(o.a)({},e),p=m.refetchQueries||r.props.refetchQueries;p&&p.length&&Array.isArray(p)&&(p=p.map((function(e){return"string"==typeof e&&r.context.operations&&r.context.operations.get(e)||e})),delete m.refetchQueries);var v=Object.assign({},i,m.variables);return delete m.variables,r.client.mutate(Object(o.a)({mutation:n,optimisticResponse:a,refetchQueries:p,awaitRefetchQueries:d,update:l,context:s,fetchPolicy:f,variables:v},m))},r.onMutationStart=function(){r.state.loading||r.props.ignoreResults||r.setState({loading:!0,error:void 0,data:void 0,called:!0})},r.onMutationCompleted=function(e,t){var n=r.props,i=n.onCompleted,a=n.ignoreResults,o=e.data,u=e.errors,s=u&&u.length>0?new l.ApolloError({graphQLErrors:u}):void 0,c=function(){return i?i(o):null};r.hasMounted&&r.isMostRecentMutation(t)&&!a?r.setState({loading:!1,data:o,error:s},c):c()},r.onMutationError=function(e,t){var n=r.props.onError,i=function(){return n?n(e):null};r.hasMounted&&r.isMostRecentMutation(t)?r.setState({loading:!1,error:e},i):i()},r.generateNewMutationId=function(){return r.mostRecentMutationId=r.mostRecentMutationId+1,r.mostRecentMutationId},r.isMostRecentMutation=function(e){return r.mostRecentMutationId===e},r.verifyDocumentIsMutation=function(e){var t=y(e);Object(a.b)(t.type===p.Mutation)},r.client=g(t,n),r.verifyDocumentIsMutation(t.mutation),r.mostRecentMutationId=0,r.state=N,r}return Object(o.c)(t,e),t.prototype.componentDidMount=function(){this.hasMounted=!0},t.prototype.componentWillUnmount=function(){this.hasMounted=!1},t.prototype.componentWillReceiveProps=function(e,t){var n=g(e,t);O(this.props,e)&&this.client===n||(this.props.mutation!==e.mutation&&this.verifyDocumentIsMutation(e.mutation),this.client!==n&&(this.client=n,this.setState(N)))},t.prototype.render=function(){var e=this.props.children,t=this.state,n=t.loading,r=t.data,i=t.error,a={called:t.called,loading:n,data:r,error:i,client:this.client};return e(this.runMutation,a)},t.contextTypes={client:i.object,operations:i.object},t.propTypes={mutation:i.object.isRequired,variables:i.object,optimisticResponse:i.object,refetchQueries:Object(i.oneOfType)([Object(i.arrayOf)(Object(i.oneOfType)([i.string,i.object])),i.func]),awaitRefetchQueries:i.bool,update:i.func,children:i.func.isRequired,onCompleted:i.func,onError:i.func,fetchPolicy:i.string},t}(r.Component),C=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.initialize=function(e){r.queryObservable||(r.queryObservable=r.client.subscribe({query:e.subscription,variables:e.variables,fetchPolicy:e.fetchPolicy}))},r.startSubscription=function(){r.querySubscription||(r.querySubscription=r.queryObservable.subscribe({next:r.updateCurrentData,error:r.updateError,complete:r.completeSubscription}))},r.getInitialState=function(){return{loading:!0,error:void 0,data:void 0}},r.updateCurrentData=function(e){var t=r,n=t.client,i=t.props.onSubscriptionData;i&&i({client:n,subscriptionData:e}),r.setState({data:e.data,loading:!1,error:void 0})},r.updateError=function(e){r.setState({error:e,loading:!1})},r.completeSubscription=function(){var e=r.props.onSubscriptionComplete;e&&e(),r.endSubscription()},r.endSubscription=function(){r.querySubscription&&(r.querySubscription.unsubscribe(),delete r.querySubscription)},r.client=g(t,n),r.initialize(t),r.state=r.getInitialState(),r}return Object(o.c)(t,e),t.prototype.componentDidMount=function(){this.startSubscription()},t.prototype.componentWillReceiveProps=function(e,t){var n=g(e,t);if(!O(this.props.variables,e.variables)||this.client!==n||this.props.subscription!==e.subscription){var r=e.shouldResubscribe;"function"==typeof r&&(r=!!r(this.props,e));var i=!1===r;if(this.client!==n&&(this.client=n),!i)return this.endSubscription(),delete this.queryObservable,this.initialize(e),this.startSubscription(),void this.setState(this.getInitialState());this.initialize(e),this.startSubscription()}},t.prototype.componentWillUnmount=function(){this.endSubscription()},t.prototype.render=function(){var e=this.props.children;return e?e(Object.assign({},this.state,{variables:this.props.variables})):null},t.contextTypes={client:i.object},t.propTypes={subscription:i.object.isRequired,variables:i.object,children:i.func,onSubscriptionData:i.func,onSubscriptionComplete:i.func,shouldResubscribe:Object(i.oneOfType)([i.func,i.bool])},t}(r.Component),j=function(){return{}},x=function(){return!1};function F(e){return e.displayName||e.name||"Component"}function E(e,t){for(var n={},r=0,i=e.variables;r<i.length;r++){var a=i[r],o=a.variable,l=a.type;if(o.name&&o.name.value){var u=o.name.value,s=t[u];void 0===s?"NonNullType"!==l.kind&&(n[u]=null):n[u]=s}}return n}var P=function(e){function t(t){var n=e.call(this,t)||this;return n.withRef=!1,n.setWrappedInstance=n.setWrappedInstance.bind(n),n}return Object(o.c)(t,e),t.prototype.getWrappedInstance=function(){return Object(a.b)(this.withRef),this.wrappedInstance},t.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},t}(r.Component);function A(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.skip,u=void 0===l?x:l,s=t.alias,c=void 0===s?"Apollo":s,f=a;"function"!=typeof f&&(f=function(){return a});var m,p=u;return"function"!=typeof p&&(p=function(){return u}),function(i){var a=c+"("+F(i)+")",l=function(l){function u(){return null!==l&&l.apply(this,arguments)||this}return Object(o.c)(u,l),u.prototype.render=function(){var l=this,u=this.props,s=p(u),c=s?Object.create(null):Object(o.a)({},f(u));return!s&&!c.variables&&n.variables.length>0&&(c.variables=E(n,u)),Object(r.createElement)(w,Object(o.a)({},c,{displayName:a,skip:s,query:e,warnUnhandledError:!0}),(function(e){e.client;var n,a,c=e.data,d=Object(o.e)(e,["client","data"]);if(t.withRef&&(l.withRef=!0,u=Object.assign({},u,{ref:l.setWrappedInstance})),s)return Object(r.createElement)(i,Object(o.a)({},u,{}));var f=Object.assign(d,c||{}),p=t.name||"data",v=((n={})[p]=f,n);if(t.props){var h=((a={})[p]=f,a.ownProps=u,a);v=m=t.props(h,m)}return Object(r.createElement)(i,Object(o.a)({},u,v))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function _(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.alias,u=void 0===l?"Apollo":l,s=a;return"function"!=typeof s&&(s=function(){return a}),function(i){var a=u+"("+F(i)+")",l=function(l){function u(){return null!==l&&l.apply(this,arguments)||this}return Object(o.c)(u,l),u.prototype.render=function(){var a=this.props,l=s(a);return t.withRef&&(this.withRef=!0,a=Object.assign({},a,{ref:this.setWrappedInstance})),!l.variables&&n.variables.length>0&&(l.variables=E(n,a)),Object(r.createElement)(T,Object(o.a)({},l,{mutation:e,ignoreResults:!0}),(function(e,n){var l,u,s=t.name||"mutate",c=((l={})[s]=e,l);if(t.props){var d=((u={})[s]=e,u.ownProps=a,u);c=t.props(d)}return Object(r.createElement)(i,Object(o.a)({},a,c))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function I(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.skip,u=void 0===l?x:l,s=t.alias,c=void 0===s?"Apollo":s,f=t.shouldResubscribe,m=a;"function"!=typeof m&&(m=function(){return a});var p,v=u;return"function"!=typeof v&&(v=function(){return u}),function(i){var a=c+"("+F(i)+")",l=function(l){function u(e){var t=l.call(this,e)||this;return t.state={resubscribe:!1},t}return Object(o.c)(u,l),u.prototype.componentWillReceiveProps=function(e){f&&this.setState({resubscribe:f(this.props,e)})},u.prototype.render=function(){var l=this,u=this.props,s=v(u),c=s?Object.create(null):m(u);return!s&&!c.variables&&n.variables.length>0&&(c.variables=E(n,u)),Object(r.createElement)(C,Object(o.a)({},c,{displayName:a,skip:s,subscription:e,shouldResubscribe:this.state.resubscribe}),(function(e){var n,a,c=e.data,d=Object(o.e)(e,["data"]);if(t.withRef&&(l.withRef=!0,u=Object.assign({},u,{ref:l.setWrappedInstance})),s)return Object(r.createElement)(i,Object(o.a)({},u,{}));var f=Object.assign(d,c||{}),m=t.name||"data",v=((n={})[m]=f,n);if(t.props){var h=((a={})[m]=f,a.ownProps=u,a);v=p=t.props(h,p)}return Object(r.createElement)(i,Object(o.a)({},u,v))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function D(e,t){switch(void 0===t&&(t={}),y(e).type){case p.Mutation:return _(e,t);case p.Subscription:return I(e,t);case p.Query:default:return A(e,t)}}function R(e,t){void 0===t&&(t={});var n="withApollo("+function(e){return e.displayName||e.name||"Component"}(e)+")",i=function(i){function l(e){var t=i.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return Object(o.c)(l,i),l.prototype.getWrappedInstance=function(){return Object(a.b)(t.withRef),this.wrappedInstance},l.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},l.prototype.render=function(){var n=this;return Object(r.createElement)(m,null,(function(i){var a=Object.assign({},n.props,{client:i,ref:t.withRef?n.setWrappedInstance:void 0});return Object(r.createElement)(e,Object(o.a)({},a))}))},l.displayName=n,l.WrappedComponent=e,l}(r.Component);return d()(i,e,{})}var M=function(){function e(){this.queryPromises=new Map,this.queryInfoTrie=new Map}return e.prototype.registerSSRObservable=function(e,t){this.lookupQueryInfo(e).observable=t},e.prototype.getSSRObservable=function(e){return this.lookupQueryInfo(e).observable},e.prototype.addQueryPromise=function(e,t){return this.lookupQueryInfo(e).seen?t():(this.queryPromises.set(e,new Promise((function(t){t(e.fetchData())}))),null)},e.prototype.hasPromises=function(){return this.queryPromises.size>0},e.prototype.consumeAndAwaitPromises=function(){var e=this,t=[];return this.queryPromises.forEach((function(n,r){e.lookupQueryInfo(r).seen=!0,t.push(n)})),this.queryPromises.clear(),Promise.all(t)},e.prototype.lookupQueryInfo=function(e){var t=this.queryInfoTrie,n=e.props,r=n.query,i=n.variables,a=t.get(r)||new Map;t.has(r)||t.set(r,a);var o=JSON.stringify(i),l=a.get(o)||{seen:!1,observable:null};return a.has(o)||a.set(o,l),l},e}();function L(e,t){return void 0===t&&(t={}),B({tree:e,context:t,renderFunction:n(186).renderToStaticMarkup})}function B(e){var t=e.tree,a=e.context,l=void 0===a?{}:a,u=e.renderFunction,s=void 0===u?n(186).renderToStaticMarkup:u,c=new M,d=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Object(o.c)(n,e),n.prototype.getChildContext=function(){return Object(o.a)({},l,{renderPromises:c})},n.prototype.render=function(){return t},n.childContextTypes={renderPromises:i.object},n}(r.Component);return Object.keys(l).forEach((function(e){d.childContextTypes[e]=i.any})),Promise.resolve().then((function e(){var t=s(Object(r.createElement)(d));return c.hasPromises()?c.consumeAndAwaitPromises().then(e):t}))}function V(e){return B({tree:e,renderFunction:n(186).renderToString})}function q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.reverse();return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n[0],i=n.slice(1),a=r.apply(null,e);return i.forEach((function(e){a=e.call(null,a)})),a}}},186:function(e,t,n){"use strict";e.exports=n(375)},187:function(e,t,n){"use strict";var r=n(188),i=n(379);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function l(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=l(e[n].toString(16));return t},t.htonl=o,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=o(i)),n+=u(i.toString(16))}return n},t.zero2=l,t.zero8=u,t.join32=function(e,t,n,i){var a=n-t;r(a%4==0);for(var o=new Array(a/4),l=0,u=t;l<o.length;l++,u+=4){var s;s="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],o[l]=s>>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var a=e[r];"big"===t?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a<r?1:0)+n+i;e[t]=o>>>0,e[t+1]=a},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,a,o,l){var u=0,s=t;return u+=(s=s+r>>>0)<t?1:0,u+=(s=s+a>>>0)<a?1:0,e+n+i+o+(u+=(s=s+l>>>0)<l?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,i,a,o,l){return t+r+a+l>>>0},t.sum64_5_hi=function(e,t,n,r,i,a,o,l,u,s){var c=0,d=t;return c+=(d=d+r>>>0)<t?1:0,c+=(d=d+a>>>0)<a?1:0,c+=(d=d+l>>>0)<l?1:0,e+n+i+o+u+(c+=(d=d+s>>>0)<s?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,i,a,o,l,u,s){return t+r+a+l+s>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},188:function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},193:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=n(0)},function(e,t){e.exports=n(1)},function(e,t){e.exports=n(8)},function(e,t){e.exports=n(9)},function(e,t){e.exports=n(420)},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),l=n(4),u=n(3);const s=[970,250],c=[728,90],d=[300,50],f=[970,90],m={header:[{height:0,sizes:[],width:0},{height:100,sizes:[[320,50],[320,48],d],width:300},{height:90,sizes:[c],width:768},{height:250,sizes:[s,f,c],width:1024}],intervention:[{height:0,sizes:[],width:0},{height:100,sizes:[[300,250],[320,50],[320,48],d],width:300},{height:90,sizes:[c],width:768},{height:250,sizes:[s,f,c],width:1024}],mpu:[{height:0,sizes:[],width:0},{height:250,sizes:[[300,250],[300,600]],width:300}],native:[{height:250,sizes:[[300,250]],width:300},{height:90,sizes:[c],width:728},{height:250,sizes:[s],width:970}],pixel:[{height:0,sizes:[[1,1]],width:0}]},p={"ad-header":1,"ad-mpu":3,"ad-pixel":2,"ad-pixelskin":2,"ad-pixelteads":2,"article-sponsored-ad":2,default:0,header:1,mpu:3,pixel:2,pixelskin:2,pixelteads:2},v={"ad-header":m.header,"ad-mpu":m.mpu,"ad-pixel":m.pixel,"ad-pixelskin":m.pixelskin,"ad-pixelteads":m.pixelteads,"article-sponsored-ad":m.pixel,default:m.intervention,header:m.header,mpu:m.mpu,"native-inline-ad":m.native,pixel:m.pixel,pixelskin:m.pixel,pixelteads:m.pixel},h=(e,t)=>{const n=v[e]||v.default,r=((e,t)=>{for(let n=e.length-1;n>=0;n-=1)if(t>=e[n].width)return e[n].sizes;return[]})(n,t);return{mappings:n,maxSizes:(e=>e?e.reduce((e,t)=>{let n=o(t,2),r=n[0],i=n[1];return{height:Math.max(e.height,i),width:Math.max(e.width,r)}},{height:0,width:0}):{height:0,width:0})(r),sizes:r,slotName:e}},y={bidderSettings:e=>{let t=e.maxBid,n=e.minPrice,r=e.bucketSize;return{adserverTargeting:[{key:"hb_bidder",val:e=>e.bidder},{key:"hb_adid",val:e=>e.adId},{key:"hb_pb",val:e=>e.cpm>t?t.toFixed(2):e.cpm<r?n.toFixed(2):(e.cpm-e.cpm%r).toFixed(2)},{key:"hb_size",val:e=>e.size}]}},init:{bidderSequence:"random",bidTimeout:3e3,cache:{url:"https://prebid.adnxs.com/pbc/v1/cache"},consentManagement:{allowAuctionWithoutConsent:!0,cmpApi:"iab",timeout:3e3},disableAjaxTimeout:!1,enableSendAllBids:!0,maxRequestsPerOrigin:4,priceGranularity:"medium",timeoutBuffer:400,userSync:{enableOverride:!1,syncDelay:3e3,syncEnabled:!0,syncsPerBidder:5}}};var g=e=>{let t=e.el,n=e.data,r=e.platform,i=e.eventCallback,a=e.window;a.googletag=a.googletag||{},a.googletag.cmd=a.googletag.cmd||[],a.pbjs=a.pbjs||{},a.pbjs.que=a.pbjs.que||[],a.apstag=a.apstag||{_Q:[],addToQueue(e,t){this._Q.push([e,t])},fetchBids(){this.addToQueue("f",arguments)},init(){this.addToQueue("i",arguments)},setDisplayBids(){},targetingKeys:()=>[]};const o=a.apstag,l=a.document,u=a.encodeURIComponent,s=a.googletag,c=a.location,d=a.pbjs,f=a.Promise,m=a.Set,p=a.XMLHttpRequest;let v=!1;const h="web"===r,y=n.prebidConfig,g=y.timeout,k=y.bidders,b=k&&k.amazon&&k.amazon.accountId;return{init(){if(n.disableAds)return f.resolve("ads disabled");const e=[f.resolve()];return a.initCalled||((!n.bidInitialiser&&h||!h)&&this.loadScripts(),e.push(this.apstag.process(),this.prebid.process(),this.gpt.process())),a.initCalled=!0,v||e.push(this.gpt.bid()),v=!0,f.all(e).then(()=>{this.gpt.refreshAd(),i("renderComplete")}).catch(e=>{i("error",e.stack),i("renderFailed")})},loadScripts(){h&&(this.breakpoints(),this.utils.loadScript(this.prebid.url)),this.utils.loadScript(this.gpt.url),this.utils.loadScript(this.apstag.url),this.admantx.init()},breakpoints(){const e={huge:"(min-width: 1320px)",medium:"(min-width: 768px) and (max-width: 1023px)",small:"(max-width: 767px)",wide:"(min-width: 1024px) and (max-width: 1319px)"};a.matchMedia&&Object.keys(e).forEach(t=>{a.matchMedia(e[t]).addListener(this.handleBreakPointChange.bind(this,t))})},handleBreakPointChange(e,t){t.matches&&(this.gpt.setPageTargeting({breakpoint:e,refresh:"true"}),s.cmd.push(()=>s.pubads().refresh()))},admantx:{extractNames:e=>[...new m(e.map(e=>e.name.toLowerCase().trim().replace(/\s+/g,"_").replace(/["'=!+#*~;^()<>[\],&]/g,"")))].join(","),getUrl:()=>"https://euasync01.admantx.com/admantx/service?request="+u(JSON.stringify({key:"f1694ae18c17dc1475ee187e4996ad2b484217b1a436cb04b7ac3dd4902180b6",method:"descriptor",mode:"async",decorator:"json",filter:"default",type:"URL",body:c.href})),init(){const e=new p;e.open("GET",this.getUrl()),e.send(),e.onload=()=>{if(200!==e.status)i("Error: ".concat(e.status,": ").concat(e.statusText));else{const t=e.response;if(t.admants||t.categories||t.entities||t.feelings){const e={admantx_bs:this.extractNames(t.admants),admantx_cat:this.extractNames(t.categories),admantx_emotion:this.extractNames(t.feelings),admantx_ents:this.extractNames(t.entities)};s.cmd.push(()=>this.gpt.setPageTargeting(e))}}},e.onerror=()=>{i("Error in ADmantx request")}}},gpt:{url:"https://www.googletagservices.com/tag/js/gpt.js",setSlotTargeting(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,a=r.networkId,o=r.adUnit,l=r.section,u=r.slotTargeting;s.cmd.push(()=>{try{const n=e.slotName,r=e.sizes,c=e.mappings,d=s.defineSlot("/".concat(a,"/").concat(o,"/").concat(l),r,n);if(!d)return;d.addService(s.pubads()),t&&(t.id="wrapper-"+n,t.innerHTML='<div id="'.concat(n,'"></div>'),t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.margin="0 auto",t.style.height="100%");const f=s.sizeMapping();c.forEach(e=>f.addSize([e.width,e.height],e.sizes)),d.defineSizeMapping(f.build()),Object.keys(u||[]).forEach(e=>d.setTargeting(e,u[e]));const m=Math.floor(10*Math.random()).toString();d.setTargeting("timestestgroup",m),d.setTargeting("pos",n),s.display(n),i("warn","[Google] INFO: set slot targeting - "+n)}catch(e){i("error",e.stack)}})},setPageTargeting(e){return s.cmd.push(()=>{try{const t=s.pubads();Object.keys(e).forEach(n=>{t.setTargeting(n,e[n])}),i("warn","[Google] INFO: set page target"),i("log",e)}catch(e){i("error",e.stack)}}),this.waitUntilReady()},init(){s.cmd.push(()=>{const e=s.pubads();e.disableInitialLoad(),e.enableSingleRequest(),e.collapseEmptyDivs(!0,!0),s.enableServices(),i("warn","[Google] INFO: initialised")})},bid(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n).config;return this.setSlotTargeting(e),this.waitUntilReady()},refreshAd(){s.cmd.push(()=>{h&&d.setTargetingForGPTAsync(),o.setDisplayBids(),s.pubads().refresh(),i("warn","[Google] INFO: pubads refresh")})},process(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n).pageTargeting;return this.init(),this.setPageTargeting(e),this.waitUntilReady()},waitUntilReady:()=>new f(e=>s.cmd.push(()=>{e()}))},prebid:{url:"https://www.thetimes.co.uk/d/js/vendor/prebid.min-4c674b73bd.js",bid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.slots;return new f((e,n)=>{d.que.push(()=>{try{if(t.length>0)i("warn","[Prebid] INFO: requesting bids"),i("log",t),t.forEach(e=>d.removeAdUnit(e.code)),d.addAdUnits(t),d.requestBids({bidsBackHandler(t){i("warn","[Prebid] INFO: bid response"),i("log",t),e(t)}});else{const t="[Prebid] INFO: no slots are defined";i("warn",t),e(t)}}catch(e){n(e)}})})},process(){if(h)return this.init(),this.bid();const e="[Prebid] INFO: no prebid on native";return i("warn",e),f.resolve(e)},init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.prebidConfig,r=e.debug,o=void 0!==r&&r;const l=t.init,u=t.bidderSettings;a.pbjs.bidderTimeout=g,a.pbjs.bidderSettings=u&&u(t),d.que.push(()=>{l.debug=o,d.setConfig(l),i("warn","[Prebid] INFO: initialised"),i("log",l)})}},apstag:{url:"https://c.amazon-adsystem.com/aax2/apstag.js",getConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.slots,r=e.networkId,i=e.adUnit,a=e.section;const o=[r,i];a&&o.push(a);const l=o.reduce((e,t,n)=>1===n?"/".concat(e,"/").concat(t):"".concat(e,"/").concat(t));return t.map(e=>({sizes:e.sizes,slotID:e.code,slotName:l}))},bid(){return new f(e=>{try{const t=this.getConfig();if(t.length>0)i("warn","[Amazon] INFO: requesting bids"),i("log",t),o.fetchBids({slots:t},t=>{i("warn","[Amazon] INFO: bids response"),i("log",t),e(t)});else{const t="[Amazon] INFO: no slots are defined";i("warn",t),e(t)}}catch(t){i("error",t.stack),e(t)}})},process(){if(b)return this.init();const e="[Amazon] INFO: amazonAccountID undefined";return i("warn",e),f.resolve(e)},init(){const e={adServer:"googletag",bidTimeout:g,gdpr:{cmpTimeout:g},pubID:b};i("log",e),o.init(e,()=>(i("warn","[Amazon] INFO: initialised"),this.bid()))}},utils:{scriptsInserted:{},createScriptElement(e,t,n){try{const r=l.createElement("script");r.type="text/javascript",r.defer=!0,t&&r.addEventListener("load",t),n&&r.addEventListener("error",n),r.src=e,l.head.appendChild(r)}catch(e){i("error",e.stack)}},loadScript(e){return this.scriptsInserted[e]?f.resolve('Inserting "'.concat(e,'" twice.')):(this.scriptsInserted[e]=!0,new f((t,n)=>{this.createScriptElement(e,()=>{t("loaded "+e)},()=>{n(new Error("load error for "+e))})}))}}}},k=n(0),b=n.n(k),S=n(2),O={alignItems:"center",flex:1},w=(i(i({backgroundColor:S.colours.functional.backgroundPrimary,borderColor:S.colours.functional.keyline,borderStyle:"solid",borderWidth:1,color:S.colours.functional.secondary},Object(S.fontFactory)({font:"body",fontSize:"puffLink"})),{},{letterSpacing:1.5,paddingBottom:Object(S.spacing)(1),paddingLeft:Object(S.spacing)(2),paddingRight:Object(S.spacing)(2),paddingTop:Object(S.spacing)(1),zIndex:1}),S.colours.functional.backgroundPrimary,S.colours.functional.keyline,e=>{let t=e.slotName,n=e.style;return a.a.createElement(u.TcView,{style:i(i({},O),n)},a.a.createElement("div",{id:""+{header:"ad-header","inline-ad":"ad-article-inline",articleListAd:"ad-article-inline",pixel:"ad-pixel",pixelteads:"ad-pixelteads",pixelskin:"ad-pixelskin",inlineAd1:"ad-article-inline-1",inlineAd2:"ad-article-inline-2",inlineAd3:"ad-article-inline-3",inlineAd4:"ad-article-inline-4",videoAd1:"ad-vid-article-1"}[t]}))});b.a.shape({}),b.a.number.isRequired,b.a.func.isRequired,b.a.func,b.a.func,b.a.number.isRequired,b.a.number;class N extends r.Component{constructor(){var e;return e=super(...arguments),this.eventQueue=[],this.eventCallback=(e,t)=>{this.eventQueue.push({detail:t,type:e}),this.processEventQueue()},this.processEvent=e=>{let t=e.type,n=e.detail;const r=this.props,i=r.onRenderComplete,a=r.onRenderError,o=r.data;if(0!==this.eventQueue.length)switch(t){case"renderFailed":a();break;case"renderComplete":i();break;default:o.debug&&((e,t)=>{switch(e){case"error":console.error(t);break;case"warn":console.warn(t);break;case"info":console.info(t);break;case"debug":console.debug(t);break;case"log":console.log(t);break;default:console.log(e),console.log(t)}})(t,n)}},e}componentDidMount(){const e=this.props,t=e.data,n=e.init;this.initExecuting=!0,this.hasUnmounted=!1,this.adInit=n({data:t,el:this.div,eventCallback:this.eventCallback,platform:"web",window:window}),this.adInit&&this.adInit.init&&this.adInit.init(),this.initExecuting=!1,this.processEventQueue()}componentWillUnmount(){this.eventQueue=[],this.hasUnmounted=!0}processEventQueue(){this.initExecuting||this.hasUnmounted||(this.eventQueue.forEach(this.processEvent),this.eventQueue=[])}render(){const e=this.props.width;return a.a.createElement("div",{ref:e=>{this.div=e},style:{height:"auto",overflow:"hidden",width:e}})}}N.defaultProps={data:{},height:0,onRenderComplete:()=>{},onRenderError:()=>{},height:0};var T=N;b.a.shape({adUnit:b.a.string.isRequired,biddersConfig:b.a.shape({}),bidderSlots:b.a.arrayOf(b.a.string),networkId:b.a.string.isRequired,pageTargeting:b.a.shape({}),slotTargeting:b.a.shape({})}),b.a.oneOfType([b.a.element,b.a.arrayOf(b.a.element)]).isRequired;const C={adConfig:{adUnit:"d.thetimes.co.uk",biddersConfig:{bidders:{amazon:{accountId:"3360"},appnexus:{placementId:"5823281"},ix:{siteId:"188830"},rubicon:{accountId:"14062",siteId:"70608",zoneId:"335918"}},bucketSize:.25,maxBid:15,minPrice:.01,timeout:3e3},bidderSlots:["header","inline-ad"],bidInitialiser:Promise.resolve(),globalSlots:["ad-pixel","ad-pixelskin","ad-pixelteads"],networkId:"25436805",pageTargeting:{label:"This is label",title:"This is title"},slotTargeting:{section:"news"}}},j=e=>{let t=e.adConfig,n=e.children;return a.a.createElement(l.Broadcast,{channel:"adConfig",value:t},n)};j.defaultProps=C;var x=j;b.a.object.style;function F(){return(F=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}b.a.string,b.a.string,b.a.bool,b.a.string,b.a.string.isRequired,n.d(t,"AdComposer",(function(){return x})),n.d(t,"AdContainer",(function(){return w}));class E extends r.Component{static getDerivedStateFromProps(e){const t=e.slotName;return{config:h(t,Object(u.screenWidth)())}}constructor(e){super(e),this.setAdReady=()=>{this.setState({isAdReady:!0})},this.setAdError=()=>{this.setState({hasError:!0})};const t=e.slotName;this.prebidConfig=y,this.state={config:h(t,Object(u.screenWidth)()),hasError:!1,isAdReady:!1,hasAdBlock:!1}}componentDidMount(){this.setState({hasAdBlock:window.hasAdBlock})}renderAd(e){const t=this.props,n=t.baseUrl,r=t.contextUrl,o=t.isLoading,l=t.section,s=t.slotName,c=t.style,d=this.state,f=d.config,m=d.hasError,v=d.isAdReady;if(d.hasAdBlock||m)return null;this.slots=e.bidderSlots.map(t=>((e,t,n,r)=>{const i=p[e]||p.default,a=h(e,n).sizes;let o=[];return r.ix&&r.ix.siteId&&(o=o.concat(a.map(e=>({bidder:"ix",params:{siteId:r.ix.siteId,size:e}})))),r.appnexus&&r.appnexus.placementId&&o.push({bidder:"appnexus",params:{keywords:{pos:i,section:t},placementId:r.appnexus.placementId,position:i}}),r.rubicon&&r.rubicon.accountId&&o.push({bidder:"rubicon",params:{accountId:r.rubicon.accountId,keywords:[t],position:1===i?"atf":"btf",siteId:r.rubicon.siteId,zoneId:r.rubicon.zoneId}}),{bids:o,code:e,mediaTypes:{banner:{sizes:a}},sizes:a}})(t,l,f.maxSizes.width,e.biddersConfig.bidders)),this.allSlotConfigs=e.globalSlots.concat(e.bidderSlots).map(e=>h(e,Object(u.screenWidth)()));const y={adUnit:e.adUnit,allSlotConfigs:this.allSlotConfigs||this.slots,bidInitialiser:e.bidInitialiser||!1,config:f,contextUrl:r,debug:e.debug||!1,disableAds:e.disabled||!1,networkId:e.networkId,pageTargeting:e.pageTargeting,prebidConfig:Object.assign(this.prebidConfig,{bidders:e.biddersConfig.bidders,bucketSize:e.biddersConfig.bucketSize,maxBid:e.biddersConfig.maxBid,minPrice:e.biddersConfig.minPrice,timeout:e.biddersConfig.timeout}),section:l,sizingMap:f.mappings,slotName:s,slots:this.slots,slotTargeting:e.slotTargeting},k=v?{height:f.maxSizes.height,width:f.maxSizes.width}:{height:0,width:0},b=a.a.createElement(u.TcView,{style:i(i({},O),c)},o?null:a.a.createElement(T,F({baseUrl:n,data:y,init:g,onRenderComplete:this.setAdReady,onRenderError:this.setAdError},k)));return a.a.createElement(u.ServerClientRender,{client:()=>b,server:null})}render(){const e=this.props.adConfig;return e?this.renderAd(e):a.a.createElement(l.Subscriber,{channel:"adConfig"},e=>this.renderAd(e))}}E.defaultProps={baseUrl:"https://www.thetimes.co.uk/",contextUrl:"",isLoading:!1,section:"",style:null},t.default=E}])},2:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return s}));
|
|
6
|
+
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,u=o(e),s=1;s<arguments.length;s++){for(var c in n=Object(arguments[s]))i.call(n,c)&&(u[c]=n[c]);if(r){l=r(n);for(var d=0;d<l.length;d++)a.call(n,l[d])&&(u[l[d]]=n[l[d]])}}return u}},185:function(e,t,n){"use strict";n.r(t),n.d(t,"ApolloConsumer",(function(){return m})),n.d(t,"ApolloContext",(function(){return f})),n.d(t,"ApolloProvider",(function(){return v})),n.d(t,"Mutation",(function(){return T})),n.d(t,"Query",(function(){return w})),n.d(t,"RenderPromises",(function(){return M})),n.d(t,"Subscription",(function(){return C})),n.d(t,"compose",(function(){return q})),n.d(t,"getDataFromTree",(function(){return L})),n.d(t,"getMarkupFromTree",(function(){return B})),n.d(t,"graphql",(function(){return D})),n.d(t,"renderToStringWithData",(function(){return V})),n.d(t,"withApollo",(function(){return R})),n.d(t,"withMutation",(function(){return _})),n.d(t,"withQuery",(function(){return A})),n.d(t,"withSubscription",(function(){return I}));var r=n(1),i=n(0),a=n(12),o=n(2),l=n(112),u=n(240),s=n.n(u),c=n(80),d=n.n(c),f=r.createContext?Object(r.createContext)(void 0):null,m=function(e,t){function n(t){if(!t||!t.client)throw new a.a;return e.children(t.client)}return f?Object(r.createElement)(f.Consumer,null,n):n(t)};m.contextTypes={client:i.object.isRequired},m.propTypes={children:i.func.isRequired};var p,v=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.operations=new Map,Object(a.b)(t.client),t.client.__operations_cache__||(t.client.__operations_cache__=r.operations),r}return Object(o.c)(t,e),t.prototype.getChildContext=function(){return{client:this.props.client,operations:this.props.client.__operations_cache__}},t.prototype.render=function(){return f?Object(r.createElement)(f.Provider,{value:this.getChildContext()},this.props.children):this.props.children},t.propTypes={client:i.object.isRequired,children:i.node.isRequired},t.childContextTypes={client:i.object.isRequired,operations:i.object},t}(r.Component);!function(e){e[e.Query=0]="Query",e[e.Mutation=1]="Mutation",e[e.Subscription=2]="Subscription"}(p||(p={}));var h=new Map;function y(e){var t,n,r=h.get(e);if(r)return r;Object(a.b)(!!e&&!!e.kind);var i=e.definitions.filter((function(e){return"FragmentDefinition"===e.kind})),o=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"query"===e.operation})),l=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})),u=e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&"subscription"===e.operation}));Object(a.b)(!i.length||o.length||l.length||u.length),Object(a.b)(o.length+l.length+u.length<=1),n=o.length?p.Query:p.Mutation,o.length||l.length||(n=p.Subscription);var s=o.length?o:l.length?l:u;Object(a.b)(1===s.length);var c=s[0];t=c.variableDefinitions||[];var d={name:c.name&&"Name"===c.name.kind?c.name.value:"data",type:n,variables:t};return h.set(e,d),d}function g(e,t){var n=e.client||t.client;return Object(a.b)(!!n),n}var k=Object.prototype.hasOwnProperty;function b(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function S(e){return null!==e&&"object"==typeof e}function O(e,t){if(b(e,t))return!0;if(!S(e)||!S(t))return!1;var n=Object.keys(e);return n.length===Object.keys(t).length&&n.every((function(n){return k.call(t,n)&&b(e[n],t[n])}))}var w=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.previousData={},r.hasMounted=!1,r.lastResult=null,r.startQuerySubscription=function(e){if(void 0===e&&(e=!1),e||(r.lastResult=r.queryObservable.getLastResult()),!r.querySubscription){var t=r.getQueryResult();r.querySubscription=r.queryObservable.subscribe({next:function(e){var n=e.loading,i=e.networkStatus,a=e.data;t&&7===t.networkStatus&&O(t.data,a)?t=void 0:r.lastResult&&r.lastResult.loading===n&&r.lastResult.networkStatus===i&&O(r.lastResult.data,a)||(t=void 0,r.lastResult&&(r.lastResult=r.queryObservable.getLastResult()),r.updateCurrentData())},error:function(e){if(r.lastResult||r.resubscribeToQuery(),!e.hasOwnProperty("graphQLErrors"))throw e;r.updateCurrentData()}})}},r.removeQuerySubscription=function(){r.querySubscription&&(r.lastResult=r.queryObservable.getLastResult(),r.querySubscription.unsubscribe(),delete r.querySubscription)},r.updateCurrentData=function(){r.handleErrorOrCompleted(),r.hasMounted&&r.forceUpdate()},r.handleErrorOrCompleted=function(){var e=r.queryObservable.currentResult(),t=e.data,n=e.loading,i=e.error,a=r.props,o=a.onCompleted,l=a.onError;!o||n||i?l&&!n&&i&&l(i):o(t)},r.getQueryResult=function(){var e,t={data:Object.create(null)};if(Object.assign(t,{variables:(e=r.queryObservable).variables,refetch:e.refetch.bind(e),fetchMore:e.fetchMore.bind(e),updateQuery:e.updateQuery.bind(e),startPolling:e.startPolling.bind(e),stopPolling:e.stopPolling.bind(e),subscribeToMore:e.subscribeToMore.bind(e)}),r.props.skip)t=Object(o.a)({},t,{data:void 0,error:void 0,loading:!1});else{var n=r.queryObservable.currentResult(),i=n.loading,a=n.partial,u=n.networkStatus,s=n.errors,c=n.error;s&&s.length>0&&(c=new l.ApolloError({graphQLErrors:s}));var d=r.queryObservable.options.fetchPolicy;if(Object.assign(t,{loading:i,networkStatus:u,error:c}),i)Object.assign(t.data,r.previousData,n.data);else if(c)Object.assign(t,{data:(r.queryObservable.getLastResult()||{}).data});else if("no-cache"===d&&0===Object.keys(n.data).length)t.data=r.previousData;else{if(r.props.partialRefetch&&0===Object.keys(n.data).length&&a&&"cache-only"!==d)return Object.assign(t,{loading:!0,networkStatus:l.NetworkStatus.loading}),t.refetch(),t;Object.assign(t.data,n.data),r.previousData=n.data}}if(!r.querySubscription){var f=t.refetch;t.refetch=function(e){return r.querySubscription?f(e):new Promise((function(t,n){r.refetcherQueue={resolve:t,reject:n,args:e}}))}}return t.client=r.client,t},r.client=g(t,n),r.initializeQueryObservable(t),r}return Object(o.c)(t,e),t.prototype.fetchData=function(){if(this.props.skip)return!1;var e=this.props,t=(e.children,e.ssr),n=(e.displayName,e.skip,e.client,e.onCompleted,e.onError,e.partialRefetch,Object(o.e)(e,["children","ssr","displayName","skip","client","onCompleted","onError","partialRefetch"])),r=n.fetchPolicy;if(!1===t)return!1;"network-only"!==r&&"cache-and-network"!==r||(r="cache-first");var i=this.client.watchQuery(Object(o.a)({},n,{fetchPolicy:r}));return this.context&&this.context.renderPromises&&this.context.renderPromises.registerSSRObservable(this,i),!!this.queryObservable.currentResult().loading&&i.result()},t.prototype.componentDidMount=function(){if(this.hasMounted=!0,!this.props.skip&&(this.startQuerySubscription(!0),this.refetcherQueue)){var e=this.refetcherQueue,t=e.args,n=e.resolve,r=e.reject;this.queryObservable.refetch(t).then(n).catch(r)}},t.prototype.componentWillReceiveProps=function(e,t){if(!e.skip||this.props.skip){var n=g(e,t);O(this.props,e)&&this.client===n||(this.client!==n&&(this.client=n,this.removeQuerySubscription(),this.queryObservable=null,this.previousData={},this.updateQuery(e)),this.props.query!==e.query&&this.removeQuerySubscription(),this.updateQuery(e),e.skip||this.startQuerySubscription())}else this.removeQuerySubscription()},t.prototype.componentWillUnmount=function(){this.removeQuerySubscription(),this.hasMounted=!1},t.prototype.componentDidUpdate=function(e){(!s()(e.query,this.props.query)||!s()(e.variables,this.props.variables))&&this.handleErrorOrCompleted()},t.prototype.render=function(){var e=this,t=this.context,n=function(){return e.props.children(e.getQueryResult())};return t&&t.renderPromises?t.renderPromises.addQueryPromise(this,n):n()},t.prototype.extractOptsFromProps=function(e){this.operation=y(e.query),Object(a.b)(this.operation.type===p.Query);var t=e.displayName||"Query";return Object(o.a)({},e,{displayName:t,context:e.context||{},metadata:{reactComponent:{displayName:t}}})},t.prototype.initializeQueryObservable=function(e){var t=this.extractOptsFromProps(e);this.setOperations(t),this.context&&this.context.renderPromises&&(this.queryObservable=this.context.renderPromises.getSSRObservable(this)),this.queryObservable||(this.queryObservable=this.client.watchQuery(t))},t.prototype.setOperations=function(e){this.context.operations&&this.context.operations.set(this.operation.name,{query:e.query,variables:e.variables})},t.prototype.updateQuery=function(e){this.queryObservable?this.setOperations(e):this.initializeQueryObservable(e),this.queryObservable.setOptions(this.extractOptsFromProps(e)).catch((function(){return null}))},t.prototype.resubscribeToQuery=function(){this.removeQuerySubscription();var e=this.queryObservable.getLastError(),t=this.queryObservable.getLastResult();this.queryObservable.resetLastResults(),this.startQuerySubscription(),Object.assign(this.queryObservable,{lastError:e,lastResult:t})},t.contextTypes={client:i.object,operations:i.object,renderPromises:i.object},t.propTypes={client:i.object,children:i.func.isRequired,fetchPolicy:i.string,notifyOnNetworkStatusChange:i.bool,onCompleted:i.func,onError:i.func,pollInterval:i.number,query:i.object.isRequired,variables:i.object,ssr:i.bool,partialRefetch:i.bool},t}(r.Component),N={loading:!1,called:!1,error:void 0,data:void 0},T=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.hasMounted=!1,r.runMutation=function(e){void 0===e&&(e={}),r.onMutationStart();var t=r.generateNewMutationId();return r.mutate(e).then((function(e){return r.onMutationCompleted(e,t),e})).catch((function(e){if(r.onMutationError(e,t),!r.props.onError)throw e}))},r.mutate=function(e){var t=r.props,n=t.mutation,i=t.variables,a=t.optimisticResponse,l=t.update,u=t.context,s=void 0===u?{}:u,c=t.awaitRefetchQueries,d=void 0!==c&&c,f=t.fetchPolicy,m=Object(o.a)({},e),p=m.refetchQueries||r.props.refetchQueries;p&&p.length&&Array.isArray(p)&&(p=p.map((function(e){return"string"==typeof e&&r.context.operations&&r.context.operations.get(e)||e})),delete m.refetchQueries);var v=Object.assign({},i,m.variables);return delete m.variables,r.client.mutate(Object(o.a)({mutation:n,optimisticResponse:a,refetchQueries:p,awaitRefetchQueries:d,update:l,context:s,fetchPolicy:f,variables:v},m))},r.onMutationStart=function(){r.state.loading||r.props.ignoreResults||r.setState({loading:!0,error:void 0,data:void 0,called:!0})},r.onMutationCompleted=function(e,t){var n=r.props,i=n.onCompleted,a=n.ignoreResults,o=e.data,u=e.errors,s=u&&u.length>0?new l.ApolloError({graphQLErrors:u}):void 0,c=function(){return i?i(o):null};r.hasMounted&&r.isMostRecentMutation(t)&&!a?r.setState({loading:!1,data:o,error:s},c):c()},r.onMutationError=function(e,t){var n=r.props.onError,i=function(){return n?n(e):null};r.hasMounted&&r.isMostRecentMutation(t)?r.setState({loading:!1,error:e},i):i()},r.generateNewMutationId=function(){return r.mostRecentMutationId=r.mostRecentMutationId+1,r.mostRecentMutationId},r.isMostRecentMutation=function(e){return r.mostRecentMutationId===e},r.verifyDocumentIsMutation=function(e){var t=y(e);Object(a.b)(t.type===p.Mutation)},r.client=g(t,n),r.verifyDocumentIsMutation(t.mutation),r.mostRecentMutationId=0,r.state=N,r}return Object(o.c)(t,e),t.prototype.componentDidMount=function(){this.hasMounted=!0},t.prototype.componentWillUnmount=function(){this.hasMounted=!1},t.prototype.componentWillReceiveProps=function(e,t){var n=g(e,t);O(this.props,e)&&this.client===n||(this.props.mutation!==e.mutation&&this.verifyDocumentIsMutation(e.mutation),this.client!==n&&(this.client=n,this.setState(N)))},t.prototype.render=function(){var e=this.props.children,t=this.state,n=t.loading,r=t.data,i=t.error,a={called:t.called,loading:n,data:r,error:i,client:this.client};return e(this.runMutation,a)},t.contextTypes={client:i.object,operations:i.object},t.propTypes={mutation:i.object.isRequired,variables:i.object,optimisticResponse:i.object,refetchQueries:Object(i.oneOfType)([Object(i.arrayOf)(Object(i.oneOfType)([i.string,i.object])),i.func]),awaitRefetchQueries:i.bool,update:i.func,children:i.func.isRequired,onCompleted:i.func,onError:i.func,fetchPolicy:i.string},t}(r.Component),C=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.initialize=function(e){r.queryObservable||(r.queryObservable=r.client.subscribe({query:e.subscription,variables:e.variables,fetchPolicy:e.fetchPolicy}))},r.startSubscription=function(){r.querySubscription||(r.querySubscription=r.queryObservable.subscribe({next:r.updateCurrentData,error:r.updateError,complete:r.completeSubscription}))},r.getInitialState=function(){return{loading:!0,error:void 0,data:void 0}},r.updateCurrentData=function(e){var t=r,n=t.client,i=t.props.onSubscriptionData;i&&i({client:n,subscriptionData:e}),r.setState({data:e.data,loading:!1,error:void 0})},r.updateError=function(e){r.setState({error:e,loading:!1})},r.completeSubscription=function(){var e=r.props.onSubscriptionComplete;e&&e(),r.endSubscription()},r.endSubscription=function(){r.querySubscription&&(r.querySubscription.unsubscribe(),delete r.querySubscription)},r.client=g(t,n),r.initialize(t),r.state=r.getInitialState(),r}return Object(o.c)(t,e),t.prototype.componentDidMount=function(){this.startSubscription()},t.prototype.componentWillReceiveProps=function(e,t){var n=g(e,t);if(!O(this.props.variables,e.variables)||this.client!==n||this.props.subscription!==e.subscription){var r=e.shouldResubscribe;"function"==typeof r&&(r=!!r(this.props,e));var i=!1===r;if(this.client!==n&&(this.client=n),!i)return this.endSubscription(),delete this.queryObservable,this.initialize(e),this.startSubscription(),void this.setState(this.getInitialState());this.initialize(e),this.startSubscription()}},t.prototype.componentWillUnmount=function(){this.endSubscription()},t.prototype.render=function(){var e=this.props.children;return e?e(Object.assign({},this.state,{variables:this.props.variables})):null},t.contextTypes={client:i.object},t.propTypes={subscription:i.object.isRequired,variables:i.object,children:i.func,onSubscriptionData:i.func,onSubscriptionComplete:i.func,shouldResubscribe:Object(i.oneOfType)([i.func,i.bool])},t}(r.Component),j=function(){return{}},x=function(){return!1};function F(e){return e.displayName||e.name||"Component"}function E(e,t){for(var n={},r=0,i=e.variables;r<i.length;r++){var a=i[r],o=a.variable,l=a.type;if(o.name&&o.name.value){var u=o.name.value,s=t[u];void 0===s?"NonNullType"!==l.kind&&(n[u]=null):n[u]=s}}return n}var P=function(e){function t(t){var n=e.call(this,t)||this;return n.withRef=!1,n.setWrappedInstance=n.setWrappedInstance.bind(n),n}return Object(o.c)(t,e),t.prototype.getWrappedInstance=function(){return Object(a.b)(this.withRef),this.wrappedInstance},t.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},t}(r.Component);function A(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.skip,u=void 0===l?x:l,s=t.alias,c=void 0===s?"Apollo":s,f=a;"function"!=typeof f&&(f=function(){return a});var m,p=u;return"function"!=typeof p&&(p=function(){return u}),function(i){var a=c+"("+F(i)+")",l=function(l){function u(){return null!==l&&l.apply(this,arguments)||this}return Object(o.c)(u,l),u.prototype.render=function(){var l=this,u=this.props,s=p(u),c=s?Object.create(null):Object(o.a)({},f(u));return!s&&!c.variables&&n.variables.length>0&&(c.variables=E(n,u)),Object(r.createElement)(w,Object(o.a)({},c,{displayName:a,skip:s,query:e,warnUnhandledError:!0}),(function(e){e.client;var n,a,c=e.data,d=Object(o.e)(e,["client","data"]);if(t.withRef&&(l.withRef=!0,u=Object.assign({},u,{ref:l.setWrappedInstance})),s)return Object(r.createElement)(i,Object(o.a)({},u,{}));var f=Object.assign(d,c||{}),p=t.name||"data",v=((n={})[p]=f,n);if(t.props){var h=((a={})[p]=f,a.ownProps=u,a);v=m=t.props(h,m)}return Object(r.createElement)(i,Object(o.a)({},u,v))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function _(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.alias,u=void 0===l?"Apollo":l,s=a;return"function"!=typeof s&&(s=function(){return a}),function(i){var a=u+"("+F(i)+")",l=function(l){function u(){return null!==l&&l.apply(this,arguments)||this}return Object(o.c)(u,l),u.prototype.render=function(){var a=this.props,l=s(a);return t.withRef&&(this.withRef=!0,a=Object.assign({},a,{ref:this.setWrappedInstance})),!l.variables&&n.variables.length>0&&(l.variables=E(n,a)),Object(r.createElement)(T,Object(o.a)({},l,{mutation:e,ignoreResults:!0}),(function(e,n){var l,u,s=t.name||"mutate",c=((l={})[s]=e,l);if(t.props){var d=((u={})[s]=e,u.ownProps=a,u);c=t.props(d)}return Object(r.createElement)(i,Object(o.a)({},a,c))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function I(e,t){void 0===t&&(t={});var n=y(e),i=t.options,a=void 0===i?j:i,l=t.skip,u=void 0===l?x:l,s=t.alias,c=void 0===s?"Apollo":s,f=t.shouldResubscribe,m=a;"function"!=typeof m&&(m=function(){return a});var p,v=u;return"function"!=typeof v&&(v=function(){return u}),function(i){var a=c+"("+F(i)+")",l=function(l){function u(e){var t=l.call(this,e)||this;return t.state={resubscribe:!1},t}return Object(o.c)(u,l),u.prototype.componentWillReceiveProps=function(e){f&&this.setState({resubscribe:f(this.props,e)})},u.prototype.render=function(){var l=this,u=this.props,s=v(u),c=s?Object.create(null):m(u);return!s&&!c.variables&&n.variables.length>0&&(c.variables=E(n,u)),Object(r.createElement)(C,Object(o.a)({},c,{displayName:a,skip:s,subscription:e,shouldResubscribe:this.state.resubscribe}),(function(e){var n,a,c=e.data,d=Object(o.e)(e,["data"]);if(t.withRef&&(l.withRef=!0,u=Object.assign({},u,{ref:l.setWrappedInstance})),s)return Object(r.createElement)(i,Object(o.a)({},u,{}));var f=Object.assign(d,c||{}),m=t.name||"data",v=((n={})[m]=f,n);if(t.props){var h=((a={})[m]=f,a.ownProps=u,a);v=p=t.props(h,p)}return Object(r.createElement)(i,Object(o.a)({},u,v))}))},u.displayName=a,u.WrappedComponent=i,u}(P);return d()(l,i,{})}}function D(e,t){switch(void 0===t&&(t={}),y(e).type){case p.Mutation:return _(e,t);case p.Subscription:return I(e,t);case p.Query:default:return A(e,t)}}function R(e,t){void 0===t&&(t={});var n="withApollo("+function(e){return e.displayName||e.name||"Component"}(e)+")",i=function(i){function l(e){var t=i.call(this,e)||this;return t.setWrappedInstance=t.setWrappedInstance.bind(t),t}return Object(o.c)(l,i),l.prototype.getWrappedInstance=function(){return Object(a.b)(t.withRef),this.wrappedInstance},l.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},l.prototype.render=function(){var n=this;return Object(r.createElement)(m,null,(function(i){var a=Object.assign({},n.props,{client:i,ref:t.withRef?n.setWrappedInstance:void 0});return Object(r.createElement)(e,Object(o.a)({},a))}))},l.displayName=n,l.WrappedComponent=e,l}(r.Component);return d()(i,e,{})}var M=function(){function e(){this.queryPromises=new Map,this.queryInfoTrie=new Map}return e.prototype.registerSSRObservable=function(e,t){this.lookupQueryInfo(e).observable=t},e.prototype.getSSRObservable=function(e){return this.lookupQueryInfo(e).observable},e.prototype.addQueryPromise=function(e,t){return this.lookupQueryInfo(e).seen?t():(this.queryPromises.set(e,new Promise((function(t){t(e.fetchData())}))),null)},e.prototype.hasPromises=function(){return this.queryPromises.size>0},e.prototype.consumeAndAwaitPromises=function(){var e=this,t=[];return this.queryPromises.forEach((function(n,r){e.lookupQueryInfo(r).seen=!0,t.push(n)})),this.queryPromises.clear(),Promise.all(t)},e.prototype.lookupQueryInfo=function(e){var t=this.queryInfoTrie,n=e.props,r=n.query,i=n.variables,a=t.get(r)||new Map;t.has(r)||t.set(r,a);var o=JSON.stringify(i),l=a.get(o)||{seen:!1,observable:null};return a.has(o)||a.set(o,l),l},e}();function L(e,t){return void 0===t&&(t={}),B({tree:e,context:t,renderFunction:n(186).renderToStaticMarkup})}function B(e){var t=e.tree,a=e.context,l=void 0===a?{}:a,u=e.renderFunction,s=void 0===u?n(186).renderToStaticMarkup:u,c=new M,d=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Object(o.c)(n,e),n.prototype.getChildContext=function(){return Object(o.a)({},l,{renderPromises:c})},n.prototype.render=function(){return t},n.childContextTypes={renderPromises:i.object},n}(r.Component);return Object.keys(l).forEach((function(e){d.childContextTypes[e]=i.any})),Promise.resolve().then((function e(){var t=s(Object(r.createElement)(d));return c.hasPromises()?c.consumeAndAwaitPromises().then(e):t}))}function V(e){return B({tree:e,renderFunction:n(186).renderToString})}function q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.reverse();return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n[0],i=n.slice(1),a=r.apply(null,e);return i.forEach((function(e){a=e.call(null,a)})),a}}},186:function(e,t,n){"use strict";e.exports=n(375)},187:function(e,t,n){"use strict";var r=n(188),i=n(379);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function l(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)n.push(parseInt(e[i]+e[i+1],16))}else for(var r=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?n[r++]=o:o<2048?(n[r++]=o>>6|192,n[r++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),n[r++]=o>>18|240,n[r++]=o>>12&63|128,n[r++]=o>>6&63|128,n[r++]=63&o|128):(n[r++]=o>>12|224,n[r++]=o>>6&63|128,n[r++]=63&o|128)}else for(i=0;i<e.length;i++)n[i]=0|e[i];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=l(e[n].toString(16));return t},t.htonl=o,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e[r];"little"===t&&(i=o(i)),n+=u(i.toString(16))}return n},t.zero2=l,t.zero8=u,t.join32=function(e,t,n,i){var a=n-t;r(a%4==0);for(var o=new Array(a/4),l=0,u=t;l<o.length;l++,u+=4){var s;s="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],o[l]=s>>>0}return o},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r<e.length;r++,i+=4){var a=e[r];"big"===t?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=255&a):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=255&a)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],a=r+e[t+1]>>>0,o=(a<r?1:0)+n+i;e[t]=o>>>0,e[t+1]=a},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,a,o,l){var u=0,s=t;return u+=(s=s+r>>>0)<t?1:0,u+=(s=s+a>>>0)<a?1:0,e+n+i+o+(u+=(s=s+l>>>0)<l?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,i,a,o,l){return t+r+a+l>>>0},t.sum64_5_hi=function(e,t,n,r,i,a,o,l,u,s){var c=0,d=t;return c+=(d=d+r>>>0)<t?1:0,c+=(d=d+a>>>0)<a?1:0,c+=(d=d+l>>>0)<l?1:0,e+n+i+o+u+(c+=(d=d+s>>>0)<s?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,i,a,o,l,u,s){return t+r+a+l+s>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},188:function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},193:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw i}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=n(0)},function(e,t){e.exports=n(1)},function(e,t){e.exports=n(8)},function(e,t){e.exports=n(9)},function(e,t){e.exports=n(420)},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),l=n(4),u=n(3);const s=[970,250],c=[728,90],d=[300,50],f=[970,90],m={header:[{height:0,sizes:[],width:0},{height:100,sizes:[[320,50],[320,48],d],width:300},{height:90,sizes:[c],width:768},{height:250,sizes:[s,f,c],width:1024}],intervention:[{height:0,sizes:[],width:0},{height:100,sizes:[[300,250],[320,50],[320,48],d],width:300},{height:90,sizes:[c],width:768},{height:250,sizes:[s,f,c],width:1024}],mpu:[{height:0,sizes:[],width:0},{height:250,sizes:[[300,250],[300,600]],width:300}],native:[{height:250,sizes:[[300,250]],width:300},{height:90,sizes:[c],width:728},{height:250,sizes:[s],width:970}],pixel:[{height:0,sizes:[[1,1]],width:0}]},p={"ad-header":1,"ad-mpu":3,"ad-pixel":2,"ad-pixelskin":2,"ad-pixelteads":2,"article-sponsored-ad":2,default:0,header:1,mpu:3,pixel:2,pixelskin:2,pixelteads:2},v={"ad-header":m.header,"ad-mpu":m.mpu,"ad-pixel":m.pixel,"ad-pixelskin":m.pixelskin,"ad-pixelteads":m.pixelteads,"article-sponsored-ad":m.pixel,default:m.intervention,header:m.header,mpu:m.mpu,"native-inline-ad":m.native,pixel:m.pixel,pixelskin:m.pixel,pixelteads:m.pixel},h=(e,t)=>{const n=v[e]||v.default,r=((e,t)=>{for(let n=e.length-1;n>=0;n-=1)if(t>=e[n].width)return e[n].sizes;return[]})(n,t);return{mappings:n,maxSizes:(e=>e?e.reduce((e,t)=>{let n=o(t,2),r=n[0],i=n[1];return{height:Math.max(e.height,i),width:Math.max(e.width,r)}},{height:0,width:0}):{height:0,width:0})(r),sizes:r,slotName:e}},y={bidderSettings:e=>{let t=e.maxBid,n=e.minPrice,r=e.bucketSize;return{adserverTargeting:[{key:"hb_bidder",val:e=>e.bidder},{key:"hb_adid",val:e=>e.adId},{key:"hb_pb",val:e=>e.cpm>t?t.toFixed(2):e.cpm<r?n.toFixed(2):(e.cpm-e.cpm%r).toFixed(2)},{key:"hb_size",val:e=>e.size}]}},init:{bidderSequence:"random",bidTimeout:3e3,cache:{url:"https://prebid.adnxs.com/pbc/v1/cache"},consentManagement:{allowAuctionWithoutConsent:!0,cmpApi:"iab",timeout:3e3},disableAjaxTimeout:!1,enableSendAllBids:!0,maxRequestsPerOrigin:4,priceGranularity:"medium",timeoutBuffer:400,userSync:{enableOverride:!1,syncDelay:3e3,syncEnabled:!0,syncsPerBidder:5}}};var g=e=>{let t=e.el,n=e.data,r=e.platform,i=e.eventCallback,a=e.window;a.googletag=a.googletag||{},a.googletag.cmd=a.googletag.cmd||[],a.pbjs=a.pbjs||{},a.pbjs.que=a.pbjs.que||[],a.apstag=a.apstag||{_Q:[],addToQueue(e,t){this._Q.push([e,t])},fetchBids(){this.addToQueue("f",arguments)},init(){this.addToQueue("i",arguments)},setDisplayBids(){},targetingKeys:()=>[]};const o=a.apstag,l=a.document,u=a.encodeURIComponent,s=a.googletag,c=a.location,d=a.pbjs,f=a.Promise,m=a.Set,p=a.XMLHttpRequest;let v=!1;const h="web"===r,y=n.prebidConfig,g=y.timeout,k=y.bidders,b=k&&k.amazon&&k.amazon.accountId;return{init(){if(n.disableAds)return f.resolve("ads disabled");const e=[f.resolve()];return a.initCalled||((!n.bidInitialiser&&h||!h)&&this.loadScripts(),e.push(this.apstag.process(),this.prebid.process(),this.gpt.process())),a.initCalled=!0,v||e.push(this.gpt.bid()),v=!0,f.all(e).then(()=>{this.gpt.refreshAd(),i("renderComplete")}).catch(e=>{i("error",e.stack),i("renderFailed")})},loadScripts(){h&&(this.breakpoints(),this.utils.loadScript(this.prebid.url)),this.utils.loadScript(this.gpt.url),this.utils.loadScript(this.apstag.url),this.admantx.init()},breakpoints(){const e={huge:"(min-width: 1320px)",medium:"(min-width: 768px) and (max-width: 1023px)",small:"(max-width: 767px)",wide:"(min-width: 1024px) and (max-width: 1319px)"};a.matchMedia&&Object.keys(e).forEach(t=>{a.matchMedia(e[t]).addListener(this.handleBreakPointChange.bind(this,t))})},handleBreakPointChange(e,t){t.matches&&(this.gpt.setPageTargeting({breakpoint:e,refresh:"true"}),s.cmd.push(()=>s.pubads().refresh()))},admantx:{extractNames:e=>[...new m(e.map(e=>e.name.toLowerCase().trim().replace(/\s+/g,"_").replace(/["'=!+#*~;^()<>[\],&]/g,"")))].join(","),getUrl:()=>"https://euasync01.admantx.com/admantx/service?request="+u(JSON.stringify({key:"f1694ae18c17dc1475ee187e4996ad2b484217b1a436cb04b7ac3dd4902180b6",method:"descriptor",mode:"async",decorator:"json",filter:"default",type:"URL",body:c.href})),init(){const e=new p;e.open("GET",this.getUrl()),e.send(),e.onload=()=>{if(200!==e.status)i("Error: ".concat(e.status,": ").concat(e.statusText));else{const t=e.response;if(t.admants||t.categories||t.entities||t.feelings){const e={admantx_bs:this.extractNames(t.admants),admantx_cat:this.extractNames(t.categories),admantx_emotion:this.extractNames(t.feelings),admantx_ents:this.extractNames(t.entities)};s.cmd.push(()=>this.gpt.setPageTargeting(e))}}},e.onerror=()=>{i("Error in ADmantx request")}}},gpt:{url:"https://www.googletagservices.com/tag/js/gpt.js",setSlotTargeting(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,a=r.networkId,o=r.adUnit,l=r.section,u=r.slotTargeting;s.cmd.push(()=>{try{const n=e.slotName,r=e.sizes,c=e.mappings,d=s.defineSlot("/".concat(a,"/").concat(o,"/").concat(l),r,n);if(!d)return;d.addService(s.pubads()),t&&(t.id="wrapper-"+n,t.innerHTML='<div id="'.concat(n,'"></div>'),t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.margin="0 auto",t.style.height="100%");const f=s.sizeMapping();c.forEach(e=>f.addSize([e.width,e.height],e.sizes)),d.defineSizeMapping(f.build()),Object.keys(u||[]).forEach(e=>d.setTargeting(e,u[e]));const m=Math.floor(10*Math.random()).toString();d.setTargeting("timestestgroup",m),d.setTargeting("pos",n),s.display(n),i("warn","[Google] INFO: set slot targeting - "+n)}catch(e){i("error",e.stack)}})},setPageTargeting(e){return s.cmd.push(()=>{try{const t=s.pubads();Object.keys(e).forEach(n=>{t.setTargeting(n,e[n])}),i("warn","[Google] INFO: set page target"),i("log",e)}catch(e){i("error",e.stack)}}),this.waitUntilReady()},init(){s.cmd.push(()=>{const e=s.pubads();e.disableInitialLoad(),e.enableSingleRequest(),e.collapseEmptyDivs(!0,!0),s.enableServices(),i("warn","[Google] INFO: initialised")})},bid(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n).config;return this.setSlotTargeting(e),this.waitUntilReady()},refreshAd(){s.cmd.push(()=>{h&&d.setTargetingForGPTAsync(),o.setDisplayBids(),s.pubads().refresh(),i("warn","[Google] INFO: pubads refresh")})},process(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:n).pageTargeting;return this.init(),this.setPageTargeting(e),this.waitUntilReady()},waitUntilReady:()=>new f(e=>s.cmd.push(()=>{e()}))},prebid:{url:"https://www.thetimes.co.uk/d/js/vendor/prebid.min-4c674b73bd.js",bid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.slots;return new f((e,n)=>{d.que.push(()=>{try{if(t.length>0)i("warn","[Prebid] INFO: requesting bids"),i("log",t),t.forEach(e=>d.removeAdUnit(e.code)),d.addAdUnits(t),d.requestBids({bidsBackHandler(t){i("warn","[Prebid] INFO: bid response"),i("log",t),e(t)}});else{const t="[Prebid] INFO: no slots are defined";i("warn",t),e(t)}}catch(e){n(e)}})})},process(){if(h)return this.init(),this.bid();const e="[Prebid] INFO: no prebid on native";return i("warn",e),f.resolve(e)},init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.prebidConfig,r=e.debug,o=void 0!==r&&r;const l=t.init,u=t.bidderSettings;a.pbjs.bidderTimeout=g,a.pbjs.bidderSettings=u&&u(t),d.que.push(()=>{l.debug=o,d.setConfig(l),i("warn","[Prebid] INFO: initialised"),i("log",l)})}},apstag:{url:"https://c.amazon-adsystem.com/aax2/apstag.js",getConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=e.slots,r=e.networkId,i=e.adUnit,a=e.section;const o=[r,i];a&&o.push(a);const l=o.reduce((e,t,n)=>1===n?"/".concat(e,"/").concat(t):"".concat(e,"/").concat(t));return t.map(e=>({sizes:e.sizes,slotID:e.code,slotName:l}))},bid(){return new f(e=>{try{const t=this.getConfig();if(t.length>0)i("warn","[Amazon] INFO: requesting bids"),i("log",t),o.fetchBids({slots:t},t=>{i("warn","[Amazon] INFO: bids response"),i("log",t),e(t)});else{const t="[Amazon] INFO: no slots are defined";i("warn",t),e(t)}}catch(t){i("error",t.stack),e(t)}})},process(){if(b)return this.init();const e="[Amazon] INFO: amazonAccountID undefined";return i("warn",e),f.resolve(e)},init(){const e={adServer:"googletag",bidTimeout:g,gdpr:{cmpTimeout:g},pubID:b};i("log",e),o.init(e,()=>(i("warn","[Amazon] INFO: initialised"),this.bid()))}},utils:{scriptsInserted:{},createScriptElement(e,t,n){try{const r=l.createElement("script");r.type="text/javascript",r.defer=!0,t&&r.addEventListener("load",t),n&&r.addEventListener("error",n),r.src=e,l.head.appendChild(r)}catch(e){i("error",e.stack)}},loadScript(e){return this.scriptsInserted[e]?f.resolve('Inserting "'.concat(e,'" twice.')):(this.scriptsInserted[e]=!0,new f((t,n)=>{this.createScriptElement(e,()=>{t("loaded "+e)},()=>{n(new Error("load error for "+e))})}))}}}},k=n(0),b=n.n(k),S=n(2),O={alignItems:"center",flex:1},w=(i(i({backgroundColor:S.colours.functional.backgroundPrimary,borderColor:S.colours.functional.keyline,borderStyle:"solid",borderWidth:1,color:S.colours.functional.secondary},Object(S.fontFactory)({font:"body",fontSize:"puffLink"})),{},{letterSpacing:1.5,paddingBottom:Object(S.spacing)(1),paddingLeft:Object(S.spacing)(2),paddingRight:Object(S.spacing)(2),paddingTop:Object(S.spacing)(1),zIndex:1}),S.colours.functional.backgroundPrimary,S.colours.functional.keyline,e=>{let t=e.slotName,n=e.style;return a.a.createElement(u.TcView,{style:i(i({},O),n)},a.a.createElement("div",{id:""+{header:"ad-header",sticky:"sticky-leaderboard","inline-ad":"ad-article-inline",articleListAd:"ad-article-inline",pixel:"ad-pixel",pixelteads:"ad-pixelteads",pixelskin:"ad-pixelskin",inlineAd1:"ad-article-inline-1",inlineAd2:"ad-article-inline-2",inlineAd3:"ad-article-inline-3",inlineAd4:"ad-article-inline-4",videoAd1:"ad-vid-article-1"}[t]}))});b.a.shape({}),b.a.number.isRequired,b.a.func.isRequired,b.a.func,b.a.func,b.a.number.isRequired,b.a.number;class N extends r.Component{constructor(){var e;return e=super(...arguments),this.eventQueue=[],this.eventCallback=(e,t)=>{this.eventQueue.push({detail:t,type:e}),this.processEventQueue()},this.processEvent=e=>{let t=e.type,n=e.detail;const r=this.props,i=r.onRenderComplete,a=r.onRenderError,o=r.data;if(0!==this.eventQueue.length)switch(t){case"renderFailed":a();break;case"renderComplete":i();break;default:o.debug&&((e,t)=>{switch(e){case"error":console.error(t);break;case"warn":console.warn(t);break;case"info":console.info(t);break;case"debug":console.debug(t);break;case"log":console.log(t);break;default:console.log(e),console.log(t)}})(t,n)}},e}componentDidMount(){const e=this.props,t=e.data,n=e.init;this.initExecuting=!0,this.hasUnmounted=!1,this.adInit=n({data:t,el:this.div,eventCallback:this.eventCallback,platform:"web",window:window}),this.adInit&&this.adInit.init&&this.adInit.init(),this.initExecuting=!1,this.processEventQueue()}componentWillUnmount(){this.eventQueue=[],this.hasUnmounted=!0}processEventQueue(){this.initExecuting||this.hasUnmounted||(this.eventQueue.forEach(this.processEvent),this.eventQueue=[])}render(){const e=this.props.width;return a.a.createElement("div",{ref:e=>{this.div=e},style:{height:"auto",overflow:"hidden",width:e}})}}N.defaultProps={data:{},height:0,onRenderComplete:()=>{},onRenderError:()=>{},height:0};var T=N;b.a.shape({adUnit:b.a.string.isRequired,biddersConfig:b.a.shape({}),bidderSlots:b.a.arrayOf(b.a.string),networkId:b.a.string.isRequired,pageTargeting:b.a.shape({}),slotTargeting:b.a.shape({})}),b.a.oneOfType([b.a.element,b.a.arrayOf(b.a.element)]).isRequired;const C={adConfig:{adUnit:"d.thetimes.co.uk",biddersConfig:{bidders:{amazon:{accountId:"3360"},appnexus:{placementId:"5823281"},ix:{siteId:"188830"},rubicon:{accountId:"14062",siteId:"70608",zoneId:"335918"}},bucketSize:.25,maxBid:15,minPrice:.01,timeout:3e3},bidderSlots:["header","inline-ad"],bidInitialiser:Promise.resolve(),globalSlots:["ad-pixel","ad-pixelskin","ad-pixelteads"],networkId:"25436805",pageTargeting:{label:"This is label",title:"This is title"},slotTargeting:{section:"news"}}},j=e=>{let t=e.adConfig,n=e.children;return a.a.createElement(l.Broadcast,{channel:"adConfig",value:t},n)};j.defaultProps=C;var x=j;b.a.object.style;function F(){return(F=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}b.a.string,b.a.string,b.a.bool,b.a.string,b.a.string.isRequired,n.d(t,"AdComposer",(function(){return x})),n.d(t,"AdContainer",(function(){return w}));class E extends r.Component{static getDerivedStateFromProps(e){const t=e.slotName;return{config:h(t,Object(u.screenWidth)())}}constructor(e){super(e),this.setAdReady=()=>{this.setState({isAdReady:!0})},this.setAdError=()=>{this.setState({hasError:!0})};const t=e.slotName;this.prebidConfig=y,this.state={config:h(t,Object(u.screenWidth)()),hasError:!1,isAdReady:!1,hasAdBlock:!1}}componentDidMount(){this.setState({hasAdBlock:window.hasAdBlock})}renderAd(e){const t=this.props,n=t.baseUrl,r=t.contextUrl,o=t.isLoading,l=t.section,s=t.slotName,c=t.style,d=this.state,f=d.config,m=d.hasError,v=d.isAdReady;if(d.hasAdBlock||m)return null;this.slots=e.bidderSlots.map(t=>((e,t,n,r)=>{const i=p[e]||p.default,a=h(e,n).sizes;let o=[];return r.ix&&r.ix.siteId&&(o=o.concat(a.map(e=>({bidder:"ix",params:{siteId:r.ix.siteId,size:e}})))),r.appnexus&&r.appnexus.placementId&&o.push({bidder:"appnexus",params:{keywords:{pos:i,section:t},placementId:r.appnexus.placementId,position:i}}),r.rubicon&&r.rubicon.accountId&&o.push({bidder:"rubicon",params:{accountId:r.rubicon.accountId,keywords:[t],position:1===i?"atf":"btf",siteId:r.rubicon.siteId,zoneId:r.rubicon.zoneId}}),{bids:o,code:e,mediaTypes:{banner:{sizes:a}},sizes:a}})(t,l,f.maxSizes.width,e.biddersConfig.bidders)),this.allSlotConfigs=e.globalSlots.concat(e.bidderSlots).map(e=>h(e,Object(u.screenWidth)()));const y={adUnit:e.adUnit,allSlotConfigs:this.allSlotConfigs||this.slots,bidInitialiser:e.bidInitialiser||!1,config:f,contextUrl:r,debug:e.debug||!1,disableAds:e.disabled||!1,networkId:e.networkId,pageTargeting:e.pageTargeting,prebidConfig:Object.assign(this.prebidConfig,{bidders:e.biddersConfig.bidders,bucketSize:e.biddersConfig.bucketSize,maxBid:e.biddersConfig.maxBid,minPrice:e.biddersConfig.minPrice,timeout:e.biddersConfig.timeout}),section:l,sizingMap:f.mappings,slotName:s,slots:this.slots,slotTargeting:e.slotTargeting},k=v?{height:f.maxSizes.height,width:f.maxSizes.width}:{height:0,width:0},b=a.a.createElement(u.TcView,{style:i(i({},O),c)},o?null:a.a.createElement(T,F({baseUrl:n,data:y,init:g,onRenderComplete:this.setAdReady,onRenderError:this.setAdError},k)));return a.a.createElement(u.ServerClientRender,{client:()=>b,server:null})}render(){const e=this.props.adConfig;return e?this.renderAd(e):a.a.createElement(l.Subscriber,{channel:"adConfig"},e=>this.renderAd(e))}}E.defaultProps={baseUrl:"https://www.thetimes.co.uk/",contextUrl:"",isLoading:!1,section:"",style:null},t.default=E}])},2:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return s}));
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
9
9
|
|