import{H as j,I as v,J as E,T as h,L as A,r as P,M as a,j as o,N as r,a0 as k,F as _,aw as f,S as M,at as L,af as F}from"./main-fine-mails-rush.js";import{u as z,C as B}from"./CronWarning-XlRnedJG.js";import{C as s}from"./index-CYdJlGpp.js";import{S as U}from"./index-_4I6v-bI.js";import"./EllipsisOutlined-Bu1rzp5h.js";import"./Dropdown-4_vtvAKA.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function O(){const e=j(),{isPending:t,mutateAsync:c}=v({mutationFn:async i=>E("pro_settings/external-cron/update",{settings:i},void 0,"POST"),onSuccess:i=>{if("errors"in i.data)return i;e.invalidateQueries({queryKey:["all-settings"]})}});return{isUpdatingProSettings:t,updateProSettings:c}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const{Paragraph:N,Text:W,Title:Y}=h;globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};const{Paragraph:$,Text:g,Title:y}=h;var q={name:"1p2emnz",styles:"color:#4059ff !important;font-size:16px !important"};function I(){var p,m;const{token:e}=A.useToken(),t=`wget -O /dev/null ${f.SITE_URL}/wp-cron.php?doing_wp_cron > /dev/null 2>&1`,{isUpdatingProSettings:c,updateProSettings:i}=O(),{allSettings:n,isLoadingSettings:C}=z(),[l,d]=P.useState({}),S=async(u,T)=>{if(n!=null&&n.proSettings){const w=F(n.proSettings,x=>{x.cron[u]=T}),{data:b}=await i(w);if("errors"in b){d(b.errors);return}d({})}};return a(s,{style:{backgroundColor:e.colorFillAlter},children:[o(y,{level:4,children:r("Cron Setup")}),a($,{children:[r("All settings here"),a(h.Link,{href:"https://bit-social.com/documentation/setting/setup-cron-jobs/",rel:"noopener noreferrer nofollow",target:"_blank",underline:!0,children:[r("Doc here"),o(k,{size:12,style:{transform:"translateY(-2px)"}})]})]}),a(s,{style:{marginBottom:16},children:[o(s.Meta,{description:a(_,{children:[r("For more accurate results, you must establish a genuine"),o(h.Link,{href:"https://bit-social.com/documentation/setting/setup-cron-jobs/",rel:"noopener noreferrer nofollow",target:"_blank",underline:!0,children:r("Cron job")}),r("on your hosting or server and enable this option to disregard the built-in Cron job.Otherwise, the auto-post and scheduling tools might not operate promptly, and you might have delays.")]}),style:{marginBottom:8},title:r("Cron Job settings")}),o(B,{type:"settings"}),o(y,{level:5,children:r("For your website, the Cron Job command is:")}),o(g,{copyable:{text:t},css:q,children:t})]}),a(s,{style:{marginBottom:16},children:[o(s.Meta,{description:r("Activate Bit Social's external cron feature for continuous cron job operation even if there is no user's hit on your website. This cron will automatically awake your website externally and your scheduled post will automatically publish on your desired social platforms!"),style:{marginBottom:8},title:r("External Cron")}),a(M,{children:[o(g,{strong:!0,children:r("Enable External Cron")}),o(U,{checked:!!((m=(p=n==null?void 0:n.proSettings)==null?void 0:p.cron)!=null&&m.isExternalCronEnabled),disabled:!f.IS_PRO||C||c,onChange:u=>S("isExternalCronEnabled",u),size:"small"}),c&&o(L,{size:"small"})]}),o("div",{children:l&&o(g,{type:"danger",children:l==null?void 0:l.isExternalCronEnabled})})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(e,t){return this.cache.has(e)?this.cache.get(e):(this.cache.set(e,t),t)}};function G(){return o(I,{})}export{G as default};
