@20minutes/tyr 2.45.1 → 2.45.3
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/dist/index.es.js +8805 -8785
- package/dist/index.umd.js +61 -61
- package/dist/js/main.min.js +5 -5
- package/dist/js/piano.min.js +1 -1
- package/dist/types/EnvVariablesType.d.ts +1 -0
- package/package.json +11 -11
package/dist/js/piano.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";var e=(e=>(e.ARCHIVE_BY_DAY="archivebyday",e.ARCHIVE_BY_YEAR="archivebyyear",e.ARTICLE="article",e.ASTRO="astro",e.ASTRO_HOME="astrohome",e.CONTACT="contact",e.DIRECT="direct",e.ELECTIONS="elections",e.ELECTIONSHOME="electionshome",e.GAME="game",e.GAME_APP="gameapp",e.GAMEHOME="gamehome",e.HOME="home",e.JOB_DETAILS="jobdetails",e.JOBS="jobs",e.JOURNALIST="journalist",e.LA21E="la21e",e.LEGAL="legal",e.LEGALNOTICE="legalnotice",e.LEGALNOTICEHOME="legalnoticehome",e.LEGALNOTICEDEPARTMENT="legalnoticedepartment",e.LIVE="live",e.MOBILE_APPS="mobileapps",e.MOST_COMMENTED="mostcommented",e.MOST_READ="mostread",e.MOST_SHARED="mostshared",e.MOST_VIEWED="mostviewed",e.MOVIES="movies",e.NEWS="news",e.PARTNER="partner",e.PROGRAMME_TV_CHANNEL="programmetvchannel",e.PROGRAMME_TV_HOME="programmetvhome",e.PROGRAMME_TV_NOW="programmetvnow",e.PROGRAMME_TV_PROGRAM="programmetvprogram",e.PROGRAMME_TV_TOMORROW="programmetvtomorrow",e.REWIND="rewind",e.SEARCH="search",e.SECTION="section",e.SERVICE="service",e.SITEMAP="sitemap",e.SPORT="sport",e.STORY="story",e.TAG="tag",e.TRAFFIC="traffic",e.TV_HOME="tvhome",e.TV_LIVE="tvlive",e.TV_MOST_RECENT="tvmostrecent",e.TV_MOST_VIEWED="tvmostviewed",e.TV_SHOW="tvshow",e.TV_SHOWS="tvshows",e.TV_VIDEO="tvvideo",e.WEATHER="weather",e))(e||{});class t extends Error{}t.prototype.name="InvalidTokenError";var n=(e=>(e.down="down",e.heart="heart",e.laughing="laughing",e.sad="sad",e.shock="shock",e.up="up",e))(n||{});n.up,n.down,n.sad,n.heart,n.laughing,n.shock;const a=(e,t)=>{let n=e.toLowerCase().replace(/[\s-]+/g,"-");return n=(e=>{let t=e;const n="ãàáäâẽèéëêìíïîõòóöôùúüûñç·/,:;";for(let e=0;e<30;e+=1)t=t.replace(new RegExp(n.charAt(e),"g"),"aaaaaeeeeeiiiiooooouuuunc-----".charAt(e));return t})(n),n.replace(/[^\w-]+/g,"").replace(/-*$/g,"")},o=()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e.entries())},i=["chapter1","chapter2","chapter3","chapter4"],r=()=>document.querySelectorAll(".c-content > p").length,s=()=>[...document.querySelectorAll(".c-content > p")].reduce((e,t)=>e+t.innerHTML.length,0),c=()=>{const e={},t=o();return("utm_source"in t||"utm_campaign"in t||"utm_medium"in t)&&("utm_source"in t||(e.utm_source=t.utm_medium??t.utm_campaign),"utm_campaign"in t||(e.utm_campaign=t.utm_source??t.utm_medium),"utm_medium"in t||(e.utm_medium=t.utm_source??t.utm_campaign)),e},d=()=>{const e=window.datalayerInfo,t={};e?.breadcrumb?.forEach((e,t)=>{let n=a(e);"diaporamas"===n&&(n="diaporama"),"actualite"===n&&(n="actu-generale"),"guide-dachat"===n&&(n="guide-achat");const o=i[t];o&&window.PianoPageInfo&&(window.PianoPageInfo[o]=n)});const n=Number(e?.contentId);Number.isFinite(n)&&(t["n:content_id"]=n),t.content_type=e?.pageName??"other",t["s:page_type"]="content",t["d:content_published_date"]=e?.modificationDate?new Date(e.modificationDate).toISOString():"",t["d:content_modified_date"]=e?.publicationDate?new Date(e.publicationDate).toISOString():"";const o=Number(e?.journalist?.id);return Number.isFinite(o)&&(t["n:content_id_journaliste"]=o),t["s:content_tags"]=e?.tagsSlug??"",t["s:content_signature"]=a(e?.signature??""),t["s:content_title"]=a(e?.contentTitle??""),t["n:content_title_characters_number"]=Number(e?.contentTitle?.length)||0,t["s:content_subtype"]="texte",t["n:content_video_number"]=e?.videoCount??0,t["n:content_20min_video_number"]=e?.video20mnCount??0,t["n:content_embed_number"]=e?.embedCount??0,e?.podcastCount&&e?.podcastCount>0?t["s:content_subtype"]="podcast":t["n:content_video_number"]>0&&(t["s:content_subtype"]="video"),t},p=(e,t,n,a)=>(window.PianoPageInfo&&(t&&(window.PianoPageInfo.chapter1=t),n&&(window.PianoPageInfo.chapter2=n),a&&(window.PianoPageInfo.chapter3=a)),e?{"s:page_type":e}:{}),u=()=>{const e=window.datalayerInfo,t={};t["b:user_adblock"]=!window.adsapp,t.page_url=e?.pageUri??"",window.PianoPageInfo&&(window.PianoPageInfo.name=new URL(window.location.href).pathname,e?.pageUri&&(window.PianoPageInfo.name=new URL(e.pageUri).pathname)),e?.contentSource&&(t["s:content_source"]=e.contentSource),document.referrer&&(t["s:misc_referrer"]=document.referrer),t["s:page_type"]=e?.pageName||"other";const n=document.querySelector("link[rel='canonical']");if(n&&(t["s:page_canonical"]=n.getAttribute("href")??""),"/search"===e?.pageUri){const e=o();t["s:misc_search"]=e.q||""}return window.performance&&(t.navigation_method=window.performance.getEntriesByType?.("navigation")?.map(e=>e.type)?.pop()||null),{...t,...c()}},l=()=>{switch(window.datalayerInfo?.pageName||"other"){case e.ARCHIVE_BY_DAY:case e.ARCHIVE_BY_YEAR:return p("divers");case e.ARTICLE:return(()=>{const e=d();return e["n:content_characters_number"]=Number(s()),e["n:content_paragraphs_number"]=r(),e})();case e.ASTRO_HOME:return"numerology"===window.datalayerInfo?.pageKey?p("home_numerologie","services","numerologie"):p("home_horoscope","services","horoscope");case e.ASTRO:return["un","deux","trois","quatre","cinq","six","sept","huit","neuf"].includes(window.datalayerInfo?.pageKey||"")?p("numerologie","services","numerologie"):p("horoscope","services","horoscope");case e.DIRECT:return p("divers","le-direct");case e.ELECTIONS:case e.ELECTIONSHOME:return(()=>{const{national:e,region:t,department:n,constituency:a,town:o}=window.datalayerInfo?.elections||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1="elections",window.PianoPageInfo.chapter2="resultats",o&&n?(window.PianoPageInfo.chapter3=n,window.PianoPageInfo.chapter4=o):a&&n?(window.PianoPageInfo.chapter3=n,window.PianoPageInfo.chapter4=a):n&&t?(window.PianoPageInfo.chapter3=t,window.PianoPageInfo.chapter4=n):t?(window.PianoPageInfo.chapter3="france",window.PianoPageInfo.chapter4=t):e&&(window.PianoPageInfo.chapter3=e)),{"s:page_type":"elections"}})();case e.HOME:return window.PianoPageInfo&&(window.PianoPageInfo.chapter1="accueil",window.PianoPageInfo.chapter2=""),{"s:page_type":"home","s:content_source":"20mn",content_type:null};case e.GAME:return p(void 0,"services","jeux",window.datalayerInfo?.pageKey);case e.GAME_APP:return(()=>{p(void 0,"services","jeux",window.datalayerInfo?.pageKey);const e=d();return e["s:page_type"]="home_game",window.datalayerInfo?.pageKey&&(e["s:page_type"]="game"),e})();case e.GAMEHOME:return p("home_game","services","jeux");case e.JOB_DETAILS:return(()=>{const{pageKey:e,tagsSlug:t="",contentTitle:n="",embedCount:a=0,videoCount:o=0,video20mnCount:i=0}=window.datalayerInfo||{};return{"s:content_source":"labsense","s:page_type":"content",content_type:"card","s:content_tags":t,"s:content_signature":"","s:content_title":n,"s:content_subtype":"job","n:content_id":Number(e),"n:content_id_journaliste":0,"n:content_title_characters_number":Number(n.length)||0,"n:content_video_number":o,"n:content_20min_video_number":i,"n:content_embed_number":a,"n:content_characters_number":Number(s()),"n:content_paragraphs_number":r(),"d:content_published_date":"","d:content_modified_date":""}})();case e.JOBS:return p("home_tag",window.datalayerInfo?.pageKey,"");case e.JOURNALIST:return(()=>{const{firstName:e,lastName:t}=window.datalayerInfo?.journalist||{};return e&&t&&window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`journaliste--${e}-${t}`),{"s:page_type":"journalist"}})();case e.LA21E:return p("divers","focus--accueil");case e.LEGALNOTICE:return(()=>{const{contentTitle:e}=window.datalayerInfo||{};return e&&window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`legal-announcement--${e}`),{"s:page_type":"legal_notice"}})();case e.LEGALNOTICEDEPARTMENT:return(()=>{const{contentTitle:e}=window.datalayerInfo||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`legal-announcement-list--${e}`),{"s:page_type":"legal_notice_department"}})();case e.LEGALNOTICEHOME:return p("legal_notice_home","legal-announcement-list");case e.LEGAL:return(()=>{const{pageKey:e}=window.datalayerInfo||{};if(window.PianoPageInfo)switch(e){case"cookies":window.PianoPageInfo.chapter1="gestion-cookies";break;case"privacy":window.PianoPageInfo.chapter1="politique-protection-donnees-personnelles";break;default:window.PianoPageInfo.chapter1=e}return{"s:page_type":"divers"}})();case e.LIVE:return(()=>{const e=d();return e["n:content_paragraphs_number"]=window.datalayerInfo?.livePosts??0,e})();case e.MOBILE_APPS:return p("divers","mobile");case e.MOST_COMMENTED:return p("most_commented");case e.MOST_READ:return p("most_read");case e.MOST_SHARED:return p("most_shared");case e.MOST_VIEWED:return p("home_tag");case e.MOVIES:return p("divers","entertainment","cinema");case e.NEWS:return p("divers","a-la-une");case e.TAG:return p("home_tag",window.datalayerInfo?.pageKey,"");case e.SITEMAP:return p("divers","plan-site");case e.SPORT:return(()=>{const{breadcrumb:e=[]}=window.datalayerInfo||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1=e.shift(),window.PianoPageInfo.chapter2=e.shift(),window.PianoPageInfo.chapter3=e.shift(),window.PianoPageInfo.chapter4=e.shift()),{"s:page_type":"divers"}})();case e.STORY:return(()=>{const e=d();return e["s:content_subtype"]=window.datalayerInfo?.subType??"",e})();case e.SERVICE:return p("divers","pratique");case e.TRAFFIC:return p("infos_trafic");case e.TV_HOME:return p("home_tv","tv");case e.TV_LIVE:return p("home_tv_live","tv");case e.TV_MOST_RECENT:return p("tv_divers","tv","videos-recentes");case e.TV_MOST_VIEWED:return p("tv_divers","tv","videos-plus-vues");case e.TV_SHOW:return p("home_tv_show","tv",window.datalayerInfo?.pageKey);case e.TV_SHOWS:return p("tv_divers","tv","emissions");case e.TV_VIDEO:return(()=>{window.PianoPageInfo&&(window.PianoPageInfo.chapter1="tv");const e=d();return e.content_type="page",e["s:content_subtype"]="video",e})();case e.WEATHER:return p("previsions-meteo-france");default:return{}}};let g=-1;const m=()=>g,_=e=>{addEventListener("pageshow",t=>{t.persisted&&(g=t.timeStamp,e(t))},!0)},h=(e,t,n,a)=>{let o,i;return r=>{t.value>=0&&(r||a)&&(i=t.value-(o??0),(i||void 0===o)&&(o=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},w=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},f=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},v=()=>f()?.activationStart??0;let I=-1;const P=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,T=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of P)e();isFinite(I)||(I="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",T,!0))}},E=(e=!1)=>{if(e&&(I=1/0),I<0){const e=v(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;I=t??y(),addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0),_(()=>{setTimeout(()=>{I=y()})})}return{get firstHiddenTime(){return I},onHidden(e){P.add(e)}}},b=(e,t=-1,n,a=0,o,i,r)=>{const s=f(),c=s?.navigationId||0;let d="navigate";return n?d=n:m()>=0?d="back-forward-cache":s&&(document.prerendering||v()>0?d="prerender":document.wasDiscarded?d="restore":s.type&&(d=s.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:d,navigationId:a||c,navigationInteractionId:o,navigationURL:i||s?.name,navigationStartTime:r||0}},O=new WeakMap;function A(e,t){let n=O.get(t);return n||(n=new WeakMap,O.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}class S{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const C=(e,t,n={})=>{try{const a=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(a.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();a.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of a)e.observe({type:t,buffered:!0,...n});return e}}catch{}},M=e=>globalThis.PerformanceObserver?.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,N=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},L=e=>{let t=!1;return()=>{t||(e(),t=!0)}};class R{l}const k=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},V=[1800,3e3],H=(e,t={})=>{const n=M(t);k(()=>{const a=A(t,R),o=E();let i,r=b("FCP");const s=C(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<o.firstHiddenTime&&(r.value=Math.max(t.startTime-v(),0),r.entries.push(t),r.navigationId=t.navigationId||r.navigationId,i(!0)))});s&&(i=h(e,r,V,t.reportAllChanges),_(n=>{r=b("FCP",-1,"back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,m()),i=h(e,r,V,t.reportAllChanges),w(()=>{r.value=performance.now()-n.timeStamp,i(!0)})})),n&&C(["soft-navigation"],n=>{n.forEach(n=>{a.l&&n.navigationId&&N(a.l,n);const o=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);r=b("FCP",o,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),i=h(e,r,V,t.reportAllChanges),i(!0)})},t)})},D=[.1,.25];let q=0,j=1/0,x=0;const G=e=>{for(const t of e)t.interactionId&&(j=Math.min(j,t.interactionId),x=Math.max(x,t.interactionId),q=x?(x-j)/7+1:0)};let U;const W=()=>U?q:performance.interactionCount??0;class B{u=0;v=[];p=new Map;m;T;_(){return W()-this.u}M(){this.u=W(),this.v.length=0,this.p.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.v.at(-1);let n=this.p.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.p.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.p.delete(t.id)}this.T?.(n)}}}const F=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,a=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const o=L(e);let i=-1;const r=()=>{a(i),o()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),i=n(()=>{removeEventListener("visibilitychange",r,{capture:!0}),o()},{timeout:t})}},Y=[200,500],$=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=E();k(()=>{"interactionCount"in performance||U||(U=C(["event"],G,{durationThreshold:0}));let a,o=b("INP");const i=A(t,B),r=(n,r,s,c,d)=>{i.M(),o=b("INP",-1,n,r,s,c,d),a=h(e,o,Y,t.reportAllChanges)},s=()=>{const e=i.L(o.navigationType);e&&e.P!==o.value&&(o.value=e.P,o.entries=e.entries,a())},c=e=>{s(),a(!0),r("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},d=(e,t=!1)=>{F(()=>{for(const t of e)"soft-navigation"!==t.entryType?i.h(t):c(t);s(),t&&a(!0)})},p=["event","first-input"];M(t)&&p.push("soft-navigation");const u=C(p,d,{...t,durationThreshold:t.durationThreshold??40});a=h(e,o,Y,t.reportAllChanges),u&&(n.onHidden(()=>{d(u.takeRecords(),!0)}),_(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,m())}))})};class K{m;l;h(e){this.m?.(e)}}const J=[2500,4e3],z=e=>{const t={click:a(e.name),click_chapter1:e?.chapter1||null,click_chapter2:e?.chapter2||null,click_chapter3:e?.chapter3||null},n=`click.${e.type}`;if(window.pa?(e.customProps&&Object.keys(e.customProps).length>0&&window.pa.setProperties(e.customProps,{persistent:!1,events:[n]}),window.pa.sendEvent(n,t)):window._paq&&(e.customProps&&Object.keys(e.customProps).length>0&&window._paq.push(["setProperties",e.customProps,{persistent:!1,events:[n]}]),window._paq.push(["sendEvent",n,t])),!window.edgee?.track)return;const o=document.getElementById("__EDGEE_DATA_LAYER__");let i={};if(o)try{const e=JSON.parse(o.textContent||"");e.data_collection.context=e.data_collection.context||{},i=e.data_collection.context.page?.properties||{}}catch{i={}}window.edgee.track({name:n,properties:{...i,click:t.click,click_chapter1:t.click_chapter1,click_chapter2:t.click_chapter2,click_chapter3:t.click_chapter3,click_type:e?.type??"navigation",...e.customProps}},{"edgee/piano-analytics":!0})},X=e=>{window._paq&&window._paq.push(["sendEvent","page.display",{page:e?.name??window.PianoPageInfo?.name,page_chapter1:e?.chapter1??window.PianoPageInfo?.chapter1,page_chapter2:e?.chapter2??window.PianoPageInfo?.chapter2,page_chapter3:e?.chapter3??window.PianoPageInfo?.chapter3,page_chapter4:e?.chapter4??window.PianoPageInfo?.chapter4}]),window.edgee?.page&&!1!==e?.enableEdgee&&window.edgee.page()},Q=()=>{if(!(100*Math.random()<=15))return;const e=new Set;((e,t={})=>{const n=E();H(L(()=>{let a,o=b("CLS",0);const i=A(t,S),r=(n,r,s,c,d)=>{o=b("CLS",0,n,r,s,c,d),i.i=0,a=h(e,o,D,t.reportAllChanges)},s=(e=!1)=>{i.i>o.value&&(o.value=i.i,o.entries=i.o),a(e)},c=e=>{s(!0),r("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},d=e=>{for(const t of e)"soft-navigation"!==t.entryType?i.h(t):c(t);s()},p=["layout-shift"];M(t)&&p.push("soft-navigation");const u=C(p,d);u&&(a=h(e,o,D,t.reportAllChanges),n.onHidden(()=>{d(u.takeRecords()),a(!0)}),_(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,m()),w(a)}),setTimeout(a))}))})(t=>{e.add(t)}),$(t=>{e.add(t)}),((e,t={})=>{let n=!1;const a=M(t);k(()=>{let o,i=E(),r=b("LCP");const s=A(t,K),c=(a,s,c,d,p)=>{r=b("LCP",-1,a,s,c,d,p),o=h(e,r,J,t.reportAllChanges),n=!1,"soft-navigation"===a&&(i=E(!0))},d=e=>{s.l&&e.navigationId&&N(s.l,e),n||o(!0),c("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&p([t])},p=e=>{t.reportAllChanges||a||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){d(t);continue}let e=0,n=[],a=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-v(),0),s.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const o=t;if(!r.navigationId)continue;if("interactionId"in o&&o.interactionId!=r.navigationInteractionId)continue;a=o.largestContentfulPaint?.renderTime||0,e=Math.max(a-t.startTime,0),o.largestContentfulPaint&&(s.h(o.largestContentfulPaint),n=[o.largestContentfulPaint])}a<i.firstHiddenTime&&(r.value=e,r.entries=n,o())}},u=["largest-contentful-paint"];a&&u.push("interaction-contentful-paint","soft-navigation");const l=C(u,p);if(l){o=h(e,r,J,t.reportAllChanges);const i=["keydown","click","visibilitychange"],s=e=>{if(e.isTrusted&&!n){const e=r.id;F(()=>{if(!n){if(!a){l.disconnect();for(const e of i)removeEventListener(e,s,{capture:!0})}e===r.id&&(n=!0,o(!0))}})}};for(const e of i)addEventListener(e,s,{capture:!0});_(a=>{c("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,m()),o=h(e,r,J,t.reportAllChanges),w(()=>{r.value=performance.now()-a.timeStamp,n=!0,o(!0)})})}})})(t=>{e.add(t)});window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(()=>{if(0!==e.size){if(window._paq){const t={};e.forEach(e=>{const n=e.name.toLowerCase();t[`name_${n}`]=e.name,t[`value_${n}`]=e.value,t[`rating_${n}`]=e.rating,t[`delta_${n}`]=e.delta}),window._paq.push(["sendEvent","technique.cwv",t])}e.clear()}})()})},Z=["breadcrumb","contentSource","contentTitle","pageKey","pageName","pageUri","sectionLabel","subType","tagsSlug"],ee=["chapter1","chapter2","chapter3","chapter4","name","pageType"],te=["name","chapter1","chapter2","chapter3","chapter4"],ne=new Set(Object.values(e)),ae=e=>"object"==typeof e&&null!==e,oe=(e,t)=>Object.fromEntries(t.flatMap(t=>"string"==typeof e[t]?[[t,e[t]]]:[])),ie=e=>{if(!ae(e)||!ae(e.meta))return;const t="string"==typeof e.meta.source?e.meta.source:void 0;if(!t||1!==e.meta.version||!1===e.meta.enabled)return;const n={meta:{enabled:!0===e.meta.enabled||void 0,source:t,version:1}};if(ae(e.datalayer)){const t={...oe(e.datalayer,Z.filter(e=>"breadcrumb"!==e&&"pageName"!==e))};"string"==typeof e.datalayer.pageName&&ne.has(e.datalayer.pageName)&&(t.pageName=e.datalayer.pageName),Array.isArray(e.datalayer.breadcrumb)&&e.datalayer.breadcrumb.every(e=>"string"==typeof e)&&(t.breadcrumb=e.datalayer.breadcrumb),Object.keys(t).length>0&&(n.datalayer=t)}if(ae(e.piano)){const t={...oe(e.piano,ee)},a=(e=>{if(!ae(e))return;const t=Object.entries(e).filter(([,e])=>["boolean","number","string"].includes(typeof e)||null===e);return t.length>0?Object.fromEntries(t):void 0})(e.piano.customProps);a&&(t.customProps=a),Object.keys(t).length>0&&(n.piano=t)}return n},re=()=>{if(window.partnerTrackingOverrides)return ie(window.partnerTrackingOverrides);const e=(e=>{const t=e?.trim();if(t&&"\x3c!-- PARTNER_SLOT:ANALYTICS_CONTEXT --\x3e"!==t)try{return ie(JSON.parse(t))}catch(e){return void console.warn("Failed to parse partner tracking overrides:",e)}})(document.getElementById("partner-tracking-overrides")?.textContent);return e&&(window.partnerTrackingOverrides=e),e},se=()=>{const e=((e,t)=>{const n=t?.datalayer,a={...e??{}};return n?(n.breadcrumb&&(a.breadcrumb=[...n.breadcrumb]),void 0!==n.pageName&&(a.pageName=n.pageName),Z.filter(e=>"breadcrumb"!==e&&"pageName"!==e).forEach(e=>{void 0!==n[e]&&(a[e]=n[e])}),a):a})(window.datalayerInfo,re());return window.datalayerInfo=e,e},ce=e=>{const t=e?.piano?.customProps??{},n="string"==typeof t.page_canonical?t.page_canonical:void 0;return{...t,...n?{page_url:n}:{},...e?.piano?.pageType?{"s:page_type":e.piano.pageType}:{}}},de=(e,t)=>{const n={...e};return t?.piano?(te.forEach(e=>{void 0!==t.piano?.[e]&&(n[e]=t.piano[e])}),"string"==typeof t.piano.customProps?.page&&void 0===t.piano.name&&(n.name=t.piano.customProps.page),n):n},pe=()=>{const e={};if(e["b:user_darkmode"]="dark"===document.documentElement.getAttribute("data-theme"),e["b:user_status"]=!!document.cookie.match("(^|;)\\s*20mnUserInfo\\s*=\\s*([^;]+)"),!e["b:user_status"])return e;const t=(e=>{const t=document.cookie.split(";").filter(t=>-1!==t.indexOf(e))[0];if(t)return t.split("=")[1]})("20mnUserDataLayer"),n=t?(()=>{try{return JSON.parse(decodeURIComponent(t))}catch{return null}})():null;return n&&(e["s:user_id"]=String(n.i),Number.isNaN(n.d)||(e["n:user_a"]=Number(n.d)),Number.isNaN(n.l)||(e["n:user_zip"]=Number(n.l)),Number.isNaN(n.g)||(e["n:user_g"]=Number(n.g))),e};(()=>{se();const e=re();window.sendPageTracking=X,window.sendClickTracking=z,window._paq=window._paq||[],window._paq.push(["privacy.include.properties",["content_type","s:page_type","d:content_published_date","d:content_modified_date","n:content_id","n:content_id_journaliste","s:content_tags","s:content_signature","s:content_title","n:content_title_characters_number","s:content_subtype","n:content_video_number","n:content_20min_video_number","n:content_embed_number","s:content_subtype","s:content_subtype","n:content_characters_number","n:content_paragraphs_number","s:content_source","s:misc_referrer","s:page_canonical","s:misc_search","s:site_level2","b:user_darkmode","b:user_status","navigation_method","cta_context","cta_destination","cta_engagement","cta_type","name_lcp","value_lcp","rating_lcp","delta_lcp","name_inp","value_inp","rating_inp","delta_inp","name_cls","value_cls","rating_cls","delta_cls"]]),window.PianoPageInfo={name:"",chapter1:"",chapter2:""},window.PianoPageInfo=de(window.PianoPageInfo,e),window._paq.push(["setProperties",{...u(),...l(),...pe(),"s:site_level2":window.location.hostname,...ce(e)},{persistent:!0,events:["page.*","click.*"]}]),window.PianoPageInfo=de(window.PianoPageInfo,e),X({enableEdgee:!1}),Q()})()}();
|
|
1
|
+
!function(){"use strict";var e=(e=>(e.ARCHIVE_BY_DAY="archivebyday",e.ARCHIVE_BY_YEAR="archivebyyear",e.ARTICLE="article",e.ASTRO="astro",e.ASTRO_HOME="astrohome",e.CONTACT="contact",e.DIRECT="direct",e.ELECTIONS="elections",e.ELECTIONSHOME="electionshome",e.GAME="game",e.GAME_APP="gameapp",e.GAMEHOME="gamehome",e.HOME="home",e.JOB_DETAILS="jobdetails",e.JOBS="jobs",e.JOURNALIST="journalist",e.LA21E="la21e",e.LEGAL="legal",e.LEGALNOTICE="legalnotice",e.LEGALNOTICEHOME="legalnoticehome",e.LEGALNOTICEDEPARTMENT="legalnoticedepartment",e.LIVE="live",e.MOBILE_APPS="mobileapps",e.MOST_COMMENTED="mostcommented",e.MOST_READ="mostread",e.MOST_SHARED="mostshared",e.MOST_VIEWED="mostviewed",e.MOVIES="movies",e.NEWS="news",e.PARTNER="partner",e.PROGRAMME_TV_CHANNEL="programmetvchannel",e.PROGRAMME_TV_HOME="programmetvhome",e.PROGRAMME_TV_NOW="programmetvnow",e.PROGRAMME_TV_PROGRAM="programmetvprogram",e.PROGRAMME_TV_TOMORROW="programmetvtomorrow",e.REWIND="rewind",e.SEARCH="search",e.SECTION="section",e.SERVICE="service",e.SITEMAP="sitemap",e.SPORT="sport",e.STORY="story",e.TAG="tag",e.TRAFFIC="traffic",e.TV_HOME="tvhome",e.TV_LIVE="tvlive",e.TV_MOST_RECENT="tvmostrecent",e.TV_MOST_VIEWED="tvmostviewed",e.TV_SHOW="tvshow",e.TV_SHOWS="tvshows",e.TV_VIDEO="tvvideo",e.WEATHER="weather",e))(e||{});class t extends Error{}t.prototype.name="InvalidTokenError";var n=(e=>(e.down="down",e.heart="heart",e.laughing="laughing",e.sad="sad",e.shock="shock",e.up="up",e))(n||{});n.up,n.down,n.sad,n.heart,n.laughing,n.shock;const a=(e,t)=>{let n=e.toLowerCase().replace(/[\s-]+/g,"-");return n=(e=>{let t=e;const n="ãàáäâẽèéëêìíïîõòóöôùúüûñç·/,:;";for(let e=0;e<30;e+=1)t=t.replace(new RegExp(n.charAt(e),"g"),"aaaaaeeeeeiiiiooooouuuunc-----".charAt(e));return t})(n),n.replace(/[^\w-]+/g,"").replace(/-*$/g,"")},o=()=>{const e=new URLSearchParams(window.location.search);return Object.fromEntries(e.entries())},i=["chapter1","chapter2","chapter3","chapter4"],r=()=>document.querySelectorAll(".c-content > p").length,s=()=>[...document.querySelectorAll(".c-content > p")].reduce((e,t)=>e+t.innerHTML.length,0),c=()=>{const e={},t=o();return("utm_source"in t||"utm_campaign"in t||"utm_medium"in t)&&("utm_source"in t||(e.utm_source=t.utm_medium??t.utm_campaign),"utm_campaign"in t||(e.utm_campaign=t.utm_source??t.utm_medium),"utm_medium"in t||(e.utm_medium=t.utm_source??t.utm_campaign)),e},d=()=>{const e=window.datalayerInfo,t={};e?.breadcrumb?.forEach((e,t)=>{let n=a(e);"diaporamas"===n&&(n="diaporama"),"actualite"===n&&(n="actu-generale"),"guide-dachat"===n&&(n="guide-achat");const o=i[t];o&&window.PianoPageInfo&&(window.PianoPageInfo[o]=n)});const n=Number(e?.contentId);Number.isFinite(n)&&(t["n:content_id"]=n),t.content_type=e?.pageName??"other",t["s:page_type"]="content",t["d:content_published_date"]=e?.modificationDate?new Date(e.modificationDate).toISOString():"",t["d:content_modified_date"]=e?.publicationDate?new Date(e.publicationDate).toISOString():"";const o=Number(e?.journalist?.id);return Number.isFinite(o)&&(t["n:content_id_journaliste"]=o),t["s:content_tags"]=e?.tagsSlug??"",t["s:content_signature"]=a(e?.signature??""),t["s:content_title"]=a(e?.contentTitle??""),t["n:content_title_characters_number"]=Number(e?.contentTitle?.length)||0,t["s:content_subtype"]="texte",t["n:content_video_number"]=e?.videoCount??0,t["n:content_20min_video_number"]=e?.video20mnCount??0,t["n:content_embed_number"]=e?.embedCount??0,e?.podcastCount&&e?.podcastCount>0?t["s:content_subtype"]="podcast":t["n:content_video_number"]>0&&(t["s:content_subtype"]="video"),t},p=(e,t,n,a)=>(window.PianoPageInfo&&(t&&(window.PianoPageInfo.chapter1=t),n&&(window.PianoPageInfo.chapter2=n),a&&(window.PianoPageInfo.chapter3=a)),e?{"s:page_type":e}:{}),u=()=>{const e=window.datalayerInfo,t={};t["b:user_adblock"]=!window.adsapp,t.page_url=e?.pageUri??"",window.PianoPageInfo&&(window.PianoPageInfo.name=new URL(window.location.href).pathname,e?.pageUri&&(window.PianoPageInfo.name=new URL(e.pageUri).pathname)),e?.contentSource&&(t["s:content_source"]=e.contentSource),document.referrer&&(t["s:misc_referrer"]=document.referrer),t["s:page_type"]=e?.pageName||"other";const n=document.querySelector("link[rel='canonical']");if(n&&(t["s:page_canonical"]=n.getAttribute("href")??""),"/search"===e?.pageUri){const e=o();t["s:misc_search"]=e.q||""}return window.performance&&(t.navigation_method=window.performance.getEntriesByType?.("navigation")?.map(e=>e.type)?.pop()||null),{...t,...c()}},l=()=>{switch(window.datalayerInfo?.pageName||"other"){case e.ARCHIVE_BY_DAY:case e.ARCHIVE_BY_YEAR:return p("divers");case e.ARTICLE:return(()=>{const e=d();return e["n:content_characters_number"]=Number(s()),e["n:content_paragraphs_number"]=r(),e})();case e.ASTRO_HOME:return"numerology"===window.datalayerInfo?.pageKey?p("home_numerologie","services","numerologie"):p("home_horoscope","services","horoscope");case e.ASTRO:return["un","deux","trois","quatre","cinq","six","sept","huit","neuf"].includes(window.datalayerInfo?.pageKey||"")?p("numerologie","services","numerologie"):p("horoscope","services","horoscope");case e.DIRECT:return p("divers","le-direct");case e.ELECTIONS:case e.ELECTIONSHOME:return(()=>{const{national:e,region:t,department:n,constituency:a,town:o}=window.datalayerInfo?.elections||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1="elections",window.PianoPageInfo.chapter2="resultats",o&&n?(window.PianoPageInfo.chapter3=n,window.PianoPageInfo.chapter4=o):a&&n?(window.PianoPageInfo.chapter3=n,window.PianoPageInfo.chapter4=a):n&&t?(window.PianoPageInfo.chapter3=t,window.PianoPageInfo.chapter4=n):t?(window.PianoPageInfo.chapter3="france",window.PianoPageInfo.chapter4=t):e&&(window.PianoPageInfo.chapter3=e)),{"s:page_type":"elections"}})();case e.HOME:return window.PianoPageInfo&&(window.PianoPageInfo.chapter1="accueil",window.PianoPageInfo.chapter2=""),{"s:page_type":"home","s:content_source":"20mn",content_type:null};case e.GAME:return p(void 0,"services","jeux",window.datalayerInfo?.pageKey);case e.GAME_APP:return(()=>{p(void 0,"services","jeux",window.datalayerInfo?.pageKey);const e=d();return e["s:page_type"]="home_game",window.datalayerInfo?.pageKey&&(e["s:page_type"]="game"),e})();case e.GAMEHOME:return p("home_game","services","jeux");case e.JOB_DETAILS:return(()=>{const{pageKey:e,tagsSlug:t="",contentTitle:n="",embedCount:a=0,videoCount:o=0,video20mnCount:i=0}=window.datalayerInfo||{};return{"s:content_source":"labsense","s:page_type":"content",content_type:"card","s:content_tags":t,"s:content_signature":"","s:content_title":n,"s:content_subtype":"job","n:content_id":Number(e),"n:content_id_journaliste":0,"n:content_title_characters_number":Number(n.length)||0,"n:content_video_number":o,"n:content_20min_video_number":i,"n:content_embed_number":a,"n:content_characters_number":Number(s()),"n:content_paragraphs_number":r(),"d:content_published_date":"","d:content_modified_date":""}})();case e.JOBS:return p("home_tag",window.datalayerInfo?.pageKey,"");case e.JOURNALIST:return(()=>{const{firstName:e,lastName:t}=window.datalayerInfo?.journalist||{};return e&&t&&window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`journaliste--${e}-${t}`),{"s:page_type":"journalist"}})();case e.LA21E:return p("divers","focus--accueil");case e.LEGALNOTICE:return(()=>{const{contentTitle:e}=window.datalayerInfo||{};return e&&window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`legal-announcement--${e}`),{"s:page_type":"legal_notice"}})();case e.LEGALNOTICEDEPARTMENT:return(()=>{const{contentTitle:e}=window.datalayerInfo||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1=`legal-announcement-list--${e}`),{"s:page_type":"legal_notice_department"}})();case e.LEGALNOTICEHOME:return p("legal_notice_home","legal-announcement-list");case e.LEGAL:return(()=>{const{pageKey:e}=window.datalayerInfo||{};if(window.PianoPageInfo)switch(e){case"cookies":window.PianoPageInfo.chapter1="gestion-cookies";break;case"privacy":window.PianoPageInfo.chapter1="politique-protection-donnees-personnelles";break;default:window.PianoPageInfo.chapter1=e}return{"s:page_type":"divers"}})();case e.LIVE:return(()=>{const e=d();return e["n:content_paragraphs_number"]=window.datalayerInfo?.livePosts??0,e})();case e.MOBILE_APPS:return p("divers","mobile");case e.MOST_COMMENTED:return p("most_commented");case e.MOST_READ:return p("most_read");case e.MOST_SHARED:return p("most_shared");case e.MOST_VIEWED:return p("home_tag");case e.MOVIES:return p("divers","entertainment","cinema");case e.NEWS:return p("divers","a-la-une");case e.TAG:return p("home_tag",window.datalayerInfo?.pageKey,"");case e.SITEMAP:return p("divers","plan-site");case e.SPORT:return(()=>{const{breadcrumb:e=[]}=window.datalayerInfo||{};return window.PianoPageInfo&&(window.PianoPageInfo.chapter1=e.shift(),window.PianoPageInfo.chapter2=e.shift(),window.PianoPageInfo.chapter3=e.shift(),window.PianoPageInfo.chapter4=e.shift()),{"s:page_type":"divers"}})();case e.STORY:return(()=>{const e=d();return e["s:content_subtype"]=window.datalayerInfo?.subType??"",e})();case e.SERVICE:return p("divers","pratique");case e.TRAFFIC:return p("infos_trafic");case e.TV_HOME:return p("home_tv","tv");case e.TV_LIVE:return p("home_tv_live","tv");case e.TV_MOST_RECENT:return p("tv_divers","tv","videos-recentes");case e.TV_MOST_VIEWED:return p("tv_divers","tv","videos-plus-vues");case e.TV_SHOW:return p("home_tv_show","tv",window.datalayerInfo?.pageKey);case e.TV_SHOWS:return p("tv_divers","tv","emissions");case e.TV_VIDEO:return(()=>{window.PianoPageInfo&&(window.PianoPageInfo.chapter1="tv");const e=d();return e.content_type="page",e["s:content_subtype"]="video",e})();case e.WEATHER:return p("previsions-meteo-france");default:return{}}};let g=-1;const m=()=>g,_=e=>{addEventListener("pageshow",t=>{t.persisted&&(g=t.timeStamp,e(t))},!0)},h=(e,t,n,a)=>{let o,i;return r=>{t.value>=0&&(r||a)&&(i=t.value-(o??0),(i||void 0===o)&&(o=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},w=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},f=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},v=()=>f()?.activationStart??0;let I=-1;const P=new Set,y=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,T=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of P)e();isFinite(I)||(I="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",T,!0))}},E=(e=!1)=>{if(e&&(I=1/0),I<0){const e=v(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;I=t??y(),addEventListener("visibilitychange",T,!0),addEventListener("prerenderingchange",T,!0),_(()=>{setTimeout(()=>{I=y()})})}return{get firstHiddenTime(){return I},onHidden(e){P.add(e)}}},b=(e,t=-1,n,a=0,o,i,r)=>{const s=f(),c=s?.navigationId||0;let d="navigate";return n?d=n:m()>=0?d="back-forward-cache":s&&(document.prerendering||v()>0?d="prerender":document.wasDiscarded?d="restore":s.type&&(d=s.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:d,navigationId:a||c,navigationInteractionId:o,navigationURL:i||s?.name,navigationStartTime:r||0}},O=new WeakMap;function A(e,t){let n=O.get(t);return n||(n=new WeakMap,O.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}class S{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const C=(e,t,n={})=>{try{const a=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(a.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();a.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of a)e.observe({type:t,buffered:!0,...n});return e}}catch{}},M=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,N=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},L=e=>{let t=!1;return()=>{t||(e(),t=!0)}};class R{l}const k=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},V=[1800,3e3],H=(e,t={})=>{const n=M(t);k(()=>{const a=A(t,R),o=E();let i,r=b("FCP");const s=C(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<o.firstHiddenTime&&(r.value=Math.max(t.startTime-v(),0),r.entries.push(t),r.navigationId=t.navigationId||r.navigationId,i(!0)))});s&&(i=h(e,r,V,t.reportAllChanges),_(n=>{r=b("FCP",-1,"back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,m()),i=h(e,r,V,t.reportAllChanges),w(()=>{r.value=performance.now()-n.timeStamp,i(!0)})})),n&&C(["soft-navigation"],n=>{n.forEach(n=>{a.l&&n.navigationId&&N(a.l,n);const o=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);r=b("FCP",o,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),i=h(e,r,V,t.reportAllChanges),i(!0)})},t)})},D=[.1,.25];let q=0,j=1/0,x=0;const G=e=>{for(const t of e)t.interactionId&&(j=Math.min(j,t.interactionId),x=Math.max(x,t.interactionId),q=x?(x-j)/7+1:0)};let U;const W=()=>U?q:performance.interactionCount??0;class B{u=0;v=[];p=new Map;m;T;_(){return W()-this.u}M(){this.u=W(),this.v.length=0,this.p.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.v.at(-1);let n=this.p.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.p.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.p.delete(t.id)}this.T?.(n)}}}const F=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,a=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const o=L(e);let i=-1;const r=()=>{a(i),o()};addEventListener("visibilitychange",r,{once:!0,capture:!0}),i=n(()=>{removeEventListener("visibilitychange",r,{capture:!0}),o()},{timeout:t})}},Y=[200,500],$=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=E();k(()=>{"interactionCount"in performance||U||(U=C(["event"],G,{durationThreshold:0}));let a,o=b("INP");const i=A(t,B),r=(n,r,s,c,d)=>{i.M(),o=b("INP",-1,n,r,s,c,d),a=h(e,o,Y,t.reportAllChanges)},s=()=>{const e=i.L(o.navigationType);e&&e.P!==o.value&&(o.value=e.P,o.entries=e.entries,a())},c=e=>{s(),a(!0),r("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},d=(e,t=!1)=>{F(()=>{for(const t of e)"soft-navigation"!==t.entryType?i.h(t):c(t);s(),t&&a(!0)})},p=["event","first-input"];M(t)&&p.push("soft-navigation");const u=C(p,d,{...t,durationThreshold:t.durationThreshold??40});a=h(e,o,Y,t.reportAllChanges),u&&(n.onHidden(()=>{d(u.takeRecords(),!0)}),_(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,m())}))})};class K{m;l;h(e){this.m?.(e)}}const J=[2500,4e3],z=e=>{const t={click:a(e.name),click_chapter1:e?.chapter1||null,click_chapter2:e?.chapter2||null,click_chapter3:e?.chapter3||null},n=`click.${e.type}`;if(window.pa?(e.customProps&&Object.keys(e.customProps).length>0&&window.pa.setProperties(e.customProps,{persistent:!1,events:[n]}),window.pa.sendEvent(n,t)):window._paq&&(e.customProps&&Object.keys(e.customProps).length>0&&window._paq.push(["setProperties",e.customProps,{persistent:!1,events:[n]}]),window._paq.push(["sendEvent",n,t])),!window.edgee?.track)return;const o=document.getElementById("__EDGEE_DATA_LAYER__");let i={};if(o)try{const e=JSON.parse(o.textContent||"");e.data_collection.context=e.data_collection.context||{},i=e.data_collection.context.page?.properties||{}}catch{i={}}window.edgee.track({name:n,properties:{...i,click:t.click,click_chapter1:t.click_chapter1,click_chapter2:t.click_chapter2,click_chapter3:t.click_chapter3,click_type:e?.type??"navigation",...e.customProps}},{"edgee/piano-analytics":!0})},X=e=>{window._paq&&window._paq.push(["sendEvent","page.display",{page:e?.name??window.PianoPageInfo?.name,page_chapter1:e?.chapter1??window.PianoPageInfo?.chapter1,page_chapter2:e?.chapter2??window.PianoPageInfo?.chapter2,page_chapter3:e?.chapter3??window.PianoPageInfo?.chapter3,page_chapter4:e?.chapter4??window.PianoPageInfo?.chapter4}]),window.edgee?.page&&!1!==e?.enableEdgee&&window.edgee.page()},Q=()=>{if(!(100*Math.random()<=15))return;const e=new Set;((e,t={})=>{const n=E();H(L(()=>{let a,o=b("CLS",0);const i=A(t,S),r=(n,r,s,c,d)=>{o=b("CLS",0,n,r,s,c,d),i.i=0,a=h(e,o,D,t.reportAllChanges)},s=(e=!1)=>{i.i>o.value&&(o.value=i.i,o.entries=i.o),a(e)},c=e=>{s(!0),r("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},d=e=>{for(const t of e)"soft-navigation"!==t.entryType?i.h(t):c(t);s()},p=["layout-shift"];M(t)&&p.push("soft-navigation");const u=C(p,d);u&&(a=h(e,o,D,t.reportAllChanges),n.onHidden(()=>{d(u.takeRecords()),a(!0)}),_(()=>{r("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,m()),w(a)}),setTimeout(a))}))})(t=>{e.add(t)}),$(t=>{e.add(t)}),((e,t={})=>{let n=!1;const a=M(t);k(()=>{let o,i=E(),r=b("LCP");const s=A(t,K),c=(a,s,c,d,p)=>{r=b("LCP",-1,a,s,c,d,p),o=h(e,r,J,t.reportAllChanges),n=!1,"soft-navigation"===a&&(i=E(!0))},d=e=>{s.l&&e.navigationId&&N(s.l,e),n||o(!0),c("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&p([t])},p=e=>{t.reportAllChanges||a||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){d(t);continue}let e=0,n=[],a=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-v(),0),s.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const o=t;if(!r.navigationId)continue;if("interactionId"in o&&o.interactionId!=r.navigationInteractionId)continue;a=o.largestContentfulPaint?.renderTime||0,e=Math.max(a-t.startTime,0),o.largestContentfulPaint&&(s.h(o.largestContentfulPaint),n=[o.largestContentfulPaint])}a<i.firstHiddenTime&&(r.value=e,r.entries=n,o())}},u=["largest-contentful-paint"];a&&u.push("interaction-contentful-paint","soft-navigation");const l=C(u,p);if(l){o=h(e,r,J,t.reportAllChanges);const i=["keydown","click","visibilitychange"],s=e=>{if(e.isTrusted&&!n){const e=r.id;F(()=>{if(!n){if(!a){l.disconnect();for(const e of i)removeEventListener(e,s,{capture:!0})}e===r.id&&(n=!0,o(!0))}})}};for(const e of i)addEventListener(e,s,{capture:!0});_(a=>{c("back-forward-cache",r.navigationId,r.navigationInteractionId,r.navigationURL,m()),o=h(e,r,J,t.reportAllChanges),w(()=>{r.value=performance.now()-a.timeStamp,n=!0,o(!0)})})}})})(t=>{e.add(t)});window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(()=>{if(0!==e.size){if(window._paq){const t={};e.forEach(e=>{const n=e.name.toLowerCase();t[`name_${n}`]=e.name,t[`value_${n}`]=e.value,t[`rating_${n}`]=e.rating,t[`delta_${n}`]=e.delta}),window._paq.push(["sendEvent","technique.cwv",t])}e.clear()}})()})},Z=["breadcrumb","contentSource","contentTitle","pageKey","pageName","pageUri","sectionLabel","subType","tagsSlug"],ee=["chapter1","chapter2","chapter3","chapter4","name","pageType"],te=["name","chapter1","chapter2","chapter3","chapter4"],ne=new Set(Object.values(e)),ae=e=>"object"==typeof e&&null!==e,oe=(e,t)=>Object.fromEntries(t.flatMap(t=>"string"==typeof e[t]?[[t,e[t]]]:[])),ie=e=>{if(!ae(e)||!ae(e.meta))return;const t="string"==typeof e.meta.source?e.meta.source:void 0;if(!t||1!==e.meta.version||!1===e.meta.enabled)return;const n={meta:{enabled:!0===e.meta.enabled||void 0,source:t,version:1}};if(ae(e.datalayer)){const t={...oe(e.datalayer,Z.filter(e=>"breadcrumb"!==e&&"pageName"!==e))};"string"==typeof e.datalayer.pageName&&ne.has(e.datalayer.pageName)&&(t.pageName=e.datalayer.pageName),Array.isArray(e.datalayer.breadcrumb)&&e.datalayer.breadcrumb.every(e=>"string"==typeof e)&&(t.breadcrumb=e.datalayer.breadcrumb),Object.keys(t).length>0&&(n.datalayer=t)}if(ae(e.piano)){const t={...oe(e.piano,ee)},a=(e=>{if(!ae(e))return;const t=Object.entries(e).filter(([,e])=>["boolean","number","string"].includes(typeof e)||null===e);return t.length>0?Object.fromEntries(t):void 0})(e.piano.customProps);a&&(t.customProps=a),Object.keys(t).length>0&&(n.piano=t)}return n},re=()=>{if(window.partnerTrackingOverrides)return ie(window.partnerTrackingOverrides);const e=(e=>{const t=e?.trim();if(t&&"\x3c!-- PARTNER_SLOT:ANALYTICS_CONTEXT --\x3e"!==t)try{return ie(JSON.parse(t))}catch(e){return void console.warn("Failed to parse partner tracking overrides:",e)}})(document.getElementById("partner-tracking-overrides")?.textContent);return e&&(window.partnerTrackingOverrides=e),e},se=()=>{const e=((e,t)=>{const n=t?.datalayer,a={...e??{}};return n?(n.breadcrumb&&(a.breadcrumb=[...n.breadcrumb]),void 0!==n.pageName&&(a.pageName=n.pageName),Z.filter(e=>"breadcrumb"!==e&&"pageName"!==e).forEach(e=>{void 0!==n[e]&&(a[e]=n[e])}),a):a})(window.datalayerInfo,re());return window.datalayerInfo=e,e},ce=e=>{const t=e?.piano?.customProps??{},n="string"==typeof t.page_canonical?t.page_canonical:void 0;return{...t,...n?{page_url:n}:{},...e?.piano?.pageType?{"s:page_type":e.piano.pageType}:{}}},de=(e,t)=>{const n={...e};return t?.piano?(te.forEach(e=>{void 0!==t.piano?.[e]&&(n[e]=t.piano[e])}),"string"==typeof t.piano.customProps?.page&&void 0===t.piano.name&&(n.name=t.piano.customProps.page),n):n},pe=()=>{const e={};if(e["b:user_darkmode"]="dark"===document.documentElement.getAttribute("data-theme"),e["b:user_status"]=!!document.cookie.match("(^|;)\\s*20mnUserInfo\\s*=\\s*([^;]+)"),!e["b:user_status"])return e;const t=(e=>{const t=document.cookie.split(";").filter(t=>-1!==t.indexOf(e))[0];if(t)return t.split("=")[1]})("20mnUserDataLayer"),n=t?(()=>{try{return JSON.parse(decodeURIComponent(t))}catch{return null}})():null;return n&&(e["s:user_id"]=String(n.i),Number.isNaN(n.d)||(e["n:user_a"]=Number(n.d)),Number.isNaN(n.l)||(e["n:user_zip"]=Number(n.l)),Number.isNaN(n.g)||(e["n:user_g"]=Number(n.g))),e};(()=>{se();const e=re();window.sendPageTracking=X,window.sendClickTracking=z,window._paq=window._paq||[],window._paq.push(["privacy.include.properties",["content_type","s:page_type","d:content_published_date","d:content_modified_date","n:content_id","n:content_id_journaliste","s:content_tags","s:content_signature","s:content_title","n:content_title_characters_number","s:content_subtype","n:content_video_number","n:content_20min_video_number","n:content_embed_number","s:content_subtype","s:content_subtype","n:content_characters_number","n:content_paragraphs_number","s:content_source","s:misc_referrer","s:page_canonical","s:misc_search","s:site_level2","b:user_darkmode","b:user_status","navigation_method","cta_context","cta_destination","cta_engagement","cta_type","name_lcp","value_lcp","rating_lcp","delta_lcp","name_inp","value_inp","rating_inp","delta_inp","name_cls","value_cls","rating_cls","delta_cls"]]),window.PianoPageInfo={name:"",chapter1:"",chapter2:""},window.PianoPageInfo=de(window.PianoPageInfo,e),window._paq.push(["setProperties",{...u(),...l(),...pe(),"s:site_level2":window.location.hostname,...ce(e)},{persistent:!0,events:["page.*","click.*"]}]),window.PianoPageInfo=de(window.PianoPageInfo,e),X({enableEdgee:!1}),Q()})()}();
|
|
2
2
|
//# sourceMappingURL=piano.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@20minutes/tyr",
|
|
3
|
-
"version": "2.45.
|
|
3
|
+
"version": "2.45.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@github.com/20minutes/tyr.git"
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"react": "^18.3.1",
|
|
66
66
|
"react-dom": "^18.3.1",
|
|
67
67
|
"uri-js": "npm:uri-js-replace",
|
|
68
|
-
"web-vitals": "^6.
|
|
68
|
+
"web-vitals": "^6.2.0",
|
|
69
69
|
"whatwg-url": "^16.0.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@20minutes/eslint-config": "^3.0.9",
|
|
73
|
-
"@aws-sdk/client-s3": "3.
|
|
74
|
-
"@graphql-codegen/cli": "^7.
|
|
73
|
+
"@aws-sdk/client-s3": "3.1117.0",
|
|
74
|
+
"@graphql-codegen/cli": "^7.3.1",
|
|
75
75
|
"@graphql-codegen/typescript": "^6.1.0",
|
|
76
76
|
"@graphql-codegen/typescript-operations": "^6.1.6",
|
|
77
77
|
"@octokit/core": "7.0.7",
|
|
@@ -79,16 +79,16 @@
|
|
|
79
79
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
80
80
|
"@rollup/plugin-replace": "^6.0.3",
|
|
81
81
|
"@rollup/plugin-terser": "^1.0.0",
|
|
82
|
-
"@storybook/addon-a11y": "^10.5.
|
|
83
|
-
"@storybook/addon-docs": "^10.5.
|
|
84
|
-
"@storybook/addon-links": "^10.5.
|
|
85
|
-
"@storybook/react-vite": "^10.5.
|
|
82
|
+
"@storybook/addon-a11y": "^10.5.10",
|
|
83
|
+
"@storybook/addon-docs": "^10.5.10",
|
|
84
|
+
"@storybook/addon-links": "^10.5.10",
|
|
85
|
+
"@storybook/react-vite": "^10.5.10",
|
|
86
86
|
"@testing-library/dom": "^10.4.1",
|
|
87
87
|
"@testing-library/react": "^16.3.2",
|
|
88
88
|
"@types/draft-js": "^0.11.20",
|
|
89
89
|
"@types/googletag": "^3.3.0",
|
|
90
90
|
"@types/jsdom": "^27.0.0",
|
|
91
|
-
"@types/node": "^26.
|
|
91
|
+
"@types/node": "^26.3.0",
|
|
92
92
|
"@types/poool-access": "^5.18.1",
|
|
93
93
|
"@types/poool-engage": "^2.3.0",
|
|
94
94
|
"@types/react": "^18.3.13",
|
|
@@ -106,12 +106,12 @@
|
|
|
106
106
|
"postcss": "^8.5.26",
|
|
107
107
|
"purgecss": "^8.0.0",
|
|
108
108
|
"purgecss-from-html": "^8.0.0",
|
|
109
|
-
"rollup": "^4.
|
|
109
|
+
"rollup": "^4.63.0",
|
|
110
110
|
"rollup-plugin-esbuild": "^6.2.1",
|
|
111
111
|
"rollup-plugin-typescript-paths": "^1.5.0",
|
|
112
112
|
"rollup-plugin-visualizer": "^7.1.1",
|
|
113
113
|
"schema-dts": "^2.0.0",
|
|
114
|
-
"storybook": "^10.5.
|
|
114
|
+
"storybook": "^10.5.10",
|
|
115
115
|
"tsx": "^4.23.12",
|
|
116
116
|
"typed-query-selector": "^2.12.2",
|
|
117
117
|
"typescript": "^6.0.3",
|