@times-components/utils 6.28.0 → 6.29.0
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.
- package/CHANGELOG.md +11 -0
- package/dist/debounce.js +26 -0
- package/dist/index.js +9 -0
- package/package.json +4 -4
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.29.0](https://github.com/newsuk/times-components/compare/@times-components/utils@6.28.0...@times-components/utils@6.29.0) (2025-03-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TMRS-684:** video article template UI ([#4101](https://github.com/newsuk/times-components/issues/4101)) ([964bee6](https://github.com/newsuk/times-components/commit/964bee6570dba6247174606707675eebc8402f97))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [6.28.0](https://github.com/newsuk/times-components/compare/@times-components/utils@6.27.1...@times-components/utils@6.28.0) (2025-03-13)
|
|
7
18
|
|
|
8
19
|
|
package/dist/debounce.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const debounce = (fn, delay) => {
|
|
9
|
+
let timeoutID;
|
|
10
|
+
|
|
11
|
+
const debounced = function debounced() {
|
|
12
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
args[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
clearTimeout(timeoutID);
|
|
17
|
+
timeoutID = setTimeout(() => {
|
|
18
|
+
fn(...args);
|
|
19
|
+
}, delay);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return debounced;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _default = debounce;
|
|
26
|
+
exports.default = _default;
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ var _exportNames = {
|
|
|
25
25
|
TcText: true,
|
|
26
26
|
TcTextLink: true,
|
|
27
27
|
TcScrollView: true,
|
|
28
|
+
debounce: true,
|
|
28
29
|
CanShowPuzzleSidebar: true,
|
|
29
30
|
getCookieValue: true,
|
|
30
31
|
getBase64CookieValue: true,
|
|
@@ -156,6 +157,12 @@ Object.defineProperty(exports, "TcScrollView", {
|
|
|
156
157
|
return _tcScrollView.default;
|
|
157
158
|
}
|
|
158
159
|
});
|
|
160
|
+
Object.defineProperty(exports, "debounce", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function get() {
|
|
163
|
+
return _debounce.default;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
159
166
|
Object.defineProperty(exports, "CanShowPuzzleSidebar", {
|
|
160
167
|
enumerable: true,
|
|
161
168
|
get: function get() {
|
|
@@ -265,6 +272,8 @@ var _tcTextLink = _interopRequireDefault(require("./tc-text-link"));
|
|
|
265
272
|
|
|
266
273
|
var _tcScrollView = _interopRequireDefault(require("./tc-scroll-view"));
|
|
267
274
|
|
|
275
|
+
var _debounce = _interopRequireDefault(require("./debounce"));
|
|
276
|
+
|
|
268
277
|
var _articlePuzzleSidebarWhitelist = _interopRequireDefault(require("./article-puzzle-sidebar-whitelist"));
|
|
269
278
|
|
|
270
279
|
var _getCookieValue = _interopRequireDefault(require("./get-cookie-value"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/utils",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.29.0",
|
|
4
4
|
"description": "A set of helpers and/or workarounds to be shared across packages ",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"dev": "src/index",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@babel/core": "7.4.4",
|
|
36
36
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
37
37
|
"@times-components/jest-configurator-web": "0.8.2",
|
|
38
|
-
"@times-components/jest-serializer": "3.13.
|
|
38
|
+
"@times-components/jest-serializer": "3.13.24",
|
|
39
39
|
"@times-components/webpack-configurator": "2.1.1",
|
|
40
40
|
"babel-jest": "24.8.0",
|
|
41
41
|
"babel-loader": "8.0.5",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@times-components/schema": "0.7.5",
|
|
51
|
-
"@times-components/ts-styleguide": "1.
|
|
51
|
+
"@times-components/ts-styleguide": "1.51.0",
|
|
52
52
|
"apollo-cache-inmemory": "1.5.1",
|
|
53
53
|
"apollo-client": "2.5.1",
|
|
54
54
|
"apollo-link": "1.2.4",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"react": ">=16.9",
|
|
68
68
|
"react-dom": ">=16.9"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "96ba6ba2abdb6bdbd1ff5cf3a6d38ded0a35b48b"
|
|
71
71
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e){t.exports=require("styled-components")},function(t,e){t.exports=require("react")},function(t,e){t.exports=require("prop-types")},function(t,e){t.exports=t=>{let e=t.tiles;if(!e)return null;let r=e.reduce((t,e)=>(t.push(...e.slices),t),[]).reduce((t,e)=>(t.push(...e.sections),t),[]).map(t=>t.title);r=r.filter(t=>t);const n=r.filter(t=>"news"!==t);return n.length?n[0].toLowerCase():"unknown section"}},function(t,e){const r=t=>t.slices[0].sections[0].title?t.slices[0].sections[0].title.toLowerCase():"";t.exports=t=>{return(e=t)&&e.tiles&&e.tiles.length>0?t.tiles.reduce((t,e)=>{return(n=e).slices&&n.slices.length>0&&(t=>t.slices[0].sections&&t.slices[0].sections.length>0)(e)&&r(e)?r(e):t;var n},"default"):"default";var e}},function(t,e){t.exports=require("@times-components/ts-styleguide/rnw")},function(t,e,r){(function(t){var r="[object Arguments]",n="[object Map]",o="[object Object]",i="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,u=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[r]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[n]=d["[object Number]"]=d[o]=d["[object RegExp]"]=d[i]=d["[object String]"]=d["[object WeakMap]"]=!1;var h="object"==typeof global&&global&&global.Object===Object&&global,y="object"==typeof self&&self&&self.Object===Object&&self,b=h||y||Function("return this")(),v=e&&!e.nodeType&&e,g=v&&"object"==typeof t&&t&&!t.nodeType&&t,_=g&&g.exports===v&&h.process,m=function(){try{return _&&_.binding("util")}catch(t){}}(),w=m&&m.isTypedArray;function j(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function x(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function O(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function k(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function A(t,e){return function(r){return t(e(r))}}function S(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var C,T=Array.prototype,P=Function.prototype,E=Object.prototype,I=b["__core-js_shared__"],z=(C=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",q=P.toString,F=E.hasOwnProperty,M=E.toString,N=RegExp("^"+q.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=b.Symbol,V=b.Uint8Array,L=A(Object.getPrototypeOf,Object),D=E.propertyIsEnumerable,$=T.splice,U=Object.getOwnPropertySymbols,W=A(Object.keys,Object),B=jt(b,"DataView"),H=jt(b,"Map"),Q=jt(b,"Promise"),G=jt(b,"Set"),J=jt(b,"WeakMap"),Y=jt(Object,"create"),K=zt(B),X=zt(H),Z=zt(Q),tt=zt(G),et=zt(J),rt=R?R.prototype:void 0,nt=rt?rt.valueOf:void 0,ot=rt?rt.toString:void 0;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function lt(t){this.__data__=new ct(t)}function st(t,e){var r=Nt(t)||Mt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!F.call(t,i)||o&&("length"==i||At(i,n))||r.push(i);return r}function ft(t,e){for(var r=t.length;r--;)if(Ft(t[r][0],e))return r;return-1}function pt(t,e){for(var r=0,n=(e=St(e,t)?[e]:gt(e)).length;null!=t&&r<n;)t=t[It(e[r++])];return r&&r==n?t:void 0}function dt(t,e){return null!=t&&e in Object(t)}function ht(t,e,c,a,u){return t===e||(null==t||null==e||!Dt(t)&&!$t(e)?t!=t&&e!=e:function(t,e,c,a,u,l){var s=Nt(t),f=Nt(e),p="[object Array]",d="[object Array]";s||(p=(p=kt(t))==r?o:p);f||(d=(d=kt(e))==r?o:d);var h=p==o&&!O(t),y=d==o&&!O(e),b=p==d;if(b&&!h)return l||(l=new lt),s||Bt(t)?_t(t,e,c,a,u,l):function(t,e,r,o,c,a,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new V(t),new V(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ft(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case n:var l=k;case i:var s=2&a;if(l||(l=S),t.size!=e.size&&!s)return!1;var f=u.get(t);if(f)return f==e;a|=1,u.set(t,e);var p=_t(l(t),l(e),o,c,a,u);return u.delete(t),p;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,p,c,a,u,l);if(!(2&u)){var v=h&&F.call(t,"__wrapped__"),g=y&&F.call(e,"__wrapped__");if(v||g){var _=v?t.value():t,m=g?e.value():e;return l||(l=new lt),c(_,m,a,u,l)}}if(!b)return!1;return l||(l=new lt),function(t,e,r,n,o,i){var c=2&o,a=Ht(t),u=a.length,l=Ht(e).length;if(u!=l&&!c)return!1;var s=u;for(;s--;){var f=a[s];if(!(c?f in e:F.call(e,f)))return!1}var p=i.get(t);if(p&&i.get(e))return p==e;var d=!0;i.set(t,e),i.set(e,t);var h=c;for(;++s<u;){f=a[s];var y=t[f],b=e[f];if(n)var v=c?n(b,y,f,e,t,i):n(y,b,f,t,e,i);if(!(void 0===v?y===b||r(y,b,n,o,i):v)){d=!1;break}h||(h="constructor"==f)}if(d&&!h){var g=t.constructor,_=e.constructor;g==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(d=!1)}return i.delete(t),i.delete(e),d}(t,e,c,a,u,l)}(t,e,ht,c,a,u))}function yt(t){return!(!Dt(t)||(e=t,z&&z in e))&&(Vt(t)||O(t)?N:f).test(zt(t));var e}function bt(t){return"function"==typeof t?t:null==t?Gt:"object"==typeof t?Nt(t)?function(t,e){if(St(t)&&Tt(e))return Pt(It(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:pt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=St(e,t)?[e]:gt(e);var n,o=-1,i=e.length;for(;++o<i;){var c=It(e[o]);if(!(n=null!=t&&r(t,c)))break;t=t[c]}if(n)return n;return!!(i=t?t.length:0)&&Lt(i)&&At(c,i)&&(Nt(t)||Mt(t))}(t,e,dt)}(r,t):ht(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Ht(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Tt(o)]}return e}(t);if(1==e.length&&e[0][2])return Pt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,c=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(c&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=r[o])[0],l=t[u],s=a[1];if(c&&a[2]){if(void 0===l&&!(u in t))return!1}else{var f=new lt;if(n)var p=n(l,s,u,t,e,f);if(!(void 0===p?ht(s,l,n,3,f):p))return!1}}return!0}(r,t,e)}}(t):St(e=t)?(r=It(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return pt(e,t)}}(e);var e,r}function vt(t){if(!Dt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Ct(t),r=[];for(var n in t)("constructor"!=n||!e&&F.call(t,n))&&r.push(n);return r}function gt(t){return Nt(t)?t:Et(t)}function _t(t,e,r,n,o,i){var c=2&o,a=t.length,u=e.length;if(a!=u&&!(c&&u>a))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,p=1&o?new ut:void 0;for(i.set(t,e),i.set(e,t);++s<a;){var d=t[s],h=e[s];if(n)var y=c?n(h,d,s,e,t,i):n(d,h,s,t,e,i);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!x(e,(function(t,e){if(!p.has(e)&&(d===t||r(d,t,n,o,i)))return p.add(e)}))){f=!1;break}}else if(d!==h&&!r(d,h,n,o,i)){f=!1;break}}return i.delete(t),i.delete(e),f}function mt(t){return function(t,e,r){var n=e(t);return Nt(t)?n:j(n,r(t))}(t,Qt,Ot)}function wt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function jt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return yt(r)?r:void 0}it.prototype.clear=function(){this.__data__=Y?Y(null):{}},it.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},it.prototype.get=function(t){var e=this.__data__;if(Y){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return F.call(e,t)?e[t]:void 0},it.prototype.has=function(t){var e=this.__data__;return Y?void 0!==e[t]:F.call(e,t)},it.prototype.set=function(t,e){return this.__data__[t]=Y&&void 0===e?"__lodash_hash_undefined__":e,this},ct.prototype.clear=function(){this.__data__=[]},ct.prototype.delete=function(t){var e=this.__data__,r=ft(e,t);return!(r<0)&&(r==e.length-1?e.pop():$.call(e,r,1),!0)},ct.prototype.get=function(t){var e=this.__data__,r=ft(e,t);return r<0?void 0:e[r][1]},ct.prototype.has=function(t){return ft(this.__data__,t)>-1},ct.prototype.set=function(t,e){var r=this.__data__,n=ft(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new it,map:new(H||ct),string:new it}},at.prototype.delete=function(t){return wt(this,t).delete(t)},at.prototype.get=function(t){return wt(this,t).get(t)},at.prototype.has=function(t){return wt(this,t).has(t)},at.prototype.set=function(t,e){return wt(this,t).set(t,e),this},ut.prototype.add=ut.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ut.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.clear=function(){this.__data__=new ct},lt.prototype.delete=function(t){return this.__data__.delete(t)},lt.prototype.get=function(t){return this.__data__.get(t)},lt.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ct){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var xt=U?A(U,Object):Jt,Ot=U?function(t){for(var e=[];t;)j(e,xt(t)),t=L(t);return e}:Jt,kt=function(t){return M.call(t)};function At(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function St(t,e){if(Nt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Ut(t))||(a.test(t)||!c.test(t)||null!=e&&t in Object(e))}function Ct(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function Tt(t){return t==t&&!Dt(t)}function Pt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(B&&"[object DataView]"!=kt(new B(new ArrayBuffer(1)))||H&&kt(new H)!=n||Q&&"[object Promise]"!=kt(Q.resolve())||G&&kt(new G)!=i||J&&"[object WeakMap]"!=kt(new J))&&(kt=function(t){var e=M.call(t),r=e==o?t.constructor:void 0,c=r?zt(r):void 0;if(c)switch(c){case K:return"[object DataView]";case X:return n;case Z:return"[object Promise]";case tt:return i;case et:return"[object WeakMap]"}return e});var Et=qt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Ut(t))return ot?ot.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return u.test(t)&&r.push(""),t.replace(l,(function(t,e,n,o){r.push(n?o.replace(s,"$1"):e||t)})),r}));function It(t){if("string"==typeof t||Ut(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zt(t){if(null!=t){try{return q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function qt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var c=t.apply(this,n);return r.cache=i.set(o,c),c};return r.cache=new(qt.Cache||at),r}function Ft(t,e){return t===e||t!=t&&e!=e}function Mt(t){return function(t){return $t(t)&&Rt(t)}(t)&&F.call(t,"callee")&&(!D.call(t,"callee")||M.call(t)==r)}qt.Cache=at;var Nt=Array.isArray;function Rt(t){return null!=t&&Lt(t.length)&&!Vt(t)}function Vt(t){var e=Dt(t)?M.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Dt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function $t(t){return!!t&&"object"==typeof t}function Ut(t){return"symbol"==typeof t||$t(t)&&"[object Symbol]"==M.call(t)}var Wt,Bt=w?(Wt=w,function(t){return Wt(t)}):function(t){return $t(t)&&Lt(t.length)&&!!d[M.call(t)]};function Ht(t){return Rt(t)?st(t):function(t){if(!Ct(t))return W(t);var e=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}function Qt(t){return Rt(t)?st(t,!0):vt(t)}function Gt(t){return t}function Jt(){return[]}t.exports=function(t,e){return function(t,e){return null==t?{}:function(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var c=e[n],a=t[c];r(a,c)&&(i[c]=a)}return i}(t,mt(t),bt(e))}(t,function(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}(bt(e)))}}).call(this,r(14)(t))},function(t,e){t.exports=require("unfetch")},function(t,e){t.exports=require("apollo-link")},function(t,e){t.exports=require("apollo-link-http")},function(t,e){t.exports=require("apollo-link-persisted-queries")},function(t,e){t.exports=require("@times-components/schema/rnw")},function(t,e){t.exports=require("apollo-cache-inmemory")},function(t,e){t.exports=require("apollo-client")},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";r.r(e);var n=r(5);var o=()=>{let t=1024,e=768;return"undefined"!=typeof window&&(t=window.innerWidth,e=window.innerHeight),{width:t,height:e}};const i=[320,440,660,800,1080,1280,1440,1670,1920,2308],c=o().width,a=t=>i.find(e=>t<=e)||i[i.length-1],u=t=>t?n.tabletWidth:c;function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(t);!(c=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);c=!0);}catch(t){a=!0,o=t}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}(t,e)||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 s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const f=t=>t.charAt(0).toUpperCase()+t.slice(1),p=t=>{if(!t||!t.length)return 1;const e=l(t.split(":"),2),r=e[0],n=e[1],o=parseFloat(r)/parseFloat(n);return Number.isNaN(o)?1:o},d=(t,e)=>t.replace(/(<([^>]+)>)/gi,e),h=t=>{const e=t;return Object.keys(e).forEach(t=>{if("lineHeight"===t){const r=e[t];"number"==typeof r&&(e[t]="".concat(r,"px"))}}),e},y=(t,e)=>{if(e&&"#"===e.charAt(0)){t.preventDefault();const r=document.getElementById(e.substring(1));if(r){const t=r.getBoundingClientRect().top+window.pageYOffset-(()=>{const t=document.querySelector(".OrientationBar"),e=t?t.offsetHeight:0;return window.innerWidth<1024?110:window.innerWidth<1320?100+e:50+e})();window.scrollTo({top:t,behavior:"smooth"})}}},b=t=>t&&"#"===t.charAt(0)?null:t;var v=r(6),g=r.n(v);var _=t=>g()(t,t=>void 0===t||Number.isNaN(t));var m=t=>t?t.startsWith("//")?"https:".concat(t):t:null,w=r(3),j=r.n(w),x=r(1),O=r.n(x),k=(r(2),r(0)),A=r.n(k);var S=A.a.div.withConfig({displayName:"tc-view__TcView",componentId:"nuazoi-0"})(["border:0px solid black;box-sizing:border-box;display:flex;flex-direction:column;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0;"]);function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(t);!(c=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);c=!0);}catch(t){a=!0,o=t}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(t,e)}(t,e)||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 T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var P=t=>{let e=t.aspectRatio,r=t.children;const n=C(e.split(":"),2),o=n[0],i=n[1]/o*100;return O.a.createElement(S,{style:{paddingBottom:"".concat(i,"%"),position:"relative"}},O.a.createElement(S,{style:{height:"100%",position:"absolute",width:"100%"}},r))},E=t=>{let e=t.crop169,r=t.crop32,n=t.crop1251,o=t.crop11,i=t.crop45,c=t.crop23;return e||r||n||o||i||c};function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const F={aspectRatio:"1:1",displayImage:null,isVideo:!1,leadAsset:null};function M(t){let e=t.leadAsset;if(!e)return F;const r="Video"===e.__typename,n=E(r?e.posterImage:e);if(!n)return F;return{aspectRatio:n.ratio,displayImage:n,isVideo:r,leadAsset:z(z({},e),{},{isVideo:r})}}var N=r(7),R=r.n(N),V=r(8),L=r(9),D=r(10),$=r(11),U=r(12),W=r(13);var B=()=>{let t=null,e=null,r=null,n=null,o="unknown";"undefined"!=typeof window&&window.nuk&&(t=window.nuk.graphqlapi.url,e=!!window.nuk.graphqlapi.usePersistedQueries,r=window.nuk.getCookieValue("acs_tnl"),n=window.nuk.getCookieValue("sacs_tnl"),o=window.nuk.graphqlapi.clientName||o);const i={fetch:R.a,headers:{},uri:t};i.headers["content-type"]="application/x-www-form-urlencoded",i.headers.Authorization="Cookie acs_tnl=".concat(r,";sacs_tnl=").concat(n);const c=V.ApolloLink.from([e&&Object(D.createPersistedQueryLink)({useGETForHashedQueries:!0}),Object(L.createHttpLink)(i)].filter(Boolean));return new W.ApolloClient({name:"@times-components/utils (".concat(o,")"),cache:new U.InMemoryCache({fragmentMatcher:$.fragmentMatcher}),link:c})};var H=(t,e)=>t||e;const Q=t=>{const e=t.toString(16);return e.length%2?"0".concat(e):e};var G=t=>t&&t.rgba?"#".concat(Q(t.rgba.red)).concat(Q(t.rgba.green)).concat(Q(t.rgba.blue)).toUpperCase():null,J=t=>t&&t.rgba?"rgba(".concat(t.rgba.red,", ").concat(t.rgba.green,", ").concat(t.rgba.blue,", ").concat(t.rgba.alpha,")"):null;var Y=A.a.div.withConfig({displayName:"hover-icon__HoverIcon",componentId:"sc-1ge5rtz-0"})(["color:",";text-decoration-line:",";&:hover{color:",";text-decoration-line:",";}"],t=>t.colour,t=>t.underline&&"underline",t=>t.hoverColour||t.colour,t=>t.underline&&"none");class K extends x.Component{constructor(t){super(t),this.state={isClient:!1}}componentDidMount(){this.setState({isClient:!0})}render(){const t=this.state.isClient,e=this.props,r=e.client,n=e.server;return t?r&&r():n&&n()}}K.defaultProps={server:null,client:null};var X=K,Z=(t,e,r)=>{if(!t||!e||!r)return t;if(t.includes("?".concat(e))||t.includes("&".concat(e)))return t;const n=t.includes("?")?"&":"?";return"".concat(t).concat(n).concat(e,"=").concat(r)},tt=r(4),et=r.n(tt);const rt=["thetimes.co.uk/imageserver","thetimes.co.uk/tto/archive/frame","thetimes.co.uk/article","thetimes.co.uk/assets/optimizely/custom",/thetimes\.co\.uk\/([a-z0-9-]+\/)+[a-z0-9-]+-([bcdfghjklmnpqrstvwxz23567890]{9,11}$)/g],nt=[/home.(.*?)thetimes.co.uk/g,/login.(.*?)thetimes.co.uk/g];var ot=(t,e)=>t.includes("thetimes.com")&&[...rt,...nt].some(t=>e.match(t))?e.replace(".co.uk",".com"):e;var it=t=>{let e=t.data,r=t.initialNumToRender,n=t.RenderItem;if(Array.isArray(e)){const t=e.map((t,e)=>e<r?O.a.createElement("div",{role:"listitem"},n({data:t,key:e})):null);if(t.length)return O.a.createElement("div",{role:"list"},t)}return null};var ct=A.a.div.withConfig({displayName:"tc-text__TcText",componentId:"sc-15igzev-0"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]);var at=A.a.a.withConfig({displayName:"tc-text-link__TcTextLink",componentId:"sc-1voa8bp-0"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]);var ut=A.a.div.withConfig({displayName:"tc-scroll-view__TcScrollView",componentId:"sc-1sygsh3-0"})(["height:500px;overflow-y:scroll;white-space:nowrap;"]);var lt=t=>!(!t||!["times2"].includes(t.toLowerCase()));var st=t=>{const e=document.cookie.split(";").find(e=>e.includes(t));return e?e.split("=")[1]:null};var ft=t=>{const e=st(t);if(e)try{return JSON.parse(atob(e))}catch(t){return}};var pt=()=>{const t=ft("nuk_zephr_decisions");return!(!t||!t["free-access-symphony"])&&t["free-access-symphony"].includes("ARTICLE_ACCESS")};r.d(e,"acceptedWidths",(function(){return i})),r.d(e,"normaliseWidthForAssetRequestCache",(function(){return a})),r.d(e,"screenWidth",(function(){return u})),r.d(e,"capitalise",(function(){return f})),r.d(e,"ratioTextToFloat",(function(){return p})),r.d(e,"stripTags",(function(){return d})),r.d(e,"checkStylesForUnits",(function(){return h})),r.d(e,"handleOnClickScrollTo",(function(){return y})),r.d(e,"handleHrefScrollTo",(function(){return b})),r.d(e,"clean",(function(){return _})),r.d(e,"addMissingProtocol",(function(){return m})),r.d(e,"getSectionNameForAnalytics",(function(){return j.a})),r.d(e,"AspectRatioContainer",(function(){return P})),r.d(e,"getLeadAsset",(function(){return M})),r.d(e,"makeClient",(function(){return B})),r.d(e,"getStandardTemplateCrop",(function(){return E})),r.d(e,"getDimensions",(function(){return o})),r.d(e,"getHeadline",(function(){return H})),r.d(e,"gqlRgbaToHex",(function(){return G})),r.d(e,"gqlRgbaToStyle",(function(){return J})),r.d(e,"HoverIcon",(function(){return Y})),r.d(e,"ServerClientRender",(function(){return X})),r.d(e,"appendToImageURL",(function(){return Z})),r.d(e,"getSectionFromTiles",(function(){return et.a})),r.d(e,"getDomainSpecificUrl",(function(){return ot})),r.d(e,"TcView",(function(){return S})),r.d(e,"TcFlatList",(function(){return it})),r.d(e,"TcText",(function(){return ct})),r.d(e,"TcTextLink",(function(){return at})),r.d(e,"TcScrollView",(function(){return ut})),r.d(e,"CanShowPuzzleSidebar",(function(){return lt})),r.d(e,"getCookieValue",(function(){return st})),r.d(e,"getBase64CookieValue",(function(){return ft})),r.d(e,"checkForSymphonyExperiment",(function(){return pt}))}]);
|
|
1
|
+
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=15)}([function(t,e){t.exports=require("styled-components")},function(t,e){t.exports=require("react")},function(t,e){t.exports=require("prop-types")},function(t,e){t.exports=t=>{let e=t.tiles;if(!e)return null;let r=e.reduce((t,e)=>(t.push(...e.slices),t),[]).reduce((t,e)=>(t.push(...e.sections),t),[]).map(t=>t.title);r=r.filter(t=>t);const n=r.filter(t=>"news"!==t);return n.length?n[0].toLowerCase():"unknown section"}},function(t,e){const r=t=>t.slices[0].sections[0].title?t.slices[0].sections[0].title.toLowerCase():"";t.exports=t=>{return(e=t)&&e.tiles&&e.tiles.length>0?t.tiles.reduce((t,e)=>{return(n=e).slices&&n.slices.length>0&&(t=>t.slices[0].sections&&t.slices[0].sections.length>0)(e)&&r(e)?r(e):t;var n},"default"):"default";var e}},function(t,e){t.exports=require("@times-components/ts-styleguide/rnw")},function(t,e,r){(function(t){var r="[object Arguments]",n="[object Map]",o="[object Object]",i="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,u=/^\./,l=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s=/\\(\\)?/g,f=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[r]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d["[object Function]"]=d[n]=d["[object Number]"]=d[o]=d["[object RegExp]"]=d[i]=d["[object String]"]=d["[object WeakMap]"]=!1;var h="object"==typeof global&&global&&global.Object===Object&&global,y="object"==typeof self&&self&&self.Object===Object&&self,b=h||y||Function("return this")(),v=e&&!e.nodeType&&e,g=v&&"object"==typeof t&&t&&!t.nodeType&&t,_=g&&g.exports===v&&h.process,m=function(){try{return _&&_.binding("util")}catch(t){}}(),w=m&&m.isTypedArray;function j(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function x(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function O(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function k(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function A(t,e){return function(r){return t(e(r))}}function S(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var C,T=Array.prototype,P=Function.prototype,E=Object.prototype,I=b["__core-js_shared__"],z=(C=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",q=P.toString,F=E.hasOwnProperty,M=E.toString,N=RegExp("^"+q.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=b.Symbol,V=b.Uint8Array,L=A(Object.getPrototypeOf,Object),D=E.propertyIsEnumerable,$=T.splice,U=Object.getOwnPropertySymbols,W=A(Object.keys,Object),B=jt(b,"DataView"),H=jt(b,"Map"),Q=jt(b,"Promise"),G=jt(b,"Set"),J=jt(b,"WeakMap"),Y=jt(Object,"create"),K=zt(B),X=zt(H),Z=zt(Q),tt=zt(G),et=zt(J),rt=R?R.prototype:void 0,nt=rt?rt.valueOf:void 0,ot=rt?rt.toString:void 0;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function at(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){var e=-1,r=t?t.length:0;for(this.__data__=new at;++e<r;)this.add(t[e])}function lt(t){this.__data__=new ct(t)}function st(t,e){var r=Nt(t)||Mt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!e&&!F.call(t,i)||o&&("length"==i||At(i,n))||r.push(i);return r}function ft(t,e){for(var r=t.length;r--;)if(Ft(t[r][0],e))return r;return-1}function pt(t,e){for(var r=0,n=(e=St(e,t)?[e]:gt(e)).length;null!=t&&r<n;)t=t[It(e[r++])];return r&&r==n?t:void 0}function dt(t,e){return null!=t&&e in Object(t)}function ht(t,e,c,a,u){return t===e||(null==t||null==e||!Dt(t)&&!$t(e)?t!=t&&e!=e:function(t,e,c,a,u,l){var s=Nt(t),f=Nt(e),p="[object Array]",d="[object Array]";s||(p=(p=kt(t))==r?o:p);f||(d=(d=kt(e))==r?o:d);var h=p==o&&!O(t),y=d==o&&!O(e),b=p==d;if(b&&!h)return l||(l=new lt),s||Bt(t)?_t(t,e,c,a,u,l):function(t,e,r,o,c,a,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new V(t),new V(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ft(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case n:var l=k;case i:var s=2&a;if(l||(l=S),t.size!=e.size&&!s)return!1;var f=u.get(t);if(f)return f==e;a|=1,u.set(t,e);var p=_t(l(t),l(e),o,c,a,u);return u.delete(t),p;case"[object Symbol]":if(nt)return nt.call(t)==nt.call(e)}return!1}(t,e,p,c,a,u,l);if(!(2&u)){var v=h&&F.call(t,"__wrapped__"),g=y&&F.call(e,"__wrapped__");if(v||g){var _=v?t.value():t,m=g?e.value():e;return l||(l=new lt),c(_,m,a,u,l)}}if(!b)return!1;return l||(l=new lt),function(t,e,r,n,o,i){var c=2&o,a=Ht(t),u=a.length,l=Ht(e).length;if(u!=l&&!c)return!1;var s=u;for(;s--;){var f=a[s];if(!(c?f in e:F.call(e,f)))return!1}var p=i.get(t);if(p&&i.get(e))return p==e;var d=!0;i.set(t,e),i.set(e,t);var h=c;for(;++s<u;){f=a[s];var y=t[f],b=e[f];if(n)var v=c?n(b,y,f,e,t,i):n(y,b,f,t,e,i);if(!(void 0===v?y===b||r(y,b,n,o,i):v)){d=!1;break}h||(h="constructor"==f)}if(d&&!h){var g=t.constructor,_=e.constructor;g==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(d=!1)}return i.delete(t),i.delete(e),d}(t,e,c,a,u,l)}(t,e,ht,c,a,u))}function yt(t){return!(!Dt(t)||(e=t,z&&z in e))&&(Vt(t)||O(t)?N:f).test(zt(t));var e}function bt(t){return"function"==typeof t?t:null==t?Gt:"object"==typeof t?Nt(t)?function(t,e){if(St(t)&&Tt(e))return Pt(It(t),e);return function(r){var n=function(t,e,r){var n=null==t?void 0:pt(t,e);return void 0===n?r:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){e=St(e,t)?[e]:gt(e);var n,o=-1,i=e.length;for(;++o<i;){var c=It(e[o]);if(!(n=null!=t&&r(t,c)))break;t=t[c]}if(n)return n;return!!(i=t?t.length:0)&&Lt(i)&&At(c,i)&&(Nt(t)||Mt(t))}(t,e,dt)}(r,t):ht(e,n,void 0,3)}}(t[0],t[1]):function(t){var e=function(t){var e=Ht(t),r=e.length;for(;r--;){var n=e[r],o=t[n];e[r]=[n,o,Tt(o)]}return e}(t);if(1==e.length&&e[0][2])return Pt(e[0][0],e[0][1]);return function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,c=!n;if(null==t)return!i;for(t=Object(t);o--;){var a=r[o];if(c&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<i;){var u=(a=r[o])[0],l=t[u],s=a[1];if(c&&a[2]){if(void 0===l&&!(u in t))return!1}else{var f=new lt;if(n)var p=n(l,s,u,t,e,f);if(!(void 0===p?ht(s,l,n,3,f):p))return!1}}return!0}(r,t,e)}}(t):St(e=t)?(r=It(e),function(t){return null==t?void 0:t[r]}):function(t){return function(e){return pt(e,t)}}(e);var e,r}function vt(t){if(!Dt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=Ct(t),r=[];for(var n in t)("constructor"!=n||!e&&F.call(t,n))&&r.push(n);return r}function gt(t){return Nt(t)?t:Et(t)}function _t(t,e,r,n,o,i){var c=2&o,a=t.length,u=e.length;if(a!=u&&!(c&&u>a))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var s=-1,f=!0,p=1&o?new ut:void 0;for(i.set(t,e),i.set(e,t);++s<a;){var d=t[s],h=e[s];if(n)var y=c?n(h,d,s,e,t,i):n(d,h,s,t,e,i);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!x(e,(function(t,e){if(!p.has(e)&&(d===t||r(d,t,n,o,i)))return p.add(e)}))){f=!1;break}}else if(d!==h&&!r(d,h,n,o,i)){f=!1;break}}return i.delete(t),i.delete(e),f}function mt(t){return function(t,e,r){var n=e(t);return Nt(t)?n:j(n,r(t))}(t,Qt,Ot)}function wt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function jt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return yt(r)?r:void 0}it.prototype.clear=function(){this.__data__=Y?Y(null):{}},it.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},it.prototype.get=function(t){var e=this.__data__;if(Y){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return F.call(e,t)?e[t]:void 0},it.prototype.has=function(t){var e=this.__data__;return Y?void 0!==e[t]:F.call(e,t)},it.prototype.set=function(t,e){return this.__data__[t]=Y&&void 0===e?"__lodash_hash_undefined__":e,this},ct.prototype.clear=function(){this.__data__=[]},ct.prototype.delete=function(t){var e=this.__data__,r=ft(e,t);return!(r<0)&&(r==e.length-1?e.pop():$.call(e,r,1),!0)},ct.prototype.get=function(t){var e=this.__data__,r=ft(e,t);return r<0?void 0:e[r][1]},ct.prototype.has=function(t){return ft(this.__data__,t)>-1},ct.prototype.set=function(t,e){var r=this.__data__,n=ft(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},at.prototype.clear=function(){this.__data__={hash:new it,map:new(H||ct),string:new it}},at.prototype.delete=function(t){return wt(this,t).delete(t)},at.prototype.get=function(t){return wt(this,t).get(t)},at.prototype.has=function(t){return wt(this,t).has(t)},at.prototype.set=function(t,e){return wt(this,t).set(t,e),this},ut.prototype.add=ut.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ut.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.clear=function(){this.__data__=new ct},lt.prototype.delete=function(t){return this.__data__.delete(t)},lt.prototype.get=function(t){return this.__data__.get(t)},lt.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof ct){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this;r=this.__data__=new at(n)}return r.set(t,e),this};var xt=U?A(U,Object):Jt,Ot=U?function(t){for(var e=[];t;)j(e,xt(t)),t=L(t);return e}:Jt,kt=function(t){return M.call(t)};function At(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||p.test(t))&&t>-1&&t%1==0&&t<e}function St(t,e){if(Nt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Ut(t))||(a.test(t)||!c.test(t)||null!=e&&t in Object(e))}function Ct(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function Tt(t){return t==t&&!Dt(t)}function Pt(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}(B&&"[object DataView]"!=kt(new B(new ArrayBuffer(1)))||H&&kt(new H)!=n||Q&&"[object Promise]"!=kt(Q.resolve())||G&&kt(new G)!=i||J&&"[object WeakMap]"!=kt(new J))&&(kt=function(t){var e=M.call(t),r=e==o?t.constructor:void 0,c=r?zt(r):void 0;if(c)switch(c){case K:return"[object DataView]";case X:return n;case Z:return"[object Promise]";case tt:return i;case et:return"[object WeakMap]"}return e});var Et=qt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Ut(t))return ot?ot.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return u.test(t)&&r.push(""),t.replace(l,(function(t,e,n,o){r.push(n?o.replace(s,"$1"):e||t)})),r}));function It(t){if("string"==typeof t||Ut(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zt(t){if(null!=t){try{return q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function qt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var c=t.apply(this,n);return r.cache=i.set(o,c),c};return r.cache=new(qt.Cache||at),r}function Ft(t,e){return t===e||t!=t&&e!=e}function Mt(t){return function(t){return $t(t)&&Rt(t)}(t)&&F.call(t,"callee")&&(!D.call(t,"callee")||M.call(t)==r)}qt.Cache=at;var Nt=Array.isArray;function Rt(t){return null!=t&&Lt(t.length)&&!Vt(t)}function Vt(t){var e=Dt(t)?M.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Dt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function $t(t){return!!t&&"object"==typeof t}function Ut(t){return"symbol"==typeof t||$t(t)&&"[object Symbol]"==M.call(t)}var Wt,Bt=w?(Wt=w,function(t){return Wt(t)}):function(t){return $t(t)&&Lt(t.length)&&!!d[M.call(t)]};function Ht(t){return Rt(t)?st(t):function(t){if(!Ct(t))return W(t);var e=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}function Qt(t){return Rt(t)?st(t,!0):vt(t)}function Gt(t){return t}function Jt(){return[]}t.exports=function(t,e){return function(t,e){return null==t?{}:function(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var c=e[n],a=t[c];r(a,c)&&(i[c]=a)}return i}(t,mt(t),bt(e))}(t,function(t){if("function"!=typeof t)throw new TypeError("Expected a function");return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}(bt(e)))}}).call(this,r(14)(t))},function(t,e){t.exports=require("unfetch")},function(t,e){t.exports=require("apollo-link")},function(t,e){t.exports=require("apollo-link-http")},function(t,e){t.exports=require("apollo-link-persisted-queries")},function(t,e){t.exports=require("@times-components/schema/rnw")},function(t,e){t.exports=require("apollo-cache-inmemory")},function(t,e){t.exports=require("apollo-client")},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";r.r(e);var n=r(5);var o=()=>{let t=1024,e=768;return"undefined"!=typeof window&&(t=window.innerWidth,e=window.innerHeight),{width:t,height:e}};const i=[320,440,660,800,1080,1280,1440,1670,1920,2308],c=o().width,a=t=>i.find(e=>t<=e)||i[i.length-1],u=t=>t?n.tabletWidth:c;function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(t);!(c=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);c=!0);}catch(t){a=!0,o=t}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}(t,e)||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 s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const f=t=>t.charAt(0).toUpperCase()+t.slice(1),p=t=>{if(!t||!t.length)return 1;const e=l(t.split(":"),2),r=e[0],n=e[1],o=parseFloat(r)/parseFloat(n);return Number.isNaN(o)?1:o},d=(t,e)=>t.replace(/(<([^>]+)>)/gi,e),h=t=>{const e=t;return Object.keys(e).forEach(t=>{if("lineHeight"===t){const r=e[t];"number"==typeof r&&(e[t]="".concat(r,"px"))}}),e},y=(t,e)=>{if(e&&"#"===e.charAt(0)){t.preventDefault();const r=document.getElementById(e.substring(1));if(r){const t=r.getBoundingClientRect().top+window.pageYOffset-(()=>{const t=document.querySelector(".OrientationBar"),e=t?t.offsetHeight:0;return window.innerWidth<1024?110:window.innerWidth<1320?100+e:50+e})();window.scrollTo({top:t,behavior:"smooth"})}}},b=t=>t&&"#"===t.charAt(0)?null:t;var v=r(6),g=r.n(v);var _=t=>g()(t,t=>void 0===t||Number.isNaN(t));var m=t=>t?t.startsWith("//")?"https:".concat(t):t:null,w=r(3),j=r.n(w),x=r(1),O=r.n(x),k=(r(2),r(0)),A=r.n(k);var S=A.a.div.withConfig({displayName:"tc-view__TcView",componentId:"nuazoi-0"})(["border:0px solid black;box-sizing:border-box;display:flex;flex-direction:column;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;z-index:0;"]);function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==r)return;var n,o,i=[],c=!0,a=!1;try{for(r=r.call(t);!(c=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);c=!0);}catch(t){a=!0,o=t}finally{try{c||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(t,e)}(t,e)||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 T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var P=t=>{let e=t.aspectRatio,r=t.children;const n=C(e.split(":"),2),o=n[0],i=n[1]/o*100;return O.a.createElement(S,{style:{paddingBottom:"".concat(i,"%"),position:"relative"}},O.a.createElement(S,{style:{height:"100%",position:"absolute",width:"100%"}},r))},E=t=>{let e=t.crop169,r=t.crop32,n=t.crop1251,o=t.crop11,i=t.crop45,c=t.crop23;return e||r||n||o||i||c};function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const F={aspectRatio:"1:1",displayImage:null,isVideo:!1,leadAsset:null};function M(t){let e=t.leadAsset;if(!e)return F;const r="Video"===e.__typename,n=E(r?e.posterImage:e);if(!n)return F;return{aspectRatio:n.ratio,displayImage:n,isVideo:r,leadAsset:z(z({},e),{},{isVideo:r})}}var N=r(7),R=r.n(N),V=r(8),L=r(9),D=r(10),$=r(11),U=r(12),W=r(13);var B=()=>{let t=null,e=null,r=null,n=null,o="unknown";"undefined"!=typeof window&&window.nuk&&(t=window.nuk.graphqlapi.url,e=!!window.nuk.graphqlapi.usePersistedQueries,r=window.nuk.getCookieValue("acs_tnl"),n=window.nuk.getCookieValue("sacs_tnl"),o=window.nuk.graphqlapi.clientName||o);const i={fetch:R.a,headers:{},uri:t};i.headers["content-type"]="application/x-www-form-urlencoded",i.headers.Authorization="Cookie acs_tnl=".concat(r,";sacs_tnl=").concat(n);const c=V.ApolloLink.from([e&&Object(D.createPersistedQueryLink)({useGETForHashedQueries:!0}),Object(L.createHttpLink)(i)].filter(Boolean));return new W.ApolloClient({name:"@times-components/utils (".concat(o,")"),cache:new U.InMemoryCache({fragmentMatcher:$.fragmentMatcher}),link:c})};var H=(t,e)=>t||e;const Q=t=>{const e=t.toString(16);return e.length%2?"0".concat(e):e};var G=t=>t&&t.rgba?"#".concat(Q(t.rgba.red)).concat(Q(t.rgba.green)).concat(Q(t.rgba.blue)).toUpperCase():null,J=t=>t&&t.rgba?"rgba(".concat(t.rgba.red,", ").concat(t.rgba.green,", ").concat(t.rgba.blue,", ").concat(t.rgba.alpha,")"):null;var Y=A.a.div.withConfig({displayName:"hover-icon__HoverIcon",componentId:"sc-1ge5rtz-0"})(["color:",";text-decoration-line:",";&:hover{color:",";text-decoration-line:",";}"],t=>t.colour,t=>t.underline&&"underline",t=>t.hoverColour||t.colour,t=>t.underline&&"none");class K extends x.Component{constructor(t){super(t),this.state={isClient:!1}}componentDidMount(){this.setState({isClient:!0})}render(){const t=this.state.isClient,e=this.props,r=e.client,n=e.server;return t?r&&r():n&&n()}}K.defaultProps={server:null,client:null};var X=K,Z=(t,e,r)=>{if(!t||!e||!r)return t;if(t.includes("?".concat(e))||t.includes("&".concat(e)))return t;const n=t.includes("?")?"&":"?";return"".concat(t).concat(n).concat(e,"=").concat(r)},tt=r(4),et=r.n(tt);const rt=["thetimes.co.uk/imageserver","thetimes.co.uk/tto/archive/frame","thetimes.co.uk/article","thetimes.co.uk/assets/optimizely/custom",/thetimes\.co\.uk\/([a-z0-9-]+\/)+[a-z0-9-]+-([bcdfghjklmnpqrstvwxz23567890]{9,11}$)/g],nt=[/home.(.*?)thetimes.co.uk/g,/login.(.*?)thetimes.co.uk/g];var ot=(t,e)=>t.includes("thetimes.com")&&[...rt,...nt].some(t=>e.match(t))?e.replace(".co.uk",".com"):e;var it=t=>{let e=t.data,r=t.initialNumToRender,n=t.RenderItem;if(Array.isArray(e)){const t=e.map((t,e)=>e<r?O.a.createElement("div",{role:"listitem"},n({data:t,key:e})):null);if(t.length)return O.a.createElement("div",{role:"list"},t)}return null};var ct=A.a.div.withConfig({displayName:"tc-text__TcText",componentId:"sc-15igzev-0"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]);var at=A.a.a.withConfig({displayName:"tc-text-link__TcTextLink",componentId:"sc-1voa8bp-0"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]);var ut=A.a.div.withConfig({displayName:"tc-scroll-view__TcScrollView",componentId:"sc-1sygsh3-0"})(["height:500px;overflow-y:scroll;white-space:nowrap;"]);var lt=(t,e)=>{let r;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];clearTimeout(r),r=setTimeout(()=>{t(...o)},e)}};var st=t=>!(!t||!["times2"].includes(t.toLowerCase()));var ft=t=>{const e=document.cookie.split(";").find(e=>e.includes(t));return e?e.split("=")[1]:null};var pt=t=>{const e=ft(t);if(e)try{return JSON.parse(atob(e))}catch(t){return}};var dt=()=>{const t=pt("nuk_zephr_decisions");return!(!t||!t["free-access-symphony"])&&t["free-access-symphony"].includes("ARTICLE_ACCESS")};r.d(e,"acceptedWidths",(function(){return i})),r.d(e,"normaliseWidthForAssetRequestCache",(function(){return a})),r.d(e,"screenWidth",(function(){return u})),r.d(e,"capitalise",(function(){return f})),r.d(e,"ratioTextToFloat",(function(){return p})),r.d(e,"stripTags",(function(){return d})),r.d(e,"checkStylesForUnits",(function(){return h})),r.d(e,"handleOnClickScrollTo",(function(){return y})),r.d(e,"handleHrefScrollTo",(function(){return b})),r.d(e,"clean",(function(){return _})),r.d(e,"addMissingProtocol",(function(){return m})),r.d(e,"getSectionNameForAnalytics",(function(){return j.a})),r.d(e,"AspectRatioContainer",(function(){return P})),r.d(e,"getLeadAsset",(function(){return M})),r.d(e,"makeClient",(function(){return B})),r.d(e,"getStandardTemplateCrop",(function(){return E})),r.d(e,"getDimensions",(function(){return o})),r.d(e,"getHeadline",(function(){return H})),r.d(e,"gqlRgbaToHex",(function(){return G})),r.d(e,"gqlRgbaToStyle",(function(){return J})),r.d(e,"HoverIcon",(function(){return Y})),r.d(e,"ServerClientRender",(function(){return X})),r.d(e,"appendToImageURL",(function(){return Z})),r.d(e,"getSectionFromTiles",(function(){return et.a})),r.d(e,"getDomainSpecificUrl",(function(){return ot})),r.d(e,"TcView",(function(){return S})),r.d(e,"TcFlatList",(function(){return it})),r.d(e,"TcText",(function(){return ct})),r.d(e,"TcTextLink",(function(){return at})),r.d(e,"TcScrollView",(function(){return ut})),r.d(e,"debounce",(function(){return lt})),r.d(e,"CanShowPuzzleSidebar",(function(){return st})),r.d(e,"getCookieValue",(function(){return ft})),r.d(e,"getBase64CookieValue",(function(){return pt})),r.d(e,"checkForSymphonyExperiment",(function(){return dt}))}]);
|