import{sasTe,yasfe,Eas_t,zasjt,Sasct,casFt,uasVt,gasLt,aasMt,easP,basC,Fasbe,dasS,fasH,iash,jasO,pasd,aaasje,qasie,k,lasM,wasR,abaszt,acasVe,nashe,xasze,a8asJe,BasHe,LasJ,Masde,adasse,tasK,hasG,masPe,raspt,vasqt,oasgt,aeasAe}from"../chunks/scheduler.ncJpckHt.js";import{SasCe,iasOe,casD,basy,masI,tasv,aasw,dasE,fasee,gasDe,easIe}from"../chunks/index.DNKwBhZH.js";import{gas_e,aasce}from"../chunks/spread.CgU5AtxT.js";import{zasoe,Faspe,sasBt,aasHt,Cas$e,basMe,casEe,dasve,IasLe,SasRt,TasXt}from"../chunks/textarea.CdBkX6LG.js";import"../chunks/entry.Cu4pHBTQ.js";import{tasbt}from"../chunks/Toaster.svelte_svelte_type_style_lang.C_CyLwr0.js";import{casZe}from"../chunks/config.ah9CROzn.js";import"../chunks/index.Bf9t7sah.js";import{BasWt}from"../chunks/button.Dry7Ezxz.js";functionYt(n){lete;constt=n[1].default,l=Ft(t,n,n[4],null);return{c(){l&&l.c()},l(s){l&&l.l(s)},m(s,i){l&&l.m(s,i),e=!0},p(s,i){l&&l.p&&(!e||i&16)&&Vt(l,t,s,s[4],e?Mt(t,s[4],i,null):Lt(s[4]),null)},i(s){e||(v(l,s),e=!0)},o(s){w(l,s),e=!1},d(s){l&&l.d(s)}}}functionKt(n){lete,t;constl=[{type:"submit"},n[0]];lets={$$slots:{default:[Yt]},$$scope:{ctx:n}};for(leti=0;i<l.length;i+=1)s=fe(s,l[i]);returne=newWt({props:s}),e.$on("click",n[2]),e.$on("keydown",n[3]),{c(){D(e.$$.fragment)},l(i){y(e.$$.fragment,i)},m(i,f){I(e,i,f),t=!0},p(i,[f]){constr=f&1?_e(l,[l[0],ce(i[0])]):{};f&16&&(r.$$scope={dirty:f,ctx:i}),e.$set(r)},i(i){t||(v(e.$$.fragment,i),t=!0)},o(i){w(e.$$.fragment,i),t=!1},d(i){E(e,i)}}}functionGt(n,e,t){constl=[];lets=_t(e,l),{$$slots:i={},$$scope:f}=e;functionr(u){ct.call(this,n,u)}functiona(u){ct.call(this,n,u)}returnn.$$set=u=>{e=fe(fe({},e),jt(u)),t(0,s=_t(e,l)),"$$scope"inu&&t(4,f=u.$$scope)},[s,i,r,a,f]}classJtextendsCe{constructor(e){super(),Oe(this,e,Gt,Kt,Te,{})}}constQt=oe.object({id:oe.string(),name:oe.string().min(4).max(16),primary_color_hex:oe.string().length(7),secondary_color_hex:oe.string().length(7),text_color_hex:oe.string().length(7),domain:oe.string(),use_freebie:oe.boolean(),freebie_name:oe.string(),freebie_url:oe.string(),freebie_image_url:oe.string(),freebie_text:oe.string(),title:oe.string(),subtitle:oe.string()}).superRefine((n,e)=>{console.log(n),n.use_freebie&&((!n.freebie_name||n.freebie_name.length===0)&&e.addIssue({path:["freebie_name"],message:"A freebie name' is required when 'Use freebie' is true.",code:"custom"}),n.freebie_url||e.addIssue({path:["freebie_url"],message:"A freebie file is required when 'Use freebie' is true.",code:"custom"}),n.freebie_image_url||e.addIssue({path:["freebie_image"],message:"'freebie_image' is required when 'use_freebie' is true.",code:"custom"}))});varZt={grad:.9,turn:360,rad:360/(2*Math.PI)},Fe=function(n){returntypeofn=="string"?n.length>0:typeofn=="number"},ne=function(n,e,t){returne===void0&&(e=0),t===void0&&(t=Math.pow(10,e)),Math.round(t*n)/t+0},ge=function(n,e,t){returne===void0&&(e=0),t===void0&&(t=1),n>t?t:n>e?n:e},Ut=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},ht=function(n){return{r:ge(n.r,0,255),g:ge(n.g,0,255),b:ge(n.b,0,255),a:ge(n.a)}},xe=function(n){return{r:ne(n.r),g:ne(n.g),b:ne(n.b),a:ne(n.a,3)}},xt=/^#([0-9a-f]{3,8})$/i,We=function(n){vare=n.toString(16);returne.length<2?"0"+e:e},Pt=function(n){vare=n.r,t=n.g,l=n.b,s=n.a,i=Math.max(e,t,l),f=i-Math.min(e,t,l),r=f?i===e?(t-l)/f:i===t?2+(l-e)/f:4+(e-t)/f:0;return{h:60*(r<0?r+6:r),s:i?f/i*100:0,v:i/255*100,a:s}},St=function(n){vare=n.h,t=n.s,l=n.v,s=n.a;e=e/360*6,t/=100,l/=100;vari=Math.floor(e),f=l*(1-t),r=l*(1-(e-i)*t),a=l*(1-(1-e+i)*t),u=i%6;return{r:255*[l,r,f,f,a,l][u],g:255*[a,l,l,r,f,f][u],b:255*[f,f,a,l,l,r][u],a:s}},dt=function(n){return{h:Ut(n.h),s:ge(n.s,0,100),l:ge(n.l,0,100),a:ge(n.a)}},$t=function(n){return{h:ne(n.h),s:ne(n.s),l:ne(n.l),a:ne(n.a,3)}},vt=function(n){returnSt((t=(e=n).s,{h:e.h,s:(t*=((l=e.l)<50?l:100-l)/100)>0?2*t/(l+t)*100:0,v:l+t,a:e.a}));vare,t,l},Re=function(n){return{h:(e=Pt(n)).h,s:(s=(200-(t=e.s))*(l=e.v)/100)>0&&s<200