1import{T as D,f as L,c as n,b as e,g as s,v as i,u as t,t as u,h as p,i as g,F as y,j as f,d as b,k as M,a as F,w as A,l as B,m as C,o,n as O}from"./app-f96b9a38.js";const E=["onSubmit"],H={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},J=e("label",{class:"mb-1 block text-sm font-medium text-brand-300 dark:text-neutral-100"},"Ðазвание",-1),R={key:0,class:"mt-1 text-xs text-rose-600"},q=e("label",{class:"mb-1 block text-sm font-medium text-brand-300 dark:text-neutral-100"},"Slug (внÑÑÑенний иденÑиÑикаÑоÑ)",-1),I=e("p",{class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},"ТолÑко ÑÑÑоÑнÑе лаÑинÑкие бÑквÑ, ÑиÑÑÑ Ð¸ подÑÑÑкиваниÑ.",-1),z={key:0,class:"mt-1 text-xs text-rose-600"},G={class:"grid grid-cols-1 gap-4 md:grid-cols-3"},K=e("label",{class:"mb-1 block text-sm font-medium text-brand-300 dark:text-neutral-100"},"СÑÑаниÑа",-1),P=["value"],Q=e("label",{class:"mb-1 block text-sm font-medium text-brand-300 dark:text-neutral-100"},"ÐозиÑиÑ",-1),W=["value"],X=e("label",{class:"mb-1 block text-sm font-medium text-brand-300 dark:text-neutral-100"},"Тип ÑодеÑжимого",-1),Y=["value"],Z={key:0,class:"space-y-3 rounded-md border border-neutral-200 p-4 dark:border-neutral-600"},$=e("h6",{class:"font-semibold text-brand-300 dark:text-neutral-100"},"ÐаннеÑ",-1),ee=e("label",{class:"mb-1 block text-sm font-medium"},"URL изобÑÐ°Ð¶ÐµÐ½Ð¸Ñ (или загÑÑзиÑе ниже)",-1),te=e("label",{class:"mb-1 block text-sm font-medium"},"ÐагÑÑзиÑÑ Ð±Ð°Ð½Ð½ÐµÑ",-1),re={key:0,class:"mt-1 text-xs text-rose-600"},le={key:1,class:"mt-1 text-xs text-emerald-700"},ae=["href"],de=e("label",{class:"mb-1 block text-sm font-medium"},"URL клика",-1),ne={key:1,class:"space-y-2 rounded-md border border-neutral-200 p-4 dark:border-neutral-600"},oe=e("h6",{class:"font-semibold text-brand-300 dark:text-neutral-100"},"HTML-код",-1),se=e("p",{class:"text-xs text-neutral-500 dark:text-neutral-400"}," ÐÑдÑÑе оÑÑоÑожнÑ: HTML вÑÑавлÑеÑÑÑ Ð½Ð° ÑÑÑаниÑÑ ÐºÐ°Ðº еÑÑÑ. ",-1),ie={key:2,class:"space-y-2 rounded-md border border-neutral-200 p-4 dark:border-neutral-600"},ue=e("h6",{class:"font-semibold text-brand-300 dark:text-neutral-100"},"ÐÑомо подкаÑÑа",-1),pe=e("label",{class:"mb-1 block text-sm font-medium"},"ID подкаÑÑа",-1),be={key:0,class:"mt-1 text-xs text-rose-600"},me={key:3,class:"space-y-2 rounded-md border border-neutral-200 p-4 dark:border-neutral-600"},ce=e("h6",{class:"font-semibold text-brand-300 dark:text-neutral-100"},"ÐÑомо подбоÑки",-1),xe=e("p",{class:"text-xs text-neutral-500"},[b("ÐведиÑе JSON: "),e("code",null,'{"type": "playlist", "id": 5}'),b(" или "),e("code",null,'{"type": "podcast_playlist", "id": 5}'),b(".")],-1),_e={key:4,class:"space-y-2 rounded-md border border-neutral-200 p-4 dark:border-neutral-600"},ke=e("h6",{class:"font-semibold text-brand-300 dark:text-neutral-100"},"ÐаÑÑÑÐµÐ»Ñ Ð¿Ñомо-подкаÑÑов",-1),ge=e("p",{class:"text-xs text-neutral-500"},[b("ÐведиÑе JSON: "),e("code",null,'{"podcast_ids": [1, 2, 3]}'),b(".")],-1),ye={class:"grid grid-cols-1 gap-4 md:grid-cols-3"},fe=e("label",{class:"mb-1 block text-sm font-medium"},"ÐÑиоÑиÑеÑ",-1),he=e("p",{class:"mt-1 text-xs text-neutral-500"},"Чем болÑÑе â Ñем вÑÑе показÑваеÑÑÑ ÑÑеди кандидаÑов на ÑÑÐ¾Ñ slug.",-1),ve=e("label",{class:"mb-1 block text-sm font-medium"},"ÐаÑало показа",-1),we=e("label",{class:"mb-1 block text-sm font-medium"},"ÐÐ¾Ð½ÐµÑ Ð¿Ð¾ÐºÐ°Ð·Ð°",-1),Ue={key:0,class:"mt-1 text-xs text-rose-600"},Ve={class:"grid grid-cols-1 gap-4 md:grid-cols-3"},Se={class:"flex items-center gap-2"},Le=e("span",{class:"text-sm"},"ÐкÑивен",-1),Me={class:"flex items-center gap-2"},Te=e("span",{class:"text-sm"},"ÐлаÑное ÑазмеÑение",-1),Ne={key:0},je=e("label",{class:"mb-1 block text-sm font-medium"},"СÑоимоÑÑÑ, â½",-1),De={class:"flex justify-end gap-3"},Fe=["disabled"],Be={__name:"AdSlotForm",props:{initial:{type:Object,default:()=>({})},pages:{type:Array,default:()=>[]},positions:{type:Array,default:()=>[]},contentTypes:{type:Array,default:()=>[]},submitUrl:{type:String,required:!0},submitMethod:{type:String,default:"post"},submitLabel:{type:String,default:"СоÑ
ÑаниÑÑ"}},setup(m){const d=m;function h(c){return c?c.slice(0,16):null}let r=D({slug:d.initial.slug??"",name:d.initial.name??"",page:d.initial.page??"home",position:d.initial.position??"top",content_type:d.initial.content_type??"banner_image",content:d.initial.content??"",image_url:d.initial.image_url??"",click_url:d.initial.click_url??"",promo_podcast_id:d.initial.promo_podcast_id??null,is_active:d.initial.is_active??!1,is_paid:d.initial.is_paid??!1,price:d.initial.price??null,priority:d.initial.priority??0,start_date:h(d.initial.start_date),end_date:h(d.initial.end_date),target_categories:d.initial.target_categories??[],banner_image_uuid:null}),x=L(null),k=L(null);async function T(c){var v,w,U,V,S;let a=(v=c.target.files)==null?void 0:v[0];if(!a)return;x.value=null;let l=new FormData;l.append("image",a);try{let _=await C.post("/api/ad-banner-images",l);r.banner_image_uuid=_.data.uuid,k.value=_.data.url}catch(_){let j=((S=(V=(U=(w=_.response)==null?void 0:w.data)==null?void 0:U.errors)==null?void 0:V.image)==null?void 0:S[0])||"ÐÑибка пÑи загÑÑзке Ñайла";x.value=j}}function N(){d.submitMethod==="patch"?r.patch(d.submitUrl):r.post(d.submitUrl)}return(c,a)=>(o(),n("form",{class:"space-y-6",onSubmit:B(N,["prevent"])},[e("div",H,[e("div",null,[J,s(e("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>t(r).name=l),type:"text",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).name]]),t(r).errors.name?(o(),n("p",R,u(t(r).errors.name),1)):p("",!0)]),e("div",null,[q,s(e("input",{"onUpdate:modelValue":a[1]||(a[1]=l=>t(r).slug=l),type:"text",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 font-mono text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100",placeholder:"home_top_banner"},null,512),[[i,t(r).slug]]),I,t(r).errors.slug?(o(),n("p",z,u(t(r).errors.slug),1)):p("",!0)])]),e("div",G,[e("div",null,[K,s(e("select",{"onUpdate:modelValue":a[2]||(a[2]=l=>t(r).page=l),class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},[(o(!0),n(y,null,f(m.pages,l=>(o(),n("option",{key:l.value,value:l.value},u(l.label),9,P))),128))],512),[[g,t(r).page]])]),e("div",null,[Q,s(e("select",{"onUpdate:modelValue":a[3]||(a[3]=l=>t(r).position=l),class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},[(o(!0),n(y,null,f(m.positions,l=>(o(),n("option",{key:l.value,value:l.value},u(l.label),9,W))),128))],512),[[g,t(r).position]])]),e("div",null,[X,s(e("select",{"onUpdate:modelValue":a[4]||(a[4]=l=>t(r).content_type=l),class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},[(o(!0),n(y,null,f(m.contentTypes,l=>(o(),n("option",{key:l.value,value:l.value},u(l.label),9,Y))),128))],512),[[g,t(r).content_type]])])]),t(r).content_type==="banner_image"?(o(),n("div",Z,[$,e("div",null,[ee,s(e("input",{"onUpdate:modelValue":a[5]||(a[5]=l=>t(r).image_url=l),type:"text",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100",placeholder:"https://example.com/banner.jpg"},null,512),[[i,t(r).image_url]])]),e("div",null,[te,e("input",{type:"file",accept:"image/png,image/jpeg",class:"block w-full text-sm",onChange:T},null,32),t(x)?(o(),n("p",re,u(t(x)),1)):p("",!0),t(k)?(o(),n("p",le,[b(" ÐагÑÑжено: "),e("a",{href:t(k),target:"_blank",class:"underline"},"пÑоÑмоÑÑ",8,ae)])):p("",!0)]),e("div",null,[de,s(e("input",{"onUpdate:modelValue":a[6]||(a[6]=l=>t(r).click_url=l),type:"text",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100",placeholder:"https://example.com/landing"},null,512),[[i,t(r).click_url]])])])):t(r).content_type==="html_code"?(o(),n("div",ne,[oe,s(e("textarea",{"onUpdate:modelValue":a[7]||(a[7]=l=>t(r).content=l),rows:"6",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dar
1k:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100",placeholder:'<div class="my-ad">â¦</div>'},null,512),[[i,t(r).content]]),se])):t(r).content_type==="promo_podcast"?(o(),n("div",ie,[ue,pe,s(e("input",{"onUpdate:modelValue":a[8]||(a[8]=l=>t(r).promo_podcast_id=l),type:"number",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).promo_podcast_id,void 0,{number:!0}]]),t(r).errors.promo_podcast_id?(o(),n("p",be,u(t(r).errors.promo_podcast_id),1)):p("",!0)])):t(r).content_type==="promo_collection"?(o(),n("div",me,[ce,xe,s(e("textarea",{"onUpdate:modelValue":a[9]||(a[9]=l=>t(r).content=l),rows:"3",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).content]])])):t(r).content_type==="promo_carousel"?(o(),n("div",_e,[ke,ge,s(e("textarea",{"onUpdate:modelValue":a[10]||(a[10]=l=>t(r).content=l),rows:"3",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).content]])])):p("",!0),e("div",ye,[e("div",null,[fe,s(e("input",{"onUpdate:modelValue":a[11]||(a[11]=l=>t(r).priority=l),type:"number",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).priority,void 0,{number:!0}]]),he]),e("div",null,[ve,s(e("input",{"onUpdate:modelValue":a[12]||(a[12]=l=>t(r).start_date=l),type:"datetime-local",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).start_date]])]),e("div",null,[we,s(e("input",{"onUpdate:modelValue":a[13]||(a[13]=l=>t(r).end_date=l),type:"datetime-local",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).end_date]]),t(r).errors.end_date?(o(),n("p",Ue,u(t(r).errors.end_date),1)):p("",!0)])]),e("div",Ve,[e("label",Se,[s(e("input",{"onUpdate:modelValue":a[14]||(a[14]=l=>t(r).is_active=l),type:"checkbox",class:"rounded"},null,512),[[M,t(r).is_active]]),Le]),e("label",Me,[s(e("input",{"onUpdate:modelValue":a[15]||(a[15]=l=>t(r).is_paid=l),type:"checkbox",class:"rounded"},null,512),[[M,t(r).is_paid]]),Te]),t(r).is_paid?(o(),n("div",Ne,[je,s(e("input",{"onUpdate:modelValue":a[16]||(a[16]=l=>t(r).price=l),type:"number",step:"0.01",class:"w-full rounded border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-500 dark:bg-neutral-800 dark:text-neutral-100"},null,512),[[i,t(r).price,void 0,{number:!0}]])])):p("",!0)]),e("div",De,[F(t(O),{href:"/admin/ad-slots",class:"rounded-md bg-neutral-200 px-4 py-2 text-sm text-neutral-700 hover:bg-neutral-300 dark:bg-neutral-600 dar
1k:text-neutral-100"},{default:A(()=>[b(" ÐÑмена ")]),_:1}),e("button",{type:"submit",class:"rounded-md bg-brand-300 px-4 py-2 text-sm font-medium text-white hover:bg-brand-200 disabled:opacity-50 dark:bg-neutral-100 dark:text-brand-300",disabled:t(r).processing},u(m.submitLabel),9,Fe)])],40,E))}};export{Be 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.