fansunited-widget-either-or 1.2.0 → 1.2.1
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/either-or-manager.es.js +6 -13
- package/either-or-manager.umd.js +2 -2
- package/package.json +1 -1
package/either-or-manager.es.js
CHANGED
|
@@ -9788,15 +9788,15 @@ const vu = (t) => {
|
|
|
9788
9788
|
const e = "api_key";
|
|
9789
9789
|
kn.initializeApp({ apiKey: e });
|
|
9790
9790
|
const n = ZE();
|
|
9791
|
-
ru(n, "
|
|
9791
|
+
ru(n, "http://localhost:39199");
|
|
9792
9792
|
} else {
|
|
9793
9793
|
const n = {
|
|
9794
9794
|
apiKey: t && t === "staging" ? "AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8" : "AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",
|
|
9795
9795
|
authDomain: "fans-united-clients.firebaseapp.com",
|
|
9796
9796
|
projectId: "fans-united-clients",
|
|
9797
9797
|
messagingSenderId: "78627953958",
|
|
9798
|
-
appId: "1:78627953958:web:
|
|
9799
|
-
measurementId: "G-
|
|
9798
|
+
appId: "1:78627953958:web:2ee87d5b274e0e7685f5e7",
|
|
9799
|
+
measurementId: "G-RH90B03KJG"
|
|
9800
9800
|
};
|
|
9801
9801
|
kn.initializeApp(n);
|
|
9802
9802
|
}
|
|
@@ -37502,16 +37502,9 @@ const t$ = (t, e, n, r) => ({
|
|
|
37502
37502
|
errorHandlingMode: "standard",
|
|
37503
37503
|
authProvider: { getIdToken: () => "", logout: () => {
|
|
37504
37504
|
} }
|
|
37505
|
-
}), n$ = (t, e) =>
|
|
37506
|
-
|
|
37507
|
-
|
|
37508
|
-
if (!t && e)
|
|
37509
|
-
return console.warn(
|
|
37510
|
-
"'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"
|
|
37511
|
-
), null;
|
|
37512
|
-
const n = e && e === "betway" ? {}.VITE_SPORTAL365_BETWAY_TOKEN : {}.VITE_SPORTAL365_SHARED_TOKEN;
|
|
37513
|
-
return { project: t, authorization: `Bearer ${n}` };
|
|
37514
|
-
}, tp = (t) => {
|
|
37505
|
+
}), n$ = (t, e) => !t && !e ? null : !t && e ? (console.warn(
|
|
37506
|
+
"'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"
|
|
37507
|
+
), null) : { project: t, authorization: `Bearer ${e && e === "betway" ? "24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K" : "dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}` }, tp = (t) => {
|
|
37515
37508
|
document.getElementById(t).scrollIntoView({ behavior: "smooth" });
|
|
37516
37509
|
}, sd = {
|
|
37517
37510
|
container: (t) => X({}, t),
|
package/either-or-manager.umd.js
CHANGED
|
@@ -2265,7 +2265,7 @@ object-assign
|
|
|
2265
2265
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2266
2266
|
* See the License for the specific language governing permissions and
|
|
2267
2267
|
* limitations under the License.
|
|
2268
|
-
*/const LI="auth-compat";function BI(t){t.INTERNAL.registerComponent(new Xn(LI,e=>{const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Zl(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:ar,FacebookAuthProvider:vn,GithubAuthProvider:wn,GoogleAuthProvider:yn,OAuthProvider:Qr,SAMLAuthProvider:io,PhoneAuthProvider:eu,PhoneMultiFactorGenerator:lh,RecaptchaVerifier:NI,TwitterAuthProvider:bn,Auth:Zl,AuthCredential:Gr,Error:Mt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),t.registerVersion(vI,yI)}BI(Fn);let Eh=!1;const tu=t=>{if(Eh)return Fn.auth();if(t&&t==="dev"){const e="api_key";Fn.initializeApp({apiKey:e});const n=KE();Tl(n,"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K")}else{const n={apiKey:t&&t==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:9e4c6caf6bd197b185f5e7",measurementId:"G-DPV1TYL0JW"};Fn.initializeApp(n)}return Eh=!0,Fn.auth()},UI=({fansUnitedEnvironment:t})=>{const[e,n]=K.useState(""),[r,i]=K.useState(""),{userNotFound:o}=be(Pe);return U("div",{className:"eow-flex eow-items-center eow-justify-center eow-min-h-screen eow-bg-gray-100",children:ie("div",{className:"eow-px-8 eow-py-6 eow-mt-4 eow-text-left eow-bg-white eow-shadow-lg",children:[U("h3",{className:"eow-text-2xl eow-font-bold eow-text-center eow-mb-4",children:"Sign in"}),U("p",{className:"eow-text-gray-400 eow-text-xs eow-mb-4 eow-text-center",children:"Use your account in the Fans United platform."}),ie("div",{className:"eow-mt-4",children:[ie("div",{children:[U("label",{className:"eow-block",htmlFor:"email",children:"Email"}),U("input",{value:e,type:"text",placeholder:"Email",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),n(l.target.value)}})]}),ie("div",{className:"eow-mt-4",children:[U("label",{className:"eow-block",htmlFor:"password",children:"Password"}),U("input",{value:r,type:"password",placeholder:"Password",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),i(l.target.value)}})]}),U("div",{className:"eow-flex eow-items-baseline eow-justify-between",children:U("button",{onClick:()=>_(this,null,function*(){try{yield tu(t).signInWithEmailAndPassword(e,r)}catch(l){console.error(l),xe.error(o)}}),className:"eow-px-6 eow-py-2 eow-mt-4 eow-text-white eow-bg-gray-600 eow-rounded hover:eow-bg-gray-900",children:"Login"})})]})]})})},Ih=K.createContext(null),$I=({children:t,fansUnitedEnvironment:e})=>{const[n,r]=K.useState(null),[i,o]=K.useState(!0);return K.useEffect(()=>tu(e).onAuthStateChanged(l=>{Ge.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[]),U(Ih.Provider,{value:n,children:!i&&t})},jI=({children:t})=>U("div",{className:"eow-w-full eow-bg-white","data-testid":"widget-card",children:t}),HI=({fansUnitedEnvironment:t})=>{const{signOut:e}=be(Pe);return U("button",{className:"eow-rounded eow-bg-gray-700 eow-text-white hover:eow-bg-gray-800 eow-uppercase eow-text-xs eow-font-bold eow-py-2 eow-px-6 ",onClick:()=>_(this,null,function*(){yield tu(t).signOut()}),children:e})},Ah=({hideSignOutButton:t,toggleScreen:e,fansUnitedEnvironment:n})=>{const{create:r}=be(Pe);return ie("div",{className:"eow-mb-4 eow-flex eow-p-2 eow-items-center eow-justify-between",children:[U("button",{onClick:e,className:"eow-rounded eow-bg-gray-700 hover:eow-bg-gray-800 eow-text-white eow-uppercase eow-text-xs eow-font-bold eow-px-6 eow-py-2",children:r}),t?U(Se,{}):U(HI,{fansUnitedEnvironment:n})]})},VI=()=>{const{title:t,status:e,type:n,creationDate:r,actions:i}=be(Pe);return U("thead",{className:"eow-bg-gray-200",children:ie("tr",{className:"eow-uppercase eow-text-xs",children:[U("th",{className:"eow-px-2 eow-py-4 eow-font-semibold eow-text-left",children:t}),U("th",{className:"md:eow-text-center eow-text-right eow-p-2 eow-font-semibold",children:e}),U("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:n}),U("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:r}),U("th",{className:"eow-text-right eow-p-2",children:i})]})})};class Zi{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const n={listener:e};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const ea=typeof window=="undefined"||"Deno"in window;function Yt(){}function qI(t,e){return typeof t=="function"?t(e):t}function nu(t){return typeof t=="number"&&t>=0&&t!==1/0}function Oh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ta(t,e,n){return _o(t)?typeof e=="function"?oe(J({},n),{queryKey:t,queryFn:e}):oe(J({},e),{queryKey:t}):t}function lr(t,e,n){return _o(t)?[oe(J({},e),{queryKey:t}),n]:[t||{},e]}function Ch(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=t;if(_o(s)){if(r){if(e.queryHash!==ru(s,e.options))return!1}else if(!bo(e.queryKey,s))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof i!="undefined"&&i!==e.state.fetchStatus||o&&!o(e))}function Th(t,e){const{exact:n,fetching:r,predicate:i,mutationKey:o}=t;if(_o(o)){if(!e.options.mutationKey)return!1;if(n){if(Cr(e.options.mutationKey)!==Cr(o))return!1}else if(!bo(e.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&e.state.status==="loading"!==r||i&&!i(e))}function ru(t,e){return((e==null?void 0:e.queryKeyHashFn)||Cr)(t)}function Cr(t){return JSON.stringify(t,(e,n)=>au(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function bo(t,e){return Sh(t,e)}function Sh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Sh(t[n],e[n])):!1}function Ph(t,e){if(t===e)return t;const n=Mh(t)&&Mh(e);if(n||au(t)&&au(e)){const r=n?t.length:Object.keys(t).length,i=n?e:Object.keys(e),o=i.length,s=n?[]:{};let l=0;for(let u=0;u<o;u++){const c=n?u:i[u];s[c]=Ph(t[c],e[c]),s[c]===t[c]&&l++}return r===o&&l===r?t:s}return e}function iu(t,e){if(t&&!e||e&&!t)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Mh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function au(t){if(!xh(t))return!1;const e=t.constructor;if(typeof e=="undefined")return!0;const n=e.prototype;return!(!xh(n)||!n.hasOwnProperty("isPrototypeOf"))}function xh(t){return Object.prototype.toString.call(t)==="[object Object]"}function _o(t){return Array.isArray(t)}function Rh(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){Rh(0).then(t)}function WI(){if(typeof AbortController=="function")return new AbortController}function ou(t,e,n){return n.isDataEqual!=null&&n.isDataEqual(t,e)?t:typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Ph(t,e):e}class GI extends Zi{constructor(){super(),this.setup=e=>{if(!ea&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document=="undefined"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Eo=new GI,Dh=["online","offline"];class zI extends Zi{constructor(){super(),this.setup=e=>{if(!ea&&window.addEventListener){const n=()=>e();return Dh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Dh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator=="undefined"||typeof navigator.onLine=="undefined"?!0:navigator.onLine}}const Io=new zI;function QI(t){return Math.min(1e3*$w(2,t),3e4)}function Ao(t){return(t!=null?t:"online")==="online"?Io.isOnline():!0}class Fh{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Oo(t){return t instanceof Fh}function Nh(t){let e=!1,n=0,r=!1,i,o,s;const l=new Promise((v,b)=>{o=v,s=b}),u=v=>{r||(h(new Fh(v)),t.abort==null||t.abort())},c=()=>{e=!0},d=()=>{e=!1},f=()=>!Eo.isFocused()||t.networkMode!=="always"&&!Io.isOnline(),p=v=>{r||(r=!0,t.onSuccess==null||t.onSuccess(v),i==null||i(),o(v))},h=v=>{r||(r=!0,t.onError==null||t.onError(v),i==null||i(),s(v))},y=()=>new Promise(v=>{i=b=>{const w=r||!f();return w&&v(b),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,r||t.onContinue==null||t.onContinue()}),g=()=>{if(r)return;let v;try{v=t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(p).catch(b=>{var w,E;if(r)return;const m=(w=t.retry)!=null?w:3,A=(E=t.retryDelay)!=null?E:QI,I=typeof A=="function"?A(n,b):A,O=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,b);if(e||!O){h(b);return}n++,t.onFail==null||t.onFail(n,b),Rh(I).then(()=>{if(f())return y()}).then(()=>{e?h(b):g()})})};return Ao(t.networkMode)?g():y().then(g),{promise:l,cancel:u,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:c,continueRetry:d}}const su=console;function YI(){let t=[],e=0,n=d=>{d()},r=d=>{d()};const i=d=>{let f;e++;try{f=d()}finally{e--,e||l()}return f},o=d=>{e?t.push(d):kh(()=>{n(d)})},s=d=>(...f)=>{o(()=>{d(...f)})},l=()=>{const d=t;t=[],d.length&&kh(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}const ut=YI();class Lh{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nu(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e!=null?e:ea?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class KI extends Lh{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||su,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||JI(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options=J(J({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,n){const r=ou(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){this.dispatch({type:"setState",state:e,setStateOptions:n})}cancel(e){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(e),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Oh(this.state.dataUpdatedAt,e)}onFocus(){var e;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const s=WI(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};u(l);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(u(d),(r=this.options.behavior)==null||r.onFetch(d),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=d.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=d.fetchOptions)==null?void 0:f.meta})}const p=h=>{if(Oo(h)&&h.silent||this.dispatch({type:"error",error:h}),!Oo(h)){var y,g,v,b;(y=(g=this.cache.config).onError)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Nh({fn:d.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:h=>{var y,g,v,b;if(typeof h=="undefined"){p(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(y=(g=this.cache.config).onSuccess)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:(h,y)=>{this.dispatch({type:"failed",failureCount:h,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const n=r=>{var i,o;switch(e.type){case"failed":return oe(J({},r),{fetchFailureCount:e.failureCount,fetchFailureReason:e.error});case"pause":return oe(J({},r),{fetchStatus:"paused"});case"continue":return oe(J({},r),{fetchStatus:"fetching"});case"fetch":return J(oe(J({},r),{fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:Ao(this.options.networkMode)?"fetching":"paused"}),!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return J(oe(J({},r),{data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=e.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success"}),!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});case"error":const s=e.error;return Oo(s)&&s.revert&&this.revertState?oe(J({},this.revertState),{fetchStatus:"idle"}):oe(J({},r),{error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"});case"invalidate":return oe(J({},r),{isInvalidated:!0});case"setState":return J(J({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function JI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=typeof e!="undefined",r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class XI extends Zi{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:ru(o,n);let l=this.get(s);return l||(l=new KI({cache:this,logger:e.getLogger(),queryKey:o,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const n=this.queriesMap[e.queryHash];n&&(e.destroy(),this.queries=this.queries.filter(r=>r!==e),n===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,n){const[r]=lr(e,n);return typeof r.exact=="undefined"&&(r.exact=!0),this.queries.find(i=>Ch(r,i))}findAll(e,n){const[r]=lr(e,n);return Object.keys(r).length>0?this.queries.filter(i=>Ch(r,i)):this.queries}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}onFocus(){ut.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class ZI extends Lh{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||su,this.observers=[],this.state=e.state||eA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=J(J({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(n=>n!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,n;return(e=(n=this.retryer)==null?void 0:n.continue())!=null?e:this.execute()}execute(){return _(this,null,function*(){const e=()=>{var O;return this.retryer=Nh({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(C,R)=>{this.dispatch({type:"failed",failureCount:C,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,u,c,d;if(!n){var f,p,h,y;this.dispatch({type:"loading",variables:this.options.variables}),yield(f=(p=this.mutationCache.config).onMutate)==null?void 0:f.call(p,this.state.variables,this);const C=yield(h=(y=this.options).onMutate)==null?void 0:h.call(y,this.state.variables);C!==this.state.context&&this.dispatch({type:"loading",context:C,variables:this.state.variables})}const O=yield e();return yield(r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this),yield(o=(s=this.options).onSuccess)==null?void 0:o.call(s,O,this.state.variables,this.state.context),yield(l=(u=this.mutationCache.config).onSettled)==null?void 0:l.call(u,O,null,this.state.variables,this.state.context,this),yield(c=(d=this.options).onSettled)==null?void 0:c.call(d,O,null,this.state.variables,this.state.context),this.dispatch({type:"success",data:O}),O}catch(O){try{var g,v,b,w,E,m,A,I;throw yield(g=(v=this.mutationCache.config).onError)==null?void 0:g.call(v,O,this.state.variables,this.state.context,this),yield(b=(w=this.options).onError)==null?void 0:b.call(w,O,this.state.variables,this.state.context),yield(E=(m=this.mutationCache.config).onSettled)==null?void 0:E.call(m,void 0,O,this.state.variables,this.state.context,this),yield(A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,O,this.state.variables,this.state.context),O}finally{this.dispatch({type:"error",error:O})}}})}dispatch(e){const n=r=>{switch(e.type){case"failed":return oe(J({},r),{failureCount:e.failureCount,failureReason:e.error});case"pause":return oe(J({},r),{isPaused:!0});case"continue":return oe(J({},r),{isPaused:!1});case"loading":return oe(J({},r),{context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Ao(this.options.networkMode),status:"loading",variables:e.variables});case"success":return oe(J({},r),{data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return oe(J({},r),{data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"});case"setState":return J(J({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function eA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class tA extends Zi{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,n,r){const i=new ZI({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?e.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(n=>n!==e),this.notify({type:"removed",mutation:e})}clear(){ut.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact=="undefined"&&(e.exact=!0),this.mutations.find(n=>Th(e,n))}findAll(e){return this.mutations.filter(n=>Th(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ut.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Yt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function nA(){return{onFetch:t=>{t.fetchFn=()=>{var e,n,r,i,o,s;const l=(e=t.fetchOptions)==null||(n=e.meta)==null?void 0:n.refetchPage,u=(r=t.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,c=u==null?void 0:u.pageParam,d=(u==null?void 0:u.direction)==="forward",f=(u==null?void 0:u.direction)==="backward",p=((o=t.state.data)==null?void 0:o.pages)||[],h=((s=t.state.data)==null?void 0:s.pageParams)||[];let y=h,g=!1;const v=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>{var O;if((O=t.signal)!=null&&O.aborted)g=!0;else{var C;(C=t.signal)==null||C.addEventListener("abort",()=>{g=!0})}return t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),w=(I,O,C,R)=>(y=R?[O,...y]:[...y,O],R?[C,...I]:[...I,C]),E=(I,O,C,R)=>{if(g)return Promise.reject("Cancelled");if(typeof C=="undefined"&&!O&&I.length)return Promise.resolve(I);const P={queryKey:t.queryKey,pageParam:C,meta:t.options.meta};v(P);const S=b(P);return Promise.resolve(S).then(D=>w(I,C,D,R))};let m;if(!p.length)m=E([]);else if(d){const I=typeof c!="undefined",O=I?c:Bh(t.options,p);m=E(p,I,O)}else if(f){const I=typeof c!="undefined",O=I?c:rA(t.options,p);m=E(p,I,O,!0)}else{y=[];const I=typeof t.options.getNextPageParam=="undefined";m=(l&&p[0]?l(p[0],0,p):!0)?E([],I,h[0]):Promise.resolve(w([],h[0],p[0]));for(let C=1;C<p.length;C++)m=m.then(R=>{if(l&&p[C]?l(p[C],C,p):!0){const S=I?h[C]:Bh(t.options,R);return E(R,I,S)}return Promise.resolve(w(R,h[C],p[C]))})}return m.then(I=>({pages:I,pageParams:y}))}}}}function Bh(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function rA(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}class iA{constructor(e={}){this.queryCache=e.queryCache||new XI,this.mutationCache=e.mutationCache||new tA,this.logger=e.logger||su,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Eo.subscribe(()=>{Eo.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Io.subscribe(()=>{Io.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,n;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(e,n){const[r]=lr(e,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll(oe(J({},e),{fetching:!0})).length}getQueryData(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state.data}ensureQueryData(e,n,r){const i=ta(e,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.queryCache.find(e),o=i==null?void 0:i.state.data,s=qI(n,o);if(typeof s=="undefined")return;const l=ta(e),u=this.defaultQueryOptions(l);return this.queryCache.build(this,u).setData(s,oe(J({},r),{manual:!0}))}setQueriesData(e,n,r){return ut.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state}removeQueries(e,n){const[r]=lr(e,n),i=this.queryCache;ut.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(e,n,r){const[i,o]=lr(e,n,r),s=this.queryCache,l=J({type:"active"},i);return ut.batch(()=>(s.findAll(i).forEach(u=>{u.reset()}),this.refetchQueries(l,o)))}cancelQueries(e,n,r){const[i,o={}]=lr(e,n,r);typeof o.revert=="undefined"&&(o.revert=!0);const s=ut.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(Yt).catch(Yt)}invalidateQueries(e,n,r){const[i,o]=lr(e,n,r);return ut.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(c=>{c.invalidate()}),i.refetchType==="none")return Promise.resolve();const u=oe(J({},i),{type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"});return this.refetchQueries(u,o)})}refetchQueries(e,n,r){const[i,o]=lr(e,n,r),s=ut.batch(()=>this.queryCache.findAll(i).filter(u=>!u.isDisabled()).map(u=>{var c;return u.fetch(void 0,oe(J({},o),{cancelRefetch:(c=o==null?void 0:o.cancelRefetch)!=null?c:!0,meta:{refetchPage:i.refetchPage}}))}));let l=Promise.all(s).then(Yt);return o!=null&&o.throwOnError||(l=l.catch(Yt)),l}fetchQuery(e,n,r){const i=ta(e,n,r),o=this.defaultQueryOptions(i);typeof o.retry=="undefined"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(e,n,r){return this.fetchQuery(e,n,r).then(Yt).catch(Yt)}fetchInfiniteQuery(e,n,r){const i=ta(e,n,r);return i.behavior=nA(),this.fetchQuery(i)}prefetchInfiniteQuery(e,n,r){return this.fetchInfiniteQuery(e,n,r).then(Yt).catch(Yt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,n){const r=this.queryDefaults.find(i=>Cr(e)===Cr(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:e,defaultOptions:n})}getQueryDefaults(e){if(!e)return;const n=this.queryDefaults.find(r=>bo(e,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(e,n){const r=this.mutationDefaults.find(i=>Cr(e)===Cr(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:e,defaultOptions:n})}getMutationDefaults(e){if(!e)return;const n=this.mutationDefaults.find(r=>bo(e,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const n=oe(J(J(J({},this.defaultOptions.queries),this.getQueryDefaults(e==null?void 0:e.queryKey)),e),{_defaulted:!0});return!n.queryHash&&n.queryKey&&(n.queryHash=ru(n.queryKey,n)),typeof n.refetchOnReconnect=="undefined"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary=="undefined"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:oe(J(J(J({},this.defaultOptions.mutations),this.getMutationDefaults(e==null?void 0:e.mutationKey)),e),{_defaulted:!0})}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class aA extends Zi{constructor(e,n){super(),this.client=e,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Uh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lu(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lu(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),iu(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled!="undefined"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&$h(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){const n=this.client.getQueryCache().build(this.client,e),r=this.createResult(n,e);return sA(this,r,e)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch(r={}){var i=r,{refetchPage:e}=i,n=Yn(i,["refetchPage"]);return this.fetch(oe(J({},n),{meta:{refetchPage:e}}))}fetchOptimistic(e){const n=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){var n;return this.executeFetch(oe(J({},e),{cancelRefetch:(n=e.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let n=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Yt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),ea||this.currentResult.isStale||!nu(this.options.staleTime))return;const n=Oh(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(ea||this.options.enabled===!1||!nu(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Eo.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,u=e!==r,c=u?e.state:this.currentQueryInitialState,d=u?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:p,error:h,errorUpdatedAt:y,fetchStatus:g,status:v}=f,b=!1,w=!1,E;if(n._optimisticResults){const C=this.hasListeners(),R=!C&&Uh(e,n),P=C&&$h(e,r,n,i);(R||P)&&(g=Ao(e.options.networkMode)?"fetching":"paused",p||(v="loading")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&d!=null&&d.isSuccess&&v!=="error")E=d.data,p=d.dataUpdatedAt,v=d.status,b=!0;else if(n.select&&typeof f.data!="undefined")if(o&&f.data===(s==null?void 0:s.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(f.data),E=ou(o==null?void 0:o.data,E,n),this.selectResult=E,this.selectError=null}catch(C){this.selectError=C}else E=f.data;if(typeof n.placeholderData!="undefined"&&typeof E=="undefined"&&v==="loading"){let C;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))C=o.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof C!="undefined")try{C=n.select(C),this.selectError=null}catch(R){this.selectError=R}typeof C!="undefined"&&(v="success",E=ou(o==null?void 0:o.data,C,n),w=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,y=Date.now(),v="error");const m=g==="fetching",A=v==="loading",I=v==="error";return{status:v,fetchStatus:g,isLoading:A,isSuccess:v==="success",isError:I,isInitialLoading:A&&m,data:E,dataUpdatedAt:p,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!A,isLoadingError:I&&f.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:w,isPreviousData:b,isRefetchError:I&&f.dataUpdatedAt!==0,isStale:uu(e,n),refetch:this.refetch,remove:this.remove}}updateResult(e){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,iu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const u=new Set(l!=null?l:this.trackedProps);return this.options.useErrorBoundary&&u.add("error"),Object.keys(this.currentResult).some(c=>{const d=c;return this.currentResult[d]!==n[d]&&u.has(d)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),this.notify(J(J({},i),e))}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const n={};e.type==="success"?n.onSuccess=!e.manual:e.type==="error"&&!Oo(e.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(e){ut.batch(()=>{if(e.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(e.onError){var s,l,u,c;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(u=(c=this.options).onSettled)==null||u.call(c,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function oA(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Uh(t,e){return oA(t,e)||t.state.dataUpdatedAt>0&&lu(t,e,e.refetchOnMount)}function lu(t,e,n){if(e.enabled!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&uu(t,e)}return!1}function $h(t,e,n,r){return n.enabled!==!1&&(t!==e||r.enabled===!1)&&(!n.suspense||t.state.status!=="error")&&uu(t,n)}function uu(t,e){return t.isStaleByTime(e.staleTime)}function sA(t,e,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?e.isPlaceholderData:!iu(t.getCurrentResult(),e)}var jh={exports:{}},Hh={};/**
|
|
2268
|
+
*/const LI="auth-compat";function BI(t){t.INTERNAL.registerComponent(new Xn(LI,e=>{const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Zl(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:ar,FacebookAuthProvider:vn,GithubAuthProvider:wn,GoogleAuthProvider:yn,OAuthProvider:Qr,SAMLAuthProvider:io,PhoneAuthProvider:eu,PhoneMultiFactorGenerator:lh,RecaptchaVerifier:NI,TwitterAuthProvider:bn,Auth:Zl,AuthCredential:Gr,Error:Mt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),t.registerVersion(vI,yI)}BI(Fn);let Eh=!1;const tu=t=>{if(Eh)return Fn.auth();if(t&&t==="dev"){const e="api_key";Fn.initializeApp({apiKey:e});const n=KE();Tl(n,"http://localhost:39199")}else{const n={apiKey:t&&t==="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"};Fn.initializeApp(n)}return Eh=!0,Fn.auth()},UI=({fansUnitedEnvironment:t})=>{const[e,n]=K.useState(""),[r,i]=K.useState(""),{userNotFound:o}=be(Pe);return U("div",{className:"eow-flex eow-items-center eow-justify-center eow-min-h-screen eow-bg-gray-100",children:ie("div",{className:"eow-px-8 eow-py-6 eow-mt-4 eow-text-left eow-bg-white eow-shadow-lg",children:[U("h3",{className:"eow-text-2xl eow-font-bold eow-text-center eow-mb-4",children:"Sign in"}),U("p",{className:"eow-text-gray-400 eow-text-xs eow-mb-4 eow-text-center",children:"Use your account in the Fans United platform."}),ie("div",{className:"eow-mt-4",children:[ie("div",{children:[U("label",{className:"eow-block",htmlFor:"email",children:"Email"}),U("input",{value:e,type:"text",placeholder:"Email",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),n(l.target.value)}})]}),ie("div",{className:"eow-mt-4",children:[U("label",{className:"eow-block",htmlFor:"password",children:"Password"}),U("input",{value:r,type:"password",placeholder:"Password",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),i(l.target.value)}})]}),U("div",{className:"eow-flex eow-items-baseline eow-justify-between",children:U("button",{onClick:()=>_(this,null,function*(){try{yield tu(t).signInWithEmailAndPassword(e,r)}catch(l){console.error(l),xe.error(o)}}),className:"eow-px-6 eow-py-2 eow-mt-4 eow-text-white eow-bg-gray-600 eow-rounded hover:eow-bg-gray-900",children:"Login"})})]})]})})},Ih=K.createContext(null),$I=({children:t,fansUnitedEnvironment:e})=>{const[n,r]=K.useState(null),[i,o]=K.useState(!0);return K.useEffect(()=>tu(e).onAuthStateChanged(l=>{Ge.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[]),U(Ih.Provider,{value:n,children:!i&&t})},jI=({children:t})=>U("div",{className:"eow-w-full eow-bg-white","data-testid":"widget-card",children:t}),HI=({fansUnitedEnvironment:t})=>{const{signOut:e}=be(Pe);return U("button",{className:"eow-rounded eow-bg-gray-700 eow-text-white hover:eow-bg-gray-800 eow-uppercase eow-text-xs eow-font-bold eow-py-2 eow-px-6 ",onClick:()=>_(this,null,function*(){yield tu(t).signOut()}),children:e})},Ah=({hideSignOutButton:t,toggleScreen:e,fansUnitedEnvironment:n})=>{const{create:r}=be(Pe);return ie("div",{className:"eow-mb-4 eow-flex eow-p-2 eow-items-center eow-justify-between",children:[U("button",{onClick:e,className:"eow-rounded eow-bg-gray-700 hover:eow-bg-gray-800 eow-text-white eow-uppercase eow-text-xs eow-font-bold eow-px-6 eow-py-2",children:r}),t?U(Se,{}):U(HI,{fansUnitedEnvironment:n})]})},VI=()=>{const{title:t,status:e,type:n,creationDate:r,actions:i}=be(Pe);return U("thead",{className:"eow-bg-gray-200",children:ie("tr",{className:"eow-uppercase eow-text-xs",children:[U("th",{className:"eow-px-2 eow-py-4 eow-font-semibold eow-text-left",children:t}),U("th",{className:"md:eow-text-center eow-text-right eow-p-2 eow-font-semibold",children:e}),U("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:n}),U("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:r}),U("th",{className:"eow-text-right eow-p-2",children:i})]})})};class Zi{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const n={listener:e};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const ea=typeof window=="undefined"||"Deno"in window;function Yt(){}function qI(t,e){return typeof t=="function"?t(e):t}function nu(t){return typeof t=="number"&&t>=0&&t!==1/0}function Oh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ta(t,e,n){return _o(t)?typeof e=="function"?oe(J({},n),{queryKey:t,queryFn:e}):oe(J({},e),{queryKey:t}):t}function lr(t,e,n){return _o(t)?[oe(J({},e),{queryKey:t}),n]:[t||{},e]}function Ch(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=t;if(_o(s)){if(r){if(e.queryHash!==ru(s,e.options))return!1}else if(!bo(e.queryKey,s))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof i!="undefined"&&i!==e.state.fetchStatus||o&&!o(e))}function Th(t,e){const{exact:n,fetching:r,predicate:i,mutationKey:o}=t;if(_o(o)){if(!e.options.mutationKey)return!1;if(n){if(Cr(e.options.mutationKey)!==Cr(o))return!1}else if(!bo(e.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&e.state.status==="loading"!==r||i&&!i(e))}function ru(t,e){return((e==null?void 0:e.queryKeyHashFn)||Cr)(t)}function Cr(t){return JSON.stringify(t,(e,n)=>au(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function bo(t,e){return Sh(t,e)}function Sh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Sh(t[n],e[n])):!1}function Ph(t,e){if(t===e)return t;const n=Mh(t)&&Mh(e);if(n||au(t)&&au(e)){const r=n?t.length:Object.keys(t).length,i=n?e:Object.keys(e),o=i.length,s=n?[]:{};let l=0;for(let u=0;u<o;u++){const c=n?u:i[u];s[c]=Ph(t[c],e[c]),s[c]===t[c]&&l++}return r===o&&l===r?t:s}return e}function iu(t,e){if(t&&!e||e&&!t)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Mh(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function au(t){if(!xh(t))return!1;const e=t.constructor;if(typeof e=="undefined")return!0;const n=e.prototype;return!(!xh(n)||!n.hasOwnProperty("isPrototypeOf"))}function xh(t){return Object.prototype.toString.call(t)==="[object Object]"}function _o(t){return Array.isArray(t)}function Rh(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){Rh(0).then(t)}function WI(){if(typeof AbortController=="function")return new AbortController}function ou(t,e,n){return n.isDataEqual!=null&&n.isDataEqual(t,e)?t:typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Ph(t,e):e}class GI extends Zi{constructor(){super(),this.setup=e=>{if(!ea&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document=="undefined"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Eo=new GI,Dh=["online","offline"];class zI extends Zi{constructor(){super(),this.setup=e=>{if(!ea&&window.addEventListener){const n=()=>e();return Dh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Dh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator=="undefined"||typeof navigator.onLine=="undefined"?!0:navigator.onLine}}const Io=new zI;function QI(t){return Math.min(1e3*$w(2,t),3e4)}function Ao(t){return(t!=null?t:"online")==="online"?Io.isOnline():!0}class Fh{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Oo(t){return t instanceof Fh}function Nh(t){let e=!1,n=0,r=!1,i,o,s;const l=new Promise((v,b)=>{o=v,s=b}),u=v=>{r||(h(new Fh(v)),t.abort==null||t.abort())},c=()=>{e=!0},d=()=>{e=!1},f=()=>!Eo.isFocused()||t.networkMode!=="always"&&!Io.isOnline(),p=v=>{r||(r=!0,t.onSuccess==null||t.onSuccess(v),i==null||i(),o(v))},h=v=>{r||(r=!0,t.onError==null||t.onError(v),i==null||i(),s(v))},y=()=>new Promise(v=>{i=b=>{const w=r||!f();return w&&v(b),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,r||t.onContinue==null||t.onContinue()}),g=()=>{if(r)return;let v;try{v=t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(p).catch(b=>{var w,E;if(r)return;const m=(w=t.retry)!=null?w:3,A=(E=t.retryDelay)!=null?E:QI,I=typeof A=="function"?A(n,b):A,O=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,b);if(e||!O){h(b);return}n++,t.onFail==null||t.onFail(n,b),Rh(I).then(()=>{if(f())return y()}).then(()=>{e?h(b):g()})})};return Ao(t.networkMode)?g():y().then(g),{promise:l,cancel:u,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:c,continueRetry:d}}const su=console;function YI(){let t=[],e=0,n=d=>{d()},r=d=>{d()};const i=d=>{let f;e++;try{f=d()}finally{e--,e||l()}return f},o=d=>{e?t.push(d):kh(()=>{n(d)})},s=d=>(...f)=>{o(()=>{d(...f)})},l=()=>{const d=t;t=[],d.length&&kh(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}const ut=YI();class Lh{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nu(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e!=null?e:ea?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class KI extends Lh{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||su,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||JI(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options=J(J({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,n){const r=ou(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){this.dispatch({type:"setState",state:e,setStateOptions:n})}cancel(e){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(e),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Oh(this.state.dataUpdatedAt,e)}onFocus(){var e;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const s=WI(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};u(l);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(u(d),(r=this.options.behavior)==null||r.onFetch(d),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=d.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=d.fetchOptions)==null?void 0:f.meta})}const p=h=>{if(Oo(h)&&h.silent||this.dispatch({type:"error",error:h}),!Oo(h)){var y,g,v,b;(y=(g=this.cache.config).onError)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Nh({fn:d.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:h=>{var y,g,v,b;if(typeof h=="undefined"){p(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(y=(g=this.cache.config).onSuccess)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:(h,y)=>{this.dispatch({type:"failed",failureCount:h,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const n=r=>{var i,o;switch(e.type){case"failed":return oe(J({},r),{fetchFailureCount:e.failureCount,fetchFailureReason:e.error});case"pause":return oe(J({},r),{fetchStatus:"paused"});case"continue":return oe(J({},r),{fetchStatus:"fetching"});case"fetch":return J(oe(J({},r),{fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:Ao(this.options.networkMode)?"fetching":"paused"}),!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return J(oe(J({},r),{data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=e.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success"}),!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});case"error":const s=e.error;return Oo(s)&&s.revert&&this.revertState?oe(J({},this.revertState),{fetchStatus:"idle"}):oe(J({},r),{error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"});case"invalidate":return oe(J({},r),{isInvalidated:!0});case"setState":return J(J({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function JI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=typeof e!="undefined",r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class XI extends Zi{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:ru(o,n);let l=this.get(s);return l||(l=new KI({cache:this,logger:e.getLogger(),queryKey:o,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const n=this.queriesMap[e.queryHash];n&&(e.destroy(),this.queries=this.queries.filter(r=>r!==e),n===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,n){const[r]=lr(e,n);return typeof r.exact=="undefined"&&(r.exact=!0),this.queries.find(i=>Ch(r,i))}findAll(e,n){const[r]=lr(e,n);return Object.keys(r).length>0?this.queries.filter(i=>Ch(r,i)):this.queries}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}onFocus(){ut.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class ZI extends Lh{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||su,this.observers=[],this.state=e.state||eA(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=J(J({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(n=>n!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,n;return(e=(n=this.retryer)==null?void 0:n.continue())!=null?e:this.execute()}execute(){return _(this,null,function*(){const e=()=>{var O;return this.retryer=Nh({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(C,R)=>{this.dispatch({type:"failed",failureCount:C,error:R})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,u,c,d;if(!n){var f,p,h,y;this.dispatch({type:"loading",variables:this.options.variables}),yield(f=(p=this.mutationCache.config).onMutate)==null?void 0:f.call(p,this.state.variables,this);const C=yield(h=(y=this.options).onMutate)==null?void 0:h.call(y,this.state.variables);C!==this.state.context&&this.dispatch({type:"loading",context:C,variables:this.state.variables})}const O=yield e();return yield(r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this),yield(o=(s=this.options).onSuccess)==null?void 0:o.call(s,O,this.state.variables,this.state.context),yield(l=(u=this.mutationCache.config).onSettled)==null?void 0:l.call(u,O,null,this.state.variables,this.state.context,this),yield(c=(d=this.options).onSettled)==null?void 0:c.call(d,O,null,this.state.variables,this.state.context),this.dispatch({type:"success",data:O}),O}catch(O){try{var g,v,b,w,E,m,A,I;throw yield(g=(v=this.mutationCache.config).onError)==null?void 0:g.call(v,O,this.state.variables,this.state.context,this),yield(b=(w=this.options).onError)==null?void 0:b.call(w,O,this.state.variables,this.state.context),yield(E=(m=this.mutationCache.config).onSettled)==null?void 0:E.call(m,void 0,O,this.state.variables,this.state.context,this),yield(A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,O,this.state.variables,this.state.context),O}finally{this.dispatch({type:"error",error:O})}}})}dispatch(e){const n=r=>{switch(e.type){case"failed":return oe(J({},r),{failureCount:e.failureCount,failureReason:e.error});case"pause":return oe(J({},r),{isPaused:!0});case"continue":return oe(J({},r),{isPaused:!1});case"loading":return oe(J({},r),{context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Ao(this.options.networkMode),status:"loading",variables:e.variables});case"success":return oe(J({},r),{data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return oe(J({},r),{data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"});case"setState":return J(J({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function eA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class tA extends Zi{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,n,r){const i=new ZI({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?e.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(n=>n!==e),this.notify({type:"removed",mutation:e})}clear(){ut.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact=="undefined"&&(e.exact=!0),this.mutations.find(n=>Th(e,n))}findAll(e){return this.mutations.filter(n=>Th(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ut.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Yt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function nA(){return{onFetch:t=>{t.fetchFn=()=>{var e,n,r,i,o,s;const l=(e=t.fetchOptions)==null||(n=e.meta)==null?void 0:n.refetchPage,u=(r=t.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,c=u==null?void 0:u.pageParam,d=(u==null?void 0:u.direction)==="forward",f=(u==null?void 0:u.direction)==="backward",p=((o=t.state.data)==null?void 0:o.pages)||[],h=((s=t.state.data)==null?void 0:s.pageParams)||[];let y=h,g=!1;const v=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>{var O;if((O=t.signal)!=null&&O.aborted)g=!0;else{var C;(C=t.signal)==null||C.addEventListener("abort",()=>{g=!0})}return t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),w=(I,O,C,R)=>(y=R?[O,...y]:[...y,O],R?[C,...I]:[...I,C]),E=(I,O,C,R)=>{if(g)return Promise.reject("Cancelled");if(typeof C=="undefined"&&!O&&I.length)return Promise.resolve(I);const P={queryKey:t.queryKey,pageParam:C,meta:t.options.meta};v(P);const S=b(P);return Promise.resolve(S).then(D=>w(I,C,D,R))};let m;if(!p.length)m=E([]);else if(d){const I=typeof c!="undefined",O=I?c:Bh(t.options,p);m=E(p,I,O)}else if(f){const I=typeof c!="undefined",O=I?c:rA(t.options,p);m=E(p,I,O,!0)}else{y=[];const I=typeof t.options.getNextPageParam=="undefined";m=(l&&p[0]?l(p[0],0,p):!0)?E([],I,h[0]):Promise.resolve(w([],h[0],p[0]));for(let C=1;C<p.length;C++)m=m.then(R=>{if(l&&p[C]?l(p[C],C,p):!0){const S=I?h[C]:Bh(t.options,R);return E(R,I,S)}return Promise.resolve(w(R,h[C],p[C]))})}return m.then(I=>({pages:I,pageParams:y}))}}}}function Bh(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function rA(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}class iA{constructor(e={}){this.queryCache=e.queryCache||new XI,this.mutationCache=e.mutationCache||new tA,this.logger=e.logger||su,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Eo.subscribe(()=>{Eo.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Io.subscribe(()=>{Io.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,n;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(e,n){const[r]=lr(e,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll(oe(J({},e),{fetching:!0})).length}getQueryData(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state.data}ensureQueryData(e,n,r){const i=ta(e,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.queryCache.find(e),o=i==null?void 0:i.state.data,s=qI(n,o);if(typeof s=="undefined")return;const l=ta(e),u=this.defaultQueryOptions(l);return this.queryCache.build(this,u).setData(s,oe(J({},r),{manual:!0}))}setQueriesData(e,n,r){return ut.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state}removeQueries(e,n){const[r]=lr(e,n),i=this.queryCache;ut.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(e,n,r){const[i,o]=lr(e,n,r),s=this.queryCache,l=J({type:"active"},i);return ut.batch(()=>(s.findAll(i).forEach(u=>{u.reset()}),this.refetchQueries(l,o)))}cancelQueries(e,n,r){const[i,o={}]=lr(e,n,r);typeof o.revert=="undefined"&&(o.revert=!0);const s=ut.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(Yt).catch(Yt)}invalidateQueries(e,n,r){const[i,o]=lr(e,n,r);return ut.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(c=>{c.invalidate()}),i.refetchType==="none")return Promise.resolve();const u=oe(J({},i),{type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"});return this.refetchQueries(u,o)})}refetchQueries(e,n,r){const[i,o]=lr(e,n,r),s=ut.batch(()=>this.queryCache.findAll(i).filter(u=>!u.isDisabled()).map(u=>{var c;return u.fetch(void 0,oe(J({},o),{cancelRefetch:(c=o==null?void 0:o.cancelRefetch)!=null?c:!0,meta:{refetchPage:i.refetchPage}}))}));let l=Promise.all(s).then(Yt);return o!=null&&o.throwOnError||(l=l.catch(Yt)),l}fetchQuery(e,n,r){const i=ta(e,n,r),o=this.defaultQueryOptions(i);typeof o.retry=="undefined"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(e,n,r){return this.fetchQuery(e,n,r).then(Yt).catch(Yt)}fetchInfiniteQuery(e,n,r){const i=ta(e,n,r);return i.behavior=nA(),this.fetchQuery(i)}prefetchInfiniteQuery(e,n,r){return this.fetchInfiniteQuery(e,n,r).then(Yt).catch(Yt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,n){const r=this.queryDefaults.find(i=>Cr(e)===Cr(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:e,defaultOptions:n})}getQueryDefaults(e){if(!e)return;const n=this.queryDefaults.find(r=>bo(e,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(e,n){const r=this.mutationDefaults.find(i=>Cr(e)===Cr(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:e,defaultOptions:n})}getMutationDefaults(e){if(!e)return;const n=this.mutationDefaults.find(r=>bo(e,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const n=oe(J(J(J({},this.defaultOptions.queries),this.getQueryDefaults(e==null?void 0:e.queryKey)),e),{_defaulted:!0});return!n.queryHash&&n.queryKey&&(n.queryHash=ru(n.queryKey,n)),typeof n.refetchOnReconnect=="undefined"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary=="undefined"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:oe(J(J(J({},this.defaultOptions.mutations),this.getMutationDefaults(e==null?void 0:e.mutationKey)),e),{_defaulted:!0})}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class aA extends Zi{constructor(e,n){super(),this.client=e,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Uh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lu(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lu(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),iu(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled!="undefined"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&$h(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){const n=this.client.getQueryCache().build(this.client,e),r=this.createResult(n,e);return sA(this,r,e)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch(r={}){var i=r,{refetchPage:e}=i,n=Yn(i,["refetchPage"]);return this.fetch(oe(J({},n),{meta:{refetchPage:e}}))}fetchOptimistic(e){const n=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){var n;return this.executeFetch(oe(J({},e),{cancelRefetch:(n=e.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let n=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Yt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),ea||this.currentResult.isStale||!nu(this.options.staleTime))return;const n=Oh(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(ea||this.options.enabled===!1||!nu(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Eo.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,u=e!==r,c=u?e.state:this.currentQueryInitialState,d=u?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:p,error:h,errorUpdatedAt:y,fetchStatus:g,status:v}=f,b=!1,w=!1,E;if(n._optimisticResults){const C=this.hasListeners(),R=!C&&Uh(e,n),P=C&&$h(e,r,n,i);(R||P)&&(g=Ao(e.options.networkMode)?"fetching":"paused",p||(v="loading")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&d!=null&&d.isSuccess&&v!=="error")E=d.data,p=d.dataUpdatedAt,v=d.status,b=!0;else if(n.select&&typeof f.data!="undefined")if(o&&f.data===(s==null?void 0:s.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(f.data),E=ou(o==null?void 0:o.data,E,n),this.selectResult=E,this.selectError=null}catch(C){this.selectError=C}else E=f.data;if(typeof n.placeholderData!="undefined"&&typeof E=="undefined"&&v==="loading"){let C;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))C=o.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof C!="undefined")try{C=n.select(C),this.selectError=null}catch(R){this.selectError=R}typeof C!="undefined"&&(v="success",E=ou(o==null?void 0:o.data,C,n),w=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,y=Date.now(),v="error");const m=g==="fetching",A=v==="loading",I=v==="error";return{status:v,fetchStatus:g,isLoading:A,isSuccess:v==="success",isError:I,isInitialLoading:A&&m,data:E,dataUpdatedAt:p,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!A,isLoadingError:I&&f.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:w,isPreviousData:b,isRefetchError:I&&f.dataUpdatedAt!==0,isStale:uu(e,n),refetch:this.refetch,remove:this.remove}}updateResult(e){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,iu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const u=new Set(l!=null?l:this.trackedProps);return this.options.useErrorBoundary&&u.add("error"),Object.keys(this.currentResult).some(c=>{const d=c;return this.currentResult[d]!==n[d]&&u.has(d)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),this.notify(J(J({},i),e))}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const n={};e.type==="success"?n.onSuccess=!e.manual:e.type==="error"&&!Oo(e.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(e){ut.batch(()=>{if(e.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(e.onError){var s,l,u,c;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(u=(c=this.options).onSettled)==null||u.call(c,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function oA(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Uh(t,e){return oA(t,e)||t.state.dataUpdatedAt>0&&lu(t,e,e.refetchOnMount)}function lu(t,e,n){if(e.enabled!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&uu(t,e)}return!1}function $h(t,e,n,r){return n.enabled!==!1&&(t!==e||r.enabled===!1)&&(!n.suspense||t.state.status!=="error")&&uu(t,n)}function uu(t,e){return t.isStaleByTime(e.staleTime)}function sA(t,e,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?e.isPlaceholderData:!iu(t.getCurrentResult(),e)}var jh={exports:{}},Hh={};/**
|
|
2269
2269
|
* @license React
|
|
2270
2270
|
* use-sync-external-store-shim.production.min.js
|
|
2271
2271
|
*
|
|
@@ -2332,4 +2332,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2332
2332
|
`+G.join("</span><span class='flatpickr-weekday'>")+`
|
|
2333
2333
|
</span>
|
|
2334
2334
|
`}}function F(){n.calendarContainer.classList.add("hasWeeks");var V=je("div","flatpickr-weekwrapper");V.appendChild(je("span","flatpickr-weekday",n.l10n.weekAbbreviation));var G=je("div","flatpickr-weeks");return V.appendChild(G),{weekWrapper:V,weekNumbers:G}}function T(V,G){G===void 0&&(G=!0);var X=G?V:V-n.currentMonth;X<0&&n._hidePrevMonthArrow===!0||X>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=X,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,fe("onYearChange"),D()),M(),fe("onMonthChange"),ft())}function x(V,G){if(V===void 0&&(V=!0),G===void 0&&(G=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,G===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var X=Bc(n.config),ne=X.hours,de=X.minutes,pe=X.seconds;h(ne,de,pe)}n.redraw(),V&&fe("onChange")}function k(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),fe("onClose")}function B(){n.config!==void 0&&fe("onDestroy");for(var V=n._handlers.length;V--;)n._handlers[V].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 G=n.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(X){try{delete n[X]}catch(ne){}})}function W(V){return n.calendarContainer.contains(V)}function j(V){if(n.isOpen&&!n.config.inline){var G=Vt(V),X=W(G),ne=G===n.input||G===n.altInput||n.element.contains(G)||V.path&&V.path.indexOf&&(~V.path.indexOf(n.input)||~V.path.indexOf(n.altInput)),de=!ne&&!X&&!W(V.relatedTarget),pe=!n.config.ignoredFocusElements.some(function(Re){return Re.contains(G)});de&&pe&&(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&&u(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function Q(V){if(!(!V||n.config.minDate&&V<n.config.minDate.getFullYear()||n.config.maxDate&&V>n.config.maxDate.getFullYear())){var G=V,X=n.currentYear!==G;n.currentYear=G||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)),X&&(n.redraw(),fe("onYearChange"),D())}}function Y(V,G){var X;G===void 0&&(G=!0);var ne=n.parseDate(V,void 0,G);if(n.config.minDate&&ne&&qt(ne,n.config.minDate,G!==void 0?G:!n.minDateHasTime)<0||n.config.maxDate&&ne&&qt(ne,n.config.maxDate,G!==void 0?G:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(ne===void 0)return!1;for(var de=!!n.config.enable,pe=(X=n.config.enable)!==null&&X!==void 0?X:n.config.disable,Re=0,ye=void 0;Re<pe.length;Re++){if(ye=pe[Re],typeof ye=="function"&&ye(ne))return de;if(ye instanceof Date&&ne!==void 0&&ye.getTime()===ne.getTime())return de;if(typeof ye=="string"){var ke=n.parseDate(ye,void 0,!0);return ke&&ke.getTime()===ne.getTime()?de:!de}else if(typeof ye=="object"&&ne!==void 0&&ye.from&&ye.to&&ne.getTime()>=ye.from.getTime()&&ne.getTime()<=ye.to.getTime())return de}return!de}function Z(V){return n.daysContainer!==void 0?V.className.indexOf("hidden")===-1&&V.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(V):!1}function ee(V){var G=V.target===n._input,X=n._input.value.trimEnd()!==Ot();G&&X&&!(V.relatedTarget&&W(V.relatedTarget))&&n.setDate(n._input.value,!0,V.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function le(V){var G=Vt(V),X=n.config.wrap?t.contains(G):G===n._input,ne=n.config.allowInput,de=n.isOpen&&(!ne||!X),pe=n.config.inline&&X&&!ne;if(V.keyCode===13&&X){if(ne)return n.setDate(n._input.value,!0,G===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),G.blur();n.open()}else if(W(G)||de||pe){var Re=!!n.timeContainer&&n.timeContainer.contains(G);switch(V.keyCode){case 13:Re?(V.preventDefault(),u(),Ee()):Oe(V);break;case 27:V.preventDefault(),Ee();break;case 8:case 46:X&&!n.config.allowInput&&(V.preventDefault(),n.clear());break;case 37:case 39:if(!Re&&!X){V.preventDefault();var ye=o();if(n.daysContainer!==void 0&&(ne===!1||ye&&Z(ye))){var ke=V.keyCode===39?1:-1;V.ctrlKey?(V.stopPropagation(),T(ke),P(C(1),0)):P(void 0,ke)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:V.preventDefault();var ge=V.keyCode===40?1:-1;n.daysContainer&&G.$i!==void 0||G===n.input||G===n.altInput?V.ctrlKey?(V.stopPropagation(),Q(n.currentYear-ge),P(C(1),0)):Re||P(void 0,ge*7):G===n.currentYearElement?Q(n.currentYear-ge):n.config.enableTime&&(!Re&&n.hourElement&&n.hourElement.focus(),u(V),n._debouncedChange());break;case 9:if(Re){var Te=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(Gt){return Gt}),Ke=Te.indexOf(G);if(Ke!==-1){var kn=Te[Ke+(V.shiftKey?-1:1)];V.preventDefault(),(kn||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(G)&&V.shiftKey&&(V.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&G===n.amPM)switch(V.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],f(),Ct();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],f(),Ct();break}(X||W(G))&&fe("onKeyDown",V)}function me(V,G){if(G===void 0&&(G="flatpickr-day"),!(n.selectedDates.length!==1||V&&(!V.classList.contains(G)||V.classList.contains("flatpickr-disabled")))){for(var X=V?V.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),ne=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),de=Math.min(X,n.selectedDates[0].getTime()),pe=Math.max(X,n.selectedDates[0].getTime()),Re=!1,ye=0,ke=0,ge=de;ge<pe;ge+=gU.DAY)Y(new Date(ge),!0)||(Re=Re||ge>de&&ge<pe,ge<ne&&(!ye||ge>ye)?ye=ge:ge>ne&&(!ke||ge<ke)&&(ke=ge));var Te=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+G));Te.forEach(function(Ke){var kn=Ke.dateObj,Gt=kn.getTime(),Ba=ye>0&&Gt<ye||ke>0&&Gt>ke;if(Ba){Ke.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Si){Ke.classList.remove(Si)});return}else if(Re&&!Ba)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Si){Ke.classList.remove(Si)}),V!==void 0&&(V.classList.add(X<=n.selectedDates[0].getTime()?"startRange":"endRange"),ne<X&&Gt===ne?Ke.classList.add("startRange"):ne>X&&Gt===ne&&Ke.classList.add("endRange"),Gt>=ye&&(ke===0||Gt<=ke)&&pU(Gt,ne,X)&&Ke.classList.add("inRange"))})}}function ve(){n.isOpen&&!n.config.static&&!n.config.inline&&re()}function Ae(V,G){if(G===void 0&&(G=n._positionElement),n.isMobile===!0){if(V){V.preventDefault();var X=Vt(V);X&&X.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),fe("onOpen");return}else if(n._input.disabled||n.config.inline)return;var ne=n.isOpen;n.isOpen=!0,ne||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),fe("onOpen"),re(G)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(V===void 0||!n.timeContainer.contains(V.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function Me(V){return function(G){var X=n.config["_"+V+"Date"]=n.parseDate(G,n.config.dateFormat),ne=n.config["_"+(V==="min"?"max":"min")+"Date"];X!==void 0&&(n[V==="min"?"minDateHasTime":"maxDateHasTime"]=X.getHours()>0||X.getMinutes()>0||X.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(de){return Y(de)}),!n.selectedDates.length&&V==="min"&&p(X),Ct()),n.daysContainer&&(se(),X!==void 0?n.currentYearElement[V]=X.getFullYear().toString():n.currentYearElement.removeAttribute(V),n.currentYearElement.disabled=!!ne&&X!==void 0&&ne.getFullYear()===X.getFullYear())}}function Ze(){var V=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=At(At({},JSON.parse(JSON.stringify(t.dataset||{}))),e),X={};n.config.parseDate=G.parseDate,n.config.formatDate=G.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(Te){n.config._enable=Ti(Te)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(Te){n.config._disable=Ti(Te)}});var ne=G.mode==="time";if(!G.dateFormat&&(G.enableTime||ne)){var de=dt.defaultConfig.dateFormat||wi.dateFormat;X.dateFormat=G.noCalendar||ne?"H:i"+(G.enableSeconds?":S":""):de+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||ne)&&!G.altFormat){var pe=dt.defaultConfig.altFormat||wi.altFormat;X.altFormat=G.noCalendar||ne?"h:i"+(G.enableSeconds?":S K":" K"):pe+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:Me("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:Me("max")});var Re=function(Te){return function(Ke){n.config[Te==="min"?"_minTime":"_maxTime"]=n.parseDate(Ke,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:Re("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:Re("max")}),G.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,X,G);for(var ye=0;ye<V.length;ye++)n.config[V[ye]]=n.config[V[ye]]===!0||n.config[V[ye]]==="true";kc.filter(function(Te){return n.config[Te]!==void 0}).forEach(function(Te){n.config[Te]=Dc(n.config[Te]||[]).map(s)}),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 ye=0;ye<n.config.plugins.length;ye++){var ke=n.config.plugins[ye](n)||{};for(var ge in ke)kc.indexOf(ge)>-1?n.config[ge]=Dc(ke[ge]).map(s).concat(n.config[ge]):typeof G[ge]=="undefined"&&(n.config[ge]=ke[ge])}G.altInputClass||(n.config.altInputClass=qe().className+" "+n.config.altInputClass),fe("onParseConfig")}function qe(){return n.config.wrap?t.querySelector("[data-input]"):t}function te(){typeof n.config.locale!="object"&&typeof dt.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=At(At({},dt.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?dt.l10ns[n.config.locale]:void 0),kr.D="("+n.l10n.weekdays.shorthand.join("|")+")",kr.l="("+n.l10n.weekdays.longhand.join("|")+")",kr.M="("+n.l10n.months.shorthand.join("|")+")",kr.F="("+n.l10n.months.longhand.join("|")+")",kr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var V=At(At({},e),JSON.parse(JSON.stringify(t.dataset||{})));V.time_24hr===void 0&&dt.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=sy(n),n.parseDate=Nc({config:n.config,l10n:n.l10n})}function re(V){if(typeof n.config.position=="function")return void n.config.position(n,V);if(n.calendarContainer!==void 0){fe("onPreCalendarPosition");var G=V||n._positionElement,X=Array.prototype.reduce.call(n.calendarContainer.children,function(OH,CH){return OH+CH.offsetHeight},0),ne=n.calendarContainer.offsetWidth,de=n.config.position.split(" "),pe=de[0],Re=de.length>1?de[1]:null,ye=G.getBoundingClientRect(),ke=window.innerHeight-ye.bottom,ge=pe==="above"||pe!=="below"&&ke<X&&ye.top>X,Te=window.pageYOffset+ye.top+(ge?-X-2:G.offsetHeight+2);if(Tt(n.calendarContainer,"arrowTop",!ge),Tt(n.calendarContainer,"arrowBottom",ge),!n.config.inline){var Ke=window.pageXOffset+ye.left,kn=!1,Gt=!1;Re==="center"?(Ke-=(ne-ye.width)/2,kn=!0):Re==="right"&&(Ke-=ne-ye.width,Gt=!0),Tt(n.calendarContainer,"arrowLeft",!kn&&!Gt),Tt(n.calendarContainer,"arrowCenter",kn),Tt(n.calendarContainer,"arrowRight",Gt);var Ba=window.document.body.offsetWidth-(window.pageXOffset+ye.right),Si=Ke+ne>window.document.body.offsetWidth,yH=Ba+ne>window.document.body.offsetWidth;if(Tt(n.calendarContainer,"rightMost",Si),!n.config.static)if(n.calendarContainer.style.top=Te+"px",!Si)n.calendarContainer.style.left=Ke+"px",n.calendarContainer.style.right="auto";else if(!yH)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=Ba+"px";else{var hd=ue();if(hd===void 0)return;var wH=window.document.body.offsetWidth,bH=Math.max(0,wH/2-ne/2),_H=".flatpickr-calendar.centerMost:before",EH=".flatpickr-calendar.centerMost:after",IH=hd.cssRules.length,AH="{left:"+ye.left+"px;right:auto;}";Tt(n.calendarContainer,"rightMost",!1),Tt(n.calendarContainer,"centerMost",!0),hd.insertRule(_H+","+EH+AH,IH),n.calendarContainer.style.left=bH+"px",n.calendarContainer.style.right="auto"}}}}function ue(){for(var V=null,G=0;G<document.styleSheets.length;G++){var X=document.styleSheets[G];if(!!X.cssRules){try{X.cssRules}catch(ne){continue}V=X;break}}return V!=null?V:he()}function he(){var V=document.createElement("style");return document.head.appendChild(V),V.sheet}function se(){n.config.noCalendar||n.isMobile||(D(),ft(),M())}function Ee(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function Oe(V){V.preventDefault(),V.stopPropagation();var G=function(Te){return Te.classList&&Te.classList.contains("flatpickr-day")&&!Te.classList.contains("flatpickr-disabled")&&!Te.classList.contains("notAllowed")},X=oy(Vt(V),G);if(X!==void 0){var ne=X,de=n.latestSelectedDateObj=new Date(ne.dateObj.getTime()),pe=(de.getMonth()<n.currentMonth||de.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=ne,n.config.mode==="single")n.selectedDates=[de];else if(n.config.mode==="multiple"){var Re=Le(de);Re?n.selectedDates.splice(parseInt(Re),1):n.selectedDates.push(de)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=de,n.selectedDates.push(de),qt(de,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(Te,Ke){return Te.getTime()-Ke.getTime()}));if(f(),pe){var ye=n.currentYear!==de.getFullYear();n.currentYear=de.getFullYear(),n.currentMonth=de.getMonth(),ye&&(fe("onYearChange"),D()),fe("onMonthChange")}if(ft(),M(),Ct(),!pe&&n.config.mode!=="range"&&n.config.showMonths===1?O(ne):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 ke=n.config.mode==="single"&&!n.config.enableTime,ge=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(ke||ge)&&Ee()}v()}}var Ce={locale:[te,$],showMonths:[N,l,z],minDate:[w],maxDate:[w],positionElement:[el],clickOpens:[function(){n.config.clickOpens===!0?(g(n._input,"focus",n.open),g(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function mt(V,G){if(V!==null&&typeof V=="object"){Object.assign(n.config,V);for(var X in V)Ce[X]!==void 0&&Ce[X].forEach(function(ne){return ne()})}else n.config[V]=G,Ce[V]!==void 0?Ce[V].forEach(function(ne){return ne()}):kc.indexOf(V)>-1&&(n.config[V]=Dc(G));n.redraw(),Ct(!0)}function Et(V,G){var X=[];if(V instanceof Array)X=V.map(function(ne){return n.parseDate(ne,G)});else if(V instanceof Date||typeof V=="number")X=[n.parseDate(V,G)];else if(typeof V=="string")switch(n.config.mode){case"single":case"time":X=[n.parseDate(V,G)];break;case"multiple":X=V.split(n.config.conjunction).map(function(ne){return n.parseDate(ne,G)});break;case"range":X=V.split(n.l10n.rangeSeparator).map(function(ne){return n.parseDate(ne,G)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(V)));n.selectedDates=n.config.allowInvalidPreload?X:X.filter(function(ne){return ne instanceof Date&&Y(ne,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(ne,de){return ne.getTime()-de.getTime()})}function We(V,G,X){if(G===void 0&&(G=!1),X===void 0&&(X=n.config.dateFormat),V!==0&&!V||V instanceof Array&&V.length===0)return n.clear(G);Et(V,X),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),w(void 0,G),p(),n.selectedDates.length===0&&n.clear(!1),Ct(G),G&&fe("onChange")}function Ti(V){return V.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?n.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:n.parseDate(G.from,void 0),to:n.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function et(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var V=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);V&&Et(V,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 nn(){if(n.input=qe(),!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=je(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"),el()}function el(){n._positionElement=n.config.positionElement||n._input}function fd(){var V=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=je("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=V,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=V==="datetime-local"?"Y-m-d\\TH:i:S":V==="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(G){}g(n.mobileInput,"change",function(G){n.setDate(Vt(G).value,!1,n.mobileFormatStr),fe("onChange"),fe("onClose")})}function ae(V){if(n.isOpen===!0)return n.close();n.open(V)}function fe(V,G){if(n.config!==void 0){var X=n.config[V];if(X!==void 0&&X.length>0)for(var ne=0;X[ne]&&ne<X.length;ne++)X[ne](n.selectedDates,n.input.value,n,G);V==="onChange"&&(n.input.dispatchEvent(Ie("change")),n.input.dispatchEvent(Ie("input")))}}function Ie(V){var G=document.createEvent("Event");return G.initEvent(V,!0,!0),G}function Le(V){for(var G=0;G<n.selectedDates.length;G++){var X=n.selectedDates[G];if(X instanceof Date&&qt(X,V)===0)return""+G}return!1}function De(V){return n.config.mode!=="range"||n.selectedDates.length<2?!1:qt(V,n.selectedDates[0])>=0&&qt(V,n.selectedDates[1])<=0}function ft(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(V,G){var X=new Date(n.currentYear,n.currentMonth,1);X.setMonth(n.currentMonth+G),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[G].textContent=qs(X.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=X.getMonth().toString(),V.value=X.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 Ot(V){var G=V||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(X){return n.formatDate(X,G)}).filter(function(X,ne,de){return n.config.mode!=="range"||n.config.enableTime||de.indexOf(X)===ne}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function Ct(V){V===void 0&&(V=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=Ot(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=Ot(n.config.altFormat)),V!==!1&&fe("onValueUpdate")}function tl(V){var G=Vt(V),X=n.prevMonthNav.contains(G),ne=n.nextMonthNav.contains(G);X||ne?T(X?-1:1):n.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):G.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function Qn(V){V.preventDefault();var G=V.type==="keydown",X=Vt(V),ne=X;n.amPM!==void 0&&X===n.amPM&&(n.amPM.textContent=n.l10n.amPM[Xt(n.amPM.textContent===n.l10n.amPM[0])]);var de=parseFloat(ne.getAttribute("min")),pe=parseFloat(ne.getAttribute("max")),Re=parseFloat(ne.getAttribute("step")),ye=parseInt(ne.value,10),ke=V.delta||(G?V.which===38?1:-1:0),ge=ye+Re*ke;if(typeof ne.value!="undefined"&&ne.value.length===2){var Te=ne===n.hourElement,Ke=ne===n.minuteElement;ge<de?(ge=pe+ge+Xt(!Te)+(Xt(Te)&&Xt(!n.amPM)),Ke&&m(void 0,-1,n.hourElement)):ge>pe&&(ge=ne===n.hourElement?ge-pe-Xt(!n.amPM):de,Ke&&m(void 0,1,n.hourElement)),n.amPM&&Te&&(Re===1?ge+ye===23:Math.abs(ge-ye)>Re)&&(n.amPM.textContent=n.l10n.amPM[Xt(n.amPM.textContent===n.l10n.amPM[0])]),ne.value=Ft(ge)}}return i(),n}function bi(t,e){for(var n=Array.prototype.slice.call(t).filter(function(s){return s 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=yU(o,e||{}),r.push(o._flatpickr)}catch(s){console.error(s)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return bi(this,t)},HTMLElement.prototype.flatpickr=function(t){return bi([this],t)});var dt=function(t,e){return typeof t=="string"?bi(window.document.querySelectorAll(t),e):t instanceof Node?bi([t],e):bi(t,e)};dt.defaultConfig={},dt.l10ns={en:At({},Ta),default:At({},Ta)},dt.localize=function(t){dt.l10ns.default=At(At({},dt.l10ns.default),t)},dt.setDefaults=function(t){dt.defaultConfig=At(At({},dt.defaultConfig),t)},dt.parseDate=Nc({}),dt.formatDate=sy({}),dt.compareDates=qt,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(t){return bi(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window!="undefined"&&(window.flatpickr=dt);const wU=md(Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"})));(function(t){function e(T){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(k){return typeof k}:e=function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},e(T)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(pn.default),r=o(ny.exports),i=o(wU);function o(T){return T&&T.__esModule?T:{default:T}}function s(){if(typeof WeakMap!="function")return null;var T=new WeakMap;return s=function(){return T},T}function l(T){if(T&&T.__esModule)return T;if(T===null||e(T)!=="object"&&typeof T!="function")return{default:T};var x=s();if(x&&x.has(T))return x.get(T);var k={},B=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in T)if(Object.prototype.hasOwnProperty.call(T,W)){var j=B?Object.getOwnPropertyDescriptor(T,W):null;j&&(j.get||j.set)?Object.defineProperty(k,W,j):k[W]=T[W]}return k.default=T,x&&x.set(T,k),k}function u(T){return p(T)||f(T)||d(T)||c()}function c(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2335
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(T,x){if(!!T){if(typeof T=="string")return h(T,x);var k=Object.prototype.toString.call(T).slice(8,-1);if(k==="Object"&&T.constructor&&(k=T.constructor.name),k==="Map"||k==="Set")return Array.from(T);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return h(T,x)}}function f(T){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(T))return Array.from(T)}function p(T){if(Array.isArray(T))return h(T)}function h(T,x){(x==null||x>T.length)&&(x=T.length);for(var k=0,B=new Array(x);k<x;k++)B[k]=T[k];return B}function y(){return y=Object.assign||function(T){for(var x=1;x<arguments.length;x++){var k=arguments[x];for(var B in k)Object.prototype.hasOwnProperty.call(k,B)&&(T[B]=k[B])}return T},y.apply(this,arguments)}function g(T,x){if(T==null)return{};var k=v(T,x),B,W;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(T);for(W=0;W<j.length;W++)B=j[W],!(x.indexOf(B)>=0)&&(!Object.prototype.propertyIsEnumerable.call(T,B)||(k[B]=T[B]))}return k}function v(T,x){if(T==null)return{};var k={},B=Object.keys(T),W,j;for(j=0;j<B.length;j++)W=B[j],!(x.indexOf(W)>=0)&&(k[W]=T[W]);return k}function b(T,x){var k=Object.keys(T);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(T);x&&(B=B.filter(function(W){return Object.getOwnPropertyDescriptor(T,W).enumerable})),k.push.apply(k,B)}return k}function w(T){for(var x=1;x<arguments.length;x++){var k=arguments[x]!=null?arguments[x]:{};x%2?b(Object(k),!0).forEach(function(B){D(T,B,k[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(k)):b(Object(k)).forEach(function(B){Object.defineProperty(T,B,Object.getOwnPropertyDescriptor(k,B))})}return T}function E(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function m(T,x){for(var k=0;k<x.length;k++){var B=x[k];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(T,B.key,B)}}function A(T,x,k){return x&&m(T.prototype,x),k&&m(T,k),T}function I(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),x&&O(T,x)}function O(T,x){return O=Object.setPrototypeOf||function(B,W){return B.__proto__=W,B},O(T,x)}function C(T){var x=S();return function(){var B=M(T),W;if(x){var j=M(this).constructor;W=Reflect.construct(B,arguments,j)}else W=B.apply(this,arguments);return R(this,W)}}function R(T,x){return x&&(e(x)==="object"||typeof x=="function")?x:P(T)}function P(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(){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(T){return!1}}function M(T){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},M(T)}function D(T,x,k){return x in T?Object.defineProperty(T,x,{value:k,enumerable:!0,configurable:!0,writable:!0}):T[x]=k,T}var L=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],N=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),H=["onCreate","onDestroy"],q=r.default.func,z=function(T){I(k,T);var x=C(k);function k(){var B;E(this,k);for(var W=arguments.length,j=new Array(W),Q=0;Q<W;Q++)j[Q]=arguments[Q];return B=x.call.apply(x,[this].concat(j)),D(P(B),"createFlatpickrInstance",function(){var Y=w({onClose:function(){B.node.blur&&B.node.blur()}},B.props.options);Y=$(Y,B.props),B.flatpickr=(0,i.default)(B.node,Y),B.props.hasOwnProperty("value")&&B.flatpickr.setDate(B.props.value,!1);var Z=B.props.onCreate;Z&&Z(B.flatpickr)}),D(P(B),"destroyFlatpickrInstance",function(){var Y=B.props.onDestroy;Y&&Y(B.flatpickr),B.flatpickr.destroy(),B.flatpickr=null}),D(P(B),"handleNodeChange",function(Y){B.node=Y,B.flatpickr&&(B.destroyFlatpickrInstance(),B.createFlatpickrInstance())}),B}return A(k,[{key:"componentDidUpdate",value:function(W){var j=this.props.options,Q=W.options;j=$(j,this.props),Q=$(Q,W);for(var Y=Object.getOwnPropertyNames(j),Z=Y.length-1;Z>=0;Z--){var ee=Y[Z],le=j[ee];le!==Q[ee]&&(L.indexOf(ee)!==-1&&!Array.isArray(le)&&(le=[le]),this.flatpickr.set(ee,le))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&W.value&&Array.isArray(W.value)&&this.props.value.every(function(me,ve){W[ve]}))&&this.props.value!==W.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 W=this.props,j=W.options,Q=W.defaultValue,Y=W.value,Z=W.children,ee=W.render,le=g(W,["options","defaultValue","value","children","render"]);return L.forEach(function(me){delete le[me]}),H.forEach(function(me){delete le[me]}),ee?ee(w(w({},le),{},{defaultValue:Q,value:Y}),this.handleNodeChange):j.wrap?n.default.createElement("div",y({},le,{ref:this.handleNodeChange}),Z):n.default.createElement("input",y({},le,{defaultValue:Q,ref:this.handleNodeChange}))}}]),k}(n.Component);D(z,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:N,onOpen:N,onClose:N,onMonthChange:N,onYearChange:N,onReady:N,onValueUpdate:N,onDayCreate:N,onCreate:q,onDestroy:q,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}),D(z,"defaultProps",{options:{}});function $(T,x){var k=w({},T);return L.forEach(function(B){if(x.hasOwnProperty(B)){var W;k[B]&&!Array.isArray(k[B])?k[B]=[k[B]]:k[B]||(k[B]=[]);var j=Array.isArray(x[B])?x[B]:[x[B]];(W=k[B]).push.apply(W,u(j))}}),k}var F=z;t.default=F})(ty);const bU=jw(ty);var Nt="top",Zt="bottom",en="right",Lt="left",Uc="auto",Pa=[Nt,Zt,en,Lt],_i="start",Ma="end",_U="clippingParents",uy="viewport",xa="popper",EU="reference",cy=Pa.reduce(function(t,e){return t.concat([e+"-"+_i,e+"-"+Ma])},[]),dy=[].concat(Pa,[Uc]).reduce(function(t,e){return t.concat([e,e+"-"+_i,e+"-"+Ma])},[]),IU="beforeRead",AU="read",OU="afterRead",CU="beforeMain",TU="main",SU="afterMain",PU="beforeWrite",MU="write",xU="afterWrite",RU=[IU,AU,OU,CU,TU,SU,PU,MU,xU];function Mn(t){return t?(t.nodeName||"").toLowerCase():null}function Wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Dr(t){var e=Wt(t).Element;return t instanceof e||t instanceof Element}function tn(t){var e=Wt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $c(t){if(typeof ShadowRoot=="undefined")return!1;var e=Wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kU(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!tn(o)||!Mn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function DU(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,c){return u[c]="",u},{});!tn(i)||!Mn(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const fy={name:"applyStyles",enabled:!0,phase:"write",fn:kU,effect:DU,requires:["computeStyles"]};function xn(t){return t.split("-")[0]}var Fr=Math.max,Ws=Math.min,Ei=Math.round;function jc(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hy(){return!/^((?!chrome|android).)*safari/i.test(jc())}function Ii(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&tn(t)&&(i=t.offsetWidth>0&&Ei(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Ei(r.height)/t.offsetHeight||1);var s=Dr(t)?Wt(t):window,l=s.visualViewport,u=!hy()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:d,right:c+f,bottom:d+p,left:c,x:c,y:d}}function Hc(t){var e=Ii(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function py(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&$c(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Gn(t){return Wt(t).getComputedStyle(t)}function FU(t){return["table","td","th"].indexOf(Mn(t))>=0}function dr(t){return((Dr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gs(t){return Mn(t)==="html"?t:t.assignedSlot||t.parentNode||($c(t)?t.host:null)||dr(t)}function my(t){return!tn(t)||Gn(t).position==="fixed"?null:t.offsetParent}function NU(t){var e=/firefox/i.test(jc()),n=/Trident/i.test(jc());if(n&&tn(t)){var r=Gn(t);if(r.position==="fixed")return null}var i=Gs(t);for($c(i)&&(i=i.host);tn(i)&&["html","body"].indexOf(Mn(i))<0;){var o=Gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ra(t){for(var e=Wt(t),n=my(t);n&&FU(n)&&Gn(n).position==="static";)n=my(n);return n&&(Mn(n)==="html"||Mn(n)==="body"&&Gn(n).position==="static")?e:n||NU(t)||e}function Vc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ka(t,e,n){return Fr(t,Ws(e,n))}function LU(t,e,n){var r=ka(t,e,n);return r>n?n:r}function gy(){return{top:0,right:0,bottom:0,left:0}}function vy(t){return Object.assign({},gy(),t)}function yy(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var BU=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,vy(typeof e!="number"?e:yy(e,Pa))};function UU(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=xn(n.placement),u=Vc(l),c=[Lt,en].indexOf(l)>=0,d=c?"height":"width";if(!(!o||!s)){var f=BU(i.padding,n),p=Hc(o),h=u==="y"?Nt:Lt,y=u==="y"?Zt:en,g=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],v=s[u]-n.rects.reference[u],b=Ra(o),w=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-v/2,m=f[h],A=w-p[d]-f[y],I=w/2-p[d]/2+E,O=ka(m,I,A),C=u;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-I,e)}}function $U(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!py(e.elements.popper,i)||(e.elements.arrow=i))}const jU={name:"arrow",enabled:!0,phase:"main",fn:UU,effect:$U,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ai(t){return t.split("-")[1]}var HU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function VU(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Ei(n*i)/i||0,y:Ei(r*i)/i||0}}function wy(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,h=p===void 0?0:p,y=s.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var b=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),E=Lt,m=Nt,A=window;if(c){var I=Ra(n),O="clientHeight",C="clientWidth";if(I===Wt(n)&&(I=dr(n),Gn(I).position!=="static"&&l==="absolute"&&(O="scrollHeight",C="scrollWidth")),I=I,i===Nt||(i===Lt||i===en)&&o===Ma){m=Zt;var R=f&&I===A&&A.visualViewport?A.visualViewport.height:I[O];g-=R-r.height,g*=u?1:-1}if(i===Lt||(i===Nt||i===Zt)&&o===Ma){E=en;var P=f&&I===A&&A.visualViewport?A.visualViewport.width:I[C];h-=P-r.width,h*=u?1:-1}}var S=Object.assign({position:l},c&&HU),M=d===!0?VU({x:h,y:g},Wt(n)):{x:h,y:g};if(h=M.x,g=M.y,u){var D;return Object.assign({},S,(D={},D[m]=w?"0":"",D[E]=b?"0":"",D.transform=(A.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",D))}return Object.assign({},S,(e={},e[m]=w?g+"px":"",e[E]=b?h+"px":"",e.transform="",e))}function qU(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:xn(e.placement),variation:Ai(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,wy(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,wy(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const WU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qU,data:{}};var zs={passive:!0};function GU(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=Wt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(d){d.addEventListener("scroll",n.update,zs)}),l&&u.addEventListener("resize",n.update,zs),function(){o&&c.forEach(function(d){d.removeEventListener("scroll",n.update,zs)}),l&&u.removeEventListener("resize",n.update,zs)}}const zU={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GU,data:{}};var QU={left:"right",right:"left",bottom:"top",top:"bottom"};function Qs(t){return t.replace(/left|right|bottom|top/g,function(e){return QU[e]})}var YU={start:"end",end:"start"};function by(t){return t.replace(/start|end/g,function(e){return YU[e]})}function qc(t){var e=Wt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Wc(t){return Ii(dr(t)).left+qc(t).scrollLeft}function KU(t,e){var n=Wt(t),r=dr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var c=hy();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+Wc(t),y:u}}function JU(t){var e,n=dr(t),r=qc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Fr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Fr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Wc(t),u=-r.scrollTop;return Gn(i||n).direction==="rtl"&&(l+=Fr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function Gc(t){var e=Gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function _y(t){return["html","body","#document"].indexOf(Mn(t))>=0?t.ownerDocument.body:tn(t)&&Gc(t)?t:_y(Gs(t))}function Da(t,e){var n;e===void 0&&(e=[]);var r=_y(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Wt(r),s=i?[o].concat(o.visualViewport||[],Gc(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Da(Gs(s)))}function zc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function XU(t,e){var n=Ii(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ey(t,e,n){return e===uy?zc(KU(t,n)):Dr(e)?XU(e,n):zc(JU(dr(t)))}function ZU(t){var e=Da(Gs(t)),n=["absolute","fixed"].indexOf(Gn(t).position)>=0,r=n&&tn(t)?Ra(t):t;return Dr(r)?e.filter(function(i){return Dr(i)&&py(i,r)&&Mn(i)!=="body"}):[]}function e5(t,e,n,r){var i=e==="clippingParents"?ZU(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,c){var d=Ey(t,c,r);return u.top=Fr(d.top,u.top),u.right=Ws(d.right,u.right),u.bottom=Ws(d.bottom,u.bottom),u.left=Fr(d.left,u.left),u},Ey(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Iy(t){var e=t.reference,n=t.element,r=t.placement,i=r?xn(r):null,o=r?Ai(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Nt:u={x:s,y:e.y-n.height};break;case Zt:u={x:s,y:e.y+e.height};break;case en:u={x:e.x+e.width,y:l};break;case Lt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?Vc(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case _i:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Ma:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function Fa(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?_U:l,c=n.rootBoundary,d=c===void 0?uy:c,f=n.elementContext,p=f===void 0?xa:f,h=n.altBoundary,y=h===void 0?!1:h,g=n.padding,v=g===void 0?0:g,b=vy(typeof v!="number"?v:yy(v,Pa)),w=p===xa?EU:xa,E=t.rects.popper,m=t.elements[y?w:p],A=e5(Dr(m)?m:m.contextElement||dr(t.elements.popper),u,d,s),I=Ii(t.elements.reference),O=Iy({reference:I,element:E,strategy:"absolute",placement:i}),C=zc(Object.assign({},E,O)),R=p===xa?C:I,P={top:A.top-R.top+b.top,bottom:R.bottom-A.bottom+b.bottom,left:A.left-R.left+b.left,right:R.right-A.right+b.right},S=t.modifiersData.offset;if(p===xa&&S){var M=S[i];Object.keys(P).forEach(function(D){var L=[en,Zt].indexOf(D)>=0?1:-1,N=[Nt,Zt].indexOf(D)>=0?"y":"x";P[D]+=M[N]*L})}return P}function t5(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?dy:u,d=Ai(r),f=d?l?cy:cy.filter(function(y){return Ai(y)===d}):Pa,p=f.filter(function(y){return c.indexOf(y)>=0});p.length===0&&(p=f);var h=p.reduce(function(y,g){return y[g]=Fa(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[xn(g)],y},{});return Object.keys(h).sort(function(y,g){return h[y]-h[g]})}function n5(t){if(xn(t)===Uc)return[];var e=Qs(t);return[by(t),e,by(e)]}function r5(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,y=h===void 0?!0:h,g=n.allowedAutoPlacements,v=e.options.placement,b=xn(v),w=b===v,E=u||(w||!y?[Qs(v)]:n5(v)),m=[v].concat(E).reduce(function(B,W){return B.concat(xn(W)===Uc?t5(e,{placement:W,boundary:d,rootBoundary:f,padding:c,flipVariations:y,allowedAutoPlacements:g}):W)},[]),A=e.rects.reference,I=e.rects.popper,O=new Map,C=!0,R=m[0],P=0;P<m.length;P++){var S=m[P],M=xn(S),D=Ai(S)===_i,L=[Nt,Zt].indexOf(M)>=0,N=L?"width":"height",H=Fa(e,{placement:S,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),q=L?D?en:Lt:D?Zt:Nt;A[N]>I[N]&&(q=Qs(q));var z=Qs(q),$=[];if(o&&$.push(H[M]<=0),l&&$.push(H[q]<=0,H[z]<=0),$.every(function(B){return B})){R=S,C=!1;break}O.set(S,$)}if(C)for(var F=y?3:1,T=function(W){var j=m.find(function(Q){var Y=O.get(Q);if(Y)return Y.slice(0,W).every(function(Z){return Z})});if(j)return R=j,"break"},x=F;x>0;x--){var k=T(x);if(k==="break")break}e.placement!==R&&(e.modifiersData[r]._skip=!0,e.placement=R,e.reset=!0)}}const i5={name:"flip",enabled:!0,phase:"main",fn:r5,requiresIfExists:["offset"],data:{_skip:!1}};function Ay(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Oy(t){return[Nt,en,Zt,Lt].some(function(e){return t[e]>=0})}function a5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Fa(e,{elementContext:"reference"}),l=Fa(e,{altBoundary:!0}),u=Ay(s,r),c=Ay(l,i,o),d=Oy(u),f=Oy(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const o5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:a5};function s5(t,e,n){var r=xn(t),i=[Lt,Nt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Lt,en].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function l5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=dy.reduce(function(d,f){return d[f]=s5(f,e.rects,o),d},{}),l=s[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const u5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:l5};function c5(t){var e=t.state,n=t.name;e.modifiersData[n]=Iy({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const d5={name:"popperOffsets",enabled:!0,phase:"read",fn:c5,data:{}};function f5(t){return t==="x"?"y":"x"}function h5(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,y=n.tetherOffset,g=y===void 0?0:y,v=Fa(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=xn(e.placement),w=Ai(e.placement),E=!w,m=Vc(b),A=f5(m),I=e.modifiersData.popperOffsets,O=e.rects.reference,C=e.rects.popper,R=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(!!I){if(o){var D,L=m==="y"?Nt:Lt,N=m==="y"?Zt:en,H=m==="y"?"height":"width",q=I[m],z=q+v[L],$=q-v[N],F=h?-C[H]/2:0,T=w===_i?O[H]:C[H],x=w===_i?-C[H]:-O[H],k=e.elements.arrow,B=h&&k?Hc(k):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:gy(),j=W[L],Q=W[N],Y=ka(0,O[H],B[H]),Z=E?O[H]/2-F-Y-j-P.mainAxis:T-Y-j-P.mainAxis,ee=E?-O[H]/2+F+Y+Q+P.mainAxis:x+Y+Q+P.mainAxis,le=e.elements.arrow&&Ra(e.elements.arrow),me=le?m==="y"?le.clientTop||0:le.clientLeft||0:0,ve=(D=S==null?void 0:S[m])!=null?D:0,Ae=q+Z-ve-me,Me=q+ee-ve,Ze=ka(h?Ws(z,Ae):z,q,h?Fr($,Me):$);I[m]=Ze,M[m]=Ze-q}if(l){var qe,te=m==="x"?Nt:Lt,re=m==="x"?Zt:en,ue=I[A],he=A==="y"?"height":"width",se=ue+v[te],Ee=ue-v[re],Oe=[Nt,Lt].indexOf(b)!==-1,Ce=(qe=S==null?void 0:S[A])!=null?qe:0,mt=Oe?se:ue-O[he]-C[he]-Ce+P.altAxis,Et=Oe?ue+O[he]+C[he]-Ce-P.altAxis:Ee,We=h&&Oe?LU(mt,ue,Et):ka(h?mt:se,ue,h?Et:Ee);I[A]=We,M[A]=We-ue}e.modifiersData[r]=M}}const p5={name:"preventOverflow",enabled:!0,phase:"main",fn:h5,requiresIfExists:["offset"]};function m5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function g5(t){return t===Wt(t)||!tn(t)?qc(t):m5(t)}function v5(t){var e=t.getBoundingClientRect(),n=Ei(e.width)/t.offsetWidth||1,r=Ei(e.height)/t.offsetHeight||1;return n!==1||r!==1}function y5(t,e,n){n===void 0&&(n=!1);var r=tn(e),i=tn(e)&&v5(e),o=dr(e),s=Ii(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Mn(e)!=="body"||Gc(o))&&(l=g5(e)),tn(e)?(u=Ii(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=Wc(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function w5(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function b5(t){var e=w5(t);return RU.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function _5(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function E5(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Cy={placement:"bottom",modifiers:[],strategy:"absolute"};function Ty(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function I5(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Cy:i;return function(l,u,c){c===void 0&&(c=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cy,o),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],p=!1,h={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;g(),d.options=Object.assign({},o,d.options,w),d.scrollParents={reference:Dr(l)?Da(l):l.contextElement?Da(l.contextElement):[],popper:Da(u)};var E=b5(E5([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(m){return m.enabled}),y(),h.update()},forceUpdate:function(){if(!p){var b=d.elements,w=b.reference,E=b.popper;if(!!Ty(w,E)){d.rects={reference:y5(w,Ra(E),d.options.strategy==="fixed"),popper:Hc(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var A=d.orderedModifiers[m],I=A.fn,O=A.options,C=O===void 0?{}:O,R=A.name;typeof I=="function"&&(d=I({state:d,options:C,name:R,instance:h})||d)}}}},update:_5(function(){return new Promise(function(v){h.forceUpdate(),v(d)})}),destroy:function(){g(),p=!0}};if(!Ty(l,u))return h;h.setOptions(c).then(function(v){!p&&c.onFirstUpdate&&c.onFirstUpdate(v)});function y(){d.orderedModifiers.forEach(function(v){var b=v.name,w=v.options,E=w===void 0?{}:w,m=v.effect;if(typeof m=="function"){var A=m({state:d,name:b,instance:h,options:E}),I=function(){};f.push(A||I)}})}function g(){f.forEach(function(v){return v()}),f=[]}return h}}var A5=[zU,d5,WU,fy,u5,i5,p5,jU,o5],O5=I5({defaultModifiers:A5}),C5="tippy-box",Sy="tippy-content",T5="tippy-backdrop",Py="tippy-arrow",My="tippy-svg-arrow",Nr={passive:!0,capture:!0},xy=function(){return document.body};function Qc(t,e,n){if(Array.isArray(t)){var r=t[e];return r==null?Array.isArray(n)?n[e]:n:r}return t}function Yc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ry(t,e){return typeof t=="function"?t.apply(void 0,e):t}function ky(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function S5(t){return t.split(/\s+/).filter(Boolean)}function Oi(t){return[].concat(t)}function Dy(t,e){t.indexOf(e)===-1&&t.push(e)}function P5(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function M5(t){return t.split("-")[0]}function Ys(t){return[].slice.call(t)}function Fy(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Na(){return document.createElement("div")}function Ks(t){return["Element","Fragment"].some(function(e){return Yc(t,e)})}function x5(t){return Yc(t,"NodeList")}function R5(t){return Yc(t,"MouseEvent")}function k5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function D5(t){return Ks(t)?[t]:x5(t)?Ys(t):Array.isArray(t)?t:Ys(document.querySelectorAll(t))}function Kc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Ny(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function F5(t){var e,n=Oi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function N5(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,c=M5(s.placement),d=s.modifiersData.offset;if(!d)return!0;var f=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,y=c==="left"?d.right.x:0,g=o.top-r+f>u,v=r-o.bottom-p>u,b=o.left-n+h>u,w=n-o.right-y>u;return g||v||b||w})}function Jc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ly(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Rn={isTouch:!1},By=0;function L5(){Rn.isTouch||(Rn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Uy))}function Uy(){var t=performance.now();t-By<20&&(Rn.isTouch=!1,document.removeEventListener("mousemove",Uy)),By=t}function B5(){var t=document.activeElement;if(k5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function U5(){document.addEventListener("touchstart",L5,Nr),window.addEventListener("blur",B5)}var $5=typeof window!="undefined"&&typeof document!="undefined",j5=$5?!!window.msCrypto:!1,H5={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},V5={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},hn=Object.assign({appendTo:xy,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},H5,V5),q5=Object.keys(hn),W5=function(e){var n=Object.keys(e);n.forEach(function(r){hn[r]=e[r]})};function $y(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=hn[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function G5(t,e){var n=e?Object.keys($y(Object.assign({},hn,{plugins:e}))):q5,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch(l){i[o]=s}return i},{});return r}function jy(t,e){var n=Object.assign({},e,{content:Ry(e.content,[t])},e.ignoreAttributes?{}:G5(t,e.plugins));return n.aria=Object.assign({},hn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var z5=function(){return"innerHTML"};function Xc(t,e){t[z5()]=e}function Hy(t){var e=Na();return t===!0?e.className=Py:(e.className=My,Ks(t)?e.appendChild(t):Xc(e,t)),e}function Vy(t,e){Ks(e.content)?(Xc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Xc(t,e.content):t.textContent=e.content)}function Zc(t){var e=t.firstElementChild,n=Ys(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Sy)}),arrow:n.find(function(r){return r.classList.contains(Py)||r.classList.contains(My)}),backdrop:n.find(function(r){return r.classList.contains(T5)})}}function qy(t){var e=Na(),n=Na();n.className=C5,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Na();r.className=Sy,r.setAttribute("data-state","hidden"),Vy(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Zc(e),u=l.box,c=l.content,d=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vy(c,t.props),s.arrow?d?o.arrow!==s.arrow&&(u.removeChild(d),u.appendChild(Hy(s.arrow))):u.appendChild(Hy(s.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}qy.$$tippy=!0;var Q5=1,Js=[],ed=[];function Y5(t,e){var n=jy(t,Object.assign({},hn,$y(Fy(e)))),r,i,o,s=!1,l=!1,u=!1,c=!1,d,f,p,h=[],y=ky(Ae,n.interactiveDebounce),g,v=Q5++,b=null,w=P5(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:v,reference:t,popper:Na(),popperInstance:b,props:n,state:E,plugins:w,clearDelayTimeouts:mt,setProps:Et,setContent:We,show:Ti,hide:et,hideWithInteractivity:nn,enable:Oe,disable:Ce,unmount:el,destroy:fd};if(!n.render)return m;var A=n.render(m),I=A.popper,O=A.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+m.id,m.popper=I,t._tippy=m,I._tippy=m;var C=w.map(function(ae){return ae.fn(m)}),R=t.hasAttribute("aria-expanded");return le(),F(),q(),z("onCreate",[m]),n.showOnCreate&&se(),I.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",y)}),m;function P(){var ae=m.props.touch;return Array.isArray(ae)?ae:[ae,0]}function S(){return P()[0]==="hold"}function M(){var ae;return!!((ae=m.props.render)!=null&&ae.$$tippy)}function D(){return g||t}function L(){var ae=D().parentNode;return ae?F5(ae):document}function N(){return Zc(I)}function H(ae){return m.state.isMounted&&!m.state.isVisible||Rn.isTouch||d&&d.type==="focus"?0:Qc(m.props.delay,ae?0:1,hn.delay)}function q(ae){ae===void 0&&(ae=!1),I.style.pointerEvents=m.props.interactive&&!ae?"":"none",I.style.zIndex=""+m.props.zIndex}function z(ae,fe,Ie){if(Ie===void 0&&(Ie=!0),C.forEach(function(De){De[ae]&&De[ae].apply(De,fe)}),Ie){var Le;(Le=m.props)[ae].apply(Le,fe)}}function $(){var ae=m.props.aria;if(!!ae.content){var fe="aria-"+ae.content,Ie=I.id,Le=Oi(m.props.triggerTarget||t);Le.forEach(function(De){var ft=De.getAttribute(fe);if(m.state.isVisible)De.setAttribute(fe,ft?ft+" "+Ie:Ie);else{var Ot=ft&&ft.replace(Ie,"").trim();Ot?De.setAttribute(fe,Ot):De.removeAttribute(fe)}})}}function F(){if(!(R||!m.props.aria.expanded)){var ae=Oi(m.props.triggerTarget||t);ae.forEach(function(fe){m.props.interactive?fe.setAttribute("aria-expanded",m.state.isVisible&&fe===D()?"true":"false"):fe.removeAttribute("aria-expanded")})}}function T(){L().removeEventListener("mousemove",y),Js=Js.filter(function(ae){return ae!==y})}function x(ae){if(!(Rn.isTouch&&(u||ae.type==="mousedown"))){var fe=ae.composedPath&&ae.composedPath()[0]||ae.target;if(!(m.props.interactive&&Ly(I,fe))){if(Oi(m.props.triggerTarget||t).some(function(Ie){return Ly(Ie,fe)})){if(Rn.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else z("onClickOutside",[m,ae]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),l=!0,setTimeout(function(){l=!1}),m.state.isMounted||j())}}}function k(){u=!0}function B(){u=!1}function W(){var ae=L();ae.addEventListener("mousedown",x,!0),ae.addEventListener("touchend",x,Nr),ae.addEventListener("touchstart",B,Nr),ae.addEventListener("touchmove",k,Nr)}function j(){var ae=L();ae.removeEventListener("mousedown",x,!0),ae.removeEventListener("touchend",x,Nr),ae.removeEventListener("touchstart",B,Nr),ae.removeEventListener("touchmove",k,Nr)}function Q(ae,fe){Z(ae,function(){!m.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&fe()})}function Y(ae,fe){Z(ae,fe)}function Z(ae,fe){var Ie=N().box;function Le(De){De.target===Ie&&(Jc(Ie,"remove",Le),fe())}if(ae===0)return fe();Jc(Ie,"remove",f),Jc(Ie,"add",Le),f=Le}function ee(ae,fe,Ie){Ie===void 0&&(Ie=!1);var Le=Oi(m.props.triggerTarget||t);Le.forEach(function(De){De.addEventListener(ae,fe,Ie),h.push({node:De,eventType:ae,handler:fe,options:Ie})})}function le(){S()&&(ee("touchstart",ve,{passive:!0}),ee("touchend",Me,{passive:!0})),S5(m.props.trigger).forEach(function(ae){if(ae!=="manual")switch(ee(ae,ve),ae){case"mouseenter":ee("mouseleave",Me);break;case"focus":ee(j5?"focusout":"blur",Ze);break;case"focusin":ee("focusout",Ze);break}})}function me(){h.forEach(function(ae){var fe=ae.node,Ie=ae.eventType,Le=ae.handler,De=ae.options;fe.removeEventListener(Ie,Le,De)}),h=[]}function ve(ae){var fe,Ie=!1;if(!(!m.state.isEnabled||qe(ae)||l)){var Le=((fe=d)==null?void 0:fe.type)==="focus";d=ae,g=ae.currentTarget,F(),!m.state.isVisible&&R5(ae)&&Js.forEach(function(De){return De(ae)}),ae.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?Ie=!0:se(ae),ae.type==="click"&&(s=!Ie),Ie&&!Le&&Ee(ae)}}function Ae(ae){var fe=ae.target,Ie=D().contains(fe)||I.contains(fe);if(!(ae.type==="mousemove"&&Ie)){var Le=he().concat(I).map(function(De){var ft,Ot=De._tippy,Ct=(ft=Ot.popperInstance)==null?void 0:ft.state;return Ct?{popperRect:De.getBoundingClientRect(),popperState:Ct,props:n}:null}).filter(Boolean);N5(Le,ae)&&(T(),Ee(ae))}}function Me(ae){var fe=qe(ae)||m.props.trigger.indexOf("click")>=0&&s;if(!fe){if(m.props.interactive){m.hideWithInteractivity(ae);return}Ee(ae)}}function Ze(ae){m.props.trigger.indexOf("focusin")<0&&ae.target!==D()||m.props.interactive&&ae.relatedTarget&&I.contains(ae.relatedTarget)||Ee(ae)}function qe(ae){return Rn.isTouch?S()!==ae.type.indexOf("touch")>=0:!1}function te(){re();var ae=m.props,fe=ae.popperOptions,Ie=ae.placement,Le=ae.offset,De=ae.getReferenceClientRect,ft=ae.moveTransition,Ot=M()?Zc(I).arrow:null,Ct=De?{getBoundingClientRect:De,contextElement:De.contextElement||D()}:t,tl={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(G){var X=G.state;if(M()){var ne=N(),de=ne.box;["placement","reference-hidden","escaped"].forEach(function(pe){pe==="placement"?de.setAttribute("data-placement",X.placement):X.attributes.popper["data-popper-"+pe]?de.setAttribute("data-"+pe,""):de.removeAttribute("data-"+pe)}),X.attributes.popper={}}}},Qn=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ft}},tl];M()&&Ot&&Qn.push({name:"arrow",options:{element:Ot,padding:3}}),Qn.push.apply(Qn,(fe==null?void 0:fe.modifiers)||[]),m.popperInstance=O5(Ct,I,Object.assign({},fe,{placement:Ie,onFirstUpdate:p,modifiers:Qn}))}function re(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function ue(){var ae=m.props.appendTo,fe,Ie=D();m.props.interactive&&ae===xy||ae==="parent"?fe=Ie.parentNode:fe=Ry(ae,[Ie]),fe.contains(I)||fe.appendChild(I),m.state.isMounted=!0,te()}function he(){return Ys(I.querySelectorAll("[data-tippy-root]"))}function se(ae){m.clearDelayTimeouts(),ae&&z("onTrigger",[m,ae]),W();var fe=H(!0),Ie=P(),Le=Ie[0],De=Ie[1];Rn.isTouch&&Le==="hold"&&De&&(fe=De),fe?r=setTimeout(function(){m.show()},fe):m.show()}function Ee(ae){if(m.clearDelayTimeouts(),z("onUntrigger",[m,ae]),!m.state.isVisible){j();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ae.type)>=0&&s)){var fe=H(!1);fe?i=setTimeout(function(){m.state.isVisible&&m.hide()},fe):o=requestAnimationFrame(function(){m.hide()})}}function Oe(){m.state.isEnabled=!0}function Ce(){m.hide(),m.state.isEnabled=!1}function mt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Et(ae){if(!m.state.isDestroyed){z("onBeforeUpdate",[m,ae]),me();var fe=m.props,Ie=jy(t,Object.assign({},fe,Fy(ae),{ignoreAttributes:!0}));m.props=Ie,le(),fe.interactiveDebounce!==Ie.interactiveDebounce&&(T(),y=ky(Ae,Ie.interactiveDebounce)),fe.triggerTarget&&!Ie.triggerTarget?Oi(fe.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):Ie.triggerTarget&&t.removeAttribute("aria-expanded"),F(),q(),O&&O(fe,Ie),m.popperInstance&&(te(),he().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),z("onAfterUpdate",[m,ae])}}function We(ae){m.setProps({content:ae})}function Ti(){var ae=m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Rn.isTouch&&!m.props.touch,De=Qc(m.props.duration,0,hn.duration);if(!(ae||fe||Ie||Le)&&!D().hasAttribute("disabled")&&(z("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,M()&&(I.style.visibility="visible"),q(),W(),m.state.isMounted||(I.style.transition="none"),M()){var ft=N(),Ot=ft.box,Ct=ft.content;Kc([Ot,Ct],0)}p=function(){var Qn;if(!(!m.state.isVisible||c)){if(c=!0,I.offsetHeight,I.style.transition=m.props.moveTransition,M()&&m.props.animation){var V=N(),G=V.box,X=V.content;Kc([G,X],De),Ny([G,X],"visible")}$(),F(),Dy(ed,m),(Qn=m.popperInstance)==null||Qn.forceUpdate(),z("onMount",[m]),m.props.animation&&M()&&Y(De,function(){m.state.isShown=!0,z("onShown",[m])})}},ue()}}function et(){var ae=!m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Qc(m.props.duration,1,hn.duration);if(!(ae||fe||Ie)&&(z("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,s=!1,M()&&(I.style.visibility="hidden"),T(),j(),q(!0),M()){var De=N(),ft=De.box,Ot=De.content;m.props.animation&&(Kc([ft,Ot],Le),Ny([ft,Ot],"hidden"))}$(),F(),m.props.animation?M()&&Q(Le,m.unmount):m.unmount()}}function nn(ae){L().addEventListener("mousemove",y),Dy(Js,y),y(ae)}function el(){m.state.isVisible&&m.hide(),m.state.isMounted&&(re(),he().forEach(function(ae){ae._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),ed=ed.filter(function(ae){return ae!==m}),m.state.isMounted=!1,z("onHidden",[m]))}function fd(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),me(),delete t._tippy,m.state.isDestroyed=!0,z("onDestroy",[m]))}}function La(t,e){e===void 0&&(e={});var n=hn.plugins.concat(e.plugins||[]);U5();var r=Object.assign({},e,{plugins:n}),i=D5(t),o=i.reduce(function(s,l){var u=l&&Y5(l,r);return u&&s.push(u),s},[]);return Ks(t)?o[0]:o}La.defaultProps=hn,La.setDefaultProps=W5,La.currentInput=Rn,Object.assign({},fy,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),La.setDefaultProps({render:qy});function Wy(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Gy=typeof window!="undefined"&&typeof document!="undefined";function td(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function zy(){return Gy&&document.createElement("div")}function K5(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function Qy(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!Qy(t[n],e[n]))return!1}else return!1;return!0}else return!1}function J5(t){var e=[];return t.forEach(function(n){e.find(function(r){return Qy(n,r)})||e.push(n)}),e}function X5(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:J5([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var nd=Gy?K.useLayoutEffect:K.useEffect;function Z5(t){var e=K.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function Yy(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var e$={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var l;return!!((l=e.props.render)!=null&&l.$$tippy)};function i(){e.props.className&&!r()||Yy(n,"add",e.props.className)}function o(){r()&&Yy(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function t$(t){function e(n){var r=n.children,i=n.content,o=n.visible,s=n.singleton,l=n.render,u=n.reference,c=n.disabled,d=c===void 0?!1:c,f=n.ignoreAttributes,p=f===void 0?!0:f;n.__source,n.__self;var h=Wy(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),y=o!==void 0,g=s!==void 0,v=K.useState(!1),b=v[0],w=v[1],E=K.useState({}),m=E[0],A=E[1],I=K.useState(),O=I[0],C=I[1],R=Z5(function(){return{container:zy(),renders:1}}),P=Object.assign({ignoreAttributes:p},h,{content:R.container});y&&(P.trigger="manual",P.hideOnClick=!1),g&&(d=!0);var S=P,M=P.plugins||[];l&&(S=Object.assign({},P,{plugins:g&&s.data!=null?[].concat(M,[{fn:function(){return{onTrigger:function(H,q){var z=s.data.children.find(function($){var F=$.instance;return F.reference===q.currentTarget});H.state.$$activeSingletonInstance=z.instance,C(z.content)}}}}]):M,render:function(){return{popper:R.container}}}));var D=[u].concat(r?[r.type]:[]);return nd(function(){var L=u;u&&u.hasOwnProperty("current")&&(L=u.current);var N=t(L||R.ref||zy(),Object.assign({},S,{plugins:[e$].concat(P.plugins||[])}));return R.instance=N,d&&N.disable(),o&&N.show(),g&&s.hook({instance:N,content:i,props:S,setSingletonContent:C}),w(!0),function(){N.destroy(),s==null||s.cleanup(N)}},D),nd(function(){var L;if(R.renders===1){R.renders++;return}var N=R.instance;N.setProps(X5(N.props,S)),(L=N.popperInstance)==null||L.forceUpdate(),d?N.disable():N.enable(),y&&(o?N.show():N.hide()),g&&s.hook({instance:N,content:i,props:S,setSingletonContent:C})}),nd(function(){var L;if(!!l){var N=R.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((L=N.props.popperOptions)==null?void 0:L.modifiers)||[]).filter(function(H){var q=H.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var z,$=q.state,F=(z=$.modifiersData)==null?void 0:z.hide;(m.placement!==$.placement||m.referenceHidden!==(F==null?void 0:F.isReferenceHidden)||m.escaped!==(F==null?void 0:F.hasPopperEscaped))&&A({placement:$.placement,referenceHidden:F==null?void 0:F.isReferenceHidden,escaped:F==null?void 0:F.hasPopperEscaped}),$.attributes.popper={}}}])})})}},[m.placement,m.referenceHidden,m.escaped].concat(D)),ie(Se,{children:[r?K.cloneElement(r,{ref:function(N){R.ref=N,td(r.ref,N)}}):null,b&&Ge.createPortal(l?l(K5(m),O,R.instance):i,R.container)]})}return e}var n$=function(t,e){return K.forwardRef(function(r,i){var o=r.children,s=Wy(r,["children"]);return U(t,oe(J({},Object.assign({},e,s)),{children:o?K.cloneElement(o,{ref:function(u){td(i,u),td(o.ref,u)}}):null}))})},r$=n$(t$(La));const i$=r$,a$=({onClick:t})=>{const{clear:e}=be(Pe);return U(i$,{content:e,children:U("button",{onClick:t,"data-testid":"clear",className:"eow-border eow-rounded eow-ml-2 eow-px-3 eow-flex eow-items-center",children:U("svg",{xmlns:"http://www.w3.org/2000/svg",className:"eow-h-4 eow-w-4 ",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:U("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})},o$=({setFilters:t})=>{const[e,n]=K.useState(!1),r=K.useRef(null),{clearFromToFilterSportal365ImagesMessage:i,dateFromTo:o,dateFromToPlaceholder:s}=be(Pe);return ie("div",{"data-testid":"from/to filter",children:[U("label",{htmlFor:"date from/to",className:Jt,children:o}),ie("div",{className:"eow-flex eow-flex-row",children:[U(bU,{ref:r,className:"eow-flex-1",placeholder:s,options:{mode:"range",enableTime:!1,dateFormat:"YYYY-MM-DD",altFormat:"YYYY-MM-DD",altInput:!0,position:"below",altInputClass:fa,parseDate:(c,d)=>na(c,d).toDate(),formatDate:(c,d)=>na(c).format(d),defaultDate:null},onChange:c=>{if(c&&c.length>1){n(!0);const d="YYYY-MM-DD",f=na(c[0]).format(d),p=na(c[1]).format(d);t({from:f,to:p})}else c.length===0&&!e&&(t(null),xe.info(i))}}),e?U(a$,{onClick:()=>{r.current.flatpickr.clear(),n(!1),t(null)}}):U(Se,{})]})]})};class s${constructor(){a(this,"id");a(this,"value");a(this,"label")}}class Ky extends s${constructor(){super(...arguments);a(this,"logo");a(this,"countryName");a(this,"countryFlag")}}const l$=(t,e,n,r)=>({apiKey:t,clientId:e,lang:n||"en",environment:r||"prod",idSchema:"native",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}}),u$=(t,e)=>{if(!t&&!e)return null;if(!t&&e)return 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;const n=e&&e==="betway"?{}.VITE_SPORTAL365_BETWAY_TOKEN:{}.VITE_SPORTAL365_SHARED_TOKEN;return{project:t,authorization:`Bearer ${n}`}},Jy=t=>{document.getElementById(t).scrollIntoView({behavior:"smooth"})},rd={container:t=>J({},t),control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",textTransform:"capitalize"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>oe(J({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"},textTransform:"capitalize"})},c$=t=>{let e=new Ky;return e.label=t.name,e.value=t.name,e.id=t.id,t.birthDate?e.logo=t.assets&&t.assets.headshot&&t.assets.headshot:e.logo=t.assets&&t.assets.logo&&t.assets.logo,e.countryName=t.country.name,e.countryFlag=t.country.assets&&t.country.assets.flag?t.country.assets.flag:_n.country,e},d$=({setQuery:t,setFilters:e})=>{const[n,r]=K.useState(!1),[i,o]=K.useState(null),{searchImages:s,hideFilters:l,showFilters:u}=be(Pe),c=()=>r(!n),d=h=>{o(h),t((h==null?void 0:h.value)||"")},p=Xu((h,y)=>{h&&y([{id:h,value:h,label:h}])},300);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"search image",className:Jt,children:s}),U(Rc,{components:{DropdownIndicator:null},loadOptions:p,isClearable:!0,styles:rd,getOptionValue:h=>h.id,onChange:d,value:i,placeholder:"",className:"eow-mb-1"}),U("a",{className:"eow-flex eow-justify-end eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-cursor-pointer eow-mb-4",onClick:c,children:n?l:u}),n?U(o$,{setFilters:e}):U(Se,{})]})},id="sportal365-images-search",f$=({imageNode:t,onChangeImages:e,setShowImagesContainer:n})=>{const[r,i]=K.useState(null),[o,s]=K.useState(""),[l,u]=K.useState(1),[c,d]=K.useState(null),[f,p]=K.useState(!1),h=K.useRef(!1),{https:y}=be(ln),{searchSportal365ImagesErrorMessage:g,noImagesFound:v}=be(Pe);K.useEffect(()=>(h.current?b():h.current=!0,()=>i(null)),[o,c,l]);const b=()=>_(this,null,function*(){if(o){p(!0);const A=yield y.fetchImagesFromSportal365(o,c,l),I=yield A.json();A.ok?(i(I),u(I.meta.pagination.current_page)):(console.error(I),xe.error(g)),p(!1)}else i(null)}),w=()=>{u(A=>A-1),Jy(id)},E=()=>{u(A=>A+1),Jy(id)};return ie("div",{id,className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded eow-bg-gray-100",children:[U("div",{className:"eow-flex eow-justify-end",children:U(Qu,{isDisabled:!1,onClick:()=>{n(A=>oe(J({},A),{[t]:!A[t]}))}})}),U(d$,{setQuery:s,setFilters:d}),r?ie(Se,{children:[U("div",{className:"eow-grid xl:eow-grid-cols-4 md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:r.data.map(A=>{var I,O;return ie("div",{className:"eow-relative eow-cursor-pointer eow-group eow-mb-2",onClick:()=>{var C,R;return e((R=(C=A.urls)==null?void 0:C.uploaded)==null?void 0:R.embed)},children:[U("img",{src:(O=(I=A.urls)==null?void 0:I.uploaded)==null?void 0:O.thumbnail,alt:"Sportal365 image",className:"eow-object-cover eow-w-full eow-h-full"}),U("div",{className:"eow-absolute eow-inset-0 eow-bg-black eow-bg-opacity-0 group-hover:eow-bg-opacity-50 eow-flex eow-justify-center eow-items-center eow-transition eow-duration-300",children:U("span",{className:"eow-text-white eow-text-4xl eow-opacity-0 group-hover:eow-opacity-100 eow-transition eow-duration-300",children:"+"})})]},A.id)})}),U(MN,{pageCount:r==null?void 0:r.meta.pagination.current_page,images:r,getPreviousPage:w,getNextPage:E})]}):U(Se,{}),r&&r.data.length===0?U("p",{className:"eow-text-center eow-font-bold eow-mb-4",children:v}):U(Se,{}),f?U(Em,{}):U(Se,{})]})},h$=({imageUrl:t,isOpen:e,closeModal:n})=>{K.useLayoutEffect(()=>(e&&document.body.addEventListener("keydown",r),()=>{document.body.removeEventListener("keydown",r)}),[n]);const r=i=>i.key==="Escape"?n():null;return e?U(Am,{wrapperId:"image-modal",children:ie("div",{className:"eow-fixed eow-inset-0 eow-z-20 eow-flex eow-items-center eow-justify-center eow-bg-black eow-bg-opacity-50 eow-animate-fadeIn",children:[U("div",{className:"eow-absolute eow-top-0 eow-right-0 eow-m-4",children:U("button",{className:"eow-text-white eow-text-2xl eow-bg-transparent",onClick:n,children:"X"})}),U("div",{className:"eow-flex eow-items-center eow-justify-center eow-h-full",children:U("img",{src:t,alt:"Image modal",className:"eow-w-full eow-object-cover"})})]})}):null},ad={mainImage:!1,coverImage:!1,mobileImage:!1},Xy={main_logo:!1,mobile_logo:!1,background_image:!1,mobile_background_image:!1,additional_image:!1},Xs=({id:t,type:e,label:n,imageUrl:r,imageNode:i,onChange:o})=>{const[s,l]=K.useState(e==="branding"?Xy:ad),[u,c]=K.useState(e==="branding"?Xy:ad),[d,f]=K.useState(!1),{https:p}=be(ln),h=()=>f(!1),y=(v,b)=>{c(ad),o(v,b)},g=(v,b)=>{navigator.clipboard.writeText(v).then(()=>{c(w=>oe(J({},w),{[b]:!0}))}).catch(w=>{console.error("Failed to copy: ",w),c(E=>oe(J({},E),{[b]:!1}))})};return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:n,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:n}),ie("div",{className:"eow-w-full eow-border eow-rounded eow-overflow-hidden eow-p-2",children:[ie("div",{className:"eow-grid lg:eow-grid-cols-8 eow-grid-cols-1 eow-gap-2 eow-mb-2",children:[U("div",{className:"lg:eow-col-span-2",children:r?ie(Se,{children:[U("img",{src:r,alt:"Card Image",className:"eow-w-full eow-object-cover eow-cursor-pointer",onClick:()=>f(!0)}),U(h$,{imageUrl:r,isOpen:d,closeModal:h})]}):U("div",{className:"eow-bg-gray-200 lg:eow-min-w-16 eow-min-h-24 eow-flex eow-justify-center eow-items-center eow-p-5",children:U("img",{src:_n.image,alt:"Card image"})})}),ie("div",{className:"eow-flex eow-flex-col eow-col-span-6",children:[ie("div",{className:"eow-grid eow-grid-cols-2 eow-gap-2 eow-mb-2",children:[U(CN,{imageNode:i,onChangeImages:y,type:e,id:t}),U(TN,{isDisabled:!r,isUrlCopied:u[i],onClick:()=>g(r||"",i)})]}),p.sportal365Config?U(PN,{imageNode:i,setShowImagesContainer:l}):U(Se,{})]})]}),s[i]?U(f$,{onChangeImages:v=>y(v,i),setShowImagesContainer:l,imageNode:i}):U(Se,{})]})]})},Zy=({id:t,type:e,loadedImages:n,onChange:r})=>{const[i,o]=K.useState(!1),s=()=>o(!i),l=be(Pe),u=e==="game"?Array.from(Cm.keys()):Array.from(LP.keys());return ie(Se,{children:[U(Xs,{id:t,type:e,label:l.main,imageUrl:n==null?void 0:n.main,imageNode:"mainImage",onChange:r}),U("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:s,children:i?l.hideMoreImages:l.showMoreImages}),i?U(Se,{children:u.map((c,d)=>U(Xs,{id:t,type:e,label:l[c],imageUrl:n&&n[c]?n[c]:"",imageNode:Cm.get(c),onChange:r},`${c}-${d}`))}):U(Se,{})]})},p$=({id:t,loadedImages:e,onChange:n})=>{const r=be(Pe);return U(_N,{images:r.optionImages,children:U(Zy,{id:t,type:"option",loadedImages:e,onChange:n})})},ew=new ai,m$=5,g$=100,v$=({options:t,setRequestBody:e})=>{const{label:n,labelOptionPlaceholder:r,options:i,optionNumber:o,optionsDescription:s}=be(Pe),l=ew.constructOptions(t),u=(y,g)=>{y.persist();const v=Array.from(l);v[g].label=y.target.value,h(v)},c=(y,g)=>{const v=Array.from(l);v[g].value=y,h(v)},d=(y,g,v)=>{const b=y||null,w=Array.from(l);switch(g){case"mainImage":w[v].images.main=b,h(w);break;case"mobileImage":w[v].images.mobile=b,h(w);break}},f=()=>{const y=Array.from(l).sort((w,E)=>parseInt(E.id)-parseInt(w.id))[0].id,g=`${parseInt(y)+1}`,v=ew.constructEmptyOption(g),b=Array.from(l);b.push(v),h(b)},p=y=>{const g=l.filter((v,b)=>b!==y);h(g)},h=y=>{e(g=>oe(J({},g),{options:y}))};return ie("div",{className:"eow-mb-4",children:[ie("div",{className:"eow-mb-2",children:[U("h3",{className:Jt,children:i}),U("p",{className:"eow-text-gray-400 eow-text-sm",children:s})]}),ie("div",{className:"eow-grid eow-grid-cols-1 lg:eow-grid-cols-2 2xl:eow-grid-cols-3 eow-gap-4 eow-mb-1",children:[l.map((y,g)=>ie("div",{className:"eow-overflow-visible eow-shadow-l eow-border eow-border-gray-200",children:[ie("div",{className:"eow-bg-gray-100 eow-flex eow-justify-between eow-px-3 eow-py-2",children:[ie("h2",{className:"eow-card-title",children:[o," ",g+1]}),U(Qu,{isDisabled:l.length===m$,onClick:()=>p(g)})]}),ie("div",{className:"eow-p-3",children:[ie("div",{className:"eow-grid sm:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[U(bN,{label:n,defaultValue:y.label,placeholder:r,onChange:v=>u(v,g)}),U(va,{type:"options_value",defaultValue:y.value,onChange:v=>c(v,g)})]}),U(p$,{id:g,loadedImages:y.images,onChange:(v,b)=>d(v,b,g)})]})]},`points_number_${y.id}_${g}`)),U(zu,{isDisabled:l.length===g$,onClick:f})]})]})},y$=({requestBody:t,setRequestBody:e,description:n,setDescription:r})=>{const i=be(Pe),o=s=>{s.persist(),e(l=>oe(J({},l),{title:s.target.value}))};return ie("div",{className:"md:eow-w-4/6 eow-w-full",children:[U(BP,{value:(t==null?void 0:t.id)||null}),U(bt,{title:i.title,placeholder:i.titlePlaceholder,onChange:o,defaultValue:t.title||""}),U(Gu,{defaultValue:n,setValue:r,property:"description"}),U(wN,{points:t.points,setRequestBody:e}),U(v$,{options:t.options,setRequestBody:e})]})},zn=({title:t,children:e})=>{const[n,r]=K.useState(!1);return ie("div",{className:"eow-border-b eow-border-gray-200 eow-mb-2",children:[ie("button",{className:"eow-flex eow-justify-between eow-py-2 eow-px-4 eow-py-2 eow-px-4 eow-w-full eow-text-left eow-text-gray-800 eow-font-semibold eow-bg-gray-100 hover:eow-bg-gray-200 focus:eow-outline-none",onClick:()=>r(!n),children:[U("span",{children:t}),U("img",{src:n?_n.upArrow:_n.downArrow,alt:"Up arrow",className:"eow-w-6 eow-h-6"})]}),n&&U("div",{className:"eow-border eow-border-gray-200 eow-p-4",children:e})]})},w$=({defaultValue:t,onChange:e})=>{const{https:n}=be(ln),{type:r,typeDescription:i,noType:o}=be(Pe),{data:s}=du({queryKey:["eitherOrTypes"],queryFn:()=>n.getEitherOrTypes()});return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"type",className:Jt,children:r}),ie("select",{id:"quizType",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:e,defaultValue:t||"",children:[U("option",{value:"",children:o}),s?s.map((l,u)=>U("option",{id:l.id,value:l.id,children:l.label},`${l.id}-${u}`)):U(Se,{})]}),U("p",{className:"eow-text-gray-400 eow-text-xs",children:i})]})},tw=({type:t,defaultValue:e,onChange:n})=>{const{status:r,active:i,inactive:o,statusDescription:s,winningCondition:l,winningConditionDescription:u,more:c,less:d}=be(Pe);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"status",className:Jt,children:t==="status"?r:l}),ie("select",{id:t==="status"?"gameStatus":"gameWinningCondition",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:n,defaultValue:e,children:[U("option",{value:t==="status"?"ACTIVE":"MORE",children:t==="status"?i:c}),U("option",{value:t==="status"?"INACTIVE":"LESS",children:t==="status"?o:d})]}),U("p",{className:"eow-text-gray-400 eow-text-xs",children:t==="status"?s:u})]})};var b$=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],nw=function(){var e=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(e).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},od={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,i){return!(!e||n.some(function(o){return nw(e,o,i)})||r.some(function(o){return nw(e,o,i)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function _$(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,i=r===void 0?"last":r,o=t.formatCreateLabel,s=o===void 0?od.formatCreateLabel:o,l=t.isValidNewOption,u=l===void 0?od.isValidNewOption:l,c=t.getNewOptionData,d=c===void 0?od.getNewOptionData:c,f=t.onCreateOption,p=t.options,h=p===void 0?[]:p,y=t.onChange,g=un(t,b$),v=g.getOptionValue,b=v===void 0?qv:v,w=g.getOptionLabel,E=w===void 0?Vv:w,m=g.inputValue,A=g.isLoading,I=g.isMulti,O=g.value,C=g.name,R=K.useMemo(function(){return u(m,Ds(O),h,{getOptionValue:b,getOptionLabel:E})?d(m,s(m)):void 0},[s,d,E,b,m,u,h,O]),P=K.useMemo(function(){return(n||!A)&&R?i==="first"?[R].concat(hi(h)):[].concat(hi(h),[R]):h},[n,i,A,R,h]),S=K.useCallback(function(M,D){if(D.action!=="select-option")return y(M,D);var L=Array.isArray(M)?M:[M];if(L[L.length-1]===R){if(f)f(m);else{var N=d(m,m),H={action:"create-option",name:C,option:N};y(Oa(I,[].concat(hi(Ds(O)),[N]),N),H)}return}y(M,D)},[d,m,I,C,R,f,y,O]);return we(we({},g),{},{options:P,onChange:S})}var E$=K.forwardRef(function(t,e){var n=xc(t),r=_$(n);return U(js,J({ref:e},r))}),I$=E$;const A$=t=>({label:t,value:t}),O$={control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"6px 1px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",boxShadow:"none"}),clearIndicator:t=>oe(J({},t),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}})},rw=({defaultValue:t,showLabel:e,setObject:n,handleResetData:r})=>{const[i,o]=K.useState(""),s=t.map(y=>A$(y)),{repeatedValueMessage:l,flags:u,flagsPlaceholder:c}=be(Pe),d=y=>{const g=y.map(v=>v.value);n(v=>oe(J({},v),{flags:g})),r&&r()},f=y=>{o(y)},p=y=>{y.persist();const{key:g}=y;if(!!i)switch(g){case"Enter":case"Tab":if(t.length===0){const v=Array.from(t);v.push(i),n(b=>oe(J({},b),{flags:v}))}if(t.length>0&&h()){const v=Array.from(t);v.push(i),n(b=>oe(J({},b),{flags:v}))}o(""),y.preventDefault()}},h=()=>{let y=!1;const g=s.map(v=>v.label);return g.length&&g.includes(i)?(xe.warn(l),y):(y=!0,y)};return ie("div",{className:"eow-mb-4",children:[e?U("label",{htmlFor:u,className:"eow-text-sm eow-mb-1",children:u}):U(Se,{}),U(I$,{styles:O$,components:{DropdownIndicator:null},getOptionValue:y=>y.value,inputValue:i,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:d,onInputChange:f,onKeyDown:p,placeholder:c,value:s})]})},C$=t=>Object.keys(t).length++,iw=({property:t,field:e,onChange:n})=>{const r=C$(e),[i,o]=K.useState(JSON.parse(JSON.stringify(e))),{dynamicFieldsDescription:s,keyDynamicFields:l,valueDynamicFields:u}=be(Pe),c=()=>{const p="new_key"+r,h=JSON.parse(JSON.stringify(e));h[p]="";const y=J(J({},e),h);o(y),n(y)},d=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p];y[h]=y[g],delete y[g],n(y)},f=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p]?Object.keys(y)[p]:"new_key";y[g]=h,n(y)};return ie("div",{className:"eow-mb-4",children:[U("div",{className:"eow-mb-2",children:U("p",{className:"eow-text-gray-400 eow-text-sm",children:s})}),ie("div",{className:"eow-border eow-border-gray-200 eow-rounded eow-p-2 eow-mb-4",children:[Object.keys(i).map((p,h)=>ie("div",{className:"eow-flex eow-items-center eow-mb-4",children:[ie("div",{className:"eow-mr-4",children:[U("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:l}),U("input",{"data-testid":"dynamic-key-field",onChange:y=>d(h,y.target.value),value:Object.keys(e)[h]&&Object.keys(e)[h].includes("new_key")?"":Object.keys(e)[h],type:"text",id:`${t}-key-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-64 focus:eow-outline-none eow-px-3 eow-py-2"})]}),ie("div",{className:"eow-w-full",children:[U("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:u}),U("input",{"data-testid":"dynamic-value-field",onChange:y=>f(h,y.target.value),value:e[p],type:"text",id:`${t}-value-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2"})]})]},`${t}-${p}-${h}`)),U(zu,{isDisabled:!1,onClick:()=>c()})]})]})},T$=({tabValue:t,setTabValue:e})=>{const{content:n,tags:r,campaign:i}=be(Pe);return U(Se,{children:U("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[r,n,i].map(s=>U("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===s?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:U("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===s?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(s),children:s})},`context-tab-${s}`))})})};class sd{constructor(){a(this,"label","");a(this,"options",[])}}const S$=10,aw=t=>{const e=[];if(t.competitions.length>0){const n=new sd;n.label="Competitions",n.options=t.competitions.map(r=>ld(r,"competition")),e.push(n)}if(t.teams.length>0){const n=new sd;n.label="Teams",n.options=t.teams.map(r=>ld(r,"team")),e.push(n)}if(t.players.length>0){const n=new sd;n.label="Players",n.options=t.players.map(r=>ld(r,"player")),e.push(n)}return e},ld=(t,e)=>{var r,i,o,s,l;let n=new Ky;return n.label=t.name,n.value=t.name,n.id=t.id,e==="player"?n.logo=((r=t.assets)==null?void 0:r.headshot)||_n.avatar:e==="team"?n.logo=((i=t.assets)==null?void 0:i.logo)||_n.team:n.logo=((o=t.assets)==null?void 0:o.logo)||_n.competition,n.countryName=t.country.name,n.countryFlag=((l=(s=t.country)==null?void 0:s.assets)==null?void 0:l.flag)||_n.country,n},P$=({options:t,setOptions:e,setFilters:n,handleResetData:r})=>{const{sdk:i}=be(ln),{contextEntityTag:o,typeContextTagNamePlaceholder:s}=be(Pe),l=d=>{const f=d.map(p=>p.id);e(d),r(),n(p=>oe(J({},p),{entityIds:f}))},c=Xu((d,f)=>{if(d){const p={query:d};i.football.search(p).then(h=>{const y=aw(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"context entity tag",className:"eow-text-sm eow-mb-1",children:o}),U(Rc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:rd,onChange:l,loadingMessage:()=>"Loading...",isOptionDisabled:()=>t.length===S$,value:t,loadOptions:c,isClearable:!0,isMulti:!0,placeholder:s,formatOptionLabel:d=>ie("div",{className:"eow-flex eow-items-center",children:[U("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-2",children:d.label}),U("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-1",children:d.countryName})]})})]})},M$=(t,e,n,r)=>{const i=t.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),o=t.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),s=t.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),l=[],u=[];if(i.length>0){const c=e.football.getCompetitions({competitionIds:i}).then(d=>{u.push(d)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}if(o.length>0){const c=e.football.getTeams({teamIds:o}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}if(s.length>0){const c=e.football.getPlayers({playerIds:s}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}Promise.all(l).then(()=>{const d=Array.prototype.concat.apply([],u).map(f=>c$(f));r(d)})},x$=({tags:t,onChangeTags:e})=>{const[n,r]=K.useState([]),{sdk:i}=be(ln),{getFootballEntitiesErrorMessage:o,typeContextTagNamePlaceholder:s}=be(Pe),l=d=>{r(d),e(d)},c=Xu((d,f)=>{if(!d&&t.length>0&&M$(t,i,o,r),d){const p={query:d};i.football.search(p).then(h=>{const y=aw(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return U("div",{className:"eow-mb-4",children:U(Rc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:rd,onChange:l,loadingMessage:()=>"Loading...",value:n,loadOptions:c,isClearable:!0,defaultOptions:!0,isMulti:!0,placeholder:s,formatOptionLabel:d=>ie("div",{className:"eow-flex eow-items-center",children:[U("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-2",children:d.label}),U("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-1",children:d.countryName})]})})})},R$=new ai,k$=t=>t.startsWith("fb:c:")?"competition":t.startsWith("fb:t:")?"team":"player",D$=({defaultValue:t,setRequestBody:e})=>{const n=R$.createContext(t),{content:r,tags:i,campaign:o,id:s,idContentPlaceholder:l,labelContentPlaceholder:u,typeContentPlaceholder:c,idCampaignPlaceholder:d,labelCampaignPlaceholder:f,label:p,type:h}=be(Pe),[y,g]=K.useState(i),v=O=>{O.persist();const C=J({},n);C.content.id=O.target.value,I(C)},b=O=>{O.persist();const C=J({},n);C.content.label=O.target.value,I(C)},w=O=>{O.persist();const C=J({},n);C.content.type=O.target.value,I(C)},E=O=>{O.persist();const C=J({},n);C.campaign.id=O.target.value,I(C)},m=O=>{O.persist();const C=J({},n);C.campaign.label=O.target.value,I(C)},A=O=>{const C=J({},n);O.length?C.tags=O.map(R=>({id:R.id,type:k$(R.id),source:"football"})):C.tags=[],I(C)},I=O=>{e(C=>oe(J({},C),{context:O}))};return ie("div",{className:"eow-mb-4 eow-p-2",children:[U(T$,{tabValue:y,setTabValue:g}),y===i?U(x$,{tags:n.tags,onChangeTags:A}):U(Se,{}),y===r?ie(Se,{children:[U(bt,{title:s,placeholder:l,defaultValue:n.content.id,onChange:v}),U(bt,{title:p,placeholder:u,defaultValue:n.content.label,onChange:b}),U(bt,{title:h,placeholder:c,defaultValue:n.content.type,onChange:w})]}):U(Se,{}),y===o?ie(Se,{children:[U(bt,{title:s,placeholder:d,defaultValue:n.campaign.id,onChange:E}),U(bt,{title:p,placeholder:f,defaultValue:n.campaign.label,onChange:m})]}):U(Se,{})]})},F$=({tabValue:t,setTabValue:e})=>{const{images:n,colors:r,urls:i}=be(Pe);return U(Se,{children:U("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[n,r,i].map(s=>U("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===s?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:U("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===s?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(s),children:s})},`context-tab-${s}`))})})};function N$(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}var L$=N$;function B$(t){return function(e){return t==null?void 0:t[e]}}var U$=B$,$$=U$,j$={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},H$=$$(j$),V$=H$;function q$(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var W$=q$,ow=Xo,G$=W$,z$=rs,Q$=Ag,Y$=1/0,sw=ow?ow.prototype:void 0,lw=sw?sw.toString:void 0;function uw(t){if(typeof t=="string")return t;if(z$(t))return G$(t,uw)+"";if(Q$(t))return lw?lw.call(t):"";var e=t+"";return e=="0"&&1/t==-Y$?"-0":e}var K$=uw,J$=K$;function X$(t){return t==null?"":J$(t)}var Zs=X$,Z$=V$,e3=Zs,t3=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n3="\\u0300-\\u036f",r3="\\ufe20-\\ufe2f",i3="\\u20d0-\\u20ff",a3=n3+r3+i3,o3="["+a3+"]",s3=RegExp(o3,"g");function l3(t){return t=e3(t),t&&t.replace(t3,Z$).replace(s3,"")}var u3=l3,c3=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function d3(t){return t.match(c3)||[]}var f3=d3,h3=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function p3(t){return h3.test(t)}var m3=p3,cw="\\ud800-\\udfff",g3="\\u0300-\\u036f",v3="\\ufe20-\\ufe2f",y3="\\u20d0-\\u20ff",w3=g3+v3+y3,dw="\\u2700-\\u27bf",fw="a-z\\xdf-\\xf6\\xf8-\\xff",b3="\\xac\\xb1\\xd7\\xf7",_3="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",E3="\\u2000-\\u206f",I3=" \\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",hw="A-Z\\xc0-\\xd6\\xd8-\\xde",A3="\\ufe0e\\ufe0f",pw=b3+_3+E3+I3,mw="['\u2019]",gw="["+pw+"]",O3="["+w3+"]",vw="\\d+",C3="["+dw+"]",yw="["+fw+"]",ww="[^"+cw+pw+vw+dw+fw+hw+"]",T3="\\ud83c[\\udffb-\\udfff]",S3="(?:"+O3+"|"+T3+")",P3="[^"+cw+"]",bw="(?:\\ud83c[\\udde6-\\uddff]){2}",_w="[\\ud800-\\udbff][\\udc00-\\udfff]",Ci="["+hw+"]",M3="\\u200d",Ew="(?:"+yw+"|"+ww+")",x3="(?:"+Ci+"|"+ww+")",Iw="(?:"+mw+"(?:d|ll|m|re|s|t|ve))?",Aw="(?:"+mw+"(?:D|LL|M|RE|S|T|VE))?",Ow=S3+"?",Cw="["+A3+"]?",R3="(?:"+M3+"(?:"+[P3,bw,_w].join("|")+")"+Cw+Ow+")*",k3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",D3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",F3=Cw+Ow+R3,N3="(?:"+[C3,bw,_w].join("|")+")"+F3,L3=RegExp([Ci+"?"+yw+"+"+Iw+"(?="+[gw,Ci,"$"].join("|")+")",x3+"+"+Aw+"(?="+[gw,Ci+Ew,"$"].join("|")+")",Ci+"?"+Ew+"+"+Iw,Ci+"+"+Aw,D3,k3,vw,N3].join("|"),"g");function B3(t){return t.match(L3)||[]}var U3=B3,$3=f3,j3=m3,H3=Zs,V3=U3;function q3(t,e,n){return t=H3(t),e=n?void 0:e,e===void 0?j3(t)?V3(t):$3(t):t.match(e)||[]}var W3=q3,G3=L$,z3=u3,Q3=W3,Y3="['\u2019]",K3=RegExp(Y3,"g");function J3(t){return function(e){return G3(Q3(z3(e).replace(K3,"")),t,"")}}var X3=J3,Z3=X3,ej=Z3(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),ud=ej;const tj=({loadedImages:t,onChange:e})=>{const[n,r]=K.useState(!1),i=be(Pe),o=["mobileLogo","backgroundImage","mobileBackgroundImage","additionalImage"],s=()=>r(!n);return ie(Se,{children:[U(Xs,{id:0,type:"branding",label:i.mainLogo,imageUrl:t.main_logo,imageNode:"main_logo",onChange:e}),U("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:s,children:n?i.hideMoreImages:i.showMoreImages}),n?U(Se,{children:o.map((l,u)=>U(Xs,{id:0,type:"branding",label:i[l],imageUrl:t&&t[ud(l)]?t[ud(l)]:"",imageNode:ud(l),onChange:e},`${l}-${u}`))}):U(Se,{})]})},nj=new ai,rj=({defaultValue:t,setRequestBody:e})=>{const n=nj.createBranding(t),r=be(Pe),[i,o]=K.useState(r.images),s=(u,c,d)=>{d.persist();const f=J({},n);f[u][c]=d.target.value,e(p=>oe(J({},p),{branding:n}))},l=(u,c)=>{const d=J({},n);d.images[c]=u,e(f=>oe(J({},f),{branding:n}))};return ie("div",{className:"eow-mb-4 eow-p-2",children:[U(F$,{tabValue:i,setTabValue:o}),i===r.images?U(tj,{loadedImages:n.images,onChange:l}):U(Se,{}),i===r.urls?ie(Se,{children:[U(bt,{title:r.primaryUrl,placeholder:"",defaultValue:n.urls.primary_url,onChange:u=>s("urls","primary_url",u)}),U(bt,{title:r.secondaryUrl,placeholder:"",defaultValue:n.urls.secondary_url,onChange:u=>s("urls","secondary_url",u)}),U(bt,{title:r.privacyPolicyUrl,placeholder:"",defaultValue:n.urls.privacy_policy_url,onChange:u=>s("urls","privacy_policy_url",u)}),U(bt,{title:r.termsAndConditionsUrl,placeholder:"",defaultValue:n.urls.terms_and_conditions_url,onChange:u=>s("urls","terms_and_conditions_url",u)}),U(bt,{title:r.additionalUrl,placeholder:"",defaultValue:n.urls.additional_url,onChange:u=>s("urls","additional_url",u)})]}):U(Se,{}),i===r.colors?ie(Se,{children:[U(bt,{title:r.primaryColor,placeholder:"",defaultValue:n.colors.primary_color,onChange:u=>s("colors","primary_color",u)}),U(bt,{title:r.secondaryColor,placeholder:"",defaultValue:n.colors.secondary_color,onChange:u=>s("colors","secondary_color",u)}),U(bt,{title:r.contentColor,placeholder:"",defaultValue:n.colors.content_color,onChange:u=>s("colors","content_color",u)}),U(bt,{title:r.backgroundColor,placeholder:"",defaultValue:n.colors.background_color,onChange:u=>s("colors","background_color",u)}),U(bt,{title:r.borderColor,placeholder:"",defaultValue:n.colors.border_color,onChange:u=>s("colors","border_color",u)}),U(bt,{title:r.additionalColor,placeholder:"",defaultValue:n.colors.additional_color,onChange:u=>s("colors","additional_color",u)})]}):U(Se,{})]})},ij=new ai,aj=({requestBody:t,rules:e,adContent:n,setRules:r,setAdContent:i,setRequestBody:o})=>{const{branding:s,configuration:l,images:u,flags:c,labels:d,customFields:f,rules:p,adContent:h,context:y}=be(Pe),g=O=>{O.persist(),o(C=>oe(J({},C),{type:O.target.value?O.target.value:null}))},v=O=>{O.persist(),o(C=>oe(J({},C),{status:O.target.value}))},b=O=>{O.persist(),o(C=>oe(J({},C),{winning_condition:O.target.value}))},w=O=>{o(C=>oe(J({},C),{time:O}))},E=O=>{o(C=>oe(J({},C),{lives:O}))},m=(O,C)=>{const R=O||null,P=ij.createImagesModel();switch(C){case"mainImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.main=R,oe(J({},S),{images:M})});break;case"coverImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.cover=R,oe(J({},S),{images:M})});break;case"mobileImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.mobile=R,oe(J({},S),{images:M})});break}},A=O=>{o(C=>oe(J({},C),{labels:O}))},I=O=>{o(C=>oe(J({},C),{custom_fields:O}))};return ie("div",{className:"md:eow-w-2/6 eow-w-full eow-p-4",children:[U(zn,{title:h,children:U(Gu,{defaultValue:n,setValue:i,property:"ad_content"})}),U(zn,{title:s,children:U(rj,{defaultValue:t.branding,setRequestBody:o})}),ie(zn,{title:l,children:[ie("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:[U(w$,{defaultValue:t.type,onChange:g}),U(tw,{type:"status",defaultValue:t.status,onChange:v}),U(tw,{type:"winning_condition",defaultValue:t.winning_condition,onChange:b})]}),ie("div",{className:"eow-grid md:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[U(va,{type:"time",defaultValue:t.time,showDescription:!0,onChange:w}),U(va,{type:"lives",defaultValue:t.lives,showDescription:!0,onChange:E})]})]}),U(zn,{title:y,children:U(D$,{defaultValue:t.context,setRequestBody:o})}),U(zn,{title:f,children:U(iw,{property:"custom_fields",field:t.custom_fields?t.custom_fields:new Object,onChange:I})}),U(zn,{title:c,children:U(rw,{defaultValue:t.flags,setObject:o})}),U(zn,{title:u,children:U(Zy,{id:0,type:"game",loadedImages:t.images,onChange:m})}),U(zn,{title:d,children:U(iw,{property:"labels",field:t.labels?t.labels:new Object,onChange:A})}),U(zn,{title:p,children:U(Gu,{defaultValue:e,setValue:r,property:"rules"})})]})},Tw=new ai,oj="manage-either-or",sj=({eitherOrById:t,setFilters:e,toggleScreen:n,clearEitherOrById:r})=>{const[i,o]=K.useState(Tw.createNewRequestBody(t)),[s,l]=K.useState(t==null?void 0:t.description),[u,c]=K.useState(t==null?void 0:t.rules),[d,f]=K.useState(t==null?void 0:t.ad_content),[p,h]=K.useState(!1),[y,g]=K.useState(!1),v=be(Pe),{https:b}=be(ln),w=!!t,E=()=>{g(!y)};return ie("div",{id:oj,children:[U(MP,{managementScreen:w?"edit":"create",toggleScreen:n,clearQuizById:r}),ie("div",{className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded",children:[ie("div",{className:"eow-flex eow-flex-col md:eow-flex-row",children:[U(y$,{requestBody:i,setRequestBody:o,description:s,setDescription:l}),U(aj,{requestBody:i,setRequestBody:o,rules:u,adContent:d,setRules:c,setAdContent:f})]}),U(kP,{isLoading:p,manageEitherOr:()=>_(this,null,function*(){const A=new xP;if(h(!0),w?A.validateUpdate(i,v):A.validateCreate(i,v),!A.isValid){xe.error(A.message),h(!1);return}i.description=s,i.rules=u,i.ad_content=d;const I=Tw.finalizeNewRequestBody(J({},i));let O=null;w?O=yield b.updateEitherOr(I.id,J({},I)):O=yield b.createEitherOr(J({},I)),O.ok?(h(!1),xe.success(w?v.updateEitherOrMessage:v.createEitherOrMessage),e(C=>oe(J({},C),{refetchEitherOrs:!C.refetchEitherOrs})),r(),n()):(xe.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage),console.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage,yield O.json()),h(!1))}),handleModal:E})]}),U(NP,{isOpen:y,requestBody:i,description:s,handleClose:E})]})},lj=t=>{const e=document.createElement("div");return e.setAttribute("id",t),document.body.appendChild(e),e},uj=({children:t,wrapperId:e})=>{const[n,r]=K.useState(null);return K.useLayoutEffect(()=>{let i=document.getElementById(e),o=!1;return i||(o=!0,i=lj(e)),r(i),()=>{o&&i.parentNode&&i.parentNode.removeChild(i)}},[e]),n===null?null:fr.default.createPortal(t,n)},cj=({isOpen:t,eitherOr:e,setFilters:n,handleClose:r})=>{const[i,o]=K.useState(!1),{confirmationQuestionLabel:s,deleteLabel:l,cancelLabel:u,deleteEitherOrMessage:c,deleteEitherOrErrorMessage:d}=be(Pe),{https:f}=be(ln);K.useLayoutEffect(()=>(t&&document.body.addEventListener("keydown",p),()=>{document.body.removeEventListener("keydown",p)}),[r]);const p=y=>y.key==="Escape"&&!i?r():null,h=()=>_(this,null,function*(){o(!0);const y=yield f.deleteEitherOr(e.id);y.ok?(xe.success(c),o(!1),n(g=>oe(J({},g),{refetchEitherOrs:!g.refetchEitherOrs})),r()):(console.error(d,yield y.json()),xe.error(d),o(!1))});return t?U(uj,{wrapperId:"confirmation-modal",children:ie(Se,{children:[U("div",{className:"eow-justify-center eow-items-center eow-flex eow-overflow-x-hidden eow-overflow-y-hidden eow-absolute eow-inset-0 eow-z-50 eow-top-0 eow-right-0 eow-bottom-0 eow-left-0 eow-outline-none focus:eow-outline-none",children:U("div",{className:"eow-relative eow-w-full eow-my-6 eow-mx-auto eow-max-w-lg",children:ie("div",{className:"eow-border-0 eow-rounded eow-shadow-lg eow-relative eow-flex eow-flex-col eow-w-full eow-bg-white eow-outline-none focus:eow-outline-none",children:[ie("div",{className:"eow-flex eow-justify-items-center eow-p-4 eow-border-b eow-border-solid eow-border-gray-200",children:[ie("h3",{className:"eow-text-2xl eow-font-semibold eow-mr-2",children:[l," ",e.title]}),U("button",{className:"eow-flex eow-justify-items-center eow-ml-auto eow-bg-transparent eow-border-0 eow-leading-none eow-font-semibold eow-outline-none focus:eow-outline-none",onClick:r,children:U("span",{className:"eow-bg-transparent eow-h-6 eow-w-6 eow-text-2xl eow-block eow-outline-none focus:eow-outline-none eow-text-red-500 hover:eow-text-red-600",children:"x"})})]}),U("div",{className:"eow-relative eow-whitespace-nowrap eow-p-4 eow-text-gray-500 eow-text-lg eow-mb-4",children:ie("p",{className:"eow-whitespace-normal eow-mb-2",children:[s," ",U("span",{className:"eow-text-xl eow-italic",children:e.title})," ?"]})}),ie("div",{className:"eow-flex eow-items-center eow-justify-end eow-p-3 eow-border-t eow-border-solid eow-border-gray-200 eow-rounded-b",children:[ie("button",{className:`${i?"eow-bg-gray-600":"eow-bg-brandColor hover:eow-bg-blue-700"} eow-text-white eow-font-bold eow-px-4 eow-py-2 eow-text-sm eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:h,disabled:i,children:[i?U(Im,{}):null,l]}),U("button",{className:`${i?"eow-bg-gray-600":"eow-bg-red-500 hover:eow-bg-red-700"} eow-text-white eow-font-bold eow-text-sm eow-px-4 eow-py-2 eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:r,disabled:i,children:u})]})]})})}),U("div",{className:"eow-opacity-80 eow-absolute eow-inset-0 eow-z-40 eow-bg-black eow-top-0 eow-right-0 eow-bottom-0 eow-left-0"})]})}):null};var Sw=(t=>(t.CREATED_AT_ASC="created_at_asc",t.CREATED_AT_DESC="created_at_desc",t.UPDATED_AT_ASC="updated_at_asc",t.UPDATED_AT_DESC="updated_at_desc",t))(Sw||{});class dj{constructor(){a(this,"sort","created_at_desc");a(this,"status","");a(this,"flags",[]);a(this,"entityIds",[]);a(this,"groupByStatus",!0);a(this,"refetchEitherOrs",!1)}}var fj=K.forwardRef(function(t,e){var n=xc(t);return U(js,J({ref:e},n))}),hj=fj;function pj(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var mj=pj,gj=mj;function vj(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:gj(t,e,n)}var yj=vj,wj="\\ud800-\\udfff",bj="\\u0300-\\u036f",_j="\\ufe20-\\ufe2f",Ej="\\u20d0-\\u20ff",Ij=bj+_j+Ej,Aj="\\ufe0e\\ufe0f",Oj="\\u200d",Cj=RegExp("["+Oj+wj+Ij+Aj+"]");function Tj(t){return Cj.test(t)}var Pw=Tj;function Sj(t){return t.split("")}var Pj=Sj,Mw="\\ud800-\\udfff",Mj="\\u0300-\\u036f",xj="\\ufe20-\\ufe2f",Rj="\\u20d0-\\u20ff",kj=Mj+xj+Rj,Dj="\\ufe0e\\ufe0f",Fj="["+Mw+"]",cd="["+kj+"]",dd="\\ud83c[\\udffb-\\udfff]",Nj="(?:"+cd+"|"+dd+")",xw="[^"+Mw+"]",Rw="(?:\\ud83c[\\udde6-\\uddff]){2}",kw="[\\ud800-\\udbff][\\udc00-\\udfff]",Lj="\\u200d",Dw=Nj+"?",Fw="["+Dj+"]?",Bj="(?:"+Lj+"(?:"+[xw,Rw,kw].join("|")+")"+Fw+Dw+")*",Uj=Fw+Dw+Bj,$j="(?:"+[xw+cd+"?",cd,Rw,kw,Fj].join("|")+")",jj=RegExp(dd+"(?="+dd+")|"+$j+Uj,"g");function Hj(t){return t.match(jj)||[]}var Vj=Hj,qj=Pj,Wj=Pw,Gj=Vj;function zj(t){return Wj(t)?Gj(t):qj(t)}var Qj=zj,Yj=yj,Kj=Pw,Jj=Qj,Xj=Zs;function Zj(t){return function(e){e=Xj(e);var n=Kj(e)?Jj(e):void 0,r=n?n[0]:e.charAt(0),i=n?Yj(n,1).join(""):e.slice(1);return r[t]()+i}}var eH=Zj,tH=eH,nH=tH("toUpperCase"),rH=nH,iH=Zs,aH=rH;function oH(t){return aH(iH(t).toLowerCase())}var sH=oH;const Nw=(t,e)=>{let n="";if(e==="sort")switch(t){case"created_at_asc":n="Sort by created at field in ascending order";break;case"created_at_desc":n="Sort by created at field in descending order";break;case"updated_at_asc":n="Sort by updated at field in ascending order";break;case"updated_at_desc":n="Sort by updated at field in descending order";break}return t&&(t=sH(t)),{id:t,value:t,label:e==="status"?t:n}},lH={control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>oe(J({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"}})},Lw=({defaultValue:t,filterValues:e,filterType:n,showClearStatus:r,setFilters:i,handleResetData:o})=>{const{status:s,clearStatus:l}=be(Pe),u=e.map(f=>Nw(f,n)),c=f=>{const p=f.value.toLocaleLowerCase();n==="sort"?i(h=>oe(J({},h),{sort:p})):n==="status"&&i(h=>oe(J({},h),{status:p.toLocaleUpperCase()})),o()},d=()=>{i(f=>oe(J({},f),{status:""}))};return ie("div",{className:"eow-w-full eow-mb-4",children:[U("label",{className:"eow-text-sm eow-mb-1",children:n==="status"?s:""}),U(hj,{onChange:c,options:u,styles:lH,value:Nw(t,n),placeholder:""}),r?U("a",{className:"eow-text-brandColor eow-cursor-pointer eow-text-sm eow-mb-8",onClick:()=>d(),children:l}):U(Se,{})]})},uH=({value:t,setFilters:e,handleResetData:n})=>{const{groupByStatus:r}=be(Pe);return ie("div",{className:"eow-flex eow-items-center eow-cursor-pointer",onClick:()=>{e(o=>oe(J({},o),{groupByStatus:!t})),n()},children:[U("input",{type:"checkbox",className:"eow-mr-2 focus:eow-outline-none eow-outline-none eow-cursor-pointer",checked:t,readOnly:!0}),U("span",{className:"eow-text-blueGray-600 eow-select-none",children:r})]})},cH=Object.values(Sw),dH=["active","inactive"],fH=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const{filterBy:o,sortBy:s}=be(Pe);return ie("div",{className:"eow-grid md:eow-grid-cols-2 eow-gap-4 eow-grid-cols-1 eow-mb-6",children:[ie("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[U("h3",{className:"eow-font-bold eow-mb-2",children:o}),U(Lw,{filterType:"status",defaultValue:t.status,filterValues:dH,showClearStatus:!0,setFilters:r,handleResetData:i}),U(rw,{defaultValue:t.flags,showLabel:!0,setObject:r,handleResetData:i}),U(P$,{options:e,setOptions:n,setFilters:r,handleResetData:i})]}),ie("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[U("h3",{className:"eow-font-bold eow-mb-2",children:s}),U(Lw,{filterType:"sort",defaultValue:t.sort,filterValues:cH,setFilters:r,handleResetData:i}),U(uH,{value:t.groupByStatus,setFilters:r,handleResetData:i})]})]})},hH=({children:t})=>U("div",{children:U("section",{className:"eow-mx-auto",children:U("div",{className:"eow-mb-8 eow-overflow-hidden eow-rounded eow-bg-white",children:U("div",{className:"eow-w-full eow-overflow-x-auto",children:t})})})}),pH=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[n,r]=K.useState(new dj),[i,o]=K.useState(1),[s,l]=K.useState(null),[u,c]=K.useState(new Map),[d,f]=K.useState(null),[p,h]=K.useState(!1),[y,g]=K.useState(!1),[v,b]=K.useState(!1),[w,E]=K.useState(null),[m,A]=K.useState([]),{sdk:I,https:O}=be(ln),{getEitherOrsErrorMessage:C,getEitherOrErrorMessage:R,noGamesFound:P}=be(Pe),S=K.useMemo(()=>JSON.stringify(n),[n]),{isError:M,error:D,data:L}=du({queryKey:["eitherOrsList",S],queryFn:()=>I.miniGames.getEitherOrs(n,!1,!0)});K.useEffect(()=>{if(L){const x=new Map(u).set(i,L.data);c(x),l(L.meta.pagination.nextPageStartsAfter)}},[L]),K.useEffect(()=>{Array.from(u.keys()).length>0&&(Array.from(u.keys()).includes(i)||(k=>_(this,null,function*(){try{const W=yield I.miniGames.getEitherOrs(oe(J({},n),{startAfter:k}),!1,!0);if(W.data.length>0){const j=new Map(u).set(i,W.data);c(j),l(W.meta.pagination.nextPageStartsAfter)}}catch(W){xe.error(C),console.error(W)}}))(s))},[i]);const N=()=>o(x=>x-1),H=()=>o(x=>x+1),q=()=>h(!p),z=()=>f(null),$=x=>_(this,null,function*(){g(!0);const k=yield O.getEitherOrById(x);if(k.ok){const B=yield k.json();f(B.data),h(!0)}else console.error(R,yield k.json()),xe.error(R);g(!1)}),F=()=>b(!v),T=()=>{o(1),c(new Map)};return M?(xe.error(R),console.error(D),U(Ah,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e})):p?U(sj,{eitherOrById:d,setFilters:r,toggleScreen:q,clearEitherOrById:z}):y||!u.get(i)?U(Em,{}):ie(Se,{children:[ie(hH,{children:[U(Ah,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e}),U(fH,{filters:n,options:m,setOptions:A,setFilters:r,handleResetData:T}),u.get(i).length>0?ie(Se,{children:[ie("table",{className:"eow-w-full eow-border eow-border-gray-200 eow-mb-2 eow-table",children:[U(VI,{}),U(SP,{data:u.get(i),fetchEitherOrById:$,handleModal:F,setSelectedEitherOr:E})]}),U(PP,{pageCount:i,pageGames:u,getPreviousPage:N,getNextPage:H})]}):U("h2",{className:"eow-text-center eow-font-bold eow-text-xl eow-my-60",children:P})]}),U(cj,{isOpen:v,eitherOr:w,setFilters:r,handleClose:F})]})},mH=({fansUnitedEnvironment:t,hideSignOutButton:e})=>K.useContext(Ih)?U(jI,{children:U(pH,{fansUnitedEnvironment:t,hideSignOutButton:e})}):U(UI,{fansUnitedEnvironment:t}),gH=new iA({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),vH=t=>{const e=l$(t.fansUnitedApiKey,t.fansUnitedClientId,t.fansUnitedLanguage,t.fansUnitedEnvironment),n=u$(t.sportal365Project,t.sportal365Infrastructure);return U($I,{fansUnitedEnvironment:t.fansUnitedEnvironment,children:U(ab,{labels:t.labels,children:U(TP,{config:e,sportal365Config:n,children:ie(wA,{client:gH,children:[U(al,{position:"top-right",autoClose:5e3,hideProgressBar:!1,limit:3,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0}),U(mH,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})]})})})})};Be.EitherOrManager=vH,Object.defineProperties(Be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2335
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(T,x){if(!!T){if(typeof T=="string")return h(T,x);var k=Object.prototype.toString.call(T).slice(8,-1);if(k==="Object"&&T.constructor&&(k=T.constructor.name),k==="Map"||k==="Set")return Array.from(T);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return h(T,x)}}function f(T){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(T))return Array.from(T)}function p(T){if(Array.isArray(T))return h(T)}function h(T,x){(x==null||x>T.length)&&(x=T.length);for(var k=0,B=new Array(x);k<x;k++)B[k]=T[k];return B}function y(){return y=Object.assign||function(T){for(var x=1;x<arguments.length;x++){var k=arguments[x];for(var B in k)Object.prototype.hasOwnProperty.call(k,B)&&(T[B]=k[B])}return T},y.apply(this,arguments)}function g(T,x){if(T==null)return{};var k=v(T,x),B,W;if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(T);for(W=0;W<j.length;W++)B=j[W],!(x.indexOf(B)>=0)&&(!Object.prototype.propertyIsEnumerable.call(T,B)||(k[B]=T[B]))}return k}function v(T,x){if(T==null)return{};var k={},B=Object.keys(T),W,j;for(j=0;j<B.length;j++)W=B[j],!(x.indexOf(W)>=0)&&(k[W]=T[W]);return k}function b(T,x){var k=Object.keys(T);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(T);x&&(B=B.filter(function(W){return Object.getOwnPropertyDescriptor(T,W).enumerable})),k.push.apply(k,B)}return k}function w(T){for(var x=1;x<arguments.length;x++){var k=arguments[x]!=null?arguments[x]:{};x%2?b(Object(k),!0).forEach(function(B){D(T,B,k[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(k)):b(Object(k)).forEach(function(B){Object.defineProperty(T,B,Object.getOwnPropertyDescriptor(k,B))})}return T}function E(T,x){if(!(T instanceof x))throw new TypeError("Cannot call a class as a function")}function m(T,x){for(var k=0;k<x.length;k++){var B=x[k];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(T,B.key,B)}}function A(T,x,k){return x&&m(T.prototype,x),k&&m(T,k),T}function I(T,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(x&&x.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),x&&O(T,x)}function O(T,x){return O=Object.setPrototypeOf||function(B,W){return B.__proto__=W,B},O(T,x)}function C(T){var x=S();return function(){var B=M(T),W;if(x){var j=M(this).constructor;W=Reflect.construct(B,arguments,j)}else W=B.apply(this,arguments);return R(this,W)}}function R(T,x){return x&&(e(x)==="object"||typeof x=="function")?x:P(T)}function P(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function S(){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(T){return!1}}function M(T){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(k){return k.__proto__||Object.getPrototypeOf(k)},M(T)}function D(T,x,k){return x in T?Object.defineProperty(T,x,{value:k,enumerable:!0,configurable:!0,writable:!0}):T[x]=k,T}var L=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],N=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),H=["onCreate","onDestroy"],q=r.default.func,z=function(T){I(k,T);var x=C(k);function k(){var B;E(this,k);for(var W=arguments.length,j=new Array(W),Q=0;Q<W;Q++)j[Q]=arguments[Q];return B=x.call.apply(x,[this].concat(j)),D(P(B),"createFlatpickrInstance",function(){var Y=w({onClose:function(){B.node.blur&&B.node.blur()}},B.props.options);Y=$(Y,B.props),B.flatpickr=(0,i.default)(B.node,Y),B.props.hasOwnProperty("value")&&B.flatpickr.setDate(B.props.value,!1);var Z=B.props.onCreate;Z&&Z(B.flatpickr)}),D(P(B),"destroyFlatpickrInstance",function(){var Y=B.props.onDestroy;Y&&Y(B.flatpickr),B.flatpickr.destroy(),B.flatpickr=null}),D(P(B),"handleNodeChange",function(Y){B.node=Y,B.flatpickr&&(B.destroyFlatpickrInstance(),B.createFlatpickrInstance())}),B}return A(k,[{key:"componentDidUpdate",value:function(W){var j=this.props.options,Q=W.options;j=$(j,this.props),Q=$(Q,W);for(var Y=Object.getOwnPropertyNames(j),Z=Y.length-1;Z>=0;Z--){var ee=Y[Z],le=j[ee];le!==Q[ee]&&(L.indexOf(ee)!==-1&&!Array.isArray(le)&&(le=[le]),this.flatpickr.set(ee,le))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&W.value&&Array.isArray(W.value)&&this.props.value.every(function(me,ve){W[ve]}))&&this.props.value!==W.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 W=this.props,j=W.options,Q=W.defaultValue,Y=W.value,Z=W.children,ee=W.render,le=g(W,["options","defaultValue","value","children","render"]);return L.forEach(function(me){delete le[me]}),H.forEach(function(me){delete le[me]}),ee?ee(w(w({},le),{},{defaultValue:Q,value:Y}),this.handleNodeChange):j.wrap?n.default.createElement("div",y({},le,{ref:this.handleNodeChange}),Z):n.default.createElement("input",y({},le,{defaultValue:Q,ref:this.handleNodeChange}))}}]),k}(n.Component);D(z,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:N,onOpen:N,onClose:N,onMonthChange:N,onYearChange:N,onReady:N,onValueUpdate:N,onDayCreate:N,onCreate:q,onDestroy:q,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}),D(z,"defaultProps",{options:{}});function $(T,x){var k=w({},T);return L.forEach(function(B){if(x.hasOwnProperty(B)){var W;k[B]&&!Array.isArray(k[B])?k[B]=[k[B]]:k[B]||(k[B]=[]);var j=Array.isArray(x[B])?x[B]:[x[B]];(W=k[B]).push.apply(W,u(j))}}),k}var F=z;t.default=F})(ty);const bU=jw(ty);var Nt="top",Zt="bottom",en="right",Lt="left",Uc="auto",Pa=[Nt,Zt,en,Lt],_i="start",Ma="end",_U="clippingParents",uy="viewport",xa="popper",EU="reference",cy=Pa.reduce(function(t,e){return t.concat([e+"-"+_i,e+"-"+Ma])},[]),dy=[].concat(Pa,[Uc]).reduce(function(t,e){return t.concat([e,e+"-"+_i,e+"-"+Ma])},[]),IU="beforeRead",AU="read",OU="afterRead",CU="beforeMain",TU="main",SU="afterMain",PU="beforeWrite",MU="write",xU="afterWrite",RU=[IU,AU,OU,CU,TU,SU,PU,MU,xU];function Mn(t){return t?(t.nodeName||"").toLowerCase():null}function Wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Dr(t){var e=Wt(t).Element;return t instanceof e||t instanceof Element}function tn(t){var e=Wt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function $c(t){if(typeof ShadowRoot=="undefined")return!1;var e=Wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kU(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!tn(o)||!Mn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function DU(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,c){return u[c]="",u},{});!tn(i)||!Mn(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const fy={name:"applyStyles",enabled:!0,phase:"write",fn:kU,effect:DU,requires:["computeStyles"]};function xn(t){return t.split("-")[0]}var Fr=Math.max,Ws=Math.min,Ei=Math.round;function jc(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hy(){return!/^((?!chrome|android).)*safari/i.test(jc())}function Ii(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&tn(t)&&(i=t.offsetWidth>0&&Ei(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Ei(r.height)/t.offsetHeight||1);var s=Dr(t)?Wt(t):window,l=s.visualViewport,u=!hy()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:d,right:c+f,bottom:d+p,left:c,x:c,y:d}}function Hc(t){var e=Ii(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function py(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&$c(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Gn(t){return Wt(t).getComputedStyle(t)}function FU(t){return["table","td","th"].indexOf(Mn(t))>=0}function dr(t){return((Dr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gs(t){return Mn(t)==="html"?t:t.assignedSlot||t.parentNode||($c(t)?t.host:null)||dr(t)}function my(t){return!tn(t)||Gn(t).position==="fixed"?null:t.offsetParent}function NU(t){var e=/firefox/i.test(jc()),n=/Trident/i.test(jc());if(n&&tn(t)){var r=Gn(t);if(r.position==="fixed")return null}var i=Gs(t);for($c(i)&&(i=i.host);tn(i)&&["html","body"].indexOf(Mn(i))<0;){var o=Gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Ra(t){for(var e=Wt(t),n=my(t);n&&FU(n)&&Gn(n).position==="static";)n=my(n);return n&&(Mn(n)==="html"||Mn(n)==="body"&&Gn(n).position==="static")?e:n||NU(t)||e}function Vc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ka(t,e,n){return Fr(t,Ws(e,n))}function LU(t,e,n){var r=ka(t,e,n);return r>n?n:r}function gy(){return{top:0,right:0,bottom:0,left:0}}function vy(t){return Object.assign({},gy(),t)}function yy(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var BU=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,vy(typeof e!="number"?e:yy(e,Pa))};function UU(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=xn(n.placement),u=Vc(l),c=[Lt,en].indexOf(l)>=0,d=c?"height":"width";if(!(!o||!s)){var f=BU(i.padding,n),p=Hc(o),h=u==="y"?Nt:Lt,y=u==="y"?Zt:en,g=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],v=s[u]-n.rects.reference[u],b=Ra(o),w=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-v/2,m=f[h],A=w-p[d]-f[y],I=w/2-p[d]/2+E,O=ka(m,I,A),C=u;n.modifiersData[r]=(e={},e[C]=O,e.centerOffset=O-I,e)}}function $U(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!py(e.elements.popper,i)||(e.elements.arrow=i))}const jU={name:"arrow",enabled:!0,phase:"main",fn:UU,effect:$U,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ai(t){return t.split("-")[1]}var HU={top:"auto",right:"auto",bottom:"auto",left:"auto"};function VU(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Ei(n*i)/i||0,y:Ei(r*i)/i||0}}function wy(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,h=p===void 0?0:p,y=s.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var b=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),E=Lt,m=Nt,A=window;if(c){var I=Ra(n),O="clientHeight",C="clientWidth";if(I===Wt(n)&&(I=dr(n),Gn(I).position!=="static"&&l==="absolute"&&(O="scrollHeight",C="scrollWidth")),I=I,i===Nt||(i===Lt||i===en)&&o===Ma){m=Zt;var R=f&&I===A&&A.visualViewport?A.visualViewport.height:I[O];g-=R-r.height,g*=u?1:-1}if(i===Lt||(i===Nt||i===Zt)&&o===Ma){E=en;var P=f&&I===A&&A.visualViewport?A.visualViewport.width:I[C];h-=P-r.width,h*=u?1:-1}}var S=Object.assign({position:l},c&&HU),M=d===!0?VU({x:h,y:g},Wt(n)):{x:h,y:g};if(h=M.x,g=M.y,u){var D;return Object.assign({},S,(D={},D[m]=w?"0":"",D[E]=b?"0":"",D.transform=(A.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",D))}return Object.assign({},S,(e={},e[m]=w?g+"px":"",e[E]=b?h+"px":"",e.transform="",e))}function qU(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:xn(e.placement),variation:Ai(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,wy(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,wy(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const WU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qU,data:{}};var zs={passive:!0};function GU(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=Wt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(d){d.addEventListener("scroll",n.update,zs)}),l&&u.addEventListener("resize",n.update,zs),function(){o&&c.forEach(function(d){d.removeEventListener("scroll",n.update,zs)}),l&&u.removeEventListener("resize",n.update,zs)}}const zU={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GU,data:{}};var QU={left:"right",right:"left",bottom:"top",top:"bottom"};function Qs(t){return t.replace(/left|right|bottom|top/g,function(e){return QU[e]})}var YU={start:"end",end:"start"};function by(t){return t.replace(/start|end/g,function(e){return YU[e]})}function qc(t){var e=Wt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Wc(t){return Ii(dr(t)).left+qc(t).scrollLeft}function KU(t,e){var n=Wt(t),r=dr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var c=hy();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+Wc(t),y:u}}function JU(t){var e,n=dr(t),r=qc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Fr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Fr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Wc(t),u=-r.scrollTop;return Gn(i||n).direction==="rtl"&&(l+=Fr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function Gc(t){var e=Gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function _y(t){return["html","body","#document"].indexOf(Mn(t))>=0?t.ownerDocument.body:tn(t)&&Gc(t)?t:_y(Gs(t))}function Da(t,e){var n;e===void 0&&(e=[]);var r=_y(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Wt(r),s=i?[o].concat(o.visualViewport||[],Gc(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Da(Gs(s)))}function zc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function XU(t,e){var n=Ii(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Ey(t,e,n){return e===uy?zc(KU(t,n)):Dr(e)?XU(e,n):zc(JU(dr(t)))}function ZU(t){var e=Da(Gs(t)),n=["absolute","fixed"].indexOf(Gn(t).position)>=0,r=n&&tn(t)?Ra(t):t;return Dr(r)?e.filter(function(i){return Dr(i)&&py(i,r)&&Mn(i)!=="body"}):[]}function e5(t,e,n,r){var i=e==="clippingParents"?ZU(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,c){var d=Ey(t,c,r);return u.top=Fr(d.top,u.top),u.right=Ws(d.right,u.right),u.bottom=Ws(d.bottom,u.bottom),u.left=Fr(d.left,u.left),u},Ey(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Iy(t){var e=t.reference,n=t.element,r=t.placement,i=r?xn(r):null,o=r?Ai(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Nt:u={x:s,y:e.y-n.height};break;case Zt:u={x:s,y:e.y+e.height};break;case en:u={x:e.x+e.width,y:l};break;case Lt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?Vc(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(o){case _i:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Ma:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function Fa(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?_U:l,c=n.rootBoundary,d=c===void 0?uy:c,f=n.elementContext,p=f===void 0?xa:f,h=n.altBoundary,y=h===void 0?!1:h,g=n.padding,v=g===void 0?0:g,b=vy(typeof v!="number"?v:yy(v,Pa)),w=p===xa?EU:xa,E=t.rects.popper,m=t.elements[y?w:p],A=e5(Dr(m)?m:m.contextElement||dr(t.elements.popper),u,d,s),I=Ii(t.elements.reference),O=Iy({reference:I,element:E,strategy:"absolute",placement:i}),C=zc(Object.assign({},E,O)),R=p===xa?C:I,P={top:A.top-R.top+b.top,bottom:R.bottom-A.bottom+b.bottom,left:A.left-R.left+b.left,right:R.right-A.right+b.right},S=t.modifiersData.offset;if(p===xa&&S){var M=S[i];Object.keys(P).forEach(function(D){var L=[en,Zt].indexOf(D)>=0?1:-1,N=[Nt,Zt].indexOf(D)>=0?"y":"x";P[D]+=M[N]*L})}return P}function t5(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?dy:u,d=Ai(r),f=d?l?cy:cy.filter(function(y){return Ai(y)===d}):Pa,p=f.filter(function(y){return c.indexOf(y)>=0});p.length===0&&(p=f);var h=p.reduce(function(y,g){return y[g]=Fa(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[xn(g)],y},{});return Object.keys(h).sort(function(y,g){return h[y]-h[g]})}function n5(t){if(xn(t)===Uc)return[];var e=Qs(t);return[by(t),e,by(e)]}function r5(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,y=h===void 0?!0:h,g=n.allowedAutoPlacements,v=e.options.placement,b=xn(v),w=b===v,E=u||(w||!y?[Qs(v)]:n5(v)),m=[v].concat(E).reduce(function(B,W){return B.concat(xn(W)===Uc?t5(e,{placement:W,boundary:d,rootBoundary:f,padding:c,flipVariations:y,allowedAutoPlacements:g}):W)},[]),A=e.rects.reference,I=e.rects.popper,O=new Map,C=!0,R=m[0],P=0;P<m.length;P++){var S=m[P],M=xn(S),D=Ai(S)===_i,L=[Nt,Zt].indexOf(M)>=0,N=L?"width":"height",H=Fa(e,{placement:S,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),q=L?D?en:Lt:D?Zt:Nt;A[N]>I[N]&&(q=Qs(q));var z=Qs(q),$=[];if(o&&$.push(H[M]<=0),l&&$.push(H[q]<=0,H[z]<=0),$.every(function(B){return B})){R=S,C=!1;break}O.set(S,$)}if(C)for(var F=y?3:1,T=function(W){var j=m.find(function(Q){var Y=O.get(Q);if(Y)return Y.slice(0,W).every(function(Z){return Z})});if(j)return R=j,"break"},x=F;x>0;x--){var k=T(x);if(k==="break")break}e.placement!==R&&(e.modifiersData[r]._skip=!0,e.placement=R,e.reset=!0)}}const i5={name:"flip",enabled:!0,phase:"main",fn:r5,requiresIfExists:["offset"],data:{_skip:!1}};function Ay(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Oy(t){return[Nt,en,Zt,Lt].some(function(e){return t[e]>=0})}function a5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Fa(e,{elementContext:"reference"}),l=Fa(e,{altBoundary:!0}),u=Ay(s,r),c=Ay(l,i,o),d=Oy(u),f=Oy(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const o5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:a5};function s5(t,e,n){var r=xn(t),i=[Lt,Nt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[Lt,en].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function l5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=dy.reduce(function(d,f){return d[f]=s5(f,e.rects,o),d},{}),l=s[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const u5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:l5};function c5(t){var e=t.state,n=t.name;e.modifiersData[n]=Iy({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const d5={name:"popperOffsets",enabled:!0,phase:"read",fn:c5,data:{}};function f5(t){return t==="x"?"y":"x"}function h5(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,y=n.tetherOffset,g=y===void 0?0:y,v=Fa(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=xn(e.placement),w=Ai(e.placement),E=!w,m=Vc(b),A=f5(m),I=e.modifiersData.popperOffsets,O=e.rects.reference,C=e.rects.popper,R=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(!!I){if(o){var D,L=m==="y"?Nt:Lt,N=m==="y"?Zt:en,H=m==="y"?"height":"width",q=I[m],z=q+v[L],$=q-v[N],F=h?-C[H]/2:0,T=w===_i?O[H]:C[H],x=w===_i?-C[H]:-O[H],k=e.elements.arrow,B=h&&k?Hc(k):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:gy(),j=W[L],Q=W[N],Y=ka(0,O[H],B[H]),Z=E?O[H]/2-F-Y-j-P.mainAxis:T-Y-j-P.mainAxis,ee=E?-O[H]/2+F+Y+Q+P.mainAxis:x+Y+Q+P.mainAxis,le=e.elements.arrow&&Ra(e.elements.arrow),me=le?m==="y"?le.clientTop||0:le.clientLeft||0:0,ve=(D=S==null?void 0:S[m])!=null?D:0,Ae=q+Z-ve-me,Me=q+ee-ve,Ze=ka(h?Ws(z,Ae):z,q,h?Fr($,Me):$);I[m]=Ze,M[m]=Ze-q}if(l){var qe,te=m==="x"?Nt:Lt,re=m==="x"?Zt:en,ue=I[A],he=A==="y"?"height":"width",se=ue+v[te],Ee=ue-v[re],Oe=[Nt,Lt].indexOf(b)!==-1,Ce=(qe=S==null?void 0:S[A])!=null?qe:0,mt=Oe?se:ue-O[he]-C[he]-Ce+P.altAxis,Et=Oe?ue+O[he]+C[he]-Ce-P.altAxis:Ee,We=h&&Oe?LU(mt,ue,Et):ka(h?mt:se,ue,h?Et:Ee);I[A]=We,M[A]=We-ue}e.modifiersData[r]=M}}const p5={name:"preventOverflow",enabled:!0,phase:"main",fn:h5,requiresIfExists:["offset"]};function m5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function g5(t){return t===Wt(t)||!tn(t)?qc(t):m5(t)}function v5(t){var e=t.getBoundingClientRect(),n=Ei(e.width)/t.offsetWidth||1,r=Ei(e.height)/t.offsetHeight||1;return n!==1||r!==1}function y5(t,e,n){n===void 0&&(n=!1);var r=tn(e),i=tn(e)&&v5(e),o=dr(e),s=Ii(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Mn(e)!=="body"||Gc(o))&&(l=g5(e)),tn(e)?(u=Ii(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=Wc(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function w5(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function b5(t){var e=w5(t);return RU.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function _5(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function E5(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Cy={placement:"bottom",modifiers:[],strategy:"absolute"};function Ty(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function I5(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Cy:i;return function(l,u,c){c===void 0&&(c=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cy,o),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],p=!1,h={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;g(),d.options=Object.assign({},o,d.options,w),d.scrollParents={reference:Dr(l)?Da(l):l.contextElement?Da(l.contextElement):[],popper:Da(u)};var E=b5(E5([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(m){return m.enabled}),y(),h.update()},forceUpdate:function(){if(!p){var b=d.elements,w=b.reference,E=b.popper;if(!!Ty(w,E)){d.rects={reference:y5(w,Ra(E),d.options.strategy==="fixed"),popper:Hc(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var A=d.orderedModifiers[m],I=A.fn,O=A.options,C=O===void 0?{}:O,R=A.name;typeof I=="function"&&(d=I({state:d,options:C,name:R,instance:h})||d)}}}},update:_5(function(){return new Promise(function(v){h.forceUpdate(),v(d)})}),destroy:function(){g(),p=!0}};if(!Ty(l,u))return h;h.setOptions(c).then(function(v){!p&&c.onFirstUpdate&&c.onFirstUpdate(v)});function y(){d.orderedModifiers.forEach(function(v){var b=v.name,w=v.options,E=w===void 0?{}:w,m=v.effect;if(typeof m=="function"){var A=m({state:d,name:b,instance:h,options:E}),I=function(){};f.push(A||I)}})}function g(){f.forEach(function(v){return v()}),f=[]}return h}}var A5=[zU,d5,WU,fy,u5,i5,p5,jU,o5],O5=I5({defaultModifiers:A5}),C5="tippy-box",Sy="tippy-content",T5="tippy-backdrop",Py="tippy-arrow",My="tippy-svg-arrow",Nr={passive:!0,capture:!0},xy=function(){return document.body};function Qc(t,e,n){if(Array.isArray(t)){var r=t[e];return r==null?Array.isArray(n)?n[e]:n:r}return t}function Yc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ry(t,e){return typeof t=="function"?t.apply(void 0,e):t}function ky(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function S5(t){return t.split(/\s+/).filter(Boolean)}function Oi(t){return[].concat(t)}function Dy(t,e){t.indexOf(e)===-1&&t.push(e)}function P5(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function M5(t){return t.split("-")[0]}function Ys(t){return[].slice.call(t)}function Fy(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Na(){return document.createElement("div")}function Ks(t){return["Element","Fragment"].some(function(e){return Yc(t,e)})}function x5(t){return Yc(t,"NodeList")}function R5(t){return Yc(t,"MouseEvent")}function k5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function D5(t){return Ks(t)?[t]:x5(t)?Ys(t):Array.isArray(t)?t:Ys(document.querySelectorAll(t))}function Kc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Ny(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function F5(t){var e,n=Oi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function N5(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,c=M5(s.placement),d=s.modifiersData.offset;if(!d)return!0;var f=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,y=c==="left"?d.right.x:0,g=o.top-r+f>u,v=r-o.bottom-p>u,b=o.left-n+h>u,w=n-o.right-y>u;return g||v||b||w})}function Jc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Ly(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Rn={isTouch:!1},By=0;function L5(){Rn.isTouch||(Rn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Uy))}function Uy(){var t=performance.now();t-By<20&&(Rn.isTouch=!1,document.removeEventListener("mousemove",Uy)),By=t}function B5(){var t=document.activeElement;if(k5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function U5(){document.addEventListener("touchstart",L5,Nr),window.addEventListener("blur",B5)}var $5=typeof window!="undefined"&&typeof document!="undefined",j5=$5?!!window.msCrypto:!1,H5={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},V5={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},hn=Object.assign({appendTo:xy,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},H5,V5),q5=Object.keys(hn),W5=function(e){var n=Object.keys(e);n.forEach(function(r){hn[r]=e[r]})};function $y(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=hn[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function G5(t,e){var n=e?Object.keys($y(Object.assign({},hn,{plugins:e}))):q5,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch(l){i[o]=s}return i},{});return r}function jy(t,e){var n=Object.assign({},e,{content:Ry(e.content,[t])},e.ignoreAttributes?{}:G5(t,e.plugins));return n.aria=Object.assign({},hn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var z5=function(){return"innerHTML"};function Xc(t,e){t[z5()]=e}function Hy(t){var e=Na();return t===!0?e.className=Py:(e.className=My,Ks(t)?e.appendChild(t):Xc(e,t)),e}function Vy(t,e){Ks(e.content)?(Xc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Xc(t,e.content):t.textContent=e.content)}function Zc(t){var e=t.firstElementChild,n=Ys(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Sy)}),arrow:n.find(function(r){return r.classList.contains(Py)||r.classList.contains(My)}),backdrop:n.find(function(r){return r.classList.contains(T5)})}}function qy(t){var e=Na(),n=Na();n.className=C5,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Na();r.className=Sy,r.setAttribute("data-state","hidden"),Vy(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Zc(e),u=l.box,c=l.content,d=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vy(c,t.props),s.arrow?d?o.arrow!==s.arrow&&(u.removeChild(d),u.appendChild(Hy(s.arrow))):u.appendChild(Hy(s.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}qy.$$tippy=!0;var Q5=1,Js=[],ed=[];function Y5(t,e){var n=jy(t,Object.assign({},hn,$y(Fy(e)))),r,i,o,s=!1,l=!1,u=!1,c=!1,d,f,p,h=[],y=ky(Ae,n.interactiveDebounce),g,v=Q5++,b=null,w=P5(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:v,reference:t,popper:Na(),popperInstance:b,props:n,state:E,plugins:w,clearDelayTimeouts:mt,setProps:Et,setContent:We,show:Ti,hide:et,hideWithInteractivity:nn,enable:Oe,disable:Ce,unmount:el,destroy:fd};if(!n.render)return m;var A=n.render(m),I=A.popper,O=A.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+m.id,m.popper=I,t._tippy=m,I._tippy=m;var C=w.map(function(ae){return ae.fn(m)}),R=t.hasAttribute("aria-expanded");return le(),F(),q(),z("onCreate",[m]),n.showOnCreate&&se(),I.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",y)}),m;function P(){var ae=m.props.touch;return Array.isArray(ae)?ae:[ae,0]}function S(){return P()[0]==="hold"}function M(){var ae;return!!((ae=m.props.render)!=null&&ae.$$tippy)}function D(){return g||t}function L(){var ae=D().parentNode;return ae?F5(ae):document}function N(){return Zc(I)}function H(ae){return m.state.isMounted&&!m.state.isVisible||Rn.isTouch||d&&d.type==="focus"?0:Qc(m.props.delay,ae?0:1,hn.delay)}function q(ae){ae===void 0&&(ae=!1),I.style.pointerEvents=m.props.interactive&&!ae?"":"none",I.style.zIndex=""+m.props.zIndex}function z(ae,fe,Ie){if(Ie===void 0&&(Ie=!0),C.forEach(function(De){De[ae]&&De[ae].apply(De,fe)}),Ie){var Le;(Le=m.props)[ae].apply(Le,fe)}}function $(){var ae=m.props.aria;if(!!ae.content){var fe="aria-"+ae.content,Ie=I.id,Le=Oi(m.props.triggerTarget||t);Le.forEach(function(De){var ft=De.getAttribute(fe);if(m.state.isVisible)De.setAttribute(fe,ft?ft+" "+Ie:Ie);else{var Ot=ft&&ft.replace(Ie,"").trim();Ot?De.setAttribute(fe,Ot):De.removeAttribute(fe)}})}}function F(){if(!(R||!m.props.aria.expanded)){var ae=Oi(m.props.triggerTarget||t);ae.forEach(function(fe){m.props.interactive?fe.setAttribute("aria-expanded",m.state.isVisible&&fe===D()?"true":"false"):fe.removeAttribute("aria-expanded")})}}function T(){L().removeEventListener("mousemove",y),Js=Js.filter(function(ae){return ae!==y})}function x(ae){if(!(Rn.isTouch&&(u||ae.type==="mousedown"))){var fe=ae.composedPath&&ae.composedPath()[0]||ae.target;if(!(m.props.interactive&&Ly(I,fe))){if(Oi(m.props.triggerTarget||t).some(function(Ie){return Ly(Ie,fe)})){if(Rn.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else z("onClickOutside",[m,ae]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),l=!0,setTimeout(function(){l=!1}),m.state.isMounted||j())}}}function k(){u=!0}function B(){u=!1}function W(){var ae=L();ae.addEventListener("mousedown",x,!0),ae.addEventListener("touchend",x,Nr),ae.addEventListener("touchstart",B,Nr),ae.addEventListener("touchmove",k,Nr)}function j(){var ae=L();ae.removeEventListener("mousedown",x,!0),ae.removeEventListener("touchend",x,Nr),ae.removeEventListener("touchstart",B,Nr),ae.removeEventListener("touchmove",k,Nr)}function Q(ae,fe){Z(ae,function(){!m.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&fe()})}function Y(ae,fe){Z(ae,fe)}function Z(ae,fe){var Ie=N().box;function Le(De){De.target===Ie&&(Jc(Ie,"remove",Le),fe())}if(ae===0)return fe();Jc(Ie,"remove",f),Jc(Ie,"add",Le),f=Le}function ee(ae,fe,Ie){Ie===void 0&&(Ie=!1);var Le=Oi(m.props.triggerTarget||t);Le.forEach(function(De){De.addEventListener(ae,fe,Ie),h.push({node:De,eventType:ae,handler:fe,options:Ie})})}function le(){S()&&(ee("touchstart",ve,{passive:!0}),ee("touchend",Me,{passive:!0})),S5(m.props.trigger).forEach(function(ae){if(ae!=="manual")switch(ee(ae,ve),ae){case"mouseenter":ee("mouseleave",Me);break;case"focus":ee(j5?"focusout":"blur",Ze);break;case"focusin":ee("focusout",Ze);break}})}function me(){h.forEach(function(ae){var fe=ae.node,Ie=ae.eventType,Le=ae.handler,De=ae.options;fe.removeEventListener(Ie,Le,De)}),h=[]}function ve(ae){var fe,Ie=!1;if(!(!m.state.isEnabled||qe(ae)||l)){var Le=((fe=d)==null?void 0:fe.type)==="focus";d=ae,g=ae.currentTarget,F(),!m.state.isVisible&&R5(ae)&&Js.forEach(function(De){return De(ae)}),ae.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?Ie=!0:se(ae),ae.type==="click"&&(s=!Ie),Ie&&!Le&&Ee(ae)}}function Ae(ae){var fe=ae.target,Ie=D().contains(fe)||I.contains(fe);if(!(ae.type==="mousemove"&&Ie)){var Le=he().concat(I).map(function(De){var ft,Ot=De._tippy,Ct=(ft=Ot.popperInstance)==null?void 0:ft.state;return Ct?{popperRect:De.getBoundingClientRect(),popperState:Ct,props:n}:null}).filter(Boolean);N5(Le,ae)&&(T(),Ee(ae))}}function Me(ae){var fe=qe(ae)||m.props.trigger.indexOf("click")>=0&&s;if(!fe){if(m.props.interactive){m.hideWithInteractivity(ae);return}Ee(ae)}}function Ze(ae){m.props.trigger.indexOf("focusin")<0&&ae.target!==D()||m.props.interactive&&ae.relatedTarget&&I.contains(ae.relatedTarget)||Ee(ae)}function qe(ae){return Rn.isTouch?S()!==ae.type.indexOf("touch")>=0:!1}function te(){re();var ae=m.props,fe=ae.popperOptions,Ie=ae.placement,Le=ae.offset,De=ae.getReferenceClientRect,ft=ae.moveTransition,Ot=M()?Zc(I).arrow:null,Ct=De?{getBoundingClientRect:De,contextElement:De.contextElement||D()}:t,tl={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(G){var X=G.state;if(M()){var ne=N(),de=ne.box;["placement","reference-hidden","escaped"].forEach(function(pe){pe==="placement"?de.setAttribute("data-placement",X.placement):X.attributes.popper["data-popper-"+pe]?de.setAttribute("data-"+pe,""):de.removeAttribute("data-"+pe)}),X.attributes.popper={}}}},Qn=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ft}},tl];M()&&Ot&&Qn.push({name:"arrow",options:{element:Ot,padding:3}}),Qn.push.apply(Qn,(fe==null?void 0:fe.modifiers)||[]),m.popperInstance=O5(Ct,I,Object.assign({},fe,{placement:Ie,onFirstUpdate:p,modifiers:Qn}))}function re(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function ue(){var ae=m.props.appendTo,fe,Ie=D();m.props.interactive&&ae===xy||ae==="parent"?fe=Ie.parentNode:fe=Ry(ae,[Ie]),fe.contains(I)||fe.appendChild(I),m.state.isMounted=!0,te()}function he(){return Ys(I.querySelectorAll("[data-tippy-root]"))}function se(ae){m.clearDelayTimeouts(),ae&&z("onTrigger",[m,ae]),W();var fe=H(!0),Ie=P(),Le=Ie[0],De=Ie[1];Rn.isTouch&&Le==="hold"&&De&&(fe=De),fe?r=setTimeout(function(){m.show()},fe):m.show()}function Ee(ae){if(m.clearDelayTimeouts(),z("onUntrigger",[m,ae]),!m.state.isVisible){j();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ae.type)>=0&&s)){var fe=H(!1);fe?i=setTimeout(function(){m.state.isVisible&&m.hide()},fe):o=requestAnimationFrame(function(){m.hide()})}}function Oe(){m.state.isEnabled=!0}function Ce(){m.hide(),m.state.isEnabled=!1}function mt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Et(ae){if(!m.state.isDestroyed){z("onBeforeUpdate",[m,ae]),me();var fe=m.props,Ie=jy(t,Object.assign({},fe,Fy(ae),{ignoreAttributes:!0}));m.props=Ie,le(),fe.interactiveDebounce!==Ie.interactiveDebounce&&(T(),y=ky(Ae,Ie.interactiveDebounce)),fe.triggerTarget&&!Ie.triggerTarget?Oi(fe.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):Ie.triggerTarget&&t.removeAttribute("aria-expanded"),F(),q(),O&&O(fe,Ie),m.popperInstance&&(te(),he().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),z("onAfterUpdate",[m,ae])}}function We(ae){m.setProps({content:ae})}function Ti(){var ae=m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Rn.isTouch&&!m.props.touch,De=Qc(m.props.duration,0,hn.duration);if(!(ae||fe||Ie||Le)&&!D().hasAttribute("disabled")&&(z("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,M()&&(I.style.visibility="visible"),q(),W(),m.state.isMounted||(I.style.transition="none"),M()){var ft=N(),Ot=ft.box,Ct=ft.content;Kc([Ot,Ct],0)}p=function(){var Qn;if(!(!m.state.isVisible||c)){if(c=!0,I.offsetHeight,I.style.transition=m.props.moveTransition,M()&&m.props.animation){var V=N(),G=V.box,X=V.content;Kc([G,X],De),Ny([G,X],"visible")}$(),F(),Dy(ed,m),(Qn=m.popperInstance)==null||Qn.forceUpdate(),z("onMount",[m]),m.props.animation&&M()&&Y(De,function(){m.state.isShown=!0,z("onShown",[m])})}},ue()}}function et(){var ae=!m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Qc(m.props.duration,1,hn.duration);if(!(ae||fe||Ie)&&(z("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,s=!1,M()&&(I.style.visibility="hidden"),T(),j(),q(!0),M()){var De=N(),ft=De.box,Ot=De.content;m.props.animation&&(Kc([ft,Ot],Le),Ny([ft,Ot],"hidden"))}$(),F(),m.props.animation?M()&&Q(Le,m.unmount):m.unmount()}}function nn(ae){L().addEventListener("mousemove",y),Dy(Js,y),y(ae)}function el(){m.state.isVisible&&m.hide(),m.state.isMounted&&(re(),he().forEach(function(ae){ae._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),ed=ed.filter(function(ae){return ae!==m}),m.state.isMounted=!1,z("onHidden",[m]))}function fd(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),me(),delete t._tippy,m.state.isDestroyed=!0,z("onDestroy",[m]))}}function La(t,e){e===void 0&&(e={});var n=hn.plugins.concat(e.plugins||[]);U5();var r=Object.assign({},e,{plugins:n}),i=D5(t),o=i.reduce(function(s,l){var u=l&&Y5(l,r);return u&&s.push(u),s},[]);return Ks(t)?o[0]:o}La.defaultProps=hn,La.setDefaultProps=W5,La.currentInput=Rn,Object.assign({},fy,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),La.setDefaultProps({render:qy});function Wy(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Gy=typeof window!="undefined"&&typeof document!="undefined";function td(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function zy(){return Gy&&document.createElement("div")}function K5(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function Qy(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!Qy(t[n],e[n]))return!1}else return!1;return!0}else return!1}function J5(t){var e=[];return t.forEach(function(n){e.find(function(r){return Qy(n,r)})||e.push(n)}),e}function X5(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:J5([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var nd=Gy?K.useLayoutEffect:K.useEffect;function Z5(t){var e=K.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function Yy(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var e$={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var l;return!!((l=e.props.render)!=null&&l.$$tippy)};function i(){e.props.className&&!r()||Yy(n,"add",e.props.className)}function o(){r()&&Yy(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function t$(t){function e(n){var r=n.children,i=n.content,o=n.visible,s=n.singleton,l=n.render,u=n.reference,c=n.disabled,d=c===void 0?!1:c,f=n.ignoreAttributes,p=f===void 0?!0:f;n.__source,n.__self;var h=Wy(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),y=o!==void 0,g=s!==void 0,v=K.useState(!1),b=v[0],w=v[1],E=K.useState({}),m=E[0],A=E[1],I=K.useState(),O=I[0],C=I[1],R=Z5(function(){return{container:zy(),renders:1}}),P=Object.assign({ignoreAttributes:p},h,{content:R.container});y&&(P.trigger="manual",P.hideOnClick=!1),g&&(d=!0);var S=P,M=P.plugins||[];l&&(S=Object.assign({},P,{plugins:g&&s.data!=null?[].concat(M,[{fn:function(){return{onTrigger:function(H,q){var z=s.data.children.find(function($){var F=$.instance;return F.reference===q.currentTarget});H.state.$$activeSingletonInstance=z.instance,C(z.content)}}}}]):M,render:function(){return{popper:R.container}}}));var D=[u].concat(r?[r.type]:[]);return nd(function(){var L=u;u&&u.hasOwnProperty("current")&&(L=u.current);var N=t(L||R.ref||zy(),Object.assign({},S,{plugins:[e$].concat(P.plugins||[])}));return R.instance=N,d&&N.disable(),o&&N.show(),g&&s.hook({instance:N,content:i,props:S,setSingletonContent:C}),w(!0),function(){N.destroy(),s==null||s.cleanup(N)}},D),nd(function(){var L;if(R.renders===1){R.renders++;return}var N=R.instance;N.setProps(X5(N.props,S)),(L=N.popperInstance)==null||L.forceUpdate(),d?N.disable():N.enable(),y&&(o?N.show():N.hide()),g&&s.hook({instance:N,content:i,props:S,setSingletonContent:C})}),nd(function(){var L;if(!!l){var N=R.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((L=N.props.popperOptions)==null?void 0:L.modifiers)||[]).filter(function(H){var q=H.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var z,$=q.state,F=(z=$.modifiersData)==null?void 0:z.hide;(m.placement!==$.placement||m.referenceHidden!==(F==null?void 0:F.isReferenceHidden)||m.escaped!==(F==null?void 0:F.hasPopperEscaped))&&A({placement:$.placement,referenceHidden:F==null?void 0:F.isReferenceHidden,escaped:F==null?void 0:F.hasPopperEscaped}),$.attributes.popper={}}}])})})}},[m.placement,m.referenceHidden,m.escaped].concat(D)),ie(Se,{children:[r?K.cloneElement(r,{ref:function(N){R.ref=N,td(r.ref,N)}}):null,b&&Ge.createPortal(l?l(K5(m),O,R.instance):i,R.container)]})}return e}var n$=function(t,e){return K.forwardRef(function(r,i){var o=r.children,s=Wy(r,["children"]);return U(t,oe(J({},Object.assign({},e,s)),{children:o?K.cloneElement(o,{ref:function(u){td(i,u),td(o.ref,u)}}):null}))})},r$=n$(t$(La));const i$=r$,a$=({onClick:t})=>{const{clear:e}=be(Pe);return U(i$,{content:e,children:U("button",{onClick:t,"data-testid":"clear",className:"eow-border eow-rounded eow-ml-2 eow-px-3 eow-flex eow-items-center",children:U("svg",{xmlns:"http://www.w3.org/2000/svg",className:"eow-h-4 eow-w-4 ",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:U("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})},o$=({setFilters:t})=>{const[e,n]=K.useState(!1),r=K.useRef(null),{clearFromToFilterSportal365ImagesMessage:i,dateFromTo:o,dateFromToPlaceholder:s}=be(Pe);return ie("div",{"data-testid":"from/to filter",children:[U("label",{htmlFor:"date from/to",className:Jt,children:o}),ie("div",{className:"eow-flex eow-flex-row",children:[U(bU,{ref:r,className:"eow-flex-1",placeholder:s,options:{mode:"range",enableTime:!1,dateFormat:"YYYY-MM-DD",altFormat:"YYYY-MM-DD",altInput:!0,position:"below",altInputClass:fa,parseDate:(c,d)=>na(c,d).toDate(),formatDate:(c,d)=>na(c).format(d),defaultDate:null},onChange:c=>{if(c&&c.length>1){n(!0);const d="YYYY-MM-DD",f=na(c[0]).format(d),p=na(c[1]).format(d);t({from:f,to:p})}else c.length===0&&!e&&(t(null),xe.info(i))}}),e?U(a$,{onClick:()=>{r.current.flatpickr.clear(),n(!1),t(null)}}):U(Se,{})]})]})};class s${constructor(){a(this,"id");a(this,"value");a(this,"label")}}class Ky extends s${constructor(){super(...arguments);a(this,"logo");a(this,"countryName");a(this,"countryFlag")}}const l$=(t,e,n,r)=>({apiKey:t,clientId:e,lang:n||"en",environment:r||"prod",idSchema:"native",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}}),u$=(t,e)=>!t&&!e?null:!t&&e?(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:t,authorization:`Bearer ${e&&e==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},Jy=t=>{document.getElementById(t).scrollIntoView({behavior:"smooth"})},rd={container:t=>J({},t),control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",textTransform:"capitalize"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>oe(J({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"},textTransform:"capitalize"})},c$=t=>{let e=new Ky;return e.label=t.name,e.value=t.name,e.id=t.id,t.birthDate?e.logo=t.assets&&t.assets.headshot&&t.assets.headshot:e.logo=t.assets&&t.assets.logo&&t.assets.logo,e.countryName=t.country.name,e.countryFlag=t.country.assets&&t.country.assets.flag?t.country.assets.flag:_n.country,e},d$=({setQuery:t,setFilters:e})=>{const[n,r]=K.useState(!1),[i,o]=K.useState(null),{searchImages:s,hideFilters:l,showFilters:u}=be(Pe),c=()=>r(!n),d=h=>{o(h),t((h==null?void 0:h.value)||"")},p=Xu((h,y)=>{h&&y([{id:h,value:h,label:h}])},300);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"search image",className:Jt,children:s}),U(Rc,{components:{DropdownIndicator:null},loadOptions:p,isClearable:!0,styles:rd,getOptionValue:h=>h.id,onChange:d,value:i,placeholder:"",className:"eow-mb-1"}),U("a",{className:"eow-flex eow-justify-end eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-cursor-pointer eow-mb-4",onClick:c,children:n?l:u}),n?U(o$,{setFilters:e}):U(Se,{})]})},id="sportal365-images-search",f$=({imageNode:t,onChangeImages:e,setShowImagesContainer:n})=>{const[r,i]=K.useState(null),[o,s]=K.useState(""),[l,u]=K.useState(1),[c,d]=K.useState(null),[f,p]=K.useState(!1),h=K.useRef(!1),{https:y}=be(ln),{searchSportal365ImagesErrorMessage:g,noImagesFound:v}=be(Pe);K.useEffect(()=>(h.current?b():h.current=!0,()=>i(null)),[o,c,l]);const b=()=>_(this,null,function*(){if(o){p(!0);const A=yield y.fetchImagesFromSportal365(o,c,l),I=yield A.json();A.ok?(i(I),u(I.meta.pagination.current_page)):(console.error(I),xe.error(g)),p(!1)}else i(null)}),w=()=>{u(A=>A-1),Jy(id)},E=()=>{u(A=>A+1),Jy(id)};return ie("div",{id,className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded eow-bg-gray-100",children:[U("div",{className:"eow-flex eow-justify-end",children:U(Qu,{isDisabled:!1,onClick:()=>{n(A=>oe(J({},A),{[t]:!A[t]}))}})}),U(d$,{setQuery:s,setFilters:d}),r?ie(Se,{children:[U("div",{className:"eow-grid xl:eow-grid-cols-4 md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:r.data.map(A=>{var I,O;return ie("div",{className:"eow-relative eow-cursor-pointer eow-group eow-mb-2",onClick:()=>{var C,R;return e((R=(C=A.urls)==null?void 0:C.uploaded)==null?void 0:R.embed)},children:[U("img",{src:(O=(I=A.urls)==null?void 0:I.uploaded)==null?void 0:O.thumbnail,alt:"Sportal365 image",className:"eow-object-cover eow-w-full eow-h-full"}),U("div",{className:"eow-absolute eow-inset-0 eow-bg-black eow-bg-opacity-0 group-hover:eow-bg-opacity-50 eow-flex eow-justify-center eow-items-center eow-transition eow-duration-300",children:U("span",{className:"eow-text-white eow-text-4xl eow-opacity-0 group-hover:eow-opacity-100 eow-transition eow-duration-300",children:"+"})})]},A.id)})}),U(MN,{pageCount:r==null?void 0:r.meta.pagination.current_page,images:r,getPreviousPage:w,getNextPage:E})]}):U(Se,{}),r&&r.data.length===0?U("p",{className:"eow-text-center eow-font-bold eow-mb-4",children:v}):U(Se,{}),f?U(Em,{}):U(Se,{})]})},h$=({imageUrl:t,isOpen:e,closeModal:n})=>{K.useLayoutEffect(()=>(e&&document.body.addEventListener("keydown",r),()=>{document.body.removeEventListener("keydown",r)}),[n]);const r=i=>i.key==="Escape"?n():null;return e?U(Am,{wrapperId:"image-modal",children:ie("div",{className:"eow-fixed eow-inset-0 eow-z-20 eow-flex eow-items-center eow-justify-center eow-bg-black eow-bg-opacity-50 eow-animate-fadeIn",children:[U("div",{className:"eow-absolute eow-top-0 eow-right-0 eow-m-4",children:U("button",{className:"eow-text-white eow-text-2xl eow-bg-transparent",onClick:n,children:"X"})}),U("div",{className:"eow-flex eow-items-center eow-justify-center eow-h-full",children:U("img",{src:t,alt:"Image modal",className:"eow-w-full eow-object-cover"})})]})}):null},ad={mainImage:!1,coverImage:!1,mobileImage:!1},Xy={main_logo:!1,mobile_logo:!1,background_image:!1,mobile_background_image:!1,additional_image:!1},Xs=({id:t,type:e,label:n,imageUrl:r,imageNode:i,onChange:o})=>{const[s,l]=K.useState(e==="branding"?Xy:ad),[u,c]=K.useState(e==="branding"?Xy:ad),[d,f]=K.useState(!1),{https:p}=be(ln),h=()=>f(!1),y=(v,b)=>{c(ad),o(v,b)},g=(v,b)=>{navigator.clipboard.writeText(v).then(()=>{c(w=>oe(J({},w),{[b]:!0}))}).catch(w=>{console.error("Failed to copy: ",w),c(E=>oe(J({},E),{[b]:!1}))})};return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:n,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:n}),ie("div",{className:"eow-w-full eow-border eow-rounded eow-overflow-hidden eow-p-2",children:[ie("div",{className:"eow-grid lg:eow-grid-cols-8 eow-grid-cols-1 eow-gap-2 eow-mb-2",children:[U("div",{className:"lg:eow-col-span-2",children:r?ie(Se,{children:[U("img",{src:r,alt:"Card Image",className:"eow-w-full eow-object-cover eow-cursor-pointer",onClick:()=>f(!0)}),U(h$,{imageUrl:r,isOpen:d,closeModal:h})]}):U("div",{className:"eow-bg-gray-200 lg:eow-min-w-16 eow-min-h-24 eow-flex eow-justify-center eow-items-center eow-p-5",children:U("img",{src:_n.image,alt:"Card image"})})}),ie("div",{className:"eow-flex eow-flex-col eow-col-span-6",children:[ie("div",{className:"eow-grid eow-grid-cols-2 eow-gap-2 eow-mb-2",children:[U(CN,{imageNode:i,onChangeImages:y,type:e,id:t}),U(TN,{isDisabled:!r,isUrlCopied:u[i],onClick:()=>g(r||"",i)})]}),p.sportal365Config?U(PN,{imageNode:i,setShowImagesContainer:l}):U(Se,{})]})]}),s[i]?U(f$,{onChangeImages:v=>y(v,i),setShowImagesContainer:l,imageNode:i}):U(Se,{})]})]})},Zy=({id:t,type:e,loadedImages:n,onChange:r})=>{const[i,o]=K.useState(!1),s=()=>o(!i),l=be(Pe),u=e==="game"?Array.from(Cm.keys()):Array.from(LP.keys());return ie(Se,{children:[U(Xs,{id:t,type:e,label:l.main,imageUrl:n==null?void 0:n.main,imageNode:"mainImage",onChange:r}),U("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:s,children:i?l.hideMoreImages:l.showMoreImages}),i?U(Se,{children:u.map((c,d)=>U(Xs,{id:t,type:e,label:l[c],imageUrl:n&&n[c]?n[c]:"",imageNode:Cm.get(c),onChange:r},`${c}-${d}`))}):U(Se,{})]})},p$=({id:t,loadedImages:e,onChange:n})=>{const r=be(Pe);return U(_N,{images:r.optionImages,children:U(Zy,{id:t,type:"option",loadedImages:e,onChange:n})})},ew=new ai,m$=5,g$=100,v$=({options:t,setRequestBody:e})=>{const{label:n,labelOptionPlaceholder:r,options:i,optionNumber:o,optionsDescription:s}=be(Pe),l=ew.constructOptions(t),u=(y,g)=>{y.persist();const v=Array.from(l);v[g].label=y.target.value,h(v)},c=(y,g)=>{const v=Array.from(l);v[g].value=y,h(v)},d=(y,g,v)=>{const b=y||null,w=Array.from(l);switch(g){case"mainImage":w[v].images.main=b,h(w);break;case"mobileImage":w[v].images.mobile=b,h(w);break}},f=()=>{const y=Array.from(l).sort((w,E)=>parseInt(E.id)-parseInt(w.id))[0].id,g=`${parseInt(y)+1}`,v=ew.constructEmptyOption(g),b=Array.from(l);b.push(v),h(b)},p=y=>{const g=l.filter((v,b)=>b!==y);h(g)},h=y=>{e(g=>oe(J({},g),{options:y}))};return ie("div",{className:"eow-mb-4",children:[ie("div",{className:"eow-mb-2",children:[U("h3",{className:Jt,children:i}),U("p",{className:"eow-text-gray-400 eow-text-sm",children:s})]}),ie("div",{className:"eow-grid eow-grid-cols-1 lg:eow-grid-cols-2 2xl:eow-grid-cols-3 eow-gap-4 eow-mb-1",children:[l.map((y,g)=>ie("div",{className:"eow-overflow-visible eow-shadow-l eow-border eow-border-gray-200",children:[ie("div",{className:"eow-bg-gray-100 eow-flex eow-justify-between eow-px-3 eow-py-2",children:[ie("h2",{className:"eow-card-title",children:[o," ",g+1]}),U(Qu,{isDisabled:l.length===m$,onClick:()=>p(g)})]}),ie("div",{className:"eow-p-3",children:[ie("div",{className:"eow-grid sm:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[U(bN,{label:n,defaultValue:y.label,placeholder:r,onChange:v=>u(v,g)}),U(va,{type:"options_value",defaultValue:y.value,onChange:v=>c(v,g)})]}),U(p$,{id:g,loadedImages:y.images,onChange:(v,b)=>d(v,b,g)})]})]},`points_number_${y.id}_${g}`)),U(zu,{isDisabled:l.length===g$,onClick:f})]})]})},y$=({requestBody:t,setRequestBody:e,description:n,setDescription:r})=>{const i=be(Pe),o=s=>{s.persist(),e(l=>oe(J({},l),{title:s.target.value}))};return ie("div",{className:"md:eow-w-4/6 eow-w-full",children:[U(BP,{value:(t==null?void 0:t.id)||null}),U(bt,{title:i.title,placeholder:i.titlePlaceholder,onChange:o,defaultValue:t.title||""}),U(Gu,{defaultValue:n,setValue:r,property:"description"}),U(wN,{points:t.points,setRequestBody:e}),U(v$,{options:t.options,setRequestBody:e})]})},zn=({title:t,children:e})=>{const[n,r]=K.useState(!1);return ie("div",{className:"eow-border-b eow-border-gray-200 eow-mb-2",children:[ie("button",{className:"eow-flex eow-justify-between eow-py-2 eow-px-4 eow-py-2 eow-px-4 eow-w-full eow-text-left eow-text-gray-800 eow-font-semibold eow-bg-gray-100 hover:eow-bg-gray-200 focus:eow-outline-none",onClick:()=>r(!n),children:[U("span",{children:t}),U("img",{src:n?_n.upArrow:_n.downArrow,alt:"Up arrow",className:"eow-w-6 eow-h-6"})]}),n&&U("div",{className:"eow-border eow-border-gray-200 eow-p-4",children:e})]})},w$=({defaultValue:t,onChange:e})=>{const{https:n}=be(ln),{type:r,typeDescription:i,noType:o}=be(Pe),{data:s}=du({queryKey:["eitherOrTypes"],queryFn:()=>n.getEitherOrTypes()});return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"type",className:Jt,children:r}),ie("select",{id:"quizType",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:e,defaultValue:t||"",children:[U("option",{value:"",children:o}),s?s.map((l,u)=>U("option",{id:l.id,value:l.id,children:l.label},`${l.id}-${u}`)):U(Se,{})]}),U("p",{className:"eow-text-gray-400 eow-text-xs",children:i})]})},tw=({type:t,defaultValue:e,onChange:n})=>{const{status:r,active:i,inactive:o,statusDescription:s,winningCondition:l,winningConditionDescription:u,more:c,less:d}=be(Pe);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"status",className:Jt,children:t==="status"?r:l}),ie("select",{id:t==="status"?"gameStatus":"gameWinningCondition",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:n,defaultValue:e,children:[U("option",{value:t==="status"?"ACTIVE":"MORE",children:t==="status"?i:c}),U("option",{value:t==="status"?"INACTIVE":"LESS",children:t==="status"?o:d})]}),U("p",{className:"eow-text-gray-400 eow-text-xs",children:t==="status"?s:u})]})};var b$=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],nw=function(){var e=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(e).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),s=String(r.getOptionLabel(n)).toLowerCase();return o===i||s===i},od={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,i){return!(!e||n.some(function(o){return nw(e,o,i)})||r.some(function(o){return nw(e,o,i)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function _$(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,i=r===void 0?"last":r,o=t.formatCreateLabel,s=o===void 0?od.formatCreateLabel:o,l=t.isValidNewOption,u=l===void 0?od.isValidNewOption:l,c=t.getNewOptionData,d=c===void 0?od.getNewOptionData:c,f=t.onCreateOption,p=t.options,h=p===void 0?[]:p,y=t.onChange,g=un(t,b$),v=g.getOptionValue,b=v===void 0?qv:v,w=g.getOptionLabel,E=w===void 0?Vv:w,m=g.inputValue,A=g.isLoading,I=g.isMulti,O=g.value,C=g.name,R=K.useMemo(function(){return u(m,Ds(O),h,{getOptionValue:b,getOptionLabel:E})?d(m,s(m)):void 0},[s,d,E,b,m,u,h,O]),P=K.useMemo(function(){return(n||!A)&&R?i==="first"?[R].concat(hi(h)):[].concat(hi(h),[R]):h},[n,i,A,R,h]),S=K.useCallback(function(M,D){if(D.action!=="select-option")return y(M,D);var L=Array.isArray(M)?M:[M];if(L[L.length-1]===R){if(f)f(m);else{var N=d(m,m),H={action:"create-option",name:C,option:N};y(Oa(I,[].concat(hi(Ds(O)),[N]),N),H)}return}y(M,D)},[d,m,I,C,R,f,y,O]);return we(we({},g),{},{options:P,onChange:S})}var E$=K.forwardRef(function(t,e){var n=xc(t),r=_$(n);return U(js,J({ref:e},r))}),I$=E$;const A$=t=>({label:t,value:t}),O$={control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"6px 1px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",boxShadow:"none"}),clearIndicator:t=>oe(J({},t),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}})},rw=({defaultValue:t,showLabel:e,setObject:n,handleResetData:r})=>{const[i,o]=K.useState(""),s=t.map(y=>A$(y)),{repeatedValueMessage:l,flags:u,flagsPlaceholder:c}=be(Pe),d=y=>{const g=y.map(v=>v.value);n(v=>oe(J({},v),{flags:g})),r&&r()},f=y=>{o(y)},p=y=>{y.persist();const{key:g}=y;if(!!i)switch(g){case"Enter":case"Tab":if(t.length===0){const v=Array.from(t);v.push(i),n(b=>oe(J({},b),{flags:v}))}if(t.length>0&&h()){const v=Array.from(t);v.push(i),n(b=>oe(J({},b),{flags:v}))}o(""),y.preventDefault()}},h=()=>{let y=!1;const g=s.map(v=>v.label);return g.length&&g.includes(i)?(xe.warn(l),y):(y=!0,y)};return ie("div",{className:"eow-mb-4",children:[e?U("label",{htmlFor:u,className:"eow-text-sm eow-mb-1",children:u}):U(Se,{}),U(I$,{styles:O$,components:{DropdownIndicator:null},getOptionValue:y=>y.value,inputValue:i,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:d,onInputChange:f,onKeyDown:p,placeholder:c,value:s})]})},C$=t=>Object.keys(t).length++,iw=({property:t,field:e,onChange:n})=>{const r=C$(e),[i,o]=K.useState(JSON.parse(JSON.stringify(e))),{dynamicFieldsDescription:s,keyDynamicFields:l,valueDynamicFields:u}=be(Pe),c=()=>{const p="new_key"+r,h=JSON.parse(JSON.stringify(e));h[p]="";const y=J(J({},e),h);o(y),n(y)},d=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p];y[h]=y[g],delete y[g],n(y)},f=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p]?Object.keys(y)[p]:"new_key";y[g]=h,n(y)};return ie("div",{className:"eow-mb-4",children:[U("div",{className:"eow-mb-2",children:U("p",{className:"eow-text-gray-400 eow-text-sm",children:s})}),ie("div",{className:"eow-border eow-border-gray-200 eow-rounded eow-p-2 eow-mb-4",children:[Object.keys(i).map((p,h)=>ie("div",{className:"eow-flex eow-items-center eow-mb-4",children:[ie("div",{className:"eow-mr-4",children:[U("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:l}),U("input",{"data-testid":"dynamic-key-field",onChange:y=>d(h,y.target.value),value:Object.keys(e)[h]&&Object.keys(e)[h].includes("new_key")?"":Object.keys(e)[h],type:"text",id:`${t}-key-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-64 focus:eow-outline-none eow-px-3 eow-py-2"})]}),ie("div",{className:"eow-w-full",children:[U("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:u}),U("input",{"data-testid":"dynamic-value-field",onChange:y=>f(h,y.target.value),value:e[p],type:"text",id:`${t}-value-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2"})]})]},`${t}-${p}-${h}`)),U(zu,{isDisabled:!1,onClick:()=>c()})]})]})},T$=({tabValue:t,setTabValue:e})=>{const{content:n,tags:r,campaign:i}=be(Pe);return U(Se,{children:U("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[r,n,i].map(s=>U("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===s?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:U("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===s?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(s),children:s})},`context-tab-${s}`))})})};class sd{constructor(){a(this,"label","");a(this,"options",[])}}const S$=10,aw=t=>{const e=[];if(t.competitions.length>0){const n=new sd;n.label="Competitions",n.options=t.competitions.map(r=>ld(r,"competition")),e.push(n)}if(t.teams.length>0){const n=new sd;n.label="Teams",n.options=t.teams.map(r=>ld(r,"team")),e.push(n)}if(t.players.length>0){const n=new sd;n.label="Players",n.options=t.players.map(r=>ld(r,"player")),e.push(n)}return e},ld=(t,e)=>{var r,i,o,s,l;let n=new Ky;return n.label=t.name,n.value=t.name,n.id=t.id,e==="player"?n.logo=((r=t.assets)==null?void 0:r.headshot)||_n.avatar:e==="team"?n.logo=((i=t.assets)==null?void 0:i.logo)||_n.team:n.logo=((o=t.assets)==null?void 0:o.logo)||_n.competition,n.countryName=t.country.name,n.countryFlag=((l=(s=t.country)==null?void 0:s.assets)==null?void 0:l.flag)||_n.country,n},P$=({options:t,setOptions:e,setFilters:n,handleResetData:r})=>{const{sdk:i}=be(ln),{contextEntityTag:o,typeContextTagNamePlaceholder:s}=be(Pe),l=d=>{const f=d.map(p=>p.id);e(d),r(),n(p=>oe(J({},p),{entityIds:f}))},c=Xu((d,f)=>{if(d){const p={query:d};i.football.search(p).then(h=>{const y=aw(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return ie("div",{className:"eow-mb-4",children:[U("label",{htmlFor:"context entity tag",className:"eow-text-sm eow-mb-1",children:o}),U(Rc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:rd,onChange:l,loadingMessage:()=>"Loading...",isOptionDisabled:()=>t.length===S$,value:t,loadOptions:c,isClearable:!0,isMulti:!0,placeholder:s,formatOptionLabel:d=>ie("div",{className:"eow-flex eow-items-center",children:[U("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-2",children:d.label}),U("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-1",children:d.countryName})]})})]})},M$=(t,e,n,r)=>{const i=t.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),o=t.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),s=t.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),l=[],u=[];if(i.length>0){const c=e.football.getCompetitions({competitionIds:i}).then(d=>{u.push(d)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}if(o.length>0){const c=e.football.getTeams({teamIds:o}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}if(s.length>0){const c=e.football.getPlayers({playerIds:s}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),xe.error(n)});l.push(c)}Promise.all(l).then(()=>{const d=Array.prototype.concat.apply([],u).map(f=>c$(f));r(d)})},x$=({tags:t,onChangeTags:e})=>{const[n,r]=K.useState([]),{sdk:i}=be(ln),{getFootballEntitiesErrorMessage:o,typeContextTagNamePlaceholder:s}=be(Pe),l=d=>{r(d),e(d)},c=Xu((d,f)=>{if(!d&&t.length>0&&M$(t,i,o,r),d){const p={query:d};i.football.search(p).then(h=>{const y=aw(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return U("div",{className:"eow-mb-4",children:U(Rc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:rd,onChange:l,loadingMessage:()=>"Loading...",value:n,loadOptions:c,isClearable:!0,defaultOptions:!0,isMulti:!0,placeholder:s,formatOptionLabel:d=>ie("div",{className:"eow-flex eow-items-center",children:[U("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-2",children:d.label}),U("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),U("span",{className:"eow-mr-1",children:d.countryName})]})})})},R$=new ai,k$=t=>t.startsWith("fb:c:")?"competition":t.startsWith("fb:t:")?"team":"player",D$=({defaultValue:t,setRequestBody:e})=>{const n=R$.createContext(t),{content:r,tags:i,campaign:o,id:s,idContentPlaceholder:l,labelContentPlaceholder:u,typeContentPlaceholder:c,idCampaignPlaceholder:d,labelCampaignPlaceholder:f,label:p,type:h}=be(Pe),[y,g]=K.useState(i),v=O=>{O.persist();const C=J({},n);C.content.id=O.target.value,I(C)},b=O=>{O.persist();const C=J({},n);C.content.label=O.target.value,I(C)},w=O=>{O.persist();const C=J({},n);C.content.type=O.target.value,I(C)},E=O=>{O.persist();const C=J({},n);C.campaign.id=O.target.value,I(C)},m=O=>{O.persist();const C=J({},n);C.campaign.label=O.target.value,I(C)},A=O=>{const C=J({},n);O.length?C.tags=O.map(R=>({id:R.id,type:k$(R.id),source:"football"})):C.tags=[],I(C)},I=O=>{e(C=>oe(J({},C),{context:O}))};return ie("div",{className:"eow-mb-4 eow-p-2",children:[U(T$,{tabValue:y,setTabValue:g}),y===i?U(x$,{tags:n.tags,onChangeTags:A}):U(Se,{}),y===r?ie(Se,{children:[U(bt,{title:s,placeholder:l,defaultValue:n.content.id,onChange:v}),U(bt,{title:p,placeholder:u,defaultValue:n.content.label,onChange:b}),U(bt,{title:h,placeholder:c,defaultValue:n.content.type,onChange:w})]}):U(Se,{}),y===o?ie(Se,{children:[U(bt,{title:s,placeholder:d,defaultValue:n.campaign.id,onChange:E}),U(bt,{title:p,placeholder:f,defaultValue:n.campaign.label,onChange:m})]}):U(Se,{})]})},F$=({tabValue:t,setTabValue:e})=>{const{images:n,colors:r,urls:i}=be(Pe);return U(Se,{children:U("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[n,r,i].map(s=>U("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===s?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:U("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===s?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(s),children:s})},`context-tab-${s}`))})})};function N$(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}var L$=N$;function B$(t){return function(e){return t==null?void 0:t[e]}}var U$=B$,$$=U$,j$={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},H$=$$(j$),V$=H$;function q$(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var W$=q$,ow=Xo,G$=W$,z$=rs,Q$=Ag,Y$=1/0,sw=ow?ow.prototype:void 0,lw=sw?sw.toString:void 0;function uw(t){if(typeof t=="string")return t;if(z$(t))return G$(t,uw)+"";if(Q$(t))return lw?lw.call(t):"";var e=t+"";return e=="0"&&1/t==-Y$?"-0":e}var K$=uw,J$=K$;function X$(t){return t==null?"":J$(t)}var Zs=X$,Z$=V$,e3=Zs,t3=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n3="\\u0300-\\u036f",r3="\\ufe20-\\ufe2f",i3="\\u20d0-\\u20ff",a3=n3+r3+i3,o3="["+a3+"]",s3=RegExp(o3,"g");function l3(t){return t=e3(t),t&&t.replace(t3,Z$).replace(s3,"")}var u3=l3,c3=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function d3(t){return t.match(c3)||[]}var f3=d3,h3=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function p3(t){return h3.test(t)}var m3=p3,cw="\\ud800-\\udfff",g3="\\u0300-\\u036f",v3="\\ufe20-\\ufe2f",y3="\\u20d0-\\u20ff",w3=g3+v3+y3,dw="\\u2700-\\u27bf",fw="a-z\\xdf-\\xf6\\xf8-\\xff",b3="\\xac\\xb1\\xd7\\xf7",_3="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",E3="\\u2000-\\u206f",I3=" \\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",hw="A-Z\\xc0-\\xd6\\xd8-\\xde",A3="\\ufe0e\\ufe0f",pw=b3+_3+E3+I3,mw="['\u2019]",gw="["+pw+"]",O3="["+w3+"]",vw="\\d+",C3="["+dw+"]",yw="["+fw+"]",ww="[^"+cw+pw+vw+dw+fw+hw+"]",T3="\\ud83c[\\udffb-\\udfff]",S3="(?:"+O3+"|"+T3+")",P3="[^"+cw+"]",bw="(?:\\ud83c[\\udde6-\\uddff]){2}",_w="[\\ud800-\\udbff][\\udc00-\\udfff]",Ci="["+hw+"]",M3="\\u200d",Ew="(?:"+yw+"|"+ww+")",x3="(?:"+Ci+"|"+ww+")",Iw="(?:"+mw+"(?:d|ll|m|re|s|t|ve))?",Aw="(?:"+mw+"(?:D|LL|M|RE|S|T|VE))?",Ow=S3+"?",Cw="["+A3+"]?",R3="(?:"+M3+"(?:"+[P3,bw,_w].join("|")+")"+Cw+Ow+")*",k3="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",D3="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",F3=Cw+Ow+R3,N3="(?:"+[C3,bw,_w].join("|")+")"+F3,L3=RegExp([Ci+"?"+yw+"+"+Iw+"(?="+[gw,Ci,"$"].join("|")+")",x3+"+"+Aw+"(?="+[gw,Ci+Ew,"$"].join("|")+")",Ci+"?"+Ew+"+"+Iw,Ci+"+"+Aw,D3,k3,vw,N3].join("|"),"g");function B3(t){return t.match(L3)||[]}var U3=B3,$3=f3,j3=m3,H3=Zs,V3=U3;function q3(t,e,n){return t=H3(t),e=n?void 0:e,e===void 0?j3(t)?V3(t):$3(t):t.match(e)||[]}var W3=q3,G3=L$,z3=u3,Q3=W3,Y3="['\u2019]",K3=RegExp(Y3,"g");function J3(t){return function(e){return G3(Q3(z3(e).replace(K3,"")),t,"")}}var X3=J3,Z3=X3,ej=Z3(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),ud=ej;const tj=({loadedImages:t,onChange:e})=>{const[n,r]=K.useState(!1),i=be(Pe),o=["mobileLogo","backgroundImage","mobileBackgroundImage","additionalImage"],s=()=>r(!n);return ie(Se,{children:[U(Xs,{id:0,type:"branding",label:i.mainLogo,imageUrl:t.main_logo,imageNode:"main_logo",onChange:e}),U("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:s,children:n?i.hideMoreImages:i.showMoreImages}),n?U(Se,{children:o.map((l,u)=>U(Xs,{id:0,type:"branding",label:i[l],imageUrl:t&&t[ud(l)]?t[ud(l)]:"",imageNode:ud(l),onChange:e},`${l}-${u}`))}):U(Se,{})]})},nj=new ai,rj=({defaultValue:t,setRequestBody:e})=>{const n=nj.createBranding(t),r=be(Pe),[i,o]=K.useState(r.images),s=(u,c,d)=>{d.persist();const f=J({},n);f[u][c]=d.target.value,e(p=>oe(J({},p),{branding:n}))},l=(u,c)=>{const d=J({},n);d.images[c]=u,e(f=>oe(J({},f),{branding:n}))};return ie("div",{className:"eow-mb-4 eow-p-2",children:[U(F$,{tabValue:i,setTabValue:o}),i===r.images?U(tj,{loadedImages:n.images,onChange:l}):U(Se,{}),i===r.urls?ie(Se,{children:[U(bt,{title:r.primaryUrl,placeholder:"",defaultValue:n.urls.primary_url,onChange:u=>s("urls","primary_url",u)}),U(bt,{title:r.secondaryUrl,placeholder:"",defaultValue:n.urls.secondary_url,onChange:u=>s("urls","secondary_url",u)}),U(bt,{title:r.privacyPolicyUrl,placeholder:"",defaultValue:n.urls.privacy_policy_url,onChange:u=>s("urls","privacy_policy_url",u)}),U(bt,{title:r.termsAndConditionsUrl,placeholder:"",defaultValue:n.urls.terms_and_conditions_url,onChange:u=>s("urls","terms_and_conditions_url",u)}),U(bt,{title:r.additionalUrl,placeholder:"",defaultValue:n.urls.additional_url,onChange:u=>s("urls","additional_url",u)})]}):U(Se,{}),i===r.colors?ie(Se,{children:[U(bt,{title:r.primaryColor,placeholder:"",defaultValue:n.colors.primary_color,onChange:u=>s("colors","primary_color",u)}),U(bt,{title:r.secondaryColor,placeholder:"",defaultValue:n.colors.secondary_color,onChange:u=>s("colors","secondary_color",u)}),U(bt,{title:r.contentColor,placeholder:"",defaultValue:n.colors.content_color,onChange:u=>s("colors","content_color",u)}),U(bt,{title:r.backgroundColor,placeholder:"",defaultValue:n.colors.background_color,onChange:u=>s("colors","background_color",u)}),U(bt,{title:r.borderColor,placeholder:"",defaultValue:n.colors.border_color,onChange:u=>s("colors","border_color",u)}),U(bt,{title:r.additionalColor,placeholder:"",defaultValue:n.colors.additional_color,onChange:u=>s("colors","additional_color",u)})]}):U(Se,{})]})},ij=new ai,aj=({requestBody:t,rules:e,adContent:n,setRules:r,setAdContent:i,setRequestBody:o})=>{const{branding:s,configuration:l,images:u,flags:c,labels:d,customFields:f,rules:p,adContent:h,context:y}=be(Pe),g=O=>{O.persist(),o(C=>oe(J({},C),{type:O.target.value?O.target.value:null}))},v=O=>{O.persist(),o(C=>oe(J({},C),{status:O.target.value}))},b=O=>{O.persist(),o(C=>oe(J({},C),{winning_condition:O.target.value}))},w=O=>{o(C=>oe(J({},C),{time:O}))},E=O=>{o(C=>oe(J({},C),{lives:O}))},m=(O,C)=>{const R=O||null,P=ij.createImagesModel();switch(C){case"mainImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.main=R,oe(J({},S),{images:M})});break;case"coverImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.cover=R,oe(J({},S),{images:M})});break;case"mobileImage":o(S=>{const M=S.images?JSON.parse(JSON.stringify(S.images)):P;return M.mobile=R,oe(J({},S),{images:M})});break}},A=O=>{o(C=>oe(J({},C),{labels:O}))},I=O=>{o(C=>oe(J({},C),{custom_fields:O}))};return ie("div",{className:"md:eow-w-2/6 eow-w-full eow-p-4",children:[U(zn,{title:h,children:U(Gu,{defaultValue:n,setValue:i,property:"ad_content"})}),U(zn,{title:s,children:U(rj,{defaultValue:t.branding,setRequestBody:o})}),ie(zn,{title:l,children:[ie("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:[U(w$,{defaultValue:t.type,onChange:g}),U(tw,{type:"status",defaultValue:t.status,onChange:v}),U(tw,{type:"winning_condition",defaultValue:t.winning_condition,onChange:b})]}),ie("div",{className:"eow-grid md:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[U(va,{type:"time",defaultValue:t.time,showDescription:!0,onChange:w}),U(va,{type:"lives",defaultValue:t.lives,showDescription:!0,onChange:E})]})]}),U(zn,{title:y,children:U(D$,{defaultValue:t.context,setRequestBody:o})}),U(zn,{title:f,children:U(iw,{property:"custom_fields",field:t.custom_fields?t.custom_fields:new Object,onChange:I})}),U(zn,{title:c,children:U(rw,{defaultValue:t.flags,setObject:o})}),U(zn,{title:u,children:U(Zy,{id:0,type:"game",loadedImages:t.images,onChange:m})}),U(zn,{title:d,children:U(iw,{property:"labels",field:t.labels?t.labels:new Object,onChange:A})}),U(zn,{title:p,children:U(Gu,{defaultValue:e,setValue:r,property:"rules"})})]})},Tw=new ai,oj="manage-either-or",sj=({eitherOrById:t,setFilters:e,toggleScreen:n,clearEitherOrById:r})=>{const[i,o]=K.useState(Tw.createNewRequestBody(t)),[s,l]=K.useState(t==null?void 0:t.description),[u,c]=K.useState(t==null?void 0:t.rules),[d,f]=K.useState(t==null?void 0:t.ad_content),[p,h]=K.useState(!1),[y,g]=K.useState(!1),v=be(Pe),{https:b}=be(ln),w=!!t,E=()=>{g(!y)};return ie("div",{id:oj,children:[U(MP,{managementScreen:w?"edit":"create",toggleScreen:n,clearQuizById:r}),ie("div",{className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded",children:[ie("div",{className:"eow-flex eow-flex-col md:eow-flex-row",children:[U(y$,{requestBody:i,setRequestBody:o,description:s,setDescription:l}),U(aj,{requestBody:i,setRequestBody:o,rules:u,adContent:d,setRules:c,setAdContent:f})]}),U(kP,{isLoading:p,manageEitherOr:()=>_(this,null,function*(){const A=new xP;if(h(!0),w?A.validateUpdate(i,v):A.validateCreate(i,v),!A.isValid){xe.error(A.message),h(!1);return}i.description=s,i.rules=u,i.ad_content=d;const I=Tw.finalizeNewRequestBody(J({},i));let O=null;w?O=yield b.updateEitherOr(I.id,J({},I)):O=yield b.createEitherOr(J({},I)),O.ok?(h(!1),xe.success(w?v.updateEitherOrMessage:v.createEitherOrMessage),e(C=>oe(J({},C),{refetchEitherOrs:!C.refetchEitherOrs})),r(),n()):(xe.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage),console.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage,yield O.json()),h(!1))}),handleModal:E})]}),U(NP,{isOpen:y,requestBody:i,description:s,handleClose:E})]})},lj=t=>{const e=document.createElement("div");return e.setAttribute("id",t),document.body.appendChild(e),e},uj=({children:t,wrapperId:e})=>{const[n,r]=K.useState(null);return K.useLayoutEffect(()=>{let i=document.getElementById(e),o=!1;return i||(o=!0,i=lj(e)),r(i),()=>{o&&i.parentNode&&i.parentNode.removeChild(i)}},[e]),n===null?null:fr.default.createPortal(t,n)},cj=({isOpen:t,eitherOr:e,setFilters:n,handleClose:r})=>{const[i,o]=K.useState(!1),{confirmationQuestionLabel:s,deleteLabel:l,cancelLabel:u,deleteEitherOrMessage:c,deleteEitherOrErrorMessage:d}=be(Pe),{https:f}=be(ln);K.useLayoutEffect(()=>(t&&document.body.addEventListener("keydown",p),()=>{document.body.removeEventListener("keydown",p)}),[r]);const p=y=>y.key==="Escape"&&!i?r():null,h=()=>_(this,null,function*(){o(!0);const y=yield f.deleteEitherOr(e.id);y.ok?(xe.success(c),o(!1),n(g=>oe(J({},g),{refetchEitherOrs:!g.refetchEitherOrs})),r()):(console.error(d,yield y.json()),xe.error(d),o(!1))});return t?U(uj,{wrapperId:"confirmation-modal",children:ie(Se,{children:[U("div",{className:"eow-justify-center eow-items-center eow-flex eow-overflow-x-hidden eow-overflow-y-hidden eow-absolute eow-inset-0 eow-z-50 eow-top-0 eow-right-0 eow-bottom-0 eow-left-0 eow-outline-none focus:eow-outline-none",children:U("div",{className:"eow-relative eow-w-full eow-my-6 eow-mx-auto eow-max-w-lg",children:ie("div",{className:"eow-border-0 eow-rounded eow-shadow-lg eow-relative eow-flex eow-flex-col eow-w-full eow-bg-white eow-outline-none focus:eow-outline-none",children:[ie("div",{className:"eow-flex eow-justify-items-center eow-p-4 eow-border-b eow-border-solid eow-border-gray-200",children:[ie("h3",{className:"eow-text-2xl eow-font-semibold eow-mr-2",children:[l," ",e.title]}),U("button",{className:"eow-flex eow-justify-items-center eow-ml-auto eow-bg-transparent eow-border-0 eow-leading-none eow-font-semibold eow-outline-none focus:eow-outline-none",onClick:r,children:U("span",{className:"eow-bg-transparent eow-h-6 eow-w-6 eow-text-2xl eow-block eow-outline-none focus:eow-outline-none eow-text-red-500 hover:eow-text-red-600",children:"x"})})]}),U("div",{className:"eow-relative eow-whitespace-nowrap eow-p-4 eow-text-gray-500 eow-text-lg eow-mb-4",children:ie("p",{className:"eow-whitespace-normal eow-mb-2",children:[s," ",U("span",{className:"eow-text-xl eow-italic",children:e.title})," ?"]})}),ie("div",{className:"eow-flex eow-items-center eow-justify-end eow-p-3 eow-border-t eow-border-solid eow-border-gray-200 eow-rounded-b",children:[ie("button",{className:`${i?"eow-bg-gray-600":"eow-bg-brandColor hover:eow-bg-blue-700"} eow-text-white eow-font-bold eow-px-4 eow-py-2 eow-text-sm eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:h,disabled:i,children:[i?U(Im,{}):null,l]}),U("button",{className:`${i?"eow-bg-gray-600":"eow-bg-red-500 hover:eow-bg-red-700"} eow-text-white eow-font-bold eow-text-sm eow-px-4 eow-py-2 eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:r,disabled:i,children:u})]})]})})}),U("div",{className:"eow-opacity-80 eow-absolute eow-inset-0 eow-z-40 eow-bg-black eow-top-0 eow-right-0 eow-bottom-0 eow-left-0"})]})}):null};var Sw=(t=>(t.CREATED_AT_ASC="created_at_asc",t.CREATED_AT_DESC="created_at_desc",t.UPDATED_AT_ASC="updated_at_asc",t.UPDATED_AT_DESC="updated_at_desc",t))(Sw||{});class dj{constructor(){a(this,"sort","created_at_desc");a(this,"status","");a(this,"flags",[]);a(this,"entityIds",[]);a(this,"groupByStatus",!0);a(this,"refetchEitherOrs",!1)}}var fj=K.forwardRef(function(t,e){var n=xc(t);return U(js,J({ref:e},n))}),hj=fj;function pj(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}var mj=pj,gj=mj;function vj(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:gj(t,e,n)}var yj=vj,wj="\\ud800-\\udfff",bj="\\u0300-\\u036f",_j="\\ufe20-\\ufe2f",Ej="\\u20d0-\\u20ff",Ij=bj+_j+Ej,Aj="\\ufe0e\\ufe0f",Oj="\\u200d",Cj=RegExp("["+Oj+wj+Ij+Aj+"]");function Tj(t){return Cj.test(t)}var Pw=Tj;function Sj(t){return t.split("")}var Pj=Sj,Mw="\\ud800-\\udfff",Mj="\\u0300-\\u036f",xj="\\ufe20-\\ufe2f",Rj="\\u20d0-\\u20ff",kj=Mj+xj+Rj,Dj="\\ufe0e\\ufe0f",Fj="["+Mw+"]",cd="["+kj+"]",dd="\\ud83c[\\udffb-\\udfff]",Nj="(?:"+cd+"|"+dd+")",xw="[^"+Mw+"]",Rw="(?:\\ud83c[\\udde6-\\uddff]){2}",kw="[\\ud800-\\udbff][\\udc00-\\udfff]",Lj="\\u200d",Dw=Nj+"?",Fw="["+Dj+"]?",Bj="(?:"+Lj+"(?:"+[xw,Rw,kw].join("|")+")"+Fw+Dw+")*",Uj=Fw+Dw+Bj,$j="(?:"+[xw+cd+"?",cd,Rw,kw,Fj].join("|")+")",jj=RegExp(dd+"(?="+dd+")|"+$j+Uj,"g");function Hj(t){return t.match(jj)||[]}var Vj=Hj,qj=Pj,Wj=Pw,Gj=Vj;function zj(t){return Wj(t)?Gj(t):qj(t)}var Qj=zj,Yj=yj,Kj=Pw,Jj=Qj,Xj=Zs;function Zj(t){return function(e){e=Xj(e);var n=Kj(e)?Jj(e):void 0,r=n?n[0]:e.charAt(0),i=n?Yj(n,1).join(""):e.slice(1);return r[t]()+i}}var eH=Zj,tH=eH,nH=tH("toUpperCase"),rH=nH,iH=Zs,aH=rH;function oH(t){return aH(iH(t).toLowerCase())}var sH=oH;const Nw=(t,e)=>{let n="";if(e==="sort")switch(t){case"created_at_asc":n="Sort by created at field in ascending order";break;case"created_at_desc":n="Sort by created at field in descending order";break;case"updated_at_asc":n="Sort by updated at field in ascending order";break;case"updated_at_desc":n="Sort by updated at field in descending order";break}return t&&(t=sH(t)),{id:t,value:t,label:e==="status"?t:n}},lH={control:t=>oe(J({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray"}),input:t=>oe(J({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>oe(J({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"}})},Lw=({defaultValue:t,filterValues:e,filterType:n,showClearStatus:r,setFilters:i,handleResetData:o})=>{const{status:s,clearStatus:l}=be(Pe),u=e.map(f=>Nw(f,n)),c=f=>{const p=f.value.toLocaleLowerCase();n==="sort"?i(h=>oe(J({},h),{sort:p})):n==="status"&&i(h=>oe(J({},h),{status:p.toLocaleUpperCase()})),o()},d=()=>{i(f=>oe(J({},f),{status:""}))};return ie("div",{className:"eow-w-full eow-mb-4",children:[U("label",{className:"eow-text-sm eow-mb-1",children:n==="status"?s:""}),U(hj,{onChange:c,options:u,styles:lH,value:Nw(t,n),placeholder:""}),r?U("a",{className:"eow-text-brandColor eow-cursor-pointer eow-text-sm eow-mb-8",onClick:()=>d(),children:l}):U(Se,{})]})},uH=({value:t,setFilters:e,handleResetData:n})=>{const{groupByStatus:r}=be(Pe);return ie("div",{className:"eow-flex eow-items-center eow-cursor-pointer",onClick:()=>{e(o=>oe(J({},o),{groupByStatus:!t})),n()},children:[U("input",{type:"checkbox",className:"eow-mr-2 focus:eow-outline-none eow-outline-none eow-cursor-pointer",checked:t,readOnly:!0}),U("span",{className:"eow-text-blueGray-600 eow-select-none",children:r})]})},cH=Object.values(Sw),dH=["active","inactive"],fH=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const{filterBy:o,sortBy:s}=be(Pe);return ie("div",{className:"eow-grid md:eow-grid-cols-2 eow-gap-4 eow-grid-cols-1 eow-mb-6",children:[ie("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[U("h3",{className:"eow-font-bold eow-mb-2",children:o}),U(Lw,{filterType:"status",defaultValue:t.status,filterValues:dH,showClearStatus:!0,setFilters:r,handleResetData:i}),U(rw,{defaultValue:t.flags,showLabel:!0,setObject:r,handleResetData:i}),U(P$,{options:e,setOptions:n,setFilters:r,handleResetData:i})]}),ie("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[U("h3",{className:"eow-font-bold eow-mb-2",children:s}),U(Lw,{filterType:"sort",defaultValue:t.sort,filterValues:cH,setFilters:r,handleResetData:i}),U(uH,{value:t.groupByStatus,setFilters:r,handleResetData:i})]})]})},hH=({children:t})=>U("div",{children:U("section",{className:"eow-mx-auto",children:U("div",{className:"eow-mb-8 eow-overflow-hidden eow-rounded eow-bg-white",children:U("div",{className:"eow-w-full eow-overflow-x-auto",children:t})})})}),pH=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[n,r]=K.useState(new dj),[i,o]=K.useState(1),[s,l]=K.useState(null),[u,c]=K.useState(new Map),[d,f]=K.useState(null),[p,h]=K.useState(!1),[y,g]=K.useState(!1),[v,b]=K.useState(!1),[w,E]=K.useState(null),[m,A]=K.useState([]),{sdk:I,https:O}=be(ln),{getEitherOrsErrorMessage:C,getEitherOrErrorMessage:R,noGamesFound:P}=be(Pe),S=K.useMemo(()=>JSON.stringify(n),[n]),{isError:M,error:D,data:L}=du({queryKey:["eitherOrsList",S],queryFn:()=>I.miniGames.getEitherOrs(n,!1,!0)});K.useEffect(()=>{if(L){const x=new Map(u).set(i,L.data);c(x),l(L.meta.pagination.nextPageStartsAfter)}},[L]),K.useEffect(()=>{Array.from(u.keys()).length>0&&(Array.from(u.keys()).includes(i)||(k=>_(this,null,function*(){try{const W=yield I.miniGames.getEitherOrs(oe(J({},n),{startAfter:k}),!1,!0);if(W.data.length>0){const j=new Map(u).set(i,W.data);c(j),l(W.meta.pagination.nextPageStartsAfter)}}catch(W){xe.error(C),console.error(W)}}))(s))},[i]);const N=()=>o(x=>x-1),H=()=>o(x=>x+1),q=()=>h(!p),z=()=>f(null),$=x=>_(this,null,function*(){g(!0);const k=yield O.getEitherOrById(x);if(k.ok){const B=yield k.json();f(B.data),h(!0)}else console.error(R,yield k.json()),xe.error(R);g(!1)}),F=()=>b(!v),T=()=>{o(1),c(new Map)};return M?(xe.error(R),console.error(D),U(Ah,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e})):p?U(sj,{eitherOrById:d,setFilters:r,toggleScreen:q,clearEitherOrById:z}):y||!u.get(i)?U(Em,{}):ie(Se,{children:[ie(hH,{children:[U(Ah,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e}),U(fH,{filters:n,options:m,setOptions:A,setFilters:r,handleResetData:T}),u.get(i).length>0?ie(Se,{children:[ie("table",{className:"eow-w-full eow-border eow-border-gray-200 eow-mb-2 eow-table",children:[U(VI,{}),U(SP,{data:u.get(i),fetchEitherOrById:$,handleModal:F,setSelectedEitherOr:E})]}),U(PP,{pageCount:i,pageGames:u,getPreviousPage:N,getNextPage:H})]}):U("h2",{className:"eow-text-center eow-font-bold eow-text-xl eow-my-60",children:P})]}),U(cj,{isOpen:v,eitherOr:w,setFilters:r,handleClose:F})]})},mH=({fansUnitedEnvironment:t,hideSignOutButton:e})=>K.useContext(Ih)?U(jI,{children:U(pH,{fansUnitedEnvironment:t,hideSignOutButton:e})}):U(UI,{fansUnitedEnvironment:t}),gH=new iA({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),vH=t=>{const e=l$(t.fansUnitedApiKey,t.fansUnitedClientId,t.fansUnitedLanguage,t.fansUnitedEnvironment),n=u$(t.sportal365Project,t.sportal365Infrastructure);return U($I,{fansUnitedEnvironment:t.fansUnitedEnvironment,children:U(ab,{labels:t.labels,children:U(TP,{config:e,sportal365Config:n,children:ie(wA,{client:gH,children:[U(al,{position:"top-right",autoClose:5e3,hideProgressBar:!1,limit:3,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0}),U(mH,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})]})})})})};Be.EitherOrManager=vH,Object.defineProperties(Be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|