Files
2025-04-04 07:29:59 +01:00

107 lines
373 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{j as e}from"./@radix-ui/react-progress-3f5a2119.js";import{R as d,r as y,u as st,f as jt,N as At,d as Ye,L as wt,g as lo,h as at,i as co,j as br,k as He,l as Ps,B as uo}from"./vendor-8efd6c0a.js";import{c as mo}from"./react-confirm-alert-1bfe7df0.js";import{E as ho}from"./@stripe/react-stripe-js-9fe680cd.js";import{l as po}from"./@stripe/stripe-js-6b714a86.js";import"./jszip-9dca798f.js";import{h as fe}from"./moment-55cb88ed.js";import{F as M}from"./@fortawesome/react-fontawesome-08267a95.js";import{P as fo,a as xo,M as go,F as bo,b as wo,D as yo,U as jo,L as vo,C as No,c as ko,X as qt,S as So,d as _o,e as Co,E as xs,f as Vr,T as gs,B as Eo,g as Po,h as rr,i as ar,j as Io,V as Do}from"./lucide-react-8e97d3d4.js";import{q as Is,_ as Ds,$ as ft}from"./@headlessui/react-d8075cb0.js";import{C as Be}from"./react-spinners-2447b03e.js";import{a as Oo,u as Et}from"./react-hook-form-67ae4fc1.js";import{o as Ao,r as Ro}from"./@hookform/resolvers-8da911c3.js";import{c as Pt,a as Re,b as To}from"./yup-1eb77410.js";import{f as Lo,i as $o}from"./@fortawesome/free-solid-svg-icons-acf59ef3.js";import{c as bs}from"./@popperjs/core-8746c87e.js";import{a as Wr}from"./axios-439bb627.js";import"./bootstrap-a957bf94.js";import{p as Mo}from"./@tailwindcss/forms-68617f70.js";import{r as ot,F as zo,D as Uo,P as Bo,V as te,I as Fo,T as he,j as Yo}from"./@react-pdf/renderer-e56aa971.js";import{r as Jo}from"./react-dates-501af09a.js";import{c as qo}from"./class-variance-authority-ff2c9236.js";import{c as Go}from"./clsx-0839fdbe.js";import{t as Vo}from"./tailwind-merge-05141ada.js";import{O as Hr,C as Qr,a as Wo,T as Kr,D as Xr,P as Ho,V as Qe}from"./cmdk-57dd7adc.js";import"./jspdf-b895519a.js";import"./suneditor-react-efa897e8.js";import"./jspdf-autotable-67a4fd30.js";import{c as Qo}from"./react-pdf-tailwind-e63e58f7.js";import{F as Ko}from"./react-window-a0187eb2.js";import{l as Xo}from"./lodash-288eb851.js";import"./uppy-b5da8030.js";import{l as Zo}from"./@fortawesome/fontawesome-svg-core-0d830203.js";import{i as en}from"./@fortawesome/free-regular-svg-icons-9481002f.js";import{i as tn}from"./@fortawesome/free-brands-svg-icons-28525c60.js";import"./moment-timezone-f4ca829b.js";import"./@uppy/aws-s3-98528360.js";import"./suneditor-c3991ade.js";import"./react-select-919494ae.js";import"./@uppy/dashboard-9cd8113d.js";import"./@uppy/core-84ea94a2.js";import"./@fullcalendar/core-bd0f45d9.js";import"./@uppy/drag-drop-27339c3f.js";import"./@uppy/react-68b82fdf.js";import"./@uppy/dropbox-1aaebb89.js";import"./@uppy/google-drive-3e0cc4a6.js";import"./@uppy/onedrive-f1f15888.js";import"./@uppy/tus-4591c912.js";import"./@uppy/xhr-upload-2d2bb4ab.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const n of a)if(n.type==="childList")for(const i of n.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function s(a){const n={};return a.integrity&&(n.integrity=a.integrity),a.referrerPolicy&&(n.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?n.credentials="include":a.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function r(a){if(a.ep)return;a.ep=!0;const n=s(a);fetch(a.href,n)}})();const Ze=o=>{if(o!=="")return o};function rt(o){return o===""||o===null||o===void 0||o==="undefined"}const zt=o=>/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89a-b][0-9a-f]{3}-[0-9a-f]{12}$/i.test(o),Qt=(o,t)=>o.sort((s,r)=>{const a=s[t].toLowerCase(),n=r[t].toLowerCase();return a<n?-1:a>n?1:0}),sn=o=>o.sort((s,r)=>{const a=m=>{const u=m.toLowerCase();let h=0;u.includes("voiceover")?h=1e4:u.includes("song")?h=2e4:h=4e4;const p=m.match(/\d+/),x=p?parseInt(p[0]):0;return h+x},n=s.type_name,i=r.type_name,c=a(n),l=a(i);return c<l?-1:c>l?1:0}),rn=o=>{let t=0,s=0,r=0,a=0;return o.forEach(n=>{let i=parseInt(n.type_name.match(/\d+/));isNaN(i)&&(i=0),n.type_name.includes("Voiceover")&&!n.type_name.includes("Upload")?i>t&&(t=i):n.type_name.includes("Song")?i>s&&(s=i):n.type_name.includes("Upload")?(console.log(n.id),i>a&&(a=i)):n.type_name.includes("Tracking")&&i>r&&(r=i)}),{voiceCount:t,songCount:s,trackingCount:r,uploadCount:a}},bt=o=>(Object.keys(o).forEach(t=>o[t]==null&&delete o[t]),o);function an(){this._baseurl="https://app.equalityrecords.com",this._project_id="equalityrecord",this._secret="p5wb2gwc9ierf8sznet6bnscq07nura",this._table="";const o=this._project_id+":"+this._secret;let t=btoa(o);this.getHeader=function(){return{Authorization:"Bearer "+localStorage.getItem("token"),"x-project":t}},this.baseUrl=function(){return this._baseurl},this.getProjectId=function(){return this._project_id},this.treeBaseUrl=function(){return this._baseurl+"/v4/api/records"};function s(n={}){let i=n.hasOwnProperty("join"),c=n.join;i&&typeof c=="string"?c=c.split(","):c=[];let l="";return c.forEach(m=>{l+=`join=${m}&`}),[i,c,l]}function r(n){let i=n.order?n.order:"id",c=n.direction?n.direction:"desc";return`order=${i},${c}&`}function a(n){let i=n.hasOwnProperty("filter"),c=n.filter,l="";return i&&Array.isArray(c)&&c.forEach(m=>{l+=`filter=${m}&`}),[i,c,l]}return this.getOne=async function(n,i,c={}){if(rt(n)||rt(i))throw new Error("table and id is required.");let[l,m,u]=s(c);const h={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},p=await fetch(this.treeBaseUrl()+`/${n}/${i}?${u}`,{method:"get",headers:h}),x=await p.json();if(p.status===401)throw new Error(x.message);if(p.status===403)throw new Error(x.message);return x},this.getMany=async function(n,i,c={}){if(rt(n)||rt(i))throw new Error("table and id is required.");let[l,m,u]=s(c),h=Array.isArray(i)?i.join(","):i;const p={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},x=await fetch(this.treeBaseUrl()+`/${n}/${h}?${u}`,{method:"get",headers:p}),f=await x.json();if(x.status===401)throw new Error(f.message);if(x.status===403)throw new Error(f.message);return f},this.getList=async function(n,i={}){if(rt(n))throw new Error("table and id is required.");let[c,l,m]=s(i),[u,h,p]=a(i),x=r(i),f=i.hasOwnProperty("size")?`size=${i.size}&`:"";const v={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},g=await fetch(this.treeBaseUrl()+`/${n}?${m}${x}${f}${p}`,{method:"get",headers:v}),w=await g.json();if(g.status===401)throw new Error(w.message);if(g.status===403)throw new Error(w.message);return w},this.getPaginate=async function(n,i={}){if(rt(n))throw new Error("table and id is required.");let[c,l,m]=s(i),[u,h,p]=a(i),x=r(i),f=i.size??20,v=i.hasOwnProperty("page")?`page=${i.page},${f}&`:"page=1&";const g={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},w=await fetch(this.treeBaseUrl()+`/${n}?${m}${x}${v}${p}`,{method:"get",headers:g}),N=await w.json();if(w.status===401)throw new Error(N.message);if(w.status===403)throw new Error(N.message);return N},this.create=async function(n,i,c={}){if(rt(n))throw new Error("table and id is required.");const l={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},m=await fetch(this.treeBaseUrl()+`/${n}`,{method:"post",headers:l,body:JSON.stringify(i)}),u=await m.json();if(m.status===401)throw new Error(u.message);if(m.status===403)throw new Error(u.message);return u},this.update=async function(n,i,c){if(rt(n)||rt(i))throw new Error("table and id is required.");const l={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},m=await fetch(this.treeBaseUrl()+`/${n}/${i}`,{method:"put",headers:l,body:JSON.stringify(c)}),u=await m.json();if(m.status===401)throw new Error(u.message);if(m.status===403)throw new Error(u.message);return u},this.delete=async function(n,i,c){if(rt(n)||rt(i))throw new Error("table and id is required.");const l={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},m=await fetch(this.treeBaseUrl()+`/${n}/${i}`,{method:"delete",headers:l,body:JSON.stringify(c)}),u=await m.json();if(m.status===401)throw new Error(u.message);if(m.status===403)throw new Error(u.message);return u},this}function qe(){this._baseurl="https://app.equalityrecords.com",this._project_id="equalityrecord",this._secret="p5wb2gwc9ierf8sznet6bnscq07nura",this._table="",this._GOOGLE_CAPTCHA_SITEKEY="6LfmBc8jAAAAAKfz4zIiX1HoAwuH-9kcx68-7hhd";const o=this._project_id+":"+this._secret;let t=btoa(o);return this.login=async function(s,r,a){const n=await fetch(this._baseurl+"/v2/api/lambda/login",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({email:s,password:r,role:a})}),i=await n.json();if(n.status===401)throw new Error(i.message);if(n.status===403)throw new Error(i.message);return i},this.oauthLoginApi=async function(s,r){const a=await fetch(`${this._baseurl}/v2/api/lambda/${s}/login?role=${r}`,{headers:{"x-project":t}}),n=await a.text();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.getHeader=function(){return{Authorization:"Bearer "+localStorage.getItem("token"),"x-project":t}},this.baseUrl=function(){return this._baseurl},this.uploadUrl=function(){return this._baseurl+"/v2/api/lambda/upload"},this.upload=async function(s){let r=new FormData;r.append("file",s);const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")};return await fetch(this._baseurl+"/v2/api/lambda/upload",{method:"post",headers:a,body:r}).then(i=>i.json())},this.getProfile=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/profile",{method:"get",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),r=await s.json();if(s.status===401)throw new Error(r.message);if(s.status===403)throw new Error(r.message);return r},this.check=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/check",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({role:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);return a},this.getSession=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/user-sessions/data",{method:"get",headers:{"Content-Type":"application/json","x-project":t}}),r=await s.json();if(s.status===401)throw new Error(r.message);if(s.status===403)throw new Error(r.message);return r},this.sessionPost=async function(s){const{user_id:r,session_id:a,status:n,events:i,screen_width:c,screen_height:l,screen_size:m,start_time:u,end_time:h,html_copy:p}=s,x=await fetch(this._baseurl+"/v2/api/lambda/analytics/user-sessions/",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({user_id:r,session_id:a,status:n,events:i,screen_width:c,screen_height:l,screen_size:m,start_time:u,end_time:h,html_copy:p})}),f=await x.json();if(x.status===401)throw new Error(f.message);if(x.status===403)throw new Error(f.message);return f},this.enable2FA=async function(s={}){const r=await fetch(this._baseurl+"/v2/api/lambda/2fa/enable",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({...s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.disable2FA=async function(s={}){const r=await fetch(this._baseurl+"/v2/api/lambda/2fa/disable",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({...s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.verify2FA=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/2fa/verify",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+s},body:JSON.stringify({access_token:s,token:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.authorize2FA=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/2fa/authorize",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+s}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.captchaValidation=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/google-captcha",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({captchaToken:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.magicLoginAttempt=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/magic-login/generate",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({email:s,role:r,url:this._baseurl+"/magic-login/verify"})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.magicLoginVerify=async function(s=""){const r=await fetch(this._baseurl+"/v2/api/lambda/magic-login",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({token:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.exportCSV=async function(){const s={"content-type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},r=await fetch(this._baseurl+`/rest/${this._table}/EXPORT`,{method:"post",headers:s}),a=await r.text();let n=document.createElement("a");if(n.href="data:text/csv;charset=utf-8,"+encodeURI(a),n.target="_blank",n.download=this._table+".csv",n.click(),r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message)},this.analyticsPost=async function(s,r,a){const i=await fetch(s,{method:a,headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify(r)}),c=await i.json();if(i.status===401)throw new Error(c.message);if(i.status===403)throw new Error(c.message);return c},this.getProfilePreference=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/preference",{method:"get",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),r=await s.json();if(s.status===401)throw new Error(r.message);if(s.status===403)throw new Error(r.message);return r},this.updateEmail=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/update/email",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({email:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.updatePassword=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/update/password",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({password:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.updateEmailByAdmin=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/admin/update/email",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({email:s,id:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.updatePasswordByAdmin=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/admin/update/password",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({password:s,id:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.sendEmailVerification=function(){},this.updateEmailVerification=function(){},this.setTable=function(s){this._table=s},this.getProjectId=function(){return this._project_id},this.logout=function(){window.localStorage.clear()},this.register=async function(s,r,a,n,i){const c=await fetch(this._baseurl+"/v2/api/lambda/register",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({email:s,password:r,role:a,first_name:n,last_name:i})}),l=await c.json();if(c.status===401)throw new Error(l.message);if(c.status===403)throw new Error(l.message);return l},this.verifyUser=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/verify/user",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({user_id:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.createUser=async function(s,r,a){const n=await fetch(this._baseurl+"/v2/api/lambda/register",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({email:s,password:r,role:a})}),i=await n.json();if(n.status===401)throw new Error(i.message);if(n.status===403)throw new Error(i.message);return i},this.forgot=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/forgot",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({role:s,email:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.reset=async function(s,r,a){const n=await fetch(this._baseurl+"/v2/api/lambda/reset",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({token:s,code:r,password:a})}),i=await n.json();if(n.status===401)throw new Error(i.message);if(n.status===403)throw new Error(i.message);return i},this.callRestAPI=async function(s,r){const a={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new an;switch(r){case"GET":return await n.getOne(this._table,s.id);case"POST":return await n.create(this._table,s);case"PUT":return n.update(this._table,s.id,s);case"PUTWHERE":const i=await fetch(this._baseurl+`/v1/api/rest/${this._table}/${r}`,{method:"post",headers:a,body:JSON.stringify(s)}),c=await i.json();if(i.status===401)throw new Error(c.message);return c;case"DELETE":return n.delete(this._table,s.id);case"DELETEALL":const l=await fetch(this._baseurl+`/v1/api/rest/${this._table}/${r}`,{method:"post",headers:a,body:JSON.stringify(s)}),m=await l.json();if(l.status===401)throw new Error(m.message);if(l.status===403)throw new Error(m.message);return m;case"GETALL":return s.order=s.orderBy,await n.getList(this._table,s);case"PAGINATE":let u={};s.page||(s.page=1),s.limit||(s.limit=10),u.size=s.limit,u.order=s.sortId,u.direction=s.direction,u.page=s.page;let h=s.payload;return u.filter=Object.keys(h).map(f=>{if(typeof h[f]<"u")return`${f},cs,${h[f]}`}),await n.getPaginate(this._table,u);case"AUTOCOMPLETE":const p=await fetch(this._baseurl+`/v1/api/rest/${this._table}/${r}`,{method:"post",headers:a,body:JSON.stringify(s)}),x=await p.json();if(p.status===401)throw new Error(x.message);if(p.status===403)throw new Error(x.message);return x}},this.callRawAPI=async function(s,r,a){const n={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")};let i;a==="GET"?i=await fetch(this._baseurl+s,{method:a,headers:n}):i=await fetch(this._baseurl+s,{method:a,headers:n,body:JSON.stringify(r)});const c=await i.json();if(i.status===401)throw new Error(c.message);if(i.status===403)throw new Error(c.message);return c},this.callJoinRestAPI=async function(s,r,a,n,i,c,l,m,u){const h={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")};switch(l){case"GETALL":const p=await fetch(this._baseurl+`/v1/api/join/${s}/${r}/${l}`,{method:"post",headers:h,body:JSON.stringify({join_id_1:a,join_id_2:n,select:i,where:c||""})}),x=await p.json();if(p.status===401)throw new Error(x.message);if(p.status===403)throw new Error(x.message);return x;case"PAGINATE":m||(m=1),u||(u=10);const f=await fetch(this._baseurl+`/v1/api/join/${s}/${r}/${l}`,{method:"post",headers:h,body:JSON.stringify({join_id_1:a,join_id_2:n,select:i,where:c||"",page:m,limit:u})}),v=await f.json();if(f.status===401)throw new Error(v.message);if(f.status===403)throw new Error(v.message);return v}},this.callMultiJoinRestAPI=async function(s,r,a,n,i,c,l){const m={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")};i||(i=1),c||(c=10);const u=await fetch(this._baseurl+`/v1/api/multi-join/${l}`,{method:"post",headers:m,body:JSON.stringify({tables:s,joinIds:r,selectStr:a,where:n,page:i,limit:c})}),h=await u.json();if(u.status===401)throw new Error(h.message);if(u.status===403)throw new Error(h.message);return h},this.subscribe=function(s){},this.subscribe=function(s){},this.subscribeChannel=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/subscription/channel/room",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({room:s})}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.subscribeListen=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/subscription/channel/poll?room="+s,{method:"GET",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.unSubscribeChannel=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/subscription/channel/unsubscribe?room="+s,{method:"GET",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.channelOnline=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/subscription/channel/online?room="+s,{method:"GET",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.broadcast=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/subscription/channel/send",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({payload:s,room:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.cmsAdd=async function(s,r,a,n){const i={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},c=await fetch(this._baseurl+"/v2/api/lambda/cms",{method:"post",headers:i,body:JSON.stringify({page:s,key:r,type:a,value:n})}),l=await c.json();if(c.status===401)throw new Error(l.message);if(c.status===403)throw new Error(l.message);return l},this.cmsEdit=async function(s,r,a,n,i){const c={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},l=await fetch(this._baseurl+"/v2/api/lambda/cms/"+s,{method:"put",headers:c,body:JSON.stringify({page:r,key:a,type:n,value:i})}),m=await l.json();if(l.status===401)throw new Error(m.message);if(l.status===403)throw new Error(m.message);return m},this.getToken=function(){return window.localStorage.getItem("token")},this.getMyRoom=async function(){const s=await fetch(this._baseurl+"/v3/api/lambda/realtime/room/my",{method:"GET",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),r=await s.json();if(s.status===401)throw new Error(r.message);if(s.status===403)throw new Error(r.message);return r},this.getChatId=async function(s){const r=await fetch(this._baseurl+`/v2/api/lambda/room?room_id=${s}`,{method:"get",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.getChats=async function(s,r,a){const n=await fetch(this._baseurl+"/v3/api/lambda/realtime/chat",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({room_id:s,chat_id:r,date:a})}),i=await n.json();if(n.status===401)throw new Error(i.message);if(n.status===403)throw new Error(i.message);return i},this.restoreChat=async function(s){await fetch(this._baseurl+`/v2/api/lambda/v2/api/lambda/room/poll?room=${s}`,{method:"get",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}})},this.postMessage=async function(s){const r=await fetch(this._baseurl+"/v3/api/lambda/realtime/send",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.uploadImage=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/s3/upload",{method:"post",headers:{"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:s}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.editorUploadImage=async function(s){let r=new FormData;r.append("file",s);const a=await fetch(this._baseurl+"/v2/api/lambda/s3/upload",{method:"post",headers:{"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:r}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.createRoom=async function(s){const r=await fetch(this._baseurl+"/v3/api/lambda/realtime/room",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.getAllUsers=async function(){const s=await fetch(this._baseurl+"/v1/api/rest/user/GETALL",{method:"POST",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),r=await s.json();if(s.status===401)throw new Error(r.message);if(s.status===403)throw new Error(r.message);return r},this.startPooling=async function(s){const r=await fetch(this._baseurl+`/v3/api/lambda/realtime/room/poll?user_id=${s}`,{method:"GET",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if(r.status===401)throw new Error(a.message);if(r.status===403)throw new Error(a.message);return a},this.addStripeProduct=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/product",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.getStripeProducts=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s),i=new URLSearchParams(r),c=await fetch(this._baseurl+`/v2/api/lambda/stripe/products?${n}&${i}`,{method:"get",headers:a}),l=await c.json();if([401,403,500].includes(c.status))throw new Error(l.message);return l},this.getStripeProduct=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+`/v2/api/lambda/stripe/product/${s}`,{method:"get",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.updateStripeProduct=async function(s,r){const a={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=await fetch(this._baseurl+`/v2/api/lambda/stripe/product/${s}`,{method:"put",headers:a,body:JSON.stringify(r)}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.addStripePrice=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/price",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.getStripePrices=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s),i=new URLSearchParams(r),c=await fetch(this._baseurl+`/v2/api/lambda/stripe/prices?${n}&${i}`,{method:"get",headers:a}),l=await c.json();if([401,403,500].includes(c.status))throw new Error(l.message);return l},this.getStripePrice=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+`/v2/api/lambda/stripe/price/${s}`,{method:"get",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.updateStripePrice=async function(s,r){const a={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=await fetch(this._baseurl+`/v2/api/lambda/stripe/price/${s}`,{method:"put",headers:a,body:JSON.stringify(r)}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.getStripeSubscriptions=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s),i=new URLSearchParams(r),c=await fetch(this._baseurl+`/v2/api/lambda/stripe/subscriptions?${n}&${i}`,{method:"get",headers:a}),l=await c.json();if([401,403,500].includes(c.status))throw new Error(l.message);return l},this.adminCancelStripeSubscription=async function(s,r){const a=await fetch(this._baseurl+`/v2/api/lambda/stripe/subscription/${s}`,{method:"delete",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(r)}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.adminCreateUsageCharge=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/stripe/subscription/usage-charge",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify({subId:s,quantity:r})}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.getStripeInvoices=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s);new URLSearchParams(r);const i=await fetch(this._baseurl+`/v2/api/lambda/stripe/invoices?${n}`,{method:"get",headers:a}),c=await i.json();if([401,403,500].includes(i.status))throw new Error(c.message);return c},this.getStripeInvoicesV2=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s);new URLSearchParams(r);const i=await fetch(this._baseurl+`/v2/api/lambda/stripe/invoices-v2?${n}`,{method:"get",headers:a}),c=await i.json();if([401,403,500].includes(i.status))throw new Error(c.message);return c},this.getStripeOrders=async function(s,r){const a={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},n=new URLSearchParams(s),i=new URLSearchParams(r),c=await fetch(this._baseurl+`/v2/api/lambda/stripe/orders?${n}&${i}`,{method:"get",headers:a}),l=await c.json();if([401,403,500].includes(c.status))throw new Error(l.message);return l},this.initCheckoutSession=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/checkout",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.registerAndSubscribe=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/register-subscribe",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.createStripeCustomer=async function(s){const r={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer",{method:"post",headers:r,body:JSON.stringify(s)}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.createCustomerStripeCard=async function(s){const r={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/card",{method:"post",headers:r,body:JSON.stringify(s)}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.updateStripeSubscription=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/subscription/update",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)});this.changeStripeSubscription=async function(n){const i=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/subscription",{method:"put",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(n)}),c=await(i==null?void 0:i.json());if([401,403,500].includes(i==null?void 0:i.status))throw new Error(c.message);return c};const a=await(r==null?void 0:r.json());if([401,403,500].includes(r==null?void 0:r.status))throw new Error(a.message);return a},this.createStripeSubscription=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/subscription",{method:"post",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.getCustomerStripeSubscription=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/subscription",{method:"get",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.getCustomerStripeSubscriptions=async function(s={},r={}){const a={Authorization:"Bearer "+this.getToken(),"x-project":t},n=new URLSearchParams(s).toString(),i=new URLSearchParams(r).toString(),c=[n&&`${n}`,i&&`${i}`].filter(Boolean).join("&"),l=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/subscriptions${c?"?"+c:""}`,{method:"get",headers:a}),m=await l.json();if([401,403,500].includes(l.status))throw new Error(m.message);return m},this.changeStripeSubscription=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer/subscription",{method:"put",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.cancelStripeSubscription=async function(s,r){const a=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/subscription/${s}`,{method:"delete",headers:{"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(r)}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.getCustomerStripeDetails=async function(){const s={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},r=await fetch(this._baseurl+"/v2/api/lambda/stripe/customer",{method:"get",headers:s}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.getCustomerStripeCards=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=new URLSearchParams(s),n=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/cards?${a}`,{method:"get",headers:r}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.getCustomerStripeInvoices=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=new URLSearchParams(s),n=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/invoices?${a}`,{method:"get",headers:r}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.getCustomerStripeCharges=async function(s){const r={"x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=new URLSearchParams(s),n=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/charges?${a}`,{method:"get",headers:r}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.getCustomerStripeOrders=async function(s){const r={Authorization:"Bearer "+localStorage.getItem("token"),"x-project":t},a=new URLSearchParams(s),n=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/orders?${a}`,{method:"get",headers:r}),i=await n.json();if([401,403,500].includes(n.status))throw new Error(i.message);return i},this.setStripeCustomerDefaultCard=async function(s){const r={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/card/${s}/set-default`,{method:"put",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.deleteCustomerStripeCard=async function(s){const r={"content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+`/v2/api/lambda/stripe/customer/card/${s}`,{method:"delete",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.getUnavailableDates=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/scheduling/dates",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({userId:s,date:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.getSchedules=async function(s,r){const a=await fetch(this._baseurl+"/v2/api/lambda/scheduling/schedules",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({userId:s,date:r})}),n=await a.json();if(a.status===401)throw new Error(n.message);if(a.status===403)throw new Error(n.message);return n},this.getSchedulesWithTZ=async function(s,r,a,n){const i=await fetch(this._baseurl+"/v2/api/lambda/scheduling/tz-month-schedules",{method:"post",headers:{"Content-Type":"application/json","x-project":t},body:JSON.stringify({rangeStart:s,rangeEnd:r,userId:a,tz:n})}),c=await i.json();if(i.status===401)throw new Error(c.message);if(i.status===403)throw new Error(c.message);return c},this.createScheduling=async function(s,r,a,n){const i=await fetch(this._baseurl+"/v2/api/lambda/scheduling/POST",{method:"POST",headers:{"Content-Type":"application/json","x-project":"bWFuYWtuaWdodDo1ZmNoeG41bThoYm82amN4aXEzeGRkb2ZvZG9hY3NreWUx"},body:JSON.stringify({user_id:s,meeting_start:r,meeting_end:a,meeting_details:n})}),c=await i.json();if(i.status===401)throw new Error(c.message);if(i.status===403)throw new Error(c.message);return c},this.addEventToGC=async function(s,r,a,n,i,c,l,m,u,h,p){const x=await fetch(this._baseurl+"/v2/api/lambda/scheduling/google-calendar-event",{method:"POST",headers:{"Content-Type":"application/json","x-project":"bWFuYWtuaWdodDo1ZmNoeG41bThoYm82amN4aXEzeGRkb2ZvZG9hY3NreWUx"},body:JSON.stringify({access_token:s,expires_in:r,refresh_token:a,scope:n,token_type:i,summary:c,location:l,description:m,startTime:u,endTime:h,attendees:p})}),f=await x.json();if(x.status===401)throw new Error(f.message);if(x.status===403)throw new Error(f.message);return f},this.getFilteredBlogs=async function(s=[],r=[],a=void 0){let n="/v2/api/lambda/blog/filter?";s&&s.length&&(n.endsWith("?")?n+=`tags=${s}`:n+=`&tags=${s}`),r&&r.length&&(n.endsWith("?")?n+=`categories=${r}`:n+=`&categories=${r}`),a&&(n.endsWith("?")?n+=`rule=${a}`:n+=`&rule=${a}`);const i=await fetch(this._baseurl+`${n}`,{headers:{"Content-Type":"application/json","x-project":t}}),c=await i.json();if([401,402,403,404,500,502,501].includes(i.status))throw new Error(c.message);return c},this.getAllBlogs=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/blog/all ",{headers:{"Content-Type":"application/json","x-project":t}}),r=await s.json();if([401,402,403,404,500,502,501].includes(s.status))throw new Error(r.message);return r},this.createBlog=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/blog/create",{method:"POST",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.getSingleBlog=async function(s){const r=await fetch(this._baseurl+`/v2/api/lambda/blog/single/${s}`,{headers:{"Content-Type":"application/json","x-project":t}}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.editBlog=async function(s,r){const a=await fetch(this._baseurl+`/v2/api/lambda/blog/edit/${s}`,{method:"POST",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(r)}),n=await a.json();if([401,402,403,404,500,502,501].includes(a.status))throw new Error(n.message);return n},this.deleteBlog=async function(s){const r=await fetch(this._baseurl+`/v2/api/lambda/blog/delete/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.getallBlogCategories=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/blog/category",{headers:{"Content-Type":"application/json","x-project":t}}),r=await s.json();if([401,402,403,404,500,502,501].includes(s.status))throw new Error(r.message);return r},this.createBlogCategory=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/blog/category",{method:"POST",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.deleteBlogCategory=async function(s){const r=await fetch(this._baseurl+`/v2/api/lambda/blog/category/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.getallBlogTags=async function(){const s=await fetch(this._baseurl+"/v2/api/lambda/blog/tags",{headers:{"Content-Type":"application/json","x-project":t}}),r=await s.json();if([401,402,403,404,500,502,501].includes(s.status))throw new Error(r.message);return r},this.createBlogTag=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/blog/tags",{method:"POST",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.deleteBlogTag=async function(s){const r=await fetch(this._baseurl+"/v2/api/lambda/blog/tags",{method:"DELETE",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if([401,402,403,404,500,502,501].includes(r.status))throw new Error(a.message);return a},this.getInvoiceById=async function(s){const r={"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},a=await fetch(this._baseurl+`/v3/api/custom/equality_record/invoice/${s}`,{method:"get",headers:r}),n=await a.json();if([401,403,500].includes(a.status))throw new Error(n.message);return n},this.createServiceAgreementPDF=async function(s){const r=await fetch(this._baseurl+"/v3/api/custom/equality_record/service-agreement/pdf",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.processInvoicePayment=async function(s){const r=await fetch(this._baseurl+"/v3/api/custom/equality_record/invoice/payment",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.createInvoiceQuote=async function(s){const r=await fetch(this._baseurl+"/v3/api/custom/equality_record/invoice/quote",{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")},body:JSON.stringify(s)}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.convertQuoteToInvoice=async function(s){const r=await fetch(this._baseurl+`/v3/api/custom/equality_record/invoice/quote/${s}/convert`,{method:"post",headers:{"Content-Type":"application/json","x-project":t,Authorization:"Bearer "+localStorage.getItem("token")}}),a=await r.json();if([401,403,500].includes(r.status))throw new Error(a.message);return a},this.createInvoice=async s=>{try{return await this.callRawAPI("/v3/api/custom/equality_record/subscription/invoice",s,"POST")}catch(r){throw new Error(r.message)}},this.getInvoices=async(s=1,r=10,a={})=>{try{return await this.callRawAPI(`/v3/api/custom/equality_record/subscription/invoices?page=${s}&limit=${r}`,{filter:a},"POST")}catch(n){throw new Error(n.message)}},this.getInvoiceById=async s=>{try{return await this.callRawAPI(`/v3/api/custom/equality_record/subscription/invoice/${s}`,[],"GET")}catch(r){throw new Error(r.message)}},this.processPayment=async s=>{try{return await this.callRawAPI("/v3/api/custom/equality_record/subscription/payment",s,"POST")}catch(r){throw new Error(r.message)}},this.recordManualPayment=async s=>{try{return await this.callRawAPI("/v3/api/custom/equality_record/subscription/payment/manual",s,"POST")}catch(r){throw new Error(r.message)}},this.refundPayment=async s=>{try{return await this.callRawAPI("/v3/api/custom/equality_record/subscription/payment/refund",s,"POST")}catch(r){throw new Error(r.message)}},this.getCoupons=async function(){return await this.callRawAPI("/v3/api/custom/equality_record/subscription/coupons",[],"GET")},this.createCoupon=async function(s){return await this.callRawAPI("/v3/api/custom/equality_record/subscription/coupon",s,"POST")},this.updateCoupon=async function(s,r){return await this.callRawAPI(`/v3/api/custom/equality_record/subscription/coupon/${s}`,r,"PUT")},this.deleteCoupon=async function(s){return await this.callRawAPI(`/v3/api/custom/equality_record/subscription/coupon/${s}`,[],"DELETE")},this}const Me=d.createContext({state:{isAuthenticated:!1,user:null,userName:null,token:null,role:null,sessionExpired:null,photo:null,companyName:null,subscriptionStatus:null},dispatch:()=>null}),on={isAuthenticated:!1,user:null,userName:null,token:null,role:null,sessionExpired:null,photo:null,companyName:null,subscriptionStatus:null},nn=(o,t)=>{var s;switch(t.type){case"LOGIN":return localStorage.setItem("user",Number(t.payload.user_id)),t.payload.first_name&&localStorage.setItem("userName",t.payload.first_name+" "+t.payload.last_name),localStorage.setItem("token",t.payload.token),localStorage.setItem("role",t.payload.role),localStorage.setItem("photo",(s=t.payload)==null?void 0:s.photo),{...o,isAuthenticated:!0,user:Number(localStorage.getItem("user")),userName:localStorage.getItem("userName"),token:localStorage.getItem("token"),role:localStorage.getItem("role"),photo:localStorage.getItem("photo"),companyName:localStorage.getItem("companyName")};case"LOGOUT":return localStorage.removeItem("user"),localStorage.removeItem("userName"),localStorage.removeItem("token"),{...o,isAuthenticated:!1,user:null};case"SESSION_EXPIRED":return{...o,sessionExpired:!0};case"SUBSCRIPTION_STATUS":return{...o,subscriptionStatus:t.payload.subscriptionStatus};case"SET_PROFILE":return localStorage.setItem("photo",t.payload.photo),localStorage.setItem("companyName",t.payload.companyName),{...o,photo:t.payload.photo,companyName:t.payload.companyName};default:return o}};let ln=new qe;const Ce=(o,t)=>{localStorage.getItem("role"),t==="TOKEN_EXPIRED"&&o({type:"SESSION_EXPIRED"})},cn=({children:o})=>{const[t,s]=y.useReducer(nn,on);return d.useEffect(()=>{const r=localStorage.getItem("user"),a=localStorage.getItem("token"),n=localStorage.getItem("role");a&&async function(){try{const i=await ln.check(n);s({type:"LOGIN",payload:{user_id:r,token:a,role:n,photo:localStorage.getItem("photo")}})}catch{n?(localStorage.removeItem("workOrderSearchFilter"),s({type:"LOGOUT"}),window.location.href="/"+n+"/login"):localStorage.getItem("subscribed")?window.location.href="/"+n+"/login":(localStorage.removeItem("workOrderSearchFilter"),s({type:"LOGOUT"}),window.location.href="/")}}()},[]),e.jsx(Me.Provider,{value:{state:t,dispatch:s},children:o})};let dn=new qe;const un=async()=>{try{const o="/v3/api/custom/equality_record/setting/public/site_images";return await dn.callRawAPI(o,[],"GET")}catch(o){return o}},mn="REQUEST_LOADING",hn="REQUEST_SUCCESS",pn="REQUEST_FAILED",fn="SET_GLOBAL_PROPERTY",xe=d.createContext(),xn={globalMessage:"",toastStatus:"success",isOpen:!0,path:"",projectRow:null,showProfile:!1,siteLogo:"",landingImage:"",assignedIdeas:[],masterProjects:[],subProjectLyrics:[],songSubProjects:[],subProjectLyricsEditWorkOrder:[],songSubProjectsEditWorkOrder:[],projectIdeas:[],eightcount_id:null,subproject_update:!1,loading:!1,success:!1,error:!1,data:[]},gn=(o,t)=>{var s,r;switch(t.type){case"SNACKBAR":return{...o,globalMessage:t.payload.message,toastStatus:t.payload.toastStatus};case"SETPATH":return{...o,path:t.payload.path};case"OPEN_SIDEBAR":return{...o,isOpen:t.payload.isOpen};case"SET_PROJECT_ROW":return{...o,projectRow:t.payload};case"TOGGLE_PROFILE":return{...o,showProfile:t.payload.showProfile};case"SITE_IMAGES":return{...o,siteLogo:t.payload.siteLogo,landingImage:t.payload.landingImage};case"SET_ASSIGNED_IDEAS":return{...o,assignedIdeas:t.payload};case"SET_SUB_PROJECT_LYRICS":return{...o,subProjectLyrics:t.payload};case"SET_SONG_SUB_PROJECTS":return{...o,songSubProjects:t.payload};case"SET_SUB_PROJECT_LYRICS_EDIT_WORK_ORDER":return{...o,subProjectLyricsEditWorkOrder:t.payload};case"SET_SONG_SUB_PROJECTS_EDIT_WORK_ORDER":return{...o,songSubProjectsEditWorkOrder:t.payload};case"SET_PROJECT_IDEAS":return{...o,projectIdeas:t.payload};case"SET_SUBPROJECT_UPDATE":return{...o,subproject_update:t.payload};case"SET_CURRENT_EIGHTCOUNT_ID":return{...o,eightcount_id:t.payload};case"SET_CURRENT_PENDING_LENGTH":return{...o,pendingLength:t.payload};case mn:return{...o,[t.item]:{...o[t==null?void 0:t.item],loading:t==null?void 0:t.payload}};case hn:return{...o,[t.item]:{...o[t==null?void 0:t.item],...t==null?void 0:t.payload,data:{...(s=o[t==null?void 0:t.item])==null?void 0:s.data,...(r=t==null?void 0:t.payload)==null?void 0:r.data},error:!1,success:!0,loading:!1}};case pn:return{...o,[t.item]:{...o[t==null?void 0:t.item],...t==null?void 0:t.payload,error:!0,success:!1,loading:!1}};case fn:if(t.property.includes(".")){const[a,n]=t.property.split(".");return{...o,[a]:{...o[a],[n]:t==null?void 0:t.payload}}}else return{...o,[t.property]:t==null?void 0:t.payload};default:return o}},R=(o,t,s=3e3,r="success")=>{o({type:"SNACKBAR",payload:{message:t,toastStatus:r}}),setTimeout(()=>{o({type:"SNACKBAR",payload:{message:""}})},s)},bn=({children:o})=>{const[t,s]=y.useReducer(gn,xn),r=async()=>{const a=await un();if(!a.error){let n="",i="";a.list.length>0&&(console.log(a.list),a.list.forEach((c,l)=>{l==2&&(n=`${c.setting_value}`),c.setting_key==="landing_image"&&(i=`${c.setting_value}`)})),s({type:"SITE_IMAGES",payload:{siteLogo:`https://app.equalityrecords.com/${n}`,landingImage:`https://app.equalityrecords.com/${i}`}})}};return d.useEffect(()=>{r()},[]),e.jsx(xe.Provider,{value:{state:t,dispatch:s},children:o})},wr=()=>{console.log(d.useContext(xe));const{state:{globalMessage:o,toastStatus:t},dispatch:s}=d.useContext(xe);return console.log(o),(o==null?void 0:o.length)>0?e.jsxs("div",{id:"mkd-toast",className:`shadow-default fixed left-1/2 top-5 z-[10000] flex -translate-x-1/2 items-center rounded border border-strokedark p-4 ${t==="success"?"bg-emerald-600":t==="error"?"bg-danger":"bg-meta-6"}`,role:"alert",children:[e.jsx("div",{className:"text-[1.2rem] font-medium text-white",children:o}),e.jsx("div",{className:"flex items-center ml-4",children:e.jsxs("button",{type:"button",className:"inline-flex h-8 w-8 items-center justify-center rounded-lg border border-strokedark bg-boxdark p-1.5 text-white hover:bg-meta-4","aria-label":"Close",onClick:()=>{s({type:"SNACKBAR",payload:{message:""}})},children:[e.jsx("span",{className:"sr-only",children:"Close"}),e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})]}):null},wn=()=>(d.useContext(Me),y.useState(!1),st(),e.jsx("div",{})),Zr=({children:o,onClick:t,className:s=""})=>{const r=y.useRef(null);return y.useEffect(()=>{function a(n){r.current&&!r.current.contains(n.target)&&t()}return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[t]),e.jsx("div",{ref:r,className:s,children:o})},yn=()=>{const o=st(),{state:t,dispatch:s}=d.useContext(Me),{state:r,dispatch:a}=d.useContext(xe);jt();let{isOpen:n,showProfile:i}=r,c=h=>a({type:"OPEN_SIDEBAR",payload:{isOpen:h}});const l=()=>{localStorage.removeItem("token"),a({type:"TOGGLE_PROFILE",payload:{showProfile:!1}}),s({type:"LOGOUT"}),o(`${t==null?void 0:t.role}/login`)};let m=h=>a({type:"TOGGLE_PROFILE",payload:{showProfile:h}});const u=localStorage.getItem("UserSubscription");return e.jsx("header",{className:"z-999 sticky top-0 flex w-full bg-boxdark drop-shadow-none",children:e.jsxs("div",{className:"flex flex-grow items-center justify-between px-4 py-4 shadow-2 md:px-6 2xl:px-11",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4",children:[n?e.jsx(fo,{onClick:()=>c(!n),className:"hidden h-5 w-5 cursor-pointer text-bodydark lg:block"}):e.jsx(xo,{onClick:()=>c(!n),className:"hidden h-5 w-5 cursor-pointer lg:block"}),n?null:e.jsx("button",{className:"z-99999 block rounded border border-stroke bg-boxdark p-1.5 shadow-sm lg:hidden dark:border-strokedark",onClick:()=>c(!n),children:e.jsx(go,{})})]}),e.jsxs("div",{className:"flex items-center gap-3 2xl:gap-7",children:[t.role!=="client"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"rounded-lg border border-primary bg-primary px-6 py-2 text-base font-medium text-white hover:bg-opacity-90",onClick:()=>o(`/${t.role}/add-project`),children:"Create New Project"}),t.role==="member"&&e.jsx("button",{className:"rounded-lg border border-primary bg-transparent px-6 py-2 text-base font-medium text-white hover:bg-primary/30",onClick:()=>o(`/${t.role}/subscription`),children:u?"Upgrade Plan":"Subscribe Now"})]}),e.jsxs(Zr,{onClick:()=>m(!1),className:"relative",children:[e.jsxs("button",{onClick:()=>m(!i),className:"flex items-center gap-4",children:[e.jsxs("span",{className:"hidden text-right lg:block",children:[e.jsx("span",{className:"block text-sm font-medium text-white",children:t.userName??"User"}),e.jsx("span",{className:"block text-xs text-gray-300",children:t.companyName??"Company"})]}),t.photo?e.jsx("span",{className:"h-12 w-12 rounded-full",children:e.jsx("img",{crossOrigin:"anonymous",className:"h-full w-full rounded-full object-cover",src:t.photo,alt:"User"})}):e.jsx(M,{className:"h-12 w-12 rounded-full text-gray-300",icon:"fa-solid fa-circle-user"}),e.jsx("svg",{className:`hidden fill-current sm:block ${i?"rotate-180":""}`,width:"12",height:"8",viewBox:"0 0 12 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.410765 0.910734C0.736202 0.585297 1.26384 0.585297 1.58928 0.910734L6.00002 5.32148L10.4108 0.910734C10.7362 0.585297 11.2638 0.585297 11.5893 0.910734C11.9147 1.23617 11.9147 1.76381 11.5893 2.08924L6.58928 7.08924C6.26384 7.41468 5.7362 7.41468 5.41077 7.08924L0.410765 2.08924C0.0853277 1.76381 0.0853277 1.23617 0.410765 0.910734Z",fill:""})})]}),i&&e.jsxs("div",{className:"w-62.5 shadow-default absolute right-0 mt-4 flex flex-col rounded border border-strokedark bg-boxdark pt-4 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("ul",{className:"py-7.5 flex flex-col gap-5 border-b border-strokedark px-6 dark:border-strokedark",children:[e.jsx("li",{children:e.jsxs("a",{href:`/${t.role}/profile`,className:"flex items-center gap-3.5 text-sm font-medium duration-300 ease-in-out hover:text-primary lg:text-base",children:[e.jsx(M,{icon:"fa-solid fa-user"}),"My Profile"]})}),t.role!=="client"||t.role!=="manager"?e.jsx("li",{children:e.jsxs("a",{href:`/${t.role}/setting`,className:"flex items-center gap-3.5 whitespace-nowrap text-sm font-medium duration-300 ease-in-out hover:text-primary lg:text-base",children:[e.jsx(M,{icon:"fa-solid fa-gear"}),"Account Settings"]})}):null]}),e.jsxs("button",{onClick:l,className:"flex items-center gap-3.5 px-6 py-4 text-sm font-medium duration-300 ease-in-out hover:text-primary lg:text-base",children:[e.jsx(M,{icon:"fa-solid fa-right-from-bracket"}),"Log Out"]})]})]})]})]})})};function yr(){const{state:o,dispatch:t}=d.useContext(Me),{pathname:s}=jt();return d.useEffect(()=>{let r;return o.sessionExpired&&(r=setTimeout(()=>{t({type:"LOGOUT"}),localStorage.getItem("role")==="admin"?window.location.href=`/admin/login?redirect_uri=${s}`:localStorage.getItem("role")==="member"?window.location.href=`/member/login?redirect_uri=${s}`:window.location.href=`/login?redirect_uri=${s}`},4e3)),()=>clearTimeout(r)},[o.sessionExpired,o.subscriptionStatus]),o.sessionExpired?e.jsx("div",{className:"relative w-full min-h-screen",children:e.jsx(Is,{appear:!0,show:!0,as:y.Fragment,children:e.jsxs(Ds,{as:"div",className:"relative z-10",onClose:()=>{},children:[e.jsx(Is.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-25"})}),e.jsx("div",{className:"overflow-y-auto fixed inset-0",children:e.jsx("div",{className:"flex justify-center items-center p-4 min-h-full text-center",children:e.jsx(Is.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:e.jsxs(Ds.Panel,{className:"overflow-hidden p-6 w-full max-w-md text-left align-middle bg-white rounded-2xl shadow-xl transition-all transform",children:[e.jsx(Ds.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900",children:"Session Expired"}),e.jsx("div",{className:"mt-2",children:e.jsx("p",{className:"text-sm text-gray-500",children:"Your current login session has expired. Redirecting to login page shortly"})}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{type:"button",className:"inline-flex justify-center px-4 py-2 text-sm font-medium text-blue-900 bg-blue-100 rounded-md border border-transparent hover:bg-blue-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",onClick:()=>{},children:"Got it, thanks!"})})]})})})})]})})}):null}let It=new qe;const jn=async o=>{try{const t="/v3/api/custom/equality_record/edit";return await It.callRawAPI(t,o,"POST")}catch(t){return t}},vn=async(o,t)=>{try{const s=`/v3/api/custom/equality_record/edit/${t}`;return await It.callRawAPI(s,o,"PUT")}catch(s){return s}},ls=async o=>{let t={filter:o};try{const s="/v3/api/custom/equality_record/edit/retrieve-all";return await It.callRawAPI(s,t,"POST")}catch(s){return s}},ws=async o=>{let t={filter:o};try{const s="/v3/api/custom/equality_record/edit_type/retrieve-all";return await It.callRawAPI(s,t,"POST")}catch(s){return s}},Nn=async o=>{try{const t=`/v3/api/custom/equality_record/edit/view/${o}`;return await It.callRawAPI(t,[],"GET")}catch(t){return t}},ea=async o=>{try{const t=`/v3/api/custom/equality_record/edit/${o}`;return await It.callRawAPI(t,[],"DELETE")}catch(t){return t}},kn=()=>{var i,c;const{dispatch:o}=d.useContext(Me),{dispatch:t,state:s}=d.useContext(xe),r=jt(),a=()=>{t({type:"TOGGLE_PROFILE",payload:{showProfile:!1}}),o({type:"LOGOUT"})},n=async()=>{var m;const l=await ls({user_id:localStorage.getItem("user"),page:1,limit:5e4,edit_status:2});t({type:"SET_CURRENT_PENDING_LENGTH",payload:{pendingLength:((m=l==null?void 0:l.list)==null?void 0:m.length)||0}})};return y.useEffect(()=>{n()},[r.pathname]),e.jsxs("aside",{className:`absolute left-0 top-0 z-[9] flex h-screen w-[180px] flex-col overflow-y-hidden border-r border-strokedark bg-boxdark text-bodydark1 duration-300 ease-linear lg:static lg:translate-x-0 dark:bg-boxdark ${s.isOpen?"":"-translate-x-full"}`,children:[e.jsx("div",{className:"py-5.5 lg:py-6.5 flex items-center justify-between gap-2 px-3 pl-6 lg:pt-[20px]",children:e.jsx("div",{className:"flex items-center justify-center lg:flex",children:e.jsx("img",{crossOrigin:"anonymous",src:s.siteLogo??`${window.location.origin}/new/cheerEQ-2-Ed2.png`,className:"h-auto w-[170px]",alt:"logo"})})}),e.jsx("div",{className:"no-scrollbar custom-overflow flex flex-col overflow-y-auto duration-300 ease-linear",children:e.jsx("nav",{className:"mt-2 px-2 py-2 lg:mt-3 lg:px-3",children:e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 ml-4 text-sm font-semibold text-bodydark2",children:"MENU"}),e.jsxs("ul",{className:"mb-6 flex flex-col gap-1.5",children:[e.jsx("li",{children:e.jsxs(At,{to:"/client/projects",className:`group relative flex items-center gap-2.5 rounded-sm px-4 py-2 font-medium duration-300 ease-in-out hover:bg-graydark dark:hover:bg-meta-4 ${s.path==="projects"?"bg-graydark dark:bg-meta-4":""}`,children:[e.jsx(bo,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[15px]",children:"Projects"})]})}),e.jsx("li",{children:e.jsxs(At,{to:"/client/edits",className:`group relative flex items-center gap-2.5 rounded-sm px-4 py-2 font-medium duration-300 ease-in-out hover:bg-graydark dark:hover:bg-meta-4 ${s.path==="edits"?"bg-graydark dark:bg-meta-4":""}`,children:[e.jsx(wo,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[15px]",children:"Edits"}),((i=s==null?void 0:s.pendingLength)==null?void 0:i.pendingLength)>0&&e.jsx("span",{className:"absolute right-4 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-[2px] bg-red text-xs text-white",children:(c=s==null?void 0:s.pendingLength)==null?void 0:c.pendingLength})]})}),e.jsx("li",{children:e.jsxs(At,{to:"/client/count-tracks",className:`group relative flex items-center gap-2.5 rounded-sm px-4 py-2 font-medium duration-300 ease-in-out hover:bg-graydark dark:hover:bg-meta-4 ${s.path==="count-tracks"?"bg-graydark dark:bg-meta-4":""}`,children:[e.jsx(yo,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[15px]",children:"Count Tracks"})]})}),e.jsx("li",{children:e.jsxs(At,{to:"/client/profile",className:`group relative flex items-center gap-2.5 rounded-sm px-4 py-2 font-medium duration-300 ease-in-out hover:bg-graydark dark:hover:bg-meta-4 ${s.path==="profile"?"bg-graydark dark:bg-meta-4":""}`,children:[e.jsx(jo,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[15px]",children:"Profile"})]})}),e.jsx("li",{children:e.jsxs(At,{to:"/client/login",onClick:a,className:"group relative flex items-center gap-2.5 rounded-sm px-4 py-2 font-medium duration-300 ease-in-out hover:bg-graydark dark:hover:bg-meta-4",children:[e.jsx(vo,{className:"h-4 w-4 text-[#CD4631]"}),e.jsx("span",{className:"text-[#CD4631]",children:"Logout"})]})})]})]})})})]})},Sn=({style:o})=>e.jsx("div",{style:{display:"flex",width:"100vw",height:"100vh",justifyContent:"center",alignItems:"center",...o},children:e.jsx(Be,{color:"#fff",size:40})}),jr=()=>{const[o,t]=d.useState(!0);return d.useEffect(()=>{setTimeout(()=>{t(!1)},5e3)},[]),e.jsx(e.Fragment,{children:o?e.jsx(Sn,{}):e.jsx("div",{className:"flex h-screen w-full items-center justify-center text-7xl text-gray-700 ",children:"Not Found"})})};function Dt(o,t,s){return t===void 0&&(t={}),s===void 0&&(s={}),function(r,a,n){try{return Promise.resolve(function(i,c){try{var l=(t.context,Promise.resolve(o[s.mode==="sync"?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:a}))).then(function(m){return n.shouldUseNativeValidation&&Ao({},n),{values:s.raw?r:m,errors:{}}}))}catch(m){return c(m)}return l&&l.then?l.then(void 0,c):l}(0,function(i){if(!i.inner)throw i;return{values:{},errors:Ro((c=i,l=!n.shouldUseNativeValidation&&n.criteriaMode==="all",(c.inner||[]).reduce(function(m,u){if(m[u.path]||(m[u.path]={message:u.message,type:u.type}),l){var h=m[u.path].types,p=h&&h[u.type];m[u.path]=Oo(u.path,l,m,u.type,p?[].concat(p,u.message):u.message)}return m},{})),n)};var c,l}))}catch(i){return Promise.reject(i)}}}var ta={},yt={};Object.defineProperty(yt,"__esModule",{value:!0});yt.cssValue=yt.parseLengthAndUnit=void 0;var _n={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function sa(o){if(typeof o=="number")return{value:o,unit:"px"};var t,s=(o.match(/^[0-9.]*/)||"").toString();s.includes(".")?t=parseFloat(s):t=parseInt(s,10);var r=(o.match(/[^0-9]*$/)||"").toString();return _n[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(o," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}yt.parseLengthAndUnit=sa;function Cn(o){var t=sa(o);return"".concat(t.value).concat(t.unit)}yt.cssValue=Cn;var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.createAnimation=void 0;var En=function(o,t,s){var r="react-spinners-".concat(o,"-").concat(s);if(typeof window>"u"||!window.document)return r;var a=document.createElement("style");document.head.appendChild(a);var n=a.sheet,i=`
@keyframes `.concat(r,` {
`).concat(t,`
}
`);return n&&n.insertRule(i,0),r};Gt.createAnimation=En;var xt=Ye&&Ye.__assign||function(){return xt=Object.assign||function(o){for(var t,s=1,r=arguments.length;s<r;s++){t=arguments[s];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=t[a])}return o},xt.apply(this,arguments)},Pn=Ye&&Ye.__createBinding||(Object.create?function(o,t,s,r){r===void 0&&(r=s);var a=Object.getOwnPropertyDescriptor(t,s);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(o,r,a)}:function(o,t,s,r){r===void 0&&(r=s),o[r]=t[s]}),In=Ye&&Ye.__setModuleDefault||(Object.create?function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}:function(o,t){o.default=t}),Dn=Ye&&Ye.__importStar||function(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var s in o)s!=="default"&&Object.prototype.hasOwnProperty.call(o,s)&&Pn(t,o,s);return In(t,o),t},On=Ye&&Ye.__rest||function(o,t){var s={};for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&t.indexOf(r)<0&&(s[r]=o[r]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(o);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(o,r[a])&&(s[r[a]]=o[r[a]]);return s};Object.defineProperty(ta,"__esModule",{value:!0});var Os=Dn(y),As=yt,An=Gt,vr=(0,An.createAnimation)("MoonLoader","100% {transform: rotate(360deg)}","moon");function Rn(o){var t=o.loading,s=t===void 0?!0:t,r=o.color,a=r===void 0?"#000000":r,n=o.speedMultiplier,i=n===void 0?1:n,c=o.cssOverride,l=c===void 0?{}:c,m=o.size,u=m===void 0?60:m,h=On(o,["loading","color","speedMultiplier","cssOverride","size"]),p=(0,As.parseLengthAndUnit)(u),x=p.value,f=p.unit,v=x/7,g=xt({display:"inherit",position:"relative",width:"".concat("".concat(x+v*2).concat(f)),height:"".concat("".concat(x+v*2).concat(f)),animation:"".concat(vr," ").concat(.6/i,"s 0s infinite linear"),animationFillMode:"forwards"},l),w=function(j){return{width:(0,As.cssValue)(j),height:(0,As.cssValue)(j),borderRadius:"100%"}},N=xt(xt({},w(v)),{backgroundColor:"".concat(a),opacity:"0.8",position:"absolute",top:"".concat("".concat(x/2-v/2).concat(f)),animation:"".concat(vr," ").concat(.6/i,"s 0s infinite linear"),animationFillMode:"forwards"}),k=xt(xt({},w(x)),{border:"".concat(v,"px solid ").concat(a),opacity:"0.1",boxSizing:"content-box",position:"absolute"});return s?Os.createElement("span",xt({style:g},h),Os.createElement("span",{style:N}),Os.createElement("span",{style:k})):null}var Tn=ta.default=Rn;const Ln=y.memo(({loading:o=!1,disabled:t,children:s,type:r="button",className:a,loaderclasses:n,onClick:i,color:c="#ffffff"})=>{const l={borderColor:"#ffffff"},m=y.useId();return e.jsx("button",{type:r,disabled:t,className:`flex items-center justify-center gap-5 ${a}`,onClick:i,children:e.jsxs(e.Fragment,{children:[e.jsx(Tn,{color:c,loading:o,cssOverride:l,size:20,className:n,"data-testid":m}),e.jsx("span",{children:s})]})})}),or=()=>e.jsxs("div",{role:"status",className:"absolute left-1/2 top-2/4 -translate-x-1/2 -translate-y-1/2",children:[e.jsx(Be,{size:20,color:"#FFF"}),e.jsx("span",{className:"sr-only",children:"Loading..."})]});let $n=new qe;const Mn=()=>{const o=Pt({email:Re().email().required(),password:Re().required()}).required(),{dispatch:t}=d.useContext(Me),{dispatch:s,state:r}=d.useContext(xe),[a,n]=y.useState(!1),i=jt(),c=new URLSearchParams(i.search),l=c.get("redirect_uri"),m=st(),{register:u,handleSubmit:h,setError:p,formState:{errors:x}}=Et({resolver:Dt(o)});console.log(r.siteLogo,"sitelogo");const f=c.get("project"),v=async g=>{try{n(!0);const w=await $n.login(g.email,g.password,"client");if(!w.error)t({type:"LOGIN",payload:w}),localStorage.setItem("photo",w==null?void 0:w.photo),localStorage.setItem("companyName",w==null?void 0:w.company_name),localStorage.setItem("userClientId",w==null?void 0:w.client_id),localStorage.setItem("userProgramName",w==null?void 0:w.program),localStorage.setItem("member_company_logo",w==null?void 0:w.company_logo),localStorage.setItem("license_logo",w==null?void 0:w.license_company_logo),localStorage.setItem("member_company_name",w==null?void 0:w.member_company_name),R(s,"Successfully Logged In",4e3,"success"),m(f?`/client/view-project/${f}`:l??"/client/projects");else if(n(!1),w.validation){const N=Object.keys(w.validation);for(let k=0;k<N.length;k++){const j=N[k];p(j,{type:"manual",message:w.validation[j]})}}}catch(w){n(!1),R(s,w.message,4e3,"error"),p("email",{type:"manual",message:w.response.data.message?w.response.data.message:w.message})}};return e.jsx("div",{className:"max-w-screen jus flex h-full",children:e.jsx("div",{className:"shadow-default flex min-h-screen w-full items-center justify-center rounded border border-form-strokedark bg-boxdark dark:border-form-strokedark dark:bg-boxdark",children:e.jsxs("div",{className:"flex w-full flex-wrap items-center",children:[e.jsx("div",{className:"hidden w-full xl:block xl:w-1/2",children:e.jsxs("div",{className:"py-17.5 px-26 text-center",children:[e.jsx(wt,{className:"mb-5.5 inline-block",to:"/",children:e.jsx("img",{crossOrigin:"anonymous",src:r.siteLogo??`${window.location.origin}/new/cheerEQ-2-Ed2.png`,className:"h-auto w-[300px] dark:hidden",alt:"Logo"})}),e.jsx("p",{className:"2xl:px-20",children:"Welcome back! Please sign in to access your account."}),e.jsx("span",{className:"mt-15 inline-block"})]})}),e.jsx("div",{className:"w-full border-form-strokedark px-12 xl:w-1/2 xl:border-l-2 dark:border-form-strokedark",children:e.jsxs("div",{className:"sm:p-12.5 xl:p-17.5 w-full p-4",children:[e.jsx("h2",{className:"mb-9 text-2xl font-bold text-white sm:text-title-xl2 dark:text-white",children:"Sign In to Your Account"}),e.jsxs("form",{onSubmit:h(v),children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white dark:text-white",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"email",placeholder:"Enter your email",...u("email"),className:"w-full rounded-lg border border-form-strokedark bg-form-input py-4 pl-6 pr-10 text-white outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary"}),x.email&&e.jsx("span",{className:"mt-1 text-sm text-red-500",children:x.email.message})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white dark:text-white",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"password",placeholder:"Enter your password",...u("password"),className:"w-full rounded-lg border border-form-strokedark bg-form-input py-4 pl-6 pr-10 text-white outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input dark:text-white dark:focus:border-primary"}),x.password&&e.jsx("span",{className:"mt-1 text-sm text-red-500",children:x.password.message})]})]}),e.jsx("div",{className:"mb-5",children:e.jsx("button",{type:"submit",disabled:a,className:"w-full cursor-pointer rounded-lg border border-primary bg-primary p-4 text-white transition hover:bg-opacity-90 disabled:opacity-50",children:a?e.jsx(Be,{size:18,color:"#fff"}):"Sign In"})})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(wt,{to:"/client/forgot",className:"text-primary hover:underline",children:"Forgot Password?"})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(wt,{to:"/",className:"text-white hover:text-primary",children:"Back to Home"})})]})})]})})})},Nr="Reset code sent to your email",zn=()=>{var g,w;const{dispatch:o}=d.useContext(xe);d.useContext(Me);const[t,s]=y.useState(!1),[r,a]=y.useState(!1),n=jt();console.log(n.pathname);const{dispatch:i,state:c}=d.useContext(xe);let m=n.pathname.slice(1).split("/")[0];console.log(m);const u=Pt({email:Re().email().required()}).required(),{register:h,handleSubmit:p,setError:x,formState:{errors:f}}=Et({resolver:Dt(u)}),v=async N=>{let k=new qe;try{s(!0);const j=await k.forgot("client",N.email);if(!j.error)a(!0),R(o,Nr);else if(j.validation){const $=Object.keys(j.validation);for(let V=0;V<$.length;V++){const L=$[V];x(L,{type:"manual",message:j.validation[L]})}}s(!1)}catch(j){s(!1),R(o,j.message,4e3,"error"),x("email",{type:"manual",message:j.response.data.message?j.response.data.message:j.message}),Ce(o,j.response.data.message?j.response.data.message:j.message)}};return e.jsx("div",{className:"flex justify-center items-center p-4 w-full min-h-screen text-white bg-boxdark md:p-8",children:e.jsx("div",{className:"w-full text-white rounded border-0 shadow-default border-y-0 border-stroke bg-boxdark dark:border-strokedark dark:bg-boxdark",children:e.jsxs("div",{className:"flex flex-wrap items-center",children:[e.jsx("div",{className:"hidden w-full xl:block xl:w-1/2",children:e.jsxs("div",{className:"px-26 py-17.5 text-center",children:[e.jsx(wt,{className:"mb-5.5 inline-block",to:"/",children:e.jsx("img",{crossOrigin:"anonymous",src:c.siteLogo??`${window.location.origin}/new/cheerEQ-2-Ed2.png`,className:"h-auto w-[300px] dark:hidden",alt:"Logo"})}),e.jsx("p",{className:"2xl:px-20",children:"Enter your email to receive password reset instructions."})]})}),e.jsx("div",{className:"w-full border-stroke xl:w-1/2 xl:border-l-2 dark:border-strokedark",children:e.jsxs("div",{className:"sm:p-12.5 xl:p-17.5 w-full p-4",children:[e.jsx("h2",{className:"mb-9 text-2xl font-bold text-white sm:text-title-xl2",children:"Forgot Password"}),e.jsxs("form",{onSubmit:p(v),children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"email",placeholder:"Enter your email",...h("email"),className:`w-full rounded-lg border bg-transparent py-4 pl-6 pr-10 outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input ${(g=f.email)!=null&&g.message?"border-red-500":"border-form-strokedark"}`}),((w=f.email)==null?void 0:w.message)&&e.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.email.message}),r&&e.jsx("p",{className:"mt-1 text-sm text-green-500",children:Nr})]})]}),e.jsx("div",{className:"mb-5",children:e.jsx("button",{type:"submit",disabled:t,className:"p-4 w-full text-white rounded-lg border transition cursor-pointer border-primary bg-primary hover:bg-opacity-90 disabled:opacity-50",children:t?e.jsx(Be,{size:18,color:"white"}):"Send Reset Link"})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(wt,{to:"/client/login",className:"text-primary",children:"Back to Login"})})]})]})})]})})})},Un=()=>{var g,w,N,k,j,$;const{dispatch:o}=d.useContext(Me),{dispatch:t}=d.useContext(xe),[s,r]=y.useState(!1),a=window.location.search,i=new URLSearchParams(a).get("token"),{dispatch:c,state:l}=d.useContext(xe),m=Pt({code:Re().required(),password:Re().required(),confirmPassword:Re().oneOf([To("password"),null],"Passwords must match")}).required(),u=st(),{register:h,handleSubmit:p,setError:x,formState:{errors:f}}=Et({resolver:Dt(m)}),v=async V=>{let L=new qe;try{r(!0);const z=await L.reset(i,V.code,V.password);if(!z.error)R(t,"Password Reset Successfully",5e3),setTimeout(()=>{u("/client/login")},2e3);else if(z.validation){const q=Object.keys(z.validation);for(let H=0;H<q.length;H++){const Z=q[H];x(Z,{type:"manual",message:z.validation[Z]})}}r(!1)}catch(z){r(!1),x("code",{type:"manual",message:z.response.data.message?z.response.data.message:z.message}),Ce(o,z.response.data.message?z.response.data.message:z.message)}};return e.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-boxdark p-4 text-white md:p-8",children:e.jsx("div",{className:"shadow-default w-full rounded border-0 border-y-0 border-strokedark bg-boxdark text-white dark:border-strokedark dark:bg-boxdark",children:e.jsxs("div",{className:"flex flex-wrap items-center",children:[e.jsx("div",{className:"hidden w-full xl:block xl:w-1/2",children:e.jsxs("div",{className:"px-26 py-17.5 text-center",children:[e.jsx(wt,{className:"mb-5.5 inline-block",to:"/",children:e.jsx("img",{crossOrigin:"anonymous",src:l.siteLogo??`${window.location.origin}/new/cheerEQ-2-Ed2.png`,className:"h-auto w-[300px] dark:hidden",alt:"Logo"})}),e.jsx("p",{className:"2xl:px-20",children:"Reset your password to regain access to your account."})]})}),e.jsx("div",{className:"w-full border-strokedark xl:w-1/2 xl:border-l-2 dark:border-strokedark",children:e.jsxs("div",{className:"sm:p-12.5 xl:p-17.5 w-full p-4",children:[e.jsx("h2",{className:"mb-9 text-2xl font-bold text-white sm:text-title-xl2",children:"Reset Password"}),e.jsxs("form",{onSubmit:p(v),children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white",children:"Code"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",placeholder:"Enter code sent to your email",...h("code"),className:`w-full rounded-lg border border-form-strokedark bg-form-input py-4 pl-6 pr-10 outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input ${(g=f.code)!=null&&g.message?"border-red-500":"border-form-strokedark"}`}),((w=f.code)==null?void 0:w.message)&&e.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.code.message})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"password",placeholder:"Create new password",...h("password"),className:`w-full rounded-lg border border-form-strokedark bg-form-input py-4 pl-6 pr-10 outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input ${(N=f.password)!=null&&N.message?"border-red-500":"border-form-strokedark"}`}),((k=f.password)==null?void 0:k.message)&&e.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.password.message})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-white",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"password",placeholder:"Confirm your password",...h("confirmPassword"),className:`w-full rounded-lg border border-form-strokedark bg-form-input py-4 pl-6 pr-10 outline-none focus:border-primary focus-visible:shadow-none dark:border-form-strokedark dark:bg-form-input ${(j=f.confirmPassword)!=null&&j.message?"border-red-500":"border-form-strokedark"}`}),(($=f.confirmPassword)==null?void 0:$.message)&&e.jsx("p",{className:"mt-1 text-sm text-red-500",children:f.confirmPassword.message})]})]}),e.jsx("div",{className:"mb-5",children:e.jsx("button",{type:"submit",disabled:s,className:"w-full cursor-pointer rounded-lg border border-primary bg-primary p-4 text-white transition hover:bg-opacity-90 disabled:opacity-50",children:s?e.jsx(Be,{size:10,"color:white":!0}):"Reset Password"})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(wt,{to:"/client/login",className:"text-primary",children:"Back to Login"})})]})]})})]})})})},Bn=o=>Array.isArray(o)?o.map(t=>{var s;return t.value!==void 0&&t.label!==void 0?t:typeof t=="object"&&t!==null?{value:((s=t.id)==null?void 0:s.toString())||"",label:t.name||""}:{value:(t==null?void 0:t.toString())||"",label:(t==null?void 0:t.toString())||""}}):[],ys=({options:o=[],label:t="Dropdown Button",register:s,name:r,defaultValue:a,className:n="",value:i,onChange:c,position:l="down",dropdownRef:m=null,onChange2:u=null,children:h,disabled:p=!1,textClass:x=""})=>{var q,H,Z;const f=y.useRef(null),v=y.useRef(null),[g,w]=y.useState(!1),[N,k]=y.useState(null);y.useEffect(()=>{if(g&&f.current&&v.current){const U=bs(f.current,v.current,{placement:l==="down"?"bottom-start":"top-start",modifiers:[{name:"offset",options:{offset:[0,4]}},{name:"preventOverflow",options:{padding:8,boundary:"viewport"}},{name:"flip",options:{fallbackPlacements:["top-start","bottom-start"]}}]});return()=>{U.destroy()}}},[g,l]),y.useEffect(()=>{const U=I=>{f.current&&!f.current.contains(I.target)&&v.current&&!v.current.contains(I.target)&&w(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]);const j=U=>{if(k(U),!s)c(U.value);else if(s){const I=new Event("change",{bubbles:!0}),O=document.querySelector(`select[name="${r}"]`);O.value=U.value,u&&u(U.value),O.dispatchEvent(I)}w(!1)},$=()=>h?d.Children.map(h,U=>(U==null?void 0:U.type)==="option"?{value:U.props.value,label:U.props.children}:null).filter(Boolean):[],V=o.length>0?Bn(o):$(),z=((q=V.find(U=>U.value==i))==null?void 0:q.label)||((H=V.find(U=>U.value==a))==null?void 0:H.label)||(N==null?void 0:N.label)||null||t;return e.jsxs("div",{className:"relative w-full",children:[e.jsxs("button",{ref:f,type:"button",className:`flex w-full items-center justify-between gap-2 rounded border border-form-strokedark bg-form-input px-3 py-2 text-sm outline-none transition ${n}`,disabled:p,onClick:()=>w(!g),children:[e.jsx("span",{className:`truncate whitespace-nowrap text-sm font-medium ${z===t?"!text-base !font-normal text-bodydark2":"text-white"} ${x}`,children:z}),e.jsx("span",{className:`transition-transform duration-200 ${g?"rotate-180":""}`,children:e.jsx(M,{icon:Lo})})]}),s&&e.jsx("select",{...s(r),className:"sr-only",defaultValue:a||i,children:V.map((U,I)=>e.jsx("option",{value:U.value,children:U.label},I))}),g&&e.jsx("div",{ref:v,className:"z-[9999] min-w-[150px] overflow-hidden rounded border border-form-strokedark bg-form-input shadow-lg",style:{position:"fixed",width:((Z=f.current)==null?void 0:Z.offsetWidth)+"px"},children:e.jsx("div",{className:"custom-overflow max-h-[300px] overflow-y-auto",children:V.map((U,I)=>e.jsx("div",{className:"flex cursor-pointer gap-1 px-4 py-2 text-bodydark2 transition-colors duration-200 hover:bg-primary/5 hover:text-white",onClick:()=>j(U),children:U.label},I))})})]})},Us=()=>{const o=st(),[t,s]=y.useState(!1),[r,a]=y.useState("1-50"),[n,i]=y.useState(null),c={"1-50":{portal:{monthly:150,annual:1500},studio:{monthly:150,annual:1500},complete:{monthly:250,annual:2500}},"51-100":{portal:{monthly:175,annual:1750},studio:{monthly:175,annual:1750},complete:{monthly:275,annual:2750}},"101-150":{portal:{monthly:200,annual:2e3},studio:{monthly:200,annual:2e3},complete:{monthly:300,annual:3e3}},"151-200":{portal:{monthly:225,annual:2250},studio:{monthly:225,annual:2250},complete:{monthly:325,annual:3250}},"201+":{portal:{monthly:250,annual:2500},studio:{monthly:250,annual:2500},complete:{monthly:350,annual:3500}},"301+":{portal:{monthly:300,annual:3e3},studio:{monthly:300,annual:3e3},complete:{monthly:400,annual:4e3}}},l=m=>{i(n===m?null:m)};return e.jsxs("div",{className:"min-h-screen bg-boxdark",children:[e.jsx("nav",{className:"fixed top-0 z-50 w-full bg-transparent backdrop-blur-sm",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"flex h-20 items-center justify-between",children:[e.jsx("div",{className:"flex items-center",children:e.jsx("img",{src:`${window.location.origin}/new/cheerEQ-1-Ed1.png`,alt:"Logo",className:"h-[80px] w-[180px] object-contain"})}),e.jsxs("div",{className:"hidden md:flex md:items-center md:gap-8",children:[e.jsx("a",{href:"#home",className:"text-sm font-medium text-white hover:text-primary",children:"Home"}),e.jsx("a",{href:"#features",className:"text-sm font-medium text-bodydark hover:text-primary",children:"Features"}),e.jsx("a",{href:"#subscriptions",className:"text-sm font-medium text-bodydark hover:text-primary",children:"Subscriptions"}),e.jsx("a",{href:"#contact",className:"text-sm font-medium text-bodydark hover:text-primary",children:"Contact"}),e.jsx("button",{onClick:()=>o("/member/login"),className:"rounded-full bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:"Sign In"})]}),e.jsx("button",{className:"md:hidden",onClick:()=>s(!t),children:e.jsx(M,{icon:"fa-solid fa-bars",className:"h-6 w-6 text-white"})})]})})}),t&&e.jsx("div",{className:"fixed inset-0 z-40 bg-black md:hidden",children:e.jsxs("div",{className:"flex h-full flex-col p-4",children:[e.jsx("button",{onClick:()=>s(!1),className:"self-end",children:e.jsx(M,{icon:"fa-solid fa-times",className:"h-6 w-6 text-white"})}),e.jsxs("div",{className:"mt-8 flex flex-col gap-4",children:[e.jsx("a",{href:"#home",className:"text-center text-lg font-medium text-white",children:"Home"}),e.jsx("a",{href:"#features",className:"text-center text-lg font-medium text-white",children:"Features"}),e.jsx("a",{href:"#subscriptions",className:"text-center text-lg font-medium text-white",children:"Subscriptions"}),e.jsx("a",{href:"#contact",className:"text-center text-lg font-medium text-white",children:"Contact"}),e.jsx("button",{onClick:()=>o("/member/login"),className:"mt-4 rounded-full bg-primary px-6 py-2 text-lg font-medium text-white",children:"Sign In"})]})]})}),e.jsx("section",{id:"home",className:"relative pt-20",children:e.jsx("div",{className:"container mx-auto px-4 py-20 2xl:px-6",children:e.jsxs("div",{className:"grid items-center gap-12 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"mb-6 text-3xl font-bold leading-normal text-white xl:text-5xl",children:"Streamline Your Cheerleading Music Production - Faster, Smarter, Easier."}),e.jsx("p",{className:"mb-8 text-lg text-bodydark",children:"CheerEQ is the ultimate platform for custom cheerleading music production, automating vocal workflows and client project management. Save time on administrative tasks, deliver high-quality mixes faster, and focus on what matters—perfecting your sound."}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{onClick:()=>o("/member/login"),className:"rounded-full bg-primary px-3 py-3 text-sm font-semibold text-white transition-all hover:bg-opacity-90 md:px-8 md:py-3 md:text-lg",children:"Get Started"}),e.jsx("a",{href:"#contact",children:e.jsx("button",{className:"rounded-full border border-primary bg-transparent px-3 py-3 text-sm font-semibold text-primary transition-all hover:bg-primary/80 hover:text-white md:px-8 md:py-3 md:text-lg",children:"Learn More"})})]})]}),e.jsx("div",{className:"relative mx-auto max-w-[520px]",children:e.jsx("div",{className:"aspect-square h-full rounded-[100px] bg-gradient-to-r from-primary to-meta-5",children:e.jsx("img",{src:`${window.location.origin}/logos/hero.jpg`,alt:"Logo",className:"h-full w-full rounded-[100px] object-cover"})})})]})})}),e.jsx("section",{id:"features",className:"py-20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h2",{className:"mb-12 text-center text-3xl font-bold text-white",children:"Why Choose CheerEQ?"}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-clipboard-check",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Automated Surveys"}),e.jsx("p",{className:"text-bodydark",children:"Streamline client project notes with automated music surveys, requiring team details before production begins."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-pen-to-square",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Automated Edits"}),e.jsx("p",{className:"text-bodydark",children:"CheerEQ removes the hassle of manual tracking, letting clients submit edits at their convenience while automatically identifying the type and providing an estimated delivery date."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-bell",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Automated Reminder Emails"}),e.jsx("p",{className:"text-bodydark",children:"Fed up with scheduling reminder emails? CheerEQ automates reminders for key deadlines, including surveys, 8-count sheets, routine videos, and more."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-microphone",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Vocal Production Management"}),e.jsx("p",{className:"text-bodydark",children:"CheerEQ simplifies vocal production by automating emails, organizing files, and providing real-time progress updates in each project."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-file-contract",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Contracts and Payment System"}),e.jsx("p",{className:"text-bodydark",children:"Ditch QuickBooks, Adobe, and other systems—our new multi-step form keeps finances, quotes, invoices, agreements, and payments all in one place."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark-2 p-8",children:[e.jsx("div",{className:"mb-4 inline-flex rounded-lg bg-primary/10 p-3",children:e.jsx(M,{icon:"fa-solid fa-certificate",className:"h-6 w-6 text-primary"})}),e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Auto-generated Music Licenses"}),e.jsx("p",{className:"text-bodydark",children:"CheerEQ automatically generates each team's music license with your company logo, creating a PDF ready for clients to download."})]})]})]})}),e.jsx("section",{className:"bg-boxdark-2 py-20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h2",{className:"mb-12 text-center text-3xl font-bold text-white",children:"Our Services"}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-xl bg-boxdark p-8 transition-all hover:bg-opacity-90",children:[e.jsx("div",{className:"mb-6 inline-flex rounded-lg bg-primary p-3",children:e.jsx(M,{icon:"fa-solid fa-globe",className:"h-8 w-8 text-white"})}),e.jsx("h3",{className:"mb-4 text-2xl font-semibold text-white",children:"Access anywhere, Anytime"}),e.jsx("p",{className:"text-lg text-bodydark",children:"Our web application keeps all your information securely stored on an online server, ensuring you can access your portal from any device with an internet connection."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark p-8 transition-all hover:bg-opacity-90",children:[e.jsx("div",{className:"mb-6 inline-flex rounded-lg bg-primary p-3",children:e.jsx(M,{icon:"fa-solid fa-chart-line",className:"h-8 w-8 text-white"})}),e.jsx("h3",{className:"mb-4 text-2xl font-semibold text-white",children:"Cut costs, boost profits"}),e.jsx("p",{className:"text-lg text-bodydark",children:"Our project management software allows you to increase revenue, streamline operations, and improve profitability by lowering administrative costs."})]}),e.jsxs("div",{className:"rounded-xl bg-boxdark p-8 transition-all hover:bg-opacity-90",children:[e.jsx("div",{className:"mb-6 inline-flex rounded-lg bg-primary p-3",children:e.jsx(M,{icon:"fa-solid fa-headset",className:"h-8 w-8 text-white"})}),e.jsx("h3",{className:"mb-4 text-2xl font-semibold text-white",children:"Premium customer experience"}),e.jsx("p",{className:"text-lg text-bodydark",children:"CheerEQ's dedicated support team is committed to your success, ensuring you're supported during the setup process and throughout your experience with us."})]})]})]})}),e.jsx("section",{className:"py-20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h2",{className:"mb-12 text-center text-3xl font-bold text-white",children:"Frequently Asked Questions"}),e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsxs("div",{className:"mb-4 overflow-hidden rounded-lg border border-stroke bg-boxdark",children:[e.jsxs("button",{className:"flex w-full items-center justify-between px-6 py-4 text-left",onClick:()=>l(0),children:[e.jsx("span",{className:"text-lg font-medium text-white",children:"What more can you tell me about Cheer EQ?"}),e.jsx(M,{icon:n===0?"fa-solid fa-minus":"fa-solid fa-plus",className:`h-4 w-4 text-primary transition-transform ${n===0?"rotate-180":""}`})]}),e.jsx("div",{className:`transition-all duration-300 ease-in-out ${n===0?"max-h-96":"max-h-0"}`,children:e.jsx("div",{className:"border-t border-stroke p-6",children:e.jsx("p",{className:"text-base text-bodydark",children:"Unlock the power of automation with our all-in-one music production platform designed specifically for cheerleading music. From client portals to streamlined workflows, our system simplifies the entire production process. Save valuable time on administrative tasks and focus on what you do best—producing top-tier music. With our tool, you can easily manage projects, reduce overhead costs, and deliver faster, more efficient results."})})})]}),e.jsxs("div",{className:"mb-4 overflow-hidden rounded-lg border border-stroke bg-boxdark",children:[e.jsxs("button",{className:"flex w-full items-center justify-between px-6 py-4 text-left",onClick:()=>l(1),children:[e.jsx("span",{className:"text-lg font-medium text-white",children:"Can I get special pricing based on number of projects?"}),e.jsx(M,{icon:n===1?"fa-solid fa-minus":"fa-solid fa-plus",className:`h-4 w-4 text-primary transition-transform ${n===1?"rotate-180":""}`})]}),e.jsx("div",{className:`transition-all duration-300 ease-in-out ${n===1?"max-h-96":"max-h-0"}`,children:e.jsx("div",{className:"border-t border-stroke p-6",children:e.jsx("p",{className:"text-base text-bodydark",children:"Yes! We offer flexible pricing based on your project volume. Check out our pricing section above to see the different ranges available."})})})]}),e.jsxs("div",{className:"mb-4 overflow-hidden rounded-lg border border-stroke bg-boxdark",children:[e.jsxs("button",{className:"flex w-full items-center justify-between px-6 py-4 text-left",onClick:()=>l(2),children:[e.jsx("span",{className:"text-lg font-medium text-white",children:"Can I get a demo or free trial before subscribing?"}),e.jsx(M,{icon:n===2?"fa-solid fa-minus":"fa-solid fa-plus",className:`h-4 w-4 text-primary transition-transform ${n===2?"rotate-180":""}`})]}),e.jsx("div",{className:`transition-all duration-300 ease-in-out ${n===2?"max-h-96":"max-h-0"}`,children:e.jsx("div",{className:"border-t border-stroke p-6",children:e.jsx("p",{className:"text-base text-bodydark",children:"Yes, we offer demos of our platform. Contact our team to schedule a personalized demonstration of CheerEQ's features."})})})]}),e.jsxs("div",{className:"mb-4 overflow-hidden rounded-lg border border-stroke bg-boxdark",children:[e.jsxs("button",{className:"flex w-full items-center justify-between px-6 py-4 text-left",onClick:()=>l(3),children:[e.jsx("span",{className:"text-lg font-medium text-white",children:"Does CheerEQ offer engineering services?"}),e.jsx(M,{icon:n===3?"fa-solid fa-minus":"fa-solid fa-plus",className:`h-4 w-4 text-primary transition-transform ${n===3?"rotate-180":""}`})]}),e.jsx("div",{className:`transition-all duration-300 ease-in-out ${n===3?"max-h-96":"max-h-0"}`,children:e.jsx("div",{className:"border-t border-stroke p-6",children:e.jsx("p",{className:"text-base text-bodydark",children:"CheerEQ is a project management platform. While we don't provide direct engineering services, our platform helps music producers manage their engineering workflow efficiently."})})})]}),e.jsxs("div",{className:"mb-4 overflow-hidden rounded-lg border border-stroke bg-boxdark",children:[e.jsxs("button",{className:"flex w-full items-center justify-between px-6 py-4 text-left",onClick:()=>l(4),children:[e.jsx("span",{className:"text-lg font-medium text-white",children:"Can I manually add my vocal production files into CheerEQ?"}),e.jsx(M,{icon:n===4?"fa-solid fa-minus":"fa-solid fa-plus",className:`h-4 w-4 text-primary transition-transform ${n===4?"rotate-180":""}`})]}),e.jsx("div",{className:`transition-all duration-300 ease-in-out ${n===4?"max-h-96":"max-h-0"}`,children:e.jsx("div",{className:"border-t border-stroke p-6",children:e.jsx("p",{className:"text-base text-bodydark",children:"Yes, CheerEQ allows you to manually upload and manage your vocal production files within the platform while maintaining organized project structures."})})})]})]})]})}),e.jsx("section",{id:"subscriptions",className:"bg-boxdark-2 py-20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h2",{className:"mb-12 text-center text-3xl font-bold text-white",children:"Choose Your Plan"}),e.jsxs("div",{className:"mb-8 flex w-full items-center justify-center gap-4",children:[e.jsx("span",{className:"whitespace-nowrap font-medium text-white",children:"Show pricing for"}),e.jsx("div",{className:"w-[200px]",children:e.jsxs(ys,{label:"Show pricing for",value:r,defaultValue:r,onChange:m=>a(m),className:"whitespace-nowrap rounded-lg border border-stroke bg-transparent px-4 py-2 text-white outline-none focus:border-primary",children:[e.jsx("option",{value:"1-50",children:"1-50 Mix Projects"}),e.jsx("option",{value:"51-100",children:"51-100 Mix Projects"}),e.jsx("option",{value:"101-150",children:"101-150 Mix Projects"}),e.jsx("option",{value:"151-200",children:"151-200 Mix Projects"}),e.jsx("option",{value:"201+",children:"201+ Mix Projects"})]})})]}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-3",children:[e.jsxs("div",{className:"rounded-xl bg-boxdark p-8",children:[e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"The Portal"}),e.jsxs("p",{className:"mb-6 text-4xl font-bold text-primary",children:["$",c[r].portal.monthly,e.jsx("span",{className:"text-lg text-bodydark",children:"/mo"})]}),e.jsxs("p",{className:"mb-4 text-sm text-white",children:["$",c[r].portal.annual," billed annually"]}),e.jsxs("ul",{className:"mb-8 space-y-4 text-bodydark",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Management"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Calendar"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Client Login Portal"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Digital 8-count sheets"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Music Licenses"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Reminder Emails"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Music Surveys"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Edit Management"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"8-Count Track Management"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Custom Email Domain"]})]}),e.jsx("button",{className:"w-full rounded-full border border-primary bg-transparent px-8 py-3 font-semibold text-primary transition-all hover:bg-primary/80 hover:text-white",children:"Get Started"})]}),e.jsxs("div",{className:"flex flex-col justify-between rounded-xl bg-boxdark p-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"The Studio"}),e.jsxs("p",{className:"mb-6 text-4xl font-bold text-primary",children:["$",c[r].studio.monthly,e.jsx("span",{className:"text-lg text-bodydark",children:"/mo"})]}),e.jsxs("p",{className:"mb-4 text-sm text-white",children:["$",c[r].studio.annual," billed annually"]}),e.jsxs("ul",{className:"mb-8 space-y-4 text-bodydark",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Music Surveys"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Management"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Calendar"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Project Budget Review"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Vocal Orders"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Excel Style Order View"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Automated Reminder Emails"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Company Logo Customization"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Custom Email Domain"]})]})]}),e.jsx("button",{className:"w-full rounded-full bg-primary px-8 py-3 font-semibold text-white transition-all hover:bg-opacity-90",children:"Get Started"})]}),e.jsxs("div",{className:"flex flex-col justify-between rounded-xl bg-boxdark p-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 text-xl font-semibold text-white",children:"Complete Suite"}),e.jsxs("p",{className:"mb-6 text-4xl font-bold text-primary",children:["$",c[r].complete.monthly,e.jsx("span",{className:"text-lg text-bodydark",children:"/mo"})]}),e.jsxs("p",{className:"mb-4 text-sm text-white",children:["$",c[r].complete.annual," billed annually"]}),e.jsxs("ul",{className:"mb-8 space-y-4 text-bodydark",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Everything in The Portal"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Everything in The Studio"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Priority Support"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(M,{icon:"fa-solid fa-check",className:"text-primary"}),"Dedicated Account Manager"]})]})]}),e.jsx("button",{className:"w-full rounded-full border border-primary bg-transparent px-8 py-3 font-semibold text-primary transition-all hover:bg-primary/80 hover:text-white",children:"Get Started"})]})]})]})}),e.jsx("section",{id:"contact",className:"py-20",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h2",{className:"mb-12 text-center text-3xl font-bold text-white",children:"Get In Touch"}),e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsx("div",{className:"rounded-xl bg-boxdark-2 p-8",children:e.jsxs("form",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"firstName",className:"mb-2.5 block font-medium text-white",children:"First Name"}),e.jsx("input",{type:"text",id:"firstName",placeholder:"John",className:"w-full rounded-lg border border-stroke bg-transparent py-4 pl-6 text-white outline-none focus:border-primary"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"lastName",className:"mb-2.5 block font-medium text-white",children:"Last Name"}),e.jsx("input",{type:"text",id:"lastName",placeholder:"Doe",className:"w-full rounded-lg border border-stroke bg-transparent py-4 pl-6 text-white outline-none focus:border-primary"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"mb-2.5 block font-medium text-white",children:"Email"}),e.jsx("input",{type:"email",id:"email",placeholder:"Enter your email",className:"w-full rounded-lg border border-stroke bg-transparent py-4 pl-6 text-white outline-none focus:border-primary"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"subject",className:"mb-2.5 block font-medium text-white",children:"Subject"}),e.jsx("input",{type:"text",id:"subject",placeholder:"How can we help?",className:"w-full rounded-lg border border-stroke bg-transparent py-4 pl-6 text-white outline-none focus:border-primary"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"message",className:"mb-2.5 block font-medium text-white",children:"Message"}),e.jsx("textarea",{id:"message",rows:"6",placeholder:"Type your message...",className:"w-full rounded-lg border border-stroke bg-transparent py-4 pl-6 text-white outline-none focus:border-primary"})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx("button",{type:"submit",className:"rounded-full bg-primary px-12 py-3 text-lg font-medium text-white transition-all hover:bg-opacity-90",children:"Send Message"})})]})}),e.jsxs("div",{className:"mt-16 grid gap-8 md:grid-cols-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-primary",children:e.jsx(M,{icon:"fa-solid fa-phone",className:"h-5 w-5 text-white"})}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-white",children:"Phone"}),e.jsx("p",{className:"text-bodydark",children:"512-547-1164"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-primary",children:e.jsx(M,{icon:"fa-solid fa-envelope",className:"h-5 w-5 text-white"})}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-white",children:"Email"}),e.jsx("p",{className:"text-bodydark",children:e.jsx("a",{href:"mailto:info@cheereq.com",children:"info@cheereq.com"})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-primary",children:e.jsx(M,{icon:"fa-solid fa-location-dot",className:"h-5 w-5 text-white"})}),e.jsx("h3",{className:"mb-2 text-lg font-semibold text-white",children:"Location"}),e.jsx("p",{className:"text-bodydark",children:"Austin, TX"})]})]})]})]})}),e.jsx("footer",{className:"bg-black py-12",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("div",{className:"grid gap-8 md:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"-mt-5 flex items-center",children:e.jsx("img",{src:`${window.location.origin}/new/cheerEQ-1-Ed1.png`,alt:"Logo",className:"h-[80px] w-[180px] object-contain"})}),e.jsx("p",{className:"text-bodydark",children:"Transform your music production workflow with our cutting-edge project management system."})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"mb-4 font-semibold text-white",children:"Quick Links"}),e.jsxs("ul",{className:"space-y-2 text-bodydark",children:[e.jsx("li",{children:e.jsx("a",{href:"#home",className:"hover:text-primary",children:"Home"})}),e.jsx("li",{children:e.jsx("a",{href:"#features",className:"hover:text-primary",children:"Features"})}),e.jsx("li",{children:e.jsx("a",{href:"#subscriptions",className:"hover:text-primary",children:"Pricing"})}),e.jsx("li",{children:e.jsx("a",{href:"#contact",className:"hover:text-primary",children:"Contact"})})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"mb-4 font-semibold text-white",children:"Legal"}),e.jsxs("ul",{className:"space-y-2 text-bodydark",children:[e.jsx("li",{children:e.jsx("a",{href:"#",className:"hover:text-primary",children:"Terms of Service"})}),e.jsx("li",{children:e.jsx("a",{href:"#",className:"hover:text-primary",children:"Privacy Policy"})}),e.jsx("li",{children:e.jsx("a",{href:"#",className:"hover:text-primary",children:"Disclaimer"})})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"mb-4 font-semibold text-white",children:"Contact"}),e.jsxs("ul",{className:"space-y-2 text-bodydark",children:[e.jsx("li",{children:"Email: info@cheereq.com"}),e.jsx("li",{children:"Phone: 512-547-1164"}),e.jsx("li",{children:"Address: Austin, TX"})]})]})]}),e.jsx("div",{className:"mt-12 border-t border-strokedark pt-8 text-center text-bodydark",children:e.jsxs("p",{children:["© ",new Date().getFullYear()," MYEQ. All rights reserved."]})})]})}),e.jsx("style",{children:`
@keyframes moveAround {
0% { transform: translate(0, 0); }
25% { transform: translate(calc(100% - 12px), 0); }
50% { transform: translate(calc(100% - 12px), calc(100% - 16px)); }
75% { transform: translate(0, calc(100% - 16px)); }
100% { transform: translate(0, 0); }
}
html {
scroll-behavior: smooth;
}
`})]})};let nr=new qe;const Nt=async o=>{try{const t=`/v3/api/custom/equality_record/user/view/${o}`;return await nr.callRawAPI(t,{},"GET")}catch(t){return t}},Fn=async o=>{try{const t=`/v3/api/custom/equality_record/user/${o.id}`;return await nr.callRawAPI(t,o,"PUT")}catch(t){return t}},Yn=async o=>{try{const t=`/v3/api/custom/equality_record/user/photo/${o.id}`;return await nr.callRawAPI(t,o,"PUT")}catch(t){return t}};new qe;const Jn=async(o,t)=>{try{const s="https://app.equalityrecords.com/v2/api/lambda/s3/uploads/only/public";return(await Wr.post(s,o,{headers:{"Content-Type":"multipart/form-data","x-project":"ZXF1YWxpdHlyZWNvcmQ6cDV3YjJnd2M5aWVyZjhzem5ldDZibnNjcTA3bnVyYQ=="},onUploadProgress:a=>{const n=Math.round(a.loaded*100/a.total);t(n)}})).data}catch(s){throw s}},qn=async o=>{try{const t="https://app.equalityrecords.com/v2/api/lambda/s3/uploads/only/public";return(await Wr.post(t,o,{headers:{"Content-Type":"multipart/form-data","x-project":"ZXF1YWxpdHlyZWNvcmQ6cDV3YjJnd2M5aWVyZjhzem5ldDZibnNjcTA3bnVyYQ=="}})).data}catch(t){return t}},Gn=({setFileUpload:o,maxFileSize:t=2,maxWidth:s=400,maxHeight:r=400})=>{const{dispatch:a}=d.useContext(xe),n=async c=>{const l=c.target.files;if(l.length>0){if(!i(l[0]))return;const m=new FormData;m.append("files",l[0]),o(m)}},i=c=>c.size/1024/1024>t?(R(a,`File size exceeds ${t}MB. Please upload a smaller file.`,5e3,"error"),!1):!0;return e.jsxs("div",{className:"flex max-w-full flex-col",children:[e.jsx("div",{className:"flex max-w-[320px] flex-row gap-2",children:e.jsx("input",{className:"max-w-full rounded border border-gray-500 bg-gray-800 p-2 text-white shadow placeholder:text-gray-200",type:"file",accept:"image/*",onChange:n})}),e.jsxs("div",{className:"text-xs text-warning-600",children:["Max file size limit is ",t,"MB"]})]})};let kr=new qe;const Vn=()=>{var z,q,H,Z,U;const o=Pt().shape({first_name:Re().required(),last_name:Re().required(),email:Re().email().required(),company_name:Re().required()}),{dispatch:t}=d.useContext(Me),{state:s}=d.useContext(Me),{dispatch:r}=d.useContext(xe),[a,n]=y.useState(""),[i,c]=y.useState(!1),[l,m]=d.useState(null),[u,h]=d.useState(null),[p,x]=d.useState(null),[f,v]=d.useState(null),{register:g,handleSubmit:w,setError:N,setValue:k,formState:{errors:j}}=Et({resolver:Dt(o)});d.useEffect(()=>{r({type:"SETPATH",payload:{path:"profile"}});const I=localStorage.getItem("user");m(I),I&&async function(){try{const O=await Nt(Number(I));if(!O.error)k("email",O.model.email),k("first_name",O.model.first_name),k("last_name",O.model.last_name),k("company_name",O.model.company_name),n(O.model.email),h(O.model.photo),x(O.model.company_name),t({type:"SET_PROFILE",payload:{photo:O.model.photo,companyName:O.model.company_name}});else{R(r,O.message,4e3,"error");return}}catch(O){Ce(r,O.message)}}()},[]);const $=async I=>{try{if(c(!0),a!==I.email){const O=await kr.updateEmail(I.email);if(!O.error)R(t,"Email Updated",2e3);else if(O.validation){const P=Object.keys(O.validation);for(let se=0;se<P.length;se++){const T=P[se];N(T,{type:"manual",message:O.validation[T]})}}}if(I.password.length>0){const O=await kr.updatePassword(I.password);if(!O.error)R(r,"Password Updated",2e3);else if(O.validation){const P=Object.keys(O.validation);for(let se=0;se<P.length;se++){const T=P[se];N(T,{type:"manual",message:O.validation[T]})}}}(I.first_name.length>0||I.last_name.length>0||I.company_name.length>0)&&((await Fn({id:l,first_name:I.first_name,last_name:I.last_name,company_name:I.company_name})).error?R(r,"Profile Update Failed",2e3,"error"):(t({type:"SET_PROFILE",payload:{photo:u,companyName:I.company_name}}),R(r,"Profile Updated",2e3))),c(!1)}catch(O){c(!1),N("email",{type:"manual",message:O.message}),Ce(t,O.response.data.message?O.response.data.message:O.message)}},V=async I=>{try{const O=await qn(I);if(O.error){R(r,O.message,2e3,"error");return}else{let P=JSON.parse(O.attachments);const se={id:l,photo:P[0]},T=await Yn(se);if(!T.error)h(P[0]),R(r,T.message,5e3),t({type:"SET_PROFILE",payload:{photo:P[0],companyName:p}});else{R(r,T.message,3e3,"error");return}}}catch(O){Ce(t,O.message)}};return localStorage.getItem("UserSubscription"),d.useEffect(()=>{const I=localStorage.getItem("user");I&&async function(){var O,P,se;try{const T=await Nt(I);T!=null&&T.error||(localStorage.setItem("photo",(O=T==null?void 0:T.model)==null?void 0:O.photo),v((P=T==null?void 0:T.model)==null?void 0:P.subscription),localStorage.setItem("UserSubscription",(se=T==null?void 0:T.model)==null?void 0:se.subscription))}catch{}}()},[]),[{id:1,type:"Vocal Production Subscription"},{id:2,type:"Producer/Client Platform Subscription"},{id:3,type:"Both (Vocal production and producer/client platform)"}].find(I=>I.id==f),e.jsx("div",{className:"p-4 h-full max-w-screen md:p-4 lg:p-6 xl:p-8",children:e.jsxs("div",{className:"grid grid-cols-5 gap-8",children:[e.jsx("div",{className:"col-span-5 xl:col-span-3",children:e.jsxs("div",{className:"rounded border shadow-default border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"px-7 py-4 border-b border-strokedark dark:border-strokedark",children:e.jsx("h3",{className:"font-medium text-white dark:text-white",children:"Personal Information"})}),e.jsx("div",{className:"p-7",children:e.jsxs("form",{onSubmit:w($),children:[e.jsxs("div",{className:"flex flex-col gap-5 justify-between mb-5 sm:flex-row",children:[e.jsxs("div",{className:"w-full sm:w-[45%]",children:[e.jsx("label",{className:"block mb-3 text-sm font-medium text-white dark:text-white",children:"First Name"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"left-4.5 absolute top-4",children:e.jsx("svg",{className:"fill-current",width:"20",height:"20",viewBox:"0 0 20 20"})}),e.jsx("input",{className:"pl-11.5 pr-4.5 w-full rounded border border-form-strokedark bg-form-input py-3 text-white focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary",type:"text",...g("first_name"),placeholder:"First Name"})]}),e.jsx("p",{className:"mt-1 text-sm text-danger",children:(z=j.first_name)==null?void 0:z.message})]}),e.jsxs("div",{className:"w-full sm:w-[45%]",children:[e.jsx("label",{className:"block mb-3 text-sm font-medium text-white dark:text-white",children:"Last Name"}),e.jsx("input",{className:"px-4.5 w-full rounded border border-form-strokedark bg-form-input py-3 text-white focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary",type:"text",...g("last_name"),placeholder:"Last Name"}),e.jsx("p",{className:"mt-1 text-sm text-danger",children:(q=j.last_name)==null?void 0:q.message})]})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block mb-3 text-sm font-medium text-white dark:text-white",children:"Company Name"}),e.jsx("input",{className:"px-4.5 w-full rounded border border-form-strokedark bg-form-input py-3 text-white focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary",type:"text",...g("company_name"),placeholder:"Company Name"}),e.jsx("p",{className:"mt-1 text-sm text-danger",children:(H=j.company_name)==null?void 0:H.message})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block mb-3 text-sm font-medium text-white dark:text-white",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx("span",{className:"left-4.5 absolute top-4",children:e.jsx("svg",{className:"fill-current",width:"20",height:"20",viewBox:"0 0 20 20"})}),e.jsx("input",{className:"pl-11.5 pr-4.5 w-full rounded border border-form-strokedark bg-form-input py-3 text-white focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary",type:"email",...g("email"),readOnly:s.role==="client",placeholder:"Email Address"})]}),e.jsx("p",{className:"mt-1 text-sm text-danger",children:(Z=j.email)==null?void 0:Z.message})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block mb-3 text-sm font-medium text-white dark:text-white",children:"Password"}),e.jsx("input",{className:"px-4.5 w-full rounded border border-form-strokedark bg-form-input py-3 text-white focus:border-primary focus-visible:outline-none dark:border-strokedark dark:bg-meta-4 dark:text-white dark:focus:border-primary",type:"password",...g("password"),placeholder:"Enter password"}),e.jsx("p",{className:"mt-1 text-sm text-danger",children:(U=j.password)==null?void 0:U.message})]}),e.jsxs("div",{className:"gap-4.5 mt-5 flex justify-end",children:[e.jsx("button",{className:"flex justify-center px-6 py-2 font-medium text-white rounded border border-strokedark hover:shadow-1 dark:border-strokedark dark:text-white",type:"button",children:"Cancel"}),e.jsx(Ln,{loading:i,disabled:i,type:"submit",className:"flex justify-center px-6 py-2 font-medium rounded bg-primary text-gray hover:bg-opacity-90",children:"Save"})]})]})})]})}),e.jsx("div",{className:"col-span-5 xl:col-span-2",children:e.jsxs("div",{className:"rounded border shadow-default border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"px-7 py-4 border-b border-strokedark dark:border-strokedark",children:e.jsx("h3",{className:"font-medium text-white dark:text-white",children:"Your Photo"})}),e.jsxs("div",{className:"p-7",children:[e.jsxs("div",{className:"flex gap-3 items-center mb-4",children:[u&&e.jsx("div",{className:"w-14 h-14 rounded-full",children:e.jsx("img",{src:u,alt:"Profile",className:"object-cover w-full h-full rounded-full"})}),e.jsx("div",{children:e.jsx("span",{className:"mb-1.5 text-white dark:text-white",children:"Edit your photo"})})]}),e.jsx(Gn,{maxFileSize:2,setFileUpload:V})]})]})})]})})};var ra={},cs=Ye&&Ye.__assign||function(){return cs=Object.assign||function(o){for(var t,s=1,r=arguments.length;s<r;s++){t=arguments[s];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=t[a])}return o},cs.apply(this,arguments)},Wn=Ye&&Ye.__createBinding||(Object.create?function(o,t,s,r){r===void 0&&(r=s);var a=Object.getOwnPropertyDescriptor(t,s);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(o,r,a)}:function(o,t,s,r){r===void 0&&(r=s),o[r]=t[s]}),Hn=Ye&&Ye.__setModuleDefault||(Object.create?function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}:function(o,t){o.default=t}),Qn=Ye&&Ye.__importStar||function(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var s in o)s!=="default"&&Object.prototype.hasOwnProperty.call(o,s)&&Wn(t,o,s);return Hn(t,o),t},Kn=Ye&&Ye.__rest||function(o,t){var s={};for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&t.indexOf(r)<0&&(s[r]=o[r]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(o);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(o,r[a])&&(s[r[a]]=o[r[a]]);return s};Object.defineProperty(ra,"__esModule",{value:!0});var Xn=Qn(y),Sr=yt,Zn=Gt,ei=(0,Zn.createAnimation)("ClipLoader","0% {transform: rotate(0deg) scale(1)} 50% {transform: rotate(180deg) scale(0.8)} 100% {transform: rotate(360deg) scale(1)}","clip");function ti(o){var t=o.loading,s=t===void 0?!0:t,r=o.color,a=r===void 0?"#000000":r,n=o.speedMultiplier,i=n===void 0?1:n,c=o.cssOverride,l=c===void 0?{}:c,m=o.size,u=m===void 0?35:m,h=Kn(o,["loading","color","speedMultiplier","cssOverride","size"]),p=cs({background:"transparent !important",width:(0,Sr.cssValue)(u),height:(0,Sr.cssValue)(u),borderRadius:"100%",border:"2px solid",borderTopColor:a,borderBottomColor:"transparent",borderLeftColor:a,borderRightColor:a,display:"inline-block",animation:"".concat(ei," ").concat(.75/i,"s 0s infinite linear"),animationFillMode:"both"},l);return s?Xn.createElement("span",cs({style:p},h)):null}var _r=ra.default=ti;const si=({currentPage:o,pageCount:t,callDataAgain:s=!1,pageSize:r=10,dataTotal:a,canPreviousPage:n,canNextPage:i,updatePageSize:c,previousPage:l,nextPage:m,setCurrentPage:u=!1,customPage:h=!1})=>{console.log(h),console.log(o,t,r);const p=o===0?0:(o-1)*r+1,x=Math.min(p+r-1,a),f=()=>{const g=[],w=[];g.push(1);for(let k=o-2;k<=o+2;k++)k>1&&k<t&&g.push(k);t!==1&&g.push(t);let N;for(let k of g)N&&(k-N===2?w.push(N+1):k-N!==1&&w.push("...")),w.push(k),N=k;return w};return console.log(f()),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("span",{className:"text-sm font-medium text-white whitespace-nowrap",children:a>0?`Showing ${p} to ${x} of ${a} entries`:"No entries to show"}),e.jsx(ys,{className:"!w-20",position:"up",label:"Size",value:r,onChange:c,children:h||[{value:5,label:5},{value:10,label:10},{value:20,label:20},{value:30,label:30},{value:40,label:40},{value:50,label:50}].map(v=>e.jsx("option",{value:v.value,children:v.label}))})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("button",{onClick:l,disabled:!n,className:`flex h-[25px] min-w-[25px] items-center justify-center rounded-md border border-strokedark bg-meta-4 text-sm font-medium text-white transition hover:bg-opacity-90 ${!n&&"cursor-not-allowed opacity-50"}`,children:e.jsx(No,{className:"w-4 h-4"})}),e.jsx("div",{className:"flex gap-1 items-center",children:f().map((v,g)=>e.jsx("button",{onClick:()=>{v!=="..."&&v!==o&&(console.log(o),u&&u(v),s&&s(v))},disabled:v==="...",className:`flex h-[32px] min-w-[32px] items-center justify-center rounded-md border border-strokedark text-sm font-medium transition ${v===o?"bg-primary text-white":v==="..."?"cursor-default bg-meta-4 text-white":"bg-meta-4 text-white hover:bg-opacity-90"}`,children:v},g))}),e.jsx("button",{onClick:m,disabled:!i,className:`flex h-[25px] min-w-[25px] items-center justify-center rounded-md border border-strokedark bg-meta-4 text-sm font-medium text-white transition hover:bg-opacity-90 ${!i&&"cursor-not-allowed opacity-50"}`,children:e.jsx(ko,{className:"w-4 h-4"})})]})]})};let js=new qe;const aa=async()=>{try{const o="/v3/api/custom/equality_record/project/client/get_all";return await js.callRawAPI(o,[],"GET")}catch(o){return o}},oa=async()=>{try{const o="/v3/api/custom/equality_record/client/get_all/producers";return await js.callRawAPI(o,[],"GET")}catch(o){return o}},ri=async()=>{try{const o="/v3/api/custom/equality_record/client/get_all";return await js.callRawAPI(o,[],"GET")}catch(o){return o}},ai=async(o,t,s)=>{try{const r={page:o,limit:t,filter:s},a="/v3/api/custom/equality_record/project/client/retrieve_all";return await js.callRawAPI(a,r,"POST")}catch(r){return r}};new qe;function oi(o){let t="",s="";switch(o){case 0:t="Unpaid",s="text-red-600";break;case 1:t="Complete",s="text-white";break;case 3:t="Paid in Full",s="text-blue-400";break;case 4:t="Awaiting Edit",s="text-green-600";break;case 2:t="Deposit Paid",s="text-blue-600 ";break;default:t="Unpaid",s="text-red-600"}return{text:t,color:s}}function ni({status:o}){const{text:t,color:s}=oi(o);return e.jsx("span",{className:`font-medium ${s}`,children:t})}const ii=({row:o,indexe:t})=>{const{state:s}=d.useContext(Me),r=st(),a=[{header:"Mix Date",accessor:"mix_date",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Program/Team",accessor:"program&team",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Producer",accessor:"producer",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Mix Type",accessor:"mix_type_name",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Team Type",accessor:"team_type",isSorted:!1,isSortedDesc:!1,mappingExist:!0,mappings:{1:"All Girl",2:"Co-ed",3:"TBD"}},{header:"PAYMENT STATUS",accessor:"payment_status",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"TD/ED",accessor:"Td&Ed",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"STATUS",accessor:"status",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}}],n=async c=>{await localStorage.setItem("ClientSelectedTab",c),r(`/${s==null?void 0:s.role}/view-project/${o==null?void 0:o.id}`)};function i(c){if(c){var l=c==null?void 0:c.split("-"),m=l[1].padStart(2,"0")+"-"+l[2].padStart(2,"0")+"-"+l[0];return m}}return e.jsx("tr",{className:"border-b border-b-[#9ca3ae80] font-medium bg-boxdark hover:bg-primary/5",onClick:async c=>{c.stopPropagation(),c.target.className.includes("lightup-icons")||r(`/${s.role}/view-project/`+o.id,{state:o})},children:a.map((c,l)=>c.accessor==="mix_date"?e.jsx("td",{className:"px-4 py-5 text-sm font-medium text-white whitespace-nowrap",children:fe(o[c.accessor]).format("MM-DD-YYYY")},l):c.accessor==="program&team"?e.jsx("td",{className:"px-4 py-5 text-sm font-medium text-white",children:e.jsxs("div",{className:"flex flex-col gap-[2px]",children:[e.jsx("span",{className:"text-white",children:o.program_name}),e.jsx("span",{className:"text-white",children:o.team_name})]})},l):c.accessor==="producer"?e.jsx("td",{className:"px-4 py-5 text-sm font-medium text-white",children:o.producer_name},l):c.accessor==="Td&Ed"?e.jsx("td",{className:"px-4 py-5 text-sm font-medium text-white",children:e.jsxs("div",{className:"flex flex-col gap-[2px]",children:[e.jsxs("div",{className:"relative group",children:[e.jsxs("span",{className:"text-white whitespace-nowrap",children:["TD:  ",i(o.team_details_date)]}),e.jsx("div",{className:"hidden absolute -top-4 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-2 text-xs text-white bg-black rounded shadow-lg",children:"Team Details Date"})})]}),e.jsxs("div",{className:"relative group",children:[e.jsxs("span",{className:"text-white whitespace-nowrap",children:["ED:  ",i(o.estimated_delivery_date)]}),e.jsx("div",{className:"hidden absolute top-5 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-2 text-xs text-white bg-black rounded shadow-lg",children:"Estimated Delivery Date"})})]})]})},l):c.accessor==="status"?e.jsx("td",{className:"px-4 py-5 text-sm font-medium text-white",children:e.jsxs("div",{className:"flex gap-4 justify-center items-center",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{onClick:()=>n(0),className:"relative cursor-pointer group",children:[e.jsxs("div",{className:`relative h-[2.5rem] w-[2.5rem] rounded-[50%] ${o.team_details_found?"ring-[4px] ring-primary":"ring-[4px] ring-[#8c8c8c]"}`,children:[e.jsx("div",{className:"absolute inset-[7px] rounded-full border-2 border-white bg-boxdark",children:e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:o.team_details_found?e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(135deg) translateY(-2px)"}}):e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(315deg) translateY(-2px)"}})})}),e.jsx("div",{className:"bg- absolute bottom-[-10px] left-0 right-0 h-[15px] border-t-0 border-white bg-boxdark bg-boxdark group-hover:bg-[#253247]"})]}),e.jsx("div",{className:"hidden absolute -bottom-8 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-1 text-xs leading-none text-center text-gray-900 whitespace-nowrap bg-gray-100 rounded shadow-lg",children:"Team Details"})})]}),e.jsx("span",{className:"mt-2 text-xs text-white whitespace-nowrap",children:"Team Details"})]}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{onClick:()=>n(1),className:"relative cursor-pointer group",children:[e.jsxs("div",{className:`relative h-[2.5rem] w-[2.5rem] rounded-[50%] ${o.survey_status?"ring-[4px] ring-primary":"ring-[4px] ring-[#8c8c8c]"}`,children:[e.jsx("div",{className:"absolute inset-[7px] rounded-full border-2 border-white bg-boxdark",children:e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:o.survey_status?e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(135deg) translateY(-2px)"}}):e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(315deg) translateY(-2px)"}})})}),e.jsx("div",{className:"bg- absolute bottom-[-10px] left-0 right-0 h-[15px] border-t-0 border-white bg-boxdark bg-boxdark group-hover:bg-[#253247]"})]}),e.jsx("div",{className:"hidden absolute -bottom-8 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-1 text-xs leading-none text-center text-gray-900 bg-gray-100 rounded shadow-lg whitespace-no-wrap",children:"Survey"})})]}),e.jsx("span",{className:"mt-2 text-xs text-white",children:"Survey"})]}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{onClick:()=>n(2),className:"relative cursor-pointer group",children:[e.jsxs("div",{className:`relative h-[2.5rem] w-[2.5rem] rounded-[50%] ${o.eight_count_found?"ring-[4px] ring-primary":"ring-[4px] ring-[#8c8c8c]"}`,children:[e.jsx("div",{className:"absolute inset-[7px] rounded-full border-2 border-white bg-boxdark",children:e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:o.eight_count_found?e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(135deg) translateY(-2px)"}}):e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(315deg) translateY(-2px)"}})})}),e.jsx("div",{className:"bg- absolute bottom-[-10px] left-0 right-0 h-[15px] border-t-0 border-white bg-boxdark bg-boxdark group-hover:bg-[#253247]"})]}),e.jsx("div",{className:"hidden absolute -bottom-8 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-1 text-xs leading-none text-center text-gray-900 bg-gray-100 rounded shadow-lg whitespace-no-wrap",children:"8-Count Sheets"})})]}),e.jsx("span",{className:"mt-2 text-xs text-white whitespace-nowrap",children:"8 Counts"})]}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{onClick:()=>n(3),className:"relative cursor-pointer group",children:[e.jsxs("div",{className:`relative h-[2.5rem] w-[2.5rem] rounded-[50%] ${o.media_found?"ring-[4px] ring-primary":"ring-[4px] ring-[#8c8c8c]"}`,children:[e.jsx("div",{className:"absolute inset-[7px] rounded-full border-2 border-white bg-boxdark",children:e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:o.media_found?e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(135deg) translateY(-2px)"}}):e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(315deg) translateY(-2px)"}})})}),e.jsx("div",{className:"bg- absolute bottom-[-10px] left-0 right-0 h-[15px] border-t-0 border-white bg-boxdark bg-boxdark group-hover:bg-[#253247]"})]}),e.jsx("div",{className:"hidden absolute -bottom-8 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-1 text-xs leading-none text-center text-gray-900 bg-gray-100 rounded shadow-lg whitespace-no-wrap",children:"Videos"})})]}),e.jsx("span",{className:"mt-2 text-xs text-white",children:"Video"})]}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{onClick:()=>n(3),className:"relative cursor-pointer group",children:[e.jsxs("div",{className:`relative h-[2.5rem] w-[2.5rem] rounded-[50%] ${o.is_music_found?"ring-[4px] ring-primary":"ring-[4px] ring-[#8c8c8c]"}`,children:[e.jsx("div",{className:"absolute inset-[7px] rounded-full border-2 border-white bg-boxdark",children:e.jsx("div",{className:"flex absolute inset-0 justify-center items-center",children:o.is_music_found?e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(135deg) translateY(-2px)"}}):e.jsx("div",{className:"h-[8px] w-[1.5px] origin-bottom bg-white",style:{transform:"rotate(315deg) translateY(-2px)"}})})}),e.jsx("div",{className:"bg- absolute bottom-[-10px] left-0 right-0 h-[15px] border-t-0 border-white bg-boxdark bg-boxdark group-hover:bg-[#253247]"})]}),e.jsx("div",{className:"hidden absolute -bottom-8 flex-col items-center group-hover:flex",children:e.jsx("span",{className:"relative z-10 p-1 text-xs leading-none text-center text-gray-900 bg-gray-100 rounded shadow-lg whitespace-no-wrap",children:"Music/Licenses Uploaded"})})]}),e.jsx("span",{className:"mt-2 text-xs text-white",children:"Music"})]})]})},l):c.accessor==="payment_status"?e.jsx("td",{className:"px-4 py-4 text-white whitespace-nowrap",children:e.jsx(ni,{status:o.payment_status})},l):c.mappingExist?e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:c.mappings[o[c.accessor]]},l):e.jsx("td",{className:"px-4 py-4 text-white whitespace-nowrap",children:o[c.accessor]},l))})},li=()=>{const[,o]=d.useState(new Date);return d.useEffect(()=>{const t=setInterval(()=>o(new Date),1e3);return()=>{clearInterval(t)}},[]),e.jsx("span",{className:"ml-2 text-base font-medium text-white",children:new Date().toLocaleString("en-US",{timeZone:"America/New_York"})})};let nt=new qe;const ir=async(o,t)=>{const s={page:1,...t&&Object.keys(t).length>0&&{filter:t}};try{const r=`/v3/api/custom/equality_record/project/client/view/${o}`;return await nt.callRawAPI(r,s,"POST")}catch(r){return r}},ci=async()=>{try{const o="/v3/api/custom/equality_record/mix_type/client/get_all";return await nt.callRawAPI(o,{},"GET")}catch(o){return o}},na=async o=>{try{const t="/v3/api/custom/equality_record/media";return await nt.callRawAPI(t,o,"POST")}catch(t){return t}},ds=async o=>{try{const t=`/v3/api/custom/equality_record/media/${o}`;return await nt.callRawAPI(t,[],"DELETE")}catch(t){return t}},Vt=async o=>{try{const t="/v3/api/custom/equality_record/media/retrieve-all";return await nt.callRawAPI(t,o,"POST")}catch(t){return t}},Bs=async o=>{try{const t=`/v3/api/custom/equality_record/eight-count/${o}`;return await nt.callRawAPI(t,[],"DELETE")}catch(t){return t}},di=async(o,t)=>{try{const s=`/v3/api/custom/equality_record/eight-count/${o.id}`;return await nt.callRawAPI(s,t,"PUT")}catch(s){return s}},Cr=async o=>{try{const t="/v3/api/custom/equality_record/eight-count";return await nt.callRawAPI(t,o,"POST")}catch(t){return t}},Rs=async(o,t,s)=>{try{const r={page:o,limit:t,filter:s},a="/v3/api/custom/equality_record/eight-count/retrieve-all";return await nt.callRawAPI(a,r,"POST")}catch(r){return r}},ia=async o=>{try{const t=`/v3/api/custom/equality_record/project/client/team_details/view/${o}`;return await nt.callRawAPI(t,[],"GET")}catch(t){return t}},ui=async o=>{try{const t="/v3/api/custom/equality_record/project/client/team_details";return await nt.callRawAPI(t,o,"PUT")}catch(t){return t}};let Er=Mo,Pr=ot,Fs=class la extends Error{constructor(t,s,r,a,n,i){super(t),this.name="CssSyntaxError",this.reason=t,n&&(this.file=n),a&&(this.source=a),i&&(this.plugin=i),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,la)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let s=this.source;t==null&&(t=Er.isColorSupported);let r=u=>u,a=u=>u,n=u=>u;if(t){let{bold:u,gray:h,red:p}=Er.createColors(!0);a=x=>u(p(x)),r=x=>h(x),Pr&&(n=x=>Pr(x))}let i=s.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,i.length),m=String(l).length;return i.slice(c,l).map((u,h)=>{let p=c+1+h,x=" "+(" "+p).slice(-m)+" | ";if(p===this.line){if(u.length>160){let v=20,g=Math.max(0,this.column-v),w=Math.max(this.column+v,this.endColumn+v),N=u.slice(g,w),k=r(x.replace(/\d/g," "))+u.slice(0,Math.min(this.column-1,v-1)).replace(/[^\t]/g," ");return a(">")+r(x)+n(N)+`
`+k+a("^")}let f=r(x.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+r(x)+n(u)+`
`+f+a("^")}return" "+r(x)+n(u)}).join(`
`)}toString(){let t=this.showSourceCode();return t&&(t=`
`+t+`
`),this.name+": "+this.message+t}};var lr=Fs;Fs.default=Fs;const Ir={after:`
`,beforeClose:`
`,beforeComment:`
`,beforeDecl:`
`,beforeOpen:" ",beforeRule:`
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function mi(o){return o[0].toUpperCase()+o.slice(1)}let Ys=class{constructor(t){this.builder=t}atrule(t,s){let r="@"+t.name,a=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?r+=t.raws.afterName:a&&(r+=" "),t.nodes)this.block(t,r+a);else{let n=(t.raws.between||"")+(s?";":"");this.builder(r+a+n,t)}}beforeAfter(t,s){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):s==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let a=t.parent,n=0;for(;a&&a.type!=="root";)n+=1,a=a.parent;if(r.includes(`
`)){let i=this.raw(t,null,"indent");if(i.length)for(let c=0;c<n;c++)r+=i}return r}block(t,s){let r=this.raw(t,"between","beforeOpen");this.builder(s+r+"{",t,"start");let a;t.nodes&&t.nodes.length?(this.body(t),a=this.raw(t,"after")):a=this.raw(t,"after","emptyBody"),a&&this.builder(a),this.builder("}",t,"end")}body(t){let s=t.nodes.length-1;for(;s>0&&t.nodes[s].type==="comment";)s-=1;let r=this.raw(t,"semicolon");for(let a=0;a<t.nodes.length;a++){let n=t.nodes[a],i=this.raw(n,"before");i&&this.builder(i),this.stringify(n,s!==a||r)}}comment(t){let s=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder("/*"+s+t.text+r+"*/",t)}decl(t,s){let r=this.raw(t,"between","colon"),a=t.prop+r+this.rawValue(t,"value");t.important&&(a+=t.raws.important||" !important"),s&&(a+=";"),this.builder(a,t)}document(t){this.body(t)}raw(t,s,r){let a;if(r||(r=s),s&&(a=t.raws[s],typeof a<"u"))return a;let n=t.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===t||n&&n.type==="document"))return"";if(!n)return Ir[r];let i=t.root();if(i.rawCache||(i.rawCache={}),typeof i.rawCache[r]<"u")return i.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let c="raw"+mi(r);this[c]?a=this[c](i,t):i.walk(l=>{if(a=l.raws[s],typeof a<"u")return!1})}return typeof a>"u"&&(a=Ir[r]),i.rawCache[r]=a,a}rawBeforeClose(t){let s;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return s=r.raws.after,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(t,s){let r;return t.walkComments(a=>{if(typeof a.raws.before<"u")return r=a.raws.before,r.includes(`
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(t,s){let r;return t.walkDecls(a=>{if(typeof a.raws.before<"u")return r=a.raws.before,r.includes(`
`)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(s,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(t){let s;return t.walk(r=>{if(r.type!=="decl"&&(s=r.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(t){let s;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(t){let s;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return s=r.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(t){let s;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(s=r.raws.after,typeof s<"u"))return!1}),s}rawIndent(t){if(t.raws.indent)return t.raws.indent;let s;return t.walk(r=>{let a=r.parent;if(a&&a!==t&&a.parent&&a.parent===t&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
`);return s=n[n.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(t){let s;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(s=r.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(t,s){let r=t[s],a=t.raws[s];return a&&a.value===r?a.raw:r}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,s){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,s)}};var ca=Ys;Ys.default=Ys;let hi=ca;function Js(o,t){new hi(t).stringify(o)}var vs=Js;Js.default=Js;var Wt={};Wt.isClean=Symbol("isClean");Wt.my=Symbol("my");let pi=lr,fi=ca,xi=vs,{isClean:Rt,my:gi}=Wt;function qs(o,t){let s=new o.constructor;for(let r in o){if(!Object.prototype.hasOwnProperty.call(o,r)||r==="proxyCache")continue;let a=o[r],n=typeof a;r==="parent"&&n==="object"?t&&(s[r]=t):r==="source"?s[r]=a:Array.isArray(a)?s[r]=a.map(i=>qs(i,s)):(n==="object"&&a!==null&&(a=qs(a)),s[r]=a)}return s}function Tt(o,t){if(t&&typeof t.offset<"u")return t.offset;let s=1,r=1,a=0;for(let n=0;n<o.length;n++){if(r===t.line&&s===t.column){a=n;break}o[n]===`
`?(s=1,r+=1):s+=1}return a}let Gs=class{constructor(t={}){this.raws={},this[Rt]=!1,this[gi]=!0;for(let s in t)if(s==="nodes"){this.nodes=[];for(let r of t[s])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[s]=t[s]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let s=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${s.input.from}:${s.start.line}:${s.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let s in t)this[s]=t[s];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let s=qs(this);for(let r in t)s[r]=t[r];return s}cloneAfter(t={}){let s=this.clone(t);return this.parent.insertAfter(this,s),s}cloneBefore(t={}){let s=this.clone(t);return this.parent.insertBefore(this,s),s}error(t,s={}){if(this.source){let{end:r,start:a}=this.rangeBy(s);return this.source.input.error(t,{column:a.column,line:a.line},{column:r.column,line:r.line},s)}return new pi(t)}getProxyProcessor(){return{get(t,s){return s==="proxyOf"?t:s==="root"?()=>t.root().toProxy():t[s]},set(t,s,r){return t[s]===r||(t[s]=r,(s==="prop"||s==="value"||s==="name"||s==="params"||s==="important"||s==="text")&&t.markDirty()),!0}}}markClean(){this[Rt]=!0}markDirty(){if(this[Rt]){this[Rt]=!1;let t=this;for(;t=t.parent;)t[Rt]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t){let s=this.source.start;if(t.index)s=this.positionInside(t.index);else if(t.word){let a=this.source.input.css.slice(Tt(this.source.input.css,this.source.start),Tt(this.source.input.css,this.source.end)).indexOf(t.word);a!==-1&&(s=this.positionInside(a))}return s}positionInside(t){let s=this.source.start.column,r=this.source.start.line,a=Tt(this.source.input.css,this.source.start),n=a+t;for(let i=a;i<n;i++)this.source.input.css[i]===`
`?(s=1,r+=1):s+=1;return{column:s,line:r}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let s={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:s.column+1,line:s.line};if(t.word){let n=this.source.input.css.slice(Tt(this.source.input.css,this.source.start),Tt(this.source.input.css,this.source.end)).indexOf(t.word);n!==-1&&(s=this.positionInside(n),r=this.positionInside(n+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line}),{end:r,start:s}}raw(t,s){return new fi().raw(this,t,s)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let s=this,r=!1;for(let a of t)a===this?r=!0:r?(this.parent.insertAfter(s,a),s=a):this.parent.insertBefore(s,a);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,s){let r={},a=s==null;s=s||new Map;let n=0;for(let i in this){if(!Object.prototype.hasOwnProperty.call(this,i)||i==="parent"||i==="proxyCache")continue;let c=this[i];if(Array.isArray(c))r[i]=c.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,s):l);else if(typeof c=="object"&&c.toJSON)r[i]=c.toJSON(null,s);else if(i==="source"){let l=s.get(c.input);l==null&&(l=n,s.set(c.input,n),n++),r[i]={end:c.end,inputId:l,start:c.start}}else r[i]=c}return a&&(r.inputs=[...s.keys()].map(i=>i.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=xi){t.stringify&&(t=t.stringify);let s="";return t(this,r=>{s+=r}),s}warn(t,s,r){let a={node:this};for(let n in r)a[n]=r[n];return t.warn(s,a)}get proxyOf(){return this}};var Ns=Gs;Gs.default=Gs;let bi=Ns,Vs=class extends bi{constructor(t){super(t),this.type="comment"}};var ks=Vs;Vs.default=Vs;let wi=Ns,Ws=class extends wi{constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Ss=Ws;Ws.default=Ws;let da=ks,ua=Ss,yi=Ns,{isClean:ma,my:ha}=Wt,cr,pa,fa,dr;function xa(o){return o.map(t=>(t.nodes&&(t.nodes=xa(t.nodes)),delete t.source,t))}function ga(o){if(o[ma]=!1,o.proxyOf.nodes)for(let t of o.proxyOf.nodes)ga(t)}let dt=class ba extends yi{append(...t){for(let s of t){let r=this.normalize(s,this.last);for(let a of r)this.proxyOf.nodes.push(a)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let s of this.nodes)s.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,a;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],a=t(this.proxyOf.nodes[r],r),a!==!1);)this.indexes[s]+=1;return delete this.indexes[s],a}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,s){return s==="proxyOf"?t:t[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>t[s](...r.map(a=>typeof a=="function"?(n,i)=>a(n.toProxy(),i):a)):s==="every"||s==="some"?r=>t[s]((a,...n)=>r(a.toProxy(),...n)):s==="root"?()=>t.root().toProxy():s==="nodes"?t.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?t[s].toProxy():t[s]:t[s]},set(t,s,r){return t[s]===r||(t[s]=r,(s==="name"||s==="params"||s==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,s){let r=this.index(t),a=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let i of a)this.proxyOf.nodes.splice(r+1,0,i);let n;for(let i in this.indexes)n=this.indexes[i],r<n&&(this.indexes[i]=n+a.length);return this.markDirty(),this}insertBefore(t,s){let r=this.index(t),a=r===0?"prepend":!1,n=this.normalize(s,this.proxyOf.nodes[r],a).reverse();r=this.index(t);for(let c of n)this.proxyOf.nodes.splice(r,0,c);let i;for(let c in this.indexes)i=this.indexes[c],r<=i&&(this.indexes[c]=i+n.length);return this.markDirty(),this}normalize(t,s){if(typeof t=="string")t=xa(pa(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let a of t)a.parent&&a.parent.removeChild(a,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let a of t)a.parent&&a.parent.removeChild(a,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new ua(t)]}else if(t.selector||t.selectors)t=[new dr(t)];else if(t.name)t=[new cr(t)];else if(t.text)t=[new da(t)];else throw new Error("Unknown node type in node creation");return t.map(a=>(a[ha]||ba.rebuild(a),a=a.proxyOf,a.parent&&a.parent.removeChild(a),a[ma]&&ga(a),a.raws||(a.raws={}),typeof a.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(a.raws.before=s.raws.before.replace(/\S/g,"")),a.parent=this.proxyOf,a))}prepend(...t){t=t.reverse();for(let s of t){let r=this.normalize(s,this.first,"prepend").reverse();for(let a of r)this.proxyOf.nodes.unshift(a);for(let a in this.indexes)this.indexes[a]=this.indexes[a]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=t&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(t,s,r){return r||(r=s,s={}),this.walkDecls(a=>{s.props&&!s.props.includes(a.prop)||s.fast&&!a.value.includes(s.fast)||(a.value=a.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((s,r)=>{let a;try{a=t(s,r)}catch(n){throw s.addToError(n)}return a!==!1&&s.walk&&(a=s.walk(t)),a})}walkAtRules(t,s){return s?t instanceof RegExp?this.walk((r,a)=>{if(r.type==="atrule"&&t.test(r.name))return s(r,a)}):this.walk((r,a)=>{if(r.type==="atrule"&&r.name===t)return s(r,a)}):(s=t,this.walk((r,a)=>{if(r.type==="atrule")return s(r,a)}))}walkComments(t){return this.walk((s,r)=>{if(s.type==="comment")return t(s,r)})}walkDecls(t,s){return s?t instanceof RegExp?this.walk((r,a)=>{if(r.type==="decl"&&t.test(r.prop))return s(r,a)}):this.walk((r,a)=>{if(r.type==="decl"&&r.prop===t)return s(r,a)}):(s=t,this.walk((r,a)=>{if(r.type==="decl")return s(r,a)}))}walkRules(t,s){return s?t instanceof RegExp?this.walk((r,a)=>{if(r.type==="rule"&&t.test(r.selector))return s(r,a)}):this.walk((r,a)=>{if(r.type==="rule"&&r.selector===t)return s(r,a)}):(s=t,this.walk((r,a)=>{if(r.type==="rule")return s(r,a)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};dt.registerParse=o=>{pa=o};dt.registerRule=o=>{dr=o};dt.registerAtRule=o=>{cr=o};dt.registerRoot=o=>{fa=o};var vt=dt;dt.default=dt;dt.rebuild=o=>{o.type==="atrule"?Object.setPrototypeOf(o,cr.prototype):o.type==="rule"?Object.setPrototypeOf(o,dr.prototype):o.type==="decl"?Object.setPrototypeOf(o,ua.prototype):o.type==="comment"?Object.setPrototypeOf(o,da.prototype):o.type==="root"&&Object.setPrototypeOf(o,fa.prototype),o[ha]=!0,o.nodes&&o.nodes.forEach(t=>{dt.rebuild(t)})};let wa=vt,us=class extends wa{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var ur=us;us.default=us;wa.registerAtRule(us);let ji=vt,ya,ja,Ut=class extends ji{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ya(new ja,this,t).stringify()}};Ut.registerLazyResult=o=>{ya=o};Ut.registerProcessor=o=>{ja=o};var mr=Ut;Ut.default=Ut;let vi="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Ni=(o,t=21)=>(s=t)=>{let r="",a=s|0;for(;a--;)r+=o[Math.random()*o.length|0];return r},ki=(o=21)=>{let t="",s=o|0;for(;s--;)t+=vi[Math.random()*64|0];return t};var Si={nanoid:ki,customAlphabet:Ni};let{existsSync:_i,readFileSync:Ci}=ot,{dirname:Ts,join:Ei}=ot,{SourceMapConsumer:Dr,SourceMapGenerator:Or}=ot;function Pi(o){return Buffer?Buffer.from(o,"base64").toString():window.atob(o)}let Hs=class{constructor(t,s){if(s.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=s.map?s.map.prev:void 0,a=this.loadMap(s.from,r);!this.mapFile&&s.from&&(this.mapFile=s.from),this.mapFile&&(this.root=Ts(this.mapFile)),a&&(this.text=a)}consumer(){return this.consumerCache||(this.consumerCache=new Dr(this.text)),this.consumerCache}decodeInline(t){let s=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,a=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/,i=t.match(a)||t.match(n);if(i)return decodeURIComponent(t.substr(i[0].length));let c=t.match(s)||t.match(r);if(c)return Pi(t.substr(c[0].length));let l=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+l)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let s=t.match(/\/\*\s*# sourceMappingURL=/g);if(!s)return;let r=t.lastIndexOf(s.pop()),a=t.indexOf("*/",r);r>-1&&a>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,a)))}loadFile(t){if(this.root=Ts(t),_i(t))return this.mapFile=t,Ci(t,"utf-8").toString().trim()}loadMap(t,s){if(s===!1)return!1;if(s){if(typeof s=="string")return s;if(typeof s=="function"){let r=s(t);if(r){let a=this.loadFile(r);if(!a)throw new Error("Unable to load previous source map: "+r.toString());return a}}else{if(s instanceof Dr)return Or.fromSourceMap(s).toString();if(s instanceof Or)return s.toString();if(this.isMap(s))return JSON.stringify(s);throw new Error("Unsupported previous source map format: "+s.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return t&&(r=Ei(Ts(t),r)),this.loadFile(r)}}}startWith(t,s){return t?t.substr(0,s.length)===s:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var va=Hs;Hs.default=Hs;let{nanoid:Ii}=Si,{isAbsolute:Qs,resolve:Ks}=ot,{SourceMapConsumer:Di,SourceMapGenerator:Oi}=ot,{fileURLToPath:Ar,pathToFileURL:Kt}=ot,Rr=lr,Ai=va,Ls=ot,$s=Symbol("fromOffsetCache"),Ri=!!(Di&&Oi),Tr=!!(Ks&&Qs),ms=class{constructor(t,s={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,s.from&&(!Tr||/^\w+:\/\//.test(s.from)||Qs(s.from)?this.file=s.from:this.file=Ks(s.from)),Tr&&Ri){let r=new Ai(this.css,s);if(r.text){this.map=r;let a=r.consumer().file;!this.file&&a&&(this.file=this.mapResolve(a))}}this.file||(this.id="<input css "+Ii(6)+">"),this.map&&(this.map.file=this.from)}error(t,s,r,a={}){let n,i,c;if(s&&typeof s=="object"){let m=s,u=r;if(typeof m.offset=="number"){let h=this.fromOffset(m.offset);s=h.line,r=h.col}else s=m.line,r=m.column;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);i=h.line,n=h.col}else i=u.line,n=u.column}else if(!r){let m=this.fromOffset(s);s=m.line,r=m.col}let l=this.origin(s,r,i,n);return l?c=new Rr(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,a.plugin):c=new Rr(t,i===void 0?s:{column:r,line:s},i===void 0?r:{column:n,line:i},this.css,this.file,a.plugin),c.input={column:r,endColumn:n,endLine:i,line:s,source:this.css},this.file&&(Kt&&(c.input.url=Kt(this.file).toString()),c.input.file=this.file),c}fromOffset(t){let s,r;if(this[$s])r=this[$s];else{let n=this.css.split(`
`);r=new Array(n.length);let i=0;for(let c=0,l=n.length;c<l;c++)r[c]=i,i+=n[c].length+1;this[$s]=r}s=r[r.length-1];let a=0;if(t>=s)a=r.length-1;else{let n=r.length-2,i;for(;a<n;)if(i=a+(n-a>>1),t<r[i])n=i-1;else if(t>=r[i+1])a=i+1;else{a=i;break}}return{col:t-r[a]+1,line:a+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Ks(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,s,r,a){if(!this.map)return!1;let n=this.map.consumer(),i=n.originalPositionFor({column:s,line:t});if(!i.source)return!1;let c;typeof r=="number"&&(c=n.originalPositionFor({column:a,line:r}));let l;Qs(i.source)?l=Kt(i.source):l=new URL(i.source,this.map.consumer().sourceRoot||Kt(this.map.mapFile));let m={column:i.column,endColumn:c&&c.column,endLine:c&&c.line,line:i.line,url:l.toString()};if(l.protocol==="file:")if(Ar)m.file=Ar(l);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(i.source);return u&&(m.source=u),m}toJSON(){let t={};for(let s of["hasBOM","css","file","id"])this[s]!=null&&(t[s]=this[s]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}};var _s=ms;ms.default=ms;Ls&&Ls.registerInput&&Ls.registerInput(ms);let Na=vt,ka,Sa,kt=class extends Na{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,s,r){let a=super.normalize(t);if(s){if(r==="prepend")this.nodes.length>1?s.raws.before=this.nodes[1].raws.before:delete s.raws.before;else if(this.first!==s)for(let n of a)n.raws.before=s.raws.before}return a}removeChild(t,s){let r=this.index(t);return!s&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new ka(new Sa,this,t).stringify()}};kt.registerLazyResult=o=>{ka=o};kt.registerProcessor=o=>{Sa=o};var Ht=kt;kt.default=kt;Na.registerRoot(kt);let Bt={comma(o){return Bt.split(o,[","],!0)},space(o){let t=[" ",`
`," "];return Bt.split(o,t)},split(o,t,s){let r=[],a="",n=!1,i=0,c=!1,l="",m=!1;for(let u of o)m?m=!1:u==="\\"?m=!0:c?u===l&&(c=!1):u==='"'||u==="'"?(c=!0,l=u):u==="("?i+=1:u===")"?i>0&&(i-=1):i===0&&t.includes(u)&&(n=!0),n?(a!==""&&r.push(a.trim()),a="",n=!1):a+=u;return(s||a!=="")&&r.push(a.trim()),r}};var _a=Bt;Bt.default=Bt;let Ca=vt,Ti=_a,hs=class extends Ca{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ti.comma(this.selector)}set selectors(t){let s=this.selector?this.selector.match(/,\s*/):null,r=s?s[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}};var hr=hs;hs.default=hs;Ca.registerRule(hs);let Li=ur,$i=ks,Mi=Ss,zi=_s,Ui=va,Bi=Ht,Fi=hr;function Ft(o,t){if(Array.isArray(o))return o.map(a=>Ft(a));let{inputs:s,...r}=o;if(s){t=[];for(let a of s){let n={...a,__proto__:zi.prototype};n.map&&(n.map={...n.map,__proto__:Ui.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=o.nodes.map(a=>Ft(a,t))),r.source){let{inputId:a,...n}=r.source;r.source=n,a!=null&&(r.source.input=t[a])}if(r.type==="root")return new Bi(r);if(r.type==="decl")return new Mi(r);if(r.type==="rule")return new Fi(r);if(r.type==="comment")return new $i(r);if(r.type==="atrule")return new Li(r);throw new Error("Unknown node type: "+o.type)}var Yi=Ft;Ft.default=Ft;let{dirname:ns,relative:Ea,resolve:Pa,sep:Ia}=ot,{SourceMapConsumer:Da,SourceMapGenerator:is}=ot,{pathToFileURL:Lr}=ot,Ji=_s,qi=!!(Da&&is),Gi=!!(ns&&Pa&&Ea&&Ia),Vi=class{constructor(t,s,r,a){this.stringify=t,this.mapOpts=r.map||{},this.root=s,this.opts=r,this.css=a,this.originalCSS=a,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let s=`
`;this.css.includes(`\r
`)&&(s=`\r
`),this.css+=s+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let s=this.toUrl(this.path(t.file)),r=t.root||ns(t.file),a;this.mapOpts.sourcesContent===!1?(a=new Da(t.text),a.sourcesContent&&(a.sourcesContent=null)):a=t.consumer(),this.map.applySourceMap(a,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let s=this.root.nodes.length-1;s>=0;s--)t=this.root.nodes[s],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(s)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Gi&&qi&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,s=>{t+=s}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=is.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new is({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new is({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,s=1,r="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,i;this.stringify(this.root,(c,l,m)=>{if(this.css+=c,l&&m!=="end"&&(a.generated.line=t,a.generated.column=s-1,l.source&&l.source.start?(a.source=this.sourcePath(l),a.original.line=l.source.start.line,a.original.column=l.source.start.column-1,this.map.addMapping(a)):(a.source=r,a.original.line=1,a.original.column=0,this.map.addMapping(a))),i=c.match(/\n/g),i?(t+=i.length,n=c.lastIndexOf(`
`),s=c.length-n):s+=c.length,l&&m!=="start"){let u=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==u.last||u.raws.semicolon)&&(l.source&&l.source.end?(a.source=this.sourcePath(l),a.original.line=l.source.end.line,a.original.column=l.source.end.column-1,a.generated.line=t,a.generated.column=s-2,this.map.addMapping(a)):(a.source=r,a.original.line=1,a.original.column=0,a.generated.line=t,a.generated.column=s-1,this.map.addMapping(a)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(s=>s.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let s=this.memoizedPaths.get(t);if(s)return s;let r=this.opts.to?ns(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=ns(Pa(r,this.mapOpts.annotation)));let a=Ea(r,t);return this.memoizedPaths.set(t,a),a}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let s=t.source.input.map;this.previousMaps.includes(s)||this.previousMaps.push(s)}});else{let t=new Ji(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(s=>{if(s.source){let r=s.source.input.from;if(r&&!t[r]){t[r]=!0;let a=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(a,s.source.input.css)}}});else if(this.css){let s=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(s,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let s=this.memoizedFileURLs.get(t);if(s)return s;if(Lr){let r=Lr(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let s=this.memoizedURLs.get(t);if(s)return s;Ia==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};var Oa=Vi;const Ms="'".charCodeAt(0),$r='"'.charCodeAt(0),Xt="\\".charCodeAt(0),Mr="/".charCodeAt(0),Zt=`
`.charCodeAt(0),Lt=" ".charCodeAt(0),es="\f".charCodeAt(0),ts=" ".charCodeAt(0),ss="\r".charCodeAt(0),Wi="[".charCodeAt(0),Hi="]".charCodeAt(0),Qi="(".charCodeAt(0),Ki=")".charCodeAt(0),Xi="{".charCodeAt(0),Zi="}".charCodeAt(0),el=";".charCodeAt(0),tl="*".charCodeAt(0),sl=":".charCodeAt(0),rl="@".charCodeAt(0),rs=/[\t\n\f\r "#'()/;[\\\]{}]/g,as=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,al=/.[\r\n"'(/\\]/,zr=/[\da-f]/i;var ol=function(t,s={}){let r=t.css.valueOf(),a=s.ignoreErrors,n,i,c,l,m,u,h,p,x,f,v=r.length,g=0,w=[],N=[];function k(){return g}function j(z){throw t.error("Unclosed "+z,g)}function $(){return N.length===0&&g>=v}function V(z){if(N.length)return N.pop();if(g>=v)return;let q=z?z.ignoreUnclosed:!1;switch(n=r.charCodeAt(g),n){case Zt:case Lt:case ts:case ss:case es:{l=g;do l+=1,n=r.charCodeAt(l);while(n===Lt||n===Zt||n===ts||n===ss||n===es);u=["space",r.slice(g,l)],g=l-1;break}case Wi:case Hi:case Xi:case Zi:case sl:case el:case Ki:{let H=String.fromCharCode(n);u=[H,H,g];break}case Qi:{if(f=w.length?w.pop()[1]:"",x=r.charCodeAt(g+1),f==="url"&&x!==Ms&&x!==$r&&x!==Lt&&x!==Zt&&x!==ts&&x!==es&&x!==ss){l=g;do{if(h=!1,l=r.indexOf(")",l+1),l===-1)if(a||q){l=g;break}else j("bracket");for(p=l;r.charCodeAt(p-1)===Xt;)p-=1,h=!h}while(h);u=["brackets",r.slice(g,l+1),g,l],g=l}else l=r.indexOf(")",g+1),i=r.slice(g,l+1),l===-1||al.test(i)?u=["(","(",g]:(u=["brackets",i,g,l],g=l);break}case Ms:case $r:{m=n===Ms?"'":'"',l=g;do{if(h=!1,l=r.indexOf(m,l+1),l===-1)if(a||q){l=g+1;break}else j("string");for(p=l;r.charCodeAt(p-1)===Xt;)p-=1,h=!h}while(h);u=["string",r.slice(g,l+1),g,l],g=l;break}case rl:{rs.lastIndex=g+1,rs.test(r),rs.lastIndex===0?l=r.length-1:l=rs.lastIndex-2,u=["at-word",r.slice(g,l+1),g,l],g=l;break}case Xt:{for(l=g,c=!0;r.charCodeAt(l+1)===Xt;)l+=1,c=!c;if(n=r.charCodeAt(l+1),c&&n!==Mr&&n!==Lt&&n!==Zt&&n!==ts&&n!==ss&&n!==es&&(l+=1,zr.test(r.charAt(l)))){for(;zr.test(r.charAt(l+1));)l+=1;r.charCodeAt(l+1)===Lt&&(l+=1)}u=["word",r.slice(g,l+1),g,l],g=l;break}default:{n===Mr&&r.charCodeAt(g+1)===tl?(l=r.indexOf("*/",g+2)+1,l===0&&(a||q?l=r.length:j("comment")),u=["comment",r.slice(g,l+1),g,l],g=l):(as.lastIndex=g+1,as.test(r),as.lastIndex===0?l=r.length-1:l=as.lastIndex-2,u=["word",r.slice(g,l+1),g,l],w.push(u),g=l);break}}return g++,u}function L(z){N.push(z)}return{back:L,endOfFile:$,nextToken:V,position:k}};let nl=ur,il=ks,ll=Ss,cl=Ht,Ur=hr,dl=ol;const Br={empty:!0,space:!0};function ul(o){for(let t=o.length-1;t>=0;t--){let s=o[t],r=s[3]||s[2];if(r)return r}}let ml=class{constructor(t){this.input=t,this.root=new cl,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let s=new nl;s.name=t[1].slice(1),s.name===""&&this.unnamedAtrule(s,t),this.init(s,t[2]);let r,a,n,i=!1,c=!1,l=[],m=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?m.push(r==="("?")":"]"):r==="{"&&m.length>0?m.push("}"):r===m[m.length-1]&&m.pop(),m.length===0)if(r===";"){s.source.end=this.getPosition(t[2]),s.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){c=!0;break}else if(r==="}"){if(l.length>0){for(n=l.length-1,a=l[n];a&&a[0]==="space";)a=l[--n];a&&(s.source.end=this.getPosition(a[3]||a[2]),s.source.end.offset++)}this.end(t);break}else l.push(t);else l.push(t);if(this.tokenizer.endOfFile()){i=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(s.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(s,"params",l),i&&(t=l[l.length-1],s.source.end=this.getPosition(t[3]||t[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),c&&(s.nodes=[],this.current=s)}checkMissedSemicolon(t){let s=this.colon(t);if(s===!1)return;let r=0,a;for(let n=s-1;n>=0&&(a=t[n],!(a[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",a[0]==="word"?a[3]+1:a[2])}colon(t){let s=0,r,a,n;for(let[i,c]of t.entries()){if(a=c,n=a[0],n==="("&&(s+=1),n===")"&&(s-=1),s===0&&n===":")if(!r)this.doubleColon(a);else{if(r[0]==="word"&&r[1]==="progid")continue;return i}r=a}return!1}comment(t){let s=new il;this.init(s,t[2]),s.source.end=this.getPosition(t[3]||t[2]),s.source.end.offset++;let r=t[1].slice(2,-2);if(/^\s*$/.test(r))s.text="",s.raws.left=r,s.raws.right="";else{let a=r.match(/^(\s*)([^]*\S)(\s*)$/);s.text=a[2],s.raws.left=a[1],s.raws.right=a[3]}}createTokenizer(){this.tokenizer=dl(this.input)}decl(t,s){let r=new ll;this.init(r,t[0][2]);let a=t[t.length-1];for(a[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(a[3]||a[2]||ul(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let m=t[0][0];if(m===":"||m==="space"||m==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let n;for(;t.length;)if(n=t.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let i=[],c;for(;t.length&&(c=t[0][0],!(c!=="space"&&c!=="comment"));)i.push(t.shift());this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(n=t[m],n[1].toLowerCase()==="!important"){r.important=!0;let u=this.stringFrom(t,m);u=this.spacesFromEnd(t)+u,u!==" !important"&&(r.raws.important=u);break}else if(n[1].toLowerCase()==="important"){let u=t.slice(0),h="";for(let p=m;p>0;p--){let x=u[p][0];if(h.trim().startsWith("!")&&x!=="space")break;h=u.pop()[1]+h}h.trim().startsWith("!")&&(r.important=!0,r.raws.important=h,t=u)}if(n[0]!=="space"&&n[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=i.map(m=>m[1]).join(""),i=[]),this.raw(r,"value",i.concat(t),s),r.value.includes(":")&&!s&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let s=new Ur;this.init(s,t[2]),s.selector="",s.raws.between="",this.current=s}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let s=this.current.nodes[this.current.nodes.length-1];s&&s.type==="rule"&&!s.raws.ownSemicolon&&(s.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let s=this.input.fromOffset(t);return{column:s.col,line:s.line,offset:t}}init(t,s){this.current.push(t),t.source={input:this.input,start:this.getPosition(s)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let s=!1,r=null,a=!1,n=null,i=[],c=t[1].startsWith("--"),l=[],m=t;for(;m;){if(r=m[0],l.push(m),r==="("||r==="[")n||(n=m),i.push(r==="("?")":"]");else if(c&&a&&r==="{")n||(n=m),i.push("}");else if(i.length===0)if(r===";")if(a){this.decl(l,c);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),s=!0;break}else r===":"&&(a=!0);else r===i[i.length-1]&&(i.pop(),i.length===0&&(n=null));m=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(s=!0),i.length>0&&this.unclosedBracket(n),s&&a){if(!c)for(;l.length&&(m=l[l.length-1][0],!(m!=="space"&&m!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,c)}else this.unknownWord(l)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,s,r,a){let n,i,c=r.length,l="",m=!0,u,h;for(let p=0;p<c;p+=1)n=r[p],i=n[0],i==="space"&&p===c-1&&!a?m=!1:i==="comment"?(h=r[p-1]?r[p-1][0]:"empty",u=r[p+1]?r[p+1][0]:"empty",!Br[h]&&!Br[u]?l.slice(-1)===","?m=!1:l+=n[1]:m=!1):l+=n[1];if(!m){let p=r.reduce((x,f)=>x+f[1],"");t.raws[s]={raw:p,value:l}}t[s]=l}rule(t){t.pop();let s=new Ur;this.init(s,t[0][2]),s.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(s,"selector",t),this.current=s}spacesAndCommentsFromEnd(t){let s,r="";for(;t.length&&(s=t[t.length-1][0],!(s!=="space"&&s!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let s,r="";for(;t.length&&(s=t[0][0],!(s!=="space"&&s!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let s,r="";for(;t.length&&(s=t[t.length-1][0],s==="space");)r=t.pop()[1]+r;return r}stringFrom(t,s){let r="";for(let a=s;a<t.length;a++)r+=t[a][1];return t.splice(s,t.length-s),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,s){throw this.input.error("At-rule without name",{offset:s[2]},{offset:s[2]+s[1].length})}};var hl=ml;let pl=vt,fl=_s,xl=hl;function ps(o,t){let s=new fl(o,t),r=new xl(s);try{r.parse()}catch(a){throw a}return r.root}var pr=ps;ps.default=ps;pl.registerParse(ps);let Xs=class{constructor(t,s={}){if(this.type="warning",this.text=t,s.node&&s.node.source){let r=s.node.rangeBy(s);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in s)this[r]=s[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Aa=Xs;Xs.default=Xs;let gl=Aa,Zs=class{constructor(t,s,r){this.processor=t,this.messages=[],this.root=s,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let r=new gl(t,s);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}get content(){return this.css}};var fr=Zs;Zs.default=Zs;let bl=vt,wl=mr,yl=Oa,jl=pr,Fr=fr,vl=Ht,Nl=vs,{isClean:lt,my:kl}=Wt;const Sl={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_l={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Cl={Once:!0,postcssPlugin:!0,prepare:!0},St=0;function $t(o){return typeof o=="object"&&typeof o.then=="function"}function Ra(o){let t=!1,s=Sl[o.type];return o.type==="decl"?t=o.prop.toLowerCase():o.type==="atrule"&&(t=o.name.toLowerCase()),t&&o.append?[s,s+"-"+t,St,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:o.append?[s,St,s+"Exit"]:[s,s+"Exit"]}function Yr(o){let t;return o.type==="document"?t=["Document",St,"DocumentExit"]:o.type==="root"?t=["Root",St,"RootExit"]:t=Ra(o),{eventIndex:0,events:t,iterator:0,node:o,visitorIndex:0,visitors:[]}}function er(o){return o[lt]=!1,o.nodes&&o.nodes.forEach(t=>er(t)),o}let tr={},_t=class Ta{constructor(t,s,r){this.stringified=!1,this.processed=!1;let a;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))a=er(s);else if(s instanceof Ta||s instanceof Fr)a=er(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let n=jl;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{a=n(s,r)}catch(i){this.processed=!0,this.error=i}a&&!a[kl]&&bl.rebuild(a)}this.result=new Fr(t,a,r),this.helpers={...tr,postcss:tr,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,s){let r=this.result.lastPlugin;try{s&&s.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(a){console&&console.error&&console.error(a)}return t}prepareVisitors(){this.listeners={};let t=(s,r,a)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,a])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!_l[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Cl[r])if(typeof s[r]=="object")for(let a in s[r])a==="*"?t(s,r,s[r][a]):t(s,r+"-"+a.toLowerCase(),s[r][a]);else typeof s[r]=="function"&&t(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let s=this.plugins[t],r=this.runOnRoot(s);if($t(r))try{await r}catch(a){throw this.handleError(a)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[lt];){t[lt]=!0;let s=[Yr(t)];for(;s.length>0;){let r=this.visitTick(s);if($t(r))try{await r}catch(a){let n=s[s.length-1].node;throw this.handleError(a,n)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(t.type==="document"){let a=t.nodes.map(n=>r(n,this.helpers));await Promise.all(a)}else await r(t,this.helpers)}catch(a){throw this.handleError(a)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return $t(s[0])?Promise.all(s):s}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(s){throw this.handleError(s)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,s=Nl;t.syntax&&(s=t.syntax.stringify),t.stringifier&&(s=t.stringifier),s.stringify&&(s=s.stringify);let a=new yl(s,this.result.root,this.result.opts).generate();return this.result.css=a[0],this.result.map=a[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let s=this.runOnRoot(t);if($t(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[lt];)t[lt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let s of t.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,s){return this.async().then(t,s)}toString(){return this.css}visitSync(t,s){for(let[r,a]of t){this.result.lastPlugin=r;let n;try{n=a(s,this.helpers)}catch(i){throw this.handleError(i,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if($t(n))throw this.getAsyncError()}}visitTick(t){let s=t[t.length-1],{node:r,visitors:a}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(a.length>0&&s.visitorIndex<a.length){let[i,c]=a[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===a.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=i;try{return c(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(s.iterator!==0){let i=s.iterator,c;for(;c=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!c[lt]){c[lt]=!0,t.push(Yr(c));return}s.iterator=0,delete r.indexes[i]}let n=s.events;for(;s.eventIndex<n.length;){let i=n[s.eventIndex];if(s.eventIndex+=1,i===St){r.nodes&&r.nodes.length&&(r[lt]=!0,s.iterator=r.getIterator());return}else if(this.listeners[i]){s.visitors=this.listeners[i];return}}t.pop()}walkSync(t){t[lt]=!0;let s=Ra(t);for(let r of s)if(r===St)t.nodes&&t.each(a=>{a[lt]||this.walkSync(a)});else{let a=this.listeners[r];if(a&&this.visitSync(a,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};_t.registerPostcss=o=>{tr=o};var La=_t;_t.default=_t;vl.registerLazyResult(_t);wl.registerLazyResult(_t);let El=Oa,Pl=pr;const Il=fr;let Dl=vs,sr=class{constructor(t,s,r){s=s.toString(),this.stringified=!1,this._processor=t,this._css=s,this._opts=r,this._map=void 0;let a,n=Dl;this.result=new Il(this._processor,a,this._opts),this.result.css=s;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let c=new El(n,a,this._opts,s);if(c.isMap()){let[l,m]=c.generate();l&&(this.result.css=l),m&&(this.result.map=m)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,s){return this.async().then(t,s)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,s=Pl;try{t=s(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};var Ol=sr;sr.default=sr;let Al=mr,Rl=La,Tl=Ol,Ll=Ht,Yt=class{constructor(t=[]){this.version="8.4.49",this.plugins=this.normalize(t)}normalize(t){let s=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))s=s.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)s.push(r);else if(typeof r=="function")s.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return s}process(t,s={}){return!this.plugins.length&&!s.parser&&!s.stringifier&&!s.syntax?new Tl(this,t,s):new Rl(this,t,s)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var $l=Yt;Yt.default=Yt;Ll.registerProcessor(Yt);Al.registerProcessor(Yt);let $a=ur,Ma=ks,Ml=vt,zl=lr,za=Ss,Ua=mr,Ul=Yi,Bl=_s,Fl=La,Yl=_a,Jl=Ns,ql=pr,xr=$l,Gl=fr,Ba=Ht,Fa=hr,Vl=vs,Wl=Aa;function Ne(...o){return o.length===1&&Array.isArray(o[0])&&(o=o[0]),new xr(o)}Ne.plugin=function(t,s){let r=!1;function a(...i){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`));let c=s(...i);return c.postcssPlugin=t,c.postcssVersion=new xr().version,c}let n;return Object.defineProperty(a,"postcss",{get(){return n||(n=a()),n}}),a.process=function(i,c,l){return Ne([a(l)]).process(i,c)},a};Ne.stringify=Vl;Ne.parse=ql;Ne.fromJSON=Ul;Ne.list=Yl;Ne.comment=o=>new Ma(o);Ne.atRule=o=>new $a(o);Ne.decl=o=>new za(o);Ne.rule=o=>new Fa(o);Ne.root=o=>new Ba(o);Ne.document=o=>new Ua(o);Ne.CssSyntaxError=zl;Ne.Declaration=za;Ne.Container=Ml;Ne.Processor=xr;Ne.Document=Ua;Ne.Comment=Ma;Ne.Warning=Wl;Ne.AtRule=$a;Ne.Result=Gl;Ne.Input=Bl;Ne.Rule=Fa;Ne.Root=Ba;Ne.Node=Jl;Fl.registerPostcss(Ne);var Hl=Ne;Ne.default=Ne;const Te=lo(Hl);Te.stringify;Te.fromJSON;Te.plugin;Te.parse;Te.list;Te.document;Te.comment;Te.atRule;Te.rule;Te.decl;Te.root;Te.CssSyntaxError;Te.Declaration;Te.Container;Te.Processor;Te.Document;Te.Comment;Te.Warning;Te.AtRule;Te.Result;Te.Input;Te.Rule;Te.Root;Te.Node;function Ge(...o){return Vo(Go(o))}const Ql=qo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Kl({className:o,variant:t,...s}){return e.jsx("div",{className:Ge(Ql({variant:t}),o),...s})}const Xl=Ho,Ya=y.forwardRef(({className:o,...t},s)=>e.jsx(Hr,{ref:s,className:Ge("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",o),...t}));Ya.displayName=Hr.displayName;const Zl=y.forwardRef(({className:o,children:t,...s},r)=>e.jsxs(Xl,{children:[e.jsx(Ya,{}),e.jsxs(Qr,{ref:r,className:Ge("bg-background 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",o),...s,children:[t,e.jsxs(Wo,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(qt,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zl.displayName=Qr.displayName;const ec=y.forwardRef(({className:o,...t},s)=>e.jsx(Kr,{ref:s,className:Ge("text-lg font-semibold tracking-tight leading-none",o),...t}));ec.displayName=Kr.displayName;const tc=y.forwardRef(({className:o,...t},s)=>e.jsx(Xr,{ref:s,className:Ge("text-sm text-muted-foreground",o),...t}));tc.displayName=Xr.displayName;const Ja=y.forwardRef(({className:o,...t},s)=>e.jsx(Qe,{ref:s,className:Ge("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",o),...t}));Ja.displayName=Qe.displayName;const sc=y.forwardRef(({className:o,...t},s)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(So,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Qe.Input,{ref:s,className:Ge("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",o),...t})]}));sc.displayName=Qe.Input.displayName;const qa=y.forwardRef(({className:o,...t},s)=>e.jsx(Qe.List,{ref:s,className:Ge("max-h-[300px] overflow-y-auto overflow-x-hidden",o),...t}));qa.displayName=Qe.List.displayName;const Ga=y.forwardRef((o,t)=>e.jsx(Qe.Empty,{ref:t,className:"py-6 text-center text-sm",...o}));Ga.displayName=Qe.Empty.displayName;const rc=y.forwardRef(({className:o,...t},s)=>e.jsx(Qe.Group,{ref:s,className:Ge("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",o),...t}));rc.displayName=Qe.Group.displayName;const ac=y.forwardRef(({className:o,...t},s)=>e.jsx(Qe.Separator,{ref:s,className:Ge("bg-border -mx-1 h-px",o),...t}));ac.displayName=Qe.Separator.displayName;const Va=y.forwardRef(({className:o,...t},s)=>e.jsx(Qe.Item,{ref:s,className:Ge("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",o),...t}));Va.displayName=Qe.Item.displayName;const Wa=y.createContext(),Cs=()=>{const o=y.useContext(Wa);if(!o)throw new Error("useMultiSelect must be used within MultiSelectProvider");return o},oc=({values:o,onValuesChange:t,loop:s=!1,className:r,data:a={data:a},children:n,dir:i,placeholder:c,...l})=>{const[m,u]=y.useState(""),[h,p]=y.useState(!1),[x,f]=y.useState(-1),v=y.useCallback(w=>{const N=o.some(k=>k.value===w.value);t(N?o.filter(k=>k.value!==w.value):[...o,{value:w.value,label:w.label}])},[o,t]),g=y.useCallback(w=>{const N=()=>{const j=x+1;f(j>o.length-1?s?0:-1:j)},k=()=>{const j=x-1;f(j<0?o.length-1:j)};if((w.key==="Backspace"||w.key==="Delete")&&o.length>0){if(m.length===0)if(x!==-1&&x<o.length){t(o.filter(($,V)=>V!==x));const j=x-1<0?0:x-1;f(j)}else t(o.slice(0,-1))}else w.key==="Enter"?p(!0):w.key==="Escape"?x!==-1?f(-1):p(!1):i==="rtl"?w.key==="ArrowRight"?k():w.key==="ArrowLeft"&&(x!==-1||s)&&N():w.key==="ArrowLeft"?k():w.key==="ArrowRight"&&(x!==-1||s)&&N()},[o,m,x,s,p,h]);return e.jsx(Zr,{onClick:()=>p(!1),className:"relative",children:e.jsx(Wa.Provider,{value:{data:a,value:o,onValueChange:v,open:h,setOpen:p,inputValue:m,setInputValue:u,activeIndex:x,setActiveIndex:f,placeholder:c},children:e.jsx(Ja,{onKeyDown:g,className:Ge("flex overflow-visible flex-col h-full border-form-strokedark bg-form-input",r),dir:i,...l,children:n})})})},Ha=y.forwardRef(({className:o,children:t,...s},r)=>{const{value:a,onValueChange:n,activeIndex:i,setOpen:c,open:l}=Cs(),m=y.useCallback(u=>{u.preventDefault(),u.stopPropagation()},[]);return e.jsxs("div",{className:`relative ${o}`,children:[e.jsxs("div",{ref:r,className:Ge(`scrollbar-hide relative flex h-full w-[calc(100%)] flex-wrap items-center gap-4 rounded border border-form-strokedark bg-form-input focus:border-blue-600 ${a.length>0?"overflow-y-auto pl-[4px] pr-[24px] pt-[6px]":""}`,o),...s,children:[a.map((u,h)=>e.jsxs(Kl,{className:Ge("flex h-[20px] max-w-[300px] items-center gap-2 rounded border-transparent bg-white/30 px-[6px] py-[3px] text-white ring-0",i===h&&"ring-muted-foreground ring-2 "),variant:"outline",children:[e.jsx("span",{className:"e truncate text-[10px] text-black text-white",children:u.label}),e.jsxs("button",{"aria-label":`Remove ${u.label} option`,"aria-roledescription":"button to remove option",type:"button",onMouseDown:m,onClick:()=>n(u),className:"rounded bg-transparent p-[2px] text-white",children:[e.jsxs("span",{className:"sr-only",children:["Remove ",u.label," option"]}),e.jsx(qt,{className:"w-4 h-4 text-white hover:stroke-destructive"})]})]},u.value)),t]}),l?e.jsx(_o,{onClick:()=>{c(!l)},className:"absolute right-[-6px] top-[50%] -translate-x-[50%] -translate-y-[50%] cursor-pointer"}):e.jsx(Co,{onClick:()=>{c(!l)},className:"absolute right-[-6px] top-[50%] -translate-x-[50%] -translate-y-[50%] cursor-pointer"})]})});Ha.displayName="MultiSelectorTrigger";const Qa=y.forwardRef(({className:o,...t},s)=>{const{setOpen:r,inputValue:a,setInputValue:n,activeIndex:i,setActiveIndex:c,value:l,placeholder:m}=Cs();return e.jsx(Qe.Input,{...t,ref:s,value:a,onValueChange:i===-1?n:void 0,onBlur:()=>r(!1),onFocus:()=>r(!0),onClick:()=>c(-1),placeholder:`${l.length?"":m||"Select"}`,className:Ge(" h-[36px] w-[30%] flex-1 bg-transparent text-white outline-none placeholder:text-bodydark2",o,i!==-1&&"caret-transparent",l.length>0&&"h-[20px]ml-2 w-[calc(30%-18px)]")})});Qa.displayName="MultiSelectorInput";const Ka=y.forwardRef(({children:o},t)=>{const{open:s}=Cs();return e.jsx("div",{ref:t,className:"relative",children:s&&o})});Ka.displayName="MultiSelectorContent";const Xa=y.forwardRef(({className:o,children:t},s)=>e.jsxs(qa,{ref:s,className:Ge("flex absolute top-0 z-10 flex-col gap-2 p-2 w-full rounded-md border shadow-md transition-colors custom-overflow border-form-strokedark bg-meta-4",o),children:[t,e.jsx(Ga,{children:e.jsx("span",{className:"text-muted-foreground",children:"No results found"})})]}));Xa.displayName="MultiSelectorList";const Za=y.forwardRef(({className:o,value:t,children:s,...r},a)=>{const{value:n,onValueChange:i,setInputValue:c,data:l}=Cs(),m=y.useCallback(p=>{p.preventDefault(),p.stopPropagation()},[]);console.log(l,t);const u=l.find(p=>p.value===t);console.log(u);const h=n.some(p=>p.value==u.value);return e.jsxs(Va,{ref:a,...r,onSelect:()=>{i({value:u.value,label:u.label}),c("")},className:Ge("flex cursor-pointer gap-3 border-b border-b-form-strokedark px-2 py-2 text-white transition-colors hover:bg-primary/5 ",o,h&&"cursor-default ",r.disabled&&"cursor-not-allowed "),onMouseDown:m,children:[e.jsx("input",{style:{accentColor:"black",color:"#3C50E0"},checked:h,className:"w-4 h-4 accent-primary hover:cursor-pointer",type:"checkbox",name:"",id:""}),s]})});Za.displayName="MultiSelectorItem";const Jr=({values:o,onValuesChange:t,options:s,placeholder:r="",className:a="h-[36px] w-full",selectRef:n})=>e.jsx("div",{className:a,children:e.jsxs(oc,{values:o,onValuesChange:t,data:s,placeholder:r,children:[e.jsx(Ha,{className:a,children:e.jsx(Qa,{className:"relative border-transparent",placeholder:r,ref:n})}),e.jsx("div",{children:e.jsx(Ka,{children:e.jsx(Xa,{className:"z-[50] bg-form-input",children:s.map((i,c)=>e.jsx(Za,{value:i.value,children:e.jsxs("span",{className:"cursor-pointer",children:[" ",i.label]})},i.value))})})})]})}),nc=()=>{st();const o=[{header:"Mix Date",accessor:"mix_date",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Program/Team",accessor:"program_name",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Producer",accessor:"producer",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Mix Type",accessor:"mix_type_name",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"Team Type",accessor:"team_type",isSorted:!1,isSortedDesc:!1,mappingExist:!0,mappings:{1:"All Girl",2:"Co-ed",3:"TBD"}},{header:"PAYMENT STATUS",accessor:"payment",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"TD/ED",accessor:"Td&Ed",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}},{header:"STATUS",accessor:"content_status",isSorted:!1,isSortedDesc:!1,mappingExist:!1,mappings:{}}],{dispatch:t,state:s}=d.useContext(Me),{dispatch:r}=d.useContext(xe),[a,n]=d.useState(!1),[i,c]=d.useState([]);d.useState([]),d.useState([]);const[l,m]=d.useState([]),[u,h]=d.useState([]),[p,x]=d.useState([]),[f,v]=d.useState(0),[g,w]=d.useState(0),[N,k]=d.useState(0),[j,$]=d.useState(!1),[V,L]=d.useState(!1);d.useState(!1);const[z,q]=d.useState(!1),[H,Z]=d.useState(""),[U,I]=d.useState(""),[O,P]=d.useState(""),[se,T]=d.useState(""),[ee,ne]=d.useState(""),[we,S]=d.useState("");d.useState(!1);const[re,Oe]=d.useState([]),[Ae,ce]=d.useState([]),[ie,ue]=d.useState([]),[be,Le]=d.useState([]),A=localStorage.getItem("clientProjectPageSize"),[ge,ve]=d.useState(A?Number(A):10),[ze,Ee]=y.useState(!1);d.useEffect(()=>{let D=localStorage.getItem("ClientProjectClientId")&&JSON.parse(localStorage.getItem("ClientProjectClientId")),J=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),Q=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),W=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName")),E=localStorage.getItem("ClientProjectMixDateStart"),Y=localStorage.getItem("ClientProjectMixDateEnd");I(D),P(J),Z(W),T(Q),ne(E),S(Y),Q&&(Q==null?void 0:Q.length)>0&&ce(Q),J&&J.length>0&&P(J),W&&(W==null?void 0:W.length)>0&&h(W),J&&(J==null?void 0:J.length)>0&&Le(J)},[]),d.useEffect(()=>{(async function(){n(!0);let D=localStorage.getItem("ClientProjectClientId")&&JSON.parse(localStorage.getItem("ClientProjectClientId")),J=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),Q=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName")),W=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),E=localStorage.getItem("ClientProjectMixDateStart"),Y=localStorage.getItem("ClientProjectMixDateEnd");I(D),P(J),T(W),ne(E),S(Y),Z(Q);let K=[];(D==null?void 0:D.length)>0&&D.forEach(b=>{K.push(b.value)});let ae=[];(J==null?void 0:J.length)>0&&J.forEach(b=>{ae.push(b.value)});let X=[];(Q==null?void 0:Q.length)>0&&Q.forEach(b=>{X.push(b.label)});let me=[];(W==null?void 0:W.length)>0&&W.forEach(b=>{me.push(b.value)});let le=Ze(ee),C=Ze(ee);if(le=le?fe(le).format("YYYY-MM-DD"):null,C=C?fe(C).format("YYYY-MM-DD"):null,le&&C&&le>C){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}(X==null?void 0:X.length)>0||(K==null?void 0:K.length)>0||(ae==null?void 0:ae.length)>0||(me==null?void 0:me.length)>0||E||Y?await Ie(1,A||ge,bt({client_ids:K??null,team_names:ae??null,producer_name:X??null,mix_type_ids:me??null,mix_date_start:E,mix_date_end:Y})):await Ie(1,A||ge),n(!1)})()},[ze]);const ke=async()=>{try{const D=await ci();if(!D.error&&D.list.length>0){let J=[];D.list.length>0&&D.list.map((Q,W)=>{J.push({value:Q.id,label:Q.name})}),Oe(J)}}catch(D){Ce(t,D.message)}},Fe=async()=>{try{const D=await oa();if(!D.error&&D.list.length>0){let J=[];D.list.length>0&&D.list.map((Q,W)=>{J.push({value:Q.id,label:Q.name})}),m(J)}}catch(D){Ce(t,D.message)}},G=Pt({client_id:Re(),producer_name:Re(),team_name:Re(),mix_type_id:Re(),mix_date_start:Re(),mix_date_end:Re()}),{register:Pe,handleSubmit:ye,setError:je,reset:Se,setValue:Je,formState:{errors:et}}=Et({resolver:Dt(G)});function Ve(D){(async function(){n(!0),ve(D);let J=localStorage.getItem("userClientId"),Q=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName"));Z(Q);let W=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),E=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),Y=localStorage.getItem("ClientProjectMixDateStart"),K=localStorage.getItem("ClientProjectMixDateEnd");P(W),T(E),ne(Y),S(K),Z(Q);let ae=[];(W==null?void 0:W.length)>0&&W.forEach(b=>{ae.push(b.value)});let X=[];(Q==null?void 0:Q.length)>0&&Q.forEach(b=>{X.push(b.value)});let me=[];(E==null?void 0:E.length)>0&&E.forEach(b=>{me.push(b.value)});let le=Ze(ee),C=Ze(ee);if(le=le?fe(le).format("YYYY-MM-DD"):null,C=C?fe(C).format("YYYY-MM-DD"):null,le&&C&&le>C){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}if((X==null?void 0:X.length)>0||(ae==null?void 0:ae.length)>0||(E==null?void 0:E.length)>0||Y||K){let b={client_id:J?Number(J):null,producer_name:X??null,team_name:ae??null,mix_type_id:me??null,mix_date_start:Y,mix_date_end:K};A?async function(){await Ie(1,D,b)}():async function(){await Ie(1,D,b)}()}else A?async function(){await Ie(1,D)}():async function(){await Ie(1,D)}();n(!1)})(),localStorage.setItem("clientProjectPageSize",D)}function Ue(){(async function(){n(!0);let D=localStorage.getItem("userClientId"),J=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName"));Z(J),JSON.parse(localStorage.getItem("ClientProjectClientId"));let Q=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),W=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),E=localStorage.getItem("ClientProjectMixDateStart"),Y=localStorage.getItem("ClientProjectMixDateEnd");P(Q),T(W),ne(E),S(Y),Z(J);let K=[];(Q==null?void 0:Q.length)>0&&Q.forEach(C=>{K.push(C.value)});let ae=[];(J==null?void 0:J.length)>0&&J.forEach(C=>{ae.push(C.value)});let X=[];(W==null?void 0:W.length)>0&&W.forEach(C=>{X.push(C.value)});let me=Ze(ee),le=Ze(ee);if(me=me?fe(me).format("YYYY-MM-DD"):null,le=le?fe(le).format("YYYY-MM-DD"):null,me&&le&&me>le){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}if((ae==null?void 0:ae.length)>0||(K==null?void 0:K.length)>0||(W==null?void 0:W.length)>0||E||Y){let C={client_id:D?Number(D):null,producer_name:ae??null,team_name:K??null,mix_type_id:X??null,mix_date_start:E,mix_date_end:Y};await Ie(N-1,A||ge,C)}else await Ie(N-1,A||ge);n(!1)})()}function tt(D){(async function(){n(!0);let J=localStorage.getItem("userClientId"),Q=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName"));Z(Q),JSON.parse(localStorage.getItem("ClientProjectClientId"));let W=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),E=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),Y=localStorage.getItem("ClientProjectMixDateStart"),K=localStorage.getItem("ClientProjectMixDateEnd");P(W),T(E),ne(Y),S(K),Z(Q);let ae=[];(W==null?void 0:W.length)>0&&W.forEach(b=>{ae.push(b.value)});let X=[];(Q==null?void 0:Q.length)>0&&Q.forEach(b=>{X.push(b.value)});let me=[];(E==null?void 0:E.length)>0&&E.forEach(b=>{me.push(b.value)});let le=Ze(ee),C=Ze(ee);if(le=le?fe(le).format("YYYY-MM-DD"):null,C=C?fe(C).format("YYYY-MM-DD"):null,le&&C&&le>C){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}if((X==null?void 0:X.length)>0||(ae==null?void 0:ae.length)>0||(E==null?void 0:E.length)>0||Y||K){let b={client_id:J?Number(J):null,producer_name:X??null,team_name:ae??null,mix_type_id:me??null,mix_date_start:Y,mix_date_end:K};await Ie(D,A||ge,b)}else await Ie(D,A||ge);n(!1)})()}function it(){(async function(){n(!0);let D=localStorage.getItem("userClientId"),J=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName"));Z(J),JSON.parse(localStorage.getItem("ClientProjectClientId"));let Q=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),W=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),E=localStorage.getItem("ClientProjectMixDateStart"),Y=localStorage.getItem("ClientProjectMixDateEnd");P(Q),T(W),ne(E),S(Y),Z(J);let K=[];(Q==null?void 0:Q.length)>0&&Q.forEach(C=>{K.push(C.value)});let ae=[];(J==null?void 0:J.length)>0&&J.forEach(C=>{ae.push(C.label)});let X=[];(W==null?void 0:W.length)>0&&W.forEach(C=>{X.push(C.value)});let me=Ze(ee),le=Ze(ee);if(me=me?fe(me).format("YYYY-MM-DD"):null,le=le?fe(le).format("YYYY-MM-DD"):null,me&&le&&me>le){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}if((K==null?void 0:K.length)>0||(W==null?void 0:W.length)>0||E||Y){let C={client_id:D?Number(D):null,producer_name:ae??null,team_name:K??null,mix_type_id:X??null,mix_date_start:E,mix_date_end:Y};await Ie(N+1,A||ge,C)}else await Ie(N+1,A||ge);n(!1)})()}async function Ie(D,J,Q){let W=localStorage.getItem("userClientId");try{n(!0);let E={...Q,is_impersonate:!1,client_id:W?Number(W):null};const Y=await ai(D,J,E),{list:K,total:ae,limit:X,num_pages:me,page:le}=Y,C=K.filter(b=>(b==null?void 0:b.payment_status)>0&&(b==null?void 0:b.payment_status)!==5&&(b==null?void 0:b.subscription)>1);x(C),v(me),k(le),w(ae),$(le>1),L(le+1<=me),n(!1)}catch(E){Ce(t,E.message)}}const gt=async()=>{Se(),n(!0),localStorage.setItem("ClientProjectTeamName",""),localStorage.setItem("ClientProjectMixTypeId",""),localStorage.setItem("ClientProjectMixDateStart",""),localStorage.setItem("ClientProjectMixDateEnd",""),localStorage.setItem("clientProjectPageSize",""),localStorage.setItem("ClientProjectProducerName",""),Z(""),ce([]),Le([]),h([]),Z(""),P(""),T(""),ne(""),S(""),ve(10),await Ie(1,ge),n(!1)},ut=async D=>{try{n(!0);let J=[];be.length>0&&be.forEach(ae=>{J.push(ae.value)});let Q=[];(u==null?void 0:u.length)>0&&u.forEach(ae=>{Q.push(ae.label)});let W=[];Ae.length>0&&Ae.forEach(ae=>{W.push(ae.value)});let E=Ze(D.mix_date_start),Y=Ze(D.mix_date_end);if(E=E?fe(E).format("YYYY-MM-DD"):null,Y=Y?fe(Y).format("YYYY-MM-DD"):null,E&&Y&&E>Y){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}let K={producer_name:Q??null,team_names:J??null,mix_type_ids:W??null,mix_date_start:E,mix_date_end:Y};if(!Q.length>0&&!(J!=null&&J.length)&&!(W!=null&&W.length)>0&&!E&&!Y){n(!1);return}localStorage.setItem("ClientProjectMixDateStart",E??""),localStorage.setItem("ClientProjectMixDateEnd",Y??""),A?async function(){await Ie(1,A,bt(K))}():async function(){await Ie(1,ge,bt(K))}(),n(!1)}catch(J){Ce(t,J.message)}},Ke=async()=>{try{const D=await aa();if(!D.error&&D.list.length>0){let J=[],Q=[];D.list.length>0&&D.list.forEach(W=>{J.push(W.team_name),Q.push({value:W.team_name,label:W.team_name})}),J=[...new Set(J)],J.sort(),Q.sort((W,E)=>W.label.localeCompare(E.label)),ue(Q)}}catch(D){Ce(t,D.message)}},$e=D=>{D.length===0?(Le([]),localStorage.setItem("ClientProjectTeamName",JSON.stringify("")),P([])):(Le(D),localStorage.setItem("ClientProjectTeamName",JSON.stringify(D)),P(D)),(D==null?void 0:D.length)<be.length&&Ee(!ze)},mt=D=>{D.length===0?(ce([]),localStorage.setItem("ClientProjectMixTypeId",JSON.stringify("")),T([])):(ce(D),localStorage.setItem("ClientProjectMixTypeId",JSON.stringify(D)),T(D)),(D==null?void 0:D.length)<Ae.length&&Ee(!ze)},We=async()=>{try{(await ri()).error&&c([])}catch(D){Ce(t,D.message)}};d.useEffect(()=>{r({type:"SETPATH",payload:{path:"projects"}});let D=localStorage.getItem("userClientId"),J=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName")),Q=localStorage.getItem("ClientProjectClientId")&&JSON.parse(localStorage.getItem("ClientProjectClientId")),W=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),E=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),Y=localStorage.getItem("ClientProjectMixDateStart"),K=localStorage.getItem("ClientProjectMixDateEnd");I(Q),P(W),T(E),ne(Y),S(K),Z(J);let ae=[];(Q==null?void 0:Q.length)>0&&Q.forEach(_=>{ae.push(_.value)});let X=[];(W==null?void 0:W.length)>0&&W.forEach(_=>{X.push(_.value)});let me=[];(E==null?void 0:E.length)>0&&E.forEach(_=>{me.push(_.value)});let le=[];(J==null?void 0:J.length)>0&&J.forEach(_=>{le.push(_.value)});let C=Ze(ee),b=Ze(ee);if(C=C?fe(C).format("YYYY-MM-DD"):null,b=b?fe(b).format("YYYY-MM-DD"):null,C&&b&&C>b){je("mix_date_start",{type:"manual",message:"Mix Date Start must be less than Mix Date End"}),n(!1);return}if((le==null?void 0:le.length)>0||(ae==null?void 0:ae.length)>0||(X==null?void 0:X.length)>0||(me==null?void 0:me.length)>0||Y||K){let _={is_impersonate:!1,client_id:D?Number(D):null,producer_name:J,team_name:W,mix_type_id:E?Number(E):null,mix_date_start:Y,mix_date_end:K};(async function(){n(!0),await Fe(),await Ke(),await We(),await ke(),n(!1)})(),A?async function(){await Ie(1,A,bt(_))}():async function(){await Ie(1,ge,bt(_))}()}else(async function(){n(!0),await Fe(),await Ke(),await We(),await ke(),n(!1)})(),A?async function(){await Ie(1,A)}():async function(){await Ie(1,ge)}()},[]);const ht=D=>{D.matches&&window.innerWidth<=600&&R(r,"Please rotate your device to landscape orientation for the best experience.",4e4,"warning")};window.matchMedia("(orientation: portrait)").addEventListener("change",ht);const pt=localStorage.getItem("userProgramName")||"";return e.jsx("div",{className:"p-4 h-full max-w-screen md:p-4 lg:p-6 xl:p-8",children:e.jsxs("div",{className:"shadow-default x",children:[e.jsxs("div",{className:"flex flex-row justify-between items-center p-3 px-4 mb-3 w-full rounded border shadow border-strokedark bg-boxdark",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("h4",{className:"text-2xl font-semibold text-white dark:text-white",children:"Projects /"}),e.jsxs("h4",{className:"text-2xl font-medium text-white",children:[" Welcome ",pt]})]}),e.jsx(li,{})]}),e.jsxs("div",{className:"rounded border shadow-default border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"px-4 py-6 mb-4 border-b project_search border-strokedark sm:px-6 2xl:px-9 dark:border-strokedark",children:e.jsxs("form",{onSubmit:ye(ut),className:"w-full",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsxs("div",{className:"flex w-[23%] flex-col",children:[e.jsx("label",{className:"mb-1.5 text-sm font-medium text-white",children:"Team Name"}),e.jsx(Jr,{className:"h-[38px]",values:be,onValuesChange:$e,options:ie,placeholder:"Team Name"})]}),e.jsxs("div",{className:"flex w-[23%] flex-col",children:[e.jsx("label",{className:"mb-1.5 text-sm font-medium text-white",children:"Mix Type"}),e.jsx(Jr,{className:"h-[38px]",values:Ae,onValuesChange:mt,options:re,placeholder:"Mix Type"})]}),e.jsxs("div",{className:"w-[46%]",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx("label",{className:"mb-1.5 w-[48.5%] text-sm font-medium text-white",children:"Mix Start Date"}),e.jsx("label",{className:"mb-1.5 w-[46%] text-sm font-medium text-white",children:"Mix End Date"})]}),e.jsx(Jo.DateRangePicker,{isOutsideRange:()=>!1,endDateArialLabel:"Mix Date End",startDateArialLabel:"Mix Date Start",endDatePlaceholderText:"Mix Date End",startDatePlaceholderText:"Mix Date Start",displayFormat:"MM-DD-YYYY",onFocusChange:D=>q(D),focusedInput:z,onDatesChange:({startDate:D,endDate:J})=>{Je("mix_date_start",D),Je("mix_date_end",J),ne(D),S(J)},startDate:ee?fe(ee):"",endDate:we?fe(we):"",startDateId:"mix_date_start",endDateId:"mix_date_end",customInputIcon:null,customArrowIcon:null,className:"w-2/5"})]})]}),e.jsxs("div",{className:"flex gap-2 items-center mt-3",children:[e.jsx("button",{type:"submit",className:"inline-flex h-[36px] items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:"Search"}),e.jsx("button",{onClick:gt,type:"button",className:"inline-flex h-[36px] items-center justify-center rounded-md border border-strokedark bg-danger px-4 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:"Reset"})]})]})}),e.jsx("div",{className:"custom-overflow min-h-[200px] w-full overflow-x-auto pb-4 pt-6 md:pb-6 2xl:pb-10",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"divide-y divide-[#9ca3ae80] bg-meta-4",children:e.jsx("tr",{className:"",children:o.map((D,J)=>e.jsxs("th",{scope:"col",className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase whitespace-nowrap text-bodydark1",children:[D.header,e.jsx("span",{children:D.isSorted?D.isSortedDesc?" ▼":" ▲":""})]},J))})}),e.jsx("tbody",{className:"cursor-pointer",children:a?a&&p.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:o.length,className:"px-4 py-8",children:e.jsx("div",{className:"flex justify-center items-center",children:e.jsxs("span",{classNasme:"relative text-xl font-semibold text-white animate-pulse",children:[e.jsx(_r,{color:"#fff",size:20,className:"mr-3"})," ","Loading Projects..."]})})})}):!a&&p.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:o.length,className:"px-4 py-8",children:e.jsx("div",{className:"flex justify-center items-center",children:e.jsx("span",{className:"text-xl font-semibold text-white",children:"No data found"})})})}):a&&p.length>0?e.jsx("tr",{children:e.jsx("td",{colSpan:o.length,className:"px-4 py-8",children:e.jsx("div",{className:"flex justify-center items-center",children:e.jsxs("span",{className:"relative text-xl font-semibold text-white animate-pulse",children:[e.jsx(_r,{color:"#fff",size:20,className:"mr-3"})," ","Loading Projects..."]})})})}):null:p.map((D,J)=>e.jsx(ii,{row:D,indexe:J},J))})]})}),p.length>0&&!a?e.jsx("div",{className:"px-4 py-10 sm:px-6 2xl:px-9",children:e.jsx(si,{currentPage:N,pageCount:f,pageSize:ge,canPreviousPage:j,canNextPage:V,updatePageSize:Ve,previousPage:Ue,nextPage:it,dataTotal:g,callDataAgain:tt,setCurrentPage:k})}):null]})]})})};let Es=new qe;const fs=async o=>{try{const t=`/v3/api/custom/equality_record/project/${o.id}`;return await Es.callRawAPI(t,o,"PUT")}catch(t){return t}},ic=async o=>{try{const t=`/v3/api/custom/equality_record/project/sub_project/${o}`;return await Es.callRawAPI(t,[],"GET")}catch(t){return t}},lc=async o=>{try{const t=`/v3/api/custom/equality_record/project/idea/${o}`;return await Es.callRawAPI(t,[],"GET")}catch(t){return t}},ct=async o=>{try{const t=`/v3/api/custom/equality_record/project/survey/view/${o}`;return await Es.callRawAPI(t,[],"GET")}catch(t){return t}};let cc=new qe;const dc=async()=>{try{const o="/v3/api/custom/equality_record/employee/retrieve/group";return await cc.callRawAPI(o,[],"GET")}catch(o){return o}};let uc=new qe;const mc=async o=>{try{const t=`/v3/api/custom/equality_record/email/get_one?slug=${o}`;return await uc.callRawAPI(t,{},"GET")}catch(t){return t}};let eo=new qe;const hc=async o=>{try{const t="/v3/api/custom/equality_record/survey/update_from_client";return await eo.callRawAPI(t,o,"PUT")}catch{}},Jt=async o=>{try{const t="/v3/api/custom/equality_record/survey/details";return await eo.callRawAPI(t,o,"POST")}catch{}},Ct=({confirmText:o,setModalClose:t,setFormYes:s})=>{const r=a=>{a.preventDefault(),s(!0)};return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),e.jsx("div",{className:"inline-block transform overflow-hidden rounded-lg bg-boxdark text-left align-bottom shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:align-middle",role:"dialog","aria-modal":"true","aria-labelledby":"modal-headline",children:e.jsxs("form",{children:[e.jsxs("div",{className:"flex w-full items-center justify-between border-b border-strokedark bg-boxdark px-6 py-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-white",id:"modal-headline",children:"Confirm Action"}),e.jsx("button",{type:"button",onClick:()=>t(!1),className:"rounded-full p-1 transition-colors hover:bg-meta-4",children:e.jsx(qt,{className:"h-6 w-6 text-white"})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"w-full",children:e.jsx("p",{className:"text-lg text-white",children:o})})}),e.jsxs("div",{className:"flex justify-end gap-4 border-t border-strokedark bg-boxdark px-6 py-4",children:[e.jsx("button",{type:"button",className:"hover:bg-danger/40/90 inline-flex items-center justify-center rounded-md bg-danger px-6 py-2.5 text-center font-medium text-white transition-colors",onClick:()=>t(!1),children:"Cancel"}),e.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white transition-colors hover:bg-primary/90",children:"Confirm"})]})]})})]})},to=({progress:o,isUploading:t,error:s})=>!t&&!s?null:e.jsxs("div",{className:"mt-1",children:[t&&e.jsxs("div",{className:"relative pt-1",children:[e.jsxs("div",{className:"flex gap-1 justify-between items-center mb-2",children:[e.jsx("div",{children:e.jsx("span",{className:"inline-block rounded-full bg-white px-2 py-1 text-[10px] font-semibold uppercase text-blue-600",children:"Uploading"})}),e.jsx("div",{className:"text-right",children:e.jsxs("span",{className:"inline-block text-xs font-semibold text-blue-600",children:[o,"%"]})})]}),e.jsx("div",{className:"flex overflow-hidden mb-1 h-2 text-xs bg-white rounded",children:e.jsx("div",{style:{width:`${o}%`},className:"flex flex-col justify-center text-center text-white whitespace-nowrap bg-blue-500 shadow-none transition-all duration-500 ease-in-out"})})]}),s&&e.jsx("div",{className:"mt-2 text-sm text-red-500",children:s.message||"An error occurred during upload."})]}),so=()=>{const[o,t]=d.useState(0),[s,r]=d.useState(null),[a,n]=d.useState(!1);return{uploadFiles:async c=>{n(!0),t(0),r(null);try{const l=await Jn(c,t);return n(!1),l}catch(l){throw r(l),n(!1),l}},progress:o,error:s,isUploading:a}};new qe;const pc=({setIsOpen:o,isDuplicate:t=!1,handleDuplicate:s,handleNewEightCount:r})=>e.jsx("div",{className:"custom-overflow fixed inset-0 z-[52] flex h-full w-full items-center justify-center overflow-y-auto px-4 py-8 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-md rounded border border-strokedark bg-boxdark p-4 sm:p-8 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-strokedark pb-4 dark:border-strokedark",children:[e.jsx("h3",{className:"text-2xl font-semibold text-white dark:text-white",children:"New 8 Count - Intro"}),e.jsx("button",{onClick:()=>o(!1),className:"text-white hover:text-white dark:text-gray-400 dark:hover:text-white",children:e.jsx(M,{icon:"close",className:"h-5 w-5"})})]}),!t&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h5",{className:"mb-6 text-center text-base font-medium text-white",children:"What count would you like your music to start on?"}),e.jsx("div",{className:"mb-8 grid grid-cols-8 gap-4",children:[1,2,3,4,5,6,7,8].map(a=>e.jsx("button",{className:"flex h-12 items-center justify-center rounded bg-primary text-xl font-medium text-white hover:bg-opacity-90",onClick:n=>{t?s(n):r(n)},children:a},a))})]})]})}),F=Qo({theme:{extend:{colors:{custom:"cornflowerblue"}}}});zo.registerHyphenationCallback(o=>[o]);class fc extends y.Component{shouldComponentUpdate(t,s){return t.currentData!==this.props.currentData}render(){var m,u,h;const{versions:t,teamDetails:s,submittedIdeas:r,viewModel:a,currentData:n,isGrayed:i}=this.props;console.log((m=a==null?void 0:a.company_info)==null?void 0:m.company_logo);const c=p=>n!=null&&n.uses_modified_system?typeof p=="string"&&p.startsWith("{{modified}}"):!1,l=p=>typeof p=="string"?p.replace("{{modified}}",""):p;return e.jsx(e.Fragment,{children:e.jsx(Uo,{children:e.jsx(Bo,{orientation:"portrait",size:"A2",style:{minWidth:"1050px",padding:"30px",width:"1050px"},children:e.jsxs(te,{style:F("mt-3 bg-white text-black md:m-0 w-full"),children:[e.jsxs(te,{style:F("mt-10 w-full min-w-full bg-black p-8 pb-2"),children:[e.jsx(te,{style:F("flex flex-row h-[250px] justify-center"),children:(u=a==null?void 0:a.company_info)!=null&&u.company_logo?e.jsx(Fo,{style:F("h-[200px] max-h-[200px] w-[500px] max-w-[500px] object-cover"),src:(h=a==null?void 0:a.company_info)==null?void 0:h.company_logo}):e.jsx(he,{style:F("text-center text-3xl font-bold"),children:"COMPANY LOGO"})}),e.jsx(he,{style:F("text-center text-xl font-bold text-white"),children:"EIGHT COUNT SHEETS"})]}),e.jsxs(te,{style:F("w-full"),children:[e.jsxs(te,{style:F("flex flex-row h-[45px] w-full items-start"),children:[e.jsx(te,{style:F("flex flex-row h-[45px] max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-r border-b-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" PROGRAM:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:a==null?void 0:a.program_name})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-full items-start"),children:[e.jsxs(te,{style:F("flex flex-row h-[45px] min-h-full w-[50%]"),children:[e.jsx(te,{style:F("flex h-[45px] flex-row max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-r border-b-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" CONTACT:"})}),e.jsx(he,{style:F("h-full pl-2 w-full border border-x-0 border-t-0 border-b-black pl-2 pb-1 pt-4"),children:a==null?void 0:a.program_owner_phone})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] min-h-full w-[50%]"),children:[e.jsx(te,{style:F("flex flex-row h-[45px] max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-l border-r border-b-gray-400 border-l-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" PHONE:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:a==null?void 0:a.program_owner_phone})]})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-full items-start"),children:[e.jsx(te,{style:F("flex h-[45px] flex-row max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-r border-b-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" EMAIL:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pl-2 pb-1 pt-4"),children:a==null?void 0:a.program_owner_email})]})]}),e.jsx(te,{style:F("flex justify-center items-center h-[50px] text-xl bg-black"),children:e.jsx(he,{style:F("text-center font-bold text-white"),children:"TEAM INFORMATION"})}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-full items-start"),children:[e.jsxs(te,{style:F("flex flex-row h-[45px] w-[50%]"),children:[e.jsx(te,{style:F("flex flex-row h-[45px] max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-r border-b-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" TEAM NAME:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:a==null?void 0:a.team_name})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-[50%]"),children:[e.jsx(te,{style:F("flex h-[45px] flex-row max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-l border-r border-b-gray-400 border-l-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" MASCOT:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:s==null?void 0:s.mascot})]})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-full items-start"),children:[e.jsxs(te,{style:F("flex flex-row h-[45px] w-[50%]"),children:[e.jsx(te,{style:F("flex h-[45px] flex-row max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-r border-b-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:e.jsx(he,{children:" DIVISION:"})}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:a==null?void 0:a.division})]}),e.jsxs(te,{style:F("flex flex-row h-[45px] w-[50%]"),children:[e.jsx(te,{style:F("flex flex-row h-[45px] max-h-[45px] w-[168px] min-w-[168px] max-w-[168px] items-end justify-end border-b border-l border-r border-b-gray-400 border-l-gray-400 border-r-gray-400 pb-1 pr-2 text-right text-lg font-bold text-black"),children:"COLORS:"}),e.jsx(he,{style:F("h-full w-full border border-x-0 border-t-0 border-b-black pb-1 pl-2 pt-4"),children:s==null?void 0:s.colors})]})]}),e.jsxs(te,{style:F("team-details-eightcount"),children:[e.jsx(te,{style:F("flex justify-center items-center h-[50px] text-xl bg-black"),children:e.jsx(he,{style:F("text-center font-bold text-white"),children:"TEAM DETAILS AND IDEAS"})}),e.jsxs(te,{style:F("team-details-eightcount flex w-full flex-col gap-6 p-4"),children:[e.jsxs(te,{style:F("flex flex-col gap-4"),children:[e.jsx(he,{children:"THEME:"}),e.jsx(te,{style:F("ml-1 mt-3 flex w-full gap-5 text-black"),children:e.jsx(he,{children:a==null?void 0:a.theme_of_the_routine})})]}),e.jsxs(te,{style:F("flex flex-col gap-4"),children:[e.jsx(he,{children:"NOTES:"}),e.jsx(te,{style:F("ml-1 mt-3 flex w-full gap-5 text-black"),children:e.jsx(he,{children:s==null?void 0:s.notes})})]}),e.jsxs(te,{style:F("flex flex-col gap-4"),children:[e.jsx(he,{className:"mb-3",children:"IDEAS"}),r.map((p,x)=>{var f;return e.jsxs(te,{style:F("ml-1 flex w-full gap-5 text-black"),children:[e.jsx(he,{children:(f=p==null?void 0:p.idea_value)==null?void 0:f.replace(/<br\s*\/?>/gi,`
`)}),e.jsx(te,{})]},x)})]})]})]}),e.jsx(te,{break:!0,style:F("eight-table w-full p-2"),children:e.jsxs(te,{style:F("eight-table-print w-full rounded-md border-0 border-none"),id:"-container",children:[e.jsxs(te,{style:{display:"flex",flexDirection:"row",width:"100%",backgroundColor:"black"},children:[e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-xs font-semibold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:" Section"})}),e.jsx(te,{style:F("w-[2.8%] border-0 py-7 text-center text-sm font-semibold uppercase tracking-wider text-white"),children:e.jsx(he,{children:" "})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"1"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"2"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"3"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"4"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"5"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"6"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"7"})}),e.jsx(te,{style:F("w-[10.8%] border-0 py-7 text-center text-base font-bold uppercase tracking-wider text-white"),children:e.jsx(he,{style:F("text-[18px] font-bold"),children:"8"})})]}),e.jsx(te,{style:F("rows-table-cont text-black w-full"),children:n&&(n==null?void 0:n.json_data)&&JSON.parse(n==null?void 0:n.json_data).map((p,x)=>{var g,w;const f=t.find(N=>(N==null?void 0:N.id)==(n==null?void 0:n.duplicate_id))||"";let v=!1;if(f){const N=f!=null&&f.json_data?JSON.parse(f.json_data):null,k=((g=N==null?void 0:N[x])==null?void 0:g[0])||"";v=(p==null?void 0:p[0])&&l(p[0])==l(k)}return e.jsxs(te,{break:x===19||x===38,style:F("flex flex-row w-full"),children:[e.jsx(te,{style:F("h-[80px] w-[10.8%] max-h-[80px] border border-black text-left text-base font-bold uppercase tracking-wider text-black"),children:e.jsx(te,{style:F("flex flex-col items-center justify-center gap-1 h-full"),children:e.jsx(he,{style:F([f&&!v&&((w=p[0])==null?void 0:w.length)>0?"text-red-700 bg-white":"text-black bg-white",f&&(n==null?void 0:n.uses_modified_system)&&!c(p[0])&&"text-red-700 bg-white","h-[78px] w-full overflow-hidden border-0 p-2 text-center sm:text-[14px]"].filter(Boolean).join(" ")),children:p[0].replace("{{modified}}","")})})},0),e.jsx(te,{style:F("w-[3.8%] flex-row items-center justify-center border text-white border-black bg-black py-3 text-center text-base font-bold uppercase tracking-wider"),children:e.jsxs(he,{style:F("text-[18px] font-bold"),children:[" ",x+1]})}),p.map((N,k)=>{var V,L,z;const j=t.find(q=>(q==null?void 0:q.id)==(n==null?void 0:n.duplicate_id))||"";let $=!1;if(j){const q=j!=null&&j.json_data?JSON.parse(j.json_data):null,H=((V=q==null?void 0:q[x])==null?void 0:V[k])||"";$=(N==null?void 0:N.length)>0&&l(N)===l(H)}return e.jsx(e.Fragment,{children:k!==0&&e.jsx(te,{style:F("h-[80px] w-[10.8%] max-h-[80px] border border-black text-left text-xs font-semibold tracking-wider text-black"),children:e.jsxs(te,{style:F("flex flex-col items-center justify-center gap-1 h-[78px]"),children:[e.jsx(te,{style:F(`flex flex-row w-full flex-wrap ${i(x,k)?"h-[54px]":"h-full"}`),children:e.jsx(he,{style:F([j&&!$&&((L=p[k])==null?void 0:L.length)>0?"text-red-700 bg-white":"bg-white text-black",i(x,k)?"h-[54px]":"h-full",j&&(n==null?void 0:n.uses_modified_system)&&!c(p[k])&&"text-red-700 bg-white","w-full flex flex-wrap border-0 p-2 text-center sm:text-[11px]"].filter(Boolean).join(" ")),children:p[k].replace("{{modified}}","")})}),i(x,k)?e.jsx(te,{style:F([j&&!$&&((z=p[k])==null?void 0:z.length)>0?"text-red-700 bg-white":"bg-white text-black",i(x,k)?"border-t border-t-black pt-1":"",j&&(n==null?void 0:n.uses_modified_system)&&!c(p[k])&&"text-red-700 bg-white","flex max-h-[24px] h-[24px] w-full items-center justify-center text-center"].filter(Boolean).join(" ")),children:i(x,k)?e.jsxs(he,{style:F(`${i(x,k)?"font-medium h-[24px] text-black":""}`),children:["End","",i(x,k)]}):null}):e.jsx(te,{})]})},k)})})]},x)})})]})})]})})})})}}const qr=d.memo(({cellData:o,rowIndex:t,colIndex:s,readonly:r,onFocus:a,onBlur:n,onKeyDown:i,handleInput:c,fontSizes:l,isGrayed:m,cleanDisplayValue:u,onTypingChange:h})=>{const p=d.useRef(0),[x,f]=d.useState(!1),v=d.useCallback(Xo.debounce((w,N,k)=>{f(!1),h(!1),n({target:{value:w}},N,k)},1e3),[n,h]);d.useEffect(()=>()=>{v.cancel()},[v]);const g=d.useCallback(w=>{const N=w.target.value;f(!0),h(!0),c(w),v(N,t,s)},[c,v,t,s,h]);return d.useEffect(()=>{p.current++,p.current>2&&console.warn(`Frequent re-renders for cell [${t},${s}]:`,p.current)}),e.jsx("textarea",{rows:2,wrap:"soft",readOnly:r,placeholder:m(t,s)?`End ${m(t,s)}`:null,maxLength:"51","data-row":t,"data-col":s,defaultValue:u(o),onFocus:()=>a(t,s),onInput:g,onKeyDown:w=>i(w,t,s,w.target.value.trim()),className:"d-none focus-within::border-2 block h-[76px] max-h-[76px] w-full resize-none content-center self-center overflow-hidden border-none bg-transparent p-[1px] text-center leading-[17px] text-white placeholder-gray-300 outline-2 outline-transparent focus-within:border-primary focus:outline-[#001fff]",type:"text",style:{fontSize:l[`${t}-${s}`]}})},(o,t)=>o.cellData===t.cellData&&o.readonly===t.readonly&&o.fontSizes[`${o.rowIndex}-${o.colIndex}`]===t.fontSizes[`${t.rowIndex}-${t.colIndex}`]),xc=d.memo(({style:o,rowData:t,rowIndex:s,handleAddRow:r,handleRemoveRow:a,handleContentEdit:n,handleInput:i,fontSizes:c,readonly:l,isGrayed:m,onFocus:u,onBlur:h,onKeyDown:p,onTypingChange:x})=>{const[f,v]=d.useState(!1),g=d.useRef(null),w=d.useRef(null),[N,k]=d.useState(null);d.useEffect(()=>{if(g.current&&w.current){const $=bs(g.current,w.current,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",options:{padding:8}}]});return k($),()=>$.destroy()}},[f]),d.useEffect(()=>{const $=V=>{f&&g.current&&!g.current.contains(V.target)&&w.current&&!w.current.contains(V.target)&&v(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[f]);const j=$=>typeof $=="string"?$.replace("{{modified}}",""):$;return e.jsxs("tr",{className:"group h-[80px] w-full",style:{...o,display:"table",width:"100%",tableLayout:"fixed"},children:[e.jsx("td",{className:"h-[80px] min-w-[10.6%] border-collapse border-[0.5px] border-stroke/50 bg-transparent text-left align-top text-xs font-semibold uppercase tracking-wider text-white focus:ring-0 focus-visible:outline-none",children:e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(qr,{cellData:t[0],rowIndex:s,colIndex:0,readonly:l,onFocus:u,onBlur:h,onKeyDown:p,handleInput:i,fontSizes:c,isGrayed:m,cleanDisplayValue:j,onTypingChange:x})})}),e.jsx("td",{className:"h-[80px] w-[2.8%] min-w-[2.8%] border-collapse border-[0.5px] border-stroke/50 bg-meta-4 text-center align-top text-xs font-semibold uppercase tracking-wider text-white",children:e.jsx("div",{className:"flex justify-center items-center h-full",children:s+1})}),t.slice(1).map(($,V)=>e.jsx("td",{className:"h-[80px] max-h-[80px] border-collapse border-[0.5px] border-stroke/50 text-left align-top text-xs font-semibold uppercase tracking-wider text-white focus:ring-0 focus-visible:outline-none lg:min-w-[10.6%]",children:e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(qr,{cellData:$,rowIndex:s,colIndex:V+1,readonly:l,onFocus:u,onBlur:h,onKeyDown:p,handleInput:i,fontSizes:c,isGrayed:m,cleanDisplayValue:j,onTypingChange:x})})},V+1)),e.jsx("td",{className:"h-[80px] w-[2.5%] border-collapse border-[0.5px] border-stroke/50 align-top",children:e.jsxs("div",{className:"relative flex h-[80px] items-center justify-center",children:[e.jsx("button",{ref:g,onClick:()=>v(!f),className:"inline-flex justify-center items-center w-8 h-8 text-white rounded-md border transition border-strokedark hover:border-primary hover:bg-primary/10",children:e.jsx(xs,{className:"w-4 h-4"})}),f&&e.jsx("div",{ref:w,className:"z-50 w-[120px] rounded-md border border-strokedark bg-boxdark shadow-lg",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:()=>{r(s),v(!1)},className:"flex gap-2 items-center px-4 py-2 w-full text-sm text-left text-white whitespace-nowrap hover:bg-primary/10",children:[e.jsx(Vr,{className:"min-h-4 min-w-4"}),"Add Row"]}),e.jsxs("button",{onClick:()=>{a(s),v(!1)},className:"flex gap-2 items-center px-4 py-2 w-full text-sm text-left text-red-500 whitespace-nowrap hover:bg-primary/10",children:[e.jsx(gs,{className:"min-h-4 min-w-4"}),"Delete Row"]})]})})]})})]})},(o,t)=>{const s=performance.now(),r=o.rowIndex===t.rowIndex&&JSON.stringify(o.rowData)===JSON.stringify(t.rowData)&&o.readonly===t.readonly&&JSON.stringify(o.fontSizes)===JSON.stringify(t.fontSizes),a=performance.now()-s;return a>5&&console.warn(`Slow memo comparison for Row-${o.rowIndex}:`,`${a.toFixed(2)}ms`),r}),gc=d.memo(({index:o,style:t,data:s})=>{const{rowData:r,handleAddRow:a,handleRemoveRow:n,handleContentEdit:i,handleInput:c,fontSizes:l,readonly:m,isGrayed:u,onFocus:h,onBlur:p,onKeyDown:x,onTypingChange:f}=s;return e.jsx(xc,{style:t,rowData:r[o],rowIndex:o,handleAddRow:a,handleRemoveRow:n,handleContentEdit:i,handleInput:c,fontSizes:l,readonly:m,isGrayed:u,onFocus:h,onBlur:p,onKeyDown:x,onTypingChange:f})}),bc=({fontSizes:o,currentData:t,handleContentEdit:s,handleAddRow:r,handleInput:a,handleRemoveRow:n,isGrayed:i,readonly:c,onTypingChange:l})=>{const[m,u]=y.useState(null),[h,p]=y.useState(null),x=y.useRef(null),[f,v]=y.useState(0),[g,w]=y.useState(0);y.useEffect(()=>{const L=()=>{if(x.current){const{width:q,height:H}=x.current.getBoundingClientRect();v(q||1e3),w(H||window.innerHeight-300)}};L();const z=new ResizeObserver(L);return x.current&&z.observe(x.current),window.addEventListener("resize",L),()=>{z.disconnect(),window.removeEventListener("resize",L)}},[]),y.useEffect(()=>{const L=z=>{if(m&&h!==null){const[q,H]=m.split("-");k(parseInt(q),parseInt(H),h)}};return window.addEventListener("beforeunload",L),()=>window.removeEventListener("beforeunload",L)},[m,h]);const N=y.useCallback((L,z)=>{u(`${L}-${z}`)},[]),k=y.useCallback((L,z,q)=>{h!==q&&(s(L,z,q),p(q))},[h,s]),j=y.useCallback((L,z,q,H)=>{L.key==="Enter"&&!L.shiftKey&&k(z,q,H)},[k]),$=y.useCallback((L,z,q)=>{const H=L.target.value;k(z,q,H),u(null),p(null)},[k]),V=t!=null&&t.json_data?JSON.parse(t.json_data):[];return e.jsx("div",{className:"grid-container eightcount-web",children:e.jsxs("div",{ref:x,className:"relative w-full",children:[e.jsx("div",{className:"sticky top-0 z-10",children:e.jsx("table",{className:"w-full border border-collapse table-fixed border-strokedark bg-meta-4",children:e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-[10.6%] border-[0.5px] border-stroke/50 py-3 text-center text-xs font-semibold uppercase tracking-wider text-white",children:"Section"}),e.jsx("th",{className:"w-[2.8%] border-[0.5px] border-stroke/50 py-3 text-center text-xs font-semibold uppercase tracking-wider text-white",children:"#"}),[1,2,3,4,5,6,7,8].map(L=>e.jsx("th",{className:"w-[10.6%] border-[0.5px] border-stroke/50 py-3 text-center text-xs font-semibold uppercase tracking-wider text-white",children:L},L)),e.jsx("th",{className:"w-[2.5%] border-[0.5px] border-stroke/50 py-3 text-center text-xs font-semibold uppercase tracking-wider text-white"})]})})})}),e.jsx("div",{className:"overflow-auto scrollbar-hide",style:{height:g||"calc(100vh - 300px)",maxHeight:"calc(100vh - 300px)"},children:e.jsx(Ko,{height:g||window.innerHeight-300,itemCount:V.length,itemSize:80,width:f||"100%",className:"scrollbar-hide",overscanCount:5,itemData:{rowData:V,handleAddRow:r,handleRemoveRow:n,handleContentEdit:s,handleInput:a,fontSizes:o,readonly:c,isGrayed:i,onFocus:N,onBlur:$,onKeyDown:j,onTypingChange:l},children:gc})})]})})},gr=({viewModel:o,surveyLink:t,submittedIdeas:s,edit_complete:r=!1,projectID:a=null,action:n=null,edit_ID:i=null,set_Edit_ID:c=null,edit_eight_count_id:l=null,numberOfEdited:m=null,setNumberOfEdited:u=null,triggerSave:h=null,reviseEdit:p=null})=>{var X,me,le,C;const[x,f]=y.useState(!0),v=d.useRef(null),{state:g}=d.useContext(Me),w=at(),[N,k]=y.useState(!1),j=a||(w==null?void 0:w.id),[$,V]=d.useState([]),{dispatch:L}=d.useContext(xe),[z,q]=d.useState(null),[H,Z]=d.useState(1),[U,I]=y.useState({}),[O,P]=y.useState(!1),[se,T]=y.useState(!1),ee=d.useRef(null),[ne,we]=d.useState([]),[S,re]=y.useState({json_data:null}),[Oe,Ae]=d.useState(""),[ce,ie]=d.useState({json_data:null}),[ue,be]=y.useState(!1),[Le,A]=y.useState(null),[ge,ve]=y.useState(!1),[ze,Ee]=y.useState(!0),ke=d.useRef(!1),Fe=d.useRef(0),G=d.useRef(0),Pe=d.useRef(null),ye=d.useRef(!1),je=d.useCallback(()=>{var _;if(!(S!=null&&S.json_data))return null;if(((_=Pe.current)==null?void 0:_.original)===S.json_data)return Pe.current.parsed;const b=JSON.parse(S.json_data);return Pe.current={original:S.json_data,parsed:b},b},[S==null?void 0:S.json_data]);d.useEffect(()=>{const b=performance.now(),_=b-Fe.current;G.current++,_<100&&console.warn("Rapid state updates detected:",{timeSinceLastUpdate:`${_.toFixed(2)}ms`,updateCount:G.current,currentData:!!(S!=null&&S.json_data)}),Fe.current=b},[S]);function Se(b,_){if(b.length!==_.length)return!1;for(let B=0;B<b.length;B++)if(b[B]!==_[B])return!1;return!0}y.useEffect(()=>{h&&Ve()},[h]);function Je(b=[],_=[]){const B=performance.now();let oe=0;const de=Math.min(b.length,_.length);for(let De=0;De<de;De++)Se(b[De],_[De])||oe++;b.length>_.length?oe+=b.length-_.length:_.length>b.length&&(oe+=_.length-b.length);const pe=performance.now()-B;return pe>20&&console.warn("Slow table comparison:",{duration:`${pe.toFixed(2)}ms`,tableALength:b.length,tableBLength:_.length,modifiedRows:oe}),oe}y.useEffect(()=>{(async function(){try{f(!0),await et(),Ee(!1),f(!1)}catch(b){console.error("Error loading data:",b),R(L,"Error loading data",4e3,"error"),Ee(!1),f(!1)}})()},[l]);const et=async(b=null)=>{var _,B,oe,de;try{const pe=await Rs(1,20,{project_id:parseInt(j)});if(!pe.error){we(pe.list);let De=p?(B=(_=pe.list)==null?void 0:_[0])==null?void 0:B.id:l!==null&&!isNaN(l)?parseInt(l):(de=(oe=pe.list)==null?void 0:oe[0])==null?void 0:de.id;Ae(De);const _e=pe.list.find(Xe=>Xe.id==De)||{json_data:null};b&&ie(_e),!(ce!=null&&ce.json_data)&&ie(_e),i!==null&&c(_e==null?void 0:_e.id),re(_e)}}catch(pe){throw console.error("getData error:",pe),pe}},Ve=async()=>{const b={project_id:j,json_data:S==null?void 0:S.json_data,is_paid:1,version:S==null?void 0:S.version,status:1};if(S!=null&&S.json_data)try{return await di({id:Oe},b)}catch(_){throw _}},[Ue,tt]=y.useState(!1);console.log(Ue),d.useEffect(()=>(v.current=setInterval(async()=>{if(S!=null&&S.json_data&&!Ue&&ye.current){ve(!0);try{(await Ve()).error||(ye.current=!1,A(new Date))}finally{ve(!1)}}},1e3),()=>{clearInterval(v.current)}),[S,Ue]);const it=(b,_,B)=>{const oe=performance.now(),de=je(),pe=JSON.parse((ce==null?void 0:ce.json_data)||"[]");de[b][_]=B.toString(),ye.current=!0;const De={...S,json_data:JSON.stringify(de)},_e=Je(de,pe);d.startTransition(()=>{re(De),m!==null&&u(_e)});const Xe=performance.now()-oe;console.log(`Total operation time including render: ${Xe.toFixed(2)}ms`)},Ie=b=>{const _=JSON.parse(S.json_data);_.splice(b,0,Array(9).fill("")),ye.current=!0;const B=Je(_,JSON.parse(ce.json_data));m&&u(B),re({...S,json_data:JSON.stringify(_)}),R(L,"New Row Added")},gt=b=>{const _=JSON.parse(S.json_data);_.splice(b,1),ye.current=!0;const B=Je(_,JSON.parse(ce==null?void 0:ce.json_data));m&&u(B),re({...S,json_data:JSON.stringify(_)}),R(L,"Row Removed")},ut=async(b,_=null)=>{var De;const B=parseInt(_||b.target.textContent),oe=Array.from({length:50},()=>Array(9).fill(""));oe[0][B]="MUSIC STARTS HERE",oe[0][0]="INTRO";const de=JSON.stringify(oe),pe={project_id:j,json_data:de,is_paid:1,version:ne.length>0?parseInt((De=ne[0])==null?void 0:De.version)+1:1,status:1,is_duplicate:0,uses_modified_system:1,duplicate_id:null,real_create_at:fe.utc().format("YYYY-MM-DD HH:mm:ss")};try{f(!0),We(!1),(await Cr(pe)).error||(await et("new-data"),R(L,"New 8 Count Added")),f(!1),We(!1),R(L,"New 8 Count Added")}catch(_e){We(!1),R(L,_e==null?void 0:_e.message,4e3,"error")}finally{f(!1)}},Ke=async b=>{var pe,De;const _=JSON.parse(b?((pe=ne.find(_e=>_e.id==b))==null?void 0:pe.json_data)||"[]":(S==null?void 0:S.json_data)||"[]");let B=null;S!=null&&S.duplicate_id?B=JSON.parse(S==null?void 0:S.json_data):B=_.map(_e=>_e.map(Xe=>Xe&&Xe.trim()!==""?`{{modified}}${Xe}`:Xe));const oe=JSON.stringify(B),de={project_id:j,json_data:oe,is_paid:1,version:ne.length>0?parseInt((De=ne[0])==null?void 0:De.version)+1:1,status:1,isDuplicate:1,uses_modified_system:1,duplicate_id:b||(S==null?void 0:S.id),real_create_at:fe.utc().format("YYYY-MM-DD HH:mm:ss")};try{k(!0),Y(!1),(await Cr(de)).error||(await et("new-data"),R(L,"New 8 Count Added through duplication")),k(!1),Y(!1),R(L,"New 8 Count Added through duplication")}catch(_e){Y(!1),R(L,_e==null?void 0:_e.message,4e3,"error")}finally{k(!1)}},$e=async()=>{var b,_;f(!0);try{await Bs(S==null?void 0:S.id);const B=await Rs(1,20,{project_id:j});if(W(!1),!B.error){const oe=(B==null?void 0:B.list.find(de=>{var pe;return de.id==((pe=B.list)==null?void 0:pe[0].id)}))||{json_data:null};re(oe),f(!1),we(B.list),Ae((_=(b=B.list)==null?void 0:b[0])==null?void 0:_.id)}f(!1)}catch(B){throw We(!1),R(L,"8 Count version deleted"),B}},[mt,We]=y.useState(!1),ht=(b,_)=>{const B=[28,32,35,41,46],oe=1;return B.includes(b)&&_===oe?{28:"1:30",32:"1:45",35:"2:00",41:"2:15",46:"2:30"}[b]:""},pt=async()=>{try{const b=await ia(j);b.error||V(b.model)}catch{}};d.useEffect(()=>{pt()},[]),d.useEffect(()=>{!ze&&!ke.current&&(async()=>{try{n==="Blank"?We(!0):n==="Previous"?ne.length===0?(R(L,"No previous Version to duplicate",7e3,"warning"),We(!0)):await Ke():p&&(ne.length===0?We(!0):await Ke(n))}catch(_){console.error("Error during initialization:",_),R(L,"Error during initialization",4e3,"error")}finally{ke.current=!0}})()},[ze,n,p]);function D(b){const _=b.target,B=_.value.length,oe=51,de=11,pe=9;let De=de-B/oe*(de-pe);De=Math.max(De,pe),_.style.setProperty("font-size",`${De}px`,"important")}const J=b=>{let de=11-b.length/51*2;return de=Math.max(de,9),`${de}px`};d.useEffect(()=>{const b={};S&&(S!=null&&S.json_data)&&JSON.parse(S==null?void 0:S.json_data).forEach((_,B)=>{_.forEach((oe,de)=>{const pe=`${B}-${de}`;b[pe]=J(oe)})}),I(b)},[S]);const[Q,W]=d.useState(!1),[E,Y]=d.useState(!1);function K(b,_){let B=new Date(o==null?void 0:o.routine_submission_date),oe=new Date(Date.UTC(B.getUTCFullYear(),B.getUTCMonth(),B.getUTCDate()+1));oe.setUTCHours(0,0,0,0);let de=oe.getTimezoneOffset()*6e4,pe=new Date(oe.getTime()+de);return new Date>pe}d.useEffect(()=>{var b;p?P(!1):(K(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(g==null?void 0:g.role)==="client"&&(!n||((b=n==null?void 0:n.toString())==null?void 0:b.length)<=0)||r)&&P(!0)},[o,p]);const ae=d.useRef(performance.now());return d.useEffect(()=>{var _;const b=performance.now()-ae.current;b>16&&console.warn("Slow render detected:",{renderTime:`${b.toFixed(2)}ms`,dataSize:((_=S==null?void 0:S.json_data)==null?void 0:_.length)||0}),ae.current=performance.now()}),d.useEffect(()=>{function b(_){ee.current&&!ee.current.contains(_.target)&&T(!1)}return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),e.jsxs(e.Fragment,{children:[mt&&e.jsx(pc,{handleDuplicate:Ke,versionNo:z,whereToBegin:H,setWhereToBegin:Z,setVersionNo:q,isOpen:mt,setIsOpen:We,handleNewEightCount:ut}),Q&&e.jsx(Ct,{confirmText:"Are you sure you want to delete this Eight Count Version?",setModalClose:W,setFormYes:()=>{$e()}}),E&&e.jsx(Ct,{confirmText:" Are you sure you want to Duplicate this version",setModalClose:Y,setFormYes:()=>{Ke()}}),e.jsx(e.Fragment,{children:!x&&!N?e.jsxs("div",{className:"rounded border border-strokedark bg-boxdark p-4",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("h2",{className:"whitespace-nowrap text-2xl font-semibold text-white",children:"8-Count"}),e.jsx(ys,{disabled:!!(n&&((X=n==null?void 0:n.toString())==null?void 0:X.length)>0&&(g==null?void 0:g.role)==="client"&&!p),className:"!w-[300px] rounded border border-form-strokedark bg-form-input p-2.5 text-sm text-white placeholder-stone-300 focus:border-primary focus:ring-primary",name:"engineer",id:"engineer",label:"Select Versions",value:Oe,defaultValue:(me=ne[ne.length-1])==null?void 0:me.id,onChange:async b=>{try{f(!0),Ae(b);const _=await Rs(1,20,{project_id:j});if(!_.error){we(_.list);const B=ne.find(oe=>oe.id==b)||{json_data:null};L({type:"SET_CURRENT_EIGHTCOUNT_ID",payload:b}),ie(B),re(B)}f(!1)}catch{f(!1)}finally{f(!1)}},children:ne.length>0&&ne.map(b=>e.jsx("option",{value:b.id,children:`Version ${b==null?void 0:b.version} - ${fe.utc(b==null?void 0:b.real_create_at).local().format("MM-DD-YYYY HH:mm:ss")}`},b))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[Le&&e.jsx("span",{className:"text-xs text-bodydark2",children:ge?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Be,{size:10,color:"white"}),"Auto-saving..."]}):`Last saved: ${fe(Le).format("h:mm:ss A")}`}),e.jsx("button",{className:`inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-white transition hover:bg-opacity-90 ${n&&((le=n==null?void 0:n.toString())==null?void 0:le.length)>0?"hidden":"flex"}`,onClick:()=>{var b;K(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(!n||((b=n==null?void 0:n.toString())==null?void 0:b.length)<=0)&&(g==null?void 0:g.role)==="client"&&!p?R(L,"Email the producer office to unlock the team details",7e3):We(!0)},children:"New 8-Count"}),S&&(S==null?void 0:S.create_at)!==void 0&&e.jsxs("div",{className:"relative",ref:ee,children:[e.jsx("button",{onClick:()=>T(!se),className:"inline-flex h-10 w-10 items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(xs,{className:"h-5 w-5"})}),se&&e.jsx("div",{className:"absolute right-0 z-50 mt-2 w-48 rounded-md border border-strokedark bg-boxdark shadow-lg",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:()=>{Ke(),T(!1)},className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-white hover:bg-primary/10",children:[e.jsx(Vr,{className:"h-4 w-4"}),"Duplicate"]}),e.jsxs("button",{onClick:()=>{be(!0),Ve().finally(()=>be(!1)),T(!1)},className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-white hover:bg-primary/10",children:[e.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"Save"]}),S&&(S==null?void 0:S.create_at)!==void 0&&o&&((C=Object.keys(o))==null?void 0:C.length)>0?e.jsx(Yo,{document:e.jsx(fc,{teamDetails:$,submittedIdeas:s,surveyLink:t,viewModel:o,versions:ne,currentData:S,handleContentEdit:it,handleAddRow:Ie,handleInput:D,handleRemoveRow:gt,isGrayed:ht}),fileName:`${(o==null?void 0:o.program_name)+"_"+(o==null?void 0:o.team_name)}_Version-${S==null?void 0:S.version}_${fe.utc(S==null?void 0:S.real_create_at).local().format("MM-DD-YYYY")}.pdf`,children:({loading:b})=>e.jsxs("button",{disabled:b,className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-white hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(Eo,{className:"h-4 w-4"}),b?"Building PDF...":"Render PDF"]})}):e.jsxs("button",{disabled:!0,className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-white opacity-50",children:[e.jsx(Po,{className:"h-4 w-4"}),"Rendering"]}),e.jsxs("button",{onClick:()=>{var b;if(K(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(!n||((b=n==null?void 0:n.toString())==null?void 0:b.length)<=0)&&(g==null?void 0:g.role)==="client"){R(L,"Email the producer office to unlock the team details",7e3);return}W(!0),T(!1)},className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-red-500 hover:bg-primary/10",children:[e.jsx(gs,{className:"h-4 w-4"}),"Delete"]})]})})]})]})]}),e.jsx("div",{className:` custom-overflow mt-7 rounded-md shadow ${ne.length==0?" h-[70px]":"overflow-x-auto border-[0.5px] border-stroke/50"}`,children:e.jsx(bc,{readonly:O,fontSizes:U,currentData:S,handleContentEdit:it,handleAddRow:Ie,handleInput:D,handleRemoveRow:gt,isGrayed:ht,onTypingChange:tt})})]}):e.jsxs("div",{className:"fixed inset-0 z-[100] flex h-screen w-full items-center justify-center bg-black/80 ",children:[" ",e.jsx(or,{})]})})]})};function Ot(){console.log("Creating progress box");const o=document.createElement("div");o.style.position="fixed",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",o.style.background="rgba(0, 0, 0, 0.8)",o.style.padding="15px",o.style.borderRadius="8px",o.style.color="white",o.style.zIndex="1000",o.style.minWidth="250px",o.style.maxHeight="250px",o.style.overflowY="auto",o.style.cursor="move",o.style.userSelect="none",o.style.fontSize="12px",o.classList.add("custom-overflow");const t=document.createElement("div");t.style.position="sticky",t.style.top="0",t.style.left="0",t.style.right="0",t.style.height="20px",t.style.cursor="move",t.style.background="rgba(0, 0, 0, 0.5)",t.style.borderTopLeftRadius="8px",t.style.borderTopRightRadius="8px",t.style.marginBottom="5px";const s=document.createElement("button");s.innerHTML="✕",s.style.position="absolute",s.style.right="8px",s.style.top="2px",s.style.background="none",s.style.border="none",s.style.color="white",s.style.cursor="pointer",s.style.fontSize="14px";const r=document.createElement("div");r.style.marginTop="5px",o.appendChild(t),t.appendChild(s),o.appendChild(r),document.body.appendChild(o);let a=!1,n,i,c,l,m=0,u=0;const h=f=>{f.type==="touchstart"?(c=f.touches[0].clientX-m,l=f.touches[0].clientY-u):(c=f.clientX-m,l=f.clientY-u),f.target===t&&(a=!0)},p=()=>{a=!1},x=f=>{a&&(f.preventDefault(),f.type==="touchmove"?(n=f.touches[0].clientX-c,i=f.touches[0].clientY-l):(n=f.clientX-c,i=f.clientY-l),m=n,u=i,o.style.transform=`translate(${n}px, ${i}px)`)};return t.addEventListener("mousedown",h),document.addEventListener("mousemove",x),document.addEventListener("mouseup",p),t.addEventListener("touchstart",h),document.addEventListener("touchmove",x),document.addEventListener("touchend",p),s.onclick=()=>{console.log("Hiding progress box"),o.style.display="none"},{updateDownloads:f=>{console.log("Updating downloads:",f);const v=Array.from(f.values()).filter(j=>j.type==="video"),g=Array.from(f.values()).filter(j=>j.type==="music"),w=Array.from(f.values()).filter(j=>j.type==="track"),N=Array.from(f.values()).filter(j=>j.type==="master"),k=Array.from(f.values()).filter(j=>j.type==="project");r.innerHTML=`
${v.length?`
<div style="margin-bottom: 10px;">
<div style="font-size: 11px; font-weight: bold; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px;">
Videos
</div>
${v.map(j=>Mt(j)).join("")}
</div>
`:""}
${g.length?`
<div style="margin-bottom: 10px;">
<div style="font-size: 11px; font-weight: bold; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px;">
Music
</div>
${g.map(j=>Mt(j)).join("")}
</div>
`:""}
${w.length?`
<div style="margin-bottom: 10px;">
<div style="font-size: 11px; font-weight: bold; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px;">
Tracks
</div>
${w.map(j=>Mt(j)).join("")}
</div>
`:""}
${N.length?`
<div style="margin-bottom: 10px;">
<div style="font-size: 11px; font-weight: bold; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px;">
Masters
</div>
${N.map(j=>Mt(j)).join("")}
</div>
`:""}
${k.length?`
<div style="margin-bottom: 10px;">
<div style="font-size: 11px; font-weight: bold; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px;">
Projects
</div>
${k.map(j=>Mt(j)).join("")}
</div>
`:""}
`},remove:()=>{o.remove(),window.downloadManager.progressBox=null},hide:()=>{console.log("Hiding progress box"),o.style.display="none"},show:()=>{console.log("Showing progress box"),document.body.contains(o)||(console.log("Re-adding to document"),document.body.appendChild(o)),o.style.display="block",this.updateDownloads(window.downloadManager.downloads)}}}function Mt(o){return`
<div style="margin-bottom: 8px; padding-bottom: 5px;">
<div style="margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
${o.fileName}
</div>
<div style="display: flex; align-items: center; gap: 5px;">
<div style="flex-grow: 1; background: rgba(255,255,255,0.1); height: 6px; border-radius: 3px;">
<div style="width: ${o.progress}%; height: 100%; background: ${o.status==="failed"?"#ff4444":o.status==="complete"?"#00C851":"#2196F3"}; border-radius: 3px;"></div>
</div>
<div style="min-width: 45px; font-size: 11px;">${o.status==="failed"?"Failed":o.status==="complete"?"Done":`${o.progress}%`}</div>
</div>
</div>
`}const wc=({setFileValues:o,fileValues:t,isUploading:s})=>{const[r,a]=y.useState(!1),n=u=>{u.preventDefault(),u.stopPropagation(),a(!0)},i=u=>{u.preventDefault(),u.stopPropagation(),a(!1)},c=u=>{u.preventDefault(),u.stopPropagation(),a(!0)},l=u=>{u.preventDefault(),u.stopPropagation(),a(!1);const h=[...u.dataTransfer.files];h.length>0&&o(h)},m=u=>{const h=[...u.target.files];h.length>0&&o(h)};return e.jsx("div",{className:"w-full",children:e.jsx("div",{className:`relative flex min-h-[200px] cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-form-strokedark bg-transparent p-6 transition-all ${r?"border-primary bg-primary/5":""}`,onDragEnter:n,onDragLeave:i,onDragOver:c,onDrop:l,children:t&&t.length>0?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3",children:[e.jsx(M,{icon:"fa-solid fa-video",className:"text-4xl text-primary"}),e.jsx("p",{className:"text-sm text-bodydark2",children:t[0].name}),e.jsx("button",{onClick:()=>o([]),className:"text-sm text-danger hover:text-danger/80",children:"Remove"})]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{icon:"fa-solid fa-cloud-arrow-up",className:"mb-3 text-4xl text-primary"}),e.jsx("p",{className:"mb-2 text-center text-sm text-white",children:"Drag file to this area to upload"}),e.jsx("p",{className:"mb-4 text-center text-xs text-bodydark2",children:"or"}),e.jsxs("label",{className:"inline-flex cursor-pointer items-center justify-center rounded-md bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx("input",{type:"file",className:"hidden",accept:"video/*",onChange:m,disabled:s}),"Select File"]}),e.jsx("p",{className:"mt-4 text-center text-xs text-bodydark2",children:"Maximum file size: 500MB"})]})})})},ro=({isOpen:o,projectIDVIDEO:t=null,setIsOpen:s,setVideoList:r,video_ids:a,setVideo_ids:n})=>{const i=at(),c=t||(i!=null&&i.project_id?i==null?void 0:i.project_id:i==null?void 0:i.id),[l,m]=d.useState(""),[u,h]=d.useState(!1),[p,x]=d.useState("");d.useState("");const[f,v]=d.useState([]),[g,w]=d.useState(!1),{uploadFiles:N,progress:k,error:j,isUploading:$}=so(),{dispatch:V}=d.useContext(xe),L=async H=>{var U;if(H.preventDefault(),!f||f.length===0){R(V,"No file selected",5e3,"error");return}if(!q(f))return;const Z=new FormData;for(const I of f)q(I)&&(I.name.slice(0,-4),Z.append("files",I));try{h(!0);const I=await N(Z);if(I||R(V,"Upload video before submission",5e3,"error"),I){const O={project_id:c,url:I==null?void 0:I.attachments,type:l,description:p,is_paid:1,is_music:0,status:1},P=await na(O),se=await Vt({page:1,limit:10,filter:{project_id:c}});if(!se.error){const T=se.list.filter(ne=>ne.is_music===0);let ee=(U=T==null?void 0:T[0])==null?void 0:U.id;a&&n([...a,ee]),r(T),h(!1),s(!1),R(V,"Video Uploaded",5e3)}h(!1),s(!1)}}catch(I){throw R(V,"Video Upload Failed",5e3,I),h(!1),I}};let z=500;const q=H=>H.size/1024/1024>z?(R(V,`File size exceeds ${z}MB. Please upload a smaller file.`,5e3,"error"),!1):!0;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(!1)}),e.jsxs("div",{className:"shadow-default w-full max-w-xl transform rounded border border-strokedark bg-boxdark transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-stroke px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{icon:"fa-solid fa-video",className:"text-xl text-primary"}),e.jsx("h3",{className:"text-xl font-medium text-white",children:"Add Video"})]}),e.jsx("button",{onClick:()=>s(!1),className:"hover:text-primary",children:e.jsx(M,{icon:"fa-solid fa-xmark",className:"text-2xl"})})]}),e.jsx("form",{onSubmit:L,className:"p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-col gap-2",children:e.jsx(wc,{isUploading:g,setFileValues:v,fileValues:f})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-bodydark2",children:"Type"}),e.jsx("div",{className:"flex h-11 items-center rounded border border-form-strokedark bg-form-input",children:e.jsxs("select",{value:l,required:!0,onChange:H=>m(H.target.value),className:"w-full cursor-pointer appearance-none rounded bg-transparent px-4 text-white outline-none",children:[e.jsx("option",{value:"",disabled:!0,className:"bg-boxdark",children:"Select a type..."}),e.jsx("option",{value:"Full Out",className:"bg-boxdark",children:"Full Out"}),e.jsx("option",{value:"Opening",className:"bg-boxdark",children:"Opening"}),e.jsx("option",{value:"Tumbling",className:"bg-boxdark",children:"Tumbling"}),e.jsx("option",{value:"Stunts",className:"bg-boxdark",children:"Stunts"}),e.jsx("option",{value:"Pyramid",className:"bg-boxdark",children:"Pyramid"}),e.jsx("option",{value:"Dance",className:"bg-boxdark",children:"Dance"}),e.jsx("option",{value:"Other",className:"bg-boxdark",children:"Other"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-bodydark2",children:"Description"}),e.jsx("div",{className:"flex h-11 items-center rounded border border-form-strokedark bg-form-input",children:e.jsx("input",{required:!0,value:p,onChange:H=>x(H.target.value),type:"text",className:"w-full rounded bg-transparent px-4 text-white outline-none placeholder:text-bodydark2",placeholder:"Walk through, full out, additional details..."})})]}),e.jsx(to,{progress:k,isUploading:$})]})}),e.jsx("div",{className:"border-t border-stroke px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>s(!1),className:"flex items-center justify-center rounded border border-strokedark bg-form-input px-6 py-2 text-sm font-medium text-bodydark1",children:"Close"}),e.jsx("button",{onClick:L,className:"flex items-center justify-center rounded bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",disabled:u,children:u?e.jsx(Be,{size:16,color:"white"}):"Upload Video"})]})})]})]})},yc=({setFileValues:o,fileValues:t,isUploading:s})=>{const[r,a]=y.useState(!1),n=u=>{u.preventDefault(),u.stopPropagation(),a(!0)},i=u=>{u.preventDefault(),u.stopPropagation(),a(!1)},c=u=>{u.preventDefault(),u.stopPropagation(),a(!0)},l=u=>{u.preventDefault(),u.stopPropagation(),a(!1);const h=[...u.dataTransfer.files];h.length>0&&o(h)},m=u=>{const h=[...u.target.files];h.length>0&&o(h)};return e.jsx("div",{className:"w-full",children:e.jsx("div",{className:`relative flex min-h-[200px] cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed border-form-strokedark bg-transparent p-6 transition-all ${r?"border-primary bg-primary/5":""}`,onDragEnter:n,onDragLeave:i,onDragOver:c,onDrop:l,children:t&&t.length>0?e.jsxs("div",{className:"flex w-full flex-col items-center gap-3",children:[e.jsx(M,{icon:"fa-solid fa-music",className:"text-4xl text-primary"}),e.jsx("p",{className:"text-sm text-bodydark2",children:t[0].name}),e.jsx("button",{onClick:()=>o([]),className:"text-sm text-danger hover:text-danger/80",children:"Remove"})]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{icon:"fa-solid fa-cloud-arrow-up",className:"mb-3 text-4xl text-primary"}),e.jsx("p",{className:"mb-2 text-center text-sm text-white",children:"Drag file to this area to upload"}),e.jsx("p",{className:"mb-4 text-center text-xs text-bodydark2",children:"or"}),e.jsxs("label",{className:"inline-flex cursor-pointer items-center justify-center rounded-md bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx("input",{type:"file",className:"hidden",accept:"audio/*",onChange:m,disabled:s}),"Select File"]}),e.jsx("p",{className:"mt-4 text-center text-xs text-bodydark2",children:"Maximum file size: 500MB"})]})})})},jc=({isOpen:o,setIsOpen:t,setMusicList:s,setMusic_ids:r,music_ids:a})=>{const n=at(),i=n!=null&&n.project_id?n==null?void 0:n.project_id:n==null?void 0:n.id,{dispatch:c}=d.useContext(xe),[l,m]=d.useState(""),[u,h]=d.useState(!1),[p,x]=d.useState(""),[f,v]=d.useState(!1),[g,w]=d.useState([]),{uploadFiles:N,progress:k,error:j,isUploading:$}=so();let V=500;const L=q=>q.size/1024/1024>V?(R(c,`File size exceeds ${V}MB. Please upload a smaller file.`,5e3,"error"),!1):!0,z=async q=>{var Z;if(q.preventDefault(),!g||g.length===0){R(c,"No file selected",5e3,"error");return}if(!L(g))return;const H=new FormData;for(const U of g)L(U)&&H.append("files",U);try{h(!0);const U=await N(H),I={project_id:i,url:U==null?void 0:U.attachments,type:l,description:p,is_paid:1,is_music:1,status:1};if(!(U!=null&&U.attachments)||U.attachments.length===0||U.attachments==="[]"||typeof U.attachments=="string"&&JSON.parse(U.attachments).length===0){R(c,"Upload track before submission",5e3,"error");return}else if(!I.url||I.url.length===0||typeof I.url=="string"&&JSON.parse(I.url).length===0){R(c,"Invalid attachment URL",5e3,"error"),h(!1);return}else{const O=await na(I);if(O.error){R(c,`Failed to add media: ${O.error}`,5e3,"error"),h(!1);return}const P=await Vt({page:1,limit:10,filter:{project_id:i}});if(!P.error){const se=P.list.filter(ee=>ee.is_music===1);let T=(Z=se==null?void 0:se[0])==null?void 0:Z.id;a&&r([...a,T]),s(se)}h(!1),t(!1)}}catch(U){h(!1),R(c,`An error occurred: ${U.message}`,5e3,"error")}};return e.jsxs("div",{className:"flex fixed inset-0 z-50 justify-center items-center",children:[e.jsx("div",{className:"fixed inset-0 backdrop-blur-sm bg-black/50",onClick:()=>t(!1)}),e.jsxs("div",{className:"w-full max-w-xl rounded border transition-all transform shadow-default border-strokedark bg-boxdark",children:[e.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-b border-stroke",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(M,{icon:"fa-solid fa-music",className:"text-xl text-primary"}),e.jsx("h3",{className:"text-xl font-medium text-white",children:"Add Music"})]}),e.jsx("button",{onClick:()=>t(!1),className:"hover:text-primary",children:e.jsx(M,{icon:"fa-solid fa-xmark",className:"text-2xl"})})]}),e.jsx("form",{onSubmit:z,className:"p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex flex-col gap-2",children:e.jsx(yc,{isUploading:f,setFileValues:w,fileValues:g})}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-bodydark2",children:"Type"}),e.jsx("div",{className:"flex items-center h-11 rounded border border-form-strokedark bg-form-input",children:e.jsxs("select",{value:l,required:!0,onChange:q=>m(q.target.value),className:"px-4 w-full text-white bg-transparent rounded appearance-none cursor-pointer outline-none",children:[e.jsx("option",{value:"",disabled:!0,className:"bg-boxdark",children:"Select a type..."}),e.jsx("option",{value:"Music",className:"bg-boxdark",children:"Music"}),e.jsx("option",{value:"Edit",className:"bg-boxdark",children:"Edit"}),e.jsx("option",{value:"Video with Music",className:"bg-boxdark",children:"Video with Music"}),e.jsx("option",{value:"Other",className:"bg-boxdark",children:"Other"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-bodydark2",children:"Description"}),e.jsx("div",{className:"flex items-center h-11 rounded border border-form-strokedark bg-form-input",children:e.jsx("input",{required:!0,value:p,onChange:q=>x(q.target.value),type:"text",className:"px-4 w-full text-white bg-transparent rounded outline-none placeholder:text-bodydark2",placeholder:"Add Description"})})]}),e.jsx(to,{progress:k,isUploading:$})]})}),e.jsx("div",{className:"px-6 py-4 border-t border-stroke",children:e.jsxs("div",{className:"flex gap-3 justify-end items-center",children:[e.jsx("button",{onClick:()=>t(!1),className:"flex justify-center items-center px-6 py-2 text-sm font-medium rounded border border-strokedark bg-form-input text-bodydark1",children:"Close"}),e.jsx("button",{onClick:z,className:"flex justify-center items-center px-6 py-2 text-sm font-medium text-white rounded bg-primary hover:bg-opacity-90",disabled:u,children:u?e.jsx(Be,{size:16,color:"white"}):"Upload"})]})})]})]})},vc=({music:o,getData:t,viewModel:s})=>{const{dispatch:r}=d.useContext(xe),[a,n]=d.useState(!1),[i,c]=d.useState(!1),l=d.useRef(null),m=d.useRef(null),[u,h]=d.useState(null);d.useEffect(()=>{if(l.current&&m.current){const f=bs(l.current,m.current,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",options:{padding:8}}]});return h(f),()=>f.destroy()}},[i]),d.useEffect(()=>{const f=v=>{i&&l.current&&!l.current.contains(v.target)&&m.current&&!m.current.contains(v.target)&&c(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[i]);const p=async()=>{await ds(o.id),n(!1),await t(),R(r,"Music Deleted",5e3)};function x(){const f=o!=null&&o.url?JSON.parse(o==null?void 0:o.url)[0]:"",v=`${s==null?void 0:s.program_name}_${s==null?void 0:s.team_name}_${o==null?void 0:o.type}_${fe.utc(o.update_at).local().format("MM-DD-YYYY")}.${f==null?void 0:f.split(".").pop()}`;window.downloadManager=window.downloadManager||{downloads:new Map,progressBox:null},window.downloadManager.progressBox||(window.downloadManager.progressBox=Ot());const g=Date.now();window.downloadManager.downloads.set(g,{fileName:v,progress:0,status:"starting",type:"music"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),fetch(f).then(w=>{const N=w.headers.get("content-length"),k=w.body.getReader();let j=0;return new ReadableStream({start($){function V(){k.read().then(({done:L,value:z})=>{if(L){$.close();return}j+=z.length;const q=j/N*100;window.downloadManager.downloads.set(g,{fileName:v,progress:Math.round(q),status:"downloading",type:"music"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),$.enqueue(z),V()})}V()}})}).then(w=>new Response(w)).then(w=>w.blob()).then(w=>{const N=window.URL.createObjectURL(w),k=document.createElement("a");k.href=N,k.download=v,document.body.appendChild(k),k.click(),document.body.removeChild(k),window.URL.revokeObjectURL(N),window.downloadManager.downloads.set(g,{fileName:v,progress:100,status:"complete",type:"music"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),setTimeout(()=>{window.downloadManager.downloads.delete(g),window.downloadManager.downloads.size===0?(window.downloadManager.progressBox.remove(),window.downloadManager.progressBox=null):window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)},2e3)}).catch(w=>{console.error("Error downloading file:",w),window.downloadManager.downloads.set(g,{fileName:v,progress:0,status:"failed",type:"music"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)})}return console.log(o.type),e.jsxs(e.Fragment,{children:[a?e.jsx(Ct,{confirmText:`Are you sure you want to delete this ${o==null?void 0:o.type}?`,setModalClose:n,setFormYes:()=>{p()}}):null,e.jsxs("tr",{className:"border-b border-b-strokedark",children:[e.jsx("td",{className:"whitespace-nowrap px-3 py-4",children:fe.utc(o.update_at).local().format("MM-DD-YYYY")}),e.jsx("td",{className:"px-3 py-4",children:o==null?void 0:o.type}),e.jsx("td",{style:{wordBreak:"break-word"},className:"px-3 py-4",children:o==null?void 0:o.description}),e.jsx("td",{className:"px-3 py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:x,className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(rr,{className:"h-4 w-4"})}),e.jsx("button",{ref:l,onClick:()=>c(!i),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(xs,{className:"h-4 w-4"})}),i&&e.jsx("div",{ref:m,className:"z-50 w-20 rounded-md border border-strokedark bg-boxdark shadow-lg",children:e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>{n(!0),c(!1)},className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-red-500 hover:bg-primary/10",children:e.jsx(gs,{className:"h-4 w-4"})})})})]})})]})]})},ao=({viewModel:o,hasDownloads:t,music_ids:s=null,setMusic_ids:r=null,projectID:a=null,edit_complete:n=!1})=>{const{dispatch:i,state:c}=d.useContext(Me),l=at(),m=a||(l==null?void 0:l.id),{dispatch:u}=d.useContext(xe),[h,p]=d.useState([]),[x,f]=d.useState(!1),[v,g]=d.useState(0),[w,N]=d.useState(0),[k,j]=d.useState(0),[$,V]=d.useState(!1),[L,z]=d.useState(!1);d.useState(!1);const[q,H]=d.useState(!0),Z=()=>{var O,P;console.log("Current download manager:",window.downloadManager),console.log("Downloads size:",(O=window.downloadManager)==null?void 0:O.downloads.size),console.log("Progress box:",(P=window.downloadManager)==null?void 0:P.progressBox),window.downloadManager&&(window.downloadManager.progressBox||(console.log("Creating new progress box"),window.downloadManager.progressBox=Ot()),console.log("Showing progress box"),window.downloadManager.progressBox.show(),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads))},U=async(O,P)=>{const se=await Vt({page:O,limit:P,filter:{project_id:m}});if(!se.error){const{list:T,total:ee,limit:ne,num_pages:we,page:S}=se,re=T.filter(Oe=>Oe.is_music===1);g(we),j(S),N(ee),V(S>1),z(S+1<=we),p(re)}H(!1)};d.useEffect(()=>{U(1,2e3)},[]);function I(O,P){console.log(o);let se=new Date(o==null?void 0:o.routine_submission_date),T=new Date(Date.UTC(se.getUTCFullYear(),se.getUTCMonth(),se.getUTCDate()+1));T.setUTCHours(0,0,0,0);let ee=T.getTimezoneOffset()*6e4,ne=new Date(T.getTime()+ee),we=new Date;return console.log("Next Day (Local):",ne),console.log("Current Local Time:",we),we>ne}return e.jsxs("div",{className:"mt-8 bg-boxdark",children:[e.jsxs("div",{className:"shadow-default rounded-sm bg-boxdark dark:bg-boxdark",children:[e.jsx("div",{className:"border-b border-strokedark px-4 py-4 2xl:px-9 dark:border-strokedark",children:e.jsxs("div",{className:"flex w-full items-start justify-between",children:[e.jsx("div",{className:"flex items-start",children:e.jsxs("div",{children:[e.jsx("h3",{className:"mb-1 text-lg font-bold text-white",children:"License and Music"}),e.jsx("div",{className:"mt-[4px]",children:e.jsx("span",{className:"text-sm font-medium text-white dark:text-white",children:"Download Mixes and Documents"})})]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[t&&e.jsx("button",{onClick:Z,className:"inline-flex items-center justify-center text-primary hover:text-primary/80",children:e.jsx(M,{icon:"download",className:"h-5 w-5"})}),((c==null?void 0:c.role)==="member"||(c==null?void 0:c.role)==="manager"||(c==null?void 0:c.role)==="admin")&&e.jsx("button",{className:`inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90 ${n&&"opacity-50"} ${I(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(c==null?void 0:c.role)==="client"&&!a&&"opacity-50"}`,onClick:()=>{if(I(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(c==null?void 0:c.role)==="client"&&!a)R(u,"Email the producer office to unlock the team details",7e3);else{if(n)return;f(!0)}},children:"Upload"})]})]})}),e.jsx("div",{className:"p-4 md:p-6 2xl:p-10",children:e.jsx("div",{className:"custom-overflow max-h-[380px] overflow-y-auto",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"bg-meta-4",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1 2xl:pl-9",children:"Date"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Description"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-strokedark text-white",children:q?e.jsx("tr",{children:e.jsx("td",{colSpan:"5",className:"text-center",children:e.jsxs("div",{className:"flex items-center justify-start gap-3 px-8 py-6 text-center",children:[e.jsx(Be,{size:20,color:"white"}),e.jsx("span",{className:"animate-pulse text-xl font-semibold text-white ease-out",children:"Loading Music..."})]})})}):h.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"5",children:e.jsx("div",{className:"p-4 text-center text-white",children:"No Music/License found!"})})}):h.map((O,P)=>e.jsx(vc,{music:O,viewModel:o,getData:U},P))})]})})})]}),x&&e.jsx(jc,{setMusicList:p,setIsOpen:f,isOpen:x,music_ids:s,setMusic_ids:r})]})},Nc=({fileSource:o,setModalClose:t})=>e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),e.jsxs("div",{className:"shadow-default w-full max-w-md transform rounded border border-strokedark bg-boxdark transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-stroke px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{icon:"fa-solid fa-video",className:"text-xl text-primary"}),e.jsx("h3",{className:"text-xl font-medium text-white",children:"Video Player"})]}),e.jsx("button",{onClick:()=>t(!1),className:"hover:text-primary",children:e.jsx(M,{icon:"fa-solid fa-xmark",className:"text-2xl"})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"relative aspect-video w-full overflow-hidden rounded border border-stroke bg-boxdark-2",children:e.jsxs("video",{controls:!0,className:"h-full w-full",controlsList:"nodownload",children:[e.jsx("source",{src:o,type:"video/mp4"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[e.jsx("div",{className:"mb-3 rounded-full bg-boxdark p-3",children:e.jsx(M,{icon:"fa-solid fa-circle-exclamation",className:"h-6 w-6 text-bodydark2"})}),e.jsx("p",{className:"text-sm text-bodydark2",children:"Your browser does not support the video player"})]})]})})}),e.jsx("div",{className:"border-t border-stroke px-6 py-4",children:e.jsx("button",{onClick:()=>t(!1),className:"flex w-full items-center justify-center rounded-sm bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:"Close"})})]})]}),oo=({video:o,getData:t,viewModel:s})=>{const{dispatch:r}=d.useContext(xe),[a,n]=d.useState(!1),[i,c]=y.useState(!1),[l,m]=d.useState(!1),u=d.useRef(null),h=d.useRef(null),[p,x]=d.useState(null);d.useEffect(()=>{if(u.current&&h.current){const w=bs(u.current,h.current,{placement:"bottom-end",modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",options:{padding:8}}]});return x(w),()=>w.destroy()}},[l]),d.useEffect(()=>{const w=N=>{l&&u.current&&!u.current.contains(N.target)&&h.current&&!h.current.contains(N.target)&&m(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[l]);const f=async()=>{await ds(o.id),c(!1),await t(),R(r,"Video Deleted",5e3)},v=o!=null&&o.url?JSON.parse(o==null?void 0:o.url):" ";console.log(v);function g(){const w=o!=null&&o.url?JSON.parse(o==null?void 0:o.url)[0]:"",N=`${s==null?void 0:s.program_name}_${s==null?void 0:s.team_name}_${o==null?void 0:o.type}_${fe.utc(o.update_at).local().format("MM-DD-YYYY")}.${w==null?void 0:w.split(".").pop()}`;window.downloadManager=window.downloadManager||{downloads:new Map,progressBox:null},window.downloadManager.progressBox||(window.downloadManager.progressBox=Ot());const k=Date.now();window.downloadManager.downloads.set(k,{fileName:N,progress:0,status:"starting",type:"video"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),fetch(w).then(j=>{const $=j.headers.get("content-length"),V=j.body.getReader();let L=0;return new ReadableStream({start(z){function q(){V.read().then(({done:H,value:Z})=>{if(H){z.close();return}L+=Z.length;const U=L/$*100;window.downloadManager.downloads.set(k,{fileName:N,progress:Math.round(U),status:"downloading",type:"video"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),z.enqueue(Z),q()})}q()}})}).then(j=>new Response(j)).then(j=>j.blob()).then(j=>{const $=window.URL.createObjectURL(j),V=document.createElement("a");V.href=$,V.download=N,document.body.appendChild(V),V.click(),document.body.removeChild(V),window.URL.revokeObjectURL($),window.downloadManager.downloads.set(k,{fileName:N,progress:100,status:"complete",type:"video"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),setTimeout(()=>{window.downloadManager.downloads.delete(k),window.downloadManager.downloads.size===0?(window.downloadManager.progressBox.remove(),window.downloadManager.progressBox=null):window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)},2e3)}).catch(j=>{console.error("Error downloading file:",j),window.downloadManager.downloads.set(k,{fileName:N,progress:0,status:"failed",type:"video"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)})}return console.log(o.type),e.jsxs(e.Fragment,{children:[i&&e.jsx(Ct,{confirmText:`Are you sure you want to delete ${o!=null&&o.type?o==null?void 0:o.type:"video"}`,setModalClose:()=>c(!1),setFormYes:f}),a&&e.jsx(Nc,{fileSource:v[0],setModalClose:n}),e.jsxs("tr",{className:"h border-b border-strokedark text-bodydark1",children:[e.jsx("td",{className:"whitespace-nowrap px-4 py-4 text-white xl:pl-6 2xl:pl-9",children:fe.utc(o.update_at).local().format("MM-DD-YYYY")}),e.jsx("td",{className:"px-4 py-4",children:o==null?void 0:o.type}),e.jsx("td",{className:"px-4 py-4",children:o==null?void 0:o.description}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>n(!0),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(ar,{className:"h-4 w-4"})}),e.jsx("button",{onClick:g,className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(rr,{className:"h-4 w-4"})}),e.jsx("button",{ref:u,onClick:()=>m(!l),className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-strokedark text-white transition hover:border-primary hover:bg-primary/10",children:e.jsx(xs,{className:"h-4 w-4"})}),l&&e.jsx("div",{ref:h,className:"z-50 w-20 rounded-md border border-strokedark bg-boxdark shadow-lg",children:e.jsx("div",{className:"py-1",children:e.jsx("button",{onClick:()=>{c(!0),m(!1)},className:"flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-red-500 hover:bg-primary/10",children:e.jsx(gs,{className:"h-4 w-4"})})})})]})})]})]})},kc=({viewModel:o})=>{var O;const t=at(),{dispatch:s,state:r}=d.useContext(Me),[a,n]=d.useState(!1),{dispatch:i}=d.useContext(xe),[c,l]=d.useState([]),[m,u]=y.useState(!0),[h,p]=d.useState(0),[x,f]=d.useState(0),[v,g]=d.useState(0),[w,N]=d.useState(!1),[k,j]=d.useState(!1),[$,V]=d.useState(!1),[L,z]=d.useState(!1),[q,H]=d.useState(!1);console.log(L,q);const Z=async(P,se)=>{const T=await Vt({page:P,limit:se,filter:{project_id:t.id}});if(!T.error){const{list:ee,total:ne,limit:we,num_pages:S,page:re}=T,Oe=ee.filter(Ae=>Ae.is_music===0);l(Oe),p(S),g(re),f(ne),N(re>1),j(re+1<=S)}u(!1)};d.useEffect(()=>{Z(1,2e3)},[]),console.log((O=window.downloadManager)==null?void 0:O.downloads),d.useEffect(()=>{const P=setInterval(()=>{var se;if((se=window.downloadManager)!=null&&se.downloads){const T=Array.from(window.downloadManager.downloads.values()).some(ne=>ne.type==="video"),ee=Array.from(window.downloadManager.downloads.values()).some(ne=>ne.type==="music");z(T),H(ee)}},1e3);return()=>clearInterval(P)},[]);const U=()=>{var P,se;console.log("Current download manager:",window.downloadManager),console.log("Downloads size:",(P=window.downloadManager)==null?void 0:P.downloads.size),console.log("Progress box:",(se=window.downloadManager)==null?void 0:se.progressBox),window.downloadManager&&(window.downloadManager.progressBox||(console.log("Creating new progress box"),window.downloadManager.progressBox=Ot()),console.log("Showing progress box"),window.downloadManager.progressBox.show(),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads))};function I(P,se){let T=new Date(o==null?void 0:o.routine_submission_date),ee=new Date(Date.UTC(T.getUTCFullYear(),T.getUTCMonth(),T.getUTCDate()+1));ee.setUTCHours(0,0,0,0);let ne=ee.getTimezoneOffset()*6e4,we=new Date(ee.getTime()+ne),S=new Date;return console.log("Next Day (Local):",we),console.log("Current Local Time:",S),S>we}return e.jsxs("div",{className:"max-w-screen h-full p-4 md:p-4 lg:p-0",children:[a&&e.jsx(ro,{setVideoList:l,setIsOpen:n,isOpen:a,ffmpegLoad:$,setFfmpegLoad:V}),e.jsxs("div",{className:"border-strokedark bg-boxdark",children:[e.jsxs("div",{className:"shadow-default rounded border border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"border-b border-strokedark px-4 py-4 2xl:px-9 dark:border-strokedark",children:e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("h4",{className:"text-lg font-semibold text-white dark:text-white",children:"Videos"})}),e.jsxs("div",{className:"flex items-center gap-3",children:[L&&e.jsx("button",{onClick:U,className:"inline-flex items-center justify-center text-primary hover:text-primary/80",children:e.jsx(M,{icon:"download",className:"h-5 w-5"})}),e.jsx("button",{className:`inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90 ${I(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(r==null?void 0:r.role)==="client"&&"opacity-50"}`,onClick:P=>{I(new Date,new Date(o==null?void 0:o.routine_submission_date))&&(r==null?void 0:r.role)==="client"?R(i,"Email the producer office to unlock the team details",7e3):n(!0)},children:"Upload"})]})]})}),e.jsx("div",{className:"p-4 md:p-6 2xl:p-10",children:e.jsx("div",{className:"max-h-[380px] overflow-y-auto",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"bg-meta-4",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1 2xl:pl-9",children:"Date"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Description"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Actions"})]})}),e.jsx("tbody",{className:"text-white",children:m?e.jsx("tr",{children:e.jsx("td",{colSpan:"6",className:"text-center",children:e.jsxs("div",{className:"flex items-center justify-start gap-3 px-8 py-6 text-center",children:[e.jsx(Be,{size:20,color:"white"}),e.jsx("span",{className:"animate-pulse text-xl font-semibold text-white ease-out",children:"Loading Videos..."})]})})}):c.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"6",children:e.jsx("div",{className:"p-4 text-center text-white",children:"No videos found!"})})}):c.map(P=>e.jsx(oo,{video:P,viewModel:o,getData:Z},P.id))})]})})})]}),e.jsx(ao,{viewModel:o,hasDownloads:q})]})]})},Sc=o=>{var f,v;const{isOpen:t,setIsOpen:s,data:r,setData:a,getData:n}=o,i=at(),[c,l]=y.useState(!1),{dispatch:m}=d.useContext(xe),[u,h]=d.useState({notes:(r==null?void 0:r.notes)||"",song_list:(r==null?void 0:r.song_list)||"",colors:(r==null?void 0:r.colors)||"",mascot:(r==null?void 0:r.mascot)||"",twitter:r&&r.social_media&&((f=JSON.parse(r.social_media))==null?void 0:f.twitter)||"",instagram:r&&r.social_media&&((v=JSON.parse(r.social_media))==null?void 0:v.instagram)||""}),p=g=>{const{name:w,value:N}=g.target;h(k=>({...k,[w]:N}))},x=async g=>{g.preventDefault();try{l(!0);const{data:w}=await ui({project_id:i.id,social_media:JSON.stringify({instagram:u.instagram,twitter:u.twitter}),song_list:u.song_list,...u});await n(),l(!1),R(m,"Music Updated"),s(!1)}catch{s(!1),l(!1),R(m,"Music Update Failed","error")}};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:[e.jsx("div",{className:"fixed inset-0 h-full w-full bg-black opacity-40",onClick:()=>s(!1)}),e.jsx("div",{className:"flex min-h-screen items-center px-4 py-8",children:e.jsx("div",{className:"relative mx-auto w-full max-w-lg rounded-md bg-white p-4 shadow-lg",children:e.jsxs("form",{className:"mt-3 flex flex-col",onSubmit:x,children:[e.jsxs("div",{className:"flex w-full justify-between",children:[e.jsx("h3",{className:"text-xl font-bold text-black",children:"Edit Team Details"}),e.jsx(M,{icon:"close",className:"h-6 w-6 cursor-pointer text-gray-600",onClick:()=>s(!1)})]}),e.jsxs("div",{className:"mt-7 flex h-[100px] w-full items-center rounded border-2 border-gray-200",children:[e.jsx("div",{className:"flex h-full items-center justify-center bg-gray-400 px-3",children:"Notes"}),e.jsx("textarea",{type:"text",name:"notes",value:u==null?void 0:u.notes,onChange:p,className:"block h-[100px] max-h-[100px] w-full resize-none border-transparent bg-transparent py-2 pl-3 text-black outline-none focus:ring-0 focus-visible:outline-transparent",placeholder:"Full routine.Dance Section"})]}),e.jsxs("div",{className:"mt-5 flex h-[45px] w-full items-center rounded border-2 border-gray-200",children:[e.jsx("div",{className:"flex h-full items-center justify-center bg-gray-400 px-3",children:"Mascot"}),e.jsx("input",{type:"text",onChange:p,name:"mascot",value:u==null?void 0:u.mascot,className:"block w-full border-transparent bg-transparent py-2 pl-3 text-black outline-none focus:ring-0 focus-visible:outline-transparent"})]}),e.jsxs("div",{className:"mt-5 flex h-[45px] w-full items-center rounded border-2 border-gray-200",children:[e.jsx("div",{className:"flex h-full items-center justify-center bg-gray-400 px-3",children:"Twitter"}),e.jsx("input",{type:"url",name:"twitter",placeholder:"Twitter Profile Link",value:u==null?void 0:u.twitter,onChange:p,className:"block w-full border-transparent bg-transparent py-2 pl-3 text-black outline-none focus:ring-0 focus-visible:outline-transparent"})]}),e.jsxs("div",{className:"mt-5 flex h-[45px] w-full items-center rounded border-2 border-gray-200",children:[e.jsx("div",{className:"flex h-full items-center justify-center bg-gray-400 px-3",children:"Instagram"}),e.jsx("input",{type:"url",placeholder:"Instagram Profile Link",onChange:p,name:"instagram",value:u==null?void 0:u.instagram,className:"block w-full border-transparent bg-transparent py-2 pl-3 text-black outline-none focus:ring-0 focus-visible:outline-transparent"})]}),e.jsxs("div",{className:"mt-8 flex w-full items-center justify-end gap-5",children:[e.jsx("button",{className:" w-[71px] rounded bg-blue-600 px-2 py-1 text-sm font-semibold text-white hover:bg-blue-700 lg:px-3 lg:py-2",children:c?e.jsx(Be,{size:12,color:"white"}):e.jsx("span",{children:"Submit"})}),e.jsx("button",{className:"w-fit rounded bg-gray-500 px-2 py-1 text-sm font-semibold text-white hover:bg-gray-400 lg:px-3 lg:py-2",onClick:()=>s(!1),children:"Close"})]})]})})})]})})},_c=o=>{var f,v,g,w,N,k,j;const{viewModel:t}=o,s=at(),{state:r}=d.useContext(Me),[a,n]=d.useState(!1),[i,c]=d.useState({notes:"",song_list:"",colors:"",mascot:"",social_media:""}),[l,m]=d.useState(!1),{dispatch:u}=d.useContext(xe),h=async()=>{n(!0);try{const $=await ia(s.id);n(!1),$!=null&&$.model&&c($.model)}catch($){n(!1),R(u,$.message,5e3,"error")}};d.useEffect(()=>{h()},[]);function p($,V){let L=new Date(t==null?void 0:t.routine_submission_date),z=new Date(Date.UTC(L.getUTCFullYear(),L.getUTCMonth(),L.getUTCDate()+1));z.setUTCHours(0,0,0,0);let q=z.getTimezoneOffset()*6e4,H=new Date(z.getTime()+q),Z=new Date;return console.log("Next Day (Local):",H),console.log("Current Local Time:",Z),Z>H}const x=new Date().getTimezoneOffset();return console.log("Current Timezone Offset (in minutes):",x),console.log((f=i==null?void 0:i.notes)==null?void 0:f.replace("<br>")),e.jsxs(e.Fragment,{children:[l&&e.jsx(Sc,{setData:c,data:i,getData:h,setIsOpen:m,isOpen:l}),e.jsxs("div",{className:"mb-4 w-full",children:[e.jsx("button",{className:"focus:ring-00 flex h-[40px] w-[100px] items-center justify-center rounded bg-primary p-3 px-5 text-xl font-medium text-white focus-visible:outline-none sm:h-[56px] sm:w-[140px]",onClick:()=>{p(new Date,new Date(t==null?void 0:t.routine_submission_date))&&(r==null?void 0:r.role)==="client"?R(u,"Email the producer office to unlock the team details",7e3):m(!0)},children:"Edit"}),e.jsx("br",{}),a?e.jsxs("div",{className:"fixed inset-0 z-[100] flex h-screen w-full items-center justify-center bg-black/80 ",children:[" ",e.jsx(or,{})]}):e.jsxs("div",{className:"mt-10 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"text-lg font-bold",children:"Notes:"}),e.jsx("p",{dangerouslySetInnerHTML:{__html:(v=i==null?void 0:i.notes)==null?void 0:v.replace(/\n/g,"<br> ")}})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("span",{className:"whitespace-nowrap text-lg font-bold",children:"Song List:"}),e.jsx("p",{dangerouslySetInnerHTML:{__html:(g=i==null?void 0:i.song_list)==null?void 0:g.replace(/\n/g,"<br> ")}})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-lg font-bold",children:"Colors:"}),e.jsx("div",{children:i==null?void 0:i.colors})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-lg font-bold",children:"Mascot:"}),e.jsx("div",{children:i==null?void 0:i.mascot})]}),e.jsxs("div",{className:"",children:[e.jsx("span",{className:"mb-2 text-lg font-bold",children:"Social Media:"}),e.jsxs("div",{className:"ml-6",children:[e.jsxs("div",{className:" flex items-start gap-[4px] ",children:[e.jsx("span",{className:"text-lg font-bold",children:"Twitter:"}),e.jsx("div",{children:i.social_media?e.jsx("a",{target:"_blank",rel:"noreferrer",className:"whitespace-break-spaces break-all text-blue-600 underline",href:((w=JSON.parse(i.social_media))==null?void 0:w.twitter)||"",children:((N=JSON.parse(i.social_media))==null?void 0:N.twitter)||""}):""})]}),e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx("span",{className:"text-lg font-bold",children:"Instagram:"}),e.jsx("div",{children:i.social_media?e.jsx("a",{target:"_blank",rel:"noreferrer",className:"break-all text-blue-600 underline",href:((k=JSON.parse(i.social_media))==null?void 0:k.instagram)||"",children:((j=JSON.parse(i.social_media))==null?void 0:j.instagram)||""}):""})]})]})]})]})]})]})};function Cc({title:o,titleId:t,...s},r){return y.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},s),o?y.createElement("title",{id:t},o):null,y.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const Ec=y.forwardRef(Cc),Pc=Ec,os=150,zs="https://equalityrecords.com/",Ic=({setShowResendSurveyModal:o,survey_id:t})=>{const s=at();let r=new qe;const{dispatch:a,state:n}=d.useContext(Me),{dispatch:i}=d.useContext(xe),[c,l]=d.useState(!1),[m,u]=d.useState(!1),[h,p]=d.useState(null),[x,f]=d.useState([]),[v,g]=d.useState(""),[w,N]=d.useState(""),[k,j]=d.useState(""),[$,V]=d.useState([{id:1,value:""},{id:2,value:""},{id:3,value:""},{id:4,value:""},{id:5,value:""}]),[L,z]=d.useState(""),[q,H]=d.useState(""),[Z,U]=d.useState(os),I=Pt().shape({idea_1:Re().required("Idea 1 is required"),idea_2:Re().required("Idea 2 is required"),idea_3:Re().required("Idea 3 is required"),idea_4:Re().required("Idea 4 is required"),idea_5:Re().required("Idea 5 is required"),songlist:Re().required("Songlist is required"),color:Re().required("Color is required"),theme_of_the_routine:Re().required("Theme of the Routine is required").max(os,"Theme of the Routine should not be more than THEME_OF_THE_ROUTINE_MAX_CHAR characters")}),{register:O,handleSubmit:P,setError:se,setValue:T,formState:{errors:ee}}=Et({resolver:Dt(I)}),ne=()=>{const ie={id:$.length+1,value:"",dbId:null};V([...$,ie])},we=async ie=>{try{let ue=Object.keys(ie).filter(ke=>ke.includes("idea_")).length;if(ue<5){R(i,"Please add minimum 5 ideas",5e3,"error");return}let be=[];for(let ke=1;ke<=ue;ke++)be.push({id:ke,value:ie[`idea_${ke}`]});be.forEach(ke=>{const Fe=x.find(G=>parseInt(G.idea_key.substring(5))===ke.id);Fe?ke.dbId=Fe.id:ke.dbId=null}),be=re(be);const Le={status:1,project_id:s==null?void 0:s.id,theme_of_the_routine:ie.theme_of_the_routine,songlist:ie.songlist,color:ie.color,ideas:be};let A=new Date;const ge={lock_date:fe(new Date(A.getTime()-24*60*60*1e3)).format("YYYY-MM-DD")},ve=await hc(Le),ze=`/v3/api/custom/equality_record/survey/update/lock_date/${t}`,Ee=await r.callRawAPI(ze,ge,"PUT");ve.error?R(i,ve.message,5e3,"error"):(R(i,"Survey updated successfully",5e3),l(!0))}catch(ue){se("name",{type:"manual",message:ue.message})}},S=ie=>{Number(ie.target.value.length)>os?U(0):(U(os-Number(ie.target.value.length)),H(ie.target.value))},re=ie=>ie.map(be=>({id:be.id,value:be.value.replace(/'/g,"''"),dbId:be.dbId})),Oe=async ie=>{try{const ue=await ct(ie);ue.error?R(i,ue.message,5e3,"error"):(j(zs+"survey/"+ue.model.uuidv4),console.log(new Date(ue.model.lock_date)>new Date),new Date(ue.model.lock_date)>new Date?l(!1):ue.model.status===1?l(!0):ue.model.status!==1&&l(!1))}catch(ue){Ce(a,ue.message)}};d.useEffect(()=>{(async function(){u(!0),await Oe(Number(s==null?void 0:s.id)),u(!1);const ie=await ct(Number(s==null?void 0:s.id));if(!ie.error){const be=new URL(zs+"survey/"+ie.model.uuidv4).pathname.split("/survey/")[1];be&&zt(be)?async function(){const A=await Jt({uuidv4:be});A.error?A.model.status!==1&&(R(i,A.message,5e3,"error"),u(!1)):(A.model.status===0&&(p(A.model.project_id),z(A.model.company_name),A.model.ideas.length>0&&(H(A.model.theme_of_the_routine),g(A.model.songlist),N(A.model.color),f(A.model.ideas),T("theme_of_the_routine",A.model.theme_of_the_routine),T("songlist",A.model.songlist),T("color",A.model.color),A.model.ideas.forEach((ge,ve)=>{V(ze=>{const Ee=[...ze];for(;ve>=Ee.length;)Ee.push({id:ve+1,value:ge.idea_value});return Ee[ve].value=ge.idea_value.replace(/<br>/g,`
`),Ee})})),u(!1)),new Date(A.model.lock_date)>new Date?(console.log(new Date(A.model.lock_date)>new Date),H(A.model.theme_of_the_routine),f(A.model.ideas),T("theme_of_the_routine",A.model.theme_of_the_routine),g(A.model.songlist),N(A.model.color),l(!1),z(A.model.company_name),u(!1)):A.model.status===1&&(H(A.model.theme_of_the_routine),T("theme_of_the_routine",A.model.theme_of_the_routine),T("theme_of_the_routine",A.model.theme_of_the_routine),T("songlist",A.model.songlist),T("color",A.model.color),z(A.model.company_name),f(A.model.ideas),u(!1),l(!0)))}():R(i,"Invalid URL",5e3,"error")}})()},[]),d.useEffect(()=>{(async function(){u(!0),await Oe(Number(s==null?void 0:s.id)),u(!1);const ie=await ct(Number(s==null?void 0:s.id));if(!ie.error){const be=new URL(zs+"survey/"+ie.model.uuidv4).pathname.split("/survey/")[1];be&&zt(be)?async function(){const A=await Jt({uuidv4:be});A.error?(R(i,A.message,5e3,"error"),u(!1)):A.model.status===0?(p(A.model.project_id),z(A.model.company_name),A.model.ideas.length>0&&(f(A.model.ideas),A.model.ideas.forEach((ge,ve)=>{V(ze=>{const Ee=[...ze];return Ee[ve]&&(Ee[ve].value=ge.idea_value),Ee})})),u(!1)):A.model.status===1&&(A.model.ideas.length>0&&(H(A.model.theme_of_the_routine),g(A.model.songlist),N(A.model.color),A.model.ideas.forEach((ge,ve)=>{V(ze=>{const Ee=[...ze];for(;ve>=Ee.length;)Ee.push({id:ve+1,value:ge.idea_value});return Ee[ve].value=ge.idea_value.replace(/<br>/g,`
`),Ee})})),H(A.model.theme_of_the_routine),f(A.model.ideas),g(A.model.songlist),N(A.model.color),u(!1))}():R(i,"Invalid URL",5e3,"error")}})()},[c]),d.useEffect(()=>{$.forEach((ie,ue)=>{T(`idea_${ue+1}`,ie.value)})},[$]);const Ae=ie=>{g(ie.target.value)},ce=ie=>{N(ie.target.value)};return e.jsxs("div",{className:"mx-auto max-w-screen-2xl",children:[m&&e.jsx("div",{className:"flex justify-center mt-10 w-full",children:e.jsx(Be,{color:"white",className:"",size:30})}),!c&&!m&&e.jsxs("div",{className:"rounded border border-strokedark bg-boxdark",children:[e.jsxs("div",{className:"p-6 border-b border-strokedark",children:[e.jsx("h2",{className:"text-3xl font-semibold text-white",children:"Survey"}),e.jsx("h4",{className:"mb-4 text-xl font-semibold text-white",children:"Hello!"}),e.jsxs("p",{className:"mb-4 text-base font-medium leading-relaxed text-bodydark",children:[L," is excited to produce your music this year! As you may or may not know, we've already started the creative process for your mix, and we want to customize and personalize your voiceovers and songs and give you the mix your team deserves. We truly want to tell your team's story!"]}),e.jsx("h5",{className:"mb-3 text-lg font-medium text-white",children:"To help us make this happen for you, will you please submit this information:"}),e.jsxs("ul",{className:"mb-4 space-y-2 text-base font-medium list-disc list-inside text-bodydark",children:[e.jsx("li",{children:"Overall theme/style of your mix?"}),e.jsx("li",{children:"Any phrases, voice overs ideas and the types of recording artists you want in the mix?"}),e.jsx("li",{children:"Any background or history about your team?"}),e.jsx("li",{children:"Do they have a team color?"}),e.jsx("li",{children:"Any inside jokes, what the team says when they break at the end of practice...etc.."}),e.jsx("li",{children:"New ideas you want us to incorporate"})]}),e.jsx("p",{className:"text-base font-medium text-bodydark",children:"We can't wait to start on your mix and make your routine come to life!"}),e.jsx("p",{className:"mt-2 text-sm italic text-bodydark",children:"*This information is due weeks/months before count sheets and videos. If the deadline is missed, we may have to adjust your production to a later date."})]}),e.jsxs("form",{onSubmit:P(we),className:"p-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Theme of the Routine"}),e.jsx("textarea",{...O("theme_of_the_routine"),className:"p-3 w-full text-white rounded border border-form-strokedark bg-form-input placeholder:text-gray-400 focus:border-primary focus:outline-none",rows:4,onChange:S,value:q}),ee.theme_of_the_routine&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:ee.theme_of_the_routine.message}),e.jsxs("p",{className:"mt-1 text-xs text-bodydark",children:["Remaining Characters:"," ",Z>0?Z:0]})]}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Song List"}),e.jsx("textarea",{...O("songlist"),className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white placeholder:text-gray-400 focus:border-primary focus:outline-none",rows:4,onChange:Ae,value:v}),ee.songlist&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:ee.songlist.message})]}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Colors"}),e.jsx("textarea",{...O("color"),className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white placeholder:text-gray-400 focus:border-primary focus:outline-none",rows:4,onChange:ce,value:w}),ee.color&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:ee.color.message})]}),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("label",{className:"text-sm font-medium text-white",children:["Ideas"," ",e.jsx("span",{className:"text-xs text-bodydark",children:"(Minimum of 5 ideas required)"})]}),e.jsxs("button",{type:"button",onClick:ne,className:"inline-flex gap-2 items-center text-sm font-medium text-primary hover:text-opacity-80",children:[e.jsx(Pc,{className:"w-4 h-4"}),"Add Idea"]})]}),e.jsx("div",{className:"space-y-4",children:$.map((ie,ue)=>e.jsxs("div",{children:[e.jsxs("label",{className:"mb-2.5 block text-xs font-medium text-bodydark",children:["Idea #",ue+1]}),e.jsx("textarea",{...O(`idea_${ue+1}`),className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white placeholder:text-gray-400 focus:border-primary focus:outline-none",rows:4}),ee[`idea_${ue+1}`]&&e.jsx("p",{className:"mt-1 text-xs text-danger",children:ee[`idea_${ue+1}`].message})]},ue))})]})]}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{type:"submit",className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90",children:"Submit Survey"})})]})]}),c&&!m&&e.jsxs("div",{className:"rounded border border-strokedark bg-boxdark",children:[e.jsxs("div",{className:"p-6 border-b border-strokedark",children:[e.jsx("h2",{className:"text-2xl font-semibold text-center text-white",children:"Survey"}),e.jsxs("div",{className:"p-6",children:[e.jsx("h4",{className:"mb-4 text-xl font-semibold text-white",children:"Hello!"}),e.jsxs("p",{className:"mb-4 text-base font-medium leading-relaxed text-bodydark",children:[L," is excited to produce your music this year! As you may or may not know, we've already started the creative process for your mix, and we want to customize and personalize your voiceovers and songs and give you the mix your team deserves. We truly want to tell your team's story!"]}),e.jsx("h5",{className:"mb-3 text-lg font-medium text-white",children:"To help us make this happen for you, will you please submit this information:"}),e.jsxs("ul",{className:"mb-4 space-y-2 text-base font-medium list-disc list-inside text-bodydark",children:[e.jsx("li",{children:"Overall theme/style of your mix?"}),e.jsx("li",{children:"Any phrases, voice overs ideas and the types of recording artists you want in the mix?"}),e.jsx("li",{children:"Any background or history about your team?"}),e.jsx("li",{children:"Do they have a team color?"}),e.jsx("li",{children:"Any inside jokes, what the team says when they break at the end of practice...etc.."}),e.jsx("li",{children:"New ideas you want us to incorporate"})]}),e.jsx("p",{className:"text-base font-medium text-bodydark",children:"We can't wait to start on your mix and make your routine come to life!"}),e.jsx("p",{className:"mt-2 text-sm italic text-bodydark",children:"*This information is due weeks/months before count sheets and videos. If the deadline is missed, we may have to adjust your production to a later date."})]})]}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Theme of the Routine"}),e.jsx("div",{className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white",children:q})]}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Song List"}),e.jsx("div",{className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white",children:v})]}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white",children:"Colors"}),e.jsx("div",{className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white",children:w})]}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"block mb-4 text-sm font-medium text-white",children:"Ideas"}),e.jsx("div",{className:"space-y-4",children:x.map((ie,ue)=>e.jsxs("div",{children:[e.jsxs("label",{className:"mb-2.5 block text-xs font-medium text-bodydark",children:["Idea #",ue+1]}),e.jsx("div",{className:"h-[128px] w-full rounded border border-form-strokedark bg-form-input p-3 text-white",children:ie.idea_value.replace(/<br>/g,`
`)})]},ue))})]})]})})]})]})},Gr="https://equalityrecords.com/",Dc=()=>{const o=st(),{dispatch:t,state:s}=d.useContext(Me),{dispatch:r}=d.useContext(xe),[a,n]=d.useState(!1),[i,c]=d.useState(!1),[l,m]=d.useState({}),[u,h]=d.useState("");d.useState([]);const[p,x]=d.useState(0);d.useState(0),d.useState(0),d.useState(!0),d.useState(!1),d.useState("");const[f,v]=d.useState([]),[g,w]=d.useState([]),[N,k]=d.useState([]),[j,$]=d.useState([]),[V,L]=d.useState([]);d.useState({}),d.useState({}),d.useState({}),d.useState({}),d.useState(0),d.useState(0),d.useState(0),d.useState(0),d.useState(0),d.useState(null),d.useState(!1);const[z,q]=d.useState([]),[H,Z]=d.useState([]),[U,I]=d.useState([]),[O,P]=d.useState([]),[se,T]=d.useState([]),[ee,ne]=d.useState(""),[we,S]=d.useState("");d.useState(!1),d.useState(!1),d.useState(!1);const[re,Oe]=d.useState(!1);d.useState(null),d.useState([]),d.useState(!1);const[Ae,ce]=d.useState(0),[ie,ue]=d.useState(0),[be,Le]=d.useState(0),[A,ge]=d.useState(0),[ve,ze]=d.useState(0),[Ee,ke]=d.useState(0);d.useState(!1),d.useState(!1),d.useState(!1),d.useState(0),d.useState(0),d.useState(0);const[Fe,G]=d.useState(""),[Pe,ye]=d.useState(""),[je,Se]=d.useState("");d.useState(!1),d.useState(!1),d.useState([]);const[Je,et]=d.useState(""),[Ve,Ue]=d.useState([]),[tt,it]=d.useState("");d.useState(!1),d.useState(!1),d.useState(!1);const[Ie,gt]=d.useState(""),[ut,Ke]=d.useState([]),$e=at(),mt=async(C=bt({}))=>{var b,_;try{const B=await ir(Number($e==null?void 0:$e.id),bt({...C,user_id:localStorage.getItem("user")}));if(B.error)R(r,B.message,5e3,"error");else{if(!B.model){R(r,"Access Denied",5e3,"error"),o("/client/projects");return}m(B.model),x((b=B.model)==null?void 0:b.total),ye(B.model.program_name),Se(B.model.team_name),gt((_=B.model)==null?void 0:_.theme_of_the_routine)}}catch(B){Ce(t,B.message)}},We=async()=>{try{const C=await mc("survey");if(!C.error){it(C.model.subject),et(C.model.html);let b=[];C.model.tag.includes(",")?b=C.model.tag.split(","):b.push(C.model.tag),Ue(b)}}catch(C){Ce(t,C.message)}},ht=async()=>{try{const C=await dc();if(C.error)v([]),w([]),k([]),$([]);else{let b=C.list.writers,_=C.list.artists,B=C.list.engineers,oe=C.list.producers;b.length>0&&(b=Qt(b,"name")),_.length>0&&(_=Qt(_,"name")),B.length>0&&(B=Qt(B,"name")),oe.length>0&&(oe=Qt(oe,"name")),v(b),w(_),k(B),$(oe)}}catch(C){Ce(t,C.message)}},pt=async()=>{try{const C=await ic(Number($e==null?void 0:$e.id));if(C.error)R(r,C.message,5e3,"error");else if(C.list.length>0){let b=sn(C.list);q(b);let _=rn(b);ce(_.voiceCount),ue(_.songCount),Le(_.trackingCount),ge(_.voiceCount),ze(_.songCount),ke(_.trackingCount)}else q([]),ce(0),ue(0),Le(0),ge(0),ze(0),ke(0)}catch(C){Ce(t,C.message)}},D=async()=>{try{const C=await lc(Number($e==null?void 0:$e.id));C.error?R(r,C.message,5e3,"error"):Z(C.list)}catch(C){Ce(t,C.message)}},J=async C=>{try{const b=await ct(C);b.error?R(r,b.message,5e3,"error"):(h(Gr+"survey/"+b.model.uuidv4),b.model.status===1?c(!0):c(!1))}catch(b){Ce(t,b.message)}},Q=async C=>{var b;try{const _=await Nt(C);_.error||G((b=_.model)==null?void 0:b.company_name)}catch(_){Ce(t,_.message)}},W=()=>{try{const C=localStorage.getItem("userClientId"),b=localStorage.getItem("ClientProjectProducerName")&&JSON.parse(localStorage.getItem("ClientProjectProducerName")),_=localStorage.getItem("ClientProjectTeamName")&&JSON.parse(localStorage.getItem("ClientProjectTeamName")),B=localStorage.getItem("ClientProjectMixTypeId")&&JSON.parse(localStorage.getItem("ClientProjectMixTypeId")),oe=localStorage.getItem("ClientProjectMixDateStart"),de=localStorage.getItem("ClientProjectMixDateEnd");I(_||[]),P(B||[]),T(b||[]),ne(oe||""),S(de||"");let pe=[];(_==null?void 0:_.length)>0&&_.forEach(Xe=>{pe.push(Xe.value)});let De=[];(b==null?void 0:b.length)>0&&b.forEach(Xe=>{De.push(Xe.value)});let _e=[];return(B==null?void 0:B.length)>0&&B.forEach(Xe=>{_e.push(Xe.value)}),oe&&de&&oe>de?(R(r,"Mix Date Start must be less than Mix Date End",5e3,"error"),null):{producer_name:(De==null?void 0:De.length)>0?De:null,client_ids:C?[Number(C)]:null,team_names:(pe==null?void 0:pe.length)>0?pe:null,mix_type_ids:(_e==null?void 0:_e.length)>0?_e:null,is_impersonate:!1,mix_date_start:oe?fe(oe).format("YYYY-MM-DD"):null,mix_date_end:de?fe(de).format("YYYY-MM-DD"):null}}catch(C){return console.error("Error loading filters:",C),{}}};d.useEffect(function(){r({type:"SETPATH",payload:{path:"projects"}});const C=localStorage.getItem("user");C&&async function(){await Q(C)}(),async function(){try{n(!0),await mt(W()),await pt(),await D(),await ht(),await We();const _=await oa();L((_==null?void 0:_.list)||[]),await J(Number($e==null?void 0:$e.id)),n(!1)}catch(_){Ce(t,_.message)}const b=await ct(Number($e==null?void 0:$e.id));if(!b.error){const B=new URL(Gr+"survey/"+b.model.uuidv4).pathname.split("/survey/")[1];B&&zt(B)?async function(){const de=await Jt({uuidv4:B});de.error||(de.model.status===0?Ke([]):de.model.status===1&&Ke(de.model.ideas))}():R(r,"Invalid URL",5e3,"error")}}()},[]);function E(C){if(C){var b=C==null?void 0:C.split("-"),_=b[1].padStart(2,"0")+"-"+b[2].padStart(2,"0")+"-"+b[0];return _}}d.useEffect(()=>{},[]);const Y=localStorage.getItem("ClientSelectedTab"),[K,ae]=d.useState(Y?parseInt(Y):0);d.useEffect(()=>{localStorage.setItem("ClientSelectedTab",K)},[K]);const X=C=>{C.matches&&window.innerWidth<=600&&R(r,"Please rotate your device to landscape orientation for the best experience.",4e4,"warning")};window.matchMedia("(orientation: portrait)").addEventListener("change",X),V.find(C=>C.user_id==(l==null?void 0:l.user_id));const[me]=co();me.get("pro");const le=new URLSearchParams({params:$e.id}).toString();return console.log(le),e.jsx("div",{className:"max-w-screen w-full bg-boxdark-2 p-5",children:e.jsx("div",{className:"mx-auto rounded border border-strokedark bg-boxdark p-6",children:l&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-6 flex items-center justify-between",children:e.jsxs("button",{onClick:()=>o(-1),className:"inline-flex items-center justify-center rounded-md bg-meta-4 px-4 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"arrow-left",className:"mr-2"}),"Back"]})}),e.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-semibold text-white",children:[l==null?void 0:l.program_name," - ",l==null?void 0:l.team_name]}),e.jsxs("p",{className:"mt-1 text-sm font-medium text-bodydark2",children:["Production Date:"," ",fe(l==null?void 0:l.mix_date).format("MM/DD/YYYY")]})]}),((l==null?void 0:l.payment_status)===4||(l==null?void 0:l.payment_status)===1)&&e.jsxs("button",{onClick:()=>o(`/client/edits?${le}`),className:"inline-flex items-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"fas fa-edit"}),"Request an Edit"]})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3",children:[e.jsx("div",{className:"rounded border border-strokedark bg-boxdark-2/40 p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Mix Type:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:l==null?void 0:l.mix_type_name})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Team Type:"}),e.jsxs("span",{className:"text-sm font-medium text-white",children:[(l==null?void 0:l.team_type)===1&&"All Girl",(l==null?void 0:l.team_type)===2&&"Co-ed",(l==null?void 0:l.team_type)===3&&"TBD"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Division:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:l==null?void 0:l.division})]})]})}),e.jsx("div",{className:"rounded border border-strokedark bg-boxdark-2/40 p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Producer:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:l==null?void 0:l.producer_name})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Mix Season:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:l==null?void 0:l.mix_season_name})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Payment Status:"}),e.jsxs("span",{className:"text-sm font-medium text-white",children:[(l==null?void 0:l.payment_status)===1&&"Complete",(l==null?void 0:l.payment_status)===2&&"Deposit Paid",(l==null?void 0:l.payment_status)===3&&"Paid in Full",(l==null?void 0:l.payment_status)===4&&"Awaiting Edit",((l==null?void 0:l.payment_status)===5||!(l!=null&&l.payment_status))&&"Unpaid"]})]})]})}),e.jsx("div",{className:"rounded border border-strokedark bg-boxdark-2/40 p-4",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Team Details Date:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:E(l==null?void 0:l.team_details_date)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Routine Submission:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:E(l==null?void 0:l.routine_submission_date)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-bodydark2",children:"Estimated Delivery:"}),e.jsx("span",{className:"text-sm font-medium text-white",children:E(l==null?void 0:l.estimated_delivery_date)})]})]})})]}),e.jsx("section",{className:"mt-10",children:e.jsxs(ft.Group,{selectedIndex:K,onChange:ae,children:[e.jsx(ft.List,{className:"mb-0 flex items-end gap-2 border-b border-strokedark md:items-center",children:["Team Details","Survey","8-Count","Media"].map((C,b)=>e.jsx(ft,{className:`p-1 text-[0.8rem] font-bold text-bodydark2 hover:text-white sm:p-3 sm:text-sm md:text-base ${K===b&&"focus:ring-00 border-b-2 border-primary text-white focus-visible:outline-none"}`,children:C},C))}),e.jsxs(ft.Panels,{className:"focus:ring-00 w-full rounded-md border border-form-strokedark bg-form-input p-5 shadow focus-visible:outline-none",children:[e.jsx(ft.Panel,{children:e.jsx(_c,{viewModel:l,Team_Date:l==null?void 0:l.team_details_date})}),e.jsx(ft.Panel,{children:e.jsx(Ic,{survey_id:l==null?void 0:l.survey_id,surveyLink:u,setShowResendSurveyModal:Oe})}),e.jsx(ft.Panel,{children:e.jsx(gr,{submittedIdeas:ut,viewModel:l,surveyLink:u})}),e.jsx(ft.Panel,{children:e.jsx(kc,{viewModel:l})})]})]})})]})})})};let Oc=new qe;const Ac=async o=>{try{const t=`/v3/api/custom/equality_record/cycle_count/client/${o}`;return await Oc.callRawAPI(t,[],"GET")}catch(t){return t}},Rc=({fileSource:o,setModalClose:t})=>{const s=y.useRef(null),[r,a]=y.useState(!1),[n,i]=y.useState(0),[c,l]=y.useState(0),[m,u]=y.useState(1);y.useEffect(()=>{s.current&&(s.current.addEventListener("loadedmetadata",()=>{l(s.current.duration)}),s.current.addEventListener("timeupdate",()=>{i(s.current.currentTime)}))},[]);const h=v=>{const g=Math.floor(v/60),w=Math.floor(v%60);return`${g}:${w.toString().padStart(2,"0")}`},p=()=>{s.current.paused?(s.current.play(),a(!0)):(s.current.pause(),a(!1))},x=v=>{const g=v.target.value;s.current.currentTime=g,i(g)},f=v=>{const g=v.target.value;u(g),s.current.volume=g};return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),e.jsxs("div",{className:"relative w-full max-w-md rounded-lg bg-boxdark p-6 shadow-xl",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h3",{className:"text-xl font-semibold text-white",children:"Audio Player"}),e.jsx("button",{onClick:()=>t(!1),className:"rounded-full p-1 hover:bg-meta-4",children:e.jsx(qt,{className:"h-6 w-6 text-white"})})]}),e.jsx("audio",{ref:s,src:o,className:"hidden"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("input",{type:"range",value:n,max:c,onChange:x,className:"h-2 w-full cursor-pointer appearance-none rounded-lg bg-meta-4",style:{background:`linear-gradient(to right, #3C50E0 ${n/c*100}%, #333F51 ${n/c*100}%)`}}),e.jsxs("div",{className:"mt-2 flex justify-between text-sm text-white",children:[e.jsx("span",{children:h(n)}),e.jsx("span",{children:h(c)})]})]}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:p,className:"rounded-full bg-primary p-3 text-white hover:bg-primary/90",children:r?e.jsx(Io,{className:"h-6 w-6"}):e.jsx(ar,{className:"h-6 w-6"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Do,{className:"h-5 w-5 text-white"}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:m,onChange:f,className:"h-1.5 w-24 cursor-pointer appearance-none rounded-lg bg-meta-4",style:{background:`linear-gradient(to right, #3C50E0 ${m*100}%, #333F51 ${m*100}%)`}})]})]})})]})]})},Tc=({track:o})=>{var a;const[t,s]=d.useState(!1);d.useContext(xe);function r(n,i){const c=n?JSON.parse(n)[0]:"";console.log(c,i);const l=`${i}.${c==null?void 0:c.split(".").pop()}`;window.downloadManager=window.downloadManager||{downloads:new Map,progressBox:null},window.downloadManager.progressBox||(window.downloadManager.progressBox=Ot());const m=Date.now();window.downloadManager.downloads.set(m,{fileName:l,progress:0,status:"starting",type:"track"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),fetch(c).then(u=>{const h=u.headers.get("content-length"),p=u.body.getReader();let x=0;return new ReadableStream({start(f){function v(){p.read().then(({done:g,value:w})=>{if(g){f.close();return}x+=w.length;const N=x/h*100;window.downloadManager.downloads.set(m,{fileName:l,progress:Math.round(N),status:"downloading",type:"track"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),f.enqueue(w),v()})}v()}})}).then(u=>new Response(u)).then(u=>u.blob()).then(u=>{const h=window.URL.createObjectURL(u),p=document.createElement("a");p.href=h,p.download=l,document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(h),window.downloadManager.downloads.set(m,{fileName:l,progress:100,status:"complete",type:"track"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads),setTimeout(()=>{window.downloadManager.downloads.delete(m),window.downloadManager.downloads.size===0?(window.downloadManager.progressBox.remove(),window.downloadManager.progressBox=null):window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)},2e3)}).catch(u=>{console.error("Error downloading file:",u),window.downloadManager.downloads.set(m,{fileName:l,progress:0,status:"failed",type:"track"}),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads)})}return e.jsxs(e.Fragment,{children:[t&&e.jsx(Rc,{fileSource:o.url?(a=JSON.parse(o==null?void 0:o.url))==null?void 0:a[0]:" ",setModalClose:s}),e.jsxs("tr",{className:"border-b border-strokedark text-bodydark1 hover:bg-primary/5",children:[e.jsx("td",{className:"px-4 py-4 text-white xl:pl-6 2xl:pl-9",children:o.title}),e.jsx("td",{className:"px-4 py-4",children:o.description}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(ar,{className:"h-6 w-6 cursor-pointer hover:text-primary",onClick:()=>s(!0)})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx(rr,{className:"h-6 w-6 cursor-pointer hover:text-primary",onClick:()=>r(o.url,o.track_name)})})]})]})},Lc=()=>{const[o,t]=d.useState([]),[s,r]=d.useState(!1),{dispatch:a}=d.useContext(xe),n=async()=>{r(!0);const i=await Ac(localStorage.getItem("userClientId"));r(!1),i.error||t(i.list)};return d.useEffect(()=>{a({type:"SETPATH",payload:{path:"count-tracks"}}),n()},[]),e.jsx("div",{className:"max-w-screen h-full p-4 md:p-4 lg:p-6 xl:p-8",children:e.jsxs("div",{className:"border-strokedark bg-boxdark",children:[e.jsx("div",{className:"px-4 pt-8 2xl:px-9",children:e.jsx("h3",{className:"mb-4 text-2xl font-bold text-white",children:"Count Tracks"})}),o.map((i,c)=>e.jsxs("div",{className:"shadow-default mb-4 rounded border border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"border-b border-strokedark px-4 py-4 sm:px-6 2xl:px-9 dark:border-strokedark",children:e.jsx("div",{className:"flex w-full items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h4",{className:"text-2xl font-semibold text-white dark:text-white",children:i.company_name}),e.jsx("span",{className:"text-white dark:text-white",children:"-"}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium text-white dark:text-white",children:[i.first_name," ",i.last_name]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:i.office_email})]})]})})}),e.jsx("div",{className:"p-4 md:p-6 2xl:p-10",children:e.jsx("div",{className:"max-h-[380px] overflow-y-auto",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"bg-meta-4",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Title"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Description"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Listen"}),e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-bodydark1",children:"Download"})]})}),e.jsx("tbody",{className:"divide-y divide-strokedark text-white",children:s?e.jsx("tr",{children:e.jsx("td",{colSpan:"4",className:"text-center",children:e.jsxs("div",{className:"flex items-center justify-start gap-3 px-8 py-6 text-center",children:[e.jsx(Be,{size:20,color:"white"}),e.jsx("span",{className:"animate-pulse text-xl font-semibold text-white ease-out",children:"Loading Tracks..."})]})})}):i.tracks.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"4",children:e.jsx("div",{className:"p-4 text-center text-white",children:"No Tracks found!"})})}):i.tracks.map((l,m)=>e.jsx(Tc,{track:l},m))})]})})})]},c)),s&&o.length===0&&e.jsx("div",{className:"shadow-default rounded border border-strokedark bg-boxdark p-4 text-center dark:border-strokedark dark:bg-boxdark",children:e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx(Be,{size:20,color:"white"}),e.jsx("span",{className:"animate-pulse text-xl font-semibold text-white ease-out",children:"Loading Tracks..."})]})}),!s&&o.length===0&&e.jsx("div",{className:"shadow-default rounded border border-strokedark bg-boxdark p-4 text-center text-white dark:border-strokedark dark:bg-boxdark",children:"No Tracks found!"})]})})},no=({confirmText:o,setModalClose:t,setFormYes:s})=>{const r=a=>{a.preventDefault(),s(!0)};return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>t(!1)}),e.jsx("div",{className:"inline-block transform overflow-hidden rounded-lg bg-boxdark text-left align-bottom shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:align-middle",role:"dialog","aria-modal":"true","aria-labelledby":"modal-headline",children:e.jsxs("form",{children:[e.jsxs("div",{className:"flex w-full items-center justify-between border-b border-strokedark bg-boxdark px-6 py-4",children:[e.jsx("h3",{className:"text-xl font-semibold text-white",id:"modal-headline",children:"Confirm Action"}),e.jsx("button",{type:"button",onClick:()=>t(!1),className:"rounded-full p-1 transition-colors hover:bg-meta-4",children:e.jsx(qt,{className:"h-6 w-6 text-white"})})]}),e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"w-full",children:e.jsx("p",{className:"text-lg text-white",children:o})})}),e.jsxs("div",{className:"flex justify-end gap-4 border-t border-strokedark bg-boxdark px-6 py-4",children:[e.jsx("button",{type:"button",className:"hover:bg-danger/40/90 inline-flex items-center justify-center rounded-md bg-danger px-6 py-2.5 text-center font-medium text-white transition-colors",onClick:()=>t(!1),children:"Cancel"}),e.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white transition-colors hover:bg-primary/90",children:"Confirm"})]})]})})]})},io=({viewModel:o,video_ids:t=null,setVideo_ids:s=null,projectID:r=null,edit_complete:a=!1,hasDownloads:n})=>{const i=at(),c=r||(i==null?void 0:i.id);console.log(c);const[l,m]=d.useState(!1),[u,h]=d.useState([]),[p,x]=y.useState(!0),[f,v]=y.useState(!1),[g,w]=d.useState(0),[N,k]=d.useState(0),[j,$]=d.useState(0),[V,L]=d.useState(!1),[z,q]=d.useState(!1),H=async(U,I)=>{const O=await Vt({page:U,limit:I,filter:{project_id:c}});if(!O.error){const{list:P,total:se,num_pages:T,page:ee}=O,ne=P.filter(we=>we.is_music===0);h(ne),w(T),$(ee),k(se),L(ee>1),q(ee+1<=T)}x(!1)};console.log("dreyyyyy"),d.useEffect(()=>{H(1,2e3)},[]);const Z=()=>{var U,I;console.log("Current download manager:",window.downloadManager),console.log("Downloads size:",(U=window.downloadManager)==null?void 0:U.downloads.size),console.log("Progress box:",(I=window.downloadManager)==null?void 0:I.progressBox),window.downloadManager&&(window.downloadManager.progressBox||(console.log("Creating new progress box"),window.downloadManager.progressBox=Ot()),console.log("Showing progress box"),window.downloadManager.progressBox.show(),window.downloadManager.progressBox.updateDownloads(window.downloadManager.downloads))};return e.jsxs("div",{className:"bg-boxdark",children:[l&&e.jsx(ro,{projectIDVIDEO:c,setVideoList:h,setIsOpen:m,isOpen:l,video_ids:t,setVideo_ids:s}),e.jsxs("div",{className:"rounded-sm shadow-default bg-boxdark dark:bg-boxdark",children:[e.jsx("div",{className:"px-4 py-4 border-b border-strokedark 2xl:px-9 dark:border-strokedark",children:e.jsxs("div",{className:"flex justify-between items-center w-full",children:[e.jsx("div",{className:"flex gap-3 items-center",children:e.jsx("h4",{className:"text-lg font-semibold text-white dark:text-white",children:"Videos"})}),e.jsxs("div",{className:"flex gap-3 items-center",children:[n&&e.jsx("button",{onClick:Z,className:"inline-flex justify-center items-center text-primary hover:text-primary/80",children:e.jsx("div",{className:"animate-pulse pulse",children:e.jsx(M,{icon:"download",className:"w-5 h-5"})})}),!a&&e.jsx("button",{className:`inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90 ${a&&"opacity-50"}`,onClick:()=>!a&&m(!0),children:"Upload"})]})]})}),e.jsx("div",{className:"p-4 md:p-6 2xl:p-10",children:e.jsx("div",{className:"custom-overflow max-h-[380px] overflow-y-auto",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"bg-meta-4",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1 2xl:pl-9",children:"Date"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Description"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Actions"})]})}),e.jsx("tbody",{className:"text-white",children:p?e.jsx("tr",{children:e.jsx("td",{colSpan:"6",className:"text-center",children:e.jsxs("div",{className:"flex gap-3 justify-start items-center px-8 py-6 text-center",children:[e.jsx(Be,{size:20,color:"white"}),e.jsx("span",{className:"text-xl font-semibold text-white ease-out animate-pulse",children:"Loading Videos..."})]})})}):u.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:"6",children:e.jsx("div",{className:"p-4 text-center text-white",children:"No videos found!"})})}):u.map(U=>e.jsx(oo,{video:U,viewModel:o,showDeleteVideoModal:f,getData:H,setShowDeleteVideoModal:v},U.id))})]})})})]})]})},$c=({SameTeamNameEdit:o=null,isOpen:t,setReviseEdit:s,setIsOpen:r,selectedEditType:a,setConfirmationPage:n,submittedIdeas:i,surveyLink:c,viewModel:l,loader:m,projectID:u,selectedTeam:h,producerName:p,producer_id:x,setEditData:f,setSelectedTeam:v,reviseEdit:g})=>{console.log(l);const[w,N]=y.useState(""),[k,j]=y.useState(!1),{dispatch:$}=d.useContext(xe),[V,L]=d.useState(!1),[z,q]=d.useState(!1),[H,Z]=y.useState(0),[U,I]=y.useState([]),[O,P]=y.useState(0),[se,T]=y.useState([]),[ee,ne]=y.useState([]),[we,S]=y.useState(""),re=d.useRef(H),[Oe,Ae]=y.useState([]),ce=d.useRef(isNaN(t)?"":1);console.log(l),d.useEffect(()=>{re.current=H},[H]);const[ie,ue]=y.useState(!1);console.log(H),console.log(o),y.useEffect(()=>{!isNaN(t)&&(o!=null&&o.video_ids)&&I(JSON.parse((o==null?void 0:o.video_ids)||"")),!isNaN(t)&&N(o==null?void 0:o.producer_notes)},[]),console.log(t),y.useEffect(()=>{isNaN(t)||Z(t)},[t]);const be=async()=>{try{const G=await ws({user_id:x}),Pe=G.list.filter(je=>je.request_range!=="Special"),ye=G.list.filter(je=>je.request_range==="Special");ne(ye),T(Pe)}catch{}};y.useEffect(()=>{be()},[]);function Le(G){const[Pe,ye,je]=G.split(", "),Se=parseInt(Pe.split(" ")[0]),Je=parseInt(ye.split(" ")[0]),et=parseInt(je.split(" ")[0]),Ve=new Date,Ue=new Date(Ve);Ue.setMonth(Ue.getMonth()+Se),Ue.setDate(Ue.getDate()+Je*7+et);const tt=String(Ue.getDate()).padStart(2,"0"),it=String(Ue.getMonth()+1).padStart(2,"0");return`${String(Ue.getFullYear())}-${it}-${tt}`}const A=()=>{L(!1)},ge=()=>{L(!1),setTimeout(()=>{q(!0)},500)};function ve(G,Pe){let ye=null,je=null,Se=-1/0;return Pe.forEach(Je=>{const et=Je.number_of_lines;if(et.includes("Special"))return;const Ve=et.split(" ");if(Ve.length===3){const Ue=parseInt(Ve[0]),tt=Ve[2];(tt==="below"&&G<=Ue||tt==="up"&&G>=Ue)&&(ye=Je),tt==="up"&&Ue>Se&&(Se=Ue,je=Je)}}),!ye&&je&&(ye=je),ye}console.log(Le("0 months, 5 weeks, 0 days")),st(),se.find(G=>G.id==a);const ze=ee.find(G=>G.id==a);console.log(H,O),console.log(w);const Ee=async()=>{try{let G={},Pe=null;if(!a)console.log("Edit type lists:",se),G=ve(o!=null&&o.number_of_lines?O+parseInt(o==null?void 0:o.number_of_lines):O,se),console.log("Default edit type:",G),Pe=Le(G==null?void 0:G.edit_duration);else{const Se=ee.find(Je=>Je.id==a);G={id:"",edit_type:"Special",edit_type_name:Se==null?void 0:Se.edit_type},console.log(a),console.log(Se),Pe=Le(Se==null?void 0:Se.edit_duration)}j(!0);const ye={producer_notes:w,edit_type:G==null?void 0:G.id,request_date:fe(new Date).format("YYYY-MM-DD"),due_date:Pe,edit_policy:"",eight_count:H,special_edit:a?1:0,special_type:a||"",edit_type_name:a?G==null?void 0:G.edit_type_name:G==null?void 0:G.edit_type,video_ids:JSON.stringify(U),edit_status:2,number_of_lines:o!=null&&o.number_of_lines?String(O+parseInt(o==null?void 0:o.number_of_lines)):String(O)},je=await vn(ye,o==null?void 0:o.id);f({program_name:h.program,team_name:h.label,producer:p,edit_type:a?ze.edit_type:G==null?void 0:G.edit_type,request_date:fe(new Date).format("YYYY-MM-DD"),due_date:Pe}),je!=null&&je.error?R($,"Edit Creation Failed",5e3,"error"):(R($,"Edit Revised Sucessfully",5e3),await fs({id:u.toString(),discount:0,payment_status:4}),ue(!0),j(!1),v(null),n(!0),ce.current=1,r(!1))}catch(G){throw R($,"Edit Revision Failed",5e3,"error"),console.log(G),j(!1),G}finally{j(!1),s(!1)}};console.log(t),console.log(H);const ke=async()=>{S(!we);try{let G={},Pe=null;if(!a)console.log("Edit type lists:",se),G=ve(O,se),console.log("Default edit type:",G),Pe=Le(G==null?void 0:G.edit_duration);else{const Se=ee.find(Je=>Je.id==a);G={id:"",edit_type:"Special",edit_type_name:Se==null?void 0:Se.edit_type},console.log(a),console.log(Se),Pe=Le(Se==null?void 0:Se.edit_duration)}j(!0),console.log(H);const ye={program_name:h.program,team_name:h.label,producer:p,user_id:localStorage.getItem("user"),producer_id:x,producer_notes:w,edit_type:G==null?void 0:G.id,completed_date:"",request_date:fe(new Date).format("YYYY-MM-DD"),due_date:Pe,edit_policy:"",eight_count:H,special_edit:a?1:0,special_type:a||"",edit_type_name:a?G==null?void 0:G.edit_type_name:G==null?void 0:G.edit_type,video_ids:JSON.stringify(U),edit_status:2,number_of_lines:O,project_id:u,music_ids:JSON.stringify([])},je=await jn(ye);f({program_name:h.program,team_name:h.label,producer:p,edit_type:a?ze.edit_type:G==null?void 0:G.edit_type,request_date:fe(new Date).format("YYYY-MM-DD"),due_date:Pe,music_ids:JSON.stringify([])}),je!=null&&je.error?R($,"Edit Creation Failed",5e3,"error"):(R($,"Edit Created Sucessfully",5e3),await fs({id:u,discount:0,payment_status:4}),ue(!0),j(!1),v(null),n(!0),ce.current=1,r(!1),N(""),s(!1))}catch(G){throw R($,"Edit Creation Failed",5e3,"error"),console.log(G),j(!1),G}finally{j(!1),s(!1)}};console.log(t);const Fe=d.useRef(U);return y.useEffect(()=>{Fe.current=U},[U]),y.useEffect(()=>{const G=Pe=>{if(!ie)return Pe.preventDefault(),Pe.returnValue="","";(async function(){try{((ce==null?void 0:ce.current)===""||Number.isNaN(ce==null?void 0:ce.current))&&(console.log(re==null?void 0:re.current),await Bs(re==null?void 0:re.current),Fe.current.forEach(async ye=>{await ds(ye)}))}catch(ye){console.log(ye)}})()};return window.addEventListener("beforeunload",G),()=>window.removeEventListener("beforeunload",G)},[ie]),d.useEffect(()=>()=>{(async function(){try{((ce==null?void 0:ce.current)===""||Number.isNaN(ce==null?void 0:ce.current))&&(console.log(re==null?void 0:re.current),await Bs(re==null?void 0:re.current),Fe.current.forEach(async G=>{await ds(G)}))}catch(G){console.log(G)}})()},[]),console.log(U,"video idsss"),console.log(t),console.log(z,"sjjs"),m||k?e.jsx(or,{}):e.jsxs(e.Fragment,{children:[" ",V?e.jsx(Ct,{confirmText:"Are you sure you want to Submit this edit?",setModalClose:A,setFormYes:ge}):null,z?e.jsx(no,{confirmText:"Are you sure you want to Submit this edit? This action cannot be undone.",setModalClose:q,setFormYes:()=>{isNaN(t)?ke():Ee()}}):null,e.jsxs("div",{className:"relative flex min-h-screen w-full flex-col rounded-md bg-boxdark p-5 text-white",children:[m||k?null:e.jsx("button",{style:{textOrientation:"upright",writingMode:"vertical-lr",WebkitWritingMode:"vertical-lr",msWritingMode:"vertical-lr"},className:"fixed right-[30px] top-[50%] z-[9] flex w-[50px] items-center justify-center gap-1 rounded-md border border-black/70 bg-primary py-[10px] text-lg font-semibold uppercase tracking-[-1px] shadow-md ",onClick:()=>{L(!0)},children:"Submit Edit"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"border-b border-strokedark pb-3 dark:border-strokedark",children:e.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("h3",{className:"text-xl font-medium text-white",children:"Edit Request for"}),e.jsx("p",{className:"text-xl font-medium text-white",children:(h==null?void 0:h.program)||"N/A"}),e.jsx("span",{children:"-"}),e.jsx("span",{className:"cursor-pointer text-xl",children:(h==null?void 0:h.team_name)||"N/A"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Producer Name"}),e.jsx("span",{children:p})]})]})})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white dark:text-white",children:"Notes for Producer"}),e.jsx("textarea",{className:"dark:border-form-stroke w-full rounded border-[1.5px] border-stroke bg-form-input bg-transparent px-5 py-3 font-medium outline-none transition focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:bg-form-input dark:focus:border-primary",rows:"4",placeholder:"Notes for producer",value:w,onChange:G=>N(G.target.value)})]})]}),e.jsxs("div",{className:"mt-14 w-full bg-gray-700 p-5",children:[e.jsx("div",{className:"custom-overflow h-auto max-h-[300px] overflow-y-auto",children:e.jsx(io,{video_ids:U,setVideo_ids:I,viewModel:l,projectID:u})}),e.jsx("div",{className:"mt-10",children:e.jsx(gr,{triggerSave:we,numberOfEdited:O,setNumberOfEdited:P,action:t,edit_eight_count_id:t,edit_ID:H,setUploaded_eight_count:Ae,set_Edit_ID:Z,surveyLink:c,viewModel:l,projectID:u,submittedIdeas:i,reviseEdit:g})})]}),e.jsx("div",{className:"mt-8 flex w-full items-center justify-center",children:e.jsx("button",{className:"flex w-[200px] items-center justify-center gap-1 rounded-md border border-black/70 bg-primary py-[15px]",onClick:()=>{L(!0)},children:e.jsx("span",{className:"text-[14px] font-medium",children:"Submit"})})})]})]})},Mc=({isOpen:o,getPending:t,setIsOpen:s,setIsOpen2:r,setIsOpen4:a,setSelectedTeam:n,selectedTeam:i,teamList:c})=>{const{dispatch:l,state:m}=d.useContext(Me),[u,h]=y.useState(!1),{dispatch:p}=d.useContext(xe);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-y-auto overflow-x-hidden bg-black/50 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-lg rounded border border-strokedark bg-boxdark p-4 sm:p-8",children:[e.jsxs("div",{className:"mb-5.5 flex items-center justify-between border-b border-strokedark pb-4",children:[e.jsx("h3",{className:"text-xl font-medium text-white",children:"Request Edit"}),e.jsx("button",{onClick:()=>{n(null),s(!1)},className:"hover:text-primary",children:e.jsx(M,{icon:"close",className:"h-4 w-4 text-white"})})]}),e.jsxs("div",{className:"gap-5.5 mt-4 flex flex-col",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-3 block text-sm font-medium text-white",children:"Select Team"}),e.jsxs("div",{className:"relative z-20",children:[e.jsxs(ys,{label:"Select Team",value:i?i==null?void 0:i.value:"",onChange:x=>{const f=c.find(v=>v.value==x);n(f)},className:"relative z-20 w-full appearance-none rounded border border-strokedark bg-meta-4 px-5 py-3 outline-none transition focus:border-primary active:border-primary",children:[e.jsx("option",{value:"",children:"Select Team"}),c.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))]}),e.jsx("span",{className:"absolute right-4 top-1/2 z-10 -translate-y-1/2",children:e.jsx(M,{icon:"chevron-down",className:"text-white"})})]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-end gap-4",children:[e.jsx("button",{onClick:()=>{n(null),s(!1)},className:"flex justify-center rounded border border-strokedark px-6 py-2 font-medium text-white hover:shadow-1",children:"Cancel"}),e.jsx("button",{onClick:async()=>{if(!i)R(p,"Select a team to proceed",5e3,"error"),Ce(l);else{h(!0);const x=await t(i==null?void 0:i.value);console.log(x),x?a(!0):r(!0),h(!1)}},className:"flex h-[40px] items-center justify-center gap-2 rounded bg-primary px-6 py-2 font-medium text-gray hover:bg-opacity-90",children:u?e.jsx(Be,{color:"white",size:13}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Next"}),e.jsx(M,{icon:"arrow-right",className:"text-xs"})]})})]})]})]})})},zc=({isOpen:o,selectedEditType:t,setSelectedTeam:s,setIsOpen1:r,setIsOpen2:a,setIsOpen3:n,setSelectedEditType:i,producer_id:c=null})=>{const[l,m]=y.useState([]),[u,h]=y.useState(!1),{dispatch:p}=d.useContext(xe),x=async()=>{h(!0);const v=(c?await ws({user_id:c}):{list:[]}).list.filter(g=>g.request_range==="Special");v.length<=0?n(!0):n(!1),m(v),h(!1)};return y.useEffect(()=>{c&&x()},[c]),console.log("dndnnd"),e.jsx("div",{className:"custom-overflow fixed inset-0 z-[51] flex h-full w-full items-center justify-center overflow-y-auto px-4 py-8 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-[1200px] rounded border border-strokedark bg-boxdark p-4 sm:p-8 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-strokedark pb-4 dark:border-strokedark",children:[e.jsx("h3",{className:"text-2xl font-semibold text-white dark:text-white",children:"Edit Type"}),e.jsx("button",{onClick:()=>{s(null),a(!1),r(!1)},className:"text-white hover:text-white dark:text-gray-400 dark:hover:text-white",children:e.jsx(M,{icon:"close",className:"h-5 w-5"})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-2.5 block text-sm font-medium text-white dark:text-white",children:"Is this edit for one of the following:"}),u?e.jsx(Be,{size:15,color:"white"}):e.jsxs("div",{className:"grid grid-cols-2 gap-5 sm:grid-cols-3 lg:grid-cols-5",children:[l.map(f=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{onChange:v=>{i(v.target.checked?f.id:null)},type:"radio",checked:f.id===t,className:"h-4 w-4",name:"special",value:f.id}),e.jsx("span",{className:"text-sm text-white",children:f.edit_type}),e.jsxs("span",{className:"group relative",children:[e.jsx(M,{icon:"question-circle",className:"h-4 w-4 cursor-pointer text-white"}),e.jsx("p",{className:"whit custom-overflow invisible absolute -top-5 z-[4] max-h-[70px] w-[200px] overflow-y-auto overflow-x-hidden break-words rounded bg-gray-2 p-3 text-center text-xs leading-none text-gray-900 shadow-lg group-hover:visible",children:f.note_keys})]})]},f.id)),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"radio",className:"h-4 w-4",name:"special",id:"",onChange:f=>{f.target.checked?i(""):i(null)}}),e.jsx("span",{className:"text-sm text-white",children:"Sound Effects Only"})]})]})]}),e.jsxs("div",{className:"mt-8 flex w-full items-center justify-between",children:[" ",e.jsxs("button",{onClick:()=>{i(""),r(!0),a(!1)},className:"flex w-[90px] items-center justify-center gap-1 rounded bg-primary py-[8px] hover:bg-primary/90",children:[e.jsx(M,{className:"text-[13px] text-white",icon:"arrow-left"}),e.jsxs("span",{className:"text-[13px] font-medium text-white",children:[" ","Previous"]})]}),e.jsxs("button",{onClick:()=>{console.log(t),t===null?R(p,"Make a selection",5e3,"warning"):n(!0)},className:"flex w-[90px] items-center justify-center gap-1 rounded bg-primary py-[8px] hover:bg-primary/90",children:[e.jsx("span",{className:"text-[13px] font-medium text-white",children:"Next"})," ",e.jsx(M,{className:"text-[13px] text-white",icon:"arrow-right"})]})]})]})]})})},Uc=({isOpen:o,edit_policy:t,producer_id:s=null,setIsOpen2:r,setIsOpen3:a,setIsOpen1:n,setOpenEditView:i,producerName:c,setSelectedTeam:l})=>{const[m,u]=y.useState("");return d.useEffect(()=>{s&&async function(){try{const h=await Nt(s);h!=null&&h.error||u(h.model.edit_policy_link)}catch{}}()},[s]),e.jsx("div",{className:"custom-overflow fixed inset-0 z-[52] flex h-full w-full items-center justify-center overflow-y-auto px-4 py-8 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-[800px] rounded border border-strokedark bg-boxdark p-4 sm:p-8 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-strokedark pb-4 dark:border-strokedark",children:[e.jsx("h3",{className:"text-2xl font-semibold text-white dark:text-white",children:"8-Count"}),e.jsx("button",{onClick:()=>{r(!1),n(!1),a(!1)},className:"text-white hover:text-white dark:text-gray-400 dark:hover:text-white",children:e.jsx(M,{icon:"close",className:"h-5 w-5"})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"mb-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Producer Name:"}),e.jsx("span",{className:"text-sm text-white",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Edit Policy:"}),m?e.jsx("a",{target:"_blank",className:"text-sm text-primary underline hover:text-primary/90",href:`${m}`,children:"Edit_Policy.pdf"}):e.jsx("span",{className:"text-sm text-white",children:"null"})]})]}),e.jsx("div",{className:"mb-6 text-center text-sm text-white",children:"Would you like to revise the previous version of 8-count sheets or start new?"}),e.jsxs("div",{className:"mb-8 flex justify-center gap-4",children:[e.jsx("button",{onClick:()=>{i("Previous"),r(!1),n(!1),a(!1)},className:"flex h-[56px] w-[146px] items-center justify-center rounded bg-primary px-6 py-2 text-xs font-medium text-white hover:bg-opacity-90",children:e.jsx("span",{className:"text-[13px] leading-[15px]",children:"Revise Previous Version"})}),e.jsx("button",{onClick:()=>{i("Blank"),r(!1),n(!1),a(!1)},className:"flex h-[56px] w-[146px] items-center justify-center rounded bg-primary px-6 py-2 text-xs font-medium leading-[15px] text-white hover:bg-opacity-90",children:e.jsx("span",{className:"text-[13px] leading-[15px]",children:"Start With Blank Count Sheet"})})]}),e.jsx("div",{className:"flex items-center justify-start",children:e.jsxs("button",{onClick:()=>{r(!0),a(!1)},className:"flex items-center justify-center gap-2 rounded bg-primary px-6 py-2 font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"arrow-left",className:"text-xs"}),e.jsx("span",{children:"Previous"})]})})]})]})})},Bc=({isOpen:o,producer_id:t=null,SameTeamNameEdit:s,setIsOpen2:r,setIsOpen3:a,setIsOpen1:n,setOpenEditView:i,producerName:c,setSelectedEditType:l,selectedEditType:m,setSelectedTeam:u,setReviseEdit:h})=>{const[p,x]=y.useState([]),[f,v]=y.useState(""),[g,w]=y.useState(!1),{dispatch:N}=d.useContext(xe);console.log(t,p,o);const k=async()=>{w(!0);const $=(t?await ws({user_id:t}):{list:[]}).list.filter(V=>(V==null?void 0:V.request_range)==="Special");$.length<=0&&a(!0),x($),w(!1)};return d.useEffect(()=>{t&&async function(){try{const j=await Nt(t);j!=null&&j.error||(console.log(j.model),v(j.model.edit_policy_link))}catch{}}()},[t]),y.useEffect(()=>{t&&k(),l(s==null?void 0:s.special_type)},[t]),console.log(s),e.jsx("div",{className:"custom-overflow fixed inset-0 z-[52] flex h-full w-full items-center justify-center overflow-y-auto px-4 py-8 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-[800px] rounded border border-strokedark bg-boxdark p-4 sm:p-8 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-strokedark pb-4 dark:border-strokedark",children:[e.jsx("h3",{className:"text-2xl font-semibold text-white dark:text-white",children:"Modifications to Pending Edit"}),e.jsx("button",{onClick:()=>{u(null),r(!1),n(!1),a(!1)},className:"text-white hover:text-white dark:text-gray-400 dark:hover:text-white",children:e.jsx(M,{icon:"close",className:"h-5 w-5"})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"mb-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Edit Request:"}),e.jsxs("span",{className:"text-sm text-white",children:[s==null?void 0:s.program_name," - ",s==null?void 0:s.team_name]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Producer Name:"}),e.jsx("span",{className:"text-sm text-white",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Edit Policy:"}),f?e.jsx("a",{target:"_blank",className:"text-sm text-primary underline hover:text-primary/90",href:`${f}`,children:"Edit_Policy.pdf"}):e.jsx("span",{className:"text-sm text-white",children:"null"})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Do you want to change edit type:"}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-4",children:g?e.jsx(Be,{size:15,color:"white"}):e.jsxs(e.Fragment,{children:[p.map(j=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"radio",checked:j.id===parseInt(m),onChange:$=>{l($.target.checked?j.id:null)},className:"h-4 w-4",name:"special",value:j.id}),e.jsx("span",{className:"text-sm text-white",children:j.edit_type}),e.jsxs("span",{className:"group relative",children:[e.jsx(M,{icon:"question-circle",className:"h-3 w-3 cursor-pointer text-white"}),e.jsx("p",{className:"invisible absolute -top-5 z-[4] w-[200px] rounded bg-gray-100 p-3 text-xs text-gray-900 group-hover:visible",children:j.note_keys})]})]},j.id)),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"radio",checked:m==="",onChange:j=>{l(j.target.checked?"":null)},className:"h-4 w-4",name:"special"}),e.jsx("span",{className:"text-sm text-white",children:"None"})]})]})})]}),e.jsxs("div",{className:"mb-6 text-center",children:[e.jsx("p",{className:"text-sm text-white",children:"Would you like to revise the previous version of the edit or start new?"}),e.jsxs("p",{className:"mt-2 text-xs italic text-warning",children:["ⓘ Submitting a new or revised edit will reset the due date based on newly submitted date and edit type. Please review edit policy for further information.",e.jsx("br",{}),e.jsx("br",{}),"ⓘ Starting with blank count sheets will delete data from previous pending edit."]})]}),e.jsxs("div",{className:"mb-8 flex justify-center gap-4",children:[e.jsx("button",{onClick:()=>{m===null?R(N,"Make a selection on edit Type",5e3,"warning"):(console.log(s==null?void 0:s.eight_count),i(s!=null&&s.eight_count?parseInt(s==null?void 0:s.eight_count):0),h(!0),r(!1),n(!1),a(!1))},className:"flex h-[56px] w-[146px] items-center justify-center rounded bg-primary px-6 py-2 text-xs font-medium text-white hover:bg-opacity-90",children:e.jsx("span",{className:"text-[13px] leading-[15px]",children:"Revise Previous Pending Version"})}),e.jsx("button",{onClick:async()=>{m===null?R(N,"Make a selection on edit Type",5e3,"warning"):(i("Blank"),await ea(s==null?void 0:s.id),await fs({id:s==null?void 0:s.project_id,discount:0,payment_status:1}),r(!1),n(!1),a(!1))},className:"flex h-[56px] w-[146px] items-center justify-center rounded bg-primary px-6 py-2 text-xs font-medium text-white hover:bg-opacity-90",children:e.jsx("span",{className:"text-[13px] leading-[15px]",children:"Start With Blank 8-count Sheet"})})]}),e.jsx("div",{className:"flex items-center justify-start",children:e.jsxs("button",{onClick:()=>{n(!0),a(!1)},className:"flex items-center justify-center gap-2 rounded bg-primary px-6 py-2 font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"arrow-left",className:"text-xs"}),e.jsx("span",{children:"Previous"})]})})]})]})})},Fc=({isOpen:o,setIsOpen:t,setisOpenRequestEdit:s,setOpenEditView:r,editData:a})=>{console.log(a);const n=st(),i=y.useRef(null),{dispatch:c,state:l}=d.useContext(xe),m=async()=>{var p;const h=await ls({user_id:localStorage.getItem("user"),page:1,limit:5e4,edit_status:2});c({type:"SET_CURRENT_PENDING_LENGTH",payload:{pendingLength:((p=h==null?void 0:h.list)==null?void 0:p.length)||0}})};y.useEffect(()=>{document.querySelector("#mainContainer").scrollTo({top:0}),m(),window.scrollTo({top:0})},[o]),y.useEffect(()=>{const h=p=>{i.current&&!i.current.contains(p.target)&&(t(!1),r(""))};return o&&document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}},[o]);function u(h){if(h){var p=h==null?void 0:h.split("-"),x=p[1].padStart(2,"0")+"-"+p[2].padStart(2,"0")+"-"+p[0];return x}}return e.jsx("div",{ref:i,className:"custom-overflow fixed inset-0 z-[52] flex h-full w-full items-center justify-center overflow-y-auto px-4 py-8 backdrop-blur-sm",children:e.jsxs("div",{className:"shadow-default relative w-full max-w-[800px] rounded border border-strokedark bg-boxdark p-4 sm:p-8 dark:border-strokedark dark:bg-boxdark",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-strokedark pb-4 dark:border-strokedark",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("h3",{className:"text-2xl font-semibold text-white dark:text-white",children:"Edit Request Confirmed"})}),e.jsx("button",{onClick:()=>{r(""),t(!1)},className:"text-white hover:text-white dark:text-gray-400 dark:hover:text-white",children:e.jsx(M,{icon:"close",className:"h-5 w-5"})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"mb-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Program & Team:"}),e.jsxs("span",{className:"text-sm text-white",children:[a==null?void 0:a.program_name," - ",a==null?void 0:a.team_name]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Edit Type:"}),e.jsx("span",{className:"text-sm text-white",children:a==null?void 0:a.edit_type})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Date Requested:"}),e.jsx("span",{className:"text-sm text-white",children:fe(a==null?void 0:a.request_date,"YYYY-MM-DD").format("MM-DD-YYYY")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Due Date:"}),e.jsx("span",{className:"text-sm text-white",children:u(a.due_date)})]})]}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-4",children:[e.jsxs("button",{onClick:()=>{n("/client/projects"),r(""),t(!1)},className:"flex items-center justify-center gap-2 rounded bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"arrow-left",className:"text-xs"}),e.jsx("span",{children:"Back to Projects"})]}),e.jsxs("button",{onClick:()=>{n("/client/edits"),r(""),t(!1)},className:"flex items-center justify-center gap-2 rounded bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx(M,{icon:"arrow-left",className:"text-xs"}),e.jsx("span",{children:"Back to Edits"})]}),e.jsxs("button",{onClick:()=>{t(!1),s(!0),r("")},className:"flex items-center justify-center gap-2 rounded bg-primary px-6 py-2 text-sm font-medium text-white hover:bg-opacity-90",children:[e.jsx("span",{children:"Request Edit"}),e.jsx(M,{icon:"plus",className:"text-xs"})]})]})]})]})})},Yc=()=>{var Q,W;const{dispatch:o,state:t}=d.useContext(xe),[s,r]=y.useState(!1),[a,n]=y.useState(!1);console.log(a,"dhdh");const[i,c]=y.useState(!1),[l,m]=y.useState(!1),[u,h]=y.useState(!1),[p,x]=y.useState(""),[f,v]=d.useState(0),[g,w]=d.useState(0),[N,k]=d.useState(0),[j,$]=d.useState(!1),[V,L]=d.useState(!1),z=localStorage.getItem("clientPageSizeEdit"),[q,H]=d.useState(!1),[Z,U]=d.useState(z?Number(z):30),[I,O]=y.useState(null),[P,se]=y.useState(null),[T,ee]=y.useState(null),[ne,we]=y.useState(!0),[S,re]=y.useState(!1),[Oe,Ae]=y.useState(!1),ce=st(),[ie,ue]=d.useState([]),[be,Le]=d.useState({}),[A,ge]=d.useState(""),{dispatch:ve,state:ze}=d.useContext(Me),[Ee,ke]=y.useState(!1);y.useState(!1);const[Fe,G]=y.useState([]),[Pe,ye]=y.useState([]),[je,Se]=y.useState({}),[Je,et]=y.useState([]),[Ve,Ue]=y.useState(""),[tt,it]=y.useState({}),Ie=jt(),ut=new URLSearchParams(Ie.search).get("params"),Ke="https://equalityrecords.com/";console.log(be);const $e=async E=>{try{const Y=await ir(Number(E));Y.error?R(o,Y.message,5e3,"error"):Le(Y.model)}catch(Y){Ce(ve,Y.message)}},mt=async()=>{try{const E=await ws();et(E.list)}catch{}};y.useEffect(()=>{(async function(){await ht()})()},[]),y.useEffect(()=>{mt()},[]),y.useEffect(()=>{(async function(){if(ut){ke(!0);const E=Fe.find(K=>K.value==ut);O(E);const Y=await pt(E==null?void 0:E.value);Y&&Fe.length>0?(h(!0),ke(!1)):!Y&&Fe.length>0&&(n(!0),ke(!1))}})()},[Fe]);const We=async E=>{try{const Y=await ct(E);Y.error?R(o,Y.message,5e3,"error"):ge(Ke+"survey/"+Y.model.uuidv4)}catch(Y){Ce(ve,Y.message)}},ht=async()=>{try{ke(!0);const E=await aa();if(!E.error&&E.list.length>0){let Y=[],K=[];E.list.length>0&&E.list.filter(X=>(X==null?void 0:X.payment_status)===4||(X==null?void 0:X.payment_status)===1).forEach(X=>{Y.push(X.team_name),K.push({value:X.id,label:X.team_name,user_id:X.user_id,program:X.program_name})}),Y=[...new Set(Y)],Y.sort(),K.sort((ae,X)=>ae.label.localeCompare(X.label)),G(K),ke(!1)}}catch(E){ke(!1),Ce(ve,E.message)}},pt=async E=>{try{const Y=await ls({user_id:localStorage.getItem("user"),page:1,limit:1e4,edit_status:2}),{list:K,total:ae,limit:X,num_pages:me,page:le}=Y,C=K.find(b=>b.project_id===E)||null;return C?(it(C),!0):!1}catch(Y){Ce(ve,Y.message)}};async function D(E,Y,K=S?{edit_status:1}:{edit_status:2}){H(!0);try{const ae=await ls({user_id:localStorage.getItem("user"),page:E,limit:Y,...K}),{list:X,total:me,limit:le,num_pages:C,page:b}=ae;let _=[];if(S?_=X.sort((B,oe)=>new Date(oe==null?void 0:oe.completed_date)-new Date(B==null?void 0:B.completed_date)):_=X.sort((B,oe)=>new Date(B==null?void 0:B.due_date)-new Date(oe==null?void 0:oe.due_date)),Ve){const oe=X.filter(de=>de.edit_type_name==Ve).sort((de,pe)=>new Date(de==null?void 0:de.due_date)-new Date(pe==null?void 0:pe.due_date));ye(oe)}else ye(_);k(b),v(C),w(me),$(b>1),L(b+1<=C),H(!1)}catch(ae){H(!1),Ce(ve,ae.message)}}y.useEffect(()=>{(async function(){if(I){if(I!=null&&I.user_id){const Y=await Nt(I.user_id);se(Y==null?void 0:Y.model)}await We(I.value),await $e(I.value);const E=await ct(Number(I.value));if(!E.error){const K=new URL(Ke+"survey/"+E.model.uuidv4).pathname.split("/survey/")[1];K&&zt(K)?async function(){const X=await Jt({uuidv4:K});X.error||(X.model.status===0?ue([]):X.model.status===1&&ue(X.model.ideas))}():R(o,"Invalid URL",5e3,"error")}}})()},[I,u,Fe]),d.useEffect(()=>{o({type:"SETPATH",payload:{path:"edits"}}),D(N,Z)},[S,ne,Ve,Oe]);function J(E){if(E){var Y=E==null?void 0:E.split("-"),K=Y[1].padStart(2,"0")+"-"+Y[2].padStart(2,"0")+"-"+Y[0];return K}}return console.log(p),e.jsxs("div",{className:"p-4 h-full max-w-screen md:p-4 lg:p-6 xl:p-8",id:"mainContainer",children:[s&&e.jsx(Mc,{setIsOpen:r,isOpen:s,setSelectedTeam:O,selectedTeam:I,setUserDetails:se,setOpenEditStep2:n,teamList:Fe,getPending:pt,setIsOpen2:n,setIsOpen4:h}),a&&e.jsx(zc,{setSelectedEditType:ee,selectedEditType:T,isOpen:a,setIsOpen1:r,setSelectedTeam:O,setIsOpen2:n,producer_id:P==null?void 0:P.id,setIsOpen3:m}),u&&e.jsx(Bc,{setReviseEdit:c,setSelectedTeam:O,setSelectedEditType:ee,selectedEditType:T,producer_id:P==null?void 0:P.id,SameTeamNameEdit:tt,setIsOpen1:r,setIsOpen3:h,setIsOpen2:n,isOpen:u,producerName:P?(P==null?void 0:P.first_name)+" "+(P==null?void 0:P.last_name):"",setOpenEditView:x}),l&&e.jsx(Uc,{setIsOpen1:r,setSelectedTeam:O,edit_policy:P==null?void 0:P.edit_policy_link,setIsOpen3:m,setIsOpen2:n,isOpen:l,producer_id:P==null?void 0:P.id,producerName:(P==null?void 0:P.first_name)+" "+(P==null?void 0:P.last_name),setOpenEditView:x}),((Q=p==null?void 0:p.toString())==null?void 0:Q.length)>0&&p&&!Oe||i&&!Oe?e.jsx($c,{setReviseEdit:c,reviseEdit:i,setSelectedTeam:O,SameTeamNameEdit:tt,producerName:(P==null?void 0:P.first_name)+" "+P.last_name,producer_id:P==null?void 0:P.id,selectedTeam:I,loader:Ee,selectedEditType:T,surveyLink:A,viewModel:be,submittedIdeas:ie,setIsOpen:x,isOpen:p,projectID:I==null?void 0:I.value,setConfirmationPage:Ae,setEditData:Se}):null,Oe&&e.jsx(Fc,{editData:je,setIsOpen:Ae,isOpen:Oe,setisOpenRequestEdit:r,setOpenEditView:x}),(!p||((W=p==null?void 0:p.toString())==null?void 0:W.length)<0)&&!Oe?Ee?e.jsx("div",{className:"flex justify-center items-center w-full h-screen",children:e.jsx(Be,{color:"#fff",size:20,className:"mr-3"})}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"rounded border shadow-default border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"sm:px-6.5 border-b border-strokedark px-4 py-4 2xl:px-9 dark:border-strokedark",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx("h4",{className:"text-2xl font-semibold text-white dark:text-white",children:"Edits"}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("button",{onClick:()=>{we(!0),re(!1)},className:`rounded-md px-3 py-1 text-sm font-medium ${ne?"text-white bg-primary":"text-white hover:bg-meta-4"}`,children:"Pending"}),e.jsx("button",{onClick:()=>{re(!0),we(!1)},className:`rounded-md px-3 py-1 text-sm font-medium ${S?"text-white bg-primary":"text-white hover:bg-meta-4"}`,children:"Completed"})]})]}),e.jsx("button",{onClick:()=>r(!0),className:"inline-flex gap-1 justify-center items-center px-4 py-2 text-sm font-medium text-white rounded-md bg-primary hover:bg-opacity-90",children:"Request Edit +"})]})}),e.jsx("div",{className:"min-h-[200px] p-4 md:p-6 2xl:p-10 ",children:e.jsx("div",{className:"overflow-x-auto w-full custom-overflow",children:e.jsxs("table",{className:"w-full table-auto",children:[e.jsx("thead",{className:"bg-meta-4",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Program/Team"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Team Name"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Producer"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Edit Type"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase whitespace-nowrap text-bodydark1",children:"Request Date"}),e.jsx("th",{className:"px-4 py-3 text-xs font-medium tracking-wider text-left uppercase text-bodydark1",children:"Due Date"})]})}),q?q?e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:"6",className:"text-center",children:e.jsxs("span",{className:"trans relative top-[30px] m-4 animate-pulse whitespace-nowrap p-4 pb-8 text-xl font-semibold text-white ease-out",children:[e.jsx(Be,{color:"#fff",size:20,className:"mr-3"})," ","Loading Edits..."]})})})}):!q&&Pe.length===0?e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:"6",className:"text-center",children:e.jsx("span",{className:"relative top-[10px] m-4 p-4 font-semibold text-white",children:"No data found"})})})}):Ee&&e.jsx("tbody",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:"6",className:"text-center",children:e.jsxs("span",{className:"trans relative top-[30px] m-4 animate-pulse whitespace-nowrap p-4 pb-8 text-xl font-semibold text-white ease-out",children:[e.jsx(Be,{color:"#fff",size:20,className:"mr-3"})," ","Loading Edits..."]})})})}):e.jsx("tbody",{className:"cursor-pointer text-bodydark1",children:Pe.map(E=>e.jsxs("tr",{onClick:()=>ce(`/client/view-edit/${E.id}/${E.project_id}`),className:"border-b border-strokedark hover:bg-primary/5 dark:border-strokedark",children:[e.jsx("td",{className:"px-4 py-4 pl-6 text-white whitespace-nowrap 2xl:pl-9",children:e.jsx("span",{children:E.program_name})}),e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:e.jsx("span",{children:E.team_name})}),e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:e.jsx("span",{children:E.producer})}),e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:e.jsx("span",{children:E.edit_type_name})}),e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:e.jsx("span",{children:fe(E==null?void 0:E.request_date,"YYYY-MM-DD").format("MM-DD-YYYY")})}),e.jsx("td",{className:"px-4 py-4 whitespace-nowrap",children:e.jsx("span",{children:J(E.due_date)})})]},E.id))})]})})})]})}):null]})},Jc=()=>{var we;const{dispatch:o}=d.useContext(xe);y.useState("");const[t,s]=d.useState([]),[r,a]=d.useState({}),[n,i]=d.useState(""),[c,l]=y.useState(!1),[m,u]=d.useState({}),{dispatch:h,state:p}=d.useContext(Me),[x,f]=y.useState(!1),v="https://equalityrecords.com/",g=at(),w=g==null?void 0:g.project_id,N="view-mode",[k,j]=d.useState(!1),[$,V]=y.useState(null),[L,z]=d.useState(!1);console.log(r);const q=()=>{j(!1)},H=()=>{j(!1),setTimeout(()=>{z(!0)},500)},Z=st(),U=async S=>{await ea(S),await fs({id:w,discount:0,payment_status:1}),z(!1),Z("/client/edits"),R(o,"Edit Deleted",5e3)},I=async S=>{try{const re=await ct(S);re.error?R(o,re.message,5e3,"error"):i(v+"survey/"+re.model.uuidv4)}catch(re){Ce(h,re.message)}},O=async()=>{const S=await Nn(g.id);l(S.model.edit_status===1),u(S.model)},P=async S=>{try{console.log("kdjdj");const re=await ir(Number(S));console.log(re),re.error?R(o,re.message,5e3,"error"):(console.log(re,"dkjjdjdjjdjjdj"),a(re.model))}catch(re){Ce(h,re.message)}};y.useEffect(()=>{O()},[]),y.useEffect(()=>{(async function(){f(!0),await I(w);const S=await P(w);V(S);const re=await ct(Number(w));if(!re.error){const Ae=new URL(v+"survey/"+re.model.uuidv4).pathname.split("/survey/")[1];Ae&&zt(Ae)?async function(){const ie=await Jt({uuidv4:Ae});ie.error||(ie.model.status===0?s([]):ie.model.status===1&&s(ie.model.ideas))}():R(o,"Invalid URL",5e3,"error")}f(!1)})()},[]);const[se,T]=d.useState(!1),[ee,ne]=d.useState(!1);return d.useEffect(()=>{const S=setInterval(()=>{var re;if((re=window.downloadManager)!=null&&re.downloads){const Oe=Array.from(window.downloadManager.downloads.values()).some(ce=>ce.type==="video"&&ce.status==="downloading"),Ae=Array.from(window.downloadManager.downloads.values()).some(ce=>ce.type==="music"&&ce.status==="downloading");T(Oe),ne(Ae)}},1e3);return()=>clearInterval(S)},[]),e.jsxs(e.Fragment,{children:[" ",k?e.jsx(Ct,{confirmText:"Are you sure you want to delete this edit?",setModalClose:q,setFormYes:H}):null,L?e.jsx(no,{confirmText:"Are you sure you want to delete this edit? This action cannot be undone.",setModalClose:z,setFormYes:()=>{U(g==null?void 0:g.id)}}):null,e.jsxs("div",{className:"p-4 h-full max-w-screen md:p-4 lg:p-6 xl:p-8",children:[e.jsxs("div",{className:"pt-10 rounded border shadow-default border-strokedark bg-boxdark dark:border-strokedark dark:bg-boxdark",children:[e.jsx("div",{className:"sm:px-6.5 border-b border-strokedark px-4 py-4 dark:border-strokedark",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("h3",{className:"text-xl font-medium text-white",children:"Edit Request for"}),e.jsx("p",{className:"text-xl font-medium text-white",children:(m==null?void 0:m.program_name)||"N/A"}),e.jsx("span",{children:"-"}),e.jsx("span",{onClick:()=>{localStorage.setItem("ClientProjectTeamName",""),localStorage.setItem("ClientProjectMixTypeId",""),localStorage.setItem("ClientProjectMixDateStart",""),localStorage.setItem("ClientProjectMixDateEnd",""),localStorage.setItem("clientProjectPageSize",""),localStorage.setItem("ClientProjectProducerName",""),Z(`/client/view-project/${w}`)},className:"text-xl cursor-pointer text-primary hover:text-opacity-90",children:(m==null?void 0:m.team_name)||"N/A"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx("span",{children:"Producer Name"}),e.jsx("span",{children:m==null?void 0:m.producer})]})]}),e.jsx("div",{className:"flex flex-wrap gap-3 items-center",children:e.jsx("button",{onClick:()=>Z(-1),className:"inline-flex items-center justify-center rounded-md border border-strokedark bg-meta-4 px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90",children:"Back"})})]})}),e.jsxs("div",{className:"p-4 md:p-6 2xl:p-10",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("span",{className:"text-sm text-white",children:"Notes for Producer"}),e.jsx("div",{className:"ml-auto mt-2 flex w-[70%] border-b border-strokedark pb-4 text-base text-white dark:border-strokedark",dangerouslySetInnerHTML:{__html:((we=m==null?void 0:m.producer_notes)==null?void 0:we.replace(/\n/g,"<br> "))||"N/A"}})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"custom-overflow max-h-[300px] overflow-y-auto rounded border border-strokedark bg-boxdark p-4",children:e.jsx(io,{viewModel:r,projectID:w,edit_complete:!0,hasDownloads:se})}),e.jsx(gr,{action:N,edit_eight_count_id:m==null?void 0:m.eight_count,surveyLink:n,viewModel:r,projectID:w,edit_complete:!0,submittedIdeas:t}),(m==null?void 0:m.edit_status)===1&&e.jsx("div",{className:"custom-overflow max-h-[300px] overflow-y-auto rounded border border-strokedark bg-boxdark p-4",children:e.jsx(ao,{viewModel:r,projectID:w,edit_complete:c,hasDownloads:ee})})]})]})}),e.jsx("div",{className:"flex justify-center items-center mt-8 w-full",children:e.jsx("button",{onClick:()=>j(!0),className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-2.5 text-center font-medium text-white hover:bg-opacity-90",children:e.jsx("span",{className:"text-[14px] font-medium",children:"Delete"})})})]})]})," "]})]})},qc={globalMessage:"",toastStatus:"success",isOpen:!0,showBackButton:!1,path:"",projectRow:null,leftPanel:[],middlePanel:[],rightPanel:{},selectedComponent:0,rightComponentId:"",selectedPageComponent:0,rooms:[],onboardingSteps:-1,subStatus:null},Gc=d.createContext(qc);function Vc(){return e.jsx(kn,{})}function Wc(o){return o?e.jsxs(br,{children:[e.jsx(He,{exact:!0,path:"/",element:e.jsx(Us,{})}),e.jsx(He,{path:"/login",element:e.jsx(Ps,{to:"/projects",replace:!0})}),e.jsx(He,{path:"/forgot",element:e.jsx(Ps,{to:"/projects",replace:!0})}),e.jsx(He,{path:"/reset",element:e.jsx(Ps,{to:"/projects",replace:!0})}),e.jsx(He,{path:"/projects",element:e.jsx(nc,{})}),e.jsx(He,{exact:!0,path:"/profile",element:e.jsx(Vn,{})}),e.jsx(He,{path:"/view-project/:id",element:e.jsx(Dc,{})}),e.jsx(He,{path:"/count-tracks",element:e.jsx(Lc,{})}),e.jsx(He,{path:"/edits",element:e.jsx(Yc,{})}),e.jsx(He,{path:"/view-edit/:id/:project_id",element:e.jsx(Jc,{})}),e.jsx(He,{path:"*",exact:!0,element:e.jsx(jr,{})})]}):e.jsxs(br,{children:[e.jsx(He,{exact:!0,path:"/",element:e.jsx(Us,{})}),e.jsx(He,{exact:!0,path:"/login",element:e.jsx(Mn,{})}),e.jsx(He,{exact:!0,path:"/forgot",element:e.jsx(zn,{})}),e.jsx(He,{exact:!0,path:"/reset",element:e.jsx(Un,{})}),e.jsx(He,{path:"*",exact:!0,element:e.jsx(jr,{})})]})}function Hc(){const{state:o}=d.useContext(Me),{state:t}=d.useContext(Gc);return jt().pathname==="/"?e.jsxs("div",{className:"h-full bg-boxdark-2 text-bodydark dark:bg-boxdark-2 dark:text-bodydark",children:[e.jsx(wn,{}),e.jsx(Us,{}),e.jsx(yr,{}),e.jsx(wr,{})]}):e.jsx("div",{className:"h-full bg-boxdark-2 text-bodydark dark:bg-boxdark-2 dark:text-bodydark",children:e.jsxs("div",{className:"flex overflow-hidden h-screen",children:[o.isAuthenticated&&e.jsx("div",{className:`left-0 top-0 z-[9] h-screen w-[180px] flex-shrink-0 bg-boxdark duration-300 ease-in-out ${t.isOpen?"left-[0px] translate-x-0 md:left-0 lg:static ":"fixed -translate-x-full lg:-translate-x-full"}`,children:Vc()}),e.jsxs("div",{id:"mainContainer",className:"flex overflow-y-auto overflow-x-hidden relative flex-col flex-1",children:[o.isAuthenticated&&e.jsx("header",{className:"sticky top-0 z-[9] flex w-full bg-boxdark drop-shadow-none",children:e.jsx(yn,{})}),e.jsx("main",{children:e.jsx("div",{className:"w-full h-full",children:e.jsxs(e.Fragment,{children:[Wc(o.isAuthenticated),e.jsx(yr,{}),e.jsx(wr,{})]})})})]})]})})}const Qc=po("pk_test_51Ll5ukBgOlWo0lDUrBhA2W7EX2MwUH9AR5Y3KQoujf7PTQagZAJylWP1UOFbtH4UwxoufZbInwehQppWAq53kmNC00UIKSmebO");function Kc(){return typeof window<"u"&&typeof global>"u"&&(window.global=window),e.jsx(cn,{children:e.jsx(bn,{children:e.jsx(uo,{children:e.jsx(ho,{stripe:Qc,children:e.jsx(Hc,{})})})})})}Zo.add($o,en,tn);const Xc=mo.createRoot(document.getElementById("root"));Xc.render(e.jsx(Kc,{}));