1var __IMPORT_META_ENV={};var __PROCESS_ENV={NODE_ENV:"production"}; 2import{a as T}from"/chunks/chunk-IPKA3XZP.js";var a="p97asPxpbZHXkU2B",n={slug:"@bl001",status:"@bl002",topic:"@bl003",excerpt:"@bl004",featuredImageUrl:"@bl005",seoTitle:"@bl006",seoKeywords:"@bl007",readingTime:"@bl008",author:"@bl009",publishedAt:"@bl010",seoScore:"@bl011",pinned:"@bl012",printHtml:"@bl013"},D={crm:{label:"CRM",color:"#6366f1",bg:"#6366f115",emoji:"\u{1F3E2}"},automatisation:{label:"Automatisation",color:"#0ea5e9",bg:"#0ea5e915",emoji:"\u26A1"},ia:{label:"IA & Tech",color:"#8b5cf6",bg:"#8b5cf615",emoji:"\u{1F916}"},web:{label:"Web & Design",color:"#f59e0b",bg:"#f59e0b15",emoji:"\u{1F3A8}"},conseil:{label:"Conseil",color:"#22c55e",bg:"#22c55e15",emoji:"\u{1F4A1}"},actualite:{label:"Actualit\xE9",color:"#ec4899",bg:"#ec489915",emoji:"\u{1F4F0}"}},K={draft:{label:"Brouillon",color:"#94a3b8",bg:"#94a3b815"},published:{label:"Publi\xE9",color:"#22c55e",bg:"#22c55e15"},archived:{label:"Archiv\xE9",color:"#ef4444",bg:"#ef444415"}},_="https://www.sky-solution.blue";function G(e){return`${_}/zen/blog/${e.slug}`}var c=T.create({baseURL:"/api/taskade",timeout:2e4,headers:{"Cache-Control":"no-cache"}});c.interceptors.request.use(e=>((!e.method||e.method.toLowerCase()==="get")&&(e.params={...e.params,_t:Date.now()}),e));function f(e){return e.startsWith("/")?e:`/attributes/${e}`}function d(e,t){return String(e.fieldValues[f(t)]??"")}function B(e,t){let o=e.fieldValues[f(t)];return typeof o=="number"?o:parseFloat(String(o??"0"))||0}function S(e,t){let o=e.fieldValues[f(t)];return typeof o=="object"&&o!==null&&"optionId"in o?o.optionId:typeof o=="string"?o:String(o??"")}function L(e){return String(e.fieldValues["/text"]??"")}function E(e){return String(e.fieldValues["/attributes/note"]??"")}function N(e,t=""){return{id:e.id,title:L(e),slug:d(e,n.slug),status:S(e,n.status)||"draft",topic:S(e,n.topic),excerpt:d(e,n.excerpt),featuredImageUrl:d(e,n.featuredImageUrl),seoTitle:d(e,n.seoTitle),seoKeywords:d(e,n.seoKeywords),readingTime:B(e,n.readingTime),author:d(e,n.author),publishedAt:d(e,n.publishedAt),seoScore:B(e,n.seoScore),pinned:d(e,n.pinned),htmlContent:E(e),printHtml:t}}var A="__print__";function y(e){let t={},o=(s,r)=>{t[f(s)]=r};return e.slug!==void 0&&o(n.slug,e.slug),e.status!==void 0&&o(n.status,e.status),e.topic!==void 0&&o(n.topic,e.topic),e.excerpt!==void 0&&o(n.excerpt,e.excerpt),e.featuredImageUrl!==void 0&&o(n.featuredImageUrl,e.featuredImageUrl),e.seoTitle!==void 0&&o(n.seoTitle,e.seoTitle),e.seoKeywords!==void 0&&o(n.seoKeywords,e.seoKeywords),e.readingTime!==void 0&&o(n.readingTime,e.readingTime),e.author!==void 0&&o(n.author,e.author),e.publishedAt!==void 0&&o(n.publishedAt,e.publishedAt),e.seoScore!==void 0&&o(n.seoScore,e.seoScore),e.pinned!==void 0&&o(n.pinned,e.pinned),t}function C(e){let o=e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().split(" ").filter(Boolean).length;return Math.max(1,Math.round(o/200))}function H(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").trim().replace(/[\s_]+/g,"-").replace(/-+/g,"-").slice(0,80)}function I(e){let t=[{label:"Titre SEO (10-60 car.)",ok:!!e.seoTitle&&e.seoTitle.length>=10&&e.seoTitle.length<=60,tip:"Entre 50-60 caract\xE8res pour un titre Google optimal."},{label:"Extrait (50-160 car.)",ok:!!e.excerpt&&e.excerpt.length>=50&&e.excerpt.length<=160,tip:"L'extrait sert de meta description."},{label:"Mots-cl\xE9s d\xE9finis",ok:!!e.seoKeywords&&e.seoKeywords.trim().length>0,tip:"3 \xE0 5 mots-cl\xE9s s\xE9par\xE9s par des virgules."},{label:"Image cover renseign\xE9e",ok:!!e.featuredImageUrl&&e.featuredImageUrl.startsWith("http"),tip:"Une image 1200\xD7630px am\xE9liore le CTR et les partages sociaux."},{label:"Slug valide",ok:!!e.slug&&/^[a-z0-9-]{3,80}$/.test(e.slug),tip:"Lettres minuscules, chiffres et tirets uniquement."},{label:"Contenu HTML (>300 mots)",ok:!!e.htmlContent&&e.htmlContent.replace(/<[^>]+>/g," ").split(/\s+/).filter(Boolean).length>300,tip:"Un contenu de 600+ mots am\xE9liore le positionnement."}
2,{label:"Topic d\xE9fini",ok:!!e.topic&&e.topic.length>0,tip:"Le topic organise les articles et am\xE9liore le maillage interne."},{label:"Auteur renseign\xE9",ok:!!e.author&&e.author.trim().length>0,tip:"Le schema.org Article exige un auteur pour les rich results."},{label:"Article publi\xE9",ok:e.status==="published",tip:"Publiez l'article pour qu'il soit index\xE9 par Google."}];return{score:Math.round(t.filter(s=>s.ok).length/t.length*100),checks:t}}var h="blog_cache_v1",v=120*1e3;function $(){try{let e=sessionStorage.getItem(h);if(!e)return null;let t=JSON.parse(e);return Date.now()-t.ts>v?(sessionStorage.removeItem(h),null):t.articles}catch{return null}}function j(e){try{sessionStorage.setItem(h,JSON.stringify({ts:Date.now(),articles:e}))}catch{}}function w(){try{sessionStorage.removeItem(h)}catch{}}var m=null;async function p(){let e=$();return e||m||(m=O().then(t=>(j(t),m=null,t)).catch(t=>{throw m=null,t}),m)}async function O(){let t=(await c.get(`/projects/${a}/nodes`)).data?.payload?.nodes??[],o=[],s=new Map;for(let r of t)if(r.parentId==null){let i=r.fieldValues[f(n.slug)];typeof i=="string"&&i.trim().length>0&&o.push(r)}else if(String(r.fieldValues["/text"]??"")===A){let l=String(r.fieldValues["/attributes/note"]??"");l.trim().length>100&&s.set(r.parentId,l)}return o.map(r=>N(r,s.get(r.id)??"")).sort((r,i)=>r.pinned==="1"&&i.pinned!=="1"?-1:i.pinned==="1"&&r.pinned!=="1"?1:(i.publishedAt||"").localeCompare(r.publishedAt||""))}async function z(){return(await p()).filter(t=>t.status==="published")}async function W(e){return(await p()).find(o=>o.slug===e)??null}async function J(e){w(),e.htmlContent&&(e={...e,htmlContent:k(e.htmlContent)});let o=(await p()).find(g=>g.slug===e.slug.trim());if(o)throw new Error(`Le slug "${e.slug}" est d\xE9j\xE0 utilis\xE9 par l'article "${o.title}".`);let s=C(e.htmlContent||""),{score:r}=I({...e,readingTime:s}),i=new Date().toISOString(),l=y({...e,readingTime:s,seoScore:r,publishedAt:e.status==="published"?e.publishedAt||i:""});await c.post(`/projects/${a}/nodes`,{parentId:null,"/text":e.title||e.seoTitle||"Nouvel article","/attributes/note":e.htmlContent||"",...l})}async function R(e,t){w(),t.htmlContent&&(t={...t,htmlContent:k(t.htmlContent)});let o={};if(t.title!==void 0&&(o["/text"]=t.title),t.htmlContent!==void 0&&(o["/attributes/note"]=t.htmlContent),t.slug!==void 0){let i=(await p()).find(l=>l.slug===t.slug.trim()&&l.id!==e);if(i)throw new Error(`Le slug "${t.slug}" est d\xE9j\xE0 utilis\xE9 par "${i.title}".`)}if(t.htmlContent!==void 0&&(t={...t,readingTime:C(t.htmlContent)}),t.seoTitle!==void 0||t.excerpt!==void 0||t.seoKeywords!==void 0||t.featuredImageUrl!==void 0||t.htmlContent!==void 0||t.status!==void 0||t.topic!==void 0||t.author!==void 0){let i=(await p()).find(l=>l.id===e);if(i){let l={...i,...t},{score:g}=I(l);t={...t,seoScore:g}}}if(t.status==="published"){let i=(await p()).find(l=>l.id===e);i&&!i.publishedAt&&(t={...t,publishedAt:new Date().toISOString()})}Object.assign(o,y(t)),await c.patch(`/projects/${a}/nodes/${e}`,o)}async function q(e){w(),await c.delete(`/projects/${a}/nodes/${e}`)}
2var x=["l'ia dans votre crm","tester l'ia gratuitement","15+ agents ia","z\xE9ro config"];function k(e){if(!e||typeof e!="string")return e;let t=e.toLowerCase();if(!x.some(o=>t.includes(o)))return e;try{let s=new DOMParser().parseFromString(e,"text/html"),r=[],i=document.createTreeWalker(s.body,NodeFilter.SHOW_ELEMENT),l=i.currentNode;for(;l;){let g=l,P=(g.textContent??"").toLowerCase();if(x.some(u=>P.includes(u))){let u=g;for(;u.parentElement&&u.parentElement!==s.body&&x.some(b=>(u.parentElement.textContent??"").toLowerCase().includes(b));)u=u.parentElement;r.some(b=>b.contains(u))||r.push(u)}l=i.nextNode()}if(r.length===0)return e;for(let g of r)g.parentNode?.removeChild(g);return s.body.innerHTML}catch{return e}}async function X(e,t){let r=((await c.get(`/projects/${a}/nodes`)).data?.payload?.nodes??[]).find(i=>i.parentId===e&&String(i.fieldValues["/text"]??"")===A);r?await c.patch(`/projects/${a}/nodes/${r.id}`,{"/attributes/note":t}):await c.post(`/projects/${a}/nodes`,{parentId:e,"/text":A,"/attributes/note":t})}async function Y(e){let t=e.status==="published"?"draft":"published";await R(e.id,{status:t})}async function Z(e,t){let o=t.filter(s=>s.pinned==="1"&&s.id!==e).map(s=>c.patch(`/projects/${a}/nodes/${s.id}`,{[f(n.pinned)]:"0"}));await Promise.all(o),await c.patch(`/projects/${a}/nodes/${e}`,{[f(n.pinned)]:"1"})}export{D as a,K as b,G as c,C as d,H as e,I as f,p as g,z as h,W as i,J as j,R as k,q as l,k as m,X as n,Y as o,Z as p};
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.