fansunited-management-components 1.59.0-RC5 → 1.59.0-RC6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Ae,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("react"),require("fansunited-sdk-esm"),require("react-dom"),require("@emotion/styled"),require("@emotion/react"),require("react-quill"),require("@mui/joy"),require("@mui/icons-material")):typeof define=="function"&&define.amd?define(["exports","react","fansunited-sdk-esm","react-dom","@emotion/styled","@emotion/react","react-quill","@mui/joy","@mui/icons-material"],y):(Ae=typeof globalThis!="undefined"?globalThis:Ae||self,y(Ae.FansUnitedComponents={},Ae.React,Ae.FansUnitedSDK,Ae.ReactDOM,Ae.EmotionStyled,Ae.EmotionReact,Ae.ReactQuill,Ae.MaterialUIJoy,Ae.MaterialUIIcons))})(this,function(Ae,y,We,yt,Di,me,Oi,h,_e){"use strict";var mz=Object.defineProperty,vz=Object.defineProperties;var bz=Object.getOwnPropertyDescriptors;var Ks=Object.getOwnPropertySymbols,yz=Object.getPrototypeOf,Lb=Object.prototype.hasOwnProperty,Mb=Object.prototype.propertyIsEnumerable,xz=Reflect.get;var Pi=Math.pow,Wu=(Ae,y,We)=>y in Ae?mz(Ae,y,{enumerable:!0,configurable:!0,writable:!0,value:We}):Ae[y]=We,M=(Ae,y)=>{for(var We in y||(y={}))Lb.call(y,We)&&Wu(Ae,We,y[We]);if(Ks)for(var We of Ks(y))Mb.call(y,We)&&Wu(Ae,We,y[We]);return Ae},Q=(Ae,y)=>vz(Ae,bz(y));var qs=Ae=>typeof Ae=="symbol"?Ae:Ae+"",Ze=(Ae,y)=>{var We={};for(var yt in Ae)Lb.call(Ae,yt)&&y.indexOf(yt)<0&&(We[yt]=Ae[yt]);if(Ae!=null&&Ks)for(var yt of Ks(Ae))y.indexOf(yt)<0&&Mb.call(Ae,yt)&&(We[yt]=Ae[yt]);return We};var J=(Ae,y,We)=>Wu(Ae,typeof y!="symbol"?y+"":y,We);var Br=(Ae,y,We)=>xz(yz(Ae),We,y);var _=(Ae,y,We)=>new Promise((yt,Di)=>{var me=_e=>{try{h(We.next(_e))}catch(Ri){Di(Ri)}},Oi=_e=>{try{h(We.throw(_e))}catch(Ri){Di(Ri)}},h=_e=>_e.done?yt(_e.value):Promise.resolve(_e.value).then(me,Oi);h((We=We.apply(Ae,y)).next())});function Ri(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const K=Ri(y),Te={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hi:{key:"hi",name:"Hindi"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},Li={ar:Te.ar,"ar-dz":Te.ar,"ar-bh":Te.ar,"ar-eg":Te.ar,"ar-iq":Te.ar,"ar-jo":Te.ar,"ar-kw":Te.ar,"ar-lb":Te.ar,"ar-ly":Te.ar,"ar-ma":Te.ar,"ar-om":Te.ar,"ar-qa":Te.ar,"ar-sa":Te.ar,"ar-sy":Te.ar,"ar-tn":Te.ar,"ar-ae":Te.ar,"ar-ye":Te.ar,bg:Te.bg,da:Te.da,de:Te.de,en:Te.en,"en-gb":Te.en,"en-us":Te.en,el:Te.el,es:Te.es,fr:Te.fr,hi:Te.hi,hu:Te.hu,it:Te.it,nl:Te.nl,pt:Te.pt,"pt-br":Te["pt-br"],ro:Te.ro,sk:Te.sk,sr:Te.sr,sv:Te.sv,sw:Te.sw},qn={ar:"sa",bg:"bg",da:"dk",de:"de",en:"gb",el:"gr",es:"es",fr:"fr",hi:"in",hu:"hu",it:"it",nl:"nl",pt:"pt","pt-br":"br",ro:"ro",sk:"sk",sr:"rs",sv:"se",sw:"ke"};var jt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Gu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Yu={exports:{}},jo={};/**
1
+ (function(Ae,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("react"),require("fansunited-sdk-esm"),require("react-dom"),require("@emotion/styled"),require("@emotion/react"),require("react-quill"),require("@mui/joy"),require("@mui/icons-material")):typeof define=="function"&&define.amd?define(["exports","react","fansunited-sdk-esm","react-dom","@emotion/styled","@emotion/react","react-quill","@mui/joy","@mui/icons-material"],y):(Ae=typeof globalThis!="undefined"?globalThis:Ae||self,y(Ae.FansUnitedComponents={},Ae.React,Ae.FansUnitedSDK,Ae.ReactDOM,Ae.EmotionStyled,Ae.EmotionReact,Ae.ReactQuill,Ae.MaterialUIJoy,Ae.MaterialUIIcons))})(this,function(Ae,y,We,yt,Di,me,Oi,h,_e){"use strict";var mz=Object.defineProperty,vz=Object.defineProperties;var bz=Object.getOwnPropertyDescriptors;var Ks=Object.getOwnPropertySymbols,yz=Object.getPrototypeOf,Lb=Object.prototype.hasOwnProperty,Mb=Object.prototype.propertyIsEnumerable,xz=Reflect.get;var Pi=Math.pow,Wu=(Ae,y,We)=>y in Ae?mz(Ae,y,{enumerable:!0,configurable:!0,writable:!0,value:We}):Ae[y]=We,L=(Ae,y)=>{for(var We in y||(y={}))Lb.call(y,We)&&Wu(Ae,We,y[We]);if(Ks)for(var We of Ks(y))Mb.call(y,We)&&Wu(Ae,We,y[We]);return Ae},Q=(Ae,y)=>vz(Ae,bz(y));var qs=Ae=>typeof Ae=="symbol"?Ae:Ae+"",Ze=(Ae,y)=>{var We={};for(var yt in Ae)Lb.call(Ae,yt)&&y.indexOf(yt)<0&&(We[yt]=Ae[yt]);if(Ae!=null&&Ks)for(var yt of Ks(Ae))y.indexOf(yt)<0&&Mb.call(Ae,yt)&&(We[yt]=Ae[yt]);return We};var J=(Ae,y,We)=>Wu(Ae,typeof y!="symbol"?y+"":y,We);var Br=(Ae,y,We)=>xz(yz(Ae),We,y);var _=(Ae,y,We)=>new Promise((yt,Di)=>{var me=_e=>{try{h(We.next(_e))}catch(Ri){Di(Ri)}},Oi=_e=>{try{h(We.throw(_e))}catch(Ri){Di(Ri)}},h=_e=>_e.done?yt(_e.value):Promise.resolve(_e.value).then(me,Oi);h((We=We.apply(Ae,y)).next())});function Ri(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const K=Ri(y),Te={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hi:{key:"hi",name:"Hindi"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},Li={ar:Te.ar,"ar-dz":Te.ar,"ar-bh":Te.ar,"ar-eg":Te.ar,"ar-iq":Te.ar,"ar-jo":Te.ar,"ar-kw":Te.ar,"ar-lb":Te.ar,"ar-ly":Te.ar,"ar-ma":Te.ar,"ar-om":Te.ar,"ar-qa":Te.ar,"ar-sa":Te.ar,"ar-sy":Te.ar,"ar-tn":Te.ar,"ar-ae":Te.ar,"ar-ye":Te.ar,bg:Te.bg,da:Te.da,de:Te.de,en:Te.en,"en-gb":Te.en,"en-us":Te.en,el:Te.el,es:Te.es,fr:Te.fr,hi:Te.hi,hu:Te.hu,it:Te.it,nl:Te.nl,pt:Te.pt,"pt-br":Te["pt-br"],ro:Te.ro,sk:Te.sk,sr:Te.sr,sv:Te.sv,sw:Te.sw},qn={ar:"sa",bg:"bg",da:"dk",de:"de",en:"gb",el:"gr",es:"es",fr:"fr",hi:"in",hu:"hu",it:"it",nl:"nl",pt:"pt","pt-br":"br",ro:"ro",sk:"sk",sr:"rs",sv:"se",sw:"ke"};var jt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Gu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Yu={exports:{}},jo={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -216,7 +216,7 @@
216
216
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
217
217
  * See the License for the specific language governing permissions and
218
218
  * limitations under the License.
219
- */const Zs=[];var je;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(je||(je={}));const ud={debug:je.DEBUG,verbose:je.VERBOSE,info:je.INFO,warn:je.WARN,error:je.ERROR,silent:je.SILENT},c0=je.INFO,u0={[je.DEBUG]:"log",[je.VERBOSE]:"log",[je.INFO]:"info",[je.WARN]:"warn",[je.ERROR]:"error"},d0=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),i=u0[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class el{constructor(t){this.name=t,this._logLevel=c0,this._logHandler=d0,this._userLogHandler=null,Zs.push(this)}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in je))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?ud[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,je.DEBUG,...t),this._logHandler(this,je.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,je.VERBOSE,...t),this._logHandler(this,je.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,je.INFO,...t),this._logHandler(this,je.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,je.WARN,...t),this._logHandler(this,je.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,je.ERROR,...t),this._logHandler(this,je.ERROR,...t)}}function f0(e){Zs.forEach(t=>{t.setLogLevel(e)})}function h0(e,t){for(const n of Zs){let r=null;t&&t.level&&(r=ud[t.level]),e===null?n.userLogHandler=null:n.userLogHandler=(i,o,...a)=>{const l=a.map(c=>{if(c==null)return null;if(typeof c=="string")return c;if(typeof c=="number"||typeof c=="boolean")return c.toString();if(c instanceof Error)return c.message;try{return JSON.stringify(c)}catch(u){return null}}).filter(c=>c).join(" ");o>=(r!=null?r:i.logLevel)&&e({level:je[o].toLowerCase(),message:l,args:a,type:i.name})}}}const p0=(e,t)=>t.some(n=>e instanceof n);let dd,fd;function g0(){return dd||(dd=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function m0(){return fd||(fd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const hd=new WeakMap,tl=new WeakMap,pd=new WeakMap,nl=new WeakMap,rl=new WeakMap;function v0(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{n(Jn(e.result)),i()},a=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&hd.set(n,e)}).catch(()=>{}),rl.set(t,e),t}function b0(e){if(tl.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{n(),i()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});tl.set(e,t)}let il={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return tl.get(e);if(t==="objectStoreNames")return e.objectStoreNames||pd.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Jn(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function y0(e){il=e(il)}function x0(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ol(this),t,...n);return pd.set(r,t.sort?t.sort():[t]),Jn(r)}:m0().includes(e)?function(...t){return e.apply(ol(this),t),Jn(hd.get(this))}:function(...t){return Jn(e.apply(ol(this),t))}}function C0(e){return typeof e=="function"?x0(e):(e instanceof IDBTransaction&&b0(e),p0(e,g0())?new Proxy(e,il):e)}function Jn(e){if(e instanceof IDBRequest)return v0(e);if(nl.has(e))return nl.get(e);const t=C0(e);return t!==e&&(nl.set(e,t),rl.set(t,e)),t}const ol=e=>rl.get(e);function w0(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),l=Jn(a);return r&&a.addEventListener("upgradeneeded",c=>{r(Jn(a.result),c.oldVersion,c.newVersion,Jn(a.transaction),c)}),n&&a.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{o&&c.addEventListener("close",()=>o()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const S0=["get","getKey","getAll","getAllKeys","count"],I0=["put","add","delete","clear"],al=new Map;function gd(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(al.get(t))return al.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=I0.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||S0.includes(n)))return;const o=function(a,...l){return _(this,null,function*(){const c=this.transaction(a,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(l.shift())),(yield Promise.all([u[n](...l),i&&c.done]))[0]})};return al.set(t,o),o}y0(e=>Q(M({},e),{get:(t,n,r)=>gd(t,n)||e.get(t,n,r),has:(t,n)=>!!gd(t,n)||e.has(t,n)}));/**
219
+ */const Zs=[];var je;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(je||(je={}));const ud={debug:je.DEBUG,verbose:je.VERBOSE,info:je.INFO,warn:je.WARN,error:je.ERROR,silent:je.SILENT},c0=je.INFO,u0={[je.DEBUG]:"log",[je.VERBOSE]:"log",[je.INFO]:"info",[je.WARN]:"warn",[je.ERROR]:"error"},d0=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),i=u0[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class el{constructor(t){this.name=t,this._logLevel=c0,this._logHandler=d0,this._userLogHandler=null,Zs.push(this)}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in je))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?ud[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,je.DEBUG,...t),this._logHandler(this,je.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,je.VERBOSE,...t),this._logHandler(this,je.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,je.INFO,...t),this._logHandler(this,je.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,je.WARN,...t),this._logHandler(this,je.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,je.ERROR,...t),this._logHandler(this,je.ERROR,...t)}}function f0(e){Zs.forEach(t=>{t.setLogLevel(e)})}function h0(e,t){for(const n of Zs){let r=null;t&&t.level&&(r=ud[t.level]),e===null?n.userLogHandler=null:n.userLogHandler=(i,o,...a)=>{const l=a.map(c=>{if(c==null)return null;if(typeof c=="string")return c;if(typeof c=="number"||typeof c=="boolean")return c.toString();if(c instanceof Error)return c.message;try{return JSON.stringify(c)}catch(u){return null}}).filter(c=>c).join(" ");o>=(r!=null?r:i.logLevel)&&e({level:je[o].toLowerCase(),message:l,args:a,type:i.name})}}}const p0=(e,t)=>t.some(n=>e instanceof n);let dd,fd;function g0(){return dd||(dd=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function m0(){return fd||(fd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const hd=new WeakMap,tl=new WeakMap,pd=new WeakMap,nl=new WeakMap,rl=new WeakMap;function v0(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{n(Jn(e.result)),i()},a=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&hd.set(n,e)}).catch(()=>{}),rl.set(t,e),t}function b0(e){if(tl.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{n(),i()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});tl.set(e,t)}let il={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return tl.get(e);if(t==="objectStoreNames")return e.objectStoreNames||pd.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Jn(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function y0(e){il=e(il)}function x0(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(ol(this),t,...n);return pd.set(r,t.sort?t.sort():[t]),Jn(r)}:m0().includes(e)?function(...t){return e.apply(ol(this),t),Jn(hd.get(this))}:function(...t){return Jn(e.apply(ol(this),t))}}function C0(e){return typeof e=="function"?x0(e):(e instanceof IDBTransaction&&b0(e),p0(e,g0())?new Proxy(e,il):e)}function Jn(e){if(e instanceof IDBRequest)return v0(e);if(nl.has(e))return nl.get(e);const t=C0(e);return t!==e&&(nl.set(e,t),rl.set(t,e)),t}const ol=e=>rl.get(e);function w0(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),l=Jn(a);return r&&a.addEventListener("upgradeneeded",c=>{r(Jn(a.result),c.oldVersion,c.newVersion,Jn(a.transaction),c)}),n&&a.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{o&&c.addEventListener("close",()=>o()),i&&c.addEventListener("versionchange",u=>i(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const S0=["get","getKey","getAll","getAllKeys","count"],I0=["put","add","delete","clear"],al=new Map;function gd(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(al.get(t))return al.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=I0.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||S0.includes(n)))return;const o=function(a,...l){return _(this,null,function*(){const c=this.transaction(a,i?"readwrite":"readonly");let u=c.store;return r&&(u=u.index(l.shift())),(yield Promise.all([u[n](...l),i&&c.done]))[0]})};return al.set(t,o),o}y0(e=>Q(L({},e),{get:(t,n,r)=>gd(t,n)||e.get(t,n,r),has:(t,n)=>!!gd(t,n)||e.has(t,n)}));/**
220
220
  * @license
221
221
  * Copyright 2019 Google LLC
222
222
  *
@@ -2322,7 +2322,7 @@
2322
2322
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2323
2323
  * See the License for the specific language governing permissions and
2324
2324
  * limitations under the License.
2325
- */const PS="auth-compat";function DS(e){e.INTERNAL.registerComponent(new Qn(PS,t=>{const n=t.getProvider("app-compat").getImmediate(),r=t.getProvider("auth");return new Hl(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:jr.EMAIL_SIGNIN,PASSWORD_RESET:jr.PASSWORD_RESET,RECOVER_EMAIL:jr.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:jr.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:jr.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:jr.VERIFY_EMAIL}},EmailAuthProvider:nr,FacebookAuthProvider:wn,GithubAuthProvider:In,GoogleAuthProvider:Sn,OAuthProvider:Kr,SAMLAuthProvider:Zo,PhoneAuthProvider:Wl,PhoneMultiFactorGenerator:Mf,RecaptchaVerifier:_S,TwitterAuthProvider:An,Auth:Hl,AuthCredential:Gr,Error:Ut}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e.registerVersion(uS,dS)}DS(er);let qf=!1;const ro=e=>{if(qf)return er.auth();if(e&&e==="dev"){er.initializeApp({apiKey:"api_key"});const n=Uw();xl(n,"http://localhost:39199")}else{const n={apiKey:e&&e==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};er.initializeApp(n)}return qf=!0,er.auth()},OS=e=>e==="dev"?"http://localhost:8070/v1":e==="staging"?"https://client.fansunitedstagingapi.com/v1":e==="watg"?"https://client.watg.fansunitedapi.com/v1":e==="yolo"?"https://client.yolo.fansunitedapi.com/v1":e==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class RS{constructor(t,n){J(this,"apiKey","");J(this,"clientId","");J(this,"environment","");J(this,"mainQueryParams",{key:"",client_id:""});J(this,"headers",{"Content-Type":"application/json"});J(this,"clientApiBaseUrl","");J(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");J(this,"sportal365Config",null);J(this,"generateSignedInUrl",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/generate-signed-url?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(t)})}));J(this,"storeInBucket",(t,n,r)=>_(this,null,function*(){const i=yield fetch(t,{headers:r,method:"PUT",body:n});if(i.ok)return this.constructAssetsUrl(n.name);const o=yield i.text();this.throwErrorFromXmlResponse(o)}));J(this,"fetchImagesFromSportal365",(t,n,r)=>_(this,null,function*(){if(this.sportal365Config){const i={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let o={query:t,page:r.toString()};return n&&(n.from&&(o=Q(M({},o),{from:n.from})),n.to&&(o=Q(M({},o),{to:n.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(o),{headers:i})}}));J(this,"getSchedulersByEntityId",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks?`,r={key:this.apiKey,limit:"50",entity_id:t},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"setSchedulers",(t,n,r)=>_(this,null,function*(){let i="",o="";n==="CREATE"?(i=`/clients/${this.clientId}/scheduler/tasks?`,o="POST"):(i=`/clients/${this.clientId}/scheduler/tasks/${r}?`,o="PUT");const a={key:this.apiKey},l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l}),body:JSON.stringify(t),method:o})}));J(this,"deleteScheduledTask",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks/${t}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLoggedInStaffMember",()=>_(this,null,function*(){const r=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(window.atob(r).split("").map(function(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}));J(this,"constructAssetsUrl",t=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${t}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${t}`:`https://uploads.fansunitedassets.com/${this.clientId}/${t}`);J(this,"throwErrorFromXmlResponse",t=>{const n=new window.DOMParser().parseFromString(t,"text/xml"),r=n.getElementsByTagName("Message")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Message")[0].textContent:"",i=n.getElementsByTagName("Details")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Details")[0].textContent:"";throw new Error(r+" "+i)});J(this,"getToken",()=>_(this,null,function*(){const t=ro(this.environment).currentUser;return t?yield t.getIdToken():""}));this.apiKey=t.apiKey,this.clientId=t.clientId,this.environment=t.environment,this.mainQueryParams={key:t.apiKey,client_id:t.clientId},this.sportal365Config=n,this.clientApiBaseUrl=OS(this.environment)}}class LS{constructor(t){J(this,"baseUrl","https://v1.formula-1.api-sports.io");J(this,"apiKey");J(this,"headers");this.apiKey=t,this.headers={"X-RapidAPI-Key":this.apiKey,"Content-Type":"application/json"}}getRaces(t,n){return _(this,null,function*(){const r={season:t.toString(),type:(n==null?void 0:n.type)||"Race"};n&&Object.entries(n).forEach(([o,a])=>{a!=null&&(r[o]=a.toString())});const i=`${this.baseUrl}/races?${new URLSearchParams(r)}`;return yield fetch(i,{method:"GET",headers:this.headers})})}makeRequest(t,n){return _(this,null,function*(){let r=`${this.baseUrl}${t}`;return n&&Object.keys(n).length>0&&(r+=`?${new URLSearchParams(n)}`),yield fetch(r,{method:"GET",headers:this.headers})})}}const MS=e=>e==="dev"?"http://localhost:8060/v1":e==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":e==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":e==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":e==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",BS=e=>e==="dev"?"http://localhost:8040/v1":e==="staging"?"https://prediction.fansunitedstagingapi.com/v1":e==="watg"?"https://prediction.watg.fansunitedapi.com/v1":e==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":e==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",$S=e=>e==="dev"?"http://localhost:9040/v1":e==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":e==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":e==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":e==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",FS=e=>e==="dev"?"http://localhost:8020/v1":e==="staging"?"https://reporting.fansunitedstagingapi.com/v1":e==="watg"?"https://reporting.watg.fansunitedapi.com/v1":e==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":e==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",NS=e=>e==="dev"?"http://localhost:9030/v1":e==="staging"?"https://voting.fansunitedstagingapi.com/v1":e==="watg"?"https://voting.watg.fansunitedapi.com/v1":e==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":e==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",zS=e=>e==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":e==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":e==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":e==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",jS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://profile.fansunitedstagingapi.com/v1":e==="watg"?"https://profile.watg.fansunitedapi.com/v1":e==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":e==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",US=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://discussions.fansunitedstagingapi.com/v1":e==="watg"?"https://discussions.watg.fansunitedapi.com/v1":e==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":e==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1",VS=e=>e==="dev"?"http://localhost:9050/v1":e==="staging"?"https://ai-content-builder-131809830171.europe-west1.run.app/v1":e==="yolo"||e==="cska"?"":"https://ai-content-builder-150199313674.europe-west1.run.app/v1";class HS extends RS{constructor(n,r){super(n,r);J(this,"loyaltyBaseUrl","");J(this,"predictionBaseUrl","");J(this,"miniGamesApiBaseUrl","");J(this,"reportingApiBaseUrl","");J(this,"votingApiBaseUrl","");J(this,"profileApiBaseUrl","");J(this,"customResolverUrl","");J(this,"discussionsApiBaseUrl","");J(this,"aiServiceBaseUrl","");J(this,"apiSports");J(this,"getClientById",()=>_(this,null,function*(){const n=`/clients/${this.clientId}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createTemplate",n=>_(this,null,function*(){const r="/leaderboard/templates?",i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editTemplate",(n,r)=>_(this,null,function*(){const i=`/leaderboard/templates/${n}?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteTemplate",n=>_(this,null,function*(){const r=`/leaderboard/templates/${n}?`,i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"setWinners",n=>_(this,null,function*(){const r="/winners?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"exportDetailedLeaderboard",(n,r,i)=>_(this,null,function*(){const o=`/leaderboard/${n}/detailed?`,a=yield this.getToken(),l=M({},this.mainQueryParams);return r&&(l.group_id=r),yield fetch(this.loyaltyBaseUrl+o+new URLSearchParams(Q(M({},l),{limit:i.toString()})),{headers:Q(M({},this.headers),{Authorization:"Bearer "+a})})}));J(this,"exportDetailedGameLeaderboard",(n,r)=>_(this,null,function*(){const i=`/leaderboard/games/${n}/detailed?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(Q(M({},this.mainQueryParams),{limit:r.toString()})),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createGame",n=>_(this,null,function*(){const r="/games?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editGame",(n,r)=>_(this,null,function*(){const i=`/games/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getEntityFeature",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o={key:this.apiKey};return r&&(o.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o))}));J(this,"getClientFeatures",(n,r=1)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features?`,o={key:this.apiKey};n&&(o.disable_cache=Date.now().toString());const a=Q(M({},this.headers),{"x-api-version":r.toString()});return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:a})}));J(this,"updateEntityFeatures",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getClassicQuizFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/classic_quiz?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getEitherOrFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/either_or?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getPollFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/poll?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"createClassicQuiz",n=>_(this,null,function*(){const r="/classic-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateClassicQuiz",(n,r)=>_(this,null,function*(){const i=`/classic-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"getClassicQuizById",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/staff?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"deleteClassicQuiz",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"calculateQuestionsReport",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/questions-report?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST"})}));J(this,"exportUsers",n=>_(this,null,function*(){const r="/exports/users?",i=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"getClassicQuizParticipations",(n,r,i,o)=>_(this,null,function*(){const a="/classic-quizzes/participations?",l=Q(M({},this.mainQueryParams),{classic_quiz_ids:n,from_date:r,to_date:i,group_by:o}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(l),{headers:Q(M({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"getEntityParticipations",(n,r,i)=>_(this,null,function*(){const o=`/participations/${n}/breakdown?`,a=Q(M({},this.mainQueryParams),{from_date:r,to_date:i}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPoll",n=>_(this,null,function*(){const r="/polls?",i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePoll",(n,r)=>_(this,null,function*(){const i=`/polls/${n}?`,o=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePoll",n=>_(this,null,function*(){const r=`/polls/${n}?`,i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getEitherOrById",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}/staff?`,o=yield this.getToken();let a=null;return r&&(a=Q(M({},this.mainQueryParams),{client_id:r})),yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(a||this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getEitherOrByIdReadOnlyClient",(n,r,i)=>_(this,null,function*(){const o="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${n}/staff?`,l=yield this.getToken(),c={key:r,client_id:i};return yield fetch(o+a+new URLSearchParams(c),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createEitherOr",n=>_(this,null,function*(){const r="/either-or?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEitherOr",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteEitherOr",n=>_(this,null,function*(){const r=`/either-or/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLists",(n,r,i="DESC")=>_(this,null,function*(){const o=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:n.toString(),sort_order:i};r&&(a.start_after=r);const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+o+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"getListById",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getListContent",(n,r,i="DESC",o)=>_(this,null,function*(){const a=`/clients/${this.clientId}/lists/${n}/content?`,l={key:this.apiKey,limit:r.toString(),sort_order:i};o&&(l.page=o.toString());const c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(l),{headers:Q(M({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"createList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateList",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/lists/${n}?`,o={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:Q(M({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getLanguageConfig",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateLanguageConfig",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(n)})}));J(this,"createBracketGame",n=>_(this,null,function*(){const r="/custom/bracket?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateBracketGame",(n,r)=>_(this,null,function*(){const i=`/custom/bracket/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolvePredictions",n=>_(this,null,function*(){const r="/custom/bracket/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"exportLeadsPerEntity",n=>_(this,null,function*(){const r="/leads/export?",i=Q(M({},this.mainQueryParams),{content_id:n}),o=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getLeadStatistics",n=>_(this,null,function*(){const r="/leads/statistics?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(M(M({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"exportLeads",n=>_(this,null,function*(){const r="/leads/export?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(M(M({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createStandingGame",n=>_(this,null,function*(){const r="/custom/standing?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateStandingGame",(n,r)=>_(this,null,function*(){const i=`/custom/standing/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveStandingPredictions",n=>_(this,null,function*(){const r="/custom/standing/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"moderateUserPosts",(n,r)=>_(this,null,function*(){const i="/moderation/bulk?",o=yield this.getToken(),a=Q(M({},this.mainQueryParams),{user_id:n,reason:r});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"POST"})}));J(this,"getUserBanStatus",n=>_(this,null,function*(){const r=`/discussions/users/${n}/ban?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"banUser",(n,r,i)=>_(this,null,function*(){const o=`/discussions/users/${n}/ban?`,a=yield this.getToken(),l={banned_period_in_days:r,banned_reason:i};return yield fetch(this.discussionsApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"unbanUser",(n,r)=>_(this,null,function*(){const i=`/discussions/users/${n}/ban?`,o=yield this.getToken(),a={unban_reason:r};return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE",body:JSON.stringify(a)})}));J(this,"updateUser",(n,r,i)=>_(this,null,function*(){const o=`/profiles/${n}/verify?`,a=yield this.getToken(),l=r==="verify"?{verified:i}:{staff_member:i};return yield fetch(this.profileApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"deleteUserProfile",n=>_(this,null,function*(){const r=`/profiles/${n}?`,i=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"createDiscussion",n=>_(this,null,function*(){const r="/discussions?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"deleteDiscussion",n=>_(this,null,function*(){const r=`/discussions/${n}?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"moderatePosts",(...o)=>_(this,[...o],function*(n="",r=[],i){const a="/moderation/bulk?",l=yield this.getToken();let c={};if(r.length>0){const u=r.join(",");c=Q(M({},this.mainQueryParams),{post_ids:u,reason:i})}else c=Q(M({},this.mainQueryParams),{discussion_id:n,reason:i});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(c),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l}),method:"POST"})}));J(this,"pinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(M({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH"})}));J(this,"unpinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(M({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getPostsByStaffMember",n=>_(this,null,function*(){const r="/posts/staff?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(M(M({},this.mainQueryParams),n)),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"getReportedPosts",n=>_(this,null,function*(){const r="/posts/staff/reported?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(M(M({},this.mainQueryParams),n)),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateDiscussionsFeature",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/discussions?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"updateProfilePreferences",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/profile_preferences?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"getClientBadges",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/loyalty/badges?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateClientBadges",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/loyalty/badges?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"PUT",body:JSON.stringify(n)})}));J(this,"getEngagementThroughPredictionsReport",(n,r,i)=>_(this,null,function*(){const o="/predictions/football/engagements?",a=Q(M({},this.mainQueryParams),{from_date:r,to_date:i,type:n}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(M({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPersonalityQuiz",n=>_(this,null,function*(){const r="/personality-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePersonalityQuiz",(n,r)=>_(this,null,function*(){const i=`/personality-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePersonalityQuiz",n=>_(this,null,function*(){const r=`/personality-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"generatePostMatchQuiz",n=>_(this,null,function*(){const r="/classic-quizzes/post-match?",i={client_id:this.clientId,sport_type:n.sportType,lang:n.lang,event_id:n.eventId},o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"generatePostMatchPoll",n=>_(this,null,function*(){const r="/polls/post-match?",i={client_id:this.clientId,lang:n.lang,event_id:n.eventId};n.targetParticipant&&(i.target_participant=n.targetParticipant);const o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createEventGame",n=>_(this,null,function*(){const r="/custom/event?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEventGame",(n,r)=>_(this,null,function*(){const i=`/custom/event/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveEventGamePredictions",n=>_(this,null,function*(){const r="/custom/event/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(M({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));this.loyaltyBaseUrl=MS(n.environment),this.predictionBaseUrl=BS(n.environment),this.miniGamesApiBaseUrl=$S(n.environment),this.reportingApiBaseUrl=FS(n.environment),this.votingApiBaseUrl=NS(n.environment),this.profileApiBaseUrl=jS(n.environment),this.customResolverUrl=zS(n.environment),this.discussionsApiBaseUrl=US(n.environment),this.aiServiceBaseUrl=VS(n.environment);const i="";this.apiSports=new LS(i)}}const WS=(e,t)=>!e&&!t?null:!e&&t?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:e,authorization:`Bearer ${t&&t==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},pa=y.createContext(null),GS=({config:e,children:t})=>{const n={apiKey:e.apiKey,clientId:e.clientId,environment:e.environment,lang:e.language,errorHandlingMode:e.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},r=WS(e.sportal365Project,e.sportal365Infrastructure),i=We.FansUnitedSDK(n),o=new HS(n,r);return s.jsx(pa.Provider,{value:{sdk:i,https:o},children:t})},Qf=y.createContext(null),YS=({children:e,environment:t})=>{const[n,r]=y.useState(null),[i,o]=y.useState(!0);return y.useEffect(()=>ro(t).onAuthStateChanged(l=>{yt.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[t]),s.jsx(Qf.Provider,{value:n,children:!i&&e})};function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Jf={exports:{}},KS="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",qS=KS,QS=qS;function Xf(){}function Zf(){}Zf.resetWarningCache=Xf;var JS=function(){function e(r,i,o,a,l,c){if(c!==QS){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Zf,resetWarningCache:Xf};return n.PropTypes=n,n};Jf.exports=JS();var XS=Jf.exports;function ZS(e){return typeof e=="string"}function eI(e,t,n){return e===void 0||ZS(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}function eh(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function Nn(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function tI(e,t,n){return typeof e=="function"?e(t,n):e}function nI(e){const{rootElementName:t="",componentName:n}=e,[r,i]=K.useState(t.toUpperCase()),o=K.useCallback(a=>{var l;i((l=a==null?void 0:a.tagName)!=null?l:"")},[]);return[r,o]}function rI(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function gn(...e){return K.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{rI(n,t)})},e)}function th(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=th(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=th(e))&&(r&&(r+=" "),r+=t);return r}function nh(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function iI(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const g=zn(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=R({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=R({},n,i,r);return g.length>0&&(m.className=g),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const a=Nn(R({},i,r)),l=nh(r),c=nh(i),u=t(a),f=zn(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=R({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=R({},u,n,c,l);return f.length>0&&(p.className=f),Object.keys(d).length>0&&(p.style=d),{props:p,internalRef:u.ref}}function or(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rh(e){if(K.isValidElement(e)||!or(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=rh(e[n])}),t}function jn(e,t,n={clone:!0}){const r=n.clone?R({},e):e;return or(e)&&or(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])?r[i]=t[i]:or(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&or(e[i])?r[i]=jn(e[i],t[i],n):n.clone?r[i]=or(t[i])?rh(t[i]):t[i]:r[i]=t[i]}),r}function ga(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var ih={exports:{}},Ue={};/**
2325
+ */const PS="auth-compat";function DS(e){e.INTERNAL.registerComponent(new Qn(PS,t=>{const n=t.getProvider("app-compat").getImmediate(),r=t.getProvider("auth");return new Hl(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:jr.EMAIL_SIGNIN,PASSWORD_RESET:jr.PASSWORD_RESET,RECOVER_EMAIL:jr.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:jr.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:jr.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:jr.VERIFY_EMAIL}},EmailAuthProvider:nr,FacebookAuthProvider:wn,GithubAuthProvider:In,GoogleAuthProvider:Sn,OAuthProvider:Kr,SAMLAuthProvider:Zo,PhoneAuthProvider:Wl,PhoneMultiFactorGenerator:Mf,RecaptchaVerifier:_S,TwitterAuthProvider:An,Auth:Hl,AuthCredential:Gr,Error:Ut}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e.registerVersion(uS,dS)}DS(er);let qf=!1;const ro=e=>{if(qf)return er.auth();if(e&&e==="dev"){er.initializeApp({apiKey:"api_key"});const n=Uw();xl(n,"http://localhost:39199")}else{const n={apiKey:e&&e==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};er.initializeApp(n)}return qf=!0,er.auth()},OS=e=>e==="dev"?"http://localhost:8070/v1":e==="staging"?"https://client.fansunitedstagingapi.com/v1":e==="watg"?"https://client.watg.fansunitedapi.com/v1":e==="yolo"?"https://client.yolo.fansunitedapi.com/v1":e==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class RS{constructor(t,n){J(this,"apiKey","");J(this,"clientId","");J(this,"environment","");J(this,"mainQueryParams",{key:"",client_id:""});J(this,"headers",{"Content-Type":"application/json"});J(this,"clientApiBaseUrl","");J(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");J(this,"sportal365Config",null);J(this,"generateSignedInUrl",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/generate-signed-url?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(t)})}));J(this,"storeInBucket",(t,n,r)=>_(this,null,function*(){const i=yield fetch(t,{headers:r,method:"PUT",body:n});if(i.ok)return this.constructAssetsUrl(n.name);const o=yield i.text();this.throwErrorFromXmlResponse(o)}));J(this,"fetchImagesFromSportal365",(t,n,r)=>_(this,null,function*(){if(this.sportal365Config){const i={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let o={query:t,page:r.toString()};return n&&(n.from&&(o=Q(L({},o),{from:n.from})),n.to&&(o=Q(L({},o),{to:n.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(o),{headers:i})}}));J(this,"getSchedulersByEntityId",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks?`,r={key:this.apiKey,limit:"50",entity_id:t},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"setSchedulers",(t,n,r)=>_(this,null,function*(){let i="",o="";n==="CREATE"?(i=`/clients/${this.clientId}/scheduler/tasks?`,o="POST"):(i=`/clients/${this.clientId}/scheduler/tasks/${r}?`,o="PUT");const a={key:this.apiKey},l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l}),body:JSON.stringify(t),method:o})}));J(this,"deleteScheduledTask",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks/${t}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLoggedInStaffMember",()=>_(this,null,function*(){const r=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(window.atob(r).split("").map(function(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}));J(this,"constructAssetsUrl",t=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${t}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${t}`:`https://uploads.fansunitedassets.com/${this.clientId}/${t}`);J(this,"throwErrorFromXmlResponse",t=>{const n=new window.DOMParser().parseFromString(t,"text/xml"),r=n.getElementsByTagName("Message")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Message")[0].textContent:"",i=n.getElementsByTagName("Details")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Details")[0].textContent:"";throw new Error(r+" "+i)});J(this,"getToken",()=>_(this,null,function*(){const t=ro(this.environment).currentUser;return t?yield t.getIdToken():""}));this.apiKey=t.apiKey,this.clientId=t.clientId,this.environment=t.environment,this.mainQueryParams={key:t.apiKey,client_id:t.clientId},this.sportal365Config=n,this.clientApiBaseUrl=OS(this.environment)}}class LS{constructor(t){J(this,"baseUrl","https://v1.formula-1.api-sports.io");J(this,"apiKey");J(this,"headers");this.apiKey=t,this.headers={"X-RapidAPI-Key":this.apiKey,"Content-Type":"application/json"}}getRaces(t,n){return _(this,null,function*(){const r={season:t.toString(),type:(n==null?void 0:n.type)||"Race"};n&&Object.entries(n).forEach(([o,a])=>{a!=null&&(r[o]=a.toString())});const i=`${this.baseUrl}/races?${new URLSearchParams(r)}`;return yield fetch(i,{method:"GET",headers:this.headers})})}makeRequest(t,n){return _(this,null,function*(){let r=`${this.baseUrl}${t}`;return n&&Object.keys(n).length>0&&(r+=`?${new URLSearchParams(n)}`),yield fetch(r,{method:"GET",headers:this.headers})})}}const MS=e=>e==="dev"?"http://localhost:8060/v1":e==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":e==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":e==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":e==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",BS=e=>e==="dev"?"http://localhost:8040/v1":e==="staging"?"https://prediction.fansunitedstagingapi.com/v1":e==="watg"?"https://prediction.watg.fansunitedapi.com/v1":e==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":e==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",$S=e=>e==="dev"?"http://localhost:9040/v1":e==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":e==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":e==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":e==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",FS=e=>e==="dev"?"http://localhost:8020/v1":e==="staging"?"https://reporting.fansunitedstagingapi.com/v1":e==="watg"?"https://reporting.watg.fansunitedapi.com/v1":e==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":e==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",NS=e=>e==="dev"?"http://localhost:9030/v1":e==="staging"?"https://voting.fansunitedstagingapi.com/v1":e==="watg"?"https://voting.watg.fansunitedapi.com/v1":e==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":e==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",zS=e=>e==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":e==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":e==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":e==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",jS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://profile.fansunitedstagingapi.com/v1":e==="watg"?"https://profile.watg.fansunitedapi.com/v1":e==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":e==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",US=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://discussions.fansunitedstagingapi.com/v1":e==="watg"?"https://discussions.watg.fansunitedapi.com/v1":e==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":e==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1",VS=e=>e==="dev"?"http://localhost:9050/v1":e==="staging"?"https://ai-content-builder-131809830171.europe-west1.run.app/v1":e==="yolo"||e==="cska"?"":"https://ai-content-builder-150199313674.europe-west1.run.app/v1";class HS extends RS{constructor(n,r){super(n,r);J(this,"loyaltyBaseUrl","");J(this,"predictionBaseUrl","");J(this,"miniGamesApiBaseUrl","");J(this,"reportingApiBaseUrl","");J(this,"votingApiBaseUrl","");J(this,"profileApiBaseUrl","");J(this,"customResolverUrl","");J(this,"discussionsApiBaseUrl","");J(this,"aiServiceBaseUrl","");J(this,"apiSports");J(this,"getClientById",()=>_(this,null,function*(){const n=`/clients/${this.clientId}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createTemplate",n=>_(this,null,function*(){const r="/leaderboard/templates?",i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editTemplate",(n,r)=>_(this,null,function*(){const i=`/leaderboard/templates/${n}?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteTemplate",n=>_(this,null,function*(){const r=`/leaderboard/templates/${n}?`,i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"setWinners",n=>_(this,null,function*(){const r="/winners?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"exportDetailedLeaderboard",(n,r,i)=>_(this,null,function*(){const o=`/leaderboard/${n}/detailed?`,a=yield this.getToken(),l=L({},this.mainQueryParams);return r&&(l.group_id=r),yield fetch(this.loyaltyBaseUrl+o+new URLSearchParams(Q(L({},l),{limit:i.toString()})),{headers:Q(L({},this.headers),{Authorization:"Bearer "+a})})}));J(this,"exportDetailedGameLeaderboard",(n,r)=>_(this,null,function*(){const i=`/leaderboard/games/${n}/detailed?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(Q(L({},this.mainQueryParams),{limit:r.toString()})),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createGame",n=>_(this,null,function*(){const r="/games?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editGame",(n,r)=>_(this,null,function*(){const i=`/games/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getEntityFeature",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o={key:this.apiKey};return r&&(o.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o))}));J(this,"getClientFeatures",(n,r=1)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features?`,o={key:this.apiKey};n&&(o.disable_cache=Date.now().toString());const a=Q(L({},this.headers),{"x-api-version":r.toString()});return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:a})}));J(this,"updateEntityFeatures",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getClassicQuizFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/classic_quiz?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getEitherOrFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/either_or?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getPollFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/poll?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"createClassicQuiz",n=>_(this,null,function*(){const r="/classic-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateClassicQuiz",(n,r)=>_(this,null,function*(){const i=`/classic-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"getClassicQuizById",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/staff?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"deleteClassicQuiz",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"calculateQuestionsReport",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/questions-report?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST"})}));J(this,"exportUsers",n=>_(this,null,function*(){const r="/exports/users?",i=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"getClassicQuizParticipations",(n,r,i,o)=>_(this,null,function*(){const a="/classic-quizzes/participations?",l=Q(L({},this.mainQueryParams),{classic_quiz_ids:n,from_date:r,to_date:i,group_by:o}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(l),{headers:Q(L({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"getEntityParticipations",(n,r,i)=>_(this,null,function*(){const o=`/participations/${n}/breakdown?`,a=Q(L({},this.mainQueryParams),{from_date:r,to_date:i}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPoll",n=>_(this,null,function*(){const r="/polls?",i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePoll",(n,r)=>_(this,null,function*(){const i=`/polls/${n}?`,o=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePoll",n=>_(this,null,function*(){const r=`/polls/${n}?`,i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getEitherOrById",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}/staff?`,o=yield this.getToken();let a=null;return r&&(a=Q(L({},this.mainQueryParams),{client_id:r})),yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(a||this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getEitherOrByIdReadOnlyClient",(n,r,i)=>_(this,null,function*(){const o="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${n}/staff?`,l=yield this.getToken(),c={key:r,client_id:i};return yield fetch(o+a+new URLSearchParams(c),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createEitherOr",n=>_(this,null,function*(){const r="/either-or?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEitherOr",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteEitherOr",n=>_(this,null,function*(){const r=`/either-or/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLists",(n,r,i="DESC")=>_(this,null,function*(){const o=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:n.toString(),sort_order:i};r&&(a.start_after=r);const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+o+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"getListById",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getListContent",(n,r,i="DESC",o)=>_(this,null,function*(){const a=`/clients/${this.clientId}/lists/${n}/content?`,l={key:this.apiKey,limit:r.toString(),sort_order:i};o&&(l.page=o.toString());const c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(l),{headers:Q(L({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"createList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateList",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/lists/${n}?`,o={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:Q(L({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getLanguageConfig",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateLanguageConfig",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(n)})}));J(this,"createBracketGame",n=>_(this,null,function*(){const r="/custom/bracket?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateBracketGame",(n,r)=>_(this,null,function*(){const i=`/custom/bracket/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolvePredictions",n=>_(this,null,function*(){const r="/custom/bracket/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"exportLeadsPerEntity",n=>_(this,null,function*(){const r="/leads/export?",i=Q(L({},this.mainQueryParams),{content_id:n}),o=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getLeadStatistics",n=>_(this,null,function*(){const r="/leads/statistics?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(L(L({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"exportLeads",n=>_(this,null,function*(){const r="/leads/export?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(L(L({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createStandingGame",n=>_(this,null,function*(){const r="/custom/standing?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateStandingGame",(n,r)=>_(this,null,function*(){const i=`/custom/standing/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveStandingPredictions",n=>_(this,null,function*(){const r="/custom/standing/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"moderateUserPosts",(n,r)=>_(this,null,function*(){const i="/moderation/bulk?",o=yield this.getToken(),a=Q(L({},this.mainQueryParams),{user_id:n,reason:r});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"POST"})}));J(this,"getUserBanStatus",n=>_(this,null,function*(){const r=`/discussions/users/${n}/ban?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"banUser",(n,r,i)=>_(this,null,function*(){const o=`/discussions/users/${n}/ban?`,a=yield this.getToken(),l={banned_period_in_days:r,banned_reason:i};return yield fetch(this.discussionsApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"unbanUser",(n,r)=>_(this,null,function*(){const i=`/discussions/users/${n}/ban?`,o=yield this.getToken(),a={unban_reason:r};return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE",body:JSON.stringify(a)})}));J(this,"updateUser",(n,r,i)=>_(this,null,function*(){const o=`/profiles/${n}/verify?`,a=yield this.getToken(),l=r==="verify"?{verified:i}:{staff_member:i};return yield fetch(this.profileApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"deleteUserProfile",n=>_(this,null,function*(){const r=`/profiles/${n}?`,i=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"createDiscussion",n=>_(this,null,function*(){const r="/discussions?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"deleteDiscussion",n=>_(this,null,function*(){const r=`/discussions/${n}?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"moderatePosts",(...o)=>_(this,[...o],function*(n="",r=[],i){const a="/moderation/bulk?",l=yield this.getToken();let c={};if(r.length>0){const u=r.join(",");c=Q(L({},this.mainQueryParams),{post_ids:u,reason:i})}else c=Q(L({},this.mainQueryParams),{discussion_id:n,reason:i});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(c),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l}),method:"POST"})}));J(this,"pinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(L({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH"})}));J(this,"unpinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(L({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getPostsByStaffMember",n=>_(this,null,function*(){const r="/posts/staff?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(L(L({},this.mainQueryParams),n)),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"getReportedPosts",n=>_(this,null,function*(){const r="/posts/staff/reported?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(L(L({},this.mainQueryParams),n)),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateDiscussionsFeature",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/discussions?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"updateProfilePreferences",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/profile_preferences?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"getClientBadges",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/loyalty/badges?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateClientBadges",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/loyalty/badges?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"PUT",body:JSON.stringify(n)})}));J(this,"getEngagementThroughPredictionsReport",(n,r,i)=>_(this,null,function*(){const o="/predictions/football/engagements?",a=Q(L({},this.mainQueryParams),{from_date:r,to_date:i,type:n}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(L({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPersonalityQuiz",n=>_(this,null,function*(){const r="/personality-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePersonalityQuiz",(n,r)=>_(this,null,function*(){const i=`/personality-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePersonalityQuiz",n=>_(this,null,function*(){const r=`/personality-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"generatePostMatchQuiz",n=>_(this,null,function*(){const r="/classic-quizzes/post-match?",i=Q(L({},this.mainQueryParams),{sport_type:n.sportType,lang:n.lang,event_id:n.eventId}),o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"generatePostMatchPoll",n=>_(this,null,function*(){const r="/polls/post-match?",i=Q(L({},this.mainQueryParams),{lang:n.lang,event_id:n.eventId});n.targetParticipant&&(i.target_participant=n.targetParticipant);const o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createEventGame",n=>_(this,null,function*(){const r="/custom/event?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEventGame",(n,r)=>_(this,null,function*(){const i=`/custom/event/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveEventGamePredictions",n=>_(this,null,function*(){const r="/custom/event/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(L({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));this.loyaltyBaseUrl=MS(n.environment),this.predictionBaseUrl=BS(n.environment),this.miniGamesApiBaseUrl=$S(n.environment),this.reportingApiBaseUrl=FS(n.environment),this.votingApiBaseUrl=NS(n.environment),this.profileApiBaseUrl=jS(n.environment),this.customResolverUrl=zS(n.environment),this.discussionsApiBaseUrl=US(n.environment),this.aiServiceBaseUrl=VS(n.environment);const i="";this.apiSports=new LS(i)}}const WS=(e,t)=>!e&&!t?null:!e&&t?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:e,authorization:`Bearer ${t&&t==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},pa=y.createContext(null),GS=({config:e,children:t})=>{const n={apiKey:e.apiKey,clientId:e.clientId,environment:e.environment,lang:e.language,errorHandlingMode:e.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},r=WS(e.sportal365Project,e.sportal365Infrastructure),i=We.FansUnitedSDK(n),o=new HS(n,r);return s.jsx(pa.Provider,{value:{sdk:i,https:o},children:t})},Qf=y.createContext(null),YS=({children:e,environment:t})=>{const[n,r]=y.useState(null),[i,o]=y.useState(!0);return y.useEffect(()=>ro(t).onAuthStateChanged(l=>{yt.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[t]),s.jsx(Qf.Provider,{value:n,children:!i&&e})};function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Jf={exports:{}},KS="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",qS=KS,QS=qS;function Xf(){}function Zf(){}Zf.resetWarningCache=Xf;var JS=function(){function e(r,i,o,a,l,c){if(c!==QS){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Zf,resetWarningCache:Xf};return n.PropTypes=n,n};Jf.exports=JS();var XS=Jf.exports;function ZS(e){return typeof e=="string"}function eI(e,t,n){return e===void 0||ZS(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}function eh(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function Nn(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function tI(e,t,n){return typeof e=="function"?e(t,n):e}function nI(e){const{rootElementName:t="",componentName:n}=e,[r,i]=K.useState(t.toUpperCase()),o=K.useCallback(a=>{var l;i((l=a==null?void 0:a.tagName)!=null?l:"")},[]);return[r,o]}function rI(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function gn(...e){return K.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{rI(n,t)})},e)}function th(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=th(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=th(e))&&(r&&(r+=" "),r+=t);return r}function nh(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function iI(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const g=zn(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=R({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=R({},n,i,r);return g.length>0&&(m.className=g),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const a=Nn(R({},i,r)),l=nh(r),c=nh(i),u=t(a),f=zn(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=R({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=R({},u,n,c,l);return f.length>0&&(p.className=f),Object.keys(d).length>0&&(p.style=d),{props:p,internalRef:u.ref}}function or(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rh(e){if(K.isValidElement(e)||!or(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=rh(e[n])}),t}function jn(e,t,n={clone:!0}){const r=n.clone?R({},e):e;return or(e)&&or(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])?r[i]=t[i]:or(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&or(e[i])?r[i]=jn(e[i],t[i],n):n.clone?r[i]=or(t[i])?rh(t[i]):t[i]:r[i]=t[i]}),r}function ga(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var ih={exports:{}},Ue={};/**
2326
2326
  * @license React
2327
2327
  * react-is.production.js
2328
2328
  *
@@ -2330,24 +2330,24 @@
2330
2330
  *
2331
2331
  * This source code is licensed under the MIT license found in the
2332
2332
  * LICENSE file in the root directory of this source tree.
2333
- */var Gl=Symbol.for("react.transitional.element"),Yl=Symbol.for("react.portal"),ma=Symbol.for("react.fragment"),va=Symbol.for("react.strict_mode"),ba=Symbol.for("react.profiler"),ya=Symbol.for("react.consumer"),xa=Symbol.for("react.context"),Ca=Symbol.for("react.forward_ref"),wa=Symbol.for("react.suspense"),Sa=Symbol.for("react.suspense_list"),Ia=Symbol.for("react.memo"),Aa=Symbol.for("react.lazy"),oI=Symbol.for("react.offscreen"),aI=Symbol.for("react.client.reference");function an(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Gl:switch(e=e.type,e){case ma:case ba:case va:case wa:case Sa:return e;default:switch(e=e&&e.$$typeof,e){case xa:case Ca:case Aa:case Ia:return e;case ya:return e;default:return t}}case Yl:return t}}}Ue.ContextConsumer=ya,Ue.ContextProvider=xa,Ue.Element=Gl,Ue.ForwardRef=Ca,Ue.Fragment=ma,Ue.Lazy=Aa,Ue.Memo=Ia,Ue.Portal=Yl,Ue.Profiler=ba,Ue.StrictMode=va,Ue.Suspense=wa,Ue.SuspenseList=Sa,Ue.isContextConsumer=function(e){return an(e)===ya},Ue.isContextProvider=function(e){return an(e)===xa},Ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gl},Ue.isForwardRef=function(e){return an(e)===Ca},Ue.isFragment=function(e){return an(e)===ma},Ue.isLazy=function(e){return an(e)===Aa},Ue.isMemo=function(e){return an(e)===Ia},Ue.isPortal=function(e){return an(e)===Yl},Ue.isProfiler=function(e){return an(e)===ba},Ue.isStrictMode=function(e){return an(e)===va},Ue.isSuspense=function(e){return an(e)===wa},Ue.isSuspenseList=function(e){return an(e)===Sa},Ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ma||e===ba||e===va||e===wa||e===Sa||e===oI||typeof e=="object"&&e!==null&&(e.$$typeof===Aa||e.$$typeof===Ia||e.$$typeof===xa||e.$$typeof===ya||e.$$typeof===Ca||e.$$typeof===aI||e.getModuleId!==void 0)},Ue.typeOf=an,ih.exports=Ue;var oh=ih.exports;function Se(e){if(typeof e!="string")throw new Error(ga(7));return e.charAt(0).toUpperCase()+e.slice(1)}function ah(e,t){var n,r;return K.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}const sI=typeof window!="undefined"?K.useLayoutEffect:K.useEffect;let sh=0;function lI(e){const[t,n]=K.useState(e),r=e||t;return K.useEffect(()=>{t==null&&(sh+=1,n(`mui-${sh}`))},[t]),r}const lh=K.useId;function io(e){if(lh!==void 0){const t=lh();return e!=null?e:t}return lI(e)}function Kl({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=K.useRef(e!==void 0),[o,a]=K.useState(t),l=i?e:o,c=K.useCallback(u=>{i||a(u)},[]);return[l,c]}class ql{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new ql}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}let Ta=!0,Ql=!1;const cI=new ql,uI={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function dI(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&uI[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function fI(e){e.metaKey||e.altKey||e.ctrlKey||(Ta=!0)}function Jl(){Ta=!1}function hI(){this.visibilityState==="hidden"&&Ql&&(Ta=!0)}function pI(e){e.addEventListener("keydown",fI,!0),e.addEventListener("mousedown",Jl,!0),e.addEventListener("pointerdown",Jl,!0),e.addEventListener("touchstart",Jl,!0),e.addEventListener("visibilitychange",hI,!0)}function gI(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return Ta||dI(t)}function ch(){const e=K.useCallback(i=>{i!=null&&pI(i.ownerDocument)},[]),t=K.useRef(!1);function n(){return t.current?(Ql=!0,cI.start(100,()=>{Ql=!1}),t.current=!1,!0):!1}function r(i){return gI(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function uh(e,t){const n=R({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=R({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=R({},o),Object.keys(i).forEach(a=>{n[r][a]=uh(i[a],o[a])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function gt(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,a)=>{if(a){const l=t(a);l!==""&&o.push(l),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const dh=e=>e,mI=(()=>{let e=dh;return{configure(t){e=t},generate(t){return e(t)},reset(){e=dh}}})(),vI={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function fh(e,t,n="Mui"){const r=vI[t];return r?`${n}-${r}`:`${mI.generate(e)}-${t}`}function bI(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=fh(e,i,n)}),r}function Xl(e={}){const{disabled:t=!1,focusableWhenDisabled:n,href:r,rootRef:i,tabIndex:o,to:a,type:l,rootElementName:c}=e,u=K.useRef(null),[f,d]=K.useState(!1),{isFocusVisibleRef:p,onFocus:g,onBlur:v,ref:m}=ch(),[b,C]=K.useState(!1);t&&!n&&b&&C(!1),K.useEffect(()=>{p.current=b},[b,p]);const[S,x]=nI({rootElementName:c!=null?c:r||a?"a":void 0,componentName:"Button"}),I=j=>N=>{var L;b&&N.preventDefault(),(L=j.onMouseLeave)==null||L.call(j,N)},w=j=>N=>{var L;v(N),p.current===!1&&C(!1),(L=j.onBlur)==null||L.call(j,N)},A=j=>N=>{var L;if(u.current||(u.current=N.currentTarget),g(N),p.current===!0){var V;C(!0),(V=j.onFocusVisible)==null||V.call(j,N)}(L=j.onFocus)==null||L.call(j,N)},E=()=>{const j=u.current;return S==="BUTTON"||S==="INPUT"&&["button","submit","reset"].includes(j==null?void 0:j.type)||S==="A"&&(j==null?void 0:j.href)},k=j=>N=>{if(!t){var L;(L=j.onClick)==null||L.call(j,N)}},$=j=>N=>{var L;t||(d(!0),document.addEventListener("mouseup",()=>{d(!1)},{once:!0})),(L=j.onMouseDown)==null||L.call(j,N)},G=j=>N=>{var L;if((L=j.onKeyDown)==null||L.call(j,N),!N.defaultMuiPrevented&&(N.target===N.currentTarget&&!E()&&N.key===" "&&N.preventDefault(),N.target===N.currentTarget&&N.key===" "&&!t&&d(!0),N.target===N.currentTarget&&!E()&&N.key==="Enter"&&!t)){var V;(V=j.onClick)==null||V.call(j,N),N.preventDefault()}},O=j=>N=>{var L;if(N.target===N.currentTarget&&d(!1),(L=j.onKeyUp)==null||L.call(j,N),N.target===N.currentTarget&&!E()&&!t&&N.key===" "&&!N.defaultMuiPrevented){var V;(V=j.onClick)==null||V.call(j,N)}},T=gn(x,i,m,u),F={};return o!==void 0&&(F.tabIndex=o),S==="BUTTON"?(F.type=l!=null?l:"button",n?F["aria-disabled"]=t:F.disabled=t):S==="INPUT"?l&&["button","submit","reset"].includes(l)&&(n?F["aria-disabled"]=t:F.disabled=t):S!==""&&(!r&&!a&&(F.role="button",F.tabIndex=o!=null?o:0),t&&(F["aria-disabled"]=t,F.tabIndex=n?o!=null?o:0:-1)),{getRootProps:(j={})=>{const N=R({},Nn(e),Nn(j)),L=R({type:l},N,F,j,{onBlur:w(N),onClick:k(N),onFocus:A(N),onKeyDown:G(N),onKeyUp:O(N),onMouseDown:$(N),onMouseLeave:I(N),ref:T});return delete L.onFocusVisible,L},focusVisible:b,setFocusVisible:C,active:f,rootRef:T}}function yI(e,t){return e===t}const Zl={},hh=()=>{};function ec(e,t){const n=R({},e);return Object.keys(t).forEach(r=>{t[r]!==void 0&&(n[r]=t[r])}),n}function xI(e){const{nextState:t,initialState:n,stateComparers:r,onStateChange:i,controlledProps:o,lastActionRef:a}=e,l=K.useRef(n);K.useEffect(()=>{if(a.current===null)return;const c=ec(l.current,o);Object.keys(t).forEach(u=>{var f;const d=(f=r[u])!=null?f:yI,p=t[u],g=c[u];if(g==null&&p!=null||g!=null&&p==null||g!=null&&p!=null&&!d(p,g)){var v,m;i==null||i((v=a.current.event)!=null?v:null,u,p,(m=a.current.type)!=null?m:"",t)}}),l.current=t,a.current=null},[l,t,a,i,r,o])}function CI(e){const t=K.useRef(null),{reducer:n,initialState:r,controlledProps:i=Zl,stateComparers:o=Zl,onStateChange:a=hh,actionContext:l,componentName:c=""}=e;K.useRef(i);const u=K.useCallback((g,v)=>{t.current=v;const m=ec(g,i);return n(m,v)},[i,n]),[f,d]=K.useReducer(u,r),p=K.useCallback(g=>{d(R({},g,{context:l}))},[l]);return xI({nextState:f,initialState:r,stateComparers:o!=null?o:Zl,onStateChange:a!=null?a:hh,controlledProps:i,lastActionRef:t}),[ec(f,i),p]}const wI=K.createContext(void 0);function SI(){return K.useContext(wI)}function II(e={}){const{defaultValue:t,disabled:n=!1,error:r=!1,onBlur:i,onChange:o,onFocus:a,required:l=!1,value:c,inputRef:u}=e,f=SI();let d,p,g,v,m;if(f){var b,C,S;d=void 0,p=(b=f.disabled)!=null?b:!1,g=(C=f.error)!=null?C:!1,v=(S=f.required)!=null?S:!1,m=f.value}else d=t,p=n,g=r,v=l,m=c;const{current:x}=K.useRef(m!=null),I=K.useCallback(j=>{},[]),w=K.useRef(null),A=gn(w,u,I),[E,k]=K.useState(!1);K.useEffect(()=>{!f&&p&&E&&(k(!1),i==null||i())},[f,p,E,i]);const $=j=>N=>{var L;if(f!=null&&f.disabled){N.stopPropagation();return}if((L=j.onFocus)==null||L.call(j,N),f&&f.onFocus){var V;f==null||(V=f.onFocus)==null||V.call(f)}else k(!0)},G=j=>N=>{var L;(L=j.onBlur)==null||L.call(j,N),f&&f.onBlur?f.onBlur():k(!1)},O=j=>(N,...L)=>{var V,Y;if(!x&&(N.target||w.current)==null)throw new Error(ga(17));f==null||(V=f.onChange)==null||V.call(f,N),(Y=j.onChange)==null||Y.call(j,N,...L)},T=j=>N=>{var L;w.current&&N.currentTarget===N.target&&w.current.focus(),(L=j.onClick)==null||L.call(j,N)};return{disabled:p,error:g,focused:E,formControlContext:f,getInputProps:(j={})=>{const L=R({},{onBlur:i,onChange:o,onFocus:a},Nn(j)),V=R({},L,{onBlur:G(L),onChange:O(L),onFocus:$(L)});return R({},V,{"aria-invalid":g||void 0,defaultValue:d,value:m,required:v,disabled:p},j,{ref:A},V)},getRootProps:(j={})=>{const N=Nn(e,["onBlur","onChange","onFocus"]),L=R({},N,Nn(j));return R({},j,L,{onClick:T(L)})},inputRef:A,required:v,value:m}}const Et={blur:"list:blur",focus:"list:focus",itemClick:"list:itemClick",itemHover:"list:itemHover",itemsChange:"list:itemsChange",keyDown:"list:keyDown",resetHighlight:"list:resetHighlight",highlightLast:"list:highlightLast",textNavigation:"list:textNavigation",clearSelection:"list:clearSelection"};function AI(e,t,n,r,i,o){if(n.length===0||!r&&n.every((l,c)=>i(l,c)))return-1;let a=e;for(;;){if(!o&&t==="next"&&a===n.length||!o&&t==="previous"&&a===-1)return-1;if(r?!1:i(n[a],a))a+=t==="next"?1:-1,o&&(a=(a+n.length)%n.length);else return a}}function $t(e,t,n){var r;const{items:i,isItemDisabled:o,disableListWrap:a,disabledItemsFocusable:l,itemComparer:c,focusManagement:u}=n,f=u==="DOM"?0:-1,d=i.length-1,p=e==null?-1:i.findIndex(C=>c(C,e));let g,v,m=!a;switch(t){case"reset":if(f===-1)return null;g=0,v="next",m=!1;break;case"start":g=0,v="next",m=!1;break;case"end":g=d,v="previous",m=!1;break;default:{const C=p+t;C<0?!m&&p!==-1||Math.abs(t)>1?(g=0,v="next"):(g=d,v="previous"):C>d?!m||Math.abs(t)>1?(g=d,v="previous"):(g=0,v="next"):(g=C,v=t>=0?"next":"previous")}}const b=AI(g,v,i,l,o,m);return b===-1&&e!==null&&!o(e,p)?e:(r=i[b])!=null?r:null}function TI(e,t,n,r){return n==="none"?[]:n==="single"?r(t[0],e)?t:[e]:t.some(i=>r(i,e))?t.filter(i=>!r(i,e)):[...t,e]}function ph(e,t,n){const{itemComparer:r,isItemDisabled:i,selectionMode:o,items:a}=n,{selectedValues:l}=t,c=a.findIndex(f=>r(e,f));if(i(e,c))return t;const u=TI(e,l,o,r);return R({},t,{selectedValues:u,highlightedValue:e})}function EI(e,t,n){const r=t.highlightedValue,{orientation:i,pageSize:o}=n;switch(e){case"Home":return R({},t,{highlightedValue:$t(r,"start",n)});case"End":return R({},t,{highlightedValue:$t(r,"end",n)});case"PageUp":return R({},t,{highlightedValue:$t(r,-o,n)});case"PageDown":return R({},t,{highlightedValue:$t(r,o,n)});case"ArrowUp":if(i!=="vertical")break;return R({},t,{highlightedValue:$t(r,-1,n)});case"ArrowDown":if(i!=="vertical")break;return R({},t,{highlightedValue:$t(r,1,n)});case"ArrowLeft":{if(i==="vertical")break;return R({},t,{highlightedValue:$t(r,i==="horizontal-ltr"?-1:1,n)})}case"ArrowRight":{if(i==="vertical")break;return R({},t,{highlightedValue:$t(r,i==="horizontal-ltr"?1:-1,n)})}case"Enter":case" ":return t.highlightedValue===null?t:ph(t.highlightedValue,t,n)}return t}function kI(e,t){return t.focusManagement==="DOM"?e:R({},e,{highlightedValue:null})}function _I(e,t,n){var r;const i=(r=n(e))==null?void 0:r.trim().toLowerCase();return!i||i.length===0?!1:i.indexOf(t)===0}function PI(e,t,n){const{items:r,isItemDisabled:i,disabledItemsFocusable:o,getItemAsString:a}=n,l=t.length>1;let c=l?e.highlightedValue:$t(e.highlightedValue,1,n);for(let u=0;u<r.length;u+=1){if(!c||!l&&e.highlightedValue===c)return e;if(_I(c,t,a)&&(!i(c,r.indexOf(c))||o))return R({},e,{highlightedValue:c});c=$t(c,1,n)}return e}function DI(e,t,n,r){var i;const{itemComparer:o,focusManagement:a}=r;let l=null;if(n.highlightedValue!=null){var c;l=(c=e.find(d=>o(d,n.highlightedValue)))!=null?c:null}else a==="DOM"&&t.length===0&&(l=$t(null,"reset",r));const f=((i=n.selectedValues)!=null?i:[]).filter(d=>e.some(p=>o(p,d)));return R({},n,{highlightedValue:l,selectedValues:f})}function OI(e,t){return R({},e,{highlightedValue:$t(null,"reset",t)})}function RI(e,t){return R({},e,{highlightedValue:$t(null,"end",t)})}function LI(e,t){return R({},e,{selectedValues:[],highlightedValue:$t(null,"reset",t)})}function gh(e,t){const{type:n,context:r}=t;switch(n){case Et.keyDown:return EI(t.key,e,r);case Et.itemClick:return ph(t.item,e,r);case Et.blur:return kI(e,r);case Et.textNavigation:return PI(e,t.searchString,r);case Et.itemsChange:return DI(t.items,t.previousItems,e,r);case Et.resetHighlight:return OI(e,r);case Et.highlightLast:return RI(e,r);case Et.clearSelection:return LI(e,r);default:return e}}const MI=500;function BI(e){const t=K.useRef({searchString:"",lastTime:null});return K.useCallback(n=>{if(n.key.length===1&&n.key!==" "){const r=t.current,i=n.key.toLowerCase(),o=performance.now();r.searchString.length>0&&r.lastTime&&o-r.lastTime>MI?r.searchString=i:(r.searchString.length!==1||i!==r.searchString)&&(r.searchString+=i),r.lastTime=o,e(r.searchString,n)}},[e])}const mh={},$I=()=>{},FI=(e,t)=>e===t,NI=()=>!1,zI=e=>typeof e=="string"?e:String(e),jI=()=>({highlightedValue:null,selectedValues:[]});function UI(e){const{controlledProps:t=mh,disabledItemsFocusable:n=!1,disableListWrap:r=!1,focusManagement:i="activeDescendant",getInitialState:o=jI,getItemDomElement:a,getItemId:l,isItemDisabled:c=NI,rootRef:u,onStateChange:f=$I,items:d,itemComparer:p=FI,getItemAsString:g=zI,onChange:v,onHighlightChange:m,onItemsChange:b,orientation:C="vertical",pageSize:S=5,reducerActionContext:x=mh,selectionMode:I="single",stateReducer:w,componentName:A="useList"}=e,E=K.useRef(null),k=gn(u,E),$=K.useCallback((oe,Z,te)=>{if(m==null||m(oe,Z,te),i==="DOM"&&Z!=null&&(te===Et.itemClick||te===Et.keyDown||te===Et.textNavigation)){var ne;a==null||(ne=a(Z))==null||ne.focus()}},[a,m,i]),G=K.useMemo(()=>({highlightedValue:p,selectedValues:(oe,Z)=>eh(oe,Z,p)}),[p]),O=K.useCallback((oe,Z,te,ne,ue)=>{switch(f==null||f(oe,Z,te,ne,ue),Z){case"highlightedValue":$(oe,te,ne);break;case"selectedValues":v==null||v(oe,te,ne);break}},[$,v,f]),T=K.useMemo(()=>({disabledItemsFocusable:n,disableListWrap:r,focusManagement:i,isItemDisabled:c,itemComparer:p,items:d,getItemAsString:g,onHighlightChange:$,orientation:C,pageSize:S,selectionMode:I,stateComparers:G}),[n,r,i,c,p,d,g,$,C,S,I,G]),F=o(),H=w!=null?w:gh,j=K.useMemo(()=>R({},x,T),[x,T]),[N,L]=CI({reducer:H,actionContext:j,initialState:F,controlledProps:t,stateComparers:G,onStateChange:O,componentName:A}),{highlightedValue:V,selectedValues:Y}=N,X=BI((oe,Z)=>L({type:Et.textNavigation,event:Z,searchString:oe})),D=K.useRef([]);K.useEffect(()=>{eh(D.current,d,p)||(L({type:Et.itemsChange,event:null,items:d,previousItems:D.current}),D.current=d,b==null||b(d))},[d,p,L,b]);const B=oe=>Z=>{var te;if((te=oe.onKeyDown)==null||te.call(oe,Z),Z.defaultMuiPrevented)return;const ne=["Home","End","PageUp","PageDown"];C==="vertical"?ne.push("ArrowUp","ArrowDown"):ne.push("ArrowLeft","ArrowRight"),i==="activeDescendant"&&ne.push(" ","Enter"),ne.includes(Z.key)&&Z.preventDefault(),L({type:Et.keyDown,key:Z.key,event:Z}),X(Z)},U=oe=>Z=>{var te,ne;(te=oe.onBlur)==null||te.call(oe,Z),!Z.defaultMuiPrevented&&((ne=E.current)!=null&&ne.contains(Z.relatedTarget)||L({type:Et.blur,event:Z}))},W=(oe={})=>{const Z=Nn(oe);return R({},oe,{"aria-activedescendant":i==="activeDescendant"&&V!=null?l(V):void 0,tabIndex:i==="DOM"?-1:0,ref:k},Z,{onBlur:U(Z),onKeyDown:B(Z)})},ie=K.useCallback(oe=>{const Z=(Y!=null?Y:[]).some(ue=>ue!=null&&p(oe,ue)),te=V!=null&&p(oe,V);return{focusable:i==="DOM",highlighted:te,selected:Z}},[p,Y,V,i]),se=K.useMemo(()=>({dispatch:L,getItemState:ie}),[L,ie]);return K.useDebugValue({state:N}),{contextValue:se,dispatch:L,getRootProps:W,rootRef:k,state:N}}const vh=K.createContext(null);function VI(e){const{handlePointerOverEvents:t=!1,item:n}=e,r=K.useContext(vh);if(!r)throw new Error("useListItem must be used within a ListProvider");const{dispatch:i,getItemState:o}=r,{highlighted:a,selected:l,focusable:c}=o(n),u=K.useCallback(g=>v=>{var m;(m=g.onClick)==null||m.call(g,v),!v.defaultPrevented&&i({type:Et.itemClick,item:n,event:v})},[i,n]),f=K.useCallback(g=>v=>{var m;(m=g.onMouseOver)==null||m.call(g,v),!v.defaultPrevented&&i({type:Et.itemHover,item:n,event:v})},[i,n]);let d;return c&&(d=a?0:-1),{getRootProps:(g={})=>{const v=Nn(g);return R({},g,{onClick:u(v),onPointerOver:t?f(v):void 0,tabIndex:d})},highlighted:a,selected:l}}const tc=K.createContext(null);function HI(e){const t=Array.from(e.keys()).map(n=>{const r=e.get(n);return{key:n,subitem:r}});return t.sort((n,r)=>{const i=n.subitem.ref.current,o=r.subitem.ref.current;return i===null||o===null||i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING?1:-1}),new Map(t.map(n=>[n.key,n.subitem]))}function bh(){const[e,t]=K.useState(new Map),n=K.useRef(new Set),r=K.useCallback(function(u){n.current.delete(u),t(f=>{const d=new Map(f);return d.delete(u),d})},[]),i=K.useCallback(function(u,f){let d;return typeof u=="function"?d=u(n.current):d=u,n.current.add(d),t(p=>{const g=new Map(p);return g.set(d,f),g}),{id:d,deregister:()=>r(d)}},[r]),o=K.useMemo(()=>HI(e),[e]),a=K.useCallback(function(u){return Array.from(o.keys()).indexOf(u)},[o]);return{contextValue:K.useMemo(()=>({getItemIndex:a,registerItem:i,totalSubitemCount:e.size}),[a,i,e.size]),subitems:o}}function yh(e,t){const n=K.useContext(tc);if(n===null)throw new Error("useCompoundItem must be used within a useCompoundParent");const{registerItem:r}=n,[i,o]=K.useState(typeof e=="function"?void 0:e);return sI(()=>{const{id:a,deregister:l}=r(e,t);return o(a),l},[r,t,e]),{id:i,index:i!==void 0?n.getItemIndex(i):-1,totalItemCount:n.totalSubitemCount}}function WI(e,t){return function(r={}){const i=R({},r,e(r));return R({},i,t(i))}}const GI=Math.min,YI=Math.max,Ea=Math.round,ka=Math.floor,_a=e=>({x:e,y:e});function KI(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xh(e){return wh(e)?(e.nodeName||"").toLowerCase():"#document"}function Un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ch(e){var t;return(t=(wh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wh(e){return e instanceof Node||e instanceof Un(e).Node}function qI(e){return e instanceof Element||e instanceof Un(e).Element}function nc(e){return e instanceof HTMLElement||e instanceof Un(e).HTMLElement}function Sh(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Un(e).ShadowRoot}function Ih(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function QI(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function JI(e){return["html","body","#document"].includes(xh(e))}function rc(e){return Un(e).getComputedStyle(e)}function XI(e){if(xh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sh(e)&&e.host||Ch(e);return Sh(t)?t.host:t}function Ah(e){const t=XI(e);return JI(t)?e.ownerDocument?e.ownerDocument.body:e.body:nc(t)&&Ih(t)?t:Ah(t)}function Pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ah(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Un(i);if(o){const l=ic(a);return t.concat(a,a.visualViewport||[],Ih(i)?i:[],l&&n?Pa(l):[])}return t.concat(i,Pa(i,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZI(e){const t=rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=nc(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=Ea(n)!==o||Ea(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function oc(e){return qI(e)?e:e.contextElement}function Th(e){const t=oc(e);if(!nc(t))return _a(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ZI(t);let a=(o?Ea(n.width):n.width)/r,l=(o?Ea(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const eA=_a(0);function tA(e){const t=Un(e);return!QI()||!t.visualViewport?eA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nA(e,t,n){return!1}function Eh(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=oc(e);let a=_a(1);t&&(a=Th(e));const l=nA()?tA(o):_a(0);let c=(i.left+l.x)/a.x,u=(i.top+l.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(o){const p=Un(o),g=r;let v=p,m=ic(v);for(;m&&r&&g!==v;){const b=Th(m),C=m.getBoundingClientRect(),S=rc(m),x=C.left+(m.clientLeft+parseFloat(S.paddingLeft))*b.x,I=C.top+(m.clientTop+parseFloat(S.paddingTop))*b.y;c*=b.x,u*=b.y,f*=b.x,d*=b.y,c+=x,u+=I,v=Un(m),m=ic(v)}}return KI({width:f,height:d,x:c,y:u})}function rA(e,t){let n=null,r;const i=Ch(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:u,top:f,width:d,height:p}=e.getBoundingClientRect();if(l||t(),!d||!p)return;const g=ka(f),v=ka(i.clientWidth-(u+d)),m=ka(i.clientHeight-(f+p)),b=ka(u),S={rootMargin:-g+"px "+-v+"px "+-m+"px "+-b+"px",threshold:YI(0,GI(1,c))||1};let x=!0;function I(w){const A=w[0].intersectionRatio;if(A!==c){if(!x)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(I,Q(M({},S),{root:i.ownerDocument}))}catch(w){n=new IntersectionObserver(I,S)}n.observe(e)}return a(!0),o}function iA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=oc(e),f=i||o?[...u?Pa(u):[],...Pa(t)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const d=u&&l?rA(u,n):null;let p=-1,g=null;a&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,m=c?Eh(e):null;c&&b();function b(){const C=Eh(e);m&&(C.x!==m.x||C.y!==m.y||C.width!==m.width||C.height!==m.height)&&n(),m=C,v=requestAnimationFrame(b)}return n(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",n),o&&S.removeEventListener("resize",n)}),d==null||d(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(v)}}function oA(e){const{checked:t,defaultChecked:n,disabled:r,onBlur:i,onChange:o,onFocus:a,onFocusVisible:l,readOnly:c,required:u}=e,[f,d]=Kl({controlled:t,default:!!n,name:"Switch",state:"checked"}),p=k=>$=>{var G;$.nativeEvent.defaultPrevented||(d($.target.checked),o==null||o($),(G=k.onChange)==null||G.call(k,$))},{isFocusVisibleRef:g,onBlur:v,onFocus:m,ref:b}=ch(),[C,S]=K.useState(!1);r&&C&&S(!1),K.useEffect(()=>{g.current=C},[C,g]);const x=K.useRef(null),I=k=>$=>{var G;x.current||(x.current=$.currentTarget),m($),g.current===!0&&(S(!0),l==null||l($)),a==null||a($),(G=k.onFocus)==null||G.call(k,$)},w=k=>$=>{var G;v($),g.current===!1&&S(!1),i==null||i($),(G=k.onBlur)==null||G.call(k,$)},A=gn(b,x);return{checked:f,disabled:!!r,focusVisible:C,getInputProps:(k={})=>R({checked:t,defaultChecked:n,disabled:r,readOnly:c,ref:A,required:u,type:"checkbox",role:"switch","aria-checked":t},k,{onChange:p(k),onFocus:I(k),onBlur:w(k)}),inputRef:A,readOnly:!!c}}function aA(e){const{value:t,defaultValue:n,onChange:r,orientation:i="horizontal",direction:o="ltr",selectionFollowsFocus:a=!1}=e,[l,c]=Kl({controlled:t,default:n,name:"Tabs",state:"value"}),u=K.useCallback((b,C)=>{c(C),r==null||r(b,C)},[r,c]),{subitems:f,contextValue:d}=bh(),p=K.useRef(()=>{}),g=K.useCallback(b=>{var C;return(C=f.get(b))==null?void 0:C.id},[f]),v=K.useCallback(b=>p.current(b),[]),m=K.useCallback(b=>{p.current=b},[]);return{contextValue:R({direction:o,getTabId:v,getTabPanelId:g,onSelected:u,orientation:i,registerTabIdLookup:m,selectionFollowsFocus:a,value:l},d)}}const kh=K.createContext(null);function Da(){const e=K.useContext(kh);if(e==null)throw new Error("No TabsContext provided");return e}function sA(e){const{value:t,children:n}=e,{direction:r,getItemIndex:i,onSelected:o,orientation:a,registerItem:l,registerTabIdLookup:c,selectionFollowsFocus:u,totalSubitemCount:f,value:d,getTabId:p,getTabPanelId:g}=t,v=K.useMemo(()=>({getItemIndex:i,registerItem:l,totalSubitemCount:f}),[l,i,f]),m=K.useMemo(()=>({direction:r,getTabId:p,getTabPanelId:g,onSelected:o,orientation:a,registerTabIdLookup:c,selectionFollowsFocus:u,value:d}),[r,p,g,o,a,c,u,d]);return s.jsx(tc.Provider,{value:v,children:s.jsx(kh.Provider,{value:m,children:n})})}function lA(e){return e.size}function cA(e){const{value:t,id:n,rootRef:r}=e,i=Da();if(i===null)throw new Error("No TabContext provided");const{value:o,getTabId:a}=i,l=io(n),c=K.useRef(null),u=gn(c,r),f=K.useMemo(()=>({id:l,ref:c}),[l]),{id:d}=yh(t!=null?t:lA,f),p=d!==o,g=d!==void 0?a(d):void 0;return{hidden:p,getRootProps:(m={})=>R({"aria-labelledby":g!=null?g:void 0,hidden:p,id:l!=null?l:void 0},m,{ref:u}),rootRef:u}}const _h={valueChange:"valueChange"};function uA(e,t){if(t.type===_h.valueChange)return R({},e,{highlightedValue:t.value});const n=gh(e,t),{context:{selectionFollowsFocus:r}}=t;if(t.type===Et.itemsChange){if(n.selectedValues.length>0)return R({},n,{highlightedValue:n.selectedValues[0]});$t(null,"reset",t.context)}return r&&n.highlightedValue!=null?R({},n,{selectedValues:[n.highlightedValue]}):n}function dA(e){var t;const{rootRef:n}=e,{direction:r="ltr",onSelected:i,orientation:o="horizontal",value:a,registerTabIdLookup:l,selectionFollowsFocus:c}=Da(),{subitems:u,contextValue:f}=bh(),d=K.useCallback(O=>{var T;return(T=u.get(O))==null?void 0:T.id},[u]);l(d);const p=K.useMemo(()=>Array.from(u.keys()),[u]),g=K.useCallback(O=>{var T,F;return O==null?null:(T=(F=u.get(O))==null?void 0:F.ref.current)!=null?T:null},[u]),v=r==="rtl";let m;o==="vertical"?m="vertical":m=v?"horizontal-rtl":"horizontal-ltr";const b=K.useCallback((O,T)=>{var F;i(O,(F=T[0])!=null?F:null)},[i]),C=K.useMemo(()=>a===void 0?{}:a!=null?{selectedValues:[a]}:{selectedValues:[]},[a]),S=K.useCallback(O=>{var T,F;return(T=(F=u.get(O))==null?void 0:F.disabled)!=null?T:!1},[u]),{contextValue:x,dispatch:I,getRootProps:w,state:{highlightedValue:A,selectedValues:E},rootRef:k}=UI({controlledProps:C,disabledItemsFocusable:!c,focusManagement:"DOM",getItemDomElement:g,isItemDisabled:S,items:p,rootRef:n,onChange:b,orientation:m,reducerActionContext:K.useMemo(()=>({selectionFollowsFocus:c||!1}),[c]),selectionMode:"single",stateReducer:uA});K.useEffect(()=>{a!==void 0&&a!=null&&I({type:_h.valueChange,value:a})},[I,a]);const $=(O={})=>R({},O,w(O),{"aria-orientation":o==="vertical"?"vertical":void 0,role:"tablist"});return{contextValue:K.useMemo(()=>R({},f,x),[f,x]),dispatch:I,getRootProps:$,highlightedValue:A,isRtl:v,orientation:o,rootRef:k,selectedValue:(t=E[0])!=null?t:null}}function fA(e){const{value:t,children:n}=e,{dispatch:r,getItemIndex:i,getItemState:o,registerItem:a,totalSubitemCount:l}=t,c=K.useMemo(()=>({dispatch:r,getItemState:o,getItemIndex:i}),[r,i,o]),u=K.useMemo(()=>({getItemIndex:i,registerItem:a,totalSubitemCount:l}),[a,i,l]);return s.jsx(tc.Provider,{value:u,children:s.jsx(vh.Provider,{value:c,children:n})})}function hA(e){return e.size}function pA(e){const{value:t,rootRef:n,disabled:r=!1,id:i}=e,o=K.useRef(null),a=io(i),{value:l,selectionFollowsFocus:c,getTabPanelId:u}=Da(),f=K.useMemo(()=>({disabled:r,ref:o,id:a}),[r,o,a]),{id:d,index:p,totalItemCount:g}=yh(t!=null?t:hA,f),{getRootProps:v,highlighted:m,selected:b}=VI({item:d}),{getRootProps:C,rootRef:S,active:x,focusVisible:I,setFocusVisible:w}=Xl({disabled:r,focusableWhenDisabled:!c,type:"button"}),A=gn(o,n,S),E=d!==void 0?u(d):void 0;return{getRootProps:($={})=>{const G=Nn($),O=WI(v,C);return R({},$,O(G),{role:"tab","aria-controls":E,"aria-selected":b,id:a,ref:A})},active:x,focusVisible:I,highlighted:m,index:p,rootRef:A,selected:b||d===l,setFocusVisible:w,totalTabsCount:g}}const Ph="$$joy";function gA(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}function mA(e,t){return Di(e,t)}const vA=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},bA=["values","unit","step"],yA=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>R({},n,{[r.key]:r.val}),{})};function Dh(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=De(e,bA),o=yA(t),a=Object.keys(o);function l(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function u(p,g){const v=a.indexOf(g);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(v!==-1&&typeof t[a[v]]=="number"?t[a[v]]:g)-r/100}${n})`}function f(p){return a.indexOf(p)+1<a.length?u(p,a[a.indexOf(p)+1]):l(p)}function d(p){const g=a.indexOf(p);return g===0?l(a[1]):g===a.length-1?c(a[g]):u(p,a[a.indexOf(p)+1]).replace("@media","@media not all and")}return R({keys:a,values:o,up:l,down:c,between:u,only:f,not:d,unit:n},i)}const xA={borderRadius:4};function oo(e,t){return t?jn(e,t,{clone:!1}):e}const ac={xs:0,sm:600,md:900,lg:1200,xl:1536},Oh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${ac[e]}px)`};function Vn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Oh;return t.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(t[c]),a),{})}if(typeof t=="object"){const o=r.breakpoints||Oh;return Object.keys(t).reduce((a,l)=>{if(Object.keys(o.values||ac).indexOf(l)!==-1){const c=o.up(l);a[c]=n(t[l],l)}else{const c=l;a[c]=t[c]}return a},{})}return n(t)}function CA(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function wA(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function ar(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Oa(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=ar(e,n)||r,t&&(i=t(i,r,e)),i}function ct(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const l=a[t],c=a.theme,u=ar(c,r)||{};return Vn(a,l,d=>{let p=Oa(u,i,d);return d===p&&typeof d=="string"&&(p=Oa(u,i,`${t}${d==="default"?"":Se(d)}`,d)),n===!1?p:{[n]:p}})};return o.propTypes={},o.filterProps=[t],o}function SA(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const IA={m:"margin",p:"padding"},AA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Rh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},TA=SA(e=>{if(e.length>2)if(Rh[e])e=Rh[e];else return[e];const[t,n]=e.split(""),r=IA[t],i=AA[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),sc=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],lc=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...sc,...lc];function ao(e,t,n,r){var i;const o=(i=ar(e,t,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function Lh(e){return ao(e,"spacing",8)}function so(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function EA(e,t){return n=>e.reduce((r,i)=>(r[i]=so(t,n),r),{})}function kA(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=TA(n),o=EA(i,r),a=e[n];return Vn(e,a,o)}function Mh(e,t){const n=Lh(e.theme);return Object.keys(e).map(r=>kA(e,t,r,n)).reduce(oo,{})}function it(e){return Mh(e,sc)}it.propTypes={},it.filterProps=sc;function ot(e){return Mh(e,lc)}ot.propTypes={},ot.filterProps=lc;function Bh(e=8){if(e.mui)return e;const t=Lh({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function Ra(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?oo(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function sn(e){return typeof e!="number"?e:`${e}px solid`}function ln(e,t){return ct({prop:e,themeKey:"borders",transform:t})}const _A=ln("border",sn),PA=ln("borderTop",sn),DA=ln("borderRight",sn),OA=ln("borderBottom",sn),RA=ln("borderLeft",sn),LA=ln("borderColor"),MA=ln("borderTopColor"),BA=ln("borderRightColor"),$A=ln("borderBottomColor"),FA=ln("borderLeftColor"),NA=ln("outline",sn),zA=ln("outlineColor"),La=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ao(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:so(t,r)});return Vn(e,e.borderRadius,n)}return null};La.propTypes={},La.filterProps=["borderRadius"],Ra(_A,PA,DA,OA,RA,LA,MA,BA,$A,FA,La,NA,zA);const Ma=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ao(e.theme,"spacing",8),n=r=>({gap:so(t,r)});return Vn(e,e.gap,n)}return null};Ma.propTypes={},Ma.filterProps=["gap"];const Ba=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ao(e.theme,"spacing",8),n=r=>({columnGap:so(t,r)});return Vn(e,e.columnGap,n)}return null};Ba.propTypes={},Ba.filterProps=["columnGap"];const $a=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ao(e.theme,"spacing",8),n=r=>({rowGap:so(t,r)});return Vn(e,e.rowGap,n)}return null};$a.propTypes={},$a.filterProps=["rowGap"];const jA=ct({prop:"gridColumn"}),UA=ct({prop:"gridRow"}),VA=ct({prop:"gridAutoFlow"}),HA=ct({prop:"gridAutoColumns"}),WA=ct({prop:"gridAutoRows"}),GA=ct({prop:"gridTemplateColumns"}),YA=ct({prop:"gridTemplateRows"}),KA=ct({prop:"gridTemplateAreas"}),qA=ct({prop:"gridArea"});Ra(Ma,Ba,$a,jA,UA,VA,HA,WA,GA,YA,KA,qA);function Zr(e,t){return t==="grey"?t:e}const QA=ct({prop:"color",themeKey:"palette",transform:Zr}),JA=ct({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Zr}),XA=ct({prop:"backgroundColor",themeKey:"palette",transform:Zr});Ra(QA,JA,XA);function qt(e){return e<=1&&e!==0?`${e*100}%`:e}const ZA=ct({prop:"width",transform:qt}),cc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||ac[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:qt(n)}};return Vn(e,e.maxWidth,t)}return null};cc.filterProps=["maxWidth"];const e1=ct({prop:"minWidth",transform:qt}),t1=ct({prop:"height",transform:qt}),n1=ct({prop:"maxHeight",transform:qt}),r1=ct({prop:"minHeight",transform:qt});ct({prop:"size",cssProperty:"width",transform:qt}),ct({prop:"size",cssProperty:"height",transform:qt});const i1=ct({prop:"boxSizing"});Ra(ZA,cc,e1,t1,n1,r1,i1);const Fa={border:{themeKey:"borders",transform:sn},borderTop:{themeKey:"borders",transform:sn},borderRight:{themeKey:"borders",transform:sn},borderBottom:{themeKey:"borders",transform:sn},borderLeft:{themeKey:"borders",transform:sn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:sn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:La},color:{themeKey:"palette",transform:Zr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Zr},backgroundColor:{themeKey:"palette",transform:Zr},p:{style:ot},pt:{style:ot},pr:{style:ot},pb:{style:ot},pl:{style:ot},px:{style:ot},py:{style:ot},padding:{style:ot},paddingTop:{style:ot},paddingRight:{style:ot},paddingBottom:{style:ot},paddingLeft:{style:ot},paddingX:{style:ot},paddingY:{style:ot},paddingInline:{style:ot},paddingInlineStart:{style:ot},paddingInlineEnd:{style:ot},paddingBlock:{style:ot},paddingBlockStart:{style:ot},paddingBlockEnd:{style:ot},m:{style:it},mt:{style:it},mr:{style:it},mb:{style:it},ml:{style:it},mx:{style:it},my:{style:it},margin:{style:it},marginTop:{style:it},marginRight:{style:it},marginBottom:{style:it},marginLeft:{style:it},marginX:{style:it},marginY:{style:it},marginInline:{style:it},marginInlineStart:{style:it},marginInlineEnd:{style:it},marginBlock:{style:it},marginBlockStart:{style:it},marginBlockEnd:{style:it},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ma},rowGap:{style:$a},columnGap:{style:Ba},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qt},maxWidth:{style:cc},minWidth:{transform:qt},height:{transform:qt},maxHeight:{transform:qt},minHeight:{transform:qt},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function o1(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function a1(e,t){return typeof e=="function"?e(t):e}function s1(){function e(n,r,i,o){const a={[n]:r,theme:i},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:f,style:d}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const p=ar(i,u)||{};return d?d(a):Vn(a,r,v=>{let m=Oa(p,f,v);return v===m&&typeof v=="string"&&(m=Oa(p,f,`${n}${v==="default"?"":Se(v)}`,v)),c===!1?m:{[c]:m}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:Fa;function l(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const f=CA(o.breakpoints),d=Object.keys(f);let p=f;return Object.keys(u).forEach(g=>{const v=a1(u[g],o);if(v!=null)if(typeof v=="object")if(a[g])p=oo(p,e(g,v,o,a));else{const m=Vn({theme:o},v,b=>({[g]:b}));o1(m,v)?p[g]=t({sx:v,theme:o}):p=oo(p,m)}else p=oo(p,e(g,v,o,a))}),wA(d,p)}return Array.isArray(i)?i.map(l):l(i)}return t}const Na=s1();Na.filterProps=["sx"];function $h(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const l1=["breakpoints","palette","spacing","shape"];function Fh(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=De(e,l1),l=Dh(n),c=Bh(i);let u=jn({breakpoints:l,direction:"ltr",components:{},palette:R({mode:"light"},r),spacing:c,shape:R({},xA,o)},a);return u.applyStyles=$h,u=t.reduce((f,d)=>jn(f,d),u),u.unstable_sxConfig=R({},Fa,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(d){return Na({sx:d,theme:this})},u}function c1(e){return Object.keys(e).length===0}function u1(e=null){const t=K.useContext(me.ThemeContext);return!t||c1(t)?e:t}const d1=Fh();function f1(e=d1){return u1(e)}const h1=["sx"],p1=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:Fa;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function g1(e){const{sx:t}=e,n=De(e,h1),{systemProps:r,otherProps:i}=p1(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...a)=>{const l=t(...a);return or(l)?R({},r,l):r}:o=R({},r,t),R({},i,{sx:o})}const m1=["ownerState"],v1=["variants"],b1=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function y1(e){return Object.keys(e).length===0}function x1(e){return typeof e=="string"&&e.charCodeAt(0)>96}function uc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const C1=Fh(),w1=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function za({defaultTheme:e,theme:t,themeId:n}){return y1(t)?e:t[n]||t}function S1(e){return e?(t,n)=>n[e]:null}function ja(e,t){let{ownerState:n}=t,r=De(t,m1);const i=typeof e=="function"?e(R({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>ja(o,R({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let l=De(i,v1);return o.forEach(c=>{let u=!0;typeof c.props=="function"?u=c.props(R({ownerState:n},r,n)):Object.keys(c.props).forEach(f=>{(n==null?void 0:n[f])!==c.props[f]&&r[f]!==c.props[f]&&(u=!1)}),u&&(Array.isArray(l)||(l=[l]),l.push(typeof c.style=="function"?c.style(R({ownerState:n},r,n)):c.style))}),l}return i}function I1(e={}){const{themeId:t,defaultTheme:n=C1,rootShouldForwardProp:r=uc,slotShouldForwardProp:i=uc}=e,o=a=>Na(R({},a,{theme:za(R({},a,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(a,l={})=>{vA(a,w=>w.filter(A=>!(A!=null&&A.__mui_systemSx)));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:p=S1(w1(u))}=l,g=De(l,b1),v=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let b,C=uc;u==="Root"||u==="root"?C=r:u?C=i:x1(a)&&(C=void 0);const S=mA(a,R({shouldForwardProp:C,label:b},g)),x=w=>typeof w=="function"&&w.__emotion_real!==w||or(w)?A=>ja(w,R({},A,{theme:za({theme:A.theme,defaultTheme:n,themeId:t})})):w,I=(w,...A)=>{let E=x(w);const k=A?A.map(x):[];c&&p&&k.push(O=>{const T=za(R({},O,{defaultTheme:n,themeId:t}));if(!T.components||!T.components[c]||!T.components[c].styleOverrides)return null;const F=T.components[c].styleOverrides,H={};return Object.entries(F).forEach(([j,N])=>{H[j]=ja(N,R({},O,{theme:T}))}),p(O,H)}),c&&!v&&k.push(O=>{var T;const F=za(R({},O,{defaultTheme:n,themeId:t})),H=F==null||(T=F.components)==null||(T=T[c])==null?void 0:T.variants;return ja({variants:H},R({},O,{theme:F}))}),m||k.push(o);const $=k.length-A.length;if(Array.isArray(w)&&$>0){const O=new Array($).fill("");E=[...w,...O],E.raw=[...w.raw,...O]}const G=S(E,...k);return a.muiName&&(G.muiName=a.muiName),G};return S.withConfig&&(I.withConfig=S.withConfig),I}}function A1(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:uh(t.components[n].defaultProps,r)}function T1({props:e,name:t,defaultTheme:n,themeId:r}){let i=f1(n);return r&&(i=i[r]||i),A1({theme:i,name:t,props:e})}function E1(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Nh(e){if(e.type)return e;if(e.charAt(0)==="#")return Nh(E1(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(ga(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(ga(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Ar=e=>{const t=Nh(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};function dc(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const zh=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},k1=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([l,c])=>{(!n||n&&!n([...o,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,l],Array.isArray(c)?[...a,l]:a):t([...o,l],c,a))})}r(e)},_1=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().indexOf("opacity")>=0?t:`${t}px`:t;function fc(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return k1(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const f=`--${n?`${n}-`:""}${l.join("-")}`;Object.assign(i,{[f]:_1(l,c)}),zh(o,l,`var(${f})`,u),zh(a,l,`var(${f}, ${c})`,u)}},l=>l[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function Tr(e){"@babel/helpers - typeof";return Tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(e)}function P1(e,t){if(Tr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hc(e){var t=P1(e,"string");return Tr(t)=="symbol"?t:t+""}const D1=["colorSchemes","components","defaultColorScheme"];function O1(e,t){const{colorSchemes:n={},defaultColorScheme:r="light"}=e,i=De(e,D1),{vars:o,css:a,varsWithDefaults:l}=fc(i,t);let c=l;const u={},{[r]:f}=n,d=De(n,[r].map(hc));if(Object.entries(d||{}).forEach(([g,v])=>{const{vars:m,css:b,varsWithDefaults:C}=fc(v,t);c=jn(c,C),u[g]={css:b,vars:m}}),f){const{css:g,vars:v,varsWithDefaults:m}=fc(f,t);c=jn(c,m),u[r]={css:g,vars:v}}return{vars:c,generateCssVars:g=>{var v;if(!g){var m;const C=R({},a);return{css:C,vars:o,selector:(t==null||(m=t.getSelector)==null?void 0:m.call(t,g,C))||":root"}}const b=R({},u[g].css);return{css:b,vars:u[g].vars,selector:(t==null||(v=t.getSelector)==null?void 0:v.call(t,g,b))||":root"}}}}const R1=R({},Fa,{borderRadius:{themeKey:"radius"},boxShadow:{themeKey:"shadow"},fontFamily:{themeKey:"fontFamily"},fontSize:{themeKey:"fontSize"},fontWeight:{themeKey:"fontWeight"},letterSpacing:{themeKey:"letterSpacing"},lineHeight:{themeKey:"lineHeight"}}),lo={grey:{50:"#FBFCFE",100:"#F0F4F8",200:"#DDE7EE",300:"#CDD7E1",400:"#9FA6AD",500:"#636B74",600:"#555E68",700:"#32383E",800:"#171A1C",900:"#0B0D0E"},blue:{50:"#EDF5FD",100:"#E3EFFB",200:"#C7DFF7",300:"#97C3F0",400:"#4393E4",500:"#0B6BCB",600:"#185EA5",700:"#12467B",800:"#0A2744",900:"#051423"},yellow:{50:"#FEFAF6",100:"#FDF0E1",200:"#FCE1C2",300:"#F3C896",400:"#EA9A3E",500:"#9A5B13",600:"#72430D",700:"#492B08",800:"#2E1B05",900:"#1D1002"},red:{50:"#FEF6F6",100:"#FCE4E4",200:"#F7C5C5",300:"#F09898",400:"#E47474",500:"#C41C1C",600:"#A51818",700:"#7D1212",800:"#430A0A",900:"#240505"},green:{50:"#F6FEF6",100:"#E3FBE3",200:"#C7F7C7",300:"#A1E8A1",400:"#51BC51",500:"#1F7A1F",600:"#136C13",700:"#0A470A",800:"#042F04",900:"#021D02"}};function L1(e){var t;return!!e[0].match(/^(typography|variants|breakpoints)$/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/^(mode)$/))||e[0]==="focus"&&e[1]!=="thickness"}const ut=(e,t)=>fh(e,t,"Mui"),qe=(e,t)=>bI(e,t,"Mui"),M1=e=>e&&typeof e=="object"&&Object.keys(e).some(t=>{var n;return(n=t.match)==null?void 0:n.call(t,/^(plain(Hover|Active|Disabled)?(Color|Bg)|outlined(Hover|Active|Disabled)?(Color|Border|Bg)|soft(Hover|Active|Disabled)?(Color|Bg)|solid(Hover|Active|Disabled)?(Color|Bg))$/)}),jh=(e,t,n)=>{t.includes("Color")&&(e.color=n),t.includes("Bg")&&(e.backgroundColor=n),t.includes("Border")&&(e.borderColor=n)},Uh=(e,t,n)=>{const r={};return Object.entries(t||{}).forEach(([i,o])=>{if(i.match(new RegExp(`${e}(color|bg|border)`,"i"))&&o){const a=n?n(i):o;i.includes("Disabled")&&(r.pointerEvents="none",r.cursor="default",r["--Icon-color"]="currentColor"),i.match(/(Hover|Active|Disabled)/)||(r["--variant-borderWidth"]||(r["--variant-borderWidth"]="0px"),i.includes("Border")&&(r["--variant-borderWidth"]="1px",r.border="var(--variant-borderWidth) solid")),jh(r,i,a)}}),r},Rt=(e,t)=>{let n={};if(t){const{getCssVar:r,palette:i}=t;Object.entries(i).forEach(o=>{const[a,l]=o;M1(l)&&typeof l=="object"&&(n=R({},n,{[a]:Uh(e,l,c=>`var(--variant-${c}, ${r(`palette-${a}-${c}`,i[a][c])})`)}))})}return n.context=Uh(e,{plainColor:"var(--variant-plainColor)",plainHoverColor:"var(--variant-plainHoverColor)",plainHoverBg:"var(--variant-plainHoverBg)",plainActiveBg:"var(--variant-plainActiveBg)",plainDisabledColor:"var(--variant-plainDisabledColor)",outlinedColor:"var(--variant-outlinedColor)",outlinedBorder:"var(--variant-outlinedBorder)",outlinedHoverColor:"var(--variant-outlinedHoverColor)",outlinedHoverBorder:"var(--variant-outlinedHoverBorder)",outlinedHoverBg:"var(--variant-outlinedHoverBg)",outlinedActiveBg:"var(--variant-outlinedActiveBg)",outlinedDisabledColor:"var(--variant-outlinedDisabledColor)",outlinedDisabledBorder:"var(--variant-outlinedDisabledBorder)",softColor:"var(--variant-softColor)",softBg:"var(--variant-softBg)",softHoverColor:"var(--variant-softHoverColor)",softHoverBg:"var(--variant-softHoverBg)",softActiveBg:"var(--variant-softActiveBg)",softDisabledColor:"var(--variant-softDisabledColor)",softDisabledBg:"var(--variant-softDisabledBg)",solidColor:"var(--variant-solidColor)",solidBg:"var(--variant-solidBg)",solidHoverBg:"var(--variant-solidHoverBg)",solidActiveBg:"var(--variant-solidActiveBg)",solidDisabledColor:"var(--variant-solidDisabledColor)",solidDisabledBg:"var(--variant-solidDisabledBg)"}),n},B1=["cssVarPrefix","breakpoints","spacing","components","variants","shouldSkipGeneratingVar"],$1=["colorSchemes"],F1=(e="joy")=>dc(e);function N1(e){var t,n,r,i,o,a,l,c,u,f;const d={},{cssVarPrefix:p="joy",breakpoints:g,spacing:v,components:m,variants:b,shouldSkipGeneratingVar:C=L1}=d,S=De(d,B1),x=F1(p),I={primary:lo.blue,neutral:lo.grey,danger:lo.red,success:lo.green,warning:lo.yellow,common:{white:"#FFF",black:"#000"}},w=Z=>{var te;const ne=Z.split("-"),ue=ne[1],be=ne[2];return x(Z,(te=I[ue])==null?void 0:te[be])},A=Z=>({plainColor:w(`palette-${Z}-500`),plainHoverBg:w(`palette-${Z}-100`),plainActiveBg:w(`palette-${Z}-200`),plainDisabledColor:w("palette-neutral-400"),outlinedColor:w(`palette-${Z}-500`),outlinedBorder:w(`palette-${Z}-300`),outlinedHoverBg:w(`palette-${Z}-100`),outlinedActiveBg:w(`palette-${Z}-200`),outlinedDisabledColor:w("palette-neutral-400"),outlinedDisabledBorder:w("palette-neutral-200"),softColor:w(`palette-${Z}-700`),softBg:w(`palette-${Z}-100`),softHoverBg:w(`palette-${Z}-200`),softActiveColor:w(`palette-${Z}-800`),softActiveBg:w(`palette-${Z}-300`),softDisabledColor:w("palette-neutral-400"),softDisabledBg:w("palette-neutral-50"),solidColor:w("palette-common-white"),solidBg:w(`palette-${Z}-500`),solidHoverBg:w(`palette-${Z}-600`),solidActiveBg:w(`palette-${Z}-700`),solidDisabledColor:w("palette-neutral-400"),solidDisabledBg:w("palette-neutral-100")}),E=Z=>({plainColor:w(`palette-${Z}-300`),plainHoverBg:w(`palette-${Z}-800`),plainActiveBg:w(`palette-${Z}-700`),plainDisabledColor:w("palette-neutral-500"),outlinedColor:w(`palette-${Z}-200`),outlinedBorder:w(`palette-${Z}-700`),outlinedHoverBg:w(`palette-${Z}-800`),outlinedActiveBg:w(`palette-${Z}-700`),outlinedDisabledColor:w("palette-neutral-500"),outlinedDisabledBorder:w("palette-neutral-800"),softColor:w(`palette-${Z}-200`),softBg:w(`palette-${Z}-800`),softHoverBg:w(`palette-${Z}-700`),softActiveColor:w(`palette-${Z}-100`),softActiveBg:w(`palette-${Z}-600`),softDisabledColor:w("palette-neutral-500"),softDisabledBg:w("palette-neutral-800"),solidColor:w("palette-common-white"),solidBg:w(`palette-${Z}-500`),solidHoverBg:w(`palette-${Z}-600`),solidActiveBg:w(`palette-${Z}-700`),solidDisabledColor:w("palette-neutral-500"),solidDisabledBg:w("palette-neutral-800")}),k={palette:{mode:"light",primary:R({},I.primary,A("primary")),neutral:R({},I.neutral,A("neutral"),{plainColor:w("palette-neutral-700"),plainHoverColor:w("palette-neutral-900"),outlinedColor:w("palette-neutral-700")}),danger:R({},I.danger,A("danger")),success:R({},I.success,A("success")),warning:R({},I.warning,A("warning")),common:{white:"#FFF",black:"#000"},text:{primary:w("palette-neutral-800"),secondary:w("palette-neutral-700"),tertiary:w("palette-neutral-600"),icon:w("palette-neutral-500")},background:{body:w("palette-common-white"),surface:w("palette-neutral-50"),popup:w("palette-common-white"),level1:w("palette-neutral-100"),level2:w("palette-neutral-200"),level3:w("palette-neutral-300"),tooltip:w("palette-neutral-500"),backdrop:`rgba(${x("palette-neutral-darkChannel",Ar(I.neutral[900]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",Ar(I.neutral[500]))} / 0.2)`,focusVisible:w("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"21 21 21",shadowOpacity:"0.08"},$={palette:{mode:"dark",primary:R({},I.primary,E("primary")),neutral:R({},I.neutral,E("neutral"),{plainColor:w("palette-neutral-300"),plainHoverColor:w("palette-neutral-300")}),danger:R({},I.danger,E("danger")),success:R({},I.success,E("success")),warning:R({},I.warning,E("warning")),common:{white:"#FFF",black:"#000"},text:{primary:w("palette-neutral-100"),secondary:w("palette-neutral-300"),tertiary:w("palette-neutral-400"),icon:w("palette-neutral-400")},background:{body:w("palette-common-black"),surface:w("palette-neutral-900"),popup:w("palette-common-black"),level1:w("palette-neutral-800"),level2:w("palette-neutral-700"),level3:w("palette-neutral-600"),tooltip:w("palette-neutral-600"),backdrop:`rgba(${x("palette-neutral-darkChannel",Ar(I.neutral[50]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",Ar(I.neutral[500]))} / 0.16)`,focusVisible:w("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"0 0 0",shadowOpacity:"0.6"},G='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',O=R({body:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,display:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,code:"Source Code Pro,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",fallback:G},S.fontFamily),T=R({sm:300,md:500,lg:600,xl:700},S.fontWeight),F=R({xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem"},S.fontSize),H=R({xs:"1.33334",sm:"1.42858",md:"1.5",lg:"1.55556",xl:"1.66667"},S.lineHeight),j=(t=(n=S.colorSchemes)==null||(n=n.light)==null?void 0:n.shadowRing)!=null?t:k.shadowRing,N=(r=(i=S.colorSchemes)==null||(i=i.light)==null?void 0:i.shadowChannel)!=null?r:k.shadowChannel,L=(o=(a=S.colorSchemes)==null||(a=a.light)==null?void 0:a.shadowOpacity)!=null?o:k.shadowOpacity,V={colorSchemes:{light:k,dark:$},fontSize:F,fontFamily:O,fontWeight:T,focus:{thickness:"2px",selector:`&.${ut("","focusVisible")}, &:focus-visible`,default:{outlineOffset:`var(--focus-outline-offset, ${x("focus-thickness",(l=(c=S.focus)==null?void 0:c.thickness)!=null?l:"2px")})`,outline:`${x("focus-thickness",(u=(f=S.focus)==null?void 0:f.thickness)!=null?u:"2px")} solid ${x("palette-focusVisible",I.primary[500])}`}},lineHeight:H,radius:{xs:"2px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},shadow:{xs:`${x("shadowRing",j)}, 0px 1px 2px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)})`,sm:`${x("shadowRing",j)}, 0px 1px 2px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)}), 0px 2px 4px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)})`,md:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)}), 0px 6px 12px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)})`,lg:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)}), 0px 12px 16px -4px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)})`,xl:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)}), 0px 20px 24px -4px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",L)})`},zIndex:{badge:1,table:10,popup:1e3,modal:1300,snackbar:1400,tooltip:1500},typography:{h1:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl4, ${F.xl4}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h2:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl3, ${F.xl3}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h3:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl2, ${F.xl2}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h4:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl, ${F.xl}`),lineHeight:x(`lineHeight-md, ${H.md}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-lg":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-lg, ${F.lg}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-md":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-md, ${F.md}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-sm":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-sm, ${F.sm}`),lineHeight:x(`lineHeight-sm, ${H.sm}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"body-lg":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-lg, ${F.lg}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-secondary, ${k.palette.text.secondary}`)},"body-md":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-md, ${F.md}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-secondary, ${k.palette.text.secondary}`)},"body-sm":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-sm, ${F.sm}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-tertiary, ${k.palette.text.tertiary}`)},"body-xs":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-xs, ${F.xs}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-tertiary, ${k.palette.text.tertiary}`)}}},Y=S?jn(V,S):V,{colorSchemes:X}=Y,D=De(Y,$1),B=R({colorSchemes:X},D,{breakpoints:Dh(g!=null?g:{}),components:jn({MuiSvgIcon:{defaultProps:{fontSize:"xl2"},styleOverrides:{root:({ownerState:Z,theme:te})=>{var ne;const ue=Z.instanceFontSize;return R({margin:"var(--Icon-margin)"},Z.fontSize&&Z.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${te.vars.fontSize[Z.fontSize]})`},!Z.htmlColor&&R({color:`var(--Icon-color, ${B.vars.palette.text.icon})`},Z.color&&Z.color!=="inherit"&&te.vars.palette[Z.color]&&{color:`rgba(${(ne=te.vars.palette[Z.color])==null?void 0:ne.mainChannel} / 1)`}),ue&&ue!=="inherit"&&{"--Icon-fontSize":te.vars.fontSize[ue]})}}}},m),cssVarPrefix:p,getCssVar:x,spacing:Bh(v)});function U(Z,te){Object.keys(te).forEach(ne=>{const ue={main:"500",light:"200",dark:"700"};Z==="dark"&&(ue.main=400),!te[ne].mainChannel&&te[ne][ue.main]&&(te[ne].mainChannel=Ar(te[ne][ue.main])),!te[ne].lightChannel&&te[ne][ue.light]&&(te[ne].lightChannel=Ar(te[ne][ue.light])),!te[ne].darkChannel&&te[ne][ue.dark]&&(te[ne].darkChannel=Ar(te[ne][ue.dark]))})}Object.entries(B.colorSchemes).forEach(([Z,te])=>{U(Z,te.palette)});const W={prefix:p,shouldSkipGeneratingVar:C},{vars:ie,generateCssVars:se}=O1(R({colorSchemes:X},D),W);B.vars=ie,B.generateCssVars=se,B.unstable_sxConfig=R({},R1,void 0),B.unstable_sx=function(te){return Na({sx:te,theme:this})},B.getColorSchemeSelector=Z=>Z==="light"?"&":`&[data-joy-color-scheme="${Z}"], [data-joy-color-scheme="${Z}"] &`;const oe={getCssVar:x,palette:B.colorSchemes.light.palette};return B.variants=jn({plain:Rt("plain",oe),plainHover:Rt("plainHover",oe),plainActive:Rt("plainActive",oe),plainDisabled:Rt("plainDisabled",oe),outlined:Rt("outlined",oe),outlinedHover:Rt("outlinedHover",oe),outlinedActive:Rt("outlinedActive",oe),outlinedDisabled:Rt("outlinedDisabled",oe),soft:Rt("soft",oe),softHover:Rt("softHover",oe),softActive:Rt("softActive",oe),softDisabled:Rt("softDisabled",oe),solid:Rt("solid",oe),solidHover:Rt("solidHover",oe),solidActive:Rt("solidActive",oe),solidDisabled:Rt("solidDisabled",oe)},b),B.palette=R({},B.colorSchemes.light.palette,{colorScheme:"light"}),B.shouldSkipGeneratingVar=C,B.applyStyles=$h,B}const Vh=N1(),Ce=I1({defaultTheme:Vh,themeId:Ph});function mt({props:e,name:t}){return T1({props:e,name:t,defaultTheme:R({},Vh,{components:{}}),themeId:Ph})}function z1(e){return ut("MuiAccordion",e)}const j1=qe("MuiAccordion",["root","expanded","disabled"]),U1=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],V1=["component","slots","slotProps"],H1=["component"];function Ee(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:l}=t,c=De(t,U1),{component:u,slots:f={[e]:void 0},slotProps:d={[e]:void 0}}=o,p=De(o,V1),g=f[e]||r,v=tI(d[e],i),m=iI(R({className:n},c,{externalForwardedProps:e==="root"?p:void 0,externalSlotProps:v})),{props:{component:b},internalRef:C}=m,S=De(m.props,H1),x=gn(C,v==null?void 0:v.ref,t.ref),I=a?a(S):{},w=R({},i,I),A=e==="root"?b||u:b,E=eI(g,R({},e==="root"&&!u&&!f[e]&&l,e!=="root"&&!f[e]&&l,S,A&&{as:A},{ref:x}),w);return Object.keys(I).forEach(k=>{delete E[k]}),[g,E]}const pc=K.createContext({});function W1(e){return ut("MuiListItem",e)}const Hh=qe("MuiListItem",["root","startAction","endAction","nested","nesting","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]),Ua=K.createContext(!1),gc=K.createContext(!1),Wh=K.createContext(!1),Gh=K.createContext(void 0),G1=K.createContext(void 0),Yh=K.createContext(void 0),Y1=["component","className","children","nested","sticky","variant","color","startAction","endAction","role","slots","slotProps"],K1=e=>{const{sticky:t,nested:n,nesting:r,variant:i,color:o}=e,a={root:["root",n&&"nested",r&&"nesting",t&&"sticky",o&&`color${Se(o)}`,i&&`variant${Se(i)}`],startAction:["startAction"],endAction:["endAction"]};return gt(a,W1,{})},mc=Ce("li")(({theme:e,ownerState:t})=>{var n;return[!t.nested&&{"--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItemButton-marginBlock":"calc(-1 * var(--ListItem-paddingY))",alignItems:"center",gap:"var(--ListItem-gap)",marginInline:"var(--ListItem-marginInline)"},t.nested&&{"--NestedList-marginRight":"calc(-1 * var(--ListItem-paddingRight))","--NestedList-marginLeft":"calc(-1 * var(--ListItem-paddingLeft))","--NestedListItem-paddingLeft":"calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItem-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",flexDirection:"column"},R({"--unstable_actionRadius":"calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"},t.startAction&&{"--unstable_startActionWidth":"2rem"},t.endAction&&{"--unstable_endActionWidth":"2.5rem"},{boxSizing:"border-box",borderRadius:"var(--ListItem-radius)",display:"var(--_ListItem-display)","&:not([hidden])":{"--_ListItem-display":"var(--_List-markerDisplay, flex)"},flex:"none",listStyleType:"var(--_List-markerType, disc)",position:"relative",paddingBlockStart:t.nested?0:"var(--ListItem-paddingY)",paddingBlockEnd:t.nested?0:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)"},t["data-first-child"]===void 0&&R({},t.row?{marginInlineStart:"var(--List-gap)"}:{marginBlockStart:"var(--List-gap)"}),t.row&&t.wrap&&{marginInlineStart:"var(--List-gap)",marginBlockStart:"var(--List-gap)"},{minBlockSize:"var(--ListItem-minHeight)"},t.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:`var(--ListItem-stickyBackground, ${e.vars.palette.background.body})`},{[`.${Hh.nested} > &`]:{"--_ListItem-display":"flex"}}),(n=e.variants[t.variant])==null?void 0:n[t.color]]}),q1=Ce(mc,{name:"JoyListItem",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Q1=Ce("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",left:0,transform:"translate(var(--ListItem-startActionTranslateX), -50%)",zIndex:1})),J1=Ce("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",right:0,transform:"translate(var(--ListItem-endActionTranslateX), -50%)"})),Kh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyListItem"}),i=K.useContext(Yh),o=K.useContext(Gh),a=K.useContext(gc),l=K.useContext(Wh),c=K.useContext(Ua),{component:u,className:f,children:d,nested:p=!1,sticky:g=!1,variant:v="plain",color:m="neutral",startAction:b,endAction:C,role:S,slots:x={},slotProps:I={}}=r,w=De(r,Y1),[A,E]=K.useState(""),[k,$]=(o==null?void 0:o.split(":"))||["",""],G=u||(k&&!k.match(/^(ul|ol|menu)$/)?"div":void 0);let O=i==="menu"?"none":void 0;o&&(O={menu:"none",menubar:"none",group:"presentation"}[$]),S&&(O=S);const T=R({},r,{sticky:g,startAction:b,endAction:C,row:a,wrap:l,variant:v,color:m,nesting:c,nested:p,component:G,role:O}),F=K1(T),H=R({},w,{component:G,slots:x,slotProps:I}),[j,N]=Ee("root",{additionalProps:{role:O},ref:n,className:zn(F.root,f),elementType:q1,externalForwardedProps:H,ownerState:T}),[L,V]=Ee("startAction",{className:F.startAction,elementType:Q1,externalForwardedProps:H,ownerState:T}),[Y,X]=Ee("endAction",{className:F.endAction,elementType:J1,externalForwardedProps:H,ownerState:T});return s.jsx(G1.Provider,{value:E,children:s.jsx(Ua.Provider,{value:p?A||!0:!1,children:s.jsxs(j,R({},N,{children:[b&&s.jsx(L,R({},V,{children:b})),K.Children.map(d,(D,B)=>{var U;return K.isValidElement(D)?K.cloneElement(D,R({},B===0&&{"data-first-child":""},ah(D,["ListItem"])&&{component:((U=D.props)==null?void 0:U.component)||"div"})):D}),C&&s.jsx(Y,R({},X,{children:C}))]}))})})});Kh.muiName="ListItem";const qh=Kh;function X1(e){return ut("MuiAccordionDetails",e)}const Er=qe("MuiAccordionDetails",["root","content","expanded"]),Z1=["accordionId","component","color","children","defaultExpanded","disabled","expanded","onChange","variant","slots","slotProps"],eT=e=>{const{variant:t,color:n,expanded:r,disabled:i}=e,o={root:["root",r&&"expanded",i&&"disabled",n&&`color${Se(n)}`,t&&`variant${Se(t)}`]};return gt(o,z1,{})},tT=Ce(mc,{name:"JoyAccordion",slot:"Root",overridesResolver:(e,t)=>t.root})({borderBottom:"var(--Accordion-borderBottom)","&[data-first-child]":{"--ListItem-radius":"var(--unstable_List-childRadius) var(--unstable_List-childRadius) 0 0"},"&[data-last-child]":{"--ListItem-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)",'& [aria-expanded="true"]':{"--ListItem-radius":"0"},[`& .${Er.root}`]:{"--AccordionDetails-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)"}},"&:not([data-first-child]):not([data-last-child])":{"--ListItem-radius":"0"}}),nT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordion"}),{accordionId:i,component:o="div",color:a="neutral",children:l,defaultExpanded:c=!1,disabled:u=!1,expanded:f,onChange:d,variant:p="plain",slots:g={},slotProps:v={}}=r,m=De(r,Z1),b=io(i),[C,S]=Kl({controlled:f,default:c,name:"Accordion",state:"expanded"}),x=K.useCallback(G=>{S(!C),d&&d(G,!C)},[C,d,S]),I=K.useMemo(()=>({accordionId:b,expanded:C,disabled:u,toggle:x}),[b,C,u,x]),w=R({},m,{component:o,slots:g,slotProps:v}),A=R({},r,{component:o,color:a,variant:p,expanded:C,disabled:u,nested:!0}),E=eT(A),[k,$]=Ee("root",{ref:n,className:E.root,elementType:tT,externalForwardedProps:w,ownerState:A});return s.jsx(pc.Provider,{value:I,children:s.jsx(k,R({},$,{children:K.Children.map(l,(G,O)=>K.isValidElement(G)&&O===0?K.cloneElement(G,{"data-first-child":""}):G)}))})});function rT(e){return ut("MuiAccordionGroup",e)}qe("MuiAccordionGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const iT={"--NestedList-marginRight":"0px","--NestedList-marginLeft":"0px","--NestedListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px"};function vc(e){const{children:t,nested:n,row:r=!1,wrap:i=!1}=e,o=s.jsx(gc.Provider,{value:r,children:s.jsx(Wh.Provider,{value:i,children:K.Children.map(t,(a,l)=>K.isValidElement(a)?K.cloneElement(a,R({},l===0&&{"data-first-child":""},l===K.Children.count(t)-1&&{"data-last-child":""})):a)})});return n===void 0?o:s.jsx(Ua.Provider,{value:n,children:o})}const bc=({theme:e,ownerState:t},n)=>{let r={};function i(o){if(typeof o=="function"){const a=o(e);i(a)}else Array.isArray(o)?o.forEach(a=>{typeof a!="boolean"&&i(a)}):typeof o=="object"&&(r=R({},r,o))}return t.sx&&(i(t.sx),n.forEach(o=>{const a=r[o];if(typeof a=="string"||typeof a=="number")if(o==="borderRadius")if(typeof a=="number")r[o]=`${a}px`;else{var l;r[o]=((l=e.vars)==null?void 0:l.radius[a])||a}else["p","padding","m","margin"].indexOf(o)!==-1&&typeof a=="number"?r[o]=e.spacing(a):r[o]=a;else typeof a=="function"?r[o]=a(e):r[o]=void 0})),r};function oT(e){return ut("MuiList",e)}qe("MuiList",["root","nesting","scoped","sizeSm","sizeMd","sizeLg","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]);const aT=K.createContext(void 0),sT=["component","className","children","size","orientation","wrap","variant","color","role","slots","slotProps"],lT=e=>{const{variant:t,color:n,size:r,nesting:i,orientation:o,instanceSize:a}=e,l={root:["root",o,t&&`variant${Se(t)}`,n&&`color${Se(n)}`,!a&&!i&&r&&`size${Se(r)}`,a&&`size${Se(a)}`,i&&"nesting"]};return gt(l,oT,{})},yc=Ce("ul")(({theme:e,ownerState:t})=>{var n;const{p:r,padding:i,borderRadius:o}=bc({theme:e,ownerState:t},["p","padding","borderRadius"]);function a(l){return l==="sm"?{"--ListDivider-gap":"0.25rem","--ListItem-minHeight":"2rem","--ListItem-paddingY":"3px","--ListItem-paddingX":t.marker?"3px":"0.5rem","--ListItem-gap":"0.5rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.5rem":"2rem","--Icon-fontSize":e.vars.fontSize.lg}:l==="md"?{"--ListDivider-gap":"0.375rem","--ListItem-minHeight":"2.25rem","--ListItem-paddingY":"0.25rem","--ListItem-paddingX":t.marker?"0.25rem":"0.75rem","--ListItem-gap":"0.625rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.75rem":"2.5rem","--Icon-fontSize":e.vars.fontSize.xl}:l==="lg"?{"--ListDivider-gap":"0.5rem","--ListItem-minHeight":"2.75rem","--ListItem-paddingY":"0.375rem","--ListItem-paddingX":t.marker?"0.5rem":"1rem","--ListItem-gap":"0.75rem","--ListItemDecorator-size":t.orientation==="horizontal"?"2.25rem":"3rem","--Icon-fontSize":e.vars.fontSize.xl2}:{}}return[t.nesting&&R({},a(t.instanceSize),{"--ListItem-paddingRight":"var(--ListItem-paddingX)","--ListItem-paddingLeft":"var(--NestedListItem-paddingLeft)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px",padding:0},t.marker&&{paddingInlineStart:"calc(3ch - var(--_List-markerDeduct, 0px))"},{marginInlineStart:"var(--NestedList-marginLeft)",marginInlineEnd:"var(--NestedList-marginRight)",marginBlockStart:"var(--List-gap)",marginBlockEnd:"initial"}),!t.nesting&&R({},a(t.size),{"--List-gap":"0px","--List-nestedInsetStart":"0px","--ListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItem-paddingRight":"var(--ListItem-paddingX)"},t.marker&&{"--_List-markerDeduct":"1ch"},{"--unstable_List-childRadius":"calc(max(var(--List-radius) - var(--List-padding), min(var(--List-padding) / 2, var(--List-radius) / 2)) - var(--variant-borderWidth, 0px))","--ListItem-radius":"var(--unstable_List-childRadius)","--ListItem-startActionTranslateX":"calc(0.5 * var(--ListItem-paddingLeft))","--ListItem-endActionTranslateX":"calc(-0.5 * var(--ListItem-paddingRight))",margin:"initial"},e.typography[`body-${t.size}`],t.orientation==="horizontal"?R({},t.wrap?{padding:"var(--List-padding)",marginInlineStart:"calc(-1 * var(--List-gap))",marginBlockStart:"calc(-1 * var(--List-gap))"}:{paddingInline:"var(--List-padding, var(--ListDivider-gap))",paddingBlock:"var(--List-padding)"}):{paddingBlock:"var(--List-padding, var(--ListDivider-gap))",paddingInline:"var(--List-padding)"},t.marker&&{paddingInlineStart:"3ch"}),R({boxSizing:"border-box",borderRadius:"var(--List-radius)",listStyle:"none",display:"flex",flexDirection:t.orientation==="horizontal"?"row":"column"},t.wrap&&{flexWrap:"wrap"},t.marker&&{"--_List-markerDisplay":"list-item","--_List-markerType":t.marker,lineHeight:"calc(var(--ListItem-minHeight) - 2 * var(--ListItem-paddingY))"},{flexGrow:1,position:"relative"},(n=e.variants[t.variant])==null?void 0:n[t.color],{"--unstable_List-borderWidth":"var(--variant-borderWidth, 0px)"},o!==void 0&&{"--List-radius":o},r!==void 0&&{"--List-padding":r},i!==void 0&&{"--List-padding":i})]}),cT=Ce(yc,{name:"JoyList",slot:"Root",overridesResolver:(e,t)=>t.root})({}),uT=K.forwardRef(function(t,n){var r;const i=K.useContext(Ua),o=K.useContext(Yh),a=K.useContext(aT),l=mt({props:t,name:"JoyList"}),{component:c,className:u,children:f,size:d,orientation:p="vertical",wrap:g=!1,variant:v="plain",color:m="neutral",role:b,slots:C={},slotProps:S={}}=l,x=De(l,sT),I=d||((r=t.size)!=null?r:"md");let w;o&&(w="group"),a&&(w="presentation"),b&&(w=b);const A=R({},l,{instanceSize:t.size,size:I,nesting:i,orientation:p,wrap:g,variant:v,color:m,role:w}),E=lT(A),k=R({},x,{component:c,slots:C,slotProps:S}),[$,G]=Ee("root",{ref:n,className:zn(E.root,u),elementType:cT,externalForwardedProps:k,ownerState:A,additionalProps:{as:c,role:w,"aria-labelledby":typeof i=="string"?i:void 0}});return s.jsx($,R({},G,{children:s.jsx(Gh.Provider,{value:`${typeof c=="string"?c:""}:${w||""}`,children:s.jsx(vc,{row:p==="horizontal",wrap:g,children:f})})}))}),dT=["component","color","children","disableDivider","variant","transition","size","slots","slotProps"],fT=e=>{const{variant:t,color:n,size:r}=e,i={root:["root",t&&`variant${Se(t)}`,n&&`color${Se(n)}`,r&&`size${Se(r)}`]};return gt(i,rT,{})},hT=Ce(yc,{name:"JoyAccordionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{let n={};return t.transition&&(typeof t.transition=="string"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition}, padding-block ${t.transition}`}),typeof t.transition=="object"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition.initial}, padding-block ${t.transition.initial}`,[`& .${Er.root}.${Er.expanded}`]:{"--AccordionDetails-transition":`grid-template-rows ${t.transition.expanded}, padding-block ${t.transition.expanded}`}})),R({"--List-padding":"0px","--ListDivider-gap":"0px"},n,!t.disableDivider&&{[`& .${j1.root}:not([data-last-child])`]:{"--Accordion-borderBottom":`1px solid ${e.vars.palette.divider}`}})}),pT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionGroup"}),{component:i="div",color:o="neutral",children:a,disableDivider:l=!1,variant:c="plain",transition:u="0.2s ease",size:f="md",slots:d={},slotProps:p={}}=r,g=De(r,dT),v=R({},g,{component:i,slots:d,slotProps:p}),m=R({},r,{component:i,color:o,disableDivider:l,variant:c,transition:u,size:f}),b=fT(m),[C,S]=Ee("root",{ref:n,className:b.root,elementType:hT,externalForwardedProps:v,ownerState:m});return s.jsx(C,R({},S,{children:s.jsx(vc,{children:a})}))}),gT=["component","children","color","variant","slots","slotProps"],mT=e=>{const{expanded:t}=e;return gt({root:["root",t&&"expanded"],content:["content",t&&"expanded"]},X1,{})},vT=Ce("div",{name:"JoyAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n;return R({overflow:"hidden",borderRadius:"var(--AccordionDetails-radius)",display:"grid",gridTemplateRows:"1fr",marginInline:"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",transition:"var(--AccordionDetails-transition)"},(n=t.variants[e.variant])==null?void 0:n[e.color],{[`&:not(.${Er.expanded})`]:{gridTemplateRows:"0fr"}})}),bT=Ce("div",{name:"JoyAccordionDetails",slot:"Content",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",overflow:"hidden",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",paddingBlockStart:"calc(var(--ListItem-paddingY) / 2)",paddingBlockEnd:"calc(2.5 * var(--ListItem-paddingY))",transition:"var(--AccordionDetails-transition)",[`&:not(.${Er.expanded})`]:{paddingBlock:0}}),yT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionDetails"}),{component:i="div",children:o,color:a="neutral",variant:l="plain",slots:c={},slotProps:u={}}=r,f=De(r,gT),{accordionId:d,expanded:p=!1}=K.useContext(pc),g=K.useRef(null),v=gn(g,n);K.useEffect(()=>{g.current&&g.current.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])').forEach(E=>{if(p){const k=E.getAttribute("data-prev-tabindex"),$=E.getAttribute("tabindex");$&&k&&(E.setAttribute("tabindex",k),E.removeAttribute("data-prev-tabindex")),!k&&!$&&E.removeAttribute("tabindex")}else E.setAttribute("data-prev-tabindex",E.getAttribute("tabindex")||""),E.setAttribute("tabindex","-1")})},[p]);const m=R({},f,{component:i,slots:c,slotProps:u}),b=R({},r,{component:i,color:a,variant:l,expanded:p,nesting:!0}),C=mT(b),[S,x]=Ee("root",{ref:v,className:C.root,elementType:vT,externalForwardedProps:m,additionalProps:{id:`${d}-details`,"aria-labelledby":`${d}-summary`,role:"region",hidden:p?void 0:!0},ownerState:b}),[I,w]=Ee("content",{className:C.content,elementType:bT,externalForwardedProps:m,ownerState:b});return s.jsx(S,R({},x,{children:s.jsx(I,R({},w,{children:o}))}))});function xT(e){return ut("MuiAccordionSummary",e)}const Va=qe("MuiAccordionSummary",["root","button","indicator","disabled","expanded"]),Ha=qe("MuiListItemButton",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","variantPlain","variantSoft","variantOutlined","variantSolid"]),CT=K.createContext("horizontal"),xc=Ce("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,l;return R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",font:"inherit",display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:"var(--ListItem-gap)"},t.orientation==="vertical"&&{flexDirection:"column",justifyContent:"center"},{textAlign:"initial",textDecoration:"initial",backgroundColor:"initial",cursor:"pointer",marginInline:"var(--ListItemButton-marginInline)",marginBlock:"var(--ListItemButton-marginBlock)"},t["data-first-child"]===void 0&&{marginInlineStart:t.row?"var(--List-gap)":void 0,marginBlockStart:t.row?void 0:"var(--List-gap)"},{paddingBlock:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px))",paddingInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItem-startActionWidth, var(--unstable_startActionWidth, 0px)))",paddingInlineEnd:"calc(var(--ListItem-paddingRight) + var(--ListItem-endActionWidth, var(--unstable_endActionWidth, 0px)))",minBlockSize:"var(--ListItem-minHeight)",border:"1px solid transparent",borderRadius:"var(--ListItem-radius)",flex:"var(--unstable_ListItem-flex, none)",fontSize:"inherit",lineHeight:"inherit",minInlineSize:0,[e.focus.selector]:R({},e.focus.default,{zIndex:1})},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:active":(r=e.variants[`${t.variant}Active`])==null?void 0:r[t.color],[`.${Hh.root} > &`]:{"--unstable_ListItem-flex":"1 0 0%"},[`&.${Ha.selected}`]:R({},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],{"--Icon-color":"currentColor"}),[`&:not(.${Ha.selected}, [aria-selected="true"])`]:{"&:hover":(o=e.variants[`${t.variant}Hover`])==null?void 0:o[t.color],"&:active":(a=e.variants[`${t.variant}Active`])==null?void 0:a[t.color]},[`&.${Ha.disabled}`]:R({},(l=e.variants[`${t.variant}Disabled`])==null?void 0:l[t.color])})});Ce(xc,{name:"JoyListItemButton",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>R({},!e.row&&{[`&.${Ha.selected}`]:{fontWeight:t.vars.fontWeight.md}}));function wT(e){return ut("MuiSvgIcon",e)}qe("MuiSvgIcon",["root","colorInherit","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","fontSizeInherit","fontSizeXs","fontSizeSm","fontSizeMd","fontSizeLg","fontSizeXl","fontSizeXl2","fontSizeXl3","fontSizeXl4","sizeSm","sizeMd","sizeLg"]);const ST=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox","size","slots","slotProps"],IT=e=>{const{color:t,size:n,fontSize:r}=e,i={root:["root",t&&t!=="inherit"&&`color${Se(t)}`,n&&`size${Se(n)}`,r&&`fontSize${Se(r)}`]};return gt(i,wT,{})},Qh={sm:"xl",md:"xl2",lg:"xl3"},AT=Ce("svg",{name:"JoySvgIcon",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return R({},t.instanceSize&&{"--Icon-fontSize":e.vars.fontSize[Qh[t.instanceSize]]},t.instanceFontSize&&t.instanceFontSize!=="inherit"&&{"--Icon-fontSize":e.vars.fontSize[t.instanceFontSize]},{userSelect:"none",margin:"var(--Icon-margin)",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,fontSize:`var(--Icon-fontSize, ${e.vars.fontSize[Qh[t.size]]||"unset"})`},t.fontSize&&t.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${e.fontSize[t.fontSize]})`},!t.htmlColor&&R({color:`var(--Icon-color, ${e.vars.palette.text.icon})`},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&e.vars.palette[t.color]&&{color:`rgba(${(n=e.vars.palette[t.color])==null?void 0:n.mainChannel} / 1)`}))}),Jh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoySvgIcon"}),{children:i,className:o,color:a,component:l="svg",fontSize:c,htmlColor:u,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24",size:g="md",slots:v={},slotProps:m={}}=r,b=De(r,ST),C=K.isValidElement(i)&&i.type==="svg",S=R({},r,{color:a,component:l,size:g,instanceSize:t.size,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:C}),x=IT(S),I=R({},b,{component:l,slots:v,slotProps:m}),[w,A]=Ee("root",{ref:n,className:zn(x.root,o),elementType:AT,externalForwardedProps:I,ownerState:S,additionalProps:R({color:u,focusable:!1},d&&{role:"img"},!d&&{"aria-hidden":!0},!f&&{viewBox:p},C&&i.props)});return s.jsxs(w,R({},A,{children:[C?i.props.children:i,d?s.jsx("title",{children:d}):null]}))});function Cc(e,t){function n(r,i){return s.jsx(Jh,R({"data-testid":`${t}Icon`,ref:i},r,{children:e}))}return n.muiName=Jh.muiName,K.memo(K.forwardRef(n))}const TT=Cc(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");var Xh;const ET=["component","color","children","indicator","variant","slots","slotProps"],kT=e=>{const{disabled:t,expanded:n}=e;return gt({root:["root",t&&"disabled",n&&"expanded"],button:["button",t&&"disabled",n&&"expanded"],indicator:["indicator",t&&"disabled",n&&"expanded"]},xT,{})},_T=Ce(mc,{name:"JoyAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({fontWeight:e.vars.fontWeight.md,gap:"calc(var(--ListItem-paddingX, 0.75rem) + 0.25rem)",[`&.${Va.expanded}`]:{"--Icon-color":"currentColor"}})),PT=Ce(xc,{name:"JoyAccordionSummary",slot:"Button",overridesResolver:(e,t)=>t.button})({gap:"inherit",fontWeight:"inherit",justifyContent:"space-between",font:"inherit","&:focus-visible":{zIndex:1},[`.${Va.root} &`]:{"--unstable_ListItem-flex":"1 0 0%"}}),DT=Ce("span",{name:"JoyAccordionSummary",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})({display:"inline-flex",[`&.${Va.expanded}`]:{transform:"rotate(180deg)"}}),OT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionSummary"}),{component:i="div",color:o="neutral",children:a,indicator:l=Xh||(Xh=s.jsx(TT,{})),variant:c="plain",slots:u={},slotProps:f={}}=r,d=De(r,ET),{accordionId:p,disabled:g=!1,expanded:v=!1,toggle:m}=K.useContext(pc),b=R({},d,{component:i,slots:u,slotProps:f}),C=R({},r,{component:i,color:o,disabled:g,expanded:v,variant:c}),S=G=>{if(m&&m(G),typeof f.button=="function"){var O,T;(O=f.button(C))==null||(T=O.onClick)==null||T.call(O,G)}else{var F,H;(F=f.button)==null||(H=F.onClick)==null||H.call(F,G)}},x=kT(C),[I,w]=Ee("root",{ref:n,className:x.root,elementType:_T,externalForwardedProps:b,ownerState:C}),[A,E]=Ee("button",{ref:n,className:x.button,elementType:PT,externalForwardedProps:b,additionalProps:{component:"button",id:`${p}-summary`,"aria-expanded":v?"true":"false","aria-controls":`${p}-details`,disabled:g,type:"button",onClick:S},ownerState:C}),[k,$]=Ee("indicator",{ref:n,className:x.indicator,elementType:DT,externalForwardedProps:b,ownerState:C});return s.jsx(I,R({},w,{children:s.jsxs(A,R({},E,{children:[a,l&&s.jsx(k,R({},$,{children:l}))]}))}))}),RT=({label:e,disabled:t,children:n})=>(t=t||!1,s.jsx(pT,{variant:"outlined",transition:"0.2s",sx:{borderRadius:"md",overflow:"hidden",[`& .${Va.button}:hover`]:{backgroundColor:"#fff"},[`& .${Er.content}`]:{boxShadow:r=>`inset 0 1px ${r.vars.palette.divider}`,[`&.${Er.expanded}`]:{paddingBlock:"0.75rem"}},marginBottom:"8px",backgroundColor:"#fff"},children:s.jsxs(nT,{disabled:t,children:[s.jsx(OT,{children:e}),s.jsx(yT,{variant:"soft",children:n})]})})),wc={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["blockquote","code-block"],[{direction:"rtl"}],[{script:"sub"},{script:"super"}],[{color:[]},{background:[]}],[{font:[]}],["link","image","video"],["clean"]]},Sc=({label:e,property:t,value:n,defaultValue:r,placeholder:i,description:o,onChange:a})=>{const l=(c,u,f,d)=>{f!=="api"&&(d.getText().trim()===""?a(""):a(c))};return t==="description"?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i,className:"ql-container ql-toolbar"})]}):t==="mini_games_explanation"?s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i,className:"ql-container ql-toolbar"}),s.jsx(h.FormHelperText,{children:o})]}):s.jsx(h.Box,{sx:()=>({marginBottom:"16px"}),children:s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i})})},LT=e=>{const t=n=>{n.persist(),e.onChange(n.target.value)};return s.jsxs(h.Tabs,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(h.TabList,{sx:{borderRadius:0},tabFlex:"auto",children:[s.jsx(h.Tab,{children:e.labels.richText}),s.jsx(h.Tab,{children:e.labels.plainText})]}),s.jsx(h.TabPanel,{value:0,sx:{px:0},children:s.jsx(Sc,{label:"",placeholder:"",defaultValue:e.defaultValue,property:"ad_content",onChange:e.onChange})}),s.jsx(h.TabPanel,{value:1,sx:{px:0},children:s.jsx(h.Textarea,{defaultValue:e.defaultValue,minRows:"7",onChange:t,sx:{marginBottom:"16px",overflow:"auto",resize:"vertical"}})})]})},MT=({label:e,defaultValue:t,values:n,description:r,onChange:i})=>{const o=(a,l)=>{i(l||"")};return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(h.Select,{defaultValue:t,onChange:o,children:n.map((a,l)=>s.jsx(h.Option,{value:a,children:a},`basic-select-${a}-${l}`))}),r?s.jsx(h.FormHelperText,{children:r}):s.jsx(s.Fragment,{})]})},Ic=K.createContext("md");function BT(e){return ut("MuiTabs",e)}qe("MuiTabs",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const $T=["children","value","defaultValue","orientation","direction","component","onChange","selectionFollowsFocus","variant","color","size","slots","slotProps"],FT=e=>{const{orientation:t,variant:n,color:r,size:i}=e,o={root:["root",t,n&&`variant${Se(n)}`,r&&`color${Se(r)}`,i&&`size${Se(i)}`]};return gt(o,BT,{})},NT=Ce("div",{name:"JoyTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r;const i=(n=t.variants[e.variant])==null?void 0:n[e.color],{bgcolor:o,backgroundColor:a,background:l,p:c,padding:u}=bc({theme:t,ownerState:e},["bgcolor","backgroundColor","background","p","padding"]),f=ar(t,`palette.${o}`)||o||ar(t,`palette.${a}`)||a||l||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.surface;return R({},e.size==="sm"&&{"--Tabs-spacing":"0.75rem"},e.size==="md"&&{"--Tabs-spacing":"1rem"},e.size==="lg"&&{"--Tabs-spacing":"1.25rem"},{"--Tab-indicatorThickness":"2px","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--TabList-stickyBackground":f==="transparent"?"initial":f,display:"flex",flexDirection:"column"},e.orientation==="vertical"&&{flexDirection:"row"},{backgroundColor:t.vars.palette.background.surface,position:"relative"},t.typography[`body-${e.size}`],(r=t.variants[e.variant])==null?void 0:r[e.color],c!==void 0&&{"--Tabs-padding":c},u!==void 0&&{"--Tabs-padding":u})}),Zh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabs"}),{children:i,value:o,defaultValue:a,orientation:l="horizontal",direction:c="ltr",component:u,variant:f="plain",color:d="neutral",size:p="md",slots:g={},slotProps:v={}}=r,m=De(r,$T),b=a||(o===void 0?0:void 0),{contextValue:C}=aA(R({},r,{orientation:l,defaultValue:b})),S=R({},r,{orientation:l,direction:c,variant:f,color:d,size:p}),x=FT(S),I=R({},m,{component:u,slots:g,slotProps:v}),[w,A]=Ee("root",{ref:n,elementType:NT,externalForwardedProps:I,additionalProps:{ref:n,as:u},ownerState:S,className:x.root});return s.jsx(w,R({},A,{children:s.jsx(sA,{value:C,children:s.jsx(Ic.Provider,{value:p,children:i})})}))});function zT(e){return ut("MuiTabList",e)}qe("MuiTabList",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);function jT(e){return ut("MuiTab",e)}const Ac=qe("MuiTab",["root","disabled","focusVisible","selected","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),UT=["component","children","variant","color","size","disableUnderline","underlinePlacement","tabFlex","sticky","slots","slotProps"],VT=e=>{const{orientation:t,size:n,variant:r,color:i}=e,o={root:["root",t,r&&`variant${Se(r)}`,i&&`color${Se(i)}`,n&&`size${Se(n)}`]};return gt(o,zT,{})},HT=Ce(yc,{name:"JoyTabList",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;const r=(n=e.variants[t.variant])==null?void 0:n[t.color];return R({"--List-gap":"0px","--ListDivider-gap":"0px","--ListItem-paddingX":"var(--Tabs-spacing)","--ListItem-gap":"0.375rem","--unstable_TabList-hasUnderline":t.disableUnderline?"var(--unknown,)":"initial"},iT,{flexGrow:"initial",flexDirection:t.orientation==="vertical"?"column":"row",borderRadius:"var(--List-radius, 0px)",padding:"var(--List-padding, 0px)",zIndex:1},t.sticky&&{position:"sticky",top:t.sticky==="top"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",bottom:t.sticky==="bottom"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",backgroundColor:(r==null?void 0:r.backgroundColor)||`var(--TabList-stickyBackground, ${e.vars.palette.background.body})`},!t.disableUnderline&&R({},t.underlinePlacement==="bottom"&&{"--unstable_TabList-underlineBottom":"1px",paddingBottom:1,boxShadow:`inset 0 -1px ${e.vars.palette.divider}`},t.underlinePlacement==="top"&&{"--unstable_TabList-underlineTop":"1px",paddingTop:1,boxShadow:`inset 0 1px ${e.vars.palette.divider}`},t.underlinePlacement==="right"&&{"--unstable_TabList-underlineRight":"1px",paddingRight:1,boxShadow:`inset -1px 0 ${e.vars.palette.divider}`},t.underlinePlacement==="left"&&{"--unstable_TabList-underlineLeft":"1px",paddingLeft:1,boxShadow:`inset 1px 0 ${e.vars.palette.divider}`}),t.tabFlex&&{[`& .${Ac.root}`]:{flex:t.tabFlex}})}),ep=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabList"}),i=K.useContext(Ic),{isRtl:o,orientation:a,getRootProps:l,contextValue:c}=dA({rootRef:n}),{component:u="div",children:f,variant:d="plain",color:p="neutral",size:g,disableUnderline:v=!1,underlinePlacement:m=a==="horizontal"?"bottom":"right",tabFlex:b,sticky:C,slots:S={},slotProps:x={}}=r,I=De(r,UT),w=g!=null?g:i,A=R({},r,{isRtl:o,orientation:a,variant:d,color:p,size:w,sticky:C,tabFlex:b,nesting:!1,disableUnderline:v,underlinePlacement:m}),E=VT(A),k=R({},I,{component:u,slots:S,slotProps:x}),[$,G]=Ee("root",{ref:n,elementType:HT,getSlotProps:l,externalForwardedProps:k,ownerState:A,className:E.root});return s.jsx($,R({},G,{children:s.jsx(fA,{value:c,children:s.jsx(vc,{row:a==="horizontal",nested:!0,children:f})})}))}),WT=["action","children","value","disabled","onChange","onClick","onFocus","component","orientation","variant","color","disableIndicator","indicatorPlacement","indicatorInset","slots","slotProps"],GT=e=>{const{selected:t,disabled:n,focusVisible:r,variant:i,color:o,orientation:a}=e,l={root:["root",a,n&&"disabled",r&&"focusVisible",t&&"selected",i&&`variant${Se(i)}`,o&&`color${Se(o)}`]};return gt(l,jT,{})},YT=Ce(xc,{name:"JoyTab",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e})=>[{flex:"initial",justifyContent:e.row?"center":"initial","--unstable_ListItemDecorator-alignItems":"center","--unstable_offset":"min(calc(-1 * var(--variant-borderWidth, 0px)), -1px)"},!e.disableIndicator&&{'&[aria-selected="true"]':{"--Tab-indicatorColor":"currentColor",zIndex:1},"&::after":{content:'""',display:"block",position:"absolute",margin:"auto",background:"var(--Tab-indicatorColor)",borderRadius:"var(--Tab-indicatorRadius)"}},!e.disableIndicator&&e.indicatorPlacement==="bottom"&&{paddingBottom:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",bottom:"calc(-1px - var(--unstable_TabList-underlineBottom, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="top"&&{paddingTop:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",top:"calc(-1px - var(--unstable_TabList-underlineTop, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="right"&&{paddingRight:"calc(var(--ListItem-paddingRight) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",right:"calc(-1px - var(--unstable_TabList-underlineRight, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="left"&&{paddingLeft:"calc(var(--ListItem-paddingLeft) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",left:"calc(-1px - var(--unstable_TabList-underlineLeft, 0px))"}}]),ei=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTab"}),i=K.useContext(gc),{action:o,children:a,disabled:l=!1,component:c="button",orientation:u="horizontal",variant:f="plain",color:d="neutral",disableIndicator:p=!1,indicatorPlacement:g=i?"bottom":"right",indicatorInset:v=!1,slots:m={},slotProps:b={}}=r,C=De(r,WT),S=K.useRef(null),x=gn(S,n),{active:I,focusVisible:w,setFocusVisible:A,selected:E,getRootProps:k}=pA(R({},r,{rootRef:x}));K.useImperativeHandle(o,()=>({focusVisible:()=>{A(!0),S.current.focus()}}),[A]);const $=R({},r,{disableIndicator:p,indicatorPlacement:g,indicatorInset:v,orientation:u,row:i,active:I,focusVisible:w,disabled:l,selected:E,variant:f,color:d}),G=GT($),O=R({},C,{component:c,slots:m,slotProps:b}),[T,F]=Ee("root",{ref:n,elementType:YT,getSlotProps:k,externalForwardedProps:O,ownerState:$,className:G.root});return s.jsx(CT.Provider,{value:u,children:s.jsx(T,R({},F,{children:a}))})});function Hn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tp(e){if(K.isValidElement(e)||oh.isValidElementType(e)||!Hn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=tp(e[n])}),t}function Qt(e,t,n={clone:!0}){const r=n.clone?M({},e):e;return Hn(e)&&Hn(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])||oh.isValidElementType(t[i])?r[i]=t[i]:Hn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Hn(e[i])?r[i]=Qt(e[i],t[i],n):n.clone?r[i]=Hn(t[i])?tp(t[i]):t[i]:r[i]=t[i]}),r}function kr(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function ti(e){if(typeof e!="string")throw new Error(kr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Tc(e,t){const n=M({},t);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=r;if(i==="components"||i==="slots")n[i]=M(M({},e[i]),n[i]);else if(i==="componentsProps"||i==="slotProps"){const o=e[i],a=t[i];if(!a)n[i]=o||{};else if(!o)n[i]=a;else{n[i]=M({},a);for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const c=l;n[i][c]=Tc(o[c],a[c])}}}else n[i]===void 0&&(n[i]=e[i])}return n}function KT(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let a="",l=!0;for(let c=0;c<o.length;c+=1){const u=o[c];u&&(a+=(l===!0?"":" ")+t(u),l=!1,n&&n[u]&&(a+=" "+n[u]))}r[i]=a}return r}const np=e=>e,qT=(()=>{let e=np;return{configure(t){e=t},generate(t){return e(t)},reset(){e=np}}})(),QT={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function rp(e,t,n="Mui"){const r=QT[t];return r?`${n}-${r}`:`${qT.generate(e)}-${t}`}function JT(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=rp(e,i,n)}),r}function XT(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function co(e,t){return t?Qt(e,t,{clone:!1}):e}function ZT(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var a,l;const o=/min-width:\s*([0-9.]+)/;return+(((a=r.match(o))==null?void 0:a[1])||0)-+(((l=i.match(o))==null?void 0:l[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},M({},t)):t}function eE(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function tE(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function nE(e){const t=(o,a)=>o.replace("@media",a?`@container ${a}`:"@container");function n(o,a){o.up=(...l)=>t(e.breakpoints.up(...l),a),o.down=(...l)=>t(e.breakpoints.down(...l),a),o.between=(...l)=>t(e.breakpoints.between(...l),a),o.only=(...l)=>t(e.breakpoints.only(...l),a),o.not=(...l)=>{const c=t(e.breakpoints.not(...l),a);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},i=o=>(n(r,o),r);return n(i),Q(M({},e),{containerQueries:i})}const Wa={xs:0,sm:600,md:900,lg:1200,xl:1536},ip={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Wa[e]}px)`},rE={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Wa[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Wn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||ip;return t.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(t[c]),a),{})}if(typeof t=="object"){const o=r.breakpoints||ip;return Object.keys(t).reduce((a,l)=>{if(eE(o.keys,l)){const c=tE(r.containerQueries?r:rE,l);c&&(a[c]=n(t[l],l))}else if(Object.keys(o.values||Wa).includes(l)){const c=o.up(l);a[c]=n(t[l],l)}else{const c=l;a[c]=t[c]}return a},{})}return n(t)}function iE(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function oE(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Ga(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Ya(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Ga(e,n)||r,t&&(i=t(i,r,e)),i}function dt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const l=a[t],c=a.theme,u=Ga(c,r)||{};return Wn(a,l,d=>{let p=Ya(u,i,d);return d===p&&typeof d=="string"&&(p=Ya(u,i,`${t}${d==="default"?"":ti(d)}`,d)),n===!1?p:{[n]:p}})};return o.propTypes={},o.filterProps=[t],o}function aE(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const sE={m:"margin",p:"padding"},lE={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},op={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},cE=aE(e=>{if(e.length>2)if(op[e])e=op[e];else return[e];const[t,n]=e.split(""),r=sE[t],i=lE[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Ec=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],kc=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Ec,...kc];function uo(e,t,n,r){var o;const i=(o=Ga(e,t,!0))!=null?o:n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const l=Math.abs(a),c=i[l];return a>=0?c:typeof c=="number"?-c:`-${c}`}:typeof i=="function"?i:()=>{}}function _c(e){return uo(e,"spacing",8)}function fo(e,t){return typeof t=="string"||t==null?t:e(t)}function uE(e,t){return n=>e.reduce((r,i)=>(r[i]=fo(t,n),r),{})}function dE(e,t,n,r){if(!t.includes(n))return null;const i=cE(n),o=uE(i,r),a=e[n];return Wn(e,a,o)}function ap(e,t){const n=_c(e.theme);return Object.keys(e).map(r=>dE(e,t,r,n)).reduce(co,{})}function at(e){return ap(e,Ec)}at.propTypes={},at.filterProps=Ec;function st(e){return ap(e,kc)}st.propTypes={},st.filterProps=kc;function Ka(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?co(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function cn(e){return typeof e!="number"?e:`${e}px solid`}function un(e,t){return dt({prop:e,themeKey:"borders",transform:t})}const fE=un("border",cn),hE=un("borderTop",cn),pE=un("borderRight",cn),gE=un("borderBottom",cn),mE=un("borderLeft",cn),vE=un("borderColor"),bE=un("borderTopColor"),yE=un("borderRightColor"),xE=un("borderBottomColor"),CE=un("borderLeftColor"),wE=un("outline",cn),SE=un("outlineColor"),qa=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=uo(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:fo(t,r)});return Wn(e,e.borderRadius,n)}return null};qa.propTypes={},qa.filterProps=["borderRadius"],Ka(fE,hE,pE,gE,mE,vE,bE,yE,xE,CE,qa,wE,SE);const Qa=e=>{if(e.gap!==void 0&&e.gap!==null){const t=uo(e.theme,"spacing",8),n=r=>({gap:fo(t,r)});return Wn(e,e.gap,n)}return null};Qa.propTypes={},Qa.filterProps=["gap"];const Ja=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=uo(e.theme,"spacing",8),n=r=>({columnGap:fo(t,r)});return Wn(e,e.columnGap,n)}return null};Ja.propTypes={},Ja.filterProps=["columnGap"];const Xa=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=uo(e.theme,"spacing",8),n=r=>({rowGap:fo(t,r)});return Wn(e,e.rowGap,n)}return null};Xa.propTypes={},Xa.filterProps=["rowGap"];const IE=dt({prop:"gridColumn"}),AE=dt({prop:"gridRow"}),TE=dt({prop:"gridAutoFlow"}),EE=dt({prop:"gridAutoColumns"}),kE=dt({prop:"gridAutoRows"}),_E=dt({prop:"gridTemplateColumns"}),PE=dt({prop:"gridTemplateRows"}),DE=dt({prop:"gridTemplateAreas"}),OE=dt({prop:"gridArea"});Ka(Qa,Ja,Xa,IE,AE,TE,EE,kE,_E,PE,DE,OE);function ni(e,t){return t==="grey"?t:e}const RE=dt({prop:"color",themeKey:"palette",transform:ni}),LE=dt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ni}),ME=dt({prop:"backgroundColor",themeKey:"palette",transform:ni});Ka(RE,LE,ME);function Jt(e){return e<=1&&e!==0?`${e*100}%`:e}const BE=dt({prop:"width",transform:Jt}),Pc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,a,l,c;const r=((a=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:a[n])||Wa[n];return r?((c=(l=e.theme)==null?void 0:l.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jt(n)}};return Wn(e,e.maxWidth,t)}return null};Pc.filterProps=["maxWidth"];const $E=dt({prop:"minWidth",transform:Jt}),FE=dt({prop:"height",transform:Jt}),NE=dt({prop:"maxHeight",transform:Jt}),zE=dt({prop:"minHeight",transform:Jt});dt({prop:"size",cssProperty:"width",transform:Jt}),dt({prop:"size",cssProperty:"height",transform:Jt});const jE=dt({prop:"boxSizing"});Ka(BE,Pc,$E,FE,NE,zE,jE);const Za={border:{themeKey:"borders",transform:cn},borderTop:{themeKey:"borders",transform:cn},borderRight:{themeKey:"borders",transform:cn},borderBottom:{themeKey:"borders",transform:cn},borderLeft:{themeKey:"borders",transform:cn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:cn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:qa},color:{themeKey:"palette",transform:ni},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ni},backgroundColor:{themeKey:"palette",transform:ni},p:{style:st},pt:{style:st},pr:{style:st},pb:{style:st},pl:{style:st},px:{style:st},py:{style:st},padding:{style:st},paddingTop:{style:st},paddingRight:{style:st},paddingBottom:{style:st},paddingLeft:{style:st},paddingX:{style:st},paddingY:{style:st},paddingInline:{style:st},paddingInlineStart:{style:st},paddingInlineEnd:{style:st},paddingBlock:{style:st},paddingBlockStart:{style:st},paddingBlockEnd:{style:st},m:{style:at},mt:{style:at},mr:{style:at},mb:{style:at},ml:{style:at},mx:{style:at},my:{style:at},margin:{style:at},marginTop:{style:at},marginRight:{style:at},marginBottom:{style:at},marginLeft:{style:at},marginX:{style:at},marginY:{style:at},marginInline:{style:at},marginInlineStart:{style:at},marginInlineEnd:{style:at},marginBlock:{style:at},marginBlockStart:{style:at},marginBlockEnd:{style:at},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Qa},rowGap:{style:Xa},columnGap:{style:Ja},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jt},maxWidth:{style:Pc},minWidth:{transform:Jt},height:{transform:Jt},maxHeight:{transform:Jt},minHeight:{transform:Jt},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function UE(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function VE(e,t){return typeof e=="function"?e(t):e}function HE(){function e(n,r,i,o){const a={[n]:r,theme:i},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:f,style:d}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const p=Ga(i,u)||{};return d?d(a):Wn(a,r,v=>{let m=Ya(p,f,v);return v===m&&typeof v=="string"&&(m=Ya(p,f,`${n}${v==="default"?"":ti(v)}`,v)),c===!1?m:{[c]:m}})}function t(n){var l;const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=(l=i.unstable_sxConfig)!=null?l:Za;function a(c){let u=c;if(typeof c=="function")u=c(i);else if(typeof c!="object")return c;if(!u)return null;const f=iE(i.breakpoints),d=Object.keys(f);let p=f;return Object.keys(u).forEach(g=>{const v=VE(u[g],i);if(v!=null)if(typeof v=="object")if(o[g])p=co(p,e(g,v,i,o));else{const m=Wn({theme:i},v,b=>({[g]:b}));UE(m,v)?p[g]=t({sx:v,theme:i}):p=co(p,m)}else p=co(p,e(g,v,i,o))}),ZT(i,oE(d,p))}return Array.isArray(r)?r.map(a):a(r)}return t}const ri=HE();ri.filterProps=["sx"];function WE(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var GE={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YE=!1,KE=/[A-Z]|^ms/g,qE=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sp=function(t){return t.charCodeAt(1)===45},lp=function(t){return t!=null&&typeof t!="boolean"},Dc=gA(function(e){return sp(e)?e:e.replace(KE,"-$&").toLowerCase()}),cp=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(qE,function(r,i,o){return sr={name:i,styles:o,next:sr},i})}return GE[t]!==1&&!sp(t)&&typeof n=="number"&&n!==0?n+"px":n},QE="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function es(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return sr={name:i.name,styles:i.styles,next:sr},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)sr={name:a.name,styles:a.styles,next:sr},a=a.next;var l=o.styles+";";return l}return JE(e,t,n)}}var c=n;return c}function JE(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=es(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var l=a;lp(l)&&(r+=Dc(o)+":"+cp(o,l)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&YE)throw new Error(QE);if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var c=0;c<a.length;c++)lp(a[c])&&(r+=Dc(o)+":"+cp(o,a[c])+";");else{var u=es(e,t,a);switch(o){case"animation":case"animationName":{r+=Dc(o)+":"+u+";";break}default:r+=o+"{"+u+"}"}}}}return r}var up=/label:\s*([^\s;{]+)\s*(;|$)/g,sr;function XE(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";sr=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=es(n,t,o);else{var a=o;i+=a[0]}for(var l=1;l<e.length;l++)if(i+=es(n,t,e[l]),r){var c=o;i+=c[l]}up.lastIndex=0;for(var u="",f;(f=up.exec(i))!==null;)u+="-"+f[1];var d=WE(i)+u;return{name:d,styles:i,next:sr}}/**
2333
+ */var Gl=Symbol.for("react.transitional.element"),Yl=Symbol.for("react.portal"),ma=Symbol.for("react.fragment"),va=Symbol.for("react.strict_mode"),ba=Symbol.for("react.profiler"),ya=Symbol.for("react.consumer"),xa=Symbol.for("react.context"),Ca=Symbol.for("react.forward_ref"),wa=Symbol.for("react.suspense"),Sa=Symbol.for("react.suspense_list"),Ia=Symbol.for("react.memo"),Aa=Symbol.for("react.lazy"),oI=Symbol.for("react.offscreen"),aI=Symbol.for("react.client.reference");function an(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Gl:switch(e=e.type,e){case ma:case ba:case va:case wa:case Sa:return e;default:switch(e=e&&e.$$typeof,e){case xa:case Ca:case Aa:case Ia:return e;case ya:return e;default:return t}}case Yl:return t}}}Ue.ContextConsumer=ya,Ue.ContextProvider=xa,Ue.Element=Gl,Ue.ForwardRef=Ca,Ue.Fragment=ma,Ue.Lazy=Aa,Ue.Memo=Ia,Ue.Portal=Yl,Ue.Profiler=ba,Ue.StrictMode=va,Ue.Suspense=wa,Ue.SuspenseList=Sa,Ue.isContextConsumer=function(e){return an(e)===ya},Ue.isContextProvider=function(e){return an(e)===xa},Ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gl},Ue.isForwardRef=function(e){return an(e)===Ca},Ue.isFragment=function(e){return an(e)===ma},Ue.isLazy=function(e){return an(e)===Aa},Ue.isMemo=function(e){return an(e)===Ia},Ue.isPortal=function(e){return an(e)===Yl},Ue.isProfiler=function(e){return an(e)===ba},Ue.isStrictMode=function(e){return an(e)===va},Ue.isSuspense=function(e){return an(e)===wa},Ue.isSuspenseList=function(e){return an(e)===Sa},Ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ma||e===ba||e===va||e===wa||e===Sa||e===oI||typeof e=="object"&&e!==null&&(e.$$typeof===Aa||e.$$typeof===Ia||e.$$typeof===xa||e.$$typeof===ya||e.$$typeof===Ca||e.$$typeof===aI||e.getModuleId!==void 0)},Ue.typeOf=an,ih.exports=Ue;var oh=ih.exports;function Se(e){if(typeof e!="string")throw new Error(ga(7));return e.charAt(0).toUpperCase()+e.slice(1)}function ah(e,t){var n,r;return K.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}const sI=typeof window!="undefined"?K.useLayoutEffect:K.useEffect;let sh=0;function lI(e){const[t,n]=K.useState(e),r=e||t;return K.useEffect(()=>{t==null&&(sh+=1,n(`mui-${sh}`))},[t]),r}const lh=K.useId;function io(e){if(lh!==void 0){const t=lh();return e!=null?e:t}return lI(e)}function Kl({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=K.useRef(e!==void 0),[o,a]=K.useState(t),l=i?e:o,c=K.useCallback(u=>{i||a(u)},[]);return[l,c]}class ql{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new ql}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}let Ta=!0,Ql=!1;const cI=new ql,uI={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function dI(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&uI[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function fI(e){e.metaKey||e.altKey||e.ctrlKey||(Ta=!0)}function Jl(){Ta=!1}function hI(){this.visibilityState==="hidden"&&Ql&&(Ta=!0)}function pI(e){e.addEventListener("keydown",fI,!0),e.addEventListener("mousedown",Jl,!0),e.addEventListener("pointerdown",Jl,!0),e.addEventListener("touchstart",Jl,!0),e.addEventListener("visibilitychange",hI,!0)}function gI(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return Ta||dI(t)}function ch(){const e=K.useCallback(i=>{i!=null&&pI(i.ownerDocument)},[]),t=K.useRef(!1);function n(){return t.current?(Ql=!0,cI.start(100,()=>{Ql=!1}),t.current=!1,!0):!1}function r(i){return gI(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function uh(e,t){const n=R({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=R({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=R({},o),Object.keys(i).forEach(a=>{n[r][a]=uh(i[a],o[a])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function gt(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,a)=>{if(a){const l=t(a);l!==""&&o.push(l),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const dh=e=>e,mI=(()=>{let e=dh;return{configure(t){e=t},generate(t){return e(t)},reset(){e=dh}}})(),vI={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function fh(e,t,n="Mui"){const r=vI[t];return r?`${n}-${r}`:`${mI.generate(e)}-${t}`}function bI(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=fh(e,i,n)}),r}function Xl(e={}){const{disabled:t=!1,focusableWhenDisabled:n,href:r,rootRef:i,tabIndex:o,to:a,type:l,rootElementName:c}=e,u=K.useRef(null),[f,d]=K.useState(!1),{isFocusVisibleRef:p,onFocus:g,onBlur:v,ref:m}=ch(),[b,C]=K.useState(!1);t&&!n&&b&&C(!1),K.useEffect(()=>{p.current=b},[b,p]);const[S,x]=nI({rootElementName:c!=null?c:r||a?"a":void 0,componentName:"Button"}),I=j=>N=>{var M;b&&N.preventDefault(),(M=j.onMouseLeave)==null||M.call(j,N)},w=j=>N=>{var M;v(N),p.current===!1&&C(!1),(M=j.onBlur)==null||M.call(j,N)},A=j=>N=>{var M;if(u.current||(u.current=N.currentTarget),g(N),p.current===!0){var V;C(!0),(V=j.onFocusVisible)==null||V.call(j,N)}(M=j.onFocus)==null||M.call(j,N)},E=()=>{const j=u.current;return S==="BUTTON"||S==="INPUT"&&["button","submit","reset"].includes(j==null?void 0:j.type)||S==="A"&&(j==null?void 0:j.href)},k=j=>N=>{if(!t){var M;(M=j.onClick)==null||M.call(j,N)}},$=j=>N=>{var M;t||(d(!0),document.addEventListener("mouseup",()=>{d(!1)},{once:!0})),(M=j.onMouseDown)==null||M.call(j,N)},G=j=>N=>{var M;if((M=j.onKeyDown)==null||M.call(j,N),!N.defaultMuiPrevented&&(N.target===N.currentTarget&&!E()&&N.key===" "&&N.preventDefault(),N.target===N.currentTarget&&N.key===" "&&!t&&d(!0),N.target===N.currentTarget&&!E()&&N.key==="Enter"&&!t)){var V;(V=j.onClick)==null||V.call(j,N),N.preventDefault()}},O=j=>N=>{var M;if(N.target===N.currentTarget&&d(!1),(M=j.onKeyUp)==null||M.call(j,N),N.target===N.currentTarget&&!E()&&!t&&N.key===" "&&!N.defaultMuiPrevented){var V;(V=j.onClick)==null||V.call(j,N)}},T=gn(x,i,m,u),F={};return o!==void 0&&(F.tabIndex=o),S==="BUTTON"?(F.type=l!=null?l:"button",n?F["aria-disabled"]=t:F.disabled=t):S==="INPUT"?l&&["button","submit","reset"].includes(l)&&(n?F["aria-disabled"]=t:F.disabled=t):S!==""&&(!r&&!a&&(F.role="button",F.tabIndex=o!=null?o:0),t&&(F["aria-disabled"]=t,F.tabIndex=n?o!=null?o:0:-1)),{getRootProps:(j={})=>{const N=R({},Nn(e),Nn(j)),M=R({type:l},N,F,j,{onBlur:w(N),onClick:k(N),onFocus:A(N),onKeyDown:G(N),onKeyUp:O(N),onMouseDown:$(N),onMouseLeave:I(N),ref:T});return delete M.onFocusVisible,M},focusVisible:b,setFocusVisible:C,active:f,rootRef:T}}function yI(e,t){return e===t}const Zl={},hh=()=>{};function ec(e,t){const n=R({},e);return Object.keys(t).forEach(r=>{t[r]!==void 0&&(n[r]=t[r])}),n}function xI(e){const{nextState:t,initialState:n,stateComparers:r,onStateChange:i,controlledProps:o,lastActionRef:a}=e,l=K.useRef(n);K.useEffect(()=>{if(a.current===null)return;const c=ec(l.current,o);Object.keys(t).forEach(u=>{var f;const d=(f=r[u])!=null?f:yI,p=t[u],g=c[u];if(g==null&&p!=null||g!=null&&p==null||g!=null&&p!=null&&!d(p,g)){var v,m;i==null||i((v=a.current.event)!=null?v:null,u,p,(m=a.current.type)!=null?m:"",t)}}),l.current=t,a.current=null},[l,t,a,i,r,o])}function CI(e){const t=K.useRef(null),{reducer:n,initialState:r,controlledProps:i=Zl,stateComparers:o=Zl,onStateChange:a=hh,actionContext:l,componentName:c=""}=e;K.useRef(i);const u=K.useCallback((g,v)=>{t.current=v;const m=ec(g,i);return n(m,v)},[i,n]),[f,d]=K.useReducer(u,r),p=K.useCallback(g=>{d(R({},g,{context:l}))},[l]);return xI({nextState:f,initialState:r,stateComparers:o!=null?o:Zl,onStateChange:a!=null?a:hh,controlledProps:i,lastActionRef:t}),[ec(f,i),p]}const wI=K.createContext(void 0);function SI(){return K.useContext(wI)}function II(e={}){const{defaultValue:t,disabled:n=!1,error:r=!1,onBlur:i,onChange:o,onFocus:a,required:l=!1,value:c,inputRef:u}=e,f=SI();let d,p,g,v,m;if(f){var b,C,S;d=void 0,p=(b=f.disabled)!=null?b:!1,g=(C=f.error)!=null?C:!1,v=(S=f.required)!=null?S:!1,m=f.value}else d=t,p=n,g=r,v=l,m=c;const{current:x}=K.useRef(m!=null),I=K.useCallback(j=>{},[]),w=K.useRef(null),A=gn(w,u,I),[E,k]=K.useState(!1);K.useEffect(()=>{!f&&p&&E&&(k(!1),i==null||i())},[f,p,E,i]);const $=j=>N=>{var M;if(f!=null&&f.disabled){N.stopPropagation();return}if((M=j.onFocus)==null||M.call(j,N),f&&f.onFocus){var V;f==null||(V=f.onFocus)==null||V.call(f)}else k(!0)},G=j=>N=>{var M;(M=j.onBlur)==null||M.call(j,N),f&&f.onBlur?f.onBlur():k(!1)},O=j=>(N,...M)=>{var V,Y;if(!x&&(N.target||w.current)==null)throw new Error(ga(17));f==null||(V=f.onChange)==null||V.call(f,N),(Y=j.onChange)==null||Y.call(j,N,...M)},T=j=>N=>{var M;w.current&&N.currentTarget===N.target&&w.current.focus(),(M=j.onClick)==null||M.call(j,N)};return{disabled:p,error:g,focused:E,formControlContext:f,getInputProps:(j={})=>{const M=R({},{onBlur:i,onChange:o,onFocus:a},Nn(j)),V=R({},M,{onBlur:G(M),onChange:O(M),onFocus:$(M)});return R({},V,{"aria-invalid":g||void 0,defaultValue:d,value:m,required:v,disabled:p},j,{ref:A},V)},getRootProps:(j={})=>{const N=Nn(e,["onBlur","onChange","onFocus"]),M=R({},N,Nn(j));return R({},j,M,{onClick:T(M)})},inputRef:A,required:v,value:m}}const Et={blur:"list:blur",focus:"list:focus",itemClick:"list:itemClick",itemHover:"list:itemHover",itemsChange:"list:itemsChange",keyDown:"list:keyDown",resetHighlight:"list:resetHighlight",highlightLast:"list:highlightLast",textNavigation:"list:textNavigation",clearSelection:"list:clearSelection"};function AI(e,t,n,r,i,o){if(n.length===0||!r&&n.every((l,c)=>i(l,c)))return-1;let a=e;for(;;){if(!o&&t==="next"&&a===n.length||!o&&t==="previous"&&a===-1)return-1;if(r?!1:i(n[a],a))a+=t==="next"?1:-1,o&&(a=(a+n.length)%n.length);else return a}}function $t(e,t,n){var r;const{items:i,isItemDisabled:o,disableListWrap:a,disabledItemsFocusable:l,itemComparer:c,focusManagement:u}=n,f=u==="DOM"?0:-1,d=i.length-1,p=e==null?-1:i.findIndex(C=>c(C,e));let g,v,m=!a;switch(t){case"reset":if(f===-1)return null;g=0,v="next",m=!1;break;case"start":g=0,v="next",m=!1;break;case"end":g=d,v="previous",m=!1;break;default:{const C=p+t;C<0?!m&&p!==-1||Math.abs(t)>1?(g=0,v="next"):(g=d,v="previous"):C>d?!m||Math.abs(t)>1?(g=d,v="previous"):(g=0,v="next"):(g=C,v=t>=0?"next":"previous")}}const b=AI(g,v,i,l,o,m);return b===-1&&e!==null&&!o(e,p)?e:(r=i[b])!=null?r:null}function TI(e,t,n,r){return n==="none"?[]:n==="single"?r(t[0],e)?t:[e]:t.some(i=>r(i,e))?t.filter(i=>!r(i,e)):[...t,e]}function ph(e,t,n){const{itemComparer:r,isItemDisabled:i,selectionMode:o,items:a}=n,{selectedValues:l}=t,c=a.findIndex(f=>r(e,f));if(i(e,c))return t;const u=TI(e,l,o,r);return R({},t,{selectedValues:u,highlightedValue:e})}function EI(e,t,n){const r=t.highlightedValue,{orientation:i,pageSize:o}=n;switch(e){case"Home":return R({},t,{highlightedValue:$t(r,"start",n)});case"End":return R({},t,{highlightedValue:$t(r,"end",n)});case"PageUp":return R({},t,{highlightedValue:$t(r,-o,n)});case"PageDown":return R({},t,{highlightedValue:$t(r,o,n)});case"ArrowUp":if(i!=="vertical")break;return R({},t,{highlightedValue:$t(r,-1,n)});case"ArrowDown":if(i!=="vertical")break;return R({},t,{highlightedValue:$t(r,1,n)});case"ArrowLeft":{if(i==="vertical")break;return R({},t,{highlightedValue:$t(r,i==="horizontal-ltr"?-1:1,n)})}case"ArrowRight":{if(i==="vertical")break;return R({},t,{highlightedValue:$t(r,i==="horizontal-ltr"?1:-1,n)})}case"Enter":case" ":return t.highlightedValue===null?t:ph(t.highlightedValue,t,n)}return t}function kI(e,t){return t.focusManagement==="DOM"?e:R({},e,{highlightedValue:null})}function _I(e,t,n){var r;const i=(r=n(e))==null?void 0:r.trim().toLowerCase();return!i||i.length===0?!1:i.indexOf(t)===0}function PI(e,t,n){const{items:r,isItemDisabled:i,disabledItemsFocusable:o,getItemAsString:a}=n,l=t.length>1;let c=l?e.highlightedValue:$t(e.highlightedValue,1,n);for(let u=0;u<r.length;u+=1){if(!c||!l&&e.highlightedValue===c)return e;if(_I(c,t,a)&&(!i(c,r.indexOf(c))||o))return R({},e,{highlightedValue:c});c=$t(c,1,n)}return e}function DI(e,t,n,r){var i;const{itemComparer:o,focusManagement:a}=r;let l=null;if(n.highlightedValue!=null){var c;l=(c=e.find(d=>o(d,n.highlightedValue)))!=null?c:null}else a==="DOM"&&t.length===0&&(l=$t(null,"reset",r));const f=((i=n.selectedValues)!=null?i:[]).filter(d=>e.some(p=>o(p,d)));return R({},n,{highlightedValue:l,selectedValues:f})}function OI(e,t){return R({},e,{highlightedValue:$t(null,"reset",t)})}function RI(e,t){return R({},e,{highlightedValue:$t(null,"end",t)})}function LI(e,t){return R({},e,{selectedValues:[],highlightedValue:$t(null,"reset",t)})}function gh(e,t){const{type:n,context:r}=t;switch(n){case Et.keyDown:return EI(t.key,e,r);case Et.itemClick:return ph(t.item,e,r);case Et.blur:return kI(e,r);case Et.textNavigation:return PI(e,t.searchString,r);case Et.itemsChange:return DI(t.items,t.previousItems,e,r);case Et.resetHighlight:return OI(e,r);case Et.highlightLast:return RI(e,r);case Et.clearSelection:return LI(e,r);default:return e}}const MI=500;function BI(e){const t=K.useRef({searchString:"",lastTime:null});return K.useCallback(n=>{if(n.key.length===1&&n.key!==" "){const r=t.current,i=n.key.toLowerCase(),o=performance.now();r.searchString.length>0&&r.lastTime&&o-r.lastTime>MI?r.searchString=i:(r.searchString.length!==1||i!==r.searchString)&&(r.searchString+=i),r.lastTime=o,e(r.searchString,n)}},[e])}const mh={},$I=()=>{},FI=(e,t)=>e===t,NI=()=>!1,zI=e=>typeof e=="string"?e:String(e),jI=()=>({highlightedValue:null,selectedValues:[]});function UI(e){const{controlledProps:t=mh,disabledItemsFocusable:n=!1,disableListWrap:r=!1,focusManagement:i="activeDescendant",getInitialState:o=jI,getItemDomElement:a,getItemId:l,isItemDisabled:c=NI,rootRef:u,onStateChange:f=$I,items:d,itemComparer:p=FI,getItemAsString:g=zI,onChange:v,onHighlightChange:m,onItemsChange:b,orientation:C="vertical",pageSize:S=5,reducerActionContext:x=mh,selectionMode:I="single",stateReducer:w,componentName:A="useList"}=e,E=K.useRef(null),k=gn(u,E),$=K.useCallback((oe,Z,te)=>{if(m==null||m(oe,Z,te),i==="DOM"&&Z!=null&&(te===Et.itemClick||te===Et.keyDown||te===Et.textNavigation)){var ne;a==null||(ne=a(Z))==null||ne.focus()}},[a,m,i]),G=K.useMemo(()=>({highlightedValue:p,selectedValues:(oe,Z)=>eh(oe,Z,p)}),[p]),O=K.useCallback((oe,Z,te,ne,ue)=>{switch(f==null||f(oe,Z,te,ne,ue),Z){case"highlightedValue":$(oe,te,ne);break;case"selectedValues":v==null||v(oe,te,ne);break}},[$,v,f]),T=K.useMemo(()=>({disabledItemsFocusable:n,disableListWrap:r,focusManagement:i,isItemDisabled:c,itemComparer:p,items:d,getItemAsString:g,onHighlightChange:$,orientation:C,pageSize:S,selectionMode:I,stateComparers:G}),[n,r,i,c,p,d,g,$,C,S,I,G]),F=o(),H=w!=null?w:gh,j=K.useMemo(()=>R({},x,T),[x,T]),[N,M]=CI({reducer:H,actionContext:j,initialState:F,controlledProps:t,stateComparers:G,onStateChange:O,componentName:A}),{highlightedValue:V,selectedValues:Y}=N,X=BI((oe,Z)=>M({type:Et.textNavigation,event:Z,searchString:oe})),D=K.useRef([]);K.useEffect(()=>{eh(D.current,d,p)||(M({type:Et.itemsChange,event:null,items:d,previousItems:D.current}),D.current=d,b==null||b(d))},[d,p,M,b]);const B=oe=>Z=>{var te;if((te=oe.onKeyDown)==null||te.call(oe,Z),Z.defaultMuiPrevented)return;const ne=["Home","End","PageUp","PageDown"];C==="vertical"?ne.push("ArrowUp","ArrowDown"):ne.push("ArrowLeft","ArrowRight"),i==="activeDescendant"&&ne.push(" ","Enter"),ne.includes(Z.key)&&Z.preventDefault(),M({type:Et.keyDown,key:Z.key,event:Z}),X(Z)},U=oe=>Z=>{var te,ne;(te=oe.onBlur)==null||te.call(oe,Z),!Z.defaultMuiPrevented&&((ne=E.current)!=null&&ne.contains(Z.relatedTarget)||M({type:Et.blur,event:Z}))},W=(oe={})=>{const Z=Nn(oe);return R({},oe,{"aria-activedescendant":i==="activeDescendant"&&V!=null?l(V):void 0,tabIndex:i==="DOM"?-1:0,ref:k},Z,{onBlur:U(Z),onKeyDown:B(Z)})},ie=K.useCallback(oe=>{const Z=(Y!=null?Y:[]).some(ue=>ue!=null&&p(oe,ue)),te=V!=null&&p(oe,V);return{focusable:i==="DOM",highlighted:te,selected:Z}},[p,Y,V,i]),se=K.useMemo(()=>({dispatch:M,getItemState:ie}),[M,ie]);return K.useDebugValue({state:N}),{contextValue:se,dispatch:M,getRootProps:W,rootRef:k,state:N}}const vh=K.createContext(null);function VI(e){const{handlePointerOverEvents:t=!1,item:n}=e,r=K.useContext(vh);if(!r)throw new Error("useListItem must be used within a ListProvider");const{dispatch:i,getItemState:o}=r,{highlighted:a,selected:l,focusable:c}=o(n),u=K.useCallback(g=>v=>{var m;(m=g.onClick)==null||m.call(g,v),!v.defaultPrevented&&i({type:Et.itemClick,item:n,event:v})},[i,n]),f=K.useCallback(g=>v=>{var m;(m=g.onMouseOver)==null||m.call(g,v),!v.defaultPrevented&&i({type:Et.itemHover,item:n,event:v})},[i,n]);let d;return c&&(d=a?0:-1),{getRootProps:(g={})=>{const v=Nn(g);return R({},g,{onClick:u(v),onPointerOver:t?f(v):void 0,tabIndex:d})},highlighted:a,selected:l}}const tc=K.createContext(null);function HI(e){const t=Array.from(e.keys()).map(n=>{const r=e.get(n);return{key:n,subitem:r}});return t.sort((n,r)=>{const i=n.subitem.ref.current,o=r.subitem.ref.current;return i===null||o===null||i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING?1:-1}),new Map(t.map(n=>[n.key,n.subitem]))}function bh(){const[e,t]=K.useState(new Map),n=K.useRef(new Set),r=K.useCallback(function(u){n.current.delete(u),t(f=>{const d=new Map(f);return d.delete(u),d})},[]),i=K.useCallback(function(u,f){let d;return typeof u=="function"?d=u(n.current):d=u,n.current.add(d),t(p=>{const g=new Map(p);return g.set(d,f),g}),{id:d,deregister:()=>r(d)}},[r]),o=K.useMemo(()=>HI(e),[e]),a=K.useCallback(function(u){return Array.from(o.keys()).indexOf(u)},[o]);return{contextValue:K.useMemo(()=>({getItemIndex:a,registerItem:i,totalSubitemCount:e.size}),[a,i,e.size]),subitems:o}}function yh(e,t){const n=K.useContext(tc);if(n===null)throw new Error("useCompoundItem must be used within a useCompoundParent");const{registerItem:r}=n,[i,o]=K.useState(typeof e=="function"?void 0:e);return sI(()=>{const{id:a,deregister:l}=r(e,t);return o(a),l},[r,t,e]),{id:i,index:i!==void 0?n.getItemIndex(i):-1,totalItemCount:n.totalSubitemCount}}function WI(e,t){return function(r={}){const i=R({},r,e(r));return R({},i,t(i))}}const GI=Math.min,YI=Math.max,Ea=Math.round,ka=Math.floor,_a=e=>({x:e,y:e});function KI(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xh(e){return wh(e)?(e.nodeName||"").toLowerCase():"#document"}function Un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ch(e){var t;return(t=(wh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wh(e){return e instanceof Node||e instanceof Un(e).Node}function qI(e){return e instanceof Element||e instanceof Un(e).Element}function nc(e){return e instanceof HTMLElement||e instanceof Un(e).HTMLElement}function Sh(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Un(e).ShadowRoot}function Ih(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=rc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function QI(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function JI(e){return["html","body","#document"].includes(xh(e))}function rc(e){return Un(e).getComputedStyle(e)}function XI(e){if(xh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sh(e)&&e.host||Ch(e);return Sh(t)?t.host:t}function Ah(e){const t=XI(e);return JI(t)?e.ownerDocument?e.ownerDocument.body:e.body:nc(t)&&Ih(t)?t:Ah(t)}function Pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ah(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Un(i);if(o){const l=ic(a);return t.concat(a,a.visualViewport||[],Ih(i)?i:[],l&&n?Pa(l):[])}return t.concat(i,Pa(i,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZI(e){const t=rc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=nc(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=Ea(n)!==o||Ea(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function oc(e){return qI(e)?e:e.contextElement}function Th(e){const t=oc(e);if(!nc(t))return _a(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ZI(t);let a=(o?Ea(n.width):n.width)/r,l=(o?Ea(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const eA=_a(0);function tA(e){const t=Un(e);return!QI()||!t.visualViewport?eA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nA(e,t,n){return!1}function Eh(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=oc(e);let a=_a(1);t&&(a=Th(e));const l=nA()?tA(o):_a(0);let c=(i.left+l.x)/a.x,u=(i.top+l.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(o){const p=Un(o),g=r;let v=p,m=ic(v);for(;m&&r&&g!==v;){const b=Th(m),C=m.getBoundingClientRect(),S=rc(m),x=C.left+(m.clientLeft+parseFloat(S.paddingLeft))*b.x,I=C.top+(m.clientTop+parseFloat(S.paddingTop))*b.y;c*=b.x,u*=b.y,f*=b.x,d*=b.y,c+=x,u+=I,v=Un(m),m=ic(v)}}return KI({width:f,height:d,x:c,y:u})}function rA(e,t){let n=null,r;const i=Ch(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),o();const{left:u,top:f,width:d,height:p}=e.getBoundingClientRect();if(l||t(),!d||!p)return;const g=ka(f),v=ka(i.clientWidth-(u+d)),m=ka(i.clientHeight-(f+p)),b=ka(u),S={rootMargin:-g+"px "+-v+"px "+-m+"px "+-b+"px",threshold:YI(0,GI(1,c))||1};let x=!0;function I(w){const A=w[0].intersectionRatio;if(A!==c){if(!x)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(I,Q(L({},S),{root:i.ownerDocument}))}catch(w){n=new IntersectionObserver(I,S)}n.observe(e)}return a(!0),o}function iA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=oc(e),f=i||o?[...u?Pa(u):[],...Pa(t)]:[];f.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const d=u&&l?rA(u,n):null;let p=-1,g=null;a&&(g=new ResizeObserver(C=>{let[S]=C;S&&S.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),u&&!c&&g.observe(u),g.observe(t));let v,m=c?Eh(e):null;c&&b();function b(){const C=Eh(e);m&&(C.x!==m.x||C.y!==m.y||C.width!==m.width||C.height!==m.height)&&n(),m=C,v=requestAnimationFrame(b)}return n(),()=>{var C;f.forEach(S=>{i&&S.removeEventListener("scroll",n),o&&S.removeEventListener("resize",n)}),d==null||d(),(C=g)==null||C.disconnect(),g=null,c&&cancelAnimationFrame(v)}}function oA(e){const{checked:t,defaultChecked:n,disabled:r,onBlur:i,onChange:o,onFocus:a,onFocusVisible:l,readOnly:c,required:u}=e,[f,d]=Kl({controlled:t,default:!!n,name:"Switch",state:"checked"}),p=k=>$=>{var G;$.nativeEvent.defaultPrevented||(d($.target.checked),o==null||o($),(G=k.onChange)==null||G.call(k,$))},{isFocusVisibleRef:g,onBlur:v,onFocus:m,ref:b}=ch(),[C,S]=K.useState(!1);r&&C&&S(!1),K.useEffect(()=>{g.current=C},[C,g]);const x=K.useRef(null),I=k=>$=>{var G;x.current||(x.current=$.currentTarget),m($),g.current===!0&&(S(!0),l==null||l($)),a==null||a($),(G=k.onFocus)==null||G.call(k,$)},w=k=>$=>{var G;v($),g.current===!1&&S(!1),i==null||i($),(G=k.onBlur)==null||G.call(k,$)},A=gn(b,x);return{checked:f,disabled:!!r,focusVisible:C,getInputProps:(k={})=>R({checked:t,defaultChecked:n,disabled:r,readOnly:c,ref:A,required:u,type:"checkbox",role:"switch","aria-checked":t},k,{onChange:p(k),onFocus:I(k),onBlur:w(k)}),inputRef:A,readOnly:!!c}}function aA(e){const{value:t,defaultValue:n,onChange:r,orientation:i="horizontal",direction:o="ltr",selectionFollowsFocus:a=!1}=e,[l,c]=Kl({controlled:t,default:n,name:"Tabs",state:"value"}),u=K.useCallback((b,C)=>{c(C),r==null||r(b,C)},[r,c]),{subitems:f,contextValue:d}=bh(),p=K.useRef(()=>{}),g=K.useCallback(b=>{var C;return(C=f.get(b))==null?void 0:C.id},[f]),v=K.useCallback(b=>p.current(b),[]),m=K.useCallback(b=>{p.current=b},[]);return{contextValue:R({direction:o,getTabId:v,getTabPanelId:g,onSelected:u,orientation:i,registerTabIdLookup:m,selectionFollowsFocus:a,value:l},d)}}const kh=K.createContext(null);function Da(){const e=K.useContext(kh);if(e==null)throw new Error("No TabsContext provided");return e}function sA(e){const{value:t,children:n}=e,{direction:r,getItemIndex:i,onSelected:o,orientation:a,registerItem:l,registerTabIdLookup:c,selectionFollowsFocus:u,totalSubitemCount:f,value:d,getTabId:p,getTabPanelId:g}=t,v=K.useMemo(()=>({getItemIndex:i,registerItem:l,totalSubitemCount:f}),[l,i,f]),m=K.useMemo(()=>({direction:r,getTabId:p,getTabPanelId:g,onSelected:o,orientation:a,registerTabIdLookup:c,selectionFollowsFocus:u,value:d}),[r,p,g,o,a,c,u,d]);return s.jsx(tc.Provider,{value:v,children:s.jsx(kh.Provider,{value:m,children:n})})}function lA(e){return e.size}function cA(e){const{value:t,id:n,rootRef:r}=e,i=Da();if(i===null)throw new Error("No TabContext provided");const{value:o,getTabId:a}=i,l=io(n),c=K.useRef(null),u=gn(c,r),f=K.useMemo(()=>({id:l,ref:c}),[l]),{id:d}=yh(t!=null?t:lA,f),p=d!==o,g=d!==void 0?a(d):void 0;return{hidden:p,getRootProps:(m={})=>R({"aria-labelledby":g!=null?g:void 0,hidden:p,id:l!=null?l:void 0},m,{ref:u}),rootRef:u}}const _h={valueChange:"valueChange"};function uA(e,t){if(t.type===_h.valueChange)return R({},e,{highlightedValue:t.value});const n=gh(e,t),{context:{selectionFollowsFocus:r}}=t;if(t.type===Et.itemsChange){if(n.selectedValues.length>0)return R({},n,{highlightedValue:n.selectedValues[0]});$t(null,"reset",t.context)}return r&&n.highlightedValue!=null?R({},n,{selectedValues:[n.highlightedValue]}):n}function dA(e){var t;const{rootRef:n}=e,{direction:r="ltr",onSelected:i,orientation:o="horizontal",value:a,registerTabIdLookup:l,selectionFollowsFocus:c}=Da(),{subitems:u,contextValue:f}=bh(),d=K.useCallback(O=>{var T;return(T=u.get(O))==null?void 0:T.id},[u]);l(d);const p=K.useMemo(()=>Array.from(u.keys()),[u]),g=K.useCallback(O=>{var T,F;return O==null?null:(T=(F=u.get(O))==null?void 0:F.ref.current)!=null?T:null},[u]),v=r==="rtl";let m;o==="vertical"?m="vertical":m=v?"horizontal-rtl":"horizontal-ltr";const b=K.useCallback((O,T)=>{var F;i(O,(F=T[0])!=null?F:null)},[i]),C=K.useMemo(()=>a===void 0?{}:a!=null?{selectedValues:[a]}:{selectedValues:[]},[a]),S=K.useCallback(O=>{var T,F;return(T=(F=u.get(O))==null?void 0:F.disabled)!=null?T:!1},[u]),{contextValue:x,dispatch:I,getRootProps:w,state:{highlightedValue:A,selectedValues:E},rootRef:k}=UI({controlledProps:C,disabledItemsFocusable:!c,focusManagement:"DOM",getItemDomElement:g,isItemDisabled:S,items:p,rootRef:n,onChange:b,orientation:m,reducerActionContext:K.useMemo(()=>({selectionFollowsFocus:c||!1}),[c]),selectionMode:"single",stateReducer:uA});K.useEffect(()=>{a!==void 0&&a!=null&&I({type:_h.valueChange,value:a})},[I,a]);const $=(O={})=>R({},O,w(O),{"aria-orientation":o==="vertical"?"vertical":void 0,role:"tablist"});return{contextValue:K.useMemo(()=>R({},f,x),[f,x]),dispatch:I,getRootProps:$,highlightedValue:A,isRtl:v,orientation:o,rootRef:k,selectedValue:(t=E[0])!=null?t:null}}function fA(e){const{value:t,children:n}=e,{dispatch:r,getItemIndex:i,getItemState:o,registerItem:a,totalSubitemCount:l}=t,c=K.useMemo(()=>({dispatch:r,getItemState:o,getItemIndex:i}),[r,i,o]),u=K.useMemo(()=>({getItemIndex:i,registerItem:a,totalSubitemCount:l}),[a,i,l]);return s.jsx(tc.Provider,{value:u,children:s.jsx(vh.Provider,{value:c,children:n})})}function hA(e){return e.size}function pA(e){const{value:t,rootRef:n,disabled:r=!1,id:i}=e,o=K.useRef(null),a=io(i),{value:l,selectionFollowsFocus:c,getTabPanelId:u}=Da(),f=K.useMemo(()=>({disabled:r,ref:o,id:a}),[r,o,a]),{id:d,index:p,totalItemCount:g}=yh(t!=null?t:hA,f),{getRootProps:v,highlighted:m,selected:b}=VI({item:d}),{getRootProps:C,rootRef:S,active:x,focusVisible:I,setFocusVisible:w}=Xl({disabled:r,focusableWhenDisabled:!c,type:"button"}),A=gn(o,n,S),E=d!==void 0?u(d):void 0;return{getRootProps:($={})=>{const G=Nn($),O=WI(v,C);return R({},$,O(G),{role:"tab","aria-controls":E,"aria-selected":b,id:a,ref:A})},active:x,focusVisible:I,highlighted:m,index:p,rootRef:A,selected:b||d===l,setFocusVisible:w,totalTabsCount:g}}const Ph="$$joy";function gA(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}function mA(e,t){return Di(e,t)}const vA=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},bA=["values","unit","step"],yA=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>R({},n,{[r.key]:r.val}),{})};function Dh(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=De(e,bA),o=yA(t),a=Object.keys(o);function l(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function c(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function u(p,g){const v=a.indexOf(g);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(v!==-1&&typeof t[a[v]]=="number"?t[a[v]]:g)-r/100}${n})`}function f(p){return a.indexOf(p)+1<a.length?u(p,a[a.indexOf(p)+1]):l(p)}function d(p){const g=a.indexOf(p);return g===0?l(a[1]):g===a.length-1?c(a[g]):u(p,a[a.indexOf(p)+1]).replace("@media","@media not all and")}return R({keys:a,values:o,up:l,down:c,between:u,only:f,not:d,unit:n},i)}const xA={borderRadius:4};function oo(e,t){return t?jn(e,t,{clone:!1}):e}const ac={xs:0,sm:600,md:900,lg:1200,xl:1536},Oh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${ac[e]}px)`};function Vn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Oh;return t.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(t[c]),a),{})}if(typeof t=="object"){const o=r.breakpoints||Oh;return Object.keys(t).reduce((a,l)=>{if(Object.keys(o.values||ac).indexOf(l)!==-1){const c=o.up(l);a[c]=n(t[l],l)}else{const c=l;a[c]=t[c]}return a},{})}return n(t)}function CA(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function wA(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function ar(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Oa(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=ar(e,n)||r,t&&(i=t(i,r,e)),i}function ct(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const l=a[t],c=a.theme,u=ar(c,r)||{};return Vn(a,l,d=>{let p=Oa(u,i,d);return d===p&&typeof d=="string"&&(p=Oa(u,i,`${t}${d==="default"?"":Se(d)}`,d)),n===!1?p:{[n]:p}})};return o.propTypes={},o.filterProps=[t],o}function SA(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const IA={m:"margin",p:"padding"},AA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Rh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},TA=SA(e=>{if(e.length>2)if(Rh[e])e=Rh[e];else return[e];const[t,n]=e.split(""),r=IA[t],i=AA[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),sc=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],lc=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...sc,...lc];function ao(e,t,n,r){var i;const o=(i=ar(e,t,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function Lh(e){return ao(e,"spacing",8)}function so(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function EA(e,t){return n=>e.reduce((r,i)=>(r[i]=so(t,n),r),{})}function kA(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=TA(n),o=EA(i,r),a=e[n];return Vn(e,a,o)}function Mh(e,t){const n=Lh(e.theme);return Object.keys(e).map(r=>kA(e,t,r,n)).reduce(oo,{})}function it(e){return Mh(e,sc)}it.propTypes={},it.filterProps=sc;function ot(e){return Mh(e,lc)}ot.propTypes={},ot.filterProps=lc;function Bh(e=8){if(e.mui)return e;const t=Lh({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function Ra(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?oo(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function sn(e){return typeof e!="number"?e:`${e}px solid`}function ln(e,t){return ct({prop:e,themeKey:"borders",transform:t})}const _A=ln("border",sn),PA=ln("borderTop",sn),DA=ln("borderRight",sn),OA=ln("borderBottom",sn),RA=ln("borderLeft",sn),LA=ln("borderColor"),MA=ln("borderTopColor"),BA=ln("borderRightColor"),$A=ln("borderBottomColor"),FA=ln("borderLeftColor"),NA=ln("outline",sn),zA=ln("outlineColor"),La=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ao(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:so(t,r)});return Vn(e,e.borderRadius,n)}return null};La.propTypes={},La.filterProps=["borderRadius"],Ra(_A,PA,DA,OA,RA,LA,MA,BA,$A,FA,La,NA,zA);const Ma=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ao(e.theme,"spacing",8),n=r=>({gap:so(t,r)});return Vn(e,e.gap,n)}return null};Ma.propTypes={},Ma.filterProps=["gap"];const Ba=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ao(e.theme,"spacing",8),n=r=>({columnGap:so(t,r)});return Vn(e,e.columnGap,n)}return null};Ba.propTypes={},Ba.filterProps=["columnGap"];const $a=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ao(e.theme,"spacing",8),n=r=>({rowGap:so(t,r)});return Vn(e,e.rowGap,n)}return null};$a.propTypes={},$a.filterProps=["rowGap"];const jA=ct({prop:"gridColumn"}),UA=ct({prop:"gridRow"}),VA=ct({prop:"gridAutoFlow"}),HA=ct({prop:"gridAutoColumns"}),WA=ct({prop:"gridAutoRows"}),GA=ct({prop:"gridTemplateColumns"}),YA=ct({prop:"gridTemplateRows"}),KA=ct({prop:"gridTemplateAreas"}),qA=ct({prop:"gridArea"});Ra(Ma,Ba,$a,jA,UA,VA,HA,WA,GA,YA,KA,qA);function Zr(e,t){return t==="grey"?t:e}const QA=ct({prop:"color",themeKey:"palette",transform:Zr}),JA=ct({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Zr}),XA=ct({prop:"backgroundColor",themeKey:"palette",transform:Zr});Ra(QA,JA,XA);function qt(e){return e<=1&&e!==0?`${e*100}%`:e}const ZA=ct({prop:"width",transform:qt}),cc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||ac[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:qt(n)}};return Vn(e,e.maxWidth,t)}return null};cc.filterProps=["maxWidth"];const e1=ct({prop:"minWidth",transform:qt}),t1=ct({prop:"height",transform:qt}),n1=ct({prop:"maxHeight",transform:qt}),r1=ct({prop:"minHeight",transform:qt});ct({prop:"size",cssProperty:"width",transform:qt}),ct({prop:"size",cssProperty:"height",transform:qt});const i1=ct({prop:"boxSizing"});Ra(ZA,cc,e1,t1,n1,r1,i1);const Fa={border:{themeKey:"borders",transform:sn},borderTop:{themeKey:"borders",transform:sn},borderRight:{themeKey:"borders",transform:sn},borderBottom:{themeKey:"borders",transform:sn},borderLeft:{themeKey:"borders",transform:sn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:sn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:La},color:{themeKey:"palette",transform:Zr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Zr},backgroundColor:{themeKey:"palette",transform:Zr},p:{style:ot},pt:{style:ot},pr:{style:ot},pb:{style:ot},pl:{style:ot},px:{style:ot},py:{style:ot},padding:{style:ot},paddingTop:{style:ot},paddingRight:{style:ot},paddingBottom:{style:ot},paddingLeft:{style:ot},paddingX:{style:ot},paddingY:{style:ot},paddingInline:{style:ot},paddingInlineStart:{style:ot},paddingInlineEnd:{style:ot},paddingBlock:{style:ot},paddingBlockStart:{style:ot},paddingBlockEnd:{style:ot},m:{style:it},mt:{style:it},mr:{style:it},mb:{style:it},ml:{style:it},mx:{style:it},my:{style:it},margin:{style:it},marginTop:{style:it},marginRight:{style:it},marginBottom:{style:it},marginLeft:{style:it},marginX:{style:it},marginY:{style:it},marginInline:{style:it},marginInlineStart:{style:it},marginInlineEnd:{style:it},marginBlock:{style:it},marginBlockStart:{style:it},marginBlockEnd:{style:it},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ma},rowGap:{style:$a},columnGap:{style:Ba},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:qt},maxWidth:{style:cc},minWidth:{transform:qt},height:{transform:qt},maxHeight:{transform:qt},minHeight:{transform:qt},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function o1(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function a1(e,t){return typeof e=="function"?e(t):e}function s1(){function e(n,r,i,o){const a={[n]:r,theme:i},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:f,style:d}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const p=ar(i,u)||{};return d?d(a):Vn(a,r,v=>{let m=Oa(p,f,v);return v===m&&typeof v=="string"&&(m=Oa(p,f,`${n}${v==="default"?"":Se(v)}`,v)),c===!1?m:{[c]:m}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:Fa;function l(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const f=CA(o.breakpoints),d=Object.keys(f);let p=f;return Object.keys(u).forEach(g=>{const v=a1(u[g],o);if(v!=null)if(typeof v=="object")if(a[g])p=oo(p,e(g,v,o,a));else{const m=Vn({theme:o},v,b=>({[g]:b}));o1(m,v)?p[g]=t({sx:v,theme:o}):p=oo(p,m)}else p=oo(p,e(g,v,o,a))}),wA(d,p)}return Array.isArray(i)?i.map(l):l(i)}return t}const Na=s1();Na.filterProps=["sx"];function $h(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const l1=["breakpoints","palette","spacing","shape"];function Fh(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=De(e,l1),l=Dh(n),c=Bh(i);let u=jn({breakpoints:l,direction:"ltr",components:{},palette:R({mode:"light"},r),spacing:c,shape:R({},xA,o)},a);return u.applyStyles=$h,u=t.reduce((f,d)=>jn(f,d),u),u.unstable_sxConfig=R({},Fa,a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(d){return Na({sx:d,theme:this})},u}function c1(e){return Object.keys(e).length===0}function u1(e=null){const t=K.useContext(me.ThemeContext);return!t||c1(t)?e:t}const d1=Fh();function f1(e=d1){return u1(e)}const h1=["sx"],p1=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:Fa;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function g1(e){const{sx:t}=e,n=De(e,h1),{systemProps:r,otherProps:i}=p1(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...a)=>{const l=t(...a);return or(l)?R({},r,l):r}:o=R({},r,t),R({},i,{sx:o})}const m1=["ownerState"],v1=["variants"],b1=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function y1(e){return Object.keys(e).length===0}function x1(e){return typeof e=="string"&&e.charCodeAt(0)>96}function uc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const C1=Fh(),w1=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function za({defaultTheme:e,theme:t,themeId:n}){return y1(t)?e:t[n]||t}function S1(e){return e?(t,n)=>n[e]:null}function ja(e,t){let{ownerState:n}=t,r=De(t,m1);const i=typeof e=="function"?e(R({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>ja(o,R({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let l=De(i,v1);return o.forEach(c=>{let u=!0;typeof c.props=="function"?u=c.props(R({ownerState:n},r,n)):Object.keys(c.props).forEach(f=>{(n==null?void 0:n[f])!==c.props[f]&&r[f]!==c.props[f]&&(u=!1)}),u&&(Array.isArray(l)||(l=[l]),l.push(typeof c.style=="function"?c.style(R({ownerState:n},r,n)):c.style))}),l}return i}function I1(e={}){const{themeId:t,defaultTheme:n=C1,rootShouldForwardProp:r=uc,slotShouldForwardProp:i=uc}=e,o=a=>Na(R({},a,{theme:za(R({},a,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(a,l={})=>{vA(a,w=>w.filter(A=>!(A!=null&&A.__mui_systemSx)));const{name:c,slot:u,skipVariantsResolver:f,skipSx:d,overridesResolver:p=S1(w1(u))}=l,g=De(l,b1),v=f!==void 0?f:u&&u!=="Root"&&u!=="root"||!1,m=d||!1;let b,C=uc;u==="Root"||u==="root"?C=r:u?C=i:x1(a)&&(C=void 0);const S=mA(a,R({shouldForwardProp:C,label:b},g)),x=w=>typeof w=="function"&&w.__emotion_real!==w||or(w)?A=>ja(w,R({},A,{theme:za({theme:A.theme,defaultTheme:n,themeId:t})})):w,I=(w,...A)=>{let E=x(w);const k=A?A.map(x):[];c&&p&&k.push(O=>{const T=za(R({},O,{defaultTheme:n,themeId:t}));if(!T.components||!T.components[c]||!T.components[c].styleOverrides)return null;const F=T.components[c].styleOverrides,H={};return Object.entries(F).forEach(([j,N])=>{H[j]=ja(N,R({},O,{theme:T}))}),p(O,H)}),c&&!v&&k.push(O=>{var T;const F=za(R({},O,{defaultTheme:n,themeId:t})),H=F==null||(T=F.components)==null||(T=T[c])==null?void 0:T.variants;return ja({variants:H},R({},O,{theme:F}))}),m||k.push(o);const $=k.length-A.length;if(Array.isArray(w)&&$>0){const O=new Array($).fill("");E=[...w,...O],E.raw=[...w.raw,...O]}const G=S(E,...k);return a.muiName&&(G.muiName=a.muiName),G};return S.withConfig&&(I.withConfig=S.withConfig),I}}function A1(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:uh(t.components[n].defaultProps,r)}function T1({props:e,name:t,defaultTheme:n,themeId:r}){let i=f1(n);return r&&(i=i[r]||i),A1({theme:i,name:t,props:e})}function E1(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Nh(e){if(e.type)return e;if(e.charAt(0)==="#")return Nh(E1(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(ga(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(ga(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const Ar=e=>{const t=Nh(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};function dc(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const zh=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},k1=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([l,c])=>{(!n||n&&!n([...o,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,l],Array.isArray(c)?[...a,l]:a):t([...o,l],c,a))})}r(e)},_1=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().indexOf("opacity")>=0?t:`${t}px`:t;function fc(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return k1(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const f=`--${n?`${n}-`:""}${l.join("-")}`;Object.assign(i,{[f]:_1(l,c)}),zh(o,l,`var(${f})`,u),zh(a,l,`var(${f}, ${c})`,u)}},l=>l[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function Tr(e){"@babel/helpers - typeof";return Tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(e)}function P1(e,t){if(Tr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hc(e){var t=P1(e,"string");return Tr(t)=="symbol"?t:t+""}const D1=["colorSchemes","components","defaultColorScheme"];function O1(e,t){const{colorSchemes:n={},defaultColorScheme:r="light"}=e,i=De(e,D1),{vars:o,css:a,varsWithDefaults:l}=fc(i,t);let c=l;const u={},{[r]:f}=n,d=De(n,[r].map(hc));if(Object.entries(d||{}).forEach(([g,v])=>{const{vars:m,css:b,varsWithDefaults:C}=fc(v,t);c=jn(c,C),u[g]={css:b,vars:m}}),f){const{css:g,vars:v,varsWithDefaults:m}=fc(f,t);c=jn(c,m),u[r]={css:g,vars:v}}return{vars:c,generateCssVars:g=>{var v;if(!g){var m;const C=R({},a);return{css:C,vars:o,selector:(t==null||(m=t.getSelector)==null?void 0:m.call(t,g,C))||":root"}}const b=R({},u[g].css);return{css:b,vars:u[g].vars,selector:(t==null||(v=t.getSelector)==null?void 0:v.call(t,g,b))||":root"}}}}const R1=R({},Fa,{borderRadius:{themeKey:"radius"},boxShadow:{themeKey:"shadow"},fontFamily:{themeKey:"fontFamily"},fontSize:{themeKey:"fontSize"},fontWeight:{themeKey:"fontWeight"},letterSpacing:{themeKey:"letterSpacing"},lineHeight:{themeKey:"lineHeight"}}),lo={grey:{50:"#FBFCFE",100:"#F0F4F8",200:"#DDE7EE",300:"#CDD7E1",400:"#9FA6AD",500:"#636B74",600:"#555E68",700:"#32383E",800:"#171A1C",900:"#0B0D0E"},blue:{50:"#EDF5FD",100:"#E3EFFB",200:"#C7DFF7",300:"#97C3F0",400:"#4393E4",500:"#0B6BCB",600:"#185EA5",700:"#12467B",800:"#0A2744",900:"#051423"},yellow:{50:"#FEFAF6",100:"#FDF0E1",200:"#FCE1C2",300:"#F3C896",400:"#EA9A3E",500:"#9A5B13",600:"#72430D",700:"#492B08",800:"#2E1B05",900:"#1D1002"},red:{50:"#FEF6F6",100:"#FCE4E4",200:"#F7C5C5",300:"#F09898",400:"#E47474",500:"#C41C1C",600:"#A51818",700:"#7D1212",800:"#430A0A",900:"#240505"},green:{50:"#F6FEF6",100:"#E3FBE3",200:"#C7F7C7",300:"#A1E8A1",400:"#51BC51",500:"#1F7A1F",600:"#136C13",700:"#0A470A",800:"#042F04",900:"#021D02"}};function L1(e){var t;return!!e[0].match(/^(typography|variants|breakpoints)$/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/^(mode)$/))||e[0]==="focus"&&e[1]!=="thickness"}const ut=(e,t)=>fh(e,t,"Mui"),qe=(e,t)=>bI(e,t,"Mui"),M1=e=>e&&typeof e=="object"&&Object.keys(e).some(t=>{var n;return(n=t.match)==null?void 0:n.call(t,/^(plain(Hover|Active|Disabled)?(Color|Bg)|outlined(Hover|Active|Disabled)?(Color|Border|Bg)|soft(Hover|Active|Disabled)?(Color|Bg)|solid(Hover|Active|Disabled)?(Color|Bg))$/)}),jh=(e,t,n)=>{t.includes("Color")&&(e.color=n),t.includes("Bg")&&(e.backgroundColor=n),t.includes("Border")&&(e.borderColor=n)},Uh=(e,t,n)=>{const r={};return Object.entries(t||{}).forEach(([i,o])=>{if(i.match(new RegExp(`${e}(color|bg|border)`,"i"))&&o){const a=n?n(i):o;i.includes("Disabled")&&(r.pointerEvents="none",r.cursor="default",r["--Icon-color"]="currentColor"),i.match(/(Hover|Active|Disabled)/)||(r["--variant-borderWidth"]||(r["--variant-borderWidth"]="0px"),i.includes("Border")&&(r["--variant-borderWidth"]="1px",r.border="var(--variant-borderWidth) solid")),jh(r,i,a)}}),r},Rt=(e,t)=>{let n={};if(t){const{getCssVar:r,palette:i}=t;Object.entries(i).forEach(o=>{const[a,l]=o;M1(l)&&typeof l=="object"&&(n=R({},n,{[a]:Uh(e,l,c=>`var(--variant-${c}, ${r(`palette-${a}-${c}`,i[a][c])})`)}))})}return n.context=Uh(e,{plainColor:"var(--variant-plainColor)",plainHoverColor:"var(--variant-plainHoverColor)",plainHoverBg:"var(--variant-plainHoverBg)",plainActiveBg:"var(--variant-plainActiveBg)",plainDisabledColor:"var(--variant-plainDisabledColor)",outlinedColor:"var(--variant-outlinedColor)",outlinedBorder:"var(--variant-outlinedBorder)",outlinedHoverColor:"var(--variant-outlinedHoverColor)",outlinedHoverBorder:"var(--variant-outlinedHoverBorder)",outlinedHoverBg:"var(--variant-outlinedHoverBg)",outlinedActiveBg:"var(--variant-outlinedActiveBg)",outlinedDisabledColor:"var(--variant-outlinedDisabledColor)",outlinedDisabledBorder:"var(--variant-outlinedDisabledBorder)",softColor:"var(--variant-softColor)",softBg:"var(--variant-softBg)",softHoverColor:"var(--variant-softHoverColor)",softHoverBg:"var(--variant-softHoverBg)",softActiveBg:"var(--variant-softActiveBg)",softDisabledColor:"var(--variant-softDisabledColor)",softDisabledBg:"var(--variant-softDisabledBg)",solidColor:"var(--variant-solidColor)",solidBg:"var(--variant-solidBg)",solidHoverBg:"var(--variant-solidHoverBg)",solidActiveBg:"var(--variant-solidActiveBg)",solidDisabledColor:"var(--variant-solidDisabledColor)",solidDisabledBg:"var(--variant-solidDisabledBg)"}),n},B1=["cssVarPrefix","breakpoints","spacing","components","variants","shouldSkipGeneratingVar"],$1=["colorSchemes"],F1=(e="joy")=>dc(e);function N1(e){var t,n,r,i,o,a,l,c,u,f;const d={},{cssVarPrefix:p="joy",breakpoints:g,spacing:v,components:m,variants:b,shouldSkipGeneratingVar:C=L1}=d,S=De(d,B1),x=F1(p),I={primary:lo.blue,neutral:lo.grey,danger:lo.red,success:lo.green,warning:lo.yellow,common:{white:"#FFF",black:"#000"}},w=Z=>{var te;const ne=Z.split("-"),ue=ne[1],be=ne[2];return x(Z,(te=I[ue])==null?void 0:te[be])},A=Z=>({plainColor:w(`palette-${Z}-500`),plainHoverBg:w(`palette-${Z}-100`),plainActiveBg:w(`palette-${Z}-200`),plainDisabledColor:w("palette-neutral-400"),outlinedColor:w(`palette-${Z}-500`),outlinedBorder:w(`palette-${Z}-300`),outlinedHoverBg:w(`palette-${Z}-100`),outlinedActiveBg:w(`palette-${Z}-200`),outlinedDisabledColor:w("palette-neutral-400"),outlinedDisabledBorder:w("palette-neutral-200"),softColor:w(`palette-${Z}-700`),softBg:w(`palette-${Z}-100`),softHoverBg:w(`palette-${Z}-200`),softActiveColor:w(`palette-${Z}-800`),softActiveBg:w(`palette-${Z}-300`),softDisabledColor:w("palette-neutral-400"),softDisabledBg:w("palette-neutral-50"),solidColor:w("palette-common-white"),solidBg:w(`palette-${Z}-500`),solidHoverBg:w(`palette-${Z}-600`),solidActiveBg:w(`palette-${Z}-700`),solidDisabledColor:w("palette-neutral-400"),solidDisabledBg:w("palette-neutral-100")}),E=Z=>({plainColor:w(`palette-${Z}-300`),plainHoverBg:w(`palette-${Z}-800`),plainActiveBg:w(`palette-${Z}-700`),plainDisabledColor:w("palette-neutral-500"),outlinedColor:w(`palette-${Z}-200`),outlinedBorder:w(`palette-${Z}-700`),outlinedHoverBg:w(`palette-${Z}-800`),outlinedActiveBg:w(`palette-${Z}-700`),outlinedDisabledColor:w("palette-neutral-500"),outlinedDisabledBorder:w("palette-neutral-800"),softColor:w(`palette-${Z}-200`),softBg:w(`palette-${Z}-800`),softHoverBg:w(`palette-${Z}-700`),softActiveColor:w(`palette-${Z}-100`),softActiveBg:w(`palette-${Z}-600`),softDisabledColor:w("palette-neutral-500"),softDisabledBg:w("palette-neutral-800"),solidColor:w("palette-common-white"),solidBg:w(`palette-${Z}-500`),solidHoverBg:w(`palette-${Z}-600`),solidActiveBg:w(`palette-${Z}-700`),solidDisabledColor:w("palette-neutral-500"),solidDisabledBg:w("palette-neutral-800")}),k={palette:{mode:"light",primary:R({},I.primary,A("primary")),neutral:R({},I.neutral,A("neutral"),{plainColor:w("palette-neutral-700"),plainHoverColor:w("palette-neutral-900"),outlinedColor:w("palette-neutral-700")}),danger:R({},I.danger,A("danger")),success:R({},I.success,A("success")),warning:R({},I.warning,A("warning")),common:{white:"#FFF",black:"#000"},text:{primary:w("palette-neutral-800"),secondary:w("palette-neutral-700"),tertiary:w("palette-neutral-600"),icon:w("palette-neutral-500")},background:{body:w("palette-common-white"),surface:w("palette-neutral-50"),popup:w("palette-common-white"),level1:w("palette-neutral-100"),level2:w("palette-neutral-200"),level3:w("palette-neutral-300"),tooltip:w("palette-neutral-500"),backdrop:`rgba(${x("palette-neutral-darkChannel",Ar(I.neutral[900]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",Ar(I.neutral[500]))} / 0.2)`,focusVisible:w("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"21 21 21",shadowOpacity:"0.08"},$={palette:{mode:"dark",primary:R({},I.primary,E("primary")),neutral:R({},I.neutral,E("neutral"),{plainColor:w("palette-neutral-300"),plainHoverColor:w("palette-neutral-300")}),danger:R({},I.danger,E("danger")),success:R({},I.success,E("success")),warning:R({},I.warning,E("warning")),common:{white:"#FFF",black:"#000"},text:{primary:w("palette-neutral-100"),secondary:w("palette-neutral-300"),tertiary:w("palette-neutral-400"),icon:w("palette-neutral-400")},background:{body:w("palette-common-black"),surface:w("palette-neutral-900"),popup:w("palette-common-black"),level1:w("palette-neutral-800"),level2:w("palette-neutral-700"),level3:w("palette-neutral-600"),tooltip:w("palette-neutral-600"),backdrop:`rgba(${x("palette-neutral-darkChannel",Ar(I.neutral[50]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",Ar(I.neutral[500]))} / 0.16)`,focusVisible:w("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"0 0 0",shadowOpacity:"0.6"},G='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',O=R({body:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,display:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,code:"Source Code Pro,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",fallback:G},S.fontFamily),T=R({sm:300,md:500,lg:600,xl:700},S.fontWeight),F=R({xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem"},S.fontSize),H=R({xs:"1.33334",sm:"1.42858",md:"1.5",lg:"1.55556",xl:"1.66667"},S.lineHeight),j=(t=(n=S.colorSchemes)==null||(n=n.light)==null?void 0:n.shadowRing)!=null?t:k.shadowRing,N=(r=(i=S.colorSchemes)==null||(i=i.light)==null?void 0:i.shadowChannel)!=null?r:k.shadowChannel,M=(o=(a=S.colorSchemes)==null||(a=a.light)==null?void 0:a.shadowOpacity)!=null?o:k.shadowOpacity,V={colorSchemes:{light:k,dark:$},fontSize:F,fontFamily:O,fontWeight:T,focus:{thickness:"2px",selector:`&.${ut("","focusVisible")}, &:focus-visible`,default:{outlineOffset:`var(--focus-outline-offset, ${x("focus-thickness",(l=(c=S.focus)==null?void 0:c.thickness)!=null?l:"2px")})`,outline:`${x("focus-thickness",(u=(f=S.focus)==null?void 0:f.thickness)!=null?u:"2px")} solid ${x("palette-focusVisible",I.primary[500])}`}},lineHeight:H,radius:{xs:"2px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},shadow:{xs:`${x("shadowRing",j)}, 0px 1px 2px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)})`,sm:`${x("shadowRing",j)}, 0px 1px 2px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)}), 0px 2px 4px 0px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)})`,md:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)}), 0px 6px 12px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)})`,lg:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)}), 0px 12px 16px -4px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)})`,xl:`${x("shadowRing",j)}, 0px 2px 8px -2px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)}), 0px 20px 24px -4px rgba(${x("shadowChannel",N)} / ${x("shadowOpacity",M)})`},zIndex:{badge:1,table:10,popup:1e3,modal:1300,snackbar:1400,tooltip:1500},typography:{h1:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl4, ${F.xl4}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h2:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl3, ${F.xl3}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h3:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl2, ${F.xl2}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},h4:{fontFamily:x(`fontFamily-display, ${O.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl, ${F.xl}`),lineHeight:x(`lineHeight-md, ${H.md}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-lg":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-lg, ${F.lg}`),lineHeight:x(`lineHeight-xs, ${H.xs}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-md":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-md, ${F.md}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"title-sm":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-sm, ${F.sm}`),lineHeight:x(`lineHeight-sm, ${H.sm}`),color:x(`palette-text-primary, ${k.palette.text.primary}`)},"body-lg":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-lg, ${F.lg}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-secondary, ${k.palette.text.secondary}`)},"body-md":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-md, ${F.md}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-secondary, ${k.palette.text.secondary}`)},"body-sm":{fontFamily:x(`fontFamily-body, ${O.body}`),fontSize:x(`fontSize-sm, ${F.sm}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-tertiary, ${k.palette.text.tertiary}`)},"body-xs":{fontFamily:x(`fontFamily-body, ${O.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-xs, ${F.xs}`),lineHeight:x(`lineHeight-md, ${H.md}`),color:x(`palette-text-tertiary, ${k.palette.text.tertiary}`)}}},Y=S?jn(V,S):V,{colorSchemes:X}=Y,D=De(Y,$1),B=R({colorSchemes:X},D,{breakpoints:Dh(g!=null?g:{}),components:jn({MuiSvgIcon:{defaultProps:{fontSize:"xl2"},styleOverrides:{root:({ownerState:Z,theme:te})=>{var ne;const ue=Z.instanceFontSize;return R({margin:"var(--Icon-margin)"},Z.fontSize&&Z.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${te.vars.fontSize[Z.fontSize]})`},!Z.htmlColor&&R({color:`var(--Icon-color, ${B.vars.palette.text.icon})`},Z.color&&Z.color!=="inherit"&&te.vars.palette[Z.color]&&{color:`rgba(${(ne=te.vars.palette[Z.color])==null?void 0:ne.mainChannel} / 1)`}),ue&&ue!=="inherit"&&{"--Icon-fontSize":te.vars.fontSize[ue]})}}}},m),cssVarPrefix:p,getCssVar:x,spacing:Bh(v)});function U(Z,te){Object.keys(te).forEach(ne=>{const ue={main:"500",light:"200",dark:"700"};Z==="dark"&&(ue.main=400),!te[ne].mainChannel&&te[ne][ue.main]&&(te[ne].mainChannel=Ar(te[ne][ue.main])),!te[ne].lightChannel&&te[ne][ue.light]&&(te[ne].lightChannel=Ar(te[ne][ue.light])),!te[ne].darkChannel&&te[ne][ue.dark]&&(te[ne].darkChannel=Ar(te[ne][ue.dark]))})}Object.entries(B.colorSchemes).forEach(([Z,te])=>{U(Z,te.palette)});const W={prefix:p,shouldSkipGeneratingVar:C},{vars:ie,generateCssVars:se}=O1(R({colorSchemes:X},D),W);B.vars=ie,B.generateCssVars=se,B.unstable_sxConfig=R({},R1,void 0),B.unstable_sx=function(te){return Na({sx:te,theme:this})},B.getColorSchemeSelector=Z=>Z==="light"?"&":`&[data-joy-color-scheme="${Z}"], [data-joy-color-scheme="${Z}"] &`;const oe={getCssVar:x,palette:B.colorSchemes.light.palette};return B.variants=jn({plain:Rt("plain",oe),plainHover:Rt("plainHover",oe),plainActive:Rt("plainActive",oe),plainDisabled:Rt("plainDisabled",oe),outlined:Rt("outlined",oe),outlinedHover:Rt("outlinedHover",oe),outlinedActive:Rt("outlinedActive",oe),outlinedDisabled:Rt("outlinedDisabled",oe),soft:Rt("soft",oe),softHover:Rt("softHover",oe),softActive:Rt("softActive",oe),softDisabled:Rt("softDisabled",oe),solid:Rt("solid",oe),solidHover:Rt("solidHover",oe),solidActive:Rt("solidActive",oe),solidDisabled:Rt("solidDisabled",oe)},b),B.palette=R({},B.colorSchemes.light.palette,{colorScheme:"light"}),B.shouldSkipGeneratingVar=C,B.applyStyles=$h,B}const Vh=N1(),Ce=I1({defaultTheme:Vh,themeId:Ph});function mt({props:e,name:t}){return T1({props:e,name:t,defaultTheme:R({},Vh,{components:{}}),themeId:Ph})}function z1(e){return ut("MuiAccordion",e)}const j1=qe("MuiAccordion",["root","expanded","disabled"]),U1=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],V1=["component","slots","slotProps"],H1=["component"];function Ee(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:l}=t,c=De(t,U1),{component:u,slots:f={[e]:void 0},slotProps:d={[e]:void 0}}=o,p=De(o,V1),g=f[e]||r,v=tI(d[e],i),m=iI(R({className:n},c,{externalForwardedProps:e==="root"?p:void 0,externalSlotProps:v})),{props:{component:b},internalRef:C}=m,S=De(m.props,H1),x=gn(C,v==null?void 0:v.ref,t.ref),I=a?a(S):{},w=R({},i,I),A=e==="root"?b||u:b,E=eI(g,R({},e==="root"&&!u&&!f[e]&&l,e!=="root"&&!f[e]&&l,S,A&&{as:A},{ref:x}),w);return Object.keys(I).forEach(k=>{delete E[k]}),[g,E]}const pc=K.createContext({});function W1(e){return ut("MuiListItem",e)}const Hh=qe("MuiListItem",["root","startAction","endAction","nested","nesting","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]),Ua=K.createContext(!1),gc=K.createContext(!1),Wh=K.createContext(!1),Gh=K.createContext(void 0),G1=K.createContext(void 0),Yh=K.createContext(void 0),Y1=["component","className","children","nested","sticky","variant","color","startAction","endAction","role","slots","slotProps"],K1=e=>{const{sticky:t,nested:n,nesting:r,variant:i,color:o}=e,a={root:["root",n&&"nested",r&&"nesting",t&&"sticky",o&&`color${Se(o)}`,i&&`variant${Se(i)}`],startAction:["startAction"],endAction:["endAction"]};return gt(a,W1,{})},mc=Ce("li")(({theme:e,ownerState:t})=>{var n;return[!t.nested&&{"--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItemButton-marginBlock":"calc(-1 * var(--ListItem-paddingY))",alignItems:"center",gap:"var(--ListItem-gap)",marginInline:"var(--ListItem-marginInline)"},t.nested&&{"--NestedList-marginRight":"calc(-1 * var(--ListItem-paddingRight))","--NestedList-marginLeft":"calc(-1 * var(--ListItem-paddingLeft))","--NestedListItem-paddingLeft":"calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItem-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",flexDirection:"column"},R({"--unstable_actionRadius":"calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"},t.startAction&&{"--unstable_startActionWidth":"2rem"},t.endAction&&{"--unstable_endActionWidth":"2.5rem"},{boxSizing:"border-box",borderRadius:"var(--ListItem-radius)",display:"var(--_ListItem-display)","&:not([hidden])":{"--_ListItem-display":"var(--_List-markerDisplay, flex)"},flex:"none",listStyleType:"var(--_List-markerType, disc)",position:"relative",paddingBlockStart:t.nested?0:"var(--ListItem-paddingY)",paddingBlockEnd:t.nested?0:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)"},t["data-first-child"]===void 0&&R({},t.row?{marginInlineStart:"var(--List-gap)"}:{marginBlockStart:"var(--List-gap)"}),t.row&&t.wrap&&{marginInlineStart:"var(--List-gap)",marginBlockStart:"var(--List-gap)"},{minBlockSize:"var(--ListItem-minHeight)"},t.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:`var(--ListItem-stickyBackground, ${e.vars.palette.background.body})`},{[`.${Hh.nested} > &`]:{"--_ListItem-display":"flex"}}),(n=e.variants[t.variant])==null?void 0:n[t.color]]}),q1=Ce(mc,{name:"JoyListItem",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Q1=Ce("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",left:0,transform:"translate(var(--ListItem-startActionTranslateX), -50%)",zIndex:1})),J1=Ce("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",right:0,transform:"translate(var(--ListItem-endActionTranslateX), -50%)"})),Kh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyListItem"}),i=K.useContext(Yh),o=K.useContext(Gh),a=K.useContext(gc),l=K.useContext(Wh),c=K.useContext(Ua),{component:u,className:f,children:d,nested:p=!1,sticky:g=!1,variant:v="plain",color:m="neutral",startAction:b,endAction:C,role:S,slots:x={},slotProps:I={}}=r,w=De(r,Y1),[A,E]=K.useState(""),[k,$]=(o==null?void 0:o.split(":"))||["",""],G=u||(k&&!k.match(/^(ul|ol|menu)$/)?"div":void 0);let O=i==="menu"?"none":void 0;o&&(O={menu:"none",menubar:"none",group:"presentation"}[$]),S&&(O=S);const T=R({},r,{sticky:g,startAction:b,endAction:C,row:a,wrap:l,variant:v,color:m,nesting:c,nested:p,component:G,role:O}),F=K1(T),H=R({},w,{component:G,slots:x,slotProps:I}),[j,N]=Ee("root",{additionalProps:{role:O},ref:n,className:zn(F.root,f),elementType:q1,externalForwardedProps:H,ownerState:T}),[M,V]=Ee("startAction",{className:F.startAction,elementType:Q1,externalForwardedProps:H,ownerState:T}),[Y,X]=Ee("endAction",{className:F.endAction,elementType:J1,externalForwardedProps:H,ownerState:T});return s.jsx(G1.Provider,{value:E,children:s.jsx(Ua.Provider,{value:p?A||!0:!1,children:s.jsxs(j,R({},N,{children:[b&&s.jsx(M,R({},V,{children:b})),K.Children.map(d,(D,B)=>{var U;return K.isValidElement(D)?K.cloneElement(D,R({},B===0&&{"data-first-child":""},ah(D,["ListItem"])&&{component:((U=D.props)==null?void 0:U.component)||"div"})):D}),C&&s.jsx(Y,R({},X,{children:C}))]}))})})});Kh.muiName="ListItem";const qh=Kh;function X1(e){return ut("MuiAccordionDetails",e)}const Er=qe("MuiAccordionDetails",["root","content","expanded"]),Z1=["accordionId","component","color","children","defaultExpanded","disabled","expanded","onChange","variant","slots","slotProps"],eT=e=>{const{variant:t,color:n,expanded:r,disabled:i}=e,o={root:["root",r&&"expanded",i&&"disabled",n&&`color${Se(n)}`,t&&`variant${Se(t)}`]};return gt(o,z1,{})},tT=Ce(mc,{name:"JoyAccordion",slot:"Root",overridesResolver:(e,t)=>t.root})({borderBottom:"var(--Accordion-borderBottom)","&[data-first-child]":{"--ListItem-radius":"var(--unstable_List-childRadius) var(--unstable_List-childRadius) 0 0"},"&[data-last-child]":{"--ListItem-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)",'& [aria-expanded="true"]':{"--ListItem-radius":"0"},[`& .${Er.root}`]:{"--AccordionDetails-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)"}},"&:not([data-first-child]):not([data-last-child])":{"--ListItem-radius":"0"}}),nT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordion"}),{accordionId:i,component:o="div",color:a="neutral",children:l,defaultExpanded:c=!1,disabled:u=!1,expanded:f,onChange:d,variant:p="plain",slots:g={},slotProps:v={}}=r,m=De(r,Z1),b=io(i),[C,S]=Kl({controlled:f,default:c,name:"Accordion",state:"expanded"}),x=K.useCallback(G=>{S(!C),d&&d(G,!C)},[C,d,S]),I=K.useMemo(()=>({accordionId:b,expanded:C,disabled:u,toggle:x}),[b,C,u,x]),w=R({},m,{component:o,slots:g,slotProps:v}),A=R({},r,{component:o,color:a,variant:p,expanded:C,disabled:u,nested:!0}),E=eT(A),[k,$]=Ee("root",{ref:n,className:E.root,elementType:tT,externalForwardedProps:w,ownerState:A});return s.jsx(pc.Provider,{value:I,children:s.jsx(k,R({},$,{children:K.Children.map(l,(G,O)=>K.isValidElement(G)&&O===0?K.cloneElement(G,{"data-first-child":""}):G)}))})});function rT(e){return ut("MuiAccordionGroup",e)}qe("MuiAccordionGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const iT={"--NestedList-marginRight":"0px","--NestedList-marginLeft":"0px","--NestedListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px"};function vc(e){const{children:t,nested:n,row:r=!1,wrap:i=!1}=e,o=s.jsx(gc.Provider,{value:r,children:s.jsx(Wh.Provider,{value:i,children:K.Children.map(t,(a,l)=>K.isValidElement(a)?K.cloneElement(a,R({},l===0&&{"data-first-child":""},l===K.Children.count(t)-1&&{"data-last-child":""})):a)})});return n===void 0?o:s.jsx(Ua.Provider,{value:n,children:o})}const bc=({theme:e,ownerState:t},n)=>{let r={};function i(o){if(typeof o=="function"){const a=o(e);i(a)}else Array.isArray(o)?o.forEach(a=>{typeof a!="boolean"&&i(a)}):typeof o=="object"&&(r=R({},r,o))}return t.sx&&(i(t.sx),n.forEach(o=>{const a=r[o];if(typeof a=="string"||typeof a=="number")if(o==="borderRadius")if(typeof a=="number")r[o]=`${a}px`;else{var l;r[o]=((l=e.vars)==null?void 0:l.radius[a])||a}else["p","padding","m","margin"].indexOf(o)!==-1&&typeof a=="number"?r[o]=e.spacing(a):r[o]=a;else typeof a=="function"?r[o]=a(e):r[o]=void 0})),r};function oT(e){return ut("MuiList",e)}qe("MuiList",["root","nesting","scoped","sizeSm","sizeMd","sizeLg","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]);const aT=K.createContext(void 0),sT=["component","className","children","size","orientation","wrap","variant","color","role","slots","slotProps"],lT=e=>{const{variant:t,color:n,size:r,nesting:i,orientation:o,instanceSize:a}=e,l={root:["root",o,t&&`variant${Se(t)}`,n&&`color${Se(n)}`,!a&&!i&&r&&`size${Se(r)}`,a&&`size${Se(a)}`,i&&"nesting"]};return gt(l,oT,{})},yc=Ce("ul")(({theme:e,ownerState:t})=>{var n;const{p:r,padding:i,borderRadius:o}=bc({theme:e,ownerState:t},["p","padding","borderRadius"]);function a(l){return l==="sm"?{"--ListDivider-gap":"0.25rem","--ListItem-minHeight":"2rem","--ListItem-paddingY":"3px","--ListItem-paddingX":t.marker?"3px":"0.5rem","--ListItem-gap":"0.5rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.5rem":"2rem","--Icon-fontSize":e.vars.fontSize.lg}:l==="md"?{"--ListDivider-gap":"0.375rem","--ListItem-minHeight":"2.25rem","--ListItem-paddingY":"0.25rem","--ListItem-paddingX":t.marker?"0.25rem":"0.75rem","--ListItem-gap":"0.625rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.75rem":"2.5rem","--Icon-fontSize":e.vars.fontSize.xl}:l==="lg"?{"--ListDivider-gap":"0.5rem","--ListItem-minHeight":"2.75rem","--ListItem-paddingY":"0.375rem","--ListItem-paddingX":t.marker?"0.5rem":"1rem","--ListItem-gap":"0.75rem","--ListItemDecorator-size":t.orientation==="horizontal"?"2.25rem":"3rem","--Icon-fontSize":e.vars.fontSize.xl2}:{}}return[t.nesting&&R({},a(t.instanceSize),{"--ListItem-paddingRight":"var(--ListItem-paddingX)","--ListItem-paddingLeft":"var(--NestedListItem-paddingLeft)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px",padding:0},t.marker&&{paddingInlineStart:"calc(3ch - var(--_List-markerDeduct, 0px))"},{marginInlineStart:"var(--NestedList-marginLeft)",marginInlineEnd:"var(--NestedList-marginRight)",marginBlockStart:"var(--List-gap)",marginBlockEnd:"initial"}),!t.nesting&&R({},a(t.size),{"--List-gap":"0px","--List-nestedInsetStart":"0px","--ListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItem-paddingRight":"var(--ListItem-paddingX)"},t.marker&&{"--_List-markerDeduct":"1ch"},{"--unstable_List-childRadius":"calc(max(var(--List-radius) - var(--List-padding), min(var(--List-padding) / 2, var(--List-radius) / 2)) - var(--variant-borderWidth, 0px))","--ListItem-radius":"var(--unstable_List-childRadius)","--ListItem-startActionTranslateX":"calc(0.5 * var(--ListItem-paddingLeft))","--ListItem-endActionTranslateX":"calc(-0.5 * var(--ListItem-paddingRight))",margin:"initial"},e.typography[`body-${t.size}`],t.orientation==="horizontal"?R({},t.wrap?{padding:"var(--List-padding)",marginInlineStart:"calc(-1 * var(--List-gap))",marginBlockStart:"calc(-1 * var(--List-gap))"}:{paddingInline:"var(--List-padding, var(--ListDivider-gap))",paddingBlock:"var(--List-padding)"}):{paddingBlock:"var(--List-padding, var(--ListDivider-gap))",paddingInline:"var(--List-padding)"},t.marker&&{paddingInlineStart:"3ch"}),R({boxSizing:"border-box",borderRadius:"var(--List-radius)",listStyle:"none",display:"flex",flexDirection:t.orientation==="horizontal"?"row":"column"},t.wrap&&{flexWrap:"wrap"},t.marker&&{"--_List-markerDisplay":"list-item","--_List-markerType":t.marker,lineHeight:"calc(var(--ListItem-minHeight) - 2 * var(--ListItem-paddingY))"},{flexGrow:1,position:"relative"},(n=e.variants[t.variant])==null?void 0:n[t.color],{"--unstable_List-borderWidth":"var(--variant-borderWidth, 0px)"},o!==void 0&&{"--List-radius":o},r!==void 0&&{"--List-padding":r},i!==void 0&&{"--List-padding":i})]}),cT=Ce(yc,{name:"JoyList",slot:"Root",overridesResolver:(e,t)=>t.root})({}),uT=K.forwardRef(function(t,n){var r;const i=K.useContext(Ua),o=K.useContext(Yh),a=K.useContext(aT),l=mt({props:t,name:"JoyList"}),{component:c,className:u,children:f,size:d,orientation:p="vertical",wrap:g=!1,variant:v="plain",color:m="neutral",role:b,slots:C={},slotProps:S={}}=l,x=De(l,sT),I=d||((r=t.size)!=null?r:"md");let w;o&&(w="group"),a&&(w="presentation"),b&&(w=b);const A=R({},l,{instanceSize:t.size,size:I,nesting:i,orientation:p,wrap:g,variant:v,color:m,role:w}),E=lT(A),k=R({},x,{component:c,slots:C,slotProps:S}),[$,G]=Ee("root",{ref:n,className:zn(E.root,u),elementType:cT,externalForwardedProps:k,ownerState:A,additionalProps:{as:c,role:w,"aria-labelledby":typeof i=="string"?i:void 0}});return s.jsx($,R({},G,{children:s.jsx(Gh.Provider,{value:`${typeof c=="string"?c:""}:${w||""}`,children:s.jsx(vc,{row:p==="horizontal",wrap:g,children:f})})}))}),dT=["component","color","children","disableDivider","variant","transition","size","slots","slotProps"],fT=e=>{const{variant:t,color:n,size:r}=e,i={root:["root",t&&`variant${Se(t)}`,n&&`color${Se(n)}`,r&&`size${Se(r)}`]};return gt(i,rT,{})},hT=Ce(yc,{name:"JoyAccordionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{let n={};return t.transition&&(typeof t.transition=="string"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition}, padding-block ${t.transition}`}),typeof t.transition=="object"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition.initial}, padding-block ${t.transition.initial}`,[`& .${Er.root}.${Er.expanded}`]:{"--AccordionDetails-transition":`grid-template-rows ${t.transition.expanded}, padding-block ${t.transition.expanded}`}})),R({"--List-padding":"0px","--ListDivider-gap":"0px"},n,!t.disableDivider&&{[`& .${j1.root}:not([data-last-child])`]:{"--Accordion-borderBottom":`1px solid ${e.vars.palette.divider}`}})}),pT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionGroup"}),{component:i="div",color:o="neutral",children:a,disableDivider:l=!1,variant:c="plain",transition:u="0.2s ease",size:f="md",slots:d={},slotProps:p={}}=r,g=De(r,dT),v=R({},g,{component:i,slots:d,slotProps:p}),m=R({},r,{component:i,color:o,disableDivider:l,variant:c,transition:u,size:f}),b=fT(m),[C,S]=Ee("root",{ref:n,className:b.root,elementType:hT,externalForwardedProps:v,ownerState:m});return s.jsx(C,R({},S,{children:s.jsx(vc,{children:a})}))}),gT=["component","children","color","variant","slots","slotProps"],mT=e=>{const{expanded:t}=e;return gt({root:["root",t&&"expanded"],content:["content",t&&"expanded"]},X1,{})},vT=Ce("div",{name:"JoyAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n;return R({overflow:"hidden",borderRadius:"var(--AccordionDetails-radius)",display:"grid",gridTemplateRows:"1fr",marginInline:"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",transition:"var(--AccordionDetails-transition)"},(n=t.variants[e.variant])==null?void 0:n[e.color],{[`&:not(.${Er.expanded})`]:{gridTemplateRows:"0fr"}})}),bT=Ce("div",{name:"JoyAccordionDetails",slot:"Content",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",overflow:"hidden",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",paddingBlockStart:"calc(var(--ListItem-paddingY) / 2)",paddingBlockEnd:"calc(2.5 * var(--ListItem-paddingY))",transition:"var(--AccordionDetails-transition)",[`&:not(.${Er.expanded})`]:{paddingBlock:0}}),yT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionDetails"}),{component:i="div",children:o,color:a="neutral",variant:l="plain",slots:c={},slotProps:u={}}=r,f=De(r,gT),{accordionId:d,expanded:p=!1}=K.useContext(pc),g=K.useRef(null),v=gn(g,n);K.useEffect(()=>{g.current&&g.current.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])').forEach(E=>{if(p){const k=E.getAttribute("data-prev-tabindex"),$=E.getAttribute("tabindex");$&&k&&(E.setAttribute("tabindex",k),E.removeAttribute("data-prev-tabindex")),!k&&!$&&E.removeAttribute("tabindex")}else E.setAttribute("data-prev-tabindex",E.getAttribute("tabindex")||""),E.setAttribute("tabindex","-1")})},[p]);const m=R({},f,{component:i,slots:c,slotProps:u}),b=R({},r,{component:i,color:a,variant:l,expanded:p,nesting:!0}),C=mT(b),[S,x]=Ee("root",{ref:v,className:C.root,elementType:vT,externalForwardedProps:m,additionalProps:{id:`${d}-details`,"aria-labelledby":`${d}-summary`,role:"region",hidden:p?void 0:!0},ownerState:b}),[I,w]=Ee("content",{className:C.content,elementType:bT,externalForwardedProps:m,ownerState:b});return s.jsx(S,R({},x,{children:s.jsx(I,R({},w,{children:o}))}))});function xT(e){return ut("MuiAccordionSummary",e)}const Va=qe("MuiAccordionSummary",["root","button","indicator","disabled","expanded"]),Ha=qe("MuiListItemButton",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","variantPlain","variantSoft","variantOutlined","variantSolid"]),CT=K.createContext("horizontal"),xc=Ce("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,l;return R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",font:"inherit",display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:"var(--ListItem-gap)"},t.orientation==="vertical"&&{flexDirection:"column",justifyContent:"center"},{textAlign:"initial",textDecoration:"initial",backgroundColor:"initial",cursor:"pointer",marginInline:"var(--ListItemButton-marginInline)",marginBlock:"var(--ListItemButton-marginBlock)"},t["data-first-child"]===void 0&&{marginInlineStart:t.row?"var(--List-gap)":void 0,marginBlockStart:t.row?void 0:"var(--List-gap)"},{paddingBlock:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px))",paddingInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItem-startActionWidth, var(--unstable_startActionWidth, 0px)))",paddingInlineEnd:"calc(var(--ListItem-paddingRight) + var(--ListItem-endActionWidth, var(--unstable_endActionWidth, 0px)))",minBlockSize:"var(--ListItem-minHeight)",border:"1px solid transparent",borderRadius:"var(--ListItem-radius)",flex:"var(--unstable_ListItem-flex, none)",fontSize:"inherit",lineHeight:"inherit",minInlineSize:0,[e.focus.selector]:R({},e.focus.default,{zIndex:1})},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:active":(r=e.variants[`${t.variant}Active`])==null?void 0:r[t.color],[`.${Hh.root} > &`]:{"--unstable_ListItem-flex":"1 0 0%"},[`&.${Ha.selected}`]:R({},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],{"--Icon-color":"currentColor"}),[`&:not(.${Ha.selected}, [aria-selected="true"])`]:{"&:hover":(o=e.variants[`${t.variant}Hover`])==null?void 0:o[t.color],"&:active":(a=e.variants[`${t.variant}Active`])==null?void 0:a[t.color]},[`&.${Ha.disabled}`]:R({},(l=e.variants[`${t.variant}Disabled`])==null?void 0:l[t.color])})});Ce(xc,{name:"JoyListItemButton",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>R({},!e.row&&{[`&.${Ha.selected}`]:{fontWeight:t.vars.fontWeight.md}}));function wT(e){return ut("MuiSvgIcon",e)}qe("MuiSvgIcon",["root","colorInherit","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","fontSizeInherit","fontSizeXs","fontSizeSm","fontSizeMd","fontSizeLg","fontSizeXl","fontSizeXl2","fontSizeXl3","fontSizeXl4","sizeSm","sizeMd","sizeLg"]);const ST=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox","size","slots","slotProps"],IT=e=>{const{color:t,size:n,fontSize:r}=e,i={root:["root",t&&t!=="inherit"&&`color${Se(t)}`,n&&`size${Se(n)}`,r&&`fontSize${Se(r)}`]};return gt(i,wT,{})},Qh={sm:"xl",md:"xl2",lg:"xl3"},AT=Ce("svg",{name:"JoySvgIcon",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return R({},t.instanceSize&&{"--Icon-fontSize":e.vars.fontSize[Qh[t.instanceSize]]},t.instanceFontSize&&t.instanceFontSize!=="inherit"&&{"--Icon-fontSize":e.vars.fontSize[t.instanceFontSize]},{userSelect:"none",margin:"var(--Icon-margin)",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,fontSize:`var(--Icon-fontSize, ${e.vars.fontSize[Qh[t.size]]||"unset"})`},t.fontSize&&t.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${e.fontSize[t.fontSize]})`},!t.htmlColor&&R({color:`var(--Icon-color, ${e.vars.palette.text.icon})`},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&e.vars.palette[t.color]&&{color:`rgba(${(n=e.vars.palette[t.color])==null?void 0:n.mainChannel} / 1)`}))}),Jh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoySvgIcon"}),{children:i,className:o,color:a,component:l="svg",fontSize:c,htmlColor:u,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24",size:g="md",slots:v={},slotProps:m={}}=r,b=De(r,ST),C=K.isValidElement(i)&&i.type==="svg",S=R({},r,{color:a,component:l,size:g,instanceSize:t.size,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:C}),x=IT(S),I=R({},b,{component:l,slots:v,slotProps:m}),[w,A]=Ee("root",{ref:n,className:zn(x.root,o),elementType:AT,externalForwardedProps:I,ownerState:S,additionalProps:R({color:u,focusable:!1},d&&{role:"img"},!d&&{"aria-hidden":!0},!f&&{viewBox:p},C&&i.props)});return s.jsxs(w,R({},A,{children:[C?i.props.children:i,d?s.jsx("title",{children:d}):null]}))});function Cc(e,t){function n(r,i){return s.jsx(Jh,R({"data-testid":`${t}Icon`,ref:i},r,{children:e}))}return n.muiName=Jh.muiName,K.memo(K.forwardRef(n))}const TT=Cc(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");var Xh;const ET=["component","color","children","indicator","variant","slots","slotProps"],kT=e=>{const{disabled:t,expanded:n}=e;return gt({root:["root",t&&"disabled",n&&"expanded"],button:["button",t&&"disabled",n&&"expanded"],indicator:["indicator",t&&"disabled",n&&"expanded"]},xT,{})},_T=Ce(mc,{name:"JoyAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({fontWeight:e.vars.fontWeight.md,gap:"calc(var(--ListItem-paddingX, 0.75rem) + 0.25rem)",[`&.${Va.expanded}`]:{"--Icon-color":"currentColor"}})),PT=Ce(xc,{name:"JoyAccordionSummary",slot:"Button",overridesResolver:(e,t)=>t.button})({gap:"inherit",fontWeight:"inherit",justifyContent:"space-between",font:"inherit","&:focus-visible":{zIndex:1},[`.${Va.root} &`]:{"--unstable_ListItem-flex":"1 0 0%"}}),DT=Ce("span",{name:"JoyAccordionSummary",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})({display:"inline-flex",[`&.${Va.expanded}`]:{transform:"rotate(180deg)"}}),OT=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyAccordionSummary"}),{component:i="div",color:o="neutral",children:a,indicator:l=Xh||(Xh=s.jsx(TT,{})),variant:c="plain",slots:u={},slotProps:f={}}=r,d=De(r,ET),{accordionId:p,disabled:g=!1,expanded:v=!1,toggle:m}=K.useContext(pc),b=R({},d,{component:i,slots:u,slotProps:f}),C=R({},r,{component:i,color:o,disabled:g,expanded:v,variant:c}),S=G=>{if(m&&m(G),typeof f.button=="function"){var O,T;(O=f.button(C))==null||(T=O.onClick)==null||T.call(O,G)}else{var F,H;(F=f.button)==null||(H=F.onClick)==null||H.call(F,G)}},x=kT(C),[I,w]=Ee("root",{ref:n,className:x.root,elementType:_T,externalForwardedProps:b,ownerState:C}),[A,E]=Ee("button",{ref:n,className:x.button,elementType:PT,externalForwardedProps:b,additionalProps:{component:"button",id:`${p}-summary`,"aria-expanded":v?"true":"false","aria-controls":`${p}-details`,disabled:g,type:"button",onClick:S},ownerState:C}),[k,$]=Ee("indicator",{ref:n,className:x.indicator,elementType:DT,externalForwardedProps:b,ownerState:C});return s.jsx(I,R({},w,{children:s.jsxs(A,R({},E,{children:[a,l&&s.jsx(k,R({},$,{children:l}))]}))}))}),RT=({label:e,disabled:t,children:n})=>(t=t||!1,s.jsx(pT,{variant:"outlined",transition:"0.2s",sx:{borderRadius:"md",overflow:"hidden",[`& .${Va.button}:hover`]:{backgroundColor:"#fff"},[`& .${Er.content}`]:{boxShadow:r=>`inset 0 1px ${r.vars.palette.divider}`,[`&.${Er.expanded}`]:{paddingBlock:"0.75rem"}},marginBottom:"8px",backgroundColor:"#fff"},children:s.jsxs(nT,{disabled:t,children:[s.jsx(OT,{children:e}),s.jsx(yT,{variant:"soft",children:n})]})})),wc={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["blockquote","code-block"],[{direction:"rtl"}],[{script:"sub"},{script:"super"}],[{color:[]},{background:[]}],[{font:[]}],["link","image","video"],["clean"]]},Sc=({label:e,property:t,value:n,defaultValue:r,placeholder:i,description:o,onChange:a})=>{const l=(c,u,f,d)=>{f!=="api"&&(d.getText().trim()===""?a(""):a(c))};return t==="description"?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i,className:"ql-container ql-toolbar"})]}):t==="mini_games_explanation"?s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i,className:"ql-container ql-toolbar"}),s.jsx(h.FormHelperText,{children:o})]}):s.jsx(h.Box,{sx:()=>({marginBottom:"16px"}),children:s.jsx(Oi,{value:n||r,defaultValue:r,onChange:l,modules:wc,placeholder:i})})},LT=e=>{const t=n=>{n.persist(),e.onChange(n.target.value)};return s.jsxs(h.Tabs,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(h.TabList,{sx:{borderRadius:0},tabFlex:"auto",children:[s.jsx(h.Tab,{children:e.labels.richText}),s.jsx(h.Tab,{children:e.labels.plainText})]}),s.jsx(h.TabPanel,{value:0,sx:{px:0},children:s.jsx(Sc,{label:"",placeholder:"",defaultValue:e.defaultValue,property:"ad_content",onChange:e.onChange})}),s.jsx(h.TabPanel,{value:1,sx:{px:0},children:s.jsx(h.Textarea,{defaultValue:e.defaultValue,minRows:"7",onChange:t,sx:{marginBottom:"16px",overflow:"auto",resize:"vertical"}})})]})},MT=({label:e,defaultValue:t,values:n,description:r,onChange:i})=>{const o=(a,l)=>{i(l||"")};return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e}),s.jsx(h.Select,{defaultValue:t,onChange:o,children:n.map((a,l)=>s.jsx(h.Option,{value:a,children:a},`basic-select-${a}-${l}`))}),r?s.jsx(h.FormHelperText,{children:r}):s.jsx(s.Fragment,{})]})},Ic=K.createContext("md");function BT(e){return ut("MuiTabs",e)}qe("MuiTabs",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const $T=["children","value","defaultValue","orientation","direction","component","onChange","selectionFollowsFocus","variant","color","size","slots","slotProps"],FT=e=>{const{orientation:t,variant:n,color:r,size:i}=e,o={root:["root",t,n&&`variant${Se(n)}`,r&&`color${Se(r)}`,i&&`size${Se(i)}`]};return gt(o,BT,{})},NT=Ce("div",{name:"JoyTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r;const i=(n=t.variants[e.variant])==null?void 0:n[e.color],{bgcolor:o,backgroundColor:a,background:l,p:c,padding:u}=bc({theme:t,ownerState:e},["bgcolor","backgroundColor","background","p","padding"]),f=ar(t,`palette.${o}`)||o||ar(t,`palette.${a}`)||a||l||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.surface;return R({},e.size==="sm"&&{"--Tabs-spacing":"0.75rem"},e.size==="md"&&{"--Tabs-spacing":"1rem"},e.size==="lg"&&{"--Tabs-spacing":"1.25rem"},{"--Tab-indicatorThickness":"2px","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--TabList-stickyBackground":f==="transparent"?"initial":f,display:"flex",flexDirection:"column"},e.orientation==="vertical"&&{flexDirection:"row"},{backgroundColor:t.vars.palette.background.surface,position:"relative"},t.typography[`body-${e.size}`],(r=t.variants[e.variant])==null?void 0:r[e.color],c!==void 0&&{"--Tabs-padding":c},u!==void 0&&{"--Tabs-padding":u})}),Zh=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabs"}),{children:i,value:o,defaultValue:a,orientation:l="horizontal",direction:c="ltr",component:u,variant:f="plain",color:d="neutral",size:p="md",slots:g={},slotProps:v={}}=r,m=De(r,$T),b=a||(o===void 0?0:void 0),{contextValue:C}=aA(R({},r,{orientation:l,defaultValue:b})),S=R({},r,{orientation:l,direction:c,variant:f,color:d,size:p}),x=FT(S),I=R({},m,{component:u,slots:g,slotProps:v}),[w,A]=Ee("root",{ref:n,elementType:NT,externalForwardedProps:I,additionalProps:{ref:n,as:u},ownerState:S,className:x.root});return s.jsx(w,R({},A,{children:s.jsx(sA,{value:C,children:s.jsx(Ic.Provider,{value:p,children:i})})}))});function zT(e){return ut("MuiTabList",e)}qe("MuiTabList",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);function jT(e){return ut("MuiTab",e)}const Ac=qe("MuiTab",["root","disabled","focusVisible","selected","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),UT=["component","children","variant","color","size","disableUnderline","underlinePlacement","tabFlex","sticky","slots","slotProps"],VT=e=>{const{orientation:t,size:n,variant:r,color:i}=e,o={root:["root",t,r&&`variant${Se(r)}`,i&&`color${Se(i)}`,n&&`size${Se(n)}`]};return gt(o,zT,{})},HT=Ce(yc,{name:"JoyTabList",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;const r=(n=e.variants[t.variant])==null?void 0:n[t.color];return R({"--List-gap":"0px","--ListDivider-gap":"0px","--ListItem-paddingX":"var(--Tabs-spacing)","--ListItem-gap":"0.375rem","--unstable_TabList-hasUnderline":t.disableUnderline?"var(--unknown,)":"initial"},iT,{flexGrow:"initial",flexDirection:t.orientation==="vertical"?"column":"row",borderRadius:"var(--List-radius, 0px)",padding:"var(--List-padding, 0px)",zIndex:1},t.sticky&&{position:"sticky",top:t.sticky==="top"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",bottom:t.sticky==="bottom"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",backgroundColor:(r==null?void 0:r.backgroundColor)||`var(--TabList-stickyBackground, ${e.vars.palette.background.body})`},!t.disableUnderline&&R({},t.underlinePlacement==="bottom"&&{"--unstable_TabList-underlineBottom":"1px",paddingBottom:1,boxShadow:`inset 0 -1px ${e.vars.palette.divider}`},t.underlinePlacement==="top"&&{"--unstable_TabList-underlineTop":"1px",paddingTop:1,boxShadow:`inset 0 1px ${e.vars.palette.divider}`},t.underlinePlacement==="right"&&{"--unstable_TabList-underlineRight":"1px",paddingRight:1,boxShadow:`inset -1px 0 ${e.vars.palette.divider}`},t.underlinePlacement==="left"&&{"--unstable_TabList-underlineLeft":"1px",paddingLeft:1,boxShadow:`inset 1px 0 ${e.vars.palette.divider}`}),t.tabFlex&&{[`& .${Ac.root}`]:{flex:t.tabFlex}})}),ep=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabList"}),i=K.useContext(Ic),{isRtl:o,orientation:a,getRootProps:l,contextValue:c}=dA({rootRef:n}),{component:u="div",children:f,variant:d="plain",color:p="neutral",size:g,disableUnderline:v=!1,underlinePlacement:m=a==="horizontal"?"bottom":"right",tabFlex:b,sticky:C,slots:S={},slotProps:x={}}=r,I=De(r,UT),w=g!=null?g:i,A=R({},r,{isRtl:o,orientation:a,variant:d,color:p,size:w,sticky:C,tabFlex:b,nesting:!1,disableUnderline:v,underlinePlacement:m}),E=VT(A),k=R({},I,{component:u,slots:S,slotProps:x}),[$,G]=Ee("root",{ref:n,elementType:HT,getSlotProps:l,externalForwardedProps:k,ownerState:A,className:E.root});return s.jsx($,R({},G,{children:s.jsx(fA,{value:c,children:s.jsx(vc,{row:a==="horizontal",nested:!0,children:f})})}))}),WT=["action","children","value","disabled","onChange","onClick","onFocus","component","orientation","variant","color","disableIndicator","indicatorPlacement","indicatorInset","slots","slotProps"],GT=e=>{const{selected:t,disabled:n,focusVisible:r,variant:i,color:o,orientation:a}=e,l={root:["root",a,n&&"disabled",r&&"focusVisible",t&&"selected",i&&`variant${Se(i)}`,o&&`color${Se(o)}`]};return gt(l,jT,{})},YT=Ce(xc,{name:"JoyTab",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e})=>[{flex:"initial",justifyContent:e.row?"center":"initial","--unstable_ListItemDecorator-alignItems":"center","--unstable_offset":"min(calc(-1 * var(--variant-borderWidth, 0px)), -1px)"},!e.disableIndicator&&{'&[aria-selected="true"]':{"--Tab-indicatorColor":"currentColor",zIndex:1},"&::after":{content:'""',display:"block",position:"absolute",margin:"auto",background:"var(--Tab-indicatorColor)",borderRadius:"var(--Tab-indicatorRadius)"}},!e.disableIndicator&&e.indicatorPlacement==="bottom"&&{paddingBottom:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",bottom:"calc(-1px - var(--unstable_TabList-underlineBottom, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="top"&&{paddingTop:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",top:"calc(-1px - var(--unstable_TabList-underlineTop, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="right"&&{paddingRight:"calc(var(--ListItem-paddingRight) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",right:"calc(-1px - var(--unstable_TabList-underlineRight, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="left"&&{paddingLeft:"calc(var(--ListItem-paddingLeft) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",left:"calc(-1px - var(--unstable_TabList-underlineLeft, 0px))"}}]),ei=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTab"}),i=K.useContext(gc),{action:o,children:a,disabled:l=!1,component:c="button",orientation:u="horizontal",variant:f="plain",color:d="neutral",disableIndicator:p=!1,indicatorPlacement:g=i?"bottom":"right",indicatorInset:v=!1,slots:m={},slotProps:b={}}=r,C=De(r,WT),S=K.useRef(null),x=gn(S,n),{active:I,focusVisible:w,setFocusVisible:A,selected:E,getRootProps:k}=pA(R({},r,{rootRef:x}));K.useImperativeHandle(o,()=>({focusVisible:()=>{A(!0),S.current.focus()}}),[A]);const $=R({},r,{disableIndicator:p,indicatorPlacement:g,indicatorInset:v,orientation:u,row:i,active:I,focusVisible:w,disabled:l,selected:E,variant:f,color:d}),G=GT($),O=R({},C,{component:c,slots:m,slotProps:b}),[T,F]=Ee("root",{ref:n,elementType:YT,getSlotProps:k,externalForwardedProps:O,ownerState:$,className:G.root});return s.jsx(CT.Provider,{value:u,children:s.jsx(T,R({},F,{children:a}))})});function Hn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function tp(e){if(K.isValidElement(e)||oh.isValidElementType(e)||!Hn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=tp(e[n])}),t}function Qt(e,t,n={clone:!0}){const r=n.clone?L({},e):e;return Hn(e)&&Hn(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])||oh.isValidElementType(t[i])?r[i]=t[i]:Hn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Hn(e[i])?r[i]=Qt(e[i],t[i],n):n.clone?r[i]=Hn(t[i])?tp(t[i]):t[i]:r[i]=t[i]}),r}function kr(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function ti(e){if(typeof e!="string")throw new Error(kr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Tc(e,t){const n=L({},t);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=r;if(i==="components"||i==="slots")n[i]=L(L({},e[i]),n[i]);else if(i==="componentsProps"||i==="slotProps"){const o=e[i],a=t[i];if(!a)n[i]=o||{};else if(!o)n[i]=a;else{n[i]=L({},a);for(const l in o)if(Object.prototype.hasOwnProperty.call(o,l)){const c=l;n[i][c]=Tc(o[c],a[c])}}}else n[i]===void 0&&(n[i]=e[i])}return n}function KT(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let a="",l=!0;for(let c=0;c<o.length;c+=1){const u=o[c];u&&(a+=(l===!0?"":" ")+t(u),l=!1,n&&n[u]&&(a+=" "+n[u]))}r[i]=a}return r}const np=e=>e,qT=(()=>{let e=np;return{configure(t){e=t},generate(t){return e(t)},reset(){e=np}}})(),QT={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function rp(e,t,n="Mui"){const r=QT[t];return r?`${n}-${r}`:`${qT.generate(e)}-${t}`}function JT(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=rp(e,i,n)}),r}function XT(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function co(e,t){return t?Qt(e,t,{clone:!1}):e}function ZT(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var a,l;const o=/min-width:\s*([0-9.]+)/;return+(((a=r.match(o))==null?void 0:a[1])||0)-+(((l=i.match(o))==null?void 0:l[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},L({},t)):t}function eE(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function tE(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function nE(e){const t=(o,a)=>o.replace("@media",a?`@container ${a}`:"@container");function n(o,a){o.up=(...l)=>t(e.breakpoints.up(...l),a),o.down=(...l)=>t(e.breakpoints.down(...l),a),o.between=(...l)=>t(e.breakpoints.between(...l),a),o.only=(...l)=>t(e.breakpoints.only(...l),a),o.not=(...l)=>{const c=t(e.breakpoints.not(...l),a);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},i=o=>(n(r,o),r);return n(i),Q(L({},e),{containerQueries:i})}const Wa={xs:0,sm:600,md:900,lg:1200,xl:1536},ip={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Wa[e]}px)`},rE={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Wa[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Wn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||ip;return t.reduce((a,l,c)=>(a[o.up(o.keys[c])]=n(t[c]),a),{})}if(typeof t=="object"){const o=r.breakpoints||ip;return Object.keys(t).reduce((a,l)=>{if(eE(o.keys,l)){const c=tE(r.containerQueries?r:rE,l);c&&(a[c]=n(t[l],l))}else if(Object.keys(o.values||Wa).includes(l)){const c=o.up(l);a[c]=n(t[l],l)}else{const c=l;a[c]=t[c]}return a},{})}return n(t)}function iE(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function oE(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Ga(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Ya(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Ga(e,n)||r,t&&(i=t(i,r,e)),i}function dt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const l=a[t],c=a.theme,u=Ga(c,r)||{};return Wn(a,l,d=>{let p=Ya(u,i,d);return d===p&&typeof d=="string"&&(p=Ya(u,i,`${t}${d==="default"?"":ti(d)}`,d)),n===!1?p:{[n]:p}})};return o.propTypes={},o.filterProps=[t],o}function aE(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const sE={m:"margin",p:"padding"},lE={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},op={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},cE=aE(e=>{if(e.length>2)if(op[e])e=op[e];else return[e];const[t,n]=e.split(""),r=sE[t],i=lE[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Ec=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],kc=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Ec,...kc];function uo(e,t,n,r){var o;const i=(o=Ga(e,t,!0))!=null?o:n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const l=Math.abs(a),c=i[l];return a>=0?c:typeof c=="number"?-c:`-${c}`}:typeof i=="function"?i:()=>{}}function _c(e){return uo(e,"spacing",8)}function fo(e,t){return typeof t=="string"||t==null?t:e(t)}function uE(e,t){return n=>e.reduce((r,i)=>(r[i]=fo(t,n),r),{})}function dE(e,t,n,r){if(!t.includes(n))return null;const i=cE(n),o=uE(i,r),a=e[n];return Wn(e,a,o)}function ap(e,t){const n=_c(e.theme);return Object.keys(e).map(r=>dE(e,t,r,n)).reduce(co,{})}function at(e){return ap(e,Ec)}at.propTypes={},at.filterProps=Ec;function st(e){return ap(e,kc)}st.propTypes={},st.filterProps=kc;function Ka(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?co(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function cn(e){return typeof e!="number"?e:`${e}px solid`}function un(e,t){return dt({prop:e,themeKey:"borders",transform:t})}const fE=un("border",cn),hE=un("borderTop",cn),pE=un("borderRight",cn),gE=un("borderBottom",cn),mE=un("borderLeft",cn),vE=un("borderColor"),bE=un("borderTopColor"),yE=un("borderRightColor"),xE=un("borderBottomColor"),CE=un("borderLeftColor"),wE=un("outline",cn),SE=un("outlineColor"),qa=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=uo(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:fo(t,r)});return Wn(e,e.borderRadius,n)}return null};qa.propTypes={},qa.filterProps=["borderRadius"],Ka(fE,hE,pE,gE,mE,vE,bE,yE,xE,CE,qa,wE,SE);const Qa=e=>{if(e.gap!==void 0&&e.gap!==null){const t=uo(e.theme,"spacing",8),n=r=>({gap:fo(t,r)});return Wn(e,e.gap,n)}return null};Qa.propTypes={},Qa.filterProps=["gap"];const Ja=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=uo(e.theme,"spacing",8),n=r=>({columnGap:fo(t,r)});return Wn(e,e.columnGap,n)}return null};Ja.propTypes={},Ja.filterProps=["columnGap"];const Xa=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=uo(e.theme,"spacing",8),n=r=>({rowGap:fo(t,r)});return Wn(e,e.rowGap,n)}return null};Xa.propTypes={},Xa.filterProps=["rowGap"];const IE=dt({prop:"gridColumn"}),AE=dt({prop:"gridRow"}),TE=dt({prop:"gridAutoFlow"}),EE=dt({prop:"gridAutoColumns"}),kE=dt({prop:"gridAutoRows"}),_E=dt({prop:"gridTemplateColumns"}),PE=dt({prop:"gridTemplateRows"}),DE=dt({prop:"gridTemplateAreas"}),OE=dt({prop:"gridArea"});Ka(Qa,Ja,Xa,IE,AE,TE,EE,kE,_E,PE,DE,OE);function ni(e,t){return t==="grey"?t:e}const RE=dt({prop:"color",themeKey:"palette",transform:ni}),LE=dt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ni}),ME=dt({prop:"backgroundColor",themeKey:"palette",transform:ni});Ka(RE,LE,ME);function Jt(e){return e<=1&&e!==0?`${e*100}%`:e}const BE=dt({prop:"width",transform:Jt}),Pc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,a,l,c;const r=((a=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:a[n])||Wa[n];return r?((c=(l=e.theme)==null?void 0:l.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jt(n)}};return Wn(e,e.maxWidth,t)}return null};Pc.filterProps=["maxWidth"];const $E=dt({prop:"minWidth",transform:Jt}),FE=dt({prop:"height",transform:Jt}),NE=dt({prop:"maxHeight",transform:Jt}),zE=dt({prop:"minHeight",transform:Jt});dt({prop:"size",cssProperty:"width",transform:Jt}),dt({prop:"size",cssProperty:"height",transform:Jt});const jE=dt({prop:"boxSizing"});Ka(BE,Pc,$E,FE,NE,zE,jE);const Za={border:{themeKey:"borders",transform:cn},borderTop:{themeKey:"borders",transform:cn},borderRight:{themeKey:"borders",transform:cn},borderBottom:{themeKey:"borders",transform:cn},borderLeft:{themeKey:"borders",transform:cn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:cn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:qa},color:{themeKey:"palette",transform:ni},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ni},backgroundColor:{themeKey:"palette",transform:ni},p:{style:st},pt:{style:st},pr:{style:st},pb:{style:st},pl:{style:st},px:{style:st},py:{style:st},padding:{style:st},paddingTop:{style:st},paddingRight:{style:st},paddingBottom:{style:st},paddingLeft:{style:st},paddingX:{style:st},paddingY:{style:st},paddingInline:{style:st},paddingInlineStart:{style:st},paddingInlineEnd:{style:st},paddingBlock:{style:st},paddingBlockStart:{style:st},paddingBlockEnd:{style:st},m:{style:at},mt:{style:at},mr:{style:at},mb:{style:at},ml:{style:at},mx:{style:at},my:{style:at},margin:{style:at},marginTop:{style:at},marginRight:{style:at},marginBottom:{style:at},marginLeft:{style:at},marginX:{style:at},marginY:{style:at},marginInline:{style:at},marginInlineStart:{style:at},marginInlineEnd:{style:at},marginBlock:{style:at},marginBlockStart:{style:at},marginBlockEnd:{style:at},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Qa},rowGap:{style:Xa},columnGap:{style:Ja},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jt},maxWidth:{style:Pc},minWidth:{transform:Jt},height:{transform:Jt},maxHeight:{transform:Jt},minHeight:{transform:Jt},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function UE(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function VE(e,t){return typeof e=="function"?e(t):e}function HE(){function e(n,r,i,o){const a={[n]:r,theme:i},l=o[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:f,style:d}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const p=Ga(i,u)||{};return d?d(a):Wn(a,r,v=>{let m=Ya(p,f,v);return v===m&&typeof v=="string"&&(m=Ya(p,f,`${n}${v==="default"?"":ti(v)}`,v)),c===!1?m:{[c]:m}})}function t(n){var l;const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=(l=i.unstable_sxConfig)!=null?l:Za;function a(c){let u=c;if(typeof c=="function")u=c(i);else if(typeof c!="object")return c;if(!u)return null;const f=iE(i.breakpoints),d=Object.keys(f);let p=f;return Object.keys(u).forEach(g=>{const v=VE(u[g],i);if(v!=null)if(typeof v=="object")if(o[g])p=co(p,e(g,v,i,o));else{const m=Wn({theme:i},v,b=>({[g]:b}));UE(m,v)?p[g]=t({sx:v,theme:i}):p=co(p,m)}else p=co(p,e(g,v,i,o))}),ZT(i,oE(d,p))}return Array.isArray(r)?r.map(a):a(r)}return t}const ri=HE();ri.filterProps=["sx"];function WE(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var GE={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},YE=!1,KE=/[A-Z]|^ms/g,qE=/_EMO_([^_]+?)_([^]*?)_EMO_/g,sp=function(t){return t.charCodeAt(1)===45},lp=function(t){return t!=null&&typeof t!="boolean"},Dc=gA(function(e){return sp(e)?e:e.replace(KE,"-$&").toLowerCase()}),cp=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(qE,function(r,i,o){return sr={name:i,styles:o,next:sr},i})}return GE[t]!==1&&!sp(t)&&typeof n=="number"&&n!==0?n+"px":n},QE="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function es(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return sr={name:i.name,styles:i.styles,next:sr},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)sr={name:a.name,styles:a.styles,next:sr},a=a.next;var l=o.styles+";";return l}return JE(e,t,n)}}var c=n;return c}function JE(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=es(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var l=a;lp(l)&&(r+=Dc(o)+":"+cp(o,l)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&YE)throw new Error(QE);if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var c=0;c<a.length;c++)lp(a[c])&&(r+=Dc(o)+":"+cp(o,a[c])+";");else{var u=es(e,t,a);switch(o){case"animation":case"animationName":{r+=Dc(o)+":"+u+";";break}default:r+=o+"{"+u+"}"}}}}return r}var up=/label:\s*([^\s;{]+)\s*(;|$)/g,sr;function XE(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";sr=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=es(n,t,o);else{var a=o;i+=a[0]}for(var l=1;l<e.length;l++)if(i+=es(n,t,e[l]),r){var c=o;i+=c[l]}up.lastIndex=0;for(var u="",f;(f=up.exec(i))!==null;)u+="-"+f[1];var d=WE(i)+u;return{name:d,styles:i,next:sr}}/**
2334
2334
  * @mui/styled-engine v6.4.0
2335
2335
  *
2336
2336
  * @license MIT
2337
2337
  * This source code is licensed under the MIT license found in the
2338
2338
  * LICENSE file in the root directory of this source tree.
2339
- */function ZE(e,t){return Di(e,t)}function ek(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const dp=[];function fp(e){return dp[0]=e,XE(dp)}const tk=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>Q(M({},n),{[r.key]:r.val}),{})};function nk(e){const p=e,{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=p,i=Ze(p,["values","unit","step"]),o=tk(t),a=Object.keys(o);function l(g){return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n})`}function c(g){return`@media (max-width:${(typeof t[g]=="number"?t[g]:g)-r/100}${n})`}function u(g,v){const m=a.indexOf(v);return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n}) and (max-width:${(m!==-1&&typeof t[a[m]]=="number"?t[a[m]]:v)-r/100}${n})`}function f(g){return a.indexOf(g)+1<a.length?u(g,a[a.indexOf(g)+1]):l(g)}function d(g){const v=a.indexOf(g);return v===0?l(a[1]):v===a.length-1?c(a[v]):u(g,a[a.indexOf(g)+1]).replace("@media","@media not all and")}return M({keys:a,values:o,up:l,down:c,between:u,only:f,not:d,unit:n},i)}const rk={borderRadius:4};function hp(e=8,t=_c({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function ik(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function pp(e={},...t){const f=e,{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=f,a=Ze(f,["breakpoints","palette","spacing","shape"]),l=nk(n),c=hp(i);let u=Qt({breakpoints:l,direction:"ltr",components:{},palette:M({mode:"light"},r),spacing:c,shape:M(M({},rk),o)},a);return u=nE(u),u.applyStyles=ik,u=t.reduce((d,p)=>Qt(d,p),u),u.unstable_sxConfig=M(M({},Za),a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(p){return ri({sx:p,theme:this})},u}function gp(e){const i=e,{variants:t}=i,n=Ze(i,["variants"]),r={variants:t,style:fp(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=fp(o.style))}),r}const ok=pp();function Oc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ak(e){return e?(t,n)=>n[e]:null}function sk(e,t,n){e.theme=uk(e.theme)?n:e.theme[t]||e.theme}function ts(e,t){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(i=>ts(e,i));if(Array.isArray(n==null?void 0:n.variants)){let i;if(n.isProcessed)i=n.style;else{const r=n,{variants:o}=r;i=Ze(r,["variants"])}return mp(e,n.variants,[i])}return n!=null&&n.isProcessed?n.style:n}function mp(e,t,n=[]){var i;let r;e:for(let o=0;o<t.length;o+=1){const a=t[o];if(typeof a.props=="function"){if(r!=null||(r=Q(M(M({},e),e.ownerState),{ownerState:e.ownerState})),!a.props(r))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((i=e.ownerState)==null?void 0:i[l])!==a.props[l])continue e;typeof a.style=="function"?(r!=null||(r=Q(M(M({},e),e.ownerState),{ownerState:e.ownerState})),n.push(a.style(r))):n.push(a.style)}return n}function lk(e={}){const{themeId:t,defaultTheme:n=ok,rootShouldForwardProp:r=Oc,slotShouldForwardProp:i=Oc}=e;function o(l){sk(l,t,n)}return(l,c={})=>{ek(l,A=>A.filter(E=>E!==ri));const w=c,{name:u,slot:f,skipVariantsResolver:d,skipSx:p,overridesResolver:g=ak(fk(f))}=w,v=Ze(w,["name","slot","skipVariantsResolver","skipSx","overridesResolver"]),m=d!==void 0?d:f&&f!=="Root"&&f!=="root"||!1,b=p||!1;let C=Oc;f==="Root"||f==="root"?C=r:f?C=i:dk(l)&&(C=void 0);const S=ZE(l,M({shouldForwardProp:C,label:ck()},v)),x=A=>{if(typeof A=="function"&&A.__emotion_real!==A)return function(k){return ts(k,A)};if(Hn(A)){const E=gp(A);return E.variants?function($){return ts($,E)}:E.style}return A},I=(...A)=>{const E=[],k=A.map(x),$=[];if(E.push(o),u&&g&&$.push(function(F){var L,V;const j=(V=(L=F.theme.components)==null?void 0:L[u])==null?void 0:V.styleOverrides;if(!j)return null;const N={};for(const Y in j)N[Y]=ts(F,j[Y]);return g(F,N)}),u&&!m&&$.push(function(F){var N,L;const H=F.theme,j=(L=(N=H==null?void 0:H.components)==null?void 0:N[u])==null?void 0:L.variants;return j?mp(F,j):null}),b||$.push(ri),Array.isArray(k[0])){const T=k.shift(),F=new Array(E.length).fill(""),H=new Array($.length).fill("");let j;j=[...F,...T,...H],j.raw=[...F,...T.raw,...H],E.unshift(j)}const G=[...E,...k,...$],O=S(...G);return l.muiName&&(O.muiName=l.muiName),O};return S.withConfig&&(I.withConfig=S.withConfig),I}}function ck(e,t){return void 0}function uk(e){for(const t in e)return!1;return!0}function dk(e){return typeof e=="string"&&e.charCodeAt(0)>96}function fk(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Rc(e,t=0,n=1){return XT(e,t,n)}function hk(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function lr(e){if(e.type)return e;if(e.charAt(0)==="#")return lr(hk(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(kr(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(kr(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const pk=e=>{const t=lr(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ho=(e,t)=>{try{return pk(e)}catch(n){return e}};function ns(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function vp(e){e=lr(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=(u,f=(u+n/30)%12)=>i-o*Math.max(Math.min(f-3,9-f,1),-1);let l="rgb";const c=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(l+="a",c.push(t[3])),ns({type:l,values:c})}function Lc(e){e=lr(e);let t=e.type==="hsl"||e.type==="hsla"?lr(vp(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:Pi((n+.055)/1.055,2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function gk(e,t){const n=Lc(e),r=Lc(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function mk(e,t){return e=lr(e),t=Rc(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ns(e)}function rs(e,t,n){try{return mk(e,t)}catch(r){return e}}function Mc(e,t){if(e=lr(e),t=Rc(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ns(e)}function Ve(e,t,n){try{return Mc(e,t)}catch(r){return e}}function Bc(e,t){if(e=lr(e),t=Rc(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ns(e)}function He(e,t,n){try{return Bc(e,t)}catch(r){return e}}function vk(e,t=.15){return Lc(e)>.5?Mc(e,t):Bc(e,t)}function is(e,t,n){try{return vk(e,t)}catch(r){return e}}const bk=K.createContext(void 0);function yk(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Tc(i.defaultProps,r):!i.styleOverrides&&!i.variants?Tc(i,r):r}function xk({props:e,name:t}){const n=K.useContext(bk);return yk({props:e,name:t,theme:{components:n}})}const bp={theme:void 0};function Ck(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(bp.theme=i.theme,o=gp(e(bp)),t=o,n=i.theme),o}}function wk(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const yp=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},Sk=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([l,c])=>{(!n||n&&!n([...o,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,l],Array.isArray(c)?[...a,l]:a):t([...o,l],c,a))})}r(e)},Ik=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function $c(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return Sk(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const f=`--${n?`${n}-`:""}${l.join("-")}`,d=Ik(l,c);Object.assign(i,{[f]:d}),yp(o,l,`var(${f})`,u),yp(a,l,`var(${f}, ${d})`,u)}},l=>l[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function Ak(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i}=t,x=e,{colorSchemes:o={},components:a,defaultColorScheme:l="light"}=x,c=Ze(x,["colorSchemes","components","defaultColorScheme"]),{vars:u,css:f,varsWithDefaults:d}=$c(c,t);let p=d;const g={},I=o,{[l]:v}=I,m=Ze(I,[qs(l)]);if(Object.entries(m||{}).forEach(([w,A])=>{const{vars:E,css:k,varsWithDefaults:$}=$c(A,t);p=Qt(p,$),g[w]={css:k,vars:E}}),v){const{css:w,vars:A,varsWithDefaults:E}=$c(v,t);p=Qt(p,E),g[l]={css:w,vars:A}}function b(w,A){var k,$;let E=i;if(i==="class"&&(E=".%s"),i==="data"&&(E="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(E=`[${i}="%s"]`),w){if(E==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${(($=(k=o[w])==null?void 0:k.palette)==null?void 0:$.mode)||w})`]:{":root":A}};if(E)return e.defaultColorScheme===w?`:root, ${E.replace("%s",String(w))}`:E.replace("%s",String(w))}return":root"}return{vars:p,generateThemeVars:()=>{let w=M({},u);return Object.entries(g).forEach(([,{vars:A}])=>{w=Qt(w,A)}),w},generateStyleSheets:()=>{var O,T;const w=[],A=e.defaultColorScheme||"light";function E(F,H){Object.keys(H).length&&w.push(typeof F=="string"?{[F]:M({},H)}:F)}E(n(void 0,M({},f)),f);const G=g,{[A]:k}=G,$=Ze(G,[qs(A)]);if(k){const{css:F}=k,H=(T=(O=o[A])==null?void 0:O.palette)==null?void 0:T.mode,j=M(!r&&H?{colorScheme:H}:{},F);E(n(A,M({},j)),j)}return Object.entries($).forEach(([F,{css:H}])=>{var L,V;const j=(V=(L=o[F])==null?void 0:L.palette)==null?void 0:V.mode,N=M(!r&&j?{colorScheme:j}:{},H);E(n(F,M({},N)),N)}),w}}}function Tk(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const po={black:"#000",white:"#fff"},Ek={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},ii={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},oi={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},go={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ai={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},si={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},li={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function xp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:po.white,default:po.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const kk=xp();function Cp(){return{text:{primary:po.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:po.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const wp=Cp();function Sp(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Bc(e.main,i):t==="dark"&&(e.dark=Mc(e.main,o)))}function _k(e="light"){return e==="dark"?{main:ai[200],light:ai[50],dark:ai[400]}:{main:ai[700],light:ai[400],dark:ai[800]}}function Pk(e="light"){return e==="dark"?{main:ii[200],light:ii[50],dark:ii[400]}:{main:ii[500],light:ii[300],dark:ii[700]}}function Dk(e="light"){return e==="dark"?{main:oi[500],light:oi[300],dark:oi[700]}:{main:oi[700],light:oi[400],dark:oi[800]}}function Ok(e="light"){return e==="dark"?{main:si[400],light:si[300],dark:si[700]}:{main:si[700],light:si[500],dark:si[900]}}function Rk(e="light"){return e==="dark"?{main:li[400],light:li[300],dark:li[700]}:{main:li[800],light:li[500],dark:li[900]}}function Lk(e="light"){return e==="dark"?{main:go[400],light:go[300],dark:go[700]}:{main:"#ed6c02",light:go[500],dark:go[900]}}function Fc(e){const m=e,{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=m,i=Ze(m,["mode","contrastThreshold","tonalOffset"]),o=e.primary||_k(t),a=e.secondary||Pk(t),l=e.error||Dk(t),c=e.info||Ok(t),u=e.success||Rk(t),f=e.warning||Lk(t);function d(b){return gk(b,wp.text.primary)>=n?wp.text.primary:kk.text.primary}const p=({color:b,name:C,mainShade:S=500,lightShade:x=300,darkShade:I=700})=>{if(b=M({},b),!b.main&&b[S]&&(b.main=b[S]),!b.hasOwnProperty("main"))throw new Error(kr(11,C?` (${C})`:"",S));if(typeof b.main!="string")throw new Error(kr(12,C?` (${C})`:"",JSON.stringify(b.main)));return Sp(b,"light",x,r),Sp(b,"dark",I,r),b.contrastText||(b.contrastText=d(b.main)),b};let g;return t==="light"?g=xp():t==="dark"&&(g=Cp()),Qt(M({common:M({},po),mode:t,primary:p({color:o,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:c,name:"info"}),success:p({color:u,name:"success"}),grey:Ek,contrastThreshold:n,getContrastText:d,augmentColor:p,tonalOffset:r},g),i)}function Mk(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Bk(e,t){return M({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}function $k(e){return Math.round(e*1e5)/1e5}const Ip={textTransform:"uppercase"},Ap='"Roboto", "Helvetica", "Arial", sans-serif';function Fk(e,t){const b=typeof t=="function"?t(e):t,{fontFamily:n=Ap,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=b,d=Ze(b,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),p=r/14,g=f||(C=>`${C/c*p}rem`),v=(C,S,x,I,w)=>M(M(M({fontFamily:n,fontWeight:C,fontSize:g(S),lineHeight:x},n===Ap?{letterSpacing:`${$k(I/S)}em`}:{}),w),u),m={h1:v(i,96,1.167,-1.5),h2:v(i,60,1.2,-.5),h3:v(o,48,1.167,0),h4:v(o,34,1.235,.25),h5:v(o,24,1.334,0),h6:v(a,20,1.6,.15),subtitle1:v(o,16,1.75,.15),subtitle2:v(a,14,1.57,.1),body1:v(o,16,1.5,.15),body2:v(o,14,1.43,.15),button:v(a,14,1.75,.4,Ip),caption:v(o,12,1.66,.4),overline:v(o,12,2.66,1,Ip),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qt(M({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:a,fontWeightBold:l},m),d,{clone:!1})}const Nk=.2,zk=.14,jk=.12;function Qe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Nk})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${zk})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${jk})`].join(",")}const Uk=["none",Qe(0,2,1,-1,0,1,1,0,0,1,3,0),Qe(0,3,1,-2,0,2,2,0,0,1,5,0),Qe(0,3,3,-2,0,3,4,0,0,1,8,0),Qe(0,2,4,-1,0,4,5,0,0,1,10,0),Qe(0,3,5,-1,0,5,8,0,0,1,14,0),Qe(0,3,5,-1,0,6,10,0,0,1,18,0),Qe(0,4,5,-2,0,7,10,1,0,2,16,1),Qe(0,5,5,-3,0,8,10,1,0,3,14,2),Qe(0,5,6,-3,0,9,12,1,0,3,16,2),Qe(0,6,6,-3,0,10,14,1,0,4,18,3),Qe(0,6,7,-4,0,11,15,1,0,4,20,3),Qe(0,7,8,-4,0,12,17,2,0,5,22,4),Qe(0,7,8,-4,0,13,19,2,0,5,24,4),Qe(0,7,9,-4,0,14,21,2,0,5,26,4),Qe(0,8,9,-5,0,15,22,2,0,6,28,5),Qe(0,8,10,-5,0,16,24,2,0,6,30,5),Qe(0,8,11,-5,0,17,26,2,0,6,32,5),Qe(0,9,11,-5,0,18,28,2,0,7,34,6),Qe(0,9,12,-6,0,19,29,2,0,7,36,6),Qe(0,10,13,-6,0,20,31,3,0,8,38,7),Qe(0,10,13,-6,0,21,33,3,0,8,40,7),Qe(0,10,14,-6,0,22,35,3,0,8,42,7),Qe(0,11,14,-7,0,23,36,3,0,9,44,8),Qe(0,11,15,-7,0,24,38,3,0,9,46,8)],Vk={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Hk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Tp(e){return`${Math.round(e)}ms`}function Wk(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*Pi(t,.25)+t/5)*10),3e3)}function Gk(e){const t=M(M({},Vk),e.easing),n=M(M({},Hk),e.duration);return Q(M({getAutoHeightDuration:Wk,create:(i=["all"],o={})=>{const f=o,{duration:a=n.standard,easing:l=t.easeInOut,delay:c=0}=f,u=Ze(f,["duration","easing","delay"]);return(Array.isArray(i)?i:[i]).map(d=>`${d} ${typeof a=="string"?a:Tp(a)} ${l} ${typeof c=="string"?c:Tp(c)}`).join(",")}},e),{easing:t,duration:n})}const Yk={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Kk(e){return Hn(e)||typeof e=="undefined"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Ep(e={}){const t=M({},e);function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[a,l]=i[o];!Kk(l)||a.startsWith("unstable_")?delete r[a]:Hn(l)&&(r[a]=M({},l),n(r[a]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
2339
+ */function ZE(e,t){return Di(e,t)}function ek(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const dp=[];function fp(e){return dp[0]=e,XE(dp)}const tk=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>Q(L({},n),{[r.key]:r.val}),{})};function nk(e){const p=e,{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=p,i=Ze(p,["values","unit","step"]),o=tk(t),a=Object.keys(o);function l(g){return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n})`}function c(g){return`@media (max-width:${(typeof t[g]=="number"?t[g]:g)-r/100}${n})`}function u(g,v){const m=a.indexOf(v);return`@media (min-width:${typeof t[g]=="number"?t[g]:g}${n}) and (max-width:${(m!==-1&&typeof t[a[m]]=="number"?t[a[m]]:v)-r/100}${n})`}function f(g){return a.indexOf(g)+1<a.length?u(g,a[a.indexOf(g)+1]):l(g)}function d(g){const v=a.indexOf(g);return v===0?l(a[1]):v===a.length-1?c(a[v]):u(g,a[a.indexOf(g)+1]).replace("@media","@media not all and")}return L({keys:a,values:o,up:l,down:c,between:u,only:f,not:d,unit:n},i)}const rk={borderRadius:4};function hp(e=8,t=_c({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function ik(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function pp(e={},...t){const f=e,{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=f,a=Ze(f,["breakpoints","palette","spacing","shape"]),l=nk(n),c=hp(i);let u=Qt({breakpoints:l,direction:"ltr",components:{},palette:L({mode:"light"},r),spacing:c,shape:L(L({},rk),o)},a);return u=nE(u),u.applyStyles=ik,u=t.reduce((d,p)=>Qt(d,p),u),u.unstable_sxConfig=L(L({},Za),a==null?void 0:a.unstable_sxConfig),u.unstable_sx=function(p){return ri({sx:p,theme:this})},u}function gp(e){const i=e,{variants:t}=i,n=Ze(i,["variants"]),r={variants:t,style:fp(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=fp(o.style))}),r}const ok=pp();function Oc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ak(e){return e?(t,n)=>n[e]:null}function sk(e,t,n){e.theme=uk(e.theme)?n:e.theme[t]||e.theme}function ts(e,t){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(i=>ts(e,i));if(Array.isArray(n==null?void 0:n.variants)){let i;if(n.isProcessed)i=n.style;else{const r=n,{variants:o}=r;i=Ze(r,["variants"])}return mp(e,n.variants,[i])}return n!=null&&n.isProcessed?n.style:n}function mp(e,t,n=[]){var i;let r;e:for(let o=0;o<t.length;o+=1){const a=t[o];if(typeof a.props=="function"){if(r!=null||(r=Q(L(L({},e),e.ownerState),{ownerState:e.ownerState})),!a.props(r))continue}else for(const l in a.props)if(e[l]!==a.props[l]&&((i=e.ownerState)==null?void 0:i[l])!==a.props[l])continue e;typeof a.style=="function"?(r!=null||(r=Q(L(L({},e),e.ownerState),{ownerState:e.ownerState})),n.push(a.style(r))):n.push(a.style)}return n}function lk(e={}){const{themeId:t,defaultTheme:n=ok,rootShouldForwardProp:r=Oc,slotShouldForwardProp:i=Oc}=e;function o(l){sk(l,t,n)}return(l,c={})=>{ek(l,A=>A.filter(E=>E!==ri));const w=c,{name:u,slot:f,skipVariantsResolver:d,skipSx:p,overridesResolver:g=ak(fk(f))}=w,v=Ze(w,["name","slot","skipVariantsResolver","skipSx","overridesResolver"]),m=d!==void 0?d:f&&f!=="Root"&&f!=="root"||!1,b=p||!1;let C=Oc;f==="Root"||f==="root"?C=r:f?C=i:dk(l)&&(C=void 0);const S=ZE(l,L({shouldForwardProp:C,label:ck()},v)),x=A=>{if(typeof A=="function"&&A.__emotion_real!==A)return function(k){return ts(k,A)};if(Hn(A)){const E=gp(A);return E.variants?function($){return ts($,E)}:E.style}return A},I=(...A)=>{const E=[],k=A.map(x),$=[];if(E.push(o),u&&g&&$.push(function(F){var M,V;const j=(V=(M=F.theme.components)==null?void 0:M[u])==null?void 0:V.styleOverrides;if(!j)return null;const N={};for(const Y in j)N[Y]=ts(F,j[Y]);return g(F,N)}),u&&!m&&$.push(function(F){var N,M;const H=F.theme,j=(M=(N=H==null?void 0:H.components)==null?void 0:N[u])==null?void 0:M.variants;return j?mp(F,j):null}),b||$.push(ri),Array.isArray(k[0])){const T=k.shift(),F=new Array(E.length).fill(""),H=new Array($.length).fill("");let j;j=[...F,...T,...H],j.raw=[...F,...T.raw,...H],E.unshift(j)}const G=[...E,...k,...$],O=S(...G);return l.muiName&&(O.muiName=l.muiName),O};return S.withConfig&&(I.withConfig=S.withConfig),I}}function ck(e,t){return void 0}function uk(e){for(const t in e)return!1;return!0}function dk(e){return typeof e=="string"&&e.charCodeAt(0)>96}function fk(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Rc(e,t=0,n=1){return XT(e,t,n)}function hk(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function lr(e){if(e.type)return e;if(e.charAt(0)==="#")return lr(hk(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(kr(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(kr(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const pk=e=>{const t=lr(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},ho=(e,t)=>{try{return pk(e)}catch(n){return e}};function ns(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function vp(e){e=lr(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=(u,f=(u+n/30)%12)=>i-o*Math.max(Math.min(f-3,9-f,1),-1);let l="rgb";const c=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(l+="a",c.push(t[3])),ns({type:l,values:c})}function Lc(e){e=lr(e);let t=e.type==="hsl"||e.type==="hsla"?lr(vp(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:Pi((n+.055)/1.055,2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function gk(e,t){const n=Lc(e),r=Lc(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function mk(e,t){return e=lr(e),t=Rc(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,ns(e)}function rs(e,t,n){try{return mk(e,t)}catch(r){return e}}function Mc(e,t){if(e=lr(e),t=Rc(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return ns(e)}function Ve(e,t,n){try{return Mc(e,t)}catch(r){return e}}function Bc(e,t){if(e=lr(e),t=Rc(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return ns(e)}function He(e,t,n){try{return Bc(e,t)}catch(r){return e}}function vk(e,t=.15){return Lc(e)>.5?Mc(e,t):Bc(e,t)}function is(e,t,n){try{return vk(e,t)}catch(r){return e}}const bk=K.createContext(void 0);function yk(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Tc(i.defaultProps,r):!i.styleOverrides&&!i.variants?Tc(i,r):r}function xk({props:e,name:t}){const n=K.useContext(bk);return yk({props:e,name:t,theme:{components:n}})}const bp={theme:void 0};function Ck(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(bp.theme=i.theme,o=gp(e(bp)),t=o,n=i.theme),o}}function wk(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const yp=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},Sk=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([l,c])=>{(!n||n&&!n([...o,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...o,l],Array.isArray(c)?[...a,l]:a):t([...o,l],c,a))})}r(e)},Ik=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function $c(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return Sk(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const f=`--${n?`${n}-`:""}${l.join("-")}`,d=Ik(l,c);Object.assign(i,{[f]:d}),yp(o,l,`var(${f})`,u),yp(a,l,`var(${f}, ${d})`,u)}},l=>l[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function Ak(e,t={}){const{getSelector:n=b,disableCssColorScheme:r,colorSchemeSelector:i}=t,x=e,{colorSchemes:o={},components:a,defaultColorScheme:l="light"}=x,c=Ze(x,["colorSchemes","components","defaultColorScheme"]),{vars:u,css:f,varsWithDefaults:d}=$c(c,t);let p=d;const g={},I=o,{[l]:v}=I,m=Ze(I,[qs(l)]);if(Object.entries(m||{}).forEach(([w,A])=>{const{vars:E,css:k,varsWithDefaults:$}=$c(A,t);p=Qt(p,$),g[w]={css:k,vars:E}}),v){const{css:w,vars:A,varsWithDefaults:E}=$c(v,t);p=Qt(p,E),g[l]={css:w,vars:A}}function b(w,A){var k,$;let E=i;if(i==="class"&&(E=".%s"),i==="data"&&(E="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(E=`[${i}="%s"]`),w){if(E==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${(($=(k=o[w])==null?void 0:k.palette)==null?void 0:$.mode)||w})`]:{":root":A}};if(E)return e.defaultColorScheme===w?`:root, ${E.replace("%s",String(w))}`:E.replace("%s",String(w))}return":root"}return{vars:p,generateThemeVars:()=>{let w=L({},u);return Object.entries(g).forEach(([,{vars:A}])=>{w=Qt(w,A)}),w},generateStyleSheets:()=>{var O,T;const w=[],A=e.defaultColorScheme||"light";function E(F,H){Object.keys(H).length&&w.push(typeof F=="string"?{[F]:L({},H)}:F)}E(n(void 0,L({},f)),f);const G=g,{[A]:k}=G,$=Ze(G,[qs(A)]);if(k){const{css:F}=k,H=(T=(O=o[A])==null?void 0:O.palette)==null?void 0:T.mode,j=L(!r&&H?{colorScheme:H}:{},F);E(n(A,L({},j)),j)}return Object.entries($).forEach(([F,{css:H}])=>{var M,V;const j=(V=(M=o[F])==null?void 0:M.palette)==null?void 0:V.mode,N=L(!r&&j?{colorScheme:j}:{},H);E(n(F,L({},N)),N)}),w}}}function Tk(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const po={black:"#000",white:"#fff"},Ek={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},ii={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},oi={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},go={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ai={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},si={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},li={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function xp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:po.white,default:po.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const kk=xp();function Cp(){return{text:{primary:po.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:po.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const wp=Cp();function Sp(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Bc(e.main,i):t==="dark"&&(e.dark=Mc(e.main,o)))}function _k(e="light"){return e==="dark"?{main:ai[200],light:ai[50],dark:ai[400]}:{main:ai[700],light:ai[400],dark:ai[800]}}function Pk(e="light"){return e==="dark"?{main:ii[200],light:ii[50],dark:ii[400]}:{main:ii[500],light:ii[300],dark:ii[700]}}function Dk(e="light"){return e==="dark"?{main:oi[500],light:oi[300],dark:oi[700]}:{main:oi[700],light:oi[400],dark:oi[800]}}function Ok(e="light"){return e==="dark"?{main:si[400],light:si[300],dark:si[700]}:{main:si[700],light:si[500],dark:si[900]}}function Rk(e="light"){return e==="dark"?{main:li[400],light:li[300],dark:li[700]}:{main:li[800],light:li[500],dark:li[900]}}function Lk(e="light"){return e==="dark"?{main:go[400],light:go[300],dark:go[700]}:{main:"#ed6c02",light:go[500],dark:go[900]}}function Fc(e){const m=e,{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=m,i=Ze(m,["mode","contrastThreshold","tonalOffset"]),o=e.primary||_k(t),a=e.secondary||Pk(t),l=e.error||Dk(t),c=e.info||Ok(t),u=e.success||Rk(t),f=e.warning||Lk(t);function d(b){return gk(b,wp.text.primary)>=n?wp.text.primary:kk.text.primary}const p=({color:b,name:C,mainShade:S=500,lightShade:x=300,darkShade:I=700})=>{if(b=L({},b),!b.main&&b[S]&&(b.main=b[S]),!b.hasOwnProperty("main"))throw new Error(kr(11,C?` (${C})`:"",S));if(typeof b.main!="string")throw new Error(kr(12,C?` (${C})`:"",JSON.stringify(b.main)));return Sp(b,"light",x,r),Sp(b,"dark",I,r),b.contrastText||(b.contrastText=d(b.main)),b};let g;return t==="light"?g=xp():t==="dark"&&(g=Cp()),Qt(L({common:L({},po),mode:t,primary:p({color:o,name:"primary"}),secondary:p({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:f,name:"warning"}),info:p({color:c,name:"info"}),success:p({color:u,name:"success"}),grey:Ek,contrastThreshold:n,getContrastText:d,augmentColor:p,tonalOffset:r},g),i)}function Mk(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function Bk(e,t){return L({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}function $k(e){return Math.round(e*1e5)/1e5}const Ip={textTransform:"uppercase"},Ap='"Roboto", "Helvetica", "Arial", sans-serif';function Fk(e,t){const b=typeof t=="function"?t(e):t,{fontFamily:n=Ap,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=b,d=Ze(b,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),p=r/14,g=f||(C=>`${C/c*p}rem`),v=(C,S,x,I,w)=>L(L(L({fontFamily:n,fontWeight:C,fontSize:g(S),lineHeight:x},n===Ap?{letterSpacing:`${$k(I/S)}em`}:{}),w),u),m={h1:v(i,96,1.167,-1.5),h2:v(i,60,1.2,-.5),h3:v(o,48,1.167,0),h4:v(o,34,1.235,.25),h5:v(o,24,1.334,0),h6:v(a,20,1.6,.15),subtitle1:v(o,16,1.75,.15),subtitle2:v(a,14,1.57,.1),body1:v(o,16,1.5,.15),body2:v(o,14,1.43,.15),button:v(a,14,1.75,.4,Ip),caption:v(o,12,1.66,.4),overline:v(o,12,2.66,1,Ip),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qt(L({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:a,fontWeightBold:l},m),d,{clone:!1})}const Nk=.2,zk=.14,jk=.12;function Qe(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Nk})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${zk})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${jk})`].join(",")}const Uk=["none",Qe(0,2,1,-1,0,1,1,0,0,1,3,0),Qe(0,3,1,-2,0,2,2,0,0,1,5,0),Qe(0,3,3,-2,0,3,4,0,0,1,8,0),Qe(0,2,4,-1,0,4,5,0,0,1,10,0),Qe(0,3,5,-1,0,5,8,0,0,1,14,0),Qe(0,3,5,-1,0,6,10,0,0,1,18,0),Qe(0,4,5,-2,0,7,10,1,0,2,16,1),Qe(0,5,5,-3,0,8,10,1,0,3,14,2),Qe(0,5,6,-3,0,9,12,1,0,3,16,2),Qe(0,6,6,-3,0,10,14,1,0,4,18,3),Qe(0,6,7,-4,0,11,15,1,0,4,20,3),Qe(0,7,8,-4,0,12,17,2,0,5,22,4),Qe(0,7,8,-4,0,13,19,2,0,5,24,4),Qe(0,7,9,-4,0,14,21,2,0,5,26,4),Qe(0,8,9,-5,0,15,22,2,0,6,28,5),Qe(0,8,10,-5,0,16,24,2,0,6,30,5),Qe(0,8,11,-5,0,17,26,2,0,6,32,5),Qe(0,9,11,-5,0,18,28,2,0,7,34,6),Qe(0,9,12,-6,0,19,29,2,0,7,36,6),Qe(0,10,13,-6,0,20,31,3,0,8,38,7),Qe(0,10,13,-6,0,21,33,3,0,8,40,7),Qe(0,10,14,-6,0,22,35,3,0,8,42,7),Qe(0,11,14,-7,0,23,36,3,0,9,44,8),Qe(0,11,15,-7,0,24,38,3,0,9,46,8)],Vk={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Hk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Tp(e){return`${Math.round(e)}ms`}function Wk(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*Pi(t,.25)+t/5)*10),3e3)}function Gk(e){const t=L(L({},Vk),e.easing),n=L(L({},Hk),e.duration);return Q(L({getAutoHeightDuration:Wk,create:(i=["all"],o={})=>{const f=o,{duration:a=n.standard,easing:l=t.easeInOut,delay:c=0}=f,u=Ze(f,["duration","easing","delay"]);return(Array.isArray(i)?i:[i]).map(d=>`${d} ${typeof a=="string"?a:Tp(a)} ${l} ${typeof c=="string"?c:Tp(c)}`).join(",")}},e),{easing:t,duration:n})}const Yk={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Kk(e){return Hn(e)||typeof e=="undefined"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Ep(e={}){const t=L({},e);function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[a,l]=i[o];!Kk(l)||a.startsWith("unstable_")?delete r[a]:Hn(l)&&(r[a]=L({},l),n(r[a]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
2340
2340
 
2341
2341
  const theme = ${JSON.stringify(t,null,2)};
2342
2342
 
2343
2343
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
2344
2344
  theme.transitions = createTransitions(theme.transitions || {});
2345
2345
 
2346
- export default theme;`}function Nc(e={},...t){const g=e,{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:a={},typography:l={},shape:c}=g,u=Ze(g,["breakpoints","mixins","spacing","palette","transitions","typography","shape"]);if(e.vars)throw new Error(kr(20));const f=Fc(o),d=pp(e);let p=Qt(d,{mixins:Bk(d.breakpoints,r),palette:f,shadows:Uk.slice(),typography:Fk(f,l),transitions:Gk(a),zIndex:M({},Yk)});return p=Qt(p,u),p=t.reduce((v,m)=>Qt(v,m),p),p.unstable_sxConfig=M(M({},Za),u==null?void 0:u.unstable_sxConfig),p.unstable_sx=function(m){return ri({sx:m,theme:this})},p.toRuntimeSource=Ep,p}function qk(e){let t;return e<1?t=5.11916*Pi(e,2):t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Qk=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=qk(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function kp(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function _p(e){return e==="dark"?Qk:[]}function Jk(e){const a=e,{palette:t={mode:"light"},opacity:n,overlays:r}=a,i=Ze(a,["palette","opacity","overlays"]),o=Fc(t);return M({palette:o,opacity:M(M({},kp(o.mode)),n),overlays:r||_p(o.mode)},i)}function Xk(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Zk=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],e_=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return Zk(e.cssVarPrefix).forEach(l=>{a[l]=n[l],delete n[l]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:a}}:o?{[o.replace("%s",t)]:a,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:M(M({},n),a)}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function t_(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function re(e,t,n){!e[t]&&n&&(e[t]=n)}function mo(e){return typeof e!="string"||!e.startsWith("hsl")?e:vp(e)}function Gn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ho(mo(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
2347
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function n_(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Tn=e=>{try{return e()}catch(t){}},r_=(e="mui")=>wk(e);function zc(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Jk(Q(M({},t),{palette:M({mode:i},t==null?void 0:t.palette)}));return}const l=Nc(Q(M({},n),{palette:M({mode:i},t==null?void 0:t.palette)})),{palette:o}=l,a=Ze(l,["palette"]);return e[r]=Q(M({},t),{palette:o,opacity:M(M({},kp(i)),t==null?void 0:t.opacity),overlays:(t==null?void 0:t.overlays)||_p(i)}),a}function i_(e={},...t){const $=e,{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:a=Xk,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root"}=$,u=Ze($,["colorSchemes","defaultColorScheme","disableCssColorScheme","cssVarPrefix","shouldSkipGeneratingVar","colorSchemeSelector","rootSelector"]),f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),p=r_(o),G=n,{[d]:g,light:v,dark:m}=G,b=Ze(G,[qs(d),"light","dark"]),C=M({},b);let S=g;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(S=!0),!S)throw new Error(kr(21,d));const x=zc(C,S,u,d);v&&!C.light&&zc(C,v,void 0,"light"),m&&!C.dark&&zc(C,m,void 0,"dark");let I=Q(M({defaultColorScheme:d},x),{cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:p,colorSchemes:C,font:M(M({},Mk(x.typography)),x.font),spacing:n_(u.spacing)});Object.keys(I.colorSchemes).forEach(O=>{const T=I.colorSchemes[O].palette,F=H=>{const j=H.split("-"),N=j[1],L=j[2];return p(H,T[N][L])};if(T.mode==="light"&&(re(T.common,"background","#fff"),re(T.common,"onBackground","#000")),T.mode==="dark"&&(re(T.common,"background","#000"),re(T.common,"onBackground","#fff")),t_(T,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),T.mode==="light"){re(T.Alert,"errorColor",Ve(T.error.light,.6)),re(T.Alert,"infoColor",Ve(T.info.light,.6)),re(T.Alert,"successColor",Ve(T.success.light,.6)),re(T.Alert,"warningColor",Ve(T.warning.light,.6)),re(T.Alert,"errorFilledBg",F("palette-error-main")),re(T.Alert,"infoFilledBg",F("palette-info-main")),re(T.Alert,"successFilledBg",F("palette-success-main")),re(T.Alert,"warningFilledBg",F("palette-warning-main")),re(T.Alert,"errorFilledColor",Tn(()=>T.getContrastText(T.error.main))),re(T.Alert,"infoFilledColor",Tn(()=>T.getContrastText(T.info.main))),re(T.Alert,"successFilledColor",Tn(()=>T.getContrastText(T.success.main))),re(T.Alert,"warningFilledColor",Tn(()=>T.getContrastText(T.warning.main))),re(T.Alert,"errorStandardBg",He(T.error.light,.9)),re(T.Alert,"infoStandardBg",He(T.info.light,.9)),re(T.Alert,"successStandardBg",He(T.success.light,.9)),re(T.Alert,"warningStandardBg",He(T.warning.light,.9)),re(T.Alert,"errorIconColor",F("palette-error-main")),re(T.Alert,"infoIconColor",F("palette-info-main")),re(T.Alert,"successIconColor",F("palette-success-main")),re(T.Alert,"warningIconColor",F("palette-warning-main")),re(T.AppBar,"defaultBg",F("palette-grey-100")),re(T.Avatar,"defaultBg",F("palette-grey-400")),re(T.Button,"inheritContainedBg",F("palette-grey-300")),re(T.Button,"inheritContainedHoverBg",F("palette-grey-A100")),re(T.Chip,"defaultBorder",F("palette-grey-400")),re(T.Chip,"defaultAvatarColor",F("palette-grey-700")),re(T.Chip,"defaultIconColor",F("palette-grey-700")),re(T.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),re(T.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),re(T.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),re(T.LinearProgress,"primaryBg",He(T.primary.main,.62)),re(T.LinearProgress,"secondaryBg",He(T.secondary.main,.62)),re(T.LinearProgress,"errorBg",He(T.error.main,.62)),re(T.LinearProgress,"infoBg",He(T.info.main,.62)),re(T.LinearProgress,"successBg",He(T.success.main,.62)),re(T.LinearProgress,"warningBg",He(T.warning.main,.62)),re(T.Skeleton,"bg",`rgba(${F("palette-text-primaryChannel")} / 0.11)`),re(T.Slider,"primaryTrack",He(T.primary.main,.62)),re(T.Slider,"secondaryTrack",He(T.secondary.main,.62)),re(T.Slider,"errorTrack",He(T.error.main,.62)),re(T.Slider,"infoTrack",He(T.info.main,.62)),re(T.Slider,"successTrack",He(T.success.main,.62)),re(T.Slider,"warningTrack",He(T.warning.main,.62));const H=is(T.background.default,.8);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",Tn(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",is(T.background.paper,.15)),re(T.StepConnector,"border",F("palette-grey-400")),re(T.StepContent,"border",F("palette-grey-400")),re(T.Switch,"defaultColor",F("palette-common-white")),re(T.Switch,"defaultDisabledColor",F("palette-grey-100")),re(T.Switch,"primaryDisabledColor",He(T.primary.main,.62)),re(T.Switch,"secondaryDisabledColor",He(T.secondary.main,.62)),re(T.Switch,"errorDisabledColor",He(T.error.main,.62)),re(T.Switch,"infoDisabledColor",He(T.info.main,.62)),re(T.Switch,"successDisabledColor",He(T.success.main,.62)),re(T.Switch,"warningDisabledColor",He(T.warning.main,.62)),re(T.TableCell,"border",He(rs(T.divider,1),.88)),re(T.Tooltip,"bg",rs(T.grey[700],.92))}if(T.mode==="dark"){re(T.Alert,"errorColor",He(T.error.light,.6)),re(T.Alert,"infoColor",He(T.info.light,.6)),re(T.Alert,"successColor",He(T.success.light,.6)),re(T.Alert,"warningColor",He(T.warning.light,.6)),re(T.Alert,"errorFilledBg",F("palette-error-dark")),re(T.Alert,"infoFilledBg",F("palette-info-dark")),re(T.Alert,"successFilledBg",F("palette-success-dark")),re(T.Alert,"warningFilledBg",F("palette-warning-dark")),re(T.Alert,"errorFilledColor",Tn(()=>T.getContrastText(T.error.dark))),re(T.Alert,"infoFilledColor",Tn(()=>T.getContrastText(T.info.dark))),re(T.Alert,"successFilledColor",Tn(()=>T.getContrastText(T.success.dark))),re(T.Alert,"warningFilledColor",Tn(()=>T.getContrastText(T.warning.dark))),re(T.Alert,"errorStandardBg",Ve(T.error.light,.9)),re(T.Alert,"infoStandardBg",Ve(T.info.light,.9)),re(T.Alert,"successStandardBg",Ve(T.success.light,.9)),re(T.Alert,"warningStandardBg",Ve(T.warning.light,.9)),re(T.Alert,"errorIconColor",F("palette-error-main")),re(T.Alert,"infoIconColor",F("palette-info-main")),re(T.Alert,"successIconColor",F("palette-success-main")),re(T.Alert,"warningIconColor",F("palette-warning-main")),re(T.AppBar,"defaultBg",F("palette-grey-900")),re(T.AppBar,"darkBg",F("palette-background-paper")),re(T.AppBar,"darkColor",F("palette-text-primary")),re(T.Avatar,"defaultBg",F("palette-grey-600")),re(T.Button,"inheritContainedBg",F("palette-grey-800")),re(T.Button,"inheritContainedHoverBg",F("palette-grey-700")),re(T.Chip,"defaultBorder",F("palette-grey-700")),re(T.Chip,"defaultAvatarColor",F("palette-grey-300")),re(T.Chip,"defaultIconColor",F("palette-grey-300")),re(T.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),re(T.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),re(T.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),re(T.LinearProgress,"primaryBg",Ve(T.primary.main,.5)),re(T.LinearProgress,"secondaryBg",Ve(T.secondary.main,.5)),re(T.LinearProgress,"errorBg",Ve(T.error.main,.5)),re(T.LinearProgress,"infoBg",Ve(T.info.main,.5)),re(T.LinearProgress,"successBg",Ve(T.success.main,.5)),re(T.LinearProgress,"warningBg",Ve(T.warning.main,.5)),re(T.Skeleton,"bg",`rgba(${F("palette-text-primaryChannel")} / 0.13)`),re(T.Slider,"primaryTrack",Ve(T.primary.main,.5)),re(T.Slider,"secondaryTrack",Ve(T.secondary.main,.5)),re(T.Slider,"errorTrack",Ve(T.error.main,.5)),re(T.Slider,"infoTrack",Ve(T.info.main,.5)),re(T.Slider,"successTrack",Ve(T.success.main,.5)),re(T.Slider,"warningTrack",Ve(T.warning.main,.5));const H=is(T.background.default,.98);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",Tn(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",is(T.background.paper,.15)),re(T.StepConnector,"border",F("palette-grey-600")),re(T.StepContent,"border",F("palette-grey-600")),re(T.Switch,"defaultColor",F("palette-grey-300")),re(T.Switch,"defaultDisabledColor",F("palette-grey-600")),re(T.Switch,"primaryDisabledColor",Ve(T.primary.main,.55)),re(T.Switch,"secondaryDisabledColor",Ve(T.secondary.main,.55)),re(T.Switch,"errorDisabledColor",Ve(T.error.main,.55)),re(T.Switch,"infoDisabledColor",Ve(T.info.main,.55)),re(T.Switch,"successDisabledColor",Ve(T.success.main,.55)),re(T.Switch,"warningDisabledColor",Ve(T.warning.main,.55)),re(T.TableCell,"border",Ve(rs(T.divider,1),.68)),re(T.Tooltip,"bg",rs(T.grey[700],.92))}Gn(T.background,"default"),Gn(T.background,"paper"),Gn(T.common,"background"),Gn(T.common,"onBackground"),Gn(T,"divider"),Object.keys(T).forEach(H=>{const j=T[H];H!=="tonalOffset"&&j&&typeof j=="object"&&(j.main&&re(T[H],"mainChannel",ho(mo(j.main))),j.light&&re(T[H],"lightChannel",ho(mo(j.light))),j.dark&&re(T[H],"darkChannel",ho(mo(j.dark))),j.contrastText&&re(T[H],"contrastTextChannel",ho(mo(j.contrastText))),H==="text"&&(Gn(T[H],"primary"),Gn(T[H],"secondary")),H==="action"&&(j.active&&Gn(T[H],"active"),j.selected&&Gn(T[H],"selected")))})}),I=t.reduce((O,T)=>Qt(O,T),I);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:e_(I)},{vars:A,generateThemeVars:E,generateStyleSheets:k}=Ak(I,w);return I.vars=A,Object.entries(I.colorSchemes[I.defaultColorScheme]).forEach(([O,T])=>{I[O]=T}),I.generateThemeVars=E,I.generateStyleSheets=k,I.generateSpacing=function(){return hp(u.spacing,_c(this))},I.getColorSchemeSelector=Tk(l),I.spacing=I.generateSpacing(),I.shouldSkipGeneratingVar=a,I.unstable_sxConfig=M(M({},Za),u==null?void 0:u.unstable_sxConfig),I.unstable_sx=function(T){return ri({sx:T,theme:this})},I.toRuntimeSource=Ep,I}function Pp(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]=Q(M({},n!==!0&&n),{palette:Fc(Q(M({},n===!0?{}:n.palette),{mode:t}))}))}function o_(e={},...t){const f=e,{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode}=f,a=Ze(f,["palette","cssVariables","colorSchemes","defaultColorScheme"]),l=o||"light",c=i==null?void 0:i[l],u=M(M({},i),n?{[l]:Q(M({},typeof c!="boolean"&&c),{palette:n})}:void 0);if(r===!1){if(!("colorSchemes"in e))return Nc(e,...t);let d=n;"palette"in e||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const p=Nc(Q(M({},e),{palette:d}),...t);return p.defaultColorScheme=l,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light=Q(M({},u.light!==!0&&u.light),{palette:p.palette}),Pp(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark=Q(M({},u.dark!==!0&&u.dark),{palette:p.palette}),Pp(p,"light",u.light)),p}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),i_(M(Q(M({},a),{colorSchemes:u,defaultColorScheme:l}),typeof r!="boolean"&&r),...t)}const a_=o_(),s_="$$material";function l_(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const c_=lk({themeId:s_,defaultTheme:a_,rootShouldForwardProp:e=>l_(e)&&e!=="classes"}),u_=Ck;function d_(e){return xk(e)}function f_(e){return rp("MuiSvgIcon",e)}JT("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const h_=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${ti(t)}`,`fontSize${ti(n)}`]};return KT(i,f_,r)},p_=c_("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ti(n.color)}`],t[`fontSize${ti(n.fontSize)}`]]}})(u_(({theme:e})=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,S;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(i=(r=((n=e.vars)!=null?n:e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:x=>!x.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((d=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:d.call(f,35))||"2.1875rem"}},...Object.entries(((p=e.vars)!=null?p:e).palette).filter(([,x])=>x&&x.main).map(([x])=>{var I,w,A;return{props:{color:x},style:{color:(A=(w=((I=e.vars)!=null?I:e).palette)==null?void 0:w[x])==null?void 0:A.main}}}),{props:{color:"action"},style:{color:(m=(v=((g=e.vars)!=null?g:e).palette)==null?void 0:v.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(S=(C=((b=e.vars)!=null?b:e).palette)==null?void 0:C.action)==null?void 0:S.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),jc=K.forwardRef(function(t,n){const r=d_({props:t,name:"MuiSvgIcon"}),S=r,{children:i,className:o,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24"}=S,g=Ze(S,["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"]),v=K.isValidElement(i)&&i.type==="svg",m=Q(M({},r),{color:a,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:v}),b={};f||(b.viewBox=p);const C=h_(m);return s.jsxs(p_,Q(M(M(M({as:l,className:zn(C.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},b),g),v&&i.props),{ownerState:m,children:[v?i.props.children:i,d?s.jsx("title",{children:d}):null]}))});jc.muiName="SvgIcon";function $e(e,t){function n(r,i){return s.jsx(jc,Q(M({"data-testid":`${t}Icon`,ref:i},r),{children:e}))}return n.muiName=jc.muiName,K.memo(K.forwardRef(n))}const Uc=$e(s.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),g_=$e(s.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"ColorLens"),m_=$e(s.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function v_(e){return ut("MuiTabPanel",e)}qe("MuiTabPanel",["root","hidden","sizeSm","sizeMd","sizeLg","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const b_=["children","value","component","color","variant","size","slots","slotProps","keepMounted"],y_=e=>{const{hidden:t,size:n,variant:r,color:i,orientation:o}=e,a={root:["root",t&&"hidden",n&&`size${Se(n)}`,o,r&&`variant${Se(r)}`,i&&`color${Se(i)}`,n&&`size${Se(n)}`]};return gt(a,v_,{})},x_=Ce("div",{name:"JoyTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return R({display:t.hidden?"none":"block",padding:"var(--Tabs-spacing)",flexGrow:1,fontFamily:e.vars.fontFamily.body},e.typography[`body-${t.size}`],(n=e.variants[t.variant])==null?void 0:n[t.color])}),ci=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabPanel"}),{orientation:i}=Da()||{orientation:"horizontal"},o=K.useContext(Ic),{children:a,value:l=0,component:c,color:u="neutral",variant:f="plain",size:d,slots:p={},slotProps:g={},keepMounted:v=!1}=r,m=De(r,b_),{hidden:b,getRootProps:C}=cA(R({},r,{value:l})),S=d!=null?d:o,x=R({},r,{orientation:i,hidden:b,size:S,color:u,variant:f}),I=y_(x),w=R({},m,{component:c,slots:p,slotProps:g}),[A,E]=Ee("root",{ref:n,elementType:x_,getSlotProps:C,externalForwardedProps:w,additionalProps:{role:"tabpanel",ref:n,as:c},ownerState:x,className:I.root});return v?s.jsx(A,R({},E,{children:a})):s.jsx(A,R({},E,{children:!b&&a}))});function C_(e){return ut("MuiInput",e)}const Dp=qe("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),os=K.createContext(void 0),w_=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function S_(e,t){var n;const r=K.useContext(os),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,className:u,defaultValue:f,disabled:d,disabledInProp:p,error:g,id:v,name:m,onClick:b,onChange:C,onKeyDown:S,onKeyUp:x,onFocus:I,onBlur:w,placeholder:A,readOnly:E,required:k,type:$,value:G}=e,O=De(e,w_),{getRootProps:T,getInputProps:F,focused:H,error:j,disabled:N}=II({disabled:(n=p!=null?p:r==null?void 0:r.disabled)!=null?n:d,defaultValue:f,error:g,onBlur:w,onClick:b,onChange:C,onFocus:I,required:k!=null?k:r==null?void 0:r.required,value:G}),L={[t.disabled]:N,[t.error]:j,[t.focused]:H,[t.formControl]:!!r,[u]:u},V={[t.disabled]:N};return R({formControl:r,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,disabled:N,id:v,onKeyDown:S,onKeyUp:x,name:m,placeholder:A,readOnly:E,type:$},rootStateClasses:L,inputStateClasses:V,getRootProps:T,getInputProps:F,focused:H,error:j,disabled:N},O)}const Vc=e=>t=>`--${e?`${e}-`:""}${t.replace(/^--/,"")}`,vo="data-skip-inverted-colors",Op=`& :not([${vo}], [${vo}] *)`,Rp=e=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,S,x,I,w,A;const E=Vc(e.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[e.getColorSchemeSelector("light")]:{[E("--palette-focusVisible")]:`${(t=e.colorSchemes.light)==null?void 0:t.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(n=e.colorSchemes.light)==null?void 0:n.palette.background.body} !important`,[E("--palette-background-surface")]:`${(r=e.colorSchemes.light)==null?void 0:r.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(i=e.colorSchemes.light)==null?void 0:i.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(o=e.colorSchemes.light)==null?void 0:o.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(a=e.colorSchemes.light)==null?void 0:a.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(l=e.colorSchemes.light)==null?void 0:l.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(c=e.colorSchemes.light)==null?void 0:c.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(u=e.colorSchemes.light)==null?void 0:u.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(f=e.colorSchemes.light)==null?void 0:f.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(d=e.colorSchemes.light)==null?void 0:d.palette.divider} !important`},[e.getColorSchemeSelector("dark")]:{[E("--palette-focusVisible")]:`${(p=e.colorSchemes.dark)==null?void 0:p.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(g=e.colorSchemes.dark)==null?void 0:g.palette.background.body} !important`,[E("--palette-background-surface")]:`${(v=e.colorSchemes.dark)==null?void 0:v.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(m=e.colorSchemes.dark)==null?void 0:m.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(b=e.colorSchemes.dark)==null?void 0:b.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(C=e.colorSchemes.dark)==null?void 0:C.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(S=e.colorSchemes.dark)==null?void 0:S.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(x=e.colorSchemes.dark)==null?void 0:x.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(I=e.colorSchemes.dark)==null?void 0:I.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(w=e.colorSchemes.dark)==null?void 0:w.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(A=e.colorSchemes.dark)==null?void 0:A.palette.divider} !important`}}};function I_(e){return e.theme!==void 0}const A_=e=>t=>{const n=I_(t)?t.theme:t,r=dc(n.cssVarPrefix),i=Vc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Op]:{"--Badge-ringColor":o(`palette-${e}-solidBg`),"--Icon-color":"currentColor",[`${n.getColorSchemeSelector("light")}, ${n.getColorSchemeSelector("dark")}`]:{colorScheme:"dark",[i("--palette-focusVisible")]:o(`palette-${e}-200`),[i("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[i("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[i("--palette-background-popup")]:o(`palette-${e}-700`),[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.36)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.6)`,[i("--palette-text-primary")]:o("palette-common-white"),[i("--palette-text-secondary")]:o(`palette-${e}-200`),[i("--palette-text-tertiary")]:o(`palette-${e}-300`),[i("--palette-text-icon")]:o(`palette-${e}-200`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainColor":o(`palette-${e}-50`),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedColor":o(`palette-${e}-50`),"--variant-outlinedBorder":`rgba(${o(`palette-${e}-lightChannel`)} / 0.5)`,"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":o("palette-common-white"),"--variant-softHoverColor":o("palette-common-white"),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.24)`,"--variant-softHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.36)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.16)`,"--variant-softActiveColor":"#fff","--variant-softDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`,"--variant-solidColor":o(`palette-${e}-${e==="neutral"?"600":"500"}`),"--variant-solidBg":o("palette-common-white"),"--variant-solidHoverBg":o("palette-common-white"),"--variant-solidActiveBg":o(`palette-${e}-100`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`}},[`&, & [${vo}]`]:Rp(n)}},T_=e=>t=>{const{theme:n=t}=t,r=dc(n.cssVarPrefix),i=Vc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Op]:{"--Badge-ringColor":o(`palette-${e}-softBg`),"--Icon-color":"currentColor",[n.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:o(`palette-${e}-300`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,[i("--palette-text-primary")]:o(`palette-${e}-100`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-text-icon")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.2)`,"--variant-plainColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-plainHoverColor":o(`palette-${e}-50`),"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-outlinedHoverColor":o(`palette-${e}-50`),"--variant-outlinedBg":"initial","--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverBorder":o(`palette-${e}-600`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,"--variant-softColor":o(`palette-${e}-200`),"--variant-softBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-softHoverColor":"#fff","--variant-softHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-solidColor":"#fff","--variant-solidBg":o(`palette-${e}-500`),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`},[n.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:o(`palette-${e}-500`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,[i("--palette-text-primary")]:o(`palette-${e}-700`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.68)`,[i("--palette-text-icon")]:o(`palette-${e}-500`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainColor":`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,"--variant-plainHoverColor":`rgba(${o(`palette-${e}-darkChannel`)} / 1)`,"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-mainChannel`)} / 1)`,"--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverColor":o(`palette-${e}-600`),"--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-softColor":o(`palette-${e}-600`),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.8)`,"--variant-softHoverColor":o(`palette-${e}-700`),"--variant-softHoverBg":o(`palette-${e}-200`),"--variant-softActiveBg":o(`palette-${e}-300`),"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,"--variant-solidColor":o("palette-common-white"),"--variant-solidBg":o(`palette-${e}-${e==="neutral"?"700":"500"}`),"--variant-solidHoverColor":o("palette-common-white"),"--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`}},[`&, & [${vo}]`]:Rp(n)}},E_=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],k_=e=>{const{disabled:t,fullWidth:n,variant:r,color:i,size:o}=e,a={root:["root",t&&"disabled",n&&"fullWidth",r&&`variant${Se(r)}`,i&&`color${Se(i)}`,o&&`size${Se(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return gt(a,C_,{})},__=Ce("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,l;const c=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Input-radius":e.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":e.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":e.vars.focus.thickness,"--Input-focusedHighlight":(r=e.vars.palette[t.color==="neutral"?"primary":t.color])==null?void 0:r[500],[`&:not([${vo}])`]:R({},t.instanceColor&&{"--_Input-focusedHighlight":(i=e.vars.palette[t.instanceColor==="neutral"?"primary":t.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${e.vars.palette.focusVisible})`})},t.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl},t.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},t.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},t.variant!=="plain"&&{boxShadow:e.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},t.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},e.typography[`body-${t.size}`],c,{backgroundColor:(o=c==null?void 0:c.backgroundColor)!=null?o:e.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":R({},(a=e.variants[`${t.variant}Hover`])==null?void 0:a[t.color],{backgroundColor:null}),[`&.${Dp.disabled}`]:(l=e.variants[`${t.variant}Disabled`])==null?void 0:l[t.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),P_=Ce("input")(({ownerState:e})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":R({paddingInline:"var(--Input-paddingInline)"},!e.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!e.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),D_=Ce("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),O_=Ce("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),R_=Ce(__,{name:"JoyInput",slot:"Root",overridesResolver:(e,t)=>t.root})({}),L_=Ce(P_,{name:"JoyInput",slot:"Input",overridesResolver:(e,t)=>t.input})({}),M_=Ce(D_,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({}),B_=Ce(O_,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({}),as=K.forwardRef(function(t,n){var r,i,o,a,l,c;const u=mt({props:t,name:"JoyInput"}),f=S_(R({},u,{disabledInProp:t.disabled}),Dp),{propsToForward:d,rootStateClasses:p,inputStateClasses:g,getRootProps:v,getInputProps:m,formControl:b,focused:C,error:S=!1,disabled:x,fullWidth:I=!1,size:w="md",color:A="neutral",variant:E="outlined",startDecorator:k,endDecorator:$,component:G,slots:O={},slotProps:T={}}=f,F=De(f,E_),H=(r=(i=t.error)!=null?i:b==null?void 0:b.error)!=null?r:S,j=(o=(a=t.size)!=null?a:b==null?void 0:b.size)!=null?o:w,N=(l=t.color)!=null?l:H?"danger":(c=b==null?void 0:b.color)!=null?c:A,L=R({instanceColor:H?"danger":t.color},u,{fullWidth:I,color:N,disabled:x,error:H,focused:C,size:j,variant:E}),V=k_(L),Y=R({},F,{component:G,slots:O,slotProps:T}),[X,D]=Ee("root",{ref:n,className:[V.root,p],elementType:R_,getSlotProps:v,externalForwardedProps:Y,ownerState:L}),[B,U]=Ee("input",R({},b&&{additionalProps:{id:b.htmlFor,"aria-describedby":b["aria-describedby"]}},{className:[V.input,g],elementType:L_,getSlotProps:m,internalForwardedProps:d,externalForwardedProps:Y,ownerState:L})),[W,ie]=Ee("startDecorator",{className:V.startDecorator,elementType:M_,externalForwardedProps:Y,ownerState:L}),[se,oe]=Ee("endDecorator",{className:V.endDecorator,elementType:B_,externalForwardedProps:Y,ownerState:L});return s.jsxs(X,R({},D,{children:[k&&s.jsx(W,R({},ie,{children:k})),s.jsx(B,R({},U)),$&&s.jsx(se,R({},oe,{children:$}))]}))}),Lt=({label:e,placeholder:t,value:n,defaultValue:r,required:i,size:o,readOnly:a=!1,endDecorator:l=void 0,onChange:c})=>s.jsxs(h.FormControl,{size:o||"md",sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{required:i,color:"primary",children:e}),s.jsx(as,{placeholder:t,size:"md",variant:"outlined",color:"neutral",value:n||r,defaultValue:r,readOnly:a,endDecorator:l,onChange:c,sx:{backgroundColor:"#fff",borderRadius:"md"}})]}),Lp=$e(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");function $_(e){return ut("MuiCircularProgress",e)}qe("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let F_=e=>e,Mp;const N_=["color","backgroundColor"],z_=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],j_=me.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}}),U_=e=>{const{determinate:t,color:n,variant:r,size:i}=e,o={root:["root",t&&"determinate",n&&`color${Se(n)}`,r&&`variant${Se(r)}`,i&&`size${Se(i)}`],svg:["svg"],track:["track"],progress:["progress"]};return gt(o,$_,{})};function ui(e,t){return`var(--CircularProgress-${e}Thickness, var(--CircularProgress-thickness, ${t}))`}const V_=Ce("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i,o;const a=((n=t.variants[e.variant])==null?void 0:n[e.color])||{},{color:l,backgroundColor:c}=a,u=De(a,N_);return R({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":c,"--CircularProgress-progressColor":l,"--CircularProgress-percent":e.value,"--CircularProgress-linecap":"round"},e.size==="sm"&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":ui("track","3px"),"--_progress-thickness":ui("progress","3px")},e.instanceSize==="sm"&&{"--CircularProgress-size":"24px"},e.size==="md"&&{"--_track-thickness":ui("track","6px"),"--_progress-thickness":ui("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},e.instanceSize==="md"&&{"--CircularProgress-size":"40px"},e.size==="lg"&&{"--_track-thickness":ui("track","8px"),"--_progress-thickness":ui("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},e.instanceSize==="lg"&&{"--CircularProgress-size":"64px"},e.thickness&&{"--_track-thickness":`${e.thickness}px`,"--_progress-thickness":`${e.thickness}px`},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:l},e.children&&{fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},u,e.variant==="outlined"&&{"&::before":R({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},u)},e.variant==="soft"&&{"--CircularProgress-trackColor":t.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":(r=t.variants.solid)==null?void 0:r[e.color].backgroundColor},e.variant==="solid"&&{"--CircularProgress-trackColor":(i=t.variants.softHover)==null?void 0:i[e.color].backgroundColor,"--CircularProgress-progressColor":(o=t.variants.solid)==null?void 0:o[e.color].backgroundColor})}),H_=Ce("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),W_=Ce("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(e,t)=>t.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),G_=Ce("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(e,t)=>t.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},({ownerState:e})=>!e.determinate&&me.css(Mp||(Mp=F_`
2346
+ export default theme;`}function Nc(e={},...t){const g=e,{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:a={},typography:l={},shape:c}=g,u=Ze(g,["breakpoints","mixins","spacing","palette","transitions","typography","shape"]);if(e.vars)throw new Error(kr(20));const f=Fc(o),d=pp(e);let p=Qt(d,{mixins:Bk(d.breakpoints,r),palette:f,shadows:Uk.slice(),typography:Fk(f,l),transitions:Gk(a),zIndex:L({},Yk)});return p=Qt(p,u),p=t.reduce((v,m)=>Qt(v,m),p),p.unstable_sxConfig=L(L({},Za),u==null?void 0:u.unstable_sxConfig),p.unstable_sx=function(m){return ri({sx:m,theme:this})},p.toRuntimeSource=Ep,p}function qk(e){let t;return e<1?t=5.11916*Pi(e,2):t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Qk=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=qk(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function kp(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function _p(e){return e==="dark"?Qk:[]}function Jk(e){const a=e,{palette:t={mode:"light"},opacity:n,overlays:r}=a,i=Ze(a,["palette","opacity","overlays"]),o=Fc(t);return L({palette:o,opacity:L(L({},kp(o.mode)),n),overlays:r||_p(o.mode)},i)}function Xk(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Zk=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],e_=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return Zk(e.cssVarPrefix).forEach(l=>{a[l]=n[l],delete n[l]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:a}}:o?{[o.replace("%s",t)]:a,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:L(L({},n),a)}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function t_(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function re(e,t,n){!e[t]&&n&&(e[t]=n)}function mo(e){return typeof e!="string"||!e.startsWith("hsl")?e:vp(e)}function Gn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ho(mo(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
2347
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function n_(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Tn=e=>{try{return e()}catch(t){}},r_=(e="mui")=>wk(e);function zc(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Jk(Q(L({},t),{palette:L({mode:i},t==null?void 0:t.palette)}));return}const l=Nc(Q(L({},n),{palette:L({mode:i},t==null?void 0:t.palette)})),{palette:o}=l,a=Ze(l,["palette"]);return e[r]=Q(L({},t),{palette:o,opacity:L(L({},kp(i)),t==null?void 0:t.opacity),overlays:(t==null?void 0:t.overlays)||_p(i)}),a}function i_(e={},...t){const $=e,{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:a=Xk,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root"}=$,u=Ze($,["colorSchemes","defaultColorScheme","disableCssColorScheme","cssVarPrefix","shouldSkipGeneratingVar","colorSchemeSelector","rootSelector"]),f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),p=r_(o),G=n,{[d]:g,light:v,dark:m}=G,b=Ze(G,[qs(d),"light","dark"]),C=L({},b);let S=g;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(S=!0),!S)throw new Error(kr(21,d));const x=zc(C,S,u,d);v&&!C.light&&zc(C,v,void 0,"light"),m&&!C.dark&&zc(C,m,void 0,"dark");let I=Q(L({defaultColorScheme:d},x),{cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:p,colorSchemes:C,font:L(L({},Mk(x.typography)),x.font),spacing:n_(u.spacing)});Object.keys(I.colorSchemes).forEach(O=>{const T=I.colorSchemes[O].palette,F=H=>{const j=H.split("-"),N=j[1],M=j[2];return p(H,T[N][M])};if(T.mode==="light"&&(re(T.common,"background","#fff"),re(T.common,"onBackground","#000")),T.mode==="dark"&&(re(T.common,"background","#000"),re(T.common,"onBackground","#fff")),t_(T,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),T.mode==="light"){re(T.Alert,"errorColor",Ve(T.error.light,.6)),re(T.Alert,"infoColor",Ve(T.info.light,.6)),re(T.Alert,"successColor",Ve(T.success.light,.6)),re(T.Alert,"warningColor",Ve(T.warning.light,.6)),re(T.Alert,"errorFilledBg",F("palette-error-main")),re(T.Alert,"infoFilledBg",F("palette-info-main")),re(T.Alert,"successFilledBg",F("palette-success-main")),re(T.Alert,"warningFilledBg",F("palette-warning-main")),re(T.Alert,"errorFilledColor",Tn(()=>T.getContrastText(T.error.main))),re(T.Alert,"infoFilledColor",Tn(()=>T.getContrastText(T.info.main))),re(T.Alert,"successFilledColor",Tn(()=>T.getContrastText(T.success.main))),re(T.Alert,"warningFilledColor",Tn(()=>T.getContrastText(T.warning.main))),re(T.Alert,"errorStandardBg",He(T.error.light,.9)),re(T.Alert,"infoStandardBg",He(T.info.light,.9)),re(T.Alert,"successStandardBg",He(T.success.light,.9)),re(T.Alert,"warningStandardBg",He(T.warning.light,.9)),re(T.Alert,"errorIconColor",F("palette-error-main")),re(T.Alert,"infoIconColor",F("palette-info-main")),re(T.Alert,"successIconColor",F("palette-success-main")),re(T.Alert,"warningIconColor",F("palette-warning-main")),re(T.AppBar,"defaultBg",F("palette-grey-100")),re(T.Avatar,"defaultBg",F("palette-grey-400")),re(T.Button,"inheritContainedBg",F("palette-grey-300")),re(T.Button,"inheritContainedHoverBg",F("palette-grey-A100")),re(T.Chip,"defaultBorder",F("palette-grey-400")),re(T.Chip,"defaultAvatarColor",F("palette-grey-700")),re(T.Chip,"defaultIconColor",F("palette-grey-700")),re(T.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),re(T.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),re(T.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),re(T.LinearProgress,"primaryBg",He(T.primary.main,.62)),re(T.LinearProgress,"secondaryBg",He(T.secondary.main,.62)),re(T.LinearProgress,"errorBg",He(T.error.main,.62)),re(T.LinearProgress,"infoBg",He(T.info.main,.62)),re(T.LinearProgress,"successBg",He(T.success.main,.62)),re(T.LinearProgress,"warningBg",He(T.warning.main,.62)),re(T.Skeleton,"bg",`rgba(${F("palette-text-primaryChannel")} / 0.11)`),re(T.Slider,"primaryTrack",He(T.primary.main,.62)),re(T.Slider,"secondaryTrack",He(T.secondary.main,.62)),re(T.Slider,"errorTrack",He(T.error.main,.62)),re(T.Slider,"infoTrack",He(T.info.main,.62)),re(T.Slider,"successTrack",He(T.success.main,.62)),re(T.Slider,"warningTrack",He(T.warning.main,.62));const H=is(T.background.default,.8);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",Tn(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",is(T.background.paper,.15)),re(T.StepConnector,"border",F("palette-grey-400")),re(T.StepContent,"border",F("palette-grey-400")),re(T.Switch,"defaultColor",F("palette-common-white")),re(T.Switch,"defaultDisabledColor",F("palette-grey-100")),re(T.Switch,"primaryDisabledColor",He(T.primary.main,.62)),re(T.Switch,"secondaryDisabledColor",He(T.secondary.main,.62)),re(T.Switch,"errorDisabledColor",He(T.error.main,.62)),re(T.Switch,"infoDisabledColor",He(T.info.main,.62)),re(T.Switch,"successDisabledColor",He(T.success.main,.62)),re(T.Switch,"warningDisabledColor",He(T.warning.main,.62)),re(T.TableCell,"border",He(rs(T.divider,1),.88)),re(T.Tooltip,"bg",rs(T.grey[700],.92))}if(T.mode==="dark"){re(T.Alert,"errorColor",He(T.error.light,.6)),re(T.Alert,"infoColor",He(T.info.light,.6)),re(T.Alert,"successColor",He(T.success.light,.6)),re(T.Alert,"warningColor",He(T.warning.light,.6)),re(T.Alert,"errorFilledBg",F("palette-error-dark")),re(T.Alert,"infoFilledBg",F("palette-info-dark")),re(T.Alert,"successFilledBg",F("palette-success-dark")),re(T.Alert,"warningFilledBg",F("palette-warning-dark")),re(T.Alert,"errorFilledColor",Tn(()=>T.getContrastText(T.error.dark))),re(T.Alert,"infoFilledColor",Tn(()=>T.getContrastText(T.info.dark))),re(T.Alert,"successFilledColor",Tn(()=>T.getContrastText(T.success.dark))),re(T.Alert,"warningFilledColor",Tn(()=>T.getContrastText(T.warning.dark))),re(T.Alert,"errorStandardBg",Ve(T.error.light,.9)),re(T.Alert,"infoStandardBg",Ve(T.info.light,.9)),re(T.Alert,"successStandardBg",Ve(T.success.light,.9)),re(T.Alert,"warningStandardBg",Ve(T.warning.light,.9)),re(T.Alert,"errorIconColor",F("palette-error-main")),re(T.Alert,"infoIconColor",F("palette-info-main")),re(T.Alert,"successIconColor",F("palette-success-main")),re(T.Alert,"warningIconColor",F("palette-warning-main")),re(T.AppBar,"defaultBg",F("palette-grey-900")),re(T.AppBar,"darkBg",F("palette-background-paper")),re(T.AppBar,"darkColor",F("palette-text-primary")),re(T.Avatar,"defaultBg",F("palette-grey-600")),re(T.Button,"inheritContainedBg",F("palette-grey-800")),re(T.Button,"inheritContainedHoverBg",F("palette-grey-700")),re(T.Chip,"defaultBorder",F("palette-grey-700")),re(T.Chip,"defaultAvatarColor",F("palette-grey-300")),re(T.Chip,"defaultIconColor",F("palette-grey-300")),re(T.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),re(T.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),re(T.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),re(T.LinearProgress,"primaryBg",Ve(T.primary.main,.5)),re(T.LinearProgress,"secondaryBg",Ve(T.secondary.main,.5)),re(T.LinearProgress,"errorBg",Ve(T.error.main,.5)),re(T.LinearProgress,"infoBg",Ve(T.info.main,.5)),re(T.LinearProgress,"successBg",Ve(T.success.main,.5)),re(T.LinearProgress,"warningBg",Ve(T.warning.main,.5)),re(T.Skeleton,"bg",`rgba(${F("palette-text-primaryChannel")} / 0.13)`),re(T.Slider,"primaryTrack",Ve(T.primary.main,.5)),re(T.Slider,"secondaryTrack",Ve(T.secondary.main,.5)),re(T.Slider,"errorTrack",Ve(T.error.main,.5)),re(T.Slider,"infoTrack",Ve(T.info.main,.5)),re(T.Slider,"successTrack",Ve(T.success.main,.5)),re(T.Slider,"warningTrack",Ve(T.warning.main,.5));const H=is(T.background.default,.98);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",Tn(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",is(T.background.paper,.15)),re(T.StepConnector,"border",F("palette-grey-600")),re(T.StepContent,"border",F("palette-grey-600")),re(T.Switch,"defaultColor",F("palette-grey-300")),re(T.Switch,"defaultDisabledColor",F("palette-grey-600")),re(T.Switch,"primaryDisabledColor",Ve(T.primary.main,.55)),re(T.Switch,"secondaryDisabledColor",Ve(T.secondary.main,.55)),re(T.Switch,"errorDisabledColor",Ve(T.error.main,.55)),re(T.Switch,"infoDisabledColor",Ve(T.info.main,.55)),re(T.Switch,"successDisabledColor",Ve(T.success.main,.55)),re(T.Switch,"warningDisabledColor",Ve(T.warning.main,.55)),re(T.TableCell,"border",Ve(rs(T.divider,1),.68)),re(T.Tooltip,"bg",rs(T.grey[700],.92))}Gn(T.background,"default"),Gn(T.background,"paper"),Gn(T.common,"background"),Gn(T.common,"onBackground"),Gn(T,"divider"),Object.keys(T).forEach(H=>{const j=T[H];H!=="tonalOffset"&&j&&typeof j=="object"&&(j.main&&re(T[H],"mainChannel",ho(mo(j.main))),j.light&&re(T[H],"lightChannel",ho(mo(j.light))),j.dark&&re(T[H],"darkChannel",ho(mo(j.dark))),j.contrastText&&re(T[H],"contrastTextChannel",ho(mo(j.contrastText))),H==="text"&&(Gn(T[H],"primary"),Gn(T[H],"secondary")),H==="action"&&(j.active&&Gn(T[H],"active"),j.selected&&Gn(T[H],"selected")))})}),I=t.reduce((O,T)=>Qt(O,T),I);const w={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:e_(I)},{vars:A,generateThemeVars:E,generateStyleSheets:k}=Ak(I,w);return I.vars=A,Object.entries(I.colorSchemes[I.defaultColorScheme]).forEach(([O,T])=>{I[O]=T}),I.generateThemeVars=E,I.generateStyleSheets=k,I.generateSpacing=function(){return hp(u.spacing,_c(this))},I.getColorSchemeSelector=Tk(l),I.spacing=I.generateSpacing(),I.shouldSkipGeneratingVar=a,I.unstable_sxConfig=L(L({},Za),u==null?void 0:u.unstable_sxConfig),I.unstable_sx=function(T){return ri({sx:T,theme:this})},I.toRuntimeSource=Ep,I}function Pp(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]=Q(L({},n!==!0&&n),{palette:Fc(Q(L({},n===!0?{}:n.palette),{mode:t}))}))}function o_(e={},...t){const f=e,{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode}=f,a=Ze(f,["palette","cssVariables","colorSchemes","defaultColorScheme"]),l=o||"light",c=i==null?void 0:i[l],u=L(L({},i),n?{[l]:Q(L({},typeof c!="boolean"&&c),{palette:n})}:void 0);if(r===!1){if(!("colorSchemes"in e))return Nc(e,...t);let d=n;"palette"in e||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const p=Nc(Q(L({},e),{palette:d}),...t);return p.defaultColorScheme=l,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light=Q(L({},u.light!==!0&&u.light),{palette:p.palette}),Pp(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark=Q(L({},u.dark!==!0&&u.dark),{palette:p.palette}),Pp(p,"light",u.light)),p}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),i_(L(Q(L({},a),{colorSchemes:u,defaultColorScheme:l}),typeof r!="boolean"&&r),...t)}const a_=o_(),s_="$$material";function l_(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const c_=lk({themeId:s_,defaultTheme:a_,rootShouldForwardProp:e=>l_(e)&&e!=="classes"}),u_=Ck;function d_(e){return xk(e)}function f_(e){return rp("MuiSvgIcon",e)}JT("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const h_=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${ti(t)}`,`fontSize${ti(n)}`]};return KT(i,f_,r)},p_=c_("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ti(n.color)}`],t[`fontSize${ti(n.fontSize)}`]]}})(u_(({theme:e})=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,S;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(i=(r=((n=e.vars)!=null?n:e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:x=>!x.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((d=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:d.call(f,35))||"2.1875rem"}},...Object.entries(((p=e.vars)!=null?p:e).palette).filter(([,x])=>x&&x.main).map(([x])=>{var I,w,A;return{props:{color:x},style:{color:(A=(w=((I=e.vars)!=null?I:e).palette)==null?void 0:w[x])==null?void 0:A.main}}}),{props:{color:"action"},style:{color:(m=(v=((g=e.vars)!=null?g:e).palette)==null?void 0:v.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(S=(C=((b=e.vars)!=null?b:e).palette)==null?void 0:C.action)==null?void 0:S.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),jc=K.forwardRef(function(t,n){const r=d_({props:t,name:"MuiSvgIcon"}),S=r,{children:i,className:o,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24"}=S,g=Ze(S,["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"]),v=K.isValidElement(i)&&i.type==="svg",m=Q(L({},r),{color:a,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:v}),b={};f||(b.viewBox=p);const C=h_(m);return s.jsxs(p_,Q(L(L(L({as:l,className:zn(C.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},b),g),v&&i.props),{ownerState:m,children:[v?i.props.children:i,d?s.jsx("title",{children:d}):null]}))});jc.muiName="SvgIcon";function $e(e,t){function n(r,i){return s.jsx(jc,Q(L({"data-testid":`${t}Icon`,ref:i},r),{children:e}))}return n.muiName=jc.muiName,K.memo(K.forwardRef(n))}const Uc=$e(s.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),g_=$e(s.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"ColorLens"),m_=$e(s.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function v_(e){return ut("MuiTabPanel",e)}qe("MuiTabPanel",["root","hidden","sizeSm","sizeMd","sizeLg","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const b_=["children","value","component","color","variant","size","slots","slotProps","keepMounted"],y_=e=>{const{hidden:t,size:n,variant:r,color:i,orientation:o}=e,a={root:["root",t&&"hidden",n&&`size${Se(n)}`,o,r&&`variant${Se(r)}`,i&&`color${Se(i)}`,n&&`size${Se(n)}`]};return gt(a,v_,{})},x_=Ce("div",{name:"JoyTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return R({display:t.hidden?"none":"block",padding:"var(--Tabs-spacing)",flexGrow:1,fontFamily:e.vars.fontFamily.body},e.typography[`body-${t.size}`],(n=e.variants[t.variant])==null?void 0:n[t.color])}),ci=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyTabPanel"}),{orientation:i}=Da()||{orientation:"horizontal"},o=K.useContext(Ic),{children:a,value:l=0,component:c,color:u="neutral",variant:f="plain",size:d,slots:p={},slotProps:g={},keepMounted:v=!1}=r,m=De(r,b_),{hidden:b,getRootProps:C}=cA(R({},r,{value:l})),S=d!=null?d:o,x=R({},r,{orientation:i,hidden:b,size:S,color:u,variant:f}),I=y_(x),w=R({},m,{component:c,slots:p,slotProps:g}),[A,E]=Ee("root",{ref:n,elementType:x_,getSlotProps:C,externalForwardedProps:w,additionalProps:{role:"tabpanel",ref:n,as:c},ownerState:x,className:I.root});return v?s.jsx(A,R({},E,{children:a})):s.jsx(A,R({},E,{children:!b&&a}))});function C_(e){return ut("MuiInput",e)}const Dp=qe("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),os=K.createContext(void 0),w_=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function S_(e,t){var n;const r=K.useContext(os),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,className:u,defaultValue:f,disabled:d,disabledInProp:p,error:g,id:v,name:m,onClick:b,onChange:C,onKeyDown:S,onKeyUp:x,onFocus:I,onBlur:w,placeholder:A,readOnly:E,required:k,type:$,value:G}=e,O=De(e,w_),{getRootProps:T,getInputProps:F,focused:H,error:j,disabled:N}=II({disabled:(n=p!=null?p:r==null?void 0:r.disabled)!=null?n:d,defaultValue:f,error:g,onBlur:w,onClick:b,onChange:C,onFocus:I,required:k!=null?k:r==null?void 0:r.required,value:G}),M={[t.disabled]:N,[t.error]:j,[t.focused]:H,[t.formControl]:!!r,[u]:u},V={[t.disabled]:N};return R({formControl:r,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,disabled:N,id:v,onKeyDown:S,onKeyUp:x,name:m,placeholder:A,readOnly:E,type:$},rootStateClasses:M,inputStateClasses:V,getRootProps:T,getInputProps:F,focused:H,error:j,disabled:N},O)}const Vc=e=>t=>`--${e?`${e}-`:""}${t.replace(/^--/,"")}`,vo="data-skip-inverted-colors",Op=`& :not([${vo}], [${vo}] *)`,Rp=e=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,S,x,I,w,A;const E=Vc(e.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[e.getColorSchemeSelector("light")]:{[E("--palette-focusVisible")]:`${(t=e.colorSchemes.light)==null?void 0:t.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(n=e.colorSchemes.light)==null?void 0:n.palette.background.body} !important`,[E("--palette-background-surface")]:`${(r=e.colorSchemes.light)==null?void 0:r.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(i=e.colorSchemes.light)==null?void 0:i.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(o=e.colorSchemes.light)==null?void 0:o.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(a=e.colorSchemes.light)==null?void 0:a.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(l=e.colorSchemes.light)==null?void 0:l.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(c=e.colorSchemes.light)==null?void 0:c.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(u=e.colorSchemes.light)==null?void 0:u.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(f=e.colorSchemes.light)==null?void 0:f.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(d=e.colorSchemes.light)==null?void 0:d.palette.divider} !important`},[e.getColorSchemeSelector("dark")]:{[E("--palette-focusVisible")]:`${(p=e.colorSchemes.dark)==null?void 0:p.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(g=e.colorSchemes.dark)==null?void 0:g.palette.background.body} !important`,[E("--palette-background-surface")]:`${(v=e.colorSchemes.dark)==null?void 0:v.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(m=e.colorSchemes.dark)==null?void 0:m.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(b=e.colorSchemes.dark)==null?void 0:b.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(C=e.colorSchemes.dark)==null?void 0:C.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(S=e.colorSchemes.dark)==null?void 0:S.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(x=e.colorSchemes.dark)==null?void 0:x.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(I=e.colorSchemes.dark)==null?void 0:I.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(w=e.colorSchemes.dark)==null?void 0:w.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(A=e.colorSchemes.dark)==null?void 0:A.palette.divider} !important`}}};function I_(e){return e.theme!==void 0}const A_=e=>t=>{const n=I_(t)?t.theme:t,r=dc(n.cssVarPrefix),i=Vc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Op]:{"--Badge-ringColor":o(`palette-${e}-solidBg`),"--Icon-color":"currentColor",[`${n.getColorSchemeSelector("light")}, ${n.getColorSchemeSelector("dark")}`]:{colorScheme:"dark",[i("--palette-focusVisible")]:o(`palette-${e}-200`),[i("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[i("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[i("--palette-background-popup")]:o(`palette-${e}-700`),[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.36)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.6)`,[i("--palette-text-primary")]:o("palette-common-white"),[i("--palette-text-secondary")]:o(`palette-${e}-200`),[i("--palette-text-tertiary")]:o(`palette-${e}-300`),[i("--palette-text-icon")]:o(`palette-${e}-200`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainColor":o(`palette-${e}-50`),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedColor":o(`palette-${e}-50`),"--variant-outlinedBorder":`rgba(${o(`palette-${e}-lightChannel`)} / 0.5)`,"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":o("palette-common-white"),"--variant-softHoverColor":o("palette-common-white"),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.24)`,"--variant-softHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.36)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.16)`,"--variant-softActiveColor":"#fff","--variant-softDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`,"--variant-solidColor":o(`palette-${e}-${e==="neutral"?"600":"500"}`),"--variant-solidBg":o("palette-common-white"),"--variant-solidHoverBg":o("palette-common-white"),"--variant-solidActiveBg":o(`palette-${e}-100`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`}},[`&, & [${vo}]`]:Rp(n)}},T_=e=>t=>{const{theme:n=t}=t,r=dc(n.cssVarPrefix),i=Vc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Op]:{"--Badge-ringColor":o(`palette-${e}-softBg`),"--Icon-color":"currentColor",[n.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:o(`palette-${e}-300`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,[i("--palette-text-primary")]:o(`palette-${e}-100`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-text-icon")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.2)`,"--variant-plainColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-plainHoverColor":o(`palette-${e}-50`),"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-outlinedHoverColor":o(`palette-${e}-50`),"--variant-outlinedBg":"initial","--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverBorder":o(`palette-${e}-600`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,"--variant-softColor":o(`palette-${e}-200`),"--variant-softBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-softHoverColor":"#fff","--variant-softHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-solidColor":"#fff","--variant-solidBg":o(`palette-${e}-500`),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`},[n.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:o(`palette-${e}-500`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,[i("--palette-text-primary")]:o(`palette-${e}-700`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.68)`,[i("--palette-text-icon")]:o(`palette-${e}-500`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainColor":`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,"--variant-plainHoverColor":`rgba(${o(`palette-${e}-darkChannel`)} / 1)`,"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-mainChannel`)} / 1)`,"--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverColor":o(`palette-${e}-600`),"--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-softColor":o(`palette-${e}-600`),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.8)`,"--variant-softHoverColor":o(`palette-${e}-700`),"--variant-softHoverBg":o(`palette-${e}-200`),"--variant-softActiveBg":o(`palette-${e}-300`),"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,"--variant-solidColor":o("palette-common-white"),"--variant-solidBg":o(`palette-${e}-${e==="neutral"?"700":"500"}`),"--variant-solidHoverColor":o("palette-common-white"),"--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`}},[`&, & [${vo}]`]:Rp(n)}},E_=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],k_=e=>{const{disabled:t,fullWidth:n,variant:r,color:i,size:o}=e,a={root:["root",t&&"disabled",n&&"fullWidth",r&&`variant${Se(r)}`,i&&`color${Se(i)}`,o&&`size${Se(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return gt(a,C_,{})},__=Ce("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,l;const c=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Input-radius":e.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":e.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":e.vars.focus.thickness,"--Input-focusedHighlight":(r=e.vars.palette[t.color==="neutral"?"primary":t.color])==null?void 0:r[500],[`&:not([${vo}])`]:R({},t.instanceColor&&{"--_Input-focusedHighlight":(i=e.vars.palette[t.instanceColor==="neutral"?"primary":t.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${e.vars.palette.focusVisible})`})},t.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl},t.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},t.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},t.variant!=="plain"&&{boxShadow:e.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},t.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},e.typography[`body-${t.size}`],c,{backgroundColor:(o=c==null?void 0:c.backgroundColor)!=null?o:e.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":R({},(a=e.variants[`${t.variant}Hover`])==null?void 0:a[t.color],{backgroundColor:null}),[`&.${Dp.disabled}`]:(l=e.variants[`${t.variant}Disabled`])==null?void 0:l[t.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),P_=Ce("input")(({ownerState:e})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":R({paddingInline:"var(--Input-paddingInline)"},!e.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!e.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),D_=Ce("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),O_=Ce("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),R_=Ce(__,{name:"JoyInput",slot:"Root",overridesResolver:(e,t)=>t.root})({}),L_=Ce(P_,{name:"JoyInput",slot:"Input",overridesResolver:(e,t)=>t.input})({}),M_=Ce(D_,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({}),B_=Ce(O_,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({}),as=K.forwardRef(function(t,n){var r,i,o,a,l,c;const u=mt({props:t,name:"JoyInput"}),f=S_(R({},u,{disabledInProp:t.disabled}),Dp),{propsToForward:d,rootStateClasses:p,inputStateClasses:g,getRootProps:v,getInputProps:m,formControl:b,focused:C,error:S=!1,disabled:x,fullWidth:I=!1,size:w="md",color:A="neutral",variant:E="outlined",startDecorator:k,endDecorator:$,component:G,slots:O={},slotProps:T={}}=f,F=De(f,E_),H=(r=(i=t.error)!=null?i:b==null?void 0:b.error)!=null?r:S,j=(o=(a=t.size)!=null?a:b==null?void 0:b.size)!=null?o:w,N=(l=t.color)!=null?l:H?"danger":(c=b==null?void 0:b.color)!=null?c:A,M=R({instanceColor:H?"danger":t.color},u,{fullWidth:I,color:N,disabled:x,error:H,focused:C,size:j,variant:E}),V=k_(M),Y=R({},F,{component:G,slots:O,slotProps:T}),[X,D]=Ee("root",{ref:n,className:[V.root,p],elementType:R_,getSlotProps:v,externalForwardedProps:Y,ownerState:M}),[B,U]=Ee("input",R({},b&&{additionalProps:{id:b.htmlFor,"aria-describedby":b["aria-describedby"]}},{className:[V.input,g],elementType:L_,getSlotProps:m,internalForwardedProps:d,externalForwardedProps:Y,ownerState:M})),[W,ie]=Ee("startDecorator",{className:V.startDecorator,elementType:M_,externalForwardedProps:Y,ownerState:M}),[se,oe]=Ee("endDecorator",{className:V.endDecorator,elementType:B_,externalForwardedProps:Y,ownerState:M});return s.jsxs(X,R({},D,{children:[k&&s.jsx(W,R({},ie,{children:k})),s.jsx(B,R({},U)),$&&s.jsx(se,R({},oe,{children:$}))]}))}),Lt=({label:e,placeholder:t,value:n,defaultValue:r,required:i,size:o,readOnly:a=!1,endDecorator:l=void 0,onChange:c})=>s.jsxs(h.FormControl,{size:o||"md",sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{required:i,color:"primary",children:e}),s.jsx(as,{placeholder:t,size:"md",variant:"outlined",color:"neutral",value:n||r,defaultValue:r,readOnly:a,endDecorator:l,onChange:c,sx:{backgroundColor:"#fff",borderRadius:"md"}})]}),Lp=$e(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");function $_(e){return ut("MuiCircularProgress",e)}qe("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let F_=e=>e,Mp;const N_=["color","backgroundColor"],z_=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],j_=me.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}}),U_=e=>{const{determinate:t,color:n,variant:r,size:i}=e,o={root:["root",t&&"determinate",n&&`color${Se(n)}`,r&&`variant${Se(r)}`,i&&`size${Se(i)}`],svg:["svg"],track:["track"],progress:["progress"]};return gt(o,$_,{})};function ui(e,t){return`var(--CircularProgress-${e}Thickness, var(--CircularProgress-thickness, ${t}))`}const V_=Ce("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i,o;const a=((n=t.variants[e.variant])==null?void 0:n[e.color])||{},{color:l,backgroundColor:c}=a,u=De(a,N_);return R({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":c,"--CircularProgress-progressColor":l,"--CircularProgress-percent":e.value,"--CircularProgress-linecap":"round"},e.size==="sm"&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":ui("track","3px"),"--_progress-thickness":ui("progress","3px")},e.instanceSize==="sm"&&{"--CircularProgress-size":"24px"},e.size==="md"&&{"--_track-thickness":ui("track","6px"),"--_progress-thickness":ui("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},e.instanceSize==="md"&&{"--CircularProgress-size":"40px"},e.size==="lg"&&{"--_track-thickness":ui("track","8px"),"--_progress-thickness":ui("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},e.instanceSize==="lg"&&{"--CircularProgress-size":"64px"},e.thickness&&{"--_track-thickness":`${e.thickness}px`,"--_progress-thickness":`${e.thickness}px`},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:l},e.children&&{fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},u,e.variant==="outlined"&&{"&::before":R({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},u)},e.variant==="soft"&&{"--CircularProgress-trackColor":t.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":(r=t.variants.solid)==null?void 0:r[e.color].backgroundColor},e.variant==="solid"&&{"--CircularProgress-trackColor":(i=t.variants.softHover)==null?void 0:i[e.color].backgroundColor,"--CircularProgress-progressColor":(o=t.variants.solid)==null?void 0:o[e.color].backgroundColor})}),H_=Ce("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),W_=Ce("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(e,t)=>t.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),G_=Ce("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(e,t)=>t.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},({ownerState:e})=>!e.determinate&&me.css(Mp||(Mp=F_`
2348
2348
  animation: var(--CircularProgress-circulation, 0.8s linear 0s infinite normal none running)
2349
2349
  ${0};
2350
- `),j_)),Bp=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:l="md",variant:c="soft",thickness:u,determinate:f=!1,value:d=f?0:25,component:p,slots:g={},slotProps:v={}}=r,m=De(r,z_),b=R({},r,{color:a,size:l,variant:c,thickness:u,value:d,determinate:f,instanceSize:t.size}),C=U_(b),S=R({},m,{component:p,slots:g,slotProps:v}),[x,I]=Ee("root",{ref:n,className:zn(C.root,o),elementType:V_,externalForwardedProps:S,ownerState:b,additionalProps:R({role:"progressbar",style:{"--CircularProgress-percent":d}},d&&f&&{"aria-valuenow":Math.round(typeof d=="number"?d:Number(d||0))})}),[w,A]=Ee("svg",{className:C.svg,elementType:H_,externalForwardedProps:S,ownerState:b}),[E,k]=Ee("track",{className:C.track,elementType:W_,externalForwardedProps:S,ownerState:b}),[$,G]=Ee("progress",{className:C.progress,elementType:G_,externalForwardedProps:S,ownerState:b});return s.jsxs(x,R({},I,{children:[s.jsxs(w,R({},A,{children:[s.jsx(E,R({},k)),s.jsx($,R({},G))]})),i]}))});function Y_(e){return ut("MuiButton",e)}const $p=qe("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),Fp=K.createContext({}),Np=K.createContext(void 0),K_=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],q_=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,fullWidth:o,size:a,variant:l,loading:c}=e,u={root:["root",n&&"disabled",r&&"focusVisible",o&&"fullWidth",l&&`variant${Se(l)}`,t&&`color${Se(t)}`,a&&`size${Se(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},f=gt(u,Y_,{});return r&&i&&(f.root+=` ${i}`),f},Q_=Ce("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),J_=Ce("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),X_=Ce("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Z_=({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:e.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:e.vars.lineHeight.md},t.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},'&:active, &[aria-pressed="true"]':(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],[`&.${$p.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]},t.loadingPosition==="center"&&{[`&.${$p.loading}`]:{color:"transparent"}})]},eP=Ce("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})(Z_),di=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyButton"}),{children:o,action:a,color:l="primary",variant:c="solid",size:u="md",fullWidth:f=!1,startDecorator:d,endDecorator:p,loading:g=!1,loadingPosition:v="center",loadingIndicator:m,disabled:b,component:C,slots:S={},slotProps:x={}}=i,I=De(i,K_),w=K.useContext(Fp),A=K.useContext(Np),E=t.variant||w.variant||c,k=t.size||w.size||u,$=t.color||w.color||l,G=(r=t.loading||t.disabled)!=null?r:w.disabled||g||b,O=K.useRef(null),T=gn(O,n),{focusVisible:F,setFocusVisible:H,getRootProps:j}=Xl(R({},i,{disabled:G,rootRef:T})),N=m!=null?m:s.jsx(Bp,{color:$,thickness:{sm:2,md:3,lg:4}[k]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var ne;H(!0),(ne=O.current)==null||ne.focus()}}),[H]);const L=R({},i,{color:$,fullWidth:f,variant:E,size:k,focusVisible:F,loading:g,loadingPosition:v,disabled:G}),V=q_(L),Y=ne=>{var ue;let be=i.onClick;if(typeof x.root=="function"?be=x.root(L).onClick:x.root&&(be=x.root.onClick),(ue=be)==null||ue(ne),A){var Ne;(Ne=A.onClick)==null||Ne.call(A,ne,i.value)}};let X=i["aria-pressed"];typeof x.root=="function"?X=x.root(L)["aria-pressed"]:x.root&&(X=x.root["aria-pressed"]),A!=null&&A.value&&(Array.isArray(A.value)?X=A.value.indexOf(i.value)!==-1:X=A.value===i.value);const D=R({},I,{component:C,slots:S,slotProps:x}),[B,U]=Ee("root",{ref:n,className:V.root,elementType:eP,externalForwardedProps:D,getSlotProps:j,ownerState:L,additionalProps:{onClick:Y,"aria-pressed":X}}),[W,ie]=Ee("startDecorator",{className:V.startDecorator,elementType:Q_,externalForwardedProps:D,ownerState:L}),[se,oe]=Ee("endDecorator",{className:V.endDecorator,elementType:J_,externalForwardedProps:D,ownerState:L}),[Z,te]=Ee("loadingIndicatorCenter",{className:V.loadingIndicatorCenter,elementType:X_,externalForwardedProps:D,ownerState:L});return s.jsxs(B,R({},U,{children:[(d||g&&v==="start")&&s.jsx(W,R({},ie,{children:g&&v==="start"?N:d})),o,g&&v==="center"&&s.jsx(Z,R({},te,{children:N})),(p||g&&v==="end")&&s.jsx(se,R({},oe,{children:g&&v==="end"?N:p}))]}))});di.muiName="Button";var zp={exports:{}};function tP(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hc={exports:{}};const nP=Gu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var jp;function Wc(){return jp||(jp=1,function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=n||function(r,i){var o;if(typeof window!="undefined"&&window.crypto&&(o=window.crypto),typeof self!="undefined"&&self.crypto&&(o=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window!="undefined"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof jt!="undefined"&&jt.crypto&&(o=jt.crypto),!o&&typeof tP=="function")try{o=nP}catch(S){}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch(S){}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch(S){}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function S(){}return function(x){var I;return S.prototype=x,I=new S,S.prototype=null,I}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(S){var x=l(this);return S&&x.mixIn(S),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var S=this.extend();return S.init.apply(S,arguments),S},init:function(){},mixIn:function(S){for(var x in S)S.hasOwnProperty(x)&&(this[x]=S[x]);S.hasOwnProperty("toString")&&(this.toString=S.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=f.extend({init:function(S,x){S=this.words=S||[],x!=i?this.sigBytes=x:this.sigBytes=S.length*4},toString:function(S){return(S||g).stringify(this)},concat:function(S){var x=this.words,I=S.words,w=this.sigBytes,A=S.sigBytes;if(this.clamp(),w%4)for(var E=0;E<A;E++){var k=I[E>>>2]>>>24-E%4*8&255;x[w+E>>>2]|=k<<24-(w+E)%4*8}else for(var $=0;$<A;$+=4)x[w+$>>>2]=I[$>>>2];return this.sigBytes+=A,this},clamp:function(){var S=this.words,x=this.sigBytes;S[x>>>2]&=4294967295<<32-x%4*8,S.length=r.ceil(x/4)},clone:function(){var S=f.clone.call(this);return S.words=this.words.slice(0),S},random:function(S){for(var x=[],I=0;I<S;I+=4)x.push(a());return new d.init(x,S)}}),p=c.enc={},g=p.Hex={stringify:function(S){for(var x=S.words,I=S.sigBytes,w=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;w.push((E>>>4).toString(16)),w.push((E&15).toString(16))}return w.join("")},parse:function(S){for(var x=S.length,I=[],w=0;w<x;w+=2)I[w>>>3]|=parseInt(S.substr(w,2),16)<<24-w%8*4;return new d.init(I,x/2)}},v=p.Latin1={stringify:function(S){for(var x=S.words,I=S.sigBytes,w=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;w.push(String.fromCharCode(E))}return w.join("")},parse:function(S){for(var x=S.length,I=[],w=0;w<x;w++)I[w>>>2]|=(S.charCodeAt(w)&255)<<24-w%4*8;return new d.init(I,x)}},m=p.Utf8={stringify:function(S){try{return decodeURIComponent(escape(v.stringify(S)))}catch(x){throw new Error("Malformed UTF-8 data")}},parse:function(S){return v.parse(unescape(encodeURIComponent(S)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(S){typeof S=="string"&&(S=m.parse(S)),this._data.concat(S),this._nDataBytes+=S.sigBytes},_process:function(S){var x,I=this._data,w=I.words,A=I.sigBytes,E=this.blockSize,k=E*4,$=A/k;S?$=r.ceil($):$=r.max(($|0)-this._minBufferSize,0);var G=$*E,O=r.min(G*4,A);if(G){for(var T=0;T<G;T+=E)this._doProcessBlock(w,T);x=w.splice(0,G),I.sigBytes-=O}return new d.init(x,O)},clone:function(){var S=f.clone.call(this);return S._data=this._data.clone(),S},_minBufferSize:0});u.Hasher=b.extend({cfg:f.extend(),init:function(S){this.cfg=this.cfg.extend(S),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(S){return this._append(S),this._process(),this},finalize:function(S){S&&this._append(S);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(S){return function(x,I){return new S.init(I).finalize(x)}},_createHmacHelper:function(S){return function(x,I){return new C.HMAC.init(S,I).finalize(x)}}});var C=c.algo={};return c}(Math);return n})}(Hc)),Hc.exports}(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,l=o.Hasher,c=i.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=r.abs(r.sin(m+1))*4294967296|0})();var f=c.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var C=0;C<16;C++){var S=b+C,x=m[S];m[S]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,w=m[b+0],A=m[b+1],E=m[b+2],k=m[b+3],$=m[b+4],G=m[b+5],O=m[b+6],T=m[b+7],F=m[b+8],H=m[b+9],j=m[b+10],N=m[b+11],L=m[b+12],V=m[b+13],Y=m[b+14],X=m[b+15],D=I[0],B=I[1],U=I[2],W=I[3];D=d(D,B,U,W,w,7,u[0]),W=d(W,D,B,U,A,12,u[1]),U=d(U,W,D,B,E,17,u[2]),B=d(B,U,W,D,k,22,u[3]),D=d(D,B,U,W,$,7,u[4]),W=d(W,D,B,U,G,12,u[5]),U=d(U,W,D,B,O,17,u[6]),B=d(B,U,W,D,T,22,u[7]),D=d(D,B,U,W,F,7,u[8]),W=d(W,D,B,U,H,12,u[9]),U=d(U,W,D,B,j,17,u[10]),B=d(B,U,W,D,N,22,u[11]),D=d(D,B,U,W,L,7,u[12]),W=d(W,D,B,U,V,12,u[13]),U=d(U,W,D,B,Y,17,u[14]),B=d(B,U,W,D,X,22,u[15]),D=p(D,B,U,W,A,5,u[16]),W=p(W,D,B,U,O,9,u[17]),U=p(U,W,D,B,N,14,u[18]),B=p(B,U,W,D,w,20,u[19]),D=p(D,B,U,W,G,5,u[20]),W=p(W,D,B,U,j,9,u[21]),U=p(U,W,D,B,X,14,u[22]),B=p(B,U,W,D,$,20,u[23]),D=p(D,B,U,W,H,5,u[24]),W=p(W,D,B,U,Y,9,u[25]),U=p(U,W,D,B,k,14,u[26]),B=p(B,U,W,D,F,20,u[27]),D=p(D,B,U,W,V,5,u[28]),W=p(W,D,B,U,E,9,u[29]),U=p(U,W,D,B,T,14,u[30]),B=p(B,U,W,D,L,20,u[31]),D=g(D,B,U,W,G,4,u[32]),W=g(W,D,B,U,F,11,u[33]),U=g(U,W,D,B,N,16,u[34]),B=g(B,U,W,D,Y,23,u[35]),D=g(D,B,U,W,A,4,u[36]),W=g(W,D,B,U,$,11,u[37]),U=g(U,W,D,B,T,16,u[38]),B=g(B,U,W,D,j,23,u[39]),D=g(D,B,U,W,V,4,u[40]),W=g(W,D,B,U,w,11,u[41]),U=g(U,W,D,B,k,16,u[42]),B=g(B,U,W,D,O,23,u[43]),D=g(D,B,U,W,H,4,u[44]),W=g(W,D,B,U,L,11,u[45]),U=g(U,W,D,B,X,16,u[46]),B=g(B,U,W,D,E,23,u[47]),D=v(D,B,U,W,w,6,u[48]),W=v(W,D,B,U,T,10,u[49]),U=v(U,W,D,B,Y,15,u[50]),B=v(B,U,W,D,G,21,u[51]),D=v(D,B,U,W,L,6,u[52]),W=v(W,D,B,U,k,10,u[53]),U=v(U,W,D,B,j,15,u[54]),B=v(B,U,W,D,A,21,u[55]),D=v(D,B,U,W,F,6,u[56]),W=v(W,D,B,U,X,10,u[57]),U=v(U,W,D,B,O,15,u[58]),B=v(B,U,W,D,V,21,u[59]),D=v(D,B,U,W,$,6,u[60]),W=v(W,D,B,U,N,10,u[61]),U=v(U,W,D,B,E,15,u[62]),B=v(B,U,W,D,H,21,u[63]),I[0]=I[0]+D|0,I[1]=I[1]+B|0,I[2]=I[2]+U|0,I[3]=I[3]+W|0},_doFinalize:function(){var m=this._data,b=m.words,C=this._nDataBytes*8,S=m.sigBytes*8;b[S>>>5]|=128<<24-S%32;var x=r.floor(C/4294967296),I=C;b[(S+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b[(S+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var w=this._hash,A=w.words,E=0;E<4;E++){var k=A[E];A[E]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return w},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function d(m,b,C,S,x,I,w){var A=m+(b&C|~b&S)+x+w;return(A<<I|A>>>32-I)+b}function p(m,b,C,S,x,I,w){var A=m+(b&S|C&~S)+x+w;return(A<<I|A>>>32-I)+b}function g(m,b,C,S,x,I,w){var A=m+(b^C^S)+x+w;return(A<<I|A>>>32-I)+b}function v(m,b,C,S,x,I,w){var A=m+(C^(b|~S))+x+w;return(A<<I|A>>>32-I)+b}i.MD5=l._createHelper(f),i.HmacMD5=l._createHmacHelper(f)}(Math),n.MD5})})(zp);var rP=zp.exports;const Up=yn(rP);var Vp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,a=o.init,l=o.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var u=c.byteLength,f=[],d=0;d<u;d++)f[d>>>2]|=c[d]<<24-d%4*8;a.call(this,f,u)}else a.apply(this,arguments)};l.prototype=o}}(),n.lib.WordArray})})(Vp);var iP=Vp.exports;const Hp=yn(iP);var Wp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var p=[],g=0;g<f;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,m=u[g+1>>>2]>>>24-(g+1)%4*8&255,b=u[g+2>>>2]>>>24-(g+2)%4*8&255,C=v<<16|m<<8|b,S=0;S<4&&g+S*.75<f;S++)p.push(d.charAt(C>>>6*(3-S)&63));var x=d.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<f.length;p++)d[f.charCodeAt(p)]=p}var g=f.charAt(64);if(g){var v=c.indexOf(g);v!==-1&&(u=v)}return l(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(c,u,f){for(var d=[],p=0,g=0;g<u;g++)if(g%4){var v=f[c.charCodeAt(g-1)]<<g%4*2,m=f[c.charCodeAt(g)]>>>6-g%4*2,b=v|m;d[p>>>2]|=b<<24-p%4*8,p++}return o.create(d,p)}}(),n.enc.Base64})})(Wp);var oP=Wp.exports;const aP=yn(oP);class Gp{constructor(){J(this,"readFileAndHash",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Hp.create(new Uint8Array(a)),u=Up(l).toString(aP);n(u)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}));J(this,"generateHashFileName",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Hp.create(new Uint8Array(a)),c=Up(l).toString();n(c)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}))}}const Yp=({title:e,open:t,imageSrc:n,toggleModal:r})=>s.jsx(h.Modal,{open:t,onClose:r,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{sx:{marginBottom:"10px"},children:e}),s.jsx(h.DialogContent,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx("img",{src:n,alt:"Image modal",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}),Kp=$e(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Ge=()=>{const e=y.useContext(pa);if(!e)throw new Error("useAPIContext must be used within a APIProvider");return e},sP=$e(s.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),lP=({isLoading:e,images:t,onClick:n})=>s.jsxs(s.Fragment,{children:[s.jsx(h.Grid,{container:!0,spacing:2,children:t.map(r=>{var i,o;return s.jsx(h.Grid,{xs:5,sm:4,md:3,children:s.jsxs(h.Box,{sx:{position:"relative",width:"100%","&:hover .overlay":{backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:1},"&:hover .plusSign":{opacity:1}},onClick:()=>{var a,l;return n(((l=(a=r.urls)==null?void 0:a.uploaded)==null?void 0:l.embed)||"")},children:[s.jsx(h.Box,{component:"img",src:(o=(i=r.urls)==null?void 0:i.uploaded)==null?void 0:o.thumbnail,alt:`image-${r.id}`,sx:{width:"100%",height:"auto",borderRadius:"8px"}}),s.jsx(h.Box,{className:"overlay",sx:{position:"absolute",top:0,left:0,right:0,bottom:5,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0)",opacity:0,transition:"background-color 0.3s ease, opacity 0.3s ease",borderRadius:"8px",cursor:"pointer"},children:s.jsx(h.Typography,{className:"plusSign",level:"h2",sx:{color:"white",opacity:0,transition:"opacity 0.3s ease"},children:"+"})})]})},`sportal-image-${r.id}`)})}),e?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}):s.jsx(s.Fragment,{})]}),cP=$e(s.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),uP=$e(s.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),dP=e=>s.jsx(h.Box,{display:"flex",alignItems:"baseline",flexWrap:"wrap",children:s.jsxs(h.Box,{display:"flex",children:[e.pageCount&&e.pageCount!==1&&s.jsx(h.Button,{variant:"outlined",color:"neutral",startDecorator:s.jsx(cP,{}),onClick:e.getPreviousPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:"4px 0 0 4px",borderRight:0,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.previous}),e.images&&e.images.length===20&&s.jsx(h.Button,{variant:"outlined",color:"neutral",endDecorator:s.jsx(uP,{}),onClick:e.getNextPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:e.pageCount!==1?"0 4px 4px 0":"4px",borderLeft:e.pageCount!==1?0:1,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.next})]})}),Xt=$e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),fP=$e(s.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),hP=({color:e})=>e==="warning"?s.jsx(fP,{}):s.jsx(Xt,{}),Ye=e=>s.jsx(h.Snackbar,{anchorOrigin:{vertical:"top",horizontal:"right"},open:e.showToast,onClose:e.hideToast,autoHideDuration:3e3,color:e.color,startDecorator:s.jsx(hP,{color:e.color}),children:e.message},e.message),bo=({label:e,defaultValue:t,required:n,onChange:r})=>{const i=o=>{r(o.target.value)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Input,{type:"date",defaultValue:t,onChange:i,sx:{backgroundColor:"#fff",borderRadius:"md"}})]})},pP=({labels:e,showFilters:t,onClick:n})=>s.jsx(h.Tooltip,{title:t?e.hideFilters:e.showFilters,children:s.jsx(h.IconButton,{"aria-label":"Filters",onClick:n,children:s.jsx(sP,{})})}),qp=({labels:e,onChangeImages:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(1),[p,g]=y.useState(""),[v,m]=y.useState(null),[b,C]=y.useState([]),{https:S}=Ge();y.useEffect(()=>{E()},[f]);const x=()=>u(!c),I=()=>d($=>$-1),w=()=>d($=>$+1),A=()=>_(this,null,function*(){if(p){o(!0);const $=v?M({},v):null,G=yield S.fetchImagesFromSportal365(p,$,f);if(G){const O=yield G.json();G.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}o(!1)}else C([])}),E=()=>_(this,null,function*(){if(p){l(!0),C([]);const $=v&&v.from&&v.to?M({},v):null,G=yield S.fetchImagesFromSportal365(p,$,f);if(G){const O=yield G.json();G.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}l(!1)}}),k=($,G)=>{m(O=>O?Q(M({},O),{[G]:$}):{[G]:$})};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(h.Input,{value:p,onChange:$=>g($.target.value),sx:{mb:2,width:"100%"},placeholder:e.searchImage,endDecorator:s.jsx(pP,{labels:e,showFilters:n,onClick:()=>r(!n)})}),n?s.jsxs(h.Grid,{container:!0,spacing:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsx(bo,{label:e.fromDate,defaultValue:v==null?void 0:v.from,required:!1,onChange:$=>k($,"from")})}),s.jsx(h.Grid,{xs:6,children:s.jsx(bo,{label:e.toDate,defaultValue:v==null?void 0:v.to,required:!1,onChange:$=>k($,"to")})})]}):s.jsx(s.Fragment,{}),s.jsx(h.Button,{onClick:A,sx:{mb:2,backgroundColor:"#ef8b34","&:hover":{backgroundColor:"#d7772e"},"&:active":{backgroundColor:"#c06c29"}},loading:i,children:e.search}),s.jsx(lP,{images:b,isLoading:a,onClick:t}),s.jsx(dP,{labels:e,pageCount:f,images:b,getPreviousPage:I,getNextPage:w})]}),s.jsx(Ye,{showToast:c,message:e.searchSportal365ImagesErrorMessage,color:"danger",hideToast:x})]})},Qp=$e(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.49 2 2 6.49 2 12s4.49 10 10 10h8c1.1 0 2-.9 2-2v-8c0-5.51-4.49-10-10-10m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"Loupe"),Jp=h.styled("input")`
2350
+ `),j_)),Bp=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:l="md",variant:c="soft",thickness:u,determinate:f=!1,value:d=f?0:25,component:p,slots:g={},slotProps:v={}}=r,m=De(r,z_),b=R({},r,{color:a,size:l,variant:c,thickness:u,value:d,determinate:f,instanceSize:t.size}),C=U_(b),S=R({},m,{component:p,slots:g,slotProps:v}),[x,I]=Ee("root",{ref:n,className:zn(C.root,o),elementType:V_,externalForwardedProps:S,ownerState:b,additionalProps:R({role:"progressbar",style:{"--CircularProgress-percent":d}},d&&f&&{"aria-valuenow":Math.round(typeof d=="number"?d:Number(d||0))})}),[w,A]=Ee("svg",{className:C.svg,elementType:H_,externalForwardedProps:S,ownerState:b}),[E,k]=Ee("track",{className:C.track,elementType:W_,externalForwardedProps:S,ownerState:b}),[$,G]=Ee("progress",{className:C.progress,elementType:G_,externalForwardedProps:S,ownerState:b});return s.jsxs(x,R({},I,{children:[s.jsxs(w,R({},A,{children:[s.jsx(E,R({},k)),s.jsx($,R({},G))]})),i]}))});function Y_(e){return ut("MuiButton",e)}const $p=qe("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),Fp=K.createContext({}),Np=K.createContext(void 0),K_=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],q_=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,fullWidth:o,size:a,variant:l,loading:c}=e,u={root:["root",n&&"disabled",r&&"focusVisible",o&&"fullWidth",l&&`variant${Se(l)}`,t&&`color${Se(t)}`,a&&`size${Se(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},f=gt(u,Y_,{});return r&&i&&(f.root+=` ${i}`),f},Q_=Ce("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),J_=Ce("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),X_=Ce("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Z_=({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:e.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:e.vars.lineHeight.md},t.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},'&:active, &[aria-pressed="true"]':(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],[`&.${$p.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]},t.loadingPosition==="center"&&{[`&.${$p.loading}`]:{color:"transparent"}})]},eP=Ce("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})(Z_),di=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyButton"}),{children:o,action:a,color:l="primary",variant:c="solid",size:u="md",fullWidth:f=!1,startDecorator:d,endDecorator:p,loading:g=!1,loadingPosition:v="center",loadingIndicator:m,disabled:b,component:C,slots:S={},slotProps:x={}}=i,I=De(i,K_),w=K.useContext(Fp),A=K.useContext(Np),E=t.variant||w.variant||c,k=t.size||w.size||u,$=t.color||w.color||l,G=(r=t.loading||t.disabled)!=null?r:w.disabled||g||b,O=K.useRef(null),T=gn(O,n),{focusVisible:F,setFocusVisible:H,getRootProps:j}=Xl(R({},i,{disabled:G,rootRef:T})),N=m!=null?m:s.jsx(Bp,{color:$,thickness:{sm:2,md:3,lg:4}[k]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var ne;H(!0),(ne=O.current)==null||ne.focus()}}),[H]);const M=R({},i,{color:$,fullWidth:f,variant:E,size:k,focusVisible:F,loading:g,loadingPosition:v,disabled:G}),V=q_(M),Y=ne=>{var ue;let be=i.onClick;if(typeof x.root=="function"?be=x.root(M).onClick:x.root&&(be=x.root.onClick),(ue=be)==null||ue(ne),A){var Ne;(Ne=A.onClick)==null||Ne.call(A,ne,i.value)}};let X=i["aria-pressed"];typeof x.root=="function"?X=x.root(M)["aria-pressed"]:x.root&&(X=x.root["aria-pressed"]),A!=null&&A.value&&(Array.isArray(A.value)?X=A.value.indexOf(i.value)!==-1:X=A.value===i.value);const D=R({},I,{component:C,slots:S,slotProps:x}),[B,U]=Ee("root",{ref:n,className:V.root,elementType:eP,externalForwardedProps:D,getSlotProps:j,ownerState:M,additionalProps:{onClick:Y,"aria-pressed":X}}),[W,ie]=Ee("startDecorator",{className:V.startDecorator,elementType:Q_,externalForwardedProps:D,ownerState:M}),[se,oe]=Ee("endDecorator",{className:V.endDecorator,elementType:J_,externalForwardedProps:D,ownerState:M}),[Z,te]=Ee("loadingIndicatorCenter",{className:V.loadingIndicatorCenter,elementType:X_,externalForwardedProps:D,ownerState:M});return s.jsxs(B,R({},U,{children:[(d||g&&v==="start")&&s.jsx(W,R({},ie,{children:g&&v==="start"?N:d})),o,g&&v==="center"&&s.jsx(Z,R({},te,{children:N})),(p||g&&v==="end")&&s.jsx(se,R({},oe,{children:g&&v==="end"?N:p}))]}))});di.muiName="Button";var zp={exports:{}};function tP(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hc={exports:{}};const nP=Gu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var jp;function Wc(){return jp||(jp=1,function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=n||function(r,i){var o;if(typeof window!="undefined"&&window.crypto&&(o=window.crypto),typeof self!="undefined"&&self.crypto&&(o=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window!="undefined"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof jt!="undefined"&&jt.crypto&&(o=jt.crypto),!o&&typeof tP=="function")try{o=nP}catch(S){}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch(S){}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch(S){}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function S(){}return function(x){var I;return S.prototype=x,I=new S,S.prototype=null,I}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(S){var x=l(this);return S&&x.mixIn(S),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var S=this.extend();return S.init.apply(S,arguments),S},init:function(){},mixIn:function(S){for(var x in S)S.hasOwnProperty(x)&&(this[x]=S[x]);S.hasOwnProperty("toString")&&(this.toString=S.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=f.extend({init:function(S,x){S=this.words=S||[],x!=i?this.sigBytes=x:this.sigBytes=S.length*4},toString:function(S){return(S||g).stringify(this)},concat:function(S){var x=this.words,I=S.words,w=this.sigBytes,A=S.sigBytes;if(this.clamp(),w%4)for(var E=0;E<A;E++){var k=I[E>>>2]>>>24-E%4*8&255;x[w+E>>>2]|=k<<24-(w+E)%4*8}else for(var $=0;$<A;$+=4)x[w+$>>>2]=I[$>>>2];return this.sigBytes+=A,this},clamp:function(){var S=this.words,x=this.sigBytes;S[x>>>2]&=4294967295<<32-x%4*8,S.length=r.ceil(x/4)},clone:function(){var S=f.clone.call(this);return S.words=this.words.slice(0),S},random:function(S){for(var x=[],I=0;I<S;I+=4)x.push(a());return new d.init(x,S)}}),p=c.enc={},g=p.Hex={stringify:function(S){for(var x=S.words,I=S.sigBytes,w=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;w.push((E>>>4).toString(16)),w.push((E&15).toString(16))}return w.join("")},parse:function(S){for(var x=S.length,I=[],w=0;w<x;w+=2)I[w>>>3]|=parseInt(S.substr(w,2),16)<<24-w%8*4;return new d.init(I,x/2)}},v=p.Latin1={stringify:function(S){for(var x=S.words,I=S.sigBytes,w=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;w.push(String.fromCharCode(E))}return w.join("")},parse:function(S){for(var x=S.length,I=[],w=0;w<x;w++)I[w>>>2]|=(S.charCodeAt(w)&255)<<24-w%4*8;return new d.init(I,x)}},m=p.Utf8={stringify:function(S){try{return decodeURIComponent(escape(v.stringify(S)))}catch(x){throw new Error("Malformed UTF-8 data")}},parse:function(S){return v.parse(unescape(encodeURIComponent(S)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(S){typeof S=="string"&&(S=m.parse(S)),this._data.concat(S),this._nDataBytes+=S.sigBytes},_process:function(S){var x,I=this._data,w=I.words,A=I.sigBytes,E=this.blockSize,k=E*4,$=A/k;S?$=r.ceil($):$=r.max(($|0)-this._minBufferSize,0);var G=$*E,O=r.min(G*4,A);if(G){for(var T=0;T<G;T+=E)this._doProcessBlock(w,T);x=w.splice(0,G),I.sigBytes-=O}return new d.init(x,O)},clone:function(){var S=f.clone.call(this);return S._data=this._data.clone(),S},_minBufferSize:0});u.Hasher=b.extend({cfg:f.extend(),init:function(S){this.cfg=this.cfg.extend(S),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(S){return this._append(S),this._process(),this},finalize:function(S){S&&this._append(S);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(S){return function(x,I){return new S.init(I).finalize(x)}},_createHmacHelper:function(S){return function(x,I){return new C.HMAC.init(S,I).finalize(x)}}});var C=c.algo={};return c}(Math);return n})}(Hc)),Hc.exports}(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,l=o.Hasher,c=i.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=r.abs(r.sin(m+1))*4294967296|0})();var f=c.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var C=0;C<16;C++){var S=b+C,x=m[S];m[S]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,w=m[b+0],A=m[b+1],E=m[b+2],k=m[b+3],$=m[b+4],G=m[b+5],O=m[b+6],T=m[b+7],F=m[b+8],H=m[b+9],j=m[b+10],N=m[b+11],M=m[b+12],V=m[b+13],Y=m[b+14],X=m[b+15],D=I[0],B=I[1],U=I[2],W=I[3];D=d(D,B,U,W,w,7,u[0]),W=d(W,D,B,U,A,12,u[1]),U=d(U,W,D,B,E,17,u[2]),B=d(B,U,W,D,k,22,u[3]),D=d(D,B,U,W,$,7,u[4]),W=d(W,D,B,U,G,12,u[5]),U=d(U,W,D,B,O,17,u[6]),B=d(B,U,W,D,T,22,u[7]),D=d(D,B,U,W,F,7,u[8]),W=d(W,D,B,U,H,12,u[9]),U=d(U,W,D,B,j,17,u[10]),B=d(B,U,W,D,N,22,u[11]),D=d(D,B,U,W,M,7,u[12]),W=d(W,D,B,U,V,12,u[13]),U=d(U,W,D,B,Y,17,u[14]),B=d(B,U,W,D,X,22,u[15]),D=p(D,B,U,W,A,5,u[16]),W=p(W,D,B,U,O,9,u[17]),U=p(U,W,D,B,N,14,u[18]),B=p(B,U,W,D,w,20,u[19]),D=p(D,B,U,W,G,5,u[20]),W=p(W,D,B,U,j,9,u[21]),U=p(U,W,D,B,X,14,u[22]),B=p(B,U,W,D,$,20,u[23]),D=p(D,B,U,W,H,5,u[24]),W=p(W,D,B,U,Y,9,u[25]),U=p(U,W,D,B,k,14,u[26]),B=p(B,U,W,D,F,20,u[27]),D=p(D,B,U,W,V,5,u[28]),W=p(W,D,B,U,E,9,u[29]),U=p(U,W,D,B,T,14,u[30]),B=p(B,U,W,D,M,20,u[31]),D=g(D,B,U,W,G,4,u[32]),W=g(W,D,B,U,F,11,u[33]),U=g(U,W,D,B,N,16,u[34]),B=g(B,U,W,D,Y,23,u[35]),D=g(D,B,U,W,A,4,u[36]),W=g(W,D,B,U,$,11,u[37]),U=g(U,W,D,B,T,16,u[38]),B=g(B,U,W,D,j,23,u[39]),D=g(D,B,U,W,V,4,u[40]),W=g(W,D,B,U,w,11,u[41]),U=g(U,W,D,B,k,16,u[42]),B=g(B,U,W,D,O,23,u[43]),D=g(D,B,U,W,H,4,u[44]),W=g(W,D,B,U,M,11,u[45]),U=g(U,W,D,B,X,16,u[46]),B=g(B,U,W,D,E,23,u[47]),D=v(D,B,U,W,w,6,u[48]),W=v(W,D,B,U,T,10,u[49]),U=v(U,W,D,B,Y,15,u[50]),B=v(B,U,W,D,G,21,u[51]),D=v(D,B,U,W,M,6,u[52]),W=v(W,D,B,U,k,10,u[53]),U=v(U,W,D,B,j,15,u[54]),B=v(B,U,W,D,A,21,u[55]),D=v(D,B,U,W,F,6,u[56]),W=v(W,D,B,U,X,10,u[57]),U=v(U,W,D,B,O,15,u[58]),B=v(B,U,W,D,V,21,u[59]),D=v(D,B,U,W,$,6,u[60]),W=v(W,D,B,U,N,10,u[61]),U=v(U,W,D,B,E,15,u[62]),B=v(B,U,W,D,H,21,u[63]),I[0]=I[0]+D|0,I[1]=I[1]+B|0,I[2]=I[2]+U|0,I[3]=I[3]+W|0},_doFinalize:function(){var m=this._data,b=m.words,C=this._nDataBytes*8,S=m.sigBytes*8;b[S>>>5]|=128<<24-S%32;var x=r.floor(C/4294967296),I=C;b[(S+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b[(S+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var w=this._hash,A=w.words,E=0;E<4;E++){var k=A[E];A[E]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return w},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function d(m,b,C,S,x,I,w){var A=m+(b&C|~b&S)+x+w;return(A<<I|A>>>32-I)+b}function p(m,b,C,S,x,I,w){var A=m+(b&S|C&~S)+x+w;return(A<<I|A>>>32-I)+b}function g(m,b,C,S,x,I,w){var A=m+(b^C^S)+x+w;return(A<<I|A>>>32-I)+b}function v(m,b,C,S,x,I,w){var A=m+(C^(b|~S))+x+w;return(A<<I|A>>>32-I)+b}i.MD5=l._createHelper(f),i.HmacMD5=l._createHmacHelper(f)}(Math),n.MD5})})(zp);var rP=zp.exports;const Up=yn(rP);var Vp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,a=o.init,l=o.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var u=c.byteLength,f=[],d=0;d<u;d++)f[d>>>2]|=c[d]<<24-d%4*8;a.call(this,f,u)}else a.apply(this,arguments)};l.prototype=o}}(),n.lib.WordArray})})(Vp);var iP=Vp.exports;const Hp=yn(iP);var Wp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Wc())})(jt,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var p=[],g=0;g<f;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,m=u[g+1>>>2]>>>24-(g+1)%4*8&255,b=u[g+2>>>2]>>>24-(g+2)%4*8&255,C=v<<16|m<<8|b,S=0;S<4&&g+S*.75<f;S++)p.push(d.charAt(C>>>6*(3-S)&63));var x=d.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<f.length;p++)d[f.charCodeAt(p)]=p}var g=f.charAt(64);if(g){var v=c.indexOf(g);v!==-1&&(u=v)}return l(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(c,u,f){for(var d=[],p=0,g=0;g<u;g++)if(g%4){var v=f[c.charCodeAt(g-1)]<<g%4*2,m=f[c.charCodeAt(g)]>>>6-g%4*2,b=v|m;d[p>>>2]|=b<<24-p%4*8,p++}return o.create(d,p)}}(),n.enc.Base64})})(Wp);var oP=Wp.exports;const aP=yn(oP);class Gp{constructor(){J(this,"readFileAndHash",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Hp.create(new Uint8Array(a)),u=Up(l).toString(aP);n(u)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}));J(this,"generateHashFileName",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Hp.create(new Uint8Array(a)),c=Up(l).toString();n(c)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}))}}const Yp=({title:e,open:t,imageSrc:n,toggleModal:r})=>s.jsx(h.Modal,{open:t,onClose:r,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{sx:{marginBottom:"10px"},children:e}),s.jsx(h.DialogContent,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx("img",{src:n,alt:"Image modal",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}),Kp=$e(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Ge=()=>{const e=y.useContext(pa);if(!e)throw new Error("useAPIContext must be used within a APIProvider");return e},sP=$e(s.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),lP=({isLoading:e,images:t,onClick:n})=>s.jsxs(s.Fragment,{children:[s.jsx(h.Grid,{container:!0,spacing:2,children:t.map(r=>{var i,o;return s.jsx(h.Grid,{xs:5,sm:4,md:3,children:s.jsxs(h.Box,{sx:{position:"relative",width:"100%","&:hover .overlay":{backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:1},"&:hover .plusSign":{opacity:1}},onClick:()=>{var a,l;return n(((l=(a=r.urls)==null?void 0:a.uploaded)==null?void 0:l.embed)||"")},children:[s.jsx(h.Box,{component:"img",src:(o=(i=r.urls)==null?void 0:i.uploaded)==null?void 0:o.thumbnail,alt:`image-${r.id}`,sx:{width:"100%",height:"auto",borderRadius:"8px"}}),s.jsx(h.Box,{className:"overlay",sx:{position:"absolute",top:0,left:0,right:0,bottom:5,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0)",opacity:0,transition:"background-color 0.3s ease, opacity 0.3s ease",borderRadius:"8px",cursor:"pointer"},children:s.jsx(h.Typography,{className:"plusSign",level:"h2",sx:{color:"white",opacity:0,transition:"opacity 0.3s ease"},children:"+"})})]})},`sportal-image-${r.id}`)})}),e?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}):s.jsx(s.Fragment,{})]}),cP=$e(s.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),uP=$e(s.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),dP=e=>s.jsx(h.Box,{display:"flex",alignItems:"baseline",flexWrap:"wrap",children:s.jsxs(h.Box,{display:"flex",children:[e.pageCount&&e.pageCount!==1&&s.jsx(h.Button,{variant:"outlined",color:"neutral",startDecorator:s.jsx(cP,{}),onClick:e.getPreviousPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:"4px 0 0 4px",borderRight:0,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.previous}),e.images&&e.images.length===20&&s.jsx(h.Button,{variant:"outlined",color:"neutral",endDecorator:s.jsx(uP,{}),onClick:e.getNextPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:e.pageCount!==1?"0 4px 4px 0":"4px",borderLeft:e.pageCount!==1?0:1,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.next})]})}),Xt=$e(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),fP=$e(s.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),hP=({color:e})=>e==="warning"?s.jsx(fP,{}):s.jsx(Xt,{}),Ye=e=>s.jsx(h.Snackbar,{anchorOrigin:{vertical:"top",horizontal:"right"},open:e.showToast,onClose:e.hideToast,autoHideDuration:3e3,color:e.color,startDecorator:s.jsx(hP,{color:e.color}),children:e.message},e.message),bo=({label:e,defaultValue:t,required:n,onChange:r})=>{const i=o=>{r(o.target.value)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Input,{type:"date",defaultValue:t,onChange:i,sx:{backgroundColor:"#fff",borderRadius:"md"}})]})},pP=({labels:e,showFilters:t,onClick:n})=>s.jsx(h.Tooltip,{title:t?e.hideFilters:e.showFilters,children:s.jsx(h.IconButton,{"aria-label":"Filters",onClick:n,children:s.jsx(sP,{})})}),qp=({labels:e,onChangeImages:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(1),[p,g]=y.useState(""),[v,m]=y.useState(null),[b,C]=y.useState([]),{https:S}=Ge();y.useEffect(()=>{E()},[f]);const x=()=>u(!c),I=()=>d($=>$-1),w=()=>d($=>$+1),A=()=>_(this,null,function*(){if(p){o(!0);const $=v?L({},v):null,G=yield S.fetchImagesFromSportal365(p,$,f);if(G){const O=yield G.json();G.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}o(!1)}else C([])}),E=()=>_(this,null,function*(){if(p){l(!0),C([]);const $=v&&v.from&&v.to?L({},v):null,G=yield S.fetchImagesFromSportal365(p,$,f);if(G){const O=yield G.json();G.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}l(!1)}}),k=($,G)=>{m(O=>O?Q(L({},O),{[G]:$}):{[G]:$})};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(h.Input,{value:p,onChange:$=>g($.target.value),sx:{mb:2,width:"100%"},placeholder:e.searchImage,endDecorator:s.jsx(pP,{labels:e,showFilters:n,onClick:()=>r(!n)})}),n?s.jsxs(h.Grid,{container:!0,spacing:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsx(bo,{label:e.fromDate,defaultValue:v==null?void 0:v.from,required:!1,onChange:$=>k($,"from")})}),s.jsx(h.Grid,{xs:6,children:s.jsx(bo,{label:e.toDate,defaultValue:v==null?void 0:v.to,required:!1,onChange:$=>k($,"to")})})]}):s.jsx(s.Fragment,{}),s.jsx(h.Button,{onClick:A,sx:{mb:2,backgroundColor:"#ef8b34","&:hover":{backgroundColor:"#d7772e"},"&:active":{backgroundColor:"#c06c29"}},loading:i,children:e.search}),s.jsx(lP,{images:b,isLoading:a,onClick:t}),s.jsx(dP,{labels:e,pageCount:f,images:b,getPreviousPage:I,getNextPage:w})]}),s.jsx(Ye,{showToast:c,message:e.searchSportal365ImagesErrorMessage,color:"danger",hideToast:x})]})},Qp=$e(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.49 2 2 6.49 2 12s4.49 10 10 10h8c1.1 0 2-.9 2-2v-8c0-5.51-4.49-10-10-10m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"Loupe"),Jp=h.styled("input")`
2351
2351
  clip: rect(0 0 0 0);
2352
2352
  clip-path: inset(50%);
2353
2353
  height: 1px;
@@ -2450,17 +2450,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
2450
2450
  border-left: 0;
2451
2451
  border-right: 0;
2452
2452
  }
2453
- `,MP=1,BP=3,$P=function(e){Ay(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=K.createRef(),n.videoRef=K.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=PP(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var l=OP(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=l.crop,a=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,l,c,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var f=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,g=u.offsetWidth<d||u.offsetHeight<p,v=d/p,m=void 0;if(g)switch(n.state.mediaObjectFit){default:case"contain":m=f>v?{width:n.containerRect.height*v,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/v};break;case"horizontal-cover":m={width:n.containerRect.width,height:n.containerRect.width/v};break;case"vertical-cover":m={width:n.containerRect.height*v,height:n.containerRect.height};break}else m={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Ot(Ot({},m),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var b=n.props.cropSize?n.props.cropSize:AP(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==b.height||((c=n.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(b),n.setState({cropSize:b},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(b),b}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,l=r.y;n.dragStartPosition={x:a,y:l},n.dragStartCrop=Ot({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,l=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?ds(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=IP(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,c;return(c=(l=n.props).onInteractionStart)===null||c===void 0?void 0:c.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,c;return(c=(l=n.props).onInteractionEnd)===null||c===void 0?void 0:c.call(l)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,l=a.crop,c=a.zoom;return{x:(i+l.x)/c,y:(o+l.y)/c}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,l=a.shouldUpdatePosition,c=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=fs(r,n.props.minZoom,n.props.maxZoom);if(c){var f=n.getPointOnContainer(i,n.containerPosition),d=n.getPointOnMedia(f),p={x:d.x*u-f.x,y:d.y*u-f.y},g=n.props.restrictPosition?ds(p,n.mediaSize,n.state.cropSize,u,n.props.rotation):p;n.props.onCropChange(g)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?ds(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return EP(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?ds(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=LP,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,l,c,u,f,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((f=this.props.crop)===null||f===void 0?void 0:f.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,c=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c/u;return f<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=ug(r,i),this.lastPinchRotation=dg(r,i),this.onDragStart(fg(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=fg(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=ug(i,o),c=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(c,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=dg(i,o),f=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(f),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,l=i.mediaProps,c=i.transform,u=i.crop,f=u.x,d=u.y,p=i.rotation,g=i.zoom,v=i.cropShape,m=i.showGrid,b=i.style,C=b.containerStyle,S=b.cropAreaStyle,x=b.mediaStyle,I=i.classes,w=I.containerClassName,A=I.cropAreaClassName,E=I.mediaClassName,k=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return K.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(G){return n.containerRef=G},"data-testid":"container",style:C,className:hs("reactEasyCrop_Container",w)},o?K.createElement("img",Ot({alt:"",className:hs("reactEasyCrop_Image",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:o,ref:this.imageRef,style:Ot(Ot({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):a&&K.createElement("video",Ot({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:hs("reactEasyCrop_Video",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ot(Ot({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function($){return K.createElement("source",Ot({key:$.src},$))})),this.state.cropSize&&K.createElement("div",{style:Ot(Ot({},S),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:hs("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",A)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:BP,minZoom:MP,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(K.Component);const FP=e=>new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",i=>n(i)),r.crossOrigin="Anonymous",r.src=e});function NP(e){return e*Math.PI/180}function zP(e,t,n=0){return _(this,null,function*(){const r=yield FP(e),i=document.createElement("canvas"),o=i.getContext("2d"),l=2*(Math.max(r.width,r.height)/2*Math.sqrt(2));i.width=l,i.height=l,o.translate(l/2,l/2),o.rotate(NP(n)),o.translate(-l/2,-l/2),o.drawImage(r,l/2-r.width*.5,l/2-r.height*.5);const c=o.getImageData(0,0,l,l);return i.width=t.width,i.height=t.height,o.putImageData(c,Math.round(0-l/2+r.width*.5-t.x),Math.round(0-l/2+r.height*.5-t.y)),new Promise(u=>i.toBlob(f=>{const d=new File([f],`cropped_image_${Date.now()}.jpeg`,{type:"image/jpeg"});u(d)},"image/jpeg"))})}const hg=({labels:e,open:t,imageSrc:n,resetDefaultImageUrl:r,toggleModal:i,uploadImage:o})=>{const[a,l]=y.useState({x:0,y:0}),[c,u]=y.useState(1),[f,d]=y.useState(16/9),[p,g]=y.useState(null),v=(x,I)=>{g(I)},m=(x,I)=>d(I),b=()=>_(this,null,function*(){const x=yield zP(n,p);S(),o(x)}),C=()=>{S(),r()},S=()=>{l({x:0,y:0}),u(1),d(16/9),g(null)};return s.jsx(h.Modal,{open:t,onClose:i,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{children:e.cropImage}),s.jsxs(h.DialogContent,{sx:{width:"100%"},children:[s.jsx(h.Box,{position:"relative",height:"100%",width:"100%",mb:2,children:s.jsx($P,{image:n,crop:a,zoom:c,aspect:f,onCropChange:l,onCropComplete:v,onZoomChange:u})}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.aspectRatio}),s.jsxs(h.Select,{value:f,onChange:m,children:[s.jsx(h.Option,{value:4/3,children:"4 / 3"}),s.jsx(h.Option,{value:16/9,children:"16 / 9"}),s.jsx(h.Option,{value:1,children:"1"})]})]}),s.jsx(h.Box,{mb:1,mx:2,children:s.jsx(h.Slider,{value:c,min:1,max:3,step:.1,onChange:(x,I)=>u(I)})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{color:"primary",onClick:b,loading:!1,children:e.crop}),s.jsx(h.Button,{color:"primary",variant:"outlined",onClick:C,loading:!1,children:e.reset})]})]})]})})},pg=$e(s.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"CropOutlined"),gg=({labels:e,title:t,image:n,onChangeImages:r,clearImage:i})=>{const[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState("primary"),[C,S]=y.useState(""),x=y.useRef(null),I=()=>p(!d),w=()=>{x.current&&x.current.click()},A=new Gp,E=y.useContext(pa),k=()=>{v(""),c(!1)},$=L=>{let V="",Y="primary";switch(L){case"copy_url":V=e.urlCopiedToClipboardMessage,Y="primary";break;case"image_deleted":V=e.imageDeletedMessage,Y="primary";break;case"image_reset":V=e.imageResetMessage,Y="primary";break;case"upload_success":V=e.uploadingImageMessage,Y="success";break;case"upload_failed":V=e.uploadingImageErrorMessage,Y="danger";break;case"sign_in_url_failed":V=e.generateSignedInUrlErrorMessage,Y="danger";break;case"encrypting_file_failed":V=e.encryptingImageErrorMessage,Y="danger";break}b(Y),v(V),c(!0)},G=()=>f(!u),O=()=>{i(),$("image_deleted")},T=L=>{navigator.clipboard.writeText(L),$("copy_url")},F=L=>_(this,null,function*(){L.persist();const V=L.target.files?L.target.files[0]:null;if(V){a(!0);try{const Y=V.type.split("/")[1],X=yield A.readFileAndHash(V),D=(yield A.generateHashFileName(V))+"."+Y,B={image_type:Y,image_file_name:D,image_size:V.size,base64_sum:X},U=yield E==null?void 0:E.https.generateSignedInUrl(B);if(U!=null&&U.ok){const W=yield U.json(),ie={"Content-Type":V.type,"Content-MD5":X};try{const se=new File([V],D,{type:V.type}),oe=yield E==null?void 0:E.https.storeInBucket(W.data.signed_url,se,ie);r(oe||""),S(oe),$("upload_success")}catch(se){console.error("There was a problem with uploading the file: ",se),$("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield U==null?void 0:U.json()),$("sign_in_url_failed")}catch(Y){console.error("There was a problem with encrypting file...",Y),$("encrypting_file_failed")}a(!1)}}),H=L=>_(this,null,function*(){if(L){a(!0);try{const V=L.type.split("/")[1],Y=yield A.readFileAndHash(L),X=(yield A.generateHashFileName(L))+"."+V,D={image_type:V,image_file_name:X,image_size:L.size,base64_sum:Y},B=yield E==null?void 0:E.https.generateSignedInUrl(D);if(B!=null&&B.ok){const U=yield B.json(),W={"Content-Type":L.type,"Content-MD5":Y};try{const ie=new File([L],X,{type:L.type}),se=yield E==null?void 0:E.https.storeInBucket(U.data.signed_url,ie,W);r(se||""),$("upload_success")}catch(ie){console.error("There was a problem with uploading the file: ",ie),$("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield B==null?void 0:B.json()),$("sign_in_url_failed")}catch(V){console.error("There was a problem with encrypting file...",V),$("encrypting_file_failed")}a(!1)}}),j=()=>{r(C),$("image_reset")},N=L=>{r(L),S(L)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:t}),s.jsx(h.Tooltip,{title:e.clearImage,children:s.jsx(h.IconButton,{"aria-label":e.clearImage,variant:"plain",color:"danger",size:"sm",onClick:O,children:s.jsx(Lp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:o,animation:"wave",children:[n?s.jsx(h.Box,{component:"img",src:n,loading:"lazy",alt:t,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(Uc,{sx:{fontSize:"3rem",opacity:.2}}),n?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Kp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.copyUrl,children:s.jsx(di,{onClick:()=>T(n),disabled:!n,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.viewImage,children:s.jsx(di,{onClick:G,disabled:!n,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(Qp,{})})}),s.jsx(h.Tooltip,{title:e.cropImage,children:s.jsx(di,{onClick:I,disabled:!n,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(pg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(di,{sx:{width:"100%"},onClick:w,children:[s.jsx(_e.Upload,{})," ",e.uploadImage,s.jsx(Jp,{type:"file",accept:"image/*",onChange:F,ref:x})]})}),E!=null&&E.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(qp,{labels:e,onChangeImages:N})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ye,{showToast:l,message:g,color:m,hideToast:k}),s.jsx(Yp,{title:e.viewImage,open:u,imageSrc:n,toggleModal:G}),s.jsx(hg,{labels:e,open:d,imageSrc:n,toggleModal:I,uploadImage:H,resetDefaultImageUrl:j})]})},jP=e=>new Map().set("main_logo",e.mainLogo).set("mobile_logo",e.mobileLogo).set("background_image",e.backgroundImage).set("mobile_background_image",e.mobileBackgroundImage).set("additional_image",e.additionalImage),UP=e=>new Map().set("primary_color",e.primaryColor).set("secondary_color",e.secondaryColor).set("content_color",e.contentColor).set("background_color",e.backgroundColor).set("border_color",e.borderColor).set("additional_color",e.additionalColor),VP=e=>new Map().set("primary_url",e.primaryUrl).set("secondary_url",e.secondaryUrl).set("privacy_policy_url",e.privacyPolicyUrl).set("terms_and_conditions_url",e.termsAndConditionsUrl).set("additional_url",e.additionalUrl),HP=({labels:e,defaultValue:t,onChange:n})=>{const[r,i]=y.useState(!1),o=JSON.parse(JSON.stringify(t)),a=["mobile_logo","background_image","mobile_background_image","additional_image"],l=jP(e),c=UP(e),u=VP(e),f=(v,m)=>{const b=v.target.value;o.colors[m]=b,n(o)},d=(v,m)=>{const b=v.target.value;o.urls[m]=b,n(o)},p=(v,m)=>{o.images[m]=v,n(o)},g=v=>{o.images[v]="",n(o)};return s.jsx(h.Box,{children:s.jsxs(Zh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(ep,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ac.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(Uc,{sx:{width:"20px"}})}),e.images]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(g_,{sx:{width:"20px"}})}),e.colors]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(m_,{sx:{width:"20px"}})}),e.urls]})]}),s.jsxs(ci,{value:0,sx:{px:0},children:[s.jsx(gg,{labels:e,title:e.mainLogo,image:o.images.main_logo,onChangeImages:v=>p(v,"main_logo"),clearImage:()=>g("main_logo")}),s.jsx(h.Link,{underline:"hover",onClick:()=>i(!r),sx:{marginBottom:"10px"},children:r?e.hideMoreImages:e.showMoreImages}),r?s.jsx(s.Fragment,{children:a.map(v=>s.jsx(gg,{labels:e,title:l.get(v),image:o.images[v],onChangeImages:m=>p(m,v),clearImage:()=>g(v)},`branding-image-${v}`))}):s.jsx(s.Fragment,{})]}),s.jsx(ci,{value:1,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.colors).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{size:"sm",label:c.get(v),placeholder:"",defaultValue:o.colors[v],required:!1,onChange:m=>f(m,v)})},`branding-color-${v}`))})}),s.jsx(ci,{value:2,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.urls).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{size:"sm",label:u.get(v),placeholder:"",defaultValue:o.urls[v],required:!1,onChange:m=>d(m,v)})},`branding-url-${v}`))})})]})})},mg=$e(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),vg=e=>{const t=()=>_(this,null,function*(){yield ro(e.environment).signOut()});return s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:t,children:e.signOutLabel})},WP=$e(s.jsx("path",{d:"m8.71 11.71 2.59 2.59c.39.39 1.02.39 1.41 0l2.59-2.59c.63-.63.18-1.71-.71-1.71H9.41c-.89 0-1.33 1.08-.7 1.71"}),"ArrowDropDownRounded"),GP=$e(s.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined"),YP=(e,t)=>{let n=[{id:"football_post_match",label:t.generateFootballPostMatchLabel}];switch(e){case"classic_quiz":n=[...n,{id:"formula1_post_event",label:(t==null?void 0:t.generateFormula1PostEventLabel)||""}];break}return n},KP=({createLabel:e,createFromTemplateLabel:t,signOutLabel:n,generateLabels:r,entityType:i,environment:o,onClickCreate:a,onClickCreateFromTemplate:l,onClickGenerate:c})=>{const u=()=>{if(!r||!c)return s.jsx(s.Fragment,{});const f=YP(i,r);return s.jsxs(h.Dropdown,{children:[s.jsxs(h.ButtonGroup,{variant:"solid",size:"md",color:"neutral",children:[s.jsx(h.MenuButton,{slots:{root:h.Button},startDecorator:s.jsx(GP,{}),sx:{border:1,borderColor:"neutral.outlinedBorder",borderRight:"none",borderTopRightRadius:0,borderBottomRightRadius:0,bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"}},children:r.generateAIEntityLabel}),s.jsx(h.MenuButton,{slots:{root:h.IconButton},"aria-label":"More AI quiz options",sx:{border:1,borderColor:"neutral.outlinedBorder",borderLeft:"none",bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"},borderTopRightRadius:"6px !important",borderBottomRightRadius:"6px !important"},children:s.jsx(WP,{})})]}),s.jsx(h.Menu,{placement:"bottom",sx:{maxHeight:240,borderRadius:12,boxShadow:"md"},children:f.map(d=>s.jsx(h.MenuItem,{onClick:()=>c(d.id),children:d.label},d.id))})]})};return s.jsx(s.Fragment,{children:s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",p:1,sx:()=>({marginBottom:"16px"}),children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",spacing:2,children:[s.jsx(h.Button,{startDecorator:s.jsx(mg,{}),variant:"solid",color:"primary",onClick:a,children:e}),t?s.jsx(h.Button,{startDecorator:s.jsx(mg,{}),variant:"outlined",color:"primary",onClick:l,children:t}):s.jsx(s.Fragment,{}),u()]}),n?s.jsx(vg,{signOutLabel:n,environment:o}):s.jsx(s.Fragment,{})]})})};var bg={},eu=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],hi={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console!="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yo={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Wt=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},dn=function(e){return e===!0?1:0};function yg(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var tu=function(e){return e instanceof Array?e:[e]};function Ft(e,t,n){if(n===!0)return e.classList.add(t);e.classList.remove(t)}function Fe(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,n!==void 0&&(r.textContent=n),r}function ps(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function xg(e,t){if(t(e))return e;if(e.parentNode)return xg(e.parentNode,t)}function gs(e,t){var n=Fe("div","numInputWrapper"),r=Fe("input","numInput "+e),i=Fe("span","arrowUp"),o=Fe("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}function Zt(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch(n){return e.target}}var nu=function(){},ms=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},qP={D:nu,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*dn(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:nu,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:nu,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Pr={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},xo={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[xo.w(e,t,n)]},F:function(e,t,n){return ms(xo.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Wt(xo.h(e,t,n))},H:function(e){return Wt(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[dn(e.getHours()>11)]},M:function(e,t){return ms(e.getMonth(),!0,t)},S:function(e){return Wt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return Wt(e.getFullYear(),4)},d:function(e){return Wt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Wt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Wt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},Cg=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?yo:r,o=e.isMobile,a=o===void 0?!1:o;return function(l,c,u){var f=u||i;return n.formatDate!==void 0&&!a?n.formatDate(l,c,f):c.split("").map(function(d,p,g){return xo[d]&&g[p-1]!=="\\"?xo[d](l,f,n):d!=="\\"?d:""}).join("")}},ru=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?yo:r;return function(o,a,l,c){if(!(o!==0&&!o)){var u=c||i,f,d=o;if(o instanceof Date)f=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)f=new Date(o);else if(typeof o=="string"){var p=a||(n||hi).dateFormat,g=String(o).trim();if(g==="today")f=new Date,l=!0;else if(n&&n.parseDate)f=n.parseDate(o,p);else if(/Z$/.test(g)||/GMT$/.test(g))f=new Date(o);else{for(var v=void 0,m=[],b=0,C=0,S="";b<p.length;b++){var x=p[b],I=x==="\\",w=p[b-1]==="\\"||I;if(Pr[x]&&!w){S+=Pr[x];var A=new RegExp(S).exec(o);A&&(v=!0)&&m[x!=="Y"?"push":"unshift"]({fn:qP[x],val:A[++C]})}else I||(S+=".")}f=!n||!n.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),m.forEach(function(E){var k=E.fn,$=E.val;return f=k(f,$,u)||f}),f=v?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){n.errorHandler(new Error("Invalid date provided: "+d));return}return l===!0&&f.setHours(0,0,0,0),f}}};function en(e,t,n){return n===void 0&&(n=!0),n!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var QP=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},iu=function(e,t,n){return e*3600+t*60+n},JP=function(e){var t=Math.floor(e/3600),n=(e-t*3600)/60;return[t,n,e-t*3600-n*60]},XP={DAY:864e5};function ou(e){var t=e.defaultHour,n=e.defaultMinute,r=e.defaultSeconds;if(e.minDate!==void 0){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<o&&(n=o),t===i&&n===o&&r<a&&(r=e.minDate.getSeconds())}if(e.maxDate!==void 0){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();t=Math.min(t,l),t===l&&(n=Math.min(c,n)),t===l&&n===c&&(r=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var r=function(l){l&&Object.keys(l).forEach(function(c){return e[c]=l[c]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return e});var Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Mt.apply(this,arguments)},wg=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,l=o.length;a<l;a++,i++)r[i]=o[a];return r},ZP=300;function eD(e,t){var n={config:Mt(Mt({},hi),vt.defaultConfig),l10n:yo};n.parseDate=ru({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=m,n._setHoursFromDate=p,n._positionCalendar=xe,n.changeMonth=D,n.changeYear=oe,n.clear=B,n.close=U,n.onMouseOver=be,n._createElement=Fe,n.createDay=A,n.destroy=W,n.isEnabled=Z,n.jumpToDate=S,n.updateValue=tn,n.open=ht,n.redraw=Oe,n.set=Bt,n.setDate=zt,n.toggle=zo;function r(){n.utils={getDaysInMonth:function(P,z){return P===void 0&&(P=n.currentMonth),z===void 0&&(z=n.currentYear),P===1&&(z%4===0&&z%100!==0||z%400===0)?29:n.l10n.daysInMonth[P]}}}function i(){n.element=n.input=e,n.isOpen=!1,_t(),ge(),hn(),Ei(),r(),n.isMobile||w(),C(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&p(n.config.noCalendar?n.latestSelectedDateObj:void 0),tn(!1)),l();var P=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&P&&xe(),ze("onReady")}function o(){var P;return((P=n.calendarContainer)===null||P===void 0?void 0:P.getRootNode()).activeElement||document.activeElement}function a(P){return P.bind(n)}function l(){var P=n.config;P.weekNumbers===!1&&P.showMonths===1||P.noCalendar!==!0&&window.requestAnimationFrame(function(){if(n.calendarContainer!==void 0&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),n.daysContainer!==void 0){var z=(n.days.offsetWidth+1)*P.showMonths;n.daysContainer.style.width=z+"px",n.calendarContainer.style.width=z+(n.weekWrapper!==void 0?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function c(P){if(n.selectedDates.length===0){var z=n.config.minDate===void 0||en(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),q=ou(n.config);z.setHours(q.hours,q.minutes,q.seconds,z.getMilliseconds()),n.selectedDates=[z],n.latestSelectedDateObj=z}P!==void 0&&P.type!=="blur"&&bt(P);var ee=n._input.value;d(),tn(),n._input.value!==ee&&n._debouncedChange()}function u(P,z){return P%12+12*dn(z===n.l10n.amPM[1])}function f(P){switch(P%24){case 0:case 12:return 12;default:return P%12}}function d(){if(!(n.hourElement===void 0||n.minuteElement===void 0)){var P=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(n.minuteElement.value,10)||0)%60,q=n.secondElement!==void 0?(parseInt(n.secondElement.value,10)||0)%60:0;n.amPM!==void 0&&(P=u(P,n.amPM.textContent));var ee=n.config.minTime!==void 0||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.minDate,!0)===0,ae=n.config.maxTime!==void 0||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.maxDate,!0)===0;if(n.config.maxTime!==void 0&&n.config.minTime!==void 0&&n.config.minTime>n.config.maxTime){var ce=iu(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),we=iu(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),de=iu(P,z,q);if(de>we&&de<ce){var Ie=JP(ce);P=Ie[0],z=Ie[1],q=Ie[2]}}else{if(ae){var pe=n.config.maxTime!==void 0?n.config.maxTime:n.config.maxDate;P=Math.min(P,pe.getHours()),P===pe.getHours()&&(z=Math.min(z,pe.getMinutes())),z===pe.getMinutes()&&(q=Math.min(q,pe.getSeconds()))}if(ee){var ve=n.config.minTime!==void 0?n.config.minTime:n.config.minDate;P=Math.max(P,ve.getHours()),P===ve.getHours()&&z<ve.getMinutes()&&(z=ve.getMinutes()),z===ve.getMinutes()&&(q=Math.max(q,ve.getSeconds()))}}g(P,z,q)}}function p(P){var z=P||n.latestSelectedDateObj;z&&z instanceof Date&&g(z.getHours(),z.getMinutes(),z.getSeconds())}function g(P,z,q){n.latestSelectedDateObj!==void 0&&n.latestSelectedDateObj.setHours(P%24,z,q||0,0),!(!n.hourElement||!n.minuteElement||n.isMobile)&&(n.hourElement.value=Wt(n.config.time_24hr?P:(12+P)%12+12*dn(P%12===0)),n.minuteElement.value=Wt(z),n.amPM!==void 0&&(n.amPM.textContent=n.l10n.amPM[dn(P>=12)]),n.secondElement!==void 0&&(n.secondElement.value=Wt(q)))}function v(P){var z=Zt(P),q=parseInt(z.value)+(P.delta||0);(q/1e3>1||P.key==="Enter"&&!/[^\d]/.test(q.toString()))&&oe(q)}function m(P,z,q,ee){if(z instanceof Array)return z.forEach(function(ae){return m(P,ae,q,ee)});if(P instanceof Array)return P.forEach(function(ae){return m(ae,z,q,ee)});P.addEventListener(z,q,ee),n._handlers.push({remove:function(){return P.removeEventListener(z,q,ee)}})}function b(){ze("onChange")}function C(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(q){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+q+"]"),function(ee){return m(ee,"click",n[q])})}),n.isMobile){No();return}var P=yg(Ne,50);if(n._debouncedChange=yg(b,ZP),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(n.daysContainer,"mouseover",function(q){n.config.mode==="range"&&be(Zt(q))}),m(n._input,"keydown",ue),n.calendarContainer!==void 0&&m(n.calendarContainer,"keydown",ue),!n.config.inline&&!n.config.static&&m(window,"resize",P),window.ontouchstart!==void 0?m(window.document,"touchstart",se):m(window.document,"mousedown",se),m(window.document,"focus",se,{capture:!0}),n.config.clickOpens===!0&&(m(n._input,"focus",n.open),m(n._input,"click",n.open)),n.daysContainer!==void 0&&(m(n.monthNav,"click",_i),m(n.monthNav,["keyup","increment"],v),m(n.daysContainer,"click",St)),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0){var z=function(q){return Zt(q).select()};m(n.timeContainer,["increment"],c),m(n.timeContainer,"blur",c,{capture:!0}),m(n.timeContainer,"click",x),m([n.hourElement,n.minuteElement],["focus","click"],z),n.secondElement!==void 0&&m(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),n.amPM!==void 0&&m(n.amPM,"click",function(q){c(q)})}n.config.allowInput&&m(n._input,"blur",ne)}function S(P,z){var q=P!==void 0?n.parseDate(P):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),ee=n.currentYear,ae=n.currentMonth;try{q!==void 0&&(n.currentYear=q.getFullYear(),n.currentMonth=q.getMonth())}catch(ce){ce.message="Invalid date supplied: "+q,n.config.errorHandler(ce)}z&&n.currentYear!==ee&&(ze("onYearChange"),F()),z&&(n.currentYear!==ee||n.currentMonth!==ae)&&ze("onMonthChange"),n.redraw()}function x(P){var z=Zt(P);~z.className.indexOf("arrow")&&I(P,z.classList.contains("arrowUp")?1:-1)}function I(P,z,q){var ee=P&&Zt(P),ae=q||ee&&ee.parentNode&&ee.parentNode.firstChild,ce=hr("increment");ce.delta=z,ae&&ae.dispatchEvent(ce)}function w(){var P=window.document.createDocumentFragment();if(n.calendarContainer=Fe("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(P.appendChild(N()),n.innerContainer=Fe("div","flatpickr-innerContainer"),n.config.weekNumbers){var z=X(),q=z.weekWrapper,ee=z.weekNumbers;n.innerContainer.appendChild(q),n.weekNumbers=ee,n.weekWrapper=q}n.rContainer=Fe("div","flatpickr-rContainer"),n.rContainer.appendChild(V()),n.daysContainer||(n.daysContainer=Fe("div","flatpickr-days"),n.daysContainer.tabIndex=-1),T(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),P.appendChild(n.innerContainer)}n.config.enableTime&&P.appendChild(L()),Ft(n.calendarContainer,"rangeMode",n.config.mode==="range"),Ft(n.calendarContainer,"animate",n.config.animate===!0),Ft(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(P);var ae=n.config.appendTo!==void 0&&n.config.appendTo.nodeType!==void 0;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!ae&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):n.config.appendTo!==void 0&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var ce=Fe("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(ce,n.element),ce.appendChild(n.element),n.altInput&&ce.appendChild(n.altInput),ce.appendChild(n.calendarContainer)}!n.config.static&&!n.config.inline&&(n.config.appendTo!==void 0?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}function A(P,z,q,ee){var ae=Z(z,!0),ce=Fe("span",P,z.getDate().toString());return ce.dateObj=z,ce.$i=ee,ce.setAttribute("aria-label",n.formatDate(z,n.config.ariaDateFormat)),P.indexOf("hidden")===-1&&en(z,n.now)===0&&(n.todayDateElem=ce,ce.classList.add("today"),ce.setAttribute("aria-current","date")),ae?(ce.tabIndex=-1,Lr(z)&&(ce.classList.add("selected"),n.selectedDateElem=ce,n.config.mode==="range"&&(Ft(ce,"startRange",n.selectedDates[0]&&en(z,n.selectedDates[0],!0)===0),Ft(ce,"endRange",n.selectedDates[1]&&en(z,n.selectedDates[1],!0)===0),P==="nextMonthDay"&&ce.classList.add("inRange")))):ce.classList.add("flatpickr-disabled"),n.config.mode==="range"&&ki(z)&&!Lr(z)&&ce.classList.add("inRange"),n.weekNumbers&&n.config.showMonths===1&&P!=="prevMonthDay"&&ee%7===6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(z)+"</span>"),ze("onDayCreate",ce),ce}function E(P){P.focus(),n.config.mode==="range"&&be(P)}function k(P){for(var z=P>0?0:n.config.showMonths-1,q=P>0?n.config.showMonths:-1,ee=z;ee!=q;ee+=P)for(var ae=n.daysContainer.children[ee],ce=P>0?0:ae.children.length-1,we=P>0?ae.children.length:-1,de=ce;de!=we;de+=P){var Ie=ae.children[de];if(Ie.className.indexOf("hidden")===-1&&Z(Ie.dateObj))return Ie}}function $(P,z){for(var q=P.className.indexOf("Month")===-1?P.dateObj.getMonth():n.currentMonth,ee=z>0?n.config.showMonths:-1,ae=z>0?1:-1,ce=q-n.currentMonth;ce!=ee;ce+=ae)for(var we=n.daysContainer.children[ce],de=q-n.currentMonth===ce?P.$i+z:z<0?we.children.length-1:0,Ie=we.children.length,pe=de;pe>=0&&pe<Ie&&pe!=(z>0?Ie:-1);pe+=ae){var ve=we.children[pe];if(ve.className.indexOf("hidden")===-1&&Z(ve.dateObj)&&Math.abs(P.$i-pe)>=Math.abs(z))return E(ve)}n.changeMonth(ae),G(k(ae),0)}function G(P,z){var q=o(),ee=te(q||document.body),ae=P!==void 0?P:ee?q:n.selectedDateElem!==void 0&&te(n.selectedDateElem)?n.selectedDateElem:n.todayDateElem!==void 0&&te(n.todayDateElem)?n.todayDateElem:k(z>0?1:-1);ae===void 0?n._input.focus():ee?$(ae,z):E(ae)}function O(P,z){for(var q=(new Date(P,z,1).getDay()-n.l10n.firstDayOfWeek+7)%7,ee=n.utils.getDaysInMonth((z-1+12)%12,P),ae=n.utils.getDaysInMonth(z,P),ce=window.document.createDocumentFragment(),we=n.config.showMonths>1,de=we?"prevMonthDay hidden":"prevMonthDay",Ie=we?"nextMonthDay hidden":"nextMonthDay",pe=ee+1-q,ve=0;pe<=ee;pe++,ve++)ce.appendChild(A("flatpickr-day "+de,new Date(P,z-1,pe),pe,ve));for(pe=1;pe<=ae;pe++,ve++)ce.appendChild(A("flatpickr-day",new Date(P,z,pe),pe,ve));for(var Le=ae+1;Le<=42-q&&(n.config.showMonths===1||ve%7!==0);Le++,ve++)ce.appendChild(A("flatpickr-day "+Ie,new Date(P,z+1,Le%ae),Le,ve));var Pt=Fe("div","dayContainer");return Pt.appendChild(ce),Pt}function T(){if(n.daysContainer!==void 0){ps(n.daysContainer),n.weekNumbers&&ps(n.weekNumbers);for(var P=document.createDocumentFragment(),z=0;z<n.config.showMonths;z++){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),P.appendChild(O(q.getFullYear(),q.getMonth()))}n.daysContainer.appendChild(P),n.days=n.daysContainer.firstChild,n.config.mode==="range"&&n.selectedDates.length===1&&be()}}function F(){if(!(n.config.showMonths>1||n.config.monthSelectorType!=="dropdown")){var P=function(ee){return n.config.minDate!==void 0&&n.currentYear===n.config.minDate.getFullYear()&&ee<n.config.minDate.getMonth()?!1:!(n.config.maxDate!==void 0&&n.currentYear===n.config.maxDate.getFullYear()&&ee>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(P(z)){var q=Fe("option","flatpickr-monthDropdown-month");q.value=new Date(n.currentYear,z).getMonth().toString(),q.textContent=ms(z,n.config.shorthandCurrentMonth,n.l10n),q.tabIndex=-1,n.currentMonth===z&&(q.selected=!0),n.monthsDropdownContainer.appendChild(q)}}}function H(){var P=Fe("div","flatpickr-month"),z=window.document.createDocumentFragment(),q;n.config.showMonths>1||n.config.monthSelectorType==="static"?q=Fe("span","cur-month"):(n.monthsDropdownContainer=Fe("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),m(n.monthsDropdownContainer,"change",function(we){var de=Zt(we),Ie=parseInt(de.value,10);n.changeMonth(Ie-n.currentMonth),ze("onMonthChange")}),F(),q=n.monthsDropdownContainer);var ee=gs("cur-year",{tabindex:"-1"}),ae=ee.getElementsByTagName("input")[0];ae.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&ae.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(ae.setAttribute("max",n.config.maxDate.getFullYear().toString()),ae.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var ce=Fe("div","flatpickr-current-month");return ce.appendChild(q),ce.appendChild(ee),z.appendChild(ce),P.appendChild(z),{container:P,yearElement:ae,monthElement:q}}function j(){ps(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var P=n.config.showMonths;P--;){var z=H();n.yearElements.push(z.yearElement),n.monthElements.push(z.monthElement),n.monthNav.appendChild(z.container)}n.monthNav.appendChild(n.nextMonthNav)}function N(){return n.monthNav=Fe("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=Fe("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=Fe("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,j(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(P){n.__hidePrevMonthArrow!==P&&(Ft(n.prevMonthNav,"flatpickr-disabled",P),n.__hidePrevMonthArrow=P)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(P){n.__hideNextMonthArrow!==P&&(Ft(n.nextMonthNav,"flatpickr-disabled",P),n.__hideNextMonthArrow=P)}}),n.currentYearElement=n.yearElements[0],pr(),n.monthNav}function L(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var P=ou(n.config);n.timeContainer=Fe("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var z=Fe("span","flatpickr-time-separator",":"),q=gs("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=q.getElementsByTagName("input")[0];var ee=gs("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=ee.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?P.hours:f(P.hours)),n.minuteElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():P.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(q),n.timeContainer.appendChild(z),n.timeContainer.appendChild(ee),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var ae=gs("flatpickr-second");n.secondElement=ae.getElementsByTagName("input")[0],n.secondElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():P.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(Fe("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(ae)}return n.config.time_24hr||(n.amPM=Fe("span","flatpickr-am-pm",n.l10n.amPM[dn((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}function V(){n.weekdayContainer?ps(n.weekdayContainer):n.weekdayContainer=Fe("div","flatpickr-weekdays");for(var P=n.config.showMonths;P--;){var z=Fe("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(z)}return Y(),n.weekdayContainer}function Y(){if(n.weekdayContainer){var P=n.l10n.firstDayOfWeek,z=wg(n.l10n.weekdays.shorthand);P>0&&P<z.length&&(z=wg(z.splice(P,z.length),z.splice(0,P)));for(var q=n.config.showMonths;q--;)n.weekdayContainer.children[q].innerHTML=`
2453
+ `,MP=1,BP=3,$P=function(e){Ay(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=K.createRef(),n.videoRef=K.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=PP(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var l=OP(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=l.crop,a=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,l,c,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var f=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,g=u.offsetWidth<d||u.offsetHeight<p,v=d/p,m=void 0;if(g)switch(n.state.mediaObjectFit){default:case"contain":m=f>v?{width:n.containerRect.height*v,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/v};break;case"horizontal-cover":m={width:n.containerRect.width,height:n.containerRect.width/v};break;case"vertical-cover":m={width:n.containerRect.height*v,height:n.containerRect.height};break}else m={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Ot(Ot({},m),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var b=n.props.cropSize?n.props.cropSize:AP(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==b.height||((c=n.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(b),n.setState({cropSize:b},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(b),b}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,l=r.y;n.dragStartPosition={x:a,y:l},n.dragStartCrop=Ot({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,l=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?ds(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=IP(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,c;return(c=(l=n.props).onInteractionStart)===null||c===void 0?void 0:c.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,c;return(c=(l=n.props).onInteractionEnd)===null||c===void 0?void 0:c.call(l)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,l=a.crop,c=a.zoom;return{x:(i+l.x)/c,y:(o+l.y)/c}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,l=a.shouldUpdatePosition,c=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=fs(r,n.props.minZoom,n.props.maxZoom);if(c){var f=n.getPointOnContainer(i,n.containerPosition),d=n.getPointOnMedia(f),p={x:d.x*u-f.x,y:d.y*u-f.y},g=n.props.restrictPosition?ds(p,n.mediaSize,n.state.cropSize,u,n.props.rotation):p;n.props.onCropChange(g)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?ds(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return EP(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?ds(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=LP,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,l,c,u,f,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((f=this.props.crop)===null||f===void 0?void 0:f.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,c=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c/u;return f<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=ug(r,i),this.lastPinchRotation=dg(r,i),this.onDragStart(fg(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=fg(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=ug(i,o),c=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(c,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=dg(i,o),f=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(f),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,l=i.mediaProps,c=i.transform,u=i.crop,f=u.x,d=u.y,p=i.rotation,g=i.zoom,v=i.cropShape,m=i.showGrid,b=i.style,C=b.containerStyle,S=b.cropAreaStyle,x=b.mediaStyle,I=i.classes,w=I.containerClassName,A=I.cropAreaClassName,E=I.mediaClassName,k=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return K.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(G){return n.containerRef=G},"data-testid":"container",style:C,className:hs("reactEasyCrop_Container",w)},o?K.createElement("img",Ot({alt:"",className:hs("reactEasyCrop_Image",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:o,ref:this.imageRef,style:Ot(Ot({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):a&&K.createElement("video",Ot({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:hs("reactEasyCrop_Video",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ot(Ot({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function($){return K.createElement("source",Ot({key:$.src},$))})),this.state.cropSize&&K.createElement("div",{style:Ot(Ot({},S),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:hs("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",A)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:BP,minZoom:MP,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(K.Component);const FP=e=>new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",i=>n(i)),r.crossOrigin="Anonymous",r.src=e});function NP(e){return e*Math.PI/180}function zP(e,t,n=0){return _(this,null,function*(){const r=yield FP(e),i=document.createElement("canvas"),o=i.getContext("2d"),l=2*(Math.max(r.width,r.height)/2*Math.sqrt(2));i.width=l,i.height=l,o.translate(l/2,l/2),o.rotate(NP(n)),o.translate(-l/2,-l/2),o.drawImage(r,l/2-r.width*.5,l/2-r.height*.5);const c=o.getImageData(0,0,l,l);return i.width=t.width,i.height=t.height,o.putImageData(c,Math.round(0-l/2+r.width*.5-t.x),Math.round(0-l/2+r.height*.5-t.y)),new Promise(u=>i.toBlob(f=>{const d=new File([f],`cropped_image_${Date.now()}.jpeg`,{type:"image/jpeg"});u(d)},"image/jpeg"))})}const hg=({labels:e,open:t,imageSrc:n,resetDefaultImageUrl:r,toggleModal:i,uploadImage:o})=>{const[a,l]=y.useState({x:0,y:0}),[c,u]=y.useState(1),[f,d]=y.useState(16/9),[p,g]=y.useState(null),v=(x,I)=>{g(I)},m=(x,I)=>d(I),b=()=>_(this,null,function*(){const x=yield zP(n,p);S(),o(x)}),C=()=>{S(),r()},S=()=>{l({x:0,y:0}),u(1),d(16/9),g(null)};return s.jsx(h.Modal,{open:t,onClose:i,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{children:e.cropImage}),s.jsxs(h.DialogContent,{sx:{width:"100%"},children:[s.jsx(h.Box,{position:"relative",height:"100%",width:"100%",mb:2,children:s.jsx($P,{image:n,crop:a,zoom:c,aspect:f,onCropChange:l,onCropComplete:v,onZoomChange:u})}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.aspectRatio}),s.jsxs(h.Select,{value:f,onChange:m,children:[s.jsx(h.Option,{value:4/3,children:"4 / 3"}),s.jsx(h.Option,{value:16/9,children:"16 / 9"}),s.jsx(h.Option,{value:1,children:"1"})]})]}),s.jsx(h.Box,{mb:1,mx:2,children:s.jsx(h.Slider,{value:c,min:1,max:3,step:.1,onChange:(x,I)=>u(I)})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{color:"primary",onClick:b,loading:!1,children:e.crop}),s.jsx(h.Button,{color:"primary",variant:"outlined",onClick:C,loading:!1,children:e.reset})]})]})]})})},pg=$e(s.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"CropOutlined"),gg=({labels:e,title:t,image:n,onChangeImages:r,clearImage:i})=>{const[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState("primary"),[C,S]=y.useState(""),x=y.useRef(null),I=()=>p(!d),w=()=>{x.current&&x.current.click()},A=new Gp,E=y.useContext(pa),k=()=>{v(""),c(!1)},$=M=>{let V="",Y="primary";switch(M){case"copy_url":V=e.urlCopiedToClipboardMessage,Y="primary";break;case"image_deleted":V=e.imageDeletedMessage,Y="primary";break;case"image_reset":V=e.imageResetMessage,Y="primary";break;case"upload_success":V=e.uploadingImageMessage,Y="success";break;case"upload_failed":V=e.uploadingImageErrorMessage,Y="danger";break;case"sign_in_url_failed":V=e.generateSignedInUrlErrorMessage,Y="danger";break;case"encrypting_file_failed":V=e.encryptingImageErrorMessage,Y="danger";break}b(Y),v(V),c(!0)},G=()=>f(!u),O=()=>{i(),$("image_deleted")},T=M=>{navigator.clipboard.writeText(M),$("copy_url")},F=M=>_(this,null,function*(){M.persist();const V=M.target.files?M.target.files[0]:null;if(V){a(!0);try{const Y=V.type.split("/")[1],X=yield A.readFileAndHash(V),D=(yield A.generateHashFileName(V))+"."+Y,B={image_type:Y,image_file_name:D,image_size:V.size,base64_sum:X},U=yield E==null?void 0:E.https.generateSignedInUrl(B);if(U!=null&&U.ok){const W=yield U.json(),ie={"Content-Type":V.type,"Content-MD5":X};try{const se=new File([V],D,{type:V.type}),oe=yield E==null?void 0:E.https.storeInBucket(W.data.signed_url,se,ie);r(oe||""),S(oe),$("upload_success")}catch(se){console.error("There was a problem with uploading the file: ",se),$("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield U==null?void 0:U.json()),$("sign_in_url_failed")}catch(Y){console.error("There was a problem with encrypting file...",Y),$("encrypting_file_failed")}a(!1)}}),H=M=>_(this,null,function*(){if(M){a(!0);try{const V=M.type.split("/")[1],Y=yield A.readFileAndHash(M),X=(yield A.generateHashFileName(M))+"."+V,D={image_type:V,image_file_name:X,image_size:M.size,base64_sum:Y},B=yield E==null?void 0:E.https.generateSignedInUrl(D);if(B!=null&&B.ok){const U=yield B.json(),W={"Content-Type":M.type,"Content-MD5":Y};try{const ie=new File([M],X,{type:M.type}),se=yield E==null?void 0:E.https.storeInBucket(U.data.signed_url,ie,W);r(se||""),$("upload_success")}catch(ie){console.error("There was a problem with uploading the file: ",ie),$("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield B==null?void 0:B.json()),$("sign_in_url_failed")}catch(V){console.error("There was a problem with encrypting file...",V),$("encrypting_file_failed")}a(!1)}}),j=()=>{r(C),$("image_reset")},N=M=>{r(M),S(M)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:t}),s.jsx(h.Tooltip,{title:e.clearImage,children:s.jsx(h.IconButton,{"aria-label":e.clearImage,variant:"plain",color:"danger",size:"sm",onClick:O,children:s.jsx(Lp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:o,animation:"wave",children:[n?s.jsx(h.Box,{component:"img",src:n,loading:"lazy",alt:t,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(Uc,{sx:{fontSize:"3rem",opacity:.2}}),n?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Kp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.copyUrl,children:s.jsx(di,{onClick:()=>T(n),disabled:!n,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.viewImage,children:s.jsx(di,{onClick:G,disabled:!n,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(Qp,{})})}),s.jsx(h.Tooltip,{title:e.cropImage,children:s.jsx(di,{onClick:I,disabled:!n,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(pg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(di,{sx:{width:"100%"},onClick:w,children:[s.jsx(_e.Upload,{})," ",e.uploadImage,s.jsx(Jp,{type:"file",accept:"image/*",onChange:F,ref:x})]})}),E!=null&&E.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(qp,{labels:e,onChangeImages:N})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ye,{showToast:l,message:g,color:m,hideToast:k}),s.jsx(Yp,{title:e.viewImage,open:u,imageSrc:n,toggleModal:G}),s.jsx(hg,{labels:e,open:d,imageSrc:n,toggleModal:I,uploadImage:H,resetDefaultImageUrl:j})]})},jP=e=>new Map().set("main_logo",e.mainLogo).set("mobile_logo",e.mobileLogo).set("background_image",e.backgroundImage).set("mobile_background_image",e.mobileBackgroundImage).set("additional_image",e.additionalImage),UP=e=>new Map().set("primary_color",e.primaryColor).set("secondary_color",e.secondaryColor).set("content_color",e.contentColor).set("background_color",e.backgroundColor).set("border_color",e.borderColor).set("additional_color",e.additionalColor),VP=e=>new Map().set("primary_url",e.primaryUrl).set("secondary_url",e.secondaryUrl).set("privacy_policy_url",e.privacyPolicyUrl).set("terms_and_conditions_url",e.termsAndConditionsUrl).set("additional_url",e.additionalUrl),HP=({labels:e,defaultValue:t,onChange:n})=>{const[r,i]=y.useState(!1),o=JSON.parse(JSON.stringify(t)),a=["mobile_logo","background_image","mobile_background_image","additional_image"],l=jP(e),c=UP(e),u=VP(e),f=(v,m)=>{const b=v.target.value;o.colors[m]=b,n(o)},d=(v,m)=>{const b=v.target.value;o.urls[m]=b,n(o)},p=(v,m)=>{o.images[m]=v,n(o)},g=v=>{o.images[v]="",n(o)};return s.jsx(h.Box,{children:s.jsxs(Zh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(ep,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ac.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(Uc,{sx:{width:"20px"}})}),e.images]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(g_,{sx:{width:"20px"}})}),e.colors]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(m_,{sx:{width:"20px"}})}),e.urls]})]}),s.jsxs(ci,{value:0,sx:{px:0},children:[s.jsx(gg,{labels:e,title:e.mainLogo,image:o.images.main_logo,onChangeImages:v=>p(v,"main_logo"),clearImage:()=>g("main_logo")}),s.jsx(h.Link,{underline:"hover",onClick:()=>i(!r),sx:{marginBottom:"10px"},children:r?e.hideMoreImages:e.showMoreImages}),r?s.jsx(s.Fragment,{children:a.map(v=>s.jsx(gg,{labels:e,title:l.get(v),image:o.images[v],onChangeImages:m=>p(m,v),clearImage:()=>g(v)},`branding-image-${v}`))}):s.jsx(s.Fragment,{})]}),s.jsx(ci,{value:1,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.colors).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{size:"sm",label:c.get(v),placeholder:"",defaultValue:o.colors[v],required:!1,onChange:m=>f(m,v)})},`branding-color-${v}`))})}),s.jsx(ci,{value:2,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.urls).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{size:"sm",label:u.get(v),placeholder:"",defaultValue:o.urls[v],required:!1,onChange:m=>d(m,v)})},`branding-url-${v}`))})})]})})},mg=$e(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),vg=e=>{const t=()=>_(this,null,function*(){yield ro(e.environment).signOut()});return s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:t,children:e.signOutLabel})},WP=$e(s.jsx("path",{d:"m8.71 11.71 2.59 2.59c.39.39 1.02.39 1.41 0l2.59-2.59c.63-.63.18-1.71-.71-1.71H9.41c-.89 0-1.33 1.08-.7 1.71"}),"ArrowDropDownRounded"),GP=$e(s.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined"),YP=(e,t)=>{let n=[{id:"football_post_match",label:t.generateFootballPostMatchLabel}];switch(e){case"classic_quiz":n=[...n,{id:"formula1_post_event",label:(t==null?void 0:t.generateFormula1PostEventLabel)||""}];break}return n},KP=({createLabel:e,createFromTemplateLabel:t,signOutLabel:n,generateLabels:r,entityType:i,environment:o,onClickCreate:a,onClickCreateFromTemplate:l,onClickGenerate:c})=>{const u=()=>{if(!r||!c)return s.jsx(s.Fragment,{});const f=YP(i,r);return s.jsxs(h.Dropdown,{children:[s.jsxs(h.ButtonGroup,{variant:"solid",size:"md",color:"neutral",children:[s.jsx(h.MenuButton,{slots:{root:h.Button},startDecorator:s.jsx(GP,{}),sx:{border:1,borderColor:"neutral.outlinedBorder",borderRight:"none",borderTopRightRadius:0,borderBottomRightRadius:0,bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"}},children:r.generateAIEntityLabel}),s.jsx(h.MenuButton,{slots:{root:h.IconButton},"aria-label":"More AI quiz options",sx:{border:1,borderColor:"neutral.outlinedBorder",borderLeft:"none",bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"},borderTopRightRadius:"6px !important",borderBottomRightRadius:"6px !important"},children:s.jsx(WP,{})})]}),s.jsx(h.Menu,{placement:"bottom",sx:{maxHeight:240,borderRadius:12,boxShadow:"md"},children:f.map(d=>s.jsx(h.MenuItem,{onClick:()=>c(d.id),children:d.label},d.id))})]})};return s.jsx(s.Fragment,{children:s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",p:1,sx:()=>({marginBottom:"16px"}),children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",spacing:2,children:[s.jsx(h.Button,{startDecorator:s.jsx(mg,{}),variant:"solid",color:"primary",onClick:a,children:e}),t?s.jsx(h.Button,{startDecorator:s.jsx(mg,{}),variant:"outlined",color:"primary",onClick:l,children:t}):s.jsx(s.Fragment,{}),u()]}),n?s.jsx(vg,{signOutLabel:n,environment:o}):s.jsx(s.Fragment,{})]})})};var bg={},eu=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],hi={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console!="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yo={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Wt=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},dn=function(e){return e===!0?1:0};function yg(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var tu=function(e){return e instanceof Array?e:[e]};function Ft(e,t,n){if(n===!0)return e.classList.add(t);e.classList.remove(t)}function Fe(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,n!==void 0&&(r.textContent=n),r}function ps(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function xg(e,t){if(t(e))return e;if(e.parentNode)return xg(e.parentNode,t)}function gs(e,t){var n=Fe("div","numInputWrapper"),r=Fe("input","numInput "+e),i=Fe("span","arrowUp"),o=Fe("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}function Zt(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch(n){return e.target}}var nu=function(){},ms=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},qP={D:nu,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*dn(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:nu,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:nu,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Pr={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},xo={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[xo.w(e,t,n)]},F:function(e,t,n){return ms(xo.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Wt(xo.h(e,t,n))},H:function(e){return Wt(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[dn(e.getHours()>11)]},M:function(e,t){return ms(e.getMonth(),!0,t)},S:function(e){return Wt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return Wt(e.getFullYear(),4)},d:function(e){return Wt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Wt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Wt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},Cg=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?yo:r,o=e.isMobile,a=o===void 0?!1:o;return function(l,c,u){var f=u||i;return n.formatDate!==void 0&&!a?n.formatDate(l,c,f):c.split("").map(function(d,p,g){return xo[d]&&g[p-1]!=="\\"?xo[d](l,f,n):d!=="\\"?d:""}).join("")}},ru=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?yo:r;return function(o,a,l,c){if(!(o!==0&&!o)){var u=c||i,f,d=o;if(o instanceof Date)f=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)f=new Date(o);else if(typeof o=="string"){var p=a||(n||hi).dateFormat,g=String(o).trim();if(g==="today")f=new Date,l=!0;else if(n&&n.parseDate)f=n.parseDate(o,p);else if(/Z$/.test(g)||/GMT$/.test(g))f=new Date(o);else{for(var v=void 0,m=[],b=0,C=0,S="";b<p.length;b++){var x=p[b],I=x==="\\",w=p[b-1]==="\\"||I;if(Pr[x]&&!w){S+=Pr[x];var A=new RegExp(S).exec(o);A&&(v=!0)&&m[x!=="Y"?"push":"unshift"]({fn:qP[x],val:A[++C]})}else I||(S+=".")}f=!n||!n.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),m.forEach(function(E){var k=E.fn,$=E.val;return f=k(f,$,u)||f}),f=v?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){n.errorHandler(new Error("Invalid date provided: "+d));return}return l===!0&&f.setHours(0,0,0,0),f}}};function en(e,t,n){return n===void 0&&(n=!0),n!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var QP=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},iu=function(e,t,n){return e*3600+t*60+n},JP=function(e){var t=Math.floor(e/3600),n=(e-t*3600)/60;return[t,n,e-t*3600-n*60]},XP={DAY:864e5};function ou(e){var t=e.defaultHour,n=e.defaultMinute,r=e.defaultSeconds;if(e.minDate!==void 0){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<o&&(n=o),t===i&&n===o&&r<a&&(r=e.minDate.getSeconds())}if(e.maxDate!==void 0){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();t=Math.min(t,l),t===l&&(n=Math.min(c,n)),t===l&&n===c&&(r=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var r=function(l){l&&Object.keys(l).forEach(function(c){return e[c]=l[c]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return e});var Mt=function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Mt.apply(this,arguments)},wg=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,l=o.length;a<l;a++,i++)r[i]=o[a];return r},ZP=300;function eD(e,t){var n={config:Mt(Mt({},hi),vt.defaultConfig),l10n:yo};n.parseDate=ru({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=m,n._setHoursFromDate=p,n._positionCalendar=xe,n.changeMonth=D,n.changeYear=oe,n.clear=B,n.close=U,n.onMouseOver=be,n._createElement=Fe,n.createDay=A,n.destroy=W,n.isEnabled=Z,n.jumpToDate=S,n.updateValue=tn,n.open=ht,n.redraw=Oe,n.set=Bt,n.setDate=zt,n.toggle=zo;function r(){n.utils={getDaysInMonth:function(P,z){return P===void 0&&(P=n.currentMonth),z===void 0&&(z=n.currentYear),P===1&&(z%4===0&&z%100!==0||z%400===0)?29:n.l10n.daysInMonth[P]}}}function i(){n.element=n.input=e,n.isOpen=!1,_t(),ge(),hn(),Ei(),r(),n.isMobile||w(),C(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&p(n.config.noCalendar?n.latestSelectedDateObj:void 0),tn(!1)),l();var P=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&P&&xe(),ze("onReady")}function o(){var P;return((P=n.calendarContainer)===null||P===void 0?void 0:P.getRootNode()).activeElement||document.activeElement}function a(P){return P.bind(n)}function l(){var P=n.config;P.weekNumbers===!1&&P.showMonths===1||P.noCalendar!==!0&&window.requestAnimationFrame(function(){if(n.calendarContainer!==void 0&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),n.daysContainer!==void 0){var z=(n.days.offsetWidth+1)*P.showMonths;n.daysContainer.style.width=z+"px",n.calendarContainer.style.width=z+(n.weekWrapper!==void 0?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function c(P){if(n.selectedDates.length===0){var z=n.config.minDate===void 0||en(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),q=ou(n.config);z.setHours(q.hours,q.minutes,q.seconds,z.getMilliseconds()),n.selectedDates=[z],n.latestSelectedDateObj=z}P!==void 0&&P.type!=="blur"&&bt(P);var ee=n._input.value;d(),tn(),n._input.value!==ee&&n._debouncedChange()}function u(P,z){return P%12+12*dn(z===n.l10n.amPM[1])}function f(P){switch(P%24){case 0:case 12:return 12;default:return P%12}}function d(){if(!(n.hourElement===void 0||n.minuteElement===void 0)){var P=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(n.minuteElement.value,10)||0)%60,q=n.secondElement!==void 0?(parseInt(n.secondElement.value,10)||0)%60:0;n.amPM!==void 0&&(P=u(P,n.amPM.textContent));var ee=n.config.minTime!==void 0||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.minDate,!0)===0,ae=n.config.maxTime!==void 0||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.maxDate,!0)===0;if(n.config.maxTime!==void 0&&n.config.minTime!==void 0&&n.config.minTime>n.config.maxTime){var ce=iu(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),we=iu(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),de=iu(P,z,q);if(de>we&&de<ce){var Ie=JP(ce);P=Ie[0],z=Ie[1],q=Ie[2]}}else{if(ae){var pe=n.config.maxTime!==void 0?n.config.maxTime:n.config.maxDate;P=Math.min(P,pe.getHours()),P===pe.getHours()&&(z=Math.min(z,pe.getMinutes())),z===pe.getMinutes()&&(q=Math.min(q,pe.getSeconds()))}if(ee){var ve=n.config.minTime!==void 0?n.config.minTime:n.config.minDate;P=Math.max(P,ve.getHours()),P===ve.getHours()&&z<ve.getMinutes()&&(z=ve.getMinutes()),z===ve.getMinutes()&&(q=Math.max(q,ve.getSeconds()))}}g(P,z,q)}}function p(P){var z=P||n.latestSelectedDateObj;z&&z instanceof Date&&g(z.getHours(),z.getMinutes(),z.getSeconds())}function g(P,z,q){n.latestSelectedDateObj!==void 0&&n.latestSelectedDateObj.setHours(P%24,z,q||0,0),!(!n.hourElement||!n.minuteElement||n.isMobile)&&(n.hourElement.value=Wt(n.config.time_24hr?P:(12+P)%12+12*dn(P%12===0)),n.minuteElement.value=Wt(z),n.amPM!==void 0&&(n.amPM.textContent=n.l10n.amPM[dn(P>=12)]),n.secondElement!==void 0&&(n.secondElement.value=Wt(q)))}function v(P){var z=Zt(P),q=parseInt(z.value)+(P.delta||0);(q/1e3>1||P.key==="Enter"&&!/[^\d]/.test(q.toString()))&&oe(q)}function m(P,z,q,ee){if(z instanceof Array)return z.forEach(function(ae){return m(P,ae,q,ee)});if(P instanceof Array)return P.forEach(function(ae){return m(ae,z,q,ee)});P.addEventListener(z,q,ee),n._handlers.push({remove:function(){return P.removeEventListener(z,q,ee)}})}function b(){ze("onChange")}function C(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(q){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+q+"]"),function(ee){return m(ee,"click",n[q])})}),n.isMobile){No();return}var P=yg(Ne,50);if(n._debouncedChange=yg(b,ZP),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(n.daysContainer,"mouseover",function(q){n.config.mode==="range"&&be(Zt(q))}),m(n._input,"keydown",ue),n.calendarContainer!==void 0&&m(n.calendarContainer,"keydown",ue),!n.config.inline&&!n.config.static&&m(window,"resize",P),window.ontouchstart!==void 0?m(window.document,"touchstart",se):m(window.document,"mousedown",se),m(window.document,"focus",se,{capture:!0}),n.config.clickOpens===!0&&(m(n._input,"focus",n.open),m(n._input,"click",n.open)),n.daysContainer!==void 0&&(m(n.monthNav,"click",_i),m(n.monthNav,["keyup","increment"],v),m(n.daysContainer,"click",St)),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0){var z=function(q){return Zt(q).select()};m(n.timeContainer,["increment"],c),m(n.timeContainer,"blur",c,{capture:!0}),m(n.timeContainer,"click",x),m([n.hourElement,n.minuteElement],["focus","click"],z),n.secondElement!==void 0&&m(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),n.amPM!==void 0&&m(n.amPM,"click",function(q){c(q)})}n.config.allowInput&&m(n._input,"blur",ne)}function S(P,z){var q=P!==void 0?n.parseDate(P):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),ee=n.currentYear,ae=n.currentMonth;try{q!==void 0&&(n.currentYear=q.getFullYear(),n.currentMonth=q.getMonth())}catch(ce){ce.message="Invalid date supplied: "+q,n.config.errorHandler(ce)}z&&n.currentYear!==ee&&(ze("onYearChange"),F()),z&&(n.currentYear!==ee||n.currentMonth!==ae)&&ze("onMonthChange"),n.redraw()}function x(P){var z=Zt(P);~z.className.indexOf("arrow")&&I(P,z.classList.contains("arrowUp")?1:-1)}function I(P,z,q){var ee=P&&Zt(P),ae=q||ee&&ee.parentNode&&ee.parentNode.firstChild,ce=hr("increment");ce.delta=z,ae&&ae.dispatchEvent(ce)}function w(){var P=window.document.createDocumentFragment();if(n.calendarContainer=Fe("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(P.appendChild(N()),n.innerContainer=Fe("div","flatpickr-innerContainer"),n.config.weekNumbers){var z=X(),q=z.weekWrapper,ee=z.weekNumbers;n.innerContainer.appendChild(q),n.weekNumbers=ee,n.weekWrapper=q}n.rContainer=Fe("div","flatpickr-rContainer"),n.rContainer.appendChild(V()),n.daysContainer||(n.daysContainer=Fe("div","flatpickr-days"),n.daysContainer.tabIndex=-1),T(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),P.appendChild(n.innerContainer)}n.config.enableTime&&P.appendChild(M()),Ft(n.calendarContainer,"rangeMode",n.config.mode==="range"),Ft(n.calendarContainer,"animate",n.config.animate===!0),Ft(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(P);var ae=n.config.appendTo!==void 0&&n.config.appendTo.nodeType!==void 0;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!ae&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):n.config.appendTo!==void 0&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var ce=Fe("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(ce,n.element),ce.appendChild(n.element),n.altInput&&ce.appendChild(n.altInput),ce.appendChild(n.calendarContainer)}!n.config.static&&!n.config.inline&&(n.config.appendTo!==void 0?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}function A(P,z,q,ee){var ae=Z(z,!0),ce=Fe("span",P,z.getDate().toString());return ce.dateObj=z,ce.$i=ee,ce.setAttribute("aria-label",n.formatDate(z,n.config.ariaDateFormat)),P.indexOf("hidden")===-1&&en(z,n.now)===0&&(n.todayDateElem=ce,ce.classList.add("today"),ce.setAttribute("aria-current","date")),ae?(ce.tabIndex=-1,Lr(z)&&(ce.classList.add("selected"),n.selectedDateElem=ce,n.config.mode==="range"&&(Ft(ce,"startRange",n.selectedDates[0]&&en(z,n.selectedDates[0],!0)===0),Ft(ce,"endRange",n.selectedDates[1]&&en(z,n.selectedDates[1],!0)===0),P==="nextMonthDay"&&ce.classList.add("inRange")))):ce.classList.add("flatpickr-disabled"),n.config.mode==="range"&&ki(z)&&!Lr(z)&&ce.classList.add("inRange"),n.weekNumbers&&n.config.showMonths===1&&P!=="prevMonthDay"&&ee%7===6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(z)+"</span>"),ze("onDayCreate",ce),ce}function E(P){P.focus(),n.config.mode==="range"&&be(P)}function k(P){for(var z=P>0?0:n.config.showMonths-1,q=P>0?n.config.showMonths:-1,ee=z;ee!=q;ee+=P)for(var ae=n.daysContainer.children[ee],ce=P>0?0:ae.children.length-1,we=P>0?ae.children.length:-1,de=ce;de!=we;de+=P){var Ie=ae.children[de];if(Ie.className.indexOf("hidden")===-1&&Z(Ie.dateObj))return Ie}}function $(P,z){for(var q=P.className.indexOf("Month")===-1?P.dateObj.getMonth():n.currentMonth,ee=z>0?n.config.showMonths:-1,ae=z>0?1:-1,ce=q-n.currentMonth;ce!=ee;ce+=ae)for(var we=n.daysContainer.children[ce],de=q-n.currentMonth===ce?P.$i+z:z<0?we.children.length-1:0,Ie=we.children.length,pe=de;pe>=0&&pe<Ie&&pe!=(z>0?Ie:-1);pe+=ae){var ve=we.children[pe];if(ve.className.indexOf("hidden")===-1&&Z(ve.dateObj)&&Math.abs(P.$i-pe)>=Math.abs(z))return E(ve)}n.changeMonth(ae),G(k(ae),0)}function G(P,z){var q=o(),ee=te(q||document.body),ae=P!==void 0?P:ee?q:n.selectedDateElem!==void 0&&te(n.selectedDateElem)?n.selectedDateElem:n.todayDateElem!==void 0&&te(n.todayDateElem)?n.todayDateElem:k(z>0?1:-1);ae===void 0?n._input.focus():ee?$(ae,z):E(ae)}function O(P,z){for(var q=(new Date(P,z,1).getDay()-n.l10n.firstDayOfWeek+7)%7,ee=n.utils.getDaysInMonth((z-1+12)%12,P),ae=n.utils.getDaysInMonth(z,P),ce=window.document.createDocumentFragment(),we=n.config.showMonths>1,de=we?"prevMonthDay hidden":"prevMonthDay",Ie=we?"nextMonthDay hidden":"nextMonthDay",pe=ee+1-q,ve=0;pe<=ee;pe++,ve++)ce.appendChild(A("flatpickr-day "+de,new Date(P,z-1,pe),pe,ve));for(pe=1;pe<=ae;pe++,ve++)ce.appendChild(A("flatpickr-day",new Date(P,z,pe),pe,ve));for(var Le=ae+1;Le<=42-q&&(n.config.showMonths===1||ve%7!==0);Le++,ve++)ce.appendChild(A("flatpickr-day "+Ie,new Date(P,z+1,Le%ae),Le,ve));var Pt=Fe("div","dayContainer");return Pt.appendChild(ce),Pt}function T(){if(n.daysContainer!==void 0){ps(n.daysContainer),n.weekNumbers&&ps(n.weekNumbers);for(var P=document.createDocumentFragment(),z=0;z<n.config.showMonths;z++){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),P.appendChild(O(q.getFullYear(),q.getMonth()))}n.daysContainer.appendChild(P),n.days=n.daysContainer.firstChild,n.config.mode==="range"&&n.selectedDates.length===1&&be()}}function F(){if(!(n.config.showMonths>1||n.config.monthSelectorType!=="dropdown")){var P=function(ee){return n.config.minDate!==void 0&&n.currentYear===n.config.minDate.getFullYear()&&ee<n.config.minDate.getMonth()?!1:!(n.config.maxDate!==void 0&&n.currentYear===n.config.maxDate.getFullYear()&&ee>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(P(z)){var q=Fe("option","flatpickr-monthDropdown-month");q.value=new Date(n.currentYear,z).getMonth().toString(),q.textContent=ms(z,n.config.shorthandCurrentMonth,n.l10n),q.tabIndex=-1,n.currentMonth===z&&(q.selected=!0),n.monthsDropdownContainer.appendChild(q)}}}function H(){var P=Fe("div","flatpickr-month"),z=window.document.createDocumentFragment(),q;n.config.showMonths>1||n.config.monthSelectorType==="static"?q=Fe("span","cur-month"):(n.monthsDropdownContainer=Fe("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),m(n.monthsDropdownContainer,"change",function(we){var de=Zt(we),Ie=parseInt(de.value,10);n.changeMonth(Ie-n.currentMonth),ze("onMonthChange")}),F(),q=n.monthsDropdownContainer);var ee=gs("cur-year",{tabindex:"-1"}),ae=ee.getElementsByTagName("input")[0];ae.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&ae.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(ae.setAttribute("max",n.config.maxDate.getFullYear().toString()),ae.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var ce=Fe("div","flatpickr-current-month");return ce.appendChild(q),ce.appendChild(ee),z.appendChild(ce),P.appendChild(z),{container:P,yearElement:ae,monthElement:q}}function j(){ps(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var P=n.config.showMonths;P--;){var z=H();n.yearElements.push(z.yearElement),n.monthElements.push(z.monthElement),n.monthNav.appendChild(z.container)}n.monthNav.appendChild(n.nextMonthNav)}function N(){return n.monthNav=Fe("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=Fe("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=Fe("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,j(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(P){n.__hidePrevMonthArrow!==P&&(Ft(n.prevMonthNav,"flatpickr-disabled",P),n.__hidePrevMonthArrow=P)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(P){n.__hideNextMonthArrow!==P&&(Ft(n.nextMonthNav,"flatpickr-disabled",P),n.__hideNextMonthArrow=P)}}),n.currentYearElement=n.yearElements[0],pr(),n.monthNav}function M(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var P=ou(n.config);n.timeContainer=Fe("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var z=Fe("span","flatpickr-time-separator",":"),q=gs("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=q.getElementsByTagName("input")[0];var ee=gs("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=ee.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?P.hours:f(P.hours)),n.minuteElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():P.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(q),n.timeContainer.appendChild(z),n.timeContainer.appendChild(ee),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var ae=gs("flatpickr-second");n.secondElement=ae.getElementsByTagName("input")[0],n.secondElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():P.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(Fe("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(ae)}return n.config.time_24hr||(n.amPM=Fe("span","flatpickr-am-pm",n.l10n.amPM[dn((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}function V(){n.weekdayContainer?ps(n.weekdayContainer):n.weekdayContainer=Fe("div","flatpickr-weekdays");for(var P=n.config.showMonths;P--;){var z=Fe("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(z)}return Y(),n.weekdayContainer}function Y(){if(n.weekdayContainer){var P=n.l10n.firstDayOfWeek,z=wg(n.l10n.weekdays.shorthand);P>0&&P<z.length&&(z=wg(z.splice(P,z.length),z.splice(0,P)));for(var q=n.config.showMonths;q--;)n.weekdayContainer.children[q].innerHTML=`
2454
2454
  <span class='flatpickr-weekday'>
2455
2455
  `+z.join("</span><span class='flatpickr-weekday'>")+`
2456
2456
  </span>
2457
2457
  `}}function X(){n.calendarContainer.classList.add("hasWeeks");var P=Fe("div","flatpickr-weekwrapper");P.appendChild(Fe("span","flatpickr-weekday",n.l10n.weekAbbreviation));var z=Fe("div","flatpickr-weeks");return P.appendChild(z),{weekWrapper:P,weekNumbers:z}}function D(P,z){z===void 0&&(z=!0);var q=z?P:P-n.currentMonth;q<0&&n._hidePrevMonthArrow===!0||q>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=q,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,ze("onYearChange"),F()),T(),ze("onMonthChange"),pr())}function B(P,z){if(P===void 0&&(P=!0),z===void 0&&(z=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,z===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var q=ou(n.config),ee=q.hours,ae=q.minutes,ce=q.seconds;g(ee,ae,ce)}n.redraw(),P&&ze("onChange")}function U(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),ze("onClose")}function W(){n.config!==void 0&&ze("onDestroy");for(var P=n._handlers.length;P--;)n._handlers[P].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var z=n.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(q){try{delete n[q]}catch(ee){}})}function ie(P){return n.calendarContainer.contains(P)}function se(P){if(n.isOpen&&!n.config.inline){var z=Zt(P),q=ie(z),ee=z===n.input||z===n.altInput||n.element.contains(z)||P.path&&P.path.indexOf&&(~P.path.indexOf(n.input)||~P.path.indexOf(n.altInput)),ae=!ee&&!q&&!ie(P.relatedTarget),ce=!n.config.ignoredFocusElements.some(function(we){return we.contains(z)});ae&&ce&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0&&n.input.value!==""&&n.input.value!==void 0&&c(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function oe(P){if(!(!P||n.config.minDate&&P<n.config.minDate.getFullYear()||n.config.maxDate&&P>n.config.maxDate.getFullYear())){var z=P,q=n.currentYear!==z;n.currentYear=z||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),q&&(n.redraw(),ze("onYearChange"),F())}}function Z(P,z){var q;z===void 0&&(z=!0);var ee=n.parseDate(P,void 0,z);if(n.config.minDate&&ee&&en(ee,n.config.minDate,z!==void 0?z:!n.minDateHasTime)<0||n.config.maxDate&&ee&&en(ee,n.config.maxDate,z!==void 0?z:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(ee===void 0)return!1;for(var ae=!!n.config.enable,ce=(q=n.config.enable)!==null&&q!==void 0?q:n.config.disable,we=0,de=void 0;we<ce.length;we++){if(de=ce[we],typeof de=="function"&&de(ee))return ae;if(de instanceof Date&&ee!==void 0&&de.getTime()===ee.getTime())return ae;if(typeof de=="string"){var Ie=n.parseDate(de,void 0,!0);return Ie&&Ie.getTime()===ee.getTime()?ae:!ae}else if(typeof de=="object"&&ee!==void 0&&de.from&&de.to&&ee.getTime()>=de.from.getTime()&&ee.getTime()<=de.to.getTime())return ae}return!ae}function te(P){return n.daysContainer!==void 0?P.className.indexOf("hidden")===-1&&P.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(P):!1}function ne(P){var z=P.target===n._input,q=n._input.value.trimEnd()!==Mr();z&&q&&!(P.relatedTarget&&ie(P.relatedTarget))&&n.setDate(n._input.value,!0,P.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function ue(P){var z=Zt(P),q=n.config.wrap?e.contains(z):z===n._input,ee=n.config.allowInput,ae=n.isOpen&&(!ee||!q),ce=n.config.inline&&q&&!ee;if(P.keyCode===13&&q){if(ee)return n.setDate(n._input.value,!0,z===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),z.blur();n.open()}else if(ie(z)||ae||ce){var we=!!n.timeContainer&&n.timeContainer.contains(z);switch(P.keyCode){case 13:we?(P.preventDefault(),c(),Pe()):St(P);break;case 27:P.preventDefault(),Pe();break;case 8:case 46:q&&!n.config.allowInput&&(P.preventDefault(),n.clear());break;case 37:case 39:if(!we&&!q){P.preventDefault();var de=o();if(n.daysContainer!==void 0&&(ee===!1||de&&te(de))){var Ie=P.keyCode===39?1:-1;P.ctrlKey?(P.stopPropagation(),D(Ie),G(k(1),0)):G(void 0,Ie)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:P.preventDefault();var pe=P.keyCode===40?1:-1;n.daysContainer&&z.$i!==void 0||z===n.input||z===n.altInput?P.ctrlKey?(P.stopPropagation(),oe(n.currentYear-pe),G(k(1),0)):we||G(void 0,pe*7):z===n.currentYearElement?oe(n.currentYear-pe):n.config.enableTime&&(!we&&n.hourElement&&n.hourElement.focus(),c(P),n._debouncedChange());break;case 9:if(we){var ve=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(Xe){return Xe}),Le=ve.indexOf(z);if(Le!==-1){var Pt=ve[Le+(P.shiftKey?-1:1)];P.preventDefault(),(Pt||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(z)&&P.shiftKey&&(P.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&z===n.amPM)switch(P.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],d(),tn();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],d(),tn();break}(q||ie(z))&&ze("onKeyDown",P)}function be(P,z){if(z===void 0&&(z="flatpickr-day"),!(n.selectedDates.length!==1||P&&(!P.classList.contains(z)||P.classList.contains("flatpickr-disabled")))){for(var q=P?P.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),ee=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),ae=Math.min(q,n.selectedDates[0].getTime()),ce=Math.max(q,n.selectedDates[0].getTime()),we=!1,de=0,Ie=0,pe=ae;pe<ce;pe+=XP.DAY)Z(new Date(pe),!0)||(we=we||pe>ae&&pe<ce,pe<ee&&(!de||pe>de)?de=pe:pe>ee&&(!Ie||pe<Ie)&&(Ie=pe));var ve=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+z));ve.forEach(function(Le){var Pt=Le.dateObj,Xe=Pt.getTime(),nn=de>0&&Xe<de||Ie>0&&Xe>Ie;if(nn){Le.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fe){Le.classList.remove(fe)});return}else if(we&&!nn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fe){Le.classList.remove(fe)}),P!==void 0&&(P.classList.add(q<=n.selectedDates[0].getTime()?"startRange":"endRange"),ee<q&&Xe===ee?Le.classList.add("startRange"):ee>q&&Xe===ee&&Le.classList.add("endRange"),Xe>=de&&(Ie===0||Xe<=Ie)&&QP(Xe,ee,q)&&Le.classList.add("inRange"))})}}function Ne(){n.isOpen&&!n.config.static&&!n.config.inline&&xe()}function ht(P,z){if(z===void 0&&(z=n._positionElement),n.isMobile===!0){if(P){P.preventDefault();var q=Zt(P);q&&q.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),ze("onOpen");return}else if(n._input.disabled||n.config.inline)return;var ee=n.isOpen;n.isOpen=!0,ee||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),ze("onOpen"),xe(z)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(P===void 0||!n.timeContainer.contains(P.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function Je(P){return function(z){var q=n.config["_"+P+"Date"]=n.parseDate(z,n.config.dateFormat),ee=n.config["_"+(P==="min"?"max":"min")+"Date"];q!==void 0&&(n[P==="min"?"minDateHasTime":"maxDateHasTime"]=q.getHours()>0||q.getMinutes()>0||q.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(ae){return Z(ae)}),!n.selectedDates.length&&P==="min"&&p(q),tn()),n.daysContainer&&(Oe(),q!==void 0?n.currentYearElement[P]=q.getFullYear().toString():n.currentYearElement.removeAttribute(P),n.currentYearElement.disabled=!!ee&&q!==void 0&&ee.getFullYear()===q.getFullYear())}}function _t(){var P=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=Mt(Mt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),q={};n.config.parseDate=z.parseDate,n.config.formatDate=z.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(ve){n.config._enable=_n(ve)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(ve){n.config._disable=_n(ve)}});var ee=z.mode==="time";if(!z.dateFormat&&(z.enableTime||ee)){var ae=vt.defaultConfig.dateFormat||hi.dateFormat;q.dateFormat=z.noCalendar||ee?"H:i"+(z.enableSeconds?":S":""):ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||ee)&&!z.altFormat){var ce=vt.defaultConfig.altFormat||hi.altFormat;q.altFormat=z.noCalendar||ee?"h:i"+(z.enableSeconds?":S K":" K"):ce+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:Je("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:Je("max")});var we=function(ve){return function(Le){n.config[ve==="min"?"_minTime":"_maxTime"]=n.parseDate(Le,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:we("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:we("max")}),z.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,q,z);for(var de=0;de<P.length;de++)n.config[P[de]]=n.config[P[de]]===!0||n.config[P[de]]==="true";eu.filter(function(ve){return n.config[ve]!==void 0}).forEach(function(ve){n.config[ve]=tu(n.config[ve]||[]).map(a)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&n.config.mode==="single"&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var de=0;de<n.config.plugins.length;de++){var Ie=n.config.plugins[de](n)||{};for(var pe in Ie)eu.indexOf(pe)>-1?n.config[pe]=tu(Ie[pe]).map(a).concat(n.config[pe]):typeof z[pe]=="undefined"&&(n.config[pe]=Ie[pe])}z.altInputClass||(n.config.altInputClass=he().className+" "+n.config.altInputClass),ze("onParseConfig")}function he(){return n.config.wrap?e.querySelector("[data-input]"):e}function ge(){typeof n.config.locale!="object"&&typeof vt.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=Mt(Mt({},vt.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?vt.l10ns[n.config.locale]:void 0),Pr.D="("+n.l10n.weekdays.shorthand.join("|")+")",Pr.l="("+n.l10n.weekdays.longhand.join("|")+")",Pr.M="("+n.l10n.months.shorthand.join("|")+")",Pr.F="("+n.l10n.months.longhand.join("|")+")",Pr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var P=Mt(Mt({},t),JSON.parse(JSON.stringify(e.dataset||{})));P.time_24hr===void 0&&vt.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=Cg(n),n.parseDate=ru({config:n.config,l10n:n.l10n})}function xe(P){if(typeof n.config.position=="function")return void n.config.position(n,P);if(n.calendarContainer!==void 0){ze("onPreCalendarPosition");var z=P||n._positionElement,q=Array.prototype.reduce.call(n.calendarContainer.children,function(pz,gz){return pz+gz.offsetHeight},0),ee=n.calendarContainer.offsetWidth,ae=n.config.position.split(" "),ce=ae[0],we=ae.length>1?ae[1]:null,de=z.getBoundingClientRect(),Ie=window.innerHeight-de.bottom,pe=ce==="above"||ce!=="below"&&Ie<q&&de.top>q,ve=window.pageYOffset+de.top+(pe?-q-2:z.offsetHeight+2);if(Ft(n.calendarContainer,"arrowTop",!pe),Ft(n.calendarContainer,"arrowBottom",pe),!n.config.inline){var Le=window.pageXOffset+de.left,Pt=!1,Xe=!1;we==="center"?(Le-=(ee-de.width)/2,Pt=!0):we==="right"&&(Le-=ee-de.width,Xe=!0),Ft(n.calendarContainer,"arrowLeft",!Pt&&!Xe),Ft(n.calendarContainer,"arrowCenter",Pt),Ft(n.calendarContainer,"arrowRight",Xe);var nn=window.document.body.offsetWidth-(window.pageXOffset+de.right),fe=Le+ee>window.document.body.offsetWidth,Gt=nn+ee>window.document.body.offsetWidth;if(Ft(n.calendarContainer,"rightMost",fe),!n.config.static)if(n.calendarContainer.style.top=ve+"px",!fe)n.calendarContainer.style.left=Le+"px",n.calendarContainer.style.right="auto";else if(!Gt)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=nn+"px";else{var Hu=ke();if(Hu===void 0)return;var lz=window.document.body.offsetWidth,cz=Math.max(0,lz/2-ee/2),uz=".flatpickr-calendar.centerMost:before",dz=".flatpickr-calendar.centerMost:after",fz=Hu.cssRules.length,hz="{left:"+de.left+"px;right:auto;}";Ft(n.calendarContainer,"rightMost",!1),Ft(n.calendarContainer,"centerMost",!0),Hu.insertRule(uz+","+dz+hz,fz),n.calendarContainer.style.left=cz+"px",n.calendarContainer.style.right="auto"}}}}function ke(){for(var P=null,z=0;z<document.styleSheets.length;z++){var q=document.styleSheets[z];if(q.cssRules){try{q.cssRules}catch(ee){continue}P=q;break}}return P!=null?P:Ke()}function Ke(){var P=document.createElement("style");return document.head.appendChild(P),P.sheet}function Oe(){n.config.noCalendar||n.isMobile||(F(),pr(),T())}function Pe(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function St(P){P.preventDefault(),P.stopPropagation();var z=function(ve){return ve.classList&&ve.classList.contains("flatpickr-day")&&!ve.classList.contains("flatpickr-disabled")&&!ve.classList.contains("notAllowed")},q=xg(Zt(P),z);if(q!==void 0){var ee=q,ae=n.latestSelectedDateObj=new Date(ee.dateObj.getTime()),ce=(ae.getMonth()<n.currentMonth||ae.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=ee,n.config.mode==="single")n.selectedDates=[ae];else if(n.config.mode==="multiple"){var we=Lr(ae);we?n.selectedDates.splice(parseInt(we),1):n.selectedDates.push(ae)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=ae,n.selectedDates.push(ae),en(ae,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(ve,Le){return ve.getTime()-Le.getTime()}));if(d(),ce){var de=n.currentYear!==ae.getFullYear();n.currentYear=ae.getFullYear(),n.currentMonth=ae.getMonth(),de&&(ze("onYearChange"),F()),ze("onMonthChange")}if(pr(),T(),tn(),!ce&&n.config.mode!=="range"&&n.config.showMonths===1?E(ee):n.selectedDateElem!==void 0&&n.hourElement===void 0&&n.selectedDateElem&&n.selectedDateElem.focus(),n.hourElement!==void 0&&n.hourElement!==void 0&&n.hourElement.focus(),n.config.closeOnSelect){var Ie=n.config.mode==="single"&&!n.config.enableTime,pe=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(Ie||pe)&&Pe()}b()}}var It={locale:[ge,Y],showMonths:[j,l,V],minDate:[S],maxDate:[S],positionElement:[Rr],clickOpens:[function(){n.config.clickOpens===!0?(m(n._input,"focus",n.open),m(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function Bt(P,z){if(P!==null&&typeof P=="object"){Object.assign(n.config,P);for(var q in P)It[q]!==void 0&&It[q].forEach(function(ee){return ee()})}else n.config[P]=z,It[P]!==void 0?It[P].forEach(function(ee){return ee()}):eu.indexOf(P)>-1&&(n.config[P]=tu(z));n.redraw(),tn(!0)}function Dt(P,z){var q=[];if(P instanceof Array)q=P.map(function(ee){return n.parseDate(ee,z)});else if(P instanceof Date||typeof P=="number")q=[n.parseDate(P,z)];else if(typeof P=="string")switch(n.config.mode){case"single":case"time":q=[n.parseDate(P,z)];break;case"multiple":q=P.split(n.config.conjunction).map(function(ee){return n.parseDate(ee,z)});break;case"range":q=P.split(n.l10n.rangeSeparator).map(function(ee){return n.parseDate(ee,z)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(P)));n.selectedDates=n.config.allowInvalidPreload?q:q.filter(function(ee){return ee instanceof Date&&Z(ee,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(ee,ae){return ee.getTime()-ae.getTime()})}function zt(P,z,q){if(z===void 0&&(z=!1),q===void 0&&(q=n.config.dateFormat),P!==0&&!P||P instanceof Array&&P.length===0)return n.clear(z);Dt(P,q),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),S(void 0,z),p(),n.selectedDates.length===0&&n.clear(!1),tn(z),z&&ze("onChange")}function _n(P){return P.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?n.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:n.parseDate(z.from,void 0),to:n.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function Ei(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var P=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);P&&Dt(P,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),n.config.minTime!==void 0&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),n.config.maxTime!==void 0&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}function hn(){if(n.input=he(),!n.input){n.config.errorHandler(new Error("Invalid input element specified"));return}n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=Fe(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),Rr()}function Rr(){n._positionElement=n.config.positionElement||n._input}function No(){var P=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=Fe("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=P,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=P==="datetime-local"?"Y-m-d\\TH:i:S":P==="date"?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",n.altInput!==void 0&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(z){}m(n.mobileInput,"change",function(z){n.setDate(Zt(z).value,!1,n.mobileFormatStr),ze("onChange"),ze("onClose")})}function zo(P){if(n.isOpen===!0)return n.close();n.open(P)}function ze(P,z){if(n.config!==void 0){var q=n.config[P];if(q!==void 0&&q.length>0)for(var ee=0;q[ee]&&ee<q.length;ee++)q[ee](n.selectedDates,n.input.value,n,z);P==="onChange"&&(n.input.dispatchEvent(hr("change")),n.input.dispatchEvent(hr("input")))}}function hr(P){var z=document.createEvent("Event");return z.initEvent(P,!0,!0),z}function Lr(P){for(var z=0;z<n.selectedDates.length;z++){var q=n.selectedDates[z];if(q instanceof Date&&en(q,P)===0)return""+z}return!1}function ki(P){return n.config.mode!=="range"||n.selectedDates.length<2?!1:en(P,n.selectedDates[0])>=0&&en(P,n.selectedDates[1])<=0}function pr(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(P,z){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[z].textContent=ms(q.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=q.getMonth().toString(),P.value=q.getFullYear().toString()}),n._hidePrevMonthArrow=n.config.minDate!==void 0&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=n.config.maxDate!==void 0&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function Mr(P){var z=P||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(q){return n.formatDate(q,z)}).filter(function(q,ee,ae){return n.config.mode!=="range"||n.config.enableTime||ae.indexOf(q)===ee}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function tn(P){P===void 0&&(P=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=Mr(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=Mr(n.config.altFormat)),P!==!1&&ze("onValueUpdate")}function _i(P){var z=Zt(P),q=n.prevMonthNav.contains(z),ee=n.nextMonthNav.contains(z);q||ee?D(q?-1:1):n.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):z.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function bt(P){P.preventDefault();var z=P.type==="keydown",q=Zt(P),ee=q;n.amPM!==void 0&&q===n.amPM&&(n.amPM.textContent=n.l10n.amPM[dn(n.amPM.textContent===n.l10n.amPM[0])]);var ae=parseFloat(ee.getAttribute("min")),ce=parseFloat(ee.getAttribute("max")),we=parseFloat(ee.getAttribute("step")),de=parseInt(ee.value,10),Ie=P.delta||(z?P.which===38?1:-1:0),pe=de+we*Ie;if(typeof ee.value!="undefined"&&ee.value.length===2){var ve=ee===n.hourElement,Le=ee===n.minuteElement;pe<ae?(pe=ce+pe+dn(!ve)+(dn(ve)&&dn(!n.amPM)),Le&&I(void 0,-1,n.hourElement)):pe>ce&&(pe=ee===n.hourElement?pe-ce-dn(!n.amPM):ae,Le&&I(void 0,1,n.hourElement)),n.amPM&&ve&&(we===1?pe+de===23:Math.abs(pe-de)>we)&&(n.amPM.textContent=n.l10n.amPM[dn(n.amPM.textContent===n.l10n.amPM[0])]),ee.value=Wt(pe)}}return i(),n}function pi(e,t){for(var n=Array.prototype.slice.call(e).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<n.length;i++){var o=n[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=eD(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return pi(this,e)},HTMLElement.prototype.flatpickr=function(e){return pi([this],e)});var vt=function(e,t){return typeof e=="string"?pi(window.document.querySelectorAll(e),t):e instanceof Node?pi([e],t):pi(e,t)};vt.defaultConfig={},vt.l10ns={en:Mt({},yo),default:Mt({},yo)},vt.localize=function(e){vt.l10ns.default=Mt(Mt({},vt.l10ns.default),e)},vt.setDefaults=function(e){vt.defaultConfig=Mt(Mt({},vt.defaultConfig),e)},vt.parseDate=ru({}),vt.formatDate=Cg({}),vt.compareDates=en,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(e){return pi(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e=="string"?parseInt(e,10):e))},typeof window!="undefined"&&(window.flatpickr=vt);const tD=Gu(Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"})));(function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(U){return typeof U}:t=function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(y),r=o(XS),i=o(tD);function o(D){return D&&D.__esModule?D:{default:D}}function a(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return a=function(){return D},D}function l(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var B=a();if(B&&B.has(D))return B.get(D);var U={},W=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ie in D)if(Object.prototype.hasOwnProperty.call(D,ie)){var se=W?Object.getOwnPropertyDescriptor(D,ie):null;se&&(se.get||se.set)?Object.defineProperty(U,ie,se):U[ie]=D[ie]}return U.default=D,B&&B.set(D,U),U}function c(D){return p(D)||d(D)||f(D)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2458
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(D,B){if(D){if(typeof D=="string")return g(D,B);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor&&(U=D.constructor.name),U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return g(D,B)}}function d(D){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(D))return Array.from(D)}function p(D){if(Array.isArray(D))return g(D)}function g(D,B){(B==null||B>D.length)&&(B=D.length);for(var U=0,W=new Array(B);U<B;U++)W[U]=D[U];return W}function v(){return v=Object.assign||function(D){for(var B=1;B<arguments.length;B++){var U=arguments[B];for(var W in U)Object.prototype.hasOwnProperty.call(U,W)&&(D[W]=U[W])}return D},v.apply(this,arguments)}function m(D,B){if(D==null)return{};var U=b(D,B),W,ie;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(D);for(ie=0;ie<se.length;ie++)W=se[ie],!(B.indexOf(W)>=0)&&Object.prototype.propertyIsEnumerable.call(D,W)&&(U[W]=D[W])}return U}function b(D,B){if(D==null)return{};var U={},W=Object.keys(D),ie,se;for(se=0;se<W.length;se++)ie=W[se],!(B.indexOf(ie)>=0)&&(U[ie]=D[ie]);return U}function C(D,B){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(D);B&&(W=W.filter(function(ie){return Object.getOwnPropertyDescriptor(D,ie).enumerable})),U.push.apply(U,W)}return U}function S(D){for(var B=1;B<arguments.length;B++){var U=arguments[B]!=null?arguments[B]:{};B%2?C(Object(U),!0).forEach(function(W){F(D,W,U[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):C(Object(U)).forEach(function(W){Object.defineProperty(D,W,Object.getOwnPropertyDescriptor(U,W))})}return D}function x(D,B){if(!(D instanceof B))throw new TypeError("Cannot call a class as a function")}function I(D,B){for(var U=0;U<B.length;U++){var W=B[U];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(D,W.key,W)}}function w(D,B,U){return B&&I(D.prototype,B),D}function A(D,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(B&&B.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),B&&E(D,B)}function E(D,B){return E=Object.setPrototypeOf||function(W,ie){return W.__proto__=ie,W},E(D,B)}function k(D){var B=O();return function(){var W=T(D),ie;if(B){var se=T(this).constructor;ie=Reflect.construct(W,arguments,se)}else ie=W.apply(this,arguments);return $(this,ie)}}function $(D,B){return B&&(t(B)==="object"||typeof B=="function")?B:G(D)}function G(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function O(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}function T(D){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)},T(D)}function F(D,B,U){return B in D?Object.defineProperty(D,B,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[B]=U,D}var H=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],j=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),N=["onCreate","onDestroy"],L=r.default.func,V=function(D){A(U,D);var B=k(U);function U(){var W;x(this,U);for(var ie=arguments.length,se=new Array(ie),oe=0;oe<ie;oe++)se[oe]=arguments[oe];return W=B.call.apply(B,[this].concat(se)),F(G(W),"createFlatpickrInstance",function(){var Z=S({onClose:function(){W.node.blur&&W.node.blur()}},W.props.options);Z=Y(Z,W.props),W.flatpickr=(0,i.default)(W.node,Z),W.props.hasOwnProperty("value")&&W.flatpickr.setDate(W.props.value,!1);var te=W.props.onCreate;te&&te(W.flatpickr)}),F(G(W),"destroyFlatpickrInstance",function(){var Z=W.props.onDestroy;Z&&Z(W.flatpickr),W.flatpickr.destroy(),W.flatpickr=null}),F(G(W),"handleNodeChange",function(Z){W.node=Z,W.flatpickr&&(W.destroyFlatpickrInstance(),W.createFlatpickrInstance())}),W}return w(U,[{key:"componentDidUpdate",value:function(ie){var se=this.props.options,oe=ie.options;se=Y(se,this.props),oe=Y(oe,ie);for(var Z=Object.getOwnPropertyNames(se),te=Z.length-1;te>=0;te--){var ne=Z[te],ue=se[ne];ue!==oe[ne]&&(H.indexOf(ne)!==-1&&!Array.isArray(ue)&&(ue=[ue]),this.flatpickr.set(ne,ue))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&ie.value&&Array.isArray(ie.value)&&this.props.value.every(function(be,Ne){ie[Ne]}))&&this.props.value!==ie.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var ie=this.props,se=ie.options,oe=ie.defaultValue,Z=ie.value,te=ie.children,ne=ie.render,ue=m(ie,["options","defaultValue","value","children","render"]);return H.forEach(function(be){delete ue[be]}),N.forEach(function(be){delete ue[be]}),ne?ne(S(S({},ue),{},{defaultValue:oe,value:Z}),this.handleNodeChange):se.wrap?n.default.createElement("div",v({},ue,{ref:this.handleNodeChange}),te):n.default.createElement("input",v({},ue,{defaultValue:oe,ref:this.handleNodeChange}))}}]),U}(n.Component);F(V,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:j,onOpen:j,onClose:j,onMonthChange:j,onYearChange:j,onReady:j,onValueUpdate:j,onDayCreate:j,onCreate:L,onDestroy:L,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),F(V,"defaultProps",{options:{}});function Y(D,B){var U=S({},D);return H.forEach(function(W){if(B.hasOwnProperty(W)){var ie;U[W]&&!Array.isArray(U[W])?U[W]=[U[W]]:U[W]||(U[W]=[]);var se=Array.isArray(B[W])?B[W]:[B[W]];(ie=U[W]).push.apply(ie,c(se))}}),U}var X=V;e.default=X})(bg);const Sg=yn(bg);var Ig={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",u="day",f="week",d="month",p="quarter",g="year",v="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],N=H%100;return"["+H+(j[(N-20)%10]||j[N]||j[0])+"]"}},x=function(H,j,N){var L=String(H);return!L||L.length>=j?H:""+Array(j+1-L.length).join(N)+H},I={s:x,z:function(H){var j=-H.utcOffset(),N=Math.abs(j),L=Math.floor(N/60),V=N%60;return(j<=0?"+":"-")+x(L,2,"0")+":"+x(V,2,"0")},m:function H(j,N){if(j.date()<N.date())return-H(N,j);var L=12*(N.year()-j.year())+(N.month()-j.month()),V=j.clone().add(L,d),Y=N-V<0,X=j.clone().add(L+(Y?-1:1),d);return+(-(L+(N-V)/(Y?V-X:X-V))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:g,w:f,d:u,D:v,h:c,m:l,s:a,ms:o,Q:p}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},w="en",A={};A[w]=S;var E="$isDayjsObject",k=function(H){return H instanceof T||!(!H||!H[E])},$=function H(j,N,L){var V;if(!j)return w;if(typeof j=="string"){var Y=j.toLowerCase();A[Y]&&(V=Y),N&&(A[Y]=N,V=Y);var X=j.split("-");if(!V&&X.length>1)return H(X[0])}else{var D=j.name;A[D]=j,V=D}return!L&&V&&(w=V),V||!L&&w},G=function(H,j){if(k(H))return H.clone();var N=typeof j=="object"?j:{};return N.date=H,N.args=arguments,new T(N)},O=I;O.l=$,O.i=k,O.w=function(H,j){return G(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var T=function(){function H(N){this.$L=$(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[E]=!0}var j=H.prototype;return j.parse=function(N){this.$d=function(L){var V=L.date,Y=L.utc;if(V===null)return new Date(NaN);if(O.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var D=X[2]-1||0,B=(X[7]||"0").substring(0,3);return Y?new Date(Date.UTC(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,B)):new Date(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,B)}}return new Date(V)}(N),this.init()},j.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==m},j.isSame=function(N,L){var V=G(N);return this.startOf(L)<=V&&V<=this.endOf(L)},j.isAfter=function(N,L){return G(N)<this.startOf(L)},j.isBefore=function(N,L){return this.endOf(L)<G(N)},j.$g=function(N,L,V){return O.u(N)?this[L]:this.set(V,N)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(N,L){var V=this,Y=!!O.u(L)||L,X=O.p(N),D=function(te,ne){var ue=O.w(V.$u?Date.UTC(V.$y,ne,te):new Date(V.$y,ne,te),V);return Y?ue:ue.endOf(u)},B=function(te,ne){return O.w(V.toDate()[te].apply(V.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ne)),V)},U=this.$W,W=this.$M,ie=this.$D,se="set"+(this.$u?"UTC":"");switch(X){case g:return Y?D(1,0):D(31,11);case d:return Y?D(1,W):D(0,W+1);case f:var oe=this.$locale().weekStart||0,Z=(U<oe?U+7:U)-oe;return D(Y?ie-Z:ie+(6-Z),W);case u:case v:return B(se+"Hours",0);case c:return B(se+"Minutes",1);case l:return B(se+"Seconds",2);case a:return B(se+"Milliseconds",3);default:return this.clone()}},j.endOf=function(N){return this.startOf(N,!1)},j.$set=function(N,L){var V,Y=O.p(N),X="set"+(this.$u?"UTC":""),D=(V={},V[u]=X+"Date",V[v]=X+"Date",V[d]=X+"Month",V[g]=X+"FullYear",V[c]=X+"Hours",V[l]=X+"Minutes",V[a]=X+"Seconds",V[o]=X+"Milliseconds",V)[Y],B=Y===u?this.$D+(L-this.$W):L;if(Y===d||Y===g){var U=this.clone().set(v,1);U.$d[D](B),U.init(),this.$d=U.set(v,Math.min(this.$D,U.daysInMonth())).$d}else D&&this.$d[D](B);return this.init(),this},j.set=function(N,L){return this.clone().$set(N,L)},j.get=function(N){return this[O.p(N)]()},j.add=function(N,L){var V,Y=this;N=Number(N);var X=O.p(L),D=function(W){var ie=G(Y);return O.w(ie.date(ie.date()+Math.round(W*N)),Y)};if(X===d)return this.set(d,this.$M+N);if(X===g)return this.set(g,this.$y+N);if(X===u)return D(1);if(X===f)return D(7);var B=(V={},V[l]=r,V[c]=i,V[a]=n,V)[X]||1,U=this.$d.getTime()+N*B;return O.w(U,this)},j.subtract=function(N,L){return this.add(-1*N,L)},j.format=function(N){var L=this,V=this.$locale();if(!this.isValid())return V.invalidDate||m;var Y=N||"YYYY-MM-DDTHH:mm:ssZ",X=O.z(this),D=this.$H,B=this.$m,U=this.$M,W=V.weekdays,ie=V.months,se=V.meridiem,oe=function(ne,ue,be,Ne){return ne&&(ne[ue]||ne(L,Y))||be[ue].slice(0,Ne)},Z=function(ne){return O.s(D%12||12,ne,"0")},te=se||function(ne,ue,be){var Ne=ne<12?"AM":"PM";return be?Ne.toLowerCase():Ne};return Y.replace(C,function(ne,ue){return ue||function(be){switch(be){case"YY":return String(L.$y).slice(-2);case"YYYY":return O.s(L.$y,4,"0");case"M":return U+1;case"MM":return O.s(U+1,2,"0");case"MMM":return oe(V.monthsShort,U,ie,3);case"MMMM":return oe(ie,U);case"D":return L.$D;case"DD":return O.s(L.$D,2,"0");case"d":return String(L.$W);case"dd":return oe(V.weekdaysMin,L.$W,W,2);case"ddd":return oe(V.weekdaysShort,L.$W,W,3);case"dddd":return W[L.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(D,B,!0);case"A":return te(D,B,!1);case"m":return String(B);case"mm":return O.s(B,2,"0");case"s":return String(L.$s);case"ss":return O.s(L.$s,2,"0");case"SSS":return O.s(L.$ms,3,"0");case"Z":return X}return null}(ne)||X.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(N,L,V){var Y,X=this,D=O.p(L),B=G(N),U=(B.utcOffset()-this.utcOffset())*r,W=this-B,ie=function(){return O.m(X,B)};switch(D){case g:Y=ie()/12;break;case d:Y=ie();break;case p:Y=ie()/3;break;case f:Y=(W-U)/6048e5;break;case u:Y=(W-U)/864e5;break;case c:Y=W/i;break;case l:Y=W/r;break;case a:Y=W/n;break;default:Y=W}return V?Y:O.a(Y)},j.daysInMonth=function(){return this.endOf(d).$D},j.$locale=function(){return A[this.$L]},j.locale=function(N,L){if(!N)return this.$L;var V=this.clone(),Y=$(N,L,!0);return Y&&(V.$L=Y),V},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H}(),F=T.prototype;return G.prototype=F,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",u],["$M",d],["$y",g],["$D",v]].forEach(function(H){F[H[1]]=function(j){return this.$g(j,H[0],H[1])}}),G.extend=function(H,j){return H.$i||(H(j,T,G),H.$i=!0),G},G.locale=$,G.isDayjs=k,G.unix=function(H){return G(1e3*H)},G.en=A[w],G.Ls=A,G.p={},G})})(Ig);var nD=Ig.exports;const ft=yn(nD);var Ag={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,o,a){var l,c=function(p,g,v){v===void 0&&(v={});var m=new Date(p),b=function(C,S){S===void 0&&(S={});var x=S.timeZoneName||"short",I=C+"|"+x,w=r[I];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[I]=w),w}(g,v);return b.formatToParts(m)},u=function(p,g){for(var v=c(p,g),m=[],b=0;b<v.length;b+=1){var C=v[b],S=C.type,x=C.value,I=n[S];I>=0&&(m[I]=parseInt(x,10))}var w=m[3],A=w===24?0:w,E=m[0]+"-"+m[1]+"-"+m[2]+" "+A+":"+m[4]+":"+m[5]+":000",k=+p;return(a.utc(E).valueOf()-(k-=k%1e3))/6e4},f=o.prototype;f.tz=function(p,g){p===void 0&&(p=l);var v,m=this.utcOffset(),b=this.toDate(),C=b.toLocaleString("en-US",{timeZone:p}),S=Math.round((b-new Date(C))/1e3/60),x=15*-Math.round(b.getTimezoneOffset()/15)-S;if(!Number(x))v=this.utcOffset(0,g);else if(v=a(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),g){var I=v.utcOffset();v=v.add(m-I,"minute")}return v.$x.$timezone=p,v},f.offsetName=function(p){var g=this.$x.$timezone||a.tz.guess(),v=c(this.valueOf(),g,{timeZoneName:p}).find(function(m){return m.type.toLowerCase()==="timezonename"});return v&&v.value};var d=f.startOf;f.startOf=function(p,g){if(!this.$x||!this.$x.$timezone)return d.call(this,p,g);var v=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(v,p,g).tz(this.$x.$timezone,!0)},a.tz=function(p,g,v){var m=v&&g,b=v||g||l,C=u(+a(),b);if(typeof p!="string")return a(p).tz(b);var S=function(A,E,k){var $=A-60*E*1e3,G=u($,k);if(E===G)return[$,E];var O=u($-=60*(G-E)*1e3,k);return G===O?[$,G]:[A-60*Math.min(G,O)*1e3,Math.max(G,O)]}(a.utc(p,m).valueOf(),C,b),x=S[0],I=S[1],w=a(x).utcOffset(I);return w.$x.$timezone=b,w},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){l=p}}})})(Ag);var rD=Ag.exports;const iD=yn(rD);var Tg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,a,l){var c=a.prototype;l.utc=function(m){var b={date:m,utc:!0,args:arguments};return new a(b)},c.utc=function(m){var b=l(this.toDate(),{locale:this.$L,utc:!0});return m?b.add(this.utcOffset(),n):b},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var f=c.init;c.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else f.call(this)};var d=c.utcOffset;c.utcOffset=function(m,b){var C=this.$utils().u;if(C(m))return this.$u?0:C(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(w){w===void 0&&(w="");var A=w.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],k=E[0],$=60*+E[1]+ +E[2];return $===0?0:k==="+"?$:-$}(m),m===null))return this;var S=Math.abs(m)<=16?60*m:m,x=this;if(b)return x.$offset=S,x.$u=m===0,x;if(m!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(S+I,n)).$offset=S,x.$x.$localOffset=I}else x=this.utc();return x};var p=c.format;c.format=function(m){var b=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,b)},c.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(m){return m==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=c.diff;c.diff=function(m,b,C){if(m&&this.$u===m.$u)return v.call(this,m,b,C);var S=this.local(),x=l(m).local();return v.call(S,x,b,C)}}})})(Tg);var oD=Tg.exports;const aD=yn(oD);ft.extend(iD),ft.extend(aD);const sD=e=>{if(!ft(e).isAfter(ft(Date.now()).subtract(15,"minute")))return ft(Date.now()).add(15,"minute").toDate()},au=({defaultDate:e,minDate:t,maxDate:n,dateFormat:r="DD.MM.YYYY HH:mm",onChange:i})=>{const o=a=>{if(a&&a.length){const l=ft.utc(a[0]).toISOString();i(l)}else i("")};return s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",paddingLeft:"0.5rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,minHeight:"37px",color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(Sg,{value:e&&ft(e).format("YYYY-MM-DD HH:mm")||void 0,onChange:o,className:"flatpickr-input",options:{enableTime:!0,dateFormat:r,position:"below",minDate:t||sD(e),maxDate:n,parseDate:(a,l)=>ft(a,l).toDate(),formatDate:(a,l)=>ft(a).format(l),time_24hr:!0,minuteIncrement:1}})})},lD=({required:e,defaultValue:t,onChangeFromDate:n,onChangeToDate:r})=>{const[i,o]=t;return s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormControl,{children:s.jsx(h.FormLabel,{required:e,color:"primary",children:"Duration"})}),s.jsxs(h.Grid,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"flex-start",children:[s.jsx(bo,{label:"From date",defaultValue:i,required:e,onChange:n}),s.jsx(bo,{label:"To date",defaultValue:o,required:e,onChange:r})]})]})},Eg=e=>{if(!e)return[];const{from:t,to:n}=e,r=[];return t&&r.push(ft(t).toDate()),n&&r.push(ft(n).toDate()),r},cD=({label:e,defaultValue:t,required:n,onChange:r})=>{const[i,o]=y.useState(Eg(t)),[a,l]=y.useState(!1),c=()=>l(!a),u=f=>{if(f&&f.length>0){const d="YYYY-MM-DD",p=ft(f[0]).format(d),g=ft(f[1]).format(d);r({from:p,to:g})}else f&&f.length===0&&(r({from:"",to:""}),c());o(f)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",padding:"0.5rem 0.75rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(Sg,{value:i,onChange:u,placeholder:"Select Date...",className:"flatpickr-input",options:{mode:"range",enableTime:!1,dateFormat:"DD.MM.YYYY",altFormat:"DD.MM.YYYY",position:"below",parseDate:(f,d)=>ft(f,d).toDate(),formatDate:(f,d)=>ft(f).format(d),defaultDate:Eg(t)||void 0}})}),s.jsx(Ye,{showToast:a,message:"Succesfully cleared the duration time",color:"primary",hideToast:c})]})},uD=({environment:e,labels:t,setNoPermission:n})=>{const{featureDisabled:r,noPermissionMessage:i,tryAgainButton:o}=t,a=()=>{ro(e).signOut().then(()=>n(null)).catch(l=>{console.error("There was a problem logging out the user:",l)})};return s.jsx(h.Box,{"data-testid":"no permission card",sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",bgcolor:"background.body"},children:s.jsx(h.Card,{variant:"outlined",sx:{maxWidth:300,overflow:"hidden",borderRadius:"md"},children:s.jsxs(h.CardContent,{children:[s.jsx(h.Typography,{level:"h2",textAlign:"center",mb:2,children:r}),s.jsx(h.Typography,{level:"body-md",color:"neutral",mb:2,children:i}),s.jsx(h.Box,{display:"flex",justifyContent:"center",children:s.jsx(h.Button,{variant:"solid",color:"neutral",fullWidth:!0,size:"sm",onClick:a,children:o})})]})})})},kg=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],su=e=>e.reduce((t,n)=>(t[n.key]=n.value,t),{}),dD=({labels:e,type:t,defaultValue:n,onChange:r})=>{const[i,o]=y.useState(kg(n)),[a,l]=y.useState(null),[c,u]=y.useState(""),[f,d]=y.useState(""),[p,g]=y.useState(""),[v,m]=y.useState("");y.useEffect(()=>o(kg(n)),[n]);const b=()=>{const I=[...i];I.push({key:c,value:p}),o(I),u(""),g(""),r(su(I))},C=I=>{const w=i.filter((A,E)=>E!==I);o(w),r(su(w))},S=(I,w)=>{d(w.key),m(w.value),l(I)},x=I=>{const w=[...i];w[I]={key:f,value:v},o(w),l(null),d(""),m(""),r(su(w))};return s.jsxs(h.Box,{children:[i.map((I,w)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{style:{flex:1},children:a===w?s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:f,onChange:A=>d(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:v,onChange:A=>m(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.save,children:f&&v?s.jsx(h.IconButton,{onClick:()=>x(w),children:s.jsx(_e.Check,{})}):s.jsx("span",{children:s.jsx(h.IconButton,{disabled:!0,children:s.jsx(_e.Check,{})})})})]}):s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.keyDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.key})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.valueDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.value})]})]}),s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.edit,children:s.jsx(h.IconButton,{onClick:()=>S(w,I),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.delete,children:s.jsx(h.IconButton,{onClick:()=>C(w),children:s.jsx(_e.Delete,{})})})]})]})})},`dynamic-fields-${t}-${w}`)),s.jsxs(h.Box,{display:"flex",alignItems:"center",style:{marginTop:i&&i.length?"20px":"0px"},children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:c,placeholder:e.keyDynamicFields,onChange:I=>u(I.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:p,onChange:I=>g(I.target.value),placeholder:e.valueDynamicFields,sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.add,children:c&&p?s.jsx(h.Button,{onClick:b,children:s.jsx(_e.Add,{})}):s.jsx("span",{children:s.jsx(h.Button,{disabled:!0,children:s.jsx(_e.Add,{})})})})]})]})};function Co(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_g(Object(n),!0).forEach(function(r){Co(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hc(r.key),r)}}function hD(e,t,n){return t&&Pg(e.prototype,t),n&&Pg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lu(e,t){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},lu(e,t)}function pD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lu(e,t)}function vs(e){return vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vs(e)}function Dg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dg=function(){return!!e})()}function gD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mD(e,t){if(t&&(Tr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gD(e)}function vD(e){var t=Dg();return function(){var n,r=vs(e);if(t){var i=vs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mD(this,n)}}function cu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e){if(Array.isArray(e))return cu(e)}function yD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Og(e,t){if(e){if(typeof e=="string")return cu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cu(e,t):void 0}}function xD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2458
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(D,B){if(D){if(typeof D=="string")return g(D,B);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor&&(U=D.constructor.name),U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return g(D,B)}}function d(D){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(D))return Array.from(D)}function p(D){if(Array.isArray(D))return g(D)}function g(D,B){(B==null||B>D.length)&&(B=D.length);for(var U=0,W=new Array(B);U<B;U++)W[U]=D[U];return W}function v(){return v=Object.assign||function(D){for(var B=1;B<arguments.length;B++){var U=arguments[B];for(var W in U)Object.prototype.hasOwnProperty.call(U,W)&&(D[W]=U[W])}return D},v.apply(this,arguments)}function m(D,B){if(D==null)return{};var U=b(D,B),W,ie;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(D);for(ie=0;ie<se.length;ie++)W=se[ie],!(B.indexOf(W)>=0)&&Object.prototype.propertyIsEnumerable.call(D,W)&&(U[W]=D[W])}return U}function b(D,B){if(D==null)return{};var U={},W=Object.keys(D),ie,se;for(se=0;se<W.length;se++)ie=W[se],!(B.indexOf(ie)>=0)&&(U[ie]=D[ie]);return U}function C(D,B){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(D);B&&(W=W.filter(function(ie){return Object.getOwnPropertyDescriptor(D,ie).enumerable})),U.push.apply(U,W)}return U}function S(D){for(var B=1;B<arguments.length;B++){var U=arguments[B]!=null?arguments[B]:{};B%2?C(Object(U),!0).forEach(function(W){F(D,W,U[W])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):C(Object(U)).forEach(function(W){Object.defineProperty(D,W,Object.getOwnPropertyDescriptor(U,W))})}return D}function x(D,B){if(!(D instanceof B))throw new TypeError("Cannot call a class as a function")}function I(D,B){for(var U=0;U<B.length;U++){var W=B[U];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(D,W.key,W)}}function w(D,B,U){return B&&I(D.prototype,B),D}function A(D,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(B&&B.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),B&&E(D,B)}function E(D,B){return E=Object.setPrototypeOf||function(W,ie){return W.__proto__=ie,W},E(D,B)}function k(D){var B=O();return function(){var W=T(D),ie;if(B){var se=T(this).constructor;ie=Reflect.construct(W,arguments,se)}else ie=W.apply(this,arguments);return $(this,ie)}}function $(D,B){return B&&(t(B)==="object"||typeof B=="function")?B:G(D)}function G(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function O(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}function T(D){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)},T(D)}function F(D,B,U){return B in D?Object.defineProperty(D,B,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[B]=U,D}var H=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],j=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),N=["onCreate","onDestroy"],M=r.default.func,V=function(D){A(U,D);var B=k(U);function U(){var W;x(this,U);for(var ie=arguments.length,se=new Array(ie),oe=0;oe<ie;oe++)se[oe]=arguments[oe];return W=B.call.apply(B,[this].concat(se)),F(G(W),"createFlatpickrInstance",function(){var Z=S({onClose:function(){W.node.blur&&W.node.blur()}},W.props.options);Z=Y(Z,W.props),W.flatpickr=(0,i.default)(W.node,Z),W.props.hasOwnProperty("value")&&W.flatpickr.setDate(W.props.value,!1);var te=W.props.onCreate;te&&te(W.flatpickr)}),F(G(W),"destroyFlatpickrInstance",function(){var Z=W.props.onDestroy;Z&&Z(W.flatpickr),W.flatpickr.destroy(),W.flatpickr=null}),F(G(W),"handleNodeChange",function(Z){W.node=Z,W.flatpickr&&(W.destroyFlatpickrInstance(),W.createFlatpickrInstance())}),W}return w(U,[{key:"componentDidUpdate",value:function(ie){var se=this.props.options,oe=ie.options;se=Y(se,this.props),oe=Y(oe,ie);for(var Z=Object.getOwnPropertyNames(se),te=Z.length-1;te>=0;te--){var ne=Z[te],ue=se[ne];ue!==oe[ne]&&(H.indexOf(ne)!==-1&&!Array.isArray(ue)&&(ue=[ue]),this.flatpickr.set(ne,ue))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&ie.value&&Array.isArray(ie.value)&&this.props.value.every(function(be,Ne){ie[Ne]}))&&this.props.value!==ie.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var ie=this.props,se=ie.options,oe=ie.defaultValue,Z=ie.value,te=ie.children,ne=ie.render,ue=m(ie,["options","defaultValue","value","children","render"]);return H.forEach(function(be){delete ue[be]}),N.forEach(function(be){delete ue[be]}),ne?ne(S(S({},ue),{},{defaultValue:oe,value:Z}),this.handleNodeChange):se.wrap?n.default.createElement("div",v({},ue,{ref:this.handleNodeChange}),te):n.default.createElement("input",v({},ue,{defaultValue:oe,ref:this.handleNodeChange}))}}]),U}(n.Component);F(V,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:j,onOpen:j,onClose:j,onMonthChange:j,onYearChange:j,onReady:j,onValueUpdate:j,onDayCreate:j,onCreate:M,onDestroy:M,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),F(V,"defaultProps",{options:{}});function Y(D,B){var U=S({},D);return H.forEach(function(W){if(B.hasOwnProperty(W)){var ie;U[W]&&!Array.isArray(U[W])?U[W]=[U[W]]:U[W]||(U[W]=[]);var se=Array.isArray(B[W])?B[W]:[B[W]];(ie=U[W]).push.apply(ie,c(se))}}),U}var X=V;e.default=X})(bg);const Sg=yn(bg);var Ig={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",u="day",f="week",d="month",p="quarter",g="year",v="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],N=H%100;return"["+H+(j[(N-20)%10]||j[N]||j[0])+"]"}},x=function(H,j,N){var M=String(H);return!M||M.length>=j?H:""+Array(j+1-M.length).join(N)+H},I={s:x,z:function(H){var j=-H.utcOffset(),N=Math.abs(j),M=Math.floor(N/60),V=N%60;return(j<=0?"+":"-")+x(M,2,"0")+":"+x(V,2,"0")},m:function H(j,N){if(j.date()<N.date())return-H(N,j);var M=12*(N.year()-j.year())+(N.month()-j.month()),V=j.clone().add(M,d),Y=N-V<0,X=j.clone().add(M+(Y?-1:1),d);return+(-(M+(N-V)/(Y?V-X:X-V))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:g,w:f,d:u,D:v,h:c,m:l,s:a,ms:o,Q:p}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},w="en",A={};A[w]=S;var E="$isDayjsObject",k=function(H){return H instanceof T||!(!H||!H[E])},$=function H(j,N,M){var V;if(!j)return w;if(typeof j=="string"){var Y=j.toLowerCase();A[Y]&&(V=Y),N&&(A[Y]=N,V=Y);var X=j.split("-");if(!V&&X.length>1)return H(X[0])}else{var D=j.name;A[D]=j,V=D}return!M&&V&&(w=V),V||!M&&w},G=function(H,j){if(k(H))return H.clone();var N=typeof j=="object"?j:{};return N.date=H,N.args=arguments,new T(N)},O=I;O.l=$,O.i=k,O.w=function(H,j){return G(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var T=function(){function H(N){this.$L=$(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[E]=!0}var j=H.prototype;return j.parse=function(N){this.$d=function(M){var V=M.date,Y=M.utc;if(V===null)return new Date(NaN);if(O.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var D=X[2]-1||0,B=(X[7]||"0").substring(0,3);return Y?new Date(Date.UTC(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,B)):new Date(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,B)}}return new Date(V)}(N),this.init()},j.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==m},j.isSame=function(N,M){var V=G(N);return this.startOf(M)<=V&&V<=this.endOf(M)},j.isAfter=function(N,M){return G(N)<this.startOf(M)},j.isBefore=function(N,M){return this.endOf(M)<G(N)},j.$g=function(N,M,V){return O.u(N)?this[M]:this.set(V,N)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(N,M){var V=this,Y=!!O.u(M)||M,X=O.p(N),D=function(te,ne){var ue=O.w(V.$u?Date.UTC(V.$y,ne,te):new Date(V.$y,ne,te),V);return Y?ue:ue.endOf(u)},B=function(te,ne){return O.w(V.toDate()[te].apply(V.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ne)),V)},U=this.$W,W=this.$M,ie=this.$D,se="set"+(this.$u?"UTC":"");switch(X){case g:return Y?D(1,0):D(31,11);case d:return Y?D(1,W):D(0,W+1);case f:var oe=this.$locale().weekStart||0,Z=(U<oe?U+7:U)-oe;return D(Y?ie-Z:ie+(6-Z),W);case u:case v:return B(se+"Hours",0);case c:return B(se+"Minutes",1);case l:return B(se+"Seconds",2);case a:return B(se+"Milliseconds",3);default:return this.clone()}},j.endOf=function(N){return this.startOf(N,!1)},j.$set=function(N,M){var V,Y=O.p(N),X="set"+(this.$u?"UTC":""),D=(V={},V[u]=X+"Date",V[v]=X+"Date",V[d]=X+"Month",V[g]=X+"FullYear",V[c]=X+"Hours",V[l]=X+"Minutes",V[a]=X+"Seconds",V[o]=X+"Milliseconds",V)[Y],B=Y===u?this.$D+(M-this.$W):M;if(Y===d||Y===g){var U=this.clone().set(v,1);U.$d[D](B),U.init(),this.$d=U.set(v,Math.min(this.$D,U.daysInMonth())).$d}else D&&this.$d[D](B);return this.init(),this},j.set=function(N,M){return this.clone().$set(N,M)},j.get=function(N){return this[O.p(N)]()},j.add=function(N,M){var V,Y=this;N=Number(N);var X=O.p(M),D=function(W){var ie=G(Y);return O.w(ie.date(ie.date()+Math.round(W*N)),Y)};if(X===d)return this.set(d,this.$M+N);if(X===g)return this.set(g,this.$y+N);if(X===u)return D(1);if(X===f)return D(7);var B=(V={},V[l]=r,V[c]=i,V[a]=n,V)[X]||1,U=this.$d.getTime()+N*B;return O.w(U,this)},j.subtract=function(N,M){return this.add(-1*N,M)},j.format=function(N){var M=this,V=this.$locale();if(!this.isValid())return V.invalidDate||m;var Y=N||"YYYY-MM-DDTHH:mm:ssZ",X=O.z(this),D=this.$H,B=this.$m,U=this.$M,W=V.weekdays,ie=V.months,se=V.meridiem,oe=function(ne,ue,be,Ne){return ne&&(ne[ue]||ne(M,Y))||be[ue].slice(0,Ne)},Z=function(ne){return O.s(D%12||12,ne,"0")},te=se||function(ne,ue,be){var Ne=ne<12?"AM":"PM";return be?Ne.toLowerCase():Ne};return Y.replace(C,function(ne,ue){return ue||function(be){switch(be){case"YY":return String(M.$y).slice(-2);case"YYYY":return O.s(M.$y,4,"0");case"M":return U+1;case"MM":return O.s(U+1,2,"0");case"MMM":return oe(V.monthsShort,U,ie,3);case"MMMM":return oe(ie,U);case"D":return M.$D;case"DD":return O.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return oe(V.weekdaysMin,M.$W,W,2);case"ddd":return oe(V.weekdaysShort,M.$W,W,3);case"dddd":return W[M.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(D,B,!0);case"A":return te(D,B,!1);case"m":return String(B);case"mm":return O.s(B,2,"0");case"s":return String(M.$s);case"ss":return O.s(M.$s,2,"0");case"SSS":return O.s(M.$ms,3,"0");case"Z":return X}return null}(ne)||X.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(N,M,V){var Y,X=this,D=O.p(M),B=G(N),U=(B.utcOffset()-this.utcOffset())*r,W=this-B,ie=function(){return O.m(X,B)};switch(D){case g:Y=ie()/12;break;case d:Y=ie();break;case p:Y=ie()/3;break;case f:Y=(W-U)/6048e5;break;case u:Y=(W-U)/864e5;break;case c:Y=W/i;break;case l:Y=W/r;break;case a:Y=W/n;break;default:Y=W}return V?Y:O.a(Y)},j.daysInMonth=function(){return this.endOf(d).$D},j.$locale=function(){return A[this.$L]},j.locale=function(N,M){if(!N)return this.$L;var V=this.clone(),Y=$(N,M,!0);return Y&&(V.$L=Y),V},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H}(),F=T.prototype;return G.prototype=F,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",u],["$M",d],["$y",g],["$D",v]].forEach(function(H){F[H[1]]=function(j){return this.$g(j,H[0],H[1])}}),G.extend=function(H,j){return H.$i||(H(j,T,G),H.$i=!0),G},G.locale=$,G.isDayjs=k,G.unix=function(H){return G(1e3*H)},G.en=A[w],G.Ls=A,G.p={},G})})(Ig);var nD=Ig.exports;const ft=yn(nD);var Ag={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,o,a){var l,c=function(p,g,v){v===void 0&&(v={});var m=new Date(p),b=function(C,S){S===void 0&&(S={});var x=S.timeZoneName||"short",I=C+"|"+x,w=r[I];return w||(w=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[I]=w),w}(g,v);return b.formatToParts(m)},u=function(p,g){for(var v=c(p,g),m=[],b=0;b<v.length;b+=1){var C=v[b],S=C.type,x=C.value,I=n[S];I>=0&&(m[I]=parseInt(x,10))}var w=m[3],A=w===24?0:w,E=m[0]+"-"+m[1]+"-"+m[2]+" "+A+":"+m[4]+":"+m[5]+":000",k=+p;return(a.utc(E).valueOf()-(k-=k%1e3))/6e4},f=o.prototype;f.tz=function(p,g){p===void 0&&(p=l);var v,m=this.utcOffset(),b=this.toDate(),C=b.toLocaleString("en-US",{timeZone:p}),S=Math.round((b-new Date(C))/1e3/60),x=15*-Math.round(b.getTimezoneOffset()/15)-S;if(!Number(x))v=this.utcOffset(0,g);else if(v=a(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),g){var I=v.utcOffset();v=v.add(m-I,"minute")}return v.$x.$timezone=p,v},f.offsetName=function(p){var g=this.$x.$timezone||a.tz.guess(),v=c(this.valueOf(),g,{timeZoneName:p}).find(function(m){return m.type.toLowerCase()==="timezonename"});return v&&v.value};var d=f.startOf;f.startOf=function(p,g){if(!this.$x||!this.$x.$timezone)return d.call(this,p,g);var v=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(v,p,g).tz(this.$x.$timezone,!0)},a.tz=function(p,g,v){var m=v&&g,b=v||g||l,C=u(+a(),b);if(typeof p!="string")return a(p).tz(b);var S=function(A,E,k){var $=A-60*E*1e3,G=u($,k);if(E===G)return[$,E];var O=u($-=60*(G-E)*1e3,k);return G===O?[$,G]:[A-60*Math.min(G,O)*1e3,Math.max(G,O)]}(a.utc(p,m).valueOf(),C,b),x=S[0],I=S[1],w=a(x).utcOffset(I);return w.$x.$timezone=b,w},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){l=p}}})})(Ag);var rD=Ag.exports;const iD=yn(rD);var Tg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,a,l){var c=a.prototype;l.utc=function(m){var b={date:m,utc:!0,args:arguments};return new a(b)},c.utc=function(m){var b=l(this.toDate(),{locale:this.$L,utc:!0});return m?b.add(this.utcOffset(),n):b},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var f=c.init;c.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else f.call(this)};var d=c.utcOffset;c.utcOffset=function(m,b){var C=this.$utils().u;if(C(m))return this.$u?0:C(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(w){w===void 0&&(w="");var A=w.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],k=E[0],$=60*+E[1]+ +E[2];return $===0?0:k==="+"?$:-$}(m),m===null))return this;var S=Math.abs(m)<=16?60*m:m,x=this;if(b)return x.$offset=S,x.$u=m===0,x;if(m!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(S+I,n)).$offset=S,x.$x.$localOffset=I}else x=this.utc();return x};var p=c.format;c.format=function(m){var b=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,b)},c.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(m){return m==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=c.diff;c.diff=function(m,b,C){if(m&&this.$u===m.$u)return v.call(this,m,b,C);var S=this.local(),x=l(m).local();return v.call(S,x,b,C)}}})})(Tg);var oD=Tg.exports;const aD=yn(oD);ft.extend(iD),ft.extend(aD);const sD=e=>{if(!ft(e).isAfter(ft(Date.now()).subtract(15,"minute")))return ft(Date.now()).add(15,"minute").toDate()},au=({defaultDate:e,minDate:t,maxDate:n,dateFormat:r="DD.MM.YYYY HH:mm",onChange:i})=>{const o=a=>{if(a&&a.length){const l=ft.utc(a[0]).toISOString();i(l)}else i("")};return s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",paddingLeft:"0.5rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,minHeight:"37px",color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(Sg,{value:e&&ft(e).format("YYYY-MM-DD HH:mm")||void 0,onChange:o,className:"flatpickr-input",options:{enableTime:!0,dateFormat:r,position:"below",minDate:t||sD(e),maxDate:n,parseDate:(a,l)=>ft(a,l).toDate(),formatDate:(a,l)=>ft(a).format(l),time_24hr:!0,minuteIncrement:1}})})},lD=({required:e,defaultValue:t,onChangeFromDate:n,onChangeToDate:r})=>{const[i,o]=t;return s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormControl,{children:s.jsx(h.FormLabel,{required:e,color:"primary",children:"Duration"})}),s.jsxs(h.Grid,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"flex-start",children:[s.jsx(bo,{label:"From date",defaultValue:i,required:e,onChange:n}),s.jsx(bo,{label:"To date",defaultValue:o,required:e,onChange:r})]})]})},Eg=e=>{if(!e)return[];const{from:t,to:n}=e,r=[];return t&&r.push(ft(t).toDate()),n&&r.push(ft(n).toDate()),r},cD=({label:e,defaultValue:t,required:n,onChange:r})=>{const[i,o]=y.useState(Eg(t)),[a,l]=y.useState(!1),c=()=>l(!a),u=f=>{if(f&&f.length>0){const d="YYYY-MM-DD",p=ft(f[0]).format(d),g=ft(f[1]).format(d);r({from:p,to:g})}else f&&f.length===0&&(r({from:"",to:""}),c());o(f)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",padding:"0.5rem 0.75rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(Sg,{value:i,onChange:u,placeholder:"Select Date...",className:"flatpickr-input",options:{mode:"range",enableTime:!1,dateFormat:"DD.MM.YYYY",altFormat:"DD.MM.YYYY",position:"below",parseDate:(f,d)=>ft(f,d).toDate(),formatDate:(f,d)=>ft(f).format(d),defaultDate:Eg(t)||void 0}})}),s.jsx(Ye,{showToast:a,message:"Succesfully cleared the duration time",color:"primary",hideToast:c})]})},uD=({environment:e,labels:t,setNoPermission:n})=>{const{featureDisabled:r,noPermissionMessage:i,tryAgainButton:o}=t,a=()=>{ro(e).signOut().then(()=>n(null)).catch(l=>{console.error("There was a problem logging out the user:",l)})};return s.jsx(h.Box,{"data-testid":"no permission card",sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",bgcolor:"background.body"},children:s.jsx(h.Card,{variant:"outlined",sx:{maxWidth:300,overflow:"hidden",borderRadius:"md"},children:s.jsxs(h.CardContent,{children:[s.jsx(h.Typography,{level:"h2",textAlign:"center",mb:2,children:r}),s.jsx(h.Typography,{level:"body-md",color:"neutral",mb:2,children:i}),s.jsx(h.Box,{display:"flex",justifyContent:"center",children:s.jsx(h.Button,{variant:"solid",color:"neutral",fullWidth:!0,size:"sm",onClick:a,children:o})})]})})})},kg=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],su=e=>e.reduce((t,n)=>(t[n.key]=n.value,t),{}),dD=({labels:e,type:t,defaultValue:n,onChange:r})=>{const[i,o]=y.useState(kg(n)),[a,l]=y.useState(null),[c,u]=y.useState(""),[f,d]=y.useState(""),[p,g]=y.useState(""),[v,m]=y.useState("");y.useEffect(()=>o(kg(n)),[n]);const b=()=>{const I=[...i];I.push({key:c,value:p}),o(I),u(""),g(""),r(su(I))},C=I=>{const w=i.filter((A,E)=>E!==I);o(w),r(su(w))},S=(I,w)=>{d(w.key),m(w.value),l(I)},x=I=>{const w=[...i];w[I]={key:f,value:v},o(w),l(null),d(""),m(""),r(su(w))};return s.jsxs(h.Box,{children:[i.map((I,w)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{style:{flex:1},children:a===w?s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:f,onChange:A=>d(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:v,onChange:A=>m(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.save,children:f&&v?s.jsx(h.IconButton,{onClick:()=>x(w),children:s.jsx(_e.Check,{})}):s.jsx("span",{children:s.jsx(h.IconButton,{disabled:!0,children:s.jsx(_e.Check,{})})})})]}):s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.keyDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.key})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.valueDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.value})]})]}),s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.edit,children:s.jsx(h.IconButton,{onClick:()=>S(w,I),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.delete,children:s.jsx(h.IconButton,{onClick:()=>C(w),children:s.jsx(_e.Delete,{})})})]})]})})},`dynamic-fields-${t}-${w}`)),s.jsxs(h.Box,{display:"flex",alignItems:"center",style:{marginTop:i&&i.length?"20px":"0px"},children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:c,placeholder:e.keyDynamicFields,onChange:I=>u(I.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:p,onChange:I=>g(I.target.value),placeholder:e.valueDynamicFields,sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.add,children:c&&p?s.jsx(h.Button,{onClick:b,children:s.jsx(_e.Add,{})}):s.jsx("span",{children:s.jsx(h.Button,{disabled:!0,children:s.jsx(_e.Add,{})})})})]})]})};function Co(e,t,n){return(t=hc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_g(Object(n),!0).forEach(function(r){Co(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hc(r.key),r)}}function hD(e,t,n){return t&&Pg(e.prototype,t),n&&Pg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lu(e,t){return lu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},lu(e,t)}function pD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lu(e,t)}function vs(e){return vs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vs(e)}function Dg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dg=function(){return!!e})()}function gD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mD(e,t){if(t&&(Tr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gD(e)}function vD(e){var t=Dg();return function(){var n,r=vs(e);if(t){var i=vs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mD(this,n)}}function cu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e){if(Array.isArray(e))return cu(e)}function yD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Og(e,t){if(e){if(typeof e=="string")return cu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cu(e,t):void 0}}function xD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2459
2459
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gi(e){return bD(e)||yD(e)||Og(e)||xD()}function CD(e){if(Array.isArray(e))return e}function wD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function SD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2460
2460
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yn(e,t){return CD(e)||wD(e,t)||Og(e,t)||SD()}function En(e,t){if(e==null)return{};var n,r,i=De(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ID(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var uu=y.useLayoutEffect,AD=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],bs=function(){};function TD(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function ED(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(TD(e,a)));return o.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var ys=function(t){return BD(t)?t.filter(Boolean):Tr(t)==="object"&&t!==null?[t]:[]},Rg=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=En(t,AD);return ye({},n)},lt=function(t,n,r){var i=t.cx,o=t.getStyles,a=t.getClassNames,l=t.className;return{css:o(n,t),className:i(r!=null?r:{},a(n,t),l)}};function xs(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function kD(e){return xs(e)?window.innerHeight:e.clientHeight}function Lg(e){return xs(e)?window.pageYOffset:e.scrollTop}function Cs(e,t){if(xs(e)){window.scrollTo(0,t);return}e.scrollTop=t}function _D(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function PD(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function ws(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:bs,i=Lg(e),o=t-i,a=10,l=0;function c(){l+=a;var u=PD(l,i,o,n);Cs(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Mg(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?Cs(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&Cs(e,Math.max(t.offsetTop-i,0))}function DD(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Bg(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function OD(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}var $g=!1,RD={get passive(){return $g=!0}},Ss=typeof window!="undefined"?window:{};Ss.addEventListener&&Ss.removeEventListener&&(Ss.addEventListener("p",bs,RD),Ss.removeEventListener("p",bs,!1));var LD=$g;function MD(e){return e!=null}function BD(e){return Array.isArray(e)}function wo(e,t,n){return e?t:n}function _z(e){return e}function Pz(e){return e}var $D=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(a){var l=Yn(a,1),c=l[0];return!r.includes(c)});return o.reduce(function(a,l){var c=Yn(l,2),u=c[0],f=c[1];return a[u]=f,a},{})},FD=["children","innerProps"],ND=["children","innerProps"];function zD(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,c=_D(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var f=c.getBoundingClientRect(),d=f.height,p=n.getBoundingClientRect(),g=p.bottom,v=p.height,m=p.top,b=n.offsetParent.getBoundingClientRect(),C=b.top,S=a?window.innerHeight:kD(c),x=Lg(c),I=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),A=C-w,E=S-m,k=A+x,$=d-x-m,G=g-S+x+I,O=x+m-w,T=160;switch(i){case"auto":case"bottom":if(E>=v)return{placement:"bottom",maxHeight:t};if($>=v&&!a)return o&&ws(c,G,T),{placement:"bottom",maxHeight:t};if(!a&&$>=r||a&&E>=r){o&&ws(c,G,T);var F=a?E-I:$-I;return{placement:"bottom",maxHeight:F}}if(i==="auto"||a){var H=t,j=a?A:k;return j>=r&&(H=Math.min(j-I-l,t)),{placement:"top",maxHeight:H}}if(i==="bottom")return o&&Cs(c,G),{placement:"bottom",maxHeight:t};break;case"top":if(A>=v)return{placement:"top",maxHeight:t};if(k>=v&&!a)return o&&ws(c,O,T),{placement:"top",maxHeight:t};if(!a&&k>=r||a&&A>=r){var N=t;return(!a&&k>=r||a&&A>=r)&&(N=a?A-w:k-w),o&&ws(c,O,T),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function jD(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Fg=function(t){return t==="auto"?"bottom":t},UD=function(t,n){var r,i=t.placement,o=t.theme,a=o.borderRadius,l=o.spacing,c=o.colors;return ye((r={label:"menu"},Co(r,jD(i),"100%"),Co(r,"position","absolute"),Co(r,"width","100%"),Co(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},Ng=y.createContext(null),VD=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,l=t.menuShouldScrollIntoView,c=t.theme,u=y.useContext(Ng)||{},f=u.setPortalPlacement,d=y.useRef(null),p=y.useState(i),g=Yn(p,2),v=g[0],m=g[1],b=y.useState(null),C=Yn(b,2),S=C[0],x=C[1],I=c.spacing.controlHeight;return uu(function(){var w=d.current;if(w){var A=a==="fixed",E=l&&!A,k=zD({maxHeight:i,menuEl:w,minHeight:r,placement:o,shouldScroll:E,isFixedPosition:A,controlHeight:I});m(k.maxHeight),x(k.placement),f==null||f(k.placement)}},[i,o,a,l,r,f,I]),n({ref:d,placerProps:ye(ye({},t),{},{placement:S||Fg(o),maxHeight:v})})},HD=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return me.jsx("div",R({},lt(t,"menu",{menu:!0}),{ref:r},i),n)},WD=HD,GD=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return ye({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},YD=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return me.jsx("div",R({},lt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},zg=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},KD=zg,qD=zg,QD=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=En(t,FD);return me.jsx("div",R({},lt(ye(ye({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},JD=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=En(t,ND);return me.jsx("div",R({},lt(ye(ye({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},XD=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},ZD=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,a=t.menuPlacement,l=t.menuPosition,c=y.useRef(null),u=y.useRef(null),f=y.useState(Fg(a)),d=Yn(f,2),p=d[0],g=d[1],v=y.useMemo(function(){return{setPortalPlacement:g}},[]),m=y.useState(null),b=Yn(m,2),C=b[0],S=b[1],x=y.useCallback(function(){if(i){var E=DD(i),k=l==="fixed"?0:window.pageYOffset,$=E[p]+k;($!==(C==null?void 0:C.offset)||E.left!==(C==null?void 0:C.rect.left)||E.width!==(C==null?void 0:C.rect.width))&&S({offset:$,rect:E})}},[i,l,p,C==null?void 0:C.offset,C==null?void 0:C.rect.left,C==null?void 0:C.rect.width]);uu(function(){x()},[x]);var I=y.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&c.current&&(u.current=iA(i,c.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);uu(function(){I()},[I]);var w=y.useCallback(function(E){c.current=E,I()},[I]);if(!n&&l!=="fixed"||!C)return null;var A=me.jsx("div",R({ref:w},lt(ye(ye({},t),{},{offset:C.offset,position:l,rect:C.rect}),"menuPortal",{"menu-portal":!0}),o),r);return me.jsx(Ng.Provider,{value:v},n?yt.createPortal(A,n):A)},eO=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},tO=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return me.jsx("div",R({},lt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},nO=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return ye({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},rO=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return me.jsx("div",R({},lt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},iO=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},oO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},lt(t,"indicatorsContainer",{indicators:!0}),r),n)},jg,aO=["size"],sO=["innerProps","isRtl","size"],lO={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Ug=function(t){var n=t.size,r=En(t,aO);return me.jsx("svg",R({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:lO},r))},du=function(t){return me.jsx(Ug,R({size:20},t),me.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Vg=function(t){return me.jsx(Ug,R({size:20},t),me.jsx("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Hg=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},cO=Hg,uO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},lt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||me.jsx(Vg,null))},dO=Hg,fO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},lt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||me.jsx(du,null))},hO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},pO=function(t){var n=t.innerProps;return me.jsx("span",R({},n,lt(t,"indicatorSeparator",{"indicator-separator":!0})))},gO=me.keyframes(jg||(jg=ID([`
2461
2461
  0%, 80%, 100% { opacity: 0; }
2462
2462
  40% { opacity: 1; }
2463
- `]))),mO=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},fu=function(t){var n=t.delay,r=t.offset;return me.jsx("span",{css:me.css({animation:"".concat(gO," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},vO=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=En(t,sO);return me.jsx("div",R({},lt(ye(ye({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),me.jsx(fu,{delay:0,offset:r}),me.jsx(fu,{delay:160,offset:!0}),me.jsx(fu,{delay:320,offset:!r}))},bO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,c=o.spacing;return ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},yO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return me.jsx("div",R({ref:o},lt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},xO=yO,CO=["data"],wO=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},SO=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,f=t.theme,d=t.selectProps;return me.jsx("div",R({},lt(t,"group",{group:!0}),c),me.jsx(a,R({},l,{selectProps:d,theme:f,getStyles:i,getClassNames:o,cx:r}),u),me.jsx("div",null,n))},IO=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return ye({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},AO=function(t){var n=Rg(t);n.data;var r=En(n,CO);return me.jsx("div",R({},lt(t,"groupHeading",{"group-heading":!0}),r))},TO=SO,EO=["innerRef","isDisabled","isHidden","inputClassName"],kO=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return ye(ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},_O),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},Wg={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_O={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Wg)},PO=function(t){return ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Wg)},DO=function(t){var n=t.cx,r=t.value,i=Rg(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,c=i.inputClassName,u=En(i,EO);return me.jsx("div",R({},lt(t,"input",{"input-container":!0}),{"data-value":r||""}),me.jsx("input",R({className:n({input:!0},c),ref:o,style:PO(l),disabled:a},u)))},OO=DO,RO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},LO=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},MO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Gg=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",r,n)},BO=Gg,$O=Gg;function FO(e){var t=e.children,n=e.innerProps;return me.jsx("div",R({role:"button"},n),t||me.jsx(du,{size:14}))}var NO=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,f=r.Label,d=r.Remove;return me.jsx(u,{data:i,innerProps:ye(ye({},lt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},me.jsx(f,{data:i,innerProps:ye({},lt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),me.jsx(d,{data:i,innerProps:ye(ye({},lt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},zO=NO,jO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,c=a.colors;return ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?c.primary:c.primary50}})},UO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return me.jsx("div",R({},lt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},VO=UO,HO=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},WO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},lt(t,"placeholder",{placeholder:!0}),r),n)},GO=WO,YO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},KO=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return me.jsx("div",R({},lt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},qO=KO,QO={ClearIndicator:fO,Control:xO,DropdownIndicator:uO,DownChevron:Vg,CrossIcon:du,Group:TO,GroupHeading:AO,IndicatorsContainer:oO,IndicatorSeparator:pO,Input:OO,LoadingIndicator:vO,Menu:WD,MenuList:YD,MenuPortal:ZD,LoadingMessage:JD,NoOptionsMessage:QD,MultiValue:zO,MultiValueContainer:BO,MultiValueLabel:$O,MultiValueRemove:FO,Option:VO,Placeholder:GO,SelectContainer:tO,SingleValue:qO,ValueContainer:rO},JO=function(t){return ye(ye({},QO),t.components)},Yg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function XO(e,t){return!!(e===t||Yg(e)&&Yg(t))}function ZO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!XO(e[n],t[n]))return!1;return!0}function eR(e,t){t===void 0&&(t=ZO);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}for(var tR={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},nR=function(t){return me.jsx("span",R({css:tR},t))},Kg=nR,rR={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,c=t.isDisabled,u=t.isSelected,f=t.isAppleDevice,d=function(m,b){return m&&m.length?"".concat(m.indexOf(b)+1," of ").concat(m.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&f){var p=c?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(a).concat(g,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},iR=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,f=t.isAppleDevice,d=c.ariaLiveMessages,p=c.getOptionLabel,g=c.inputValue,v=c.isMulti,m=c.isOptionDisabled,b=c.isSearchable,C=c.menuIsOpen,S=c.options,x=c.screenReaderStatus,I=c.tabSelectsValue,w=c.isLoading,A=c["aria-label"],E=c["aria-live"],k=y.useMemo(function(){return ye(ye({},rR),d||{})},[d]),$=y.useMemo(function(){var j="";if(n&&k.onChange){var N=n.option,L=n.options,V=n.removedValue,Y=n.removedValues,X=n.value,D=function(Z){return Array.isArray(Z)?null:Z},B=V||N||D(X),U=B?p(B):"",W=L||Y||void 0,ie=W?W.map(p):[],se=ye({isDisabled:B&&m(B,l),label:U,labels:ie},n);j=k.onChange(se)}return j},[n,k,m,l,p]),G=y.useMemo(function(){var j="",N=r||i,L=!!(r&&l&&l.includes(r));if(N&&k.onFocus){var V={focused:N,label:p(N),isDisabled:m(N,l),isSelected:L,options:o,context:N===r?"menu":"value",selectValue:l,isAppleDevice:f};j=k.onFocus(V)}return j},[r,i,p,m,k,o,l,f]),O=y.useMemo(function(){var j="";if(C&&S.length&&!w&&k.onFilter){var N=x({count:o.length});j=k.onFilter({inputValue:g,resultsMessage:N})}return j},[o,g,C,k,S,x,w]),T=(n==null?void 0:n.action)==="initial-input-focus",F=y.useMemo(function(){var j="";if(k.guidance){var N=i?"value":C?"menu":"input";j=k.guidance({"aria-label":A,context:N,isDisabled:r&&m(r,l),isMulti:v,isSearchable:b,tabSelectsValue:I,isInitialFocus:T})}return j},[A,r,i,v,m,b,C,k,l,I,T]),H=me.jsx(y.Fragment,null,me.jsx("span",{id:"aria-selection"},$),me.jsx("span",{id:"aria-focused"},G),me.jsx("span",{id:"aria-results"},O),me.jsx("span",{id:"aria-guidance"},F));return me.jsx(y.Fragment,null,me.jsx(Kg,{id:u},T&&H),me.jsx(Kg,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&H))},oR=iR,hu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],aR=new RegExp("["+hu.map(function(e){return e.letters}).join("")+"]","g"),qg={},pu=0;pu<hu.length;pu++)for(var gu=hu[pu],mu=0;mu<gu.letters.length;mu++)qg[gu.letters[mu]]=gu.base;var Qg=function(t){return t.replace(aR,function(n){return qg[n]})},sR=eR(Qg),Jg=function(t){return t.replace(/^\s+|\s+$/g,"")},lR=function(t){return"".concat(t.label," ").concat(t.value)},cR=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=ye({ignoreCase:!0,ignoreAccents:!0,stringify:lR,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,c=i.trim,u=i.matchFrom,f=c?Jg(r):r,d=c?Jg(l(n)):l(n);return o&&(f=f.toLowerCase(),d=d.toLowerCase()),a&&(f=sR(f),d=Qg(d)),u==="start"?d.substr(0,f.length)===f:d.indexOf(f)>-1}},uR=["innerRef"];function dR(e){var t=e.innerRef,n=En(e,uR),r=$D(n,"onExited","in","enter","exit","appear");return me.jsx("input",R({ref:t},r,{css:me.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var fR=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function hR(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=y.useRef(!1),l=y.useRef(!1),c=y.useRef(0),u=y.useRef(null),f=y.useCallback(function(b,C){if(u.current!==null){var S=u.current,x=S.scrollTop,I=S.scrollHeight,w=S.clientHeight,A=u.current,E=C>0,k=I-w-x,$=!1;k>C&&a.current&&(r&&r(b),a.current=!1),E&&l.current&&(o&&o(b),l.current=!1),E&&C>k?(n&&!a.current&&n(b),A.scrollTop=I,$=!0,a.current=!0):!E&&-C>x&&(i&&!l.current&&i(b),A.scrollTop=0,$=!0,l.current=!0),$&&fR(b)}},[n,r,i,o]),d=y.useCallback(function(b){f(b,b.deltaY)},[f]),p=y.useCallback(function(b){c.current=b.changedTouches[0].clientY},[]),g=y.useCallback(function(b){var C=c.current-b.changedTouches[0].clientY;f(b,C)},[f]),v=y.useCallback(function(b){if(b){var C=LD?{passive:!1}:!1;b.addEventListener("wheel",d,C),b.addEventListener("touchstart",p,C),b.addEventListener("touchmove",g,C)}},[g,p,d]),m=y.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",p,!1),b.removeEventListener("touchmove",g,!1))},[g,p,d]);return y.useEffect(function(){if(t){var b=u.current;return v(b),function(){m(b)}}},[t,v,m]),function(b){u.current=b}}var Xg=["boxSizing","height","overflow","paddingRight","position"],Zg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function em(e){e.preventDefault()}function tm(e){e.stopPropagation()}function nm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function rm(){return"ontouchstart"in window||navigator.maxTouchPoints}var im=!!(typeof window!="undefined"&&window.document&&window.document.createElement),So=0,mi={capture:!1,passive:!1};function pR(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=y.useRef({}),o=y.useRef(null),a=y.useCallback(function(c){if(im){var u=document.body,f=u&&u.style;if(r&&Xg.forEach(function(v){var m=f&&f[v];i.current[v]=m}),r&&So<1){var d=parseInt(i.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(Zg).forEach(function(v){var m=Zg[v];f&&(f[v]=m)}),f&&(f.paddingRight="".concat(g,"px"))}u&&rm()&&(u.addEventListener("touchmove",em,mi),c&&(c.addEventListener("touchstart",nm,mi),c.addEventListener("touchmove",tm,mi))),So+=1}},[r]),l=y.useCallback(function(c){if(im){var u=document.body,f=u&&u.style;So=Math.max(So-1,0),r&&So<1&&Xg.forEach(function(d){var p=i.current[d];f&&(f[d]=p)}),u&&rm()&&(u.removeEventListener("touchmove",em,mi),c&&(c.removeEventListener("touchstart",nm,mi),c.removeEventListener("touchmove",tm,mi)))}},[r]);return y.useEffect(function(){if(t){var c=o.current;return a(c),function(){l(c)}}},[t,a,l]),function(c){o.current=c}}var gR=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},mR={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function vR(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=hR({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:c}),f=pR({isEnabled:n}),d=function(g){u(g),f(g)};return me.jsx(y.Fragment,null,n&&me.jsx("div",{onClick:gR,css:mR}),t(d))}var bR={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},yR=function(t){var n=t.name,r=t.onFocus;return me.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:bR,value:"",onChange:function(){}})},xR=yR;function vu(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function CR(){return vu(/^iPhone/i)}function om(){return vu(/^Mac/i)}function wR(){return vu(/^iPad/i)||om()&&navigator.maxTouchPoints>1}function SR(){return CR()||wR()}function IR(){return om()||SR()}var AR=function(t){return t.label},am=function(t){return t.label},sm=function(t){return t.value},TR=function(t){return!!t.isDisabled},ER={clearIndicator:dO,container:eO,control:bO,dropdownIndicator:cO,group:wO,groupHeading:IO,indicatorsContainer:iO,indicatorSeparator:hO,input:kO,loadingIndicator:mO,loadingMessage:qD,menu:UD,menuList:GD,menuPortal:XD,multiValue:RO,multiValueLabel:LO,multiValueRemove:MO,noOptionsMessage:KD,option:jO,placeholder:HO,singleValue:YO,valueContainer:nO},kR={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},_R=4,lm=4,PR=38,DR=lm*2,OR={baseUnit:lm,controlHeight:PR,menuGutter:DR},bu={borderRadius:_R,colors:kR,spacing:OR},RR={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Bg(),captureMenuScroll:!Bg(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:cR(),formatGroupLabel:AR,getOptionLabel:am,getOptionValue:sm,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:TR,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!OD(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function cm(e,t,n,r){var i=pm(e,t,n),o=gm(e,t,n),a=hm(e,t),l=As(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function Is(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return cm(e,a,t,l)}).filter(function(a){return fm(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=cm(e,n,t,r);return fm(e,o)?o:void 0}).filter(MD)}function um(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,gi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function dm(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,gi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function LR(e,t){return um(Is(e,t))}function fm(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!vm(e)||!o)&&mm(e,{label:a,value:l,data:i},r)}function MR(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function BR(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var yu=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},hm=function(t,n){return t.getOptionLabel(n)},As=function(t,n){return t.getOptionValue(n)};function pm(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function gm(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=As(e,t);return n.some(function(i){return As(e,i)===r})}function mm(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var vm=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},$R=1,bm=function(e){pD(n,e);var t=vD(n);function n(r){var i;if(fD(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=IR(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var f=i.props,d=f.onChange,p=f.name;u.name=p,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,f){var d=i.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:f})},i.selectOption=function(c){var u=i.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=i.state.selectValue,v=d&&i.isOptionSelected(c,g),m=i.isOptionDisabled(c,g);if(v){var b=i.getOptionValue(c);i.setValue(g.filter(function(C){return i.getOptionValue(C)!==b}),"deselect-option",c)}else if(!m)d?i.setValue([].concat(gi(g),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:p});return}f&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,f=i.state.selectValue,d=i.getOptionValue(c),p=f.filter(function(v){return i.getOptionValue(v)!==d}),g=wo(u,p,p[0]||null);i.onChange(g,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(wo(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=wo(c,d,d[0]||null);i.onChange(p,{action:"pop-value",removedValue:f})},i.getFocusedOptionId=function(c){return yu(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return dm(Is(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return ED.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return hm(i.props,c)},i.getOptionValue=function(c){return As(i.props,c)},i.getStyles=function(c,u){var f=i.props.unstyled,d=ER[c](u,f);d.boxSizing="border-box";var p=i.props.styles[c];return p?p(d,u):d},i.getClassNames=function(c,u){var f,d;return(f=(d=i.props.classNames)[c])===null||f===void 0?void 0:f.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return JO(i.props)},i.buildCategorizedOptions=function(){return Is(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return um(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:ye({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,f=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&xs(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,f=u&&u.item(0);f&&(i.initialTouchX=f.clientX,i.initialTouchY=f.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,f=u&&u.item(0);if(f){var d=Math.abs(f.clientX-i.initialTouchX),p=Math.abs(f.clientY-i.initialTouchY),g=5;i.userIsDragging=d>g||p>g}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,f=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(f,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),f=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:f>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return vm(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,m=u.isDisabled,b=u.menuIsOpen,C=u.onKeyDown,S=u.tabSelectsValue,x=u.openMenuOnFocus,I=i.state,w=I.focusedOption,A=I.focusedValue,E=I.selectValue;if(!m&&!(typeof C=="function"&&(C(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!f||g)return;i.focusValue("previous");break;case"ArrowRight":if(!f||g)return;i.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)i.removeValue(A);else{if(!d)return;f?i.popValue():v&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!b||!S||!w||x&&i.isOptionSelected(w,E))return;i.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(b){if(!w||i.isComposing)return;i.selectOption(w);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:g}),i.onMenuClose()):v&&p&&i.clearValue();break;case" ":if(g)return;if(!b){i.openMenu("first");break}if(!w)return;i.selectOption(w);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++$R),i.state.selectValue=ys(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=yu(o,a[l])}return i}return hD(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Mg(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&i.isDisabled||c&&l&&!i.menuIsOpen)&&this.focusInput(),c&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mg(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,c=a.isFocused,u=this.buildFocusableOptions(),f=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(l);l||(c=-1);var u=a.length-1,f=-1;if(a.length){switch(i){case"previous":c===0?f=0:c===-1?f=u:f=c-1;break;case"next":c>-1&&c<u&&(f=c+1);break}this.setState({inputIsHidden:f!==-1,focusedValue:a[f]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(a);a||(u=-1),i==="up"?c=u>0?u-1:l.length-1:i==="down"?c=(u+1)%l.length:i==="pageup"?(c=u-o,c<0&&(c=0)):i==="pagedown"?(c=u+o,c>l.length-1&&(c=l.length-1)):i==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bu):ye(ye({},bu),this.props.theme):bu}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:c,hasValue:m,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return pm(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return gm(this.props,i,o)}},{key:"filterOption",value:function(i,o){return mm(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,c=i.inputValue,u=i.tabIndex,f=i.form,d=i.menuIsOpen,p=i.required,g=this.getComponents(),v=g.Input,m=this.state,b=m.inputIsHidden,C=m.ariaSelection,S=this.commonProps,x=l||this.getElementId("input"),I=ye(ye(ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(C==null?void 0:C.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?K.createElement(v,R({},S,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:c},I)):K.createElement(dR,R({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:bs,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:f,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,c=o.MultiValueLabel,u=o.MultiValueRemove,f=o.SingleValue,d=o.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,m=g.isDisabled,b=g.isMulti,C=g.inputValue,S=g.placeholder,x=this.state,I=x.selectValue,w=x.focusedValue,A=x.isFocused;if(!this.hasValue()||!v)return C?null:K.createElement(d,R({},p,{key:"placeholder",isDisabled:m,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),S);if(b)return I.map(function(k,$){var G=k===w,O="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return K.createElement(a,R({},p,{components:{Container:l,Label:c,Remove:u},isFocused:G,isDisabled:m,key:O,index:$,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(F){F.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(C)return null;var E=I[0];return K.createElement(f,R({},p,{data:E,isDisabled:m}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isDisabled:c,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return K.createElement(a,R({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,c=o.Menu,u=o.MenuList,f=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,g=o.Option,v=this.commonProps,m=this.state.focusedOption,b=this.props,C=b.captureMenuScroll,S=b.inputValue,x=b.isLoading,I=b.loadingMessage,w=b.minMenuHeight,A=b.maxMenuHeight,E=b.menuIsOpen,k=b.menuPlacement,$=b.menuPosition,G=b.menuPortalTarget,O=b.menuShouldBlockScroll,T=b.menuShouldScrollIntoView,F=b.noOptionsMessage,H=b.onMenuScrollToTop,j=b.onMenuScrollToBottom;if(!E)return null;var N=function(U,W){var ie=U.type,se=U.data,oe=U.isDisabled,Z=U.isSelected,te=U.label,ne=U.value,ue=m===se,be=oe?void 0:function(){return i.onOptionHover(se)},Ne=oe?void 0:function(){return i.selectOption(se)},ht="".concat(i.getElementId("option"),"-").concat(W),Je={id:ht,onClick:Ne,onMouseMove:be,onMouseOver:be,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:Z};return K.createElement(g,R({},v,{innerProps:Je,data:se,isDisabled:oe,isSelected:Z,key:ht,label:te,type:ie,value:ne,isFocused:ue,innerRef:ue?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(U.data,"menu"))},L;if(this.hasOptions())L=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var U=B.data,W=B.options,ie=B.index,se="".concat(i.getElementId("group"),"-").concat(ie),oe="".concat(se,"-heading");return K.createElement(a,R({},v,{key:se,data:U,options:W,Heading:l,headingProps:{id:oe,data:B.data},label:i.formatGroupLabel(B.data)}),B.options.map(function(Z){return N(Z,"".concat(ie,"-").concat(Z.index))}))}else if(B.type==="option")return N(B,"".concat(B.index))});else if(x){var V=I({inputValue:S});if(V===null)return null;L=K.createElement(d,v,V)}else{var Y=F({inputValue:S});if(Y===null)return null;L=K.createElement(p,v,Y)}var X={minMenuHeight:w,maxMenuHeight:A,menuPlacement:k,menuPosition:$,menuShouldScrollIntoView:T},D=K.createElement(VD,R({},v,X),function(B){var U=B.ref,W=B.placerProps,ie=W.placement,se=W.maxHeight;return K.createElement(c,R({},v,X,{innerRef:U,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:ie}),K.createElement(vR,{captureEnabled:C,onTopArrive:H,onBottomArrive:j,lockEnabled:O},function(oe){return K.createElement(u,R({},v,{innerRef:function(te){i.getMenuListRef(te),oe(te)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:se,focusedOption:m}),L)}))});return G||$==="fixed"?K.createElement(f,R({},v,{appendTo:G,controlElement:this.controlRef,menuPlacement:k,menuPosition:$}),D):D}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,c=o.isMulti,u=o.name,f=o.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!l)return K.createElement(xR,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(a){var p=d.map(function(m){return i.getOptionValue(m)}).join(a);return K.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(m,b){return K.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(m)})}):K.createElement("input",{name:u,type:"hidden",value:""});return K.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return K.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,c=o.focusedValue,u=o.isFocused,f=o.selectValue,d=this.getFocusableOptions();return K.createElement(oR,R({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:c,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,c=i.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,m=this.commonProps=this.getCommonProps();return K.createElement(l,R({},m,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),K.createElement(o,R({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),K.createElement(c,R({},m,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),K.createElement(a,R({},m,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,f=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,g=i.options,v=i.value,m=i.menuIsOpen,b=i.inputValue,C=i.isMulti,S=ys(v),x={};if(a&&(v!==a.value||g!==a.options||m!==a.menuIsOpen||b!==a.inputValue)){var I=m?LR(i,S):[],w=m?dm(Is(i,S),"".concat(p,"-option")):[],A=l?MR(o,S):null,E=BR(o,I),k=yu(w,E);x={selectValue:S,focusedOption:E,focusedOptionId:k,focusableOptionsWithIds:w,focusedValue:A,clearFocusValueOnUpdate:!1}}var $=c!=null&&i!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},G=u,O=f&&d;return f&&!O&&(G={value:wo(C,S,S[0]||null),options:S,action:"initial-input-focus"},O=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(G=null),ye(ye(ye({},x),$),{},{prevProps:i,ariaSelection:G,prevWasFocused:O})}}]),n}(y.Component);bm.defaultProps=RR;var FR=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function NR(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,f=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,g=e.value,v=En(e,FR),m=y.useState(l!==void 0?l:n),b=Yn(m,2),C=b[0],S=b[1],x=y.useState(c!==void 0?c:i),I=Yn(x,2),w=I[0],A=I[1],E=y.useState(g!==void 0?g:a),k=Yn(E,2),$=k[0],G=k[1],O=y.useCallback(function(V,Y){typeof u=="function"&&u(V,Y),G(V)},[u]),T=y.useCallback(function(V,Y){var X;typeof f=="function"&&(X=f(V,Y)),S(X!==void 0?X:V)},[f]),F=y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),H=y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=l!==void 0?l:C,N=c!==void 0?c:w,L=g!==void 0?g:$;return ye(ye({},v),{},{inputValue:j,menuIsOpen:N,onChange:O,onInputChange:T,onMenuClose:H,onMenuOpen:F,value:L})}var zR=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],ym=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),a=String(r.getOptionLabel(n)).toLowerCase();return o===i||a===i},xu={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return ym(t,o,i)})||r.some(function(o){return ym(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function jR(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,a=o===void 0?xu.formatCreateLabel:o,l=e.isValidNewOption,c=l===void 0?xu.isValidNewOption:l,u=e.getNewOptionData,f=u===void 0?xu.getNewOptionData:u,d=e.onCreateOption,p=e.options,g=p===void 0?[]:p,v=e.onChange,m=En(e,zR),b=m.getOptionValue,C=b===void 0?sm:b,S=m.getOptionLabel,x=S===void 0?am:S,I=m.inputValue,w=m.isLoading,A=m.isMulti,E=m.value,k=m.name,$=y.useMemo(function(){return c(I,ys(E),g,{getOptionValue:C,getOptionLabel:x})?f(I,a(I)):void 0},[a,f,x,C,I,c,g,E]),G=y.useMemo(function(){return(n||!w)&&$?i==="first"?[$].concat(gi(g)):[].concat(gi(g),[$]):g},[n,i,w,$,g]),O=y.useCallback(function(T,F){if(F.action!=="select-option")return v(T,F);var H=Array.isArray(T)?T:[T];if(H[H.length-1]===$){if(d)d(I);else{var j=f(I,I),N={action:"create-option",name:k,option:j};v(wo(A,[].concat(gi(ys(E)),[j]),j),N)}return}v(T,F)},[f,I,A,k,$,d,v,E]);return ye(ye({},m),{},{options:G,onChange:O})}var UR=y.forwardRef(function(e,t){var n=NR(e),r=jR(n);return K.createElement(bm,R({ref:t},r))}),xm=UR;const VR={control:(e,t)=>Q(M({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px",fontFamily:'var(--joy-fontFamily-body, "Inter", var(--joy-fontFamily-fallback, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"));',"&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(M({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(M({},e),{minHeight:"36px"}),menu:e=>Q(M({},e),{position:"relative"}),clearIndicator:e=>Q(M({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(M({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(M({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(M({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"14px"}),multiValueLabel:e=>Q(M({},e),{color:"#333"})},HR=e=>e.map(t=>({label:t,value:t})),WR=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=e.sx||{marginBottom:"16px"},a=HR(e.flags),l=()=>i(!r),c=p=>{e.onChange(p.map(g=>g.value))},u=p=>{n(p)},f=p=>{p.persist();const{key:g}=p;if(t)switch(g){case"Enter":case"Tab":if(e.flags&&e.flags.length===0){const v=[...e.flags,t];e.onChange(v)}if(e.flags&&e.flags.length>0&&d()){const v=[...e.flags,t];e.onChange(v)}n(""),p.preventDefault()}},d=()=>{let p=!1;return e.flags.length&&e.flags.includes(t)?(l(),p):(p=!0,p)};return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:o,children:s.jsx(xm,{styles:VR,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:c,onInputChange:u,onKeyDown:f,placeholder:e.labels.flagsPlaceholder,value:a})}),s.jsx(Ye,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:l})]})},Io=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("primary"),[g,v]=y.useState(""),m=y.useRef(null),b=()=>{m.current&&m.current.click()},C=new Gp,S=Ge(),x=()=>{f(""),i(!1)},I=F=>{let H="",j="primary";switch(F){case"copy_url":H=e.labels.urlCopiedToClipboardMessage,j="primary";break;case"image_deleted":H=e.labels.imageDeletedMessage,j="primary";break;case"image_reset":H=e.labels.imageResetMessage,j="primary";break;case"upload_success":H=e.labels.uploadingImageMessage,j="success";break;case"upload_failed":H=e.labels.uploadingImageErrorMessage,j="danger";break;case"sign_in_url_failed":H=e.labels.generateSignedInUrlErrorMessage,j="danger";break;case"encrypting_file_failed":H=e.labels.encryptingImageErrorMessage,j="danger";break}p(j),f(H),i(!0)},w=()=>a(!o),A=()=>c(!l),E=()=>{e.clearImage(),I("image_deleted")},k=F=>{navigator.clipboard.writeText(F),I("copy_url")},$=F=>_(this,null,function*(){F.persist();const H=F.target.files?F.target.files[0]:null;if(H){n(!0);try{const j=H.type.split("/")[1],N=yield C.readFileAndHash(H),L=(yield C.generateHashFileName(H))+"."+j,V={image_type:j,image_file_name:L,image_size:H.size,base64_sum:N},Y=yield S==null?void 0:S.https.generateSignedInUrl(V);if(Y!=null&&Y.ok){const X=yield Y.json(),D={"Content-Type":H.type,"Content-MD5":N};try{const B=new File([H],L,{type:H.type}),U=yield S==null?void 0:S.https.storeInBucket(X.data.signed_url,B,D);e.onChangeImages(U||""),v(U),I("upload_success")}catch(B){console.error("There was a problem with uploading the file: ",B),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield Y==null?void 0:Y.json()),I("sign_in_url_failed")}catch(j){console.error("There was a problem with encrypting file...",j),I("encrypting_file_failed")}n(!1)}}),G=F=>_(this,null,function*(){if(F){n(!0);try{const H=F.type.split("/")[1],j=yield C.readFileAndHash(F),N=(yield C.generateHashFileName(F))+"."+H,L={image_type:H,image_file_name:N,image_size:F.size,base64_sum:j},V=yield S==null?void 0:S.https.generateSignedInUrl(L);if(V!=null&&V.ok){const Y=yield V.json(),X={"Content-Type":F.type,"Content-MD5":j};try{const D=new File([F],N,{type:F.type}),B=yield S==null?void 0:S.https.storeInBucket(Y.data.signed_url,D,X);e.onChangeImages(B||""),I("upload_success")}catch(D){console.error("There was a problem with uploading the file: ",D),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield V==null?void 0:V.json()),I("sign_in_url_failed")}catch(H){console.error("There was a problem with encrypting file...",H),I("encrypting_file_failed")}n(!1)}}),O=()=>{e.onChangeImages(g),I("image_reset")},T=F=>{e.onChangeImages(F),v(F)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:e.title}),s.jsx(h.Tooltip,{title:e.labels.clearImage,children:s.jsx(h.IconButton,{variant:"plain",color:"danger",size:"sm",onClick:E,children:s.jsx(Lp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:t,animation:"wave",children:[e.image?s.jsx(h.Box,{component:"img",src:e.image,loading:"lazy",alt:e.title,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(Uc,{sx:{fontSize:"3rem",opacity:.2}}),e.image?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Kp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.labels.copyUrl,children:s.jsx(h.Button,{onClick:()=>k(e.image),disabled:!e.image,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.labels.viewImage,children:s.jsx(h.Button,{onClick:w,disabled:!e.image,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(Qp,{})})}),s.jsx(h.Tooltip,{title:e.labels.cropImage,children:s.jsx(h.Button,{onClick:A,disabled:!e.image,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(pg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(h.Button,{sx:{width:"100%"},onClick:b,children:[s.jsx(_e.Upload,{})," ",e.labels.uploadImage,s.jsx(Jp,{type:"file",accept:"image/*",onChange:$,ref:m})]})}),S.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.labels.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(qp,{labels:e.labels,onChangeImages:T})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ye,{showToast:r,message:u,color:d,hideToast:x}),s.jsx(Yp,{title:e.labels.viewImage,open:o,imageSrc:e.image,toggleModal:w}),s.jsx(hg,{labels:e.labels,open:l,imageSrc:e.image,toggleModal:A,uploadImage:G,resetDefaultImageUrl:O})]})},GR=["cover","mobile"],YR=e=>new Map().set("main",e.mainImage).set("cover",e.coverImage).set("mobile",e.mobileImage),KR=e=>e?M({},e):{main:"",mobile:"",cover:""},qR=e=>{const[t,n]=y.useState(!1),r=KR(e.defaultValue),i=YR(e.labels),o=(l,c)=>{r[c]=l,e.onChange(r)},a=l=>{r[l]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(Io,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:l=>o(l,"main"),clearImage:()=>a("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(s.Fragment,{children:GR.map(l=>s.jsx(Io,{labels:e.labels,title:i.get(l),image:r[l],onChangeImages:c=>o(c,l),clearImage:()=>a(l)},`images-${l}`))}):s.jsx(s.Fragment,{})]})};function QR(e){return ut("MuiSheet",e)}qe("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const JR=["className","color","component","variant","invertedColors","slots","slotProps"],XR=e=>{const{variant:t,color:n}=e,r={root:["root",t&&`variant${Se(t)}`,n&&`color${Se(n)}`]};return gt(r,QR,{})},ZR=Ce("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r;const i=(n=e.variants[t.variant])==null?void 0:n[t.color],{borderRadius:o,bgcolor:a,backgroundColor:l,background:c}=bc({theme:e,ownerState:t},["borderRadius","bgcolor","backgroundColor","background"]),u=ar(e,`palette.${a}`)||a||ar(e,`palette.${l}`)||l||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||e.vars.palette.background.surface;return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:e.vars.palette.background.surface,position:"relative"}),R({},e.typography["body-md"],t.variant==="solid"&&t.color&&t.invertedColors&&A_(t.color)(e),t.variant==="soft"&&t.color&&t.invertedColors&&T_(t.color)(e),(r=e.variants[t.variant])==null?void 0:r[t.color],i)]}),eL=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:l="plain",invertedColors:c=!1,slots:u={},slotProps:f={}}=r,d=De(r,JR),p=R({},r,{color:o,component:a,invertedColors:c,variant:l}),g=XR(p),v=R({},d,{component:a,slots:u,slotProps:f}),[m,b]=Ee("root",{ref:n,className:zn(g.root,i),elementType:ZR,externalForwardedProps:v,ownerState:p});return s.jsx(m,R({},b))});function tL(e){return ut("MuiTypography",e)}qe("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const nL=["color","textColor"],rL=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],Cu=K.createContext(!1),iL=K.createContext(!1),oL=e=>{const{gutterBottom:t,noWrap:n,level:r,color:i,variant:o}=e,a={root:["root",r,t&&"gutterBottom",n&&"noWrap",i&&`color${Se(i)}`,o&&`variant${Se(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return gt(a,tL,{})},aL=Ce("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),sL=Ce("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),lL=Ce("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=t.level!=="inherit"?(n=e.typography[t.level])==null?void 0:n.lineHeight:"1";return R({"--Icon-fontSize":`calc(1em * ${l})`},t.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},t.nesting?{display:"inline"}:R({display:"block"},t.unstable_hasSkeleton&&{position:"relative"}),(t.startDecorator||t.endDecorator)&&R({display:"flex",alignItems:"center"},t.nesting&&R({display:"inline-flex"},t.startDecorator&&{verticalAlign:"bottom"})),t.level&&t.level!=="inherit"&&e.typography[t.level],{fontSize:`var(--Typography-fontSize, ${t.level&&t.level!=="inherit"&&(r=(i=e.typography[t.level])==null?void 0:i.fontSize)!=null?r:"inherit"})`},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.color&&{color:`var(--variant-plainColor, rgba(${(o=e.vars.palette[t.color])==null?void 0:o.mainChannel} / 1))`},t.variant&&R({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!t.nesting&&{marginInline:"-0.25em"},(a=e.variants[t.variant])==null?void 0:a[t.color]))}),Cm={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},wu=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyTypography"}),{color:o,textColor:a}=i,l=De(i,nL),c=K.useContext(Cu),u=K.useContext(iL),f=g1(R({},l,{color:a})),{component:d,gutterBottom:p=!1,noWrap:g=!1,level:v="body-md",levelMapping:m=Cm,children:b,endDecorator:C,startDecorator:S,variant:x,slots:I={},slotProps:w={}}=f,A=De(f,rL),E=(r=t.color)!=null?r:x?o!=null?o:"neutral":o,k=c||u?t.level||"inherit":v,$=ah(b,["Skeleton"]),G=d||(c?"span":m[k]||Cm[k]||"span"),O=R({},f,{level:k,component:G,color:E,gutterBottom:p,noWrap:g,nesting:c,variant:x,unstable_hasSkeleton:$}),T=oL(O),F=R({},A,{component:G,slots:I,slotProps:w}),[H,j]=Ee("root",{ref:n,className:T.root,elementType:lL,externalForwardedProps:F,ownerState:O}),[N,L]=Ee("startDecorator",{className:T.startDecorator,elementType:aL,externalForwardedProps:F,ownerState:O}),[V,Y]=Ee("endDecorator",{className:T.endDecorator,elementType:sL,externalForwardedProps:F,ownerState:O});return s.jsx(Cu.Provider,{value:!0,children:s.jsxs(H,R({},j,{children:[S&&s.jsx(N,R({},L,{children:S})),$?K.cloneElement(b,{variant:b.props.variant||"inline"}):b,C&&s.jsx(V,R({},Y,{children:C}))]}))})});wu.muiName="Typography";function cL(e){return ut("MuiFormControl",e)}const wm=qe("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),uL=qe("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),dL=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],fL=e=>{const{disabled:t,error:n,size:r,color:i,orientation:o}=e,a={root:["root",o,t&&"disabled",n&&"error",i&&`color${Se(i)}`,r&&`size${Se(r)}`]};return gt(a,cL,{})},hL=Ce("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i;return R({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":t.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":e.vars.palette.danger[500]},t.size==="sm"&&{"--FormLabel-fontSize":e.vars.fontSize.xs,"--FormLabel-lineHeight":e.vars.lineHeight.xl,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":e.vars.fontSize.xs,"--FormHelperText-lineHeight":e.vars.lineHeight.xl},t.size==="md"&&{"--FormLabel-fontSize":e.vars.fontSize.sm,"--FormLabel-lineHeight":e.vars.lineHeight.sm,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.size==="lg"&&{"--FormLabel-fontSize":e.vars.fontSize.md,"--FormLabel-lineHeight":e.vars.lineHeight.md,"--FormLabel-margin":t.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.color&&{"--FormHelperText-color":(n=e.vars.palette[t.color])==null?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${wm.error}`]:{"--FormHelperText-color":e.vars.palette.danger[500]},[`&.${wm.disabled}`]:{"--FormLabel-color":(r=e.variants.plainDisabled)==null||(r=r[t.color||"neutral"])==null?void 0:r.color,"--FormHelperText-color":(i=e.variants.plainDisabled)==null||(i=i[t.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal"&&{[`& > label ~ .${uL.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),Su=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:l=!1,required:c=!1,error:u=!1,color:f,size:d="md",orientation:p="vertical",slots:g={},slotProps:v={}}=r,m=De(r,dL),b=io(i),[C,S]=K.useState(null),x=R({},r,{id:b,component:a,color:f,disabled:l,error:u,required:c,size:d,orientation:p});let I;const w=fL(x),[A,E]=Ee("root",{ref:n,className:zn(w.root,o),elementType:hL,externalForwardedProps:R({},m,{component:a,slots:g,slotProps:v}),ownerState:x}),k=K.useMemo(()=>({disabled:l,required:c,error:u,color:f,size:d,htmlFor:b,labelId:`${b}-label`,"aria-describedby":C?`${b}-helper-text`:void 0,setHelperText:S,registerEffect:I}),[f,l,u,C,b,I,c,d]);return s.jsx(os.Provider,{value:k,children:s.jsx(A,R({},E))})});function pL(e){return ut("MuiFormLabel",e)}qe("MuiFormLabel",["root","asterisk"]);const gL=["children","component","htmlFor","id","slots","slotProps"],mL=()=>gt({root:["root"],asterisk:["asterisk"]},pL,{}),vL=Ce("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:e.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,fontWeight:e.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${e.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),bL=Ce("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Iu=K.forwardRef(function(t,n){var r,i;const o=mt({props:t,name:"JoyFormLabel"}),{children:a,component:l="label",htmlFor:c,id:u,slots:f={},slotProps:d={}}=o,p=De(o,gL),g=K.useContext(os),v=(r=(i=t.required)!=null?i:g==null?void 0:g.required)!=null?r:!1,m=R({},o,{required:v}),b=mL(),C=R({},p,{component:l,slots:f,slotProps:d}),[S,x]=Ee("root",{additionalProps:{htmlFor:c!=null?c:g==null?void 0:g.htmlFor,id:u!=null?u:g==null?void 0:g.labelId},ref:n,className:b.root,elementType:vL,externalForwardedProps:C,ownerState:m}),[I,w]=Ee("asterisk",{additionalProps:{"aria-hidden":!0},className:b.asterisk,elementType:bL,externalForwardedProps:C,ownerState:m});return s.jsxs(S,R({},x,{children:[a,v&&s.jsxs(I,R({},w,{children:[" ","*"]}))]}))}),yL=({environment:e,userNotFound:t})=>{const[n,r]=y.useState(""),[i,o]=y.useState(""),[a,l]=y.useState(!1),c=()=>{l(!a)},u=p=>{p.persist(),r(p.target.value)},f=p=>{p.persist(),o(p.target.value)},d=()=>_(this,null,function*(){try{yield ro(e).signInWithEmailAndPassword(n,i)}catch(p){console.error(p),c()}});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxs(eL,{sx:{width:300,mx:"auto",py:3,px:2,display:"flex",flexDirection:"column",justifyContent:"center",gap:2,borderRadius:"sm",boxShadow:"md"},variant:"outlined",children:[s.jsxs("div",{children:[s.jsx(wu,{level:"h4",component:"h1",children:s.jsx("b",{children:"Sign in"})}),s.jsx(wu,{level:"body-sm",children:"Use your account in the Fans United platform."})]}),s.jsxs(Su,{children:[s.jsx(Iu,{children:"Email"}),s.jsx(as,{name:"email",type:"email",onChange:u})]}),s.jsxs(Su,{children:[s.jsx(Iu,{children:"Password"}),s.jsx(as,{name:"password",type:"password",onChange:f})]}),s.jsx(di,{sx:{mt:1},onClick:d,children:"Log in"})]})}),s.jsx(Ye,{showToast:a,message:t,color:"danger",hideToast:c})]})};function xL(e){return ut("MuiCheckbox",e)}const vi=qe("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),CL=Cc(s.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),wL=Cc(s.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),SL=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],IL=e=>{const{checked:t,disabled:n,disableIcon:r,focusVisible:i,color:o,variant:a,size:l,indeterminate:c}=e,u={root:["root",t&&"checked",n&&"disabled",i&&"focusVisible",a&&`variant${Se(a)}`,o&&`color${Se(o)}`,l&&`size${Se(l)}`],checkbox:["checkbox",t&&"checked",c&&"indeterminate",n&&"disabled"],action:["action",t&&"checked",r&&n&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return gt(u,xL,{})},AL=Ce("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i;return R({"--Icon-fontSize":"var(--Checkbox-size)"},e.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:t.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},e.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:t.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},e.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:t.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:e.overlay?"initial":"relative",display:"inline-flex",fontFamily:t.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:t.vars.palette.text.primary,[`&.${vi.disabled}`]:{color:(n=t.variants.plainDisabled)==null||(n=n[e.color])==null?void 0:n.color}},e.disableIcon&&{color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color,[`&.${vi.disabled}`]:{color:(i=t.variants[`${e.variant}Disabled`])==null||(i=i[e.color])==null?void 0:i.color}})}),TL=Ce("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${e.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{[`&.${vi.checked}, &.${vi.indeterminate}`]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[R({},l,{backgroundColor:(r=l==null?void 0:l.backgroundColor)!=null?r:e.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=e.variants[`${t.variant}Hover`])==null?void 0:i[t.color]}},{"&:active":(o=e.variants[`${t.variant}Active`])==null?void 0:o[t.color]},{[`&.${vi.disabled}`]:(a=e.variants[`${t.variant}Disabled`])==null?void 0:a[t.color]}]]}),EL=Ce("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var n,r,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${t.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[e.focus.selector]:e.focus.default},...t.disableIcon?[(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},{"&:active":(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]},{[`&.${vi.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]}]:[]]}),kL=Ce("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),_L=Ce("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>R({flex:1,minWidth:0},e.disableIcon&&{zIndex:1,pointerEvents:"none"})),PL=s.jsx(CL,{}),DL=s.jsx(wL,{}),OL=K.forwardRef(function(t,n){var r,i,o,a,l;const c=mt({props:t,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:f,checkedIcon:d=PL,label:p,defaultChecked:g,disabled:v,disableIcon:m=!1,overlay:b,id:C,indeterminate:S=!1,indeterminateIcon:x=DL,name:I,onBlur:w,onChange:A,onFocus:E,onFocusVisible:k,readOnly:$,required:G,value:O,color:T,variant:F,size:H="md",component:j,slots:N={},slotProps:L={}}=c,V=De(c,SL),Y=K.useContext(os),X=(r=(i=t.disabled)!=null?i:Y==null?void 0:Y.disabled)!=null?r:v,D=(o=(a=t.size)!=null?a:Y==null?void 0:Y.size)!=null?o:H,B=io(C!=null?C:Y==null?void 0:Y.htmlFor),U={checked:u,defaultChecked:g,disabled:X,onBlur:w,onChange:A,onFocus:E,onFocusVisible:k},{getInputProps:W,checked:ie,disabled:se,focusVisible:oe}=oA(U),Z=ie||S,ue=Z?F||"solid":F||"outlined",be=t.color||(Y!=null&&Y.error?"danger":(l=Y==null?void 0:Y.color)!=null?l:T),Je=R({},c,{checked:ie,disabled:se,disableIcon:m,overlay:b,focusVisible:oe,color:Z?be||"primary":be||"neutral",variant:ue,size:D}),_t=IL(Je),he=R({},V,{component:j,slots:N,slotProps:L}),[ge,xe]=Ee("root",{ref:n,className:_t.root,elementType:AL,externalForwardedProps:he,ownerState:Je}),[ke,Ke]=Ee("checkbox",{className:_t.checkbox,elementType:TL,externalForwardedProps:he,ownerState:Je}),[Oe,Pe]=Ee("action",{className:_t.action,elementType:EL,externalForwardedProps:he,ownerState:Je}),[St,It]=Ee("input",{additionalProps:R({id:B,name:I,value:O,readOnly:$,role:void 0,required:G!=null?G:Y==null?void 0:Y.required,"aria-describedby":Y==null?void 0:Y["aria-describedby"]},S&&{"aria-checked":"mixed"}),className:_t.input,elementType:kL,externalForwardedProps:he,getSlotProps:W,ownerState:Je}),[Bt,Dt]=Ee("label",{additionalProps:{htmlFor:B},className:_t.label,elementType:_L,externalForwardedProps:he,ownerState:Je});let zt=f;return m?zt=null:S?zt=x:ie&&(zt=d),s.jsxs(ge,R({},xe,{children:[s.jsxs(ke,R({},Ke,{children:[s.jsx(Oe,R({},Pe,{children:s.jsx(St,R({},It))})),zt]})),p&&s.jsx(Cu.Provider,{value:!0,children:s.jsx(Bt,R({},Dt,{children:p}))})]}))}),RL=$e(s.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),Dr=({label:e,values:t,allValues:n,valuesMap:r,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:l})=>{const c=(u,f)=>{u.persist();let d=[...t];if(u.target.checked){d.push(f),a(d);return}d=t.filter(p=>p!==f),a(d)};return s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"body-sm",mb:1,children:e}),s.jsxs(uT,{orientation:"horizontal",wrap:!0,sx:{columnGap:"12px","--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>s.jsxs(qh,{children:[t.includes(u)&&s.jsx(RL,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),s.jsx(OL,{checked:t.includes(u),variant:t.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:f=>c(f,u),slotProps:{action:({checked:f})=>({sx:f?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${e}-${u}`)),i===!1?s.jsx(qh,{children:s.jsx(h.Link,{onClick:l,children:o})}):s.jsx(s.Fragment,{})]})]})},bi={popular:["FT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","CORRECT_SCORE","OVER_CORNERS_9_5"],playerRelated:["PLAYER_YELLOW_CARD","PLAYER_RED_CARD","PLAYER_SCORE","PLAYER_SCORE_FIRST_GOAL","PLAYER_SCORE_TWICE","PLAYER_SCORE_HATTRICK"],goals:["OVER_GOALS_0_5","OVER_GOALS_1_5","OVER_GOALS_2_5","OVER_GOALS_3_5","OVER_GOALS_4_5","OVER_GOALS_5_5","OVER_GOALS_6_5"],corners:["CORNERS_MATCH","OVER_CORNERS_6_5","OVER_CORNERS_7_5","OVER_CORNERS_8_5","OVER_CORNERS_9_5","OVER_CORNERS_10_5","OVER_CORNERS_11_5","OVER_CORNERS_12_5","OVER_CORNERS_13_5"],correctScores:["CORRECT_SCORE","CORRECT_SCORE_HT","CORRECT_SCORE_ADVANCED"],misc:["FT_1X2","HT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","HT_FT","RED_CARD_MATCH","PENALTY_MATCH"]},LL=({labels:e,values:t,valuesMap:n,onChange:r})=>{const[i,o]=y.useState(!1);return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.marketSelection}),s.jsx(h.FormHelperText,{sx:{mb:2},children:e.marketSelectionDescription}),s.jsx(Dr,{label:"Popular",values:t,allValues:bi.popular,valuesMap:n,showAll:i,showAllLabel:e.showAll,onChange:r,toggleShowAll:()=>o(!0)}),i?s.jsxs(s.Fragment,{children:[s.jsx(Dr,{label:e.playerRelated,values:t,allValues:bi.playerRelated,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.goals,values:t,allValues:bi.goals,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.corners,values:t,allValues:bi.corners,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.correctScores,values:t,allValues:bi.correctScores,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.misc,values:t,allValues:bi.misc,valuesMap:n,onChange:r})]}):s.jsx(s.Fragment,{})]})},Be={avatar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMA+h6XBeOBCz4ozafvc/W9X+nD29ROsWmINjBVRxC4F3uPnhL6/TMAAAygSURBVHja7N0JkqJAEIXhAsEFEEVs9z3vf8eZmI6J3mxFZamq/L8zaC2ZrxKjTzTaLfu9xWweZ7n8FeRFmRwuq+XbZmDgs2gzPR9iuaGYpOl4yO/AQ+G0lwRSUXJ+40fgkXCaxvKgYDIeGXhgvZrLk8rVxsBp63MsLyn7rAPOCvul1GB+Cg2cE20nUpvDNjJwybpXSK2KPsuAM8J+LPULUk6EbjgF0pDD0MB2w0QaNOMnYLfhRL7iJ6DJaCEtOHAWsNO+F0g7Um4EFlpm0pq8T6/IMptEWhVPDewxWAXSthlNAltEu1I6EKyoD9sgOufSkZIrYfeOM+lQj8NgxzaxdKpcG3RonEvHgpNBV8KDWGByNOjENBMrFJwFu7BPxRbB2KBtw1gsknIbaNk4EKskHATaNLBn+f8vpjLcnn0i9skue4NWHOdipYRfwHUa/v//JBwFWzCYibUm9AebtxCLpQYN64nVVgaNGovllgYN2or13gwaM7Ss/ndNTmuoMevOu/9VZGREGrKxpP17T8bToUaMCnFEQV+gAaFV/d/bYt6O1e5YikPmtAVqNrC2AUBboA2RFfHPRywManQR5/QManMSB5EU1VQApij8k7IC4E855YBaHB0qAHwVExWuQWRxAuieiYHvCZDbzgYvmorTtgYvGTl6APwv4yD4koGlTwCqSwgKqz0AUBHUWgGiHlST0JEI0G0F1YBnOdcCpDFYq6V4grGyTwkdvwF+yEiIKd4A2AR0lgApCL5o70wIvIqCkKiCEBjloBqtxTO8FnqMYynw+2YGWk+AnAMfNnA2Bfa7mLag5zFwYuK1OXpTA/wsoymkKAXAVfAFIwcGwTwjIB7mwSRApgheQw2oGqYHVTERbx0M7tqJxxghd5/DL8F4K8YCwBLAAsAS8IqheI4lQO0VgIuA7hoAyRDVRUDKgZWMxH8BjwTUtQFpCqrOAXyXExFXFQQiGlRZ5GESkHSg7igwAWGqwLwRqGojapANU3sH5Cb4q4GKO+C7jO+JeDwQhqExPAflGEgbgGPgg1aiCp+Z/86riTD3xQaasqA/7Qw+S0WZi4HSIsC7jI6Qd2PBGSJOFpBsIDtAVTl7gOodgD1A9R2APeCLyIsvg3APoArEM0GiIHxW9AlK0sDflQYaO8EfeCT2bixKLQ08+zgQnxJ6QqSwDMhFUNNUGC6Ct/VFrZOBohdhzAy7KvJ0NjgdwT/snVlSAlEMRYO2duEADnQVIO2U/e9RLSkZbB7o5zvnbAGqX3Jzc2MJYHq0KoBZEZqBHAm7EOB6wGHOEo3jAKQbTF8Ydidwn8ugg50EOQ+yBrQKjHhJOPTYULQO6EAQlgykK2iHZtGtxlBD8Ibz8apbEGdC/Su8/Nvmfo4rBTp//h1uYPnBkGB43UGOgB0N2/uZG7VHD10FO8YFJUEYbAN2MoQ5DeU5KTsAO4FhHlPIC+O2AHCbONwCZBmIOgzxV66ietqUw4zqlwIsAeD+ELwDhO4PwTtA6NFx6FVAbeI2Afg2QCcQfE8AnAdyCjdROylFonKalCK1O8QVAuF/AL8A8D+ANQC8BrALoHcByPNA6gAbZikFZlE70xR0ejDyRKDJkRveUgrMo3Y0hBS5i9qBHonUEmY0rNGxCgHqQOwLMcd5iPqxDUB7QiPuUsBNAPhSsDWgtlBHQYrBcCFYLRBfAlgE0EsAM2LAZgCVAPgo0IgA+CTom8ZxwCD3QcGMgEHOg4JvAPoF+MS0aGpKpHHR9JxYbUGHGEFUIJOCsOlAWkMtAc2KAqdD6QsqAjsbF40TIWwP6CcA6wRwT5w+CN7mKeWHLoC4IQJKBRhiaVzQmtE4kOgMAu0DDdE6FGSdjFUQhh+N1hoENwL9plUMyBn2AfhiiT8kPYF2ACrC0CGQl2SZuyAuC5PXgcs04PDYafXXAU6hxQ4FHtANwIYW+g2Y+vuvaZB1wLXff7QkSBYA3RThpIGYGqIL1DfAF+A4XcJAugALtDB/2MQWkH1M6jlkl9tEcRuCjo+0CWRvCtF2gTUG7HEZss8iQSxDyNFhyoDwN0AjGPwN8AVgD4SIaQDGR0IjIdWCVIHMjgOeB/WclIFQ/6BHzISdBMO3hNwGgl+SgIUCKwUoAmgL0QpyKn31gRGTPqTAe1aOdvAyy6wceCIMPkCWGQrrhoiZgB/snVFOwzAQRO2QElJFhUAJClUpwve/I0h8tagobVzH3nnvColsz+7sLEoQDUhDgDbAFOo+mGVFJoR2MYgi0BQas9vlO/qA2tYwrGDT2Bs9AjgAxI8ADgDtV0DPAaAtBJAA2tuEqAGIrxGgCKgdF0EkhPhCMdqAF/IRTDE4uIzW1JCI6nJYFsuKL4edw95QW1h3OSxSEAmIPxQnqPg7UH05qHxXkC7gtdQm6oFbmgBXMxq4BPzoQDk8klBI7UtgzQUwi/fCLwFPKOhMPkPRYAPSXiZECWg+VcEO0f7gQHlgnOWA2o1hFGAc6kIzhJ9RgJGoirQG9ISCR+OhwGqAJxH0B+FRoTcHTjg/kDzAuNSF2YMeeQBG5lBUetgLgbDRaQuqCHaYwH4RlQIbBMBN2IUy8FSAj1HLkEQAniBmDsAE/AcpjyAdoJtyFzKHMdBj1P4ACoCnaP0BfP9zaPhDOP/PIPISvHfwD+abw1jAk/GUYVXYkwKRkNfsFkxuyIFLypiZTXDFCFhiqqzGRtcYQJPTDCEbBlLAJmJTDiL/FmKXxVOwo/2/GG0GD4Et9q8FaRa3i39x/X+zdyc5CMNAEEUhuQnc/46sEFMGWyJy1PX+Fept7R7bfXAXdQWAABAAAkAACAABIAAEgAAQAAJAAAgAASAABIAAEAACQADofPelvQrqqd7+BPRUcX8C2qu5PwGtVd2fgLbq7k9AS5X3J2C/2vsTsFf1/QnYrv7+BGyVsD8B62XsT8BaKfsTsFzO/gQslbQ/Ab9l7U/Ad2n7E/BZ3v4EvJe4PwGvMvcn4Fnq/gQc0zT8W+D2bu5H/LtpPuGdqPWuMwLB8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8CD/buRStRKIDC8NaBRBBFzfttxvP+7zi1Wq2mxgxLC87+v1f4d6VwIPv8TMA+PxOwz88E7PMzAfv8TMA+PxOQukfr/I86xieIyW89gT75n3WKvtz0C/IbT6BfBLxhNAHyn1as5YD875uvFDvyn7ePewJr8n9olClW63lADZOtYkT++vKZYkN+6wmsyH+xfKNYrPYBn3BfKQbk/7xplajlyP816aLVE8jI/2Vp2VNLZaOAKxi3cwLkv57B79ZNgPzXNbjbqUXIf32D5UEtQf7bGP5pxQSyScCNDJt/inxL/tM8HiQg/+11jo09PEj+8yI/QrzNAz4W6xHiGfm/17xRR4jJf4nojhCT/4fsG3F+lPyXiuoIMfkvE9kENuT/eZO6EyB/rEZr/YDNfUBTFF2dR/7Inb9HQH4D70+A/Ca+aQIV+RvrG24TVdOAJnt1gZj8jm72dHlC/pa4rxLye0sXybXzpwFtMi575Pd2tceJkgX52+lhAuT3Ni4T8ntLK/Kby7PP5i/JH4eiS35vw1KX2pI/Knlfl9jxTt/YdErVt+LHP0Kjg2pa8N9cojTOVEfyKyBOtf4M9Hitb8SOyYf9ecY/avse/b1Ndjoj4f1e0cvPLYCv/wbynt5zF2BglOi0WYCFQid1BwEeSp3CFwAbnUz/KwNspDu91ecGgJNfeosrAF4yvbYJsJLrlYTnvtxU+tciwEya6EXCESA/C34BeJvqBZ8AHM30bBtgaK5nnAKz1DnoSZeLgJ5K7gJ4m+gJ73x2ddCjfoCpir8A3gruA3pL9aDHdwBfXa4CedtIWgbYWvIRwNteEofBjaVSN8BYj8eBvK25DORtpmOAsZIvAd6WnAbzVmgYYGyvAGc5A/A2ZQDexgzA25ABmGMA5hiAOQZgjgGYYwDmGIA5BmCOAZjjTKg5jQOcifeDeWMA5hiAOT4DmPvb3h2lNAxEYRT+kzo0JtNqoFpQmyCz/z2KFJFa8d2e863hvCRzZ65fAXAOhcL5IwjOAOAMAM4A4AwAzgDgDADOAOAMAM4A4AwAzgDg4lPRaN4Ohus8DmYrjoSxLVmawHY+Fcu2zdrENSeOBZNtkmyasNa4MYJsdHMs25BPL01MY86mJqT7nJ28Hob0ni9DE88h3x6baOopFgBW+1x48lgYpfT5oXd9GMjzNteGyfEwhvKW363HxQZu3uE1f7gbdtO4b1e6WudSylz3JvJ/dfPDcc2FD2jGIfoz6ZkMAAAAAElFTkSuQmCC",team:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMAcN3YbAMJ8lQsGkdh97kVyyLTsT0Q7ayEfDXD6KSLdeSclIjjiMMAAAu4SURBVHja7NjbasJAFIbRbY0S0npA641Cxc77v2OveyElYCY7nbWe4YPZ/wQAAAAAAAAAAAAAAAAAAAAAANCU7bXvVrxI11+3sSDD/Vh4sdt9iGUYHoVJPJaQwGa1K0xk120iucu+MKHzJVIbToVJnQ6R2GFd+K2pAraO/wpuee+A70IFX5HUe6GKz0hp4wCs5JjzEegLlfSRkR+AavaR0FCoJuMU/Cg818AbYAP+4b8vQSdARefIxwis6Bj5vBWqWUc+AnhOAAgAASAABIAAEAACQAAIAAEgAASAABAAAkAACAABIAAEgAAQAAJAAAgAASCAxgmgcQJonAAaJ4DGCaBxAmicABongJfpZiaAmcXMBDCOAAQgAAEIIPIRgACWKEYSgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABLBEMZIABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQggCWKkQQgAAH8sEvHNAAAAAiA7J/aDJ5ukAEBBBBAAAEEEEAAAQQQQAABBBBAgEcZCSCAAAIIIIAAAggggAACCCCAAAIIIIAAjzISQAABBBBAAAEEEEAAAQQQQAABBBBAAAEeZSSAAAIIIIAAAggggAACCCCAAAIIIIAAAjzKSAABBBBAAAEEEEAAAQQQQAABBBBAAAEEeJSRAAIIIIAAAggggAACCCCAAAIIIIAAAgjwKCMBBBBAAAEEEEAAAQQQQAABBBBAAAEEEOBRRgIIIIAAAggggAACCCCAAAIIIIAAAgggwKOMBBBAAAEEEEAAAQQQQAABBBBAAAEEEECARxkJIIAAAggggAACCCCAAAIIIIAAAggggACPMhJAAAEEEEAAAQQQQAABBBBAAAEEEEAAAR5lJIAAAggggAACCCCAAAIIIIAAAggggAACPMpIgLJLxzQAAAAIgOyf2gyebpABAQQQQAABBBBAAAEEEEAAAQQQQAABBHiUkQACCCCAAAIIIIAAAggggAACCCCAAAII8CgjAQQQQAABBBBAAAEEEEAAAQQQQAABBBDgUUYClF07y2kgiKEoehVIAGUgE5CkRYC8/e+RNZR/7NfyWULrSl1lVwfQAXQAHUAH0AF0AB1AB9ABdAAdQAcQt+wAxswtgNV8AniSJcYUCeBIPUdZIte7QvbUs5clch0UMlHPJEvkuilkRz07WSLXWiEn6vmSJXJtFPJNPX+yRK6rQh7Uc5Elcj0UcqWeH1kiIP/k9Ew9G1ki10Ihr9SzliUC0lcBOlPPmywxosxHO1DPhywxqsR/c0VBL3JEqrtCPqnIcxtEqmk+uyA4yRGZltv5DALhLkdkuinmQkWegwCGFRiebajoLEeMS58D6kZFnvdAEq22c7oFwq8MMS59eLqgJssnIYzKXwX+k3cvOgnEUBBAx0ddXbMqJkAUMJj5/38UwsMA4rZsdjtTzieIudveO20l4yC2A2Ekyz4JkhwGrz3SEFLlHwTwGZpqGkK67I2TV4ia0w+yCcvC1oCeuVCkUeibaDaCXVNhSCSQolXMg2180g9yGTe80BNUBcNIANIIjE4mAbIMJ8JIohCfmELXDe0gnsYSUHgJYBkMRTSVYqkYCDWeByGPEVlcF8DzgCCiCP2hFI8FOp8OQRZ1w9IGAfuIgxlk8cVLVcKbQMuNICKpFADlTaBlMhQJsidBRI+FWgcDEUljC8BGNA7o+w1ABgsW+wXwiwUhnsLMTP0L4LcPQIrsF+pV8l8AYEEriKJSI7+hz6wXhKE9LLlS0M0gx4LXteGIpRCe154D7HzQCeJoDExVDwQ4p8MxrDBjBzUsWLUCEEGlU6rfBDBcBmJQdUWy0EGg6TIQ7VTOzyq+E+N/PgCtVD4A0mHAQ2OjbiAGNKrYQTWGDaNkGFrI7ADEs2C26WC00GmQSKeBfS8LQQuFkwDS14K47wQxlNclycLHAI6PyGEg4YVb5TwUV0QuBP/S2RrrJ0FMm0E4T+mb+C6eBveNB2MQowm3iroctoQSgCE8vLGbW7sCYFMCcJ5QTM6vANiUAJyj0wHyLAAuJQBnSO2IHAuASwlA754adnRnWQBMegHo22hOXlkPYCc4PCOFno3f+aukJ6JKmQjglFIH2CkJ5jkURK/ClJ29wJdBLgB/y38RgMHFoEVEg3BCqQFgFgQ6VctfHose3bO7SvZxgEICwjgm1gm7gbdwR204pNYG8RsDu20Fsaf4+7sFwQyfEcGe4j++7uMgxawDsaH5+7uvADfuqQy9eG64cqVTwGNhRmHYEvz+c2a/AjToB2JN8/dvrHuAP+zd62KiMBAF4CkWUBTFG6JSLz3v/45bbbu77noBm8AknO8F/EFMJpPJxJWmMfJN2f7/w158ESq+JiJnGmOezJMF4GSg9764iOic7vxZAHRnhOWTgpcAnG0HUUWotjJAjAqPMGTs0QJwkuTQSUyK5jAkd6QjnPsVomLQZItPnS4Du+UdKok50x7OOl8Fcl2ks0ZYjNmUAHeAd0xVngqJKf0UpsROtQNyPAzQlv7xNAD4tIM+YkT4DnMK8ZXGbICYsBwDYAbgsYm+x6XFgOkM5gQONQStb6PuUEB+bpHjA48A3GwaoCv8c/cmsLOBoKrwz+cA8Fuo7D0RPdnfk5XHAaDSjKD8yOYAkzIH3oVU0TJDywAYpTDp4N0RoANbAXledIRRsecbAJ05YXnaNMMJM8Ct75zaGQDDHL/xFoi7m0F5TljghBvAJ4Vq3hiXpyRjXOP5u+AiHp4LyTOGJQybdyABcClScllExfSPbScSAJcmOhJCUluyhWkzr08Ab0lU9BKWuvo5TAs6kgBSmRKUeqJ3GHfwtATwsYGC2yJSy6AH48rOfn+RQfuFwlJDuId5eWcSwNdsWh8BUt10iw/8/kYtYrRLKhvFMC/eSMe1PQKkoskcJ/z+vo2Aeps/fn8Rz0aAVDF5wxm//5lXkaBU0C/xB+O/M2/yAfLQZAUrSn7/3wYl2tLS6g8c+P3/Mg3QErkvmcOOoMP5v2uSHtoh94SvMeyYdfT8R9/psNwxyGBJ5kUbcLOWW7RBbop2sGXcwfoPwz3W7A+AYYCreAHsXwq7LP58ACQrWPPO739LgcbdOPdNYc1aSFH7ALli2MP/eP/jAXXN1qppdvZH2qH7Xwr6rTwxAKJ1CntKHv88NAjQJLnUD2BRj+m/CiYZGnQ5+Mawacv0j76EgPwxOcKqFdM/FYU7NEa+RfsYVu24/dfYQOD+4s/tX1uGMZohZ4sMdsXc/tU0OKAR59+aw7KA1R+1JRmaIJIccRPD/xZFb2jAskhh25Hhn94nZ3M8xCdgW9OP4TyGfw7lhb8w/NNjqaWZ1JPGnWz+IuJmVtC8guGfgyUCxsTev/5wCwOBkx6Xf0OWyh6Z4OGfCa0357HsRcighYaWcjWUC6EbtLRntmnM5P9tahq027Pm7u8BJT267Thw+rdk4sQyMOf0b034oj4plL4KWTTQ0WT+phmTP3UpaNcNVv66ZKjvDfovAaO/RizVvDh16Y1Hv0/S8GrHj5U8+mtQou54aMXNX7NGqsoFY977qcTXw4E5u/5V4eskkPPvX5mPkcCKf/9aPNsOMPi3xt5TDtz7+2QYoDUBb/0oEO3Qkh3LPnXYZGhBxoM/NcKXGA2LX3nwp0myQqPeuPfT5n4wyODPf9E6RSNSFv0qNZ2jAXP2e9XL/jrQ4+yvmuV1IN5z9tcuecMFxv6dY6vtZ8Zm/44IRyWMO4w4+7sjKlIYlRbM+7tlugJY9NFp5kKBjBc+nBSOSi7+3WYgFEjXXPxd9tOswJGLv+sGYzxtzJoPHwxneMqMaX9PhKMDagsY+3kk2ueoJX9h7OeXZRGjsnjNcn//THYpKokLXvX206SI+fm7bbnOcVfOyd9z0b7ETQeGfh0QjQJc1ePGryPCfob/bPv8/B2yWOHCiuVeXTMtZvgyK1jq30nLRf/1tb9g3P+rPTgkAAAAABD0/7U3DAAAAAAAAAAAAAAAAAAAAAAAALATZ09HWAi+hXYAAAAASUVORK5CYII=",competition:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACjCAYAAABotuf8AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALiQAAC4kBN8nLrQAAEnpJREFUeJztXQmQXFUVpaBCzCIIghAooCBRIZDp7r93/+5Ze++GYrNEooALUux7sYmAqIAUQgWpArRKBBHKsMgiawhhEWIpi4AssoY9rAGUBEgGz+2ewDDTPfPf//3+7f79TtUtqMnMe/+de9599/3/lnXWUVBQUFBQUFBQUFBQUFBghe7k5unJ/FlWurzMSBVXGcnCMOxTZQ1tGBx9DK6W4/8vBG+D3P5rSxipQtl0S4/Ymepqp3fnT5V5N+IMAnuWOITApnH7sm3Qo/dtBWJWcDuo04041JxchdufgaHZ2el6srCfZudOQbS5xM5UrvFjIORlbqdExcDna4hg1/r0w58S1tBpdZ9mNwxdUAkrux7G953NVGkhGvGula6sxn/ZSVUW3ODLYfIpAsWt8PE+8PX6oQmLwi0e4G1uEpTJNQjsE93JHxWWqBIImyu5G60sNHF9DJ+XpIoK4+80zDx+xd1YZeEahsSb4+bgTGnCQpI+23LLz3E3VFm4RjkXhsSYNGHpyXwKSd0n3A1VFrawKmswU5T3GgMhcX/uRirjMfj+TGnCQo51DHcDlfEYfL9AmrB6jP4TuRuojMfg+wulCQuqPYO7gcp4LGFlr5YmLCtduZG7gcp4DL5/UZqwTLd8G3cDlfEYfL9cmrAwM1js56HsTHUVbGUzc3qra7iJi5CtmYTvVfQ7ouXC929LE5aZKi0SfqBkYdhKlx0ovqnpyfxF6iN2cCMOzVRx4UR8079BJA+Ilg3fvyVNWJZbul30gdAQsm0mFa1buoPbMZ1uxCE66XYT+hC+QL70kI+y32idksY/1K1+Gqw7hZ7JyrYzlQ00J38BGv0yhsaxPRHhu6o+fPfWhrIPxv4cnC3Xk8U/O+BwMp7JFyjjcdG64fvXWqOiBoBqr/BDSI/eZ3gpn9b+xIyBr2P4/IFmZ09O2NlTIbZjEbrzqPsqfsfyGni5xEgVMnqycEyNGzt3On52UMIeioG7GV44Jl+gEz8lWjeGwgeDqWcCwOm+XpBuPy+ZClp33Bz8KbdjuS1uDZ0UlEfyBaLPM6J1w/cXBa27KdBLjvJDiOZkvxO07rg51PVv/RGhjgvKI/kCEest0brh+3OD1t0U9BHaz+wNofskO11eN0jdGBqP43Yst+lIC4L6sOaLTEV4hQp8f3LQupsC+Y6vZTO00QKkfCVI3bqTO5bbsdwGDo8J6kPyhSMYHGrLZpx8NWjdTQHV7oQZyLs+1H7HvERm0lcOEwGh+Hhux3JbK4ZC8oVovfRiFX/nBK27KZDAbQHF3yv6YJZbfgeKTwepO4HEldux3Ibk/cQgHMIHU034QlxYlWWYPE34fiwQMK3dGMK6xofikWflfxikbkyzz+d2LLchYp0RhMMevc/ykyNjlHoCHXuzIHVPCs3J+UqijWTht0HqxRT5L9yO5TY4+NogHEIcZ/kStJO7Pki9nhA3B4Z8kvIIprqb+q0XY/wtXutCr/yQti1xC6HVZqaKN/nlj7hHSvIvP/XC5/v7rdczoPqvYTgUPrgD4/R7mNlpfupEtJuOOpd6dgB+F9PqF7iF0GpD57rLSOan++EQUUcjH4jWiYCwBj7f1k+dwkAS6Gv5DIT1Bz/17Rh3t0QDn/ZcT7JwPm0R5xZCq40+xczTej19Hhvns2T+ND91mqnSY37q8wXKszDUDAs/pFt6GxOArUXrw2xoLkhd7l1Y+aPxjGdyC0GCsF7X7OzuovwR5+D+bj91IkpeJlqfb6Bxup2uvO/nQeH0wy23NEWkPtrPCFI/8loHkZ+wsidwC6H1wqrSYXTCZykQ5/hbX/4Cl/Lzq7VAMjfDdMv3+3lQzO5eQUMzIvXRpwyv02T6vbg5OBs9zdd3zba22kK+klA6QUdNEed+6oOPP4Kv5b5mGAv0nAX+CKoOm27xAiNV8Hw8DoY1z8t1MPNZiQR3Csg8jF0IEgxD2j2efQSO0YnnE+d+6kKuers/dQQAKt0dCfUqPw9Mh4Ohwdt7rQvR53XPwkqXX6C/QR2HcItAhqF973j3UX57/P6D/nxU/QQ+/p4PaQQDpqD0Fv7SAD3vaTR80jAbM/rn0GFgAuXWXiKCmAO5RSDDaNKUMAcnnRliBr4ZuLghgIAfJB+3QitCQERYF7nPbqJfykcbItE5k9WDxu0hQPpqlHk6/Z1m58rIR9iFIMOQN034zdDJVKZAVOc2WsbszWqf4I4hH7dKL0KIG5TElzy/BhgnhHRlZcwc6G1WPs0ekSf8TEBYKyD279PfxoyBPtohxC0CGYY2TviJJWFnDXDheRY91uDT1zEBCv8M0tFAYn0UlO2zZ9TyrQ8ggEMblR23BrdFI+/yWhZ9LAUhtXOcSLAQZSSP9sYwRS9Kt2jEmZ4szgcPrwUpX3PyR8rUjCfUX76VPTu/iSDeQqI4f2zZCMcuSPR81ilEuBhDYe2TBwQGYRUjKSx0xvfRoe3xfBVIVE8EFO2biHjCL7GlwHSL+wU9+B+EfBAzBg/E8Dd1bbkg6jCRHM5MFT87EQX51T4ok10EsgzcHLy2rcQZOtKuxGEwwVbXoDPyR6u1wMPQDPHi4IRV10CkV6G8OVQuyrxO5O/xd4evfSaI7Ehu58s0DPOXUzvj5sBMiGxBK1ZzQJhLyZdcOmoIPNA3EaKFly036DXD1ECIam/890nvpJQ/pP2Ha5+H9iNyO1+m0ZBnuWVE5fLN4P2/gXlPV+hs9305NdQURqr085FDJwITNzK0iry/uhfJ/mfLZzE0RH0pM7hp3b1D5Dt0zPa8hwcheSYe7iIOolHveWsTdwJ68u/bwPkdYXSKkO7k5R233Qogt+nhOEeL7n8Z/RxqKbM3oyEV+ZrJJBcxYBja1PK5rMYnObR8dqvRz4BeGLmFfhJ4e19P5nfh0okvIILsgajxfBgEIb/6wjGGCSvbg4RW+ESVbjL45iPyEbgL7xKmVgHj9gB6xZsyCaJZJKLTJaPr3THu9ocl6k602gtpJ19mkkVw4OHXQ68oIXq0ZKbYRFgfjv0khDoPws8DT8GjaOQLdMTDyDdcumgZ0JDdEEH+I6f3lR9O2ENzRtenOflf0HkD3E5sN6OcinwB67zhrxlGFvTf6WcTxkQ2dhgkYFZ6PbcT28nqL51LS/1sZOkIJOzBjSGEK2l1YqsIM5L5cR+v0TOFDxaLsoHzKzQ7O6eRTyIDDFHTMFTNR/R6Nbiwatuhdhhdvu7kpiNiRW4XtB9DmvA68s3TiXMuf4cOJNybGqnCwiAfT9ETb7PT5amjy+3R+9LcDuW2+krawkJ0ukkPFY4kNCc3E7YLSBBO7GmbF4gb99EU0fBgbsdyGi3yQ4c7WrNz7f2JJgwg6myAsP2iCIEYSl8ZW07cGtzIdIu+N3h0uhGHGAkCHyQcGcTNQcsW2IlD67YstzTuWKSENdQDwXVt4o5capiOMufwYdtBs4doQ8ZNgj3zyYSdHffh1Ki/GO3q91fgZpHmZMPdvdyOSNQP/HhDhDzkEH9sVJaZKl7G7Vhuo8NT0On2DNuPbQeI5HdixFVXNzrBV0/mDSSuwjcuRNEQte7g8GXbgN4E05JiEdJMt/wohDVrbFkQ6An03ZDbqe1gdDKP1i47bThgpArCB3doTu74RmXR1i9uh7aT6U7uR2H7s20AMfxNhCz8/rJG5dBOFUQ+9bZ9lCGC300bfsP2KTswg6uKfDOkg94QrY4eW07M6F8PQ+MB3I5sNyNu0RGP4PAtGzAEzrDSYhdfgqT75unjt5WjV85C71SrGRqJK11Zgk7n+6TqjoOeLGTqd0F77n1rmr34M1PFvZGsRnIrfQuE9W7CGuyOXEuzh6ZAJOeJEISItERP5jcZWxYi2Pr4N+GbMrrJEOkfwAxR6MzXjkTCHtKQaHs+uIKuQNOcbMP12RgG59K1tdzOa2erHdQGzsP2c+igE/e8nolJCaiRLJ7XqBwnU5mGIfVObsd1gtH9R8i1Ng/b16EBSftckdsRLLd8HwgZd1apVt+ksVvQE266xcD5CojrWxw+DwXIrQRu8Kp+2uxIHfx8W9MtL+F2WCcZnRcbtr9DQT0fKnvOh5A7rUbS2fA8eAh0P7ULR8woF01YQzs04rOjgSFNaElLfaNE4fhGt1jg599AD/R8G5iy+isbzcmdyuB6uTBT4is7EeH+DTL0RuUhApq0TZzbYZ1kyHEfDdvv0uFHWCPiWtaj9321UZkg6tv+j5zuPkNu+kjYfpcODIU/9rcjp3Y2w5X4+y3HlonZ4fT6eVzdvWrUk4F73cmdxOF7qcDQtYXp84bPkUNXz9YaHA6Gn8+DCV+A3m2G5P0xJO8Nj/DueCDh3qj+mkA8wpC4MJzejzLGrXWfp/V+GT9/jNt57WrEuZkqRXuPIaJLDA290RE4X/Rzqw7b6cqDKGOXmNH/hYMtUOaudqaixPVFG0aO+lyN81Sp80+XmQwY0rZGYx/ySxidzozZ4qWa/cXdKCjTQEKvVpKOGKL4I+Da4vIzC+Lm4MZ+r5Nda+iN7xnJwkUoa08kppuOlDuT8glup3IbcYvOF+f2MwsQXWIj9+n5PtqIci8Mj8tB5N9R3i2IWjchokk9RbDNjc7Jf4a41exc9Ie/ZoCwtqHe5fVqXmXNjTgEn0thDV8qdyWQCyygD8/czulkIw57jP7uWYrsBQlraBNErgsRxgNfm9JtNrIs5krikNuPbYkeva92GK7pltVnGs+iqn5ipkqHgrupkzPc5YiZA3Mhrsf93r7eHUbnipZfSljZLF3Vy+2zjgEiVwLEXauO1W4oqo+IG93JN732WGEC6Mn8hkaysBfyB89bxaJutFTISBWOIG64/dPxMN3iTiB0cZeffUVD32LDLQ5y+yNSQOSaqtnZXTADeq7bBIY2v4YZ3wHEAbcfIgsMAdvQwWvdsPt55J6guxvtVFKQANrZGzcHdSOZvwzDQ+ReTdB5rMijbsDseKgrdjG3IxDBXCtdWuS04LJtdkMb6JMM2pTl5lVhnfrpNWaqOB85yKJO3BZGQ56eLPyj1oZUYSNuPhXGAI6Zgt4eR15yvuWWl7X1h+36B+MV9KwGfW3As3Pzp+ABCWvwS/P0XldzcjfTKsp2iGQ0m7XSlZc0J38z8qfv0jNy86TgE3FzYErM6N8GM6u9gtzb0wJRfYzo9JMeo38OPRM3LwotBGZbK/iEVXnXdEsONwcKEgDnBr7KLoCwXoWw1AK8KAIJ8m1cwjJTpdswDG7FzYGCBCBinMd1phbyq19j9jeDmwMFCdCT+V4I61kGYQ33GH0x7vYrSIKdLk9B1Do1zNkh1UVHLtlqMV60UTtDIu3vDAk/ZqXLj9GRS9ztVggBiCCz4PCHnV65kYvqQF1qlWc3QbOzW5hu8RQZyTyVabml6xKoA0PgutxtVQgZmKk5EMEqCcJaaaaK3XWPjcLnwFBlYziUcMdh9UOUfRh3+xSYQMISudNHJGKh7MO526fABLM+FEoRlhoKuxi6k3eRXLd8ZkhlouxjudunwAQ4v2inW79Oi8pE2b/kbp8CE0y3dEjrE/e6Ice6irt9CkxI2NnjZQnLSBZu4W6fAhOMlMilUWKGaBi9WyAUvMFyy9fJEhbyrPe426fAALqEG1FlqcQca01XXfStUEfM6E8hqjwjS1hkVAd3OxVChpEsHij77C2qg7udCiFDTxZ+QzuQZQqL6oibg2o5cjfBTJXukSkqMqojZg5sx91WhRCBxF3CqoYxwkIdmp1zuduqEBLi5sB+skU1ajg8lbu9CiFAd/JT4OyrwxIWotZfUafKs6KOhJ2dbWcqL4YlLKoLdea5260gGUaysGeYZ5iO3A67gLvdCh5hpArT49bQ5pjOz/JqCWtoFoR1cViiGjUcPkp1izwrGdr4FW6euwa6k9sIOdK5iAL3IRo8KWhPwf4XtrBqN8PW6xZ6XgjyAbT1crR5NjfvkQXtJAbRVcstvxC+MHjNSpffQNsPVLupJUBzci4Ifp7byVw2cl2xeifWakBUoedG7WbEAbcfIgU6zAM51RJux3IbcQAupnH7IzIwksXNnEz1cW7Hshs4ABc93P6IDIxkQQnrM2EVlLBaBSUsJSwpUMJSwpICJSwlLClQwlLCkgIlLCUsKVDCUsKSAiUsJSwpUMJSwpICJSwlLCmoCatXCYs4UMJqIZxMZWoY+wDb3WocZCobcPsjUkBPPRs9lt25nEYccPshctCcbMZ0S69wO5fLrHTlfeKA2w+RRMwY6LPS5Te5ncwgqvfQ9n25+Y80NCcXN1KFc3Qnf0/CHvpnlI3aSG2lNnPzrqCgoKCgoKCg0D74PybY2tE87U6rAAAAAElFTkSuQmCC",bin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVR4nOWUvQ3CMBCFX5MGloAJwgQwAUwAYoAwATSUMAGZACYgA/CzQSaAjgGgQTIyegU6WfbZioQET3Lxonf+4uR8wL9oCcCItUrZyDS0vgewqhnK306nnDW2NqiK4WEEYMSavSZcMlx8PJNHl35Gv9EAFo4uMQHAmn6uAUwY3kYAdvRjDWDA8CkCcKbvawBdhi8RgCt9RwPIADy5MgXAlQ9KvpHxAFwnDkp+U+MBuP5ZULIrjAfg6rqgZF8bD8B1b4IqWFTSHx2Ag+fmNzpbqoTZhV7EdKwTpi/aAB4R8/8OoIVITQHcFJvbjO2kH9UL+0+m+SiE/A0AAAAASUVORK5CYII=",checkMark:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE10lEQVR4nO2ZXVBUdRjGdzS78BLqSmqyIKducjKZuvKqNMMpMgQW17IENEIFEWhVViYEJlm+dmG/JAFFZFcQ+QqlRKAQiNUWli/5EJYFgd0FUWI/gJ7mv+ZkAp497GG3Znhmzv3vec/7f//veQ6LtaIVrchuySFfLbY0vpc528DNtDQUCi31bemm+vE0Y50lZbrWkmysGedP31AnTVUXJk1d5yZOVr/LA28Vy9n6AU0vSeaaEiUzTVrRbCMyZxogtNyEwFyPdNMvSDXWIcVYi+TpGiT9cQOnp6rx/cPrSHz4E+Inrw3GTV5N4Okr3BwOnoVbL8rmlBLJbJNZMtsEuvAJD6pwavIa4u5fxXfjleaTExUi3oOSFxwCL8MttnROaZDO/Qa74ScqETvxI06OV4CnL9MfHyv1WzZwCZrXnIFSJvtTCcbhDWU4oS/FcV0JuKNXxEGQrGEafu0ZKCuWG/7Y2BV8O1aMqJGict5QyVomK+8w+OjRy8QAjg4rqnhq+fN2G3BE2xx7Gv7eJUQMKxA+JBfZCX87wGnww3KEDRXgkDbfd0nwOWh0lc0pdc6EP6y9iNDBC4bwoTz6I5bMeWfDHxzMR6gmDyH95zNowUuhcmPkkmIA/puB8/h6INcc1Jvzss0GrOuBg+CPaC/CuywWIT25i8Cfw4H+XAT3ZSfYBM8DVolnmgYdAR+uLcDGU/5wYb+D9Yc+QHB71oLw++/mILD3rNYH8tWUBshW6ajKvxXnB9fdm60GXPw3wT1s24LwQX3ZxAC+6pV5UhqwrsSOgud4zjOwOHwW9vbKoikNZFhuFi1728SzH8Fz/jHwysH3sU8tXRT+y54z+KJbpqA0ILDUq22BjxkpAefn04jVly+t8k8YeDVsKwLbnw2/t1uGPXekLdQGTL8aKOGHi7EheocV4O14NmJ0pfQr//ezPmwrZeUJ/Od3pNjTJdFRGkg31pmp2uZN7if/gtgUH4ATo8X0Ks/xxGsRHyKwXWYrPHZ3ik2UBlKna81UPf/GUwYevwnuSNGywXO6xAjoEFEbSDHWGKgOLHewEBuivOZBbYzzQ+TwJRvaZhv2tUnpwXeKwG4XUreQNT2wYdpEaRR4fQETpNoRWgXz8B0Z8GsTUh/ipKnqIltHZUR/ATwiFzbBWNt0PoL3bxdiV5uAeoyS3IbOnD9y9wI8Ij+aB8tk5f3bhfBtE8BHnRZFaYCETnQvqcN9ec80wQT8LnU6vFtTN1MaIIlZwmSVhu4NG9qTC/fI7csGv7M1bcDmNI8kZkvZ50O6s+F+dDvj8J+p07CzNTXeJnjrW9BXuJHEbCkfI/s7z8Ijeof1sefA+j4J35Ji8rnNX8eiIxL32f8lxUjl4a1KFtCCt76F+5UuMfoynbPhP1Xx9V7NSUvLTUlW6VT4lmR4t/B9WPaIZJXOgv/4d76QZa/Id2jUaNFlh8Or+GVbqnnPsZgQCVoj7inKHQhf6tUsYSbcfSwSeZOs0hFts4Wpyi8kklWGavJ1jI/KFv6Y3QfWVoVoc1xJ3Hdg4JyJiUvKW5Us8FHzXViOVrAmex1JzAL7sjW0dxt1moasB7Rv2OUQWbJI6ERyGxJ9kPSA0yU2cLpE5oDOTDO7Q2jwbxOoyD5PVmKyVf4nfrOuaEWs/7/+Atqs1blaLwVcAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+ElEQVR4nO2aO2gUURSGP8T1AaImIGjUIkIMooj4KgRBbFJZiYVY2agIVj5WsDC9VklIsLNQwS2yhZVmN4KotYVPWERFLBbER1Y0aBy5cAaGZXZm7nhn92bmfnBg2T1n98x/z5z7mAWHw+FwOBwOh8MheDm3WLycmxMgDi/n5gSIw8u5OQHi8BLaPHAJGBAry3uFqYBySGy5SAJsCIldXyQBBkJiNxb9FricUdK3gDu2CTAvImTdBN8Ca4C1wAebBPC6YL+BA4HcDgJ/iiTA1ZD8rhdFgMfA0pD8lgPP8i7AV2AwIsftwM88C3AiQZ7n8yTAJ6ACnAK2JEkSWALU8yDAbdKjFl6fF7MAH4F+/o+jNgrQBI4BR6S8w3wWgMOY4Z1NAlSAdYHv6wNuhPhdwxw3bRCgKaMexqE23+fACoMCnOy1AJW2UW/nYcD3F7ATswz2SoBmxKh3Gn01f2fBMmAlsAnYD5wD7gKtrASoxIx62OjXZf7uJquBM7KrNCbAC40ERiXmC7AZcwzLFrwGvJKRbsnrmnymfHxUz7liSoBRzWSV/3HMsA+Y1ahUVXV7dX7AS2BqM9JtSsAk8DdFk1YxE/IdsXgGy98U/W29JK3NyrokEi/FIUWWlDRLPs4eyYzREdvKf9Lgxfs2HvWDXo/tvZz6+A0vyT0/F8i/lbAn7LFVgNOBXJKWfiMQ00gYM2OjAD+AVZLHNs3zQ58nGnHDtgmglq5pnjNOB+KmNeIu2ibA2UAeNY24qUDclEbcA9sEUJsYnzcdfFpyn6tSr8osMRKIG5H3quLTiGiMr20TQD1d9pnr4JOWuNnDCgGChyTfuyDAt6SO3TJ//u/pLWALM11ogvexmLTTYFUj7gIWM6RxIarUfZ5qxG3Fcuq9WArbxC55gBJ3MarJGdsM2cZEBrPNGIuIUsqnwKkPRGykz9CpUD3JkZjNlTCe8lB0Qco+7C83i44dwD2Ni1fdfjc5ZEj282pLqx6GqI2NspeywlOfKZ9I/gGPNfEFBL9FwQAAAABJRU5ErkJggg==",upArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVR4nO3YywrCMBBG4fOE1oWDC/vsCiq+RAuVQLpzvDVtJvAfCJSki/nIqgWllFJKKaUqtwfuwDU/N5kBAzDlNQI9jSOmFjHmIJrCHF8gBmcvvdvMTYzACTg4Z31LiLnwGPsCER5jPyDCYuwPRDiMLUCEwVgBRHWMFURUw9gKiM0xtiJiM4xtgFgdYxsi5opjaiCKY2oiimEiIBZjuoDfDkdnpjSr2y0Y4h0m/dBwewREeJg0q1uXpedPV1epDrjkGXe1h1FKKaWUUrTVE5bz7NyN3sYLAAAAAElFTkSuQmCC",downArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAgklEQVR4nO2UOwrAIBAF5xKReP+bJFV+TSxynATBQiSI0TXVDggW7htesYKiKIogE7ADRiDLZxzAXPJ4BW7ANcpNyPBZS8nAAJxh4AJshTTNGGsH7R/SFnmztEYuJv0iF5eWyLtJc/Lu0rfddMld4sPJErfs3jTFt9vC6d5UURSFmAePTDtnrV72/QAAAABJRU5ErkJggg==",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvUlEQVR4nO2XTUrDQBSAPwXBn7ps0TO4EFfd24obEfQQHqOt4qIewAt4BkFci+610IIW7MpFXQtWxJGRNxBK02k0qTPpfDCUvDbJ+/LezDQQCARmBpWTQe5EfEUFEcdQoSKOoUJFMmIZOAG6wEA+G8CSTxXRyd7F7A+3FhmnRI4lh2egAqwAVaAn8bovIl3JYXsoXpX4ky8iA8mhMBRflfh7miIlYJNsK1IZiu9I/DEtES3RAtrAIunTkBx60k4FkTBzpJaGiJEwvztL3+NnVdKr06hV68by8CYSiUroCfcpo5yBjE62LvcZyGdtgg6wihSBB/muA6xJNcyxbaOaFmqcSLQSLTlGnk5b4s2YCy/giEgpRsJQjrTYHnAAnAJXQD/mnKmLFEe00yialtdOfe76f4mULJWIYlqsL5XQFTmUfWbSa2Qm0kqYQNxqkuSBZCKiLO2UhGiLjmu/rSxEOilJJJH5kF19Pu05Mi30HnQOfMm9r/+wOCgX/v3uAi9y/1dg31cRpBMuI3lcyIuVdyKaOeAIeLPMqXHDCRHDBnCfB5HfEERcQ4XWcgwVKuIYKrcVUZ4PciMSCARmgG9mLvK/OR2iiQAAAABJRU5ErkJggg==",flag:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAACBCAYAAADuS3kqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACfRJREFUeJztnXuIXNUdx913shutjfVBqtGFupuZ3Xnd9zz3Ne/dYKEo/isSEGqFSlslSFBi2kStSqkiCEGl1D/ECP4hKLYmTUziZjfRjUl8FzU0pbJLtIlJ1t2N37PZQHBM9t67d845d+b3hS8z9+59nfP73N/5nZnZmcsuI5FIJJJE0pOlpqg+2NwbTbUEQlZLd4/ecnNAbT3vrqDWuqbXbA1GEq0RbaBFSxSbRF8zySOF1b5G1cqtDCl93Xhcq1r530X1gYeMVHlUTxSPYnkqZgydBCDTCP4cfJY9YnkG608pVu44gDiGbXdFtP6N2P4+xcwWw2p/AH/vwHYEi+xC8BoQrOUI1q3wk1jeA39ppIZPm+nhOSuz9uxSjePMmjgeYPlIjeffCGt9vwcoAZyvRXT7SQvCUHAFAjIIGNYjUP/A8gkzPbLk4DsxzjmtJQrjgGNzVBtI4FpaRfdL3QkdvwypPaPFC5uMZGkcmQAgDHMF4cezyMickSxPApLtuL518C8AS6Po/qppYShYjbtwHdL2q3qyfEo0BIsMM3OoXY4iez0AeDvNVLlBdP/VjHC3tQGComLmtgGE06KD7caA42u0YyOK3JVL7hAccAW8DR5d8L6LeAze6kEMpBIq/lvUeGEn7rrvRAd26ZljZE5PFg+j7uhH1nA/pOBgP4E/sXni3R7GQ5gwdbwaIGzAuPwpagVPZgwyGVnjjBYvbsEweLmrDqonKBQru0q18vdjDJ4UHbhqm9UbGBJfQpHc5bijcIArah0KFI8rAMPdyAzHWIoVHTCOnsFM5UHHHVbLUKDwuhLTtQ1Ip/+TIEAiPAsoNjruOIdQ7KlC7DwXIOjQ4vlfYZjYgTQ6I0FwfAnFx7UCRdQY7EIR+SJgmJYgKKJd31AoZu46DTAgSxAMHkBxuZ+hAAjNmHr9AUPFvyUIgmyuLygw1boKReSv8fhxnc0onELxsOPO9RsUmHtfjaxwJ4aJccBwRoKOl9lcoNhbhTjbEoaIFTEzu05Plj63MpQZ6hYKI1VqiZlD3agb/gYYpmiYkBiKrqDeGlIyN1jpYc8/6ME+PBLVB8PICvdgmHgbU8uTEnSuX+0aihVOoQAQIRR5n8HPhrW+jGrl25YCgmJmGwFCGhlhA471MrLCccoKnkGxiQsUCGAMQZv/AAoeZ1D8/Ze9RqBYubvwPN8TSXZim9W406/HRf0cvhLPVyELrAZQnRGtP6InSndgm3uxfif2+8pIDc9K0Im1ZjFQ/MBz7GVlzAxO4vFrKz0yhXWTWP4cy5PY5zj7WBt7a5dtK0Gn1bqXBMVHNk/yDtsHd3z0IlCQ5TJBQfYOig6CombNEQozGwEU30rQaPLiUPyRCxSYQoYJCl+YCxSj56DIERT+MEcorFyIoPCF+UGhnoOCXn6W366haHcORb6XoPCFZ40ULyjiBIVPzBOKAkHhD7N/QP6TWyg+tHmSfWwfLVHoISh8YZ5QFINWeuSEBI0mywKFTlD4xa6hWO4YimQpYGUICh+YoCCLgWLsHBRlQLGWoJDfDIrNvKBYg+f/l6DRZFmgMAgKv5gjFKlyN0HhCwOKYVdQLHMKhZkaJij8YY5QpEe68PwbCRpNXhyKLW6h+MDmScYXMsWNOFnNf5lYDZgfFOynCmJm1m52IdcDFDcHVPZFIXb3IfsQijbnUGiAIntEgkaTZYGiKwgoTILCB2ZQPFJtKPZfAMVhCRpNlgiKJoWg8IN5QqE3IVMckqDRZFmg6O4hKHxi11C0uoECw8f7EjSaLA8UBqDIERTym0HxaLWhOHABFAclaDS5ilDYfc2BoPCXOULROw/FhASNJlcJihanUKzpNQkKf5g7FO9J0Gjy4lA8xguKRoLCF+YCxbvzUISsRsXKvStBo8kEBVlaKAKAQrVyByRoNLlKUDQ7hyIOKPIEhfzmCEV4Hor9EjSavDgUfyYoyJ5BYfcDM++xfYLhBINiXIJGkwkKMi8omhxDEQEU8fyYBI0mywJFTyRJUPjDXKFo0OKFfRI0mrw4FI9XG4qJeSiiBIVfzBuKUdENJksFRapBJSh8YbdQNDqFovccFO+IbjBZJihiKTZ8EBQ+MEco0gyKvaIbLKPN9MhZLVE4ZaTKX+nJ0ljUGHpBtfLPaoni01j+q5Es/0WHsfwUsu0zMTO7VbVyryF4x7DuhNe/3IzjPuEWCrv/7XWQ7RMiKM4DwKZ8JxHcCS1ReiOiDdyvxvO3OQ7Cgsz0MIbl/K1hrf8+gPU6IPoC677zBxRKpgFU7xEdFEEgnEWwvgEIb8aM7DoEsFNPFJrdgnAp4cb7Kc5T1uL5vyPzTFkZ51mENxS7RQeIlwHBDIJzULFyW5ANBsJqX4PnBCwiPVFcFlb7h5BJngcgtr+Z0C0UDQRFpdnQABjYOP9yVB8soc3XeB5pF0L2aAYYA7i25wDHot9QyBGKvpqFYr5QjBcOozjcHDUGA4qZ5Z4V7ArXVgQcE+yaLwHFk44P7BCK98/vByjeFh1Aj2GYBQzjipn7ZUTrlxaEHxMyx1Zc/4wMUOwSHUgvjDttFiBsQ7V/i5EstnsaLU7SE6V2tOMx+LRQKHSfQ4Gp3oyRLO/AMJEVUThWQ6h9CgDjuDgoksWdogPrEoZpdNx+DBVr0YZGT6MigZDBkyhA/4Ppq3somNxBUfIdFADhQxRntxvJUodnUZBQMTO7CnXGAQYGbyj+JTrI9jLD/ItNX6jxwnpkiZWe9bzkwrD4M7T7Jdj5ex9MLNg2O/nQ+X38AAXS6CSKyMdjxuBNyBI1UTc4EWJ0LWo/xdXOLqHYITrol4BhFrOJ15BCcyi+6g4GT1QrUACGM0ibb0b1gSxqh5orIrnKHRTl7aIhuACGGWSFVzBMpCNaP8HghdxAgTn+WyJBWCggj0aNwU3ICgZlBo/lEop/CgCB/XreFIqn7Sgcf6tauWBYyRAM1RA63O7XH7Kp63zhhuBwgWIhI5zA8LBLsXL3KOZQJ7JCk+g+q3m5gQKB+Q3u1DH23r6RWtqngy4EAMeaRhaaBAB7o8bQw3AhrPa1ITMQCDzlBgoA0RhSMq0IXjceFUwB740ZQw/GzOwzAGU3UvwYZgIT+PshAHQE6z9gZs+x/qAaLxxABhiF34poA6wuWI9tb++NpsL4+40hta8Z56DppCi5geJiYu8nIMDLAUp7IBxvX9NrdHQFdVhbsI51ZnswkliODLAMw0Ibr3aSHMhLKEg1IgdQHCYo6kQItN2vVCYo6kUEBalCBAWpQgQFqUIEBalCDqGg9xrqQQi03Z9pICjqRQQFqUIEBalCBAWpQgQFqUIItN1f+TlCUNSJCApShQgKUoUIClKFCApShRxCQR+grQch0HZ/OZCgqBcRFKQKERSkChEUJBKJRCKRHOh7LktbCRuu/n0AAAAASUVORK5CYII="},ML=({match:e,timeFormat:t})=>{var n,r,i,o;return s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:.5,fontSize:"xs",children:[s.jsxs(h.Typography,{mr:1,children:["[",ft(e.kickoffAt).format(t),"]"]}),e.homeTeam.code?s.jsx(h.Tooltip,{title:e.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((n=e.homeTeam.assets)==null?void 0:n.logo)||Be.team,sx:{width:"20px",height:"20px"}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((r=e.homeTeam.assets)==null?void 0:r.logo)||Be.team,sx:{width:"20px",height:"20px"}})]}),"-",e.awayTeam.code?s.jsx(h.Tooltip,{title:e.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((i=e.awayTeam.assets)==null?void 0:i.logo)||Be.team,sx:{width:"20px",height:"20px"}})," ",s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((o=e.awayTeam.assets)==null?void 0:o.logo)||Be.team,sx:{width:"20px",height:"20px"}}),s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})]})},Ts=$e(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),BL=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=Ge(),c=()=>_(this,null,function*(){try{const p=yield l.topX.getGames({limit:50},!0),g=yield l.matchQuiz.getGames({limit:50},!0),v=[...p.data,...g.data];if(e.related&&e.related.length>0){const m=v.filter(b=>{var C;return(C=e.related)==null?void 0:C.some(S=>S.entity_id===b.id)}).map(b=>b.id);n(m)}i(v)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"GAME",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Ts,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-game-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.title?d.title+` (${d.type})`:`Game with no title (${d.type}). ID: ${d.id}`},`related-game-title-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ye,{showToast:o,message:"There was a problem witch fetching games for related options",color:"danger",hideToast:f})]})},$L=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=Ge(),c=()=>_(this,null,function*(){try{const p=yield l.loyalty.getTemplates(void 0,!0);if(e.related&&e.related.length>0){const g=p.data.filter(v=>{var m;return(m=e.related)==null?void 0:m.some(b=>b.entity_id===v.id)}).map(v=>v.id);n(g)}i(p.data)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"TEMPLATE",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Ts,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-template-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.name||`Template with no name. ID: ${d.id}`},`related-template-name-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ye,{showToast:o,message:"There was a problem witch fetching templates for related options",color:"danger",hideToast:f})]})},Sm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="game"),Im=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="template"),FL=e=>{const t=(n,r)=>{if(r==="games"){const i=Im(e.related);e.onChange([...n,...i])}if(r==="templates"){const i=Sm(e.related);e.onChange([...n,...i])}};return s.jsxs(s.Fragment,{children:[s.jsx(BL,{label:e.labels.games,related:Sm(e.related),onChange:n=>t(n,"games")}),s.jsx($L,{label:e.labels.templates,related:Im(e.related),onChange:n=>t(n,"templates")})]})},NL=(e,t)=>{const[n,r]=y.useState(null),{https:i}=Ge(),o=()=>_(this,null,function*(){const a=yield i.getSchedulersByEntityId(e);if(a.ok){const l=yield a.json();r(l.data);return}r([])});return y.useEffect(()=>(o(),()=>r(null)),[e,t]),n},yi=({my:e})=>s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:e},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}),zL=["PENDING","LIVE","SETTLED"],jL=["OPEN"],UL=["ACTIVE","INACTIVE","EXPIRED"],VL=new Map().set("PENDING","Pending").set("LIVE","Live").set("SETTLED","Settled").set("CANCELED","Canceled").set("OPEN","Open").set("ACTIVE","Active").set("INACTIVE","Inactive").set("PENDING","Pending").set("EXPIRED","Expired"),Am=e=>{let t=[];return e.entityType==="CLASSIC_QUIZ"||e.entityType==="PERSONALITY_QUIZ"||e.entityType==="EITHER_OR"||e.entityType==="POLL"?t=Array.from(UL):e.entityType==="TEMPLATE"?t=Array.from(zL):t=Array.from(jL),s.jsx(s.Fragment,{children:t.map(n=>s.jsx(h.Option,{value:n,children:VL.get(n)},`${e.entityType}-${n}-status`))})};class HL{constructor(){J(this,"name","");J(this,"scheduled_task_config",{entity_id:"",entity_type:"",change:{status:""}});J(this,"trigger",{trigger_type:"DATETIME",date:""})}}const WL=$e(s.jsx("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded"),GL=e=>{const[t,n]=y.useState(!1),{https:r}=Ge(),i=o=>_(this,null,function*(){if(o.stopPropagation(),n(!0),(yield r.deleteScheduledTask(e.taskId)).ok){n(!1),e.toggleToast("success",e.labels.deleteScheduledTaskMessage),e.refetchTasks(),e.toggleModal();return}n(!1),e.toggleToast("danger",e.labels.deleteScheduledTaskErrorMessage)});return s.jsx(s.Fragment,{children:s.jsx(h.Modal,{open:e.isOpen,onClose:e.toggleModal,children:s.jsxs(h.ModalDialog,{children:[s.jsxs(h.DialogTitle,{children:[s.jsx(WL,{}),e.labels.deleteScheduledTaskModalTitle]}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{children:s.jsxs(h.Typography,{children:[e.labels.deleteScheduledTaskModalParagraph,s.jsx(h.Typography,{fontWeight:"bold",children:e.taskName}),"?"]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{loading:t,variant:"solid",color:"danger",onClick:o=>i(o),children:e.labels.delete}),s.jsx(h.Button,{variant:"plain",color:"neutral",onClick:o=>{o.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]})})})},YL=e=>{const[t,n]=y.useState(null),[r,i]=y.useState(""),[o,a]=y.useState(""),[l,c]=y.useState(""),[u,f]=y.useState(""),[d,p]=y.useState(!1),[g,v]=y.useState(!1),[m,b]=y.useState(!1),[C,S]=y.useState("success"),[x,I]=y.useState(""),[w,A]=y.useState(!1),E=y.useRef(!1),k=NL(e.entityId,E.current),{https:$}=Ge();if(!k)return s.jsx(yi,{my:10});const G=()=>A(!w),O=(L,V)=>{b(!0),S(L),I(V)},T=(L,V)=>{i(V.scheduled_task_config.change.status),c(V.trigger.date),n(L)},F=()=>_(this,null,function*(){p(!0);const L=N("CREATE","");if((yield $.setSchedulers(L,"CREATE",null)).ok){p(!1),a(""),f(""),E.current=!E.current,O("success",e.labels.createScheduledTaskMessage);return}p(!1),a(""),f(""),O("danger",e.labels.createScheduledTaskErrorMessage)}),H=(L,V)=>_(this,null,function*(){v(!0);const Y=N("UPDATE",V);if((yield $.setSchedulers(Y,"UPDATE",L)).ok){v(!1),n(null),i(""),c(""),E.current=!E.current,O("success",e.labels.updateScheduledTaskMessage);return}v(!1),O("danger",e.labels.updateScheduledTaskErrorMessage),n(null),i(""),c("")}),j=()=>{E.current=!E.current},N=(L,V)=>{const Y=new HL,X=L==="CREATE"?o:r,D=L==="CREATE"?null:V,B=L==="CREATE"?u:l;return Y.scheduled_task_config.entity_id=e.entityId,Y.scheduled_task_config.entity_type=e.entityType,Y.scheduled_task_config.change.status=X,Y.trigger.date=B,Y.name=D,Y};return s.jsxs(s.Fragment,{children:[k.map((L,V)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{children:t===V?s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%"},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:r,size:"sm",name:"status",onChange:(Y,X)=>i(X),sx:{minHeight:"36px"},children:s.jsx(Am,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(au,{defaultDate:l,onChange:Y=>c(Y)})]}),r&&l?s.jsx(h.Button,{onClick:()=>H(L.id,L.name),loading:g,sx:{mt:"auto"},children:e.labels.save}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.save})]}):s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"}},children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.labels.name,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:L.name})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.labels.status,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:L.status})]})]}),!e.readOnly&&s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.labels.edit,children:s.jsx(h.IconButton,{onClick:()=>T(V,L),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.labels.delete,children:s.jsx(h.IconButton,{onClick:G,children:s.jsx(_e.Delete,{})})})]}),s.jsx(GL,{labels:e.labels,isOpen:w,taskId:L.id,taskName:L.name,toggleModal:G,refetchTasks:j,toggleToast:O})]})})},`scheduled-task-${e.entityId}-${e.entityType}-${L.id}`)),!e.readOnly&&s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%",mt:k&&k.length?2:0},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:o,size:"sm",name:"status",onChange:(L,V)=>a(V),sx:{minHeight:"37px"},children:s.jsx(Am,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(au,{defaultDate:u,onChange:L=>f(L)})]}),o&&u?s.jsx(h.Button,{onClick:F,loading:d,sx:{mt:"auto"},children:e.labels.create}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.create})]}),s.jsx(Ye,{showToast:m,message:x,color:C,hideToast:()=>b(!1)})]})};function KL(e){return ut("MuiIconButton",e)}qe("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]);const qL=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],QL=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,size:o,variant:a,loading:l}=e,c={root:["root",n&&"disabled",r&&"focusVisible",a&&`variant${Se(a)}`,t&&`color${Se(t)}`,o&&`size${Se(o)}`,l&&"loading"],loadingIndicator:["loadingIndicator"]},u=gt(c,KL,{});return r&&i&&(u.root+=` ${i}`),u},JL=Ce("button")(({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[t.instanceSize]},t.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:e.vars.fontSize.sm,paddingInline:"2px"},t.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:e.vars.fontSize.md,paddingInline:"0.25rem"},t.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:e.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${e.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[e.focus.selector]:R({"--Icon-color":"currentColor"},e.focus.default)}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":R({"--Icon-color":"currentColor"},(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color])},'&:active, &[aria-pressed="true"]':R({"--Icon-color":"currentColor"},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]),"&:disabled":(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]})]}),XL=Ce(JL,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ZL=Ce("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Tm=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyIconButton"}),{children:o,action:a,component:l="button",color:c="neutral",disabled:u,variant:f="plain",loading:d=!1,loadingIndicator:p,size:g="md",slots:v={},slotProps:m={}}=i,b=De(i,qL),C=K.useContext(Fp),S=K.useContext(Np),x=t.variant||C.variant||f,I=t.size||C.size||g,w=t.color||C.color||c,A=(r=t.loading||t.disabled)!=null?r:C.disabled||d||u,E=K.useRef(null),k=gn(E,n),{focusVisible:$,setFocusVisible:G,getRootProps:O}=Xl(R({},i,{disabled:A,rootRef:k})),T=p!=null?p:s.jsx(Bp,{color:w,thickness:{sm:2,md:3,lg:4}[I]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var B;G(!0),(B=E.current)==null||B.focus()}}),[G]);const F=R({},i,{component:l,color:w,disabled:A,variant:x,loading:d,size:I,focusVisible:$,instanceSize:t.size}),H=QL(F),j=B=>{var U;let W=i.onClick;if(typeof m.root=="function"?W=m.root(F).onClick:m.root&&(W=m.root.onClick),(U=W)==null||U(B),S){var ie;(ie=S.onClick)==null||ie.call(S,B,i.value)}};let N=i["aria-pressed"];typeof m.root=="function"?N=m.root(F)["aria-pressed"]:m.root&&(N=m.root["aria-pressed"]),S!=null&&S.value&&(Array.isArray(S.value)?N=S.value.indexOf(i.value)!==-1:N=S.value===i.value);const L=R({},b,{component:l,slots:v,slotProps:m}),[V,Y]=Ee("root",{ref:n,className:H.root,elementType:XL,getSlotProps:O,externalForwardedProps:L,ownerState:F,additionalProps:{onClick:j,"aria-pressed":N}}),[X,D]=Ee("loadingIndicator",{className:H.loadingIndicator,elementType:ZL,externalForwardedProps:L,ownerState:F});return s.jsx(V,R({},Y,{children:d?s.jsx(X,R({},D,{children:T})):o}))});Tm.muiName="IconButton";const Ao=$e(s.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded"),eM=({label:e,defaultValue:t,options:n,required:r,onChange:i})=>{function o(c){var u,f;return c?s.jsxs(s.Fragment,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=(u=n.find(d=>d.id===c.value))==null?void 0:u.assets)==null?void 0:f.logo)||Be.competition})}),c.label]}):null}const a=y.useRef(null),l=(c,u)=>{i(u)};return s.jsxs(h.FormControl,{sx:{mb:1},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:e}),s.jsx(h.Select,Q(M({slotProps:{button:{sx:{whiteSpace:"nowrap"}}},sx:{"--ListItemDecorator-size":"44px",minHeight:"37px"},renderValue:o,value:t,onChange:l},t&&{endDecorator:s.jsx(Tm,{variant:"plain",color:"neutral",onMouseDown:c=>{c.stopPropagation()},onClick:()=>{var c;i(""),(c=a.current)==null||c.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:n.map((c,u)=>{var f;return s.jsxs(y.Fragment,{children:[u!==0?s.jsx(h.ListDivider,{role:"none"}):null,s.jsxs(h.Option,{value:c.id,label:c.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=c.assets)==null?void 0:f.logo)||Be.competition})}),c.name]})]},`${c.id}-${u}`)})}))]})};function tM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Em=tM,nM=typeof jt=="object"&&jt&&jt.Object===Object&&jt,rM=nM,iM=rM,oM=typeof self=="object"&&self&&self.Object===Object&&self,aM=iM||oM||Function("return this")(),km=aM,sM=km,lM=function(){return sM.Date.now()},cM=lM,uM=/\s/;function dM(e){for(var t=e.length;t--&&uM.test(e.charAt(t)););return t}var fM=dM,hM=fM,pM=/^\s+/;function gM(e){return e&&e.slice(0,hM(e)+1).replace(pM,"")}var mM=gM,vM=km,bM=vM.Symbol,Au=bM,_m=Au,Pm=Object.prototype,yM=Pm.hasOwnProperty,xM=Pm.toString,To=_m?_m.toStringTag:void 0;function CM(e){var t=yM.call(e,To),n=e[To];try{e[To]=void 0;var r=!0}catch(o){}var i=xM.call(e);return r&&(t?e[To]=n:delete e[To]),i}var wM=CM,SM=Object.prototype,IM=SM.toString;function AM(e){return IM.call(e)}var TM=AM,Dm=Au,EM=wM,kM=TM,_M="[object Null]",PM="[object Undefined]",Om=Dm?Dm.toStringTag:void 0;function DM(e){return e==null?e===void 0?PM:_M:Om&&Om in Object(e)?EM(e):kM(e)}var OM=DM;function RM(e){return e!=null&&typeof e=="object"}var LM=RM,MM=OM,BM=LM,$M="[object Symbol]";function FM(e){return typeof e=="symbol"||BM(e)&&MM(e)==$M}var Rm=FM,NM=mM,Lm=Em,zM=Rm,Mm=NaN,jM=/^[-+]0x[0-9a-f]+$/i,UM=/^0b[01]+$/i,VM=/^0o[0-7]+$/i,HM=parseInt;function WM(e){if(typeof e=="number")return e;if(zM(e))return Mm;if(Lm(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Lm(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=NM(e);var n=UM.test(e);return n||VM.test(e)?HM(e.slice(2),n?2:8):jM.test(e)?Mm:+e}var GM=WM,YM=Em,Tu=cM,Bm=GM,KM="Expected a function",qM=Math.max,QM=Math.min;function JM(e,t,n){var r,i,o,a,l,c,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(KM);t=Bm(t)||0,YM(n)&&(f=!!n.leading,d="maxWait"in n,o=d?qM(Bm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var E=r,k=i;return r=i=void 0,u=A,a=e.apply(k,E),a}function v(A){return u=A,l=setTimeout(C,t),f?g(A):a}function m(A){var E=A-c,k=A-u,$=t-E;return d?QM($,o-k):$}function b(A){var E=A-c,k=A-u;return c===void 0||E>=t||E<0||d&&k>=o}function C(){var A=Tu();if(b(A))return S(A);l=setTimeout(C,m(A))}function S(A){return l=void 0,p&&r?g(A):(r=i=void 0,a)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function I(){return l===void 0?a:S(Tu())}function w(){var A=Tu(),E=b(A);if(r=arguments,i=this,c=A,E){if(l===void 0)return v(c);if(d)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return w.cancel=x,w.flush=I,w}var XM=JM;const cr=yn(XM),kn=({option:e})=>s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:e.logo}),s.jsx(h.Typography,{children:e.label}),s.jsx(h.Typography,{ml:.5,level:"body-xs",children:`(${e.countryName})`})]}),$m=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],ZM=({labels:e,label:t,ids:n,required:r,onChange:i})=>{const[o,a]=y.useState([]),[l,c]=y.useState([]),[u,f]=y.useState(!1),[d,p]=y.useState(""),[g,v]=y.useState(!1),{sdk:m}=Ge(),b=()=>v(!g),C=(w,A)=>{a(A),i(A[0]?[A[0].id]:[])},S=3;y.useEffect(()=>{!d&&n&&n.length&&m.football.getCompetitions({competitionIds:n}).then(w=>{a($m(w))}).catch(w=>{console.error(w),b(),a([])})},[]);const x=y.useMemo(()=>cr(w=>{f(!0),m.football.getCompetitions({name:w}).then(A=>{c([...$m(A)]),f(!1)}).catch(A=>{console.error(A),b(),c([]),f(!1)})},300),[]);y.useEffect(()=>{if(!d||d.length<S){c([]);return}return x(d),()=>x.cancel()},[d,x]);const I=(w,A)=>w.map((E,k)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:$=>A({index:k}).onClick($),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:E},`option_${E.id}`)},E.id));return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:t}),s.jsx(h.Box,{children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:u,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(w,A)=>w.id===A.id,endDecorator:u?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.competitionsSelectionPlaceholder,options:l,disabled:o.length===1,filterOptions:w=>w.filter(A=>!o.some(E=>E.value===A.value)),onInputChange:(w,A)=>{p(A)},onChange:C,getOptionKey:w=>w.id,value:o,renderTags:I,renderOption:(w,A)=>s.jsx(h.AutocompleteOption,Q(M({},w),{children:s.jsx(kn,{option:A})}))})}),s.jsx(Ye,{showToast:g,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:b})]})},Fm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],e2=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState(!1),[f,d]=y.useState(""),[p,g]=y.useState(!1),{sdk:v}=Ge(),m=()=>g(!p),b=(I,w)=>{o(w);const A=w.map(E=>E.id);r(A&&A.length?A:null)},C=3;y.useEffect(()=>{!f&&t&&t.length&&v.football.getCompetitions({competitionIds:t}).then(I=>{o(Fm(I))}).catch(I=>{console.error(I),m(),o([])})},[]);const S=y.useMemo(()=>cr(I=>{u(!0);const w={name:I,competitionIds:[""]};n&&Array.isArray(n)&&n.length>0?w.competitionIds=Array.from(n):delete w.competitionIds,v.football.getCompetitions(w).then(A=>{l([...Fm(A)]),u(!1)}).catch(A=>{console.error(A),m(),l([]),u(!1)})},300),[]);y.useEffect(()=>{if(!f||f.length<C){l([]);return}return S(f),()=>S.cancel()},[f,S]);const x=(I,w)=>I.map((A,E)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>w({index:E}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:A},`option_${A.id}`)},A.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:c,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,w)=>I.id===w.id,endDecorator:c?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.competitionsSelectionPlaceholder,options:a,filterOptions:I=>I.filter(w=>!i.some(A=>A.value===w.value)),onInputChange:(I,w)=>{d(w)},onChange:b,getOptionKey:I=>I.id,value:i,renderTags:x,renderOption:(I,w)=>s.jsx(h.AutocompleteOption,Q(M({},I),{children:s.jsx(kn,{option:w})}))})}),s.jsx(Ye,{showToast:p,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:m})]})},Nm=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],t2=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState(!1),{sdk:g}=Ge(),v=()=>p(!d),m=(x,I)=>{i(I);const w=I.map(A=>A.id);n(w&&w.length?w:null)},b=3;y.useEffect(()=>{!u&&t&&t.length&&g.profile.getByIds(t).then(x=>{i(Nm(x))}).catch(x=>{v(),console.error(x),i([])})},[]);const C=y.useMemo(()=>cr(x=>{c(!0),g.profile.getByIds([],x).then(I=>{a([...Nm(I)]),c(!1)}).catch(I=>{console.error(I),v(),a([]),c(!1)})},300),[]);y.useEffect(()=>{if(!u||u.length<b){a([]);return}return C(u),()=>C.cancel()},[u,C]);const S=(x,I)=>x.map((w,A)=>{var E;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>I({index:A}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(E=w.avatar)!=null?E:Be.avatar}),s.jsx(h.Typography,{children:w.label})]})},w.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(x,I)=>x.id===I.id,endDecorator:l?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:x=>x.filter(I=>!r.some(w=>w.value===I.value)),onInputChange:(x,I)=>{f(I)},onChange:m,getOptionKey:x=>x.id,value:r,renderTags:S,renderOption:(x,I)=>{var w;return s.jsx(h.AutocompleteOption,Q(M({},x),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(w=I.avatar)!=null?w:Be.avatar}),s.jsx(h.Typography,{children:I.label})]})}))}})}),s.jsx(Ye,{showToast:d,message:e.searchProfilesErrorMessage,color:"danger",hideToast:v})]})},zm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Team with no name",label:t.name?t.name:"Team with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.team,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],jm=({labels:e,ids:t,scope:n,readOnly:r,AdditionalCheckbox:i,onChange:o})=>{const[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ge(),C=()=>m(!v),S=(A,E)=>{l(E),o(E)},x=3;y.useEffect(()=>{!p&&t&&t.length&&b.football.getTeams({teamIds:t,scope:n}).then(A=>{const E=A.data.filter(k=>!k.name.includes("/"));l(zm(E))}).catch(A=>{console.error(A),C(),l([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{d(!0),b.football.getTeams({name:A,scope:E}).then(k=>{const $=k.data.filter(G=>!G.name.includes("/"));u([...zm($)]),d(!1)}).catch(k=>{console.error(k),C(),u([]),d(!1)})},300),[]);y.useEffect(()=>{if(!p||p.length<x){u([]);return}return I(p,n),()=>I.cancel()},[p,I]);const w=(A,E)=>A.map((k,$)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:G=>E({index:$}).onClick(G),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:k},`option_${k.id}`)},k.id));return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.Autocomplete,{readOnly:r||!1,forcePopupIcon:!1,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,marginBottom:i?1:0}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:a.length>0?"":e.teamsSelectionPlaceholder,options:c,filterOptions:A=>A.filter(E=>!a.some(k=>k.value===E.value)),onInputChange:(A,E)=>{g(E)},onChange:S,getOptionKey:A=>A.id,value:a,renderTags:w,renderOption:(A,E)=>s.jsx(h.AutocompleteOption,Q(M({},A),{children:s.jsx(kn,{option:E})}))}),i]}),s.jsx(Ye,{showToast:v,message:e.searchTeamsErrorMessage,color:"danger",hideToast:C})]})},n2=({checked:e,disabled:t,sx:n,onChange:r})=>{const i=n?M({},n):{ml:1};return s.jsx(h.Switch,{color:e?"success":"danger",checked:e,disabled:t,onChange:o=>r(o.target.checked),sx:Q(M({},i),{"--Switch-thumbSize":"16px","--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-trackBackground":"#EE5E52","&:hover":{"--Switch-trackBackground":"#EE5E52"},[`&.${h.switchClasses.checked}`]:{"--Switch-trackBackground":"#5CB176","&:hover":{"--Switch-trackBackground":"#5CB176"}}})})},mn=({label:e,labelPosition:t="start",defaultValue:n,description:r,disabled:i,descriptionColor:o,sx:a,onChange:l})=>{const c=s.jsx(n2,{checked:n,disabled:i,onChange:l,sx:a==null?void 0:a.switch}),u=a!=null&&a.container?M({},a.container):{mb:2},f=a!=null&&a.label?M({},a.label):{};return r?s.jsxs(h.Box,{sx:M({},u),children:[s.jsx(h.Typography,{component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,sx:f,children:e}),s.jsx(h.Typography,{level:"body-sm",color:o||"neutral",children:r})]}):s.jsx(h.Typography,{sx:Object.keys(f)?M({},f):{mb:2},component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,children:e})},r2={control:(e,t)=>Q(M({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px","&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(M({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(M({},e),{minHeight:"36px"}),menu:e=>Q(M({},e),{position:"relative"}),clearIndicator:e=>Q(M({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(M({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(M({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(M({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"13px"}),multiValueLabel:e=>Q(M({},e),{color:"#333"})},i2=e=>e.map(t=>({label:t,value:t})),Um=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=i2(e.tags),a=()=>i(!r),l=d=>{e.onChange(d.map(p=>p.value))},c=d=>{n(d)},u=d=>{d.persist();const{key:p}=d;if(t)switch(p){case"Enter":case"Tab":if(e.tags&&e.tags.length===0){const g=[...e.tags,t];e.onChange(g)}if(e.tags&&e.tags.length>0&&f()){const g=[...e.tags,t];e.onChange(g)}n(""),d.preventDefault()}},f=()=>{let d=!1;return e.tags&&e.tags.length&&e.tags.includes(t)?(a(),d):(d=!0,d)};return s.jsxs(s.Fragment,{children:[s.jsx(xm,{styles:r2,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:l,onInputChange:c,onKeyDown:u,placeholder:e.labels.tagsPlaceholder,value:o}),s.jsx(Ye,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:a})]})},o2=$e(s.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");class Vm{constructor(){J(this,"contestId","");J(this,"contestType","");J(this,"description","");J(this,"userList",[])}}const a2=(e,t,n)=>{const[r,i]=y.useState(null),{sdk:o}=Ge(),a=()=>_(this,null,function*(){try{let l;switch(t){case"top_x":l=yield o.topX.getGameWinners(e,!0);break;case"match_quiz":l=yield o.matchQuiz.getGameWinners(e,!0);break;default:l=yield o.loyalty.getTemplateWinners(e,!0)}l.userList&&l.userList.forEach(c=>{c.tags||(c.tags=[])}),i(l)}catch(l){const c=o.helpers.getSDKConfiguration();let u=null;c.errorHandlingMode==="standard"?u=l.error:u=l.data.error,u.code!==404&&u.status!=="code_unknown_contest"&&n(),i(new Vm)}});return y.useEffect(()=>{a()},[]),r};class s2{constructor(){J(this,"position","");J(this,"profileId","");J(this,"note","");J(this,"tags",[])}}function l2(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var c2=l2,u2=Array.isArray,d2=u2,Hm=Au,f2=c2,h2=d2,p2=Rm,g2=1/0,Wm=Hm?Hm.prototype:void 0,Gm=Wm?Wm.toString:void 0;function Ym(e){if(typeof e=="string")return e;if(h2(e))return f2(e,Ym)+"";if(p2(e))return Gm?Gm.call(e):"";var t=e+"";return t=="0"&&1/e==-g2?"-0":t}var m2=Ym,v2=m2;function b2(e){return e==null?"":v2(e)}var Km=b2;function y2(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var x2=y2;function C2(e){return function(t){return e==null?void 0:e[t]}}var w2=C2,S2=w2,I2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},A2=S2(I2),T2=A2,E2=T2,k2=Km,_2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,P2="\\u0300-\\u036f",D2="\\ufe20-\\ufe2f",O2="\\u20d0-\\u20ff",R2=P2+D2+O2,L2="["+R2+"]",M2=RegExp(L2,"g");function B2(e){return e=k2(e),e&&e.replace(_2,E2).replace(M2,"")}var $2=B2,F2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function N2(e){return e.match(F2)||[]}var z2=N2,j2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function U2(e){return j2.test(e)}var V2=U2,qm="\\ud800-\\udfff",H2="\\u0300-\\u036f",W2="\\ufe20-\\ufe2f",G2="\\u20d0-\\u20ff",Y2=H2+W2+G2,Qm="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",K2="\\xac\\xb1\\xd7\\xf7",q2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Q2="\\u2000-\\u206f",J2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",X2="\\ufe0e\\ufe0f",Zm=K2+q2+Q2+J2,ev="['’]",tv="["+Zm+"]",Z2="["+Y2+"]",nv="\\d+",eB="["+Qm+"]",rv="["+Jm+"]",iv="[^"+qm+Zm+nv+Qm+Jm+Xm+"]",tB="\\ud83c[\\udffb-\\udfff]",nB="(?:"+Z2+"|"+tB+")",rB="[^"+qm+"]",ov="(?:\\ud83c[\\udde6-\\uddff]){2}",av="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+Xm+"]",iB="\\u200d",sv="(?:"+rv+"|"+iv+")",oB="(?:"+xi+"|"+iv+")",lv="(?:"+ev+"(?:d|ll|m|re|s|t|ve))?",cv="(?:"+ev+"(?:D|LL|M|RE|S|T|VE))?",uv=nB+"?",dv="["+X2+"]?",aB="(?:"+iB+"(?:"+[rB,ov,av].join("|")+")"+dv+uv+")*",sB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",cB=dv+uv+aB,uB="(?:"+[eB,ov,av].join("|")+")"+cB,dB=RegExp([xi+"?"+rv+"+"+lv+"(?="+[tv,xi,"$"].join("|")+")",oB+"+"+cv+"(?="+[tv,xi+sv,"$"].join("|")+")",xi+"?"+sv+"+"+lv,xi+"+"+cv,lB,sB,nv,uB].join("|"),"g");function fB(e){return e.match(dB)||[]}var hB=fB,pB=z2,gB=V2,mB=Km,vB=hB;function bB(e,t,n){return e=mB(e),t=n?void 0:t,t===void 0?gB(e)?vB(e):pB(e):e.match(t)||[]}var yB=bB,xB=x2,CB=$2,wB=yB,SB="['’]",IB=RegExp(SB,"g");function AB(e){return function(t){return xB(wB(CB(t).replace(IB,"")),e,"")}}var TB=AB,EB=TB,kB=EB(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),_B=kB;const PB=yn(_B);class DB{constructor(){J(this,"id","");J(this,"value","");J(this,"label","")}}class OB extends DB{constructor(){super(...arguments);J(this,"logo","");J(this,"countryFlag","");J(this,"countryName","")}}class fv extends OB{constructor(){super(...arguments);J(this,"group","")}}const RB=(e,t)=>t||e||"-------------",Eu=(e,t)=>Array.isArray(e)?e.map(n=>Eu(n)):e!=null&&e.constructor===Object?Object.keys(e).reduce((n,r)=>Q(M({},n),{[PB(r)]:Eu(e[r])}),{}):e,hv=e=>{const t=[];return e.competitions.forEach(n=>{t.push(ku(n,"competition"))}),e.teams.forEach(n=>{t.push(ku(n,"team"))}),e.players.forEach(n=>{t.push(ku(n,"player"))}),t},ku=(e,t)=>{var r,i,o,a,l;const n=new fv;return n.label=e.name,n.value=e.id,n.id=e.id,n.group=t,t==="player"?n.logo=((r=e.assets)==null?void 0:r.headshot)||Be.avatar:t==="team"?n.logo=((i=e.assets)==null?void 0:i.logo)||Be.team:n.logo=((o=e.assets)==null?void 0:o.logo)||Be.competition,n.countryName=e.country.name,n.countryFlag=((l=(a=e.country)==null?void 0:a.assets)==null?void 0:l.flag)||Be.country,n},LB=e=>{switch(e){case"CLASSIC_QUIZ":return"success";case"EITHER_OR":return"success";case"POLL":return"warning";case"TOP_X":return"primary";case"MATCH_QUIZ":return"primary";case"LEADERBOARD_TEMPLATES":return"neutral";default:return"neutral"}},MB=e=>{switch(e){case"CLASSIC_QUIZ":return"CLASSIC QUIZ";case"EITHER_OR":return"EITHER/OR";case"POLL":return"POLL";case"TOP_X":return"TOP X";case"MATCH_QUIZ":return"MATCH QUIZ";case"LEADERBOARD_TEMPLATES":return"LEADERBOARD TEMPLATES"}},BB=({profile:e,winner:t,labels:n,onChange:r,onRemove:i})=>{var b,C,S,x,I,w;const[o,a]=y.useState(t.position),[l,c]=y.useState(t.note),[u,f]=y.useState(t.tags),d=o||l||u.length>0,p=A=>{A.persist();const{value:E}=A.target;a(E),r("position",E)},g=A=>{A.persist();const{value:E}=A.target;c(E),r("note",E)},v=A=>{f(A),r("tags",A)},m=()=>{a(""),c(""),f([]),i()};return s.jsxs("tr",{style:{backgroundColor:d?"rgb(255 237 213)":""},children:[s.jsx("td",{children:s.jsx(h.Input,{name:"position",placeholder:"#",value:o,onChange:p,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Avatar,{src:((b=e.profileModel)==null?void 0:b.avatar)||"",alt:((C=e.profileModel)==null?void 0:C.name)||"Unknown",sx:{mr:1}}),s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{fontWeight:"md",children:[RB((S=e.profileModel)==null?void 0:S.name,(x=e.profileModel)==null?void 0:x.nickname),"  ",(I=e.profileModel)!=null&&I.name?s.jsxs(h.Typography,{children:["(",(w=e.profileModel)==null?void 0:w.name,")"]}):s.jsx(s.Fragment,{})]}),s.jsx(h.Typography,{fontSize:"sm",sx:{opacity:"0.5"},children:e.profileModel&&e.profileModel.country?e.profileModel.country.name:""})]})]})}),s.jsx("td",{style:{textAlign:"center"},children:e.points}),s.jsx("td",{style:{textAlign:"center"},children:e.predictionsMade}),s.jsx("td",{children:s.jsx(h.Input,{name:"note",value:l,placeholder:"This user has...",onChange:g,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsx(Um,{labels:n,tags:u,onChange:v})}),s.jsx("td",{children:s.jsx(h.Tooltip,{title:n.clearWinner,children:s.jsx(h.IconButton,{onClick:m,variant:"outlined",color:"danger",disabled:!d,children:s.jsx(_e.Remove,{})})})})]})},$B=e=>{const t=(i,o,a)=>{if(e.winners.find(f=>f.profileId===i)){const f=e.winners.map(d=>d.profileId===i?Q(M({},d),{[o]:a}):d);r(f);return}const c=new s2;c.profileId=i,c[o]=a;const u=[...e.winners,c];r(u)},n=i=>{const o=e.winners.filter(a=>a.profileId!==i);r(o)},r=i=>{e.setWinnersRequestBody(o=>Q(M({},o),{userList:i}))};return e.leaderboard?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"h4",children:e.labels.configureWinners}),e.leaderboard.length===0?s.jsx(h.Typography,{level:"body-lg",textAlign:"center",fontWeight:"bold",children:e.labels.noStandingsAvailable}):s.jsx(s.Fragment,{}),s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:last-child, & > tbody > tr > td:last-child":{textAlign:"center",width:"50px"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"70px"},children:e.labels.position}),s.jsx("th",{children:e.labels.nicknameAndName}),s.jsx("th",{style:{width:"70px",textAlign:"center"},children:e.labels.points}),s.jsx("th",{style:{width:"100px",textAlign:"center"},children:e.labels.predictions}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags}),s.jsx("th",{children:e.labels.actions})]})}),s.jsxs("tbody",{children:[e.leaderboard.length>0?e.leaderboard.map(i=>s.jsx(BB,{winner:e.winners.find(o=>o.profileId===i.profileId)||{position:"",profileId:"",note:"",tags:[]},profile:i,labels:e.labels,onChange:(o,a)=>t(i.profileId,o,a),onRemove:()=>n(i.profileId)},`winner-profile-${i.profileId}`)):s.jsx(s.Fragment,{}),s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:e.hasMoreParticipants?s.jsx(h.Box,{textAlign:"center",my:1,children:s.jsx(h.Button,{variant:"plain",sx:{width:"100%"},onClick:()=>e.setPage(i=>i+1),loading:e.isLoading,children:e.labels.loadMore})}):s.jsx(s.Fragment,{})})})]})]})]}):s.jsx(yi,{my:40})},FB=(e,t,n,r,i)=>{const[o,a]=y.useState(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),{sdk:d}=Ge(),p=()=>_(this,null,function*(){f(!0);const g={limit:10,page:r},v=!0;try{let m;t==="template"?m=yield d.loyalty.getLeaderboard(e,g,v):m=yield d.loyalty.getLeaderboardForGame(e,g,v),m.meta.pagination.numberOfPages>r?c(!0):c(!1),o&&o.length?a(b=>[...b,...m.data]):a(m.data)}catch(m){console.error(m),i("danger",n),a([])}f(!1)});return y.useEffect(()=>{p()},[r]),{leaderboard:o,hasMoreParticipants:l,isLeaderboardLoading:u}};class NB{constructor(){J(this,"isValid",!0);J(this,"message","");J(this,"validate",(t,n,r)=>(this.validateField(t,n),this.validateWinnerIds(t,r),this));J(this,"validateField",(t,n)=>{const r=t.every(i=>i.position&&i.profileId);r||(this.isValid=r,this.message=n)});J(this,"validateWinnerIds",(t,n)=>{const r=t.map(o=>o.profileId),i=new Set(r);r.length!==i.size&&(this.isValid=!1,this.message=n)})}}const zB=e=>{const t=e.winners.userList.length>0&&(e.winners.userList[0].position||e.winners.userList[0].profileId||e.winners.userList[0].note||e.winners.userList[0].tags.length);return s.jsx(h.Card,{variant:"plain",children:t?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-lg",mb:2,fontWeight:"bold",children:e.labels.preview}),s.jsx(h.Sheet,{children:s.jsxs(h.Table,{sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"& > thead > tr > th:nth-of-type(3), & > thead > tr > th:nth-of-type(4), & > tbody > tr > td:nth-of-type(3), & > tbody > tr > td:nth-of-type(4)":{fontSize:"sm",display:{xs:"none",md:"table-cell"}}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"3%"},children:"#"}),s.jsx("th",{children:e.labels.name}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags})]})}),s.jsx("tbody",{children:e.winners.userList.map(n=>{var i;const r=e.profiles.find(o=>o.id===n.profileId);return s.jsxs("tr",{children:[s.jsx("td",{children:n.position}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:2,children:[s.jsx(h.Avatar,{src:(r==null?void 0:r.avatar)||"",alt:(r==null?void 0:r.name)||"Unknown"}),s.jsxs(h.Box,{textAlign:"left",children:[s.jsxs(h.Typography,{fontWeight:"bold",children:[(r==null?void 0:r.nickname)||"-------------"," ",s.jsxs(h.Typography,{children:["(",(r==null?void 0:r.name)||"-------------",")"]})]}),s.jsx(h.Typography,{fontSize:"sm",color:"neutral",children:(i=r==null?void 0:r.country)==null?void 0:i.name})]})]})}),s.jsx("td",{children:n.note}),s.jsx("td",{children:n.tags.map(o=>s.jsx(h.Chip,{variant:"soft",color:"neutral",size:"sm",sx:{mr:1},children:o},`preview-winner-${n.profileId}-tag-${o}`))})]},`preview-winner-${n.profileId}`)})})]})})]}):s.jsx(h.Typography,{textAlign:"center",fontWeight:"bold",children:e.labels.noSetWinnersMessage})})},jB=e=>Object.keys(e).length?(e.userList||(e.userList=[]),e):new Vm,UB=e=>{var w;const[t,n]=y.useState(jB(e.winners)),[r,i]=y.useState(((w=e.winners)==null?void 0:w.description)||""),[o,a]=y.useState(!1),[l,c]=y.useState(1),[u,f]=y.useState(!1),[d,p]=y.useState("danger"),[g,v]=y.useState(""),m=(A,E)=>{p(A),v(E),f(!0)},{leaderboard:b,hasMoreParticipants:C,isLeaderboardLoading:S}=FB(e.entityId,e.entityType,e.labels.leaderboardErrorMessage,l,m),{https:x}=Ge(),I=()=>_(this,null,function*(){a(!0);const A=JSON.parse(JSON.stringify(t));if(A.contestId=e.entityId,A.contestType=e.entityType==="template"?"TEMPLATE":"GAME",A.description=r,delete A.contestModel,A.userList.length>0){const k=new NB().validate(A.userList,e.labels.positionAndWinnerRequiredMessage,e.labels.sameChosenWinnerMessage);if(!k.isValid){m("danger",k.message),a(!1);return}}else delete A.userList;const E=Eu(A);try{yield x.setWinners(E),m("success",Object.keys(e.winners).length?e.labels.editWinnersMessage:e.labels.createWinnersMessage)}catch(k){console.error(k),m("danger",Object.keys(e.winners).length?e.labels.editWinnersErrorMessage:e.labels.createWinnersErrorMessage)}a(!1)});return s.jsxs(s.Fragment,{children:[s.jsx("section",{style:{marginRight:"auto",marginLeft:"auto"},children:s.jsx(h.Box,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:s.jsxs(h.Box,{width:"100%",sx:{overflowX:"auto"},children:[s.jsxs(h.Card,{variant:"plain",children:[s.jsx(Sc,{property:"description",label:e.labels.description,defaultValue:r,placeholder:e.labels.winnersDescription,onChange:A=>{i(A)}}),s.jsx($B,{winners:t.userList,leaderboard:b,hasMoreParticipants:C,isLoading:S,setPage:c,setWinnersRequestBody:n,labels:e.labels}),s.jsx(h.Box,{textAlign:"center",my:3,children:s.jsx(h.Button,{variant:"solid",color:"primary",onClick:I,loading:o,children:e.labels.save})}),s.jsx(h.Divider,{sx:{my:4}})]}),b?s.jsx(zB,{winners:t,profiles:b.map(A=>A.profileModel),labels:e.labels}):s.jsx(s.Fragment,{})]})})}),s.jsx(Ye,{showToast:u,color:d,message:g,hideToast:()=>f(!1)})]})},VB=e=>{const[t,n]=y.useState(!1),r=()=>n(!0),i=a2(e.entityId,e.entityType,r);return i?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{p:2,children:[s.jsx(h.Typography,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:s.jsx(o2,{fontSize:"inherit"}),onClick:e.onClickBack,children:e.labels.back}),s.jsxs(h.Typography,{level:"h3",children:[e.labels.manageWinners,":"," ",s.jsx(h.Typography,{level:"title-lg",fontWeight:"italic",children:e.entityName})]})]}),s.jsx(UB,{labels:e.labels,winners:i,entityId:e.entityId,entityType:e.entityType}),s.jsx(Ye,{showToast:t,color:"danger",message:e.labels.winnersErrorMessage,hideToast:()=>n(!1)})]}):s.jsx(yi,{my:50})},HB=10,WB=e=>{var d;const[t,n]=y.useState([]),[r,i]=y.useState(!1),[o,a]=y.useState(""),{sdk:l}=Ge(),c=y.useMemo(()=>cr(p=>{if(!p){n([]),i(!1);return}i(!0),l.football.search({query:p}).then(g=>{n([...hv(g)]),i(!1)}).catch(g=>{console.error(g),n([]),i(!1)})},300),[]);y.useEffect(()=>(c(o),()=>c.cancel()),[o,c]);const u=(p,g)=>{const v=g.map(m=>m.id);e.setOptions(g),e.handleResetData(),e.setFilters(m=>Q(M({},m),{entityIds:v}))},f=(p,g)=>p.map((v,m)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:b=>g({index:m}).onClick(b),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:v},`option_${v.id}`)},v.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{sx:{fontSize:12},color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>e.options.length===HB,forcePopupIcon:!1,multiple:!0,loading:r,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(p,g)=>p.id===g.id,endDecorator:r?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.options.length>0?"":e.labels.typeContextTagNamePlaceholder,options:t,filterOptions:p=>p.filter(g=>!e.options.some(v=>v.value===g.value)),onInputChange:(p,g)=>{a(g)},onChange:u,getOptionKey:p=>p.id,groupBy:p=>p.group+"s",value:(d=e.options)!=null?d:[],renderTags:f,renderOption:(p,g)=>s.jsx(h.AutocompleteOption,Q(M({},p),{children:s.jsx(kn,{option:g})}))})]})};function pv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Eo;(function(e){e.event="event",e.props="prop"})(Eo||(Eo={}));function ur(){}function GB(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,a){return o===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function ko(e){return!!(e||"").match(/\d/)}function Ci(e){return e==null}function YB(e){return typeof e=="number"&&isNaN(e)}function gv(e){return Ci(e)||YB(e)||typeof e=="number"&&!isFinite(e)}function mv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function KB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function qB(e,t,n){var r=KB(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function QB(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function _u(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNegation:n,addNegation:r}}function JB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function vv(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function bv(e,t){return Array(t+1).join(e)}function yv(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var a=1+o,l=i.length;return a<0?i="0."+bv("0",Math.abs(a))+i:a>=l?i=i+bv("0",a-l):i=(i.substring(0,a)||"0")+"."+i.substring(a),n+i}function xv(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=_u(e),o=i.beforeDecimal,a=i.afterDecimal,l=i.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),f=u.split("."),d=o;o&&Number(f[0])&&(d=o.split("").reverse().reduce(function(m,b,C){return m.length>C?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},f[0]));var p=vv(f[1]||"",t,n),g=l?"-":"",v=r?".":"";return""+g+d+v+p}function Or(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Cv=GB(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),XB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function ZB(e,t,n){return Math.min(Math.max(e,t),n)}function Pu(e){return Math.max(e.selectionStart,e.selectionEnd)}function e$(){return typeof navigator!="undefined"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function t$(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function n$(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function r$(e,t,n,r,i,o,a){a===void 0&&(a=n$);var l=i.findIndex(function(I){return I}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,f=e.length,d={},p=new Array(u),g=0;g<u;g++){p[g]=-1;for(var v=0,m=f;v<m;v++){var b=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:v});if(b&&d[v]!==!0){p[g]=v,d[v]=!0;break}}}for(var C=r;C<u&&(p[C]===-1||!o(n[C]));)C++;var S=C===u||p[C]===-1?f:p[C];for(C=r-1;C>0&&p[C]===-1;)C--;var x=C===-1||p[C]===-1?0:p[C]+1;return x>S?S:r-x<S-r?x:S}function wv(e,t,n,r){var i=e.length;if(t=ZB(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function i$(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ko(e[n])||ko(e[n-1]));return t}function Sv(e,t,n,r,i,o){o===void 0&&(o=ur);var a=QB(function(v,m){var b,C;return gv(v)?(C="",b=""):typeof v=="number"||m?(C=typeof v=="number"?yv(v):v,b=r(C)):(C=i(v,void 0),b=r(C)),{formattedValue:b,numAsString:C}}),l=y.useState(function(){return a(Ci(e)?t:e,n)}),c=l[0],u=l[1],f=function(v,m){v.formattedValue!==c.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),o(v,m)},d=e,p=n;Ci(e)&&(d=c.numAsString,p=!0);var g=a(d,p);return y.useMemo(function(){u(g)},[g.formattedValue]),[c,f]}function o$(e){return e.replace(/[^0-9]/g,"")}function a$(e){return e}function s$(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,a=e.format;a===void 0&&(a=a$);var l=e.removeFormatting;l===void 0&&(l=o$);var c=e.defaultValue,u=e.valueIsNumericString,f=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=ur);var g=e.onKeyDown;g===void 0&&(g=ur);var v=e.onMouseUp;v===void 0&&(v=ur);var m=e.onFocus;m===void 0&&(m=ur);var b=e.onBlur;b===void 0&&(b=ur);var C=e.value,S=e.getCaretBoundary;S===void 0&&(S=i$);var x=e.isValidInputCharacter;x===void 0&&(x=ko);var I=e.isCharacterSame,w=pv(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=Sv(C,c,!!u,a,l,f),E=A[0],k=E.formattedValue,$=E.numAsString,G=A[1],O=y.useRef(),T=y.useRef({formattedValue:k,numAsString:$}),F=function(he,ge){T.current={formattedValue:he.formattedValue,numAsString:he.value},G(he,ge)},H=y.useState(!1),j=H[0],N=H[1],L=y.useRef(null),V=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return N(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var Y=a,X=function(he,ge){var xe=parseFloat(ge);return{formattedValue:he,value:ge,floatValue:isNaN(xe)?void 0:xe}},D=function(he,ge,xe){he.selectionStart===0&&he.selectionEnd===he.value.length||(Or(he,ge),V.current.setCaretTimeout=setTimeout(function(){he.value===xe&&he.selectionStart!==ge&&Or(he,ge)},0))},B=function(he,ge,xe){return wv(he,ge,S(he),xe)},U=function(he,ge,xe){var ke=S(ge),Ke=r$(ge,k,he,xe,ke,x,I);return Ke=wv(ge,Ke,ke),Ke},W=function(he){var ge=he.formattedValue;ge===void 0&&(ge="");var xe=he.input,ke=he.source,Ke=he.event,Oe=he.numAsString,Pe;if(xe){var St=he.inputValue||xe.value,It=Pu(xe);xe.value=ge,Pe=U(St,ge,It),Pe!==void 0&&D(xe,Pe,ge)}ge!==k&&F(X(ge,Oe),{event:Ke,source:ke})};y.useEffect(function(){var he=T.current,ge=he.formattedValue,xe=he.numAsString;(k!==ge||$!==xe)&&F(X(k,$),{event:void 0,source:Eo.props})},[k,$]);var ie=L.current?Pu(L.current):void 0,se=typeof window!="undefined"?y.useLayoutEffect:y.useEffect;se(function(){var he=L.current;if(k!==T.current.formattedValue&&he){var ge=U(T.current.formattedValue,k,ie);he.value=k,D(he,ge,k)}},[k]);var oe=function(he,ge,xe){var ke=ge.target,Ke=O.current?XB(O.current,ke.selectionEnd):Cv(k,he),Oe=Object.assign(Object.assign({},Ke),{lastValue:k}),Pe=l(he,Oe),St=Y(Pe);if(Pe=l(St,void 0),d&&!d(X(St,Pe))){var It=ge.target,Bt=Pu(It),Dt=U(he,k,Bt);return It.value=k,D(It,Dt,k),!1}return W({formattedValue:St,numAsString:Pe,inputValue:he,event:ge,source:xe,input:ge.target}),!0},Z=function(he,ge){ge===void 0&&(ge=0);var xe=he.selectionStart,ke=he.selectionEnd;O.current={selectionStart:xe,selectionEnd:ke+ge}},te=function(he){var ge=he.target,xe=ge.value,ke=oe(xe,he,Eo.event);ke&&p(he),O.current=void 0},ne=function(he){var ge=he.target,xe=he.key,ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe;xe==="ArrowLeft"||xe==="Backspace"?Pe=Math.max(ke-1,0):xe==="ArrowRight"?Pe=Math.min(ke+1,Oe.length):xe==="Delete"&&(Pe=ke);var St=0;xe==="Delete"&&ke===Ke&&(St=1);var It=xe==="ArrowLeft"||xe==="ArrowRight";if(Pe===void 0||ke!==Ke&&!It){g(he),Z(ge,St);return}var Bt=Pe;if(It){var Dt=xe==="ArrowLeft"?"left":"right";Bt=B(Oe,Pe,Dt),Bt!==Pe&&he.preventDefault()}else xe==="Delete"&&!x(Oe[Pe])?Bt=B(Oe,Pe,"right"):xe==="Backspace"&&!x(Oe[Pe])&&(Bt=B(Oe,Pe,"left"));Bt!==Pe&&D(ge,Bt,Oe),g(he),Z(ge,St)},ue=function(he){var ge=he.target,xe=function(){var ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;if(Oe===void 0&&(Oe=""),ke===Ke){var Pe=B(Oe,ke);Pe!==ke&&D(ge,Pe,Oe)}};xe(),requestAnimationFrame(function(){xe()}),v(he),Z(ge)},be=function(he){he.persist&&he.persist();var ge=he.target,xe=he.currentTarget;L.current=ge,V.current.focusTimeout=setTimeout(function(){var ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe=B(Oe,ke);Pe!==ke&&!(ke===0&&Ke===Oe.length)&&D(ge,Pe,Oe),m(Object.assign(Object.assign({},he),{currentTarget:xe}))},0)},Ne=function(he){L.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),b(he)},ht=j&&e$()?"numeric":void 0,Je=Object.assign({inputMode:ht},w,{type:t,value:k,onChange:te,onKeyDown:ne,onMouseUp:ue,onFocus:be,onBlur:Ne});if(n==="text")return i?y.createElement(y.Fragment,null,i(k,w)||null):y.createElement("span",Object.assign({},w,{ref:o}),k);if(r){var _t=r;return y.createElement(_t,Object.assign({},Je,{ref:o}))}return y.createElement("input",Object.assign({},Je,{ref:o}))}function Iv(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Es(t),u=c.thousandSeparator,f=c.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,p=_u(e,a),g=p.beforeDecimal,v=p.afterDecimal,m=p.addNegation;return n!==void 0&&(v=vv(v,n,!!r)),u&&(g=qB(g,u,l)),i&&(g=i+g),o&&(v=v+o),m&&(g="-"+g),e=g+(d&&f||"")+v,e}function Es(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function l$(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function c$(e,t){return new RegExp("(^-)|[0-9]|"+mv(e),"g")}function u$(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function d$(e,t,n){var r;t===void 0&&(t=t$(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,f=u.start,d=u.end,p=Es(n),g=p.allowedDecimalSeparators,v=p.decimalSeparator,m=e[d]===v;if(ko(e)&&(e===o||e===a)&&t.lastValue==="")return e;if(d-f===1&&g.indexOf(e[f])!==-1){var b=l===0?"":v;e=e.substring(0,f)+b+e.substring(f+1,e.length)}var C=function(L,V,Y){var X=!1,D=!1;o.startsWith("-")?X=!1:L.startsWith("--")?(X=!1,D=!0):a.startsWith("-")&&L.length===a.length?X=!1:L[0]==="-"&&(X=!0);var B=X?1:0;return D&&(B=2),B&&(L=L.substring(B),V-=B,Y-=B),{value:L,start:V,end:Y,hasNegation:X}},S=C(e,f,d),x=S.hasNegation;r=S,e=r.value,f=r.start,d=r.end;var I=C(t.lastValue,c.start,c.end),w=I.start,A=I.end,E=I.value,k=e.substring(f,d);e.length&&E.length&&(w>E.length-a.length||A<o.length)&&!(k&&a.startsWith(k))&&(e=E);var $=0;e.startsWith(o)?$+=o.length:f<o.length&&($=f),e=e.substring($),d-=$;var G=e.length,O=e.length-a.length;e.endsWith(a)?G=O:(d>O||d>e.length-a.length)&&(G=d),e=e.substring(0,G),e=l$(x?"-"+e:e,i),e=(e.match(c$(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(mv(v),"g"),function(L,V){return V===T?".":""});var F=_u(e,i),H=F.beforeDecimal,j=F.afterDecimal,N=F.addNegation;return u.end-u.start<c.end-c.start&&H===""&&m&&!parseFloat(j)&&(e=N?"-":""),e}function f$(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var a=e.length;return i.fill(!1,a-r.length+1,a+1),i}function h$(e){var t=Es(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
2463
+ `]))),mO=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},fu=function(t){var n=t.delay,r=t.offset;return me.jsx("span",{css:me.css({animation:"".concat(gO," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},vO=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=En(t,sO);return me.jsx("div",R({},lt(ye(ye({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),me.jsx(fu,{delay:0,offset:r}),me.jsx(fu,{delay:160,offset:!0}),me.jsx(fu,{delay:320,offset:!r}))},bO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,c=o.spacing;return ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},yO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return me.jsx("div",R({ref:o},lt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},xO=yO,CO=["data"],wO=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},SO=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,f=t.theme,d=t.selectProps;return me.jsx("div",R({},lt(t,"group",{group:!0}),c),me.jsx(a,R({},l,{selectProps:d,theme:f,getStyles:i,getClassNames:o,cx:r}),u),me.jsx("div",null,n))},IO=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return ye({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},AO=function(t){var n=Rg(t);n.data;var r=En(n,CO);return me.jsx("div",R({},lt(t,"groupHeading",{"group-heading":!0}),r))},TO=SO,EO=["innerRef","isDisabled","isHidden","inputClassName"],kO=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return ye(ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},_O),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},Wg={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},_O={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Wg)},PO=function(t){return ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Wg)},DO=function(t){var n=t.cx,r=t.value,i=Rg(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,c=i.inputClassName,u=En(i,EO);return me.jsx("div",R({},lt(t,"input",{"input-container":!0}),{"data-value":r||""}),me.jsx("input",R({className:n({input:!0},c),ref:o,style:PO(l),disabled:a},u)))},OO=DO,RO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},LO=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},MO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Gg=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",r,n)},BO=Gg,$O=Gg;function FO(e){var t=e.children,n=e.innerProps;return me.jsx("div",R({role:"button"},n),t||me.jsx(du,{size:14}))}var NO=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,f=r.Label,d=r.Remove;return me.jsx(u,{data:i,innerProps:ye(ye({},lt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},me.jsx(f,{data:i,innerProps:ye({},lt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),me.jsx(d,{data:i,innerProps:ye(ye({},lt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},zO=NO,jO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,c=a.colors;return ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?c.primary:c.primary50}})},UO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return me.jsx("div",R({},lt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},VO=UO,HO=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},WO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},lt(t,"placeholder",{placeholder:!0}),r),n)},GO=WO,YO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},KO=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return me.jsx("div",R({},lt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},qO=KO,QO={ClearIndicator:fO,Control:xO,DropdownIndicator:uO,DownChevron:Vg,CrossIcon:du,Group:TO,GroupHeading:AO,IndicatorsContainer:oO,IndicatorSeparator:pO,Input:OO,LoadingIndicator:vO,Menu:WD,MenuList:YD,MenuPortal:ZD,LoadingMessage:JD,NoOptionsMessage:QD,MultiValue:zO,MultiValueContainer:BO,MultiValueLabel:$O,MultiValueRemove:FO,Option:VO,Placeholder:GO,SelectContainer:tO,SingleValue:qO,ValueContainer:rO},JO=function(t){return ye(ye({},QO),t.components)},Yg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function XO(e,t){return!!(e===t||Yg(e)&&Yg(t))}function ZO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!XO(e[n],t[n]))return!1;return!0}function eR(e,t){t===void 0&&(t=ZO);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}for(var tR={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},nR=function(t){return me.jsx("span",R({css:tR},t))},Kg=nR,rR={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,c=t.isDisabled,u=t.isSelected,f=t.isAppleDevice,d=function(m,b){return m&&m.length?"".concat(m.indexOf(b)+1," of ").concat(m.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&f){var p=c?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(a).concat(g,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},iR=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,f=t.isAppleDevice,d=c.ariaLiveMessages,p=c.getOptionLabel,g=c.inputValue,v=c.isMulti,m=c.isOptionDisabled,b=c.isSearchable,C=c.menuIsOpen,S=c.options,x=c.screenReaderStatus,I=c.tabSelectsValue,w=c.isLoading,A=c["aria-label"],E=c["aria-live"],k=y.useMemo(function(){return ye(ye({},rR),d||{})},[d]),$=y.useMemo(function(){var j="";if(n&&k.onChange){var N=n.option,M=n.options,V=n.removedValue,Y=n.removedValues,X=n.value,D=function(Z){return Array.isArray(Z)?null:Z},B=V||N||D(X),U=B?p(B):"",W=M||Y||void 0,ie=W?W.map(p):[],se=ye({isDisabled:B&&m(B,l),label:U,labels:ie},n);j=k.onChange(se)}return j},[n,k,m,l,p]),G=y.useMemo(function(){var j="",N=r||i,M=!!(r&&l&&l.includes(r));if(N&&k.onFocus){var V={focused:N,label:p(N),isDisabled:m(N,l),isSelected:M,options:o,context:N===r?"menu":"value",selectValue:l,isAppleDevice:f};j=k.onFocus(V)}return j},[r,i,p,m,k,o,l,f]),O=y.useMemo(function(){var j="";if(C&&S.length&&!w&&k.onFilter){var N=x({count:o.length});j=k.onFilter({inputValue:g,resultsMessage:N})}return j},[o,g,C,k,S,x,w]),T=(n==null?void 0:n.action)==="initial-input-focus",F=y.useMemo(function(){var j="";if(k.guidance){var N=i?"value":C?"menu":"input";j=k.guidance({"aria-label":A,context:N,isDisabled:r&&m(r,l),isMulti:v,isSearchable:b,tabSelectsValue:I,isInitialFocus:T})}return j},[A,r,i,v,m,b,C,k,l,I,T]),H=me.jsx(y.Fragment,null,me.jsx("span",{id:"aria-selection"},$),me.jsx("span",{id:"aria-focused"},G),me.jsx("span",{id:"aria-results"},O),me.jsx("span",{id:"aria-guidance"},F));return me.jsx(y.Fragment,null,me.jsx(Kg,{id:u},T&&H),me.jsx(Kg,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&H))},oR=iR,hu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],aR=new RegExp("["+hu.map(function(e){return e.letters}).join("")+"]","g"),qg={},pu=0;pu<hu.length;pu++)for(var gu=hu[pu],mu=0;mu<gu.letters.length;mu++)qg[gu.letters[mu]]=gu.base;var Qg=function(t){return t.replace(aR,function(n){return qg[n]})},sR=eR(Qg),Jg=function(t){return t.replace(/^\s+|\s+$/g,"")},lR=function(t){return"".concat(t.label," ").concat(t.value)},cR=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=ye({ignoreCase:!0,ignoreAccents:!0,stringify:lR,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,c=i.trim,u=i.matchFrom,f=c?Jg(r):r,d=c?Jg(l(n)):l(n);return o&&(f=f.toLowerCase(),d=d.toLowerCase()),a&&(f=sR(f),d=Qg(d)),u==="start"?d.substr(0,f.length)===f:d.indexOf(f)>-1}},uR=["innerRef"];function dR(e){var t=e.innerRef,n=En(e,uR),r=$D(n,"onExited","in","enter","exit","appear");return me.jsx("input",R({ref:t},r,{css:me.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var fR=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function hR(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=y.useRef(!1),l=y.useRef(!1),c=y.useRef(0),u=y.useRef(null),f=y.useCallback(function(b,C){if(u.current!==null){var S=u.current,x=S.scrollTop,I=S.scrollHeight,w=S.clientHeight,A=u.current,E=C>0,k=I-w-x,$=!1;k>C&&a.current&&(r&&r(b),a.current=!1),E&&l.current&&(o&&o(b),l.current=!1),E&&C>k?(n&&!a.current&&n(b),A.scrollTop=I,$=!0,a.current=!0):!E&&-C>x&&(i&&!l.current&&i(b),A.scrollTop=0,$=!0,l.current=!0),$&&fR(b)}},[n,r,i,o]),d=y.useCallback(function(b){f(b,b.deltaY)},[f]),p=y.useCallback(function(b){c.current=b.changedTouches[0].clientY},[]),g=y.useCallback(function(b){var C=c.current-b.changedTouches[0].clientY;f(b,C)},[f]),v=y.useCallback(function(b){if(b){var C=LD?{passive:!1}:!1;b.addEventListener("wheel",d,C),b.addEventListener("touchstart",p,C),b.addEventListener("touchmove",g,C)}},[g,p,d]),m=y.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",p,!1),b.removeEventListener("touchmove",g,!1))},[g,p,d]);return y.useEffect(function(){if(t){var b=u.current;return v(b),function(){m(b)}}},[t,v,m]),function(b){u.current=b}}var Xg=["boxSizing","height","overflow","paddingRight","position"],Zg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function em(e){e.preventDefault()}function tm(e){e.stopPropagation()}function nm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function rm(){return"ontouchstart"in window||navigator.maxTouchPoints}var im=!!(typeof window!="undefined"&&window.document&&window.document.createElement),So=0,mi={capture:!1,passive:!1};function pR(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=y.useRef({}),o=y.useRef(null),a=y.useCallback(function(c){if(im){var u=document.body,f=u&&u.style;if(r&&Xg.forEach(function(v){var m=f&&f[v];i.current[v]=m}),r&&So<1){var d=parseInt(i.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(Zg).forEach(function(v){var m=Zg[v];f&&(f[v]=m)}),f&&(f.paddingRight="".concat(g,"px"))}u&&rm()&&(u.addEventListener("touchmove",em,mi),c&&(c.addEventListener("touchstart",nm,mi),c.addEventListener("touchmove",tm,mi))),So+=1}},[r]),l=y.useCallback(function(c){if(im){var u=document.body,f=u&&u.style;So=Math.max(So-1,0),r&&So<1&&Xg.forEach(function(d){var p=i.current[d];f&&(f[d]=p)}),u&&rm()&&(u.removeEventListener("touchmove",em,mi),c&&(c.removeEventListener("touchstart",nm,mi),c.removeEventListener("touchmove",tm,mi)))}},[r]);return y.useEffect(function(){if(t){var c=o.current;return a(c),function(){l(c)}}},[t,a,l]),function(c){o.current=c}}var gR=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},mR={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function vR(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=hR({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:c}),f=pR({isEnabled:n}),d=function(g){u(g),f(g)};return me.jsx(y.Fragment,null,n&&me.jsx("div",{onClick:gR,css:mR}),t(d))}var bR={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},yR=function(t){var n=t.name,r=t.onFocus;return me.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:bR,value:"",onChange:function(){}})},xR=yR;function vu(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function CR(){return vu(/^iPhone/i)}function om(){return vu(/^Mac/i)}function wR(){return vu(/^iPad/i)||om()&&navigator.maxTouchPoints>1}function SR(){return CR()||wR()}function IR(){return om()||SR()}var AR=function(t){return t.label},am=function(t){return t.label},sm=function(t){return t.value},TR=function(t){return!!t.isDisabled},ER={clearIndicator:dO,container:eO,control:bO,dropdownIndicator:cO,group:wO,groupHeading:IO,indicatorsContainer:iO,indicatorSeparator:hO,input:kO,loadingIndicator:mO,loadingMessage:qD,menu:UD,menuList:GD,menuPortal:XD,multiValue:RO,multiValueLabel:LO,multiValueRemove:MO,noOptionsMessage:KD,option:jO,placeholder:HO,singleValue:YO,valueContainer:nO},kR={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},_R=4,lm=4,PR=38,DR=lm*2,OR={baseUnit:lm,controlHeight:PR,menuGutter:DR},bu={borderRadius:_R,colors:kR,spacing:OR},RR={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Bg(),captureMenuScroll:!Bg(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:cR(),formatGroupLabel:AR,getOptionLabel:am,getOptionValue:sm,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:TR,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!OD(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function cm(e,t,n,r){var i=pm(e,t,n),o=gm(e,t,n),a=hm(e,t),l=As(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function Is(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return cm(e,a,t,l)}).filter(function(a){return fm(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=cm(e,n,t,r);return fm(e,o)?o:void 0}).filter(MD)}function um(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,gi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function dm(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,gi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function LR(e,t){return um(Is(e,t))}function fm(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!vm(e)||!o)&&mm(e,{label:a,value:l,data:i},r)}function MR(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function BR(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var yu=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},hm=function(t,n){return t.getOptionLabel(n)},As=function(t,n){return t.getOptionValue(n)};function pm(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function gm(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=As(e,t);return n.some(function(i){return As(e,i)===r})}function mm(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var vm=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},$R=1,bm=function(e){pD(n,e);var t=vD(n);function n(r){var i;if(fD(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=IR(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var f=i.props,d=f.onChange,p=f.name;u.name=p,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,f){var d=i.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:f})},i.selectOption=function(c){var u=i.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=i.state.selectValue,v=d&&i.isOptionSelected(c,g),m=i.isOptionDisabled(c,g);if(v){var b=i.getOptionValue(c);i.setValue(g.filter(function(C){return i.getOptionValue(C)!==b}),"deselect-option",c)}else if(!m)d?i.setValue([].concat(gi(g),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:p});return}f&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,f=i.state.selectValue,d=i.getOptionValue(c),p=f.filter(function(v){return i.getOptionValue(v)!==d}),g=wo(u,p,p[0]||null);i.onChange(g,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(wo(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=wo(c,d,d[0]||null);i.onChange(p,{action:"pop-value",removedValue:f})},i.getFocusedOptionId=function(c){return yu(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return dm(Is(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return ED.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return hm(i.props,c)},i.getOptionValue=function(c){return As(i.props,c)},i.getStyles=function(c,u){var f=i.props.unstyled,d=ER[c](u,f);d.boxSizing="border-box";var p=i.props.styles[c];return p?p(d,u):d},i.getClassNames=function(c,u){var f,d;return(f=(d=i.props.classNames)[c])===null||f===void 0?void 0:f.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return JO(i.props)},i.buildCategorizedOptions=function(){return Is(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return um(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:ye({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,f=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&xs(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,f=u&&u.item(0);f&&(i.initialTouchX=f.clientX,i.initialTouchY=f.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,f=u&&u.item(0);if(f){var d=Math.abs(f.clientX-i.initialTouchX),p=Math.abs(f.clientY-i.initialTouchY),g=5;i.userIsDragging=d>g||p>g}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,f=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(f,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),f=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:f>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return vm(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,m=u.isDisabled,b=u.menuIsOpen,C=u.onKeyDown,S=u.tabSelectsValue,x=u.openMenuOnFocus,I=i.state,w=I.focusedOption,A=I.focusedValue,E=I.selectValue;if(!m&&!(typeof C=="function"&&(C(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!f||g)return;i.focusValue("previous");break;case"ArrowRight":if(!f||g)return;i.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)i.removeValue(A);else{if(!d)return;f?i.popValue():v&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!b||!S||!w||x&&i.isOptionSelected(w,E))return;i.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(b){if(!w||i.isComposing)return;i.selectOption(w);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:g}),i.onMenuClose()):v&&p&&i.clearValue();break;case" ":if(g)return;if(!b){i.openMenu("first");break}if(!w)return;i.selectOption(w);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++$R),i.state.selectValue=ys(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=yu(o,a[l])}return i}return hD(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Mg(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&i.isDisabled||c&&l&&!i.menuIsOpen)&&this.focusInput(),c&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mg(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,c=a.isFocused,u=this.buildFocusableOptions(),f=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(l);l||(c=-1);var u=a.length-1,f=-1;if(a.length){switch(i){case"previous":c===0?f=0:c===-1?f=u:f=c-1;break;case"next":c>-1&&c<u&&(f=c+1);break}this.setState({inputIsHidden:f!==-1,focusedValue:a[f]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(a);a||(u=-1),i==="up"?c=u>0?u-1:l.length-1:i==="down"?c=(u+1)%l.length:i==="pageup"?(c=u-o,c<0&&(c=0)):i==="pagedown"?(c=u+o,c>l.length-1&&(c=l.length-1)):i==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bu):ye(ye({},bu),this.props.theme):bu}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:c,hasValue:m,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return pm(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return gm(this.props,i,o)}},{key:"filterOption",value:function(i,o){return mm(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,c=i.inputValue,u=i.tabIndex,f=i.form,d=i.menuIsOpen,p=i.required,g=this.getComponents(),v=g.Input,m=this.state,b=m.inputIsHidden,C=m.ariaSelection,S=this.commonProps,x=l||this.getElementId("input"),I=ye(ye(ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(C==null?void 0:C.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?K.createElement(v,R({},S,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:c},I)):K.createElement(dR,R({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:bs,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:f,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,c=o.MultiValueLabel,u=o.MultiValueRemove,f=o.SingleValue,d=o.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,m=g.isDisabled,b=g.isMulti,C=g.inputValue,S=g.placeholder,x=this.state,I=x.selectValue,w=x.focusedValue,A=x.isFocused;if(!this.hasValue()||!v)return C?null:K.createElement(d,R({},p,{key:"placeholder",isDisabled:m,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),S);if(b)return I.map(function(k,$){var G=k===w,O="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return K.createElement(a,R({},p,{components:{Container:l,Label:c,Remove:u},isFocused:G,isDisabled:m,key:O,index:$,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(F){F.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(C)return null;var E=I[0];return K.createElement(f,R({},p,{data:E,isDisabled:m}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isDisabled:c,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return K.createElement(a,R({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,c=o.Menu,u=o.MenuList,f=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,g=o.Option,v=this.commonProps,m=this.state.focusedOption,b=this.props,C=b.captureMenuScroll,S=b.inputValue,x=b.isLoading,I=b.loadingMessage,w=b.minMenuHeight,A=b.maxMenuHeight,E=b.menuIsOpen,k=b.menuPlacement,$=b.menuPosition,G=b.menuPortalTarget,O=b.menuShouldBlockScroll,T=b.menuShouldScrollIntoView,F=b.noOptionsMessage,H=b.onMenuScrollToTop,j=b.onMenuScrollToBottom;if(!E)return null;var N=function(U,W){var ie=U.type,se=U.data,oe=U.isDisabled,Z=U.isSelected,te=U.label,ne=U.value,ue=m===se,be=oe?void 0:function(){return i.onOptionHover(se)},Ne=oe?void 0:function(){return i.selectOption(se)},ht="".concat(i.getElementId("option"),"-").concat(W),Je={id:ht,onClick:Ne,onMouseMove:be,onMouseOver:be,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:Z};return K.createElement(g,R({},v,{innerProps:Je,data:se,isDisabled:oe,isSelected:Z,key:ht,label:te,type:ie,value:ne,isFocused:ue,innerRef:ue?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(U.data,"menu"))},M;if(this.hasOptions())M=this.getCategorizedOptions().map(function(B){if(B.type==="group"){var U=B.data,W=B.options,ie=B.index,se="".concat(i.getElementId("group"),"-").concat(ie),oe="".concat(se,"-heading");return K.createElement(a,R({},v,{key:se,data:U,options:W,Heading:l,headingProps:{id:oe,data:B.data},label:i.formatGroupLabel(B.data)}),B.options.map(function(Z){return N(Z,"".concat(ie,"-").concat(Z.index))}))}else if(B.type==="option")return N(B,"".concat(B.index))});else if(x){var V=I({inputValue:S});if(V===null)return null;M=K.createElement(d,v,V)}else{var Y=F({inputValue:S});if(Y===null)return null;M=K.createElement(p,v,Y)}var X={minMenuHeight:w,maxMenuHeight:A,menuPlacement:k,menuPosition:$,menuShouldScrollIntoView:T},D=K.createElement(VD,R({},v,X),function(B){var U=B.ref,W=B.placerProps,ie=W.placement,se=W.maxHeight;return K.createElement(c,R({},v,X,{innerRef:U,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:ie}),K.createElement(vR,{captureEnabled:C,onTopArrive:H,onBottomArrive:j,lockEnabled:O},function(oe){return K.createElement(u,R({},v,{innerRef:function(te){i.getMenuListRef(te),oe(te)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:se,focusedOption:m}),M)}))});return G||$==="fixed"?K.createElement(f,R({},v,{appendTo:G,controlElement:this.controlRef,menuPlacement:k,menuPosition:$}),D):D}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,c=o.isMulti,u=o.name,f=o.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!l)return K.createElement(xR,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(a){var p=d.map(function(m){return i.getOptionValue(m)}).join(a);return K.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(m,b){return K.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(m)})}):K.createElement("input",{name:u,type:"hidden",value:""});return K.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return K.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,c=o.focusedValue,u=o.isFocused,f=o.selectValue,d=this.getFocusableOptions();return K.createElement(oR,R({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:c,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,c=i.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,m=this.commonProps=this.getCommonProps();return K.createElement(l,R({},m,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),K.createElement(o,R({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),K.createElement(c,R({},m,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),K.createElement(a,R({},m,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,f=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,g=i.options,v=i.value,m=i.menuIsOpen,b=i.inputValue,C=i.isMulti,S=ys(v),x={};if(a&&(v!==a.value||g!==a.options||m!==a.menuIsOpen||b!==a.inputValue)){var I=m?LR(i,S):[],w=m?dm(Is(i,S),"".concat(p,"-option")):[],A=l?MR(o,S):null,E=BR(o,I),k=yu(w,E);x={selectValue:S,focusedOption:E,focusedOptionId:k,focusableOptionsWithIds:w,focusedValue:A,clearFocusValueOnUpdate:!1}}var $=c!=null&&i!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},G=u,O=f&&d;return f&&!O&&(G={value:wo(C,S,S[0]||null),options:S,action:"initial-input-focus"},O=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(G=null),ye(ye(ye({},x),$),{},{prevProps:i,ariaSelection:G,prevWasFocused:O})}}]),n}(y.Component);bm.defaultProps=RR;var FR=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function NR(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,f=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,g=e.value,v=En(e,FR),m=y.useState(l!==void 0?l:n),b=Yn(m,2),C=b[0],S=b[1],x=y.useState(c!==void 0?c:i),I=Yn(x,2),w=I[0],A=I[1],E=y.useState(g!==void 0?g:a),k=Yn(E,2),$=k[0],G=k[1],O=y.useCallback(function(V,Y){typeof u=="function"&&u(V,Y),G(V)},[u]),T=y.useCallback(function(V,Y){var X;typeof f=="function"&&(X=f(V,Y)),S(X!==void 0?X:V)},[f]),F=y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),H=y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=l!==void 0?l:C,N=c!==void 0?c:w,M=g!==void 0?g:$;return ye(ye({},v),{},{inputValue:j,menuIsOpen:N,onChange:O,onInputChange:T,onMenuClose:H,onMenuOpen:F,value:M})}var zR=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],ym=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),a=String(r.getOptionLabel(n)).toLowerCase();return o===i||a===i},xu={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return ym(t,o,i)})||r.some(function(o){return ym(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function jR(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,a=o===void 0?xu.formatCreateLabel:o,l=e.isValidNewOption,c=l===void 0?xu.isValidNewOption:l,u=e.getNewOptionData,f=u===void 0?xu.getNewOptionData:u,d=e.onCreateOption,p=e.options,g=p===void 0?[]:p,v=e.onChange,m=En(e,zR),b=m.getOptionValue,C=b===void 0?sm:b,S=m.getOptionLabel,x=S===void 0?am:S,I=m.inputValue,w=m.isLoading,A=m.isMulti,E=m.value,k=m.name,$=y.useMemo(function(){return c(I,ys(E),g,{getOptionValue:C,getOptionLabel:x})?f(I,a(I)):void 0},[a,f,x,C,I,c,g,E]),G=y.useMemo(function(){return(n||!w)&&$?i==="first"?[$].concat(gi(g)):[].concat(gi(g),[$]):g},[n,i,w,$,g]),O=y.useCallback(function(T,F){if(F.action!=="select-option")return v(T,F);var H=Array.isArray(T)?T:[T];if(H[H.length-1]===$){if(d)d(I);else{var j=f(I,I),N={action:"create-option",name:k,option:j};v(wo(A,[].concat(gi(ys(E)),[j]),j),N)}return}v(T,F)},[f,I,A,k,$,d,v,E]);return ye(ye({},m),{},{options:G,onChange:O})}var UR=y.forwardRef(function(e,t){var n=NR(e),r=jR(n);return K.createElement(bm,R({ref:t},r))}),xm=UR;const VR={control:(e,t)=>Q(L({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px",fontFamily:'var(--joy-fontFamily-body, "Inter", var(--joy-fontFamily-fallback, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"));',"&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(L({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(L({},e),{minHeight:"36px"}),menu:e=>Q(L({},e),{position:"relative"}),clearIndicator:e=>Q(L({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(L({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(L({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(L({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"14px"}),multiValueLabel:e=>Q(L({},e),{color:"#333"})},HR=e=>e.map(t=>({label:t,value:t})),WR=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=e.sx||{marginBottom:"16px"},a=HR(e.flags),l=()=>i(!r),c=p=>{e.onChange(p.map(g=>g.value))},u=p=>{n(p)},f=p=>{p.persist();const{key:g}=p;if(t)switch(g){case"Enter":case"Tab":if(e.flags&&e.flags.length===0){const v=[...e.flags,t];e.onChange(v)}if(e.flags&&e.flags.length>0&&d()){const v=[...e.flags,t];e.onChange(v)}n(""),p.preventDefault()}},d=()=>{let p=!1;return e.flags.length&&e.flags.includes(t)?(l(),p):(p=!0,p)};return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:o,children:s.jsx(xm,{styles:VR,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:c,onInputChange:u,onKeyDown:f,placeholder:e.labels.flagsPlaceholder,value:a})}),s.jsx(Ye,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:l})]})},Io=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("primary"),[g,v]=y.useState(""),m=y.useRef(null),b=()=>{m.current&&m.current.click()},C=new Gp,S=Ge(),x=()=>{f(""),i(!1)},I=F=>{let H="",j="primary";switch(F){case"copy_url":H=e.labels.urlCopiedToClipboardMessage,j="primary";break;case"image_deleted":H=e.labels.imageDeletedMessage,j="primary";break;case"image_reset":H=e.labels.imageResetMessage,j="primary";break;case"upload_success":H=e.labels.uploadingImageMessage,j="success";break;case"upload_failed":H=e.labels.uploadingImageErrorMessage,j="danger";break;case"sign_in_url_failed":H=e.labels.generateSignedInUrlErrorMessage,j="danger";break;case"encrypting_file_failed":H=e.labels.encryptingImageErrorMessage,j="danger";break}p(j),f(H),i(!0)},w=()=>a(!o),A=()=>c(!l),E=()=>{e.clearImage(),I("image_deleted")},k=F=>{navigator.clipboard.writeText(F),I("copy_url")},$=F=>_(this,null,function*(){F.persist();const H=F.target.files?F.target.files[0]:null;if(H){n(!0);try{const j=H.type.split("/")[1],N=yield C.readFileAndHash(H),M=(yield C.generateHashFileName(H))+"."+j,V={image_type:j,image_file_name:M,image_size:H.size,base64_sum:N},Y=yield S==null?void 0:S.https.generateSignedInUrl(V);if(Y!=null&&Y.ok){const X=yield Y.json(),D={"Content-Type":H.type,"Content-MD5":N};try{const B=new File([H],M,{type:H.type}),U=yield S==null?void 0:S.https.storeInBucket(X.data.signed_url,B,D);e.onChangeImages(U||""),v(U),I("upload_success")}catch(B){console.error("There was a problem with uploading the file: ",B),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield Y==null?void 0:Y.json()),I("sign_in_url_failed")}catch(j){console.error("There was a problem with encrypting file...",j),I("encrypting_file_failed")}n(!1)}}),G=F=>_(this,null,function*(){if(F){n(!0);try{const H=F.type.split("/")[1],j=yield C.readFileAndHash(F),N=(yield C.generateHashFileName(F))+"."+H,M={image_type:H,image_file_name:N,image_size:F.size,base64_sum:j},V=yield S==null?void 0:S.https.generateSignedInUrl(M);if(V!=null&&V.ok){const Y=yield V.json(),X={"Content-Type":F.type,"Content-MD5":j};try{const D=new File([F],N,{type:F.type}),B=yield S==null?void 0:S.https.storeInBucket(Y.data.signed_url,D,X);e.onChangeImages(B||""),I("upload_success")}catch(D){console.error("There was a problem with uploading the file: ",D),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield V==null?void 0:V.json()),I("sign_in_url_failed")}catch(H){console.error("There was a problem with encrypting file...",H),I("encrypting_file_failed")}n(!1)}}),O=()=>{e.onChangeImages(g),I("image_reset")},T=F=>{e.onChangeImages(F),v(F)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:e.title}),s.jsx(h.Tooltip,{title:e.labels.clearImage,children:s.jsx(h.IconButton,{variant:"plain",color:"danger",size:"sm",onClick:E,children:s.jsx(Lp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:t,animation:"wave",children:[e.image?s.jsx(h.Box,{component:"img",src:e.image,loading:"lazy",alt:e.title,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(Uc,{sx:{fontSize:"3rem",opacity:.2}}),e.image?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Kp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.labels.copyUrl,children:s.jsx(h.Button,{onClick:()=>k(e.image),disabled:!e.image,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.labels.viewImage,children:s.jsx(h.Button,{onClick:w,disabled:!e.image,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(Qp,{})})}),s.jsx(h.Tooltip,{title:e.labels.cropImage,children:s.jsx(h.Button,{onClick:A,disabled:!e.image,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(pg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(h.Button,{sx:{width:"100%"},onClick:b,children:[s.jsx(_e.Upload,{})," ",e.labels.uploadImage,s.jsx(Jp,{type:"file",accept:"image/*",onChange:$,ref:m})]})}),S.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.labels.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(qp,{labels:e.labels,onChangeImages:T})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ye,{showToast:r,message:u,color:d,hideToast:x}),s.jsx(Yp,{title:e.labels.viewImage,open:o,imageSrc:e.image,toggleModal:w}),s.jsx(hg,{labels:e.labels,open:l,imageSrc:e.image,toggleModal:A,uploadImage:G,resetDefaultImageUrl:O})]})},GR=["cover","mobile"],YR=e=>new Map().set("main",e.mainImage).set("cover",e.coverImage).set("mobile",e.mobileImage),KR=e=>e?L({},e):{main:"",mobile:"",cover:""},qR=e=>{const[t,n]=y.useState(!1),r=KR(e.defaultValue),i=YR(e.labels),o=(l,c)=>{r[c]=l,e.onChange(r)},a=l=>{r[l]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(Io,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:l=>o(l,"main"),clearImage:()=>a("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(s.Fragment,{children:GR.map(l=>s.jsx(Io,{labels:e.labels,title:i.get(l),image:r[l],onChangeImages:c=>o(c,l),clearImage:()=>a(l)},`images-${l}`))}):s.jsx(s.Fragment,{})]})};function QR(e){return ut("MuiSheet",e)}qe("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const JR=["className","color","component","variant","invertedColors","slots","slotProps"],XR=e=>{const{variant:t,color:n}=e,r={root:["root",t&&`variant${Se(t)}`,n&&`color${Se(n)}`]};return gt(r,QR,{})},ZR=Ce("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r;const i=(n=e.variants[t.variant])==null?void 0:n[t.color],{borderRadius:o,bgcolor:a,backgroundColor:l,background:c}=bc({theme:e,ownerState:t},["borderRadius","bgcolor","backgroundColor","background"]),u=ar(e,`palette.${a}`)||a||ar(e,`palette.${l}`)||l||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||e.vars.palette.background.surface;return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:e.vars.palette.background.surface,position:"relative"}),R({},e.typography["body-md"],t.variant==="solid"&&t.color&&t.invertedColors&&A_(t.color)(e),t.variant==="soft"&&t.color&&t.invertedColors&&T_(t.color)(e),(r=e.variants[t.variant])==null?void 0:r[t.color],i)]}),eL=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:l="plain",invertedColors:c=!1,slots:u={},slotProps:f={}}=r,d=De(r,JR),p=R({},r,{color:o,component:a,invertedColors:c,variant:l}),g=XR(p),v=R({},d,{component:a,slots:u,slotProps:f}),[m,b]=Ee("root",{ref:n,className:zn(g.root,i),elementType:ZR,externalForwardedProps:v,ownerState:p});return s.jsx(m,R({},b))});function tL(e){return ut("MuiTypography",e)}qe("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const nL=["color","textColor"],rL=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],Cu=K.createContext(!1),iL=K.createContext(!1),oL=e=>{const{gutterBottom:t,noWrap:n,level:r,color:i,variant:o}=e,a={root:["root",r,t&&"gutterBottom",n&&"noWrap",i&&`color${Se(i)}`,o&&`variant${Se(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return gt(a,tL,{})},aL=Ce("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),sL=Ce("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),lL=Ce("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=t.level!=="inherit"?(n=e.typography[t.level])==null?void 0:n.lineHeight:"1";return R({"--Icon-fontSize":`calc(1em * ${l})`},t.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},t.nesting?{display:"inline"}:R({display:"block"},t.unstable_hasSkeleton&&{position:"relative"}),(t.startDecorator||t.endDecorator)&&R({display:"flex",alignItems:"center"},t.nesting&&R({display:"inline-flex"},t.startDecorator&&{verticalAlign:"bottom"})),t.level&&t.level!=="inherit"&&e.typography[t.level],{fontSize:`var(--Typography-fontSize, ${t.level&&t.level!=="inherit"&&(r=(i=e.typography[t.level])==null?void 0:i.fontSize)!=null?r:"inherit"})`},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.color&&{color:`var(--variant-plainColor, rgba(${(o=e.vars.palette[t.color])==null?void 0:o.mainChannel} / 1))`},t.variant&&R({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!t.nesting&&{marginInline:"-0.25em"},(a=e.variants[t.variant])==null?void 0:a[t.color]))}),Cm={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},wu=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyTypography"}),{color:o,textColor:a}=i,l=De(i,nL),c=K.useContext(Cu),u=K.useContext(iL),f=g1(R({},l,{color:a})),{component:d,gutterBottom:p=!1,noWrap:g=!1,level:v="body-md",levelMapping:m=Cm,children:b,endDecorator:C,startDecorator:S,variant:x,slots:I={},slotProps:w={}}=f,A=De(f,rL),E=(r=t.color)!=null?r:x?o!=null?o:"neutral":o,k=c||u?t.level||"inherit":v,$=ah(b,["Skeleton"]),G=d||(c?"span":m[k]||Cm[k]||"span"),O=R({},f,{level:k,component:G,color:E,gutterBottom:p,noWrap:g,nesting:c,variant:x,unstable_hasSkeleton:$}),T=oL(O),F=R({},A,{component:G,slots:I,slotProps:w}),[H,j]=Ee("root",{ref:n,className:T.root,elementType:lL,externalForwardedProps:F,ownerState:O}),[N,M]=Ee("startDecorator",{className:T.startDecorator,elementType:aL,externalForwardedProps:F,ownerState:O}),[V,Y]=Ee("endDecorator",{className:T.endDecorator,elementType:sL,externalForwardedProps:F,ownerState:O});return s.jsx(Cu.Provider,{value:!0,children:s.jsxs(H,R({},j,{children:[S&&s.jsx(N,R({},M,{children:S})),$?K.cloneElement(b,{variant:b.props.variant||"inline"}):b,C&&s.jsx(V,R({},Y,{children:C}))]}))})});wu.muiName="Typography";function cL(e){return ut("MuiFormControl",e)}const wm=qe("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),uL=qe("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),dL=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],fL=e=>{const{disabled:t,error:n,size:r,color:i,orientation:o}=e,a={root:["root",o,t&&"disabled",n&&"error",i&&`color${Se(i)}`,r&&`size${Se(r)}`]};return gt(a,cL,{})},hL=Ce("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i;return R({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":t.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":e.vars.palette.danger[500]},t.size==="sm"&&{"--FormLabel-fontSize":e.vars.fontSize.xs,"--FormLabel-lineHeight":e.vars.lineHeight.xl,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":e.vars.fontSize.xs,"--FormHelperText-lineHeight":e.vars.lineHeight.xl},t.size==="md"&&{"--FormLabel-fontSize":e.vars.fontSize.sm,"--FormLabel-lineHeight":e.vars.lineHeight.sm,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.size==="lg"&&{"--FormLabel-fontSize":e.vars.fontSize.md,"--FormLabel-lineHeight":e.vars.lineHeight.md,"--FormLabel-margin":t.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.color&&{"--FormHelperText-color":(n=e.vars.palette[t.color])==null?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${wm.error}`]:{"--FormHelperText-color":e.vars.palette.danger[500]},[`&.${wm.disabled}`]:{"--FormLabel-color":(r=e.variants.plainDisabled)==null||(r=r[t.color||"neutral"])==null?void 0:r.color,"--FormHelperText-color":(i=e.variants.plainDisabled)==null||(i=i[t.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal"&&{[`& > label ~ .${uL.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),Su=K.forwardRef(function(t,n){const r=mt({props:t,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:l=!1,required:c=!1,error:u=!1,color:f,size:d="md",orientation:p="vertical",slots:g={},slotProps:v={}}=r,m=De(r,dL),b=io(i),[C,S]=K.useState(null),x=R({},r,{id:b,component:a,color:f,disabled:l,error:u,required:c,size:d,orientation:p});let I;const w=fL(x),[A,E]=Ee("root",{ref:n,className:zn(w.root,o),elementType:hL,externalForwardedProps:R({},m,{component:a,slots:g,slotProps:v}),ownerState:x}),k=K.useMemo(()=>({disabled:l,required:c,error:u,color:f,size:d,htmlFor:b,labelId:`${b}-label`,"aria-describedby":C?`${b}-helper-text`:void 0,setHelperText:S,registerEffect:I}),[f,l,u,C,b,I,c,d]);return s.jsx(os.Provider,{value:k,children:s.jsx(A,R({},E))})});function pL(e){return ut("MuiFormLabel",e)}qe("MuiFormLabel",["root","asterisk"]);const gL=["children","component","htmlFor","id","slots","slotProps"],mL=()=>gt({root:["root"],asterisk:["asterisk"]},pL,{}),vL=Ce("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:e.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,fontWeight:e.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${e.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),bL=Ce("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Iu=K.forwardRef(function(t,n){var r,i;const o=mt({props:t,name:"JoyFormLabel"}),{children:a,component:l="label",htmlFor:c,id:u,slots:f={},slotProps:d={}}=o,p=De(o,gL),g=K.useContext(os),v=(r=(i=t.required)!=null?i:g==null?void 0:g.required)!=null?r:!1,m=R({},o,{required:v}),b=mL(),C=R({},p,{component:l,slots:f,slotProps:d}),[S,x]=Ee("root",{additionalProps:{htmlFor:c!=null?c:g==null?void 0:g.htmlFor,id:u!=null?u:g==null?void 0:g.labelId},ref:n,className:b.root,elementType:vL,externalForwardedProps:C,ownerState:m}),[I,w]=Ee("asterisk",{additionalProps:{"aria-hidden":!0},className:b.asterisk,elementType:bL,externalForwardedProps:C,ownerState:m});return s.jsxs(S,R({},x,{children:[a,v&&s.jsxs(I,R({},w,{children:[" ","*"]}))]}))}),yL=({environment:e,userNotFound:t})=>{const[n,r]=y.useState(""),[i,o]=y.useState(""),[a,l]=y.useState(!1),c=()=>{l(!a)},u=p=>{p.persist(),r(p.target.value)},f=p=>{p.persist(),o(p.target.value)},d=()=>_(this,null,function*(){try{yield ro(e).signInWithEmailAndPassword(n,i)}catch(p){console.error(p),c()}});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxs(eL,{sx:{width:300,mx:"auto",py:3,px:2,display:"flex",flexDirection:"column",justifyContent:"center",gap:2,borderRadius:"sm",boxShadow:"md"},variant:"outlined",children:[s.jsxs("div",{children:[s.jsx(wu,{level:"h4",component:"h1",children:s.jsx("b",{children:"Sign in"})}),s.jsx(wu,{level:"body-sm",children:"Use your account in the Fans United platform."})]}),s.jsxs(Su,{children:[s.jsx(Iu,{children:"Email"}),s.jsx(as,{name:"email",type:"email",onChange:u})]}),s.jsxs(Su,{children:[s.jsx(Iu,{children:"Password"}),s.jsx(as,{name:"password",type:"password",onChange:f})]}),s.jsx(di,{sx:{mt:1},onClick:d,children:"Log in"})]})}),s.jsx(Ye,{showToast:a,message:t,color:"danger",hideToast:c})]})};function xL(e){return ut("MuiCheckbox",e)}const vi=qe("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),CL=Cc(s.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),wL=Cc(s.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),SL=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],IL=e=>{const{checked:t,disabled:n,disableIcon:r,focusVisible:i,color:o,variant:a,size:l,indeterminate:c}=e,u={root:["root",t&&"checked",n&&"disabled",i&&"focusVisible",a&&`variant${Se(a)}`,o&&`color${Se(o)}`,l&&`size${Se(l)}`],checkbox:["checkbox",t&&"checked",c&&"indeterminate",n&&"disabled"],action:["action",t&&"checked",r&&n&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return gt(u,xL,{})},AL=Ce("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i;return R({"--Icon-fontSize":"var(--Checkbox-size)"},e.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:t.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},e.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:t.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},e.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:t.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:e.overlay?"initial":"relative",display:"inline-flex",fontFamily:t.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:t.vars.palette.text.primary,[`&.${vi.disabled}`]:{color:(n=t.variants.plainDisabled)==null||(n=n[e.color])==null?void 0:n.color}},e.disableIcon&&{color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color,[`&.${vi.disabled}`]:{color:(i=t.variants[`${e.variant}Disabled`])==null||(i=i[e.color])==null?void 0:i.color}})}),TL=Ce("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${e.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{[`&.${vi.checked}, &.${vi.indeterminate}`]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[R({},l,{backgroundColor:(r=l==null?void 0:l.backgroundColor)!=null?r:e.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=e.variants[`${t.variant}Hover`])==null?void 0:i[t.color]}},{"&:active":(o=e.variants[`${t.variant}Active`])==null?void 0:o[t.color]},{[`&.${vi.disabled}`]:(a=e.variants[`${t.variant}Disabled`])==null?void 0:a[t.color]}]]}),EL=Ce("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var n,r,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${t.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[e.focus.selector]:e.focus.default},...t.disableIcon?[(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},{"&:active":(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]},{[`&.${vi.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]}]:[]]}),kL=Ce("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),_L=Ce("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>R({flex:1,minWidth:0},e.disableIcon&&{zIndex:1,pointerEvents:"none"})),PL=s.jsx(CL,{}),DL=s.jsx(wL,{}),OL=K.forwardRef(function(t,n){var r,i,o,a,l;const c=mt({props:t,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:f,checkedIcon:d=PL,label:p,defaultChecked:g,disabled:v,disableIcon:m=!1,overlay:b,id:C,indeterminate:S=!1,indeterminateIcon:x=DL,name:I,onBlur:w,onChange:A,onFocus:E,onFocusVisible:k,readOnly:$,required:G,value:O,color:T,variant:F,size:H="md",component:j,slots:N={},slotProps:M={}}=c,V=De(c,SL),Y=K.useContext(os),X=(r=(i=t.disabled)!=null?i:Y==null?void 0:Y.disabled)!=null?r:v,D=(o=(a=t.size)!=null?a:Y==null?void 0:Y.size)!=null?o:H,B=io(C!=null?C:Y==null?void 0:Y.htmlFor),U={checked:u,defaultChecked:g,disabled:X,onBlur:w,onChange:A,onFocus:E,onFocusVisible:k},{getInputProps:W,checked:ie,disabled:se,focusVisible:oe}=oA(U),Z=ie||S,ue=Z?F||"solid":F||"outlined",be=t.color||(Y!=null&&Y.error?"danger":(l=Y==null?void 0:Y.color)!=null?l:T),Je=R({},c,{checked:ie,disabled:se,disableIcon:m,overlay:b,focusVisible:oe,color:Z?be||"primary":be||"neutral",variant:ue,size:D}),_t=IL(Je),he=R({},V,{component:j,slots:N,slotProps:M}),[ge,xe]=Ee("root",{ref:n,className:_t.root,elementType:AL,externalForwardedProps:he,ownerState:Je}),[ke,Ke]=Ee("checkbox",{className:_t.checkbox,elementType:TL,externalForwardedProps:he,ownerState:Je}),[Oe,Pe]=Ee("action",{className:_t.action,elementType:EL,externalForwardedProps:he,ownerState:Je}),[St,It]=Ee("input",{additionalProps:R({id:B,name:I,value:O,readOnly:$,role:void 0,required:G!=null?G:Y==null?void 0:Y.required,"aria-describedby":Y==null?void 0:Y["aria-describedby"]},S&&{"aria-checked":"mixed"}),className:_t.input,elementType:kL,externalForwardedProps:he,getSlotProps:W,ownerState:Je}),[Bt,Dt]=Ee("label",{additionalProps:{htmlFor:B},className:_t.label,elementType:_L,externalForwardedProps:he,ownerState:Je});let zt=f;return m?zt=null:S?zt=x:ie&&(zt=d),s.jsxs(ge,R({},xe,{children:[s.jsxs(ke,R({},Ke,{children:[s.jsx(Oe,R({},Pe,{children:s.jsx(St,R({},It))})),zt]})),p&&s.jsx(Cu.Provider,{value:!0,children:s.jsx(Bt,R({},Dt,{children:p}))})]}))}),RL=$e(s.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),Dr=({label:e,values:t,allValues:n,valuesMap:r,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:l})=>{const c=(u,f)=>{u.persist();let d=[...t];if(u.target.checked){d.push(f),a(d);return}d=t.filter(p=>p!==f),a(d)};return s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"body-sm",mb:1,children:e}),s.jsxs(uT,{orientation:"horizontal",wrap:!0,sx:{columnGap:"12px","--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>s.jsxs(qh,{children:[t.includes(u)&&s.jsx(RL,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),s.jsx(OL,{checked:t.includes(u),variant:t.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:f=>c(f,u),slotProps:{action:({checked:f})=>({sx:f?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${e}-${u}`)),i===!1?s.jsx(qh,{children:s.jsx(h.Link,{onClick:l,children:o})}):s.jsx(s.Fragment,{})]})]})},bi={popular:["FT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","CORRECT_SCORE","OVER_CORNERS_9_5"],playerRelated:["PLAYER_YELLOW_CARD","PLAYER_RED_CARD","PLAYER_SCORE","PLAYER_SCORE_FIRST_GOAL","PLAYER_SCORE_TWICE","PLAYER_SCORE_HATTRICK"],goals:["OVER_GOALS_0_5","OVER_GOALS_1_5","OVER_GOALS_2_5","OVER_GOALS_3_5","OVER_GOALS_4_5","OVER_GOALS_5_5","OVER_GOALS_6_5"],corners:["CORNERS_MATCH","OVER_CORNERS_6_5","OVER_CORNERS_7_5","OVER_CORNERS_8_5","OVER_CORNERS_9_5","OVER_CORNERS_10_5","OVER_CORNERS_11_5","OVER_CORNERS_12_5","OVER_CORNERS_13_5"],correctScores:["CORRECT_SCORE","CORRECT_SCORE_HT","CORRECT_SCORE_ADVANCED"],misc:["FT_1X2","HT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","HT_FT","RED_CARD_MATCH","PENALTY_MATCH"]},LL=({labels:e,values:t,valuesMap:n,onChange:r})=>{const[i,o]=y.useState(!1);return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.marketSelection}),s.jsx(h.FormHelperText,{sx:{mb:2},children:e.marketSelectionDescription}),s.jsx(Dr,{label:"Popular",values:t,allValues:bi.popular,valuesMap:n,showAll:i,showAllLabel:e.showAll,onChange:r,toggleShowAll:()=>o(!0)}),i?s.jsxs(s.Fragment,{children:[s.jsx(Dr,{label:e.playerRelated,values:t,allValues:bi.playerRelated,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.goals,values:t,allValues:bi.goals,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.corners,values:t,allValues:bi.corners,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.correctScores,values:t,allValues:bi.correctScores,valuesMap:n,onChange:r}),s.jsx(Dr,{label:e.misc,values:t,allValues:bi.misc,valuesMap:n,onChange:r})]}):s.jsx(s.Fragment,{})]})},Be={avatar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMA+h6XBeOBCz4ozafvc/W9X+nD29ROsWmINjBVRxC4F3uPnhL6/TMAAAygSURBVHja7N0JkqJAEIXhAsEFEEVs9z3vf8eZmI6J3mxFZamq/L8zaC2ZrxKjTzTaLfu9xWweZ7n8FeRFmRwuq+XbZmDgs2gzPR9iuaGYpOl4yO/AQ+G0lwRSUXJ+40fgkXCaxvKgYDIeGXhgvZrLk8rVxsBp63MsLyn7rAPOCvul1GB+Cg2cE20nUpvDNjJwybpXSK2KPsuAM8J+LPULUk6EbjgF0pDD0MB2w0QaNOMnYLfhRL7iJ6DJaCEtOHAWsNO+F0g7Um4EFlpm0pq8T6/IMptEWhVPDewxWAXSthlNAltEu1I6EKyoD9sgOufSkZIrYfeOM+lQj8NgxzaxdKpcG3RonEvHgpNBV8KDWGByNOjENBMrFJwFu7BPxRbB2KBtw1gsknIbaNk4EKskHATaNLBn+f8vpjLcnn0i9skue4NWHOdipYRfwHUa/v//JBwFWzCYibUm9AebtxCLpQYN64nVVgaNGovllgYN2or13gwaM7Ss/ndNTmuoMevOu/9VZGREGrKxpP17T8bToUaMCnFEQV+gAaFV/d/bYt6O1e5YikPmtAVqNrC2AUBboA2RFfHPRywManQR5/QManMSB5EU1VQApij8k7IC4E855YBaHB0qAHwVExWuQWRxAuieiYHvCZDbzgYvmorTtgYvGTl6APwv4yD4koGlTwCqSwgKqz0AUBHUWgGiHlST0JEI0G0F1YBnOdcCpDFYq6V4grGyTwkdvwF+yEiIKd4A2AR0lgApCL5o70wIvIqCkKiCEBjloBqtxTO8FnqMYynw+2YGWk+AnAMfNnA2Bfa7mLag5zFwYuK1OXpTA/wsoymkKAXAVfAFIwcGwTwjIB7mwSRApgheQw2oGqYHVTERbx0M7tqJxxghd5/DL8F4K8YCwBLAAsAS8IqheI4lQO0VgIuA7hoAyRDVRUDKgZWMxH8BjwTUtQFpCqrOAXyXExFXFQQiGlRZ5GESkHSg7igwAWGqwLwRqGojapANU3sH5Cb4q4GKO+C7jO+JeDwQhqExPAflGEgbgGPgg1aiCp+Z/86riTD3xQaasqA/7Qw+S0WZi4HSIsC7jI6Qd2PBGSJOFpBsIDtAVTl7gOodgD1A9R2APeCLyIsvg3APoArEM0GiIHxW9AlK0sDflQYaO8EfeCT2bixKLQ08+zgQnxJ6QqSwDMhFUNNUGC6Ct/VFrZOBohdhzAy7KvJ0NjgdwT/snVlSAlEMRYO2duEADnQVIO2U/e9RLSkZbB7o5zvnbAGqX3Jzc2MJYHq0KoBZEZqBHAm7EOB6wGHOEo3jAKQbTF8Ydidwn8ugg50EOQ+yBrQKjHhJOPTYULQO6EAQlgykK2iHZtGtxlBD8Ibz8apbEGdC/Su8/Nvmfo4rBTp//h1uYPnBkGB43UGOgB0N2/uZG7VHD10FO8YFJUEYbAN2MoQ5DeU5KTsAO4FhHlPIC+O2AHCbONwCZBmIOgzxV66ietqUw4zqlwIsAeD+ELwDhO4PwTtA6NFx6FVAbeI2Afg2QCcQfE8AnAdyCjdROylFonKalCK1O8QVAuF/AL8A8D+ANQC8BrALoHcByPNA6gAbZikFZlE70xR0ejDyRKDJkRveUgrMo3Y0hBS5i9qBHonUEmY0rNGxCgHqQOwLMcd5iPqxDUB7QiPuUsBNAPhSsDWgtlBHQYrBcCFYLRBfAlgE0EsAM2LAZgCVAPgo0IgA+CTom8ZxwCD3QcGMgEHOg4JvAPoF+MS0aGpKpHHR9JxYbUGHGEFUIJOCsOlAWkMtAc2KAqdD6QsqAjsbF40TIWwP6CcA6wRwT5w+CN7mKeWHLoC4IQJKBRhiaVzQmtE4kOgMAu0DDdE6FGSdjFUQhh+N1hoENwL9plUMyBn2AfhiiT8kPYF2ACrC0CGQl2SZuyAuC5PXgcs04PDYafXXAU6hxQ4FHtANwIYW+g2Y+vuvaZB1wLXff7QkSBYA3RThpIGYGqIL1DfAF+A4XcJAugALtDB/2MQWkH1M6jlkl9tEcRuCjo+0CWRvCtF2gTUG7HEZss8iQSxDyNFhyoDwN0AjGPwN8AVgD4SIaQDGR0IjIdWCVIHMjgOeB/WclIFQ/6BHzISdBMO3hNwGgl+SgIUCKwUoAmgL0QpyKn31gRGTPqTAe1aOdvAyy6wceCIMPkCWGQrrhoiZgB/snVFOwzAQRO2QElJFhUAJClUpwve/I0h8tagobVzH3nnvColsz+7sLEoQDUhDgDbAFOo+mGVFJoR2MYgi0BQas9vlO/qA2tYwrGDT2Bs9AjgAxI8ADgDtV0DPAaAtBJAA2tuEqAGIrxGgCKgdF0EkhPhCMdqAF/IRTDE4uIzW1JCI6nJYFsuKL4edw95QW1h3OSxSEAmIPxQnqPg7UH05qHxXkC7gtdQm6oFbmgBXMxq4BPzoQDk8klBI7UtgzQUwi/fCLwFPKOhMPkPRYAPSXiZECWg+VcEO0f7gQHlgnOWA2o1hFGAc6kIzhJ9RgJGoirQG9ISCR+OhwGqAJxH0B+FRoTcHTjg/kDzAuNSF2YMeeQBG5lBUetgLgbDRaQuqCHaYwH4RlQIbBMBN2IUy8FSAj1HLkEQAniBmDsAE/AcpjyAdoJtyFzKHMdBj1P4ACoCnaP0BfP9zaPhDOP/PIPISvHfwD+abw1jAk/GUYVXYkwKRkNfsFkxuyIFLypiZTXDFCFhiqqzGRtcYQJPTDCEbBlLAJmJTDiL/FmKXxVOwo/2/GG0GD4Et9q8FaRa3i39x/X+zdyc5CMNAEEUhuQnc/46sEFMGWyJy1PX+Fept7R7bfXAXdQWAABAAAkAACAABIAAEgAAQAAJAAAgAASAABIAAEAACQADofPelvQrqqd7+BPRUcX8C2qu5PwGtVd2fgLbq7k9AS5X3J2C/2vsTsFf1/QnYrv7+BGyVsD8B62XsT8BaKfsTsFzO/gQslbQ/Ab9l7U/Ad2n7E/BZ3v4EvJe4PwGvMvcn4Fnq/gQc0zT8W+D2bu5H/LtpPuGdqPWuMwLB8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8CD/buRStRKIDC8NaBRBBFzfttxvP+7zi1Wq2mxgxLC87+v1f4d6VwIPv8TMA+PxOwz88E7PMzAfv8TMA+PxOQukfr/I86xieIyW89gT75n3WKvtz0C/IbT6BfBLxhNAHyn1as5YD875uvFDvyn7ePewJr8n9olClW63lADZOtYkT++vKZYkN+6wmsyH+xfKNYrPYBn3BfKQbk/7xplajlyP816aLVE8jI/2Vp2VNLZaOAKxi3cwLkv57B79ZNgPzXNbjbqUXIf32D5UEtQf7bGP5pxQSyScCNDJt/inxL/tM8HiQg/+11jo09PEj+8yI/QrzNAz4W6xHiGfm/17xRR4jJf4nojhCT/4fsG3F+lPyXiuoIMfkvE9kENuT/eZO6EyB/rEZr/YDNfUBTFF2dR/7Inb9HQH4D70+A/Ca+aQIV+RvrG24TVdOAJnt1gZj8jm72dHlC/pa4rxLye0sXybXzpwFtMi575Pd2tceJkgX52+lhAuT3Ni4T8ntLK/Kby7PP5i/JH4eiS35vw1KX2pI/Knlfl9jxTt/YdErVt+LHP0Kjg2pa8N9cojTOVEfyKyBOtf4M9Hitb8SOyYf9ecY/avse/b1Ndjoj4f1e0cvPLYCv/wbynt5zF2BglOi0WYCFQid1BwEeSp3CFwAbnUz/KwNspDu91ecGgJNfeosrAF4yvbYJsJLrlYTnvtxU+tciwEya6EXCESA/C34BeJvqBZ8AHM30bBtgaK5nnAKz1DnoSZeLgJ5K7gJ4m+gJ73x2ddCjfoCpir8A3gruA3pL9aDHdwBfXa4CedtIWgbYWvIRwNteEofBjaVSN8BYj8eBvK25DORtpmOAsZIvAd6WnAbzVmgYYGyvAGc5A/A2ZQDexgzA25ABmGMA5hiAOQZgjgGYYwDmGIA5BmCOAZjjTKg5jQOcifeDeWMA5hiAOT4DmPvb3h2lNAxEYRT+kzo0JtNqoFpQmyCz/z2KFJFa8d2e863hvCRzZ65fAXAOhcL5IwjOAOAMAM4A4AwAzgDgDADOAOAMAM4A4AwAzgDg4lPRaN4Ohus8DmYrjoSxLVmawHY+Fcu2zdrENSeOBZNtkmyasNa4MYJsdHMs25BPL01MY86mJqT7nJ28Hob0ni9DE88h3x6baOopFgBW+1x48lgYpfT5oXd9GMjzNteGyfEwhvKW363HxQZu3uE1f7gbdtO4b1e6WudSylz3JvJ/dfPDcc2FD2jGIfoz6ZkMAAAAAElFTkSuQmCC",team:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMAcN3YbAMJ8lQsGkdh97kVyyLTsT0Q7ayEfDXD6KSLdeSclIjjiMMAAAu4SURBVHja7NjbasJAFIbRbY0S0npA641Cxc77v2OveyElYCY7nbWe4YPZ/wQAAAAAAAAAAAAAAAAAAAAAANCU7bXvVrxI11+3sSDD/Vh4sdt9iGUYHoVJPJaQwGa1K0xk120iucu+MKHzJVIbToVJnQ6R2GFd+K2pAraO/wpuee+A70IFX5HUe6GKz0hp4wCs5JjzEegLlfSRkR+AavaR0FCoJuMU/Cg818AbYAP+4b8vQSdARefIxwis6Bj5vBWqWUc+AnhOAAgAASAABIAAEAACQAAIAAEgAASAABAAAkAACAABIAAEgAAQAAJAAAgAASCAxgmgcQJonAAaJ4DGCaBxAmicABongJfpZiaAmcXMBDCOAAQgAAEIIPIRgACWKEYSgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABLBEMZIABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQggCWKkQQgAAH8sEvHNAAAAAiA7J/aDJ5ukAEBBBBAAAEEEEAAAQQQQAABBBBAgEcZCSCAAAIIIIAAAggggAACCCCAAAIIIIAAjzISQAABBBBAAAEEEEAAAQQQQAABBBBAAAEeZSSAAAIIIIAAAggggAACCCCAAAIIIIAAAjzKSAABBBBAAAEEEEAAAQQQQAABBBBAAAEEeJSRAAIIIIAAAggggAACCCCAAAIIIIAAAgjwKCMBBBBAAAEEEEAAAQQQQAABBBBAAAEEEOBRRgIIIIAAAggggAACCCCAAAIIIIAAAgggwKOMBBBAAAEEEEAAAQQQQAABBBBAAAEEEECARxkJIIAAAggggAACCCCAAAIIIIAAAggggACPMhJAAAEEEEAAAQQQQAABBBBAAAEEEEAAAR5lJIAAAggggAACCCCAAAIIIIAAAggggAACPMpIgLJLxzQAAAAIgOyf2gyebpABAQQQQAABBBBAAAEEEEAAAQQQQAABBHiUkQACCCCAAAIIIIAAAggggAACCCCAAAII8CgjAQQQQAABBBBAAAEEEEAAAQQQQAABBBDgUUYClF07y2kgiKEoehVIAGUgE5CkRYC8/e+RNZR/7NfyWULrSl1lVwfQAXQAHUAH0AF0AB1AB9ABdAAdQAcQt+wAxswtgNV8AniSJcYUCeBIPUdZIte7QvbUs5clch0UMlHPJEvkuilkRz07WSLXWiEn6vmSJXJtFPJNPX+yRK6rQh7Uc5Elcj0UcqWeH1kiIP/k9Ew9G1ki10Ihr9SzliUC0lcBOlPPmywxosxHO1DPhywxqsR/c0VBL3JEqrtCPqnIcxtEqmk+uyA4yRGZltv5DALhLkdkuinmQkWegwCGFRiebajoLEeMS58D6kZFnvdAEq22c7oFwq8MMS59eLqgJssnIYzKXwX+k3cvOgnEUBBAx0ddXbMqJkAUMJj5/38UwsMA4rZsdjtTzieIudveO20l4yC2A2Ekyz4JkhwGrz3SEFLlHwTwGZpqGkK67I2TV4ia0w+yCcvC1oCeuVCkUeibaDaCXVNhSCSQolXMg2180g9yGTe80BNUBcNIANIIjE4mAbIMJ8JIohCfmELXDe0gnsYSUHgJYBkMRTSVYqkYCDWeByGPEVlcF8DzgCCiCP2hFI8FOp8OQRZ1w9IGAfuIgxlk8cVLVcKbQMuNICKpFADlTaBlMhQJsidBRI+FWgcDEUljC8BGNA7o+w1ABgsW+wXwiwUhnsLMTP0L4LcPQIrsF+pV8l8AYEEriKJSI7+hz6wXhKE9LLlS0M0gx4LXteGIpRCe154D7HzQCeJoDExVDwQ4p8MxrDBjBzUsWLUCEEGlU6rfBDBcBmJQdUWy0EGg6TIQ7VTOzyq+E+N/PgCtVD4A0mHAQ2OjbiAGNKrYQTWGDaNkGFrI7ADEs2C26WC00GmQSKeBfS8LQQuFkwDS14K47wQxlNclycLHAI6PyGEg4YVb5TwUV0QuBP/S2RrrJ0FMm0E4T+mb+C6eBveNB2MQowm3iroctoQSgCE8vLGbW7sCYFMCcJ5QTM6vANiUAJyj0wHyLAAuJQBnSO2IHAuASwlA754adnRnWQBMegHo22hOXlkPYCc4PCOFno3f+aukJ6JKmQjglFIH2CkJ5jkURK/ClJ29wJdBLgB/y38RgMHFoEVEg3BCqQFgFgQ6VctfHose3bO7SvZxgEICwjgm1gm7gbdwR204pNYG8RsDu20Fsaf4+7sFwQyfEcGe4j++7uMgxawDsaH5+7uvADfuqQy9eG64cqVTwGNhRmHYEvz+c2a/AjToB2JN8/dvrHuAP+zd62KiMBAF4CkWUBTFG6JSLz3v/45bbbu77noBm8AknO8F/EFMJpPJxJWmMfJN2f7/w158ESq+JiJnGmOezJMF4GSg9764iOic7vxZAHRnhOWTgpcAnG0HUUWotjJAjAqPMGTs0QJwkuTQSUyK5jAkd6QjnPsVomLQZItPnS4Du+UdKok50x7OOl8Fcl2ks0ZYjNmUAHeAd0xVngqJKf0UpsROtQNyPAzQlv7xNAD4tIM+YkT4DnMK8ZXGbICYsBwDYAbgsYm+x6XFgOkM5gQONQStb6PuUEB+bpHjA48A3GwaoCv8c/cmsLOBoKrwz+cA8Fuo7D0RPdnfk5XHAaDSjKD8yOYAkzIH3oVU0TJDywAYpTDp4N0RoANbAXledIRRsecbAJ05YXnaNMMJM8Ct75zaGQDDHL/xFoi7m0F5TljghBvAJ4Vq3hiXpyRjXOP5u+AiHp4LyTOGJQybdyABcClScllExfSPbScSAJcmOhJCUluyhWkzr08Ab0lU9BKWuvo5TAs6kgBSmRKUeqJ3GHfwtATwsYGC2yJSy6AH48rOfn+RQfuFwlJDuId5eWcSwNdsWh8BUt10iw/8/kYtYrRLKhvFMC/eSMe1PQKkoskcJ/z+vo2Aeps/fn8Rz0aAVDF5wxm//5lXkaBU0C/xB+O/M2/yAfLQZAUrSn7/3wYl2tLS6g8c+P3/Mg3QErkvmcOOoMP5v2uSHtoh94SvMeyYdfT8R9/psNwxyGBJ5kUbcLOWW7RBbop2sGXcwfoPwz3W7A+AYYCreAHsXwq7LP58ACQrWPPO739LgcbdOPdNYc1aSFH7ALli2MP/eP/jAXXN1qppdvZH2qH7Xwr6rTwxAKJ1CntKHv88NAjQJLnUD2BRj+m/CiYZGnQ5+Mawacv0j76EgPwxOcKqFdM/FYU7NEa+RfsYVu24/dfYQOD+4s/tX1uGMZohZ4sMdsXc/tU0OKAR59+aw7KA1R+1JRmaIJIccRPD/xZFb2jAskhh25Hhn94nZ3M8xCdgW9OP4TyGfw7lhb8w/NNjqaWZ1JPGnWz+IuJmVtC8guGfgyUCxsTev/5wCwOBkx6Xf0OWyh6Z4OGfCa0357HsRcighYaWcjWUC6EbtLRntmnM5P9tahq027Pm7u8BJT267Thw+rdk4sQyMOf0b034oj4plL4KWTTQ0WT+phmTP3UpaNcNVv66ZKjvDfovAaO/RizVvDh16Y1Hv0/S8GrHj5U8+mtQou54aMXNX7NGqsoFY977qcTXw4E5u/5V4eskkPPvX5mPkcCKf/9aPNsOMPi3xt5TDtz7+2QYoDUBb/0oEO3Qkh3LPnXYZGhBxoM/NcKXGA2LX3nwp0myQqPeuPfT5n4wyODPf9E6RSNSFv0qNZ2jAXP2e9XL/jrQ4+yvmuV1IN5z9tcuecMFxv6dY6vtZ8Zm/44IRyWMO4w4+7sjKlIYlRbM+7tlugJY9NFp5kKBjBc+nBSOSi7+3WYgFEjXXPxd9tOswJGLv+sGYzxtzJoPHwxneMqMaX9PhKMDagsY+3kk2ueoJX9h7OeXZRGjsnjNcn//THYpKokLXvX206SI+fm7bbnOcVfOyd9z0b7ETQeGfh0QjQJc1ePGryPCfob/bPv8/B2yWOHCiuVeXTMtZvgyK1jq30nLRf/1tb9g3P+rPTgkAAAAABD0/7U3DAAAAAAAAAAAAAAAAAAAAAAAALATZ09HWAi+hXYAAAAASUVORK5CYII=",competition:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACjCAYAAABotuf8AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALiQAAC4kBN8nLrQAAEnpJREFUeJztXQmQXFUVpaBCzCIIghAooCBRIZDp7r93/+5Ze++GYrNEooALUux7sYmAqIAUQgWpArRKBBHKsMgiawhhEWIpi4AssoY9rAGUBEgGz+2ewDDTPfPf//3+7f79TtUtqMnMe/+de9599/3/lnXWUVBQUFBQUFBQUFBQUFBghe7k5unJ/FlWurzMSBVXGcnCMOxTZQ1tGBx9DK6W4/8vBG+D3P5rSxipQtl0S4/Ymepqp3fnT5V5N+IMAnuWOITApnH7sm3Qo/dtBWJWcDuo04041JxchdufgaHZ2el6srCfZudOQbS5xM5UrvFjIORlbqdExcDna4hg1/r0w58S1tBpdZ9mNwxdUAkrux7G953NVGkhGvGula6sxn/ZSVUW3ODLYfIpAsWt8PE+8PX6oQmLwi0e4G1uEpTJNQjsE93JHxWWqBIImyu5G60sNHF9DJ+XpIoK4+80zDx+xd1YZeEahsSb4+bgTGnCQpI+23LLz3E3VFm4RjkXhsSYNGHpyXwKSd0n3A1VFrawKmswU5T3GgMhcX/uRirjMfj+TGnCQo51DHcDlfEYfL9AmrB6jP4TuRuojMfg+wulCQuqPYO7gcp4LGFlr5YmLCtduZG7gcp4DL5/UZqwTLd8G3cDlfEYfL9cmrAwM1js56HsTHUVbGUzc3qra7iJi5CtmYTvVfQ7ouXC929LE5aZKi0SfqBkYdhKlx0ovqnpyfxF6iN2cCMOzVRx4UR8079BJA+Ilg3fvyVNWJZbul30gdAQsm0mFa1buoPbMZ1uxCE66XYT+hC+QL70kI+y32idksY/1K1+Gqw7hZ7JyrYzlQ00J38BGv0yhsaxPRHhu6o+fPfWhrIPxv4cnC3Xk8U/O+BwMp7JFyjjcdG64fvXWqOiBoBqr/BDSI/eZ3gpn9b+xIyBr2P4/IFmZ09O2NlTIbZjEbrzqPsqfsfyGni5xEgVMnqycEyNGzt3On52UMIeioG7GV44Jl+gEz8lWjeGwgeDqWcCwOm+XpBuPy+ZClp33Bz8KbdjuS1uDZ0UlEfyBaLPM6J1w/cXBa27KdBLjvJDiOZkvxO07rg51PVv/RGhjgvKI/kCEest0brh+3OD1t0U9BHaz+wNofskO11eN0jdGBqP43Yst+lIC4L6sOaLTEV4hQp8f3LQupsC+Y6vZTO00QKkfCVI3bqTO5bbsdwGDo8J6kPyhSMYHGrLZpx8NWjdTQHV7oQZyLs+1H7HvERm0lcOEwGh+Hhux3JbK4ZC8oVovfRiFX/nBK27KZDAbQHF3yv6YJZbfgeKTwepO4HEldux3Ibk/cQgHMIHU034QlxYlWWYPE34fiwQMK3dGMK6xofikWflfxikbkyzz+d2LLchYp0RhMMevc/ykyNjlHoCHXuzIHVPCs3J+UqijWTht0HqxRT5L9yO5TY4+NogHEIcZ/kStJO7Pki9nhA3B4Z8kvIIprqb+q0XY/wtXutCr/yQti1xC6HVZqaKN/nlj7hHSvIvP/XC5/v7rdczoPqvYTgUPrgD4/R7mNlpfupEtJuOOpd6dgB+F9PqF7iF0GpD57rLSOan++EQUUcjH4jWiYCwBj7f1k+dwkAS6Gv5DIT1Bz/17Rh3t0QDn/ZcT7JwPm0R5xZCq40+xczTej19Hhvns2T+ND91mqnSY37q8wXKszDUDAs/pFt6GxOArUXrw2xoLkhd7l1Y+aPxjGdyC0GCsF7X7OzuovwR5+D+bj91IkpeJlqfb6Bxup2uvO/nQeH0wy23NEWkPtrPCFI/8loHkZ+wsidwC6H1wqrSYXTCZykQ5/hbX/4Cl/Lzq7VAMjfDdMv3+3lQzO5eQUMzIvXRpwyv02T6vbg5OBs9zdd3zba22kK+klA6QUdNEed+6oOPP4Kv5b5mGAv0nAX+CKoOm27xAiNV8Hw8DoY1z8t1MPNZiQR3Csg8jF0IEgxD2j2efQSO0YnnE+d+6kKuers/dQQAKt0dCfUqPw9Mh4Ohwdt7rQvR53XPwkqXX6C/QR2HcItAhqF973j3UX57/P6D/nxU/QQ+/p4PaQQDpqD0Fv7SAD3vaTR80jAbM/rn0GFgAuXWXiKCmAO5RSDDaNKUMAcnnRliBr4ZuLghgIAfJB+3QitCQERYF7nPbqJfykcbItE5k9WDxu0hQPpqlHk6/Z1m58rIR9iFIMOQN034zdDJVKZAVOc2WsbszWqf4I4hH7dKL0KIG5TElzy/BhgnhHRlZcwc6G1WPs0ekSf8TEBYKyD279PfxoyBPtohxC0CGYY2TviJJWFnDXDheRY91uDT1zEBCv8M0tFAYn0UlO2zZ9TyrQ8ggEMblR23BrdFI+/yWhZ9LAUhtXOcSLAQZSSP9sYwRS9Kt2jEmZ4szgcPrwUpX3PyR8rUjCfUX76VPTu/iSDeQqI4f2zZCMcuSPR81ilEuBhDYe2TBwQGYRUjKSx0xvfRoe3xfBVIVE8EFO2biHjCL7GlwHSL+wU9+B+EfBAzBg/E8Dd1bbkg6jCRHM5MFT87EQX51T4ok10EsgzcHLy2rcQZOtKuxGEwwVbXoDPyR6u1wMPQDPHi4IRV10CkV6G8OVQuyrxO5O/xd4evfSaI7Ehu58s0DPOXUzvj5sBMiGxBK1ZzQJhLyZdcOmoIPNA3EaKFly036DXD1ECIam/890nvpJQ/pP2Ha5+H9iNyO1+m0ZBnuWVE5fLN4P2/gXlPV+hs9305NdQURqr085FDJwITNzK0iry/uhfJ/mfLZzE0RH0pM7hp3b1D5Dt0zPa8hwcheSYe7iIOolHveWsTdwJ68u/bwPkdYXSKkO7k5R233Qogt+nhOEeL7n8Z/RxqKbM3oyEV+ZrJJBcxYBja1PK5rMYnObR8dqvRz4BeGLmFfhJ4e19P5nfh0okvIILsgajxfBgEIb/6wjGGCSvbg4RW+ESVbjL45iPyEbgL7xKmVgHj9gB6xZsyCaJZJKLTJaPr3THu9ocl6k602gtpJ19mkkVw4OHXQ68oIXq0ZKbYRFgfjv0khDoPws8DT8GjaOQLdMTDyDdcumgZ0JDdEEH+I6f3lR9O2ENzRtenOflf0HkD3E5sN6OcinwB67zhrxlGFvTf6WcTxkQ2dhgkYFZ6PbcT28nqL51LS/1sZOkIJOzBjSGEK2l1YqsIM5L5cR+v0TOFDxaLsoHzKzQ7O6eRTyIDDFHTMFTNR/R6Nbiwatuhdhhdvu7kpiNiRW4XtB9DmvA68s3TiXMuf4cOJNybGqnCwiAfT9ETb7PT5amjy+3R+9LcDuW2+krawkJ0ukkPFY4kNCc3E7YLSBBO7GmbF4gb99EU0fBgbsdyGi3yQ4c7WrNz7f2JJgwg6myAsP2iCIEYSl8ZW07cGtzIdIu+N3h0uhGHGAkCHyQcGcTNQcsW2IlD67YstzTuWKSENdQDwXVt4o5capiOMufwYdtBs4doQ8ZNgj3zyYSdHffh1Ki/GO3q91fgZpHmZMPdvdyOSNQP/HhDhDzkEH9sVJaZKl7G7Vhuo8NT0On2DNuPbQeI5HdixFVXNzrBV0/mDSSuwjcuRNEQte7g8GXbgN4E05JiEdJMt/wohDVrbFkQ6An03ZDbqe1gdDKP1i47bThgpArCB3doTu74RmXR1i9uh7aT6U7uR2H7s20AMfxNhCz8/rJG5dBOFUQ+9bZ9lCGC300bfsP2KTswg6uKfDOkg94QrY4eW07M6F8PQ+MB3I5sNyNu0RGP4PAtGzAEzrDSYhdfgqT75unjt5WjV85C71SrGRqJK11Zgk7n+6TqjoOeLGTqd0F77n1rmr34M1PFvZGsRnIrfQuE9W7CGuyOXEuzh6ZAJOeJEISItERP5jcZWxYi2Pr4N+GbMrrJEOkfwAxR6MzXjkTCHtKQaHs+uIKuQNOcbMP12RgG59K1tdzOa2erHdQGzsP2c+igE/e8nolJCaiRLJ7XqBwnU5mGIfVObsd1gtH9R8i1Ng/b16EBSftckdsRLLd8HwgZd1apVt+ksVvQE266xcD5CojrWxw+DwXIrQRu8Kp+2uxIHfx8W9MtL+F2WCcZnRcbtr9DQT0fKnvOh5A7rUbS2fA8eAh0P7ULR8woF01YQzs04rOjgSFNaElLfaNE4fhGt1jg599AD/R8G5iy+isbzcmdyuB6uTBT4is7EeH+DTL0RuUhApq0TZzbYZ1kyHEfDdvv0uFHWCPiWtaj9321UZkg6tv+j5zuPkNu+kjYfpcODIU/9rcjp3Y2w5X4+y3HlonZ4fT6eVzdvWrUk4F73cmdxOF7qcDQtYXp84bPkUNXz9YaHA6Gn8+DCV+A3m2G5P0xJO8Nj/DueCDh3qj+mkA8wpC4MJzejzLGrXWfp/V+GT9/jNt57WrEuZkqRXuPIaJLDA290RE4X/Rzqw7b6cqDKGOXmNH/hYMtUOaudqaixPVFG0aO+lyN81Sp80+XmQwY0rZGYx/ySxidzozZ4qWa/cXdKCjTQEKvVpKOGKL4I+Da4vIzC+Lm4MZ+r5Nda+iN7xnJwkUoa08kppuOlDuT8glup3IbcYvOF+f2MwsQXWIj9+n5PtqIci8Mj8tB5N9R3i2IWjchokk9RbDNjc7Jf4a41exc9Ie/ZoCwtqHe5fVqXmXNjTgEn0thDV8qdyWQCyygD8/czulkIw57jP7uWYrsBQlraBNErgsRxgNfm9JtNrIs5krikNuPbYkeva92GK7pltVnGs+iqn5ipkqHgrupkzPc5YiZA3Mhrsf93r7eHUbnipZfSljZLF3Vy+2zjgEiVwLEXauO1W4oqo+IG93JN732WGEC6Mn8hkaysBfyB89bxaJutFTISBWOIG64/dPxMN3iTiB0cZeffUVD32LDLQ5y+yNSQOSaqtnZXTADeq7bBIY2v4YZ3wHEAbcfIgsMAdvQwWvdsPt55J6guxvtVFKQANrZGzcHdSOZvwzDQ+ReTdB5rMijbsDseKgrdjG3IxDBXCtdWuS04LJtdkMb6JMM2pTl5lVhnfrpNWaqOB85yKJO3BZGQ56eLPyj1oZUYSNuPhXGAI6Zgt4eR15yvuWWl7X1h+36B+MV9KwGfW3As3Pzp+ABCWvwS/P0XldzcjfTKsp2iGQ0m7XSlZc0J38z8qfv0jNy86TgE3FzYErM6N8GM6u9gtzb0wJRfYzo9JMeo38OPRM3LwotBGZbK/iEVXnXdEsONwcKEgDnBr7KLoCwXoWw1AK8KAIJ8m1cwjJTpdswDG7FzYGCBCBinMd1phbyq19j9jeDmwMFCdCT+V4I61kGYQ33GH0x7vYrSIKdLk9B1Do1zNkh1UVHLtlqMV60UTtDIu3vDAk/ZqXLj9GRS9ztVggBiCCz4PCHnV65kYvqQF1qlWc3QbOzW5hu8RQZyTyVabml6xKoA0PgutxtVQgZmKk5EMEqCcJaaaaK3XWPjcLnwFBlYziUcMdh9UOUfRh3+xSYQMISudNHJGKh7MO526fABLM+FEoRlhoKuxi6k3eRXLd8ZkhlouxjudunwAQ4v2inW79Oi8pE2b/kbp8CE0y3dEjrE/e6Ice6irt9CkxI2NnjZQnLSBZu4W6fAhOMlMilUWKGaBi9WyAUvMFyy9fJEhbyrPe426fAALqEG1FlqcQca01XXfStUEfM6E8hqjwjS1hkVAd3OxVChpEsHij77C2qg7udCiFDTxZ+QzuQZQqL6oibg2o5cjfBTJXukSkqMqojZg5sx91WhRCBxF3CqoYxwkIdmp1zuduqEBLi5sB+skU1ajg8lbu9CiFAd/JT4OyrwxIWotZfUafKs6KOhJ2dbWcqL4YlLKoLdea5260gGUaysGeYZ5iO3A67gLvdCh5hpArT49bQ5pjOz/JqCWtoFoR1cViiGjUcPkp1izwrGdr4FW6euwa6k9sIOdK5iAL3IRo8KWhPwf4XtrBqN8PW6xZ6XgjyAbT1crR5NjfvkQXtJAbRVcstvxC+MHjNSpffQNsPVLupJUBzci4Ifp7byVw2cl2xeifWakBUoedG7WbEAbcfIgU6zAM51RJux3IbcQAupnH7IzIwksXNnEz1cW7Hshs4ABc93P6IDIxkQQnrM2EVlLBaBSUsJSwpUMJSwpICJSwlLClQwlLCkgIlLCUsKVDCUsKSAiUsJSwpUMJSwpICJSwlLCmoCatXCYs4UMJqIZxMZWoY+wDb3WocZCobcPsjUkBPPRs9lt25nEYccPshctCcbMZ0S69wO5fLrHTlfeKA2w+RRMwY6LPS5Te5ncwgqvfQ9n25+Y80NCcXN1KFc3Qnf0/CHvpnlI3aSG2lNnPzrqCgoKCgoKCg0D74PybY2tE87U6rAAAAAElFTkSuQmCC",bin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVR4nOWUvQ3CMBCFX5MGloAJwgQwAUwAYoAwATSUMAGZACYgA/CzQSaAjgGgQTIyegU6WfbZioQET3Lxonf+4uR8wL9oCcCItUrZyDS0vgewqhnK306nnDW2NqiK4WEEYMSavSZcMlx8PJNHl35Gv9EAFo4uMQHAmn6uAUwY3kYAdvRjDWDA8CkCcKbvawBdhi8RgCt9RwPIADy5MgXAlQ9KvpHxAFwnDkp+U+MBuP5ZULIrjAfg6rqgZF8bD8B1b4IqWFTSHx2Ag+fmNzpbqoTZhV7EdKwTpi/aAB4R8/8OoIVITQHcFJvbjO2kH9UL+0+m+SiE/A0AAAAASUVORK5CYII=",checkMark:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE10lEQVR4nO2ZXVBUdRjGdzS78BLqSmqyIKducjKZuvKqNMMpMgQW17IENEIFEWhVViYEJlm+dmG/JAFFZFcQ+QqlRKAQiNUWli/5EJYFgd0FUWI/gJ7mv+ZkAp497GG3Znhmzv3vec/7f//veQ6LtaIVrchuySFfLbY0vpc528DNtDQUCi31bemm+vE0Y50lZbrWkmysGedP31AnTVUXJk1d5yZOVr/LA28Vy9n6AU0vSeaaEiUzTVrRbCMyZxogtNyEwFyPdNMvSDXWIcVYi+TpGiT9cQOnp6rx/cPrSHz4E+Inrw3GTV5N4Okr3BwOnoVbL8rmlBLJbJNZMtsEuvAJD6pwavIa4u5fxXfjleaTExUi3oOSFxwCL8MttnROaZDO/Qa74ScqETvxI06OV4CnL9MfHyv1WzZwCZrXnIFSJvtTCcbhDWU4oS/FcV0JuKNXxEGQrGEafu0ZKCuWG/7Y2BV8O1aMqJGict5QyVomK+8w+OjRy8QAjg4rqnhq+fN2G3BE2xx7Gv7eJUQMKxA+JBfZCX87wGnww3KEDRXgkDbfd0nwOWh0lc0pdc6EP6y9iNDBC4bwoTz6I5bMeWfDHxzMR6gmDyH95zNowUuhcmPkkmIA/puB8/h6INcc1Jvzss0GrOuBg+CPaC/CuywWIT25i8Cfw4H+XAT3ZSfYBM8DVolnmgYdAR+uLcDGU/5wYb+D9Yc+QHB71oLw++/mILD3rNYH8tWUBshW6ajKvxXnB9fdm60GXPw3wT1s24LwQX3ZxAC+6pV5UhqwrsSOgud4zjOwOHwW9vbKoikNZFhuFi1728SzH8Fz/jHwysH3sU8tXRT+y54z+KJbpqA0ILDUq22BjxkpAefn04jVly+t8k8YeDVsKwLbnw2/t1uGPXekLdQGTL8aKOGHi7EheocV4O14NmJ0pfQr//ezPmwrZeUJ/Od3pNjTJdFRGkg31pmp2uZN7if/gtgUH4ATo8X0Ks/xxGsRHyKwXWYrPHZ3ik2UBlKna81UPf/GUwYevwnuSNGywXO6xAjoEFEbSDHWGKgOLHewEBuivOZBbYzzQ+TwJRvaZhv2tUnpwXeKwG4XUreQNT2wYdpEaRR4fQETpNoRWgXz8B0Z8GsTUh/ipKnqIltHZUR/ATwiFzbBWNt0PoL3bxdiV5uAeoyS3IbOnD9y9wI8Ij+aB8tk5f3bhfBtE8BHnRZFaYCETnQvqcN9ec80wQT8LnU6vFtTN1MaIIlZwmSVhu4NG9qTC/fI7csGv7M1bcDmNI8kZkvZ50O6s+F+dDvj8J+p07CzNTXeJnjrW9BXuJHEbCkfI/s7z8Ijeof1sefA+j4J35Ji8rnNX8eiIxL32f8lxUjl4a1KFtCCt76F+5UuMfoynbPhP1Xx9V7NSUvLTUlW6VT4lmR4t/B9WPaIZJXOgv/4d76QZa/Id2jUaNFlh8Or+GVbqnnPsZgQCVoj7inKHQhf6tUsYSbcfSwSeZOs0hFts4Wpyi8kklWGavJ1jI/KFv6Y3QfWVoVoc1xJ3Hdg4JyJiUvKW5Us8FHzXViOVrAmex1JzAL7sjW0dxt1moasB7Rv2OUQWbJI6ERyGxJ9kPSA0yU2cLpE5oDOTDO7Q2jwbxOoyD5PVmKyVf4nfrOuaEWs/7/+Atqs1blaLwVcAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+ElEQVR4nO2aO2gUURSGP8T1AaImIGjUIkIMooj4KgRBbFJZiYVY2agIVj5WsDC9VklIsLNQwS2yhZVmN4KotYVPWERFLBbER1Y0aBy5cAaGZXZm7nhn92bmfnBg2T1n98x/z5z7mAWHw+FwOBwOh8MheDm3WLycmxMgDi/n5gSIw8u5OQHi8BLaPHAJGBAry3uFqYBySGy5SAJsCIldXyQBBkJiNxb9FricUdK3gDu2CTAvImTdBN8Ca4C1wAebBPC6YL+BA4HcDgJ/iiTA1ZD8rhdFgMfA0pD8lgPP8i7AV2AwIsftwM88C3AiQZ7n8yTAJ6ACnAK2JEkSWALU8yDAbdKjFl6fF7MAH4F+/o+jNgrQBI4BR6S8w3wWgMOY4Z1NAlSAdYHv6wNuhPhdwxw3bRCgKaMexqE23+fACoMCnOy1AJW2UW/nYcD3F7ATswz2SoBmxKh3Gn01f2fBMmAlsAnYD5wD7gKtrASoxIx62OjXZf7uJquBM7KrNCbAC40ERiXmC7AZcwzLFrwGvJKRbsnrmnymfHxUz7liSoBRzWSV/3HMsA+Y1ahUVXV7dX7AS2BqM9JtSsAk8DdFk1YxE/IdsXgGy98U/W29JK3NyrokEi/FIUWWlDRLPs4eyYzREdvKf9Lgxfs2HvWDXo/tvZz6+A0vyT0/F8i/lbAn7LFVgNOBXJKWfiMQ00gYM2OjAD+AVZLHNs3zQ58nGnHDtgmglq5pnjNOB+KmNeIu2ibA2UAeNY24qUDclEbcA9sEUJsYnzcdfFpyn6tSr8osMRKIG5H3quLTiGiMr20TQD1d9pnr4JOWuNnDCgGChyTfuyDAt6SO3TJ//u/pLWALM11ogvexmLTTYFUj7gIWM6RxIarUfZ5qxG3Fcuq9WArbxC55gBJ3MarJGdsM2cZEBrPNGIuIUsqnwKkPRGykz9CpUD3JkZjNlTCe8lB0Qco+7C83i44dwD2Ni1fdfjc5ZEj282pLqx6GqI2NspeywlOfKZ9I/gGPNfEFBL9FwQAAAABJRU5ErkJggg==",upArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVR4nO3YywrCMBBG4fOE1oWDC/vsCiq+RAuVQLpzvDVtJvAfCJSki/nIqgWllFJKKaUqtwfuwDU/N5kBAzDlNQI9jSOmFjHmIJrCHF8gBmcvvdvMTYzACTg4Z31LiLnwGPsCER5jPyDCYuwPRDiMLUCEwVgBRHWMFURUw9gKiM0xtiJiM4xtgFgdYxsi5opjaiCKY2oiimEiIBZjuoDfDkdnpjSr2y0Y4h0m/dBwewREeJg0q1uXpedPV1epDrjkGXe1h1FKKaWUUrTVE5bz7NyN3sYLAAAAAElFTkSuQmCC",downArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAgklEQVR4nO2UOwrAIBAF5xKReP+bJFV+TSxynATBQiSI0TXVDggW7htesYKiKIogE7ADRiDLZxzAXPJ4BW7ANcpNyPBZS8nAAJxh4AJshTTNGGsH7R/SFnmztEYuJv0iF5eWyLtJc/Lu0rfddMld4sPJErfs3jTFt9vC6d5UURSFmAePTDtnrV72/QAAAABJRU5ErkJggg==",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvUlEQVR4nO2XTUrDQBSAPwXBn7ps0TO4EFfd24obEfQQHqOt4qIewAt4BkFci+610IIW7MpFXQtWxJGRNxBK02k0qTPpfDCUvDbJ+/LezDQQCARmBpWTQe5EfEUFEcdQoSKOoUJFMmIZOAG6wEA+G8CSTxXRyd7F7A+3FhmnRI4lh2egAqwAVaAn8bovIl3JYXsoXpX4ky8iA8mhMBRflfh7miIlYJNsK1IZiu9I/DEtES3RAtrAIunTkBx60k4FkTBzpJaGiJEwvztL3+NnVdKr06hV68by8CYSiUroCfcpo5yBjE62LvcZyGdtgg6wihSBB/muA6xJNcyxbaOaFmqcSLQSLTlGnk5b4s2YCy/giEgpRsJQjrTYHnAAnAJXQD/mnKmLFEe00yialtdOfe76f4mULJWIYlqsL5XQFTmUfWbSa2Qm0kqYQNxqkuSBZCKiLO2UhGiLjmu/rSxEOilJJJH5kF19Pu05Mi30HnQOfMm9r/+wOCgX/v3uAi9y/1dg31cRpBMuI3lcyIuVdyKaOeAIeLPMqXHDCRHDBnCfB5HfEERcQ4XWcgwVKuIYKrcVUZ4PciMSCARmgG9mLvK/OR2iiQAAAABJRU5ErkJggg==",flag:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAACBCAYAAADuS3kqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACfRJREFUeJztnXuIXNUdx913shutjfVBqtGFupuZ3Xnd9zz3Ne/dYKEo/isSEGqFSlslSFBi2kStSqkiCEGl1D/ECP4hKLYmTUziZjfRjUl8FzU0pbJLtIlJ1t2N37PZQHBM9t67d845d+b3hS8z9+59nfP73N/5nZnZmcsuI5FIJJJE0pOlpqg+2NwbTbUEQlZLd4/ecnNAbT3vrqDWuqbXbA1GEq0RbaBFSxSbRF8zySOF1b5G1cqtDCl93Xhcq1r530X1gYeMVHlUTxSPYnkqZgydBCDTCP4cfJY9YnkG608pVu44gDiGbXdFtP6N2P4+xcwWw2p/AH/vwHYEi+xC8BoQrOUI1q3wk1jeA39ppIZPm+nhOSuz9uxSjePMmjgeYPlIjeffCGt9vwcoAZyvRXT7SQvCUHAFAjIIGNYjUP/A8gkzPbLk4DsxzjmtJQrjgGNzVBtI4FpaRfdL3QkdvwypPaPFC5uMZGkcmQAgDHMF4cezyMickSxPApLtuL518C8AS6Po/qppYShYjbtwHdL2q3qyfEo0BIsMM3OoXY4iez0AeDvNVLlBdP/VjHC3tQGComLmtgGE06KD7caA42u0YyOK3JVL7hAccAW8DR5d8L6LeAze6kEMpBIq/lvUeGEn7rrvRAd26ZljZE5PFg+j7uhH1nA/pOBgP4E/sXni3R7GQ5gwdbwaIGzAuPwpagVPZgwyGVnjjBYvbsEweLmrDqonKBQru0q18vdjDJ4UHbhqm9UbGBJfQpHc5bijcIArah0KFI8rAMPdyAzHWIoVHTCOnsFM5UHHHVbLUKDwuhLTtQ1Ip/+TIEAiPAsoNjruOIdQ7KlC7DwXIOjQ4vlfYZjYgTQ6I0FwfAnFx7UCRdQY7EIR+SJgmJYgKKJd31AoZu46DTAgSxAMHkBxuZ+hAAjNmHr9AUPFvyUIgmyuLygw1boKReSv8fhxnc0onELxsOPO9RsUmHtfjaxwJ4aJccBwRoKOl9lcoNhbhTjbEoaIFTEzu05Plj63MpQZ6hYKI1VqiZlD3agb/gYYpmiYkBiKrqDeGlIyN1jpYc8/6ME+PBLVB8PICvdgmHgbU8uTEnSuX+0aihVOoQAQIRR5n8HPhrW+jGrl25YCgmJmGwFCGhlhA471MrLCccoKnkGxiQsUCGAMQZv/AAoeZ1D8/Ze9RqBYubvwPN8TSXZim9W406/HRf0cvhLPVyELrAZQnRGtP6InSndgm3uxfif2+8pIDc9K0Im1ZjFQ/MBz7GVlzAxO4vFrKz0yhXWTWP4cy5PY5zj7WBt7a5dtK0Gn1bqXBMVHNk/yDtsHd3z0IlCQ5TJBQfYOig6CombNEQozGwEU30rQaPLiUPyRCxSYQoYJCl+YCxSj56DIERT+MEcorFyIoPCF+UGhnoOCXn6W366haHcORb6XoPCFZ40ULyjiBIVPzBOKAkHhD7N/QP6TWyg+tHmSfWwfLVHoISh8YZ5QFINWeuSEBI0mywKFTlD4xa6hWO4YimQpYGUICh+YoCCLgWLsHBRlQLGWoJDfDIrNvKBYg+f/l6DRZFmgMAgKv5gjFKlyN0HhCwOKYVdQLHMKhZkaJij8YY5QpEe68PwbCRpNXhyKLW6h+MDmScYXMsWNOFnNf5lYDZgfFOynCmJm1m52IdcDFDcHVPZFIXb3IfsQijbnUGiAIntEgkaTZYGiKwgoTILCB2ZQPFJtKPZfAMVhCRpNlgiKJoWg8IN5QqE3IVMckqDRZFmg6O4hKHxi11C0uoECw8f7EjSaLA8UBqDIERTym0HxaLWhOHABFAclaDS5ilDYfc2BoPCXOULROw/FhASNJlcJihanUKzpNQkKf5g7FO9J0Gjy4lA8xguKRoLCF+YCxbvzUISsRsXKvStBo8kEBVlaKAKAQrVyByRoNLlKUDQ7hyIOKPIEhfzmCEV4Hor9EjSavDgUfyYoyJ5BYfcDM++xfYLhBINiXIJGkwkKMi8omhxDEQEU8fyYBI0mywJFTyRJUPjDXKFo0OKFfRI0mrw4FI9XG4qJeSiiBIVfzBuKUdENJksFRapBJSh8YbdQNDqFovccFO+IbjBZJihiKTZ8EBQ+MEco0gyKvaIbLKPN9MhZLVE4ZaTKX+nJ0ljUGHpBtfLPaoni01j+q5Es/0WHsfwUsu0zMTO7VbVyryF4x7DuhNe/3IzjPuEWCrv/7XWQ7RMiKM4DwKZ8JxHcCS1ReiOiDdyvxvO3OQ7Cgsz0MIbl/K1hrf8+gPU6IPoC677zBxRKpgFU7xEdFEEgnEWwvgEIb8aM7DoEsFNPFJrdgnAp4cb7Kc5T1uL5vyPzTFkZ51mENxS7RQeIlwHBDIJzULFyW5ANBsJqX4PnBCwiPVFcFlb7h5BJngcgtr+Z0C0UDQRFpdnQABjYOP9yVB8soc3XeB5pF0L2aAYYA7i25wDHot9QyBGKvpqFYr5QjBcOozjcHDUGA4qZ5Z4V7ArXVgQcE+yaLwHFk44P7BCK98/vByjeFh1Aj2GYBQzjipn7ZUTrlxaEHxMyx1Zc/4wMUOwSHUgvjDttFiBsQ7V/i5EstnsaLU7SE6V2tOMx+LRQKHSfQ4Gp3oyRLO/AMJEVUThWQ6h9CgDjuDgoksWdogPrEoZpdNx+DBVr0YZGT6MigZDBkyhA/4Ppq3somNxBUfIdFADhQxRntxvJUodnUZBQMTO7CnXGAQYGbyj+JTrI9jLD/ItNX6jxwnpkiZWe9bzkwrD4M7T7Jdj5ex9MLNg2O/nQ+X38AAXS6CSKyMdjxuBNyBI1UTc4EWJ0LWo/xdXOLqHYITrol4BhFrOJ15BCcyi+6g4GT1QrUACGM0ibb0b1gSxqh5orIrnKHRTl7aIhuACGGWSFVzBMpCNaP8HghdxAgTn+WyJBWCggj0aNwU3ICgZlBo/lEop/CgCB/XreFIqn7Sgcf6tauWBYyRAM1RA63O7XH7Kp63zhhuBwgWIhI5zA8LBLsXL3KOZQJ7JCk+g+q3m5gQKB+Q3u1DH23r6RWtqngy4EAMeaRhaaBAB7o8bQw3AhrPa1ITMQCDzlBgoA0RhSMq0IXjceFUwB740ZQw/GzOwzAGU3UvwYZgIT+PshAHQE6z9gZs+x/qAaLxxABhiF34poA6wuWI9tb++NpsL4+40hta8Z56DppCi5geJiYu8nIMDLAUp7IBxvX9NrdHQFdVhbsI51ZnswkliODLAMw0Ibr3aSHMhLKEg1IgdQHCYo6kQItN2vVCYo6kUEBalCBAWpQgQFqUIEBalCDqGg9xrqQQi03Z9pICjqRQQFqUIEBalCBAWpQgQFqUIItN1f+TlCUNSJCApShQgKUoUIClKFCApShRxCQR+grQch0HZ/OZCgqBcRFKQKERSkChEUJBKJRCKRHOh7LktbCRuu/n0AAAAASUVORK5CYII="},ML=({match:e,timeFormat:t})=>{var n,r,i,o;return s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:.5,fontSize:"xs",children:[s.jsxs(h.Typography,{mr:1,children:["[",ft(e.kickoffAt).format(t),"]"]}),e.homeTeam.code?s.jsx(h.Tooltip,{title:e.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((n=e.homeTeam.assets)==null?void 0:n.logo)||Be.team,sx:{width:"20px",height:"20px"}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((r=e.homeTeam.assets)==null?void 0:r.logo)||Be.team,sx:{width:"20px",height:"20px"}})]}),"-",e.awayTeam.code?s.jsx(h.Tooltip,{title:e.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((i=e.awayTeam.assets)==null?void 0:i.logo)||Be.team,sx:{width:"20px",height:"20px"}})," ",s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((o=e.awayTeam.assets)==null?void 0:o.logo)||Be.team,sx:{width:"20px",height:"20px"}}),s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})]})},Ts=$e(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),BL=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=Ge(),c=()=>_(this,null,function*(){try{const p=yield l.topX.getGames({limit:50},!0),g=yield l.matchQuiz.getGames({limit:50},!0),v=[...p.data,...g.data];if(e.related&&e.related.length>0){const m=v.filter(b=>{var C;return(C=e.related)==null?void 0:C.some(S=>S.entity_id===b.id)}).map(b=>b.id);n(m)}i(v)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"GAME",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Ts,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-game-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.title?d.title+` (${d.type})`:`Game with no title (${d.type}). ID: ${d.id}`},`related-game-title-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ye,{showToast:o,message:"There was a problem witch fetching games for related options",color:"danger",hideToast:f})]})},$L=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=Ge(),c=()=>_(this,null,function*(){try{const p=yield l.loyalty.getTemplates(void 0,!0);if(e.related&&e.related.length>0){const g=p.data.filter(v=>{var m;return(m=e.related)==null?void 0:m.some(b=>b.entity_id===v.id)}).map(v=>v.id);n(g)}i(p.data)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"TEMPLATE",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Ts,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-template-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.name||`Template with no name. ID: ${d.id}`},`related-template-name-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ye,{showToast:o,message:"There was a problem witch fetching templates for related options",color:"danger",hideToast:f})]})},Sm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="game"),Im=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="template"),FL=e=>{const t=(n,r)=>{if(r==="games"){const i=Im(e.related);e.onChange([...n,...i])}if(r==="templates"){const i=Sm(e.related);e.onChange([...n,...i])}};return s.jsxs(s.Fragment,{children:[s.jsx(BL,{label:e.labels.games,related:Sm(e.related),onChange:n=>t(n,"games")}),s.jsx($L,{label:e.labels.templates,related:Im(e.related),onChange:n=>t(n,"templates")})]})},NL=(e,t)=>{const[n,r]=y.useState(null),{https:i}=Ge(),o=()=>_(this,null,function*(){const a=yield i.getSchedulersByEntityId(e);if(a.ok){const l=yield a.json();r(l.data);return}r([])});return y.useEffect(()=>(o(),()=>r(null)),[e,t]),n},yi=({my:e})=>s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:e},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}),zL=["PENDING","LIVE","SETTLED"],jL=["OPEN"],UL=["ACTIVE","INACTIVE","EXPIRED"],VL=new Map().set("PENDING","Pending").set("LIVE","Live").set("SETTLED","Settled").set("CANCELED","Canceled").set("OPEN","Open").set("ACTIVE","Active").set("INACTIVE","Inactive").set("PENDING","Pending").set("EXPIRED","Expired"),Am=e=>{let t=[];return e.entityType==="CLASSIC_QUIZ"||e.entityType==="PERSONALITY_QUIZ"||e.entityType==="EITHER_OR"||e.entityType==="POLL"?t=Array.from(UL):e.entityType==="TEMPLATE"?t=Array.from(zL):t=Array.from(jL),s.jsx(s.Fragment,{children:t.map(n=>s.jsx(h.Option,{value:n,children:VL.get(n)},`${e.entityType}-${n}-status`))})};class HL{constructor(){J(this,"name","");J(this,"scheduled_task_config",{entity_id:"",entity_type:"",change:{status:""}});J(this,"trigger",{trigger_type:"DATETIME",date:""})}}const WL=$e(s.jsx("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded"),GL=e=>{const[t,n]=y.useState(!1),{https:r}=Ge(),i=o=>_(this,null,function*(){if(o.stopPropagation(),n(!0),(yield r.deleteScheduledTask(e.taskId)).ok){n(!1),e.toggleToast("success",e.labels.deleteScheduledTaskMessage),e.refetchTasks(),e.toggleModal();return}n(!1),e.toggleToast("danger",e.labels.deleteScheduledTaskErrorMessage)});return s.jsx(s.Fragment,{children:s.jsx(h.Modal,{open:e.isOpen,onClose:e.toggleModal,children:s.jsxs(h.ModalDialog,{children:[s.jsxs(h.DialogTitle,{children:[s.jsx(WL,{}),e.labels.deleteScheduledTaskModalTitle]}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{children:s.jsxs(h.Typography,{children:[e.labels.deleteScheduledTaskModalParagraph,s.jsx(h.Typography,{fontWeight:"bold",children:e.taskName}),"?"]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{loading:t,variant:"solid",color:"danger",onClick:o=>i(o),children:e.labels.delete}),s.jsx(h.Button,{variant:"plain",color:"neutral",onClick:o=>{o.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]})})})},YL=e=>{const[t,n]=y.useState(null),[r,i]=y.useState(""),[o,a]=y.useState(""),[l,c]=y.useState(""),[u,f]=y.useState(""),[d,p]=y.useState(!1),[g,v]=y.useState(!1),[m,b]=y.useState(!1),[C,S]=y.useState("success"),[x,I]=y.useState(""),[w,A]=y.useState(!1),E=y.useRef(!1),k=NL(e.entityId,E.current),{https:$}=Ge();if(!k)return s.jsx(yi,{my:10});const G=()=>A(!w),O=(M,V)=>{b(!0),S(M),I(V)},T=(M,V)=>{i(V.scheduled_task_config.change.status),c(V.trigger.date),n(M)},F=()=>_(this,null,function*(){p(!0);const M=N("CREATE","");if((yield $.setSchedulers(M,"CREATE",null)).ok){p(!1),a(""),f(""),E.current=!E.current,O("success",e.labels.createScheduledTaskMessage);return}p(!1),a(""),f(""),O("danger",e.labels.createScheduledTaskErrorMessage)}),H=(M,V)=>_(this,null,function*(){v(!0);const Y=N("UPDATE",V);if((yield $.setSchedulers(Y,"UPDATE",M)).ok){v(!1),n(null),i(""),c(""),E.current=!E.current,O("success",e.labels.updateScheduledTaskMessage);return}v(!1),O("danger",e.labels.updateScheduledTaskErrorMessage),n(null),i(""),c("")}),j=()=>{E.current=!E.current},N=(M,V)=>{const Y=new HL,X=M==="CREATE"?o:r,D=M==="CREATE"?null:V,B=M==="CREATE"?u:l;return Y.scheduled_task_config.entity_id=e.entityId,Y.scheduled_task_config.entity_type=e.entityType,Y.scheduled_task_config.change.status=X,Y.trigger.date=B,Y.name=D,Y};return s.jsxs(s.Fragment,{children:[k.map((M,V)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{children:t===V?s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%"},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:r,size:"sm",name:"status",onChange:(Y,X)=>i(X),sx:{minHeight:"36px"},children:s.jsx(Am,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(au,{defaultDate:l,onChange:Y=>c(Y)})]}),r&&l?s.jsx(h.Button,{onClick:()=>H(M.id,M.name),loading:g,sx:{mt:"auto"},children:e.labels.save}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.save})]}):s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"}},children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.labels.name,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.name})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.labels.status,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.status})]})]}),!e.readOnly&&s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.labels.edit,children:s.jsx(h.IconButton,{onClick:()=>T(V,M),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.labels.delete,children:s.jsx(h.IconButton,{onClick:G,children:s.jsx(_e.Delete,{})})})]}),s.jsx(GL,{labels:e.labels,isOpen:w,taskId:M.id,taskName:M.name,toggleModal:G,refetchTasks:j,toggleToast:O})]})})},`scheduled-task-${e.entityId}-${e.entityType}-${M.id}`)),!e.readOnly&&s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%",mt:k&&k.length?2:0},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:o,size:"sm",name:"status",onChange:(M,V)=>a(V),sx:{minHeight:"37px"},children:s.jsx(Am,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(au,{defaultDate:u,onChange:M=>f(M)})]}),o&&u?s.jsx(h.Button,{onClick:F,loading:d,sx:{mt:"auto"},children:e.labels.create}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.create})]}),s.jsx(Ye,{showToast:m,message:x,color:C,hideToast:()=>b(!1)})]})};function KL(e){return ut("MuiIconButton",e)}qe("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]);const qL=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],QL=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,size:o,variant:a,loading:l}=e,c={root:["root",n&&"disabled",r&&"focusVisible",a&&`variant${Se(a)}`,t&&`color${Se(t)}`,o&&`size${Se(o)}`,l&&"loading"],loadingIndicator:["loadingIndicator"]},u=gt(c,KL,{});return r&&i&&(u.root+=` ${i}`),u},JL=Ce("button")(({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[t.instanceSize]},t.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:e.vars.fontSize.sm,paddingInline:"2px"},t.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:e.vars.fontSize.md,paddingInline:"0.25rem"},t.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:e.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${e.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[e.focus.selector]:R({"--Icon-color":"currentColor"},e.focus.default)}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":R({"--Icon-color":"currentColor"},(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color])},'&:active, &[aria-pressed="true"]':R({"--Icon-color":"currentColor"},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]),"&:disabled":(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]})]}),XL=Ce(JL,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ZL=Ce("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Tm=K.forwardRef(function(t,n){var r;const i=mt({props:t,name:"JoyIconButton"}),{children:o,action:a,component:l="button",color:c="neutral",disabled:u,variant:f="plain",loading:d=!1,loadingIndicator:p,size:g="md",slots:v={},slotProps:m={}}=i,b=De(i,qL),C=K.useContext(Fp),S=K.useContext(Np),x=t.variant||C.variant||f,I=t.size||C.size||g,w=t.color||C.color||c,A=(r=t.loading||t.disabled)!=null?r:C.disabled||d||u,E=K.useRef(null),k=gn(E,n),{focusVisible:$,setFocusVisible:G,getRootProps:O}=Xl(R({},i,{disabled:A,rootRef:k})),T=p!=null?p:s.jsx(Bp,{color:w,thickness:{sm:2,md:3,lg:4}[I]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var B;G(!0),(B=E.current)==null||B.focus()}}),[G]);const F=R({},i,{component:l,color:w,disabled:A,variant:x,loading:d,size:I,focusVisible:$,instanceSize:t.size}),H=QL(F),j=B=>{var U;let W=i.onClick;if(typeof m.root=="function"?W=m.root(F).onClick:m.root&&(W=m.root.onClick),(U=W)==null||U(B),S){var ie;(ie=S.onClick)==null||ie.call(S,B,i.value)}};let N=i["aria-pressed"];typeof m.root=="function"?N=m.root(F)["aria-pressed"]:m.root&&(N=m.root["aria-pressed"]),S!=null&&S.value&&(Array.isArray(S.value)?N=S.value.indexOf(i.value)!==-1:N=S.value===i.value);const M=R({},b,{component:l,slots:v,slotProps:m}),[V,Y]=Ee("root",{ref:n,className:H.root,elementType:XL,getSlotProps:O,externalForwardedProps:M,ownerState:F,additionalProps:{onClick:j,"aria-pressed":N}}),[X,D]=Ee("loadingIndicator",{className:H.loadingIndicator,elementType:ZL,externalForwardedProps:M,ownerState:F});return s.jsx(V,R({},Y,{children:d?s.jsx(X,R({},D,{children:T})):o}))});Tm.muiName="IconButton";const Ao=$e(s.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded"),eM=({label:e,defaultValue:t,options:n,required:r,onChange:i})=>{function o(c){var u,f;return c?s.jsxs(s.Fragment,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=(u=n.find(d=>d.id===c.value))==null?void 0:u.assets)==null?void 0:f.logo)||Be.competition})}),c.label]}):null}const a=y.useRef(null),l=(c,u)=>{i(u)};return s.jsxs(h.FormControl,{sx:{mb:1},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:e}),s.jsx(h.Select,Q(L({slotProps:{button:{sx:{whiteSpace:"nowrap"}}},sx:{"--ListItemDecorator-size":"44px",minHeight:"37px"},renderValue:o,value:t,onChange:l},t&&{endDecorator:s.jsx(Tm,{variant:"plain",color:"neutral",onMouseDown:c=>{c.stopPropagation()},onClick:()=>{var c;i(""),(c=a.current)==null||c.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:n.map((c,u)=>{var f;return s.jsxs(y.Fragment,{children:[u!==0?s.jsx(h.ListDivider,{role:"none"}):null,s.jsxs(h.Option,{value:c.id,label:c.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=c.assets)==null?void 0:f.logo)||Be.competition})}),c.name]})]},`${c.id}-${u}`)})}))]})};function tM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Em=tM,nM=typeof jt=="object"&&jt&&jt.Object===Object&&jt,rM=nM,iM=rM,oM=typeof self=="object"&&self&&self.Object===Object&&self,aM=iM||oM||Function("return this")(),km=aM,sM=km,lM=function(){return sM.Date.now()},cM=lM,uM=/\s/;function dM(e){for(var t=e.length;t--&&uM.test(e.charAt(t)););return t}var fM=dM,hM=fM,pM=/^\s+/;function gM(e){return e&&e.slice(0,hM(e)+1).replace(pM,"")}var mM=gM,vM=km,bM=vM.Symbol,Au=bM,_m=Au,Pm=Object.prototype,yM=Pm.hasOwnProperty,xM=Pm.toString,To=_m?_m.toStringTag:void 0;function CM(e){var t=yM.call(e,To),n=e[To];try{e[To]=void 0;var r=!0}catch(o){}var i=xM.call(e);return r&&(t?e[To]=n:delete e[To]),i}var wM=CM,SM=Object.prototype,IM=SM.toString;function AM(e){return IM.call(e)}var TM=AM,Dm=Au,EM=wM,kM=TM,_M="[object Null]",PM="[object Undefined]",Om=Dm?Dm.toStringTag:void 0;function DM(e){return e==null?e===void 0?PM:_M:Om&&Om in Object(e)?EM(e):kM(e)}var OM=DM;function RM(e){return e!=null&&typeof e=="object"}var LM=RM,MM=OM,BM=LM,$M="[object Symbol]";function FM(e){return typeof e=="symbol"||BM(e)&&MM(e)==$M}var Rm=FM,NM=mM,Lm=Em,zM=Rm,Mm=NaN,jM=/^[-+]0x[0-9a-f]+$/i,UM=/^0b[01]+$/i,VM=/^0o[0-7]+$/i,HM=parseInt;function WM(e){if(typeof e=="number")return e;if(zM(e))return Mm;if(Lm(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Lm(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=NM(e);var n=UM.test(e);return n||VM.test(e)?HM(e.slice(2),n?2:8):jM.test(e)?Mm:+e}var GM=WM,YM=Em,Tu=cM,Bm=GM,KM="Expected a function",qM=Math.max,QM=Math.min;function JM(e,t,n){var r,i,o,a,l,c,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(KM);t=Bm(t)||0,YM(n)&&(f=!!n.leading,d="maxWait"in n,o=d?qM(Bm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var E=r,k=i;return r=i=void 0,u=A,a=e.apply(k,E),a}function v(A){return u=A,l=setTimeout(C,t),f?g(A):a}function m(A){var E=A-c,k=A-u,$=t-E;return d?QM($,o-k):$}function b(A){var E=A-c,k=A-u;return c===void 0||E>=t||E<0||d&&k>=o}function C(){var A=Tu();if(b(A))return S(A);l=setTimeout(C,m(A))}function S(A){return l=void 0,p&&r?g(A):(r=i=void 0,a)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function I(){return l===void 0?a:S(Tu())}function w(){var A=Tu(),E=b(A);if(r=arguments,i=this,c=A,E){if(l===void 0)return v(c);if(d)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return w.cancel=x,w.flush=I,w}var XM=JM;const cr=yn(XM),kn=({option:e})=>s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:e.logo}),s.jsx(h.Typography,{children:e.label}),s.jsx(h.Typography,{ml:.5,level:"body-xs",children:`(${e.countryName})`})]}),$m=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],ZM=({labels:e,label:t,ids:n,required:r,onChange:i})=>{const[o,a]=y.useState([]),[l,c]=y.useState([]),[u,f]=y.useState(!1),[d,p]=y.useState(""),[g,v]=y.useState(!1),{sdk:m}=Ge(),b=()=>v(!g),C=(w,A)=>{a(A),i(A[0]?[A[0].id]:[])},S=3;y.useEffect(()=>{!d&&n&&n.length&&m.football.getCompetitions({competitionIds:n}).then(w=>{a($m(w))}).catch(w=>{console.error(w),b(),a([])})},[]);const x=y.useMemo(()=>cr(w=>{f(!0),m.football.getCompetitions({name:w}).then(A=>{c([...$m(A)]),f(!1)}).catch(A=>{console.error(A),b(),c([]),f(!1)})},300),[]);y.useEffect(()=>{if(!d||d.length<S){c([]);return}return x(d),()=>x.cancel()},[d,x]);const I=(w,A)=>w.map((E,k)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:$=>A({index:k}).onClick($),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:E},`option_${E.id}`)},E.id));return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:t}),s.jsx(h.Box,{children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:u,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(w,A)=>w.id===A.id,endDecorator:u?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.competitionsSelectionPlaceholder,options:l,disabled:o.length===1,filterOptions:w=>w.filter(A=>!o.some(E=>E.value===A.value)),onInputChange:(w,A)=>{p(A)},onChange:C,getOptionKey:w=>w.id,value:o,renderTags:I,renderOption:(w,A)=>s.jsx(h.AutocompleteOption,Q(L({},w),{children:s.jsx(kn,{option:A})}))})}),s.jsx(Ye,{showToast:g,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:b})]})},Fm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],e2=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState(!1),[f,d]=y.useState(""),[p,g]=y.useState(!1),{sdk:v}=Ge(),m=()=>g(!p),b=(I,w)=>{o(w);const A=w.map(E=>E.id);r(A&&A.length?A:null)},C=3;y.useEffect(()=>{!f&&t&&t.length&&v.football.getCompetitions({competitionIds:t}).then(I=>{o(Fm(I))}).catch(I=>{console.error(I),m(),o([])})},[]);const S=y.useMemo(()=>cr(I=>{u(!0);const w={name:I,competitionIds:[""]};n&&Array.isArray(n)&&n.length>0?w.competitionIds=Array.from(n):delete w.competitionIds,v.football.getCompetitions(w).then(A=>{l([...Fm(A)]),u(!1)}).catch(A=>{console.error(A),m(),l([]),u(!1)})},300),[]);y.useEffect(()=>{if(!f||f.length<C){l([]);return}return S(f),()=>S.cancel()},[f,S]);const x=(I,w)=>I.map((A,E)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>w({index:E}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:A},`option_${A.id}`)},A.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:c,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,w)=>I.id===w.id,endDecorator:c?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.competitionsSelectionPlaceholder,options:a,filterOptions:I=>I.filter(w=>!i.some(A=>A.value===w.value)),onInputChange:(I,w)=>{d(w)},onChange:b,getOptionKey:I=>I.id,value:i,renderTags:x,renderOption:(I,w)=>s.jsx(h.AutocompleteOption,Q(L({},I),{children:s.jsx(kn,{option:w})}))})}),s.jsx(Ye,{showToast:p,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:m})]})},Nm=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],t2=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState(!1),{sdk:g}=Ge(),v=()=>p(!d),m=(x,I)=>{i(I);const w=I.map(A=>A.id);n(w&&w.length?w:null)},b=3;y.useEffect(()=>{!u&&t&&t.length&&g.profile.getByIds(t).then(x=>{i(Nm(x))}).catch(x=>{v(),console.error(x),i([])})},[]);const C=y.useMemo(()=>cr(x=>{c(!0),g.profile.getByIds([],x).then(I=>{a([...Nm(I)]),c(!1)}).catch(I=>{console.error(I),v(),a([]),c(!1)})},300),[]);y.useEffect(()=>{if(!u||u.length<b){a([]);return}return C(u),()=>C.cancel()},[u,C]);const S=(x,I)=>x.map((w,A)=>{var E;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>I({index:A}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(E=w.avatar)!=null?E:Be.avatar}),s.jsx(h.Typography,{children:w.label})]})},w.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(x,I)=>x.id===I.id,endDecorator:l?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:x=>x.filter(I=>!r.some(w=>w.value===I.value)),onInputChange:(x,I)=>{f(I)},onChange:m,getOptionKey:x=>x.id,value:r,renderTags:S,renderOption:(x,I)=>{var w;return s.jsx(h.AutocompleteOption,Q(L({},x),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(w=I.avatar)!=null?w:Be.avatar}),s.jsx(h.Typography,{children:I.label})]})}))}})}),s.jsx(Ye,{showToast:d,message:e.searchProfilesErrorMessage,color:"danger",hideToast:v})]})},zm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Team with no name",label:t.name?t.name:"Team with no name",logo:((n=t.assets)==null?void 0:n.logo)||Be.team,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Be.flag}}))||[],jm=({labels:e,ids:t,scope:n,readOnly:r,AdditionalCheckbox:i,onChange:o})=>{const[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ge(),C=()=>m(!v),S=(A,E)=>{l(E),o(E)},x=3;y.useEffect(()=>{!p&&t&&t.length&&b.football.getTeams({teamIds:t,scope:n}).then(A=>{const E=A.data.filter(k=>!k.name.includes("/"));l(zm(E))}).catch(A=>{console.error(A),C(),l([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{d(!0),b.football.getTeams({name:A,scope:E}).then(k=>{const $=k.data.filter(G=>!G.name.includes("/"));u([...zm($)]),d(!1)}).catch(k=>{console.error(k),C(),u([]),d(!1)})},300),[]);y.useEffect(()=>{if(!p||p.length<x){u([]);return}return I(p,n),()=>I.cancel()},[p,I]);const w=(A,E)=>A.map((k,$)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:G=>E({index:$}).onClick(G),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:k},`option_${k.id}`)},k.id));return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.Autocomplete,{readOnly:r||!1,forcePopupIcon:!1,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,marginBottom:i?1:0}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:a.length>0?"":e.teamsSelectionPlaceholder,options:c,filterOptions:A=>A.filter(E=>!a.some(k=>k.value===E.value)),onInputChange:(A,E)=>{g(E)},onChange:S,getOptionKey:A=>A.id,value:a,renderTags:w,renderOption:(A,E)=>s.jsx(h.AutocompleteOption,Q(L({},A),{children:s.jsx(kn,{option:E})}))}),i]}),s.jsx(Ye,{showToast:v,message:e.searchTeamsErrorMessage,color:"danger",hideToast:C})]})},n2=({checked:e,disabled:t,sx:n,onChange:r})=>{const i=n?L({},n):{ml:1};return s.jsx(h.Switch,{color:e?"success":"danger",checked:e,disabled:t,onChange:o=>r(o.target.checked),sx:Q(L({},i),{"--Switch-thumbSize":"16px","--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-trackBackground":"#EE5E52","&:hover":{"--Switch-trackBackground":"#EE5E52"},[`&.${h.switchClasses.checked}`]:{"--Switch-trackBackground":"#5CB176","&:hover":{"--Switch-trackBackground":"#5CB176"}}})})},mn=({label:e,labelPosition:t="start",defaultValue:n,description:r,disabled:i,descriptionColor:o,sx:a,onChange:l})=>{const c=s.jsx(n2,{checked:n,disabled:i,onChange:l,sx:a==null?void 0:a.switch}),u=a!=null&&a.container?L({},a.container):{mb:2},f=a!=null&&a.label?L({},a.label):{};return r?s.jsxs(h.Box,{sx:L({},u),children:[s.jsx(h.Typography,{component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,sx:f,children:e}),s.jsx(h.Typography,{level:"body-sm",color:o||"neutral",children:r})]}):s.jsx(h.Typography,{sx:Object.keys(f)?L({},f):{mb:2},component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,children:e})},r2={control:(e,t)=>Q(L({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px","&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(L({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(L({},e),{minHeight:"36px"}),menu:e=>Q(L({},e),{position:"relative"}),clearIndicator:e=>Q(L({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(L({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(L({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(L({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"13px"}),multiValueLabel:e=>Q(L({},e),{color:"#333"})},i2=e=>e.map(t=>({label:t,value:t})),Um=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=i2(e.tags),a=()=>i(!r),l=d=>{e.onChange(d.map(p=>p.value))},c=d=>{n(d)},u=d=>{d.persist();const{key:p}=d;if(t)switch(p){case"Enter":case"Tab":if(e.tags&&e.tags.length===0){const g=[...e.tags,t];e.onChange(g)}if(e.tags&&e.tags.length>0&&f()){const g=[...e.tags,t];e.onChange(g)}n(""),d.preventDefault()}},f=()=>{let d=!1;return e.tags&&e.tags.length&&e.tags.includes(t)?(a(),d):(d=!0,d)};return s.jsxs(s.Fragment,{children:[s.jsx(xm,{styles:r2,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:l,onInputChange:c,onKeyDown:u,placeholder:e.labels.tagsPlaceholder,value:o}),s.jsx(Ye,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:a})]})},o2=$e(s.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");class Vm{constructor(){J(this,"contestId","");J(this,"contestType","");J(this,"description","");J(this,"userList",[])}}const a2=(e,t,n)=>{const[r,i]=y.useState(null),{sdk:o}=Ge(),a=()=>_(this,null,function*(){try{let l;switch(t){case"top_x":l=yield o.topX.getGameWinners(e,!0);break;case"match_quiz":l=yield o.matchQuiz.getGameWinners(e,!0);break;default:l=yield o.loyalty.getTemplateWinners(e,!0)}l.userList&&l.userList.forEach(c=>{c.tags||(c.tags=[])}),i(l)}catch(l){const c=o.helpers.getSDKConfiguration();let u=null;c.errorHandlingMode==="standard"?u=l.error:u=l.data.error,u.code!==404&&u.status!=="code_unknown_contest"&&n(),i(new Vm)}});return y.useEffect(()=>{a()},[]),r};class s2{constructor(){J(this,"position","");J(this,"profileId","");J(this,"note","");J(this,"tags",[])}}function l2(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var c2=l2,u2=Array.isArray,d2=u2,Hm=Au,f2=c2,h2=d2,p2=Rm,g2=1/0,Wm=Hm?Hm.prototype:void 0,Gm=Wm?Wm.toString:void 0;function Ym(e){if(typeof e=="string")return e;if(h2(e))return f2(e,Ym)+"";if(p2(e))return Gm?Gm.call(e):"";var t=e+"";return t=="0"&&1/e==-g2?"-0":t}var m2=Ym,v2=m2;function b2(e){return e==null?"":v2(e)}var Km=b2;function y2(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var x2=y2;function C2(e){return function(t){return e==null?void 0:e[t]}}var w2=C2,S2=w2,I2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},A2=S2(I2),T2=A2,E2=T2,k2=Km,_2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,P2="\\u0300-\\u036f",D2="\\ufe20-\\ufe2f",O2="\\u20d0-\\u20ff",R2=P2+D2+O2,L2="["+R2+"]",M2=RegExp(L2,"g");function B2(e){return e=k2(e),e&&e.replace(_2,E2).replace(M2,"")}var $2=B2,F2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function N2(e){return e.match(F2)||[]}var z2=N2,j2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function U2(e){return j2.test(e)}var V2=U2,qm="\\ud800-\\udfff",H2="\\u0300-\\u036f",W2="\\ufe20-\\ufe2f",G2="\\u20d0-\\u20ff",Y2=H2+W2+G2,Qm="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",K2="\\xac\\xb1\\xd7\\xf7",q2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Q2="\\u2000-\\u206f",J2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",X2="\\ufe0e\\ufe0f",Zm=K2+q2+Q2+J2,ev="['’]",tv="["+Zm+"]",Z2="["+Y2+"]",nv="\\d+",eB="["+Qm+"]",rv="["+Jm+"]",iv="[^"+qm+Zm+nv+Qm+Jm+Xm+"]",tB="\\ud83c[\\udffb-\\udfff]",nB="(?:"+Z2+"|"+tB+")",rB="[^"+qm+"]",ov="(?:\\ud83c[\\udde6-\\uddff]){2}",av="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+Xm+"]",iB="\\u200d",sv="(?:"+rv+"|"+iv+")",oB="(?:"+xi+"|"+iv+")",lv="(?:"+ev+"(?:d|ll|m|re|s|t|ve))?",cv="(?:"+ev+"(?:D|LL|M|RE|S|T|VE))?",uv=nB+"?",dv="["+X2+"]?",aB="(?:"+iB+"(?:"+[rB,ov,av].join("|")+")"+dv+uv+")*",sB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",cB=dv+uv+aB,uB="(?:"+[eB,ov,av].join("|")+")"+cB,dB=RegExp([xi+"?"+rv+"+"+lv+"(?="+[tv,xi,"$"].join("|")+")",oB+"+"+cv+"(?="+[tv,xi+sv,"$"].join("|")+")",xi+"?"+sv+"+"+lv,xi+"+"+cv,lB,sB,nv,uB].join("|"),"g");function fB(e){return e.match(dB)||[]}var hB=fB,pB=z2,gB=V2,mB=Km,vB=hB;function bB(e,t,n){return e=mB(e),t=n?void 0:t,t===void 0?gB(e)?vB(e):pB(e):e.match(t)||[]}var yB=bB,xB=x2,CB=$2,wB=yB,SB="['’]",IB=RegExp(SB,"g");function AB(e){return function(t){return xB(wB(CB(t).replace(IB,"")),e,"")}}var TB=AB,EB=TB,kB=EB(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),_B=kB;const PB=yn(_B);class DB{constructor(){J(this,"id","");J(this,"value","");J(this,"label","")}}class OB extends DB{constructor(){super(...arguments);J(this,"logo","");J(this,"countryFlag","");J(this,"countryName","")}}class fv extends OB{constructor(){super(...arguments);J(this,"group","")}}const RB=(e,t)=>t||e||"-------------",Eu=(e,t)=>Array.isArray(e)?e.map(n=>Eu(n)):e!=null&&e.constructor===Object?Object.keys(e).reduce((n,r)=>Q(L({},n),{[PB(r)]:Eu(e[r])}),{}):e,hv=e=>{const t=[];return e.competitions.forEach(n=>{t.push(ku(n,"competition"))}),e.teams.forEach(n=>{t.push(ku(n,"team"))}),e.players.forEach(n=>{t.push(ku(n,"player"))}),t},ku=(e,t)=>{var r,i,o,a,l;const n=new fv;return n.label=e.name,n.value=e.id,n.id=e.id,n.group=t,t==="player"?n.logo=((r=e.assets)==null?void 0:r.headshot)||Be.avatar:t==="team"?n.logo=((i=e.assets)==null?void 0:i.logo)||Be.team:n.logo=((o=e.assets)==null?void 0:o.logo)||Be.competition,n.countryName=e.country.name,n.countryFlag=((l=(a=e.country)==null?void 0:a.assets)==null?void 0:l.flag)||Be.country,n},LB=e=>{switch(e){case"CLASSIC_QUIZ":return"success";case"EITHER_OR":return"success";case"POLL":return"warning";case"TOP_X":return"primary";case"MATCH_QUIZ":return"primary";case"LEADERBOARD_TEMPLATES":return"neutral";default:return"neutral"}},MB=e=>{switch(e){case"CLASSIC_QUIZ":return"CLASSIC QUIZ";case"EITHER_OR":return"EITHER/OR";case"POLL":return"POLL";case"TOP_X":return"TOP X";case"MATCH_QUIZ":return"MATCH QUIZ";case"LEADERBOARD_TEMPLATES":return"LEADERBOARD TEMPLATES"}},BB=({profile:e,winner:t,labels:n,onChange:r,onRemove:i})=>{var b,C,S,x,I,w;const[o,a]=y.useState(t.position),[l,c]=y.useState(t.note),[u,f]=y.useState(t.tags),d=o||l||u.length>0,p=A=>{A.persist();const{value:E}=A.target;a(E),r("position",E)},g=A=>{A.persist();const{value:E}=A.target;c(E),r("note",E)},v=A=>{f(A),r("tags",A)},m=()=>{a(""),c(""),f([]),i()};return s.jsxs("tr",{style:{backgroundColor:d?"rgb(255 237 213)":""},children:[s.jsx("td",{children:s.jsx(h.Input,{name:"position",placeholder:"#",value:o,onChange:p,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Avatar,{src:((b=e.profileModel)==null?void 0:b.avatar)||"",alt:((C=e.profileModel)==null?void 0:C.name)||"Unknown",sx:{mr:1}}),s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{fontWeight:"md",children:[RB((S=e.profileModel)==null?void 0:S.name,(x=e.profileModel)==null?void 0:x.nickname),"  ",(I=e.profileModel)!=null&&I.name?s.jsxs(h.Typography,{children:["(",(w=e.profileModel)==null?void 0:w.name,")"]}):s.jsx(s.Fragment,{})]}),s.jsx(h.Typography,{fontSize:"sm",sx:{opacity:"0.5"},children:e.profileModel&&e.profileModel.country?e.profileModel.country.name:""})]})]})}),s.jsx("td",{style:{textAlign:"center"},children:e.points}),s.jsx("td",{style:{textAlign:"center"},children:e.predictionsMade}),s.jsx("td",{children:s.jsx(h.Input,{name:"note",value:l,placeholder:"This user has...",onChange:g,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsx(Um,{labels:n,tags:u,onChange:v})}),s.jsx("td",{children:s.jsx(h.Tooltip,{title:n.clearWinner,children:s.jsx(h.IconButton,{onClick:m,variant:"outlined",color:"danger",disabled:!d,children:s.jsx(_e.Remove,{})})})})]})},$B=e=>{const t=(i,o,a)=>{if(e.winners.find(f=>f.profileId===i)){const f=e.winners.map(d=>d.profileId===i?Q(L({},d),{[o]:a}):d);r(f);return}const c=new s2;c.profileId=i,c[o]=a;const u=[...e.winners,c];r(u)},n=i=>{const o=e.winners.filter(a=>a.profileId!==i);r(o)},r=i=>{e.setWinnersRequestBody(o=>Q(L({},o),{userList:i}))};return e.leaderboard?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"h4",children:e.labels.configureWinners}),e.leaderboard.length===0?s.jsx(h.Typography,{level:"body-lg",textAlign:"center",fontWeight:"bold",children:e.labels.noStandingsAvailable}):s.jsx(s.Fragment,{}),s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:last-child, & > tbody > tr > td:last-child":{textAlign:"center",width:"50px"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"70px"},children:e.labels.position}),s.jsx("th",{children:e.labels.nicknameAndName}),s.jsx("th",{style:{width:"70px",textAlign:"center"},children:e.labels.points}),s.jsx("th",{style:{width:"100px",textAlign:"center"},children:e.labels.predictions}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags}),s.jsx("th",{children:e.labels.actions})]})}),s.jsxs("tbody",{children:[e.leaderboard.length>0?e.leaderboard.map(i=>s.jsx(BB,{winner:e.winners.find(o=>o.profileId===i.profileId)||{position:"",profileId:"",note:"",tags:[]},profile:i,labels:e.labels,onChange:(o,a)=>t(i.profileId,o,a),onRemove:()=>n(i.profileId)},`winner-profile-${i.profileId}`)):s.jsx(s.Fragment,{}),s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:e.hasMoreParticipants?s.jsx(h.Box,{textAlign:"center",my:1,children:s.jsx(h.Button,{variant:"plain",sx:{width:"100%"},onClick:()=>e.setPage(i=>i+1),loading:e.isLoading,children:e.labels.loadMore})}):s.jsx(s.Fragment,{})})})]})]})]}):s.jsx(yi,{my:40})},FB=(e,t,n,r,i)=>{const[o,a]=y.useState(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),{sdk:d}=Ge(),p=()=>_(this,null,function*(){f(!0);const g={limit:10,page:r},v=!0;try{let m;t==="template"?m=yield d.loyalty.getLeaderboard(e,g,v):m=yield d.loyalty.getLeaderboardForGame(e,g,v),m.meta.pagination.numberOfPages>r?c(!0):c(!1),o&&o.length?a(b=>[...b,...m.data]):a(m.data)}catch(m){console.error(m),i("danger",n),a([])}f(!1)});return y.useEffect(()=>{p()},[r]),{leaderboard:o,hasMoreParticipants:l,isLeaderboardLoading:u}};class NB{constructor(){J(this,"isValid",!0);J(this,"message","");J(this,"validate",(t,n,r)=>(this.validateField(t,n),this.validateWinnerIds(t,r),this));J(this,"validateField",(t,n)=>{const r=t.every(i=>i.position&&i.profileId);r||(this.isValid=r,this.message=n)});J(this,"validateWinnerIds",(t,n)=>{const r=t.map(o=>o.profileId),i=new Set(r);r.length!==i.size&&(this.isValid=!1,this.message=n)})}}const zB=e=>{const t=e.winners.userList.length>0&&(e.winners.userList[0].position||e.winners.userList[0].profileId||e.winners.userList[0].note||e.winners.userList[0].tags.length);return s.jsx(h.Card,{variant:"plain",children:t?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-lg",mb:2,fontWeight:"bold",children:e.labels.preview}),s.jsx(h.Sheet,{children:s.jsxs(h.Table,{sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"& > thead > tr > th:nth-of-type(3), & > thead > tr > th:nth-of-type(4), & > tbody > tr > td:nth-of-type(3), & > tbody > tr > td:nth-of-type(4)":{fontSize:"sm",display:{xs:"none",md:"table-cell"}}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"3%"},children:"#"}),s.jsx("th",{children:e.labels.name}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags})]})}),s.jsx("tbody",{children:e.winners.userList.map(n=>{var i;const r=e.profiles.find(o=>o.id===n.profileId);return s.jsxs("tr",{children:[s.jsx("td",{children:n.position}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:2,children:[s.jsx(h.Avatar,{src:(r==null?void 0:r.avatar)||"",alt:(r==null?void 0:r.name)||"Unknown"}),s.jsxs(h.Box,{textAlign:"left",children:[s.jsxs(h.Typography,{fontWeight:"bold",children:[(r==null?void 0:r.nickname)||"-------------"," ",s.jsxs(h.Typography,{children:["(",(r==null?void 0:r.name)||"-------------",")"]})]}),s.jsx(h.Typography,{fontSize:"sm",color:"neutral",children:(i=r==null?void 0:r.country)==null?void 0:i.name})]})]})}),s.jsx("td",{children:n.note}),s.jsx("td",{children:n.tags.map(o=>s.jsx(h.Chip,{variant:"soft",color:"neutral",size:"sm",sx:{mr:1},children:o},`preview-winner-${n.profileId}-tag-${o}`))})]},`preview-winner-${n.profileId}`)})})]})})]}):s.jsx(h.Typography,{textAlign:"center",fontWeight:"bold",children:e.labels.noSetWinnersMessage})})},jB=e=>Object.keys(e).length?(e.userList||(e.userList=[]),e):new Vm,UB=e=>{var w;const[t,n]=y.useState(jB(e.winners)),[r,i]=y.useState(((w=e.winners)==null?void 0:w.description)||""),[o,a]=y.useState(!1),[l,c]=y.useState(1),[u,f]=y.useState(!1),[d,p]=y.useState("danger"),[g,v]=y.useState(""),m=(A,E)=>{p(A),v(E),f(!0)},{leaderboard:b,hasMoreParticipants:C,isLeaderboardLoading:S}=FB(e.entityId,e.entityType,e.labels.leaderboardErrorMessage,l,m),{https:x}=Ge(),I=()=>_(this,null,function*(){a(!0);const A=JSON.parse(JSON.stringify(t));if(A.contestId=e.entityId,A.contestType=e.entityType==="template"?"TEMPLATE":"GAME",A.description=r,delete A.contestModel,A.userList.length>0){const k=new NB().validate(A.userList,e.labels.positionAndWinnerRequiredMessage,e.labels.sameChosenWinnerMessage);if(!k.isValid){m("danger",k.message),a(!1);return}}else delete A.userList;const E=Eu(A);try{yield x.setWinners(E),m("success",Object.keys(e.winners).length?e.labels.editWinnersMessage:e.labels.createWinnersMessage)}catch(k){console.error(k),m("danger",Object.keys(e.winners).length?e.labels.editWinnersErrorMessage:e.labels.createWinnersErrorMessage)}a(!1)});return s.jsxs(s.Fragment,{children:[s.jsx("section",{style:{marginRight:"auto",marginLeft:"auto"},children:s.jsx(h.Box,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:s.jsxs(h.Box,{width:"100%",sx:{overflowX:"auto"},children:[s.jsxs(h.Card,{variant:"plain",children:[s.jsx(Sc,{property:"description",label:e.labels.description,defaultValue:r,placeholder:e.labels.winnersDescription,onChange:A=>{i(A)}}),s.jsx($B,{winners:t.userList,leaderboard:b,hasMoreParticipants:C,isLoading:S,setPage:c,setWinnersRequestBody:n,labels:e.labels}),s.jsx(h.Box,{textAlign:"center",my:3,children:s.jsx(h.Button,{variant:"solid",color:"primary",onClick:I,loading:o,children:e.labels.save})}),s.jsx(h.Divider,{sx:{my:4}})]}),b?s.jsx(zB,{winners:t,profiles:b.map(A=>A.profileModel),labels:e.labels}):s.jsx(s.Fragment,{})]})})}),s.jsx(Ye,{showToast:u,color:d,message:g,hideToast:()=>f(!1)})]})},VB=e=>{const[t,n]=y.useState(!1),r=()=>n(!0),i=a2(e.entityId,e.entityType,r);return i?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{p:2,children:[s.jsx(h.Typography,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:s.jsx(o2,{fontSize:"inherit"}),onClick:e.onClickBack,children:e.labels.back}),s.jsxs(h.Typography,{level:"h3",children:[e.labels.manageWinners,":"," ",s.jsx(h.Typography,{level:"title-lg",fontWeight:"italic",children:e.entityName})]})]}),s.jsx(UB,{labels:e.labels,winners:i,entityId:e.entityId,entityType:e.entityType}),s.jsx(Ye,{showToast:t,color:"danger",message:e.labels.winnersErrorMessage,hideToast:()=>n(!1)})]}):s.jsx(yi,{my:50})},HB=10,WB=e=>{var d;const[t,n]=y.useState([]),[r,i]=y.useState(!1),[o,a]=y.useState(""),{sdk:l}=Ge(),c=y.useMemo(()=>cr(p=>{if(!p){n([]),i(!1);return}i(!0),l.football.search({query:p}).then(g=>{n([...hv(g)]),i(!1)}).catch(g=>{console.error(g),n([]),i(!1)})},300),[]);y.useEffect(()=>(c(o),()=>c.cancel()),[o,c]);const u=(p,g)=>{const v=g.map(m=>m.id);e.setOptions(g),e.handleResetData(),e.setFilters(m=>Q(L({},m),{entityIds:v}))},f=(p,g)=>p.map((v,m)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:b=>g({index:m}).onClick(b),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:v},`option_${v.id}`)},v.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{sx:{fontSize:12},color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>e.options.length===HB,forcePopupIcon:!1,multiple:!0,loading:r,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(p,g)=>p.id===g.id,endDecorator:r?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.options.length>0?"":e.labels.typeContextTagNamePlaceholder,options:t,filterOptions:p=>p.filter(g=>!e.options.some(v=>v.value===g.value)),onInputChange:(p,g)=>{a(g)},onChange:u,getOptionKey:p=>p.id,groupBy:p=>p.group+"s",value:(d=e.options)!=null?d:[],renderTags:f,renderOption:(p,g)=>s.jsx(h.AutocompleteOption,Q(L({},p),{children:s.jsx(kn,{option:g})}))})]})};function pv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Eo;(function(e){e.event="event",e.props="prop"})(Eo||(Eo={}));function ur(){}function GB(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,a){return o===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function ko(e){return!!(e||"").match(/\d/)}function Ci(e){return e==null}function YB(e){return typeof e=="number"&&isNaN(e)}function gv(e){return Ci(e)||YB(e)||typeof e=="number"&&!isFinite(e)}function mv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function KB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function qB(e,t,n){var r=KB(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function QB(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function _u(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNegation:n,addNegation:r}}function JB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function vv(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function bv(e,t){return Array(t+1).join(e)}function yv(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var a=1+o,l=i.length;return a<0?i="0."+bv("0",Math.abs(a))+i:a>=l?i=i+bv("0",a-l):i=(i.substring(0,a)||"0")+"."+i.substring(a),n+i}function xv(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=_u(e),o=i.beforeDecimal,a=i.afterDecimal,l=i.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),f=u.split("."),d=o;o&&Number(f[0])&&(d=o.split("").reverse().reduce(function(m,b,C){return m.length>C?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},f[0]));var p=vv(f[1]||"",t,n),g=l?"-":"",v=r?".":"";return""+g+d+v+p}function Or(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Cv=GB(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),XB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function ZB(e,t,n){return Math.min(Math.max(e,t),n)}function Pu(e){return Math.max(e.selectionStart,e.selectionEnd)}function e$(){return typeof navigator!="undefined"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function t$(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function n$(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function r$(e,t,n,r,i,o,a){a===void 0&&(a=n$);var l=i.findIndex(function(I){return I}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,f=e.length,d={},p=new Array(u),g=0;g<u;g++){p[g]=-1;for(var v=0,m=f;v<m;v++){var b=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:v});if(b&&d[v]!==!0){p[g]=v,d[v]=!0;break}}}for(var C=r;C<u&&(p[C]===-1||!o(n[C]));)C++;var S=C===u||p[C]===-1?f:p[C];for(C=r-1;C>0&&p[C]===-1;)C--;var x=C===-1||p[C]===-1?0:p[C]+1;return x>S?S:r-x<S-r?x:S}function wv(e,t,n,r){var i=e.length;if(t=ZB(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function i$(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ko(e[n])||ko(e[n-1]));return t}function Sv(e,t,n,r,i,o){o===void 0&&(o=ur);var a=QB(function(v,m){var b,C;return gv(v)?(C="",b=""):typeof v=="number"||m?(C=typeof v=="number"?yv(v):v,b=r(C)):(C=i(v,void 0),b=r(C)),{formattedValue:b,numAsString:C}}),l=y.useState(function(){return a(Ci(e)?t:e,n)}),c=l[0],u=l[1],f=function(v,m){v.formattedValue!==c.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),o(v,m)},d=e,p=n;Ci(e)&&(d=c.numAsString,p=!0);var g=a(d,p);return y.useMemo(function(){u(g)},[g.formattedValue]),[c,f]}function o$(e){return e.replace(/[^0-9]/g,"")}function a$(e){return e}function s$(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,a=e.format;a===void 0&&(a=a$);var l=e.removeFormatting;l===void 0&&(l=o$);var c=e.defaultValue,u=e.valueIsNumericString,f=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=ur);var g=e.onKeyDown;g===void 0&&(g=ur);var v=e.onMouseUp;v===void 0&&(v=ur);var m=e.onFocus;m===void 0&&(m=ur);var b=e.onBlur;b===void 0&&(b=ur);var C=e.value,S=e.getCaretBoundary;S===void 0&&(S=i$);var x=e.isValidInputCharacter;x===void 0&&(x=ko);var I=e.isCharacterSame,w=pv(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=Sv(C,c,!!u,a,l,f),E=A[0],k=E.formattedValue,$=E.numAsString,G=A[1],O=y.useRef(),T=y.useRef({formattedValue:k,numAsString:$}),F=function(he,ge){T.current={formattedValue:he.formattedValue,numAsString:he.value},G(he,ge)},H=y.useState(!1),j=H[0],N=H[1],M=y.useRef(null),V=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return N(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var Y=a,X=function(he,ge){var xe=parseFloat(ge);return{formattedValue:he,value:ge,floatValue:isNaN(xe)?void 0:xe}},D=function(he,ge,xe){he.selectionStart===0&&he.selectionEnd===he.value.length||(Or(he,ge),V.current.setCaretTimeout=setTimeout(function(){he.value===xe&&he.selectionStart!==ge&&Or(he,ge)},0))},B=function(he,ge,xe){return wv(he,ge,S(he),xe)},U=function(he,ge,xe){var ke=S(ge),Ke=r$(ge,k,he,xe,ke,x,I);return Ke=wv(ge,Ke,ke),Ke},W=function(he){var ge=he.formattedValue;ge===void 0&&(ge="");var xe=he.input,ke=he.source,Ke=he.event,Oe=he.numAsString,Pe;if(xe){var St=he.inputValue||xe.value,It=Pu(xe);xe.value=ge,Pe=U(St,ge,It),Pe!==void 0&&D(xe,Pe,ge)}ge!==k&&F(X(ge,Oe),{event:Ke,source:ke})};y.useEffect(function(){var he=T.current,ge=he.formattedValue,xe=he.numAsString;(k!==ge||$!==xe)&&F(X(k,$),{event:void 0,source:Eo.props})},[k,$]);var ie=M.current?Pu(M.current):void 0,se=typeof window!="undefined"?y.useLayoutEffect:y.useEffect;se(function(){var he=M.current;if(k!==T.current.formattedValue&&he){var ge=U(T.current.formattedValue,k,ie);he.value=k,D(he,ge,k)}},[k]);var oe=function(he,ge,xe){var ke=ge.target,Ke=O.current?XB(O.current,ke.selectionEnd):Cv(k,he),Oe=Object.assign(Object.assign({},Ke),{lastValue:k}),Pe=l(he,Oe),St=Y(Pe);if(Pe=l(St,void 0),d&&!d(X(St,Pe))){var It=ge.target,Bt=Pu(It),Dt=U(he,k,Bt);return It.value=k,D(It,Dt,k),!1}return W({formattedValue:St,numAsString:Pe,inputValue:he,event:ge,source:xe,input:ge.target}),!0},Z=function(he,ge){ge===void 0&&(ge=0);var xe=he.selectionStart,ke=he.selectionEnd;O.current={selectionStart:xe,selectionEnd:ke+ge}},te=function(he){var ge=he.target,xe=ge.value,ke=oe(xe,he,Eo.event);ke&&p(he),O.current=void 0},ne=function(he){var ge=he.target,xe=he.key,ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe;xe==="ArrowLeft"||xe==="Backspace"?Pe=Math.max(ke-1,0):xe==="ArrowRight"?Pe=Math.min(ke+1,Oe.length):xe==="Delete"&&(Pe=ke);var St=0;xe==="Delete"&&ke===Ke&&(St=1);var It=xe==="ArrowLeft"||xe==="ArrowRight";if(Pe===void 0||ke!==Ke&&!It){g(he),Z(ge,St);return}var Bt=Pe;if(It){var Dt=xe==="ArrowLeft"?"left":"right";Bt=B(Oe,Pe,Dt),Bt!==Pe&&he.preventDefault()}else xe==="Delete"&&!x(Oe[Pe])?Bt=B(Oe,Pe,"right"):xe==="Backspace"&&!x(Oe[Pe])&&(Bt=B(Oe,Pe,"left"));Bt!==Pe&&D(ge,Bt,Oe),g(he),Z(ge,St)},ue=function(he){var ge=he.target,xe=function(){var ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;if(Oe===void 0&&(Oe=""),ke===Ke){var Pe=B(Oe,ke);Pe!==ke&&D(ge,Pe,Oe)}};xe(),requestAnimationFrame(function(){xe()}),v(he),Z(ge)},be=function(he){he.persist&&he.persist();var ge=he.target,xe=he.currentTarget;M.current=ge,V.current.focusTimeout=setTimeout(function(){var ke=ge.selectionStart,Ke=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe=B(Oe,ke);Pe!==ke&&!(ke===0&&Ke===Oe.length)&&D(ge,Pe,Oe),m(Object.assign(Object.assign({},he),{currentTarget:xe}))},0)},Ne=function(he){M.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),b(he)},ht=j&&e$()?"numeric":void 0,Je=Object.assign({inputMode:ht},w,{type:t,value:k,onChange:te,onKeyDown:ne,onMouseUp:ue,onFocus:be,onBlur:Ne});if(n==="text")return i?y.createElement(y.Fragment,null,i(k,w)||null):y.createElement("span",Object.assign({},w,{ref:o}),k);if(r){var _t=r;return y.createElement(_t,Object.assign({},Je,{ref:o}))}return y.createElement("input",Object.assign({},Je,{ref:o}))}function Iv(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Es(t),u=c.thousandSeparator,f=c.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,p=_u(e,a),g=p.beforeDecimal,v=p.afterDecimal,m=p.addNegation;return n!==void 0&&(v=vv(v,n,!!r)),u&&(g=qB(g,u,l)),i&&(g=i+g),o&&(v=v+o),m&&(g="-"+g),e=g+(d&&f||"")+v,e}function Es(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function l$(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function c$(e,t){return new RegExp("(^-)|[0-9]|"+mv(e),"g")}function u$(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function d$(e,t,n){var r;t===void 0&&(t=t$(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,f=u.start,d=u.end,p=Es(n),g=p.allowedDecimalSeparators,v=p.decimalSeparator,m=e[d]===v;if(ko(e)&&(e===o||e===a)&&t.lastValue==="")return e;if(d-f===1&&g.indexOf(e[f])!==-1){var b=l===0?"":v;e=e.substring(0,f)+b+e.substring(f+1,e.length)}var C=function(M,V,Y){var X=!1,D=!1;o.startsWith("-")?X=!1:M.startsWith("--")?(X=!1,D=!0):a.startsWith("-")&&M.length===a.length?X=!1:M[0]==="-"&&(X=!0);var B=X?1:0;return D&&(B=2),B&&(M=M.substring(B),V-=B,Y-=B),{value:M,start:V,end:Y,hasNegation:X}},S=C(e,f,d),x=S.hasNegation;r=S,e=r.value,f=r.start,d=r.end;var I=C(t.lastValue,c.start,c.end),w=I.start,A=I.end,E=I.value,k=e.substring(f,d);e.length&&E.length&&(w>E.length-a.length||A<o.length)&&!(k&&a.startsWith(k))&&(e=E);var $=0;e.startsWith(o)?$+=o.length:f<o.length&&($=f),e=e.substring($),d-=$;var G=e.length,O=e.length-a.length;e.endsWith(a)?G=O:(d>O||d>e.length-a.length)&&(G=d),e=e.substring(0,G),e=l$(x?"-"+e:e,i),e=(e.match(c$(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(mv(v),"g"),function(M,V){return V===T?".":""});var F=_u(e,i),H=F.beforeDecimal,j=F.afterDecimal,N=F.addNegation;return u.end-u.start<c.end-c.start&&H===""&&m&&!parseFloat(j)&&(e=N?"-":""),e}function f$(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var a=e.length;return i.fill(!1,a-r.length+1,a+1),i}function h$(e){var t=Es(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
2464
2464
  Decimal separator can't be same as thousand separator.
2465
2465
  thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
2466
2466
  decimalSeparator: `+r+` (default value for decimalSeparator is .)
@@ -2468,11 +2468,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2468
2468
  Prefix can't start with '-' when allowNegative is true.
2469
2469
  prefix: `+i+`
2470
2470
  allowNegative: `+o+`
2471
- `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function p$(e){e=h$(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=ur);var o=e.onBlur;o===void 0&&(o=ur);var a=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var f=e.defaultValue,d=e.value,p=e.valueIsNumericString,g=e.onValueChange,v=pv(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=Es(e),b=m.decimalSeparator,C=m.allowedDecimalSeparators,S=function(N){return Iv(N,e)},x=function(N,L){return d$(N,L,e)},I=Ci(d)?f:d,w=p!=null?p:u$(I,u,t);Ci(d)?Ci(f)||(w=w||typeof f=="number"):w=w||typeof d=="number";var A=function(N){return gv(N)?N:(typeof N=="number"&&(N=yv(N)),w&&typeof l=="number"?xv(N,l,!!c):N)},E=Sv(A(d),A(f),!!w,S,x,g),k=E[0],$=k.numAsString,G=k.formattedValue,O=E[1],T=function(N){var L=N.target,V=N.key,Y=L.selectionStart,X=L.selectionEnd,D=L.value;if(D===void 0&&(D=""),(V==="Backspace"||V==="Delete")&&X<u.length){N.preventDefault();return}if(Y!==X){i(N);return}V==="Backspace"&&D[0]==="-"&&Y===u.length+1&&n&&Or(L,1),l&&c&&(V==="Backspace"&&D[Y-1]===b?(Or(L,Y-1),N.preventDefault()):V==="Delete"&&D[Y]===b&&N.preventDefault()),C!=null&&C.includes(V)&&D[Y]===b&&Or(L,Y+1);var B=a===!0?",":a;V==="Backspace"&&D[Y-1]===B&&Or(L,Y-1),V==="Delete"&&D[Y]===B&&Or(L,Y+1),i(N)},F=function(N){var L=$;if(L.match(/\d/g)||(L=""),r||(L=JB(L)),c&&l&&(L=xv(L,l,c)),L!==$){var V=Iv(L,e);O({formattedValue:V,value:L,floatValue:parseFloat(L)},{event:N,source:Eo.event})}o(N)},H=function(N){return N===b?!0:ko(N)},j=function(N){var L=N.currentValue,V=N.lastValue,Y=N.formattedValue,X=N.currentValueIndex,D=N.formattedValueIndex,B=L[X],U=Y[D],W=Cv(V,L),ie=W.to,se=function(oe){return x(oe).indexOf(".")+u.length};return d===0&&c&&l&&L[ie.start]===b&&se(L)<X&&se(Y)>D?!1:X>=ie.start&&X<ie.end&&C&&C.includes(B)&&U===b?!0:B===U};return Object.assign(Object.assign({},v),{value:G,valueIsNumericString:!1,isValidInputCharacter:H,isCharacterSame:j,onValueChange:O,format:S,removeFormatting:x,getCaretBoundary:function(N){return f$(N,e)},onKeyDown:T,onBlur:F})}function g$(e){var t=p$(e);return y.createElement(s$,Object.assign({},t))}const m$=K.forwardRef(function(t,n){const a=t,{onChange:r,isAllowed:i}=a,o=Ze(a,["onChange","isAllowed"]);return s.jsx(g$,Q(M({},o),{getInputRef:n,onValueChange:l=>{r({target:{name:t.name,value:l.value}})},thousandSeparator:!0,valueIsNumericString:!0,isAllowed:i}))}),Du=e=>{const t=n=>{e.onChange(Number(n.target.value))};return s.jsxs(Su,{size:e.size||"sm",children:[s.jsx(Iu,{children:e.label}),s.jsx(as,{sx:e.sx,value:e.defaultValue,onChange:t,disabled:e.disabled||!1,slotProps:{input:{component:m$,isAllowed:e.isAllowed?e.isAllowed:()=>!0}}}),e.description?s.jsx(h.FormHelperText,{children:e.description}):s.jsx(s.Fragment,{})]})},v$=e=>e.startsWith("fb:c:")?"competition":e.startsWith("fb:t:")?"team":"player",b$=(e,t,n,r)=>{const i=e.filter(u=>u.type.toLocaleLowerCase()==="competition").map(u=>u.id),o=e.filter(u=>u.type.toLocaleLowerCase()==="team").map(u=>u.id),a=e.filter(u=>u.type.toLocaleLowerCase()==="player").map(u=>u.id),l=[],c=[];if(i.length>0){const u=t.football.getCompetitions({competitionIds:i}).then(f=>{c.push(f)}).catch(f=>{console.error(f),r()});l.push(u)}if(o.length>0){const u=t.football.getTeams({teamIds:o}).then(f=>{c.push(f.data)}).catch(f=>{console.error(f),r()});l.push(u)}if(a.length>0){const u=t.football.getPlayers({playerIds:a}).then(f=>{c.push(f.data)}).catch(f=>{console.error(f),r()});l.push(u)}Promise.all(l).then(()=>{const f=Array.prototype.concat.apply([],c).map(d=>y$(d));n(f)})},y$=e=>{const t=new fv;return t.label=e.name,t.value=e.name,t.id=e.id,t.group=v$(e.id),e.birthDate?t.logo=e.assets&&e.assets.headshot&&e.assets.headshot:t.logo=e.assets&&e.assets.logo&&e.assets.logo,t.countryName=e.country.name,t.countryFlag=e.country.assets&&e.country.assets.flag?e.country.assets.flag:Be.country,t},x$=10,C$=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),[l,c]=y.useState(""),[u,f]=y.useState(!1),{sdk:d}=Ge(),p=()=>f(!u),g=(b,C)=>{n(C),e.onChangeTags(C)};y.useEffect(()=>{b$(e.tags,d,n,p)},[e.tags]);const v=y.useMemo(()=>cr(b=>{if(!b){i([]),a(!1);return}a(!0),d.football.search({query:b}).then(C=>{i([...hv(C)]),a(!1)}).catch(C=>{console.error(C),i([]),a(!1)})},300),[]);y.useEffect(()=>(v(l),()=>v.cancel()),[l,v]);const m=(b,C)=>b.map((S,x)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:I=>C({index:x}).onClick(I),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:S},`option_${S.id}`)},S.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>t.length===x$,forcePopupIcon:!1,multiple:!0,loading:o,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(b,C)=>b.id===C.id,endDecorator:o?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:t.length>0?"":e.labels.typeContextTagNamePlaceholder,options:r,filterOptions:b=>b.filter(C=>!t.some(S=>S.value===C.value)),onInputChange:(b,C)=>{c(C)},onChange:g,getOptionKey:b=>b.id,groupBy:b=>b.group+"s",value:t!=null?t:[],renderTags:m,renderOption:(b,C)=>s.jsx(h.AutocompleteOption,Q(M({},b),{children:s.jsx(kn,{option:C})}))}),s.jsx(Ye,{showToast:u,message:e.labels.getFootballEntitiesErrorMessage,color:"danger",hideToast:p})]})},w$=e=>new Map().set("id",e.id).set("type",e.type).set("label",e.label),S$=e=>{const t=JSON.parse(JSON.stringify(e.context)),n=e.context.content,r=e.context.campaign,i=w$(e.labels),o=(c,u)=>{const f=c.target.value;t.content[u]=f,e.onChange(t)},a=(c,u)=>{const f=c.target.value;t.campaign[u]=f,e.onChange(t)},l=c=>{c.length?t.tags=c.map(u=>({id:u.id,type:u.group,source:"football"})):t.tags=[],e.onChange(t)};return s.jsx(s.Fragment,{children:s.jsxs(Zh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(ep,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ac.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsx(ei,{children:e.labels.tags}),s.jsx(ei,{children:e.labels.content}),s.jsx(ei,{children:e.labels.campaign})]}),s.jsx(ci,{value:0,sx:{px:0},children:s.jsx(C$,{labels:e.labels,tags:e.context.tags,onChangeTags:l})}),s.jsx(ci,{value:1,sx:{px:0},children:Object.keys(n).map(c=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{label:i.get(c),placeholder:"",defaultValue:n[c],required:!1,size:"sm",onChange:u=>o(u,c)})},`context-content-${c}`))}),s.jsx(ci,{value:2,sx:{px:0},children:Object.keys(r).map(c=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{label:i.get(c),placeholder:"",defaultValue:r[c],required:!1,size:"sm",onChange:u=>a(u,c)})},`context-campaign-${c}`))})]})})},I$=e=>e?M({},e):{main:"",mobile:""},A$=e=>{const[t,n]=y.useState(!1),r=I$(e.defaultValue),i=(a,l)=>{r[l]=a,e.onChange(r)},o=a=>{r[a]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(Io,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:a=>i(a,"main"),clearImage:()=>o("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(Io,{labels:e.labels,title:e.labels.mobileImage,image:r.mobile,onChangeImages:a=>i(a,"mobile"),clearImage:()=>o("mobile")}):s.jsx(s.Fragment,{})]})},T$=({defaultValue:e,isClearable:t=!0,labels:n,onChange:r})=>{const i=y.useRef(null),o=[{id:"FREE",label:n.free},{id:"LEAD",label:n.lead},{id:"REGISTERED",label:n.registered},{id:"PAID",label:n.paid}];return s.jsxs(h.FormControl,{size:"sm",sx:{mb:2},children:[s.jsx(h.FormLabel,{children:n.authRequirement}),s.jsx(h.Select,Q(M({value:e,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,l)=>r(l),sx:{minHeight:"37px"}},e&&t&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;r(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:o.map(a=>s.jsx(h.Option,{value:a.id,children:a.label},a.id))})),s.jsx(h.FormHelperText,{children:n.authRequirementDescription})]})};function E$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const ks=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function wi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ou(e){return"nodeType"in e}function Nt(e){var t,n;return e?wi(e)?e:Ou(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ru(e){const{Document:t}=Nt(e);return e instanceof t}function _o(e){return wi(e)?!1:e instanceof Nt(e).HTMLElement}function Av(e){return e instanceof Nt(e).SVGElement}function Si(e){return e?wi(e)?e.document:Ou(e)?Ru(e)?e:_o(e)||Av(e)?e.ownerDocument:document:document:document}const vn=ks?y.useLayoutEffect:y.useEffect;function _s(e){const t=y.useRef(e);return vn(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function k$(){const e=y.useRef(null),t=y.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Po(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return vn(()=>{n.current!==e&&(n.current=e)},t),n}function Do(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ps(e){const t=_s(e),n=y.useRef(null),r=y.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Ds(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let Lu={};function Oo(e,t){return y.useMemo(()=>{if(t)return t;const n=Lu[e]==null?0:Lu[e]+1;return Lu[e]=n,e+"-"+n},[e,t])}function Tv(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const l=Object.entries(a);for(const[c,u]of l){const f=o[c];f!=null&&(o[c]=f+e*u)}return o},M({},t))}}const Ii=Tv(1),Ro=Tv(-1);function _$(e){return"clientX"in e&&"clientY"in e}function Os(e){if(!e)return!1;const{KeyboardEvent:t}=Nt(e.target);return t&&e instanceof t}function P$(e){if(!e)return!1;const{TouchEvent:t}=Nt(e.target);return t&&e instanceof t}function Rs(e){if(P$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return _$(e)?{x:e.clientX,y:e.clientY}:null}const Kn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Kn.Translate.toString(e),Kn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ev="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function D$(e){return e.matches(Ev)?e:e.querySelector(Ev)}const O$={display:"none"};function R$(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:O$},n)}function L$(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return y.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function M$(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const kv=y.createContext(null);function B$(e){const t=y.useContext(kv);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function $$(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var l;return(l=a[i])==null?void 0:l.call(a,o)})},[e]),t]}const F$={draggable:`
2471
+ `),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function p$(e){e=h$(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=ur);var o=e.onBlur;o===void 0&&(o=ur);var a=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var f=e.defaultValue,d=e.value,p=e.valueIsNumericString,g=e.onValueChange,v=pv(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),m=Es(e),b=m.decimalSeparator,C=m.allowedDecimalSeparators,S=function(N){return Iv(N,e)},x=function(N,M){return d$(N,M,e)},I=Ci(d)?f:d,w=p!=null?p:u$(I,u,t);Ci(d)?Ci(f)||(w=w||typeof f=="number"):w=w||typeof d=="number";var A=function(N){return gv(N)?N:(typeof N=="number"&&(N=yv(N)),w&&typeof l=="number"?xv(N,l,!!c):N)},E=Sv(A(d),A(f),!!w,S,x,g),k=E[0],$=k.numAsString,G=k.formattedValue,O=E[1],T=function(N){var M=N.target,V=N.key,Y=M.selectionStart,X=M.selectionEnd,D=M.value;if(D===void 0&&(D=""),(V==="Backspace"||V==="Delete")&&X<u.length){N.preventDefault();return}if(Y!==X){i(N);return}V==="Backspace"&&D[0]==="-"&&Y===u.length+1&&n&&Or(M,1),l&&c&&(V==="Backspace"&&D[Y-1]===b?(Or(M,Y-1),N.preventDefault()):V==="Delete"&&D[Y]===b&&N.preventDefault()),C!=null&&C.includes(V)&&D[Y]===b&&Or(M,Y+1);var B=a===!0?",":a;V==="Backspace"&&D[Y-1]===B&&Or(M,Y-1),V==="Delete"&&D[Y]===B&&Or(M,Y+1),i(N)},F=function(N){var M=$;if(M.match(/\d/g)||(M=""),r||(M=JB(M)),c&&l&&(M=xv(M,l,c)),M!==$){var V=Iv(M,e);O({formattedValue:V,value:M,floatValue:parseFloat(M)},{event:N,source:Eo.event})}o(N)},H=function(N){return N===b?!0:ko(N)},j=function(N){var M=N.currentValue,V=N.lastValue,Y=N.formattedValue,X=N.currentValueIndex,D=N.formattedValueIndex,B=M[X],U=Y[D],W=Cv(V,M),ie=W.to,se=function(oe){return x(oe).indexOf(".")+u.length};return d===0&&c&&l&&M[ie.start]===b&&se(M)<X&&se(Y)>D?!1:X>=ie.start&&X<ie.end&&C&&C.includes(B)&&U===b?!0:B===U};return Object.assign(Object.assign({},v),{value:G,valueIsNumericString:!1,isValidInputCharacter:H,isCharacterSame:j,onValueChange:O,format:S,removeFormatting:x,getCaretBoundary:function(N){return f$(N,e)},onKeyDown:T,onBlur:F})}function g$(e){var t=p$(e);return y.createElement(s$,Object.assign({},t))}const m$=K.forwardRef(function(t,n){const a=t,{onChange:r,isAllowed:i}=a,o=Ze(a,["onChange","isAllowed"]);return s.jsx(g$,Q(L({},o),{getInputRef:n,onValueChange:l=>{r({target:{name:t.name,value:l.value}})},thousandSeparator:!0,valueIsNumericString:!0,isAllowed:i}))}),Du=e=>{const t=n=>{e.onChange(Number(n.target.value))};return s.jsxs(Su,{size:e.size||"sm",children:[s.jsx(Iu,{children:e.label}),s.jsx(as,{sx:e.sx,value:e.defaultValue,onChange:t,disabled:e.disabled||!1,slotProps:{input:{component:m$,isAllowed:e.isAllowed?e.isAllowed:()=>!0}}}),e.description?s.jsx(h.FormHelperText,{children:e.description}):s.jsx(s.Fragment,{})]})},v$=e=>e.startsWith("fb:c:")?"competition":e.startsWith("fb:t:")?"team":"player",b$=(e,t,n,r)=>{const i=e.filter(u=>u.type.toLocaleLowerCase()==="competition").map(u=>u.id),o=e.filter(u=>u.type.toLocaleLowerCase()==="team").map(u=>u.id),a=e.filter(u=>u.type.toLocaleLowerCase()==="player").map(u=>u.id),l=[],c=[];if(i.length>0){const u=t.football.getCompetitions({competitionIds:i}).then(f=>{c.push(f)}).catch(f=>{console.error(f),r()});l.push(u)}if(o.length>0){const u=t.football.getTeams({teamIds:o}).then(f=>{c.push(f.data)}).catch(f=>{console.error(f),r()});l.push(u)}if(a.length>0){const u=t.football.getPlayers({playerIds:a}).then(f=>{c.push(f.data)}).catch(f=>{console.error(f),r()});l.push(u)}Promise.all(l).then(()=>{const f=Array.prototype.concat.apply([],c).map(d=>y$(d));n(f)})},y$=e=>{const t=new fv;return t.label=e.name,t.value=e.name,t.id=e.id,t.group=v$(e.id),e.birthDate?t.logo=e.assets&&e.assets.headshot&&e.assets.headshot:t.logo=e.assets&&e.assets.logo&&e.assets.logo,t.countryName=e.country.name,t.countryFlag=e.country.assets&&e.country.assets.flag?e.country.assets.flag:Be.country,t},x$=10,C$=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),[l,c]=y.useState(""),[u,f]=y.useState(!1),{sdk:d}=Ge(),p=()=>f(!u),g=(b,C)=>{n(C),e.onChangeTags(C)};y.useEffect(()=>{b$(e.tags,d,n,p)},[e.tags]);const v=y.useMemo(()=>cr(b=>{if(!b){i([]),a(!1);return}a(!0),d.football.search({query:b}).then(C=>{i([...hv(C)]),a(!1)}).catch(C=>{console.error(C),i([]),a(!1)})},300),[]);y.useEffect(()=>(v(l),()=>v.cancel()),[l,v]);const m=(b,C)=>b.map((S,x)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:I=>C({index:x}).onClick(I),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(kn,{option:S},`option_${S.id}`)},S.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>t.length===x$,forcePopupIcon:!1,multiple:!0,loading:o,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(b,C)=>b.id===C.id,endDecorator:o?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:t.length>0?"":e.labels.typeContextTagNamePlaceholder,options:r,filterOptions:b=>b.filter(C=>!t.some(S=>S.value===C.value)),onInputChange:(b,C)=>{c(C)},onChange:g,getOptionKey:b=>b.id,groupBy:b=>b.group+"s",value:t!=null?t:[],renderTags:m,renderOption:(b,C)=>s.jsx(h.AutocompleteOption,Q(L({},b),{children:s.jsx(kn,{option:C})}))}),s.jsx(Ye,{showToast:u,message:e.labels.getFootballEntitiesErrorMessage,color:"danger",hideToast:p})]})},w$=e=>new Map().set("id",e.id).set("type",e.type).set("label",e.label),S$=e=>{const t=JSON.parse(JSON.stringify(e.context)),n=e.context.content,r=e.context.campaign,i=w$(e.labels),o=(c,u)=>{const f=c.target.value;t.content[u]=f,e.onChange(t)},a=(c,u)=>{const f=c.target.value;t.campaign[u]=f,e.onChange(t)},l=c=>{c.length?t.tags=c.map(u=>({id:u.id,type:u.group,source:"football"})):t.tags=[],e.onChange(t)};return s.jsx(s.Fragment,{children:s.jsxs(Zh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(ep,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ac.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsx(ei,{children:e.labels.tags}),s.jsx(ei,{children:e.labels.content}),s.jsx(ei,{children:e.labels.campaign})]}),s.jsx(ci,{value:0,sx:{px:0},children:s.jsx(C$,{labels:e.labels,tags:e.context.tags,onChangeTags:l})}),s.jsx(ci,{value:1,sx:{px:0},children:Object.keys(n).map(c=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{label:i.get(c),placeholder:"",defaultValue:n[c],required:!1,size:"sm",onChange:u=>o(u,c)})},`context-content-${c}`))}),s.jsx(ci,{value:2,sx:{px:0},children:Object.keys(r).map(c=>s.jsx(h.Box,{mb:2,children:s.jsx(Lt,{label:i.get(c),placeholder:"",defaultValue:r[c],required:!1,size:"sm",onChange:u=>a(u,c)})},`context-campaign-${c}`))})]})})},I$=e=>e?L({},e):{main:"",mobile:""},A$=e=>{const[t,n]=y.useState(!1),r=I$(e.defaultValue),i=(a,l)=>{r[l]=a,e.onChange(r)},o=a=>{r[a]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(Io,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:a=>i(a,"main"),clearImage:()=>o("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(Io,{labels:e.labels,title:e.labels.mobileImage,image:r.mobile,onChangeImages:a=>i(a,"mobile"),clearImage:()=>o("mobile")}):s.jsx(s.Fragment,{})]})},T$=({defaultValue:e,isClearable:t=!0,labels:n,onChange:r})=>{const i=y.useRef(null),o=[{id:"FREE",label:n.free},{id:"LEAD",label:n.lead},{id:"REGISTERED",label:n.registered},{id:"PAID",label:n.paid}];return s.jsxs(h.FormControl,{size:"sm",sx:{mb:2},children:[s.jsx(h.FormLabel,{children:n.authRequirement}),s.jsx(h.Select,Q(L({value:e,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,l)=>r(l),sx:{minHeight:"37px"}},e&&t&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;r(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:o.map(a=>s.jsx(h.Option,{value:a.id,children:a.label},a.id))})),s.jsx(h.FormHelperText,{children:n.authRequirementDescription})]})};function E$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const ks=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function wi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ou(e){return"nodeType"in e}function Nt(e){var t,n;return e?wi(e)?e:Ou(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ru(e){const{Document:t}=Nt(e);return e instanceof t}function _o(e){return wi(e)?!1:e instanceof Nt(e).HTMLElement}function Av(e){return e instanceof Nt(e).SVGElement}function Si(e){return e?wi(e)?e.document:Ou(e)?Ru(e)?e:_o(e)||Av(e)?e.ownerDocument:document:document:document}const vn=ks?y.useLayoutEffect:y.useEffect;function _s(e){const t=y.useRef(e);return vn(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function k$(){const e=y.useRef(null),t=y.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Po(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return vn(()=>{n.current!==e&&(n.current=e)},t),n}function Do(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ps(e){const t=_s(e),n=y.useRef(null),r=y.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Ds(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let Lu={};function Oo(e,t){return y.useMemo(()=>{if(t)return t;const n=Lu[e]==null?0:Lu[e]+1;return Lu[e]=n,e+"-"+n},[e,t])}function Tv(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const l=Object.entries(a);for(const[c,u]of l){const f=o[c];f!=null&&(o[c]=f+e*u)}return o},L({},t))}}const Ii=Tv(1),Ro=Tv(-1);function _$(e){return"clientX"in e&&"clientY"in e}function Os(e){if(!e)return!1;const{KeyboardEvent:t}=Nt(e.target);return t&&e instanceof t}function P$(e){if(!e)return!1;const{TouchEvent:t}=Nt(e.target);return t&&e instanceof t}function Rs(e){if(P$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return _$(e)?{x:e.clientX,y:e.clientY}:null}const Kn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Kn.Translate.toString(e),Kn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ev="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function D$(e){return e.matches(Ev)?e:e.querySelector(Ev)}const O$={display:"none"};function R$(e){let{id:t,value:n}=e;return y.createElement("div",{id:t,style:O$},n)}function L$(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return y.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function M$(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const kv=y.createContext(null);function B$(e){const t=y.useContext(kv);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function $$(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var l;return(l=a[i])==null?void 0:l.call(a,o)})},[e]),t]}const F$={draggable:`
2472
2472
  To pick up a draggable item, press the space bar.
2473
2473
  While dragging, use the arrow keys to move the item.
2474
2474
  Press space again to drop the item in its new position, or press escape to cancel.
2475
- `},N$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function z$(e){let{announcements:t=N$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=F$}=e;const{announce:o,announcement:a}=M$(),l=Oo("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),B$(y.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!c)return null;const f=y.createElement(y.Fragment,null,y.createElement(R$,{id:r,value:i.draggable}),y.createElement(L$,{id:l,announcement:a}));return n?yt.createPortal(f,n):f}var wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wt||(wt={}));function Ls(){}function Ms(e,t){return y.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function _v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const bn=Object.freeze({x:0,y:0});function j$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function U$(e,t){const n=Rs(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function V$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function H$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pv(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Dv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const W$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Pv(t),o=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const u=Pv(c),f=i.reduce((p,g,v)=>p+j$(u[v],g),0),d=Number((f/4).toFixed(4));o.push({id:l,data:{droppableContainer:a,value:d}})}}return o.sort(V$)};function G$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,l=o-n;if(r<i&&n<o){const c=t.width*t.height,u=e.width*e.height,f=a*l,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const Y$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=G$(l,t);c>0&&i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(H$)};function K$(e,t,n){return Q(M({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Ov(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:bn}function q$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,l)=>Q(M({},a),{top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),M({},n))}}const Q$=q$(1);function Rv(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function J$(e,t,n){const r=Rv(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:l}=r,c=e.left-a-(1-i)*parseFloat(n),u=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),f=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const X$={ignoreTransform:!1};function Ai(e,t){t===void 0&&(t=X$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=Nt(e).getComputedStyle(e);u&&(n=J$(n,u,f))}const{top:r,left:i,width:o,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:o,height:a,bottom:l,right:c}}function Lv(e){return Ai(e,{ignoreTransform:!0})}function Z$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function eF(e,t){return t===void 0&&(t=Nt(e).getComputedStyle(e)),t.position==="fixed"}function tF(e,t){t===void 0&&(t=Nt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Bs(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ru(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_o(i)||Av(i)||n.includes(i))return n;const o=Nt(e).getComputedStyle(i);return i!==e&&tF(i,o)&&n.push(i),eF(i,o)?n:r(i.parentNode)}return e?r(e):n}function Mv(e){const[t]=Bs(e,1);return t!=null?t:null}function Mu(e){return!ks||!e?null:wi(e)?e:Ou(e)?Ru(e)||e===Si(e).scrollingElement?window:_o(e)?e:null:null}function Bv(e){return wi(e)?e.scrollX:e.scrollLeft}function $v(e){return wi(e)?e.scrollY:e.scrollTop}function Bu(e){return{x:Bv(e),y:$v(e)}}var kt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(kt||(kt={}));function Fv(e){return!ks||!e?!1:e===document.scrollingElement}function Nv(e){const t={x:0,y:0},n=Fv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const nF={x:.2,y:.2};function rF(e,t,n,r,i){let{top:o,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=nF);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Nv(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(g.y=kt.Backward,v.y=r*Math.abs((t.top+m.height-o)/m.height)):!f&&c>=t.bottom-m.height&&(g.y=kt.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!p&&l>=t.right-m.width?(g.x=kt.Forward,v.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&a<=t.left+m.width&&(g.x=kt.Backward,v.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:g,speed:v}}function iF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function zv(e){return e.reduce((t,n)=>Ii(t,Bu(n)),bn)}function oF(e){return e.reduce((t,n)=>t+Bv(n),0)}function aF(e){return e.reduce((t,n)=>t+$v(n),0)}function jv(e,t){if(t===void 0&&(t=Ai),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Mv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sF=[["x",["left","right"],oF],["y",["top","bottom"],aF]];class $u{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Bs(n),i=zv(r);this.rect=M({},t),this.width=t.width,this.height=t.height;for(const[o,a,l]of sF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(r),f=i[o]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Lo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lF(e){const{EventTarget:t}=Nt(e);return e instanceof t?e:Si(e)}function Fu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(Pi(n,2)+Pi(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fn||(fn={}));function Uv(e){e.preventDefault()}function cF(e){e.stopPropagation()}var Re;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Re||(Re={}));const Vv={start:[Re.Space,Re.Enter],cancel:[Re.Esc],end:[Re.Space,Re.Enter,Re.Tab]},uF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Re.Right:return Q(M({},n),{x:n.x+25});case Re.Left:return Q(M({},n),{x:n.x-25});case Re.Down:return Q(M({},n),{y:n.y+25});case Re.Up:return Q(M({},n),{y:n.y-25})}};class $s{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Lo(Si(n)),this.windowListeners=new Lo(Nt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jv(r),n(bn)}handleKeyDown(t){if(Os(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Vv,coordinateGetter:a=uF,scrollBehavior:l="smooth"}=i,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:bn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=Ro(d,f),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const b=t.code,{isTop:C,isRight:S,isLeft:x,isBottom:I,maxScroll:w,minScroll:A}=Nv(m),E=iF(m),k={x:Math.min(b===Re.Right?E.right-E.width/2:E.right,Math.max(b===Re.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(b===Re.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Re.Down?E.top:E.top+E.height/2,d.y))},$=b===Re.Right&&!S||b===Re.Left&&!x,G=b===Re.Down&&!I||b===Re.Up&&!C;if($&&k.x!==d.x){const O=m.scrollLeft+p.x,T=b===Re.Right&&O<=w.x||b===Re.Left&&O>=A.x;if(T&&!p.y){m.scrollTo({left:O,behavior:l});return}T?g.x=m.scrollLeft-O:g.x=b===Re.Right?m.scrollLeft-w.x:m.scrollLeft-A.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(G&&k.y!==d.y){const O=m.scrollTop+p.y,T=b===Re.Down&&O<=w.y||b===Re.Up&&O>=A.y;if(T&&!p.x){m.scrollTo({top:O,behavior:l});return}T?g.y=m.scrollTop-O:g.y=b===Re.Down?m.scrollTop-w.y:m.scrollTop-A.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ii(Ro(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}$s.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Vv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=o.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Hv(e){return!!(e&&"distance"in e)}function Wv(e){return!!(e&&"delay"in e)}class Nu{constructor(t,n,r){var i;r===void 0&&(r=lF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Si(a),this.documentListeners=new Lo(this.document),this.listeners=new Lo(r),this.windowListeners=new Lo(Nt(a)),this.initialCoordinates=(i=Rs(o))!=null?i:bn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.DragStart,Uv),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),this.windowListeners.add(fn.ContextMenu,Uv),this.documentListeners.add(fn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Wv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Hv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fn.Click,cF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!i)return;const c=(n=Rs(t))!=null?n:bn,u=Ro(i,c);if(!r&&l){if(Hv(l)){if(l.tolerance!=null&&Fu(u,l.tolerance))return this.handleCancel();if(Fu(u,l.distance))return this.handleStart()}if(Wv(l)&&Fu(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Re.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fs extends Nu{constructor(t){const{event:n}=t,r=Si(n.target);super(t,dF,r)}}Fs.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const fF={move:{name:"mousemove"},end:{name:"mouseup"}};var zu;(function(e){e[e.RightClick=2]="RightClick"})(zu||(zu={}));class hF extends Nu{constructor(t){super(t,fF,Si(t.event.target))}}hF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zu.RightClick?!1:(r==null||r({event:n}),!0)}}];const ju={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pF extends Nu{constructor(t){super(t,ju)}static setup(){return window.addEventListener(ju.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ju.move.name,t)};function t(){}}}pF.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Mo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Mo||(Mo={}));var Ns;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ns||(Ns={}));function gF(e){let{acceleration:t,activator:n=Mo.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:l=Ns.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const g=vF({delta:d,disabled:!o}),[v,m]=k$(),b=y.useRef({x:0,y:0}),C=y.useRef({x:0,y:0}),S=y.useMemo(()=>{switch(n){case Mo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Mo.DraggableRect:return i}},[n,i,c]),x=y.useRef(null),I=y.useCallback(()=>{const A=x.current;if(!A)return;const E=b.current.x*C.current.x,k=b.current.y*C.current.y;A.scrollBy(E,k)},[]),w=y.useMemo(()=>l===Ns.TreeOrder?[...u].reverse():u,[l,u]);y.useEffect(()=>{if(!o||!u.length||!S){m();return}for(const A of w){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=f[E];if(!k)continue;const{direction:$,speed:G}=rF(A,k,S,t,p);for(const O of["x","y"])g[O][$[O]]||(G[O]=0,$[O]=0);if(G.x>0||G.y>0){m(),x.current=A,v(I,a),b.current=G,C.current=$;return}}b.current={x:0,y:0},C.current={x:0,y:0},m()},[t,I,r,m,o,a,JSON.stringify(S),JSON.stringify(g),v,u,w,f,JSON.stringify(p)])}const mF={x:{[kt.Backward]:!1,[kt.Forward]:!1},y:{[kt.Backward]:!1,[kt.Forward]:!1}};function vF(e){let{delta:t,disabled:n}=e;const r=Ds(t);return Do(i=>{if(n||!r||!i)return mF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[kt.Backward]:i.x[kt.Backward]||o.x===-1,[kt.Forward]:i.x[kt.Forward]||o.x===1},y:{[kt.Backward]:i.y[kt.Backward]||o.y===-1,[kt.Forward]:i.y[kt.Forward]||o.y===1}}},[n,t,r])}function bF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Do(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function yF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Bo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Bo||(Bo={}));var Uu;(function(e){e.Optimized="optimized"})(Uu||(Uu={}));const Gv=new Map;function xF(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=y.useState(null),{frequency:l,measure:c,strategy:u}=i,f=y.useRef(e),d=b(),p=Po(d),g=y.useCallback(function(C){C===void 0&&(C=[]),!p.current&&a(S=>S===null?C:S.concat(C.filter(x=>!S.includes(x))))},[p]),v=y.useRef(null),m=Do(C=>{if(d&&!n)return Gv;if(!C||C===Gv||f.current!==e||o!=null){const S=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){S.set(x.id,x.rect.current);continue}const I=x.node.current,w=I?new $u(c(I),I):null;x.rect.current=w,w&&S.set(x.id,w)}return S}return C},[e,o,n,d,c]);return y.useEffect(()=>{f.current=e},[e]),y.useEffect(()=>{d||g()},[n,d]),y.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),y.useEffect(()=>{d||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},l))},[l,d,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:o!=null};function b(){switch(u){case Bo.Always:return!1;case Bo.BeforeDragging:return n;default:return!n}}}function Vu(e,t){return Do(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function CF(e,t){return Vu(e,t)}function wF(e){let{callback:t,disabled:n}=e;const r=_s(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function zs(e){let{callback:t,disabled:n}=e;const r=_s(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function SF(e){return new $u(Ai(e),e)}function Yv(e,t,n){t===void 0&&(t=SF);const[r,i]=y.useState(null);function o(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=wF({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),l=zs({callback:o});return vn(()=>{o(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function IF(e){const t=Vu(e);return Ov(e,t)}const Kv=[];function AF(e){const t=y.useRef(e),n=Do(r=>e?r&&r!==Kv&&e&&t.current&&e.parentNode===t.current.parentNode?r:Bs(e):Kv,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function TF(e){const[t,n]=y.useState(null),r=y.useRef(e),i=y.useCallback(o=>{const a=Mu(o.target);a&&n(l=>l?(l.set(a,Bu(a)),new Map(l)):null)},[]);return y.useEffect(()=>{const o=r.current;if(e!==o){a(o);const l=e.map(c=>{const u=Mu(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Bu(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(o)};function a(l){l.forEach(c=>{const u=Mu(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Ii(o,a),bn):zv(e):bn,[e,t])}function qv(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==bn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ro(e,n.current):bn}function EF(e){y.useEffect(()=>{if(!ks)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function kF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function Qv(e){return y.useMemo(()=>e?Z$(e):null,[e])}const Jv=[];function _F(e,t){t===void 0&&(t=Ai);const[n]=e,r=Qv(n?Nt(n):null),[i,o]=y.useState(Jv);function a(){o(()=>e.length?e.map(c=>Fv(c)?r:new $u(t(c),c)):Jv)}const l=zs({callback:a});return vn(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function Xv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return _o(t)?t:e}function PF(e){let{measure:t}=e;const[n,r]=y.useState(null),i=y.useCallback(u=>{for(const{target:f}of u)if(_o(f)){r(d=>{const p=t(f);return d?Q(M({},d),{width:p.width,height:p.height}):p});break}},[t]),o=zs({callback:i}),a=y.useCallback(u=>{const f=Xv(u);o==null||o.disconnect(),f&&(o==null||o.observe(f)),r(f?t(f):null)},[t,o]),[l,c]=Ps(a);return y.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const DF=[{sensor:Fs,options:{}},{sensor:$s,options:{}}],OF={current:{}},js={draggable:{measure:Lv},droppable:{measure:Lv,strategy:Bo.WhileDragging,frequency:Uu.Optimized},dragOverlay:{measure:Ai}};class $o extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const RF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $o,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ls},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:js,measureDroppableContainers:Ls,windowRect:null,measuringScheduled:!1},Zv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ls,draggableNodes:new Map,over:null,measureDroppableContainers:Ls},Fo=y.createContext(Zv),eb=y.createContext(RF);function LF(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $o}}}function MF(e,t){switch(t.type){case wt.DragStart:return Q(M({},e),{draggable:Q(M({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case wt.DragMove:return e.draggable.active==null?e:Q(M({},e),{draggable:Q(M({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case wt.DragEnd:case wt.DragCancel:return Q(M({},e),{draggable:Q(M({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case wt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new $o(e.droppable.containers);return i.set(r,n),Q(M({},e),{droppable:Q(M({},e.droppable),{containers:i})})}case wt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new $o(e.droppable.containers);return a.set(n,Q(M({},o),{disabled:i})),Q(M({},e),{droppable:Q(M({},e.droppable),{containers:a})})}case wt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new $o(e.droppable.containers);return o.delete(n),Q(M({},e),{droppable:Q(M({},e.droppable),{containers:o})})}default:return e}}function BF(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=y.useContext(Fo),o=Ds(r),a=Ds(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!Os(o)||document.activeElement===o.target)return;const l=i.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=D$(f);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function tb(e,t){let i=t,{transform:n}=i,r=Ze(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(M({transform:o},r)),n):n}function $F(e){return y.useMemo(()=>({draggable:M(M({},js.draggable),e==null?void 0:e.draggable),droppable:M(M({},js.droppable),e==null?void 0:e.droppable),dragOverlay:M(M({},js.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function FF(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=y.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;vn(()=>{if(!a&&!l||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Ov(f,r);if(a||(d.x=0),l||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Mv(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,l,r,n])}const Us=y.createContext(Q(M({},bn),{scaleX:1,scaleY:1}));var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const nb=y.memo(function(t){var n,r,i,o;let _i=t,{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:f=DF,collisionDetection:d=Y$,measuring:p,modifiers:g}=_i,v=Ze(_i,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=y.useReducer(MF,void 0,LF),[b,C]=m,[S,x]=$$(),[I,w]=y.useState(dr.Uninitialized),A=I===dr.Initialized,{draggable:{active:E,nodes:k,translate:$},droppable:{containers:G}}=b,O=E!=null?k.get(E):null,T=y.useRef({initial:null,translated:null}),F=y.useMemo(()=>{var bt;return E!=null?{id:E,data:(bt=O==null?void 0:O.data)!=null?bt:OF,rect:T}:null},[E,O]),H=y.useRef(null),[j,N]=y.useState(null),[L,V]=y.useState(null),Y=Po(v,Object.values(v)),X=Oo("DndDescribedBy",a),D=y.useMemo(()=>G.getEnabled(),[G]),B=$F(p),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:ie}=xF(D,{dragging:A,dependencies:[$.x,$.y],config:B.droppable}),se=bF(k,E),oe=y.useMemo(()=>L?Rs(L):null,[L]),Z=tn(),te=CF(se,B.draggable.measure);FF({activeNode:E!=null?k.get(E):null,config:Z.layoutShiftCompensation,initialRect:te,measure:B.draggable.measure});const ne=Yv(se,B.draggable.measure,te),ue=Yv(se?se.parentElement:null),be=y.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=G.getNodeFor((n=be.current.over)==null?void 0:n.id),ht=PF({measure:B.dragOverlay.measure}),Je=(r=ht.nodeRef.current)!=null?r:se,_t=A?(i=ht.rect)!=null?i:ne:null,he=!!(ht.nodeRef.current&&ht.rect),ge=IF(he?null:ne),xe=Qv(Je?Nt(Je):null),ke=AF(A?Ne!=null?Ne:se:null),Ke=_F(ke),Oe=tb(g,{transform:{x:$.x-ge.x,y:$.y-ge.y,scaleX:1,scaleY:1},activatorEvent:L,active:F,activeNodeRect:ne,containerNodeRect:ue,draggingNodeRect:_t,over:be.current.over,overlayNodeRect:ht.rect,scrollableAncestors:ke,scrollableAncestorRects:Ke,windowRect:xe}),Pe=oe?Ii(oe,$):null,St=TF(ke),It=qv(St),Bt=qv(St,[ne]),Dt=Ii(Oe,It),zt=_t?Q$(_t,Oe):null,_n=F&&zt?d({active:F,collisionRect:zt,droppableRects:U,droppableContainers:D,pointerCoordinates:Pe}):null,Ei=Dv(_n,"id"),[hn,Rr]=y.useState(null),No=he?Oe:Ii(Oe,Bt),zo=K$(No,(o=hn==null?void 0:hn.rect)!=null?o:null,ne),ze=y.useRef(null),hr=y.useCallback((bt,P)=>{let{sensor:z,options:q}=P;if(H.current==null)return;const ee=k.get(H.current);if(!ee)return;const ae=bt.nativeEvent,ce=new z({active:H.current,activeNode:ee,event:ae,options:q,context:be,onAbort(de){if(!k.get(de))return;const{onDragAbort:pe}=Y.current,ve={id:de};pe==null||pe(ve),S({type:"onDragAbort",event:ve})},onPending(de,Ie,pe,ve){if(!k.get(de))return;const{onDragPending:Pt}=Y.current,Xe={id:de,constraint:Ie,initialCoordinates:pe,offset:ve};Pt==null||Pt(Xe),S({type:"onDragPending",event:Xe})},onStart(de){const Ie=H.current;if(Ie==null)return;const pe=k.get(Ie);if(!pe)return;const{onDragStart:ve}=Y.current,Le={activatorEvent:ae,active:{id:Ie,data:pe.data,rect:T}};yt.unstable_batchedUpdates(()=>{ve==null||ve(Le),w(dr.Initializing),C({type:wt.DragStart,initialCoordinates:de,active:Ie}),S({type:"onDragStart",event:Le}),N(ze.current),V(ae)})},onMove(de){C({type:wt.DragMove,coordinates:de})},onEnd:we(wt.DragEnd),onCancel:we(wt.DragCancel)});ze.current=ce;function we(de){return function(){return _(this,null,function*(){const{active:pe,collisions:ve,over:Le,scrollAdjustedTranslate:Pt}=be.current;let Xe=null;if(pe&&Pt){const{cancelDrop:nn}=Y.current;Xe={activatorEvent:ae,active:pe,collisions:ve,delta:Pt,over:Le},de===wt.DragEnd&&typeof nn=="function"&&(yield Promise.resolve(nn(Xe)))&&(de=wt.DragCancel)}H.current=null,yt.unstable_batchedUpdates(()=>{C({type:de}),w(dr.Uninitialized),Rr(null),N(null),V(null),ze.current=null;const nn=de===wt.DragEnd?"onDragEnd":"onDragCancel";if(Xe){const fe=Y.current[nn];fe==null||fe(Xe),S({type:nn,event:Xe})}})})}}},[k]),Lr=y.useCallback((bt,P)=>(z,q)=>{const ee=z.nativeEvent,ae=k.get(q);if(H.current!==null||!ae||ee.dndKit||ee.defaultPrevented)return;const ce={active:ae};bt(z,P.options,ce)===!0&&(ee.dndKit={capturedBy:P.sensor},H.current=q,hr(z,P))},[k,hr]),ki=yF(f,Lr);EF(f),vn(()=>{ne&&I===dr.Initializing&&w(dr.Initialized)},[ne,I]),y.useEffect(()=>{const{onDragMove:bt}=Y.current,{active:P,activatorEvent:z,collisions:q,over:ee}=be.current;if(!P||!z)return;const ae={active:P,activatorEvent:z,collisions:q,delta:{x:Dt.x,y:Dt.y},over:ee};yt.unstable_batchedUpdates(()=>{bt==null||bt(ae),S({type:"onDragMove",event:ae})})},[Dt.x,Dt.y]),y.useEffect(()=>{const{active:bt,activatorEvent:P,collisions:z,droppableContainers:q,scrollAdjustedTranslate:ee}=be.current;if(!bt||H.current==null||!P||!ee)return;const{onDragOver:ae}=Y.current,ce=q.get(Ei),we=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,de={active:bt,activatorEvent:P,collisions:z,delta:{x:ee.x,y:ee.y},over:we};yt.unstable_batchedUpdates(()=>{Rr(we),ae==null||ae(de),S({type:"onDragOver",event:de})})},[Ei]),vn(()=>{be.current={activatorEvent:L,active:F,activeNode:se,collisionRect:zt,collisions:_n,droppableRects:U,draggableNodes:k,draggingNode:Je,draggingNodeRect:_t,droppableContainers:G,over:hn,scrollableAncestors:ke,scrollAdjustedTranslate:Dt},T.current={initial:_t,translated:zt}},[F,se,_n,zt,k,Je,_t,U,G,hn,ke,Dt]),gF(Q(M({},Z),{delta:$,draggingRect:zt,pointerCoordinates:Pe,scrollableAncestors:ke,scrollableAncestorRects:Ke}));const pr=y.useMemo(()=>({active:F,activeNode:se,activeNodeRect:ne,activatorEvent:L,collisions:_n,containerNodeRect:ue,dragOverlay:ht,draggableNodes:k,droppableContainers:G,droppableRects:U,over:hn,measureDroppableContainers:W,scrollableAncestors:ke,scrollableAncestorRects:Ke,measuringConfiguration:B,measuringScheduled:ie,windowRect:xe}),[F,se,ne,L,_n,ue,ht,k,G,U,hn,W,ke,Ke,B,ie,xe]),Mr=y.useMemo(()=>({activatorEvent:L,activators:ki,active:F,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:C,draggableNodes:k,over:hn,measureDroppableContainers:W}),[L,ki,F,ne,C,X,k,hn,W]);return y.createElement(kv.Provider,{value:x},y.createElement(Fo.Provider,{value:Mr},y.createElement(eb.Provider,{value:pr},y.createElement(Us.Provider,{value:zo},u)),y.createElement(BF,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(z$,Q(M({},l),{hiddenTextDescribedById:X})));function tn(){const bt=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof c=="object"?c.enabled===!1:c===!1,z=A&&!bt&&!P;return typeof c=="object"?Q(M({},c),{enabled:z}):{enabled:z}}}),NF=y.createContext(null),rb="button",zF="Draggable";function jF(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Oo(zF),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=y.useContext(Fo),{role:g=rb,roleDescription:v="draggable",tabIndex:m=0}=i!=null?i:{},b=(c==null?void 0:c.id)===t,C=y.useContext(b?Us:NF),[S,x]=Ps(),[I,w]=Ps(),A=kF(a,t),E=Po(n);vn(()=>(d.set(t,{id:t,key:o,node:S,activatorNode:I,data:E}),()=>{const $=d.get(t);$&&$.key===o&&d.delete(t)}),[d,t]);const k=y.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&g===rb?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,g,m,b,v,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:S,over:p,setNodeRef:x,setActivatorNodeRef:w,transform:C}}function ib(){return y.useContext(eb)}const UF="Droppable",VF={timeout:25};function HF(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Oo(UF),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=y.useContext(Fo),f=y.useRef({disabled:n}),d=y.useRef(!1),p=y.useRef(null),g=y.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:b}=M(M({},VF),i),C=Po(m!=null?m:r),S=y.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(C.current)?C.current:[C.current]),g.current=null},b)},[b]),x=zs({callback:S,disabled:v||!a}),I=y.useCallback((k,$)=>{x&&($&&(x.unobserve($),d.current=!1),k&&x.observe(k))},[x]),[w,A]=Ps(I),E=Po(t);return y.useEffect(()=>{!x||!w.current||(x.disconnect(),d.current=!1,x.observe(w.current))},[w,x]),y.useEffect(()=>(l({type:wt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:w,rect:p,data:E}}),()=>l({type:wt.UnregisterDroppable,key:o,id:r})),[r]),y.useEffect(()=>{n!==f.current.disabled&&(l({type:wt.SetDroppableDisabled,id:r,key:o,disabled:n}),f.current.disabled=n)},[r,o,n,l]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===r,node:w,over:c,setNodeRef:A}}function WF(e){let{animation:t,children:n}=e;const[r,i]=y.useState(null),[o,a]=y.useState(null),l=Ds(n);return!n&&!r&&l&&i(l),vn(()=>{if(!o)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),y.createElement(y.Fragment,null,n,r?y.cloneElement(r,{ref:a}):null)}const GF={x:0,y:0,scaleX:1,scaleY:1};function YF(e){let{children:t}=e;return y.createElement(Fo.Provider,{value:Zv},y.createElement(Us.Provider,{value:GF},t))}const KF={position:"fixed",touchAction:"none"},qF=e=>Os(e)?"transform 250ms ease":void 0,QF=y.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:l,style:c,transform:u,transition:f=qF}=e;if(!l)return null;const d=i?u:Q(M({},u),{scaleX:1,scaleY:1}),p=M(Q(M({},KF),{width:l.width,height:l.height,top:l.top,left:l.left,transform:Kn.Transform.toString(d),transformOrigin:i&&r?U$(r,l):void 0,transition:typeof f=="function"?f(r):f}),c);return y.createElement(n,{className:a,style:p,ref:t},o)}),ob=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[l,c]of Object.entries(o.active))c!==void 0&&(i[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(o!=null&&o.dragOverlay)for(const[l,c]of Object.entries(o.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(i))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},JF={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Kn.Transform.toString(t)},{transform:Kn.Transform.toString(n)}]},sideEffects:ob({styles:{active:{opacity:"0"}}})};function XF(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return _s((o,a)=>{if(t===null)return;const l=n.get(o);if(!l)return;const c=l.node.current;if(!c)return;const u=Xv(a);if(!u)return;const{transform:f}=Nt(a).getComputedStyle(a),d=Rv(f);if(!d)return;const p=typeof t=="function"?t:ZF(t);return jv(c,i.draggable.measure),p({active:{id:o,data:l.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function ZF(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=M(M({},JF),e);return o=>{let S=o,{active:a,dragOverlay:l,transform:c}=S,u=Ze(S,["active","dragOverlay","transform"]);if(!t)return;const f={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},d={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/l.rect.height:1},p=M({x:c.x-f.x,y:c.y-f.y},d),g=i(Q(M({},u),{active:a,dragOverlay:l,transform:{initial:c,final:p}})),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const b=r==null?void 0:r(M({active:a,dragOverlay:l},u)),C=l.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{C.onfinish=()=>{b==null||b(),x()}})}}let ab=0;function eN(e){return y.useMemo(()=>{if(e!=null)return ab++,ab},[e])}const tN=y.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:l="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:b,over:C,measuringConfiguration:S,scrollableAncestors:x,scrollableAncestorRects:I,windowRect:w}=ib(),A=y.useContext(Us),E=eN(d==null?void 0:d.id),k=tb(a,{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:b.rect,over:C,overlayNodeRect:b.rect,scrollableAncestors:x,scrollableAncestorRects:I,transform:A,windowRect:w}),$=Vu(p),G=XF({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:S}),O=$?b.setRef:void 0;return y.createElement(YF,null,y.createElement(WF,{animation:G},d&&E?y.createElement(QF,{key:E,id:d.id,ref:O,as:l,activatorEvent:f,adjustScale:t,className:c,transition:o,rect:$,style:M({zIndex:u},i),transform:k},n):null))});function Vs(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function nN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Hs(e){return e!==null&&e>=0}function rN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function iN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sb=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Vs(t,r,n),a=t[i],l=o[i];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},lb="Sortable",cb=y.createContext({activeIndex:-1,containerId:lb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sb,disabled:{draggable:!1,droppable:!1}});function ub(e){let{children:t,id:n,items:r,strategy:i=sb,disabled:o=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:f}=ib(),d=Oo(lb,n),p=l.rect!==null,g=y.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,m=a?g.indexOf(a.id):-1,b=u?g.indexOf(u.id):-1,C=y.useRef(g),S=!rN(g,C.current),x=b!==-1&&m===-1||S,I=iN(o);vn(()=>{S&&v&&f(g)},[S,g,v,f]),y.useEffect(()=>{C.current=g},[g]);const w=y.useMemo(()=>({activeIndex:m,containerId:d,disabled:I,disableTransforms:x,items:g,overIndex:b,useDragOverlay:p,sortedRects:nN(g,c),strategy:i}),[m,d,I.draggable,I.droppable,x,g,b,c,p,i]);return y.createElement(cb.Provider,{value:w},t)}const oN=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Vs(n,r,i).indexOf(t)},aN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==o&&i===a?!1:n?!0:a!==i&&t===c},sN={duration:200,easing:"ease"},db="transform",lN=Kn.Transition.toString({property:db,duration:0,easing:"linear"}),cN={roleDescription:"sortable"};function uN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=y.useState(null),l=y.useRef(n);return vn(()=>{if(!t&&n!==l.current&&r.current){const c=i.current;if(c){const u=Ai(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==l.current&&(l.current=n)},[t,n,r,i]),y.useEffect(()=>{o&&a(null)},[o]),o}function fb(e){let{animateLayoutChanges:t=aN,attributes:n,disabled:r,data:i,getNewIndex:o=oN,id:a,strategy:l,resizeObserverConfig:c,transition:u=sN}=e;const{items:f,containerId:d,activeIndex:p,disabled:g,disableTransforms:v,sortedRects:m,overIndex:b,useDragOverlay:C,strategy:S}=y.useContext(cb),x=dN(r,g),I=f.indexOf(a),w=y.useMemo(()=>M({sortable:{containerId:d,index:I,items:f}},i),[d,i,I,f]),A=y.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:E,node:k,isOver:$,setNodeRef:G}=HF({id:a,data:w,disabled:x.droppable,resizeObserverConfig:M({updateMeasurementsFor:A},c)}),{active:O,activatorEvent:T,activeNodeRect:F,attributes:H,setNodeRef:j,listeners:N,isDragging:L,over:V,setActivatorNodeRef:Y,transform:X}=jF({id:a,data:w,attributes:M(M({},cN),n),disabled:x.draggable}),D=E$(G,j),B=!!O,U=B&&!v&&Hs(p)&&Hs(b),W=!C&&L,ie=W&&U?X:null,se=l!=null?l:S,oe=U?ie!=null?ie:se({rects:m,activeNodeRect:F,activeIndex:p,overIndex:b,index:I}):null,Z=Hs(p)&&Hs(b)?o({id:a,items:f,activeIndex:p,overIndex:b}):I,te=O==null?void 0:O.id,ne=y.useRef({activeId:te,items:f,newIndex:Z,containerId:d}),ue=f!==ne.current.items,be=t({active:O,containerId:d,isDragging:L,isSorting:B,id:a,index:I,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),Ne=uN({disabled:!be,index:I,node:k,rect:E});return y.useEffect(()=>{B&&ne.current.newIndex!==Z&&(ne.current.newIndex=Z),d!==ne.current.containerId&&(ne.current.containerId=d),f!==ne.current.items&&(ne.current.items=f)},[B,Z,d,f]),y.useEffect(()=>{if(te===ne.current.activeId)return;if(te!=null&&ne.current.activeId==null){ne.current.activeId=te;return}const Je=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(Je)},[te]),{active:O,activeIndex:p,attributes:H,data:w,rect:E,index:I,newIndex:Z,items:f,isOver:$,isSorting:B,isDragging:L,listeners:N,node:k,overIndex:b,over:V,setNodeRef:D,setActivatorNodeRef:Y,setDroppableNodeRef:G,setDraggableNodeRef:j,transform:Ne!=null?Ne:oe,transition:ht()};function ht(){if(Ne||ue&&ne.current.newIndex===I)return lN;if(!(W&&!Os(T)||!u)&&(B||be))return Kn.Transition.toString(Q(M({},u),{property:db}))}}function dN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Ws(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const fN=[Re.Down,Re.Right,Re.Up,Re.Left],hb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:l}}=t;if(fN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case Re.Down:r.top<p.top&&c.push(d);break;case Re.Up:r.top>p.top&&c.push(d);break;case Re.Left:r.left>p.left&&c.push(d);break;case Re.Right:r.left<p.left&&c.push(d);break}});const u=W$({active:n,collisionRect:r,droppableRects:i,droppableContainers:c,pointerCoordinates:null});let f=Dv(u,"id");if(f===(a==null?void 0:a.id)&&u.length>1&&(f=u[1].id),f!=null){const d=o.get(n.id),p=o.get(f),g=p?i.get(p.id):null,v=p==null?void 0:p.node.current;if(v&&g&&d&&p){const b=Bs(v).some((A,E)=>l[E]!==A),C=pb(d,p),S=hN(d,p),x=b||!C?{x:0,y:0}:{x:S?r.width-g.width:0,y:S?r.height-g.height:0},I={x:g.left,y:g.top};return x.x&&x.y?I:Ro(I,x)}}}};function pb(e,t){return!Ws(e)||!Ws(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function hN(e,t){return!Ws(e)||!Ws(t)||!pb(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const gb=$e(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Gs=y.createContext({attributes:{},listeners:void 0,ref(){}}),pN=()=>{const{attributes:e,listeners:t,ref:n}=y.useContext(Gs);return s.jsx(h.Button,Q(M(M({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:s.jsx(gb,{})}))},mb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:l,listeners:c,setNodeRef:u,setActivatorNodeRef:f,transform:d,transition:p}=fb({id:t}),g=y.useMemo(()=>({attributes:a,listeners:c,ref:f}),[a,c,f]),v={opacity:l?.6:void 0,transform:Kn.Translate.toString(d),transition:p};return s.jsx(Gs.Provider,{value:g,children:s.jsx(h.ListItem,{variant:o,ref:u,style:v,startAction:i?s.jsx(pN,{}):s.jsx(s.Fragment,{}),endAction:i?s.jsx(h.Tooltip,{title:n,children:s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:s.jsx(_e.Remove,{})})}):s.jsx(s.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},gN={sideEffects:ob({styles:{active:{opacity:"0.6"}}})},vb=({children:e})=>s.jsx(tN,{dropAnimation:gN,children:e}),mN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=y.useState(null),l=y.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),c=_v(Ms(Fs),Ms($s,{coordinateGetter:hb}));return s.jsxs(nb,{sensors:c,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:f})=>{if(f&&u.id!==(f==null?void 0:f.id)){const d=e.findIndex(({id:g})=>g===u.id),p=e.findIndex(({id:g})=>g===f.id);r(Vs(e,d,p))}a(null)},onDragCancel:()=>{a(null)},children:[s.jsx(ub,{items:e,children:s.jsx(h.List,{sx:{gap:"10px",padding:0},children:e.map(u=>s.jsxs(mb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[s.jsx(h.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&s.jsx(h.Chip,{color:LB(u.type),sx:{marginLeft:2,marginRight:4},children:MB(u.type)})]},`sortable-item-${u.id}`))})}),s.jsx(vb,{children:l?s.jsx(s.Fragment,{children:e.map(u=>s.jsx(mb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):s.jsx(s.Fragment,{})})]})},vN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>s.jsxs(h.FormControl,{size:r,disabled:i,children:[s.jsx(h.FormLabel,{children:e.itemsPerPage}),s.jsx(h.Select,{value:t,size:r,onChange:a,sx:Q(M({},o),{minHeight:"37px"}),children:n.map((l,c)=>s.jsx(h.Option,{value:l,children:l},`items-per-page-${l}-${c}`))})]}),bN=(e,t)=>{const[n,r]=y.useState(null),{sdk:i}=Ge(),o=()=>_(this,null,function*(){let l=[];if(!e){r(l);return}try{switch(e){case"top_x":l=(yield i.topX.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":l=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"template":l=(yield i.loyalty.getTemplates(void 0,!0)).data.map(C=>({id:C.id,name:C.name,status:C.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":l=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":l=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"either_or":l=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"poll":l=(yield i.voting.getPolls({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"bracket":l=(yield i.bracketGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"standing":l=(yield i.standingGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break}}catch(c){console.error(c),r(l),t();return}r(l)});return y.useEffect(()=>(o(),()=>r(null)),[e]),n},yN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return s.jsx(h.Chip,{color:t,variant:"solid",size:"sm",children:e})},xN=$e(s.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),CN=$e(s.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),wN=$e(s.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),SN=$e(s.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),IN=$e(s.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),AN=e=>{switch(e.entityType){case"top_x":return s.jsx(h.Tooltip,{title:"Top X",children:s.jsx(xN,{})});case"match_quiz":return s.jsx(h.Tooltip,{title:"Match Quiz",children:s.jsx(CN,{})});case"template":return s.jsx(h.Tooltip,{title:"Leaderboard Templates",children:s.jsx(_e.EmojiEvents,{})});case"classic_quiz":return s.jsx(h.Tooltip,{title:"Classic Quiz",children:s.jsx(wN,{})});case"either_or":return s.jsx(h.Tooltip,{title:"Either/Or",children:s.jsx(SN,{})});case"poll":return s.jsx(h.Tooltip,{title:"Poll",children:s.jsx(IN,{})});case"bracket":return s.jsx(h.Tooltip,{title:"Custom Bracket Game",children:s.jsx(_e.EmojiEvents,{})});case"standing":return s.jsx(h.Tooltip,{title:"Custom Standings Game",children:s.jsx(_e.EmojiEvents,{})});default:return null}},bb=({entity:e,deleteLabel:t,onDelete:n})=>s.jsx(s.Fragment,{children:s.jsx(h.Card,{sx:{p:2,mb:2},children:s.jsx(h.CardContent,{children:s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[s.jsx(h.Typography,{fontSize:"sm",startDecorator:s.jsx(AN,{entityType:e.type}),children:e.name}),s.jsx(h.Box,{display:{xs:"none",md:"block"},children:s.jsx(yN,{status:e.status})}),s.jsx(h.Box,{children:s.jsx(h.Tooltip,{title:t,children:s.jsx(h.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:s.jsx(_e.Delete,{})})})})]})})})}),TN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(l=>{if(a.has(l.entity_type)){const c=a.get(l.entity_type);a.set(l.entity_type,[...c,[l.entity_id,l.entity_relationship]])}else a.set(l.entity_type,[[l.entity_id,l.entity_relationship]])});try{for(const[l,c]of a)switch(l){case"top_x":const u=c.map(([O])=>O),f=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...f.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"match_quiz":const d=c.map(([O])=>O),p=yield e.matchQuiz.getGames({limit:d.length,gameIds:d},!0);o=[...o,...p.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"template":const g=c.map(([O])=>O),v=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...v.data.filter(O=>g.includes(O.id)).map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"classic_quiz":const m=c.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:m.length,classicQuizIds:m},!1,!0);o=[...o,...b.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"personality_quiz":const C=c.map(([O])=>O),S=yield e.miniGames.getPersonalityQuizzes({limit:C.length,personalityQuizIds:C},!1,!0);o=[...o,...S.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"either_or":const x=c.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:x.length,eitherOrIds:x},!1,!0);o=[...o,...I.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"poll":const w=c.map(([O])=>O),A=yield e.voting.getPolls({limit:w.length,pollIds:w},!0);o=[...o,...A.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"bracket":const E=c.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"standing":const $=c.map(([O])=>O),G=yield e.standingGame.getGames({limit:$.length,gameIds:$},!0);o=[...o,...G.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;default:}}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),EN=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],kN=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],_N=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),yb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),PN=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState("relatedTo"),[d,p]=y.useState(!1),g=()=>p(!d),v=bN(l,g),{sdk:m}=Ge();y.useEffect(()=>(e.length>0&&TN(m,e,i,g),()=>{i([]),a(""),c(null),f("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const w=[...e,{entity_id:o,entity_type:l,entity_relationship:u}],A=(v==null?void 0:v.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:l,status:E.status,relationship:u})))||[];i([...r,...A]),t(w),a("")},C=(I,w)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===w)),E=r.filter(k=>!(k.id===I&&k.relationship===w));i(E),t(A)},S=r.reduce((I,w)=>{const A=w.relationship;return I[A]||(I[A]=[]),I[A].push(w),I},{}),x=Object.keys(S).sort();return s.jsxs(s.Fragment,{children:[x.map(I=>s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:yb.get(I)||"Unknown relationship"})}),S[I].map((w,A)=>s.jsx(bb,{entity:w,deleteLabel:n.delete,onDelete:C},`related-entity-relationship-${w.id}-${A}`))]},`relationship-group-${I}`)),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Select,{value:l,size:"sm",name:"entity_type",onChange:(I,w)=>c(w),sx:{minHeight:"37px"},children:EN.map(I=>s.jsx(h.Option,{value:I,children:_N.get(I)},`entity-type-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,w)=>f(w),sx:{minHeight:"37px"},children:kN.map(I=>s.jsx(h.Option,{value:I,children:yb.get(I)},`entity-relationship-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,w)=>a(w),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!v&&s.jsx(h.CircularProgress,{size:"sm"}),children:v&&v.map(I=>s.jsx(h.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o||!l,onClick:b,sx:{mb:1},children:n.add})]}),s.jsx(Ye,{showToast:d,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:g})]})},DN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=t.filter(l=>l.entity_type==="classic_quiz"&&l.entity_relationship==="bonusPointsGame").map(l=>[l.entity_id,l.entity_relationship]);if(a.length===0){n([]);return}try{const l=a.map(([u])=>u);o=(yield e.miniGames.getClassicQuizzes({limit:l.length,classicQuizIds:l},!1,!0)).data.map(u=>{var d;const f=((d=a.find(([p])=>p===u.id))==null?void 0:d[1])||"bonusPointsGame";return{id:u.id,name:u.title,status:u.status,type:"classic_quiz",relationship:f}})}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),ON=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState(!1),d=()=>f(!u),{sdk:p}=Ge();y.useEffect(()=>(e.length>0&&DN(p,e,i,d),()=>{i([]),a("")}),[]),y.useEffect(()=>(_(this,null,function*(){try{const S=(yield p.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(x=>({id:x.id,name:x.title,status:x.status,type:"classic_quiz",relationship:"bonusPointsGame"}));c(S)}catch(C){console.error(C),c([]),d()}}),()=>c(null)),[]);const g=()=>{if(e.some(S=>S.entity_id===o&&S.entity_relationship==="bonusPointsGame")){a("");return}const b=[...e,{entity_id:o,entity_type:"classic_quiz",entity_relationship:"bonusPointsGame"}],C=(l==null?void 0:l.filter(S=>S.id===o).map(S=>({id:S.id,name:S.name,type:"classic_quiz",status:S.status,relationship:"bonusPointsGame"})))||[];i([...r,...C]),t(b),a("")},v=(m,b)=>{const C=e.filter(x=>!(x.entity_id===m&&x.entity_relationship===b)),S=r.filter(x=>!(x.id===m&&x.relationship===b));i(S),t(C)};return s.jsxs(s.Fragment,{children:[r.length>0&&s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:"Bonus points game"})}),r.map((m,b)=>s.jsx(bb,{entity:m,deleteLabel:n.delete,onDelete:v},`related-entity-relationship-${m.id}-${b}`))]}),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Input,{value:"Classic Quiz",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Input,{value:"Bonus Points Game",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(m,b)=>a(b),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!l&&s.jsx(h.CircularProgress,{size:"sm"}),children:l&&l.map(m=>s.jsx(h.Option,{value:m.id,children:m.name},`entity--${m.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o,onClick:g,sx:{mb:1},children:n.add})]}),s.jsx(Ye,{showToast:u,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:d})]})},RN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState("success"),[l,c]=y.useState(""),u=y.useContext(pa),f=(p,g)=>{a(p),c(g),i(!0)},d=()=>_(this,null,function*(){n(!0);const p=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(p!=null&&p.ok){const g=yield p.blob(),v=URL.createObjectURL(g),m=document.createElement("a");m.href=v,m.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(v),n(!1),f("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield p==null?void 0:p.json()),n(!1),f("danger",e.labels.usersLeadsExportErrorMessage)});return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{mb:2,children:[s.jsx(h.Box,{display:"flex",alignItems:"center",mb:1,children:s.jsx(h.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),s.jsx(h.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:e.labels.category}),s.jsx("th",{children:e.labels.action})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),s.jsx("td",{children:s.jsx(h.Button,{loading:t,onClick:d,children:e.labels.exportAllUsersLeads})})]})})]})})]}),s.jsx(Ye,{showToast:r,color:o,message:l,hideToast:()=>i(!1)})]})},LN=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=y.useContext(Gs);return s.jsx(h.Tooltip,{title:e,placement:"left",arrow:!0,children:s.jsx(h.IconButton,Q(M(M({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:s.jsx(gb,{})}))})},xb=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:f,transition:d}=fb({id:e}),p=y.useMemo(()=>({attributes:o,listeners:l,ref:u}),[o,l,u]),g={opacity:a?.6:void 0,transform:Kn.Translate.toString(f),transition:d},v=b=>b.split(" ").map(C=>C[0]).join("").toUpperCase().substring(0,2),m=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((x,I)=>I.charCodeAt(0)+((x<<5)-x),0)%360}, 70%, 80%)`;return s.jsx(Gs.Provider,{value:p,children:s.jsx(h.ListItem,{variant:n,ref:c,style:g,endAction:t?s.jsx(LN,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:s.jsxs(h.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[s.jsx(h.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:m(r.name)}}),s.jsx(h.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:m(r.name),my:2,ml:1},children:v(r.name)}),s.jsxs(h.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[s.jsx(h.Typography,{level:"title-md",children:r.name}),r.description&&s.jsx(h.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),s.jsx(h.Box,{sx:{mt:.5},children:r.type&&s.jsx(h.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${m(r.type)}40`},children:r.type})})]})]})})})},MN=({items:e=[],labels:t,setItems:n})=>{const[r,i]=y.useState(null),o=y.useMemo(()=>e.find(l=>l.id===(r==null?void 0:r.id)),[r,e]),a=_v(Ms(Fs,{activationConstraint:{distance:8}}),Ms($s,{coordinateGetter:hb}));return e.length===0?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:s.jsx(h.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):s.jsxs(nb,{sensors:a,onDragStart:({active:l})=>{i(l)},onDragEnd:({active:l,over:c})=>{if(c&&l.id!==(c==null?void 0:c.id)){const u=e.findIndex(({id:d})=>d===l.id),f=e.findIndex(({id:d})=>d===c.id);n(Vs(e,u,f))}i(null)},onDragCancel:()=>{i(null)},children:[s.jsx(ub,{items:e,children:s.jsx(h.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(l=>s.jsx(xb,{id:l.id,variant:"outlined",item:l,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${l.id}`))})}),s.jsx(vb,{children:o?s.jsx(xb,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},BN=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const i=y.useRef(null),o=y.useRef(null),a=y.useRef(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState(""),[C,S]=y.useState(""),[x,I]=y.useState(null),[w,A]=y.useState(""),[E,k]=y.useState(""),[$,G]=y.useState(""),[O,T]=y.useState(null),[F,H]=y.useState([]),[j,N]=y.useState("before"),[L,V]=y.useState(!1),[Y,X]=y.useState(""),[D,B]=y.useState(""),[U,W]=y.useState("STANDARD"),[ie,se]=y.useState("left"),[oe,Z]=y.useState("row"),[te,ne]=y.useState(!0),[ue,be]=y.useState(!0),[Ne,ht]=y.useState(!0),[Je,_t]=y.useState(!0),[he,ge]=y.useState(!0),[xe,ke]=y.useState(!1);y.useEffect(()=>{n!=="LEAD"&&c(!1),n!=="REGISTERED"&&f(!1)},[n]);const Ke=`
2475
+ `},N$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function z$(e){let{announcements:t=N$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=F$}=e;const{announce:o,announcement:a}=M$(),l=Oo("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),B$(y.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!c)return null;const f=y.createElement(y.Fragment,null,y.createElement(R$,{id:r,value:i.draggable}),y.createElement(L$,{id:l,announcement:a}));return n?yt.createPortal(f,n):f}var wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wt||(wt={}));function Ls(){}function Ms(e,t){return y.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function _v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const bn=Object.freeze({x:0,y:0});function j$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function U$(e,t){const n=Rs(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function V$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function H$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pv(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Dv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const W$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Pv(t),o=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const u=Pv(c),f=i.reduce((p,g,v)=>p+j$(u[v],g),0),d=Number((f/4).toFixed(4));o.push({id:l,data:{droppableContainer:a,value:d}})}}return o.sort(V$)};function G$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,l=o-n;if(r<i&&n<o){const c=t.width*t.height,u=e.width*e.height,f=a*l,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const Y$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=G$(l,t);c>0&&i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(H$)};function K$(e,t,n){return Q(L({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Ov(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:bn}function q$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,l)=>Q(L({},a),{top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),L({},n))}}const Q$=q$(1);function Rv(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function J$(e,t,n){const r=Rv(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:l}=r,c=e.left-a-(1-i)*parseFloat(n),u=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),f=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const X$={ignoreTransform:!1};function Ai(e,t){t===void 0&&(t=X$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=Nt(e).getComputedStyle(e);u&&(n=J$(n,u,f))}const{top:r,left:i,width:o,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:o,height:a,bottom:l,right:c}}function Lv(e){return Ai(e,{ignoreTransform:!0})}function Z$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function eF(e,t){return t===void 0&&(t=Nt(e).getComputedStyle(e)),t.position==="fixed"}function tF(e,t){t===void 0&&(t=Nt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Bs(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ru(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_o(i)||Av(i)||n.includes(i))return n;const o=Nt(e).getComputedStyle(i);return i!==e&&tF(i,o)&&n.push(i),eF(i,o)?n:r(i.parentNode)}return e?r(e):n}function Mv(e){const[t]=Bs(e,1);return t!=null?t:null}function Mu(e){return!ks||!e?null:wi(e)?e:Ou(e)?Ru(e)||e===Si(e).scrollingElement?window:_o(e)?e:null:null}function Bv(e){return wi(e)?e.scrollX:e.scrollLeft}function $v(e){return wi(e)?e.scrollY:e.scrollTop}function Bu(e){return{x:Bv(e),y:$v(e)}}var kt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(kt||(kt={}));function Fv(e){return!ks||!e?!1:e===document.scrollingElement}function Nv(e){const t={x:0,y:0},n=Fv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const nF={x:.2,y:.2};function rF(e,t,n,r,i){let{top:o,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=nF);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Nv(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(g.y=kt.Backward,v.y=r*Math.abs((t.top+m.height-o)/m.height)):!f&&c>=t.bottom-m.height&&(g.y=kt.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!p&&l>=t.right-m.width?(g.x=kt.Forward,v.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&a<=t.left+m.width&&(g.x=kt.Backward,v.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:g,speed:v}}function iF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function zv(e){return e.reduce((t,n)=>Ii(t,Bu(n)),bn)}function oF(e){return e.reduce((t,n)=>t+Bv(n),0)}function aF(e){return e.reduce((t,n)=>t+$v(n),0)}function jv(e,t){if(t===void 0&&(t=Ai),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Mv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sF=[["x",["left","right"],oF],["y",["top","bottom"],aF]];class $u{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Bs(n),i=zv(r);this.rect=L({},t),this.width=t.width,this.height=t.height;for(const[o,a,l]of sF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(r),f=i[o]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Lo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lF(e){const{EventTarget:t}=Nt(e);return e instanceof t?e:Si(e)}function Fu(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(Pi(n,2)+Pi(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fn||(fn={}));function Uv(e){e.preventDefault()}function cF(e){e.stopPropagation()}var Re;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Re||(Re={}));const Vv={start:[Re.Space,Re.Enter],cancel:[Re.Esc],end:[Re.Space,Re.Enter,Re.Tab]},uF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Re.Right:return Q(L({},n),{x:n.x+25});case Re.Left:return Q(L({},n),{x:n.x-25});case Re.Down:return Q(L({},n),{y:n.y+25});case Re.Up:return Q(L({},n),{y:n.y-25})}};class $s{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Lo(Si(n)),this.windowListeners=new Lo(Nt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jv(r),n(bn)}handleKeyDown(t){if(Os(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Vv,coordinateGetter:a=uF,scrollBehavior:l="smooth"}=i,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:bn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=Ro(d,f),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const b=t.code,{isTop:C,isRight:S,isLeft:x,isBottom:I,maxScroll:w,minScroll:A}=Nv(m),E=iF(m),k={x:Math.min(b===Re.Right?E.right-E.width/2:E.right,Math.max(b===Re.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(b===Re.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Re.Down?E.top:E.top+E.height/2,d.y))},$=b===Re.Right&&!S||b===Re.Left&&!x,G=b===Re.Down&&!I||b===Re.Up&&!C;if($&&k.x!==d.x){const O=m.scrollLeft+p.x,T=b===Re.Right&&O<=w.x||b===Re.Left&&O>=A.x;if(T&&!p.y){m.scrollTo({left:O,behavior:l});return}T?g.x=m.scrollLeft-O:g.x=b===Re.Right?m.scrollLeft-w.x:m.scrollLeft-A.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(G&&k.y!==d.y){const O=m.scrollTop+p.y,T=b===Re.Down&&O<=w.y||b===Re.Up&&O>=A.y;if(T&&!p.x){m.scrollTo({top:O,behavior:l});return}T?g.y=m.scrollTop-O:g.y=b===Re.Down?m.scrollTop-w.y:m.scrollTop-A.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ii(Ro(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}$s.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Vv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=o.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Hv(e){return!!(e&&"distance"in e)}function Wv(e){return!!(e&&"delay"in e)}class Nu{constructor(t,n,r){var i;r===void 0&&(r=lF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Si(a),this.documentListeners=new Lo(this.document),this.listeners=new Lo(r),this.windowListeners=new Lo(Nt(a)),this.initialCoordinates=(i=Rs(o))!=null?i:bn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fn.Resize,this.handleCancel),this.windowListeners.add(fn.DragStart,Uv),this.windowListeners.add(fn.VisibilityChange,this.handleCancel),this.windowListeners.add(fn.ContextMenu,Uv),this.documentListeners.add(fn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Wv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Hv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fn.Click,cF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!i)return;const c=(n=Rs(t))!=null?n:bn,u=Ro(i,c);if(!r&&l){if(Hv(l)){if(l.tolerance!=null&&Fu(u,l.tolerance))return this.handleCancel();if(Fu(u,l.distance))return this.handleStart()}if(Wv(l)&&Fu(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Re.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fs extends Nu{constructor(t){const{event:n}=t,r=Si(n.target);super(t,dF,r)}}Fs.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const fF={move:{name:"mousemove"},end:{name:"mouseup"}};var zu;(function(e){e[e.RightClick=2]="RightClick"})(zu||(zu={}));class hF extends Nu{constructor(t){super(t,fF,Si(t.event.target))}}hF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===zu.RightClick?!1:(r==null||r({event:n}),!0)}}];const ju={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pF extends Nu{constructor(t){super(t,ju)}static setup(){return window.addEventListener(ju.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ju.move.name,t)};function t(){}}}pF.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Mo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Mo||(Mo={}));var Ns;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ns||(Ns={}));function gF(e){let{acceleration:t,activator:n=Mo.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:l=Ns.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const g=vF({delta:d,disabled:!o}),[v,m]=k$(),b=y.useRef({x:0,y:0}),C=y.useRef({x:0,y:0}),S=y.useMemo(()=>{switch(n){case Mo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Mo.DraggableRect:return i}},[n,i,c]),x=y.useRef(null),I=y.useCallback(()=>{const A=x.current;if(!A)return;const E=b.current.x*C.current.x,k=b.current.y*C.current.y;A.scrollBy(E,k)},[]),w=y.useMemo(()=>l===Ns.TreeOrder?[...u].reverse():u,[l,u]);y.useEffect(()=>{if(!o||!u.length||!S){m();return}for(const A of w){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=f[E];if(!k)continue;const{direction:$,speed:G}=rF(A,k,S,t,p);for(const O of["x","y"])g[O][$[O]]||(G[O]=0,$[O]=0);if(G.x>0||G.y>0){m(),x.current=A,v(I,a),b.current=G,C.current=$;return}}b.current={x:0,y:0},C.current={x:0,y:0},m()},[t,I,r,m,o,a,JSON.stringify(S),JSON.stringify(g),v,u,w,f,JSON.stringify(p)])}const mF={x:{[kt.Backward]:!1,[kt.Forward]:!1},y:{[kt.Backward]:!1,[kt.Forward]:!1}};function vF(e){let{delta:t,disabled:n}=e;const r=Ds(t);return Do(i=>{if(n||!r||!i)return mF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[kt.Backward]:i.x[kt.Backward]||o.x===-1,[kt.Forward]:i.x[kt.Forward]||o.x===1},y:{[kt.Backward]:i.y[kt.Backward]||o.y===-1,[kt.Forward]:i.y[kt.Forward]||o.y===1}}},[n,t,r])}function bF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Do(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function yF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Bo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Bo||(Bo={}));var Uu;(function(e){e.Optimized="optimized"})(Uu||(Uu={}));const Gv=new Map;function xF(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=y.useState(null),{frequency:l,measure:c,strategy:u}=i,f=y.useRef(e),d=b(),p=Po(d),g=y.useCallback(function(C){C===void 0&&(C=[]),!p.current&&a(S=>S===null?C:S.concat(C.filter(x=>!S.includes(x))))},[p]),v=y.useRef(null),m=Do(C=>{if(d&&!n)return Gv;if(!C||C===Gv||f.current!==e||o!=null){const S=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){S.set(x.id,x.rect.current);continue}const I=x.node.current,w=I?new $u(c(I),I):null;x.rect.current=w,w&&S.set(x.id,w)}return S}return C},[e,o,n,d,c]);return y.useEffect(()=>{f.current=e},[e]),y.useEffect(()=>{d||g()},[n,d]),y.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),y.useEffect(()=>{d||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},l))},[l,d,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:o!=null};function b(){switch(u){case Bo.Always:return!1;case Bo.BeforeDragging:return n;default:return!n}}}function Vu(e,t){return Do(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function CF(e,t){return Vu(e,t)}function wF(e){let{callback:t,disabled:n}=e;const r=_s(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function zs(e){let{callback:t,disabled:n}=e;const r=_s(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function SF(e){return new $u(Ai(e),e)}function Yv(e,t,n){t===void 0&&(t=SF);const[r,i]=y.useState(null);function o(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=wF({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),l=zs({callback:o});return vn(()=>{o(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function IF(e){const t=Vu(e);return Ov(e,t)}const Kv=[];function AF(e){const t=y.useRef(e),n=Do(r=>e?r&&r!==Kv&&e&&t.current&&e.parentNode===t.current.parentNode?r:Bs(e):Kv,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function TF(e){const[t,n]=y.useState(null),r=y.useRef(e),i=y.useCallback(o=>{const a=Mu(o.target);a&&n(l=>l?(l.set(a,Bu(a)),new Map(l)):null)},[]);return y.useEffect(()=>{const o=r.current;if(e!==o){a(o);const l=e.map(c=>{const u=Mu(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Bu(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(o)};function a(l){l.forEach(c=>{const u=Mu(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Ii(o,a),bn):zv(e):bn,[e,t])}function qv(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==bn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ro(e,n.current):bn}function EF(e){y.useEffect(()=>{if(!ks)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function kF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function Qv(e){return y.useMemo(()=>e?Z$(e):null,[e])}const Jv=[];function _F(e,t){t===void 0&&(t=Ai);const[n]=e,r=Qv(n?Nt(n):null),[i,o]=y.useState(Jv);function a(){o(()=>e.length?e.map(c=>Fv(c)?r:new $u(t(c),c)):Jv)}const l=zs({callback:a});return vn(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function Xv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return _o(t)?t:e}function PF(e){let{measure:t}=e;const[n,r]=y.useState(null),i=y.useCallback(u=>{for(const{target:f}of u)if(_o(f)){r(d=>{const p=t(f);return d?Q(L({},d),{width:p.width,height:p.height}):p});break}},[t]),o=zs({callback:i}),a=y.useCallback(u=>{const f=Xv(u);o==null||o.disconnect(),f&&(o==null||o.observe(f)),r(f?t(f):null)},[t,o]),[l,c]=Ps(a);return y.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const DF=[{sensor:Fs,options:{}},{sensor:$s,options:{}}],OF={current:{}},js={draggable:{measure:Lv},droppable:{measure:Lv,strategy:Bo.WhileDragging,frequency:Uu.Optimized},dragOverlay:{measure:Ai}};class $o extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const RF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $o,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ls},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:js,measureDroppableContainers:Ls,windowRect:null,measuringScheduled:!1},Zv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ls,draggableNodes:new Map,over:null,measureDroppableContainers:Ls},Fo=y.createContext(Zv),eb=y.createContext(RF);function LF(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $o}}}function MF(e,t){switch(t.type){case wt.DragStart:return Q(L({},e),{draggable:Q(L({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case wt.DragMove:return e.draggable.active==null?e:Q(L({},e),{draggable:Q(L({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case wt.DragEnd:case wt.DragCancel:return Q(L({},e),{draggable:Q(L({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case wt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new $o(e.droppable.containers);return i.set(r,n),Q(L({},e),{droppable:Q(L({},e.droppable),{containers:i})})}case wt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new $o(e.droppable.containers);return a.set(n,Q(L({},o),{disabled:i})),Q(L({},e),{droppable:Q(L({},e.droppable),{containers:a})})}case wt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new $o(e.droppable.containers);return o.delete(n),Q(L({},e),{droppable:Q(L({},e.droppable),{containers:o})})}default:return e}}function BF(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=y.useContext(Fo),o=Ds(r),a=Ds(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!Os(o)||document.activeElement===o.target)return;const l=i.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=D$(f);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function tb(e,t){let i=t,{transform:n}=i,r=Ze(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(L({transform:o},r)),n):n}function $F(e){return y.useMemo(()=>({draggable:L(L({},js.draggable),e==null?void 0:e.draggable),droppable:L(L({},js.droppable),e==null?void 0:e.droppable),dragOverlay:L(L({},js.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function FF(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=y.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;vn(()=>{if(!a&&!l||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Ov(f,r);if(a||(d.x=0),l||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Mv(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,l,r,n])}const Us=y.createContext(Q(L({},bn),{scaleX:1,scaleY:1}));var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const nb=y.memo(function(t){var n,r,i,o;let _i=t,{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:f=DF,collisionDetection:d=Y$,measuring:p,modifiers:g}=_i,v=Ze(_i,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=y.useReducer(MF,void 0,LF),[b,C]=m,[S,x]=$$(),[I,w]=y.useState(dr.Uninitialized),A=I===dr.Initialized,{draggable:{active:E,nodes:k,translate:$},droppable:{containers:G}}=b,O=E!=null?k.get(E):null,T=y.useRef({initial:null,translated:null}),F=y.useMemo(()=>{var bt;return E!=null?{id:E,data:(bt=O==null?void 0:O.data)!=null?bt:OF,rect:T}:null},[E,O]),H=y.useRef(null),[j,N]=y.useState(null),[M,V]=y.useState(null),Y=Po(v,Object.values(v)),X=Oo("DndDescribedBy",a),D=y.useMemo(()=>G.getEnabled(),[G]),B=$F(p),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:ie}=xF(D,{dragging:A,dependencies:[$.x,$.y],config:B.droppable}),se=bF(k,E),oe=y.useMemo(()=>M?Rs(M):null,[M]),Z=tn(),te=CF(se,B.draggable.measure);FF({activeNode:E!=null?k.get(E):null,config:Z.layoutShiftCompensation,initialRect:te,measure:B.draggable.measure});const ne=Yv(se,B.draggable.measure,te),ue=Yv(se?se.parentElement:null),be=y.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=G.getNodeFor((n=be.current.over)==null?void 0:n.id),ht=PF({measure:B.dragOverlay.measure}),Je=(r=ht.nodeRef.current)!=null?r:se,_t=A?(i=ht.rect)!=null?i:ne:null,he=!!(ht.nodeRef.current&&ht.rect),ge=IF(he?null:ne),xe=Qv(Je?Nt(Je):null),ke=AF(A?Ne!=null?Ne:se:null),Ke=_F(ke),Oe=tb(g,{transform:{x:$.x-ge.x,y:$.y-ge.y,scaleX:1,scaleY:1},activatorEvent:M,active:F,activeNodeRect:ne,containerNodeRect:ue,draggingNodeRect:_t,over:be.current.over,overlayNodeRect:ht.rect,scrollableAncestors:ke,scrollableAncestorRects:Ke,windowRect:xe}),Pe=oe?Ii(oe,$):null,St=TF(ke),It=qv(St),Bt=qv(St,[ne]),Dt=Ii(Oe,It),zt=_t?Q$(_t,Oe):null,_n=F&&zt?d({active:F,collisionRect:zt,droppableRects:U,droppableContainers:D,pointerCoordinates:Pe}):null,Ei=Dv(_n,"id"),[hn,Rr]=y.useState(null),No=he?Oe:Ii(Oe,Bt),zo=K$(No,(o=hn==null?void 0:hn.rect)!=null?o:null,ne),ze=y.useRef(null),hr=y.useCallback((bt,P)=>{let{sensor:z,options:q}=P;if(H.current==null)return;const ee=k.get(H.current);if(!ee)return;const ae=bt.nativeEvent,ce=new z({active:H.current,activeNode:ee,event:ae,options:q,context:be,onAbort(de){if(!k.get(de))return;const{onDragAbort:pe}=Y.current,ve={id:de};pe==null||pe(ve),S({type:"onDragAbort",event:ve})},onPending(de,Ie,pe,ve){if(!k.get(de))return;const{onDragPending:Pt}=Y.current,Xe={id:de,constraint:Ie,initialCoordinates:pe,offset:ve};Pt==null||Pt(Xe),S({type:"onDragPending",event:Xe})},onStart(de){const Ie=H.current;if(Ie==null)return;const pe=k.get(Ie);if(!pe)return;const{onDragStart:ve}=Y.current,Le={activatorEvent:ae,active:{id:Ie,data:pe.data,rect:T}};yt.unstable_batchedUpdates(()=>{ve==null||ve(Le),w(dr.Initializing),C({type:wt.DragStart,initialCoordinates:de,active:Ie}),S({type:"onDragStart",event:Le}),N(ze.current),V(ae)})},onMove(de){C({type:wt.DragMove,coordinates:de})},onEnd:we(wt.DragEnd),onCancel:we(wt.DragCancel)});ze.current=ce;function we(de){return function(){return _(this,null,function*(){const{active:pe,collisions:ve,over:Le,scrollAdjustedTranslate:Pt}=be.current;let Xe=null;if(pe&&Pt){const{cancelDrop:nn}=Y.current;Xe={activatorEvent:ae,active:pe,collisions:ve,delta:Pt,over:Le},de===wt.DragEnd&&typeof nn=="function"&&(yield Promise.resolve(nn(Xe)))&&(de=wt.DragCancel)}H.current=null,yt.unstable_batchedUpdates(()=>{C({type:de}),w(dr.Uninitialized),Rr(null),N(null),V(null),ze.current=null;const nn=de===wt.DragEnd?"onDragEnd":"onDragCancel";if(Xe){const fe=Y.current[nn];fe==null||fe(Xe),S({type:nn,event:Xe})}})})}}},[k]),Lr=y.useCallback((bt,P)=>(z,q)=>{const ee=z.nativeEvent,ae=k.get(q);if(H.current!==null||!ae||ee.dndKit||ee.defaultPrevented)return;const ce={active:ae};bt(z,P.options,ce)===!0&&(ee.dndKit={capturedBy:P.sensor},H.current=q,hr(z,P))},[k,hr]),ki=yF(f,Lr);EF(f),vn(()=>{ne&&I===dr.Initializing&&w(dr.Initialized)},[ne,I]),y.useEffect(()=>{const{onDragMove:bt}=Y.current,{active:P,activatorEvent:z,collisions:q,over:ee}=be.current;if(!P||!z)return;const ae={active:P,activatorEvent:z,collisions:q,delta:{x:Dt.x,y:Dt.y},over:ee};yt.unstable_batchedUpdates(()=>{bt==null||bt(ae),S({type:"onDragMove",event:ae})})},[Dt.x,Dt.y]),y.useEffect(()=>{const{active:bt,activatorEvent:P,collisions:z,droppableContainers:q,scrollAdjustedTranslate:ee}=be.current;if(!bt||H.current==null||!P||!ee)return;const{onDragOver:ae}=Y.current,ce=q.get(Ei),we=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,de={active:bt,activatorEvent:P,collisions:z,delta:{x:ee.x,y:ee.y},over:we};yt.unstable_batchedUpdates(()=>{Rr(we),ae==null||ae(de),S({type:"onDragOver",event:de})})},[Ei]),vn(()=>{be.current={activatorEvent:M,active:F,activeNode:se,collisionRect:zt,collisions:_n,droppableRects:U,draggableNodes:k,draggingNode:Je,draggingNodeRect:_t,droppableContainers:G,over:hn,scrollableAncestors:ke,scrollAdjustedTranslate:Dt},T.current={initial:_t,translated:zt}},[F,se,_n,zt,k,Je,_t,U,G,hn,ke,Dt]),gF(Q(L({},Z),{delta:$,draggingRect:zt,pointerCoordinates:Pe,scrollableAncestors:ke,scrollableAncestorRects:Ke}));const pr=y.useMemo(()=>({active:F,activeNode:se,activeNodeRect:ne,activatorEvent:M,collisions:_n,containerNodeRect:ue,dragOverlay:ht,draggableNodes:k,droppableContainers:G,droppableRects:U,over:hn,measureDroppableContainers:W,scrollableAncestors:ke,scrollableAncestorRects:Ke,measuringConfiguration:B,measuringScheduled:ie,windowRect:xe}),[F,se,ne,M,_n,ue,ht,k,G,U,hn,W,ke,Ke,B,ie,xe]),Mr=y.useMemo(()=>({activatorEvent:M,activators:ki,active:F,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:C,draggableNodes:k,over:hn,measureDroppableContainers:W}),[M,ki,F,ne,C,X,k,hn,W]);return y.createElement(kv.Provider,{value:x},y.createElement(Fo.Provider,{value:Mr},y.createElement(eb.Provider,{value:pr},y.createElement(Us.Provider,{value:zo},u)),y.createElement(BF,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(z$,Q(L({},l),{hiddenTextDescribedById:X})));function tn(){const bt=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof c=="object"?c.enabled===!1:c===!1,z=A&&!bt&&!P;return typeof c=="object"?Q(L({},c),{enabled:z}):{enabled:z}}}),NF=y.createContext(null),rb="button",zF="Draggable";function jF(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Oo(zF),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=y.useContext(Fo),{role:g=rb,roleDescription:v="draggable",tabIndex:m=0}=i!=null?i:{},b=(c==null?void 0:c.id)===t,C=y.useContext(b?Us:NF),[S,x]=Ps(),[I,w]=Ps(),A=kF(a,t),E=Po(n);vn(()=>(d.set(t,{id:t,key:o,node:S,activatorNode:I,data:E}),()=>{const $=d.get(t);$&&$.key===o&&d.delete(t)}),[d,t]);const k=y.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&g===rb?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,g,m,b,v,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:S,over:p,setNodeRef:x,setActivatorNodeRef:w,transform:C}}function ib(){return y.useContext(eb)}const UF="Droppable",VF={timeout:25};function HF(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Oo(UF),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=y.useContext(Fo),f=y.useRef({disabled:n}),d=y.useRef(!1),p=y.useRef(null),g=y.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:b}=L(L({},VF),i),C=Po(m!=null?m:r),S=y.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(C.current)?C.current:[C.current]),g.current=null},b)},[b]),x=zs({callback:S,disabled:v||!a}),I=y.useCallback((k,$)=>{x&&($&&(x.unobserve($),d.current=!1),k&&x.observe(k))},[x]),[w,A]=Ps(I),E=Po(t);return y.useEffect(()=>{!x||!w.current||(x.disconnect(),d.current=!1,x.observe(w.current))},[w,x]),y.useEffect(()=>(l({type:wt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:w,rect:p,data:E}}),()=>l({type:wt.UnregisterDroppable,key:o,id:r})),[r]),y.useEffect(()=>{n!==f.current.disabled&&(l({type:wt.SetDroppableDisabled,id:r,key:o,disabled:n}),f.current.disabled=n)},[r,o,n,l]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===r,node:w,over:c,setNodeRef:A}}function WF(e){let{animation:t,children:n}=e;const[r,i]=y.useState(null),[o,a]=y.useState(null),l=Ds(n);return!n&&!r&&l&&i(l),vn(()=>{if(!o)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),y.createElement(y.Fragment,null,n,r?y.cloneElement(r,{ref:a}):null)}const GF={x:0,y:0,scaleX:1,scaleY:1};function YF(e){let{children:t}=e;return y.createElement(Fo.Provider,{value:Zv},y.createElement(Us.Provider,{value:GF},t))}const KF={position:"fixed",touchAction:"none"},qF=e=>Os(e)?"transform 250ms ease":void 0,QF=y.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:l,style:c,transform:u,transition:f=qF}=e;if(!l)return null;const d=i?u:Q(L({},u),{scaleX:1,scaleY:1}),p=L(Q(L({},KF),{width:l.width,height:l.height,top:l.top,left:l.left,transform:Kn.Transform.toString(d),transformOrigin:i&&r?U$(r,l):void 0,transition:typeof f=="function"?f(r):f}),c);return y.createElement(n,{className:a,style:p,ref:t},o)}),ob=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[l,c]of Object.entries(o.active))c!==void 0&&(i[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(o!=null&&o.dragOverlay)for(const[l,c]of Object.entries(o.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(i))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},JF={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Kn.Transform.toString(t)},{transform:Kn.Transform.toString(n)}]},sideEffects:ob({styles:{active:{opacity:"0"}}})};function XF(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return _s((o,a)=>{if(t===null)return;const l=n.get(o);if(!l)return;const c=l.node.current;if(!c)return;const u=Xv(a);if(!u)return;const{transform:f}=Nt(a).getComputedStyle(a),d=Rv(f);if(!d)return;const p=typeof t=="function"?t:ZF(t);return jv(c,i.draggable.measure),p({active:{id:o,data:l.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function ZF(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=L(L({},JF),e);return o=>{let S=o,{active:a,dragOverlay:l,transform:c}=S,u=Ze(S,["active","dragOverlay","transform"]);if(!t)return;const f={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},d={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/l.rect.height:1},p=L({x:c.x-f.x,y:c.y-f.y},d),g=i(Q(L({},u),{active:a,dragOverlay:l,transform:{initial:c,final:p}})),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const b=r==null?void 0:r(L({active:a,dragOverlay:l},u)),C=l.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{C.onfinish=()=>{b==null||b(),x()}})}}let ab=0;function eN(e){return y.useMemo(()=>{if(e!=null)return ab++,ab},[e])}const tN=y.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:l="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:b,over:C,measuringConfiguration:S,scrollableAncestors:x,scrollableAncestorRects:I,windowRect:w}=ib(),A=y.useContext(Us),E=eN(d==null?void 0:d.id),k=tb(a,{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:b.rect,over:C,overlayNodeRect:b.rect,scrollableAncestors:x,scrollableAncestorRects:I,transform:A,windowRect:w}),$=Vu(p),G=XF({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:S}),O=$?b.setRef:void 0;return y.createElement(YF,null,y.createElement(WF,{animation:G},d&&E?y.createElement(QF,{key:E,id:d.id,ref:O,as:l,activatorEvent:f,adjustScale:t,className:c,transition:o,rect:$,style:L({zIndex:u},i),transform:k},n):null))});function Vs(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function nN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Hs(e){return e!==null&&e>=0}function rN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function iN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const sb=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Vs(t,r,n),a=t[i],l=o[i];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},lb="Sortable",cb=y.createContext({activeIndex:-1,containerId:lb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sb,disabled:{draggable:!1,droppable:!1}});function ub(e){let{children:t,id:n,items:r,strategy:i=sb,disabled:o=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:f}=ib(),d=Oo(lb,n),p=l.rect!==null,g=y.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,m=a?g.indexOf(a.id):-1,b=u?g.indexOf(u.id):-1,C=y.useRef(g),S=!rN(g,C.current),x=b!==-1&&m===-1||S,I=iN(o);vn(()=>{S&&v&&f(g)},[S,g,v,f]),y.useEffect(()=>{C.current=g},[g]);const w=y.useMemo(()=>({activeIndex:m,containerId:d,disabled:I,disableTransforms:x,items:g,overIndex:b,useDragOverlay:p,sortedRects:nN(g,c),strategy:i}),[m,d,I.draggable,I.droppable,x,g,b,c,p,i]);return y.createElement(cb.Provider,{value:w},t)}const oN=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Vs(n,r,i).indexOf(t)},aN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==o&&i===a?!1:n?!0:a!==i&&t===c},sN={duration:200,easing:"ease"},db="transform",lN=Kn.Transition.toString({property:db,duration:0,easing:"linear"}),cN={roleDescription:"sortable"};function uN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=y.useState(null),l=y.useRef(n);return vn(()=>{if(!t&&n!==l.current&&r.current){const c=i.current;if(c){const u=Ai(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==l.current&&(l.current=n)},[t,n,r,i]),y.useEffect(()=>{o&&a(null)},[o]),o}function fb(e){let{animateLayoutChanges:t=aN,attributes:n,disabled:r,data:i,getNewIndex:o=oN,id:a,strategy:l,resizeObserverConfig:c,transition:u=sN}=e;const{items:f,containerId:d,activeIndex:p,disabled:g,disableTransforms:v,sortedRects:m,overIndex:b,useDragOverlay:C,strategy:S}=y.useContext(cb),x=dN(r,g),I=f.indexOf(a),w=y.useMemo(()=>L({sortable:{containerId:d,index:I,items:f}},i),[d,i,I,f]),A=y.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:E,node:k,isOver:$,setNodeRef:G}=HF({id:a,data:w,disabled:x.droppable,resizeObserverConfig:L({updateMeasurementsFor:A},c)}),{active:O,activatorEvent:T,activeNodeRect:F,attributes:H,setNodeRef:j,listeners:N,isDragging:M,over:V,setActivatorNodeRef:Y,transform:X}=jF({id:a,data:w,attributes:L(L({},cN),n),disabled:x.draggable}),D=E$(G,j),B=!!O,U=B&&!v&&Hs(p)&&Hs(b),W=!C&&M,ie=W&&U?X:null,se=l!=null?l:S,oe=U?ie!=null?ie:se({rects:m,activeNodeRect:F,activeIndex:p,overIndex:b,index:I}):null,Z=Hs(p)&&Hs(b)?o({id:a,items:f,activeIndex:p,overIndex:b}):I,te=O==null?void 0:O.id,ne=y.useRef({activeId:te,items:f,newIndex:Z,containerId:d}),ue=f!==ne.current.items,be=t({active:O,containerId:d,isDragging:M,isSorting:B,id:a,index:I,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),Ne=uN({disabled:!be,index:I,node:k,rect:E});return y.useEffect(()=>{B&&ne.current.newIndex!==Z&&(ne.current.newIndex=Z),d!==ne.current.containerId&&(ne.current.containerId=d),f!==ne.current.items&&(ne.current.items=f)},[B,Z,d,f]),y.useEffect(()=>{if(te===ne.current.activeId)return;if(te!=null&&ne.current.activeId==null){ne.current.activeId=te;return}const Je=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(Je)},[te]),{active:O,activeIndex:p,attributes:H,data:w,rect:E,index:I,newIndex:Z,items:f,isOver:$,isSorting:B,isDragging:M,listeners:N,node:k,overIndex:b,over:V,setNodeRef:D,setActivatorNodeRef:Y,setDroppableNodeRef:G,setDraggableNodeRef:j,transform:Ne!=null?Ne:oe,transition:ht()};function ht(){if(Ne||ue&&ne.current.newIndex===I)return lN;if(!(W&&!Os(T)||!u)&&(B||be))return Kn.Transition.toString(Q(L({},u),{property:db}))}}function dN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Ws(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const fN=[Re.Down,Re.Right,Re.Up,Re.Left],hb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:l}}=t;if(fN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case Re.Down:r.top<p.top&&c.push(d);break;case Re.Up:r.top>p.top&&c.push(d);break;case Re.Left:r.left>p.left&&c.push(d);break;case Re.Right:r.left<p.left&&c.push(d);break}});const u=W$({active:n,collisionRect:r,droppableRects:i,droppableContainers:c,pointerCoordinates:null});let f=Dv(u,"id");if(f===(a==null?void 0:a.id)&&u.length>1&&(f=u[1].id),f!=null){const d=o.get(n.id),p=o.get(f),g=p?i.get(p.id):null,v=p==null?void 0:p.node.current;if(v&&g&&d&&p){const b=Bs(v).some((A,E)=>l[E]!==A),C=pb(d,p),S=hN(d,p),x=b||!C?{x:0,y:0}:{x:S?r.width-g.width:0,y:S?r.height-g.height:0},I={x:g.left,y:g.top};return x.x&&x.y?I:Ro(I,x)}}}};function pb(e,t){return!Ws(e)||!Ws(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function hN(e,t){return!Ws(e)||!Ws(t)||!pb(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const gb=$e(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Gs=y.createContext({attributes:{},listeners:void 0,ref(){}}),pN=()=>{const{attributes:e,listeners:t,ref:n}=y.useContext(Gs);return s.jsx(h.Button,Q(L(L({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:s.jsx(gb,{})}))},mb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:l,listeners:c,setNodeRef:u,setActivatorNodeRef:f,transform:d,transition:p}=fb({id:t}),g=y.useMemo(()=>({attributes:a,listeners:c,ref:f}),[a,c,f]),v={opacity:l?.6:void 0,transform:Kn.Translate.toString(d),transition:p};return s.jsx(Gs.Provider,{value:g,children:s.jsx(h.ListItem,{variant:o,ref:u,style:v,startAction:i?s.jsx(pN,{}):s.jsx(s.Fragment,{}),endAction:i?s.jsx(h.Tooltip,{title:n,children:s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:s.jsx(_e.Remove,{})})}):s.jsx(s.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},gN={sideEffects:ob({styles:{active:{opacity:"0.6"}}})},vb=({children:e})=>s.jsx(tN,{dropAnimation:gN,children:e}),mN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=y.useState(null),l=y.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),c=_v(Ms(Fs),Ms($s,{coordinateGetter:hb}));return s.jsxs(nb,{sensors:c,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:f})=>{if(f&&u.id!==(f==null?void 0:f.id)){const d=e.findIndex(({id:g})=>g===u.id),p=e.findIndex(({id:g})=>g===f.id);r(Vs(e,d,p))}a(null)},onDragCancel:()=>{a(null)},children:[s.jsx(ub,{items:e,children:s.jsx(h.List,{sx:{gap:"10px",padding:0},children:e.map(u=>s.jsxs(mb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[s.jsx(h.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&s.jsx(h.Chip,{color:LB(u.type),sx:{marginLeft:2,marginRight:4},children:MB(u.type)})]},`sortable-item-${u.id}`))})}),s.jsx(vb,{children:l?s.jsx(s.Fragment,{children:e.map(u=>s.jsx(mb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):s.jsx(s.Fragment,{})})]})},vN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>s.jsxs(h.FormControl,{size:r,disabled:i,children:[s.jsx(h.FormLabel,{children:e.itemsPerPage}),s.jsx(h.Select,{value:t,size:r,onChange:a,sx:Q(L({},o),{minHeight:"37px"}),children:n.map((l,c)=>s.jsx(h.Option,{value:l,children:l},`items-per-page-${l}-${c}`))})]}),bN=(e,t)=>{const[n,r]=y.useState(null),{sdk:i}=Ge(),o=()=>_(this,null,function*(){let l=[];if(!e){r(l);return}try{switch(e){case"top_x":l=(yield i.topX.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":l=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"template":l=(yield i.loyalty.getTemplates(void 0,!0)).data.map(C=>({id:C.id,name:C.name,status:C.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":l=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":l=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"either_or":l=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"poll":l=(yield i.voting.getPolls({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"bracket":l=(yield i.bracketGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"standing":l=(yield i.standingGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break}}catch(c){console.error(c),r(l),t();return}r(l)});return y.useEffect(()=>(o(),()=>r(null)),[e]),n},yN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return s.jsx(h.Chip,{color:t,variant:"solid",size:"sm",children:e})},xN=$e(s.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),CN=$e(s.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),wN=$e(s.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),SN=$e(s.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),IN=$e(s.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),AN=e=>{switch(e.entityType){case"top_x":return s.jsx(h.Tooltip,{title:"Top X",children:s.jsx(xN,{})});case"match_quiz":return s.jsx(h.Tooltip,{title:"Match Quiz",children:s.jsx(CN,{})});case"template":return s.jsx(h.Tooltip,{title:"Leaderboard Templates",children:s.jsx(_e.EmojiEvents,{})});case"classic_quiz":return s.jsx(h.Tooltip,{title:"Classic Quiz",children:s.jsx(wN,{})});case"either_or":return s.jsx(h.Tooltip,{title:"Either/Or",children:s.jsx(SN,{})});case"poll":return s.jsx(h.Tooltip,{title:"Poll",children:s.jsx(IN,{})});case"bracket":return s.jsx(h.Tooltip,{title:"Custom Bracket Game",children:s.jsx(_e.EmojiEvents,{})});case"standing":return s.jsx(h.Tooltip,{title:"Custom Standings Game",children:s.jsx(_e.EmojiEvents,{})});default:return null}},bb=({entity:e,deleteLabel:t,onDelete:n})=>s.jsx(s.Fragment,{children:s.jsx(h.Card,{sx:{p:2,mb:2},children:s.jsx(h.CardContent,{children:s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[s.jsx(h.Typography,{fontSize:"sm",startDecorator:s.jsx(AN,{entityType:e.type}),children:e.name}),s.jsx(h.Box,{display:{xs:"none",md:"block"},children:s.jsx(yN,{status:e.status})}),s.jsx(h.Box,{children:s.jsx(h.Tooltip,{title:t,children:s.jsx(h.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:s.jsx(_e.Delete,{})})})})]})})})}),TN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(l=>{if(a.has(l.entity_type)){const c=a.get(l.entity_type);a.set(l.entity_type,[...c,[l.entity_id,l.entity_relationship]])}else a.set(l.entity_type,[[l.entity_id,l.entity_relationship]])});try{for(const[l,c]of a)switch(l){case"top_x":const u=c.map(([O])=>O),f=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...f.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"match_quiz":const d=c.map(([O])=>O),p=yield e.matchQuiz.getGames({limit:d.length,gameIds:d},!0);o=[...o,...p.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"template":const g=c.map(([O])=>O),v=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...v.data.filter(O=>g.includes(O.id)).map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"classic_quiz":const m=c.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:m.length,classicQuizIds:m},!1,!0);o=[...o,...b.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"personality_quiz":const C=c.map(([O])=>O),S=yield e.miniGames.getPersonalityQuizzes({limit:C.length,personalityQuizIds:C},!1,!0);o=[...o,...S.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"either_or":const x=c.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:x.length,eitherOrIds:x},!1,!0);o=[...o,...I.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"poll":const w=c.map(([O])=>O),A=yield e.voting.getPolls({limit:w.length,pollIds:w},!0);o=[...o,...A.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"bracket":const E=c.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"standing":const $=c.map(([O])=>O),G=yield e.standingGame.getGames({limit:$.length,gameIds:$},!0);o=[...o,...G.data.map(O=>{var F;const T=((F=c.find(([H])=>H===O.id))==null?void 0:F[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;default:}}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),EN=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],kN=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],_N=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),yb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),PN=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState("relatedTo"),[d,p]=y.useState(!1),g=()=>p(!d),v=bN(l,g),{sdk:m}=Ge();y.useEffect(()=>(e.length>0&&TN(m,e,i,g),()=>{i([]),a(""),c(null),f("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const w=[...e,{entity_id:o,entity_type:l,entity_relationship:u}],A=(v==null?void 0:v.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:l,status:E.status,relationship:u})))||[];i([...r,...A]),t(w),a("")},C=(I,w)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===w)),E=r.filter(k=>!(k.id===I&&k.relationship===w));i(E),t(A)},S=r.reduce((I,w)=>{const A=w.relationship;return I[A]||(I[A]=[]),I[A].push(w),I},{}),x=Object.keys(S).sort();return s.jsxs(s.Fragment,{children:[x.map(I=>s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:yb.get(I)||"Unknown relationship"})}),S[I].map((w,A)=>s.jsx(bb,{entity:w,deleteLabel:n.delete,onDelete:C},`related-entity-relationship-${w.id}-${A}`))]},`relationship-group-${I}`)),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Select,{value:l,size:"sm",name:"entity_type",onChange:(I,w)=>c(w),sx:{minHeight:"37px"},children:EN.map(I=>s.jsx(h.Option,{value:I,children:_N.get(I)},`entity-type-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,w)=>f(w),sx:{minHeight:"37px"},children:kN.map(I=>s.jsx(h.Option,{value:I,children:yb.get(I)},`entity-relationship-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,w)=>a(w),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!v&&s.jsx(h.CircularProgress,{size:"sm"}),children:v&&v.map(I=>s.jsx(h.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o||!l,onClick:b,sx:{mb:1},children:n.add})]}),s.jsx(Ye,{showToast:d,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:g})]})},DN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=t.filter(l=>l.entity_type==="classic_quiz"&&l.entity_relationship==="bonusPointsGame").map(l=>[l.entity_id,l.entity_relationship]);if(a.length===0){n([]);return}try{const l=a.map(([u])=>u);o=(yield e.miniGames.getClassicQuizzes({limit:l.length,classicQuizIds:l},!1,!0)).data.map(u=>{var d;const f=((d=a.find(([p])=>p===u.id))==null?void 0:d[1])||"bonusPointsGame";return{id:u.id,name:u.title,status:u.status,type:"classic_quiz",relationship:f}})}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),ON=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState(!1),d=()=>f(!u),{sdk:p}=Ge();y.useEffect(()=>(e.length>0&&DN(p,e,i,d),()=>{i([]),a("")}),[]),y.useEffect(()=>(_(this,null,function*(){try{const S=(yield p.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(x=>({id:x.id,name:x.title,status:x.status,type:"classic_quiz",relationship:"bonusPointsGame"}));c(S)}catch(C){console.error(C),c([]),d()}}),()=>c(null)),[]);const g=()=>{if(e.some(S=>S.entity_id===o&&S.entity_relationship==="bonusPointsGame")){a("");return}const b=[...e,{entity_id:o,entity_type:"classic_quiz",entity_relationship:"bonusPointsGame"}],C=(l==null?void 0:l.filter(S=>S.id===o).map(S=>({id:S.id,name:S.name,type:"classic_quiz",status:S.status,relationship:"bonusPointsGame"})))||[];i([...r,...C]),t(b),a("")},v=(m,b)=>{const C=e.filter(x=>!(x.entity_id===m&&x.entity_relationship===b)),S=r.filter(x=>!(x.id===m&&x.relationship===b));i(S),t(C)};return s.jsxs(s.Fragment,{children:[r.length>0&&s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:"Bonus points game"})}),r.map((m,b)=>s.jsx(bb,{entity:m,deleteLabel:n.delete,onDelete:v},`related-entity-relationship-${m.id}-${b}`))]}),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Input,{value:"Classic Quiz",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Input,{value:"Bonus Points Game",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(m,b)=>a(b),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!l&&s.jsx(h.CircularProgress,{size:"sm"}),children:l&&l.map(m=>s.jsx(h.Option,{value:m.id,children:m.name},`entity--${m.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o,onClick:g,sx:{mb:1},children:n.add})]}),s.jsx(Ye,{showToast:u,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:d})]})},RN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState("success"),[l,c]=y.useState(""),u=y.useContext(pa),f=(p,g)=>{a(p),c(g),i(!0)},d=()=>_(this,null,function*(){n(!0);const p=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(p!=null&&p.ok){const g=yield p.blob(),v=URL.createObjectURL(g),m=document.createElement("a");m.href=v,m.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(v),n(!1),f("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield p==null?void 0:p.json()),n(!1),f("danger",e.labels.usersLeadsExportErrorMessage)});return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{mb:2,children:[s.jsx(h.Box,{display:"flex",alignItems:"center",mb:1,children:s.jsx(h.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),s.jsx(h.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:e.labels.category}),s.jsx("th",{children:e.labels.action})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),s.jsx("td",{children:s.jsx(h.Button,{loading:t,onClick:d,children:e.labels.exportAllUsersLeads})})]})})]})})]}),s.jsx(Ye,{showToast:r,color:o,message:l,hideToast:()=>i(!1)})]})},LN=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=y.useContext(Gs);return s.jsx(h.Tooltip,{title:e,placement:"left",arrow:!0,children:s.jsx(h.IconButton,Q(L(L({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:s.jsx(gb,{})}))})},xb=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:f,transition:d}=fb({id:e}),p=y.useMemo(()=>({attributes:o,listeners:l,ref:u}),[o,l,u]),g={opacity:a?.6:void 0,transform:Kn.Translate.toString(f),transition:d},v=b=>b.split(" ").map(C=>C[0]).join("").toUpperCase().substring(0,2),m=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((x,I)=>I.charCodeAt(0)+((x<<5)-x),0)%360}, 70%, 80%)`;return s.jsx(Gs.Provider,{value:p,children:s.jsx(h.ListItem,{variant:n,ref:c,style:g,endAction:t?s.jsx(LN,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:s.jsxs(h.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[s.jsx(h.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:m(r.name)}}),s.jsx(h.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:m(r.name),my:2,ml:1},children:v(r.name)}),s.jsxs(h.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[s.jsx(h.Typography,{level:"title-md",children:r.name}),r.description&&s.jsx(h.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),s.jsx(h.Box,{sx:{mt:.5},children:r.type&&s.jsx(h.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${m(r.type)}40`},children:r.type})})]})]})})})},MN=({items:e=[],labels:t,setItems:n})=>{const[r,i]=y.useState(null),o=y.useMemo(()=>e.find(l=>l.id===(r==null?void 0:r.id)),[r,e]),a=_v(Ms(Fs,{activationConstraint:{distance:8}}),Ms($s,{coordinateGetter:hb}));return e.length===0?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:s.jsx(h.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):s.jsxs(nb,{sensors:a,onDragStart:({active:l})=>{i(l)},onDragEnd:({active:l,over:c})=>{if(c&&l.id!==(c==null?void 0:c.id)){const u=e.findIndex(({id:d})=>d===l.id),f=e.findIndex(({id:d})=>d===c.id);n(Vs(e,u,f))}i(null)},onDragCancel:()=>{i(null)},children:[s.jsx(ub,{items:e,children:s.jsx(h.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(l=>s.jsx(xb,{id:l.id,variant:"outlined",item:l,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${l.id}`))})}),s.jsx(vb,{children:o?s.jsx(xb,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},BN=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const i=y.useRef(null),o=y.useRef(null),a=y.useRef(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState(""),[C,S]=y.useState(""),[x,I]=y.useState(null),[w,A]=y.useState(""),[E,k]=y.useState(""),[$,G]=y.useState(""),[O,T]=y.useState(null),[F,H]=y.useState([]),[j,N]=y.useState("before"),[M,V]=y.useState(!1),[Y,X]=y.useState(""),[D,B]=y.useState(""),[U,W]=y.useState("STANDARD"),[ie,se]=y.useState("left"),[oe,Z]=y.useState(null),[te,ne]=y.useState(!0),[ue,be]=y.useState(!0),[Ne,ht]=y.useState(!0),[Je,_t]=y.useState(!0),[he,ge]=y.useState(!0),[xe,ke]=y.useState(!1);y.useEffect(()=>{n!=="LEAD"&&c(!1),n!=="REGISTERED"&&f(!1)},[n]);const Ke=`
2476
2476
  data-content-type="${e}"`,Oe=`
2477
2477
  data-content-id="${t}"`,Pe=F.length>0?`
2478
2478
  data-lead-fields="${F.join(", ")}"`:"",St=l?`
@@ -2497,7 +2497,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2497
2497
  data-additional-cta-url="${$}"`:"",bt=d&&O?`
2498
2498
  data-additional-cta-target="${O}"`:"",P=`<div
2499
2499
  data-component="fu-widget"${Ke}${Oe}${Rr}${No}${zo}${ze}${hr}${Lr}${ki}${pr}${Pe}${St}${It}${Bt}${Dt}${zt}${_n}${Ei}${hn}${Mr}${tn}${_i}${bt}
2500
- ></div>`,z={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},q=({title:fe})=>s.jsx(h.Tooltip,{title:fe,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),ee=()=>e==="either-or"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{mb:1.5,children:[s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.layoutTemplate}),s.jsxs(h.Select,{value:U,size:"md",name:"layout_template",onChange:Pt,children:[s.jsx(h.Option,{value:"STANDARD",children:"Standard"}),s.jsx(h.Option,{value:"SPLIT",children:"Split"}),s.jsx(h.Option,{value:"OVERLAY",children:"Overlay"})]}),s.jsx(h.FormHelperText,{children:r.layoutTemplateDescription})]}),s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.imagePosition}),s.jsxs(h.Select,{value:ie,size:"md",name:"image_position",disabled:U!=="STANDARD",onChange:(fe,Gt)=>se(Gt),children:[s.jsx(h.Option,{value:"left",children:"Left"}),s.jsx(h.Option,{value:"right",children:"Right"})]}),s.jsx(h.FormHelperText,{children:r.imagePositionDescription})]})]}),ae=()=>e==="either-or"||e==="match-quiz"?s.jsx(s.Fragment,{}):s.jsx(h.Box,{mb:1.5,children:s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.optionsLayout||"Options Layout"}),s.jsxs(h.Select,Q(M({action:a,value:oe,size:"md",name:"options_layout",onChange:(fe,Gt)=>Z(Gt),sx:{flex:1}},oe&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;Z(null),(fe=a.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"twoByTwo",children:"2x2 Grid"}),s.jsx(h.Option,{value:"row",children:"Row"}),s.jsx(h.Option,{value:"column",children:"Column"})]})),s.jsx(h.FormHelperText,{children:r.optionsLayoutDescription||"Configure the visual arrangement of answer options (2x2 grid, single row, or single column)"})]})}),ce=()=>e==="classic-quiz"||e==="personality-quiz"?s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:te,label:r.showAnswerExplanations,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ne(fe)}}),s.jsx(h.Tooltip,{title:r.showAnswerExplanationsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}):e==="match-quiz"||e==="event-game"?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:ue,label:r.showPredictionDetails||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{be(fe)}}),s.jsx(h.Tooltip,{title:r.showPredictionDetailsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:Ne,label:r.showCountdown||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ht(fe)}}),s.jsx(h.Tooltip,{title:r.showCountdownTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:he,label:r.showPoints||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ge(fe)}}),s.jsx(h.Tooltip,{title:r.showPointsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),e==="match-quiz"&&s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:Je,label:r.showTeamLabels||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{_t(fe)}}),s.jsx(h.Tooltip,{title:r.showTeamLabelsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]})]}):s.jsx(s.Fragment,{}),we=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:l,label:r.configureLeads,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:fe=>{fe===!1&&(H([]),N("before"),ke(!1)),c(fe)}}),n!=="LEAD"&&s.jsx(h.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),de=()=>!l||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Dr,{label:"",values:F,allValues:Object.keys(z),valuesMap:z,onChange:fe=>H(fe)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.leadPosition}),s.jsxs(h.Select,{value:j,size:"md",name:"lead_position",onChange:(fe,Gt)=>N(Gt==="before"?"before":"after"),children:[s.jsx(h.Option,{value:"before",children:"Before"}),s.jsx(h.Option,{value:"after",children:"After"})]})]}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.Checkbox,{label:r.syncWithProfile,checked:xe,onChange:fe=>ke(fe.target.checked)}),s.jsx(h.FormHelperText,{children:r.syncWithProfileDescription})]})]}),Ie=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:u,label:r.configureSignIn,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="REGISTERED",onChange:fe=>{fe===!1&&(v(""),b("")),f(fe)}}),n!=="REGISTERED"&&s.jsx(h.Tooltip,{title:r.configureSignInDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),pe=()=>!u||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.signInLabel,placeholder:"",defaultValue:"",value:g,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.signInLabelInfoMessage}),onChange:fe=>v(fe.target.value)}),s.jsx(Lt,{label:r.authenticationHandler,placeholder:"",defaultValue:m,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.authenticationHandlerInfoMessage}),onChange:fe=>b(fe.target.value)}),s.jsx(Lt,{label:r.signInUrl,placeholder:"",defaultValue:C,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.signInUrlInfoMessage}),onChange:fe=>S(fe.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.signInTarget}),s.jsxs(h.Select,Q(M({action:i,value:x,size:"md",name:"signin_cta_target",onChange:(fe,Gt)=>I(Gt),sx:{flex:1}},x&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;I(null),(fe=i.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens URL in the same tab"})]}))]})]}),ve=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsx(mn,{sx:{label:{mb:1.5}},defaultValue:L,label:r.addCampaignInfo,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{fe===!1&&(X(""),B("")),V(fe)}}),Le=()=>!L||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.id,placeholder:"",defaultValue:Y,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.campaignIdInfoMessage}),onChange:fe=>X(fe.target.value)}),s.jsx(Lt,{label:r.name,placeholder:"",defaultValue:D,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.campaignNameInfoMessage}),onChange:fe=>B(fe.target.value)})]}),Pt=(fe,Gt)=>{W(Gt),se(Gt!=="STANDARD"?null:"left")},Xe=()=>s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:d,label:r.configureAdditionalCta,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{fe===!1&&(A(""),k("")),p(fe)}}),s.jsx(h.Tooltip,{title:r.configureAdditionalCtaTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),nn=()=>d?s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.additionalCtaLabel,placeholder:"",defaultValue:"",value:w,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaLabelInfoMessage}),onChange:fe=>A(fe.target.value)}),s.jsx(Lt,{label:r.additionalCtaHandler,placeholder:"",defaultValue:E,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaHandlerInfoMessage}),onChange:fe=>k(fe.target.value)}),s.jsx(Lt,{label:r.additionalCtaUrl,placeholder:"",defaultValue:$,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaUrlInfoMessage}),onChange:fe=>G(fe.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.additionalCtaTarget}),s.jsxs(h.Select,Q(M({action:o,value:O,size:"md",name:"additional_cta_target",onChange:(fe,Gt)=>T(Gt),sx:{flex:1}},O&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;T(null),(fe=o.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens the provided URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens the provided URL in the same tab"})]}))]})]}):s.jsx(s.Fragment,{});return s.jsxs(h.Box,{mt:1,children:[ee(),ae(),ce(),we(),de(),Ie(),pe(),ve(),Le(),Xe(),nn(),s.jsxs(h.Box,{position:"relative",mb:1.5,children:[s.jsx(h.Textarea,{value:P,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:fe=>fe.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:r.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText(P)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1.5,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},$N=["load-more","limited"],FN={"load-more":"Load more",limited:"Limited"},NN=({entityId:e,labels:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(""),[a,l]=y.useState(""),[c,u]=y.useState(""),[f,d]=y.useState(10),[p,g]=y.useState(2),[v,m]=y.useState("load-more"),b=`
2500
+ ></div>`,z={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},q=({title:fe})=>s.jsx(h.Tooltip,{title:fe,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),ee=()=>e==="either-or"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{mb:1.5,children:[s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.layoutTemplate}),s.jsxs(h.Select,{value:U,size:"md",name:"layout_template",onChange:Pt,children:[s.jsx(h.Option,{value:"STANDARD",children:"Standard"}),s.jsx(h.Option,{value:"SPLIT",children:"Split"}),s.jsx(h.Option,{value:"OVERLAY",children:"Overlay"})]}),s.jsx(h.FormHelperText,{children:r.layoutTemplateDescription})]}),s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.imagePosition}),s.jsxs(h.Select,{value:ie,size:"md",name:"image_position",disabled:U!=="STANDARD",onChange:(fe,Gt)=>se(Gt),children:[s.jsx(h.Option,{value:"left",children:"Left"}),s.jsx(h.Option,{value:"right",children:"Right"})]}),s.jsx(h.FormHelperText,{children:r.imagePositionDescription})]})]}),ae=()=>e==="either-or"||e==="match-quiz"?s.jsx(s.Fragment,{}):s.jsx(h.Box,{mb:1.5,children:s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.optionsLayout||"Options Layout"}),s.jsxs(h.Select,Q(L({action:a,value:oe,size:"md",name:"options_layout",onChange:(fe,Gt)=>Z(Gt),sx:{flex:1}},oe&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;Z(null),(fe=a.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"twoByTwo",children:"2x2 Grid"}),s.jsx(h.Option,{value:"row",children:"Row"}),s.jsx(h.Option,{value:"column",children:"Column"})]})),s.jsx(h.FormHelperText,{children:r.optionsLayoutDescription||"Configure the visual arrangement of answer options (2x2 grid, single row, or single column)"})]})}),ce=()=>e==="classic-quiz"||e==="personality-quiz"?s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:te,label:r.showAnswerExplanations||"Show Answer Explanations",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ne(fe)}}),s.jsx(h.Tooltip,{title:r.showAnswerExplanationsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}):e==="match-quiz"||e==="event-game"?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:ue,label:r.showPredictionDetails||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{be(fe)}}),s.jsx(h.Tooltip,{title:r.showPredictionDetailsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:Ne,label:r.showCountdown||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ht(fe)}}),s.jsx(h.Tooltip,{title:r.showCountdownTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:he,label:r.showPoints||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{ge(fe)}}),s.jsx(h.Tooltip,{title:r.showPointsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),e==="match-quiz"&&s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(mn,{defaultValue:Je,label:r.showTeamLabels||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{_t(fe)}}),s.jsx(h.Tooltip,{title:r.showTeamLabelsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]})]}):s.jsx(s.Fragment,{}),we=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:l,label:r.configureLeads||"Configure Leads",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:fe=>{fe===!1&&(H([]),N("before"),ke(!1)),c(fe)}}),n!=="LEAD"&&s.jsx(h.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),de=()=>!l||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Dr,{label:"",values:F,allValues:Object.keys(z),valuesMap:z,onChange:fe=>H(fe)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.leadPosition}),s.jsxs(h.Select,{value:j,size:"md",name:"lead_position",onChange:(fe,Gt)=>N(Gt==="before"?"before":"after"),children:[s.jsx(h.Option,{value:"before",children:"Before"}),s.jsx(h.Option,{value:"after",children:"After"})]})]}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.Checkbox,{label:r.syncWithProfile,checked:xe,onChange:fe=>ke(fe.target.checked)}),s.jsx(h.FormHelperText,{children:r.syncWithProfileDescription})]})]}),Ie=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:u,label:r.configureSignIn||"Configure Sign In",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="REGISTERED",onChange:fe=>{fe===!1&&(v(""),b("")),f(fe)}}),n!=="REGISTERED"&&s.jsx(h.Tooltip,{title:r.configureSignInDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),pe=()=>!u||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.signInLabel||"Sign In Label",placeholder:"",defaultValue:"",value:g,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.signInLabelInfoMessage||"Custom label for the sign in button"}),onChange:fe=>v(fe.target.value)}),s.jsx(Lt,{label:r.authenticationHandler||"Authentication Handler",placeholder:"",defaultValue:m,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.authenticationHandlerInfoMessage||"JavaScript function name to handle the sign in click"}),onChange:fe=>b(fe.target.value)}),s.jsx(Lt,{label:r.signInUrl||"Sign In URL",placeholder:"",defaultValue:C,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.signInUrlInfoMessage||"URL to redirect users for sign in"}),onChange:fe=>S(fe.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.signInTarget}),s.jsxs(h.Select,Q(L({action:i,value:x,size:"md",name:"signin_cta_target",onChange:(fe,Gt)=>I(Gt),sx:{flex:1}},x&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;I(null),(fe=i.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens URL in the same tab"})]}))]})]}),ve=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsx(mn,{sx:{label:{mb:1.5}},defaultValue:M,label:r.addCampaignInfo||"Add Campaign Info",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{fe===!1&&(X(""),B("")),V(fe)}}),Le=()=>!M||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.id||"ID",placeholder:"",defaultValue:Y,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.campaignIdInfoMessage||"Unique identifier for the campaign"}),onChange:fe=>X(fe.target.value)}),s.jsx(Lt,{label:r.name||"Name",placeholder:"",defaultValue:D,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.campaignNameInfoMessage||"Name of the campaign"}),onChange:fe=>B(fe.target.value)})]}),Pt=(fe,Gt)=>{W(Gt),se(Gt!=="STANDARD"?null:"left")},Xe=()=>s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(mn,{defaultValue:d,label:r.configureAdditionalCta,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:fe=>{fe===!1&&(A(""),k("")),p(fe)}}),s.jsx(h.Tooltip,{title:r.configureAdditionalCtaTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),nn=()=>d?s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Lt,{label:r.additionalCtaLabel,placeholder:"",defaultValue:"",value:w,required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaLabelInfoMessage}),onChange:fe=>A(fe.target.value)}),s.jsx(Lt,{label:r.additionalCtaHandler,placeholder:"",defaultValue:E,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaHandlerInfoMessage}),onChange:fe=>k(fe.target.value)}),s.jsx(Lt,{label:r.additionalCtaUrl,placeholder:"",defaultValue:$,value:"",required:!1,size:"md",endDecorator:s.jsx(q,{title:r.additionalCtaUrlInfoMessage}),onChange:fe=>G(fe.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.additionalCtaTarget}),s.jsxs(h.Select,Q(L({action:o,value:O,size:"md",name:"additional_cta_target",onChange:(fe,Gt)=>T(Gt),sx:{flex:1}},O&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:fe=>{fe.stopPropagation()},onClick:()=>{var fe;T(null),(fe=o.current)==null||fe.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(Ao,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens the provided URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens the provided URL in the same tab"})]}))]})]}):s.jsx(s.Fragment,{});return s.jsxs(h.Box,{mt:1,children:[ee(),ae(),ce(),we(),de(),Ie(),pe(),ve(),Le(),Xe(),nn(),s.jsxs(h.Box,{position:"relative",mb:1.5,children:[s.jsx(h.Textarea,{value:P,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:fe=>fe.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:r.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText(P)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1.5,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},$N=["load-more","limited"],FN={"load-more":"Load more",limited:"Limited"},NN=({entityId:e,labels:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(""),[a,l]=y.useState(""),[c,u]=y.useState(""),[f,d]=y.useState(10),[p,g]=y.useState(2),[v,m]=y.useState("load-more"),b=`
2501
2501
  data-content-id="${e}"`,C=i?`
2502
2502
  data-classic-quiz-url="${i}"`:"",S=a?`
2503
2503
  data-either-or-url="${a}"`:"",x=c?`
@@ -2507,4 +2507,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2507
2507
  data-widget-mode="${v}"`,$=`<div
2508
2508
  data-component="fu-widget"
2509
2509
  data-content-type="list"${b}${C}${S}${x}${A}${E}${k}
2510
- ></div>`,G=({title:F})=>s.jsx(h.Tooltip,{title:F,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),O=()=>s.jsxs(h.Card,{sx:{pb:1,mb:3},children:[s.jsx(Lt,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.quizzesInfoMessage}),onChange:F=>o(F.target.value)}),s.jsx(Lt,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:F=>l(F.target.value)}),s.jsx(Lt,{label:t.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.pollsInfoMessage}),onChange:F=>u(F.target.value)})]}),T=()=>s.jsxs(h.Card,{sx:{pb:1,mb:3},children:[s.jsx(Du,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:f,onChange:F=>d(F||null),size:"md"}),s.jsx(Du,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:p,onChange:F=>g(F||null),size:"md"}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:t.mode}),s.jsx(h.Select,{defaultValue:v,onChange:(F,H)=>m(H),children:$N.map((F,H)=>s.jsx(h.Option,{value:F,children:FN[F]},`basic-select-${F}-${H}`))}),s.jsx(h.FormHelperText,{children:t.modeDescription})]})]});return s.jsxs(h.Box,{mt:1,children:[T(),s.jsx(mn,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:F=>{F===!1&&(o(""),l(""),u("")),r(F)}}),n&&O(),s.jsxs(h.Box,{position:"relative",mb:1,children:[s.jsx(h.Textarea,{value:$,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:F=>F.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:t.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText($)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},Cb=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],zN=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(""),[u,f]=y.useState("name"),[d,p]=y.useState(!1),[g,v]=y.useState(!1),{sdk:m}=Ge(),b=!0,C=()=>v(!g),S=(A,E)=>{i(E);const k=E.map($=>$.id);n(k&&k.length?k:null)},x=3;y.useEffect(()=>{!l&&t&&t.length&&m.profile.getByIds(t,void 0,b).then(A=>{i(Cb(A))}).catch(A=>{C(),console.error(A),i([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{p(!0),m.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,b).then(k=>{a([...Cb(k)]),p(!1)}).catch(k=>{console.error(k),C(),a([]),p(!1)})},300),[]);y.useEffect(()=>{if(!l||l.length<x){a([]);return}return I(l,u),()=>I.cancel()},[l,I,u]);const w=(A,E)=>A.map((k,$)=>{var G;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:O=>E({index:$}).onClick(O),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=k.avatar)!=null?G:Be.avatar}),s.jsx(h.Typography,{children:k.label})]})},k.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:d,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:s.jsxs(s.Fragment,{children:[d&&s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),s.jsx(h.Divider,{orientation:"vertical"}),s.jsxs(h.Select,{variant:"plain",value:u,onChange:(A,E)=>f(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[s.jsx(h.Option,{value:"name",children:e.searchByName}),s.jsx(h.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(k=>k.value===E.value)),onInputChange:(A,E)=>{c(E)},onChange:S,getOptionKey:A=>A.id,value:r,renderTags:w,renderOption:(A,E)=>{var k;return s.jsx(h.AutocompleteOption,Q(M({},A),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(k=E.avatar)!=null?k:Be.avatar}),s.jsx(h.Typography,{children:E.label})]})}))}})}),s.jsx(Ye,{showToast:g,message:e.searchProfilesErrorMessage,color:"danger",hideToast:C})]})},jN=({value:e,sx:t,tooltipPlacement:n})=>{const r=c=>{const u=Math.abs(c);return u>=1e9?(c/1e9).toFixed(1)+"b":u>=1e6?(c/1e6).toFixed(1)+"m":u>=1e3?(c/1e3).toFixed(1)+"k":c.toString()},i=c=>new Intl.NumberFormat("en-US").format(c),o=Math.abs(e)>=1e3,a=r(e),l=i(e);return o?s.jsx(h.Tooltip,{title:l,placement:n,arrow:!0,children:s.jsx(h.Typography,{sx:t,children:a})}):s.jsx(h.Typography,{sx:t,children:a})},UN=(e,t,n,r)=>{if(e&&e.length===0){n([]);return}t.football.getPlayers({playerIds:e}).then(i=>{const o=i.data.map(a=>wb(a));n(o)}).catch(i=>{console.error("Error fetching players by ID:",i),r()})},wb=e=>{var t,n,r,i,o;return{id:e.id,name:e.name,avatar:((t=e.assets)==null?void 0:t.headshot)||Be.avatar,countryName:((n=e.country)==null?void 0:n.name)||"Unknown",countryFlag:((i=(r=e.country)==null?void 0:r.assets)==null?void 0:i.flag)||Be.flag,teams:((o=e.teams)==null?void 0:o.map(a=>{var l;return{id:a.id,name:a.name,logo:((l=a.assets)==null?void 0:l.logo)||Be.team}}))||[]}},VN=({player:e,onRemove:t})=>s.jsx(h.Tooltip,{title:s.jsxs(h.Box,{sx:{p:1},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"bold",children:e.name}),s.jsxs(h.Typography,{level:"body-xs",sx:{display:"flex",alignItems:"center",gap:.5,mt:.5},children:[s.jsx("img",{src:e.countryFlag,alt:e.countryName,width:16,height:12,loading:"lazy"}),e.countryName]}),e.teams&&e.teams.length>0&&s.jsxs(h.Box,{sx:{mt:.5},children:[s.jsx(h.Typography,{level:"body-xs",sx:{mb:.5},children:"Teams:"}),s.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:.25},children:e.teams.map((n,r)=>s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx("img",{src:n.logo,alt:n.name,width:16,height:16,style:{borderRadius:"2px"},loading:"lazy"}),s.jsx(h.Typography,{level:"body-xs",children:n.name})]},r))})]})]}),placement:"left",variant:"solid",sx:{"--Tooltip-radius":"8px",maxWidth:300,bgcolor:"background.level1"},children:s.jsxs(h.Box,{sx:{display:"inline-flex",alignItems:"center",gap:.5,backgroundColor:"#e0f3ff",borderRadius:"50px",padding:"2px 8px 2px 2px",margin:"2px",position:"relative","&:hover":{backgroundColor:"#d0e8ff",cursor:"default"}},children:[s.jsx(h.Avatar,{src:e.avatar,alt:e.name,size:"sm",sx:{width:24,height:24,border:"1px solid #fff"}}),s.jsx(h.Typography,{level:"body-sm",sx:{fontSize:"12px",maxWidth:80,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),s.jsx(h.IconButton,{size:"sm",variant:"plain",color:"danger",onClick:t,sx:{minHeight:16,minWidth:16,padding:0,ml:.5,"&:hover":{backgroundColor:"rgba(255, 0, 0, 0.1)"}},children:s.jsx(_e.Close,{sx:{fontSize:12}})})]})}),HN=({labels:e,teamIds:t,selectedPlayers:n,onChangePlayers:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ge(),C=()=>m(!v),S=t&&t.length>0,x=(k,$)=>{o($),r($)},I=()=>_(this,null,function*(){if(S){d(!0);try{const k=t.map(O=>b.football.getTeamById(O)),$=yield Promise.all(k),G=[];$.forEach(O=>{if(O.squad&&O.squad.length>0){const T=O.squad.map(F=>{var H,j,N,L,V;return{id:F.id,name:F.name,avatar:((H=F.assets)==null?void 0:H.headshot)||Be.avatar,countryName:((j=F.country)==null?void 0:j.name)||"Unknown",countryFlag:((L=(N=F.country)==null?void 0:N.assets)==null?void 0:L.flag)||Be.flag,teams:[{id:O.id,name:O.name,logo:((V=O.assets)==null?void 0:V.logo)||Be.team}]}}).sort((F,H)=>F.name.localeCompare(H.name));G.push(...T)}}),u(G),l(G)}catch(k){console.error("Error fetching team players:",k),C()}finally{d(!1)}}}),w=k=>{if(!k){l(c);return}const $=c.filter(G=>G.name.toLowerCase().includes(k.toLowerCase()));l($)};y.useEffect(()=>{UN(n,b,o,C)},[n]),y.useEffect(()=>{S&&I()},[t]);const A=y.useMemo(()=>cr(k=>{if(!S){if(!k||k.length<2){l([]),d(!1);return}d(!0),b.football.getPlayers({name:k,sortField:"name",sortOrder:"asc"}).then($=>{const G=$.data.map(O=>wb(O));l(G),d(!1)}).catch($=>{console.error("Error searching players:",$),l([]),d(!1),C()})}},300),[b,S]);y.useEffect(()=>(S?w(p):A(p),()=>{S||A.cancel()}),[p,S]);const E=(k,$)=>k.map((G,O)=>s.jsx(VN,{player:G,onRemove:()=>{const T=$({index:O});T.onClick&&T.onClick({})}},G.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Autocomplete,{forcePopupIcon:S,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,flexWrap:"wrap"}},noOptions:{sx:{}}},isOptionEqualToValue:(k,$)=>k.id===$.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e==null?void 0:e.searchPlayersPlaceholder,options:a,filterSelectedOptions:!0,onInputChange:(k,$)=>{g($)},onChange:x,getOptionKey:k=>typeof k=="string"?k:k.id,getOptionLabel:k=>typeof k=="string"?k:k.name,value:i,renderTags:E,limitTags:1,renderOption:(k,$)=>{const G={props:k};return s.jsxs(h.AutocompleteOption,Q(M({},k),{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(h.Avatar,{src:$.avatar,alt:$.name,size:"sm",sx:{width:32,height:32}}),s.jsxs(h.Box,{sx:{flexGrow:1},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"bold",children:$.name}),s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx("img",{src:$.countryFlag,alt:$.countryName,width:16,height:12,loading:"lazy"}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:$.countryName})]})]})]}),`player-option-${$.id}-${G}`)}}),s.jsx(Ye,{showToast:v,message:e.getPlayersErrorMessage,color:"danger",hideToast:C})]})},WN=(e,t={})=>{const{enabled:n=!0}=t,{sdk:r}=Ge(),[i,o]=y.useState(null),[a,l]=y.useState(!1),[c,u]=y.useState(null),[f,d]=y.useState(null),p=y.useMemo(()=>M({},e),[JSON.stringify(e)]),g=y.useCallback(()=>_(this,null,function*(){var v,m;l(!0),u(null);try{const b=yield r.football.getMatches(p);o(b.data),d((m=(v=b.meta)==null?void 0:v.pagination)!=null?m:null)}catch(b){u(b),o([]),d(null)}finally{l(!1)}}),[r,p]);return y.useEffect(()=>{n&&g()},[g,n]),{matches:i,loading:a,error:c,meta:f,refetch:g}},Sb=$e(s.jsx("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded"),Ib=$e(s.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"PreviewRounded"),fr=qe("MuiStep",["root","indicator","horizontal","vertical","active","completed","disabled"]),Ti=qe("MuiStepIndicator",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]),GN=$e(s.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft"),YN=$e(s.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),Ab=$e(s.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");class KN{constructor(){J(this,"id","");J(this,"title","");J(this,"alternative_title",null);J(this,"description",null);J(this,"type",null);J(this,"auth_requirement",null);J(this,"rules",null);J(this,"ad_content",null);J(this,"labels",null);J(this,"branding",null);J(this,"embed_code",null);J(this,"custom_fields",null);J(this,"images",null);J(this,"status","");J(this,"flags",[]);J(this,"context",null);J(this,"options",[]);J(this,"related",[]);J(this,"multiple_choice",!1);J(this,"max_multiple_choice_options",null);J(this,"participation_count",0);J(this,"preferences_enabled",!1);J(this,"max_attempts",1);J(this,"external_activity",null)}}const qN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(""),o=e.generatedEntity,a=d=>{const p=new KN;return p.title=d.question||"",p.status="INACTIVE",p.options=(d.options||[]).map(g=>({title:g,description:"",images:{main:"",mobile:"",cover:""},embed_code:null,preference_mappings:[]})),p},l=d=>{i(d.id);const p=a(d);e.setPollRequestBody(p)},c=()=>{if(!o)return s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const d=()=>s.jsxs(h.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsx("tr",{children:s.jsx("th",{children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.questions})})})}),s.jsx("tbody",{children:o.questions.map((g,v)=>{var m;return s.jsx("tr",{children:s.jsx("td",{children:s.jsxs(h.Typography,{level:"body-sm",children:[g.question," ",s.jsx(h.Typography,{children:(m=g.options)==null?void 0:m.map((b,C)=>s.jsx(h.Chip,{color:b.correct?"success":"neutral",variant:b.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:b.option},`question-option-${C}`))})]})})},`question-${v}`)})})]}),p=()=>{const g=o.questions||[],v=m=>!m&&m!==0?"neutral":m>=5?"success":m>=4?"primary":m>=3?"warning":"neutral";return s.jsx(h.Box,{component:"ul",sx:{listStyle:"none",m:0,p:0,ml:0,pl:0,marginBlockStart:0,marginBlockEnd:0,marginInlineStart:0,marginInlineEnd:0,paddingInlineStart:0,display:"flex",flexDirection:"column",gap:1},children:g.map((m,b)=>{const C=r===m.id;return s.jsx(h.Box,{component:"li",children:s.jsx(h.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",cursor:"pointer",bgcolor:C?"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))":"background.body",borderColor:C?"primary.solidBg":void 0,"&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},"&:hover .pollOptionChipNeutral":{backgroundColor:"background.level1",borderColor:"neutral.outlinedBorder"}},onClick:()=>l(m),role:"button",tabIndex:0,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),l(m))},children:s.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[s.jsx(h.Radio,{name:"selectedPollSuggestion",value:m.id,checked:C,onChange:()=>l(m),size:"sm"}),s.jsxs(h.Box,{sx:{flex:1,minWidth:0},children:[s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.5},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:600,p:0,children:m.question}),s.jsx(h.Box,{sx:{flex:1}}),m.engagement_score?s.jsx(h.Tooltip,{title:e.labels.engagementScore,children:s.jsx(h.Chip,{size:"sm",variant:"solid",color:v(m.engagement_score),children:m.engagement_score})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(m.options||[]).map((S,x)=>s.jsx(h.Chip,{className:C?void 0:"pollOptionChipNeutral",variant:C?"soft":"outlined",color:C?"primary":"neutral",size:"sm",sx:{mr:.5,mb:.5},children:S},`poll-suggestion-opt-${x}`))})]})]})})},`poll-suggestion-${m.id||b}`)})})};return e.entityType==="poll"?s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",p:1,maxHeight:"400px",my:.5},children:p()}):s.jsxs(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[s.jsxs(h.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(v=>!v))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[s.jsx(h.Typography,{level:"body-sm",sx:{flexGrow:1},children:o.title}),s.jsx(h.Tooltip,{title:t?"":e.labels.expand,children:s.jsx(h.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?s.jsx(Ab,{}):s.jsx(Ts,{})})})]}),s.jsx(h.Box,{sx:{display:t?"block":"none",p:1},children:t?d():null})]})},u=()=>!e.matches||e.matches.length===0?s.jsx(h.Box,{sx:{height:250,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noMatchesFound})}):s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"250px",my:.5},children:e.matches.map(d=>{var p,g,v,m,b,C,S,x,I,w,A,E,k,$,G,O,T,F,H,j,N,L,V,Y;return s.jsxs(y.Fragment,{children:[s.jsxs(h.Box,{onClick:()=>e.setSelectedMatchId(d.id),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),e.setSelectedMatchId(d.id))},role:"button",tabIndex:0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},backgroundColor:e.selectedMatchId===d.id?"rgba(0,0,0,0.04)":"transparent"},children:[s.jsx(h.Radio,{size:"sm",name:"selectedMatch",value:d.id,checked:e.selectedMatchId===d.id,onChange:X=>e.setSelectedMatchId(X.target.value),sx:{mr:1}}),s.jsx(h.Tooltip,{title:(((g=(p=d.context)==null?void 0:p.competition)==null?void 0:g.name)||"Competition with no name")+((b=(m=(v=d.context)==null?void 0:v.competition)==null?void 0:m.country)!=null&&b.name?` (${d.context.competition.country.name})`:""),children:s.jsx(h.Avatar,{src:((x=(S=(C=d.context)==null?void 0:C.competition)==null?void 0:S.assets)==null?void 0:x.logo)||Be.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),s.jsxs(h.Typography,{level:"body-sm",children:["[",ft(d.kickoffAt).format("HH:mm DD.MM.YYYY"),"]"]}),(I=d.homeTeam)!=null&&I.code?s.jsx(h.Tooltip,{title:d.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),s.jsx(h.Avatar,{src:((w=d.homeTeam.assets)==null?void 0:w.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),s.jsx(h.Avatar,{src:((A=d.homeTeam.assets)==null?void 0:A.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]}),((k=(E=d==null?void 0:d.scores)==null?void 0:E.ftScore)==null?void 0:k.homeGoals)!==null&&((G=($=d==null?void 0:d.scores)==null?void 0:$.ftScore)==null?void 0:G.awayGoals)!==null?s.jsx(h.Chip,{variant:"outlined",children:((F=(T=(O=d.scores)==null?void 0:O.ftScore)==null?void 0:T.homeGoals)!=null?F:"")+":"+((N=(j=(H=d.scores)==null?void 0:H.ftScore)==null?void 0:j.awayGoals)!=null?N:"")}):" : ",(L=d.awayTeam)!=null&&L.code?s.jsx(h.Tooltip,{title:d.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((V=d.awayTeam.assets)==null?void 0:V.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})," ",s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((Y=d.awayTeam.assets)==null?void 0:Y.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}}),s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})]}),s.jsx(h.Divider,{sx:{my:.5}})]},`search-matches-custom-${d.id}`)})}),f=()=>s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-xs",children:e.pagination?`${e.labels.page} ${e.pagination.currentPage} ${e.labels.of} ${e.pagination.numberOfPages} • ${e.pagination.totalItems} ${e.labels.total}`:""}),s.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[s.jsx(h.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage<=1,onClick:()=>e.setPage(d=>Math.max(1,d-1)),sx:{bgcolor:"background.surface"},children:s.jsx(GN,{})}),s.jsx(h.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage>=e.pagination.numberOfPages,onClick:()=>e.setPage(d=>e.pagination?Math.min(e.pagination.numberOfPages,d+1):d+1),sx:{bgcolor:"background.surface"},children:s.jsx(YN,{})})]})]});return e.loading?s.jsx(h.Box,{sx:{height:240},children:s.jsx(yi,{my:0})}):s.jsxs(s.Fragment,{children:[e.step==="search"?u():c(),s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsx(h.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedMatchId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate}),e.step==="search"?f():s.jsx(s.Fragment,{})]})]})},QN=e=>{const t=ft(Date.now()).format("YYYY-MM-DD");if(e.step==="preview")return s.jsx(s.Fragment,{});const n=()=>e.entityType==="poll"?s.jsx(h.Checkbox,{disabled:!e.matchFilters.teamIds||e.matchFilters.teamIds.length===0,checked:e.useFramingGuidelines,size:"sm",onChange:r=>{e.setUseFramingGuidelines(r.target.checked)},label:e.labels.useFramingGuidelinesLabel}):s.jsx(s.Fragment,{});return s.jsxs(s.Fragment,{children:[s.jsx(jm,{labels:{teamsSelectionPlaceholder:e.labels.teamsSelectionPlaceholder||"",searchTeamsErrorMessage:e.labels.searchTeamsErrorMessage},ids:e.matchFilters.teamIds||[],onChange:e.onChangeTeams,scope:e.competitionsScope,readOnly:e.isGenerating,AdditionalCheckbox:n()}),s.jsxs(h.Grid,{container:!0,spacing:2,minWidth:"100%",columns:{xs:0,sm:0,md:12},mb:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.fromDate}),s.jsx(h.Input,{name:"fromDate",type:"date",defaultValue:e.matchFilters.fromDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})}),s.jsx(h.Grid,{xs:6,children:s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.toDate}),s.jsx(h.Input,{name:"toDate",type:"date",defaultValue:e.matchFilters.toDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})})]})]})},JN=ft(Date.now()).format("YYYY-MM-DD"),Tb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Li[t]?Li[t].key:"en"},Eb=e=>({fromDate:"",toDate:JN,competitionIds:e&&e.length?e:void 0,teamIds:void 0,sortOrder:"desc",status:"finished"}),XN=e=>{var Z;const[t,n]=y.useState(Tb(e.defaultLanguage)),[r,i]=y.useState(Eb(e.competitionsScope)),[o,a]=y.useState(1),[l,c]=y.useState(""),[u,f]=y.useState(!1),[d,p]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[C,S]=y.useState(null),[x,I]=y.useState(!1),[w,A]=y.useState(!1),[E,k]=y.useState(""),[$,G]=y.useState(!1),[O,T]=y.useState(""),[F,H]=y.useState("danger"),j=10,N=y.useMemo(()=>{const Ne=r,{fromDate:te,toDate:ne}=Ne,ue=Ze(Ne,["fromDate","toDate"]),be=M({},ue);if(te&&(be.fromDate=`${te}T00:00:00Z`),ne){const ht=ft().add(1,"minute").format("THH:mm:ss")+"Z";be.toDate=ne+ht}return Q(M({},be),{page:o,limit:j})},[r,o]),L=y.useMemo(()=>!(!m||e.entityType==="poll"&&!C),[m,e.entityType,C]);y.useEffect(()=>()=>{n(Tb),i(Eb(e.competitionsScope)),a(1),c(""),f(!1),p("search"),b(null)},[]);const{https:V}=Ge(),{matches:Y,loading:X,meta:D}=WN(N,{enabled:u}),B=()=>{T(""),G(!1)},U=te=>{let ne="",ue="danger";switch(te){case"on_generate_failed":ne=e.labels.onEntityGenerateErrorMessage;break;case"on_create":ne=e.labels.onEntityCreateMessage,ue="success";break;case"on_create_failed":ne=e.labels.onEntityCreateErrorMessage;break}H(ue),T(ne),G(!0)},W=te=>{var ue;const ne=te.map(be=>be.id);i(be=>Q(M({},be),{teamIds:ne||void 0})),a(1),f(!0),e.entityType==="poll"&&(te.length===0?(k(""),A(!1)):k(((ue=te[te.length-1])==null?void 0:ue.label)||""))},ie=te=>{const{name:ne,value:ue}=te.target;i(be=>Q(M({},be),{[ne]:ue})),f(!0)},se=()=>_(this,null,function*(){v(!0),e.entityType==="poll"&&S(null);let te=null;switch(e.entityType){case"classic_quiz":te=yield V.generatePostMatchQuiz({sportType:"football",lang:t,eventId:l});break;case"poll":const ue=w?E:"";te=yield V.generatePostMatchPoll({targetParticipant:ue,lang:t,eventId:l});break}if(!(te!=null&&te.ok)){const ue=yield te==null?void 0:te.json();console.error("Failed to generate AI content",ue),v(!1),U("on_generate_failed");return}const ne=yield te==null?void 0:te.json();if(e.entityType==="poll"){const ue=ne;ue.questions.sort((be,Ne)=>Ne.engagement_score-be.engagement_score),b(ue)}else b(ne);v(!1),p("preview")}),oe=te=>_(this,null,function*(){I(!0);let ne=null;switch(e.entityType){case"classic_quiz":const be=m;ne=yield V.createClassicQuiz(be);break;case"poll":ne=yield V.createPoll(C);break}const ue=yield ne==null?void 0:ne.json();if(!(ne!=null&&ne.ok)){console.error("Failed to create content",ue),I(!1),U("on_create_failed");return}if(I(!1),te==="goto"){U("on_create"),e.toggleModal(),e.fetchEntityById(ue.data.id);return}U("on_create")});return s.jsx(h.Modal,{open:e.isOpen,onClose:()=>{g||x||e.toggleModal()},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[s.jsx(h.DialogTitle,{children:e.labels.generateFootballPostMatchModalTitle}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{sx:{overflowX:"hidden"},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.FormControl,{size:"sm",sx:{mb:2},children:[s.jsx(h.FormLabel,{children:e.labels.language}),s.jsx(h.Select,{value:t,onChange:(te,ne)=>ne&&n(ne),indicator:null,disabled:g,startDecorator:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[t]||"gb").toLowerCase()}.png`,alt:((Z=Object.values(Te).find(te=>te.key===t))==null?void 0:Z.name)||"Language"}),sx:{minWidth:220,minHeight:38},children:Object.values(Te).map(te=>s.jsxs(h.Option,{value:te.key,label:te.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[te.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[te.key]||"gb").toLowerCase()}.png`,alt:te.name})}),te.name]},te.key))}),s.jsx(h.FormHelperText,{children:e.labels.targetLanguageDescription})]}),s.jsxs(h.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${Ti.root}`]:{borderWidth:3},[`& .${fr.root}::after`]:{height:3},[`& .${fr.completed}`]:{[`& .${Ti.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${fr.active}`]:{[`& .${Ti.root}`]:{borderColor:"currentColor"}},[`& .${fr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[s.jsx(h.Step,{active:d==="search",orientation:"vertical",indicator:s.jsx(h.Tooltip,{title:d==="preview"?e.labels.searchMatchTooltip:"",placement:"right",children:s.jsx(h.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&d==="preview"&&(te.preventDefault(),b(null),p("search"))},sx:M({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:s.jsx(Sb,{})})}),children:s.jsx(h.Typography,{sx:M({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&d==="preview"&&(te.preventDefault(),b(null),p("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchMatch})}),s.jsx(h.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:s.jsx(h.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:s.jsx(Ib,{})}),children:s.jsx(h.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),s.jsx(QN,{entityType:e.entityType,step:d,labels:e.labels,useFramingGuidelines:w,matchFilters:r,competitionsScope:e.competitionsScope,generatedEntity:m,isGenerating:g,setUseFramingGuidelines:A,onChangeTeams:W,onChangeDates:ie}),u?s.jsx(h.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",bgcolor:"background.surface"},children:s.jsx(qN,{step:d,loading:X||g,matches:Y,selectedMatchId:l,generatedEntity:m,labels:e.labels,pagination:D,teamIdsFilter:r.teamIds,setPollRequestBody:S,setPage:a,setSelectedMatchId:c,onGenerate:se,entityType:e.entityType,setGeneratedEntity:b})}):s.jsx(s.Fragment,{})]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{variant:"outlined",color:"primary",loading:x,disabled:!L||g,onClick:()=>oe("goto"),children:e.labels.createAndGoTo}),s.jsx(h.Button,{variant:"solid",color:"primary",loading:x,disabled:!L||g,onClick:()=>oe("continue"),children:e.labels.createAndContinue}),s.jsx(h.Button,{disabled:g||x,variant:"plain",color:"neutral",onClick:te=>{te.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),s.jsx(Ye,{showToast:$,color:F,message:O,hideToast:B})]})})},ZN=e=>{const[t,n]=y.useState(!1),r=e.generatedEntity,i=()=>{if(!r)return s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const a=()=>s.jsxs(h.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsx("tr",{children:s.jsx("th",{children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.questions})})})}),s.jsx("tbody",{children:r.questions.map((l,c)=>{var u;return s.jsx("tr",{children:s.jsx("td",{children:s.jsxs(h.Typography,{level:"body-sm",children:[l.question," ",s.jsx(h.Typography,{children:(u=l.options)==null?void 0:u.map((f,d)=>s.jsx(h.Chip,{color:f.correct?"success":"neutral",variant:f.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:f.option},`question-option-${d}`))})]})})},`question-${c}`)})})]});return s.jsxs(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[s.jsxs(h.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n(c=>!c))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[s.jsx(h.Typography,{level:"body-sm",sx:{flexGrow:1},children:r.title}),s.jsx(h.Tooltip,{title:t?"":e.labels.expand,children:s.jsx(h.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?s.jsx(Ab,{}):s.jsx(Ts,{})})})]}),s.jsx(h.Box,{sx:{display:t?"block":"none",p:1},children:t?a():null})]})},o=()=>!e.races||e.races.length===0?s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noRacesFound})}):s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:e.races.map(a=>{var u;const l=a.status==="Completed",c=a.status==="Scheduled";return s.jsxs(y.Fragment,{children:[s.jsxs(h.Box,{onClick:l?()=>e.setSelectedRaceId(a.id.toString()):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.setSelectedRaceId(a.id.toString()))}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:l?"pointer":"not-allowed",opacity:c?.6:1,"&:hover":l?{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}:{},backgroundColor:e.selectedRaceId===a.id.toString()?"rgba(0,0,0,0.04)":"transparent"},children:[s.jsx(h.Radio,{size:"sm",name:"selectedRace",value:a.id.toString(),checked:e.selectedRaceId===a.id.toString(),disabled:!l,onChange:l?f=>e.setSelectedRaceId(f.target.value):void 0,sx:{mr:1}}),s.jsx(h.Tooltip,{title:a.competition.name+((u=a.competition.location)!=null&&u.country?` (${a.competition.location.country})`:""),children:s.jsx(h.Avatar,{src:a.circuit.image||Be.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),s.jsxs(h.Typography,{level:"body-sm",children:["[",ft(a.date).format("HH:mm DD.MM.YYYY"),"]"]}),s.jsx(h.Typography,{level:"body-sm",fontWeight:600,children:a.competition.name}),s.jsx(h.Typography,{level:"body-sm",children:a.circuit.name}),s.jsx(h.Chip,{variant:l?"solid":"outlined",color:l?"success":"neutral",size:"sm",children:a.status==="Completed"?"Finished":"Upcoming"})]}),s.jsx(h.Divider,{sx:{my:.5}})]},`race-${a.id}`)})});return e.loading?s.jsx(h.Box,{sx:{height:240},children:s.jsx(yi,{my:0})}):s.jsxs(s.Fragment,{children:[e.step==="search"?o():i(),s.jsx(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:s.jsx(h.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedRaceId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate})})]})},kb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Li[t]?Li[t].key:"en"},Ys=()=>new Date().getFullYear(),ez=()=>{const e=Ys();return[e,e-1,e-2]},tz={Login:yL,InformationInput:Lt,RichText:Sc,HeaderButtons:KP,MarketSelection:LL,Accordion:RT,DynamicFields:dD,BasicSelect:MT,BooleanSwitch:mn,Branding:HP,ProfileSearchSelect:t2,RangeCalendar:cD,CompetitionSearchSelect:ZM,Related:FL,Images:qR,Duration:lD,DatePickerComponent:bo,Flags:WR,Spinner:yi,Tags:Um,Toast:Ye,AdContent:LT,Match:ML,Winners:VB,CompetitionsSearchSelect:e2,TeamsSearchSelect:jm,CustomSelect:eM,Schedule:YL,NoPermissionCard:uD,CustomFlatpickrCalendar:au,ContextSelectFilter:WB,NumberInput:Du,EntityContext:S$,MiniGamesImages:A$,AuthRequirement:T$,SortableList:mN,ItemsPerPageFilter:vN,ImageCard:Io,RelatedRelationship:PN,BonusPointsRelatedQuiz:ON,ExportUsersLeads:RN,SignOutButton:vg,BasicSortableList:MN,WidgetEmbedCode:BN,WidgetListEmbedCode:NN,AdvancedProfileSearchSelect:zN,FormatNumber:jN,PlayersSearchSelect:HN,GenerateFootballPostMatchModal:XN,GenerateFormula1PostEventModal:e=>{var L,V;const[t,n]=y.useState(kb(e.defaultLanguage)),[r,i]=y.useState(Ys()),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[C,S]=y.useState(!1),[x,I]=y.useState(!1),[w,A]=y.useState(""),[E,k]=y.useState("danger"),$=y.useMemo(()=>!!m,[m]);y.useEffect(()=>{e.isOpen?F(Ys()):(n(kb(e.defaultLanguage)),i(Ys()),a([]),f(""),p("search"),b(null))},[e.isOpen]);const{https:G}=Ge(),O=()=>{A(""),I(!1)},T=Y=>{let X="",D="danger";switch(Y){case"on_generate_failed":X=e.labels.onEntityGenerateErrorMessage;break;case"on_create":X=e.labels.onEntityCreateMessage,D="success";break;case"on_create_failed":X=e.labels.onEntityCreateErrorMessage;break;case"fetch_races_failed":X=e.labels.fetchRacesErrorMessage;break}k(D),A(X),I(!0)},F=Y=>_(this,null,function*(){c(!0);const X=yield G.apiSports.getRaces(Y),D=yield X.json();if(!X.ok){console.error("Error fetching races:",D),c(!1),a([]),T("fetch_races_failed");return}const W=(D.response||[]).sort((te,ne)=>new Date(ne.date).getTime()-new Date(te.date).getTime()),ie=W.filter(te=>te.status==="Completed"),se=W.filter(te=>te.status==="Scheduled"),Z=[...se.length>0?[se.sort((te,ne)=>new Date(te.date).getTime()-new Date(ne.date).getTime())[0]]:[],...ie];a(Z),c(!1)}),H=Y=>{i(Y),f(""),F(Y)},j=()=>_(this,null,function*(){v(!0);const Y=yield G.generatePostMatchQuiz({sportType:"formula1",lang:t,eventId:u});if(!(Y!=null&&Y.ok)){const D=yield Y==null?void 0:Y.json();console.error("Failed to generate AI content",D),v(!1),T("on_generate_failed");return}const X=yield Y==null?void 0:Y.json();b(X),v(!1),p("preview")}),N=Y=>_(this,null,function*(){S(!0);const X=m,D=yield G.createClassicQuiz(X),B=yield D.json();if(!(D!=null&&D.ok)){console.error("Failed to create content",B),S(!1),T("on_create_failed");return}if(S(!1),Y==="goto"){T("on_create"),e.toggleModal(),e.fetchEntityById(B.data.id);return}T("on_create")});return s.jsx(h.Modal,{open:e.isOpen,onClose:()=>{g||C||e.toggleModal()},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[s.jsx(h.DialogTitle,{children:e.labels.generateFormulaOnePostEventModalTitle}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{sx:{overflowX:"hidden"},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:2,mb:2},children:[s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.language}),s.jsx(h.Select,{value:t,onChange:(Y,X)=>X&&n(X),indicator:null,disabled:g,startDecorator:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[t]||"gb").toLowerCase()}.png`,alt:((L=Object.values(Te).find(Y=>Y.key===t))==null?void 0:L.name)||"Language"}),sx:{minHeight:38},children:Object.values(Te).map(Y=>s.jsxs(h.Option,{value:Y.key,label:Y.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[Y.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[Y.key]||"gb").toLowerCase()}.png`,alt:Y.name})}),Y.name]},Y.key))}),s.jsx(h.FormHelperText,{children:e.labels.targetLanguageDescription})]}),s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.season}),s.jsx(h.Select,{value:r,onChange:(Y,X)=>X&&H(X),disabled:g||!!m,sx:{minHeight:38},children:ez().map(Y=>s.jsx(h.Option,{value:Y,children:Y},Y))}),s.jsx(h.FormHelperText,{children:e.labels.seasonDescription})]})]}),s.jsxs(h.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${Ti.root}`]:{borderWidth:3},[`& .${fr.root}::after`]:{height:3},[`& .${fr.completed}`]:{[`& .${Ti.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${fr.active}`]:{[`& .${Ti.root}`]:{borderColor:"currentColor"}},[`& .${fr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[s.jsx(h.Step,{active:d==="search",orientation:"vertical",indicator:s.jsx(h.Tooltip,{title:d==="preview"?(V=e.labels)==null?void 0:V.searchRaceTooltip:"",placement:"right",children:s.jsx(h.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),p("search"))},sx:M({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:s.jsx(Sb,{})})}),children:s.jsx(h.Typography,{sx:M({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),p("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchRace})}),s.jsx(h.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:s.jsx(h.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:s.jsx(Ib,{})}),children:s.jsx(h.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),s.jsx(h.Sheet,{variant:"outlined",sx:{mt:2,p:1,borderRadius:"sm",bgcolor:"background.surface"},children:s.jsx(ZN,{step:d,loading:l||g,races:o,selectedRaceId:u,generatedEntity:m,labels:e.labels,setSelectedRaceId:f,onGenerate:j,setGeneratedEntity:b})})]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{variant:"outlined",color:"primary",loading:C,disabled:!$||g,onClick:()=>N("goto"),children:e.labels.createAndGoTo}),s.jsx(h.Button,{variant:"solid",color:"primary",loading:C,disabled:!$||g,onClick:()=>N("continue"),children:e.labels.createAndContinue}),s.jsx(h.Button,{disabled:g||C,variant:"plain",color:"neutral",onClick:Y=>{Y.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),s.jsx(Ye,{showToast:x,color:E,message:w,hideToast:O})]})})}},_b=y.createContext(null),nz=({children:e})=>s.jsx(_b.Provider,{value:tz,children:e}),rz=()=>{const e=y.useContext(_b);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},Pb=425,Db=1024,iz=()=>{const[e,t]=y.useState(window.innerWidth<=Db),[n,r]=y.useState(window.innerWidth<=Pb);return y.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=Db),r(window.innerWidth<=Pb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}};var Ob=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.ENUM="ENUM",e.FREE_INPUT="FREE_INPUT",e))(Ob||{}),Rb=(e=>(e.ACTIVE="ACTIVE",e.SETTLED="SETTLED",e.VOID="VOID",e))(Rb||{});class oz{constructor(){J(this,"id","");J(this,"question","");J(this,"status","ACTIVE");J(this,"void_reason",null);J(this,"points",0);J(this,"outcome_type",null);J(this,"valid_outcomes",null);J(this,"outcome",null)}}class az{constructor(){J(this,"id","");J(this,"title","");J(this,"description","");J(this,"type","EVENT");J(this,"rules","");J(this,"status","PENDING");J(this,"images",null);J(this,"related",[]);J(this,"custom_fields",null);J(this,"predictions_cutoff","");J(this,"fixtures",[]);J(this,"tiebreaker",{stat_tiebreaker_enabled:!1,stat_total:0})}}const sz={APIProvider:GS,AuthProvider:YS,AuthContext:Qf,ComponentProvider:nz,useComponentContext:rz,useAPIContext:Ge,useIsMobile:iz,constants:{supportedLanguages:Te,languagesMap:Li}};Ae.EventGameFixtureStatusEnum=Rb,Ae.EventGameFixturesModel=oz,Ae.EventGameOutcomeTypeEnum=Ob,Ae.EventGameRequestBody=az,Ae.default=sz,Object.defineProperties(Ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
2510
+ ></div>`,G=({title:F})=>s.jsx(h.Tooltip,{title:F,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),O=()=>s.jsxs(h.Card,{sx:{pb:1,mb:3},children:[s.jsx(Lt,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.quizzesInfoMessage}),onChange:F=>o(F.target.value)}),s.jsx(Lt,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:F=>l(F.target.value)}),s.jsx(Lt,{label:t.pollURL,placeholder:"",defaultValue:c,required:!1,size:"md",endDecorator:s.jsx(G,{title:t.pollsInfoMessage}),onChange:F=>u(F.target.value)})]}),T=()=>s.jsxs(h.Card,{sx:{pb:1,mb:3},children:[s.jsx(Du,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:f,onChange:F=>d(F||null),size:"md"}),s.jsx(Du,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:p,onChange:F=>g(F||null),size:"md"}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:t.mode}),s.jsx(h.Select,{defaultValue:v,onChange:(F,H)=>m(H),children:$N.map((F,H)=>s.jsx(h.Option,{value:F,children:FN[F]},`basic-select-${F}-${H}`))}),s.jsx(h.FormHelperText,{children:t.modeDescription})]})]});return s.jsxs(h.Box,{mt:1,children:[T(),s.jsx(mn,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:F=>{F===!1&&(o(""),l(""),u("")),r(F)}}),n&&O(),s.jsxs(h.Box,{position:"relative",mb:1,children:[s.jsx(h.Textarea,{value:$,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:F=>F.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:t.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText($)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},Cb=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],zN=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(""),[u,f]=y.useState("name"),[d,p]=y.useState(!1),[g,v]=y.useState(!1),{sdk:m}=Ge(),b=!0,C=()=>v(!g),S=(A,E)=>{i(E);const k=E.map($=>$.id);n(k&&k.length?k:null)},x=3;y.useEffect(()=>{!l&&t&&t.length&&m.profile.getByIds(t,void 0,b).then(A=>{i(Cb(A))}).catch(A=>{C(),console.error(A),i([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{p(!0),m.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,b).then(k=>{a([...Cb(k)]),p(!1)}).catch(k=>{console.error(k),C(),a([]),p(!1)})},300),[]);y.useEffect(()=>{if(!l||l.length<x){a([]);return}return I(l,u),()=>I.cancel()},[l,I,u]);const w=(A,E)=>A.map((k,$)=>{var G;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:O=>E({index:$}).onClick(O),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=k.avatar)!=null?G:Be.avatar}),s.jsx(h.Typography,{children:k.label})]})},k.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:d,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:s.jsxs(s.Fragment,{children:[d&&s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),s.jsx(h.Divider,{orientation:"vertical"}),s.jsxs(h.Select,{variant:"plain",value:u,onChange:(A,E)=>f(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[s.jsx(h.Option,{value:"name",children:e.searchByName}),s.jsx(h.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(k=>k.value===E.value)),onInputChange:(A,E)=>{c(E)},onChange:S,getOptionKey:A=>A.id,value:r,renderTags:w,renderOption:(A,E)=>{var k;return s.jsx(h.AutocompleteOption,Q(L({},A),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(k=E.avatar)!=null?k:Be.avatar}),s.jsx(h.Typography,{children:E.label})]})}))}})}),s.jsx(Ye,{showToast:g,message:e.searchProfilesErrorMessage,color:"danger",hideToast:C})]})},jN=({value:e,sx:t,tooltipPlacement:n})=>{const r=c=>{const u=Math.abs(c);return u>=1e9?(c/1e9).toFixed(1)+"b":u>=1e6?(c/1e6).toFixed(1)+"m":u>=1e3?(c/1e3).toFixed(1)+"k":c.toString()},i=c=>new Intl.NumberFormat("en-US").format(c),o=Math.abs(e)>=1e3,a=r(e),l=i(e);return o?s.jsx(h.Tooltip,{title:l,placement:n,arrow:!0,children:s.jsx(h.Typography,{sx:t,children:a})}):s.jsx(h.Typography,{sx:t,children:a})},UN=(e,t,n,r)=>{if(e&&e.length===0){n([]);return}t.football.getPlayers({playerIds:e}).then(i=>{const o=i.data.map(a=>wb(a));n(o)}).catch(i=>{console.error("Error fetching players by ID:",i),r()})},wb=e=>{var t,n,r,i,o;return{id:e.id,name:e.name,avatar:((t=e.assets)==null?void 0:t.headshot)||Be.avatar,countryName:((n=e.country)==null?void 0:n.name)||"Unknown",countryFlag:((i=(r=e.country)==null?void 0:r.assets)==null?void 0:i.flag)||Be.flag,teams:((o=e.teams)==null?void 0:o.map(a=>{var l;return{id:a.id,name:a.name,logo:((l=a.assets)==null?void 0:l.logo)||Be.team}}))||[]}},VN=({player:e,onRemove:t})=>s.jsx(h.Tooltip,{title:s.jsxs(h.Box,{sx:{p:1},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"bold",children:e.name}),s.jsxs(h.Typography,{level:"body-xs",sx:{display:"flex",alignItems:"center",gap:.5,mt:.5},children:[s.jsx("img",{src:e.countryFlag,alt:e.countryName,width:16,height:12,loading:"lazy"}),e.countryName]}),e.teams&&e.teams.length>0&&s.jsxs(h.Box,{sx:{mt:.5},children:[s.jsx(h.Typography,{level:"body-xs",sx:{mb:.5},children:"Teams:"}),s.jsx(h.Box,{sx:{display:"flex",flexDirection:"column",gap:.25},children:e.teams.map((n,r)=>s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx("img",{src:n.logo,alt:n.name,width:16,height:16,style:{borderRadius:"2px"},loading:"lazy"}),s.jsx(h.Typography,{level:"body-xs",children:n.name})]},r))})]})]}),placement:"left",variant:"solid",sx:{"--Tooltip-radius":"8px",maxWidth:300,bgcolor:"background.level1"},children:s.jsxs(h.Box,{sx:{display:"inline-flex",alignItems:"center",gap:.5,backgroundColor:"#e0f3ff",borderRadius:"50px",padding:"2px 8px 2px 2px",margin:"2px",position:"relative","&:hover":{backgroundColor:"#d0e8ff",cursor:"default"}},children:[s.jsx(h.Avatar,{src:e.avatar,alt:e.name,size:"sm",sx:{width:24,height:24,border:"1px solid #fff"}}),s.jsx(h.Typography,{level:"body-sm",sx:{fontSize:"12px",maxWidth:80,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),s.jsx(h.IconButton,{size:"sm",variant:"plain",color:"danger",onClick:t,sx:{minHeight:16,minWidth:16,padding:0,ml:.5,"&:hover":{backgroundColor:"rgba(255, 0, 0, 0.1)"}},children:s.jsx(_e.Close,{sx:{fontSize:12}})})]})}),HN=({labels:e,teamIds:t,selectedPlayers:n,onChangePlayers:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=Ge(),C=()=>m(!v),S=t&&t.length>0,x=(k,$)=>{o($),r($)},I=()=>_(this,null,function*(){if(S){d(!0);try{const k=t.map(O=>b.football.getTeamById(O)),$=yield Promise.all(k),G=[];$.forEach(O=>{if(O.squad&&O.squad.length>0){const T=O.squad.map(F=>{var H,j,N,M,V;return{id:F.id,name:F.name,avatar:((H=F.assets)==null?void 0:H.headshot)||Be.avatar,countryName:((j=F.country)==null?void 0:j.name)||"Unknown",countryFlag:((M=(N=F.country)==null?void 0:N.assets)==null?void 0:M.flag)||Be.flag,teams:[{id:O.id,name:O.name,logo:((V=O.assets)==null?void 0:V.logo)||Be.team}]}}).sort((F,H)=>F.name.localeCompare(H.name));G.push(...T)}}),u(G),l(G)}catch(k){console.error("Error fetching team players:",k),C()}finally{d(!1)}}}),w=k=>{if(!k){l(c);return}const $=c.filter(G=>G.name.toLowerCase().includes(k.toLowerCase()));l($)};y.useEffect(()=>{UN(n,b,o,C)},[n]),y.useEffect(()=>{S&&I()},[t]);const A=y.useMemo(()=>cr(k=>{if(!S){if(!k||k.length<2){l([]),d(!1);return}d(!0),b.football.getPlayers({name:k,sortField:"name",sortOrder:"asc"}).then($=>{const G=$.data.map(O=>wb(O));l(G),d(!1)}).catch($=>{console.error("Error searching players:",$),l([]),d(!1),C()})}},300),[b,S]);y.useEffect(()=>(S?w(p):A(p),()=>{S||A.cancel()}),[p,S]);const E=(k,$)=>k.map((G,O)=>s.jsx(VN,{player:G,onRemove:()=>{const T=$({index:O});T.onClick&&T.onClick({})}},G.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Autocomplete,{forcePopupIcon:S,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,flexWrap:"wrap"}},noOptions:{sx:{}}},isOptionEqualToValue:(k,$)=>k.id===$.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e==null?void 0:e.searchPlayersPlaceholder,options:a,filterSelectedOptions:!0,onInputChange:(k,$)=>{g($)},onChange:x,getOptionKey:k=>typeof k=="string"?k:k.id,getOptionLabel:k=>typeof k=="string"?k:k.name,value:i,renderTags:E,limitTags:1,renderOption:(k,$)=>{const G={props:k};return s.jsxs(h.AutocompleteOption,Q(L({},k),{sx:{display:"flex",alignItems:"center",gap:1},children:[s.jsx(h.Avatar,{src:$.avatar,alt:$.name,size:"sm",sx:{width:32,height:32}}),s.jsxs(h.Box,{sx:{flexGrow:1},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"bold",children:$.name}),s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[s.jsx("img",{src:$.countryFlag,alt:$.countryName,width:16,height:12,loading:"lazy"}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:$.countryName})]})]})]}),`player-option-${$.id}-${G}`)}}),s.jsx(Ye,{showToast:v,message:e.getPlayersErrorMessage,color:"danger",hideToast:C})]})},WN=(e,t={})=>{const{enabled:n=!0}=t,{sdk:r}=Ge(),[i,o]=y.useState(null),[a,l]=y.useState(!1),[c,u]=y.useState(null),[f,d]=y.useState(null),p=y.useMemo(()=>L({},e),[JSON.stringify(e)]),g=y.useCallback(()=>_(this,null,function*(){var v,m;l(!0),u(null);try{const b=yield r.football.getMatches(p);o(b.data),d((m=(v=b.meta)==null?void 0:v.pagination)!=null?m:null)}catch(b){u(b),o([]),d(null)}finally{l(!1)}}),[r,p]);return y.useEffect(()=>{n&&g()},[g,n]),{matches:i,loading:a,error:c,meta:f,refetch:g}},Sb=$e(s.jsx("path",{d:"M4.25 5.61C6.57 8.59 10 13 10 13v5c0 1.1.9 2 2 2s2-.9 2-2v-5s3.43-4.41 5.75-7.39c.51-.66.04-1.61-.8-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAltRounded"),Ib=$e(s.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.89-2-2-2m0 16H5V7h14zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4m0 6.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"PreviewRounded"),fr=qe("MuiStep",["root","indicator","horizontal","vertical","active","completed","disabled"]),Ti=qe("MuiStepIndicator",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]),GN=$e(s.jsx("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft"),YN=$e(s.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight"),Ab=$e(s.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");class KN{constructor(){J(this,"id","");J(this,"title","");J(this,"alternative_title",null);J(this,"description",null);J(this,"type",null);J(this,"auth_requirement",null);J(this,"rules",null);J(this,"ad_content",null);J(this,"labels",null);J(this,"branding",null);J(this,"embed_code",null);J(this,"custom_fields",null);J(this,"images",null);J(this,"status","");J(this,"flags",[]);J(this,"context",null);J(this,"options",[]);J(this,"related",[]);J(this,"multiple_choice",!1);J(this,"max_multiple_choice_options",null);J(this,"participation_count",0);J(this,"preferences_enabled",!1);J(this,"max_attempts",1);J(this,"external_activity",null)}}const qN=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(""),o=e.generatedEntity,a=d=>{const p=new KN;return p.title=d.question||"",p.status="INACTIVE",p.options=(d.options||[]).map(g=>({title:g,description:"",images:{main:"",mobile:"",cover:""},embed_code:null,preference_mappings:[]})),p},l=d=>{i(d.id);const p=a(d);e.setPollRequestBody(p)},c=()=>{if(!o)return s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const d=()=>s.jsxs(h.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsx("tr",{children:s.jsx("th",{children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.questions})})})}),s.jsx("tbody",{children:o.questions.map((g,v)=>{var m;return s.jsx("tr",{children:s.jsx("td",{children:s.jsxs(h.Typography,{level:"body-sm",children:[g.question," ",s.jsx(h.Typography,{children:(m=g.options)==null?void 0:m.map((b,C)=>s.jsx(h.Chip,{color:b.correct?"success":"neutral",variant:b.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:b.option},`question-option-${C}`))})]})})},`question-${v}`)})})]}),p=()=>{const g=o.questions||[],v=m=>!m&&m!==0?"neutral":m>=5?"success":m>=4?"primary":m>=3?"warning":"neutral";return s.jsx(h.Box,{component:"ul",sx:{listStyle:"none",m:0,p:0,ml:0,pl:0,marginBlockStart:0,marginBlockEnd:0,marginInlineStart:0,marginInlineEnd:0,paddingInlineStart:0,display:"flex",flexDirection:"column",gap:1},children:g.map((m,b)=>{const C=r===m.id;return s.jsx(h.Box,{component:"li",children:s.jsx(h.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",cursor:"pointer",bgcolor:C?"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))":"background.body",borderColor:C?"primary.solidBg":void 0,"&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},"&:hover .pollOptionChipNeutral":{backgroundColor:"background.level1",borderColor:"neutral.outlinedBorder"}},onClick:()=>l(m),role:"button",tabIndex:0,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),l(m))},children:s.jsxs(h.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1},children:[s.jsx(h.Radio,{name:"selectedPollSuggestion",value:m.id,checked:C,onChange:()=>l(m),size:"sm"}),s.jsxs(h.Box,{sx:{flex:1,minWidth:0},children:[s.jsxs(h.Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.5},children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:600,p:0,children:m.question}),s.jsx(h.Box,{sx:{flex:1}}),m.engagement_score?s.jsx(h.Tooltip,{title:e.labels.engagementScore,children:s.jsx(h.Chip,{size:"sm",variant:"solid",color:v(m.engagement_score),children:m.engagement_score})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(m.options||[]).map((S,x)=>s.jsx(h.Chip,{className:C?void 0:"pollOptionChipNeutral",variant:C?"soft":"outlined",color:C?"primary":"neutral",size:"sm",sx:{mr:.5,mb:.5},children:S},`poll-suggestion-opt-${x}`))})]})]})})},`poll-suggestion-${m.id||b}`)})})};return e.entityType==="poll"?s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",p:1,maxHeight:"400px",my:.5},children:p()}):s.jsxs(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[s.jsxs(h.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n(v=>!v))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[s.jsx(h.Typography,{level:"body-sm",sx:{flexGrow:1},children:o.title}),s.jsx(h.Tooltip,{title:t?"":e.labels.expand,children:s.jsx(h.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?s.jsx(Ab,{}):s.jsx(Ts,{})})})]}),s.jsx(h.Box,{sx:{display:t?"block":"none",p:1},children:t?d():null})]})},u=()=>!e.matches||e.matches.length===0?s.jsx(h.Box,{sx:{height:250,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noMatchesFound})}):s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"250px",my:.5},children:e.matches.map(d=>{var p,g,v,m,b,C,S,x,I,w,A,E,k,$,G,O,T,F,H,j,N,M,V,Y;return s.jsxs(y.Fragment,{children:[s.jsxs(h.Box,{onClick:()=>e.setSelectedMatchId(d.id),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),e.setSelectedMatchId(d.id))},role:"button",tabIndex:0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"},backgroundColor:e.selectedMatchId===d.id?"rgba(0,0,0,0.04)":"transparent"},children:[s.jsx(h.Radio,{size:"sm",name:"selectedMatch",value:d.id,checked:e.selectedMatchId===d.id,onChange:X=>e.setSelectedMatchId(X.target.value),sx:{mr:1}}),s.jsx(h.Tooltip,{title:(((g=(p=d.context)==null?void 0:p.competition)==null?void 0:g.name)||"Competition with no name")+((b=(m=(v=d.context)==null?void 0:v.competition)==null?void 0:m.country)!=null&&b.name?` (${d.context.competition.country.name})`:""),children:s.jsx(h.Avatar,{src:((x=(S=(C=d.context)==null?void 0:C.competition)==null?void 0:S.assets)==null?void 0:x.logo)||Be.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),s.jsxs(h.Typography,{level:"body-sm",children:["[",ft(d.kickoffAt).format("HH:mm DD.MM.YYYY"),"]"]}),(I=d.homeTeam)!=null&&I.code?s.jsx(h.Tooltip,{title:d.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),s.jsx(h.Avatar,{src:((w=d.homeTeam.assets)==null?void 0:w.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.homeTeam.id)?700:400,children:d.homeTeam.code||d.homeTeam.name}),s.jsx(h.Avatar,{src:((A=d.homeTeam.assets)==null?void 0:A.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})]}),((k=(E=d==null?void 0:d.scores)==null?void 0:E.ftScore)==null?void 0:k.homeGoals)!==null&&((G=($=d==null?void 0:d.scores)==null?void 0:$.ftScore)==null?void 0:G.awayGoals)!==null?s.jsx(h.Chip,{variant:"outlined",children:((F=(T=(O=d.scores)==null?void 0:O.ftScore)==null?void 0:T.homeGoals)!=null?F:"")+":"+((N=(j=(H=d.scores)==null?void 0:H.ftScore)==null?void 0:j.awayGoals)!=null?N:"")}):" : ",(M=d.awayTeam)!=null&&M.code?s.jsx(h.Tooltip,{title:d.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((V=d.awayTeam.assets)==null?void 0:V.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}})," ",s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((Y=d.awayTeam.assets)==null?void 0:Y.logo)||Be.team,sx:{width:"20px",height:"20px"},slotProps:{img:{loading:"lazy"}}}),s.jsx(h.Typography,{fontWeight:e.teamIdsFilter&&e.teamIdsFilter.includes(d.awayTeam.id)?700:400,children:d.awayTeam.code||d.awayTeam.name})]})]}),s.jsx(h.Divider,{sx:{my:.5}})]},`search-matches-custom-${d.id}`)})}),f=()=>s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-xs",children:e.pagination?`${e.labels.page} ${e.pagination.currentPage} ${e.labels.of} ${e.pagination.numberOfPages} • ${e.pagination.totalItems} ${e.labels.total}`:""}),s.jsxs(h.Box,{sx:{display:"flex",gap:1},children:[s.jsx(h.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage<=1,onClick:()=>e.setPage(d=>Math.max(1,d-1)),sx:{bgcolor:"background.surface"},children:s.jsx(GN,{})}),s.jsx(h.IconButton,{size:"sm",color:"neutral",variant:"outlined",disabled:!e.pagination||e.pagination&&e.pagination.currentPage>=e.pagination.numberOfPages,onClick:()=>e.setPage(d=>e.pagination?Math.min(e.pagination.numberOfPages,d+1):d+1),sx:{bgcolor:"background.surface"},children:s.jsx(YN,{})})]})]});return e.loading?s.jsx(h.Box,{sx:{height:240},children:s.jsx(yi,{my:0})}):s.jsxs(s.Fragment,{children:[e.step==="search"?u():c(),s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsx(h.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedMatchId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate}),e.step==="search"?f():s.jsx(s.Fragment,{})]})]})},QN=e=>{const t=ft(Date.now()).format("YYYY-MM-DD");if(e.step==="preview")return s.jsx(s.Fragment,{});const n=()=>e.entityType==="poll"?s.jsx(h.Checkbox,{disabled:!e.matchFilters.teamIds||e.matchFilters.teamIds.length===0,checked:e.useFramingGuidelines,size:"sm",onChange:r=>{e.setUseFramingGuidelines(r.target.checked)},label:e.labels.useFramingGuidelinesLabel}):s.jsx(s.Fragment,{});return s.jsxs(s.Fragment,{children:[s.jsx(jm,{labels:{teamsSelectionPlaceholder:e.labels.teamsSelectionPlaceholder||"",searchTeamsErrorMessage:e.labels.searchTeamsErrorMessage},ids:e.matchFilters.teamIds||[],onChange:e.onChangeTeams,scope:e.competitionsScope,readOnly:e.isGenerating,AdditionalCheckbox:n()}),s.jsxs(h.Grid,{container:!0,spacing:2,minWidth:"100%",columns:{xs:0,sm:0,md:12},mb:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.fromDate}),s.jsx(h.Input,{name:"fromDate",type:"date",defaultValue:e.matchFilters.fromDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})}),s.jsx(h.Grid,{xs:6,children:s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.toDate}),s.jsx(h.Input,{name:"toDate",type:"date",defaultValue:e.matchFilters.toDate,onChange:e.onChangeDates,sx:{backgroundColor:"#fff",borderRadius:"md",minHeight:"36px"},slotProps:{input:{max:t}},readOnly:e.isGenerating})]})})]})]})},JN=ft(Date.now()).format("YYYY-MM-DD"),Tb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Li[t]?Li[t].key:"en"},Eb=e=>({fromDate:"",toDate:JN,competitionIds:e&&e.length?e:void 0,teamIds:void 0,sortOrder:"desc",status:"finished"}),XN=e=>{var Z;const[t,n]=y.useState(Tb(e.defaultLanguage)),[r,i]=y.useState(Eb(e.competitionsScope)),[o,a]=y.useState(1),[l,c]=y.useState(""),[u,f]=y.useState(!1),[d,p]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[C,S]=y.useState(null),[x,I]=y.useState(!1),[w,A]=y.useState(!1),[E,k]=y.useState(""),[$,G]=y.useState(!1),[O,T]=y.useState(""),[F,H]=y.useState("danger"),j=10,N=y.useMemo(()=>{const Ne=r,{fromDate:te,toDate:ne}=Ne,ue=Ze(Ne,["fromDate","toDate"]),be=L({},ue);if(te&&(be.fromDate=`${te}T00:00:00Z`),ne){const ht=ft().add(1,"minute").format("THH:mm:ss")+"Z";be.toDate=ne+ht}return Q(L({},be),{page:o,limit:j})},[r,o]),M=y.useMemo(()=>!(!m||e.entityType==="poll"&&!C),[m,e.entityType,C]);y.useEffect(()=>()=>{n(Tb),i(Eb(e.competitionsScope)),a(1),c(""),f(!1),p("search"),b(null)},[]);const{https:V}=Ge(),{matches:Y,loading:X,meta:D}=WN(N,{enabled:u}),B=()=>{T(""),G(!1)},U=te=>{let ne="",ue="danger";switch(te){case"on_generate_failed":ne=e.labels.onEntityGenerateErrorMessage;break;case"on_create":ne=e.labels.onEntityCreateMessage,ue="success";break;case"on_create_failed":ne=e.labels.onEntityCreateErrorMessage;break}H(ue),T(ne),G(!0)},W=te=>{var ue;const ne=te.map(be=>be.id);i(be=>Q(L({},be),{teamIds:ne||void 0})),a(1),f(!0),e.entityType==="poll"&&(te.length===0?(k(""),A(!1)):k(((ue=te[te.length-1])==null?void 0:ue.label)||""))},ie=te=>{const{name:ne,value:ue}=te.target;i(be=>Q(L({},be),{[ne]:ue})),f(!0)},se=()=>_(this,null,function*(){v(!0),e.entityType==="poll"&&S(null);let te=null;switch(e.entityType){case"classic_quiz":te=yield V.generatePostMatchQuiz({sportType:"football",lang:t,eventId:l});break;case"poll":const ue=w?E:"";te=yield V.generatePostMatchPoll({targetParticipant:ue,lang:t,eventId:l});break}if(!(te!=null&&te.ok)){const ue=yield te==null?void 0:te.json();console.error("Failed to generate AI content",ue),v(!1),U("on_generate_failed");return}const ne=yield te==null?void 0:te.json();if(e.entityType==="poll"){const ue=ne;ue.questions.sort((be,Ne)=>Ne.engagement_score-be.engagement_score),b(ue)}else b(ne);v(!1),p("preview")}),oe=te=>_(this,null,function*(){I(!0);let ne=null;switch(e.entityType){case"classic_quiz":const be=m;ne=yield V.createClassicQuiz(be);break;case"poll":ne=yield V.createPoll(C);break}const ue=yield ne==null?void 0:ne.json();if(!(ne!=null&&ne.ok)){console.error("Failed to create content",ue),I(!1),U("on_create_failed");return}if(I(!1),te==="goto"){U("on_create"),e.toggleModal(),e.fetchEntityById(ue.data.id);return}U("on_create")});return s.jsx(h.Modal,{open:e.isOpen,onClose:()=>{g||x||e.toggleModal()},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[s.jsx(h.DialogTitle,{children:e.labels.generateFootballPostMatchModalTitle}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{sx:{overflowX:"hidden"},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.FormControl,{size:"sm",sx:{mb:2},children:[s.jsx(h.FormLabel,{children:e.labels.language}),s.jsx(h.Select,{value:t,onChange:(te,ne)=>ne&&n(ne),indicator:null,disabled:g,startDecorator:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[t]||"gb").toLowerCase()}.png`,alt:((Z=Object.values(Te).find(te=>te.key===t))==null?void 0:Z.name)||"Language"}),sx:{minWidth:220,minHeight:38},children:Object.values(Te).map(te=>s.jsxs(h.Option,{value:te.key,label:te.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[te.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[te.key]||"gb").toLowerCase()}.png`,alt:te.name})}),te.name]},te.key))}),s.jsx(h.FormHelperText,{children:e.labels.targetLanguageDescription})]}),s.jsxs(h.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${Ti.root}`]:{borderWidth:3},[`& .${fr.root}::after`]:{height:3},[`& .${fr.completed}`]:{[`& .${Ti.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${fr.active}`]:{[`& .${Ti.root}`]:{borderColor:"currentColor"}},[`& .${fr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[s.jsx(h.Step,{active:d==="search",orientation:"vertical",indicator:s.jsx(h.Tooltip,{title:d==="preview"?e.labels.searchMatchTooltip:"",placement:"right",children:s.jsx(h.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&d==="preview"&&(te.preventDefault(),b(null),p("search"))},sx:L({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:s.jsx(Sb,{})})}),children:s.jsx(h.Typography,{sx:L({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:te=>{(te.key==="Enter"||te.key===" ")&&d==="preview"&&(te.preventDefault(),b(null),p("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchMatch})}),s.jsx(h.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:s.jsx(h.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:s.jsx(Ib,{})}),children:s.jsx(h.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),s.jsx(QN,{entityType:e.entityType,step:d,labels:e.labels,useFramingGuidelines:w,matchFilters:r,competitionsScope:e.competitionsScope,generatedEntity:m,isGenerating:g,setUseFramingGuidelines:A,onChangeTeams:W,onChangeDates:ie}),u?s.jsx(h.Sheet,{variant:"outlined",sx:{p:1,borderRadius:"sm",bgcolor:"background.surface"},children:s.jsx(qN,{step:d,loading:X||g,matches:Y,selectedMatchId:l,generatedEntity:m,labels:e.labels,pagination:D,teamIdsFilter:r.teamIds,setPollRequestBody:S,setPage:a,setSelectedMatchId:c,onGenerate:se,entityType:e.entityType,setGeneratedEntity:b})}):s.jsx(s.Fragment,{})]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{variant:"outlined",color:"primary",loading:x,disabled:!M||g,onClick:()=>oe("goto"),children:e.labels.createAndGoTo}),s.jsx(h.Button,{variant:"solid",color:"primary",loading:x,disabled:!M||g,onClick:()=>oe("continue"),children:e.labels.createAndContinue}),s.jsx(h.Button,{disabled:g||x,variant:"plain",color:"neutral",onClick:te=>{te.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),s.jsx(Ye,{showToast:$,color:F,message:O,hideToast:B})]})})},ZN=e=>{const[t,n]=y.useState(!1),r=e.generatedEntity,i=()=>{if(!r)return s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noPreviewAvailable})});const a=()=>s.jsxs(h.Table,{variant:"outlined",size:"sm",sx:{width:"100%",maxWidth:"100%","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsx("tr",{children:s.jsx("th",{children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.questions})})})}),s.jsx("tbody",{children:r.questions.map((l,c)=>{var u;return s.jsx("tr",{children:s.jsx("td",{children:s.jsxs(h.Typography,{level:"body-sm",children:[l.question," ",s.jsx(h.Typography,{children:(u=l.options)==null?void 0:u.map((f,d)=>s.jsx(h.Chip,{color:f.correct?"success":"neutral",variant:f.correct?"solid":"outlined",sx:{mr:1},size:"sm",children:f.option},`question-option-${d}`))})]})})},`question-${c}`)})})]});return s.jsxs(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:[s.jsxs(h.Box,{role:"button",tabIndex:0,onClick:()=>n(!t),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n(c=>!c))},sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:"pointer","&:hover":{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}},children:[s.jsx(h.Typography,{level:"body-sm",sx:{flexGrow:1},children:r.title}),s.jsx(h.Tooltip,{title:t?"":e.labels.expand,children:s.jsx(h.IconButton,{"aria-label":"expand row",variant:"plain",color:"neutral",size:"sm",sx:{"&:hover":{backgroundColor:"background.surface"}},children:t?s.jsx(Ab,{}):s.jsx(Ts,{})})})]}),s.jsx(h.Box,{sx:{display:t?"block":"none",p:1},children:t?a():null})]})},o=()=>!e.races||e.races.length===0?s.jsx(h.Box,{sx:{height:240,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx(h.Typography,{level:"body-sm",children:e.labels.noRacesFound})}):s.jsx(h.Sheet,{sx:{overflowY:"auto",borderRadius:"sm",maxHeight:"300px",my:.5},children:e.races.map(a=>{var u;const l=a.status==="Completed",c=a.status==="Scheduled";return s.jsxs(y.Fragment,{children:[s.jsxs(h.Box,{onClick:l?()=>e.setSelectedRaceId(a.id.toString()):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),e.setSelectedRaceId(a.id.toString()))}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:"xs",p:1,borderRadius:"sm",cursor:l?"pointer":"not-allowed",opacity:c?.6:1,"&:hover":l?{backgroundColor:"var(--joy-palette-neutral-softBg, rgba(0,0,0,0.04))"}:{},backgroundColor:e.selectedRaceId===a.id.toString()?"rgba(0,0,0,0.04)":"transparent"},children:[s.jsx(h.Radio,{size:"sm",name:"selectedRace",value:a.id.toString(),checked:e.selectedRaceId===a.id.toString(),disabled:!l,onChange:l?f=>e.setSelectedRaceId(f.target.value):void 0,sx:{mr:1}}),s.jsx(h.Tooltip,{title:a.competition.name+((u=a.competition.location)!=null&&u.country?` (${a.competition.location.country})`:""),children:s.jsx(h.Avatar,{src:a.circuit.image||Be.competition,sx:{width:"15px",height:"15px"},slotProps:{img:{loading:"lazy"}}})}),s.jsxs(h.Typography,{level:"body-sm",children:["[",ft(a.date).format("HH:mm DD.MM.YYYY"),"]"]}),s.jsx(h.Typography,{level:"body-sm",fontWeight:600,children:a.competition.name}),s.jsx(h.Typography,{level:"body-sm",children:a.circuit.name}),s.jsx(h.Chip,{variant:l?"solid":"outlined",color:l?"success":"neutral",size:"sm",children:a.status==="Completed"?"Finished":"Upcoming"})]}),s.jsx(h.Divider,{sx:{my:.5}})]},`race-${a.id}`)})});return e.loading?s.jsx(h.Box,{sx:{height:240},children:s.jsx(yi,{my:0})}):s.jsxs(s.Fragment,{children:[e.step==="search"?o():i(),s.jsx(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:s.jsx(h.Button,{size:"sm",color:"primary",variant:"outlined",disabled:!e.selectedRaceId,onClick:e.onGenerate,children:e.step==="search"?e.labels.generate:e.labels.regenerate})})]})},kb=e=>{const t=e==null?void 0:e.toLowerCase();return t&&Li[t]?Li[t].key:"en"},Ys=()=>new Date().getFullYear(),ez=()=>{const e=Ys();return[e,e-1,e-2]},tz={Login:yL,InformationInput:Lt,RichText:Sc,HeaderButtons:KP,MarketSelection:LL,Accordion:RT,DynamicFields:dD,BasicSelect:MT,BooleanSwitch:mn,Branding:HP,ProfileSearchSelect:t2,RangeCalendar:cD,CompetitionSearchSelect:ZM,Related:FL,Images:qR,Duration:lD,DatePickerComponent:bo,Flags:WR,Spinner:yi,Tags:Um,Toast:Ye,AdContent:LT,Match:ML,Winners:VB,CompetitionsSearchSelect:e2,TeamsSearchSelect:jm,CustomSelect:eM,Schedule:YL,NoPermissionCard:uD,CustomFlatpickrCalendar:au,ContextSelectFilter:WB,NumberInput:Du,EntityContext:S$,MiniGamesImages:A$,AuthRequirement:T$,SortableList:mN,ItemsPerPageFilter:vN,ImageCard:Io,RelatedRelationship:PN,BonusPointsRelatedQuiz:ON,ExportUsersLeads:RN,SignOutButton:vg,BasicSortableList:MN,WidgetEmbedCode:BN,WidgetListEmbedCode:NN,AdvancedProfileSearchSelect:zN,FormatNumber:jN,PlayersSearchSelect:HN,GenerateFootballPostMatchModal:XN,GenerateFormula1PostEventModal:e=>{var M,V;const[t,n]=y.useState(kb(e.defaultLanguage)),[r,i]=y.useState(Ys()),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("search"),[g,v]=y.useState(!1),[m,b]=y.useState(null),[C,S]=y.useState(!1),[x,I]=y.useState(!1),[w,A]=y.useState(""),[E,k]=y.useState("danger"),$=y.useMemo(()=>!!m,[m]);y.useEffect(()=>{e.isOpen?F(Ys()):(n(kb(e.defaultLanguage)),i(Ys()),a([]),f(""),p("search"),b(null))},[e.isOpen]);const{https:G}=Ge(),O=()=>{A(""),I(!1)},T=Y=>{let X="",D="danger";switch(Y){case"on_generate_failed":X=e.labels.onEntityGenerateErrorMessage;break;case"on_create":X=e.labels.onEntityCreateMessage,D="success";break;case"on_create_failed":X=e.labels.onEntityCreateErrorMessage;break;case"fetch_races_failed":X=e.labels.fetchRacesErrorMessage;break}k(D),A(X),I(!0)},F=Y=>_(this,null,function*(){c(!0);const X=yield G.apiSports.getRaces(Y),D=yield X.json();if(!X.ok){console.error("Error fetching races:",D),c(!1),a([]),T("fetch_races_failed");return}const W=(D.response||[]).sort((te,ne)=>new Date(ne.date).getTime()-new Date(te.date).getTime()),ie=W.filter(te=>te.status==="Completed"),se=W.filter(te=>te.status==="Scheduled"),Z=[...se.length>0?[se.sort((te,ne)=>new Date(te.date).getTime()-new Date(ne.date).getTime())[0]]:[],...ie];a(Z),c(!1)}),H=Y=>{i(Y),f(""),F(Y)},j=()=>_(this,null,function*(){v(!0);const Y=yield G.generatePostMatchQuiz({sportType:"formula1",lang:t,eventId:u});if(!(Y!=null&&Y.ok)){const D=yield Y==null?void 0:Y.json();console.error("Failed to generate AI content",D),v(!1),T("on_generate_failed");return}const X=yield Y==null?void 0:Y.json();b(X),v(!1),p("preview")}),N=Y=>_(this,null,function*(){S(!0);const X=m,D=yield G.createClassicQuiz(X),B=yield D.json();if(!(D!=null&&D.ok)){console.error("Failed to create content",B),S(!1),T("on_create_failed");return}if(S(!1),Y==="goto"){T("on_create"),e.toggleModal(),e.fetchEntityById(B.data.id);return}T("on_create")});return s.jsx(h.Modal,{open:e.isOpen,onClose:()=>{g||C||e.toggleModal()},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.ModalDialog,{sx:{backgroundColor:"white",minWidth:"50%",height:900},children:[s.jsx(h.DialogTitle,{children:e.labels.generateFormulaOnePostEventModalTitle}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{sx:{overflowX:"hidden"},children:s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"1fr 1fr"},gap:2,mb:2},children:[s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.language}),s.jsx(h.Select,{value:t,onChange:(Y,X)=>X&&n(X),indicator:null,disabled:g,startDecorator:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[t]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[t]||"gb").toLowerCase()}.png`,alt:((M=Object.values(Te).find(Y=>Y.key===t))==null?void 0:M.name)||"Language"}),sx:{minHeight:38},children:Object.values(Te).map(Y=>s.jsxs(h.Option,{value:Y.key,label:Y.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx("img",{loading:"lazy",width:"20",srcSet:`https://flagcdn.com/w40/${(qn[Y.key]||"gb").toLowerCase()}.png 2x`,src:`https://flagcdn.com/w20/${(qn[Y.key]||"gb").toLowerCase()}.png`,alt:Y.name})}),Y.name]},Y.key))}),s.jsx(h.FormHelperText,{children:e.labels.targetLanguageDescription})]}),s.jsxs(h.FormControl,{size:"sm",children:[s.jsx(h.FormLabel,{children:e.labels.season}),s.jsx(h.Select,{value:r,onChange:(Y,X)=>X&&H(X),disabled:g||!!m,sx:{minHeight:38},children:ez().map(Y=>s.jsx(h.Option,{value:Y,children:Y},Y))}),s.jsx(h.FormHelperText,{children:e.labels.seasonDescription})]})]}),s.jsxs(h.Stepper,{sx:{my:2,width:"100%","--StepIndicator-size":"3rem","--Step-connectorInset":"0px",[`& .${Ti.root}`]:{borderWidth:3},[`& .${fr.root}::after`]:{height:3},[`& .${fr.completed}`]:{[`& .${Ti.root}`]:{borderColor:"primary.300",color:"primary.300"},"&::after":{bgcolor:"primary.300"}},[`& .${fr.active}`]:{[`& .${Ti.root}`]:{borderColor:"currentColor"}},[`& .${fr.disabled} *`]:{color:"neutral.outlinedDisabledColor"}},children:[s.jsx(h.Step,{active:d==="search",orientation:"vertical",indicator:s.jsx(h.Tooltip,{title:d==="preview"?(V=e.labels)==null?void 0:V.searchRaceTooltip:"",placement:"right",children:s.jsx(h.StepIndicator,{variant:d==="search"?"solid":"outlined",color:"primary",onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),p("search"))},sx:L({cursor:d==="preview"?"pointer":"default"},d==="preview"&&{animation:"pulse 2s infinite","@keyframes pulse":{"0%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0.7)"},"70%":{boxShadow:"0 0 0 10px rgba(25, 118, 210, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(25, 118, 210, 0)"}},"&:hover":{animation:"none",boxShadow:"0 0 0 4px rgba(25, 118, 210, 0.3)"}}),role:"button",tabIndex:d==="preview"?0:-1,children:s.jsx(Sb,{})})}),children:s.jsx(h.Typography,{sx:L({textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},d==="preview"&&{cursor:"pointer"}),onClick:()=>{d==="preview"&&(b(null),p("search"))},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&d==="preview"&&(Y.preventDefault(),b(null),p("search"))},role:"button",tabIndex:d==="preview"?0:-1,children:e.labels.searchRace})}),s.jsx(h.Step,{orientation:"vertical",active:d==="preview",disabled:d!=="preview",indicator:s.jsx(h.StepIndicator,{variant:d==="preview"?"solid":"outlined",color:"primary",children:s.jsx(Ib,{})}),children:s.jsx(h.Typography,{sx:{textTransform:"uppercase",fontWeight:"lg",fontSize:"0.75rem"},children:e.labels.preview})})]}),s.jsx(h.Sheet,{variant:"outlined",sx:{mt:2,p:1,borderRadius:"sm",bgcolor:"background.surface"},children:s.jsx(ZN,{step:d,loading:l||g,races:o,selectedRaceId:u,generatedEntity:m,labels:e.labels,setSelectedRaceId:f,onGenerate:j,setGeneratedEntity:b})})]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{variant:"outlined",color:"primary",loading:C,disabled:!$||g,onClick:()=>N("goto"),children:e.labels.createAndGoTo}),s.jsx(h.Button,{variant:"solid",color:"primary",loading:C,disabled:!$||g,onClick:()=>N("continue"),children:e.labels.createAndContinue}),s.jsx(h.Button,{disabled:g||C,variant:"plain",color:"neutral",onClick:Y=>{Y.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]}),s.jsx(Ye,{showToast:x,color:E,message:w,hideToast:O})]})})}},_b=y.createContext(null),nz=({children:e})=>s.jsx(_b.Provider,{value:tz,children:e}),rz=()=>{const e=y.useContext(_b);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},Pb=425,Db=1024,iz=()=>{const[e,t]=y.useState(window.innerWidth<=Db),[n,r]=y.useState(window.innerWidth<=Pb);return y.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=Db),r(window.innerWidth<=Pb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}};var Ob=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.ENUM="ENUM",e.FREE_INPUT="FREE_INPUT",e))(Ob||{}),Rb=(e=>(e.ACTIVE="ACTIVE",e.SETTLED="SETTLED",e.VOID="VOID",e))(Rb||{});class oz{constructor(){J(this,"id","");J(this,"question","");J(this,"status","ACTIVE");J(this,"void_reason",null);J(this,"points",0);J(this,"outcome_type",null);J(this,"valid_outcomes",null);J(this,"outcome",null)}}class az{constructor(){J(this,"id","");J(this,"title","");J(this,"description","");J(this,"type","EVENT");J(this,"rules","");J(this,"status","PENDING");J(this,"images",null);J(this,"related",[]);J(this,"custom_fields",null);J(this,"predictions_cutoff","");J(this,"fixtures",[]);J(this,"tiebreaker",{stat_tiebreaker_enabled:!1,stat_total:0})}}const sz={APIProvider:GS,AuthProvider:YS,AuthContext:Qf,ComponentProvider:nz,useComponentContext:rz,useAPIContext:Ge,useIsMobile:iz,constants:{supportedLanguages:Te,languagesMap:Li}};Ae.EventGameFixtureStatusEnum=Rb,Ae.EventGameFixturesModel=oz,Ae.EventGameOutcomeTypeEnum=Ob,Ae.EventGameRequestBody=az,Ae.default=sz,Object.defineProperties(Ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});