1import{t as e}from"./blog-lang.B7x6Mrwl.js";import{n as t,t as n}from"./utils.DWJQ7RRN.js";import{a as r,r as i}from"./authState.C3eUlWaU.js";var a=`[data-instant-root]`;function o(e){document.dispatchEvent(new CustomEvent(`instant:content-changed`,{detail:{root:e}}))}var s={"wp-category":{root:`[data-wp-category-posts]`,grid:`[data-wp-grid]`},"success-story":{root:`[data-success-stories]`,grid:`[data-story-grid]`},"story-detail":{root:`[data-story-detail]`,grid:`[data-story-body]`},blog:{root:`body`,grid:`[data-blog-list-root]`}};function c(e){return e.surface!==`wp-category`||e.cardLayout===`media`}function l(e){if(!e)return;let t=Object.entries(e).map(([e,t])=>`${e}:${t}`);return t.length>0?t.join(`,`):void 0}function u(e,t){switch(e.surface){case`wp-category`:return{cardLayout:e.cardLayout,category:e.category,metaTag:e.metaTag,base:e.base,lang:e.lang,ctaLabel:e.ctaLabel,since:t?void 0:e.since,revs:t?void 0:l(e.revisions),legacyExcludeIds:t?void 0:e.legacyIds?.join(`,`),legacyRevs:t?void 0:l(e.legacyRevisions)};case`success-story`:return{tab:e.tab};case`story-detail`:return{slug:e.storySlug};case`blog`:return{source:e.source,lang:e.lang,productSlug:e.productSlug,category:e.category,limit:String(e.pageSize),ids:e.existingIds.join(`,`)||void 0,revs:l(e.revisions)}}}function d(e,t){let r=c(e),i=new URLSearchParams({surface:e.surface});r&&i.set(`replace`,`1`);for(let[t,n]of Object.entries(u(e,r)))n&&i.set(t,n);return!r&&t&&i.set(`excludeIds`,t),n(`/wxa-api/instant/cards?${i.toString()}`)}function f(e){let t=e.getAttribute(`data-post-id`),n=e.getAttribute(`data-source`),r=e.getAttribute(`data-lang`);return!t||!r||n!==`legacy`&&n!==`modern`?null:{id:t,source:n,lang:r,modified:e.getAttribute(`data-post-modified`)??void 0}}async function p(e){let t=new URLSearchParams({id:e.id,source:e.source});e.modified&&t.set(`since`,e.modified);try{let e=await fetch(n(`/wxa-api/instant/post?${t.toString()}`),{credentials:`include`});return e.ok?await e.json():null}catch{return null}}async function m(e){let t=document.querySelector(a);if(!t)return;let n=f(t);if(!n)return;let r=await p(n);e()||!r||r.stale!==!0||!r.post||C(t,r.post,n.lang)}function h(e,t){return e.querySelector(`[data-instant-target="${t}"]`)}function g(e,t){let n=h(e,`title`);n&&(n.textContent=t)}function _(t,n,r){let i=h(t,`date`);i&&(i.textContent=e(n.date,r));let a=h(t,`time`);a?.hasAttribute(`datetime`)&&a.setAttribute(`datetime`,n.date)}function v(e,t){let n=h(e,`content`);n&&(n.innerHTML=t.content)}function y(e,t,n){e.removeAttribute(`srcset`),e.removeAttribute(`sizes`),e.setAttribute(`src`,t.thumbnail??``),e.setAttribute(`alt`,n)}function b(e,t,n){let r=document.createElement(`img`);return r.setAttribute(`src`,e.thumbnail??``),r.setAttribute(`alt`,t),r.className=n,r.setAttribute(`loading`,`eager`),r.setAttribute(`decoding`,`sync`),r.setAttribute(`fetchpriority`,`high`),r.setAttribute(`data-zoomable`,``),r}var x=`blog-image mx-auto mb-10 h-auto cursor-zoom-in rounded-lg bg-white md:w-[60%]`;function S(e,t,n){let r=h(e,`thumbnail`);if(!r)return;let i=r.querySelector(`img`);if(!t.thumbnail){i&&(r.style.display=`none`);return}r.removeAttribute(`hidden`),r.style.removeProperty(`display`),i?y(i,t,n):r.appendChild(b(t,n,r.dataset.thumbClass||x))}function C(e,n,r){let i=t(n.title);g(e,i),_(e,n,r),v(e,n),S(e,n,i),o(e)}async function w(e,{rootSelector:t,gridSelector:n,buildUrl:r,insert:i,minNodes:a,onInserted:o}){let s=e.closest(t),c=s?.querySelector(n);if(!s||!c)return;let l;try{l=await fetch(r(),{credentials:`include`})}catch{return}if(!l.ok)return;let u;try{u=await l.text()}catch{return}if(!u.trim())return;let d=document.createElement(`template`);d.innerHTML=u;let f=Array.from(d.content.children);if(f.length!==0){if(i===`replace`){if(a&&f.length<a)return;c.replaceChildren(...f)}else{let e=[];for(let t of f){let n=t.getAttribute(`data-post-id`),r=n?T(c,n,t.getAttribute(`data-post-source`)):null;r?r.replaceWith(t):e.push(t)}c.prepend(...e)}o?.(s,c)}}function T(e,t,n){let r=`[data-post-id="${CSS.escape(t)}"]`;return n?e.querySelector(`${r}[data-post-source="${CSS.escape(n)}"], ${r}:not([data-post-source])`):e.querySelector(r)}function E(e,t){let n=s[t.surface],r=c(t);w(e,{rootSelector:n.root,gridSelector:n.grid,insert:r?`replace`:`prepend`,minNodes:t.surface===`blog`&&t.existingIds.length||void 0,buildUrl:()=>d(t,t.surface===`wp-category`?t.existingIds.join(`,`):``),onInserted:e=>o(e)})}function D(){let e=!1,t=()=>{if(e||!i())return;let t=document.querySelector(`[data-instant-post]:not([data-instant-blog-bound])`);t&&(t.dataset.instantBlogBound=`post`,m(()=>e)),document.querySelectorAll(`[data-instant-section]:not([data-instant-blog-bound])`).forEach(e
1=>{let t;try{t=JSON.parse(e.dataset.instantSection||``)}catch{return}e.dataset.instantBlogBound=`section`,E(e,t)})};t();let n=r(t);return()=>{e=!0,n()}}D();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.