Files
equalityrecord_frontend_client/dist/assets/index-c20b3403.js
T

107 lines
373 KiB
JavaScript
Raw Normal View History

2025-04-04 07:29:59 +01:00
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&
@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.lice
@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)
`+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
`);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]==="
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.Li
`)}),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-70
${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.js
`),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-
`)})]},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.l