import{u as b,a as v,b as x}from"./notifier-D0ifK1Rl.js";import{e as k,r as w,g as B,c,o as u,b as s,t as d,s as r,a as i,h,u as l,d as f,F as C}from"./app-CMIR6SQ7.js";const F={class:"mr:8 font:24"},A={class:"mt:16 r:4 rel bg:white p:24"},I={class:"mx:auto max-w:512"},T={role:"list",class:"m:0 mt:24 bt:1|solid|gray-20 {by:1|solid|gray-20}>*+*"},Y={class:"m:0"},N={class:"rel flex items-start gap-x:12 py:16"},S={class:"flex-shrink:0"},j={class:r(["bg:blue-50","inline-flex h:40 w:40 align-items:center justify-content:center r:8"])},D={class:"flex-shrink:0 align-self:center"},P=["disabled"],R={class:"m:0"},V={class:"rel flex items-start gap-x:12 py:16"},q={class:"flex-shrink:0"},M={class:r(["bg:pink-50","inline-flex h:40 w:40 align-items:center justify-content:center r:8"])},O={class:"min-w:0 flex-grow:1"},W={class:"m:0 font:14 font:medium fg:yellow-80"},z={class:"flex-shrink:0 align-self:center"},E=["disabled"],U={class:"mt:24 r:8 bg:sky-60/.10 p:16"},G={class:"flex"},H={class:"flex-shrink:0"},Q={__name:"CustomFontsBricks",setup(J){const e=b(),m=v(),p=x(),a=k({import:!1,cleanup:!1});function y(){if(!confirm(a.value.import?"You have already imported the fonts data. Are you sure you want to import it again?":"Are you sure you want to import the fonts data?"))return;e.add("migrations.index:import-fonts");let o=m.request({method:"POST",url:"/migrations/bricks-custom-fonts/import-fonts"}).then(t=>{a.value.import=!0}).finally(()=>{e.remove("migrations.index:import-fonts")});p.async(o,"Fonts data imported successfully.","Failed to import fonts data.","Importing fonts data...")}function _(){if(!confirm(a.value.import?a.value.cleanup?"You have already cleaned up the Custom Fonts [Bricks] data. Are you sure you want to clean it up again?":"Are you sure you want to clean up the Custom Fonts [Bricks] data?":"You have not imported the fonts data. Are you sure you want to clean up the Custom Fonts [Bricks] data?"))return;e.add("migrations.index:cleanup-fonts");let o=m.request({method:"POST",url:"/migrations/bricks-custom-fonts/clean-up"}).then(t=>{a.value.cleanup=!0}).finally(()=>{e.remove("migrations.index:cleanup-fonts")});p.async(o,"Custom Fonts [Bricks] data cleaned up successfully.","Failed to clean up Custom Fonts [Bricks] data.","Cleaning up Custom Fonts [Bricks] data...")}return(o,t)=>{const n=w("Icon"),g=B("ripple");return u(),c(C,null,[s("span",F,"» "+d(o.__("Custom Fonts [Bricks]","yabe-webfont")),1),s("div",A,[s("div",I,[t[4]||(t[4]=s("h2",{class:"m:0 font:semibold lh:1.5 fg:gray-80"}," Custom Fonts [Bricks] → Yabe Webfont ",-1)),t[5]||(t[5]=s("p",{class:"m:0 mt:4 font:14 fg:gray-50"}," Migrate your custom fonts from Bricks to Yabe Webfont. Manage your fonts in one place, and use them across visual builders. ",-1)),s("ul",T,[s("li",Y,[s("div",N,[s("div",S,[s("span",j,[i(n,{icon:"fa6-solid:file-import",class:"h:24 w:24 fg:white fill:current"})])]),t[0]||(t[0]=s("div",{class:"min-w:0 flex-grow:1"},[s("p",{class:"m:0 font:14 font:medium text-gray-900"}," Import fonts "),s("p",{class:"m:0 font:14 fg:gray-50"}," Import the fonts data from the Custom Fonts [Bricks] feature. ")],-1)),s("div",D,[h((u(),c("button",{type:"button",disabled:l(e).isBusy,onClick:y,class:"button flex align-items:center gap-x:8"},[i(n,{icon:"fa6-solid:spinner",class:r([{hidden:!l(e).hasTask("migrations.index:import-fonts")},"animation:rotate|1.2s|infinite|linear fill:current"])},null,8,["class"]),f(" "+d(o.__("Run","yabe-webfont")),1)],8,P)),[[g]])])])]),s("li",R,[s("div",V,[s("div",q,[s("span",M,[i(n,{icon:"fa6-solid:broom",class:"h:24 w:24 fg:white fill:current"})])]),s("div",O,[s("p",W,[i(n,{icon:"fa6-solid:triangle-exclamation"}),t[1]||(t[1]=f(" Clean up "))]),t[2]||(t[2]=s("p",{class:"m:0 font:14 fg:gray-50"}," Remove the fonts data from the Custom Fonts [Bricks] feature. ",-1))]),s("div",z,[h((u(),c("button",{type:"button",disabled:l(e).isBusy,onClick:_,class:"button flex align-items:center gap-x:8"},[i(n,{icon:"fa6-solid:spinner",class:r([{hidden:!l(e).hasTask("migrations.index:cleanup-fonts")},"animation:rotate|1.2s|infinite|linear fill:current"])},null,8,["class"]),f(" "+d(o.__("Run","yabe-webfont")),1)],8,E)),[[g]])])])])]),s("div",U,[s("div",G,[s("div",H,[i(n,{icon:"fa6-solid:circle-info",class:"h:20 w:20 fg:blue-40"})]),t[3]||(t[3]=s("div",{class:"ml:12 flex-grow:1 flex justify-content:between"},[s("p",{class:"m:0 font:14 fg:blue-70"}," Please make a backup of your database before running the migration. ")],-1))])])])])],64)}}};export{Q as default};
