1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8452],{4080:(e,t,a)=>{a.d(t,{Me:()=>o,_q:()=>s._,cn:()=>l,nM:()=>i});var r=a(30553),n=a(13153),s=a(4196);function l(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function o(e){if(!e||"string"!=typeof e)return"";let t=e.trim();if(!t)return"";if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("data:"))return t;try{let e=t;for(let t=0;t<2;t++)if((e=decodeURIComponent(e)).startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("data:"))return e}catch(e){}return"/".concat(t)}function i(e){return 1/0}},4196:(e,t,a)=>{a.d(t,{_:()=>n});var r=a(76426);let n=async(e,t)=>{try{let a=await fetch(e);if(!a.ok)throw Error("Network response was not ok");let r=await a.blob(),n=window.URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=t||"download",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(n)}catch(t){r.vF.error("Download failed",t),window.open(e,"_blank")}}},11917:(e,t,a)=>{a.d(t,{Tw:()=>u,ik:()=>o,oW:()=>i.A,ky:()=>c.A,yY:()=>l,li:()=>m,H0:()=>s,cw:()=>r.A,Fi:()=>d.A,pd:()=>f.p});var r=a(65183),n=a(54456);function s(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 256 256",children:(0,n.jsx)("g",{transform:"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)",children:(0,n.jsx)("path",{d:"M 66.537 41.713 c -0.388 -0.186 -0.781 -0.365 -1.18 -0.536 c -0.695 -12.8 -7.689 -20.128 -19.433 -20.203 c -0.053 0 -0.106 0 -0.159 0 c -7.025 0 -12.867 2.998 -16.462 8.455 l 6.459 4.431 c 2.686 -4.076 6.902 -4.944 10.007 -4.944 c 0.036 0 0.072 0 0.107 0 c 3.867 0.025 6.785 1.149 8.673 3.341 c 1.374 1.596 2.294 3.802 2.749 6.586 c -3.428 -0.583 -7.136 -0.762 -11.1 -0.535 c -11.166 0.643 -18.344 7.155 -17.862 16.204 c 0.245 4.59 2.531 8.539 6.438 11.118 c 3.303 2.181 7.558 3.247 11.98 3.006 c 5.84 -0.32 10.421 -2.548 13.617 -6.622 c 2.427 -3.094 3.962 -7.103 4.64 -12.155 c 2.783 1.68 4.845 3.89 5.985 6.547 c 1.937 4.516 2.05 11.938 -4.006 17.989 c -5.306 5.301 -11.684 7.594 -21.322 7.665 c -10.692 -0.079 -18.778 -3.508 -24.035 -10.192 C 16.708 65.609 14.164 56.57 14.069 45 c 0.095 -11.57 2.639 -20.609 7.562 -26.867 C 26.888 11.449 34.974 8.02 45.666 7.941 c 10.769 0.08 18.996 3.525 24.455 10.241 c 2.677 3.293 4.695 7.435 6.025 12.264 l 7.569 -2.019 c -1.613 -5.944 -4.15 -11.066 -7.603 -15.313 C 69.114 4.503 58.88 0.091 45.693 0 H 45.64 c -13.16 0.091 -23.28 4.52 -30.079 13.162 c -6.05 7.691 -9.171 18.392 -9.275 31.806 l 0 0.032 l 0 0.032 c 0.105 13.414 3.226 24.116 9.275 31.806 C 22.359 85.48 32.479 89.909 45.64 90 h 0.053 c 11.7 -0.081 19.947 -3.144 26.741 -9.932 c 8.889 -8.88 8.621 -20.012 5.692 -26.845 C 76.024 48.322 72.016 44.342 66.537 41.713 z M 46.335 60.706 c -4.894 0.276 -9.978 -1.921 -10.229 -6.626 c -0.186 -3.488 2.483 -7.381 10.529 -7.845 c 0.921 -0.053 1.826 -0.079 2.714 -0.079 c 2.923 0 5.657 0.284 8.143 0.827 C 56.565 58.563 51.127 60.443 46.335 60.706 z"})})})}function l(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,n.jsx)("path",{d:"M8 0a8 8 0 0 0-2.915 15.452c-.07-.633-.134-1.606.027-2.297.146-.625.938-3.977.938-3.977s-.239-.479-.239-1.187c0-1.113.645-1.943 1.448-1.943.682 0 1.012.512 1.012 1.127 0 .686-.437 1.712-.663 2.663-.188.796.4 1.446 1.185 1.446 1.422 0 2.515-1.5 2.515-3.664 0-1.915-1.377-3.254-3.342-3.254-2.276 0-3.612 1.707-3.612 3.471 0 .688.265 1.425.595 1.826a.24.24 0 0 1 .056.23c-.061.252-.196.796-.222.907-.035.146-.116.177-.268.107-1-.465-1.624-1.926-1.624-3.1 0-2.523 1.834-4.84 5.286-4.84 2.775 0 4.932 1.977 4.932 4.62 0 2.757-1.739 4.976-4.151 4.976-.811 0-1.573-.421-1.834-.919l-.498 1.902c-.181.695-.669 1.566-.995 2.097A8 8 0 1 0 8 0"})})}function o(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,n.jsx)("path",{d:"M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625
1h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951"})})}a(27412);var i=a(47625),d=a(95824),c=a(46215);function u(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"none",stroke:"currentColor",className:t,viewBox:"0 0 24 24",strokeWidth:"2",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}function m(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,n.jsx)("svg",{width:a,height:a,className:t,fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M10 3.158V7.51c-5.428.223-8.27 3.75-8.875 11.199-.04.487-.07.975-.09 1.464l-.014.395c-.014.473.578.684.88.32.302-.368.61-.73.925-1.086l.244-.273c1.79-1.967 3-2.677 4.93-2.917a18.011 18.011 0 012-.112v4.346a1 1 0 001.646.763l9.805-8.297 1.55-1.31-1.55-1.31-9.805-8.297A1 1 0 0010 3.158Zm2 6.27v.002-4.116l7.904 6.688L12 18.689v-4.212l-2.023.024c-1.935.022-3.587.17-5.197 1.024a9 9 0 00-1.348.893c.355-1.947.916-3.39 1.63-4.425 1.062-1.541 2.607-2.385 5.02-2.485L12 9.428Z"})})}var f=a(28586)},16754:(e,t,a)=>{a.d(t,{M:()=>o,v:()=>i});var r=a(54456),n=a(11917),s=a(70901);let l={instagram:n.oW,facebook:n.ik,tiktok:n.cw,threads:n.H0,linkedin:n.ky,pinterest:n.yY,twitter:n.Fi,x:n.Fi,youtube:n.pd};function o(e){var t;return null!=(t=l[(null!=e?e:"").toLowerCase()])?t:null}function i(e){let{platform:t,size:a,colored:n=!0,className:l}=e,i=o(t);if(!i)return null;let d=n?(0,s.PE)(t):"",c=[l?"":"w-[".concat(null!=a?a:12,"px] h-[").concat(null!=a?a:12,"px]"),d,l].filter(Boolean).join(" ");return(0,r.jsx)(i,{className:c,size:null!=a?a:12})}},27313:(e,t,a)=>{a.d(t,{Hr:()=>u,Ht:()=>p,SQ:()=>m,V0:()=>g,_2:()=>f,hO:()=>h,mB:()=>x,rI:()=>d,ty:()=>c});var r=a(54456),n=a(27412),s=a(56747),l=a(94700),o=a(99740),i=a(4080);let d=s.bL,c=s.l9;s.YJ,s.ZL,s.Pb;let u=s.z6;n.forwardRef((e,t)=>{let{className:a,inset:n,children:o,...d}=e;return(0,r.jsxs)(s.ZP,{ref:t,className:(0,i.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",a),...d,children:[o,(0,r.jsx)(l.A,{className:"ml-auto h-4 w-4"})]})}).displayName=s.ZP.displayName,n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.G5,{ref:t,className:(0,i.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...n})}).displayName=s.G5.displayName;let m=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...l}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{ref:t,sideOffset:n,className:(0,i.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-white",a),...l})})});m.displayName=s.UC.displayName;let f=n.forwardRef((e,t)=>{let{className:a,inset:n,...l}=e;return(0,r.jsx)(s.q7,{ref:t,className:(0,i.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100 data-[highlighted]:bg-gray-100 data-[highlighted]:text-gray-900 dark:data-[highlighted]:bg-gray-800 dark:data-[highlighted]:text-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",a),...l})});f.displayName=s.q7.displayName;let h=n.forwardRef((e,t)=>
1{let{className:a,children:n,checked:l,...d}=e;return(0,r.jsxs)(s.H_,{ref:t,className:(0,i.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:l,...d,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})}),n]})});h.displayName=s.H_.displayName;let p=n.forwardRef((e,t)=>{let{className:a,children:n,...l}=e;return(0,r.jsxs)(s.hN,{ref:t,className:(0,i.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})}),n]})});p.displayName=s.hN.displayName,n.forwardRef((e,t)=>{let{className:a,inset:n,...l}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,i.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",a),...l})}).displayName=s.JU.displayName;let x=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,i.cn)("-mx-1 my-1 h-px bg-muted",a),...n})});x.displayName=s.wv.displayName;let g=e=>{let{className:t,...a}=e;return(0,r.jsx)("span",{className:(0,i.cn)("ml-auto text-xs tracking-widest opacity-60",t),...a})};g.displayName="DropdownMenuShortcut"},28586:(e,t,a)=>{a.d(t,{p:()=>n});var r=a(54456);a(27412);let n=e=>{let{className:t="w-4 h-4",size:a=16}=e;return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:[(0,r.jsx)("path",{fill:"red",d:"M14.712 4.633a1.754 1.754 0 00-1.234-1.234C12.382 3.11 8 3.11 8 3.11s-4.382 0-5.478.289c-.6.161-1.072.634-1.234 1.234C1 5.728 1 8 1 8s0 2.283.288 3.367c.162.6.635 1.073 1.234 1.234C3.618 12.89 8 12.89 8 12.89s4.382 0 5.478-.289a1.754 1.754 0 001.234-1.234C15 10.272 15 8 15 8s0-2.272-.288-3.367z"}),(0,r.jsx)("path",{fill:"#ffffff",d:"M6.593 10.11l3.644-2.098-3.644-2.11v4.208z"})]})}},38452:(e,t,a)=>{a.r(t),a.d(t,{default:()=>N});var r=a(54456),n=a(12933),s=a(86110),l=a(95907),o=a(77101),i=a(75509),d=a(24288),c=a(82840),u=a(44620);let m=[{dow:1,key:"mon"},{dow:2,key:"tue"},{dow:3,key:"wed"},{dow:4,key:"thu"},{dow:5,key:"fri"},{dow:6,key:"sat"},{dow:0,key:"sun"}];function f(e,t){let a=[];for(let{dow:e}of m){let r=t[e];if(null==r?void 0:r.enabled)for(let t of r.times)a.push([e,t.time,t.accountId])}return a.sort((e,t)=>e[0]-t[0]||e[1].localeCompare(t[1])||e[2].localeCompare(t[2])),JSON.stringify({name:e.trim(),slots:a})}var h=a(27313),p=a(51482),x=a(99740),g=a(85766);function b(e){let{active:t,onClick:a,label:n,platform:s}=e;return(0,r.jsxs)("button",{type:"button",onClick:a,className:"inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-[12.5px] font-semibold transition ".concat(t?"border-[#1d1b30] bg-[#1d1b30] text-white":"border-gray-200 bg-white text-gray-500 hover:border-gray-300 dark:border-gray-600 dark:bg-gray-800"),children:[s&&(0,r.jsx)("span",{className:"grid h-[18px] w-[18px] place-items-center rounded-[5px] ".concat(t?"bg-white":""),children:(0,r.jsx)(g.jE,{platform:s,size:14})}),n]})}function w(e){let{accounts:t,value:a,onChange:n}=e,s=t.find(e=>e.id===a);return(0,r.jsxs)(h.rI,{children:[(0,r.jsx)(h.ty,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",title:(null==s?void 0:s.username)||(null==s?void 0:s.platform),className:"inline-flex items-center gap-1 rounded-md px-1 py-0.5 hover:bg-white/70 dark:hover:bg-gray-600",children:[(0,r.jsx)(g.jE,{platform:(null==s?void 0:s.platform)||"unknown",size:16}),(0,r.jsx)(p.A,{className:"h-3 w-3 text-gray-400"})]})}),(0,r.jsx)(h.SQ,{align:"start",className:"bg-white",children:t.map(e=>(0,r.jsxs)(h._2,{onClick:()=>e.id&&n(e.id),className:"cursor-pointer gap-2",children:[(0,r.jsx)(g.jE,{platform:e.platform,size:15}),(0,r.jsx)("span",{className:"truncate",children:e.username||e.platform}),e.id===a&&(0,r.jsx)(x.A,{className:"ml-auto h-3.5 w-3.5 text-[#ec4899]"})]},e.id))})]})}var v=a(30694),y=a(46916),k=a(79101),j=a(27412);function N(e){let{scheduleId:t}=e,a=(0,s.c)("postingSchedule"),h=(0,n.useRouter)(),{schedule:p,isLoading:x,accounts:g,name:N,setName:C,days:_,scope:A,setScope:M,editingName:z,setEditingName:F,justSaved:S,isDirty:L,saving:E,addTime:B,removeTime:R,setChipAccount:U,setTime:I,toggleDay:T,totalSlots:H,totalDays:P,handleSave:W}=function(e){var t,a;let{data:r,isLoading:n}=(0,k.UN)(),{data:s}=(0,y.GM)(),l=(0,k.ZK)(),o=(0,k.Cw)(),i=(0,j.useMemo)(()=>null==r?void 0:r.find(t=>
1t.id===e),[r,e]),[d,c]=(0,j.useState)(""),[u,h]=(0,j.useState)({}),[p,x]=(0,j.useState)("all"),[g,b]=(0,j.useState)(!1),[w,v]=(0,j.useState)(!1),[N,C]=(0,j.useState)(null),_=null!=(a=null==s||null==(t=s[0])?void 0:t.id)?a:"";(0,j.useEffect)(()=>{if(!i||!_)return;let e=function(e,t){var a,r,n;let s={};for(let{dow:e}of m)s[e]={enabled:!1,times:[]};for(let l of[...null!=(a=e.slots)?a:[]].sort((e,t)=>e.sort_order-t.sort_order||e.time_of_day.localeCompare(t.time_of_day)))s[l.day_of_week]&&(l.is_enabled&&(s[l.day_of_week].enabled=!0),s[l.day_of_week].times.push({id:l.id,time:l.time_of_day.slice(0,5),accountId:null!=(n=null==(r=l.account_ids)?void 0:r[0])?n:t}));return s}(i,_);c(i.name),h(e),C(f(i.name,e))},[i,_]);let A=null!==N&&f(d,u)!==N,M=m.reduce((e,t)=>{var a;return e+((null==(a=u[t.dow])?void 0:a.enabled)?u[t.dow].times.length:0)},0),z=m.filter(e=>{var t;return(null==(t=u[e.dow])?void 0:t.enabled)&&u[e.dow].times.length>0}).length,F=async()=>{if(!i)return;let e=[],t=0;for(let{dow:a}of m){let r=u[a];if(null==r?void 0:r.enabled)for(let n of r.times)e.push({day_of_week:a,time_of_day:n.time,account_ids:n.accountId?[n.accountId]:[],is_enabled:!0,sort_order:t++})}d.trim()&&d.trim()!==i.name&&await o.mutateAsync({id:i.id,name:d.trim()}),await l.mutateAsync({id:i.id,slots:e}),C(f(d,u)),v(!0),setTimeout(()=>v(!1),1800)};return{schedule:i,isLoading:n,accounts:s,name:d,setName:c,days:u,scope:p,setScope:x,editingName:g,setEditingName:b,justSaved:w,isDirty:A,saving:l.isPending||o.isPending,addTime:e=>{let t="all"===p?(null!=s?s:[]).map(e=>e.id).filter(Boolean):[p];0!==t.length&&h(a=>({...a,[e]:{enabled:!0,times:[...a[e].times,...t.map(e=>({id:"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.round(1e6*Math.random())),time:"09:00",accountId:e}))]}}))},removeTime:(e,t)=>{h(a=>({...a,[e]:{...a[e],times:a[e].times.filter(e=>e.id!==t)}}))},setChipAccount:(e,t,a)=>{h(r=>({...r,[e]:{...r[e],times:r[e].times.map(e=>e.id===t?{...e,accountId:a}:e)}}))},setTime:(e,t,a)=>{h(r=>({...r,[e]:{...r[e],times:r[e].times.map(e=>e.id===t?{...e,time:a}:e)}}))},toggleDay:(e,t)=>{h(a=>({...a,[e]:{...a[e],enabled:t}}))},totalSlots:M,totalDays:z,handleSave:F}}(t);return x||!p?(0,r.jsx)(v.M,{}):(0,r.jsx)("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-900",children:(0,r.jsxs)("div",{className:"mx-auto max-w-[1180px] px-6 pb-16 pt-5 sm:px-8",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>h.push("/posting-schedule"),className:"mb-3 inline-flex items-center gap-1.5 text-[13px] font-semibold text-gray-400 transition-colors hover:text-[#be2a6c]",children:[(0,r.jsx)(l.A,{className:"h-[15px] w-[15px]"})," ",a("back")]}),(0,r.jsxs)("div",{className:"mb-[22px] flex items-start gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[z?(0,r.jsx)("input",{autoFocus:!0,value:N,onChange:e=>C(e.target.value),onBlur:()=>F(!1),onKeyDown:e=>{("Enter"===e.key||"Escape"===e.key)&&F(!1)},placeholder:a("editor.namePlaceholder"),className:"min-w-0 flex-1 border-b-2 border-[#ec4899] bg-transparent pb-0.5 font-poppins text-[26px] font-semibold tracking-tight text-[#1d1b30] outline-none dark:text-white"}):(0,r.jsx)("h1",{className:"font-poppins text-[26px] font-semibold tracking-tight text-[#1d1b30] dark:text-white",children:N||a("editor.untitled")}),(0,r.jsx)("button",{type:"button",onClick:()=>F(!0),"aria-label":a("edit"),className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg border border-gray-200 bg-white text-gray-500 transition hover:border-[#fdeef6] hover:text-[#be2a6c] dark:border-gray-700 dark:bg-gray-800",children:(0,r.jsx)(o.A,{className:"h-[15px] w-[15px]"})})]}),(0,r.jsx)("p",{className:"mt-1.5 max-w-[56ch] text-sm leading-relaxed text-gray-500",children:a("editor.subtitle")})]}),(0,r.jsxs)("button",{type:"button",onClick:W,disabled:E||!L,className:"inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-[#ec4899] px-3.5 py-2 text-[13px] font-bold text-white transition hover:opacity-95 disabled:cursor-not-allowed disabled:opacity-40",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"}),S?a("editor.saved"):a("editor.saveChanges")]})]}),(0,r.jsxs)("div",{className:"mb-[18px] flex flex-wrap items-center gap-2.5 rounded-2xl border border-gray-100 bg-[#fafafb] px-4 py-3.5 dar
1k:border-gray-700 dark:bg-gray-800/40",children:[(0,r.jsx)("span",{className:"text-[13px] font-bold text-gray-500",children:a("editor.scopeLabel")}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(b,{active:"all"===A,onClick:()=>M("all"),label:a("allChannels")}),(null!=g?g:[]).map(e=>(0,r.jsx)(b,{active:A===e.id,onClick:()=>e.id&&M(e.id),label:e.username||e.platform,platform:e.platform},e.id))]})]}),(0,r.jsx)("div",{className:"overflow-hidden rounded-[18px] border border-gray-100 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800",children:m.map((e,t)=>{var n;let{dow:s,key:l}=e,o=null!=(n=_[s])?n:{enabled:!1,times:[]};return(0,r.jsxs)("div",{className:"flex items-center gap-4 px-[18px] py-[15px] ".concat(t>0?"border-t border-gray-100 dark:border-gray-700":""," ").concat(o.enabled?"":"bg-[#fafafb] dark:bg-gray-800/40"),children:[(0,r.jsxs)("div",{className:"flex flex-[0_0_150px] items-center gap-3",children:[(0,r.jsx)(u.d,{checked:o.enabled,onCheckedChange:e=>T(s,e),className:"data-[state=checked]:bg-[#ec4899] dark:data-[state=checked]:bg-[#ec4899]"}),(0,r.jsxs)("span",{className:"font-poppins text-[15px] font-semibold text-[#1d1b30] dark:text-white",children:[a("days.".concat(l)),!o.enabled&&(0,r.jsx)("small",{className:"block font-sans text-[11.5px] font-semibold text-gray-400",children:a("editor.paused")})]})]}),o.enabled?(0,r.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-2.5",children:[o.times.map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-[10px] border border-gray-200 bg-[#f5f5f8] py-[7px] pl-3 pr-[9px] text-[13px] font-bold text-[#1d1b30] dark:border-gray-600 dark:bg-gray-700 dark:text-white",children:[(0,r.jsx)("input",{type:"time",value:e.time,onChange:t=>I(s,e.id,t.target.value),className:"bg-transparent text-[13px] font-bold outline-none [color-scheme:light]"}),(0,r.jsx)(w,{accounts:null!=g?g:[],value:e.accountId,onChange:t=>U(s,e.id,t)}),(0,r.jsx)("button",{type:"button",onClick:()=>R(s,e.id),className:"grid h-[18px] w-[18px] place-items-center rounded-md text-gray-400 hover:bg-white hover:text-[#be2a6c]","aria-label":"remove",children:(0,r.jsx)(d.A,{className:"h-3 w-3"})})]},e.id)),(0,r.jsxs)("button",{type:"button",onClick:()=>B(s),className:"inline-flex items-center gap-1.5 rounded-[10px] border border-dashed border-[#ec4899] bg-white px-3 py-[7px] text-[12.5px] font-bold text-[#be2a6c]",children:[(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"})," ",a("editor.addTime")]})]}):(0,r.jsx)("div",{className:"flex-1 text-[13px] font-semibold text-gray-400",children:a("editor.noTimes")})]},s)})}),(0,r.jsx)("div",{className:"mt-4 flex items-center gap-2.5 px-1",children:(0,r.jsx)("span",{className:"text-[13.5px] font-semibold text-gray-500",children:a.rich("editor.summary",{slots:H,days:P,b:e=>(0,r.jsx)("b",{className:"font-bold text-[#1d1b30] dark:text-white",children:e})})})})]})})}},44620:(e,t,a)=>{a.d(t,{d:()=>o});var r=a(54456),n=a(27412),s=a(65809),l=a(4080);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{className:(0,l.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-brand-orange data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-300 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-brand-orange dark:data-[state=unchecked]:bg-slate-800",a),...n,ref:t,children:(0,r.jsx)(s.zi,{className:(0,l.cn)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950")})})});o.displayName=s.bL.displayName},46215:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(54456);function n(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854zm4.943 12.248V6.169H2.542v7.225zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248S2.4 3.226 2.4 3.934c0 .694.521 1.248 1.327 1.248zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016l.016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225z"})})}
1a(27412)},47625:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(54456);function n(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.9 3.9 0 0 0-1.417.923A3.9 3.9 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.9 3.9 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.9 3.9 0 0 0-.923-1.417A3.9 3.9 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599s.453.546.598.92c.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.5 2.5 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.5 2.5 0 0 1-.92-.598 2.5 2.5 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233s.008-2.388.046-3.231c.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92s.546-.453.92-.598c.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92m-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217m0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334"})})}a(27412)},65183:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(54456);function n(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M9 0h1.98c.144.715.54 1.617 1.235 2.512C12.895 3.389 13.797 4 15 4v2c-1.753 0-3.07-.814-4-1.829V11a5 5 0 1 1-5-5v2a3 3 0 1 0 3 3z"})})}a(27412)},70901:(e,t,a)=>{a.d(t,{Ck:()=>i,PE:()=>d,uD:()=>o});let r={instagram:"Instagram",facebook:"Facebook",twitter:"X",x:"X",linkedin:"LinkedIn",tiktok:"TikTok",pinterest:"Pinterest",threads:"Threads",youtube:"YouTube",bluesky:"Bluesky",mastodon:"Mastodon"},n={instagram:"#E1306C",facebook:"#1877F2",twitter:"#000000",x:"#000000",linkedin:"#0A66C2",tiktok:"#000000",pinterest:"#E60023",threads:"#000000",youtube:"#FF0000",bluesky:"#0085FF",mastodon:"#6364FF"},s={instagram:"text-pink-500",facebook:"text-blue-600",twitter:"text-blue-400",x:"text-blue-400",linkedin:"text-blue-700",tiktok:"text-black dark:text-white",pinterest:"text-red-500",threads:"text-black dark:text-white",youtube:"text-red-600",bluesky:"text-sky-500",mastodon:"text-purple-500"};function l(e){return(null!=e?e:"").trim().toLowerCase()}function o(e){let t=l(e);return r[t]?r[t]:t?t.charAt(0).toUpperCase()+t.slice(1):""}function i(e){var t;return null!=(t=n[l(e)])?t:"#9CA3AF"}function d(e){var t;return null!=(t=s[l(e)])?t:"text-neutral-500"}},76426:(e,t,a)=>{a.d(t,{h:()=>c,vF:()=>d});let r={debug:10,info:20,warn:30,error:40},n=r.warn,s=["token","accesstoken","refreshtoken","idtoken","authorization","password","secret","clientsecret","apikey","cookie","setcookie","bearer","credential","sessiontoken"];function l(e){for(var t=arguments.length,a=Array(t>1?t-1:0),r=1;r<t;r++)a[r-1]=arguments[r];console[e](...a)}function o(e,t,a,o){if(!(r[e]<n))try{!function(e,t,a,r){let n=t?"[".concat(t,"] ").concat(a):a,o=window.__zapicSe
1ntry,i=r?function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new WeakSet;if(null===t||"object"!=typeof t)return t;if(a>=6)return"[Truncated]";if(r.has(t))return"[Circular]";if(r.add(t),Array.isArray(t))return t.map(t=>e(t,a+1,r));if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};let n={};for(let[l,o]of Object.entries(t))n[l]=!function(e){let t=e.toLowerCase().replace(/[-_\s]/g,"");return s.some(e=>t===e||t.includes(e))}(l)?e(o,a+1,r):"[REDACTED]";return n}(r):void 0;if("error"===e){var d;let e=null!=(d=null==r?void 0:r.error)?d:a;o&&o.captureException(function(e){if(e instanceof Error)return e;if("string"==typeof e)return Error(e);try{return Error(JSON.stringify(e))}catch(t){return Error(String(e))}}(e),{extra:{message:n,...i}}),l("error",n,null!=i?i:"");return}"warn"===e&&(o?o.addBreadcrumb({level:"warning",category:t,message:n,data:i}):l("warn",n,null!=i?i:""))}(e,t,a,o)}catch(e){}}function i(e){return{debug:(t,a)=>o("debug",e,t,a),info:(t,a)=>o("info",e,t,a),warn:(t,a)=>o("warn",e,t,a),error:(t,a,r)=>o("error",e,t,void 0===a?r:{error:a,...r})}}let d=i();function c(e){return i(e)}},79101:(e,t,a)=>{a.d(t,{Cw:()=>m,PG:()=>u,UN:()=>d,ZK:()=>p,mU:()=>h,q$:()=>f});var r=a(23987),n=a(30444),s=a(11336),l=a(93342),o=a(95829);let i={all:e=>["postingSchedules",e]};function d(e){var t;let a=(0,l.u)(e=>e.activeBrandIdForApi);return(0,r.I)({queryKey:i.all(a),enabled:!!a&&(null==(t=null==e?void 0:e.enabled)||t),queryFn:o.$B})}function c(){let e=(0,n.jE)(),t=(0,l.u)(e=>e.activeBrandIdForApi);return()=>e.invalidateQueries({queryKey:i.all(t)})}function u(){let e=c();return(0,s.n)({mutationFn:e=>(0,o._M)(e),onSuccess:()=>e()})}function m(){let e=c();return(0,s.n)({mutationFn:e=>{let{id:t,...a}=e;return(0,o.N9)(t,a)},onSuccess:()=>e()})}function f(){let e=c();return(0,s.n)({mutationFn:e=>(0,o.ti)(e),onSuccess:()=>e()})}function h(){let e=c();return(0,s.n)({mutationFn:e=>{let{id:t,name:a}=e;return(0,o.rP)(t,a)},onSuccess:()=>e()})}function p(){let e=c();return(0,s.n)({mutationFn:e=>{let{id:t,slots:a}=e;return(0,o.Os)(t,a)},onSuccess:()=>e()})}},85766:(e,t,a)=>{a.d(t,{Av:()=>u,DL:()=>c,eD:()=>h,jE:()=>d,pG:()=>i});var r=a(54456),n=a(27412),s=a(46916),l=a(16754),o=a(70901);function i(e){return(0,o.Ck)(e)}function d(e){let{platform:t,size:a=18,className:n}=e,s=(0,l.M)(t),o=i(t);return s?(0,r.jsx)(s,{className:n,style:{width:a,height:a,color:o},"aria-hidden":!0}):(0,r.jsx)("span",{className:n,style:{width:a,height:a,borderRadius:4,background:o,display:"inline-block"},"aria-hidden":!0})}let c=d;function u(){let{data:e}=(0,s.GM)();return(0,n.useMemo)(()=>{let t=new Map;for(let a of null!=e?e:[])a.id&&a.platform&&t.set(a.id,a.platform.toLowerCase());let a=Array.from(new Set(t.values()));return{forAccountIds(e){if(!e||0===e.length)return a;let r=new Set;for(let a of e){let e=t.get(a);e&&r.add(e)}return Array.from(r)},allPlatforms:a,hasAccounts:t.size>0}},[e])}let m=[1,2,3,4,5,6,0],f={1:"M",2:"T",3:"W",4:"T",5:"F",6:"S",0:"S"};function h(e){let{slots:t,resolve:a}=e,s=(0,n.useMemo)(()=>{let e=new Map;for(let l of t){var r,n,s;if(!l.is_enabled)continue;let t=a(null!=(r=l.account_ids)?r:[]),o=null!=(n=e.get(l.day_of_week))?n:[];o.push(null!=(s=t[0])?s:"unknown"),e.set(l.day_of_week,o)}return e},[t,a]);return(0,r.jsx)("div",{className:"flex gap-1.5 border-y border-gray-100 px-1 pt-3.5 pb-1",children:m.map(e=>{var t;let a=null!=(t=s.get(e))?t:[],n=0===a.length;return(0,r.jsxs)("div",{className:"flex flex-1 flex-col items-center gap-1.5",children:[(0,r.jsx)("div",{className:"flex h-[54px] w-full flex-col-reverse items-center justify-start gap-1",children:n?(0,r.jsx)("span",{className:"mt-auto h-[3px] w-3.5 rounded-sm bg-gray-200"}):a.map((e,t)=>(0,r.jsx)("span",{className:"h-[9px] w-[9px] rounded-[3px]",style:{background:i(e)}},t))}),(0,r.jsx)("div",{className:"text-[11px] font-bold ".concat(n?"text-gray-200":"text-gray-400"),children:f[e]})]},e)})})}},95824:(e,t,a)=>{a.d(t,{A:()=>n});var r=a(54456);function n(e){let{className:t="w-4 h-4",size:a=16}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,fill:"currentColor",className:t,viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M12.6.75h2.454l-5.36 6.142L16 15.25h-4.937l-3.867-5.07-4.425 5.07H.316l5.733-6.57L0 .75h5.063l3.495 4.633L12.601.75Zm-.86 13.028h1.36L4.323 2.145H2.865z"})})}
1a(27412)},95829:(e,t,a)=>{a.d(t,{$B:()=>s,N9:()=>o,Os:()=>c,_M:()=>l,gK:()=>u,rP:()=>d,ti:()=>i});var r=a(73521);let n="/api/v1/core/posting-schedules";async function s(){var e;let t=await r.u.get(n);return null!=(e=null==t?void 0:t.schedules)?e:[]}async function l(e){let t=await r.u.post(n,e);return null==t?void 0:t.schedule}async function o(e,t){let a=await r.u.patch("".concat(n,"/").concat(e),t);return null==a?void 0:a.schedule}async function i(e){await r.u.delete("".concat(n,"/").concat(e))}async function d(e,t){let a=await r.u.post("".concat(n,"/").concat(e,"/duplicate"),t?{name:t}:{});return null==a?void 0:a.schedule}async function c(e,t){var a;let s=await r.u.put("".concat(n,"/").concat(e,"/slots"),{slots:t});return null!=(a=null==s?void 0:s.slots)?a:[]}async function u(e){return r.u.post("/api/v1/core/queue",{post_id:e})}}}]);
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.