1import{p as F,bT as m,a2 as k,a8 as l,a5 as a,ag as w,d4 as x,cA as v,h as B,cr as n,d6 as I,cX as O,bt as h,a7 as c,f as P,bY as $,cL as z,P as _,bL as u,af as R}from"./index-DLeOQHh2.js";import{B as J,r as E}from"./beeRenderer-BvtyoMRm.js";const U={class:"bp"},X={class:"bp-head"},Y={class:"caption neutral"},q={class:"bp-form"},G={class:"bp-actions"},H=["disabled"],K=["disabled"],Q={key:0,class:"body-s-medium bp-bad"},W={key:0,class:"body-s-medium"},Z={key:1,class:"bp-table body-s-medium"},ee={key:0,class:"bp-diff"},te={__name:"BeeParityView",setup(se){const y=z(),f=m(y.params.id?String(y.params.id):""),r=m(!1),d=m([]),p=m(""),V=k(()=>d.value.filter(s=>s.ok).length),C=k(()=>{const s=d.value.filter(t=>t.ms!==void 0);return s.length?(s.reduce((t,e)=>t+e.ms,0)/s.length).toFixed(2):"â"});function N(s){const t=[];for(const e of s.split(/[\s,;]+/).filter(Boolean)){const o=/^(\d+)-(\d+)$/.exec(e);if(o)for(let i=+o[1];i<=+o[2]&&t.length<5e3;i++)t.push(i);else/^\d+$/.test(e)&&t.push(+e)}return[...new Set(t)]}async function S(){var s;p.value="";try{const t=await _.get("/beefree/get_user_templates"),e=Array.isArray(t.data)?t.data:((s=t.data)==null?void 0:s.data)||[];f.value=e.map(o=>o.id).join(" ")}catch{p.value="Ðе ÑдалоÑÑ Ð¿Ð¾Ð»ÑÑиÑÑ ÑпиÑок Ñаблонов"}}function M(s,t){let e=0;for(;e<s.length&&e<t.length&&s[e]===t[e];)e++;return{at:e,server:t.slice(Math.max(0,e-80),e+120),client:s.slice(Math.max(0,e-80),e+120)}}async function j(s){const t={id:s,ok:!1};try{const e=await _.post("beefree/get_json",{campaign_id:s}),o=typeof e.data=="string"?e.data:JSON.stringify(e.data);if(!o||o.length<50)throw new Error("Ð½ÐµÑ Ð¼Ð°ÐºÐµÑа");for(const i of[!1,!0]){const L=await _.post("beefree/render_html",{campaign_id:s,...i?{editor:1}:{}},{transformResponse:A=>A}),b=String(L.data),T=performance.now(),g=E(o,"desktop",i);if(t.ms=performance.now()-T,g!==b&&E(o,"desktop",i,{php81:!1})!==b)return t.mode=i?"канваÑ":"пиÑÑмо",t.diff=M(g,b),t}t.ok=!0}catch(e){t.error=(e==null?void 0:e.message)||String(e)}return t}async function D(){const s=N(f.value);if(s.length){r.value=!0,d.value=[];for(const t of s){if(!r.value)break;d.value.push(await j(t))}r.value=!1}}return(s,t)=>(u(),l("div",U,[a("header",X,[w(v(B),{to:"/templates",class:"body-s-medium"},{default:x(()=>t[2]||(t[2]=[R("â ШаблонÑ")])),_:1}),t[3]||(t[3]=a("h1",{class:"heading-s"},"СвеÑка клиенÑÑкого ÑендеÑа",-1)),a("span",Y,"renderBee v"+n(v(J))+" пÑоÑив ÑеÑвеÑного BeeRenderer, Ð±Ð°Ð¹Ñ Ð² байÑ",1)]),a("div",q,[I(a("textarea",{"onUpdate:modelValue":t[0]||(t[0]=e=>f.value=e),class:"input input-text input-text-s body-s-medium",rows:"3",placeholder:"id кампаний: 6521396 6521400-6521450"},null,512),[[O,f.value]]),a("div",G,[a("button",{class:h(["button button-primary button-s body-s-medium",{disabled:r.value}]),disabled:r.value,onClick:D},"СвеÑиÑÑ",10,H),r.value?(u(),l("button",{key:0,class:"button button-secondary button-s body-s-medium",onClick:t[1]||(t[1]=e=>r.value=!1)},"ÐÑÑановиÑÑ")):c("",!0),a("button",{class:h(["button button-secondary button-s body-s-medium",{disabled:r.value}]),disabled:r.value,onClick:S},"Ðои ÑаблонÑ",10,K)]),p.value?(u(),l("p",Q,n(p.value),1)):c("",!0)]),d.value.length?(u(),l("p",W,"Совпало "+n(V.value)+" из "+n(d.value.length)+" · ÑÑедний клиенÑÑкий ÑÐµÐ½Ð´ÐµÑ "+n(C.value)+" мÑ",1)):c("",!0),d.value.length?(u(),l("table",Z,[a("tbody",null,[(u(!0),l(P,null,$(d.value,e=>(u(),l("tr",{key:e.id},[a("td",null,[w(v(B),{to:{name:"dashabuilder2",params:{id:e.id}}},{default:x(()=>[R(n(e.id),1)]),_:2},1032,["to"])]),a("td",{class:h(e.ok?"bp-ok":"bp-bad")},n(e.ok?"Ñовпало":e.error?e.error:"ÑаÑÑ
одиÑÑÑ: "+e.mode+" @"+e.diff.at),3),a("td",null,n(e.ms!==void 0?e.ms.toFixed(2)+" мÑ":""),1),e.diff?(u(),l("td",ee,[a("div",null,"ÑеÑвеÑ: "+n(e.diff.server),1),a("div",null,"клиенÑ: "+n(e.diff.client),1)])):c("",!0)]))),128))])])):c("",!0)]))}},ne=F(te,[["__scopeId","data-v-dfa23626"]]);export{ne as default};
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.