1const __vite__fileDeps=["assets/General-kKRG0ThU.js","assets/index-kmVhCdnt.js","assets/ProgressBar-BQwkh7Vr.js","assets/PageHeading-BeMx7C-P.js","assets/arrow-right-Ck9ZtviR.js","assets/Settings-4DL0eS7Q.js","assets/Contact-zSCXsox-.js","assets/Billing-B-0T8ShJ.js","assets/HowAreSeatsCalculated-B6h49cqZ.js","assets/formatAmount-7XpBwXzF.js","assets/Invoices-BCZezDVN.js","assets/arrow-left-CopHcP76.js","assets/Edit-DSSWWxx_.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); 2var a0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var q=(e,t,n)=>(a0(e,t,"read from private field"),n?n.call(e):t.get(e)),Ie=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ce=(e,t,n,r)=>(a0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var gh=(e,t,n,r)=>({set _(s){Ce(e,t,s,n)},get _(){return q(e,t,r)}}),Je=(e,t,n)=>(a0(e,t,"access private method"),n);function tP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Go(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function el(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var nP={exports:{}},pm={},rP={exports:{}},et={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var Nf=Symbol.for("react.element"),t8=Symbol.for("react.portal"),n8=Symbol.for("react.fragment"),r8=Symbol.for("react.strict_mode"),s8=Symbol.for("react.profiler"),i8=Symbol.for("react.provider"),o8=Symbol.for("react.context"),a8=Symbol.for("react.forward_ref"),l8=Symbol.for("react.suspense"),c8=Symbol.for("react.memo"),u8=Symbol.for("react.lazy"),cE=Symbol.iterator;function d8(e){return e===null||typeof e!="object"?null:(e=cE&&e[cE]||e["@@iterator"],typeof e=="function"?e:null)}var sP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iP=Object.assign,oP={};function Wc(e,t,n){this.props=e,this.context=t,this.refs=oP,this.updater=n||sP}Wc.prototype.isReactComponent={};Wc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Wc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function aP(){}aP.prototype=Wc.prototype;function I1(e,t,n){this.props=e,this.context=t,this.refs=oP,this.updater=n||sP}var N1=I1.prototype=new aP;N1.constructor=I1;iP(N1,Wc.prototype);N1.isPureReactComponent=!0;var uE=Array.isArray,lP=Object.prototype.hasOwnProperty,L1={current:null},cP={key:!0,ref:!0,__self:!0,__source:!0};function uP(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)lP.call(t,r)&&!cP.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Nf,type:e,key:i,ref:o,props:s,_owner:L1.current}}function f8(e,t){return{$$typeof:Nf,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function D1(e){return typeof e=="object"&&e!==null&&e.$$typeof===Nf}function h8(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var dE=/\/+/g;function l0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?h8(""+e.key):t.toString(36)}
vendor: 4,788 bytes, lines 10-18
10function hp(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Nf:case t8:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+l0(o,0):r,uE(s)?(n="",e!=null&&(n=e.replace(dE,"$&/")+"/"),hp(s,t,n,"",function(c){return c})):s!=null&&(D1(s)&&(s=f8(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(dE,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",uE(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+l0(i,a);o+=hp(i,t,n,l,s)}else if(l=d8(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+l0(i,a++),o+=hp(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function mh(e,t,n){if(e==null)return e;var r=[],s=0;return hp(e,r,"","",function(i){return t.call(n,i,s++)}),r}function p8(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Yn={current:null},pp={transition:null},g8={ReactCurrentDispatcher:Yn,ReactCurrentBatchConfig:pp,ReactCurrentOwner:L1};function dP(){throw Error("act(...) is not supported in production builds of React.")}et.Children={map:mh,forEach:function(e,t,n){mh(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mh(e,function(){t++}),t},toArray:function(e){return mh(e,function(t){return t})||[]},only:function(e){if(!D1(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};et.Component=Wc;et.Fragment=n8;et.Profiler=s8;et.PureComponent=I1;et.StrictMode=r8;et.Suspense=l8;et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=g8;et.act=dP;et.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=iP({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=L1.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)lP.call(t,l)&&!cP.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Nf,type:e.type,key:s,ref:i,props:r,_owner:o}};et.createContext=function(e){return e={$$typeof:o8,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:i8,_context:e},e.Consumer=e};et.createElement=uP;et.createFactory=function(e){var t=uP.bind(null,e);return t.type=e,t};et.createRef=function(){return{current:null}};et.forwardRef=function(e){return{$$typeof:a8,render:e}};et.isValidElement=D1;et.lazy=function(e){return{$$typeof:u8,_payload:{_status:-1,_result:e},_init:p8}};et.memo=function(e,t){return{$$typeof:c8,type:e,compare:t===void 0?null:t}};et.startTransition=function(e){var t=pp.transition;pp.transition={};try{e()}finally{pp.transition=t}};et.unstable_act=dP;et.useCallback=function(e,t){return Yn.current.useCallback(e,t)};et.useContext=function(e){return Yn.current.useContext(e)};et.useDebugValue=function(){};et.useDeferredValue=function(e){return Yn.current.useDeferredValue(e)};et.useEffect=function(e,t){return Yn.current.useEffect(e,t)};et.useId=function(){return Yn.current.useId()};et.useImperativeHandle=function(e,t,n){return Yn.current.useImperativeHandle(e,t,n)};et.useInsertionEffect=function(e,t){return Yn.current.useInsertionEffect(e,t)};et.useLayoutEffect=function(e,t){return Yn.current.useLayoutEffect(e,t)};et.useMemo=function(e,t){return Yn.current.useMemo(e,t)};et.useReducer=function(e,t,n){return Yn.current.useReducer(e,t,n)};et.useRef=function(e){return Yn.current.useRef(e)};et.useState=function(e){return Yn.current.useState(e)};et.useSyncExternalStore=function(e,t,n){return Yn.current.useSyncExternalStore(e,t,n)};et.useTransition=function(){return Yn.current.useTransition()};et.version="18.3.1";rP.exports=et;var y=rP.exports;const me=Go(y),ji=tP({__proto__:null,default:me},[y]);/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var m8=y,v8=Symbol.for("react.element"),y8=Symbol.for("react.fragment"),S8=Object.prototype.hasOwnProperty,b8=m8.__SECRET_INT
18ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_8={key:!0,ref:!0,__self:!0,__source:!0};function fP(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)S8.call(t,r)&&!_8.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:v8,type:e,key:i,ref:o,props:s,_owner:b8.current}}pm.Fragment=y8;pm.jsx=fP;pm.jsxs=fP;nP.exports=pm;var _=nP.exports;const w8="GTM-P3T38KFN",gp=window;gp.dataLayer??(gp.dataLayer=[]);gp.dataLayer.push({"gtm.start":Date.now(),event:"gtm.js"});const hP=new URL("https://www.googletagmanager.com/gtm.js");hP.searchParams.set("id",w8);const M1=document.createElement("script");M1.async=!0;M1.src=hP.toString();document.head.append(M1);const E8="143742664",fE="hs-script-loader",mp=window;mp.hsConversationsSettings??(mp.hsConversationsSettings={});mp.hsConversationsSettings.avoidInlineStyles=!0;if(!document.getElementById(fE)){const e=document.createElement("script");e.id=fE,e.async=!0,e.defer=!0,e.src=`https://js-eu1.hs-scripts.com/${E8}.js`,document.head.appendChild(e)}var se=typeof window<"u"?window:void 0,En=typeof globalThis<"u"?globalThis:se;typeof self>"u"&&(En.self=En),typeof File>"u"&&(En.File=function(){});var pP=Array.prototype,hE=pP.forEach,pE=pP.indexOf,vr=En==null?void 0:En.navigator,Se=En==null?void 0:En.document,wn=En==null?void 0:En.location,Ny=En==null?void 0:En.fetch,Ly=En!=null&&En.XMLHttpRequest&&"withCredentials"in new En.XMLHttpRequest?En.XMLHttpRequest:void 0,gE=En==null?void 0:En.AbortController,er=vr==null?void 0:vr.userAgent,Me=se??{},di={DEBUG:!1,LIB_VERSION:"1.360.1"};function mE(e,t,n,r,s,i,o){try{var a=e[i](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,s)}function fi(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(l){mE(i,r,s,o,a,"next",l)}function a(l){mE(i,r,s,o,a,"throw",l)}o(void 0)})}}function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ve.apply(null,arguments)}function gP(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var A8=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],C8=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],vE=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return C8.concat(t).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})};function Ze(e,t){return e.indexOf(t)!==-1}var gm=function(e){return e.trim()},Dy=function(e){return e.replace(/^\$/,"")},x8=Array.isArray,mP=Object.prototype,vP=mP.hasOwnProperty,mm=mP.toString,ot=x8||function(e){return mm.call(e)==="[object Array]"},_i=e=>typeof e=="function",Zt=e=>e===Object(e)&&!ot(e),xl=e=>{if(Zt(e)){for(var t in e)if(vP.call(e,t))return!1;return!0}return!1},be=e=>e===void 0,Yt=e=>mm.call(e)=="[object String]",My=e=>Yt(e)&&e.trim().length===0,ys=e=>e===null,nt=e=>be(e)||ys(e),Ys=e=>mm.call(e)=="[object Number]"&&e==e,_l=e=>Ys(e)&&e>0,Ti=e=>mm.call(e)==="[object Boolean]",T8=e=>e instanceof FormData,P8=e=>Ze(A8,e);function yP(e){return e===null||typeof e!="object"}function Wp(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function U1(e){return!be(Event)&&function(t,n){try{return t instanceof n}catch{return!1}}(e,Event)}var R8=[!0,"true",1,"1","yes"],c0=e=>Ze(R8,e),k8=[!1,"false",0,"0","no"];
18function js(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Ys(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+s),js(s||n,t,n,r))}let O8=class{constructor(t){this.t={},this.i=t.i,this.o=js(t.bucketSize,0,100,t.h),this.m=js(t.refillRate,0,this.o,t.h),this.S=js(t.refillInterval,0,864e5,t.h)}$(t,n){var r=n-t.lastAccess,s=Math.floor(r/this.S);if(s>0){var i=s*this.m;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+s*this.S}}consumeRateLimit(t){var n,r=Date.now(),s=String(t),i=this.t[s];return i?this.$(i,r):(i={tokens:this.o,lastAccess:r},this.t[s]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,t)),i.tokens===0)}stop(){this.t={}}};var _r="Mobile",Kp="iOS",wi="Android",yc="Tablet",SP=wi+" "+yc,bP="iPad",_P="Apple",wP=_P+" Watch",bd="Safari",Sc="BlackBerry",EP="Samsung",AP=EP+"Browser",CP=EP+" Internet",Fa="Chrome",I8=Fa+" OS",xP=Fa+" "+Kp,F1="Internet Explorer",TP=F1+" "+_r,$1="Opera",N8=$1+" Mini",j1="Edge",PP="Microsoft "+j1,Vl="Firefox",RP=Vl+" "+Kp,_d="Nintendo",wd="PlayStation",Bl="Xbox",kP=wi+" "+_r,OP=_r+" "+bd,$u="Windows",Uy=$u+" Phone",yE="Nokia",Fy="Ouya",IP="Generic",L8=IP+" "+_r.toLowerCase(),NP=IP+" "+yc.toLowerCase(),$y="Konqueror",$n="(\\d+(\\.\\d+)?)",u0=new RegExp("Version/"+$n),D8=new RegExp(Bl,"i"),M8=new RegExp(wd+" \\w+","i"),U8=new RegExp(_d+" \\w+","i"),V1=new RegExp(Sc+"|PlayBook|BB10","i"),F8={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},vh,SE,d0,$8=(e,t)=>t&&Ze(t,_P)||function(n){return Ze(n,bd)&&!Ze(n,Fa)&&!Ze(n,wi)}(e),LP=function(e,t){return t=t||"",Ze(e," OPR/")&&Ze(e,"Mini")?N8:Ze(e," OPR/")?$1:V1.test(e)?Sc:Ze(e,"IE"+_r)||Ze(e,"WPDesktop")?TP:Ze(e,AP)?CP:Ze(e,j1)||Ze(e,"Edg/")?PP:Ze(e,"FBIOS")?"Facebook "+_r:Ze(e,"UCWEB")||Ze(e,"UCBrowser")?"UC Browser":Ze(e,"CriOS")?xP:Ze(e,"CrMo")||Ze(e,Fa)?Fa:Ze(e,wi)&&Ze(e,bd)?kP:Ze(e,"FxiOS")?RP:Ze(e.toLowerCase(),$y.toLowerCase())?$y:$8(e,t)?Ze(e,_r)?OP:bd:Ze(e,Vl)?Vl:Ze(e,"MSIE")||Ze(e,"Trident/")?F1:Ze(e,"Gecko")?Vl:""},j8={[TP]:[new RegExp("rv:"+$n)],[PP]:[new RegExp(j1+"?\\/"+$n)],[Fa]:[new RegExp("("+Fa+"|CrMo)\\/"+$n)],[xP]:[new RegExp("CriOS\\/"+$n)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+$n)],[bd]:[u0],[OP]:[u0],[$1]:[new RegExp("(Opera|OPR)\\/"+$n)],[Vl]:[new RegExp(Vl+"\\/"+$n)],[RP]:[new RegExp("FxiOS\\/"+$n)],[$y]:[new RegExp("Konqueror[:/]?"+$n,"i")],[Sc]:[new RegExp(Sc+" "+$n),u0],[kP]:[new RegExp("android\\s"+$n,"i")],[CP]:[new RegExp(AP+"\\/"+$n)],[F1]:[new RegExp("(rv:|MSIE )"+$n)],Mozilla:[new RegExp("rv:"+$n)]},V8=function(e,t){var n=LP(e,t),r=j8[n];if(be(r))return null;for(var s=0;s<r.length;s++){var i=r[s],o=e.match(i);if(o)return parseFloat(o[o.length-2])}return null},bE=[[new RegExp(Bl+"; "+Bl+" (.*?)[);]","i"),e=>[Bl,e&&e[1]||""]],[new RegExp(_d,"i"),[_d,""]],[new RegExp(wd,"i"),[wd,""]],[V1,[Sc,""]],[new RegExp($u,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Uy,""];if(new RegExp(_r).test(t)&&!/IEMobile\b/.test(t))return[$u+" "+_r,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],s=F8[r]||"";return/arm/i.test(t)&&(s="RT"),[$u,s]}return[$u,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Kp,t.join(".")]}return[Kp,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=be(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+wi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wi+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[wi,t.join(".")]}return[wi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[I8,""]],[/Linux|debian/i,["Linux",""]]],_E=function(e){return U8.test(e)?_d:M8.test(e)?wd:D8.test(e)?Bl:new RegExp(Fy,"i").test(e)?Fy:new RegExp("("+Uy+"|WPDesktop)","i").test(e)?Uy:/iPad/.test(e)?bP:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?wP:V1.test(e)?Sc:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(yE,"i").test(e)?yE:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(_r).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?wi:SP:new RegExp("(pda|"+_r+")","i").test(e)?L8:new RegExp(yc,"i").test(e)&&!new RegExp(yc+" pc","i").test(e)?NP:""},B8=e=>e instanceof Error;function z8(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return d0&&n.length===SE||(SE=n.length,d0=n.reduce((r,s)=>{vh||(vh={});var i=vh[s];if(i)r[i[0]]=i[1];else for(var o=e(s),a=o.length-1;a>=0;a--){var l=o[a],c=l==null?void 0:l.filename,u=t[s];if(c&&u){r[c]=u,vh[s]=[c,u];break}}return r},{})),d0}}class G8{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(t),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return fi(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&ot(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,s;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),ve({},t,{cause:r,stack:s})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return fi(function*(){var r=t;for(var s of n.modifiers)r=yield s(r);return r})()}convertToExceptionList(t,n){var r,s,i,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=t.synthetic)!==null&&i!==void 0&&i}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,ve({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:z8(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var s=(i,o)=>
18{if(o<=4){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(i,a)}};return ve({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var bc="?";function jy(e,t,n,r,s){var i={platform:e,filename:t,function:n==="<anonymous>"?bc:n,in_app:!0};return be(r)||(i.lineno=r),be(s)||(i.colno=s),i}var DP=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:bc,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},H8=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W8=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,K8=/\((\S*)(?::(\d+))(?::(\d+))\)/,q8=(e,t)=>{var n=H8.exec(e);if(n){var[,r,s,i]=n;return jy(t,r,bc,+s,+i)}var o=W8.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=K8.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=DP(o[1]||bc,o[2]);return jy(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Y8=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Q8=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,X8=(e,t)=>{var n=Y8.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Q8.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||bc;return[i,s]=DP(i,s),jy(t,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},wE=/\(error: (.*)\)/,EE=50;function J8(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(s,i){i===void 0&&(i=0);for(var o=[],a=s.split(` 19`),l=i;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=wE.test(c)?c.replace(wE,"$1"):c;if(!u.match(/\S*Error: /)){for(var d of n){var f=d(u,e);if(f){o.push(f);break}}if(o.length>=EE)break}}}return function(g){if(!g.length)return[];var h=Array.from(g);return h.reverse(),h.slice(0,EE).map(p=>{return ve({},p,{filename:p.filename||(v=h,v[v.length-1]||{}).filename,function:p.function||bc});var v})}(o)}}("web:javascript",q8,X8)}let Z8=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=Yt(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return Wp(t,"DOMException")}isDOMError(t){return Wp(t,"DOMError")}},eU=class{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}},tU=class{constructor(){}match(t){return Wp(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,s=n.apply(t.error);return s||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}};var nU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class rU{match(t){return typeof t=="string"}coerce(t,n){var r,[s,i]=this.getInfos(t);return{type:s??"Error",value:i??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,s=t.match(nU);return s&&(n=s[1],r=s[2]),[n,r]}}var sU=["fatal","error","warning","log","info","debug"];function MP(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length||s.length<=t?s:s.slice(0,t)+"..."}return""}let iU=class{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return U1(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+MP(t)}isSeverityLevel(t){return Yt(t)&&!My(t)&&sU.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(B8(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}},oU=class{match(t){return U1(t)}coerce(t,n){var r,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+MP(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},aU=class{match(t){return yP(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},lU=class{match(t){return Wp(t,"PromiseRejectionEvent")||this.isCu
19stomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!U1(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,s=this.getUnhandledRejectionReason(t);return yP(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}};var UP=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(s){if(se&&(di.DEBUG||Me.POSTHOG_DEBUG||n)&&!be(se.console)&&se.console){for(var i=("__rrweb_original__"in se.console[s])?se.console[s].__rrweb_original__:se.console[s],o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];i(e,...a)}},info:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("log",...i)},warn:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("warn",...i)},error:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];r.k("error",...i)},critical:function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];console.error(e,...i)},uninitializedWarning:s=>{r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>UP(e+" "+s,i)};return r},_e=UP("[PostHog.js]"),Vt=_e.createLogger,cU=Vt("[ExternalScriptsLoader]"),AE=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return cU.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Se==null?void 0:Se.querySelectorAll("script");if(r){for(var s,i=function(){if(r[o].src===t){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)}),l.onerror=c=>n(c),{v:void 0})}},o=0;o<r.length;o++)if(s=i())return s.v}var a=()=>{if(!Se)return n("document not found");var l=Se.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=t,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),e.config.prepare_external_dependency_script&&(l=e.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Se.head.appendChild(l);else{var c,u=Se.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):Se.body.appendChild(l)}};Se!=null&&Se.body?a():Se==null||Se.addEventListener("DOMContentLoaded",a)};Me.__PosthogExtensions__=Me.__PosthogExtensions__||{},Me.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var i=e.requestRouter.endpointFor("assets",r);AE(e,i,n)},Me.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);AE(e,r,n)};var qp={};function wo(e,t,n){if(ot(e)){if(hE&&e.forEach===hE)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(n,e[r],r)===qp)return}}}function yt(e,t,n){if(!nt(e)){if(ot(e))return wo(e,t,n);if(T8(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===qp)return}else for(var s in e)if(vP.call(e,s)&&t.call(n,e[s],s)===qp)return}}var Ht=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return wo(n,function(s){for(var i in s)s[i]!==void 0&&(e[i]=s[i])}),e},_c=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return wo(n,function(s){wo(s,function(i){e.push(i)})}),e};function vp(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var CE=function(e){try{return e()}catch{return}},uU=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(s){_e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_e.critical(s)}}},B1=function(e){var t={};return yt(e,function(n,r){(Yt(n)&&n.length>0||Ys(n))&&(t[r]=n)}),t};function dU(e,t){return n=e,r=i=>Yt(i)&&!ys(t)?i.slice(0,t):i,s=new Set,function i(o,a){return o!==Object(o)?r?r(o,a):o:s.has(o)?void 0:(s.add(o),ot(o)?(l=[],wo(o,c=>{l.push(i(c))})):(l={},yt(o,(c,u)=>{s.has(c)||(l[u]=i(c,u))})),l);var l}(n);var n,r,s}var fU=["herokuapp.com","vercel.app","netlify.app"];function hU(e){var t=e==null?void 0:e.hostname;if(!Yt(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of fU)if(n===r)return!1;return!0}function FP(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function qt(e,t,n,r){var{capture:s=!1,passive:i=!0}=r??{};e==null||e.addEventListener(t,n,{capture:s,passive:i})}
19function $P(e){return e.name==="ph_toolbar_internal"}var jP="$people_distinct_id",ju="__alias",Vu="__timers",xE="$autocapture_disabled_server_side",Vy="$heatmaps_enabled_server_side",TE="$exception_capture_enabled_server_side",By="$error_tracking_suppression_rules",PE="$error_tracking_capture_extension_exceptions",RE="$web_vitals_enabled_server_side",VP="$dead_clicks_enabled_server_side",kE="$product_tours_enabled_server_side",OE="$web_vitals_allowed_metrics",yh="$session_recording_remote_config",Yp="$sesid",BP="$session_is_sampled",Tl="$enabled_feature_flags",Bu="$early_access_features",zy="$feature_flag_details",zu="$stored_person_properties",da="$stored_group_properties",Gy="$surveys",Qp="$flag_call_reported",Hy="$feature_flag_errors",Xp="$feature_flag_evaluated_at",Ps="$user_state",Wy="$client_session_props",Ky="$capture_rate_limit",qy="$initial_campaign_params",Yy="$initial_referrer_info",Jp="$initial_person_info",Zp="$epp",zP="__POSTHOG_TOOLBAR__",pu="$posthog_cookieless",pU=[jP,ju,"__cmpns",Vu,"$session_recording_enabled_server_side",Vy,Yp,Tl,By,Ps,Bu,zy,da,zu,Gy,Qp,Hy,Xp,Wy,Ky,qy,Yy,Zp,Jp];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ys(e)&&isFinite(e)&&Math.floor(e)===e});var IE="0123456789abcdef";let gU=class Qy{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||t<0||n<0||r<0||s<0||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Qy(i)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+IE.charAt(this.bytes[n]>>>4)+IE.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Qy(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}},mU=class{constructor(){this.P=0,this.T=0,this.R=new vU}generate(){var t=this.generateOrAbort();if(be(t)){this.P=0;var n=this.generateOrAbort();if(be(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.I();else{if(!(t+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return gU.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.R.nextUint32())}I(){this.T=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}};var NE,GP=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};se&&!be(se.crypto)&&crypto.getRandomValues&&(GP=e=>crypto.getRandomValues(e));let vU=class{constructor(){this.C=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.C.length&&(GP(this.C),this.O=0),this.C[this.O++]}};var vo=()=>yU().toString(),yU=()=>(NE||(NE=new mU)).generate(),gu="",SU=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function bU(e,t){if(t){var n=function(s,i){if(i===void 0&&(i=Se),gu)return gu;if(!i||["localhost","127.0.0.1"].includes(s))return"";for(var o=s.split("."),a=Math.min(o.length,8),l="dmn_chk_"+vo();!gu&&a--;){var c=o.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";i.cookie=u+";max-age=3",i.cookie.includes(l)&&(i.cookie=u+";max-age=0",gu=c)}return gu}(e);if(!n){var r=(s=>{var i=s.match(SU);return i?i[0]:""})(e);r!==n&&_e.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ms={F:()=>!!Se,M:function(e){_e.error("cookieStore error: "+e)},A:function(e){if(Se){try{for(var t=e+"=",n=Se.cookie.split(";").filter(i=>i.length),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(Ms.A(e))||{}}catch{}return t}
19,j:function(e,t,n,r,s){if(Se)try{var i="",o="",a=bU(Se.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),i="; expires="+l.toUTCString()}s&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&_e.warn("cookieStore warning: large cookie, len="+c.length),Se.cookie=c,c}catch{return}},L:function(e,t){if(Se!=null&&Se.cookie)try{Ms.j(e,"",-1,t)}catch{return}}},f0=null,Mt={F:function(){if(!ys(f0))return f0;var e=!0;if(be(se))e=!1;else try{var t="__mplssupport__";Mt.j(t,"xyz"),Mt.A(t)!=='"xyz"'&&(e=!1),Mt.L(t)}catch{e=!1}return e||_e.error("localStorage unsupported; falling back to cookie store"),f0=e,e},M:function(e){_e.error("localStorage error: "+e)},A:function(e){try{return se==null?void 0:se.localStorage.getItem(e)}catch(t){Mt.M(t)}return null},D:function(e){try{return JSON.parse(Mt.A(e))||{}}catch{}return null},j:function(e,t){try{se==null||se.localStorage.setItem(e,JSON.stringify(t))}catch(n){Mt.M(n)}},L:function(e){try{se==null||se.localStorage.removeItem(e)}catch(t){Mt.M(t)}}},_U=["$device_id","distinct_id",Yp,BP,Zp,Jp,Ps],Sh={},wU={F:function(){return!0},M:function(e){_e.error("memoryStorage error: "+e)},A:function(e){return Sh[e]||null},D:function(e){return Sh[e]||null},j:function(e,t){Sh[e]=t},L:function(e){delete Sh[e]}},sa=null,_n={F:function(){if(!ys(sa))return sa;if(sa=!0,be(se))sa=!1;else try{var e="__support__";_n.j(e,"xyz"),_n.A(e)!=='"xyz"'&&(sa=!1),_n.L(e)}catch{sa=!1}return sa},M:function(e){_e.error("sessionStorage error: ",e)},A:function(e){try{return se==null?void 0:se.sessionStorage.getItem(e)}catch(t){_n.M(t)}return null},D:function(e){try{return JSON.parse(_n.A(e))||null}catch{}return null},j:function(e,t){try{se==null||se.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){_n.M(n)}},L:function(e){try{se==null||se.sessionStorage.removeItem(e)}catch(t){_n.M(t)}}},hi=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});let EU=class{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?hi.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===hi.DENIED||this.consent===hi.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===hi.DENIED}optInOut(t){this.B.j(this.q,t?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get H(){var t=this.B.A(this.q);return c0(t)?hi.GRANTED:Ze(k8,t)?hi.DENIED:hi.PENDING}get B(){if(!this.V){var t=this.N.opt_out_capturing_persistence_type;this.V=t==="localStorage"?Mt:Ms;var n=t==="localStorage"?Ms:Mt;n.A(this.q)&&(this.V.A(this.q)||this.optInOut(c0(n.A(this.q))),n.L(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!FP([vr==null?void 0:vr.doNotTrack,vr==null?void 0:vr.msDoNotTrack,Me.doNotTrack],t=>c0(t))}};var bh=Vt("[Dead Clicks]"),AU=()=>!0,CU=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(VP)),r=e.instance.config.capture_dead_clicks;return Ti(r)?r:!!Zt(r)||n};let LE=class{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[VP]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.G(()=>{this.Y()}):this.stop()}G(t){var n,r;(n=Me.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=Me.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?bh.error("failed to load script",s):t()})}Y(){var t;if(Se){if(!this.W&&(t=Me.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Zt(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.W=Me.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.W.start(Se),bh.info("starting...")}}else bh.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,bh.info("stopping..."))}};var h0=Vt("[SegmentIntegration]");function xU(e,t){var n=e.config.segment;if(!n)return t();(function(r,s){var i=r.config.segment;if(!i)return s();var o=l=>{var c=()=>l.anonymousId()||vo();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(Ps,"identified")),s()},a=i.user();"then"in a&&_i(a.then)?a.then(o):o(a)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||h0.warn("This browser does not have Promise support, and can not use the segment integration");var s=(i,o)=>
19{if(!o)return i;i.event.userId||i.event.anonymousId===r.get_distinct_id()||(h0.info("No userId set, resetting PostHog"),r.reset()),i.event.userId&&i.event.userId!==r.get_distinct_id()&&(h0.info("UserId set, identifying with PostHog"),r.identify(i.event.userId));var a=r.calculateEventProperties(o,i.event.properties);return i.event.properties=Object.assign({},a,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>s(i,i.event.event),page:i=>s(i,"$pageview"),identify:i=>s(i,"$identify"),screen:i=>s(i,"$screen")}})(e)).then(()=>{t()})})}var HP="posthog-js";function WP(e,t){var{organization:n,projectId:r,prefix:s,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return a=>{var l,c,u,d,f;if(!(i==="*"||i.includes(a.level))||!e.__loaded)return a;a.tags||(a.tags={});var g=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());a.tags["PostHog Person URL"]=g,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,p=((l=a.exception)==null?void 0:l.values)||[],v=p.map(S=>ve({},S,{stacktrace:S.stacktrace?ve({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map(b=>ve({},b,{platform:"web:javascript"}))}):void 0}
19)),m={$exception_message:((c=p[0])==null?void 0:c.value)||a.message,$exception_type:(u=p[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:v,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=p[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(f=p[0])==null?void 0:f.type,$sentry_tags:a.tags};return n&&r&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&((h=e.exceptions)==null||h.sendExceptionEvent(m)),a}}let TU=class{constructor(t,n,r,s,i,o){this.name=HP,this.setupOnce=function(a){a(WP(t,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}},DE=class{constructor(t){this.J=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(_e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.K=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.X()}X(){var t;this.Z=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.J)}destroy(){var t;(t=this.Z)==null||t.call(this),this.Z=void 0}doPageView(t,n){var r,s=this.tt(t,n);return this.K={pathname:(r=se==null?void 0:se.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var n;return this.tt(t,(n=this.K)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.K)==null?void 0:t.pageViewId}}tt(t,n){var r=this.K;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=i;if(!(be(o)||be(a)||be(l)||be(c)||be(u)||be(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=o<=1?1:js(a/o,0,1,_e),g=o<=1?1:js(l/o,0,1,_e),h=c<=1?1:js(u/c,0,1,_e),p=c<=1?1:js(d/c,0,1,_e);s=Ht(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:p})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),s}};var eg=e=>{var t=Se==null?void 0:Se.createElement("a");return be(t)?null:(t.href=e,t)},PU=function(e,t){var n,r;t===void 0&&(t="&");var s=[];return yt(e,function(i,o){be(i)||be(o)||o==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(i)?i.name:i.toString()),r=encodeURIComponent(o),s[s.length]=r+"="+n)}),s.join(t)},tg=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var i=r[s].split("=");if(i[0]===t){n=i;break}}if(!ot(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{_e.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ed=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",i=r[1],o=s.split("?"),a=o[1],l=o[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var f=c[d].split("=");ot(f)&&(t.includes(f[0])?u.push(f[0]+"="+n):u.push(c[d]))}var g=l;return a!=null&&(g+="?"+u.join("&")),i!=null&&(g+="#"+i),g},ng=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},_h="https?://(.*)",wc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],RU=_c(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],wc),Ad="<masked>",kU=["li_fat_id"];function KP(e,t,n){if(!Se)return{};var r,s=t?_c([],wc,n||[]):[],i=qP(Ed(Se.URL,s,Ad),e),o=(r={},yt(kU,function(a){var l=Ms.A(a);r[a]=l||null}),r);return Ht(o,i)}function qP(e,t){var n=RU.concat(t||[]),r={};return yt(n,function(s){var i=tg(e,s);r[s]=i||null}),r}function YP(e){var t=function(i){return i?i.search(_h+"google.([^/?]*)")===0?"google":i.search(_h+"bing.com")===0?"bing":i.search(_h+"yahoo.com")===0?"yahoo":i.search(_h+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!ys(t)){r.$search_engine=t;var s=Se?tg(Se.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function ME(){return navigator.language||navigator.userLanguage}function QP(){return(Se==null?void 0:Se.referrer)||"$direct"}function XP(e,t){var n=e?_c([],wc,t||[]):[],r=wn==null?void 0:wn.href.substring(0,1e3);return{r:QP().substring(0,1e3),u:r?Ed(r,n,Ad):void 0}}function JP(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=eg(n))==null?void 0:t.host};
19if(r){s.$current_url=r;var i=eg(r);s.$host=i==null?void 0:i.host,s.$pathname=i==null?void 0:i.pathname;var o=qP(r);Ht(s,o)}if(n){var a=YP(n);Ht(s,a)}return s}function ZP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function OU(){try{return new Date().getTimezoneOffset()}catch{return}}function IU(e,t){var n,r,s,i;if(!er)return{};var o,a,l,c,u,d,f,g,h=e?_c([],wc,t||[]):[],[p,v]=function(m){for(var S=0;S<bE.length;S++){var[b,w]=bE[S],A=b.exec(m),C=A&&(_i(w)?w(A,m):w);if(C)return C}return["",""]}(er);return Ht(B1({$os:p,$os_version:v,$browser:LP(er,navigator.vendor),$device:_E(er),$device_type:(a=er,l={userAgentDataPlatform:(n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform,maxTouchPoints:(r=navigator)==null?void 0:r.maxTouchPoints,screenWidth:se==null||(s=se.screen)==null?void 0:s.width,screenHeight:se==null||(i=se.screen)==null?void 0:i.height,devicePixelRatio:se==null?void 0:se.devicePixelRatio},g=_E(a),g===bP||g===SP||g==="Kobo"||g==="Kindle Fire"||g===NP?yc:g===_d||g===Bl||g===wd||g===Fy?"Console":g===wP?"Wearable":g?_r:(l==null?void 0:l.userAgentDataPlatform)==="Android"&&((c=l==null?void 0:l.maxTouchPoints)!==null&&c!==void 0?c:0)>0?Math.min((u=l==null?void 0:l.screenWidth)!==null&&u!==void 0?u:0,(d=l==null?void 0:l.screenHeight)!==null&&d!==void 0?d:0)/((f=l==null?void 0:l.devicePixelRatio)!==null&&f!==void 0?f:1)>=600?yc:_r:"Desktop"),$timezone:ZP(),$timezone_offset:OU()}),{$current_url:Ed(wn==null?void 0:wn.href,h,Ad),$host:wn==null?void 0:wn.host,$pathname:wn==null?void 0:wn.pathname,$raw_user_agent:er.length>1e3?er.substring(0,997)+"...":er,$browser_version:V8(er,navigator.vendor),$browser_language:ME(),$browser_language_prefix:(o=ME(),typeof o=="string"?o.split("-")[0]:void 0),$screen_height:se==null?void 0:se.screen.height,$screen_width:se==null?void 0:se.screen.width,$viewport_height:se==null?void 0:se.innerHeight,$viewport_width:se==null?void 0:se.innerWidth,$lib:"web",$lib_version:di.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var NU=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class p0{constructor(t,n){this.N=t,this.props={},this.it=!1,this.et=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.B=this.rt(t),this.load(),t.debug&&_e.info("Persistence loaded",t.persistence,ve({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.st}rt(t){NU.indexOf(t.persistence.toLowerCase())===-1&&(_e.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=function(s){s===void 0&&(s=[]);var i=[..._U,...s];return ve({},Mt,{D:function(o){try{var a={};try{a=Ms.D(o)||{}}catch{}var l=Ht(a,JSON.parse(Mt.A(o)||"{}"));return Mt.j(o,l),l}catch{}return null},j:function(o,a,l,c,u,d){try{Mt.j(o,a,void 0,void 0,d);var f={};i.forEach(g=>{a[g]&&(f[g]=a[g])}),Object.keys(f).length&&Ms.j(o,f,l,c,u,d)}catch(g){Mt.M(g)}},L:function(o,a){try{se==null||se.localStorage.removeItem(o),Ms.L(o,a)}catch(l){Mt.M(l)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&Mt.F()?Mt:r==="localstorage+cookie"&&n.F()?n:r==="sessionstorage"&&_n.F()?_n:r==="memory"?wU:r==="cookie"?Ms:n.F()?n:Ms}nt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[Xp];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return yt(this.props,(n,r)=>{if(r===Tl&&Zt(n)){if(!this.nt())for(var s=Object.keys(n),i=0;i<s.length;i++)t["$feature/"+s[i]]=n[s[i]]}else a=r,l=!1,(ys(o=pU)?l:pE&&o.indexOf===pE?o.indexOf(a)!=-1:(yt(o,function(c){if(l||(l=c===a))return qp}),l))||(t[r]=n);var o,a,l}),t}load(){if(!this.st){var t=this.B.D(this.et);t&&(this.props=Ht({},t))}}save(){this.st||this.B.j(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.B.L(this.et,!1),this.B.L(this.et,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Zt(t)){be(n)&&(n="None"),this.ot=be(r)?this.dt:r;var s=!1;if(yt(t,(i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,s=!0)}),s)return this.save(),!0}return!1}register(t,n){if(Zt(t)){this.ot=be(n)?this.dt:n;var r=!1;if(yt(t,(s,i)=>{t.hasOwnProperty(i)&&this.props[i]!==s&&(this.props[i]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.it){var t=KP(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);xl(B1(t))||this.register(t),this.it=!0}}update_search_keyword(){var t;this.register((t=Se==null?void 0:Se.referrer)?YP(t):{})}update_referrer_info(){var t;this.register_once({$referrer:QP(),$referring_domain:Se!=null&&Se.referrer&&((t=eg(Se.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[qy]||this.props[Yy]||this.register_once({[Jp]:XP(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};yt([Yy,qy],o=>{var a=this.props[o];a&&yt(a,function(l,c){t["$initial_"+Dy(c)]=l})});var n,r,s=this.props[Jp];if(s){var i=(n=JP(s),r={},yt(n,function(o,a){r["$initial_"+Dy(a)]=o}),r);Ht(t,i)}return t}safe_merge(t){return yt(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){if(this.dt=this.ot=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,a)=>
19{if(o.length!==a.length)return!1;var l=[...o].sort(),c=[...a].sort();return l.every((u,d)=>u===c[d])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.rt(t),i=this.props;this.clear(),this.B=s,this.props=i,this.save()}}set_disabled(t){this.st=t,this.st?this.remove():this.save()}set_cross_subdomain(t){t!==this.ut&&(this.ut=t,this.remove(),this.save())}set_secure(t){t!==this.ht&&(this.ht=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Vu]||{};r[t]=n,this.props[Vu]=r,this.save()}remove_event_timer(t){var n=(this.props[Vu]||{})[t];return be(n)||(delete this.props[Vu][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var mu={Activation:"events",Cancellation:"cancelEvents"},g0={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Gu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},m0={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Xy={Popover:"popover",Inline:"inline"},LU=function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e}({}),UE=function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e}({}),FE=Vt("[RateLimiter]");class DU{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{FE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void FE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,s;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ky))!==null&&n!==void 0?n:{tokens:i,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>i&&(l.tokens=i);var c=l.tokens<1;return c||t||(l.tokens=Math.max(0,l.tokens-1)),!c||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(s=this.instance.persistence)==null||s.set_property(Ky,l),{isRateLimited:c,remainingTokens:l.tokens}
19}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var vu=Vt("[RemoteConfig]");class eR{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=Me._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}vt(t){var n,r;(n=Me.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=Me.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}ct(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return vu.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void vu.warn("Remote config is disabled. Falling back to local config.");this.vt(t=>{if(!t)return vu.info("No config found after loading remote JS config. Falling back to JSON."),void this.ct(n=>{this.ft(n),this._t()});this.ft(t),this._t()})}catch(t){vu.error("Error loading remote config",t)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||(Se==null?void 0:Se.visibilityState)==="hidden"||this._instance.reloadFeatureFlags()}_t(){var t;if(!this.yt){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.yt=setInterval(()=>{this.refresh()},n))}}ft(t){var n;t||vu.error("Failed to fetch remote config from PostHog."),this._instance.ft(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var yi=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),Gr=Uint8Array,rr=Uint16Array,Ec=Uint32Array,z1=new Gr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),G1=new Gr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$E=new Gr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),tR=function(e,t){for(var n=new rr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var s=new Ec(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)s[i]=i-n[r]<<5|r;return[n,s]},nR=tR(z1,2),MU=nR[0],Jy=nR[1];MU[28]=258,Jy[258]=28;for(var jE=tR(G1,0)[1],rR=new rr(32768),Pt=0;Pt<32768;++Pt){var ia=(43690&Pt)>>>1|(21845&Pt)<<1;ia=(61680&(ia=(52428&ia)>>>2|(13107&ia)<<2))>>>4|(3855&ia)<<4,rR[Pt]=((65280&ia)>>>8|(255&ia)<<8)>>>1}var id=function(e,t,n){for(var r=e.length,s=0,i=new rr(t);s<r;++s)++i[e[s]-1];var o,a=new rr(t);for(s=0;s<t;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new rr(r),s=0;s<r;++s)o[s]=rR[a[e[s]-1]++]>>>15-e[s];return o},$a=new Gr(288);for(Pt=0;Pt<144;++Pt)$a[Pt]=8;for(Pt=144;Pt<256;++Pt)$a[Pt]=9;for(Pt=256;Pt<280;++Pt)$a[Pt]=7;for(Pt=280;Pt<288;++Pt)$a[Pt]=8;var rg=new Gr(32);for(Pt=0;Pt<32;++Pt)rg[Pt]=5;var UU=id($a,9),FU=id(rg,5),sR=function(e){return(e/8>>0)+(7&e&&1)},iR=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof rr?rr:e instanceof Ec?Ec:Gr)(n-t);return r.set(e.subarray(t,n)),r},ai=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},yu=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},v0=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,i=n.slice();if(!s)return[new Gr(0),0];if(s==1){var o=new Gr(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(A,C){return A.f-C.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=n[n[c].f<n[d].f?c++:d++],l=n[c!=u&&n[c].f<n[d].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var f=i[0].s;for(r=1;r<s;++r)i[r].s>f&&(f=i[r].s);var g=new rr(f+1),h=Zy(n[u-1],g,0);if(h>t){r=0;var p=0,v=h-t,m=1<<v;for(i.sort(function(A,C){return g[C.s]-g[A.s]||A.f-C.f});r<s;++r){var S=i[r].s;if(!(g[S]>t))break;p+=m-(1<<h-g[S]),g[S]=t}for(p>>>=v;p>0;){var b=i[r].s;g[b]<t?p-=1<<t-g[b]++-1:++r}for(;r>=0&&p;--r){var w=i[r].s;g[w]==t&&(--g[w],++p)}h=t}return[new Gr(g),h]},Zy=function(e,t,n){return e.s==-1?Math.max(Zy(e.l,t,n+1),Zy(e.r,t,n+1)):t[e.s]=n},VE=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new rr(++t),r=0,s=e[0],i=1,o=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==s&&a!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[a]}return[n.subarray(0,r),t]},Su=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},eS=function(e,t,n){var r=n.length,s=sR(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var i=0;i<r;++i)e[s+i+4]=n[i];return 8*(s+4+r)},BE=function(e,t,n,r,s,i,o,a,l,c,u){ai(t,u++,n),++s[256];for(var d=v0(s,15),f=d[0],g=d[1],h=v0(i,15),p=h[0],v=h[1],m=VE(f),S=m[0],b=m[1],w=VE(p),A=w[0],C=w[1],E=new rr(19),x=0;x<S.length;++x)E[31&S[x]]++;for(x=0;x<A.length;++x)E[31&A[x]]++;for(var R=v0(E,7),T=R[0],P=R[1],I=19;I>4&&!T[$E[I-1]];--I);var U,L,z,O,j=c+5<<3,N=Su(s,$a)+Su(i,rg)+o,V=Su(s,f)+Su(i,p)+o+14+3*I+Su(E,T)+(2*E[16]+3*E[17]+7*E[18]);if(j<=N&&j<=V)return eS(t,u,e.subarray(l,l+c));if(ai(t,u,1+(V<N)),u+=2,V<N){U=id(f,g),L=f,z=id(p,v),O=p;var k=id(T,P);for(ai(t,u,b-257),ai(t,u+5,C-1),ai(t,u+10,I-4),u+=14,x=0;x<I;++x)ai(t,u+3*x,T[$E[x]]);u+=3*I;for(var $=[S,A],M=0;M<2;++M){var B=$[M];for(x=0;x<B.length;++x){var H=31&B[x];ai(t,u,k[H]),u+=T[H],H>15&&(ai(t,u,B[x]>>>5&127),u+=B[x]>>>12)}}}else U=UU,L=$a,z=FU,O=rg;for(x=0;x<a;++x)if(r[x]>255){H=r[x]>>>18&31,yu(t,u,U[H+257]),u+=L[H+257],H>7&&(ai(t,u,r[x]>>>23&31),u+=z1[H]);var X=31&r[x];yu(t,u,z[X]),u+=O[X],X>3&&(yu(t,u,r[x]>>>5&8191),u+=G1[X])}else yu(t,u,U[r[x]]),u+=L[r[x]];return yu(t,u,U[256]),u+L[256]},$U=new Ec([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jU=function(){for(var e=new Ec(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}
19(),VU=function(e,t,n,r,s){return function(i,o,a,l,c,u){var d=i.length,f=new Gr(l+d+5*(1+Math.floor(d/7e3))+c),g=f.subarray(l,f.length-c),h=0;if(!o||d<8)for(var p=0;p<=d;p+=65535){var v=p+65535;v<d?h=eS(g,h,i.subarray(p,v)):(g[p]=u,h=eS(g,h,i.subarray(p,d)))}else{for(var m=$U[o-1],S=m>>>13,b=8191&m,w=(1<<a)-1,A=new rr(32768),C=new rr(w+1),E=Math.ceil(a/3),x=2*E,R=function(pe){return(i[pe]^i[pe+1]<<E^i[pe+2]<<x)&w},T=new Ec(25e3),P=new rr(288),I=new rr(32),U=0,L=0,z=(p=0,0),O=0,j=0;p<d;++p){var N=R(p),V=32767&p,k=C[N];if(A[V]=k,C[N]=V,O<=p){var $=d-p;if((U>7e3||z>24576)&&$>423){h=BE(i,g,0,T,P,I,L,z,j,p-j,h),z=U=L=0,j=p;for(var M=0;M<286;++M)P[M]=0;for(M=0;M<30;++M)I[M]=0}var B=2,H=0,X=b,te=V-k&32767;if($>2&&N==R(p-te))for(var Y=Math.min(S,$)-1,ae=Math.min(32767,p),Ae=Math.min(258,$);te<=ae&&--X&&V!=k;){if(i[p+B]==i[p+B-te]){for(var oe=0;oe<Ae&&i[p+oe]==i[p+oe-te];++oe);if(oe>B){if(B=oe,H=te,oe>Y)break;var K=Math.min(te,oe-2),G=0;for(M=0;M<K;++M){var Q=p-te+M+32768&32767,Z=Q-A[Q]+32768&32767;Z>G&&(G=Z,k=Q)}}}te+=(V=k)-(k=A[V])+32768&32767}if(H){T[z++]=268435456|Jy[B]<<18|jE[H];var ee=31&Jy[B],ge=31&jE[H];L+=z1[ee]+G1[ge],++P[257+ee],++I[ge],O=p+B,++U}else T[z++]=i[p],++P[i[p]]}}h=BE(i,g,u,T,P,I,L,z,j,p-j,h)}return iR(f,0,l+sR(h)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},y0=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function BU(e,t){t===void 0&&(t={});var n=function(){var a=4294967295;return{p:function(l){for(var c=a,u=0;u<l.length;++u)c=jU[255&c^l[u]]^c>>>8;a=c},d:function(){return 4294967295^a}}}(),r=e.length;n.p(e);var s,i=VU(e,t,10+((s=t).filename&&s.filename.length+1||0),8),o=i.length;return function(a,l){var c=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&y0(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){a[3]=8;for(var u=0;u<=c.length;++u)a[u+10]=c.charCodeAt(u)}}(i,t),y0(i,o-8,n.d()),y0(i,o-4,r),i}var zU=function(e){var t,n,r,s,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,` 20`).replace(/\r/g,` 21`)).length,s=0;s<r;s++){var o=e.charCodeAt(s),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),ys(a)||(n>t&&(i+=e.substring(t,n)),i+=a,t=n=s+1)}return n>t&&(i+=e.substring(t,e.length)),i},GU=!!Ly||!!Ny,sg=function(e,t,n){var r;n===void 0&&(n=!0);var[s,i]=e.split("?"),o=ve({},t),a=(r=i==null?void 0:i.split("&").map(c=>{var u,[d,f]=c.split("="),g=n&&(u=o[d])!==null&&u!==void 0?u:f;return delete o[d],d+"="+g}))!==null&&r!==void 0?r:[],l=PU(o);return l&&a.push(l),s+"?"+a.join("&")},Hu=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),S0=e=>{var{data:t,compression:n}=e;if(t){if(n===yi.GZipJS){var r=BU(function(a,l){var c=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var u=new Gr(a.length+(a.length>>>1)),d=0,f=function(v){u[d++]=v},g=0;g<c;++g){if(d+5>u.length){var h=new Gr(d+8+(c-g<<1));h.set(u),u=h}var p=a.charCodeAt(g);p<128||l?f(p):p<2048?(f(192|p>>>6),f(128|63&p)):p>55295&&p<57344?(f(240|(p=65536+(1047552&p)|1023&a.charCodeAt(++g))>>>18),f(128|p>>>12&63),f(128|p>>>6&63),f(128|63&p)):(f(224|p>>>12),f(128|p>>>6&63),f(128|63&p))}return iR(u,0,d)}(Hu(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===yi.Base64){var s=function(a){var l,c,u,d,f,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=0,p=0,v="",m=[];if(!a)return a;a=zU(a);do l=(f=a.charCodeAt(h++)<<16|a.charCodeAt(h++)<<8|a.charCodeAt(h++))>>18&63,c=f>>12&63,u=f>>6&63,d=63&f,m[p++]=g.charAt(l)+g.charAt(c)+g.charAt(u)+g.charAt(d);while(h<a.length);switch(v=m.join(""),a.length%3){case 1:v=v.slice(0,-2)+"==";break;case 2:v=v.slice(0,-1)+"="}return v}(Hu(t)),i=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Hu(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Hu(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},yp=[];Ny&&yp.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:s,estimatedSize:i}=(t=S0(e))!==null&&t!==void 0?t:{},o=new Headers;yt(e.headers,function(u,d){o.append(d,u)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(gE){var c=new gE;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}Ny(a,ve({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&(i||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},e.fetchOptions)).then(u=>u.text().then(d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(g){_e.error(g)}e.callback==null||e.callback(f)})).catch(u=>{_e.error(u),e.callback==null||e.callback({statusCode:0,error:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Ly&&yp.push({transport:"XHR",method:e=>{var t,n=new Ly;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=S0(e))!==null&&t!==void 0?t:{};yt(e.headers,function(i,o){n.setRequestHeader(o,i)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(s)}}),vr!=null&&vr.sendBeacon&&yp.push({transport:"sendBeacon",method:e=>{var t=sg(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=S0(e))!==null&&n!==void 0?n:{},i=typeof s=="string"?new Blob([s],{type:r}):s;vr.sendBeacon(t,i)}catch{}}});var tS=3e3;class HU{constructor(t,n){this.wt=!0,this.Et=[],this.xt=js((n==null?void 0:n.flush_interval_ms)||tS,250,5e3,_e.createLogger("flush interval"),tS),this.St=t}enqueue(t){this.Et.push(t),this.$t||this.kt()}unload(){this.Pt();var t=this.Et.length>0?this.Tt():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.St(ve({},r,{transport:"sendBeacon"}))})}enable(){this.wt=!1,this.kt()}kt(){var t=this;this.wt||(this.$t=setTimeout(()=>{if(this.Pt(),this.Et.length>0){var n=this.Tt(),r=function(){var i=n[s],o=new Date().getTime();i.data&&ot(i.data)&&yt(i.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.St(i)};for(var s in n)r()}},this.xt))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var t={};return yt(this.Et,n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;be(t[i])&&(t[i]=ve({},s,{data:[]})),(r=t[i].data)==null||r.push(s.data)}),this.Et=[],t}}var WU=["retriesPerformedSoFar"];class KU{constructor(t){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=t,this.Et=[],this.Ct=!0,!be(se)&&"onLine"in se.navigator&&(this.Ct=se.navigator.onLine,this.Ot=()=>{this.Ct=!0,this.Ft()},this.Mt=()=>{this.Ct=!1},qt(se,"online",this.Ot),qt(se,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=gP(t,WU);_l(n)&&(r.url=sg(r.url,{retry_count:n})),this._instance._send_request(ve({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.At(ve({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}At(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(n),s=Date.now()+r;this.Et.push({retryAt:s,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),_e.warn(i),this.Rt||(this.Rt=!0,this.Dt())}Dt(){if(this.jt&&clearTimeout(this.jt),this.Et.length===0)return this.Rt=!1,void(this.jt=void 0);this.jt=setTimeout(()=>{this.Ct&&this.Et.length>0&&this.Ft(),this.Dt()},this.It)}Ft(){var t=Date.now(),n=[],r=this.Et.filter(i=>i.retryAt<t||(n.push(i),!1));if(this.Et=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.jt&&(clearTimeout(this.jt),this.jt=void 0),this.Rt=!1,be(se)||(this.Ot&&(se.removeEventListener("online",this.Ot),this.Ot=void 0),this.Mt&&(se.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(ve({},t,{transport:"sendBeacon"}))}catch(n){_e.error(n)}this.Et=[]}}class qU{constructor(t){this.Lt=()=>{var n,r,s,i;this.Nt||(this.Nt={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=a+((o==null?void 0:o.clientHeight)||0),u=(o==null?void 0:o.scrollHeight)||0;this.Nt.lastScrollY=Math.ceil(a),this.Nt.maxScrollY=Math.max(a,(n=this.Nt.maxScrollY)!==null&&n!==void 0?n:0),this.Nt.maxScrollHeight=Math.max(l,(r=this.Nt.maxScrollHeight)!==null&&r!==void 0?r:0),this.Nt.lastContentY=c,this.Nt.maxContentY=Math.max(c,(s=this.Nt.maxContentY)!==null&&s!==void 0?s:0),this.Nt.maxContentHeight=Math.max(u,(i=this.Nt.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}getContext(){return this.Nt}resetContext(){var t=this.Nt;return setTimeout(this.Lt,0),t}startMeasuringScrollPosition(){qt(se,"scroll",this.Lt,{capture:!0}),qt(se,"scrollend",this.Lt,{capture:!0}),qt(se,"resize",this.Lt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return se==null?void 0:se.document.documentElement;var t=ot(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=se==null?void 0:se.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return se&&(se.scrollY||se.pageYOffset||se.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return se&&(se.scrollX||se.pageXOffset||se.document.documentElement.scrollLeft)||0}}var YU=e=>XP(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class zE{constructor(t,n,r,s){this.Ut=i=>{var o=this.zt();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.Ht(this._instance)};this.Bt.register({[Wy]:a})}},this._instance=t,this.qt=n,this.Bt=r,this.Ht=s||YU,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[Wy]}
21getSetOnceProps(){var t,n=(t=this.zt())==null?void 0:t.props;return n?"r"in n?JP(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return yt(B1(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+Dy(r)]=n}),t}}class H1{constructor(){this.Vt={},this.Vt={}}on(t,n){return this.Vt[t]||(this.Vt[t]=[]),this.Vt[t].push(n),()=>{this.Vt[t]=this.Vt[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Vt[t]||[])r(n);for(var s of this.Vt["*"]||[])s(t,n)}}var b0=Vt("[SessionId]");let GE=class{on(t,n){return this.Wt.on(t,n)}constructor(t,n,r){var s;if(this.Gt=[],this.Yt=void 0,this.Wt=new H1,this.Jt=(u,d)=>!(!_l(u)||!_l(d))&&Math.abs(u-d)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.Bt=t.persistence,this.Kt=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Qt=n||vo,this.Zt=r||vo;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*js(o,60,36e3,b0.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ti(),this.ii="ph_"+i+"_window_id",this.ei="ph_"+i+"_primary_window_exists",this.ri()){var a=_n.D(this.ii),l=_n.D(this.ei);a&&!l?this.Kt=a:_n.L(this.ii),_n.j(this.ei,!0)}if((s=this.N.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var d=u.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.N.bootstrap.sessionID);this.si(this.N.bootstrap.sessionID,new Date().getTime(),c)}catch(u){b0.error("Invalid sessionID in bootstrap",u)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return be(this.Gt)&&(this.Gt=[]),this.Gt.push(t),this.Xt&&t(this.Xt,this.Kt),()=>{this.Gt=this.Gt.filter(n=>n!==t)}}ri(){return this.N.persistence!=="memory"&&!this.Bt.st&&_n.F()}oi(t){t!==this.Kt&&(this.Kt=t,this.ri()&&_n.j(this.ii,t))}ai(){return this.Kt?this.Kt:this.ri()?_n.D(this.ii):null}si(t,n,r){t===this.Xt&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Xt=t,this.Bt.register({[Yp]:[n,t,r]}))}li(){var t=this.Bt.props[Yp];return ot(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.si(null,null,null)}destroy(){clearTimeout(this.ui),this.ui=void 0,this.Yt&&se&&(se.removeEventListener("beforeunload",this.Yt,{capture:!1}),this.Yt=void 0),this.Gt=[]}ni(){this.Yt=()=>{this.ri()&&_n.L(this.ei)},qt(se,"beforeunload",this.Yt,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,i,o]=this.li(),a=this.ai(),l=_l(o)&&Math.abs(r-o)>864e5,c=!1,u=!i,d=!u&&!t&&this.Jt(r,s);u||d||l?(i=this.Qt(),a=this.Zt(),b0.info("new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),o=r,c=!0):a||(a=this.Zt(),c=!0);var f=_l(s)&&t&&!l?s:r,g=_l(o)?o:new Date().getTime();return this.oi(a),this.si(i,f,g),t||this.ti(),c&&this.Gt.forEach(h=>h(i,a,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:i,windowId:a,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}ti(){clearTimeout(this.ui),this.ui=setTimeout(()=>{var[t]=this.li();if(this.Jt(new Date().getTime(),t)){var n=this.Xt;this.resetSessionId(),this.Wt.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}};var oR=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&vE(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>vE(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver},ig=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function HE(e,t,n){return Hu({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var aR={exact:(e,t)=>
21t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>ig(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!ig(n,r))),icontains:(e,t)=>t.map(wh).some(n=>e.map(wh).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(wh).every(n=>e.map(wh).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r>parseFloat(s))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(s=>r<parseFloat(s))})},wh=e=>e.toLowerCase();function lR(e,t){return!e||Object.entries(e).every(n=>{var[r,s]=n,i=t==null?void 0:t[r];if(be(i)||ys(i))return!1;var o=[String(i)],a=aR[s.operator];return!!a&&a(s.values,o)})}var Wu=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),WE="i.posthog.com";class QU{constructor(t){this.hi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+WE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.hi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Wu.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Wu.EU:this.hi[this.apiHost]=Wu.CUSTOM),this.hi[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===Wu.CUSTOM)return this.apiHost+n;var r=WE+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var ft=Vt("[Surveys]"),cR="seenSurvey_",XU=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},KE=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(cR,e),JU=[g0.Popover,g0.Widget,g0.API],ZU={ignoreConditions:!1,ignoreDelay:!1,displayType:Xy.Popover},e9=Vt("[PostHog ExternalIntegrations]"),t9={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class n9{constructor(t){this._instance=t}G(t,n){var r;(r=Me.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,s=>{if(s)return e9.error("failed to load script",s);n()})}startIfEnabledOrStop(){var t=this,n=function(o){var a,l,c;!s||(a=Me.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||t.G(t9[o],()=>{var u;(u=Me.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.start(t._instance)}),!s&&(l=Me.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((c=Me.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var od={},_0=0,nS=()=>{},wl="posthog",uR=!GU&&(er==null?void 0:er.indexOf("MSIE"))===-1&&(er==null?void 0:er.indexOf("Mozilla"))===-1,qE=e=>{var t;return ve({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:hU(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nS,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:wn&&Yt(wn==null?void 0:wn.search)&&wn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(se==null||(t=se.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;_e.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:tS},error_tracking:{},_onCapture:nS,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},YE=e=>{var t={};be(e.process_person)||(t.person_profiles=e.process_person),be(e.xhr_headers)||(t.request_headers=e.x
21hr_headers),be(e.cookie_name)||(t.persistence_name=e.cookie_name),be(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),be(e.store_google)||(t.save_campaign_params=e.store_google),be(e.verbose)||(t.debug=e.verbose);var n=Ht({},t,e);return ot(e.property_blacklist)&&(be(e.property_denylist)?n.property_denylist=e.property_blacklist:ot(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:_e.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class r9{constructor(){this.__forceAllowLocalhost=!1}get di(){return this.__forceAllowLocalhost}set di(t){_e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Us{vi(t,n){if(t){var r=this.ci.indexOf(t);r!==-1&&this.ci.splice(r,1)}return this.ci.push(n),n.initialize==null||n.initialize(),n}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new r9,this.fi=!1,this.version=di.LIB_VERSION,this.pi=new H1,this.ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=qE(),this.SentryIntegration=TU,this.sentryIntegration=r=>function(s,i){var o=WP(s,i);return{name:HP,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.gi=!1,this.mi=null,this.bi=null,this.yi=null,this.scrollManager=new qU(this),this.pageViewManager=new DE(this),this.rateLimiter=new DU(this),this.requestRouter=new QU(this),this.consent=new EU(this),this.externalIntegrations=new n9(this);var n=(t=Us.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var o=Yt(r)?{[r]:s}:r;this.setPersonProperties(o),i==null||i({})},set_once:(r,s,i)=>{var o=Yt(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i==null||i({})}},this.on("eventCaptured",r=>_e.info('send "'+(r==null?void 0:r.event)+'"',r))}init(t,n,r){if(r&&r!==wl){var s,i=(s=od[r])!==null&&s!==void 0?s:new Us;return i._init(t,n,r),od[r]=i,od[wl][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var s;if(n===void 0&&(n={}),be(t)||My(t))return _e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.wi(n.debug),this.Ei=n,this.xi=[],n.person_profiles?this.bi=n.person_profiles:n.process_person&&(this.bi=n.process_person),this.set_config(Ht({},qE(n.defaults),YE(n),{name:r,token:t})),this.config.on_xhr_error&&_e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:yi.GZipJS;var i=this.Si();this.persistence=new p0(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new p0(ve({},this.config,{persistence:"sessionStorage"}),i);var o=ve({},this.persistence.props),a=ve({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new HU(h=>this.ki(h),this.config.request_queue_config),this.Pi=new KU(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new GE(this),this.sessionPropsManager=new zE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(_e.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Ti(l)},0)):(_e.info("Initializing extensions synchronously"),this.Ti(l)),di.DEBUG=di.DEBUG||this.config.debug,di.DEBUG&&_e.info("Starting in debug mode",{this:this,config:n,thisC:ve({},this.config),p:o,s:a}),((s=n.bootstrap)==null?void 0:s.distinctID)!==void 0){var c,u,d=this.config.get_device_id(vo()),f=(c=n.bootstrap)!=null&&c.isIdentifiedID?d:n.bootstrap.distinctID;this.persistence.set_property(Ps,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:f})}if(l)this.register_once({distinct_id:pu,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(vo());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(Ps,"anonymous")}return qt(se,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?xU(this,()=>this.Ri()):this.Ri(),_i(this.config._onCapture)&&this.config._onCapture!==nS&&(_e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",h=>this.config._onCapture(h.event,h))),this.config.ip&&_e.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ti(t){var n,r,s,i,o,a,l,c=performance.now(),u=ve({},Us.__defaultExtensionClasses,this.config.__extensionClasses),d=[];u.featureFlags&&this.ci.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new u.featureFlags(this)),u.exceptions&&this.ci.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new u.exceptions(this)),u.historyAutocapture&&this.ci.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.ci.push(new u.tracingHeaders(this)),u.siteApps&&this.ci.push(this.siteApps=new u.
21siteApps(this)),u.sessionRecording&&!t&&this.ci.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.ci.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.ci.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new u.surveys(this)),u.logs&&this.ci.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new u.logs(this)),u.conversations&&this.ci.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new u.conversations(this)),u.productTours&&this.ci.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.ci.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.ci.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.ci.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.ci.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,CU)),u.toolbar&&this.ci.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new u.toolbar(this)),u.experiments&&this.ci.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new u.experiments(this)),this.ci.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.Ii){var f=this.Ii;this.Ii=void 0,this.ft(f)}}),this.Ci(d,c)}Ci(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.Ci(t,n)},0);var r=t.shift();if(r)try{r()}catch(i){_e.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&_e.info("PostHog extensions initialized ("+s+"ms)")}ft(t){var n;if(!Se||!Se.body)return _e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.ft(t)},500);this.config.__preview_deferred_init_extensions&&(this.Ii=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(t.supportedCompression,yi.GZipJS)?yi.GZipJS:Ze(t.supportedCompression,yi.Base64)?yi.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.bi?this.bi:"identified_only"}),this.ci.forEach(r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t))}Ri(){try{this.config.loaded(this)}catch(r){_e.critical("`loaded` function failed",r)}if(this.Oi(),this.config.internal_or_test_user_hostname&&wn!=null&&wn.hostname){var t=wn.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fi()},1),this.Mi=new eR(this),this.Mi.load()}Oi(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.$i)==null||t.enable())}_dom_loaded(){this.is_capturing()&&wo(this.__request_queue,t=>this.ki(t)),this.__request_queue=[],this.Oi()}_handle_unload(){var t,n,r;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Ai()&&this.capture("$pageleave"),(n=this.$i)==null||n.unload(),(r=this.Pi)==null||r.unload()):this.Ai()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(uR?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=sg(t.url,{ip:this.config.ip?1:0}),t.headers=ve({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=ve({},n);o.timeout=o.timeout||6e4,o.url=sg(o.url,{_:new Date().getTime().toString(),ver:di.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=yp.filter(u=>!o.disableTransport||!u.transport||!o.disableTransport.includes(u.transport)),c=(s=(i=FP(l,u=>u.transport===a))==null?void 0:i.method)!==null&&s!==void 0?s:l[0].method;if(!c)throw new Error("No available transport method");c(o)})(ve({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),t.callback==null||t.callback(n)}}))))}ki(t){this.Pi?this.Pi.retriableRequest(t):this._send_request(t)}_execute_array(t){_0++;try{var n,r=[],s=[],i=[];wo(t,a=>{a&&(n=a[0],ot(n)?i.push(a):_i(a)?a.call(this):ot(a)&&n==="alias"?r.push(a):ot(a)&&n.indexOf("capture")!==-1&&_i(this[n])?i.push(a):s.push(a))});var o=function(a,l){wo(a,function(c){if(ot(c[0])){var u=l;yt(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};o(r,this),o(s,this),o(i,this)}finally{_0--}}push(t){if(_0>0&&ot(t)&&Yt(t[0])){var n=Us.prototype[t[0]];_i(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!be(t)&&Yt(t)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!Yt(n==null?void 0:n.$current_url)&&(_e.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.Di||_e.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(r==null?void 0:r.timestamp)||a,c=vo(),u={uuid:c,event:t,properties:this.calculateEventProperties(t,n||{},l,c)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(u.$set=r==null?void 0:r.$set);var d,f=t!=="$groupidentify",g=this.ji(r==null?void 0:r.$set_once,f);if(g&&(u.$set_once=g),(u=dU(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,be(r==null?void 0:r.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),t===Gu.DISMISSED||t===Gu.SENT){var h=n==null?void 0:n[m0.SURVEY_ID],p=n==null?void 0:n[m0.SURVEY_ITERATION];d={id:h,current_iteration:p},localStorage.getItem(KE(d))||localStorage.setItem(KE(d),"true"),u.$set=ve({},u.$set,{[XU({id:h,current_iteration:p},t===Gu.SENT?"responded":"dismissed")]:!0})}else t===Gu.SHOWN&&(u.$set=ve({},u.$set,{[m0.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===LU.SHOWN){var v=n==null?void 0:n[UE.TOUR_TYPE];v&&(u.$set=ve({},u.$set,{[UE.TOUR_LAST_SEEN_DATE+"/"+v]:new Date().toISOString()}))}var m=ve({},u.properties.$set,u.$set);if(xl(m)||this.setPersonPropertiesForFlags(m),!nt(this.config.before_send)){var S=this.Li(u);if(!S)return;u=S}
21this.pi.emit("eventCaptured",u);var b={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.ki(b):this.$i.enqueue(b),u}_e.critical("This capture call is ignored due to client rate limiting.")}}else _e.error("No event name provided to posthog.capture")}else _e.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),a=ve({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),t==="$snapshot"){var l=ve({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Yt(a.distinct_id)&&!Ys(a.distinct_id)||My(a.distinct_id))&&_e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=IU(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());a.$session_id=d,a.$window_id=f}this.sessionPropsManager&&Ht(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Ht(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Pi)==null?void 0:g.length}catch(m){a.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===Wu.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=Ht(a,c),t==="$pageview"&&Se&&(a.title=Se.title),!be(o)){var h=r.getTime()-o;a.$duration=parseFloat((h/1e3).toFixed(3))}er&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ht({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ot(this.config.property_denylist)?yt(this.config.property_denylist,function(m){delete a[m]}):_e.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(_e.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var v=this.Ni();return a.$process_person_profile=v,v&&!i&&this.Ui("_calculate_event_properties"),a}ji(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.Ni()||this.fi)return t;var s=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=Ht({},s,i||{},t||{}),a=this.config.sanitize_properties;return a&&(_e.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),n&&(this.fi=!0),xl(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}zi(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.pi.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:"Surveys module not available"}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:"Surveys module not available"})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=ZU),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:"Surveys module not available"}}canRenderSurveyAsync(t,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:"Surveys module not available"})}identify(t,n,r){if(!this.__loaded||!this.persistence)return _e.uninitializedWarning("posthog.identify");if(Ys(t)&&(t=t.toString(),_e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))_e.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
21ot a hardcoded string.');else if(t!==pu){if(this.Ui("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==s&&t!==this.get_property(ju)&&(this.unregister(ju),this.register({distinct_id:t}));var o,a=(this.persistence.get_property(Ps)||"anonymous")==="anonymous";t!==s&&a?(this.persistence.set_property(Ps,"identified"),this.setPersonPropertiesForFlags(ve({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.yi=HE(t,n,r),(o=this.featureFlags)==null||o.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(Qp))}}else _e.critical('The string "'+pu+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else _e.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Ui("posthog.setPersonProperties")){var r=HE(this.get_distinct_id(),t,n);this.yi!==r?(this.setPersonPropertiesForFlags(ve({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.yi=r):_e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var s=this.getGroups();s[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:ve({},s,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),s[t]===n||r||this.reloadFeatureFlags()}else _e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.Ui("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,s,i,o,a,l;if(_e.info("reset"),!this.__loaded)return _e.uninitializedWarning("posthog.reset");var c=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(s=this.surveys)==null||s.reset(),(i=this.Mi)==null||i.stop(),(o=this.featureFlags)==null||o.reset(),(a=this.persistence)==null||a.set_property(Ps,"anonymous"),(l=this.sessionManager)==null||l.resetSessionId(),this.yi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:pu,$device_id:null},"");else{var u=this.config.get_device_id(vo());this.register_once({distinct_id:u,$device_id:t?u:c},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(t,n){return t===this.get_property(jP)?(_e.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ui("posthog.alias")?(be(n)&&(n=this.get_distinct_id()),t!==n?(this.zi(ju,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(_e.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=ve({},this.config);if(Zt(t)){var r,s,i,o,a,l,c,u,d;Ht(this.config,YE(t));var f=this.Si();(r=this.persistence)==null||r.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new p0(ve({},this.config,{persistence:"sessionStorage"}),f);var g=this.wi(this.config.debug);Ti(g)&&(this.config.debug=g),Ti(this.config.debug)&&(this.config.debug?(di.DEBUG=!0,Mt.F()&&Mt.j("ph_debug","true"),_e.
21info("set_config",{config:t,oldConfig:n,newConfig:ve({},this.config)})):(di.DEBUG=!1,Mt.F()&&Mt.L("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(c=this.deadClicksAutocapture)==null||c.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.Hi(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var s,i,o,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(ve({},s,n))}}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:wl;return n!==wl&&(n=wl+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Ps))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Ps))==="identified"}Ni(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&xl(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[ju])&&((n=this.persistence)==null||(n=n.props)==null||!n[Zp]))}Ai(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ni()||this.Ui("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ui("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ui(t){return this.config.person_profiles==="never"?(_e.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zi(Zp,!0),!0)}Si(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}Hi(){var t,n,r,s,i=this.Si();return((t=this.persistence)==null?void 0:t.st)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.st)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,s,i,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new GE(this),this.pageViewManager=new DE(this),this.persistence&&(this.sessionPropsManager=new zE(this,this.sessionManager,this.persistence));var l=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=Us.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=this.vi(this.sessionRecording,new l(this)))}var c,u;this.consent.optInOut(!0),this.Hi(),this.Oi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((c=this.surveys)==null||c.loadIfEnabled()),(be(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((u=t==null?void 0:t.captureEventName)!==null&&u!==void 0?u:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fi()}
21else _e.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Hi(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:pu,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.Fi())):_e.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===hi.GRANTED?"granted":t===hi.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Hi()}_is_bot(){return vr?oR(vr,this.config.custom_blocked_useragents):void 0}Fi(){Se&&(Se.visibilityState==="visible"?this.gi||(this.gi=!0,this.capture("$pageview",{title:Se.title},{send_instantly:!0}),this.mi&&(Se.removeEventListener("visibilitychange",this.mi),this.mi=null)):this.mi||(this.mi=this.Fi.bind(this),qt(Se,"visibilitychange",this.mi)))}debug(t){t===!1?(se==null||se.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(se==null||se.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}bt(){var t,n,r,s,i,o,a,l=this.Ei||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(_e.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",s=!1,i=_e,o=(n="advanced_disable_flags")in(t=l)&&!nt(t[n]),a=r in t&&!nt(t[r]),o?t[n]:a?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):s)}Li(t){if(nt(this.config.before_send))return t;var n=ot(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),nt(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return P8(t.event)?_e.warn(i+". This can cause unexpected behavior."):_e.info(i),null}r.properties&&!xl(r.properties)||_e.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.K)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}wi(t){var n=Ti(t)&&!t,r=Mt.F()&&Mt.A("ph_debug")==="true";return!n&&(!!r||t)}}Us.__defaultExtensionClasses={},function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=uU(e.prototype[t[n]])}(Us,["identify"]);function QE(e){return e instanceof Element&&(e.id===zP||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function vm(e){return!!e&&e.nodeType===1}function Eo(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function dR(e){return!!e&&e.nodeType===3}function fR(e){return!!e&&e.nodeType===11}function W1(e){return e?gm(e).split(/\s+/):[]}function XE(e){var t=se==null?void 0:se.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function og(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return W1(t)}function hR(e){return nt(e)?null:gm(e).split(/(\s+)/).filter(t=>Cd(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Lf(e){var t="";return rS(e)&&!vR(e)&&e.childNodes&&e.childNodes.length&&yt(e.childNodes,function(n){var r;dR(n)&&n.textContent&&(t+=(r=hR(n.textContent))!==null&&r!==void 0?r:"")}),gm(t)}function JE(e){return be(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var K1=["a","button","form","input","select","textarea","label"];function pR(e,t){if(be(t))return!0;var n,r=function(i){if(t.some(o=>i.matches(o)))return{v:!0}};for(var s of e)if(n=r(s))return n.v;return!1}function gR(e){var t=e.parentNode;return!(!t||!vm(t))&&t}var s9=["next","previous","prev",">","<"],ZE=10,eA=[".ph-no-rageclick",".ph-no-capture"];function i9(e,t){if(!se||q1(e))return!1;var n,r,s;if(Ti(t)?(n=!!t&&eA,r=void 0):(n=(s=t==null?void 0:t.css_selector_ignorelist)!==null&&s!==void 0?s:eA,r=t==null?void 0:t.content_ignorelist),n===!1)return!1;var{targetElementList:i}=mR(e,!1);return!function(o,a){if(o===!1||be(o))return!1;var l;if(o===!0)l=s9;else{if(!ot(o))return!1;if(o.length>ZE)return _e.error("[PostHog] content_ignorelist array cannot exceed "+ZE+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map(c=>c.toLowerCase())}return a.some(c=>{var{safeText:u,ariaLabel:d}=c;return l.some(f=>u.includes(f)||d.includes(f))})}(r,i.map(o=>{var a;return{safeText:Lf(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}}))&&!pR(i,n)}var q1=e=>!e||Eo(e,"html")||!vm(e),mR=(e,t)=>{if(!se||q1(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],s=e;s.parentNode&&!Eo(s,"body");)if(fR(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=gR(s);if(!i)break;if(t||K1.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=se.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};
21function o9(e,t,n,r,s){var i,o,a,l;if(n===void 0&&(n=void 0),!se||q1(e)||(i=n)!=null&&i.url_allowlist&&!XE(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&XE(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some(h=>t.type===h))return!1}var{parentIsUsefulElement:u,targetElementList:d}=mR(e,r);if(!function(h,p){var v=p==null?void 0:p.element_allowlist;if(be(v))return!0;var m,S=function(w){if(v.some(A=>w.tagName.toLowerCase()===A))return{v:!0}};for(var b of h)if(m=S(b))return m.v;return!1}(d,n)||!pR(d,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var f=se.getComputedStyle(e);if(f&&f.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return u?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(K1.indexOf(g)>-1||e.getAttribute("contenteditable")==="true")}}function rS(e){for(var t=e;t.parentNode&&!Eo(t,"body");t=t.parentNode){var n=og(t);if(Ze(n,"ph-sensitive")||Ze(n,"ph-no-capture"))return!1}if(Ze(og(e),"ph-include"))return!0;var r=e.type||"";if(Yt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(Yt(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function vR(e){return!!(Eo(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Eo(e,"select")||Eo(e,"textarea")||e.getAttribute("contenteditable")==="true")}var yR="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",a9=new RegExp("^(?:"+yR+")$"),l9=new RegExp(yR),SR="\\d{3}-?\\d{2}-?\\d{4}",c9=new RegExp("^("+SR+")$"),u9=new RegExp("("+SR+")");function Cd(e,t){return t===void 0&&(t=!0),!(nt(e)||Yt(e)&&(e=gm(e),(t?a9:l9).test((e||"").replace(/[- ]/g,""))||(t?c9:u9).test(e)))}function bR(e){var t=Lf(e);return Cd(t=(t+" "+_R(e)).trim())?t:""}function _R(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yt(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Lf(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+_R(n)).trim())}catch(i){_e.error("[AutoCapture]",i)}}),t}function d9(e){return function(t){var n=t.map(r=>{var s,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=ve({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),c={};return vp(l).sort((u,d)=>{var[f]=u,[g]=d;return f.localeCompare(g)}).forEach(u=>{var[d,f]=u;return c[tA(d.toString())]=tA(f.toString())}),o+=":",o+=vp(c).map(u=>{var[d,f]=u;return d+'="'+f+'"'}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,s,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:f9(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return vp(n).filter(o=>{var[a]=o;return a.indexOf("attr__")===0}).forEach(o=>{var[a,l]=o;return i.attributes[a]=l}),i})}(e))}function tA(e){return e.replace(/"|\\"/g,'\\"')}function f9(e){var t=e.attr__class;return t?ot(t)?t:W1(t):void 0}class nA{constructor(t){this.disabled=t===!1;var n=Zt(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<this.thresholdPx&&r-s.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var w0="$copy_autocapture",rA=Vt("[AutoCapture]");function E0(e,t){return t.length>e?t.slice(0,e)+"...":t}function h9(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!vm(t));return t}function p9(e,t,n,r){var s=e.tagName.toLowerCase(),i={tag_name:s};K1.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?i.$el_text=E0(1024,bR(e)):i.$el_text=E0(1024,Lf(e)));var o=og(e);o.length>0&&(i.classes=o.filter(function(u){return u!==""})),yt(e.attributes,function(u){var d;if((!vR(e)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&
21!t&&Cd(u.value)&&(d=u.name,!Yt(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=W1(f).join(" ")),i["attr__"+u.name]=E0(1024,f)}});for(var a=1,l=1,c=e;c=h9(c);)a++,c.tagName===e.tagName&&l++;return i.nth_child=a,i.nth_of_type=l,i}function g9(e,t){for(var n,r,{e:s,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Eo(u,"body");)fR(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f=[],g={},h=!1,p=!1;if(yt(c,w=>{var A=rS(w);w.tagName.toLowerCase()==="a"&&(h=w.getAttribute("href"),h=A&&h&&Cd(h)&&h),Ze(og(w),"ph-no-capture")&&(p=!0),f.push(p9(w,i,o,a));var C=function(E){if(!rS(E))return{};var x={};return yt(E.attributes,function(R){if(R.name&&R.name.indexOf("data-ph-capture-attribute")===0){var T=R.name.replace("data-ph-capture-attribute-",""),P=R.value;T&&P&&Cd(P)&&(x[T]=P)}}),x}(w);Ht(g,C)}),p)return{props:{},explicitNoCapture:p};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?f[0].$el_text=bR(e):f[0].$el_text=Lf(e)),h){var v,m;f[0].attr__href=h;var S=(v=eg(h))==null?void 0:v.host,b=se==null||(m=se.location)==null?void 0:m.host;S&&b&&S!==b&&(d=h)}return{props:Ht({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:d9(f)},(n=f[0])!=null&&n.$el_text?{$el_text:(r=f[0])==null?void 0:r.$el_text}:{},d&&s.type==="click"?{$external_click_url:d}:{},g)}}var bu=Vt("[ExceptionAutocapture]");function sA(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return _i(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}var m9=Vt("[TracingHeaders]"),Wi=Vt("[Web Vitals]"),iA=9e5,oA="disabled",aA="lazy_loading",_u="awaiting_config",Eh="missing_config";Vt("[SessionRecording]");var sS="[SessionRecording]",oa=Vt(sS),v9=Vt("[Heatmaps]");function lA(e){return Zt(e)&&"clientX"in e&&"clientY"in e&&Ys(e.clientX)&&Ys(e.clientY)}var cA=Vt("[Product Tours]"),A0="ph_product_tours",y9=["$set_once","$set"],Ki=Vt("[SiteApps]");function pl(e,t,n){if(nt(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class S9{constructor(t){this.Bi=new H1,this.qi=(n,r)=>this.Vi(n,r)&&this.Wi(n,r)&&this.Gi(n,r)&&this.Yi(n,r),this.Vi=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.Ji=new Set,this.Ki=new Set}init(){var t;if(!be((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((r,s)=>{this.on(r,s)})}}register(t){var n,r;if(!be((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(o=>{var a,l;(a=this.Ki)==null||a.add(o),(l=o.steps)==null||l.forEach(c=>{var u;(u=this.Ji)==null||u.add((c==null?void 0:c.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;t.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&i.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Ji.has(t)||this.Ji.has(n==null?void 0:n.event))&&this.Ki&&((r=this.Ki)==null?void 0:r.size)>0&&this.Ki.forEach(s=>{this.Xi(n,s)&&this.Bi.emit("actionCaptured",s.name)})}Qi(t){this.onAction("actionCaptured",n=>t(n))}Xi(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.qi(t,r))return!0;return!1}onAction(t,n){return this.Bi.on(t,n)}Wi(t,n){if(n!=null&&n.url){var r,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!pl(s,n.url,n.url_matching||"contains"))return!1}return!0}Gi(t,n){return!!this.Zi(t,n)&&!!this.te(t,n)&&!!this.ie(t,n)}Zi(t,n){var r;if(n==null||!n.href)return!0;var s=this.ee(t);if(s.length>0)return s.some(a=>pl(a.href,n.href,n.href_matching||"exact"));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&pl((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}te(t,n){var r;if(n==null||!n.text)return!0;var s=this.ee(t);if(s.length>0)return s.some(c=>pl(c.text,n.text,n.text_matching||"exact")||pl(c.$el_text,n.text,n.text_matching||"exact"));var i,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(i=function(c){for(var u,d=[],f=/(?::|")text="(.*?)"/g;!nt(u=f.exec(c));)d.includes(u[1])||d.push(u[1]);return d}(l),o=n.text,a=n.text_matching||"exact",i.some(c=>pl(c,o,a)))}ie(t,n){var r,s;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}ee(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Yi(t,n){return n==null||!n.properties||n.properties.length===0||lR(n.properties.reduce((r,s)=>{var i=ot(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class b9{constructor(t){this._instance=t,this.re=new Map,this.se=new Map,this.ne=new Map}oe(t,n){return!!t&&lR(t.propertyFilters,n==null?void 0:n.properties)}ae(t,n){var r=new Map;return t.forEach(s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEac
21h(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}})}),r}le(t,n,r){var s=(r===mu.Activation?this.re:this.se).get(t),i=[];return this.ue(o=>{i=o.filter(a=>s==null?void 0:s.includes(a.id))}),i.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(c=>c.name===t);return this.oe(l,n)})}register(t){var n;be((n=this._instance)==null?void 0:n._addCaptureHook)||(this.he(t),this.de(t))}de(t){var n=t.filter(r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});n.length!==0&&(this.ve==null&&(this.ve=new S9(this._instance),this.ve.init(),this.ve.Qi(r=>{this.onAction(r)})),n.forEach(r=>{var s,i,o,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.ve)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.ne.get(c.name);u&&u.push(r.id),this.ne.set(c.name,u||[r.id])}}))}))}he(t){var n,r=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),s=t.filter(i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});(r.length!==0||s.length!==0)&&((n=this._instance)==null||n._addCaptureHook((i,o)=>{this.onEvent(i,o)}),this.re=this.ae(t,mu.Activation),this.se=this.ae(t,mu.Cancellation))}onEvent(t,n){var r,s=this.ce(),i=this.fe(),o=this.pe(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&a.length>0){var l,c;s.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:a});var u=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(c=n.properties)==null?void 0:c.$product_tour_id);if(u){var d=a.indexOf(u);d>=0&&(a.splice(d,1),this._e(a))}}else{if(this.se.has(t)){var f=this.le(t,n,mu.Cancellation);f.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:f.map(h=>h.id)}),f.forEach(h=>{var p=a.indexOf(h.id);p>=0&&a.splice(p,1),this.ge(h.id)}),this._e(a))}if(this.re.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.re.get(t)});var g=this.le(t,n,mu.Activation);this._e(a.concat(g.map(h=>h.id)||[]))}}}onAction(t){var n,r=this.fe(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ne.has(t)&&this._e(s.concat(this.ne.get(t)||[]))}_e(t){var n,r=this.ce(),s=this.fe(),i=[...new Set(t)].filter(o=>!this.me(o));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:i})}getActivatedIds(){var t,n=this.fe(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.re}be(){return this.ve}}class _9 extends b9{constructor(t){super(t)}fe(){return"$surveys_activated"}pe(){return Gu.SHOWN}ue(t){var n;(n=this._instance)==null||n.getSurveys(t)}ge(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}ce(){return ft}me(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var w9=se!=null&&se.location?ng(se.location.hash,"__posthog")||ng(location.hash,"state"):null,uA="_postHogToolbarParams",dA=Vt("[Toolbar]"),Xi=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(Xi||{}),Xn=Vt("[FeatureFlags]"),wu=Vt("[FeatureFlags]",{debugEnabled:!0}),E9="errors_while_computing_flags",A9="flag_missing",C9="quota_limited",x9="timeout",T9="connection_error",P9="unknown_error",R9=e=>"api_error_"+e,C0="$active_feature_flags",gl="$override_feature_flags",fA="$feature_flag_payloads",Eu="$override_feature_flag_payloads",hA="$feature_flag_request_id",pA=e=>{var t={};for(var[n,r]of vp(e||{}))r&&(t[n]=r);return t},k9=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]}))):Xn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},O9=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({}),x0=Vt("[Error tracking]"),I9={icontains:(e,t)=>!!se&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!se&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!se&&ig(t.href,e),not_regex:(e,t)=>!!se&&!ig(t.href,e),exact:(e,t)=>
21t.href===e,is_not:(e,t)=>t.href!==e};class Rn{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{Rn.ye("retrieved web experiments from the server"),n.we=new Map,s.forEach(i=>{if(i.feature_flag_key){var o;n.we&&(Rn.ye("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.we)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);Yt(a)&&i.variants[a]&&n.Ee(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var l in i.variants){var c=i.variants[l];Rn.xe(c)&&n.Ee(i.name,l,c.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())Rn.ye("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(nt(this.we))return this.we=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Rn.ye("applying feature flags",t),t.forEach(n=>{var r;if(this.we&&(r=this.we)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.we)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.Ee(o.name,i,o.variants[i].transforms)}})}}previewWebExperiment(){var t=Rn.getWindowLocation();if(t!=null&&t.search){var n=tg(t==null?void 0:t.search,"__experiment_id"),r=tg(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Rn.ye("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.Se(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var o=i.json.experiments||[];return t(o)}})}Se(t,n,r){var s=r.filter(i=>i.id===t);s&&s.length>0&&(Rn.ye("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ee(s[0].name,n,s[0].variants[n].transforms))}static xe(t){return!nt(t.conditions)&&Rn.$e(t)&&Rn.ke(t)}static $e(t){var n;if(nt(t.conditions)||nt((n=t.conditions)==null?void 0:n.url))return!0;var r,s,i,o=Rn.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||I9[(s=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,o))}
21static getWindowLocation(){return se==null?void 0:se.location}static ke(t){var n;if(nt(t.conditions)||nt((n=t.conditions)==null?void 0:n.utm))return!0;var r=KP();if(r.utm_source){var s,i,o,a,l,c,u,d,f=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,g=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,h=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,p=(u=t.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&h&&p&&g}return!1}static ye(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];_e.info("[WebExperiments] "+t,r)}Ee(t,n,r){this._is_bot()?Rn.ye("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var i;Rn.ye("applying transform of variant "+n+" for experiment "+t+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o==null||o.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):Rn.ye("Control variants leave the page unmodified.")}_is_bot(){return vr&&this._instance?oR(vr,this._instance.config.custom_blocked_useragents):void 0}}var kr=Vt("[Conversations]"),ym={featureFlags:class{constructor(e){this.Pe=!1,this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.Fe=!1,this.Me=!1,this._instance=e,this.featureFlagEventHandlers=[]}Ae(){var e,t;return(e=(t=this._instance.persistence)==null?void 0:t.nt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}De(){return!!this.Ae()&&(this.Me||this.Re||(this.Me=!0,Xn.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}je(){var e,t=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Fe||(Xn.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Fe=!0),t!=null&&t.length?t.filter(n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||Xn.error("Invalid evaluation context found:",n,"Expected non-empty string"),r}):[]}Le(){return this.je().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var s,i,o=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},a=Object.keys(r).filter(c=>!!r[c]).reduce((c,u)=>(c[u]=r[u]||!1,c),{}),l=Object.keys(o).filter(c=>a[c]).reduce((c,u)=>(o[u]&&(c[u]=o[u]),c),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},s=n!=null&&n.merge?this.getFlagPayloads():{},i=ve({},r,e),o=ve({},s,t),a={};for(var[l,c]of Object.entries(i)){var u=typeof c=="string";a[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:be(o==null?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.Te}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(zy),t=this._instance.get_property(gl),n=this._instance.get_property(Eu);if(!n&&!t)return e||{};var r=Ht({},e||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var i of s){var o,a,l=r[i],c=t==null?void 0:t[i],u=be(c)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!c,d=be(c)?l.variant:typeof c=="string"?c:void 0,f=n==null?void 0:n[i],g=ve({},l,{enabled:u,variant:u?d??(l==null?void 0:l.variant):void 0});u!==(l==null?void 0:l.enabled)&&(g.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(g.original_variant=l==null?void 0:l.variant),f&&(g.metadata=ve({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[i]=g}return this.Pe||(Xn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Pe=!0),r}getFlagVariants(){var e=this._instance.get_property(Tl),t=this._instance.get_property(gl);if(!t)return e||{};for(var n=Ht({},e),r=Object.keys(t),s=0;s<r.length;s++)n[r[s]]=t[r[s]];return this.Pe||(Xn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Pe=!0),n}getFlagPayloads(){var e=this._instance.get_property(fA),t=this._instance.get_property(Eu);if(!t)return e||{};for(var n=Ht({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)n[r[s]]=t[r[s]];return this.Pe||(Xn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Pe=!0),n}reloadFeatureFlags(){this.Ie||this._instance.config.advanced_disable_feature_flags||this.Ne||(this._instance.pi.emit("featureFlagsReloading",!0),this.Ne=setTimeout(()=>{this.Ue()},5))}ze(){clearTimeout(this.Ne),this.Ne=void 0}ensureFlagsLoaded(){this.Te||this.Re||this.Ne||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Ie=e}Ue(e){var t;if(this.ze(),!this._instance.bt())if(this.Re)this.Ce=!0;else{var n=this._instance.config.token,r=this._instance.get_property("$device_id"),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:ve({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(zu)||{}),group_properties:this._instance.get_property(da),timezone:ZP()};ys(r)||be(r)||(s.$device_id=r),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Le()&&(s.evaluation_contexts=this.je());var i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+i);this.Re=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this._instance.config.disable_compression?void 0:yi.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:a=>{var l,c,u,d=!0;if(a.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),d=!1),this.Re=!1,!s.disable_flags||this.Ce){this.Oe=!d;var f=[];
21a.error?a.error instanceof Error?f.push(a.error.name==="AbortError"?x9:T9):f.push(P9):a.statusCode!==200&&f.push(R9(a.statusCode)),(l=a.json)!=null&&l.errorsWhileComputingFlags&&f.push(E9);var g=!((c=a.json)==null||(c=c.quotaLimited)==null||!c.includes(O9.FeatureFlags));if(g&&f.push(C9),(u=this._instance.persistence)==null||u.register({[Hy]:f}),g)Xn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;s.disable_flags||this.receivedFeatureFlags((h=a.json)!==null&&h!==void 0?h:{},d),this.Ce&&(this.Ce=!1,this.Ue())}}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else Xn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var n=this.getFlagVariants(),r=e in n,s=n[e],i=this.getFlagPayloads()[e],o=String(s),a=this._instance.get_property(hA)||void 0,l=this._instance.get_property(Xp)||void 0,c=this._instance.get_property(Qp)||{};if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){var u,d,f,g,h,p,v,m,S,b;ot(c[e])?c[e].push(o):c[e]=[o],(u=this._instance.persistence)==null||u.register({[Qp]:c});var w=this.getFeatureFlagDetails(e),A=[...(d=this._instance.get_property(Hy))!==null&&d!==void 0?d:[]];be(s)&&A.push(A9);var C={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((f=this._instance.config.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((g=this._instance.config.bootstrap)==null||(g=g.featureFlagPayloads)==null?void 0:g[e])||null,$used_bootstrap_value:!this.Oe};be(w==null||(h=w.metadata)==null?void 0:h.version)||(C.$feature_flag_version=w.metadata.version);var E,x=(p=w==null||(v=w.reason)==null?void 0:v.description)!==null&&p!==void 0?p:w==null||(m=w.reason)==null?void 0:m.code;x&&(C.$feature_flag_reason=x),w!=null&&(S=w.metadata)!=null&&S.id&&(C.$feature_flag_id=w.metadata.id),be(w==null?void 0:w.original_variant)&&be(w==null?void 0:w.original_enabled)||(C.$feature_flag_original_response=be(w.original_variant)?w.original_enabled:w.original_variant),w!=null&&(b=w.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=w==null||(E=w.metadata)==null?void 0:E.original_payload),A.length&&(C.$feature_flag_error=A.join(",")),this._instance.capture("$feature_flag_called",C)}if(r){var R=i;if(!be(i))try{R=JSON.parse(i)}catch{}return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:R}}}}else Xn.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,t){var n=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Le()&&(r.evaluation_contexts=this.je()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:yi.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var i,o=(i=s.json)==null?void 0:i.featureFlagPayloads;t((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.Oe){if(this.Te||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return be(n)?void 0:!!n}Xn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.Te=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(i,o,a,l,c){a===void 0&&(a={}),l===void 0&&(l={}),c===void 0&&(c={});var u=k9(i),d=u.flags,f=u.featureFlags,g=u.featureFlagPayloads;if(f){var h=i.requestId,p=i.evaluatedAt;if(ot(f)){Xn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(f)for(var m=0;m<f.length;m++)v[f[m]]=!0;o&&o.register({[C0]:f,[Tl]:v})}else{var S=f,b=g,w=d;if(i.errorsWhileComputingFlags)if(d){var A=new Set(Object.keys(d).filter(C=>{var E;return!((E=d[C])!=null&&E.failed)}));S=ve({},a,Object.fromEntries(Object.entries(S).filter(C=>{var[E]=C;return A.has(E)}))),b=ve({},l,Object.fromEntries(Object.entries(b||{}).filter(C=>{var[E]=C;return A.has(E)}))),w=ve({},c,Object.fromEntries(Object.entries(w||{}).filter(C=>{var[E]=C;return A.has(E)})))}else S=ve({},a,S),b=ve({},l,b),w=ve({},c,w);o&&o.register(ve({[C0]:Object.keys(pA(S)),[Tl]:S||{},[fA]:b||{},[zy]:w||{}},h?{[hA]:h}:{},p?{[Xp]:p}:{}))}}}
21)(e,this._instance.persistence,n,r,s),t||(this.Me=!1),this.He(t)}}override(e,t){t===void 0&&(t=!1),Xn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Xn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(gl),this._instance.persistence.unregister(Eu),this.He(),wu.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,n=e;if(this.Pe=!!((t=n.suppressWarning)!==null&&t!==void 0&&t),"flags"in n){if(n.flags===!1)this._instance.persistence.unregister(gl),wu.info("Flag overrides cleared");else if(n.flags){if(ot(n.flags)){for(var r={},s=0;s<n.flags.length;s++)r[n.flags[s]]=!0;this._instance.persistence.register({[gl]:r})}else this._instance.persistence.register({[gl]:n.flags});wu.info("Flag overrides set",{flags:n.flags})}}return"payloads"in n&&(n.payloads===!1?(this._instance.persistence.unregister(Eu),wu.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[Eu]:n.payloads}),wu.info("Payload overrides set",{payloads:n.payloads}))),void this.He()}this.He()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Te){var{flags:t,flagVariants:n}=this.Be();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,s=(this._instance.get_property(Bu)||[]).find(l=>l.flagKey===e),i={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(i,!1);var a=ve({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[C0]:Object.keys(pA(a)),[Tl]:a}),this.He()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this._instance.get_property(Bu),s=n?"&"+n.map(i=>"stage="+i).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:i=>{var o,a;if(i.json){var l=i.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(Bu),(a=this._instance.persistence)==null||a.register({[Bu]:l}),e(l)}}})}Be(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}He(e){var{flags:t,flagVariants:n}=this.Be();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(zu)||{};this._instance.register({[zu]:ve({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(zu)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this._instance.get_property(da)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=ve({},n[r],e[r]),delete e[r]}),this._instance.register({[da]:ve({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(da)||{};this._instance.register({[da]:ve({},t,{[e]:{}})})}else this._instance.unregister(da)}reset(){this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.$anon_distinct_id=void 0,this.ze(),this.Pe=!1}}},N9={sessionRecording:class{get started(){var e;return!((e=this.qe)==null||!e.isStarted)}get status(){var e,t;return this.Ve===_u||this.Ve===Eh?this.Ve:(e=(t=this.qe)==null?void 0:t.status)!==null&&e!==void 0?e:this.Ve}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ve=oA,this.We=void 0,this._instance=e,!this._instance.sessionManager)throw oa.error("started without valid sessionManager"),new Error(sS+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(sS+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ge(){var e,t=!((e=this._instance.get_property(yh))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return se&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.Ge||(t=this.qe)==null||!t.isStarted){var n=!be(Object.assign)&&!be(Array.from);this.Ge&&n?(this.Ye(e),oa.info("starting")):(this.Ve=oA,this.stopRecording())}}
21Ye(e){var t,n,r;this.Ge&&(this.Ve!==_u&&this.Ve!==Eh&&(this.Ve=aA),Me!=null&&(t=Me.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=Me.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Je(e):(r=Me.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ke,s=>{if(s)return oa.error("could not load recorder",s);this.Je(e)}))}stopRecording(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.stop()}Xe(){var e,t;(e=this.We)==null||e.call(this),this.We=void 0,(t=this.qe)==null||t.discard()}Qe(){var e;(e=this._instance.persistence)==null||e.unregister(BP)}Ze(e,t){if(nt(e))return null;var n,r=Ys(e)?e:parseFloat(e);return typeof(n=r)=="number"&&Number.isFinite(n)&&n>=0&&n<=1?r:(oa.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null)}tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,s=()=>{var i,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Ze((i=this._instance.config.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),l=this.Ze(o==null?void 0:o.sampleRate,"remote config sampleRate"),c=a??l;nt(c)&&this.Qe();var u=o==null?void 0:o.minimumDurationMilliseconds;r.register({[yh]:ve({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:ve({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:c,minimumDurationMilliseconds:be(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers})})};s(),(t=this.We)==null||t.call(this),this.We=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.tr(e),void this.Xe()):(this.tr(e),void this.startIfEnabledOrStop()):(this.Ve===_u&&(this.Ve=Eh,oa.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.qe)!=null&&n.log?this.qe.log(e,t):oa.warn("log called before recorder was ready")}get Ke(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(yh);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}ir(){var e,t=this._instance.get_property(yh);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=36e5}Je(e){var t,n;if((t=Me.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.qe||(this.qe=(n=Me.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ir())return this.Ve===Eh||this.Ve===_u?void 0:(this.Ve=_u,oa.info("persisted remote config is stale, requesting fresh config before starting"),void new eR(this._instance).load());this.Ve=aA,this.qe.start(e)}onRRwebEmit(e){var t;(t=this.qe)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.qe)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.qe||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.qe)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.qe||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.qe)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.qe)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.qe)==null||!n.tryAddCustomEvent(e,t))}}},L9={autocapture:class{constructor(e){this.er=!1,this.rr=null,this.sr=!1,this.instance=e,this.rageclicks=new nA(e.config.rageclick),this.nr=null}initialize(){this.startIfEnabled()}get N(){var e,t,n=Zt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}
21ar(){if(this.isBrowserSupported()){if(se&&Se){var e=n=>{n=n||(se==null?void 0:se.event);try{this.lr(n)}catch(r){rA.error("Failed to capture event",r)}};if(qt(Se,"submit",e,{capture:!0}),qt(Se,"change",e,{capture:!0}),qt(Se,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||(se==null?void 0:se.event),this.lr(n,w0)};qt(Se,"copy",t,{capture:!0}),qt(Se,"cut",t,{capture:!0})}}}else rA.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.er&&(this.ar(),this.er=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.sr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[xE]:!!e.autocapture_opt_out}),this.rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.nr=e}getElementSelectors(e){var t,n=[];return(t=this.nr)==null||t.forEach(r=>{var s=Se==null?void 0:Se.querySelectorAll(r);s==null||s.forEach(i=>{e===i&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[xE],r=this.rr;if(ys(r)&&!Ti(n)&&!this.instance.bt())return!1;var s=(t=this.rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!s}lr(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=JE(e);dR(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&i9(r,this.instance.config.rageclick)&&this.lr(e,"$rageclick");var s=t===w0;if(r&&o9(r,e,this.N,s,s?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=g9(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.sr});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(i.$element_selectors=a),t===w0){var l,c=hR(se==null||(l=se.getSelection())==null?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;i.$selected_content=c,i.$copy_type=u}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return _i(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ur=(se==null||(t=se.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(_e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.hr&&this.hr(),this.hr=void 0,_e.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(se&&se.history){var n=this;(e=se.history.pushState)!=null&&e.__posthog_wrapped__||sA(se.history,"pushState",r=>function(s,i,o){r.call(this,s,i,o),n.dr("pushState")}),(t=se.history.replaceState)!=null&&t.__posthog_wrapped__||sA(se.history,"replaceState",r=>function(s,i,o){r.call(this,s,i,o),n.dr("replaceState")}),this.vr()}}dr(e){try{var t,n=se==null||(t=se.location)==null?void 0:t.pathname;if(!n)return;n!==this.ur&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ur=n}catch(r){_e.error("Error capturing "+e+" pageview",r)}}vr(){if(!this.hr){var e=()=>{this.dr("popstate")};qt(se,"popstate",e),this.hr=()=>{se&&se.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.cr=!1,this.er=!1,this.pr=null,this.instance=e,this.cr=!((t=this.instance.persistence)==null||!t.props[Vy]),this.rageclicks=new nA(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Zt(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return nt(this.instance.config.capture_heatmaps)?nt(this.instance.config.enable_heatmaps)?this.cr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.er)return;v9.info("starting..."),this._r(),this.gr()}else{var e;clearInterval((e=this.pr)!==null&&e!==void 0?e:void 0),this.mr(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Vy]:t}),this.cr=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.C;return this.C=void 0,e}br(e){this.yr(e.originalEvent,"deadclick")}gr(){this.pr&&clearInterval(this.pr),this.pr=function(e){return(e==null?void 0:e.visibilityState)==="visible"}(Se)?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}_r(){se&&Se&&(this.wr=this.Ft.bind(this),qt(se,"beforeunload",this.wr),this.Er=e=>this.yr(e||(se==null?void 0:se.event)),qt(Se,"click",this.Er,{capture:!0}),this.Sr=e=>this.$r(e||(se==null?void 0:se.event)),qt(Se,"mousemove",this.Sr,{capture:!0}),this.kr=new LE(this.instance,AU,this.br.bind(this)),this.kr.startIfEnabledOrStop(),this.Pr=this.gr.bind(this),qt(Se,"visibilitychange",this.Pr),this.er=!0)}mr(){var e;se&&Se&&(this.wr&&se.removeEventListener("beforeunload",this.wr),this.Er&&Se.removeEventListener("click",this.Er,{capture:!0}),this.Sr&&Se.removeEventListener("mousemove",this.Sr,{capture:!0}),this.Pr&&Se.removeEventListener("visibilitychange",this.Pr),clearTimeout(this.Tr),(e=this.kr)==null||e.stop(),this.er=!1)}Rr(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=function(o,a,l){for(var c=o;c&&vm(c)&&!Eo(c,"body");){if(c===l)return!1;if(Ze(a,se==null?void 0:se.getComputedStyle(c).position))return!0;c=gR(c)}return!1}(JE(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}yr(e,t){var n;if(t===void 0&&(t="click"),!QE(e.target)&&lA(e)){var r=this.Rr(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Ir(ve({},r,{type:"rageclick"})),this.Ir(r)}}$r(e){!QE(e.target)&&lA(e)&&(clearTimeout(this.Tr),this.Tr=setTimeout(()=>{this.Ir(this.Rr(e,"mousemove"))},500))}Ir(e){if(se){var t=se.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,s=n?_c([],wc,r||[]):[],i=Ed(t,s,Ad);this.C=this.C||{},this.C[i]||(this.C[i]=[]),this.C[i].push(e)}}Ft(){this.C&&!xl(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:LE,webVitalsAutocapture:class{constructor(e){var t;this.cr=!1,this.er=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Cr=()=>{clearTimeout(this.Or),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((n,r)=>ve({},n,{["$web_vitals_"+r.name+"_event"]:ve({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Fr=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(be(s))Wi.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Mr();be(i)||(nt(n==null?void 0:n.name)||nt(n==null?void 0:n.value)?Wi.error("Invalid metric received",n):this.Ar&&n.value>=this.Ar?Wi.error("Ignoring metric with value >= "+this.Ar,n):(this.C.url!==i&&(this.Cr(),this.Or=setTimeout(this.Cr,this.flushToCaptureTimeoutMs)),be(this.C.url)&&(this.C.url=i),this.C.firstMetricTimestamp=be(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.C.metrics.push(ve({},n,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Cr()))}},this.Dr=()=>{if(!this.er){var n,r,s,i,o=Me.__PosthogExtensions__;be(o)||be(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.Fr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Fr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Fr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Fr.bind(this)),this.er=!0):Wi.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.cr=!((t=this._instance.persistence)==null||!t.props[RE]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Zt(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return nt(n)?((t=this._instance.persistence)==null?void 0:t.props[OE])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Zt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Zt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Ar(){var e=Zt(this._instance.config.capture_performance)&&Ys(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:iA;return 0<e&&e<=6e4?iA:e}get isEnabled(){var e=wn==null?void 0:wn.protocol;if(e!=="http:"&&e!=="https:")return Wi.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Zt(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Ti(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Ti(t)?t:this.cr}startIfEnabled(){this.isEnabled&&!this.er&&(Wi.info("enabled, starting..."),this.G(this.Dr))}onRemoteConfig(e){if("capturePerformance"in e){var t=Zt(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Zt(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[RE]:t}),this._instance.persistence.register({[OE]:n})),this.cr=t,this.startIfEnabled()}}G(e){var t,n;if((t=Me.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=Me.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,s=>{s?Wi.error("failed to load script",s):e()})}}Mr(){var e=se?se.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?_c([],wc,n||[]):[];return Ed(e,r,Ad)}Wi.error("Could not determine current URL")}}},D9={exceptionObserver:class{constructor(e){var t,n,r;this.Dr=()=>{var s;if(se&&this.isEnabled&&(s=Me.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=Me.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=Me.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=Me.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jr&&this.N.capture_unhandled_errors&&(this.jr=i(this.captureException.bind(this))),!this.Lr&&this.N.capture_unhandled_rejections&&(this.Lr=o(this.captureException.bind(this))),!this.Nr&&this.N.capture_console_errors&&(this.Nr=a(this.captureException.bind(this)))}catch(l){bu.error("failed to start",l),this.Ur()}}},this._instance=e,this.zr=!((t=this._instance.persistence)==null||!t.props[TE]),this.Hr=new O8({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:bu}),this.N=this.Br(),this.startIfEnabledOrStop()}Br(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Zt(e)?t=ve({},t,e):(be(e)?this.zr:e)&&(t=ve({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(bu.info("enabled"),this.Ur(),this.G(this.Dr)):this.Ur()}G(e){var t,n;(t=Me.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(
21),(n=Me.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return bu.error("failed to load script",r);e()})}Ur(){var e,t,n;(e=this.jr)==null||e.call(this),this.jr=void 0,(t=this.Lr)==null||t.call(this),this.Lr=void 0,(n=this.Nr)==null||n.call(this),this.Nr=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.zr=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[TE]:this.zr}),this.N=this.Br(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.Br()}captureException(e){var t,n,r,s=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.Hr.consumeRateLimit(s)?bu.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.qr=[],this.Vr=new G8([new Z8,new lU,new tU,new eU,new oU,new iU,new rU,new aU],J8()),this._instance=e,this.qr=(t=(n=this._instance.persistence)==null?void 0:n.get_property(By))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var s=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],i=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.qr=s,this._instance.persistence&&this._instance.persistence.register({[By]:this.qr,[PE]:i})}}get Wr(){var e,t=!!this._instance.get_property(PE),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Vr.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Gr(t)){if(this.Yr(t))return void x0.info("Skipping exception capture because a suppression rule matched");if(!this.Wr&&this.Jr(t))return void x0.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Kr(t))return void x0.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",Di:!0})}Yr(e){if(e.length===0)return!1;var t=e.reduce((n,r)=>{var{type:s,value:i}=r;return Yt(s)&&s.length>0&&n.$exception_types.push(s),Yt(i)&&i.length>0&&n.$exception_values.push(i),n},{$exception_types:[],$exception_values:[]});return this.qr.some(n=>{var r=n.values.map(s=>{var i,o=aR[s.operator],a=ot(s.value)?s.value:[s.value],l=(i=t[s.key])!==null&&i!==void 0?i:[];return a.length>0&&o(a,l)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}Jr(e){return e.flatMap(t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(t=>t.filename&&t.filename.startsWith("chrome-extension://"))}Kr(e){if(e.length>0){var t,n,r,s,i=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=i[i.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}Gr(e){return!nt(e)&&ot(e)}}},M9=ve({productTours:class{constructor(e){this.Xr=null,this.Qr=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[kE]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Xr||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(kE)||this.G(()=>this.Zr())}G(e){var t,n;(t=Me.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=Me.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?cA.error("Could not load product tours script",r):e()})}Zr(){var e;!this.Xr&&(e=Me.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Xr=Me.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!ot(this.Qr)||t){var n=this._instance.persistence;if(n){var r=n.props[A0];if(ot(r)&&!t)return this.Qr=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return cA.error(o),void e([],{isLoaded:!1,error:o})}var a=ot(s.json.product_tours)?s.json.product_tours:[];this.Qr=a,n&&n.register({[A0]:a}),e(a,{isLoaded:!0})}})}else e(this.Qr,{isLoaded:!0})}getActiveProductTours(e){nt(this.Xr)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Xr.getActiveProductTours(e)}showProductTour(e){var t;
21(t=this.Xr)==null||t.showTourById(e)}previewTour(e){this.Xr?this.Xr.previewTour(e):this.G(()=>{var t;this.Zr(),(t=this.Xr)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.Xr)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Xr)==null||e.nextStep()}previousStep(){var e;(e=this.Xr)==null||e.previousStep()}clearCache(){var e;this.Qr=null,(e=this._instance.persistence)==null||e.unregister(A0)}resetTour(e){var t;(t=this.Xr)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Xr)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Xr)==null||t.cancelPendingTour(e)}}},ym),U9={siteApps:class{constructor(e){this._instance=e,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(e,t){if(t){var n=this.globalsForEvent(t);this.ts.push(n),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var e;return(e=Me._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.es.bind(this));this.rs=()=>{e(),this.ts=[],this.rs=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(u))l[d]={id:c[d],type:d,properties:f};var{$set_once:g,$set:h}=e;return{event:ve({},gP(e,y9),{properties:ve({},e.properties,h?{$set:ve({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},h)}:{},g?{$set_once:ve({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},g)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ts.length&&(Ki.info("Processing "+this.ts.length+" events for site app with id "+e.id),this.ts.forEach(a=>t.processEvent==null?void 0:t.processEvent(a)),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.rs)==null||o.call(this))},r=!1,s=o=>{t.errored=!o,t.loaded=!0,Ki.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:o=>{s(o)}});i&&(t.processEvent=i),r=!0}catch(o){Ki.error("Error while initializing PostHog app with config id "+e.id,o),s(!1)}if(r&&t.loaded)try{n()}catch(o){Ki.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}ss(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}ns(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Ki.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,s=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",l=>this.ns(l))):void Ki.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.rs)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(l){var c;Me["__$$ph_site_app_"+l]=s._instance,(c=Me.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,a,u=>{if(u)return Ki.error("Error while initializing PostHog app with config id "+l,u)})};for(var{id:o,url:a}of e.siteApps)i(o)}else Ki.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},F9={tracingHeaders:class{constructor(e){this.os=void 0,this.ls=void 0,this.Dr=()=>{var t,n;be(this.os)&&((t=Me.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),be(this.ls)&&((n=Me.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}G(e){var t,n;(t=Me.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=Me.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return m9.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.Dr):((e=this.os)==null||e.call(this),(t=this.ls)==null||t.call(this),this.os=void 0,this.ls=void 0)}}},$9=ve({surveys:class{constructor(e){this.us=void 0,this._surveyManager=null,this.hs=!1,this.ds=[],this.vs=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(nt(t))return ft.warn("Flags not loaded yet. Not loading surveys.");var n=ot(t);this.us=n?t.length>0:t,ft.info("flags response received, isSurveysEnabled: "+this.us),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(cR)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.hs)ft.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ft.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ft.info("Not loading surveys in cookieless mode without consent.");else{var e=Me==null?void 0:Me.__PosthogExtensions__;if(e){if(!be(this.us)||this._instance.config.advanced_enable_surveys){var t=this.us||this._instance.config.advanced_enable_surveys;this.hs=!0;try{var n=e.generateSurveys;if(n)return void this.cs(n,t);var r=e.loadExternalDependency;if(!r)return void this.fs("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",s=>{s||!e.generateSurveys?this.fs("Could not load surveys script",s):this.cs(e.generateSurveys,t)})}catch(s){throw this.fs("Error initializing surveys",s),s}finally{this.hs=!1}}}else ft.error("PostHog Extensions not found.")}}cs(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new _9(this._instance),ft.info("Surveys loaded successfully"),this.ps({isLoaded:!0})}fs(e,t){ft.error(e,t),this.ps({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ds.push(e),this._surveyManager&&this.ps({isLoaded:!0}),()=>{this.ds=this.ds.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return ft.info("Disabled. Not loading surveys."),e([]);var n,r=this._instance.get_property(Gy);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.vs?this.vs.then(s=>{var{surveys:i,context:o}=s;return e(i,o)}):(typeof Promise<"u"&&(this.vs=new Promise(s=>{n=s})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var i;this.vs=null;var o=s.statusCode;if(o!==200||!s.json){var a="Surveys API could not be loaded, status: "+o;ft.error(a);var l={isLoaded:!1,error:a};return e([],l),void(n==null||n({surveys:[],context:l}))}var c,u=s.json.surveys||[],d=u.filter(g=>function(h){return!(!h.start_date||h.end_date)}(g)&&(function(h){var p;return!((p=h.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)}(g)||function(h){var p;return!((p=h.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)}(g)));d.length>0&&((c=this._surveyEventReceiver)==null||c.register(d)),(i=this._instance.persistence)==null||i.register({[Gy]:u});var f={isLoaded:!0};e(u,f),n==null||n({surveys:u,context:f})}}))}ps(e){for(var t of this.ds)try{if(!e.isLoaded)return t([],e);
21this.getSurveys(t)}catch(n){ft.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!nt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);ft.warn("init was not called")}_s(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(s=>s.id===e))!==null&&r!==void 0?r:null}),t}gs(e){if(nt(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this._s(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(nt(this._surveyManager))return ft.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.gs(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return nt(this._surveyManager)?(ft.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(n=>{this.getSurveys(r=>{var s,i=(s=r.find(a=>a.id===e))!==null&&s!==void 0?s:null;if(i){var o=this.gs(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var r;if(nt(this._surveyManager))ft.warn("init was not called");else{var s=typeof e=="string"?this._s(e):e;if(s!=null&&s.id)if(JU.includes(s.type)){var i=Se==null?void 0:Se.querySelector(t);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(ft.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,a;ft.info("Rendering survey "+s.id+" with delay of "+((o=s.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(s,i,n),ft.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);ft.warn("Survey element not found")}else ft.warn("Surveys of type "+s.type+" cannot be rendered in the app");else ft.warn("Survey not found")}}displaySurvey(e,t){var n;if(nt(this._surveyManager))ft.warn("init was not called");else{var r=this._s(e);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=ve({},r,{appearance:ve({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Xy.Popover&&t.initialResponses&&ft.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void ft.warn("Survey is not eligible to be displayed: ",i.disabledReason)}t.displayType!==Xy.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else ft.warn("Survey not found")}}cancelPendingSurvey(e){nt(this._surveyManager)?ft.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},ym),j9={toolbar:class{constructor(e){this.instance=e}bs(e){Me.ph_toolbar_state=e}ys(){var e;return(e=Me.ph_toolbar_state)!==null&&e!==void 0?e:Xi.UNINITIALIZED}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),$P(this.instance.config)||!se||!Se)return!1;e=e??se.location,n=n??se.history;try{if(!t){try{se.localStorage.setItem("test","test"),se.localStorage.removeItem("test")}catch{return!1}t=se==null?void 0:se.localStorage}var r,s=w9||ng(e.hash,"__posthog")||ng(e.hash,"state"),i=s?CE(()=>JSON.parse(atob(decodeURIComponent(s))))||CE(()=>JSON.parse(decodeURIComponent(s))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(uA)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}ws(e){var t=Me.ph_load_toolbar||Me.ph_load_editor;!nt(t)&&_i(t)?t(e,this.instance):dA.warn("No toolbar load function found")}loadToolbar(e){var t=!(Se==null||!Se.getElementById(zP));if(!se||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=ve({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(se.localStorage.setItem(uA,JSON.stringify(ve({},r,{source:void 0}))),this.ys()===Xi.LOADED)this.ws(r);else if(this.ys()===Xi.UNINITIALIZED){var s;this.bs(Xi.LOADING),(s=Me.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",i=>{if(i)return dA.error("[Toolbar] Failed to load",i),void this.bs(Xi.UNINITIALIZED);this.bs(Xi.LOADED),this.ws(r)}),qt(se,"turbolinks:load",()=>{this.bs(Xi.UNINITIALIZED),this.loadToolbar(r)})}return!0}Es(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},V9=ve({experiments:Rn},ym),B9={conversations:class{constructor(e){this.xs=void 0,this._conversationsManager=null,this.Ss=!1,this.$s=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;nt(t)||(Ti(t)?this.xs=t:(this.xs=t.enabled,this.$s=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.xs=void 0,this.$s=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ss||this._instance.config.disable_conversations||$P(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Me==null?void 0:Me.__PosthogExtensions__;if(e&&!be(this.xs)&&this.xs)if(this.$s&&this.$s.token){this.Ss=!0;try{var t=e.initConversations;if(t)return this.ks(t),void(this.Ss=!1);var n=e.loadExternalDependency;if(!n)return void this.Ps("PostHog loadExternalDependency extension not found.");n(this._instance,"conversations",r=>{r||!e.initConversations?this.Ps("Could not load conversations script",r):this.ks(e.initConversations),this.Ss=!1})}catch(r){this.Ps("Error initializing conversations",r),this.Ss=!1}}else kr.error("Conversations enabled but missing token in remote config.")}}ks(e){if(this.$s)try{this._conversationsManager=e(this.$s,this._instance),kr.info("Conversations loaded successfully")}catch(t){this.Ps("Error completing conversations initialization",t)}else kr.error("Cannot complete initialization: remote config is null")}Ps(e,t){kr.error(e,t),this._conversationsManager=null,this.Ss=!1}show(){this._conversationsManager?this._conversationsManager.show():kr.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.xs===!0&&!ys(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return fi(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(kr.warn("Conversations not available yet."),null)})()}getMessages(e,t){var n=this;return fi(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(kr.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return fi(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(kr.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return fi(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(kr.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var t=this;return fi(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(kr.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var t=this;return fi(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(kr.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return fi(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(kr.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}}},z9={logs:class{constructor(e){var t;this.Ts=!1,this.Rs=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.Ts=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!nt(n)&&n&&(this.Ts=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ts&&!this.Rs){var e=Vt("[logs]"),t=Me==null?void 0:Me.__PosthogExtensions__;if(t){var n=t.loadExternalDependency;n?n(this._instance,"logs",r=>{var s;r||(s=t.logs)==null||!s.initializeLogs?e.error("Could not load logs script",r):(t.logs.initializeLogs(this._instance),this.Rs=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}},G9=ve({},ym,N9,L9,D9,M9,U9,$9,F9,j9,V9,B9,z9);Us.__defaultExtensionClasses=ve({},G9);var gA,jr=(gA=od[wl]=new Us,function(){function e(){e.done||(e.done=!0,uR=!1,yt(od,function(t){t._dom_loaded()}))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():qt(Se,"DOMContentLoaded",e,{capture:!1}):se&&_e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),gA),Sm=y.createContext({client:jr,bootstrap:void 0});function wR(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;
21if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(var i=0,o=r;i<o.length;i++){var a=o[i];if(!s.includes(a)||!wR(e[a],t[a],n))return!1}return!0}function H9(e){var t,n,r=e.children,s=e.client,i=e.apiKey,o=e.options,a=y.useRef(null),l=y.useMemo(function(){return s?(i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s):(i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),jr)},[s,i,JSON.stringify(o)]);return y.useEffect(function(){if(!s){var c=a.current;c?(i!==c.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!wR(o,c.options)&&jr.set_config(o),a.current={apiKey:i,options:o??{}}):(jr.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),jr.init(i,o),a.current={apiKey:i,options:o??{}})}},[s,i,JSON.stringify(o)]),me.createElement(Sm.Provider,{value:{client:l,bootstrap:(t=o==null?void 0:o.bootstrap)!==null&&t!==void 0?t:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var T0=function(e){return typeof e=="function"},W9=function(e){return e===void 0};function K9(e){var t,n,r=y.useContext(Sm),s=r.client,i=r.bootstrap,o=y.useState(function(){return s.isFeatureEnabled(e)}),a=o[0],l=o[1];y.useEffect(function(){return s.onFeatureFlags(function(){l(s.isFeatureEnabled(e))})},[s,e]);var c=(t=i==null?void 0:i.featureFlags)===null||t===void 0?void 0:t[e];return!(!((n=s==null?void 0:s.featureFlags)===null||n===void 0)&&n.hasLoadedFlags)&&(i!=null&&i.featureFlags)?W9(c)?void 0:!!c:a}var tl=function(){var e=y.useContext(Sm).client;return e},iS=function(e,t){return iS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&
vendor: 12,143 bytes, lines 21-38
21(n[s]=r[s])},iS(e,t)};function q9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");iS(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Y9={componentStack:null,exceptionEvent:null,error:null},Q9={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){q9(t,e);function t(n){var r=e.call(this,n)||this;return r.state=Y9,r}return t.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;T0(s)?i=s(n):typeof s=="object"&&(i=s);var o=this.context.client,a=o.captureException(n,i),l=r.componentStack;this.setState({error:n,componentStack:l??null,exceptionEvent:a})},t.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,i=this.state;if(i.componentStack==null)return T0(r)?r():r;var o=T0(s)?me.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return me.isValidElement(o)?o:(console.warn(Q9.INVALID_FALLBACK),me.createElement(me.Fragment,null))},t.contextType=Sm,t})(me.Component);var oS={},ER={exports:{}},Ar={},AR={exports:{}},CR={};/** 22 * @license React 23 * scheduler.production.min.js 24 * 25 * Copyright (c) Facebook, Inc. and its affiliates. 26 * 27 * This source code is licensed under the MIT license found in the 28 * LICENSE file in the root directory of this source tree. 29 */(function(e){function t(N,V){var k=N.length;N.push(V);e:for(;0<k;){var $=k-1>>>1,M=N[$];if(0<s(M,V))N[$]=V,N[k]=M,k=$;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var V=N[0],k=N.pop();if(k!==V){N[0]=k;e:for(var $=0,M=N.length,B=M>>>1;$<B;){var H=2*($+1)-1,X=N[H],te=H+1,Y=N[te];if(0>s(X,k))te<M&&0>s(Y,X)?(N[$]=Y,N[te]=k,$=te):(N[$]=X,N[H]=k,$=H);else if(te<M&&0>s(Y,k))N[$]=Y,N[te]=k,$=te;else break e}}return V}function s(N,V){var k=N.sortIndex-V.sortIndex;return k!==0?k:N.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,f=3,g=!1,h=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(N){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=N)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function w(N){if(p=!1,b(N),!h)if(n(l)!==null)h=!0,O(A);else{var V=n(c);V!==null&&j(w,V.startTime-N)}}function A(N,V){h=!1,p&&(p=!1,m(x),x=-1),g=!0;var k=f;try{for(b(V),d=n(l);d!==null&&(!(d.expirationTime>V)||N&&!P());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var M=$(d.expirationTime<=V);V=e.unstable_now(),typeof M=="function"?d.callback=M:d===n(l)&&r(l),b(V)}else r(l);d=n(l)}if(d!==null)var B=!0;else{var H=n(c);H!==null&&j(w,H.startTime-V),B=!1}return B}finally{d=null,f=k,g=!1}}var C=!1,E=null,x=-1,R=5,T=-1;function P(){return!(e.unstable_now()-T<R)}function I(){if(E!==null){var N=e.unstable_now();T=N;var V=!0;try{V=E(!0,N)}finally{V?U():(C=!1,E=null)}}else C=!1}var U;if(typeof S=="function")U=function(){S(I)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,z=L.port2;L.port1.onmessage=I,U=function(){z.postMessage(null)}}else U=function(){v(I,0)};function O(N){E=N,C||(C=!0,U())}function j(N,V){x=v(function(){N(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,O(A))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(N){switch(f){case 1:case 2:case 3:var V=3;break;default:V=f}var k=f;f=V;try{return N()}finally{f=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var k=f;f=N;try{return V()}finally{f=k}},e.unstable_scheduleCallback=function(N,V,k){var $=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?$+k:$):k=$,N){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=k+M,N={id:u++,callback:V,priorityLevel:N,startTime:k,expirationTime:M,sortIndex:-1},k>$?(N.sortIndex=k,t(c,N),n(l)===null&&N===n(c)&&(p?(m(x),x=-1):p=!0,j(w,k-$))):(N.sortIndex=M,t(l,N),h||g||(h=!0,O(A))),N},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(N){var V=f;return function(){var k=f;f=V;try{return N.apply(this,arguments)}finally{f=k}}}})(CR);AR.exports=CR;var X9=AR.exports;/** 30 * @license React 31 * react-dom.production.min.js 32 * 33 * Copyright (c) Facebook, Inc. and its affiliates. 34 * 35 * This source code is licensed under the MIT license found in the 36 * LICENSE file in the root directory of this source tree. 37 */var J9=y,Er=X9;function ce(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var xR=new Set,xd={};function nl(e,t){Ac(e,t),Ac(e+"Capture",t)}function Ac(e,t){for(xd[e]=t,e=0;e<t.length;e++)xR.add(t[e])}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),aS=Object.prototype.hasOwnProperty,Z9=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mA={},vA={};function e7(e){return aS.call(vA,e)?!0:aS.call(mA,e)?!1:Z9.test(e)?vA[e]=!0:(mA[e]=!0,!1)}function t7(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function n7(e,t,n,r){if(t===null||typeof t>"u"||t7(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qn(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Cn[e]=new Qn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Cn[t]=new Qn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Cn[e]=new Qn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Cn[e]=new Qn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Cn[e]=new Qn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Cn[e]=new Qn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Cn[e]=new Qn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Cn[e]=new Qn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Cn[e]=new Qn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Y1=/[\-:]([a-z])/g;function Q1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Y1,Q1);Cn[t]=new Qn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Y1,Q1);Cn[t]=new Qn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Y1,Q1);Cn[t]=new Qn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Cn[e]=new Qn(e,1,!1,e.toLowerCase(),null,!1,!1)});Cn.xlinkHref=new Qn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Cn[e]=new Qn(e,1,!1,e.toLowerCase(),null,!0,!0)});function X1(e,t,n,r){var s=Cn.hasOwnProperty(t)?Cn[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(n7(t,n,s,r)&&(n=null),r||s===null?e7(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Vi=J9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ah=Symbol.for("react.element"),Pl=Symbol.for("react.portal"),Rl=Symbol.for("react.fragment"),J1=Symbol.for("react.strict_mode"),lS=Symbol.for("react.profiler"),TR=Symbol.for("react.provider"),PR=Symbol.for("react.context"),Z1=Symbol.for("react.forward_ref"),cS=Symbol.for("react.suspense"),uS=Symbol.for("react.suspense_list"),eb=Symbol.for("react.memo"),to=Symbol.for("react.lazy"),RR=Symbol.for("react.offscreen"),yA=Symbol.iterator;function Au(e){return e===null||typeof e!="object"?null:(e=yA&&e[yA]||e["@@iterator"],typeof e=="function"?e:null)}var jt=Object.assign,P0;function Ku(e){if(P0===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);P0=t&&t[1]||""}return` 38`+P0+e}var R0=!1;function k0(e,t){if(!e||R0)return"";R0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}
vendor: 5,499 bytes, lines 38-41
38catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(` 39`),i=r.stack.split(` 40`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=` 41`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{R0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ku(e):""}function r7(e){switch(e.tag){case 5:return Ku(e.type);case 16:return Ku("Lazy");case 13:return Ku("Suspense");case 19:return Ku("SuspenseList");case 0:case 2:case 15:return e=k0(e.type,!1),e;case 11:return e=k0(e.type.render,!1),e;case 1:return e=k0(e.type,!0),e;default:return""}}function dS(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Rl:return"Fragment";case Pl:return"Portal";case lS:return"Profiler";case J1:return"StrictMode";case cS:return"Suspense";case uS:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case PR:return(e.displayName||"Context")+".Consumer";case TR:return(e._context.displayName||"Context")+".Provider";case Z1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eb:return t=e.displayName||null,t!==null?t:dS(e.type)||"Memo";case to:t=e._payload,e=e._init;try{return dS(e(t))}catch{}}return null}function s7(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dS(t);case 8:return t===J1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Lo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function i7(e){var t=kR(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ch(e){e._valueTracker||(e._valueTracker=i7(e))}function OR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kR(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ag(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function fS(e,t){var n=t.checked;return jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function SA(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Lo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function IR(e,t){t=t.checked,t!=null&&X1(e,"checked",t,!1)}function hS(e,t){IR(e,t);var n=Lo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pS(e,t.type,n):t.hasOwnProperty("defaultValue")&&pS(e,t.type,Lo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function bA(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pS(e,t,n){(t!=="number"||ag(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qu=Array.isArray;function zl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Lo(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function gS(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ce(91));return jt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _A(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ce(92));
vendor: 10,114 bytes, line 41
41if(qu(n)){if(1<n.length)throw Error(ce(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Lo(n)}}function NR(e,t){var n=Lo(t.value),r=Lo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function wA(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function LR(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mS(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?LR(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var xh,DR=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(xh=xh||document.createElement("div"),xh.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=xh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Td(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ad={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},o7=["Webkit","ms","Moz","O"];Object.keys(ad).forEach(function(e){o7.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ad[t]=ad[e]})});function MR(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ad.hasOwnProperty(e)&&ad[e]?(""+t).trim():t+"px"}function UR(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=MR(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var a7=jt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vS(e,t){if(t){if(a7[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function yS(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var SS=null;function tb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bS=null,Gl=null,Hl=null;function EA(e){if(e=Uf(e)){if(typeof bS!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=Am(t),bS(e.stateNode,e.type,t))}}function FR(e){Gl?Hl?Hl.push(e):Hl=[e]:Gl=e}function $R(){if(Gl){var e=Gl,t=Hl;if(Hl=Gl=null,EA(e),t)for(e=0;e<t.length;e++)EA(t[e])}}function jR(e,t){return e(t)}function VR(){}var O0=!1;function BR(e,t,n){if(O0)return e(t,n);O0=!0;try{return jR(e,t,n)}finally{O0=!1,(Gl!==null||Hl!==null)&&(VR(),$R())}}function Pd(e,t){var n=e.stateNode;if(n===null)return null;var r=Am(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ce(231,t,typeof n));return n}var _S=!1;if(Ni)try{var Cu={};Object.defineProperty(Cu,"passive",{get:function(){_S=!0}}),window.addEventListener("test",Cu,Cu),window.removeEventListener("test",Cu,Cu)}catch{_S=!1}function l7(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ld=!1,lg=null,cg=!1,wS=null,c7={onError:function(e){ld=!0,lg=e}};function u7(e,t,n,r,s,i,o,a,l){ld=!1,lg=null,l7.apply(c7,arguments)}function d7(e,t,n,r,s,i,o,a,l){if(u7.apply(this,arguments),ld){if(ld){var c=lg;ld=!1,lg=null}else throw Error(ce(198));cg||(cg=!0,wS=c)}}function rl(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function zR(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function AA(e){if(rl(e)!==e)throw Error(ce(188))}function f7(e){var t=e.alternate;if(!t){if(t=rl(e),t===null)throw Error(ce(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return AA(s),e;if(i===r)return AA(s),t;i=i.sibling}throw Error(ce(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(ce(189))}}if(n.alternate!==r)throw Error(ce(190))}if(n.tag!==3)throw Error(ce(188));return n.stateNode.current===n?e:t}function GR(e){return e=f7(e),e!==null?HR(e):null}function HR(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=HR(e);if(t!==null)return t;e=e.sibling}return null}var WR=Er.unstable_scheduleCallback,CA=Er.unstable_cancelCallback,h7=Er.unstable_shouldYield,p7=Er.unstable_requestPaint,Wt=Er.unstable_now,g7=Er.unstable_getCurrentPriorityLevel,nb=Er.unstable_ImmediatePriority,KR=Er.unstable_UserBlockingPriority,ug=Er.unstable_NormalPriority,m7=Er.unstable_LowPriority,qR=Er.unstable_IdlePriority,bm=null,Hs=null;function v7(e){if(Hs&&typeof Hs.onCommitFiberRoot=="function")try{Hs.onCommitFiberRoot(bm,e,void 0,(e.current.flags&128)===128)}catch{}}var hs=Math.clz32?Math.clz32:b7,y7=Math.log,S7=Math.LN2;function b7(e){return e>>>=0,e===0?32:31-(y7(e)/S7|0)|0}var Th=64,Ph=4194304;function Yu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dg(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Yu(a):(i&=o,i!==0&&(r=Yu(i)))}else o=n&~s,o!==0?r=Yu(o):i!==0&&(r=Yu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-hs(t),s=1<<n,r|=e[n],t&=~s;return r}function _7(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function w7(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-hs(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=_7(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function ES(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function YR(){var e=Th;return Th<<=1,!(Th&4194240)&&(Th=64),e}function I0(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Df(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hs(t),e[t]=n}function E7(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-hs(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function rb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-hs(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var dt=0;function QR(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var XR,sb,JR,ZR,ek,AS=!1,Rh=[],Ao=null,Co=null,xo=null,Rd=new Map,kd=new Map,so=[],A7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function xA(e,t){switch(e){case"focusin":case"focusout":Ao=null;break;case"dragenter":case"dragleave":Co=null;break;case"mouseover":case"mouseout":xo=null;break;case"pointerover":case"pointerout":Rd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kd.delete(t.pointerId)}}function xu(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Uf(t),t!==null&&sb(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}
vendor: 12,981 bytes, line 41
41function C7(e,t,n,r,s){switch(t){case"focusin":return Ao=xu(Ao,e,t,n,r,s),!0;case"dragenter":return Co=xu(Co,e,t,n,r,s),!0;case"mouseover":return xo=xu(xo,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Rd.set(i,xu(Rd.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,kd.set(i,xu(kd.get(i)||null,e,t,n,r,s)),!0}return!1}function tk(e){var t=va(e.target);if(t!==null){var n=rl(t);if(n!==null){if(t=n.tag,t===13){if(t=zR(n),t!==null){e.blockedOn=t,ek(e.priority,function(){JR(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=CS(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);SS=r,n.target.dispatchEvent(r),SS=null}else return t=Uf(n),t!==null&&sb(t),e.blockedOn=n,!1;t.shift()}return!0}function TA(e,t,n){Sp(e)&&n.delete(t)}function x7(){AS=!1,Ao!==null&&Sp(Ao)&&(Ao=null),Co!==null&&Sp(Co)&&(Co=null),xo!==null&&Sp(xo)&&(xo=null),Rd.forEach(TA),kd.forEach(TA)}function Tu(e,t){e.blockedOn===t&&(e.blockedOn=null,AS||(AS=!0,Er.unstable_scheduleCallback(Er.unstable_NormalPriority,x7)))}function Od(e){function t(s){return Tu(s,e)}if(0<Rh.length){Tu(Rh[0],e);for(var n=1;n<Rh.length;n++){var r=Rh[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ao!==null&&Tu(Ao,e),Co!==null&&Tu(Co,e),xo!==null&&Tu(xo,e),Rd.forEach(t),kd.forEach(t),n=0;n<so.length;n++)r=so[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<so.length&&(n=so[0],n.blockedOn===null);)tk(n),n.blockedOn===null&&so.shift()}var Wl=Vi.ReactCurrentBatchConfig,fg=!0;function T7(e,t,n,r){var s=dt,i=Wl.transition;Wl.transition=null;try{dt=1,ib(e,t,n,r)}finally{dt=s,Wl.transition=i}}function P7(e,t,n,r){var s=dt,i=Wl.transition;Wl.transition=null;try{dt=4,ib(e,t,n,r)}finally{dt=s,Wl.transition=i}}function ib(e,t,n,r){if(fg){var s=CS(e,t,n,r);if(s===null)B0(e,t,r,hg,n),xA(e,r);else if(C7(s,e,t,n,r))r.stopPropagation();else if(xA(e,r),t&4&&-1<A7.indexOf(e)){for(;s!==null;){var i=Uf(s);if(i!==null&&XR(i),i=CS(e,t,n,r),i===null&&B0(e,t,r,hg,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else B0(e,t,r,null,n)}}var hg=null;function CS(e,t,n,r){if(hg=null,e=tb(r),e=va(e),e!==null)if(t=rl(e),t===null)e=null;else if(n=t.tag,n===13){if(e=zR(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return hg=e,null}function nk(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(g7()){case nb:return 1;case KR:return 4;case ug:case m7:return 16;case qR:return 536870912;default:return 16}default:return 16}}var yo=null,ob=null,bp=null;function rk(){if(bp)return bp;var e,t=ob,n=t.length,r,s="value"in yo?yo.value:yo.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return bp=s.slice(e,1<r?1-r:void 0)}function _p(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kh(){return!0}function PA(){return!1}function Cr(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?kh:PA,this.isPropagationStopped=PA,this}return jt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=kh)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=kh)},persist:function(){},isPersistent:kh}),t}var Kc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ab=Cr(Kc),Mf=jt({},Kc,{view:0,detail:0}),R7=Cr(Mf),N0,L0,Pu,_m=jt({},Mf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lb,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Pu&&(Pu&&e.type==="mousemove"?(N0=e.screenX-Pu.screenX,L0=e.screenY-Pu.screenY):L0=N0=0,Pu=e),N0)},movementY:function(e){return"movementY"in e?e.movementY:L0}}),RA=Cr(_m),k7=jt({},_m,{dataTransfer:0}),O7=Cr(k7),I7=jt({},Mf,{relatedTarget:0}),D0=Cr(I7),N7=jt({},Kc,{animationName:0,elapsedTime:0,pseudoElement:0}),L7=Cr(N7),D7=jt({},Kc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),M7=Cr(D7),U7=jt({},Kc,{data:0}),kA=Cr(U7),F7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$7={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},j7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function V7(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=j7[e])?!!t[e]:!1}function lb(){return V7}var B7=jt({},Mf,{key:function(e){if(e.key){var t=F7[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_p(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$7[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lb,charCode:function(e){return e.type==="keypress"?_p(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_p(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z7=Cr(B7),G7=jt({},_m,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),OA=Cr(G7),H7=jt({},Mf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lb}),W7=Cr(H7),K7=jt({},Kc,{propertyName:0,elapsedTime:0,pseudoElement:0}),q7=Cr(K7),Y7=jt({},_m,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Q7=Cr(Y7),X7=[9,13,27,32],cb=Ni&&"CompositionEvent"in window,cd=null;Ni&&"documentMode"in document&&(cd=document.documentMode);var J7=Ni&&"TextEvent"in window&&!cd,sk=Ni&&(!cb||cd&&8<cd&&11>=cd),IA=" ",NA=!1;function ik(e,t){switch(e){case"keyup":return X7.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ok(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kl=!1;function Z7(e,t){switch(e){case"compositionend":return ok(t);case"keypress":return t.which!==32?null:(NA=!0,IA);case"textInput":return e=t.data,e===IA&&NA?null:e;default:return null}}function eF(e,t){if(kl)return e==="compositionend"||!cb&&ik(e,t)?(e=rk(),bp=ob=yo=null,kl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sk&&t.locale!=="ko"?null:t.data;default:return null}}var tF={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function LA(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tF[e.type]:t==="textarea"}function ak(e,t,n,r){FR(r),t=pg(t,"onChange"),0<t.length&&(n=new ab("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ud=null,Id=null;function nF(e){yk(e,0)}function wm(e){var t=Nl(e);if(OR(t))return e}function rF(e,t){if(e==="change")return t}var lk=!1;if(Ni){var M0;if(Ni){var U0="oninput"in document;if(!U0){var DA=document.createElement("div");DA.setAttribute("oninput","return;"),U0=typeof DA.oninput=="function"}M0=U0}else M0=!1;lk=M0&&(!document.documentMode||9<document.documentMode)}function MA(){ud&&(ud.detachEvent("onpropertychange",ck),Id=ud=null)}function ck(e){if(e.propertyName==="value"&&wm(Id)){var t=[];ak(t,Id,e,tb(e)),BR(nF,t)}}function sF(e,t,n){e==="focusin"?(MA(),ud=t,Id=n,ud.attachEvent("onpropertychange",ck)):e==="focusout"&&MA()}function iF(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wm(Id)}function oF(e,t){if(e==="click")return wm(t)}function aF(e,t){if(e==="input"||e==="change")return wm(t)}function lF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ms=typeof Object.is=="function"?Object.is:lF;function Nd(e,t){if(ms(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!aS.call(t,s)||!ms(e[s],t[s]))return!1}return!0}function UA(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function FA(e,t){var n=UA(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=UA(n)}}function uk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function dk(){for(var e=window,t=ag();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ag(e.document)}return t}function ub(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cF(e){var t=dk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&uk(n.ownerDocument.documentElement,n)){if(r!==null&&ub(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=FA(n,i);var o=FA(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uF=Ni&&"documentMode"in document&&11>=document.documentMode,Ol=null,xS=null,dd=null,TS=!1;function $A(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;TS||Ol==null||Ol!==ag(r)||(r=Ol,"selectionStart"in r&&ub(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,352 bytes, line 41
41sNode:r.focusNode,focusOffset:r.focusOffset}),dd&&Nd(dd,r)||(dd=r,r=pg(xS,"onSelect"),0<r.length&&(t=new ab("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ol)))}function Oh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Il={animationend:Oh("Animation","AnimationEnd"),animationiteration:Oh("Animation","AnimationIteration"),animationstart:Oh("Animation","AnimationStart"),transitionend:Oh("Transition","TransitionEnd")},F0={},fk={};Ni&&(fk=document.createElement("div").style,"AnimationEvent"in window||(delete Il.animationend.animation,delete Il.animationiteration.animation,delete Il.animationstart.animation),"TransitionEvent"in window||delete Il.transitionend.transition);function Em(e){if(F0[e])return F0[e];if(!Il[e])return e;var t=Il[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fk)return F0[e]=t[n];return e}var hk=Em("animationend"),pk=Em("animationiteration"),gk=Em("animationstart"),mk=Em("transitionend"),vk=new Map,jA="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ho(e,t){vk.set(e,t),nl(t,[e])}for(var $0=0;$0<jA.length;$0++){var j0=jA[$0],dF=j0.toLowerCase(),fF=j0[0].toUpperCase()+j0.slice(1);Ho(dF,"on"+fF)}Ho(hk,"onAnimationEnd");Ho(pk,"onAnimationIteration");Ho(gk,"onAnimationStart");Ho("dblclick","onDoubleClick");Ho("focusin","onFocus");Ho("focusout","onBlur");Ho(mk,"onTransitionEnd");Ac("onMouseEnter",["mouseout","mouseover"]);Ac("onMouseLeave",["mouseout","mouseover"]);Ac("onPointerEnter",["pointerout","pointerover"]);Ac("onPointerLeave",["pointerout","pointerover"]);nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nl("onBeforeInput",["compositionend","keypress","textInput","paste"]);nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hF=new Set("cancel close invalid load scroll toggle".split(" ").concat(Qu));function VA(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,d7(r,t,void 0,e),e.currentTarget=null}function yk(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;VA(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;VA(s,a,c),i=l}}}if(cg)throw e=wS,cg=!1,wS=null,e}function Et(e,t){var n=t[IS];n===void 0&&(n=t[IS]=new Set);var r=e+"__bubble";n.has(r)||(Sk(t,e,2,!1),n.add(r))}function V0(e,t,n){var r=0;t&&(r|=4),Sk(n,e,r,t)}var Ih="_reactListening"+Math.random().toString(36).slice(2);function Ld(e){if(!e[Ih]){e[Ih]=!0,xR.forEach(function(n){n!=="selectionchange"&&(hF.has(n)||V0(n,!1,e),V0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ih]||(t[Ih]=!0,V0("selectionchange",!1,t))}}function Sk(e,t,n,r){switch(nk(t)){case 1:var s=T7;break;case 4:s=P7;break;default:s=ib}n=s.bind(null,t,n,e),s=void 0,!_S||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 4,100 bytes, line 41
41function B0(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=va(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}BR(function(){var c=i,u=tb(n),d=[];e:{var f=vk.get(e);if(f!==void 0){var g=ab,h=e;switch(e){case"keypress":if(_p(n)===0)break e;case"keydown":case"keyup":g=z7;break;case"focusin":h="focus",g=D0;break;case"focusout":h="blur",g=D0;break;case"beforeblur":case"afterblur":g=D0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=RA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=O7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=W7;break;case hk:case pk:case gk:g=L7;break;case mk:g=q7;break;case"scroll":g=R7;break;case"wheel":g=Q7;break;case"copy":case"cut":case"paste":g=M7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=OA}var p=(t&4)!==0,v=!p&&e==="scroll",m=p?f!==null?f+"Capture":null:f;p=[];for(var S=c,b;S!==null;){b=S;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,m!==null&&(w=Pd(S,m),w!=null&&p.push(Dd(S,w,b)))),v)break;S=S.return}0<p.length&&(f=new g(f,h,null,n,u),d.push({event:f,listeners:p}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==SS&&(h=n.relatedTarget||n.fromElement)&&(va(h)||h[Li]))break e;if((g||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,g?(h=n.relatedTarget||n.toElement,g=c,h=h?va(h):null,h!==null&&(v=rl(h),h!==v||h.tag!==5&&h.tag!==6)&&(h=null)):(g=null,h=c),g!==h)){if(p=RA,w="onMouseLeave",m="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(p=OA,w="onPointerLeave",m="onPointerEnter",S="pointer"),v=g==null?f:Nl(g),b=h==null?f:Nl(h),f=new p(w,S+"leave",g,n,u),f.target=v,f.relatedTarget=b,w=null,va(u)===c&&(p=new p(m,S+"enter",h,n,u),p.target=b,p.relatedTarget=v,w=p),v=w,g&&h)t:{for(p=g,m=h,S=0,b=p;b;b=ml(b))S++;for(b=0,w=m;w;w=ml(w))b++;for(;0<S-b;)p=ml(p),S--;for(;0<b-S;)m=ml(m),b--;for(;S--;){if(p===m||m!==null&&p===m.alternate)break t;p=ml(p),m=ml(m)}p=null}else p=null;g!==null&&BA(d,f,g,p,!1),h!==null&&v!==null&&BA(d,v,h,p,!0)}}e:{if(f=c?Nl(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var A=rF;else if(LA(f))if(lk)A=aF;else{A=iF;var C=sF}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(A=oF);if(A&&(A=A(e,c))){ak(d,A,n,u);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&pS(f,"number",f.value)}switch(C=c?Nl(c):window,e){case"focusin":(LA(C)||C.contentEditable==="true")&&(Ol=C,xS=c,dd=null);break;case"focusout":dd=xS=Ol=null;break;case"mousedown":TS=!0;break;case"contextmenu":case"mouseup":case"dragend":TS=!1,$A(d,n,u);break;case"selectionchange":if(uF)break;case"keydown":case"keyup":$A(d,n,u)}var E;if(cb)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else kl?ik(e,n)&&(x="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(x="onCompositionStart");x&&(sk&&n.locale!=="ko"&&(kl||x!=="onCompositionStart"?x==="onCompositionEnd"&&kl&&(E=rk()):(yo=u,ob="value"in yo?yo.value:yo.textContent,kl=!0)),C=pg(c,x),0<C.length&&(x=new kA(x,e,null,n,u),d.push({event:x,listeners:C}),E?x.data=E:(E=ok(n),E!==null&&(x.data=E)))),(E=J7?Z7(e,n):eF(e,n))&&(c=pg(c,"onBeforeInput"),0<c.length&&(u=new kA("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=E))}yk(d,t)})}
vendor: 2,421 bytes, lines 41-42
41function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pg(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Pd(e,n),i!=null&&r.unshift(Dd(e,i,s)),i=Pd(e,t),i!=null&&r.push(Dd(e,i,s))),e=e.return}return r}function ml(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function BA(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Pd(n,i),l!=null&&o.unshift(Dd(n,l,a))):s||(l=Pd(n,i),l!=null&&o.push(Dd(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var pF=/\r\n?/g,gF=/\u0000|\uFFFD/g;function zA(e){return(typeof e=="string"?e:""+e).replace(pF,` 42`).replace(gF,"")}function Nh(e,t,n){if(t=zA(t),zA(e)!==t&&n)throw Error(ce(425))}function gg(){}var PS=null,RS=null;function kS(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var OS=typeof setTimeout=="function"?setTimeout:void 0,mF=typeof clearTimeout=="function"?clearTimeout:void 0,GA=typeof Promise=="function"?Promise:void 0,vF=typeof queueMicrotask=="function"?queueMicrotask:typeof GA<"u"?function(e){return GA.resolve(null).then(e).catch(yF)}:OS;function yF(e){setTimeout(function(){throw e})}function z0(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Od(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Od(t)}function To(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function HA(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var qc=Math.random().toString(36).slice(2),Fs="__reactFiber$"+qc,Md="__reactProps$"+qc,Li="__reactContainer$"+qc,IS="__reactEvents$"+qc,SF="__reactListeners$"+qc,bF="__reactHandles$"+qc;function va(e){var t=e[Fs];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Li]||n[Fs]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=HA(e);e!==null;){if(n=e[Fs])return n;e=HA(e)}return t}e=n,n=e.parentNode}return null}
vendor: 5,335 bytes, line 42
42function Uf(e){return e=e[Fs]||e[Li],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ce(33))}function Am(e){return e[Md]||null}var NS=[],Ll=-1;function Wo(e){return{current:e}}function kt(e){0>Ll||(e.current=NS[Ll],NS[Ll]=null,Ll--)}function St(e,t){Ll++,NS[Ll]=e.current,e.current=t}var Do={},Mn=Wo(Do),ir=Wo(!1),ja=Do;function Cc(e,t){var n=e.type.contextTypes;if(!n)return Do;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function or(e){return e=e.childContextTypes,e!=null}function mg(){kt(ir),kt(Mn)}function WA(e,t,n){if(Mn.current!==Do)throw Error(ce(168));St(Mn,t),St(ir,n)}function bk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ce(108,s7(e)||"Unknown",s));return jt({},n,r)}function vg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Do,ja=Mn.current,St(Mn,e),St(ir,ir.current),!0}function KA(e,t,n){var r=e.stateNode;if(!r)throw Error(ce(169));n?(e=bk(e,t,ja),r.__reactInternalMemoizedMergedChildContext=e,kt(ir),kt(Mn),St(Mn,e)):kt(ir),St(ir,n)}var gi=null,Cm=!1,G0=!1;function _k(e){gi===null?gi=[e]:gi.push(e)}function _F(e){Cm=!0,_k(e)}function Ko(){if(!G0&&gi!==null){G0=!0;var e=0,t=dt;try{var n=gi;for(dt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gi=null,Cm=!1}catch(s){throw gi!==null&&(gi=gi.slice(e+1)),WR(nb,Ko),s}finally{dt=t,G0=!1}}return null}var Dl=[],Ml=0,yg=null,Sg=0,Ur=[],Fr=0,Va=null,Ei=1,Ai="";function fa(e,t){Dl[Ml++]=Sg,Dl[Ml++]=yg,yg=e,Sg=t}function wk(e,t,n){Ur[Fr++]=Ei,Ur[Fr++]=Ai,Ur[Fr++]=Va,Va=e;var r=Ei;e=Ai;var s=32-hs(r)-1;r&=~(1<<s),n+=1;var i=32-hs(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Ei=1<<32-hs(t)+s|n<<s|r,Ai=i+e}else Ei=1<<i|n<<s|r,Ai=e}function db(e){e.return!==null&&(fa(e,1),wk(e,1,0))}function fb(e){for(;e===yg;)yg=Dl[--Ml],Dl[Ml]=null,Sg=Dl[--Ml],Dl[Ml]=null;for(;e===Va;)Va=Ur[--Fr],Ur[Fr]=null,Ai=Ur[--Fr],Ur[Fr]=null,Ei=Ur[--Fr],Ur[Fr]=null}var wr=null,yr=null,Lt=!1,us=null;function Ek(e,t){var n=Br(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function qA(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,wr=e,yr=To(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,wr=e,yr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Va!==null?{id:Ei,overflow:Ai}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Br(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wr=e,yr=null,!0):!1;default:return!1}}function LS(e){return(e.mode&1)!==0&&(e.flags&128)===0}function DS(e){if(Lt){var t=yr;if(t){var n=t;if(!qA(e,t)){if(LS(e))throw Error(ce(418));t=To(n.nextSibling);var r=wr;t&&qA(e,t)?Ek(r,n):(e.flags=e.flags&-4097|2,Lt=!1,wr=e)}}else{if(LS(e))throw Error(ce(418));e.flags=e.flags&-4097|2,Lt=!1,wr=e}}}function YA(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wr=e}function Lh(e){if(e!==wr)return!1;if(!Lt)return YA(e),Lt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!kS(e.type,e.memoizedProps)),t&&(t=yr)){if(LS(e))throw Ak(),Error(ce(418));for(;t;)Ek(e,t),t=To(t.nextSibling)}if(YA(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){yr=To(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}yr=null}}else yr=wr?To(e.stateNode.nextSibling):null;return!0}function Ak(){for(var e=yr;e;)e=To(e.nextSibling)}function xc(){yr=wr=null,Lt=!1}function hb(e){us===null?us=[e]:us.push(e)}var wF=Vi.ReactCurrentBatchConfig;function Ru(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ce(309));var r=n.stateNode}if(!r)throw Error(ce(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(ce(284));if(!n._owner)throw Error(ce(290,e))}return e}function Dh(e,t){throw e=Object.prototype.toString.call(t),Error(ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function QA(e){var t=e._init;return t(e._payload)}function Ck(e){function t(m,S){if(e){var b=m.deletions;b===null?(m.deletions=[S],m.flags|=16):b.push(S)}}function n(m,S){if(!e)return null;for(;S!==null;)t(m,S),S=S.sibling;return null}function r(m,S){for(m=new Map;S!==null;)S.key!==null?m.set(S.key,S):m.set(S.index,S),S=S.sibling;return m}function s(m,S){return m=Oo(m,S),m.index=0,m.sibling=null,m}function i(m,S,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<S?(m.flags|=2,S):b):(m.flags|=2,S)):(m.flags|=1048576,S)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}
vendor: 4,232 bytes, line 42
42function a(m,S,b,w){return S===null||S.tag!==6?(S=X0(b,m.mode,w),S.return=m,S):(S=s(S,b),S.return=m,S)}function l(m,S,b,w){var A=b.type;return A===Rl?u(m,S,b.props.children,w,b.key):S!==null&&(S.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===to&&QA(A)===S.type)?(w=s(S,b.props),w.ref=Ru(m,S,b),w.return=m,w):(w=Pp(b.type,b.key,b.props,null,m.mode,w),w.ref=Ru(m,S,b),w.return=m,w)}function c(m,S,b,w){return S===null||S.tag!==4||S.stateNode.containerInfo!==b.containerInfo||S.stateNode.implementation!==b.implementation?(S=J0(b,m.mode,w),S.return=m,S):(S=s(S,b.children||[]),S.return=m,S)}function u(m,S,b,w,A){return S===null||S.tag!==7?(S=La(b,m.mode,w,A),S.return=m,S):(S=s(S,b),S.return=m,S)}function d(m,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return S=X0(""+S,m.mode,b),S.return=m,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ah:return b=Pp(S.type,S.key,S.props,null,m.mode,b),b.ref=Ru(m,null,S),b.return=m,b;case Pl:return S=J0(S,m.mode,b),S.return=m,S;case to:var w=S._init;return d(m,w(S._payload),b)}if(qu(S)||Au(S))return S=La(S,m.mode,b,null),S.return=m,S;Dh(m,S)}return null}function f(m,S,b,w){var A=S!==null?S.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return A!==null?null:a(m,S,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ah:return b.key===A?l(m,S,b,w):null;case Pl:return b.key===A?c(m,S,b,w):null;case to:return A=b._init,f(m,S,A(b._payload),w)}if(qu(b)||Au(b))return A!==null?null:u(m,S,b,w,null);Dh(m,b)}return null}function g(m,S,b,w,A){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(b)||null,a(S,m,""+w,A);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ah:return m=m.get(w.key===null?b:w.key)||null,l(S,m,w,A);case Pl:return m=m.get(w.key===null?b:w.key)||null,c(S,m,w,A);case to:var C=w._init;return g(m,S,b,C(w._payload),A)}if(qu(w)||Au(w))return m=m.get(b)||null,u(S,m,w,A,null);Dh(S,w)}return null}function h(m,S,b,w){for(var A=null,C=null,E=S,x=S=0,R=null;E!==null&&x<b.length;x++){E.index>x?(R=E,E=null):R=E.sibling;var T=f(m,E,b[x],w);if(T===null){E===null&&(E=R);break}e&&E&&T.alternate===null&&t(m,E),S=i(T,S,x),C===null?A=T:C.sibling=T,C=T,E=R}if(x===b.length)return n(m,E),Lt&&fa(m,x),A;if(E===null){for(;x<b.length;x++)E=d(m,b[x],w),E!==null&&(S=i(E,S,x),C===null?A=E:C.sibling=E,C=E);return Lt&&fa(m,x),A}for(E=r(m,E);x<b.length;x++)R=g(E,m,x,b[x],w),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?x:R.key),S=i(R,S,x),C===null?A=R:C.sibling=R,C=R);return e&&E.forEach(function(P){return t(m,P)}),Lt&&fa(m,x),A}function p(m,S,b,w){var A=Au(b);if(typeof A!="function")throw Error(ce(150));if(b=A.call(b),b==null)throw Error(ce(151));for(var C=A=null,E=S,x=S=0,R=null,T=b.next();E!==null&&!T.done;x++,T=b.next()){E.index>x?(R=E,E=null):R=E.sibling;var P=f(m,E,T.value,w);if(P===null){E===null&&(E=R);break}e&&E&&P.alternate===null&&t(m,E),S=i(P,S,x),C===null?A=P:C.sibling=P,C=P,E=R}if(T.done)return n(m,E),Lt&&fa(m,x),A;if(E===null){for(;!T.done;x++,T=b.next())T=d(m,T.value,w),T!==null&&(S=i(T,S,x),C===null?A=T:C.sibling=T,C=T);return Lt&&fa(m,x),A}for(E=r(m,E);!T.done;x++,T=b.next())T=g(E,m,x,T.value,w),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?x:T.key),S=i(T,S,x),C===null?A=T:C.sibling=T,C=T);return e&&E.forEach(function(I){return t(m,I)}),Lt&&fa(m,x),A}function v(m,S,b,w){if(typeof b=="object"&&b!==null&&b.type===Rl&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Ah:e:{for(var A=b.key,C=S;C!==null;){if(C.key===A){if(A=b.type,A===Rl){if(C.tag===7){n(m,C.sibling),S=s(C,b.props.children),S.return=m,m=S;break e}}else if(C.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===to&&QA(A)===C.type){n(m,C.sibling),S=s(C,b.props),S.ref=Ru(m,C,b),S.return=m,m=S;break e}n(m,C);break}else t(m,C);C=C.sibling}b.type===Rl?(S=La(b.props.children,m.mode,w,b.key),S.return=m,m=S):(w=Pp(b.type,b.key,b.props,null,m.mode,w),w.ref=Ru(m,S,b),w.return=m,m=w)}return o(m);case Pl:e:{for(C=b.key;S!==null;){if(S.key===C)if(S.tag===4&&S.stateNode.containerInfo===b.containerInfo&&S.stateNode.implementation===b.implementation){n(m,S.sibling),S=s(S,b.children||[]),S.return=m,m=S;break e}else{n(m,S);break}else t(m,S);S=S.sibling}
vendor: 19,825 bytes, lines 42-44
42S=J0(b,m.mode,w),S.return=m,m=S}return o(m);case to:return C=b._init,v(m,S,C(b._payload),w)}if(qu(b))return h(m,S,b,w);if(Au(b))return p(m,S,b,w);Dh(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,S!==null&&S.tag===6?(n(m,S.sibling),S=s(S,b),S.return=m,m=S):(n(m,S),S=X0(b,m.mode,w),S.return=m,m=S),o(m)):n(m,S)}return v}var Tc=Ck(!0),xk=Ck(!1),bg=Wo(null),_g=null,Ul=null,pb=null;function gb(){pb=Ul=_g=null}function mb(e){var t=bg.current;kt(bg),e._currentValue=t}function MS(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Kl(e,t){_g=e,pb=Ul=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Wr(e){var t=e._currentValue;if(pb!==e)if(e={context:e,memoizedValue:t,next:null},Ul===null){if(_g===null)throw Error(ce(308));Ul=e,_g.dependencies={lanes:0,firstContext:e}}else Ul=Ul.next=e;return t}var ya=null;function vb(e){ya===null?ya=[e]:ya.push(e)}function Tk(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,vb(t)):(n.next=s.next,s.next=n),t.interleaved=n,Di(e,r)}function Di(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var no=!1;function yb(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,it&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Di(e,n)}return s=r.interleaved,s===null?(t.next=t,vb(r)):(t.next=s.next,s.next=t),r.interleaved=t,Di(e,n)}function wp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rb(e,n)}}function XA(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function wg(e,t,n,r){var s=e.updateQueue;no=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;o=0,u=c=l=null,a=i;do{var f=a.lane,g=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,p=a;switch(f=t,g=n,p.tag){case 1:if(h=p.payload,typeof h=="function"){d=h.call(g,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=p.payload,f=typeof h=="function"?h.call(g,d,f):h,f==null)break e;d=jt({},d,f);break e;case 2:no=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else g={eventTime:g,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);za|=o,e.lanes=o,e.memoizedState=d}}function JA(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ce(191,s));s.call(r)}}}var Ff={},Ws=Wo(Ff),Ud=Wo(Ff),Fd=Wo(Ff);function Sa(e){if(e===Ff)throw Error(ce(174));return e}function Sb(e,t){switch(St(Fd,t),St(Ud,e),St(Ws,Ff),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mS(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mS(t,e)}kt(Ws),St(Ws,t)}function Pc(){kt(Ws),kt(Ud),kt(Fd)}function Rk(e){Sa(Fd.current);var t=Sa(Ws.current),n=mS(t,e.type);t!==n&&(St(Ud,e),St(Ws,n))}function bb(e){Ud.current===e&&(kt(Ws),kt(Ud))}var Ut=Wo(0);function Eg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var H0=[];function _b(){for(var e=0;e<H0.length;e++)H0[e]._workInProgressVersionPrimary=null;H0.length=0}var Ep=Vi.ReactCurrentDispatcher,W0=Vi.ReactCurrentBatchConfig,Ba=0,$t=null,en=null,an=null,Ag=!1,fd=!1,$d=0,EF=0;function xn(){throw Error(ce(321))}function wb(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ms(e[n],t[n]))return!1;return!0}function Eb(e,t,n,r,s,i){if(Ba=i,$t=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ep.current=e===null||e.memoizedState===null?TF:PF,e=n(r,s),fd){i=0;do{if(fd=!1,$d=0,25<=i)throw Error(ce(301));i+=1,an=en=null,t.updateQueue=null,Ep.current=RF,e=n(r,s)}while(fd)}if(Ep.current=Cg,t=en!==null&&en.next!==null,Ba=0,an=en=$t=null,Ag=!1,t)throw Error(ce(300));return e}function Ab(){var e=$d!==0;return $d=0,e}function Ts(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?$t.memoizedState=an=e:an=an.next=e,an}function Kr(){if(en===null){var e=$t.alternate;e=e!==null?e.memoizedState:null}else e=en.next;var t=an===null?$t.memoizedState:an.next;if(t!==null)an=t,en=e;else{if(e===null)throw Error(ce(310));en=e,e={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},an===null?$t.memoizedState=an=e:an=an.next=e}return an}function jd(e,t){return typeof t=="function"?t(e):t}function K0(e){var t=Kr(),n=t.queue;if(n===null)throw Error(ce(311));n.lastRenderedReducer=e;var r=en,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var u=c.lane;if((Ba&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,$t.lanes|=u,za|=u}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,ms(r,t.memoizedState)||(sr=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,$t.lanes|=i,za|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function q0(e){var t=Kr(),n=t.queue;if(n===null)throw Error(ce(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);ms(i,t.memoizedState)||(sr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function kk(){}function Ok(e,t){var n=$t,r=Kr(),s=t(),i=!ms(r.memoizedState,s);if(i&&(r.memoizedState=s,sr=!0),r=r.queue,Cb(Lk.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||an!==null&&an.memoizedState.tag&1){if(n.flags|=2048,Vd(9,Nk.bind(null,n,r,s,t),void 0,null),cn===null)throw Error(ce(349));Ba&30||Ik(n,t,s)}return s}function Ik(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$t.updateQueue,t===null?(t={lastEffect:null,stores:null},$t.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nk(e,t,n,r){t.value=n,t.getSnapshot=r,Dk(t)&&Mk(e)}function Lk(e,t,n){return n(function(){Dk(t)&&Mk(e)})}function Dk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ms(e,n)}catch{return!0}}function Mk(e){var t=Di(e,1);t!==null&&ps(t,e,1,-1)}function ZA(e){var t=Ts();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jd,lastRenderedState:e},t.queue=e,e=e.dispatch=xF.bind(null,$t,e),[t.memoizedState,e]}function Vd(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=$t.updateQueue,t===null?(t={lastEffect:null,stores:null},$t.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Uk(){return Kr().memoizedState}function Ap(e,t,n,r){var s=Ts();$t.flags|=e,s.memoizedState=Vd(1|t,n,void 0,r===void 0?null:r)}function xm(e,t,n,r){var s=Kr();r=r===void 0?null:r;var i=void 0;if(en!==null){var o=en.memoizedState;if(i=o.destroy,r!==null&&wb(r,o.deps)){s.memoizedState=Vd(t,n,i,r);return}}$t.flags|=e,s.memoizedState=Vd(1|t,n,i,r)}function eC(e,t){return Ap(8390656,8,e,t)}function Cb(e,t){return xm(2048,8,e,t)}function Fk(e,t){return xm(4,2,e,t)}function $k(e,t){return xm(4,4,e,t)}function jk(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vk(e,t,n){return n=n!=null?n.concat([e]):null,xm(4,4,jk.bind(null,t,e),n)}function xb(){}function Bk(e,t){var n=Kr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wb(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function zk(e,t){var n=Kr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wb(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Gk(e,t,n){return Ba&21?(ms(n,t)||(n=YR(),$t.lanes|=n,za|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=n)}function AF(e,t){var n=dt;dt=n!==0&&4>n?n:4,e(!0);var r=W0.transition;W0.transition={};try{e(!1),t()}finally{dt=n,W0.transition=r}}function Hk(){return Kr().memoizedState}function CF(e,t,n){var r=ko(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wk(e))Kk(t,n);else if(n=Tk(e,t,n,r),n!==null){var s=qn();ps(n,e,r,s),qk(n,t,r)}}function xF(e,t,n){var r=ko(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wk(e))Kk(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,ms(a,o)){var l=t.interleaved;l===null?(s.next=s,vb(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Tk(e,t,s,r),n!==null&&(s=qn(),ps(n,e,r,s),qk(n,t,r))}}function Wk(e){var t=e.alternate;return e===$t||t!==null&&t===$t}function Kk(e,t){fd=Ag=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qk(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rb(e,n)}}var Cg={readContext:Wr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},TF={readContext:Wr,useCallback:function(e,t){return Ts().memoizedState=[e,t===void 0?null:t],e},useContext:Wr,useEffect:eC,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ap(4194308,4,jk.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ap(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ap(4,2,e,t)},useMemo:function(e,t){var n=Ts();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ts();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=CF.bind(null,$t,e),[r.memoizedState,e]},useRef:function(e){var t=Ts();return e={current:e},t.memoizedState=e},useState:ZA,useDebugValue:xb,useDeferredValue:function(e){return Ts().memoizedState=e},useTransition:function(){var e=ZA(!1),t=e[0];return e=AF.bind(null,e[1]),Ts().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$t,s=Ts();if(Lt){if(n===void 0)throw Error(ce(407));n=n()}else{if(n=t(),cn===null)throw Error(ce(349));Ba&30||Ik(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,eC(Lk.bind(null,r,i,e),[e]),r.flags|=2048,Vd(9,Nk.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ts(),t=cn.identifierPrefix;if(Lt){var n=Ai,r=Ei;n=(r&~(1<<32-hs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=$d++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=EF++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},PF={readContext:Wr,useCallback:Bk,useContext:Wr,useEffect:Cb,useImperativeHandle:Vk,useInsertionEffect:Fk,useLayoutEffect:$k,useMemo:zk,useReducer:K0,useRef:Uk,useState:function(){return K0(jd)},useDebugValue:xb,useDeferredValue:function(e){var t=Kr();return Gk(t,en.memoizedState,e)},useTransition:function(){var e=K0(jd)[0],t=Kr().memoizedState;return[e,t]},useMutableSource:kk,useSyncExternalStore:Ok,useId:Hk,unstable_isNewReconciler:!1},RF={readContext:Wr,useCallback:Bk,useContext:Wr,useEffect:Cb,useImperativeHandle:Vk,useInsertionEffect:Fk,useLayoutEffect:$k,useMemo:zk,useReducer:q0,useRef:Uk,useState:function(){return q0(jd)},useDebugValue:xb,useDeferredValue:function(e){var t=Kr();return en===null?t.memoizedState=e:Gk(t,en.memoizedState,e)},useTransition:function(){var e=q0(jd)[0],t=Kr().memoizedState;return[e,t]},useMutableSource:kk,useSyncExternalStore:Ok,useId:Hk,unstable_isNewReconciler:!1};function is(e,t){if(e&&e.defaultProps){t=jt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function US(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:jt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tm={isMounted:function(e){return(e=e._reactInternals)?rl(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qn(),s=ko(e),i=Pi(r,s);i.payload=t,n!=null&&(i.callback=n),t=Po(e,i,s),t!==null&&(ps(t,e,s,r),wp(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qn(),s=ko(e),i=Pi(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Po(e,i,s),t!==null&&(ps(t,e,s,r),wp(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qn(),r=ko(e),s=Pi(n,r);s.tag=2,t!=null&&(s.callback=t),t=Po(e,s,r),t!==null&&(ps(t,e,r,n),wp(t,e,r))}};function tC(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Nd(n,r)||!Nd(s,i):!0}function Yk(e,t,n){var r=!1,s=Do,i=t.contextType;return typeof i=="object"&&i!==null?i=Wr(i):(s=or(t)?ja:Mn.current,r=t.contextTypes,i=(r=r!=null)?Cc(e,s):Do),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function nC(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tm.enqueueReplaceState(t,t.state,null)}function FS(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},yb(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Wr(i):(i=or(t)?ja:Mn.current,s.context=Cc(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(US(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Tm.enqueueReplaceState(s,s.state,null),wg(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Rc(e,t){try{var n="",r=t;do n+=r7(r),r=r.return;while(r);var s=n}catch(i){s=` 43Error generating stack: `+i.message+` 44`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Y0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $S(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var kF=typeof WeakMap=="function"?WeakMap:Map;function Qk(e,t,n){n=Pi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Tg||(Tg=!0,YS=r),$S(e,t)},n}function Xk(e,t,n){n=Pi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){$S(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){$S(e,t),typeof r!="function"&&(Ro===null?Ro=new Set([this]):Ro.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function rC(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kF;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=GF.bind(null,e,t,n),t.then(e,e))}function sC(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function iC(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Pi(-1,1),t.tag=2,Po(n,t,1))),n.lanes|=1),e)}var OF=Vi.ReactCurrentOwner,sr=!1;function Bn(e,t,n,r){t.child=e===null?xk(t,null,n,r):Tc(t,e.child,n,r)}function oC(e,t,n,r,s){n=n.render;var i=t.ref;return Kl(t,s),r=Eb(e,t,n,r,i,s),n=Ab(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Mi(e,t,s)):(Lt&&n&&db(t),t.flags|=1,Bn(e,t,r,s),t.child)}function aC(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Lb(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Jk(e,t,i,r,s)):(e=Pp(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Nd,n(o,r)&&e.ref===t.ref)return Mi(e,t,s)}return t.flags|=1,e=Oo(i,r),e.ref=t.ref,e.return=t,t.child=e}function Jk(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Nd(i,r)&&e.ref===t.ref)if(sr=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,Mi(e,t,s)}return jS(e,t,n,r,s)}function Zk(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},St($l,pr),pr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,St($l,pr),pr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,St($l,pr),pr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,St($l,pr),pr|=r;return Bn(e,t,s,n),t.child}function eO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 6,729 bytes, line 44
44function jS(e,t,n,r,s){var i=or(n)?ja:Mn.current;return i=Cc(t,i),Kl(t,s),n=Eb(e,t,n,r,i,s),r=Ab(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Mi(e,t,s)):(Lt&&r&&db(t),t.flags|=1,Bn(e,t,n,s),t.child)}function lC(e,t,n,r,s){if(or(n)){var i=!0;vg(t)}else i=!1;if(Kl(t,s),t.stateNode===null)Cp(e,t),Yk(t,n,r),FS(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Wr(c):(c=or(n)?ja:Mn.current,c=Cc(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&nC(t,o,r,c),no=!1;var f=t.memoizedState;o.state=f,wg(t,r,o,s),l=t.memoizedState,a!==r||f!==l||ir.current||no?(typeof u=="function"&&(US(t,n,u,r),l=t.memoizedState),(a=no||tC(t,n,a,r,f,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Pk(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:is(t.type,a),o.props=c,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Wr(l):(l=or(n)?ja:Mn.current,l=Cc(t,l));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&nC(t,o,r,l),no=!1,f=t.memoizedState,o.state=f,wg(t,r,o,s);var h=t.memoizedState;a!==d||f!==h||ir.current||no?(typeof g=="function"&&(US(t,n,g,r),h=t.memoizedState),(c=no||tC(t,n,c,r,f,h,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return VS(e,t,n,r,i,s)}function VS(e,t,n,r,s,i){eO(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&KA(t,n,!1),Mi(e,t,i);r=t.stateNode,OF.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Tc(t,e.child,null,i),t.child=Tc(t,null,a,i)):Bn(e,t,a,i),t.memoizedState=r.state,s&&KA(t,n,!0),t.child}function tO(e){var t=e.stateNode;t.pendingContext?WA(e,t.pendingContext,t.pendingContext!==t.context):t.context&&WA(e,t.context,!1),Sb(e,t.containerInfo)}function cC(e,t,n,r,s){return xc(),hb(s),t.flags|=256,Bn(e,t,n,r),t.child}var BS={dehydrated:null,treeContext:null,retryLane:0};function zS(e){return{baseLanes:e,cachePool:null,transitions:null}}function nO(e,t,n){var r=t.pendingProps,s=Ut.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),St(Ut,s&1),e===null)return DS(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=km(o,r,0,null),e=La(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=zS(n),t.memoizedState=BS,e):Tb(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return IF(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Oo(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Oo(a,i):(i=La(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?zS(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=BS,r}return i=e.child,e=i.sibling,r=Oo(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Tb(e,t){return t=km({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mh(e,t,n,r){return r!==null&&hb(r),Tc(t,e.child,null,n),e=Tb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function IF(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Y0(Error(ce(422))),Mh(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=km({mode:"visible",children:r.children},s,0,null),i=La(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Tc(t,e.child,null,o),t.child.memoizedState=zS(o),t.memoizedState=BS,i);if(!(t.mode&1))return Mh(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(ce(419)),r=Y0(i,r,void 0),Mh(e,t,o,r)}if(a=(o&e.childLanes)!==0,sr||a){if(r=cn,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Di(e,s),ps(r,e,s,-1))}return Nb(),r=Y0(Error(ce(421))),Mh(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=HF.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,yr=To(s.nextSibling),wr=t,Lt=!0,us=null,e!==null&&(Ur[Fr++]=Ei,Ur[Fr++]=Ai,Ur[Fr++]=Va,Ei=e.id,Ai=e.overflow,Va=t),t=Tb(t,r.children),t.flags|=4096,t)}function uC(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),MS(e.return,t,n)}
vendor: 4,866 bytes, line 44
44function Q0(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function rO(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Bn(e,t,r.children,n),r=Ut.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uC(e,n,t);else if(e.tag===19)uC(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(St(Ut,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Eg(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Q0(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Eg(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Q0(t,!0,n,null,i);break;case"together":Q0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Mi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),za|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,n=Oo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function NF(e,t,n){switch(t.tag){case 3:tO(t),xc();break;case 5:Rk(t);break;case 1:or(t.type)&&vg(t);break;case 4:Sb(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;St(bg,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(St(Ut,Ut.current&1),t.flags|=128,null):n&t.child.childLanes?nO(e,t,n):(St(Ut,Ut.current&1),e=Mi(e,t,n),e!==null?e.sibling:null);St(Ut,Ut.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rO(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),St(Ut,Ut.current),r)break;return null;case 22:case 23:return t.lanes=0,Zk(e,t,n)}return Mi(e,t,n)}var sO,GS,iO,oO;sO=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};GS=function(){};iO=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Sa(Ws.current);var i=null;switch(n){case"input":s=fS(e,s),r=fS(e,r),i=[];break;case"select":s=jt({},s,{value:void 0}),r=jt({},r,{value:void 0}),i=[];break;case"textarea":s=gS(e,s),r=gS(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=gg)}vS(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(xd.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(xd.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Et("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};oO=function(e,t,n,r){n!==r&&(t.flags|=4)};function ku(e,t){if(!Lt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}
vendor: 30,322 bytes, line 44
44function LF(e,t,n){var r=t.pendingProps;switch(fb(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(t),null;case 1:return or(t.type)&&mg(),Tn(t),null;case 3:return r=t.stateNode,Pc(),kt(ir),kt(Mn),_b(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Lh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,us!==null&&(JS(us),us=null))),GS(e,t),Tn(t),null;case 5:bb(t);var s=Sa(Fd.current);if(n=t.type,e!==null&&t.stateNode!=null)iO(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ce(166));return Tn(t),null}if(e=Sa(Ws.current),Lh(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Fs]=t,r[Md]=i,e=(t.mode&1)!==0,n){case"dialog":Et("cancel",r),Et("close",r);break;case"iframe":case"object":case"embed":Et("load",r);break;case"video":case"audio":for(s=0;s<Qu.length;s++)Et(Qu[s],r);break;case"source":Et("error",r);break;case"img":case"image":case"link":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"input":SA(r,i),Et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Et("invalid",r);break;case"textarea":_A(r,i),Et("invalid",r)}vS(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Nh(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Nh(r.textContent,a,e),s=["children",""+a]):xd.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Et("scroll",r)}switch(n){case"input":Ch(r),bA(r,i,!0);break;case"textarea":Ch(r),wA(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=gg)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=LR(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Fs]=t,e[Md]=r,sO(e,t,!1,!1),t.stateNode=e;e:{switch(o=yS(n,r),n){case"dialog":Et("cancel",e),Et("close",e),s=r;break;case"iframe":case"object":case"embed":Et("load",e),s=r;break;case"video":case"audio":for(s=0;s<Qu.length;s++)Et(Qu[s],e);s=r;break;case"source":Et("error",e),s=r;break;case"img":case"image":case"link":Et("error",e),Et("load",e),s=r;break;case"details":Et("toggle",e),s=r;break;case"input":SA(e,r),s=fS(e,r),Et("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=jt({},r,{value:void 0}),Et("invalid",e);break;case"textarea":_A(e,r),s=gS(e,r),Et("invalid",e);break;default:s=r}vS(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?UR(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&DR(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Td(e,l):typeof l=="number"&&Td(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(xd.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Et("scroll",e):l!=null&&X1(e,i,l,o))}switch(n){case"input":Ch(e),bA(e,r,!1);break;case"textarea":Ch(e),wA(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Lo(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?zl(e,!!r.multiple,i,!1):r.defaultValue!=null&&zl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=gg)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tn(t),null;case 6:if(e&&t.stateNode!=null)oO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ce(166));if(n=Sa(Fd.current),Sa(Ws.current),Lh(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fs]=t,(i=r.nodeValue!==n)&&(e=wr,e!==null))switch(e.tag){case 3:Nh(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nh(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fs]=t,t.stateNode=r}return Tn(t),null;case 13:if(kt(Ut),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Lt&&yr!==null&&t.mode&1&&!(t.flags&128))Ak(),xc(),t.flags|=98560,i=!1;else if(i=Lh(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ce(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ce(317));i[Fs]=t}else xc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tn(t),i=!1}else us!==null&&(JS(us),us=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ut.current&1?nn===0&&(nn=3):Nb())),t.updateQueue!==null&&(t.flags|=4),Tn(t),null);case 4:return Pc(),GS(e,t),e===null&&Ld(t.stateNode.containerInfo),Tn(t),null;case 10:return mb(t.type._context),Tn(t),null;case 17:return or(t.type)&&mg(),Tn(t),null;case 19:if(kt(Ut),i=t.memoizedState,i===null)return Tn(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ku(i,!1);else{if(nn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Eg(e),o!==null){for(t.flags|=128,ku(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return St(Ut,Ut.current&1|2),t.child}e=e.sibling}i.tail!==null&&Wt()>kc&&(t.flags|=128,r=!0,ku(i,!1),t.lanes=4194304)}else{if(!r)if(e=Eg(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ku(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Lt)return Tn(t),null}else 2*Wt()-i.renderingStartTime>kc&&n!==1073741824&&(t.flags|=128,r=!0,ku(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Wt(),t.sibling=null,n=Ut.current,St(Ut,r?n&1|2:n&1),t):(Tn(t),null);case 22:case 23:return Ib(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pr&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function DF(e,t){switch(fb(t),t.tag){case 1:return or(t.type)&&mg(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pc(),kt(ir),kt(Mn),_b(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bb(t),null;case 13:if(kt(Ut),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));xc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(Ut),null;case 4:return Pc(),null;case 10:return mb(t.type._context),null;case 22:case 23:return Ib(),null;case 24:return null;default:return null}}var Uh=!1,Nn=!1,MF=typeof WeakSet=="function"?WeakSet:Set,Te=null;function Fl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function HS(e,t,n){try{n()}catch(r){zt(e,t,r)}}var dC=!1;function UF(e,t){if(PS=fg,e=dk(),ub(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var g;d!==n||s!==0&&d.nodeType!==3||(a=o+s),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++c===s&&(a=o),f===i&&++u===r&&(l=o),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(RS={focusedElem:e,selectionRange:n},fg=!1,Te=t;Te!==null;)if(t=Te,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Te=e;else for(;Te!==null;){t=Te;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var p=h.memoizedProps,v=h.memoizedState,m=t.stateNode,S=m.getSnapshotBeforeUpdate(t.elementType===t.type?p:is(t.type,p),v);m.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(w){zt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Te=e;break}Te=t.return}return h=dC,dC=!1,h}function hd(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&HS(t,n,i)}s=s.next}while(s!==r)}}function Pm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function WS(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function aO(e){var t=e.alternate;t!==null&&(e.alternate=null,aO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fs],delete t[Md],delete t[IS],delete t[SF],delete t[bF])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function lO(e){return e.tag===5||e.tag===3||e.tag===4}function fC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function KS(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gg));else if(r!==4&&(e=e.child,e!==null))for(KS(e,t,n),e=e.sibling;e!==null;)KS(e,t,n),e=e.sibling}function qS(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qS(e,t,n),e=e.sibling;e!==null;)qS(e,t,n),e=e.sibling}var bn=null,as=!1;function qi(e,t,n){for(n=n.child;n!==null;)cO(e,t,n),n=n.sibling}function cO(e,t,n){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(bm,n)}catch{}switch(n.tag){case 5:Nn||Fl(n,t);case 6:var r=bn,s=as;bn=null,qi(e,t,n),bn=r,as=s,bn!==null&&(as?(e=bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):bn.removeChild(n.stateNode));break;case 18:bn!==null&&(as?(e=bn,n=n.stateNode,e.nodeType===8?z0(e.parentNode,n):e.nodeType===1&&z0(e,n),Od(e)):z0(bn,n.stateNode));break;case 4:r=bn,s=as,bn=n.stateNode.containerInfo,as=!0,qi(e,t,n),bn=r,as=s;break;case 0:case 11:case 14:case 15:if(!Nn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&HS(n,t,o),s=s.next}while(s!==r)}qi(e,t,n);break;case 1:if(!Nn&&(Fl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){zt(n,t,a)}qi(e,t,n);break;case 21:qi(e,t,n);break;case 22:n.mode&1?(Nn=(r=Nn)||n.memoizedState!==null,qi(e,t,n),Nn=r):qi(e,t,n);break;default:qi(e,t,n)}}function hC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new MF),t.forEach(function(r){var s=WF.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Zr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:bn=a.stateNode,as=!1;break e;case 3:bn=a.stateNode.containerInfo,as=!0;break e;case 4:bn=a.stateNode.containerInfo,as=!0;break e}a=a.return}if(bn===null)throw Error(ce(160));cO(i,o,s),bn=null,as=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){zt(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)uO(t,e),t=t.sibling}function uO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zr(t,e),Cs(e),r&4){try{hd(3,e,e.return),Pm(3,e)}catch(p){zt(e,e.return,p)}try{hd(5,e,e.return)}catch(p){zt(e,e.return,p)}}break;case 1:Zr(t,e),Cs(e),r&512&&n!==null&&Fl(n,n.return);break;case 5:if(Zr(t,e),Cs(e),r&512&&n!==null&&Fl(n,n.return),e.flags&32){var s=e.stateNode;try{Td(s,"")}catch(p){zt(e,e.return,p)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&IR(s,i),yS(a,o);var c=yS(a,i);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?UR(s,d):u==="dangerouslySetInnerHTML"?DR(s,d):u==="children"?Td(s,d):X1(s,u,d,c)}switch(a){case"input":hS(s,i);break;case"textarea":NR(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?zl(s,!!i.multiple,g,!1):f!==!!i.multiple&&(i.defaultValue!=null?zl(s,!!i.multiple,i.defaultValue,!0):zl(s,!!i.multiple,i.multiple?[]:"",!1))}s[Md]=i}catch(p){zt(e,e.return,p)}}break;case 6:if(Zr(t,e),Cs(e),r&4){if(e.stateNode===null)throw Error(ce(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(p){zt(e,e.return,p)}}break;case 3:if(Zr(t,e),Cs(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Od(t.containerInfo)}catch(p){zt(e,e.return,p)}break;case 4:Zr(t,e),Cs(e);break;case 13:Zr(t,e),Cs(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(kb=Wt())),r&4&&hC(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Nn=(c=Nn)||u,Zr(t,e),Nn=c):Zr(t,e),Cs(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(Te=e,u=e.child;u!==null;){for(d=Te=u;Te!==null;){switch(f=Te,g=f.child,f.tag){case 0:case 11:case 14:case 15:hd(4,f,f.return);break;case 1:Fl(f,f.return);var h=f.stateNode;if(typeof h.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(p){zt(r,n,p)}}break;case 5:Fl(f,f.return);break;case 22:if(f.memoizedState!==null){gC(d);continue}}g!==null?(g.return=f,Te=g):gC(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=MR("display",o))}catch(p){zt(e,e.return,p)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(p){zt(e,e.return,p)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Zr(t,e),Cs(e),r&4&&hC(e);break;case 21:break;default:Zr(t,e),Cs(e)}}function Cs(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lO(n)){var r=n;break e}n=n.return}throw Error(ce(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Td(s,""),r.flags&=-33);var i=fC(e);qS(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=fC(e);KS(e,a,o);break;default:throw Error(ce(161))}}catch(l){zt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function FF(e,t,n){Te=e,dO(e)}function dO(e,t,n){for(var r=(e.mode&1)!==0;Te!==null;){var s=Te,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Uh;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Nn;a=Uh;var c=Nn;if(Uh=o,(Nn=l)&&!c)for(Te=s;Te!==null;)o=Te,l=o.child,o.tag===22&&o.memoizedState!==null?mC(s):l!==null?(l.return=o,Te=l):mC(s);for(;i!==null;)Te=i,dO(i),i=i.sibling;Te=s,Uh=a,Nn=c}pC(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Te=i):pC(e)}}function pC(e){for(;Te!==null;){var t=Te;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Nn||Pm(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Nn)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:is(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&JA(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}JA(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Od(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ce(163))}Nn||t.flags&512&&WS(t)}catch(f){zt(t,t.return,f)}}if(t===e){Te=null;break}if(n=t.sibling,n!==null){n.return=t.return,Te=n;break}Te=t.return}}function gC(e){for(;Te!==null;){var t=Te;if(t===e){Te=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Te=n;break}Te=t.return}}function mC(e){for(;Te!==null;){var t=Te;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Pm(4,t)}catch(l){zt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){zt(t,s,l)}}var i=t.return;try{WS(t)}catch(l){zt(t,i,l)}break;case 5:var o=t.return;try{WS(t)}catch(l){zt(t,o,l)}}}catch(l){zt(t,t.return,l)}if(t===e){Te=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Te=a;break}Te=t.return}}var $F=Math.ceil,xg=Vi.ReactCurrentDispatcher,Pb=Vi.ReactCurrentOwner,Hr=Vi.ReactCurrentBatchConfig,it=0,cn=null,Qt=null,An=0,pr=0,$l=Wo(0),nn=0,Bd=null,za=0,Rm=0,Rb=0,pd=null,tr=null,kb=0,kc=1/0,pi=null,Tg=!1,YS=null,Ro=null,Fh=!1,So=null,Pg=0,gd=0,QS=null,xp=-1,Tp=0;function qn(){return it&6?Wt():xp!==-1?xp:xp=Wt()}function ko(e){return e.mode&1?it&2&&An!==0?An&-An:wF.transition!==null?(Tp===0&&(Tp=YR()),Tp):(e=dt,e!==0||(e=window.event,e=e===void 0?16:nk(e.type)),e):1}function ps(e,t,n,r){if(50<gd)throw gd=0,QS=null,Error(ce(185));Df(e,n,r),(!(it&2)||e!==cn)&&(e===cn&&(!(it&2)&&(Rm|=n),nn===4&&io(e,An)),ar(e,r),n===1&&it===0&&!(t.mode&1)&&(kc=Wt()+500,Cm&&Ko()))}function ar(e,t){var n=e.callbackNode;w7(e,t);var r=dg(e,e===cn?An:0);if(r===0)n!==null&&CA(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&CA(n),t===1)e.tag===0?_F(vC.bind(null,e)):_k(vC.bind(null,e)),vF(function(){!(it&6)&&Ko()}),n=null;else{switch(QR(r)){case 1:n=nb;break;case 4:n=KR;break;case 16:n=ug;break;case 536870912:n=qR;break;default:n=ug}n=SO(n,fO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function fO(e,t){if(xp=-1,Tp=0,it&6)throw Error(ce(327));var n=e.callbackNode;if(ql()&&e.callbackNode!==n)return null;var r=dg(e,e===cn?An:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Rg(e,r);else{t=r;var s=it;it|=2;var i=pO();(cn!==e||An!==t)&&(pi=null,kc=Wt()+500,Na(e,t));do try{BF();break}catch(a){hO(e,a)}while(!0);gb(),xg.current=i,it=s,Qt!==null?t=0:(cn=null,An=0,t=nn)}if(t!==0){if(t===2&&(s=ES(e),s!==0&&(r=s,t=XS(e,s))),t===1)throw n=Bd,Na(e,0),io(e,r),ar(e,Wt()),n;if(t===6)io(e,r);else{if(s=e.current.alternate,!(r&30)&&!jF(s)&&(t=Rg(e,r),t===2&&(i=ES(e),i!==0&&(r=i,t=XS(e,i))),t===1))throw n=Bd,Na(e,0),io(e,r),ar(e,Wt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ce(345));case 2:ha(e,tr,pi);break;case 3:if(io(e,r),(r&130023424)===r&&(t=kb+500-Wt(),10<t)){if(dg(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){qn(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=OS(ha.bind(null,e,tr,pi),t);break}ha(e,tr,pi);break;case 4:if(io(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-hs(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Wt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$F(r/1960))-r,10<r){e.timeoutHandle=OS(ha.bind(null,e,tr,pi),r);break}ha(e,tr,pi);break;case 5:ha(e,tr,pi);break;default:throw Error(ce(329))}}}return ar(e,Wt()),e.callbackNode===n?fO.bind(null,e):null}function XS(e,t){var n=pd;return e.current.memoizedState.isDehydrated&&(Na(e,t).flags|=256),e=Rg(e,t),e!==2&&(t=tr,tr=n,t!==null&&JS(t)),e}function JS(e){tr===null?tr=e:tr.push.apply(tr,e)}function jF(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!ms(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function io(e,t){for(t&=~Rb,t&=~Rm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-hs(t),r=1<<n;e[n]=-1,t&=~r}}function vC(e){if(it&6)throw Error(ce(327));ql();var t=dg(e,0);if(!(t&1))return ar(e,Wt()),null;var n=Rg(e,t);if(e.tag!==0&&n===2){var r=ES(e);r!==0&&(t=r,n=XS(e,r))}if(n===1)throw n=Bd,Na(e,0),io(e,t),ar(e,Wt()),n;if(n===6)throw Error(ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ha(e,tr,pi),ar(e,Wt()),null}function Ob(e,t){var n=it;it|=1;try{return e(t)}finally{it=n,it===0&&(kc=Wt()+500,Cm&&Ko())}}function Ga(e){So!==null&&So.tag===0&&!(it&6)&&ql();var t=it;it|=1;var n=Hr.transition,r=dt;try{if(Hr.transition=null,dt=1,e)return e()}finally{dt=r,Hr.transition=n,it=t,!(it&6)&&Ko()}}function Ib(){pr=$l.current,kt($l)}function Na(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,mF(n)),Qt!==null)for(n=Qt.return;n!==null;){var r=n;switch(fb(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&mg();break;case 3:Pc(),kt(ir),kt(Mn),_b();break;case 5:bb(r);break;case 4:Pc();break;case 13:kt(Ut);break;case 19:kt(Ut);break;case 10:mb(r.type._context);break;case 22:case 23:Ib()}n=n.return}if(cn=e,Qt=e=Oo(e.current,null),An=pr=t,nn=0,Bd=null,Rb=Rm=za=0,tr=pd=null,ya!==null){for(t=0;t<ya.length;t++)if(n=ya[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}ya=null}return e}function hO(e,t){do{var n=Qt;try{if(gb(),Ep.current=Cg,Ag){for(var r=$t.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Ag=!1}if(Ba=0,an=en=$t=null,fd=!1,$d=0,Pb.current=null,n===null||n.return===null){nn=1,Bd=t,Qt=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=An,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=sC(o);if(g!==null){g.flags&=-257,iC(g,o,a,i,t),g.mode&1&&rC(i,c,t),t=g,l=c;var h=t.updateQueue;if(h===null){var p=new Set;p.add(l),t.updateQueue=p}else h.add(l);break e}else{if(!(t&1)){rC(i,c,t),Nb();break e}l=Error(ce(426))}}else if(Lt&&a.mode&1){var v=sC(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),iC(v,o,a,i,t),hb(Rc(l,a));break e}}i=l=Rc(l,a),nn!==4&&(nn=2),pd===null?pd=[i]:pd.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=Qk(i,l,t);XA(i,m);break e;case 1:a=l;var S=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof S.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ro===null||!Ro.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Xk(i,a,t);XA(i,w);break e}}i=i.return}while(i!==null)}mO(n)}catch(A){t=A,Qt===n&&n!==null&&(Qt=n=n.return);continue}break}while(!0)}function pO(){var e=xg.current;return xg.current=Cg,e===null?Cg:e}function Nb(){(nn===0||nn===3||nn===2)&&(nn=4),cn===null||!(za&268435455)&&!(Rm&268435455)||io(cn,An)}function Rg(e,t){var n=it;it|=2;var r=pO();(cn!==e||An!==t)&&(pi=null,Na(e,t));do try{VF();break}catch(s){hO(e,s)}while(!0);if(gb(),it=n,xg.current=r,Qt!==null)throw Error(ce(261));return cn=null,An=0,nn}function VF(){for(;Qt!==null;)gO(Qt)}function BF(){for(;Qt!==null&&!h7();)gO(Qt)}function gO(e){var t=yO(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?mO(e):Qt=t,Pb.current=null}function mO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=DF(n,t),n!==null){n.flags&=32767,Qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{nn=6,Qt=null;return}}else if(n=LF(n,t,pr),n!==null){Qt=n;return}if(t=t.sibling,t!==null){Qt=t;return}Qt=t=e}while(t!==null);nn===0&&(nn=5)}function ha(e,t,n){var r=dt,s=Hr.transition;try{Hr.transition=null,dt=1,zF(e,t,n,r)}finally{Hr.transition=s,dt=r}return null}function zF(e,t,n,r){do ql();while(So!==null);if(it&6)throw Error(ce(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ce(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(E7(e,i),e===cn&&(Qt=cn=null,An=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fh||(Fh=!0,SO(ug,function(){return ql(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Hr.transition,Hr.transition=null;var o=dt;dt=1;var a=it;it|=4,Pb.current=null,UF(e,n),uO(n,e),cF(RS),fg=!!PS,RS=PS=null,e.current=n,FF(n),p7(),it=a,dt=o,Hr.transition=i}else e.current=n;if(Fh&&(Fh=!1,So=e,Pg=s),i=e.pendingLanes,i===0&&(Ro=null),v7(n.stateNode),ar(e,Wt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Tg)throw Tg=!1,e=YS,YS=null,e;return Pg&1&&e.tag!==0&&ql(),i=e.pendingLanes,i&1?e===QS?gd++:(gd=0,QS=e):gd=0,Ko(),null}function ql(){if(So!==null){var e=QR(Pg),t=Hr.transition,n=dt;try{if(Hr.transition=null,dt=16>e?16:e,So===null)var r=!1;else{if(e=So,So=null,Pg=0,it&6)throw Error(ce(331));var s=it;for(it|=4,Te=e.current;Te!==null;){var i=Te,o=i.child;if(Te.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Te=c;Te!==null;){var u=Te;switch(u.tag){case 0:case 11:case 15:hd(8,u,i)}var d=u.child;if(d!==null)d.return=u,Te=d;else for(;Te!==null;){u=Te;var f=u.sibling,g=u.return;if(aO(u),u===c){Te=null;break}if(f!==null){f.return=g,Te=f;break}Te=g}}}var h=i.alternate;if(h!==null){var p=h.child;if(p!==null){h.child=null;do{var v=p.sibling;p.sibling=null,p=v}while(p!==null)}}Te=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Te=o;else e:for(;Te!==null;){if(i=Te,i.flags&2048)switch(i.tag){case 0:case 11:case 15:hd(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,Te=m;break e}Te=i.return}}var S=e.current;for(Te=S;Te!==null;){o=Te;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,Te=b;else e:for(o=S;Te!==null;){if(a=Te,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Pm(9,a)}}catch(A){zt(a,a.return,A)}if(a===o){Te=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,Te=w;break e}Te=a.return}}if(it=s,Ko(),Hs&&typeof Hs.onPostCommitFiberRoot=="function")try{Hs.onPostCommitFiberRoot(bm,e)}catch{}r=!0}return r}finally{dt=n,Hr.transition=t}}return!1}function yC(e,t,n){t=Rc(n,t),t=Qk(e,t,1),e=Po(e,t,1),t=qn(),e!==null&&(Df(e,1,t),ar(e,t))}function zt(e,t,n){if(e.tag===3)yC(e,e,n);else for(;t!==null;){if(t.tag===3){yC(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ro===null||!Ro.has(r))){e=Rc(n,e),e=Xk(t,e,1),t=Po(t,e,1),e=qn(),t!==null&&(Df(t,1,e),ar(t,e));break}}t=t.return}}function GF(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qn(),e.pingedLanes|=e.suspendedLanes&n,cn===e&&(An&n)===n&&(nn===4||nn===3&&(An&130023424)===An&&500>Wt()-kb?Na(e,0):Rb|=n),ar(e,t)}function vO(e,t){t===0&&(e.mode&1?(t=Ph,Ph<<=1,!(Ph&130023424)&&(Ph=4194304)):t=1);var n=qn();e=Di(e,t),e!==null&&(Df(e,t,n),ar(e,n))}function HF(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vO(e,n)}function WF(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ce(314))}r!==null&&r.delete(t),vO(e,n)}var yO;yO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return sr=!1,NF(e,t,n);sr=!!(e.flags&131072)}else sr=!1,Lt&&t.flags&1048576&&wk(t,Sg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cp(e,t),e=t.pendingProps;var s=Cc(t,Mn.current);Kl(t,n),s=Eb(null,t,r,e,s,n);var i=Ab();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,or(r)?(i=!0,vg(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,yb(t),s.updater=Tm,t.stateNode=s,s._reactInternals=t,FS(t,r,e,n),t=VS(null,t,r,!0,i,n)):(t.tag=0,Lt&&i&&db(t),Bn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cp(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=qF(r),e=is(r,e),s){case 0:t=jS(null,t,r,e,n);break e;case 1:t=lC(null,t,r,e,n);break e;case 11:t=oC(null,t,r,e,n);break e;case 14:t=aC(null,t,r,is(r.type,e),n);break e}throw Error(ce(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:is(r,s),jS(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:is(r,s),lC(e,t,r,s,n);case 3:e:{if(tO(t),e===null)throw Error(ce(387));
vendor: 4,917 bytes, line 44
44r=t.pendingProps,i=t.memoizedState,s=i.element,Pk(e,t),wg(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Rc(Error(ce(423)),t),t=cC(e,t,r,n,s);break e}else if(r!==s){s=Rc(Error(ce(424)),t),t=cC(e,t,r,n,s);break e}else for(yr=To(t.stateNode.containerInfo.firstChild),wr=t,Lt=!0,us=null,n=xk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xc(),r===s){t=Mi(e,t,n);break e}Bn(e,t,r,n)}t=t.child}return t;case 5:return Rk(t),e===null&&DS(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,kS(r,s)?o=null:i!==null&&kS(r,i)&&(t.flags|=32),eO(e,t),Bn(e,t,o,n),t.child;case 6:return e===null&&DS(t),null;case 13:return nO(e,t,n);case 4:return Sb(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Tc(t,null,r,n):Bn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:is(r,s),oC(e,t,r,s,n);case 7:return Bn(e,t,t.pendingProps,n),t.child;case 8:return Bn(e,t,t.pendingProps.children,n),t.child;case 12:return Bn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,St(bg,r._currentValue),r._currentValue=o,i!==null)if(ms(i.value,o)){if(i.children===s.children&&!ir.current){t=Mi(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Pi(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),MS(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ce(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),MS(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Bn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Kl(t,n),s=Wr(s),r=r(s),t.flags|=1,Bn(e,t,r,n),t.child;case 14:return r=t.type,s=is(r,t.pendingProps),s=is(r.type,s),aC(e,t,r,s,n);case 15:return Jk(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:is(r,s),Cp(e,t),t.tag=1,or(r)?(e=!0,vg(t)):e=!1,Kl(t,n),Yk(t,r,s),FS(t,r,s,n),VS(null,t,r,!0,e,n);case 19:return rO(e,t,n);case 22:return Zk(e,t,n)}throw Error(ce(156,t.tag))};function SO(e,t){return WR(e,t)}function KF(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Br(e,t,n,r){return new KF(e,t,n,r)}function Lb(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qF(e){if(typeof e=="function")return Lb(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Z1)return 11;if(e===eb)return 14}return 2}function Oo(e,t){var n=e.alternate;return n===null?(n=Br(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Pp(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Lb(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Rl:return La(n.children,s,i,t);case J1:o=8,s|=8;break;case lS:return e=Br(12,n,t,s|2),e.elementType=lS,e.lanes=i,e;case cS:return e=Br(13,n,t,s),e.elementType=cS,e.lanes=i,e;case uS:return e=Br(19,n,t,s),e.elementType=uS,e.lanes=i,e;case RR:return km(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case TR:o=10;break e;case PR:o=9;break e;case Z1:o=11;break e;case eb:o=14;break e;case to:o=16,r=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=Br(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function La(e,t,n,r){return e=Br(7,e,r,t),e.lanes=n,e}function km(e,t,n,r){return e=Br(22,e,r,t),e.elementType=RR,e.lanes=n,e.stateNode={isHidden:!1},e}function X0(e,t,n){return e=Br(6,e,null,t),e.lanes=n,e}function J0(e,t,n){return t=Br(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}
vendor: 5,457 bytes, line 44
44function YF(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=I0(0),this.expirationTimes=I0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I0(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Db(e,t,n,r,s,i,o,a,l){return e=new YF(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Br(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yb(i),e}function QF(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function bO(e){if(!e)return Do;e=e._reactInternals;e:{if(rl(e)!==e||e.tag!==1)throw Error(ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ce(171))}if(e.tag===1){var n=e.type;if(or(n))return bk(e,n,t)}return t}function _O(e,t,n,r,s,i,o,a,l){return e=Db(n,r,!0,e,s,i,o,a,l),e.context=bO(null),n=e.current,r=qn(),s=ko(n),i=Pi(r,s),i.callback=t??null,Po(n,i,s),e.current.lanes=s,Df(e,s,r),ar(e,r),e}function Om(e,t,n,r){var s=t.current,i=qn(),o=ko(s);return n=bO(n),t.context===null?t.context=n:t.pendingContext=n,t=Pi(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Po(s,t,o),e!==null&&(ps(e,s,o,i),wp(e,s,o)),o}function kg(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function SC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Mb(e,t){SC(e,t),(e=e.alternate)&&SC(e,t)}function XF(){return null}var wO=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ub(e){this._internalRoot=e}Im.prototype.render=Ub.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ce(409));Om(e,t,null,null)};Im.prototype.unmount=Ub.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ga(function(){Om(null,e,null,null)}),t[Li]=null}};function Im(e){this._internalRoot=e}Im.prototype.unstable_scheduleHydration=function(e){if(e){var t=ZR();e={blockedOn:null,target:e,priority:t};for(var n=0;n<so.length&&t!==0&&t<so[n].priority;n++);so.splice(n,0,e),n===0&&tk(e)}};function Fb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function bC(){}function JF(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=kg(o);i.call(c)}}var o=_O(t,r,e,0,null,!1,!1,"",bC);return e._reactRootContainer=o,e[Li]=o.current,Ld(e.nodeType===8?e.parentNode:e),Ga(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=kg(l);a.call(c)}}var l=Db(e,0,!1,null,null,!1,!1,"",bC);return e._reactRootContainer=l,e[Li]=l.current,Ld(e.nodeType===8?e.parentNode:e),Ga(function(){Om(t,l,n,r)}),l}function Lm(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=kg(o);a.call(l)}}Om(t,o,e,s)}else o=JF(n,t,e,s,r);return kg(o)}XR=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yu(t.pendingLanes);n!==0&&(rb(t,n|1),ar(t,Wt()),!(it&6)&&(kc=Wt()+500,Ko()))}break;case 13:Ga(function(){var r=Di(e,1);if(r!==null){var s=qn();ps(r,e,1,s)}}),Mb(e,1)}};sb=function(e){if(e.tag===13){var t=Di(e,134217728);if(t!==null){var n=qn();ps(t,e,134217728,n)}Mb(e,134217728)}};JR=function(e){if(e.tag===13){var t=ko(e),n=Di(e,t);if(n!==null){var r=qn();ps(n,e,t,r)}Mb(e,t)}};ZR=function(){return dt};ek=function(e,t){var n=dt;try{return dt=e,t()}finally{dt=n}};bS=function(e,t,n){switch(t){case"input":if(hS(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Am(r);if(!s)throw Error(ce(90));OR(r),hS(r,s)}}}break;case"textarea":NR(e,n);break;case"select":t=n.value,t!=null&&zl(e,!!n.multiple,t,!1)}};jR=Ob;VR=Ga;var ZF={usingClientEntryPoint:!1,Events:[Uf,Nl,Am,FR,$R,Ob]},Ou={findFiberByHostInstance:va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},e$={bundleType:Ou.bundleType,version:Ou.version,rendererPackageName:Ou.rendererPackageName,rendererConfig:Ou.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=GR(e),e===null?null:e.stateNode},findFiberByHostInstance:Ou.findFiberByHostInstance||XF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
44if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$h.isDisabled&&$h.supportsFiber)try{bm=$h.inject(e$),Hs=$h}catch{}}Ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZF;Ar.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fb(t))throw Error(ce(200));return QF(e,t,null,n)};Ar.createRoot=function(e,t){if(!Fb(e))throw Error(ce(299));var n=!1,r="",s=wO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Db(e,1,!1,null,null,n,!1,r,s),e[Li]=t.current,Ld(e.nodeType===8?e.parentNode:e),new Ub(t)};Ar.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ce(188)):(e=Object.keys(e).join(","),Error(ce(268,e)));return e=GR(t),e=e===null?null:e.stateNode,e};Ar.flushSync=function(e){return Ga(e)};Ar.hydrate=function(e,t,n){if(!Nm(t))throw Error(ce(200));return Lm(null,e,t,!0,n)};Ar.hydrateRoot=function(e,t,n){if(!Fb(e))throw Error(ce(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=wO;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=_O(t,null,e,1,n??null,s,!1,i,o),e[Li]=t.current,Ld(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Im(t)};Ar.render=function(e,t,n){if(!Nm(t))throw Error(ce(200));return Lm(null,e,t,!1,n)};Ar.unmountComponentAtNode=function(e){if(!Nm(e))throw Error(ce(40));return e._reactRootContainer?(Ga(function(){Lm(null,null,e,!1,function(){e._reactRootContainer=null,e[Li]=null})}),!0):!1};Ar.unstable_batchedUpdates=Ob;Ar.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nm(n))throw Error(ce(200));if(e==null||e._reactInternals===void 0)throw Error(ce(38));return Lm(e,t,n,!1,r)};Ar.version="18.3.1-next-f1338f8080-20240426";function EO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(EO)}catch(e){console.error(e)}}EO(),ER.exports=Ar;var ti=ER.exports;const Dm=Go(ti),t$=tP({__proto__:null,default:Dm},[ti]);var _C=ti;oS.createRoot=_C.createRoot,oS.hydrateRoot=_C.hydrateRoot;const n$="modulepreload",r$=function(e){return"/"+e},wC={},ni=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.all(n.map(a=>{if(a=r$(a),a in wC)return;wC[a]=!0;const l=a.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":n$,l||(u.as="script",u.crossOrigin=""),u.href=a,o&&u.setAttribute("nonce",o),document.head.appendChild(u),l)return new Promise((d,f)=>{u.addEventListener("load",d),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})}))}return s.then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})};function AO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=AO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Vs(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=AO(e))&&(r&&(r+=" "),r+=t);return r}const $b="-",s$=e=>{const t=o$(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split($b);return a[0]===""&&a.length!==1&&a.shift(),CO(a,t)||i$(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},CO=(e,t)=>{var o;if(e.length===0)return t.classGroupId;
vendor: 5,542 bytes, line 44
44const n=e[0],r=t.nextPart.get(n),s=r?CO(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join($b);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},EC=/^\[(.+)\]$/,i$=e=>{if(EC.test(e)){const t=EC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},o$=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return l$(Object.entries(e.classGroups),n).forEach(([i,o])=>{ZS(o,r,i,t)}),r},ZS=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:AC(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(a$(s)){ZS(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{ZS(o,AC(t,i),n,r)})})},AC=(e,t)=>{let n=e;return t.split($b).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},a$=e=>e.isThemeGetter,l$=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,c$=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},xO="!",u$=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let m=a[v];if(c===0){if(m===s&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(m==="/"){d=v;continue}}m==="["?c++:m==="]"&&c--}const f=l.length===0?a:a.substring(u),g=f.startsWith(xO),h=g?f.substring(1):f,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:o}):o},d$=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},f$=e=>({cache:c$(e.cacheSize),parseClassName:u$(e),...s$(e)}),h$=/\s+/,p$=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(h$);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let h=!!g,p=r(h?f.substring(0,g):f);if(!p){if(!h){a=c+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=c+(a.length>0?" "+a:a);continue}h=!1}const v=d$(u).join(":"),m=d?v+xO:v,S=m+p;if(i.includes(S))continue;i.push(S);const b=s(p,h);for(let w=0;w<b.length;++w){const A=b[w];i.push(m+A)}a=c+(a.length>0?" "+a:a)}return a};function g$(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=TO(t))&&(r&&(r+=" "),r+=n);return r}const TO=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=TO(e[r]))&&(n&&(n+=" "),n+=t);return n};function m$(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((u,d)=>d(u),e());return n=f$(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=p$(l,n);return s(l,u),u}return function(){return i(g$.apply(null,arguments))}}const wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},PO=/^\[(?:([a-z-]+):)?(.+)\]$/i,v$=/^\d+\/\d+$/,y$=new Set(["px","full","screen"]),S$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,li=e=>Yl(e)||y$.has(e)||v$.test(e),Yi=e=>Yc(e,"length",O$),Yl=e=>!!e&&!Number.isNaN(Number(e)),Z0=e=>Yc(e,"number",Yl),Iu=e=>!!e&&Number.isInteger(Number(e)),A$=e=>e.endsWith("%")&&Yl(e.slice(0,-1)),Xe=e=>PO.test(e),Qi=e=>S$.test(e),C$=new Set(["length","size","percentage"]),x$=e=>Yc(e,C$,RO),T$=e=>Yc(e,"position",RO),P$=new Set(["image","url"]),R$=e=>Yc(e,P$,N$),k$=e=>Yc(e,"",I$),Nu=()=>!0,Yc=(e,t,n)=>{const r=PO.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},O$=e=>b$.test(e)&&!_$.test(e),RO=()=>!1,I$=e=>w$.test(e),N$=e=>E$.test(e),L$=()=>{const e=wt("colors"),t=wt("spacing"),n=wt("blur"),r=wt("brightness"),s=wt("borderColor"),i=wt("borderRadius"),o=wt("borderSpacing"),a=wt("borderWidth"),l=wt("contrast"),c=wt("grayscale"),u=wt("hueRotate"),d=wt("invert"),f=wt("gap"),g=wt("gradientColorStops"),h=wt("gradientColorStopPositions"),p=wt("inset"),v=wt("margin"),m=wt("opacity"),S=wt("padding"),b=wt("saturate"),w=wt("scale"),A=wt("sepia"),C=wt("skew"),E=wt("space"),x=wt("translate"),R=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Xe,t],I=()=>[Xe,t],U=()=>["",li,Yi],L=()=>["auto",Yl,Xe],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],j=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",Xe],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[Yl,Xe];return{cacheSize:500,separator:":",theme:{colors:[Nu],spacing:[li,Yi],blur:["none","",Qi,Xe],brightness:$(),borderColor:[e],borderRadius:["n
44one","","full",Qi,Xe],borderSpacing:I(),borderWidth:U(),contrast:$(),grayscale:V(),hueRotate:$(),invert:V(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[A$,Yi],inset:P(),margin:P(),opacity:$(),padding:I(),saturate:$(),scale:$(),sepia:V(),skew:$(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Xe]}],container:["container"],columns:[{columns:[Qi]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),Xe]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Iu,Xe]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Xe]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Iu,Xe]}],"grid-cols":[{"grid-cols":[Nu]}],"col-start-end":[{col:["auto",{span:["full",Iu,Xe]},Xe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Nu]}],"row-start-end":[{row:["auto",{span:[Iu,Xe]},Xe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Xe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Xe,t]}],"min-w":[{"min-w":[Xe,t,"min","max","fit"]}],"max-w":[{"max-w":[Xe,t,"none","full","min","max","fit","prose",{screen:[Qi]},Qi]}],h:[{h:[Xe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Xe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Xe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Xe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qi,Yi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Z0]}],"font-family":[{font:[Nu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Xe]}],"line-clamp":[{"line-clamp":["none",Yl,Z0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",li,Xe]}],"list-image":[{"list-image":["none",Xe]}],"list-style-type":[{list:["none","disc","decimal",Xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",li,Yi]}],"underline-offset":[{"underline-offset":["auto",li,Xe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),T$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",x$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},R$]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}
vendor: 5,180 bytes, line 44
44],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:O()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[li,Xe]}],"outline-w":[{outline:[li,Yi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[li,Yi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qi,k$]}],"shadow-color":[{shadow:[Nu]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...j(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":j()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Qi,Xe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Xe]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",Xe]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",Xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Iu,Xe]}],"translate-x":[{"translate-x":[x]}],"translate-y":[{"translate-y":[x]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Xe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Xe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 5,218 bytes, line 44
44],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Xe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[li,Yi,Z0]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},D$=m$(L$);function CC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jb(...e){return t=>{let n=!1;const r=e.map(s=>{const i=CC(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():CC(e[s],null)}}}}function ur(...e){return y.useCallback(jb(...e),e)}function Og(e){const t=M$(e),n=y.forwardRef((r,s)=>{const{children:i,...o}=r,a=y.Children.toArray(i),l=a.find(F$);if(l){const c=l.props.children,u=a.map(d=>d===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:d);return _.jsx(t,{...o,ref:s,children:y.isValidElement(c)?y.cloneElement(c,void 0,u):null})}return _.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var kO=Og("Slot");function M$(e){const t=y.forwardRef((n,r)=>{const{children:s,...i}=n;if(y.isValidElement(s)){const o=j$(s),a=$$(i,s.props);return s.type!==y.Fragment&&(a.ref=r?jb(r,o):o),y.cloneElement(s,a)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U$=Symbol("radix.slottable");function F$(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U$}function $$(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function j$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const xC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TC=Vs,Ss=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return TC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=xC(u)||xC(d);return s[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...g}=u;return Object.entries(g).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...a}[p]):{...i,...a}[p]===v})?[...c,d,f]:c},[]);return TC(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};function PC(e,t){if(typeof e=="function")return e(t);
44e!=null&&(e.current=t)}function V$(...e){return t=>{let n=!1;const r=e.map(s=>{const i=PC(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():PC(e[s],null)}}}}function st(...e){return y.useCallback(V$(...e),e)}function qr(e,t=[]){let n=[];function r(i,o){const a=y.createContext(o);a.displayName=i+"Context";const l=n.length;n=[...n,o];const c=d=>{var m;const{scope:f,children:g,...h}=d,p=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,v=y.useMemo(()=>h,Object.values(h));return _.jsx(p.Provider,{value:v,children:g})};c.displayName=i+"Provider";function u(d,f,g={}){var m;const{optional:h=!1}=g,p=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,v=y.useContext(p);if(v)return v;if(o!==void 0)return o;if(!h)throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const s=()=>{const i=n.map(o=>y.createContext(o));return function(a){const l=(a==null?void 0:a[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,B$(s,...t)]}function B$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s||!s.defaultPrevented)return t==null?void 0:t(s)}}var un=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},z$=ji[" useInsertionEffect ".trim().toString()]||un;function Ui({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=G$({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const u=y.useRef(e!==void 0);y.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=y.useCallback(u=>{var d;if(a){const f=H$(u)?u(e):u;f!==e&&((d=o.current)==null||d.call(o,f))}else i(u)},[a,e,i,o]);return[l,c]}function G$({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),i=y.useRef(t);return z$(()=>{i.current=t},[t]),y.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function H$(e){return typeof e=="function"}function Mm(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Um(e){const[t,n]=y.useState(void 0);return un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function W$(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var bs=e=>{const{present:t,children:n}=e,r=K$(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=q$(r.ref,Y$(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:i}):null};bs.displayName="Presence";function K$(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),i=y.useRef("none"),o=y.useRef(void 0),a=e?"mounted":"unmounted",[l,c]=W$(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{l==="mounted"?(i.current=o.current??Lu(r.current),o.current=void 0):i.current="none"},[l]),un(()=>{const u=r.current,d=s.current;if(d!==e){const g=i.current,h=Lu(u);e?(o.current=h,c("MOUNT")):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&g!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),un(()=>
44{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const v=Lu(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(c("ANIMATION_END"),!s.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},g=h=>{h.target===t&&(i.current=Lu(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(u=>{if(u){const d=getComputedStyle(u);r.current=d,o.current=Lu(d)}else r.current=null;n(u)},[])}}function RC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function q$(...e){const t=y.useRef(e);return t.current=e,y.useCallback(n=>{const r=t.current;let s=!1;const i=r.map(o=>{const a=RC(o,n);return!s&&typeof a=="function"&&(s=!0),a});if(s)return()=>{for(let o=0;o<i.length;o++){const a=i[o];typeof a=="function"?a():RC(r[o],null)}}},[])}function Lu(e){return(e==null?void 0:e.animationName)||"none"}function Y$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Oc(e){const t=y.forwardRef((n,r)=>{let{children:s,...i}=n,o=null,a=!1;const l=[];kC(s)&&typeof jh=="function"&&(s=jh(s._payload)),y.Children.forEach(s,f=>{var g;if(ej(f)){a=!0;const h=f;let p="child"in h.props?h.props.child:h.props.children;kC(p)&&typeof jh=="function"&&(p=jh(p._payload)),o=X$(h,p),l.push((g=o==null?void 0:o.props)==null?void 0:g.children)}else l.push(f)}),o?o=y.cloneElement(o,void 0,l):!a&&y.Children.count(s)===1&&y.isValidElement(s)&&(o=s);const c=o?Z$(o):void 0,u=st(r,c);if(!o){if(s||s===0)throw new Error(a?sj(e):rj(e));return s}const d=J$(i,o.props??{});return o.type!==y.Fragment&&(d.ref=r?u:c),y.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}var OO=Symbol.for("radix.slottable");function Q$(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=OO,t}var X$=(e,t)=>{if("child"in e.props){const n=e.props.child;return y.isValidElement(n)?y.cloneElement(n,void 0,e.props.children(n.props.children)):null}return y.isValidElement(t)?t:null};function J$(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Z$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ej(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OO}var tj=Symbol.for("react.lazy");function kC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tj&&"_payload"in e&&nj(e._payload)}function nj(e){return typeof e=="object"&&e!==null&&"then"in e}var rj=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,sj=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,jh=ji[" use ".trim().toString()],ij=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=ij.reduce((e,t)=>{const n=Oc(`Primitive.${t}`),r=y.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function oj(e,t){e&&ti.flushSync(()=>
44e.dispatchEvent(t))}var Fm="Checkbox",[aj,Wge]=qr(Fm),[lj,Vb]=aj(Fm);function cj(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,g]=Ui({prop:n,defaultProp:s??!1,onChange:l,caller:Fm}),[h,p]=y.useState(null),[v,m]=y.useState(null),S=y.useRef(!1),b=h?!!o||!!h.closest("form"):!0,w={checked:f,disabled:i,setChecked:g,control:h,setControl:p,name:a,form:o,value:u,hasConsumerStoppedPropagationRef:S,required:c,defaultChecked:Io(s)?!1:s,isFormControl:b,bubbleInput:v,setBubbleInput:m};return _.jsx(lj,{scope:t,...w,children:uj(d)?d(w):r})}var IO="CheckboxTrigger",NO=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:o,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:g,bubbleInput:h}=Vb(IO,e),p=st(s,u),v=y.useRef(l);return y.useEffect(()=>{const m=i==null?void 0:i.form;if(m){const S=()=>d(v.current);return m.addEventListener("reset",S),()=>m.removeEventListener("reset",S)}},[i,d]),_.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":Io(l)?"mixed":l,"aria-required":c,"data-state":FO(l),"data-disabled":a?"":void 0,disabled:a,value:o,...r,ref:p,onKeyDown:Ve(t,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Ve(n,m=>{d(S=>Io(S)?!0:!S),h&&g&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});NO.displayName=IO;var Bb=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return _.jsx(cj,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:a,required:o,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>_.jsxs(_.Fragment,{children:[_.jsx(NO,{...d,ref:t,__scopeCheckbox:n}),f&&_.jsx(UO,{__scopeCheckbox:n})]})})});Bb.displayName=Fm;var LO="CheckboxIndicator",DO=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=Vb(LO,n);return _.jsx(bs,{present:r||Io(i.checked)||i.checked===!0,children:_.jsx(ze.span,{"data-state":FO(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});DO.displayName=LO;var MO="CheckboxBubbleInput",UO=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:g}=Vb(MO,e),h=st(n,g),p=Mm(i),v=Um(r);y.useEffect(()=>{const S=f;if(!S)return;const b=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(b,"checked").set,C=!s.current;if(p!==i&&A){const E=new Event("click",{bubbles:C});S.indeterminate=Io(i),A.call(S,Io(i)?!1:i),S.dispatchEvent(E)}},[f,p,i,s]);const m=y.useRef(Io(i)?!1:i);return _.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??m.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:h,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});UO.displayName=MO;function uj(e){return typeof e=="function"}function Io(e){return e==="indeterminate"}function FO(e){return Io(e)?"indeterminate":e?"checked":"unchecked"}/** 45 * @license lucide-react v0.469.0 - ISC 46 * 47 * This source code is licensed under the ISC license. 48 * See the LICENSE file in the root directory of this source tree. 49 */const dj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$O=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** 50 * @license lucide-react v0.469.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */var fj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 55 * @license lucide-react v0.469.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */const hj=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>y.createElement("svg",{ref:l,...fj,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$O("lucide",s),...a},[...o.map(([c,u])=>y.createElement(c,u)),...Array.isArray(i)?i:[i]]));/** 60 * @license lucide-react v0.469.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const ri=(e,t)=>{const n=y.forwardRef(({className:r,...s},i)=>y.createElement(hj,{ref:i,iconNode:t,className:$O(`lucide-${dj(e)}`,r),...s}));return n.displayName=`${e}`,n};/** 65 * @license lucide-react v0.469.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const pj=ri("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 70 * @license lucide-react v0.469.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const gj=ri("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 75 * @license lucide-react v0.469.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const zb=ri("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 80 * @license lucide-react v0.469.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const $m=ri("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 85 * @license lucide-react v0.469.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const mj=ri("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 90 * @license lucide-react v0.469.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const vj=ri("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 95 * @license lucide-react v0.469.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree.
99 */const yj=ri("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 100 * @license lucide-react v0.469.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const OC=ri("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 105 * @license lucide-react v0.469.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Sj=ri("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 110 * @license lucide-react v0.469.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const Gb=ri("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function jO(e){const t=e+"CollectionProvider",[n,r]=qr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:v,children:m}=p,S=y.useRef(null),b=y.useRef(new Map).current;return _.jsx(s,{scope:v,itemMap:b,collectionRef:S,children:m})};o.displayName=t;const a=e+"CollectionSlot",l=Oc(a),c=y.forwardRef((p,v)=>{const{scope:m,children:S}=p,b=i(a,m),w=st(v,b.collectionRef);return _.jsx(l,{ref:w,children:S})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Oc(u),g=y.forwardRef((p,v)=>{const{scope:m,children:S,...b}=p,w=y.useRef(null),A=st(v,w),C=i(u,m);return y.useEffect(()=>(C.itemMap.set(w,{ref:w,...b}),()=>void C.itemMap.delete(w))),_.jsx(f,{[d]:"",ref:A,children:S})});g.displayName=u;function h(p){const v=i(e+"CollectionConsumer",p);return y.useCallback(()=>{const S=v.collectionRef.current;if(!S)return[];const b=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((C,E)=>b.indexOf(C.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:g},h,r]}var bj=ji[" useId ".trim().toString()]||(()=>{}),_j=0;function Ri(e){const[t,n]=y.useState(bj());return un(()=>{n(r=>r??String(_j++))},[e]),t?`radix-${t}`:""}function Qs(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var wj=y.createContext(void 0);function jm(e){const t=y.useContext(wj);return e||t||"ltr"}var ey=!1;function Ej(){const[e,t]=y.useState(ey);return y.useEffect(()=>{ey||(ey=!0,t(!0))},[]),e}var VO=ji[" useSyncExternalStore ".trim().toString()];function Aj(){return()=>{}}function Cj(){return VO(Aj,()=>!0,()=>!1)}var xj=typeof VO=="function"?Cj:Ej,ty="rovingFocusGroup.onEntryFocus",Tj={bubbles:!1,cancelable:!0},$f="RovingFocusGroup",[e2,BO,Pj]=jO($f),[Rj,Vm]=qr($f,[Pj]),[kj,Oj]=Rj($f),zO=y.forwardRef((e,t)=>_.jsx(e2.Provider,{scope:e.__scopeRovingFocusGroup,children:_.jsx(e2.Slot,{scope:e.__scopeRovingFocusGroup,children:_.jsx(Ij,{...e,ref:t})})}));zO.displayName=$f;var Ij=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=y.useRef(null),g=st(t,f),h=jm(i),[p,v]=Ui({prop:o,defaultProp:a??null,onChange:l,caller:$f}),[m,S]=y.useState(!1),b=Qs(c),w=BO(n),A=y.useRef(!1),[C,E]=y.useState(0);return y.useEffect(()=>{const x=f.current;if(x)return x.addEventListener(ty,b),()=>x.removeEventListener(ty,b)},[b]),_.jsx(kj,{scope:n,orientation:r,dir:h,loop:s,currentTabStopId:p,onItemFocus:y.useCallback(x=>v(x),[v]),onItemShiftTab:y.useCallback(()=>S(!0),[]),onFocusableItemAdd:y.useCallback(()=>E(x=>x+1),[]),onFocusableItemRemove:y.useCallback(()=>E(x=>x-1),[]),children:_.jsx(ze.div,{tabIndex:m||C===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:Ve(e.onMouseDown,()=>{A.current=!0}),onFocus:Ve(e.onFocus,x=>{const R=!A.current;if(x.target===x.currentTarget&&R&&!m){const T=new CustomEvent(ty,Tj);if(x.currentTarget.dispatchEvent(T),!T.defaultPrevented){const P=w().filter(O=>O.focusable),I=P.find(O=>O.active),U=P.find(O=>
114O.id===p),z=[I,U,...P].filter(Boolean).map(O=>O.ref.current);WO(z,u)}}A.current=!1}),onBlur:Ve(e.onBlur,()=>S(!1))})})}),GO="RovingFocusGroupItem",HO=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=e,l=Ri(),c=i||l,u=Oj(GO,n),d=u.currentTabStopId===c,f=BO(n),{onFocusableItemAdd:g,onFocusableItemRemove:h,currentTabStopId:p}=u,v=xj();return un(()=>{if(!(!v||!r))return g(),()=>h()},[v,r,g,h]),y.useEffect(()=>{if(!(v||!r))return g(),()=>h()},[v,r,g,h]),_.jsx(e2.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:_.jsx(ze.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ve(e.onMouseDown,m=>{r?u.onItemFocus(c):m.preventDefault()}),onFocus:Ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Ve(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const S=Dj(m,u.orientation,u.dir);if(S!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let w=f().filter(A=>A.focusable).map(A=>A.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const A=w.indexOf(m.currentTarget);w=u.loop?Mj(w,A+1):w.slice(A+1)}setTimeout(()=>WO(w))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:p!=null}):o})})});HO.displayName=GO;var Nj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Lj(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Dj(e,t,n){const r=Lj(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Nj[r]}function WO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Mj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var KO=zO,qO=HO,Hb="Radio",[Uj,YO]=qr(Hb),[Fj,Bm]=Uj(Hb);function QO(e){const{__scopeRadio:t,checked:n=!1,children:r,disabled:s,form:i,name:o,onCheck:a,required:l,value:c="on",internal_do_not_use_render:u}=e,[d,f]=y.useState(null),[g,h]=y.useState(null),p=y.useRef(!1),v=d?!!i||!!d.closest("form"):!0,m={checked:n,disabled:s,required:l,name:o,form:i,value:c,control:d,setControl:f,hasConsumerStoppedPropagationRef:p,isFormControl:v,bubbleInput:g,setBubbleInput:h,onCheck:()=>a==null?void 0:a()};return _.jsx(Fj,{scope:t,...m,children:jj(u)?u(m):r})}var XO="RadioTrigger",Wb=y.forwardRef(({__scopeRadio:e,onClick:t,...n},r)=>{const{checked:s,disabled:i,value:o,setControl:a,onCheck:l,hasConsumerStoppedPropagationRef:c,isFormControl:u,bubbleInput:d}=Bm(XO,e),f=st(r,a);return _.jsx(ze.button,{type:"button",role:"radio","aria-checked":s,"data-state":tI(s),"data-disabled":i?"":void 0,disabled:i,value:o,...n,ref:f,onClick:Ve(t,g=>{s||l(),d&&u&&(c.current=g.isPropagationStopped(),c.current||g.stopPropagation())})})});Wb.displayName=XO;var $j=y.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:s,required:i,disabled:o,value:a,onCheck:l,form:c,...u}=e;return _.jsx(QO,{__scopeRadio:n,checked:s,disabled:o,required:i,onCheck:l,name:r,form:c,value:a,internal_do_not_use_render:({isFormControl:d})=>_.jsxs(_.Fragment,{children:[_.jsx(Wb,{...u,ref:t,__scopeRadio:n}),d&&_.jsx(Kb,{__scopeRadio:n})]})})});$j.displayName=Hb;var JO="RadioIndicator",ZO=y.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...s}=e,i=Bm(JO,n);return _.jsx(bs,{present:r||i.checked,children:_.jsx(ze.span,{"data-state":tI(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t})})});ZO.displayName=JO;var eI="RadioBubbleInput",Kb=y.forwardRef(({__scopeRadio:e,...t},n)=>{const{control:r,checked:s,required:i,disabled:o,name:a,value:l,form:c,bubbleInput:u,setBubbleInput:d,hasConsumerStoppedPropagationRef:f}=Bm(eI,e),g=st(n,d),h=Mm(s),p=Um(r);y.useEffect(()=>{const m=u;if(!m)return;const S=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(S,"checked").set,A=!f.current;if(h!==s&&w){const C=new Event("click",{bubbles:A});w.call(m,s),m.dispatchEvent(C)}},[u,h,s,f]);const v=y.useRef(s);return _.jsx(ze.input,{type:"radio","aria-hidden":!0,defaultChecked:v.current,required:i,disabled:o,name:a,value:l,form:c,...t,tabIndex:-1,ref:g,style:{...t.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Kb.displayName=eI;function jj(e){return typeof e=="function"}function tI(e){return e?"checked":"unchecked"}var Vj=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zm="RadioGroup",[Bj,Kge]=qr(zm,[Vm,YO]),nI=Vm(),Gm=YO(),[zj,Gj]=Bj(zm),qb=y.forwardRef((e,t)=>
114{const{__scopeRadioGroup:n,name:r,form:s,defaultValue:i,value:o,required:a=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...g}=e,h=nI(n),p=jm(u),[v,m]=Ui({prop:o,defaultProp:i??null,onChange:f,caller:zm}),[S,b]=y.useState(null),w=st(t,b),A=y.useRef(v);return y.useEffect(()=>{const C=s?S==null?void 0:S.ownerDocument.getElementById(s):S==null?void 0:S.closest("form");if(C instanceof HTMLFormElement){const E=()=>m(A.current);return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[S,s,m]),_.jsx(zj,{scope:n,name:r,form:s,required:a,disabled:l,value:v,onValueChange:m,children:_.jsx(KO,{asChild:!0,...h,orientation:c,dir:p,loop:d,children:_.jsx(ze.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":l?"":void 0,dir:p,...g,ref:w})})})});qb.displayName=zm;var Hj="RadioGroupItem",Wj="RadioGroupItemProvider",rI="RadioGroupItemTrigger",Kj="RadioGroupItemBubbleInput";function qj(e){const{__scopeRadioGroup:t,value:n,disabled:r,children:s,internal_do_not_use_render:i}=e,o=Gj(Wj,t),a=Gm(t),l=o.disabled||r;return _.jsx(QO,{...a,checked:o.value===n,disabled:l,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:i,children:s})}var sI=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=nI(n),i=Gm(n),{checked:o,disabled:a}=Bm(rI,i.__scopeRadio),l=y.useRef(null),c=st(t,l),u=y.useRef(!1);return y.useEffect(()=>{const d=g=>{Vj.includes(g.key)&&(u.current=!0)},f=()=>u.current=!1;return document.addEventListener("keydown",d),document.addEventListener("keyup",f),()=>{document.removeEventListener("keydown",d),document.removeEventListener("keyup",f)}},[]),_.jsx(qO,{asChild:!0,...s,focusable:!a,active:o,children:_.jsx(Wb,{...i,...r,ref:c,onKeyDown:Ve(r.onKeyDown,d=>{d.key==="Enter"&&d.preventDefault()}),onFocus:Ve(r.onFocus,()=>{var d;u.current&&((d=l.current)==null||d.click())})})})});sI.displayName=rI;var Yb=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,value:r,disabled:s,...i}=e;return _.jsx(qj,{__scopeRadioGroup:n,value:r,disabled:s,internal_do_not_use_render:({isFormControl:o})=>_.jsxs(_.Fragment,{children:[_.jsx(sI,{...i,ref:t,__scopeRadioGroup:n}),o&&_.jsx(iI,{__scopeRadioGroup:n})]})})});Yb.displayName=Hj;var iI=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=Gm(n);return _.jsx(Kb,{...s,...r,ref:t})});iI.displayName=Kj;var Yj="RadioGroupIndicator",oI=y.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,s=Gm(n);return _.jsx(ZO,{...s,...r,ref:t})});oI.displayName=Yj;function IC(e,[t,n]){return Math.min(n,Math.max(t,e))}var Qj="DismissableLayer",t2="dismissableLayer.update",Xj="dismissableLayer.pointerDownOutside",Jj="dismissableLayer.focusOutside",NC,Qb=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),jf=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=y.useContext(Qb),[d,f]=y.useState(null),g=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),p=st(t,f),v=Array.from(u.layers),[m]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),S=m?v.indexOf(m):-1,b=d?v.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=b>=S,C=y.useRef(!1),E=rV(P=>{i==null||i(P),a==null||a(P),P.defaultPrevented||l==null||l()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(P=>{if(!(P instanceof Node))return!1;const I=[...u.branches].some(U=>U.contains(P));return A&&!I},[u.branches,A])}),x=sV(P=>{if(r&&C.current)return;const I=P.target;[...u.branches].some(L=>L.contains(I))||(o==null||o(P),a==null||a(P),P.defaultPrevented||l==null||l())},g),R=d?b===v.length-1:!1,T=Qs(P=>{P.key==="Escape"&&(s==null||s(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))});return y.useEffect(()=>{if(R)return g.addEventListener("keydown",T,{capture:!0}),()=>g.removeEventListener("keydown",T,{capture:!0})},[g,R,T]),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(NC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),LC(),()=>
114{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=NC))}},[d,g,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),LC())},[d,u]),y.useEffect(()=>{const P=()=>h({});return document.addEventListener(t2,P),()=>document.removeEventListener(t2,P)},[]),_.jsx(ze.div,{...c,ref:p,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Ve(e.onFocusCapture,x.onFocusCapture),onBlurCapture:Ve(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:Ve(e.onPointerDownCapture,E.onPointerDownCapture)})});jf.displayName=Qj;var Zj="DismissableLayerBranch",eV=y.forwardRef((e,t)=>{const n=y.useContext(Qb),r=y.useRef(null),s=st(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(ze.div,{...e,ref:s})});eV.displayName=Zj;function tV(){const e=y.useContext(Qb),[t,n]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var nV=()=>!0;function rV(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:o=nV}=t,a=Qs(e),l=y.useRef(!1),c=y.useRef(!1),u=y.useRef(new Map),d=y.useRef(()=>{});return y.useEffect(()=>{function f(){c.current=!1,s.current=!1,u.current.clear()}function g(){return Array.from(u.current.values()).some(Boolean)}function h(b){if(!c.current)return;const w=b.target;w instanceof Node&&[...i].some(C=>C.contains(w))||u.current.set(b.type,!0),b.type==="click"&&window.setTimeout(()=>{c.current&&d.current()},0)}function p(b){c.current&&u.current.set(b.type,!1)}const v=b=>{if(b.target&&!l.current){let w=function(){n.removeEventListener("click",d.current);const C=g();f(),C||aI(Xj,a,A,{discrete:!0})};if(!o(b.target)){n.removeEventListener("click",d.current),f(),l.current=!1;return}const A={originalEvent:b};c.current=!0,s.current=r&&b.button===0,u.current.clear(),!r||b.button!==0?w():(n.removeEventListener("click",d.current),d.current=w,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),f();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const b of m)n.addEventListener(b,h,!0),n.addEventListener(b,p);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",v),n.removeEventListener("click",d.current);for(const b of m)n.removeEventListener(b,h,!0),n.removeEventListener(b,p)}},[n,a,r,s,i,o]),{onPointerDownCapture:()=>l.current=!0}}function sV(e,t=globalThis==null?void 0:globalThis.document){const n=Qs(e),r=y.useRef(!1);return y.useEffect(()=>{const s=i=>{i.target&&!r.current&&aI(Jj,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function LC(){const e=new CustomEvent(t2);document.dispatchEvent(e)}function aI(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?oj(s,i):s.dispatchEvent(i)}var Vh=0,xs=null;function Xb(){y.useEffect(()=>{xs||(xs={start:DC(),end:DC()});const{start:e,end:t}=xs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Vh++,()=>{Vh===1&&(xs==null||xs.start.remove(),xs==null||xs.end.remove(),xs=null),Vh=Math.max(0,Vh-1)}},[])}function DC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ny="focusScope.autoFocusOnMount",ry="focusScope.autoFocusOnUnmount",MC={bubbles:!1,cancelable:!0},iV="FocusScope",Hm=y.forwardRef((e,t)=>
114{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,l]=y.useState(null),c=Qs(s),u=Qs(i),d=y.useRef(null),f=st(t,l),g=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let p=function(b){if(g.paused||!a)return;const w=b.target;a.contains(w)?d.current=w:Ji(d.current,{select:!0})},v=function(b){if(g.paused||!a)return;const w=b.relatedTarget;w!==null&&(a.contains(w)||Ji(d.current,{select:!0}))},m=function(b){if(document.activeElement===document.body)for(const A of b)A.removedNodes.length>0&&Ji(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const S=new MutationObserver(m);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),S.disconnect()}}},[r,a,g.paused]),y.useEffect(()=>{if(a){FC.add(g);const p=document.activeElement;if(!a.contains(p)){const m=new CustomEvent(ny,MC);a.addEventListener(ny,c),a.dispatchEvent(m),m.defaultPrevented||(oV(dV(lI(a)),{select:!0}),document.activeElement===p&&Ji(a))}return()=>{a.removeEventListener(ny,c),setTimeout(()=>{const m=new CustomEvent(ry,MC);a.addEventListener(ry,u),a.dispatchEvent(m),m.defaultPrevented||Ji(p??document.body,{select:!0}),a.removeEventListener(ry,u),FC.remove(g)},0)}}},[a,c,u,g]);const h=y.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,m=document.activeElement;if(v&&m){const S=p.currentTarget,[b,w]=aV(S);b&&w?!p.shiftKey&&m===w?(p.preventDefault(),n&&Ji(b,{select:!0})):p.shiftKey&&m===b&&(p.preventDefault(),n&&Ji(w,{select:!0})):m===S&&p.preventDefault()}},[n,r,g.paused]);return _.jsx(ze.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})});Hm.displayName=iV;function oV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ji(r,{select:t}),document.activeElement!==n)return}function aV(e){const t=lI(e),n=UC(t,e),r=UC(t.reverse(),e);return[n,r]}function lI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function UC(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):lV(r,{upTo:t})))return r}function lV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cV(e){return e instanceof HTMLInputElement&&"select"in e}function Ji(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cV(e)&&t&&e.select()}}var FC=uV();function uV(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$C(e,t),e.unshift(t)},remove(t){var n;e=$C(e,t),(n=e[0])==null||n.resume()}}}function $C(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dV(e){return e.filter(t=>t.tagName!=="A")}const fV=["top","right","bottom","left"],Mo=Math.min,ki=Math.max,Ig=Math.round,Bh=Math.floor,Oi=e=>({x:e,y:e}),hV={left:"right",right:"left",bottom:"top",top:"bottom"};function cI(e,t,n){return ki(e,Mo(t,n))}function Fi(e,t){return typeof e=="function"?e(t):e}function Uo(e){return e.split("-")[0]}function Qc(e){return e.split("-")[1]}function Jb(e){return e==="x"?"y":"x"}function Zb(e){return e==="y"?"height":"width"}function Bs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function e_(e){return Jb(Bs(e))}function pV(e,t,n){n===void 0&&(n=!1);const r=Qc(e),s=e_(e),i=Zb(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Ng(o)),[o,Ng(o)]}function gV(e){const t=Ng(e);return[n2(e),t,n2(t)]}function n2(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jC=["left","right"],VC=["right","left"],mV=["top","bottom"],vV=["bottom","top"];function yV(e,t,n){switch(e){case"top":case"bottom":return n?t?VC:jC:t?jC:VC;case"left":case"right":return t?mV:vV;default:return[]}}function SV(e,t,n,r){const s=Qc(e);let i=yV(Uo(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(n2)))),i}function Ng(e){const t=Uo(e);return hV[t]+e.slice(t.length)}function bV(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function uI(e){return typeof e!="number"?bV(e):{top:e,right:e,bottom:e,left:e}}function Lg(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function BC(e,t,n){let{reference:r,floating:s}=e;const i=Bs(t),o=e_(t),a=Zb(o),l=Uo(t),c=i==="y",u=r.x+r.width/2-s.width/2,d=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-s.width,y:d};break;default:g={x:r.x,y:r.y}}const h=Qc(t);return h&&(g[o]+=f*(h==="end"?1:-1)*(n&&c?-1:1)),g}async function _V(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=Fi(t,e),h=uI(g),v=a[f?d==="floating"?"reference":"floating":d],m=Lg(await i.getClippingRect
vendor: 4,795 bytes, line 114
114({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(b))&&await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1},A=Lg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:b,strategy:l}):S);return{top:(m.top-A.top+h.top)/w.y,bottom:(A.bottom-m.bottom+h.bottom)/w.y,left:(m.left-A.left+h.left)/w.x,right:(A.right-m.right+h.right)/w.x}}const wV=50,EV=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:_V},l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:d}=BC(c,r,l),f=r,g=0;const h={};for(let p=0;p<i.length;p++){const v=i[p];if(!v)continue;const{name:m,fn:S}=v,{x:b,y:w,data:A,reset:C}=await S({x:u,y:d,initialPlacement:r,placement:f,strategy:s,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=b??u,d=w??d,h[m]={...h[m],...A},C&&g<wV&&(g++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(c=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:u,y:d}=BC(c,f,l)),p=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:h}},AV=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Fi(e,t)||{};if(c==null)return{};const d=uI(u),f={x:n,y:r},g=e_(s),h=Zb(g),p=await o.getDimensions(c),v=g==="y",m=v?"top":"left",S=v?"bottom":"right",b=v?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[g]-f[g]-i.floating[h],A=f[g]-i.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let E=C?C[b]:0;(!E||!await(o.isElement==null?void 0:o.isElement(C)))&&(E=a.floating[b]||i.floating[h]);const x=w/2-A/2,R=E/2-p[h]/2-1,T=Mo(d[m],R),P=Mo(d[S],R),I=E-p[h]-P,U=E/2-p[h]/2+x,L=cI(T,U,I),z=!l.arrow&&Qc(s)!=null&&U!==L&&i.reference[h]/2-(U<T?T:P)-p[h]/2<0,O=z?U<T?U-T:U-I:0;return{[g]:f[g]+O,data:{[g]:L,centerOffset:U-L-O,...z&&{alignmentOffset:O}},reset:z}}}),CV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=Fi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const m=Uo(s),S=Bs(a),b=Uo(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),A=f||(b||!p?[Ng(a)]:gV(a)),C=h!=="none";!f&&C&&A.push(...SV(a,p,h,w));const E=[a,...A],x=await l.detectOverflow(t,v),R=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&R.push(x[m]),d){const L=pV(s,o,w);R.push(x[L[0]],x[L[1]])}if(T=[...T,{placement:s,overflows:R}],!R.every(L=>L<=0)){var P,I;const L=(((P=i.flip)==null?void 0:P.index)||0)+1,z=E[L];if(z&&(!(d==="alignment"?S!==Bs(z):!1)||T.every(N=>Bs(N.placement)===S?N.overflows[0]>0:!0)))return{data:{index:L,overflows:T},reset:{placement:z}};let O=(I=T.filter(j=>j.overflows[0]<=0).sort((j,N)=>j.overflows[1]-N.overflows[1])[0])==null?void 0:I.placement;if(!O)switch(g){case"bestFit":{var U;const j=(U=T.filter(N=>{if(C){const V=Bs(N.placement);return V===S||V==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(V=>V>0).reduce((V,k)=>V+k,0)]).sort((N,V)=>N[1]-V[1])[0])==null?void 0:U[0];j&&(O=j);break}case"initialPlacement":O=a;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function zC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function GC(e){return fV.some(t=>e[t]>=0)}const xV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=Fi(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=zC(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:GC(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),a=zC(o,n.floating);return{data:{escapedOffsets:a,escaped:GC(a)}}}default:return{}}}}},dI=new Set(["left","top"]);async function TV(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Uo(n),a=Qc(n),l=Bs(n)==="y",c=dI.has(o)?-1:1,u=i&&l?-1:1,d=Fi(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}
114:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof h=="number"&&(g=a==="end"?h*-1:h),l?{x:g*u,y:f*c}:{x:f*c,y:g*u}}const PV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,l=await TV(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},RV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:b,y:w}=S;return{x:b,y:w}}},...c}=Fi(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),f=Bs(s),g=Jb(f);let h=u[g],p=u[f];const v=(S,b)=>cI(b+d[S==="y"?"top":"left"],b,b-d[S==="y"?"bottom":"right"]);o&&(h=v(g,h)),a&&(p=v(f,p));const m=l.fn({...t,[g]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:o,[f]:a}}}}}},kV=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:i,placement:o,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Fi(e,t),f={x:s,y:i},g=Bs(o),h=Jb(g);let p=f[h],v=f[g];const m=Fi(c,t),S=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:(n=m.mainAxis)!=null?n:0,crossAxis:(r=m.crossAxis)!=null?r:0};if(u){const A=h==="y"?"height":"width",C=a.reference[h]-a.floating[A]+S.mainAxis,E=a.reference[h]+a.reference[A]-S.mainAxis;p<C?p=C:p>E&&(p=E)}if(d){var b,w;const A=h==="y"?"width":"height",C=dI.has(Uo(o)),E=a.reference[g]-a.floating[A]+(C&&((b=l.offset)==null?void 0:b[g])||0)+(C?0:S.crossAxis),x=a.reference[g]+a.reference[A]+(C?0:((w=l.offset)==null?void 0:w[g])||0)-(C?S.crossAxis:0);v<E?v=E:v>x&&(v=x)}return{[h]:p,[g]:v}}}},OV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:i}=t,{apply:o=()=>{},...a}=Fi(e,t),l=await s.detectOverflow(t,a),c=Uo(n),u=Qc(n),d=Bs(n)==="y",{width:f,height:g}=r.floating;let h,p;c==="top"||c==="bottom"?(h=c,p=u===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(p=c,h=u==="end"?"top":"bottom");const v=g-l.top-l.bottom,m=f-l.left-l.right,S=Mo(g-l[h],v),b=Mo(f-l[p],m),w=t.middlewareData.shift,A=!w;let C=S,E=b;w!=null&&w.enabled.x&&(E=m),w!=null&&w.enabled.y&&(C=v),A&&!u&&(d?E=f-2*ki(l.left,l.right):C=g-2*ki(l.top,l.bottom)),await o({...t,availableWidth:E,availableHeight:C});const x=await s.getDimensions(i.floating);return f!==x.width||g!==x.height?{reset:{rects:!0}}:{}}}};function Wm(){return typeof window<"u"}function Xc(e){return fI(e)?(e.nodeName||"").toLowerCase():"#document"}function lr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bi(e){var t;return(t=(fI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fI(e){return Wm()?e instanceof Node||e instanceof lr(e).Node:!1}function Xs(e){return Wm()?e instanceof Element||e instanceof lr(e).Element:!1}function qo(e){return Wm()?e instanceof HTMLElement||e instanceof lr(e).HTMLElement:!1}function HC(e){return!Wm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lr(e).ShadowRoot}function Km(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Js(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function IV(e){return/^(table|td|th)$/.test(Xc(e))}function qm(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const NV=/transform|translate|scale|rotate|perspective|filter/,LV=/paint|layout|strict|content/,aa=e=>!!e&&e!=="none";let sy;function t_(e){const t=Xs(e)?Js(e):e;return aa(t.transform)||aa(t.translate)||aa(t.scale)||aa(t.rotate)||aa(t.perspective)||!n_()&&(aa(t.backdropFilter)||aa(t.filter))||NV.test(t.willChange||"")||LV.test(t.contain||"")}function DV(e){let t=Ha(e);for(;qo(t)&&!zd(t);){if(t_(t))return t;if(qm(t))return null;t=Ha(t)}return null}function n_(){return sy==null&&(sy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),sy}function zd(e){return/^(html|body|#document)$/.test(Xc(e))}function Js(e){return lr(e).getComputedStyle(e)}function Ym(e){return Xs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ha(e){if(Xc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||Bi(e);return HC(t)?t.host:t}function hI(e){const t=Ha(e);return zd(t)?(e.ownerDocument||e).body:qo(t)&&Km(t)?t:hI(t)}function Gd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=hI(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=lr(s);if(i){const a=r2(o);
114return t.concat(o,o.visualViewport||[],Km(s)?s:[],a&&n?Gd(a):[])}else return t.concat(s,Gd(s,[],n))}function r2(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pI(e){const t=Js(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=qo(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=Ig(n)!==i||Ig(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function r_(e){return Xs(e)?e:e.contextElement}function Ql(e){const t=r_(e);if(!qo(t))return Oi(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=pI(t);let o=(i?Ig(n.width):n.width)/r,a=(i?Ig(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const MV=Oi(0);function gI(e){const t=lr(e);return!n_()||!t.visualViewport?MV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UV(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===lr(e)}function Wa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=r_(e);let o=Oi(1);t&&(r?Xs(r)&&(o=Ql(r)):o=Ql(e));const a=UV(i,n,r)?gI(i):Oi(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,u=s.width/o.x,d=s.height/o.y;if(i&&r){const f=lr(i),g=Xs(r)?lr(r):r;let h=f,p=r2(h);for(;p&&g!==h;){const v=Ql(p),m=p.getBoundingClientRect(),S=Js(p),b=m.left+(p.clientLeft+parseFloat(S.paddingLeft))*v.x,w=m.top+(p.clientTop+parseFloat(S.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=b,c+=w,h=lr(p),p=r2(h)}}return Lg({width:u,height:d,x:l,y:c})}function Qm(e,t){const n=Ym(e).scrollLeft;return t?t.left+n:Wa(Bi(e)).left+n}function mI(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Qm(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function FV(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=Bi(r),a=t?qm(t.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Oi(1);const u=Oi(0),d=qo(r);if((d||!i)&&((Xc(r)!=="body"||Km(o))&&(l=Ym(r)),d)){const g=Wa(r);c=Ql(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const f=o&&!d&&!i?mI(o,l):Oi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function $V(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function jV(e){const t=Ym(e),n=e.ownerDocument.body,r=ki(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ki(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Qm(e);const o=-t.scrollTop;return Js(n).direction==="rtl"&&(i+=ki(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:o}}const VV=25;function BV(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=lr(e),i=Bi(e),o=s.visualViewport;let a=i.clientWidth,l=i.clientHeight,c=0,u=0;if(o){const f=!n_()||t==="fixed";r?f||(c=-o.offsetLeft,u=-o.offsetTop):(a=o.width,l=o.height,f&&(c=o.offsetLeft,u=o.offsetTop))}if(Qm(i)<=0){const f=i.ownerDocument,g=f.body,h=getComputedStyle(g),p=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(i.clientWidth-g.clientWidth-p),m=getComputedStyle(i).scrollbarGutter==="stable both-edges"?v/2:v;m<=VV&&(a-=m)}return{width:a,height:l,x:c,y:u}}function zV(e,t){const n=Wa(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Ql(e),o=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,c=r*i.y;return{width:o,height:a,x:l,y:c}}function WC(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=BV(e,n,t);else if(t==="document")r=jV(Bi(e));else if(Xs(t))r=zV(t,n);else{const s=gI(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Lg(r)}function GV(e,t){const n=t.get(e);if(n)return n;let r=Gd(e,[],!1).filter(a=>Xs(a)&&Xc(a)!=="body"),s=null;const i=Js(e).position==="fixed";let o=i?Ha(e):e;for(;Xs(o)&&!zd(o);){const a=Js(o),l=t_(o),c=s?s.position:i?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?r=r.filter(d=>d!==o):s=a,o=Ha(o)}return t.set(e,r),r}function HV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?qm(t)?[]:GV(t,this._c):[].concat(n),r],a=WC(t,o[0],s);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const g=WC(t,o[f],s);l=ki(g.top,l),c=Mo(g.right,c),u=Mo(g.bottom,u),d=ki(g.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function WV(e){const{width:t,height:n}=pI(e);return{width:t,height:n}}function KV(e,t,n){const r=qo(t),s=Bi(t),i=n==="fixed",o=Wa(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Oi(0);if((r||!i)&&((Xc(t)!=="body"||Km(s))&&(a=Ym(t)),r)){const f=Wa(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}!r&&s&&(l.x=Qm(s));const c=s&&!r&&!i?mI(s,a):Oi(0),u=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:o.width,height:o.height}}function iy(e){return Js(e).position==="static"}function KC(e,t){if(!qo(e)||Js(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bi(e)===n&&(n=n.ownerDocument.body),n}function vI(e,t){const n=lr(e);if(qm(e))return n;if(!qo(e)){let s=Ha(e);for(;s&&!zd(s);){if(Xs(s)&&!iy(s))return s;s=Ha(s)}return n}let r=KC(e,t);for(;r&&IV(r)&&iy(r);)r=KC(r,t);return r&&zd(r)&&iy(r)&&!t_(r)?n:r||DV(e)||n}const qV=async function(e){const t=this.getOffsetParent||vI,n=this.getDimensions,r=await n(e.floating);return{reference:KV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function YV(e){return Js(e).direction==="rtl"}const QV={convertOffsetParentRelativeRectToViewportRelativeRect:FV,getDocumentElement:Bi,getClippingRect:HV,getOffsetParent:vI,getElementRects:qV,getClientRects:$V,getDimensions:WV,getScale:Ql,isElement:Xs,isRTL:YV};function yI(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XV(e,t,n){let r=null,s;const i=Bi(e);function o(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function a(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:g,top:h,width:p,height:v}=f;if(u||t(),!p||!v)return;
114const m=Bh(h),S=Bh(i.clientWidth-(g+p)),b=Bh(i.clientHeight-(h+v)),w=Bh(g),C={rootMargin:-m+"px "+-S+"px "+-b+"px "+-w+"px",threshold:ki(0,Mo(1,d))||1};let E=!0;function x(R){const T=R[0].intersectionRatio;if(!yI(f,e.getBoundingClientRect()))return a();if(T!==d){if(!E)return a();T?a(!1,T):s=setTimeout(()=>{a(!1,1e-7)},1e3)}E=!1}try{r=new IntersectionObserver(x,{...C,root:i.ownerDocument})}catch{r=new IntersectionObserver(x,C)}r.observe(e)}const l=lr(e),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function JV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=r_(e),u=s||i?[...c?Gd(c):[],...t?Gd(t):[]]:[];u.forEach(m=>{s&&m.addEventListener("scroll",n),i&&m.addEventListener("resize",n)});const d=c&&a?XV(c,n,i):null;let f=-1,g=null;o&&(g=new ResizeObserver(m=>{let[S]=m;S&&S.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let h,p=l?Wa(e):null;l&&v();function v(){const m=Wa(e);p&&!yI(p,m)&&n(),p=m,h=requestAnimationFrame(v)}return n(),()=>{var m;u.forEach(S=>{s&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),d==null||d(),(m=g)==null||m.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const ZV=PV,eB=RV,tB=CV,nB=OV,rB=xV,qC=AV,sB=kV,iB=(e,t,n)=>{const r=new Map,s=n??{},i={...QV,...s.platform,_c:r};return EV(e,t,{...s,platform:i})};var oB=typeof document<"u",aB=function(){},Rp=oB?y.useLayoutEffect:aB;function Dg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Dg(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Dg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function SI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YC(e,t){const n=SI(e);return Math.round(t*n)/n}function oy(e){const t=y.useRef(e);return Rp(()=>{t.current=e}),t}function lB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=y.useState(r);Dg(f,r)||g(r);const[h,p]=y.useState(null),[v,m]=y.useState(null),S=y.useCallback(N=>{N!==C.current&&(C.current=N,p(N))},[]),b=y.useCallback(N=>{N!==E.current&&(E.current=N,m(N))},[]),w=i||h,A=o||v,C=y.useRef(null),E=y.useRef(null),x=y.useRef(u),R=l!=null,T=oy(l),P=oy(s),I=oy(c),U=y.useCallback(()=>{if(!C.current||!E.current)return;const N={placement:t,strategy:n,middleware:f};P.current&&(N.platform=P.current),iB(C.current,E.current,N).then(V=>{const k={...V,isPositioned:I.current!==!1};L.current&&!Dg(x.current,k)&&(x.current=k,ti.flushSync(()=>{d(k)}))})},[f,t,n,P,I]);Rp(()=>{c===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[c]);const L=y.useRef(!1);Rp(()=>(L.current=!0,()=>{L.current=!1}),[]),Rp(()=>{if(w&&(C.current=w),A&&(E.current=A),w&&A){if(T.current)return T.current(w,A,U);U()}},[w,A,U,T,R]);const z=y.useMemo(()=>({reference:C,floating:E,setReference:S,setFloating:b}),[S,b]),O=y.useMemo(()=>({reference:w,floating:A}),[w,A]),j=y.useMemo(()=>{const N={position:n,left:0,top:0};if(!O.floating)return N;const V=YC(O.floating,u.x),k=YC(O.floating,u.y);return a?{...N,transform:"translate("+V+"px, "+k+"px)",...SI(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:k}},[n,a,O.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:U,refs:z,elements:O,floatingStyles:j}),[u,U,z,O,j])}const cB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?qC({element:r.current,padding:s}).fn(n):{}:r?qC({element:r,padding:s}).fn(n):{}}}},uB=(e,t)=>{const n=ZV(e);return{name:n.name,fn:n.fn,options:[e,t]}},dB=(e,t)=>{const n=eB(e);return{name:n.name,fn:n.fn,options:[e,t]}},fB=(e,t)=>({fn:sB(e).fn,options:[e,t]}),hB=(e,t)=>{const n=tB(e);return{name:n.name,fn:n.fn,options:[e,t]}},pB=(e,t)=>{const n=nB(e);return{name:n.name,fn:n.fn,options:[e,t]}},gB=(e,t)=>{const n=rB(e);return{name:n.name,fn:n.fn,options:[e,t]}},mB=(e,t)=>{const n=cB(e);return{name:n.name,fn:n.fn,options:[e,t]}};var vB="Arrow",bI=y.forwardRef((e,t)=>
114{const{children:n,width:r=10,height:s=5,...i}=e;return _.jsx(ze.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});bI.displayName=vB;var yB=bI,s_="Popper",[_I,Jc]=qr(s_),[SB,wI]=_I(s_),EI=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null),[i,o]=y.useState(void 0);return _.jsx(SB,{scope:t,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:o,children:n})};EI.displayName=s_;var AI="PopperAnchor",CI=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=wI(AI,n),o=y.useRef(null),a=i.onAnchorChange,l=y.useCallback(h=>{o.current=h,h&&a(h)},[a]),c=st(t,l),u=y.useRef(null);y.useEffect(()=>{if(!r)return;const h=u.current;u.current=r.current,h!==u.current&&a(u.current)});const d=i.placementState&&o_(i.placementState),f=d==null?void 0:d[0],g=d==null?void 0:d[1];return r?null:_.jsx(ze.div,{"data-radix-popper-side":f,"data-radix-popper-align":g,...s,ref:c})});CI.displayName=AI;var i_="PopperContent",[bB,_B]=_I(i_),xI=y.forwardRef((e,t)=>{var ae,Ae,oe,K,G,Q;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:h,...p}=e,v=wI(i_,n),[m,S]=y.useState(null),b=st(t,S),[w,A]=y.useState(null),C=Um(w),E=(C==null?void 0:C.width)??0,x=(C==null?void 0:C.height)??0,R=r+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(c)?c:[c],I=P.length>0,U={padding:T,boundary:P.filter(EB),altBoundary:I},{refs:L,floatingStyles:z,placement:O,isPositioned:j,middlewareData:N}=lB({strategy:"fixed",placement:R,whileElementsMounted:(...Z)=>JV(...Z,{animationFrame:g==="always"}),elements:{reference:v.anchor}
114,middleware:[uB({mainAxis:s+x,alignmentAxis:o}),l&&dB({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?fB():void 0,...U}),l&&hB({...U}),pB({...U,apply:({elements:Z,rects:ee,availableWidth:ge,availableHeight:pe})=>{const{width:xe,height:Le}=ee.reference,Be=Z.floating.style;Be.setProperty("--radix-popper-available-width",`${ge}px`),Be.setProperty("--radix-popper-available-height",`${pe}px`),Be.setProperty("--radix-popper-anchor-width",`${xe}px`),Be.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),w&&mB({element:w,padding:a}),AB({arrowWidth:E,arrowHeight:x}),f&&gB({strategy:"referenceHidden",...U,boundary:I?U.boundary:void 0})]}),V=v.setPlacementState;un(()=>(V(O),()=>{V(void 0)}),[O,V]);const[k,$]=o_(O),M=Qs(h);un(()=>{j&&(M==null||M())},[j,M]);const B=(ae=N.arrow)==null?void 0:ae.x,H=(Ae=N.arrow)==null?void 0:Ae.y,X=((oe=N.arrow)==null?void 0:oe.centerOffset)!==0,[te,Y]=y.useState();return un(()=>{m&&Y(window.getComputedStyle(m).zIndex)},[m]),_.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:j?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(K=N.transformOrigin)==null?void 0:K.x,(G=N.transformOrigin)==null?void 0:G.y].join(" "),...((Q=N.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:_.jsx(bB,{scope:n,placedSide:k,placedAlign:$,onArrowChange:A,arrowX:B,arrowY:H,shouldHideArrow:X,children:_.jsx(ze.div,{"data-side":k,"data-align":$,...p,ref:b,style:{...p.style,animation:j?void 0:"none"}})})})});xI.displayName=i_;var TI="PopperArrow",wB={top:"bottom",right:"left",bottom:"top",left:"right"},PI=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=_B(TI,r),o=wB[i.placedSide];return _.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:_.jsx(yB,{...s,ref:n,style:{...s.style,display:"block"}})})});PI.displayName=TI;function EB(e){return e!==null}var AB=e=>({name:"transformOrigin",options:e,fn(t){var v,m,S;const{placement:n,rects:r,middlewareData:s}=t,o=((v=s.arrow)==null?void 0:v.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,u]=o_(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((m=s.arrow)==null?void 0:m.x)??0)+a/2,g=(((S=s.arrow)==null?void 0:S.y)??0)+l/2;let h="",p="";return c==="bottom"?(h=o?d:`${f}px`,p=`${-l}px`):c==="top"?(h=o?d:`${f}px`,p=`${r.floating.height+l}px`):c==="right"?(h=`${-l}px`,p=o?d:`${g}px`):c==="left"&&(h=`${r.floating.width+l}px`,p=o?d:`${g}px`),{data:{x:h,y:p}}}});function o_(e){const[t,n="center"]=e.split("-");return[t,n]}var RI=EI,Xm=CI,a_=xI,l_=PI,CB="Portal",Jm=y.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=y.useState(!1);un(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?ti.createPortal(_.jsx(ze.div,{...r,ref:t}),o):null});Jm.displayName=CB;var kI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xB="VisuallyHidden",OI=y.forwardRef((e,t)=>_.jsx(ze.span,{...e,ref:t,style:{...kI,...e.style}}));OI.displayName=xB;var TB=OI,PB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vl=new WeakMap,zh=new WeakMap,Gh={},ay=0,II=function(e){return e&&(e.host||II(e.parentNode))},RB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=II(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kB=function(e,t,n,r){var s=RB(t,Array.isArray(e)?e:[e]);Gh[n]||(Gh[n]=new WeakMap);var i=Gh[n],o=[],a=new Set,l=new Set(s),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};
vendor: 5,301 bytes, line 114
114s.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var g=f.getAttribute(r),h=g!==null&&g!=="false",p=(vl.get(f)||0)+1,v=(i.get(f)||0)+1;vl.set(f,p),i.set(f,v),o.push(f),p===1&&h&&zh.set(f,!0),v===1&&f.setAttribute(n,"true"),h||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return u(t),a.clear(),ay++,function(){o.forEach(function(d){var f=vl.get(d)-1,g=i.get(d)-1;vl.set(d,f),i.set(d,g),f||(zh.has(d)||d.removeAttribute(r),zh.delete(d)),g||d.removeAttribute(n)}),ay--,ay||(vl=new WeakMap,vl=new WeakMap,zh=new WeakMap,Gh={})}},c_=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=PB(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),kB(r,s,n,"aria-hidden")):function(){return null}},$s=function(){return $s=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},$s.apply(this,arguments)};function NI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function OB(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var kp="right-scroll-bar-position",Op="width-before-scroll-bar",IB="with-scroll-bars-hidden",NB="--removed-body-scroll-bar-size";function ly(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function LB(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var DB=typeof window<"u"?y.useLayoutEffect:y.useEffect,QC=new WeakMap;function MB(e,t){var n=LB(null,function(r){return e.forEach(function(s){return ly(s,r)})});return DB(function(){var r=QC.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(a){i.has(a)||ly(a,null)}),i.forEach(function(a){s.has(a)||ly(a,o)})}QC.set(n,e)},[e]),n}function UB(e){return e}function FB(e,t){t===void 0&&(t=UB);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var l=function(){var u=o;o=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return s}function $B(e){e===void 0&&(e={});var t=FB(null);return t.options=$s({async:!0,ssr:!1},e),t}var LI=function(e){var t=e.sideCar,n=NI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,$s({},n))};LI.isSideCarExport=!0;function jB(e,t){return e.useMedium(t),LI}var DI=$B(),cy=function(){},Zm=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:cy,onWheelCapture:cy,onTouchMoveCapture:cy}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,g=e.noRelative,h=e.noIsolation,p=e.inert,v=e.allowPinchZoom,m=e.as,S=m===void 0?"div":m,b=e.gapMode,w=NI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=f,C=MB([n,t]),E=$s($s({},w),s);return y.createElement(y.Fragment,null,u&&y.createElement(A,{sideCar:DI,removeScrollBar:c,shards:d,noRelative:g,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(a),$s($s({},E),{ref:C})):y.createElement(S,$s({},E,{className:l,ref:C}),a))});Zm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zm.classNames={fullWidth:Op,zeroRight:kp};var VB=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VB();return t&&e.setAttribute("nonce",t),e}function zB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function GB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BB())&&(zB(t,n),GB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WB=function(){var e=HB();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MI=function(){var e=WB(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t}
vendor: 4,190 bytes, lines 114-154
114,KB={left:0,top:0,right:0,gap:0},uy=function(e){return parseInt(e||"",10)||0},qB=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[uy(n),uy(r),uy(s)]},YB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return KB;var t=qB(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},QB=MI(),Xl="data-scroll-locked",XB=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),` 115 .`.concat(IB,` { 116 overflow: hidden `).concat(r,`; 117 padding-right: `).concat(a,"px ").concat(r,`; 118 } 119 body[`).concat(Xl,`] { 120 overflow: hidden `).concat(r,`; 121 overscroll-behavior: contain; 122 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 123 padding-left: `.concat(s,`px; 124 padding-top: `).concat(i,`px; 125 padding-right: `).concat(o,`px; 126 margin-left:0; 127 margin-top:0; 128 margin-right: `).concat(a,"px ").concat(r,`; 129 `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` 130 } 131 132 .`).concat(kp,` { 133 right: `).concat(a,"px ").concat(r,`; 134 } 135 136 .`).concat(Op,` { 137 margin-right: `).concat(a,"px ").concat(r,`; 138 } 139 140 .`).concat(kp," .").concat(kp,` { 141 right: 0 `).concat(r,`; 142 } 143 144 .`).concat(Op," .").concat(Op,` { 145 margin-right: 0 `).concat(r,`; 146 } 147 148 body[`).concat(Xl,`] { 149 `).concat(NB,": ").concat(a,`px; 150 } 151`)},XC=function(){var e=parseInt(document.body.getAttribute(Xl)||"0",10);return isFinite(e)?e:0},JB=function(){y.useEffect(function(){return document.body.setAttribute(Xl,(XC()+1).toString()),function(){var e=XC()-1;e<=0?document.body.removeAttribute(Xl):document.body.setAttribute(Xl,e.toString())}},[])},ZB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;JB();var i=y.useMemo(function(){return YB(s)},[s]);return y.createElement(QB,{styles:XB(i,!t,s,n?"":"!important")})},s2=!1;if(typeof window<"u")try{var Hh=Object.defineProperty({},"passive",{get:function(){return s2=!0,!0}});window.addEventListener("test",Hh,Hh),window.removeEventListener("test",Hh,Hh)}catch{s2=!1}var yl=s2?{passive:!1}:!1,ez=function(e){return e.tagName==="TEXTAREA"},UI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ez(e)&&n[t]==="visible")},tz=function(e){return UI(e,"overflowY")},nz=function(e){return UI(e,"overflowX")},JC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=FI(e,r);if(s){var i=$I(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},FI=function(e,t){return e==="v"?tz(t):nz(t)},$I=function(e,t){return e==="v"?rz(t):sz(t)},iz=function(e,t){return e==="h"&&t==="rtl"?-1:1},oz=function(e,t,n,r,s){var i=iz(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,l=t.contains(a),c=!1,u=o>0,d=0,f=0;do{if(!a)break;var g=$I(e,a),h=g[0],p=g[1],v=g[2],m=p-v-i*h;(h||m)&&FI(e,a)&&(d+=m,f+=h);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(f)<1||!s))&&(c=!0),c},Wh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZC=function(e){return[e.deltaX,e.deltaY]},ex=function(e){return e&&"current"in e?e.current:e},az=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lz=function(e){return` 152 .block-interactivity-`.concat(e,` {pointer-events: none;} 153 .allow-interactivity-`).concat(e,` {pointer-events: all;} 154`)},cz=0,Sl=[];function uz(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(cz++)[0],i=y.useState(MI)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));
154var p=OB([e.lockRef.current],(e.shards||[]).map(ex),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=y.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var m=Wh(p),S=n.current,b="deltaX"in p?p.deltaX:S[0]-m[0],w="deltaY"in p?p.deltaY:S[1]-m[1],A,C=p.target,E=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in p&&E==="h"&&C.type==="range")return!1;var x=window.getSelection(),R=x&&x.anchorNode,T=R?R===C||R.contains(C):!1;if(T)return!1;var P=JC(E,C);if(!P)return!0;if(P?A=E:(A=E==="v"?"h":"v",P=JC(E,C)),!P)return!1;if(!r.current&&"changedTouches"in p&&(b||w)&&(r.current=A),!A)return!0;var I=r.current||A;return oz(I,v,p,I==="h"?b:w,!0)},[]),l=y.useCallback(function(p){var v=p;if(!(!Sl.length||Sl[Sl.length-1]!==i)){var m="deltaY"in v?ZC(v):Wh(v),S=t.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&az(A.delta,m)})[0];if(S&&S.should){v.cancelable&&v.preventDefault();return}if(!S){var b=(o.current.shards||[]).map(ex).filter(Boolean).filter(function(A){return A.contains(v.target)}),w=b.length>0?a(v,b[0]):!o.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),c=y.useCallback(function(p,v,m,S){var b={name:p,delta:v,target:m,should:S,shadowParent:dz(m)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),u=y.useCallback(function(p){n.current=Wh(p),r.current=void 0},[]),d=y.useCallback(function(p){c(p.type,ZC(p),p.target,a(p,e.lockRef.current))},[]),f=y.useCallback(function(p){c(p.type,Wh(p),p.target,a(p,e.lockRef.current))},[]);y.useEffect(function(){return Sl.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,yl),document.addEventListener("touchmove",l,yl),document.addEventListener("touchstart",u,yl),function(){Sl=Sl.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,yl),document.removeEventListener("touchmove",l,yl),document.removeEventListener("touchstart",u,yl)}},[]);var g=e.removeScrollBar,h=e.inert;return y.createElement(y.Fragment,null,h?y.createElement(i,{styles:lz(s)}):null,g?y.createElement(ZB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fz=jB(DI,uz);var ev=y.forwardRef(function(e,t){return y.createElement(Zm,$s({},e,{ref:t,sideCar:fz}))});ev.classNames=Zm.classNames;var hz=[" ","Enter","ArrowUp","ArrowDown"],pz=[" ","Enter"],Ka="Select",[tv,nv,gz]=jO(Ka),[sl,qge]=qr(Ka,[gz,Jc]),rv=Jc(),[mz,Yo]=sl(Ka),[vz,yz]=sl(Ka),Sz="SelectProvider";function jI(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:g,form:h,internal_do_not_use_render:p}=e,v=rv(t),[m,S]=y.useState(null),[b,w]=y.useState(null),[A,C]=y.useState(!1),E=jm(c),[x,R]=Ui({prop:r,defaultProp:s??!1,onChange:i,caller:Ka}),[T,P]=Ui({prop:o,defaultProp:a,onChange:l,caller:Ka}),I=y.useRef(null),U=y.useRef(T);y.useEffect(()=>{const M=h?m==null?void 0:m.ownerDocument.getElementById(h):m==null?void 0:m.form;if(M instanceof HTMLFormElement){const B=()=>P(U.current);return M.addEventListener("reset",B),()=>M.removeEventListener("reset",B)}},[h,m,P]);const L=m?!!h||!!m.closest("form"):!0,[z,O]=y.useState(new Set),j=Ri(),N=Array.from(z).map(M=>M.props.value).join(";"),V=y.useCallback(M=>{O(B=>new Set(B).add(M))},[]),k=y.useCallback(M=>{O(B=>{const H=new Set(B);return H.delete(M),H})},[]),$={required:g,trigger:m,onTriggerChange:S,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:A,onValueNodeHasChildrenChange:C,contentId:j,value:T,onValueChange:P,open:x,onOpenChange:R,dir:E,triggerPointerDownPosRef:I,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:z,nativeSelectKey:N,isFormControl:L};return _.jsx(RI,{...v,children:_.jsx(mz,{scope:t,...$,children:_.jsx(tv.Provider,{scope:t,children:_.jsx(vz,{scope:t,onNativeOptionAdd:V,onNativeOptionRemove:k,children:Lz(p)?p($):n})})})})}jI.displayName=Sz;var VI=e=>{const{__scopeSelect:t,children:n,...r}=e;return _.jsx(jI,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:s})=>_.jsxs(_.Fragment,{children:[n,s?_.jsx(l3,{__scopeSelect:t}):null]})})};VI.displayName=Ka;var BI="SelectTrigger",u_=y.forwardRef((e,t)=>
154{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=rv(n),o=Yo(BI,n),a=o.disabled||r,l=st(t,o.onTriggerChange),c=nv(n),u=y.useRef("touch"),[d,f,g]=c3(p=>{const v=c().filter(b=>!b.disabled),m=v.find(b=>b.value===o.value),S=u3(v,p,m);S!==void 0&&o.onValueChange(S.value)}),h=p=>{a||(o.onOpenChange(!0),g()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return _.jsx(Xm,{asChild:!0,...i,children:_.jsx(ze.button,{type:"button",role:"combobox","aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":sv(o.value)?"":void 0,...s,ref:l,onClick:Ve(s.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&h(p)}),onPointerDown:Ve(s.onPointerDown,p=>{u.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(h(p),p.preventDefault())}),onKeyDown:Ve(s.onKeyDown,p=>{const v=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(v&&p.key===" ")&&hz.includes(p.key)&&(h(),p.preventDefault())})})})});u_.displayName=BI;var zI="SelectValue",GI=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:o="",...a}=e,l=Yo(zI,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=st(t,l.onValueNodeChange);un(()=>{c(u)},[c,u]);const f=sv(l.value);return _.jsx(ze.span,{...a,asChild:f?!1:a.asChild,ref:d,style:{pointerEvents:"none"},children:_.jsx(y.Fragment,{children:f?o:i},f?"placeholder":"value")})});GI.displayName=zI;var bz="SelectIcon",HI=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return _.jsx(ze.span,{"aria-hidden":!0,...s,ref:t,children:r||"â¼"})});HI.displayName=bz;var WI="SelectPortal",[_z,wz]=sl(WI,{forceMount:void 0}),KI=e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return _.jsx(_z,{scope:e.__scopeSelect,forceMount:n,children:_.jsx(Jm,{asChild:!0,...r})})};KI.displayName=WI;var Fo="SelectContent",d_=y.forwardRef((e,t)=>{const n=wz(Fo,e.__scopeSelect),{forceMount:r=n.forceMount,...s}=e,i=Yo(Fo,e.__scopeSelect),[o,a]=y.useState();return un(()=>{a(new DocumentFragment)},[]),_.jsx(bs,{present:r||i.open,children:({present:l})=>l?_.jsx(QI,{...s,ref:t}):_.jsx(qI,{...s,fragment:o})})});d_.displayName=Fo;var qI=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,fragment:s}=e;return s?ti.createPortal(_.jsx(YI,{scope:n,children:_.jsx(tv.Slot,{scope:n,children:_.jsx("div",{ref:t,children:r})})}),s):null});qI.displayName="SelectContentFragment";var ss=10,[YI,Qo]=sl(Fo),Ez="SelectContentImpl",Az=Oc("SelectContent.RemoveScroll"),QI=y.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:p,avoidCollisions:v,...m}=e,S=Yo(Fo,n),[b,w]=y.useState(null),[A,C]=y.useState(null),E=st(t,w),[x,R]=y.useState(null),[T,P]=y.useState(null),I=nv(n),[U,L]=y.useState(!1),z=y.useRef(!1);y.useEffect(()=>{if(b)return c_(b)},[b]),Xb();const O=y.useCallback(Y=>{const[ae,...Ae]=I().map(G=>G.ref.current),[oe]=Ae.slice(-1),K=document.activeElement;for(const G of Y)if(G===K||(G==null||G.scrollIntoView({block:"nearest"}),G===ae&&A&&(A.scrollTop=0),G===oe&&A&&(A.scrollTop=A.scrollHeight),G==null||G.focus(),document.activeElement!==K))return},[I,A]),j=y.useCallback(()=>O([x,b]),[O,x,b]);y.useEffect(()=>{U&&j()},[U,j]);const{onOpenChange:N,triggerPointerDownPosRef:V}=S;y.useEffect(()=>{if(b){let Y={x:0,y:0};const ae=oe=>{var K,G;Y={x:Math.abs(Math.round(oe.pageX)-(((K=V.current)==null?void 0:K.x)??0)),y:Math.abs(Math.round(oe.pageY)-(((G=V.current)==null?void 0:G.y)??0))}},Ae=oe=>{Y.x<=10&&Y.y<=10?oe.preventDefault():oe.composedPath().includes(b)||N(!1),document.removeEventListener("pointermove",ae),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[b,N,V]),y.useEffect(()=>{const Y=()=>N(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}}
154,[N]);const[k,$]=c3(Y=>{const ae=I().filter(K=>!K.disabled),Ae=ae.find(K=>K.ref.current===document.activeElement),oe=u3(ae,Y,Ae);oe&&setTimeout(()=>{var K;return(K=oe.ref.current)==null?void 0:K.focus()})}),M=y.useCallback((Y,ae,Ae)=>{const oe=!z.current&&!Ae;(S.value!==void 0&&S.value===ae||oe)&&(R(Y),oe&&(z.current=!0))},[S.value]),B=y.useCallback(()=>b==null?void 0:b.focus(),[b]),H=y.useCallback((Y,ae,Ae)=>{const oe=!z.current&&!Ae;(S.value!==void 0&&S.value===ae||oe)&&P(Y)},[S.value]),X=r==="popper"?i2:XI,te=X===i2?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:p,avoidCollisions:v}:{};return _.jsx(YI,{scope:n,content:b,viewport:A,onViewportChange:C,itemRefCallback:M,selectedItem:x,onItemLeave:B,itemTextRefCallback:H,focusSelectedItem:j,selectedItemText:T,position:r,isPositioned:U,searchRef:k,children:_.jsx(ev,{as:Az,allowPinchZoom:!0,children:_.jsx(Hm,{asChild:!0,trapped:S.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Ve(s,Y=>{var ae;(ae=S.trigger)==null||ae.focus({preventScroll:!0}),Y.preventDefault()}),children:_.jsx(jf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:_.jsx(X,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:Y=>Y.preventDefault(),...m,...te,onPlaced:()=>L(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:Ve(m.onKeyDown,Y=>{const ae=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ae&&Y.key.length===1&&$(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let oe=I().filter(K=>!K.disabled).map(K=>K.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(oe=oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const K=Y.target,G=oe.indexOf(K);oe=oe.slice(G+1)}setTimeout(()=>O(oe)),Y.preventDefault()}})})})})})})});QI.displayName=Ez;var Cz="SelectItemAlignedPosition",XI=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Yo(Fo,n),o=Qo(Fo,n),[a,l]=y.useState(null),[c,u]=y.useState(null),d=st(t,u),f=nv(n),g=y.useRef(!1),h=y.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:m,focusSelectedItem:S}=o,b=y.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&p&&v&&m){const E=i.trigger.getBoundingClientRect(),x=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),T=m.getBoundingClientRect();if(i.dir!=="rtl"){const K=T.left-x.left,G=R.left-K,Q=E.left-G,Z=E.width+Q,ee=Math.max(Z,x.width),ge=window.innerWidth-ss,pe=IC(G,[ss,Math.max(ss,ge-ee)]);a.style.minWidth=Z+"px",a.style.left=pe+"px"}else{const K=x.right-T.right,G=window.innerWidth-R.right-K,Q=window.innerWidth-E.right-G,Z=E.width+Q,ee=Math.max(Z,x.width),ge=window.innerWidth-ss,pe=IC(G,[ss,Math.max(ss,ge-ee)]);a.style.minWidth=Z+"px",a.style.right=pe+"px"}const P=f(),I=window.innerHeight-ss*2,U=p.scrollHeight,L=window.getComputedStyle(c),z=parseInt(L.borderTopWidth,10),O=parseInt(L.paddingTop,10),j=parseInt(L.borderBottomWidth,10),N=parseInt(L.paddingBottom,10),V=z+O+U+N+j,k=Math.min(v.offsetHeight*5,V),$=window.getComputedStyle(p),M=parseInt($.paddingTop,10),B=parseInt($.paddingBottom,10),H=E.top+E.height/2-ss,X=I-H,te=v.offsetHeight/2,Y=v.offsetTop+te,ae=z+O+Y,Ae=V-ae;if(ae<=H){const K=P.length>0&&v===P[P.length-1].ref.current;a.style.bottom="0px";const G=c.clientHeight-p.offsetTop-p.offsetHeight,Q=Math.max(X,te+(K?B:0)+G+j),Z=ae+Q;a.style.height=Z+"px"}else{const K=P.length>0&&v===P[0].ref.current;a.style.top="0px";const Q=Math.max(H,z+p.offsetTop+(K?M:0)+te)+Ae;a.style.height=Q+"px",p.scrollTop=ae-H+p.offsetTop}a.style.margin=`${ss}px 0`,a.style.minHeight=k+"px",a.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,i.trigger,i.valueNode,a,c,p,v,m,i.dir,r]);un(()=>b(),[b]);const[w,A]=y.useState();un(()=>{c&&A(window.getComputedStyle(c).zIndex)},[c]);const C=y.useCallback(E=>
154{E&&h.current===!0&&(b(),S==null||S(),h.current=!1)},[b,S]);return _.jsx(Tz,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:_.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:_.jsx(ze.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});XI.displayName=Cz;var xz="SelectPopperPosition",i2=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ss,...i}=e,o=rv(n);return _.jsx(a_,{...o,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});i2.displayName=xz;var[Tz,f_]=sl(Fo,{}),o2="SelectViewport",JI=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Qo(o2,n),o=f_(o2,n),a=st(t,i.onViewportChange),l=y.useRef(0);return _.jsxs(_.Fragment,{children:[_.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),_.jsx(tv.Slot,{scope:n,children:_.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ve(s.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(l.current-u.scrollTop);if(g>0){const h=window.innerHeight-ss*2,p=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),m=Math.max(p,v);if(m<h){const S=m+g,b=Math.min(h,S),w=S-b;d.style.height=b+"px",d.style.bottom==="0px"&&(u.scrollTop=w>0?w:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});JI.displayName=o2;var ZI="SelectGroup",[Pz,Rz]=sl(ZI),kz=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ri();return _.jsx(Pz,{scope:n,id:s,children:_.jsx(ze.div,{role:"group","aria-labelledby":s,...r,ref:t})})});kz.displayName=ZI;var e3="SelectLabel",h_=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Rz(e3,n);return _.jsx(ze.div,{id:s.id,...r,ref:t})});h_.displayName=e3;var Mg="SelectItem",[Oz,t3]=sl(Mg),p_=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...o}=e,a=Yo(Mg,n),l=Qo(Mg,n),c=a.value===r,[u,d]=y.useState(i??""),[f,g]=y.useState(!1),h=Qs(b=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,b,r,s)}),p=st(t,h),v=Ri(),m=y.useRef("touch"),S=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};return _.jsx(Oz,{scope:n,value:r,disabled:s,textId:v,isSelected:c,onItemTextChange:y.useCallback(b=>{d(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:_.jsx(tv.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:_.jsx(ze.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:p,onFocus:Ve(o.onFocus,()=>g(!0)),onBlur:Ve(o.onBlur,()=>g(!1)),onClick:Ve(o.onClick,()=>{m.current!=="mouse"&&S()}),onPointerUp:Ve(o.onPointerUp,()=>{m.current==="mouse"&&S()}),onPointerDown:Ve(o.onPointerDown,b=>{m.current=b.pointerType}),onPointerMove:Ve(o.onPointerMove,b=>{var w;m.current=b.pointerType,s?(w=l.onItemLeave)==null||w.call(l):m.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ve(o.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:Ve(o.onKeyDown,b=>{var A;s||b.target!==b.currentTarget||((A=l.searchRef)==null?void 0:A.current)!==""&&b.key===" "||(pz.includes(b.key)&&S(),b.key===" "&&b.preventDefault())})})})})});p_.displayName=Mg;var Xu="SelectItemText",n3=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,o=Yo(Xu,n),a=Qo(Xu,n),l=t3(Xu,n),c=yz(Xu,n),[u,d]=y.useState(null),f=Qs(S=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,S,l.value,l.disabled)}),g=st(t,d,l.onItemTextChange,f),h=u==null?void 0:u.textContent,p=y.useMemo(()=>_.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:m}=c;return un(()=>(v(p),()=>m(p)),[v,m,p]),_.jsxs(_.Fragment,{children:[_.jsx(ze.span,{id:l.textId,...i,ref:g}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!sv(o.value)?ti.createPortal(i.children,o.valueNode):null]})});
154n3.displayName=Xu;var r3="SelectItemIndicator",s3=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return t3(r3,n).isSelected?_.jsx(ze.span,{"aria-hidden":!0,...r,ref:t}):null});s3.displayName=r3;var a2="SelectScrollUpButton",g_=y.forwardRef((e,t)=>{const n=Qo(a2,e.__scopeSelect),r=f_(a2,e.__scopeSelect),[s,i]=y.useState(!1),o=st(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(i3,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});g_.displayName=a2;var l2="SelectScrollDownButton",m_=y.forwardRef((e,t)=>{const n=Qo(l2,e.__scopeSelect),r=f_(l2,e.__scopeSelect),[s,i]=y.useState(!1),o=st(t,r.onScrollButtonChange);return un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?_.jsx(i3,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});m_.displayName=l2;var i3=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Qo("SelectScrollButton",n),o=y.useRef(null),a=nv(n),l=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),un(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),_.jsx(ze.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ve(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ve(s.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ve(s.onPointerLeave,()=>{l()})})}),Iz="SelectSeparator",v_=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _.jsx(ze.div,{"aria-hidden":!0,...r,ref:t})});v_.displayName=Iz;var o3="SelectArrow",Nz=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=rv(n);return Qo(o3,n).position==="popper"?_.jsx(l_,{...s,...r,ref:t}):null});Nz.displayName=o3;var a3="SelectBubbleInput",l3=y.forwardRef(({__scopeSelect:e,...t},n)=>{const r=Yo(a3,e),{value:s,onValueChange:i,required:o,disabled:a,name:l,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,g=y.useRef(null),h=st(n,g),p=s??"",v=Mm(p),m=Array.from(d).some(S=>(S.props.value??"")==="");return y.useEffect(()=>{const S=g.current;if(!S)return;const b=window.HTMLSelectElement.prototype,A=Object.getOwnPropertyDescriptor(b,"value").set;if(v!==p&&A){const C=new Event("change",{bubbles:!0});A.call(S,p),S.dispatchEvent(C)}},[v,p]),_.jsxs(ze.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:c,disabled:a,form:u,onChange:S=>i(S.target.value),...t,style:{...kI,...t.style},ref:h,defaultValue:p,children:[sv(s)&&!m?_.jsx("option",{value:""}):null,Array.from(d)]},f)});l3.displayName=a3;function Lz(e){return typeof e=="function"}function sv(e){return e===""||e===void 0}function c3(e){const t=Qs(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(o=>{const a=n.current+o;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function u3(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Dz(e,Math.max(i,0));s.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function Dz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var iv="Switch",[Mz,Yge]=qr(iv),[Uz,y_]=Mz(iv);function Fz(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:s,disabled:i,form:o,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,g]=Ui({prop:n,defaultProp:s??!1,onChange:l,caller:iv}),[h,p]=y.useState(null),[v,m]=y.useState(null),S=y.useRef(!1),b=h?!!o||!!h.closest("form"):!0,w={checked:f,setChecked:g,disabled:i,control:h,setControl:p,name:a,form:o,value:u,hasConsumerStoppedPropagationRef:S,required:c,defaultChecked:s,isFormControl:b,bubbleInput:v,setBubbleInput:m};return _.jsx(Uz,{scope:t,...w,children:$z(d)?d(w):r})}var d3="SwitchTrigger",f3=y.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{const{control:s,form:i,value:o,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:g,bubbleInput:h}=y_(d3,e),p=st(r,u),v=y.useRef(l);return y.useEffect(()=>{const m=i?s==null?void 0:s.ownerDocument.getElementById(i):s==null?void 0:s.form;if(m instanceof HTMLFormElement){const S=()=>d(v.current);return m.addEventListener("reset",S),()=>m.removeEventListener("reset",S)}},[s,i,d]),_.jsx(ze.button,{type:"button",role:"switch","aria-checked":l,"aria-required":c,"data-state":v3(l),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:p,onClick:Ve(t,m=>{d(S=>!S),h&&g&&(f.current=m.isPropagationStopped(),f.current||m.stopPropagation())})})});f3.displayName=d3;var S_=y.forwardRef((e,t)=>
154{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return _.jsx(Fz,{__scopeSwitch:n,checked:s,defaultChecked:i,disabled:a,required:o,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:f})=>_.jsxs(_.Fragment,{children:[_.jsx(f3,{...d,ref:t,__scopeSwitch:n}),f&&_.jsx(m3,{__scopeSwitch:n})]})})});S_.displayName=iv;var h3="SwitchThumb",p3=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=y_(h3,n);return _.jsx(ze.span,{"data-state":v3(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});p3.displayName=h3;var g3="SwitchBubbleInput",m3=y.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:o,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:f,setBubbleInput:g}=y_(g3,e),h=st(n,g),p=Mm(i),v=Um(r);y.useEffect(()=>{const S=f;if(!S)return;const b=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(b,"checked").set,C=!s.current;if(p!==i&&A){const E=new Event("click",{bubbles:C});A.call(S,i),S.dispatchEvent(E)}},[f,p,i,s]);const m=y.useRef(i);return _.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??m.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:h,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});m3.displayName=g3;function $z(e){return typeof e=="function"}function v3(e){return e?"checked":"unchecked"}var jz="Label",y3=y.forwardRef((e,t)=>_.jsx(ze.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));y3.displayName=jz;var S3=y3,Vz="Separator",tx="horizontal",Bz=["horizontal","vertical"],b3=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=tx,...s}=e,i=zz(r)?r:tx,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return _.jsx(ze.div,{"data-orientation":i,...a,...s,ref:t})});b3.displayName=Vz;function zz(e){return Bz.includes(e)}var _3=b3,ov="Tabs",[Gz,Qge]=qr(ov,[Vm]),w3=Vm(),[Hz,b_]=Gz(ov),Wz=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=jm(a),[d,f]=Ui({prop:r,onChange:s,defaultProp:i??"",caller:ov});return _.jsx(Hz,{scope:n,baseId:Ri(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:l,children:_.jsx(ze.div,{dir:u,"data-orientation":o,...c,ref:t})})});Wz.displayName=ov;var E3="TabsList",A3=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=b_(E3,n),o=w3(n);return _.jsx(KO,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:_.jsx(ze.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});A3.displayName=E3;var C3="TabsTrigger",x3=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,o=b_(C3,n),a=w3(n),l=R3(o.baseId,r),c=k3(o.baseId,r),u=r===o.value;return _.jsx(qO,{asChild:!0,...a,focusable:!s,active:u,children:_.jsx(ze.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...i,ref:t,onMouseDown:Ve(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?o.onValueChange(r):d.preventDefault()}),onKeyDown:Ve(e.onKeyDown,d=>{s||d.target!==d.currentTarget||[" ","Enter"].includes(d.key)&&o.onValueChange(r)}),onFocus:Ve(e.onFocus,()=>{const d=o.activationMode!=="manual";!u&&!s&&d&&o.onValueChange(r)})})})});x3.displayName=C3;var T3="TabsContent",P3=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...o}=e,a=b_(T3,n),l=R3(a.baseId,r),c=k3(a.baseId,r),u=r===a.value,d=y.useRef(u);return y.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),_.jsx(bs,{present:s||u,children:({present:f})=>_.jsx(ze.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});P3.displayName=T3;function R3(e,t){return`${e}-trigger-${t}`}function k3(e,t){return`${e}-content-${t}`}var O3=A3,I3=x3,N3=P3;function Vf(e,t=[]){let n=[];function r(i,o){const a=y.createContext(o),l=n.length;n=[...n,o];const c=d=>{var m;const{scope:f,children:g,...h}=d,p=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,v=y.useMemo(()=>h,Object.values(h));return _.jsx(p.Provider,{value:v,children:g})};c.displayName=i+"Provider";function u(d,f){var p;const g=((p=f==null?void 0:f[e])==null?void 0:p[l])||a,h=y.useContext(g);if(h)return h;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const s=()=>{const i=n.map(o=>y.createContext(o));return function(a){const l=(a==null?void 0:a[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,Kz(s,...t)]}function Kz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c}
154)=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function av(e){const t=e+"CollectionProvider",[n,r]=Vf(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:v,children:m}=p,S=me.useRef(null),b=me.useRef(new Map).current;return _.jsx(s,{scope:v,itemMap:b,collectionRef:S,children:m})};o.displayName=t;const a=e+"CollectionSlot",l=Og(a),c=me.forwardRef((p,v)=>{const{scope:m,children:S}=p,b=i(a,m),w=ur(v,b.collectionRef);return _.jsx(l,{ref:w,children:S})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=Og(u),g=me.forwardRef((p,v)=>{const{scope:m,children:S,...b}=p,w=me.useRef(null),A=ur(v,w),C=i(u,m);return me.useEffect(()=>(C.itemMap.set(w,{ref:w,...b}),()=>void C.itemMap.delete(w))),_.jsx(f,{[d]:"",ref:A,children:S})});g.displayName=u;function h(p){const v=i(e+"CollectionConsumer",p);return me.useCallback(()=>{const S=v.collectionRef.current;if(!S)return[];const b=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((C,E)=>b.indexOf(C.ref.current)-b.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:g},h,r]}function lt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var Zs=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},qz=ji[" useInsertionEffect ".trim().toString()]||Zs;function Zc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=Yz({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const u=y.useRef(e!==void 0);y.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=y.useCallback(u=>{var d;if(a){const f=Qz(u)?u(e):u;f!==e&&((d=o.current)==null||d.call(o,f))}else i(u)},[a,e,i,o]);return[l,c]}function Yz({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),i=y.useRef(t);return qz(()=>{i.current=t},[t]),y.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function Qz(e){return typeof e=="function"}var Xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bt=Xz.reduce((e,t)=>{const n=Og(`Primitive.${t}`),r=y.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ug(e,t){e&&ti.flushSync(()=>e.dispatchEvent(t))}function Jz(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var il=e=>{const{present:t,children:n}=e,r=Zz(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=ur(r.ref,eG(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:i}):null};il.displayName="Presence";function Zz(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),i=y.useRef("none"),o=e?"mounted":"unmounted",[a,l]=Jz(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Kh(r.current);i.current=a==="mounted"?c:"none"},[a]),Zs(()=>{const c=r.current,u=s.current;if(u!==e){const f=i.current,g=Kh(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Zs(()=>
154{if(t){let c;const u=t.ownerDocument.defaultView??window,d=g=>{const p=Kh(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&p&&(l("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(i.current=Kh(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Kh(e){return(e==null?void 0:e.animationName)||"none"}function eG(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tG=ji[" useId ".trim().toString()]||(()=>{}),nG=0;function lv(e){const[t,n]=y.useState(tG());return Zs(()=>{n(r=>r??String(nG++))},[e]),t?`radix-${t}`:""}var cv="Collapsible",[rG,L3]=Vf(cv),[sG,__]=rG(cv),D3=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=e,[l,c]=Zc({prop:r,defaultProp:s??!1,onChange:o,caller:cv});return _.jsx(sG,{scope:n,disabled:i,contentId:lv(),open:l,onOpenToggle:y.useCallback(()=>c(u=>!u),[c]),children:_.jsx(bt.div,{"data-state":E_(l),"data-disabled":i?"":void 0,...a,ref:t})})});D3.displayName=cv;var M3="CollapsibleTrigger",U3=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=__(M3,n);return _.jsx(bt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":E_(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:lt(e.onClick,s.onOpenToggle)})});U3.displayName=M3;var w_="CollapsibleContent",F3=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=__(w_,e.__scopeCollapsible);return _.jsx(il,{present:n||s.open,children:({present:i})=>_.jsx(iG,{...r,ref:t,present:i})})});F3.displayName=w_;var iG=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=__(w_,n),[a,l]=y.useState(r),c=y.useRef(null),u=ur(t,c),d=y.useRef(0),f=d.current,g=y.useRef(0),h=g.current,p=o.open||a,v=y.useRef(p),m=y.useRef(void 0);return y.useEffect(()=>{const S=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(S)},[]),Zs(()=>{const S=c.current;if(S){m.current=m.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const b=S.getBoundingClientRect();d.current=b.height,g.current=b.width,v.current||(S.style.transitionDuration=m.current.transitionDuration,S.style.animationName=m.current.animationName),l(r)}},[o.open,r]),_.jsx(bt.div,{"data-state":E_(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!p,...i,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:p&&s})});function E_(e){return e?"open":"closed"}var oG=D3,aG=U3,lG=F3,cG=y.createContext(void 0);function $3(e){const t=y.useContext(cG);return e||t||"ltr"}var _s="Accordion",uG=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[A_,dG,fG]=av(_s),[uv,Xge]=Vf(_s,[fG,L3]),C_=L3(),hG=me.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return _.jsx(A_.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?_.jsx(vG,{...i,ref:t}):_.jsx(mG,{...s,ref:t})})});hG.displayName=_s;var[j3,pG]=uv(_s),[V3,gG]=uv(_s,{collapsible:!1}),mG=me.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=e,[a,l]=Zc({prop:n,defaultProp:r??"",onChange:s,caller:_s});return _.jsx(j3,{scope:e.__scopeAccordion,value:me.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:me.useCallback(()=>i&&l(""),[i,l]),children:_.jsx(V3,{scope:e.__scopeAccordion,collapsible:i,children:_.jsx(B3,{...o,ref:t})})})}),vG=me.forwardRef((e,t)=>
154{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o,a]=Zc({prop:n,defaultProp:r??[],onChange:s,caller:_s}),l=me.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=me.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return _.jsx(j3,{scope:e.__scopeAccordion,value:o,onItemOpen:l,onItemClose:c,children:_.jsx(V3,{scope:e.__scopeAccordion,collapsible:!0,children:_.jsx(B3,{...i,ref:t})})})}),[yG,dv]=uv(_s),B3=me.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=e,a=me.useRef(null),l=ur(a,t),c=dG(n),d=$3(s)==="ltr",f=lt(e.onKeyDown,g=>{var x;if(!uG.includes(g.key))return;const h=g.target,p=c().filter(R=>{var T;return!((T=R.ref.current)!=null&&T.disabled)}),v=p.findIndex(R=>R.ref.current===h),m=p.length;if(v===-1)return;g.preventDefault();let S=v;const b=0,w=m-1,A=()=>{S=v+1,S>w&&(S=b)},C=()=>{S=v-1,S<b&&(S=w)};switch(g.key){case"Home":S=b;break;case"End":S=w;break;case"ArrowRight":i==="horizontal"&&(d?A():C());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(d?C():A());break;case"ArrowUp":i==="vertical"&&C();break}const E=S%m;(x=p[E].ref.current)==null||x.focus()});return _.jsx(yG,{scope:n,disabled:r,direction:s,orientation:i,children:_.jsx(A_.Slot,{scope:n,children:_.jsx(bt.div,{...o,"data-orientation":i,ref:l,onKeyDown:r?void 0:f})})})}),Fg="AccordionItem",[SG,x_]=uv(Fg),z3=me.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=dv(Fg,n),o=pG(Fg,n),a=C_(n),l=lv(),c=r&&o.value.includes(r)||!1,u=i.disabled||e.disabled;return _.jsx(SG,{scope:n,open:c,disabled:u,triggerId:l,children:_.jsx(oG,{"data-orientation":i.orientation,"data-state":Y3(c),...a,...s,ref:t,disabled:u,open:c,onOpenChange:d=>{d?o.onItemOpen(r):o.onItemClose(r)}})})});z3.displayName=Fg;var G3="AccordionHeader",H3=me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=dv(_s,n),i=x_(G3,n);return _.jsx(bt.h3,{"data-orientation":s.orientation,"data-state":Y3(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});H3.displayName=G3;var c2="AccordionTrigger",W3=me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=dv(_s,n),i=x_(c2,n),o=gG(c2,n),a=C_(n);return _.jsx(A_.ItemSlot,{scope:n,children:_.jsx(aG,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:t})})});W3.displayName=c2;var K3="AccordionContent",q3=me.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=dv(_s,n),i=x_(K3,n),o=C_(n);return _.jsx(lG,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});q3.displayName=K3;function Y3(e){return e?"open":"closed"}var bG=z3,_G=H3,Q3=W3,X3=q3;function wG(e){return Object.prototype.toString.call(e)==="[object Object]"}function nx(e){return wG(e)||Array.isArray(e)}function EG(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function T_(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==i?!1:n.every(o=>{const a=e[o],l=t[o];return typeof a=="function"?`${a}`==`${l}`:!nx(a)||!nx(l)?a===l:T_(a,l)})}function rx(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function AG(e,t){if(e.length!==t.length)return!1;const n=rx(e),r=rx(t);return n.every((s,i)=>{const o=r[i];return T_(s,o)})}function P_(e){return typeof e=="number"}function u2(e){return typeof e=="string"}function fv(e){return typeof e=="boolean"}function sx(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ft(e){return Math.abs(e)}function R_(e){return Math.sign(e)}function md(e,t){return Ft(e-t)}function CG(e,t){if(e===0||t===0||Ft(e)<=Ft(t))return 0;const n=md(Ft(e),Ft(t));return Ft(n/e)}function xG(e){return Math.round(e*100)/100}function Hd(e){return Wd(e).map(Number)}function gs(e){return e[Bf(e)]}function Bf(e){return Math.max(0,e.length-1)}function k_(e,t){return t===Bf(e)}function ix(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Wd(e){return Object.keys(e)}function J3(e,t){return[e,t].reduce((n,r)=>(Wd(r).forEach(s=>{const i=n[s],o=r[s],a=sx(i)&&sx(o);n[s]=a?J3(i,o):o}),n),{})}function d2(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function TG(e,t){const n={start:r,center:s,end:i};function r(){return 0}function s(l){return i(l)/2}function i(l){return t-l}function o(l,c){return u2(e)?n[e](l):e(t,l,c)}return{measure:o}}function Kd(){let e=[];function t(s,i,o,a={passive:!0}){let l;if("addEventListener"in s)s.addEventListener(i,o,a),l=()=>s.removeEventListener(i,o,a);else{const c=s;c.addListener(o),l=()=>c.removeListener(o)}return e.push(l),r}function n(){e=e.filter(s=>s())}const r={add:t,clear:n};return r}function PG(e,t,n,r){const s=Kd(),i=1e3/60;let o=null,a=0,l=0;function c(){s.add(e,"visibilitychange",()=>{e.hidden&&h()})}function u(){g(),s.clear()}function d(v){if(!l)return;o||(o=v,n(),n());const m=v-o;for(o=v,a+=m;a>=i;)n(),a-=i;const S=a/i;r(S),l&&(l=t.requestAnimationFrame(d))}function f(){l||(l=t.requestAnimationFrame(d))}function g(){t.cancelAnimationFrame(l),o=null,a=0,l=0}function h(){o=null,a=0}return{init:c,destroy:u,start:f,stop:g,update:n,render:r}}function RG(e,t){const n=t==="rtl",r=e==="y",s=r?"y":"x",i=r?"x":"y",o=!r&&n?-1:1,a=u(),l=d();function c(h){const{height:p,width:v}=h;return r?p:v}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function f(h){return h*o}return{scroll:s,cross:i,startEdge:a,endEdge:l,measureSize:c,direction:f}}function qa(e=0,t=0){const n=Ft(e-t);function r(c){return c<e}function s(c){return c>t}function i(c){return r(c)||s(c)}function o(c){return i(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:o,reachedAny:i,reachedMax:s,reachedMin:r,removeOffset:a}}function Z3(e,t,n){const{constrain:r}=qa(0,e),s=e+1;let i=o(t);function o(f){return n?Ft((s+f)%s):r(f)}function a(){return i}function l(f){return i=o(f),d}function c(f){return u().set(a()+f)}function u(){return Z3(e,a(),n)}const d={get:a,set:l,add:c,clone:u};return d}function kG(e,t,n,r,s,i,o,a,l,c,u,d,f,g,h,p,v,m,S){const{cross:b,direction:w}=e,A=["INPUT","SELECT","TEXTAREA"],C={passive:!1},E=Kd(),x=Kd(),R=qa(50,225).constrain(g.measure(20)),T={mouse:300,touch:400},P={mouse:500,touch:600},I=h?43:25;let U=!1,L=0,z=0,O=!1,j=!1,N=!1,V=!1;function k(G){if(!S)return;function Q(ee){(fv(S)||S(G,ee))&&te(ee)}const Z=t;E.add(Z,"dragstart",ee=>ee.preventDefault(),C).add(Z,"touchmove",()=>{},C).add(Z,"touchend",()=>{}).add(Z,"touchstart",Q).add(Z,"mousedown",Q).add(Z,"touchcancel",ae).add(Z,"contextmenu",ae).add(Z,"click",Ae,!0)}function $(){E.clear(),x.clear()}
vendor: 10,826 bytes, line 154
154function M(){const G=V?n:t;x.add(G,"touchmove",Y,C).add(G,"touchend",ae).add(G,"mousemove",Y,C).add(G,"mouseup",ae)}function B(G){const Q=G.nodeName||"";return A.includes(Q)}function H(){return(h?P:T)[V?"mouse":"touch"]}function X(G,Q){const Z=d.add(R_(G)*-1),ee=u.byDistance(G,!h).distance;return h||Ft(G)<R?ee:v&&Q?ee*.5:u.byIndex(Z.get(),0).distance}function te(G){const Q=d2(G,r);V=Q,N=h&&Q&&!G.buttons&&U,U=md(s.get(),o.get())>=2,!(Q&&G.button!==0)&&(B(G.target)||(O=!0,i.pointerDown(G),c.useFriction(0).useDuration(0),s.set(o),M(),L=i.readPoint(G),z=i.readPoint(G,b),f.emit("pointerDown")))}function Y(G){if(!d2(G,r)&&G.touches.length>=2)return ae(G);const Z=i.readPoint(G),ee=i.readPoint(G,b),ge=md(Z,L),pe=md(ee,z);if(!j&&!V&&(!G.cancelable||(j=ge>pe,!j)))return ae(G);const xe=i.pointerMove(G);ge>p&&(N=!0),c.useFriction(.3).useDuration(.75),a.start(),s.add(w(xe)),G.preventDefault()}function ae(G){const Z=u.byDistance(0,!1).index!==d.get(),ee=i.pointerUp(G)*H(),ge=X(w(ee),Z),pe=CG(ee,ge),xe=I-10*pe,Le=m+pe/50;j=!1,O=!1,x.clear(),c.useDuration(xe).useFriction(Le),l.distance(ge,!h),V=!1,f.emit("pointerUp")}function Ae(G){N&&(G.stopPropagation(),G.preventDefault(),N=!1)}function oe(){return O}return{init:k,destroy:$,pointerDown:oe}}function OG(e,t){let r,s;function i(d){return d.timeStamp}function o(d,f){const h=`client${(f||e.scroll)==="x"?"X":"Y"}`;return(d2(d,t)?d:d.touches[0])[h]}function a(d){return r=d,s=d,o(d)}function l(d){const f=o(d)-o(s),g=i(d)-i(r)>170;return s=d,g&&(r=d),f}function c(d){if(!r||!s)return 0;const f=o(s)-o(r),g=i(d)-i(r),h=i(d)-i(s)>170,p=f/g;return g&&!h&&Ft(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:o}}function IG(){function e(n){const{offsetTop:r,offsetLeft:s,offsetWidth:i,offsetHeight:o}=n;return{top:r,right:s+i,bottom:r+o,left:s,width:i,height:o}}return{measure:e}}function NG(e){function t(r){return e*(r/100)}return{measure:t}}function LG(e,t,n,r,s,i,o){const a=[e].concat(r);let l,c,u=[],d=!1;function f(v){return s.measureSize(o.measure(v))}function g(v){if(!i)return;c=f(e),u=r.map(f);function m(S){for(const b of S){if(d)return;const w=b.target===e,A=r.indexOf(b.target),C=w?c:u[A],E=f(w?e:r[A]);if(Ft(E-C)>=.5){v.reInit(),t.emit("resize");break}}}l=new ResizeObserver(S=>{(fv(i)||i(v,S))&&m(S)}),n.requestAnimationFrame(()=>{a.forEach(S=>l.observe(S))})}function h(){d=!0,l&&l.disconnect()}return{init:g,destroy:h}}function DG(e,t,n,r,s,i){let o=0,a=0,l=s,c=i,u=e.get(),d=0;function f(){const C=r.get()-e.get(),E=!l;let x=0;return E?(o=0,n.set(r),e.set(r),x=C):(n.set(e),o+=C/l,o*=c,u+=o,e.add(o),x=u-d),a=R_(x),d=u,A}function g(){const C=r.get()-t.get();return Ft(C)<.001}function h(){return l}function p(){return a}function v(){return o}function m(){return b(s)}function S(){return w(i)}function b(C){return l=C,A}function w(C){return c=C,A}const A={direction:p,duration:h,velocity:v,seek:f,settled:g,useBaseFriction:S,useBaseDuration:m,useFriction:w,useDuration:b};return A}function MG(e,t,n,r,s){const i=s.measure(10),o=s.measure(50),a=qa(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(g){if(!c())return;const h=e.reachedMin(t.get())?"min":"max",p=Ft(e[h]-t.get()),v=n.get()-t.get(),m=a.constrain(p/o);n.subtract(v*m),!g&&Ft(v)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(g){l=!g}return{shouldConstrain:c,constrain:u,toggleActive:d}}function UG(e,t,n,r,s){const i=qa(-t+e,0),o=d(),a=u(),l=f();function c(h,p){return md(h,p)<=1}function u(){const h=o[0],p=gs(o),v=o.lastIndexOf(h),m=o.indexOf(p)+1;return qa(v,m)}function d(){return n.map((h,p)=>{const{min:v,max:m}=i,S=i.constrain(h),b=!p,w=k_(n,p);return b?m:w||c(v,S)?v:c(m,S)?m:S}).map(h=>parseFloat(h.toFixed(3)))}function f(){if(t<=e+s)return[i.max];if(r==="keepSnaps")return o;const{min:h,max:p}=a;return o.slice(h,p)}return{snapsContained:l,scrollContainLimit:a}}function FG(e,t,n){const r=t[0],s=n?r-e:gs(t);return{limit:qa(s,r)}}function $G(e,t,n,r){const i=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:l}=qa(i,o);function c(f){return f===1?l(n.get()):f===-1?a(n.get()):!1}function u(f){if(!c(f))return;const g=e*(f*-1);r.forEach(h=>h.add(g))}return{loop:u}}function jG(e){const{max:t,length:n}=e;function r(i){const o=i-t;return n?o/-n:0}return{get:r}}function VG(e,t,n,r,s){const{startEdge:i,endEdge:o}=e,{groupSlides:a}=s,l=d().map(t.measure),c=f(),u=g();function d(){return a(r).map(p=>gs(p)[o]-p[0][i]).map(Ft)}function f(){return r.map(p=>n[i]-p[i]).map(p=>-Ft(p))}function g(){return a(c).map(p=>p[0]).map((p,v)=>p+l[v])}return{snaps:c,snapsAligned:u}}function BG(e,t,n,r,s,i){const{groupSlides:o}=s,{min:a,max:l}=r,c=u();function u(){const f=o(i),g=!e||t==="keepSnaps";return n.length===1?[i]:g?f:f.slice(a,l).map((h,p,v)=>{const m=!p,S=k_(v,p);if(m){const b=gs(v[0])+1;return ix(b)}if(S){const b=Bf(i)-gs(v)[0]+1;return ix(b,gs(v)[0])}return h})}return{slideRegistry:c}}function zG(e,t,n,r,s){const{reachedAny:i,removeOffset:o,constrain:a}=r;function l(h){return h.concat().sort((p,v)=>Ft(p)-Ft(v))[0]}function c(h){const p=e?o(h):a(h),v=t.map((S,b)=>({diff:u(S-p,0),index:b})).sort((S,b)=>Ft(S.diff)-Ft(b.diff)),{index:m}=v[0];return{index:m,distance:p}}function u(h,p){const v=[h,h+n,h-n];if(!e)return h;if(!p)return l(v);const m=v.filter(S=>R_(S)===p);return m.length?l(m):gs(v)-n}function d(h,p){const v=t[h]-s.get(),m=u(v,p);return{index:h,distance:m}}function f(h,p){const v=s.get()+h,{index:m,distance:S}=c(v),b=!e&&i(v);if(!p||b)return{index:m,distance:h};const w=t[m]-S,A=h+u(w,0);return{index:m,distance:A}}return{byDistance:f,byIndex:d,shortcut:u}}function GG(e,t,n,r,s,i,o){function a(d){const f=d.distance,g=d.index!==t.get();i.add(f),f&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),g&&(n.set(t.get()),t.set(d.index),o.emit("select"))}function l(d,f){const g=s.byDistance(d,f);a(g)}function c(d,f){const g=t.clone().set(d),h=s.byIndex(g.get(),f);a(h)}return{distance:l,index:c}}function HG(e,t,n,r,s,i,o,a){const l={passive:!0,capture:!0};let c=0;function u(g){if(!a)return;function h(p){if(new Date().getTime()-c>10)return;o.emit("slideFocusStart"),e.scrollLeft=0;const S=n.findIndex(b=>b.includes(p));P_(S)&&(s.useDuration(0),r.index(S,0),o.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((p,v)=>{i.add(p,"focus",m=>{(fv(a)||a(g,m))&&h(v)},l)})}function d(g){g.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function Ju(e){let t=e;function n(){return t}function r(l){t=o(l)}function s(l){t+=o(l)}function i(l){t-=o(l)}function o(l){return P_(l)?l:l.get()}return{get:n,set:r,add:s,subtract:i}}function eN(e,t){const n=e.scroll==="x"?o:a,r=t.style;let s=null,i=!1;function o(f){return`translate3d(${f}px,0px,0px)`}function a(f){return`translate3d(0px,${f}px,0px)`}function l(f){if(i)return;const g=xG(e.direction(f));g!==s&&(r.transform=n(g),s=g)}function c(f){i=!f}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function WG(e,t,n,r,s,i,o,a,l){const u=Hd(s),d=Hd(s).reverse(),f=m().concat(S());function g(E,x){return E.reduce((R,T)=>R-s[T],x)}function h(E,x){return E.reduce((R,T)=>g(R,x)>0?R.concat([T]):R,[])}function p(E){return i.map((x,R)=>({start:x-r[R]+.5+E,end:x+t-.5+E}))}function v(E,x,R){const T=p(x);return E.map(P=>{const I=R?0:-n,U=R?n:0,L=R?"end":"start",z=T[P][L];return{index:P,loopPoint:z,slideLocation:Ju(-1),translate:eN(e,l[P]),target:()=>a.get()>z?I:U}})}function m(){const E=o[0],x=h(d,E);return v(x,n,!1)}function S(){const E=t-o[0]-1,x=h(u,E);return v(x,-n,!0)}function b(){return f.every(({index:E})=>{const x=u.filter(R=>R!==E);return g(x,t)<=.1})}function w(){f.forEach(E=>{const{target:x,translate:R,slideLocation:T}=E,P=x();P!==T.get()&&(R.to(P),T.set(P))})}function A(){f.forEach(E=>E.translate.clear())}return{canLoop:b,clear:A,loop:w,loopPoints:f}}function KG(e,t,n){let r,s=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{s||(fv(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function o(){r&&r.disconnect(),s=!0}return{init:i,destroy:o}}function qG(e,t,n,r){const s={};let i=null,o=null,a,l=!1;function c(){a=new IntersectionObserver(h=>{l||(h.forEach(p=>{const v=t.indexOf(p.target);s[v]=p}),i=null,o=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(h=>a.observe(h))}function u(){a&&a.disconnect(),l=!0}function d(h){return Wd(s).reduce((p,v)=>{const m=parseInt(v),{isIntersecting:S}=s[m];return(h&&S||!h&&!S)&&p.push(m),p},[])}function f(h=!0){if(h&&i)return i;if(!h&&o)return o;const p=d(h);return h&&(i=p),h||(o=p),p}return{init:c,destroy:u,get:f}}function YG(e,t,n,r,s,i){const{measureSize:o,startEdge:a,endEdge:l}=e,c=n[0]&&s,u=h(),d=p(),f=n.map(o),g=v();function h(){if(!c)return 0;const S=n[0];return Ft(t[a]-S[a])}function p(){if(!c)return 0;const S=i.getComputedStyle(gs(r));return parseFloat(S.getPropertyValue(`margin-${l}`))}function v(){return n.map((S,b,w)=>{const A=!b,C=k_(w,b);return A?f[b]+u:C?f[b]+d:w[b+1][a]-S[a]}).map(Ft)}return{slideSizes:f,slideSizesWithGaps:g,startGap:u,endGap:d}}function QG(e,t,n,r,s,i,o,a,l){const{startEdge:c,endEdge:u,direction:d}=e,f=P_(n);function g(m,S){return Hd(m).filter(b=>b%S===0).map(b=>m.slice(b,b+S))}function h(m){return m.length?Hd(m).reduce((S,b,w)=>{const A=gs(S)||0,C=A===0,E=b===Bf(m),x=s[c]-i[A][c],R=s[c]-i[b][u],T=!r&&C?d(o):0,P=!r&&E?d(a):0,I=Ft(R-P-(x+T));return w&&I>t+l&&S.push(b),E&&S.push(m.length),S},[]).map((S,b,w)=>{const A=Math.max(w[b-1]||0);return m.slice(A,S)}):[]}function p(m){return f?g(m,n):h(m)}return{groupSlides:p}}function XG(e,t,n,r,s,i,o){const{align:a,axis:l,direction:c,startIndex:u,loop:d,duration:f,dragFree:g,dragThreshold:h,inViewThreshold:p,slidesToScroll:v,skipSnaps:m,containScroll:S,watchResize:b,watchSlides:w,watchDrag:A,watchFocus:C}=i,E=2,x=IG(),R=x.measure(t),T=n.map(x.measure),P=RG(l,c),I=P.measureSize(R),U=NG(I),L=TG(a,I),z=!d&&!!S,O=d||!!S,{slideSizes:j,slideSizesWithGaps:N,startGap:V,endGap:k}=YG(P,R,T,n,O,s),$=QG(P,I,v,d,R,T,V,k,E),{snaps:M,snapsAligned:B}=VG(P,L,R,T,$),H=-gs(M)+gs(N),{snapsContained:X,scrollContainLimit:te}=UG(I,H,B,S,E),Y=z?X:B,{limit:ae}=FG(H,Y,d),Ae=Z3(Bf(Y),u,d),oe=Ae.clone(),K=Hd(n),G=({dragHandler:Gi,scrollBody:Pr,scrollBounds:ll,options:{loop:ra}})=>{ra||ll.constrain(Gi.pointerDown()),Pr.seek()},Q=({scrollBody:Gi,translate:Pr,location:ll,offsetLocation:ra,previousLocation:lh,scrollLooper:s0,slideLooper:ch,dragHandler:cl,animation:uh,eventHandler:ul,scrollBounds:i0,options:{loop:uu}},dh)=>{const du=Gi.settled(),o0=!i0.shouldConstrain(),J=uu?du:du&&o0,ne=J&&!cl.pointerDown();ne&&uh.stop();const ie=ll.get()*dh+lh.get()*(1-dh);ra.set(ie),uu&&(s0.loop(Gi.direction()),ch.loop()),Pr.to(ra.get()),ne&&ul.emit("settle"),J||ul.emit("scroll")}
vendor: 1,037 bytes, line 154
154,Z=PG(r,s,()=>G(zi),Gi=>Q(zi,Gi)),ee=.68,ge=Y[Ae.get()],pe=Ju(ge),xe=Ju(ge),Le=Ju(ge),Be=Ju(ge),ye=DG(pe,Le,xe,Be,f,ee),we=zG(d,Y,H,ae,Be),Ot=GG(Z,Ae,oe,ye,we,Be,o),Un=jG(ae),dn=Kd(),fn=qG(t,n,o,p),{slideRegistry:Jr}=BG(z,S,Y,te,$,K),cu=HG(e,n,Jr,Ot,ye,dn,o,C),zi={ownerDocument:r,ownerWindow:s,eventHandler:o,containerRect:R,slideRects:T,animation:Z,axis:P,dragHandler:kG(P,e,r,s,Be,OG(P,s),pe,Z,Ot,ye,we,Ae,o,U,g,h,m,ee,A),eventStore:dn,percentOfView:U,index:Ae,indexPrevious:oe,limit:ae,location:pe,offsetLocation:Le,previousLocation:xe,options:i,resizeHandler:LG(t,o,s,n,P,b,x),scrollBody:ye,scrollBounds:MG(ae,Le,Be,ye,U),scrollLooper:$G(H,ae,Le,[pe,Le,xe,Be]),scrollProgress:Un,scrollSnapList:Y.map(Un.get),scrollSnaps:Y,scrollTarget:we,scrollTo:Ot,slideLooper:WG(P,I,H,j,N,M,Y,Le,n),slideFocus:cu,slidesHandler:KG(t,o,w),slidesInView:fn,slideIndexes:K,slideRegistry:Jr,slidesToScroll:$,target:Be,translate:eN(P,t)};return zi}function JG(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function s(c){return r(c).forEac
154h(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function o(c,u){return e[c]=r(c).filter(d=>d!==u),l}function a(){e={}}const l={init:n,emit:s,off:o,on:i,clear:a};return l}const ZG={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function eH(e){function t(i,o){return J3(i,o||{})}function n(i){const o=i.breakpoints||{},a=Wd(o).filter(l=>e.matchMedia(l).matches).map(l=>o[l]).reduce((l,c)=>t(l,c),{});return t(i,a)}function r(i){return i.map(o=>Wd(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function tH(e){let t=[];function n(i,o){return t=o.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(i,e)),o.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function $g(e,t,n){const r=e.ownerDocument,s=r.defaultView,i=eH(s),o=tH(i),a=Kd(),l=JG(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:f,off:g,emit:h}=l,p=P;let v=!1,m,S=c(ZG,$g.globalOptions),b=c(S),w=[],A,C,E;function x(){const{container:K,slides:G}=b;C=(u2(K)?e.querySelector(K):K)||e.children[0];const Z=u2(G)?C.querySelectorAll(G):G;E=[].slice.call(Z||C.children)}function R(K){const G=XG(e,C,E,r,s,K,l);if(K.loop&&!G.slideLooper.canLoop()){const Q=Object.assign({},K,{loop:!1});return R(Q)}return G}function T(K,G){v||(S=c(S,K),b=u(S),w=G||w,x(),m=R(b),d([S,...w.map(({options:Q})=>Q)]).forEach(Q=>a.add(Q,"change",P)),b.active&&(m.translate.to(m.location.get()),m.animation.init(),m.slidesInView.init(),m.slideFocus.init(oe),m.eventHandler.init(oe),m.resizeHandler.init(oe),m.slidesHandler.init(oe),m.options.loop&&m.slideLooper.loop(),C.offsetParent&&E.length&&m.dragHandler.init(oe),A=o.init(oe,w)))}function P(K,G){const Q=$();I(),T(c({startIndex:Q},K),G),l.emit("reInit")}function I(){m.dragHandler.destroy(),m.eventStore.clear(),m.translate.clear(),m.slideLooper.clear(),m.resizeHandler.destroy(),m.slidesHandler.destroy(),m.slidesInView.destroy(),m.animation.destroy(),o.destroy(),a.clear()}function U(){v||(v=!0,a.clear(),I(),l.emit("destroy"),l.clear())}function L(K,G,Q){!b.active||v||(m.scrollBody.useBaseFriction().useDuration(G===!0?0:b.duration),m.scrollTo.index(K,Q||0))}function z(K){const G=m.index.add(1).get();L(G,K,-1)}function O(K){const G=m.index.add(-1).get();L(G,K,1)}function j(){return m.index.add(1).get()!==$()}function N(){return m.index.add(-1).get()!==$()}function V(){return m.scrollSnapList}function k(){return m.scrollProgress.get(m.offsetLocation.get())}function $(){return m.index.get()}function M(){return m.indexPrevious.get()}function B(){return m.slidesInView.get()}function H(){return m.slidesInView.get(!1)}function X(){return A}function te(){return m}function Y(){return e}function ae(){return C}function Ae(){return E}const oe={canScrollNext:j,canScrollPrev:N,containerNode:ae,internalEngine:te,destroy:U,off:g,on:f,emit:h,plugins:X,previousScrollSnap:M,reInit:p,rootNode:Y,scrollNext:z,scrollPrev:O,scrollProgress:k,scrollSnapList:V,scrollTo:L,selectedScrollSnap:$,slideNodes:Ae,slidesInView:B,slidesNotInView:H};return T(t,n),setTimeout(()=>l.emit("init"),0),oe}$g.globalOptions=void 0;function O_(e={},t=[]){const n=y.useRef(e),r=y.useRef(t),[s,i]=y.useState(),[o,a]=y.useState(),l=y.useCallback(()=>{s&&s.reInit(n.current,r.current)},[s]);return y.useEffect(()=>{T_(n.current,e)||(n.current=e,l())},[e,l]),y.useEffect(()=>{AG(r.current,t)||(r.current=t,l())},[t,l]),y.useEffect(()=>{if(EG()&&o){$g.globalOptions=O_.globalOptions;const c=$g(o,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[o,i]),[a,s]}O_.globalOptions=void 0;function nr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nH(e,t=globalThis==null?void 0:globalThis.document){const n=nr(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var rH="DismissableLayer",f2="dismissableLayer.update",sH="dismissableLayer.pointerDownOutside",iH="dismissableLayer.focusOutside",ox,tN=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I_=y.forwardRef((e,t)=>
154{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=e,c=y.useContext(tN),[u,d]=y.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=y.useState({}),h=ur(t,E=>d(E)),p=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=p.indexOf(v),S=u?p.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=S>=m,A=aH(E=>{const x=E.target,R=[...c.branches].some(T=>T.contains(x));!w||R||(s==null||s(E),o==null||o(E),E.defaultPrevented||a==null||a())},f),C=lH(E=>{const x=E.target;[...c.branches].some(T=>T.contains(x))||(i==null||i(E),o==null||o(E),E.defaultPrevented||a==null||a())},f);return nH(E=>{S===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},f),y.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ox=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ax(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ox)}},[u,f,n,c]),y.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ax())},[u,c]),y.useEffect(()=>{const E=()=>g({});return document.addEventListener(f2,E),()=>document.removeEventListener(f2,E)},[]),_.jsx(bt.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:lt(e.onFocusCapture,C.onFocusCapture),onBlurCapture:lt(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:lt(e.onPointerDownCapture,A.onPointerDownCapture)})});I_.displayName=rH;var oH="DismissableLayerBranch",nN=y.forwardRef((e,t)=>{const n=y.useContext(tN),r=y.useRef(null),s=ur(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),_.jsx(bt.div,{...e,ref:s})});nN.displayName=oH;function aH(e,t=globalThis==null?void 0:globalThis.document){const n=nr(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){rN(sH,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lH(e,t=globalThis==null?void 0:globalThis.document){const n=nr(e),r=y.useRef(!1);return y.useEffect(()=>{const s=i=>{i.target&&!r.current&&rN(iH,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ax(){const e=new CustomEvent(f2);document.dispatchEvent(e)}function rN(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Ug(s,i):s.dispatchEvent(i)}var cH=I_,uH=nN;function dH(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fH=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hH="VisuallyHidden",hv=y.forwardRef((e,t)=>_.jsx(bt.span,{...e,ref:t,style:{...fH,...e.style}}));hv.displayName=hH;var pH=hv,ol="NavigationMenu",[N_,sN,gH]=av(ol),[h2,mH,vH]=av(ol),[L_,Jge]=Vf(ol,[gH,vH]),[yH,Yr]=L_(ol),[SH,bH]=L_(ol),iN=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:o=200,skipDelayDuration:a=300,orientation:l="horizontal",dir:c,...u}=e,[d,f]=y.useState(null),g=ur(t,R=>f(R)),h=$3(c),p=y.useRef(0),v=y.useRef(0),m=y.useRef(0),[S,b]=y.useState(!0),[w,A]=Zc({prop:r,onChange:R=>{const T=R!=="",P=a>0;T?(window.clearTimeout(m.current),P&&b(!1)):(window.clearTimeout(m.current),m.current=window.setTimeout(()=>b(!0),a)),s==null||s(R)},defaultProp:i??"",caller:ol}),C=y.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>A(""),150)},[A]),E=y.useCallback(R=>{window.clearTimeout(v.current),A(R)},[A]),x=y.useCallback(R=>{w===R?window.clearTimeout(v.current):p.current=window.setTimeout(()=>{window.clearTimeout(v.current),A(R)},o)},[w,A,o]);return y.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(v.current),window.clearTimeout(m.current)},[]),_.jsx(oN,{scope:n,isRootMenu:!0,value:w,dir:h,orientation:l,rootNavigationMenu:d,onTriggerEnter:R=>{window.clearTimeout(p.current),S?x(R):E(R)},onTriggerLeave:()=>{window.clearTimeout(p.current),C()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:C,onItemSelect:R=>{A(T=>T===R?"":R)},onItemDismiss:()=>A(""),children:_.jsx(bt.nav,{"aria-label":"Main","data-orientation":l,dir:h,...u,ref:g})})});iN.displayName=ol;var p2="NavigationMenuSub",_H=y.forwardRef((e,t)=>
154{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:o="horizontal",...a}=e,l=Yr(p2,n),[c,u]=Zc({prop:r,onChange:s,defaultProp:i??"",caller:p2});return _.jsx(oN,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:o,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>u(d),onItemSelect:d=>u(d),onItemDismiss:()=>u(""),children:_.jsx(bt.div,{"data-orientation":o,...a,ref:t})})});_H.displayName=p2;var oN=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:o,value:a,onItemSelect:l,onItemDismiss:c,onTriggerEnter:u,onTriggerLeave:d,onContentEnter:f,onContentLeave:g}=e,[h,p]=y.useState(null),[v,m]=y.useState(new Map),[S,b]=y.useState(null);return _.jsx(yH,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:a,previousValue:dH(a),baseId:lv(),dir:s,orientation:i,viewport:h,onViewportChange:p,indicatorTrack:S,onIndicatorTrackChange:b,onTriggerEnter:nr(u),onTriggerLeave:nr(d),onContentEnter:nr(f),onContentLeave:nr(g),onItemSelect:nr(l),onItemDismiss:nr(c),onViewportContentChange:y.useCallback((w,A)=>{m(C=>(C.set(w,A),new Map(C)))},[]),onViewportContentRemove:y.useCallback(w=>{m(A=>A.has(w)?(A.delete(w),new Map(A)):A)},[]),children:_.jsx(N_.Provider,{scope:t,children:_.jsx(SH,{scope:t,items:v,children:o})})})},aN="NavigationMenuList",lN=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Yr(aN,n),i=_.jsx(bt.ul,{"data-orientation":s.orientation,...r,ref:t});return _.jsx(bt.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:_.jsx(N_.Slot,{scope:n,children:s.isRootMenu?_.jsx(mN,{asChild:!0,children:i}):i})})});lN.displayName=aN;var cN="NavigationMenuItem",[wH,uN]=L_(cN),EH=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...s}=e,i=lv(),o=r||i||"LEGACY_REACT_AUTO_VALUE",a=y.useRef(null),l=y.useRef(null),c=y.useRef(null),u=y.useRef(()=>{}),d=y.useRef(!1),f=y.useCallback((h="start")=>{if(a.current){u.current();const p=m2(a.current);p.length&&U_(h==="start"?p:p.reverse())}},[]),g=y.useCallback(()=>{if(a.current){const h=m2(a.current);h.length&&(u.current=OH(h))}},[]);return _.jsx(wH,{scope:n,value:o,triggerRef:l,contentRef:a,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:_.jsx(bt.li,{...s,ref:t})})});EH.displayName=cN;var g2="NavigationMenuTrigger",dN=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=e,i=Yr(g2,e.__scopeNavigationMenu),o=uN(g2,e.__scopeNavigationMenu),a=y.useRef(null),l=ur(a,o.triggerRef,t),c=yN(i.baseId,o.value),u=SN(i.baseId,o.value),d=y.useRef(!1),f=y.useRef(!1),g=o.value===i.value;return _.jsxs(_.Fragment,{children:[_.jsx(N_.ItemSlot,{scope:n,value:o.value,children:_.jsx(vN,{asChild:!0,children:_.jsx(bt.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":F_(g),"aria-expanded":g,"aria-controls":u,...s,ref:l,onPointerEnter:lt(e.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:lt(e.onPointerMove,jg(()=>{r||f.current||o.wasEscapeCloseRef.current||d.current||(i.onTriggerEnter(o.value),d.current=!0)})),onPointerLeave:lt(e.onPointerLeave,jg(()=>{r||(i.onTriggerLeave(),d.current=!1)})),onClick:lt(e.onClick,()=>{i.onItemSelect(o.value),f.current=g}),onKeyDown:lt(e.onKeyDown,h=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];g&&h.key===v&&(o.onEntryKeyDown(),h.preventDefault())})})})}),g&&_.jsxs(_.Fragment,{children:[_.jsx(pH,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:h=>{const p=o.contentRef.current,v=h.relatedTarget,m=v===a.current,S=p==null?void 0:p.contains(v);(m||!S)&&o.onFocusProxyEnter(m?"start":"end")}}),i.viewport&&_.jsx("span",{"aria-owns":u})]})]})});dN.displayName=g2;var AH="NavigationMenuLink",lx="navigationMenu.linkSelect",CH=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=e;return _.jsx(vN,{asChild:!0,children:_.jsx(bt.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:lt(e.onClick,o=>{const a=o.target,l=new CustomEvent(lx,{bubbles:!0,cancelable:!0});if(a.addEventListener(lx,c=>s==null?void 0:s(c),{once:!0}),Ug(a,l),!l.defaultPrevented&&!o.metaKey){const c=new CustomEvent(Ip,{bubbles:!0,cancelable:!0});Ug(a,c)}},{checkForDefaultPrevented:!1})})})});CH.displayName=AH;var D_="NavigationMenuIndicator",fN=y.forwardRef((e,t)=>
154{const{forceMount:n,...r}=e,s=Yr(D_,e.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?Dm.createPortal(_.jsx(il,{present:n||i,children:_.jsx(xH,{...r,ref:t})}),s.indicatorTrack):null});fN.displayName=D_;var xH=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=Yr(D_,n),i=sN(n),[o,a]=y.useState(null),[l,c]=y.useState(null),u=s.orientation==="horizontal",d=!!s.value;y.useEffect(()=>{var p;const h=(p=i().find(v=>v.value===s.value))==null?void 0:p.ref.current;h&&a(h)},[i,s.value]);const f=()=>{o&&c({size:u?o.offsetWidth:o.offsetHeight,offset:u?o.offsetLeft:o.offsetTop})};return v2(o,f),v2(s.indicatorTrack,f),l?_.jsx(bt.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":s.orientation,...r,ref:t,style:{position:"absolute",...u?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}}):null}),Ic="NavigationMenuContent",hN=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Yr(Ic,e.__scopeNavigationMenu),i=uN(Ic,e.__scopeNavigationMenu),o=ur(i.contentRef,t),a=i.value===s.value,l={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?_.jsx(TH,{forceMount:n,...l,ref:o}):_.jsx(il,{present:n||a,children:_.jsx(pN,{"data-state":F_(a),...l,ref:o,onPointerEnter:lt(e.onPointerEnter,s.onContentEnter),onPointerLeave:lt(e.onPointerLeave,jg(s.onContentLeave)),style:{pointerEvents:!a&&s.isRootMenu?"none":void 0,...l.style}})})});hN.displayName=Ic;var TH=y.forwardRef((e,t)=>{const n=Yr(Ic,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Zs(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Zs(()=>()=>s(e.value),[e.value,s]),null}),Ip="navigationMenu.rootContentDismiss",pN=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:a,onContentFocusOutside:l,...c}=e,u=Yr(Ic,n),d=y.useRef(null),f=ur(d,t),g=yN(u.baseId,r),h=SN(u.baseId,r),p=sN(n),v=y.useRef(null),{onItemDismiss:m}=u;y.useEffect(()=>{const b=d.current;if(u.isRootMenu&&b){const w=()=>{var A;m(),a(),b.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return b.addEventListener(Ip,w),()=>b.removeEventListener(Ip,w)}},[u.isRootMenu,e.value,s,m,a]);const S=y.useMemo(()=>{const w=p().map(T=>T.value);u.dir==="rtl"&&w.reverse();const A=w.indexOf(u.value),C=w.indexOf(u.previousValue),E=r===u.value,x=C===w.indexOf(r);if(!E&&!x)return v.current;const R=(()=>{if(A!==C){if(E&&C!==-1)return A>C?"from-end":"from-start";if(x&&A!==-1)return A>C?"to-start":"to-end"}return null})();return v.current=R,R},[u.previousValue,u.value,u.dir,p,r]);return _.jsx(mN,{asChild:!0,children:_.jsx(I_,{id:h,"aria-labelledby":g,"data-motion":S,"data-orientation":u.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var w;const b=new Event(Ip,{bubbles:!0,cancelable:!0});(w=d.current)==null||w.dispatchEvent(b)},onFocusOutside:lt(e.onFocusOutside,b=>{var A;l();const w=b.target;(A=u.rootNavigationMenu)!=null&&A.contains(w)&&b.preventDefault()}),onPointerDownOutside:lt(e.onPointerDownOutside,b=>{var E;const w=b.target,A=p().some(x=>{var R;return(R=x.ref.current)==null?void 0:R.contains(w)}),C=u.isRootMenu&&((E=u.viewport)==null?void 0:E.contains(w));(A||C||!u.isRootMenu)&&b.preventDefault()}),onKeyDown:lt(e.onKeyDown,b=>{var C;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const E=m2(b.currentTarget),x=document.activeElement,R=E.findIndex(I=>I===x),P=b.shiftKey?E.slice(0,R).reverse():E.slice(R+1,E.length);U_(P)?b.preventDefault():(C=i.current)==null||C.focus()}}),onEscapeKeyDown:lt(e.onEscapeKeyDown,b=>{o.current=!0})})})}),M_="NavigationMenuViewport",gN=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Yr(M_,e.__scopeNavigationMenu).value;return _.jsx(il,{present:n||i,children:_.jsx(PH,{...r,ref:t})})});gN.displayName=M_;var PH=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...s}=e,i=Yr(M_,n),o=ur(t,i.onViewportChange),a=bH(Ic,e.__scopeNavigationMenu),[l,c]=y.useState(null),[u,d]=y.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,h=!!i.value,p=h?i.value:i.previousValue;return v2(u,()=>{u&&c({width:u.offsetWidth,height:u.offsetHeight})}),_.jsx(bt.div,{"data-state":F_(h),"data-orientation":i.orientation,...s,ref:o,style:{pointerEvents:!h&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...s.style},onPointerEnter:lt(e.onPointerEnter,i.onContentEnter),onPointerLeave:lt(e.onPointerLeave,jg(i.onContentLeave)),children:Array.from(a.items).map(([m,{ref:S,forceMount:b,...w}])=>{const A=p===m;return _.jsx(il,{present:b||A,children:_.jsx(pN,{...w,ref:jb(S,C=>{A&&C&&d(C)})})},m)})})}),RH="FocusGroup",mN=y.forwardRef((e,t)=>
154{const{__scopeNavigationMenu:n,...r}=e,s=Yr(RH,n);return _.jsx(h2.Provider,{scope:n,children:_.jsx(h2.Slot,{scope:n,children:_.jsx(bt.div,{dir:s.dir,...r,ref:t})})})}),cx=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],kH="FocusGroupItem",vN=y.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,s=mH(n),i=Yr(kH,n);return _.jsx(h2.ItemSlot,{scope:n,children:_.jsx(bt.button,{...r,ref:t,onKeyDown:lt(e.onKeyDown,o=>{if(["Home","End",...cx].includes(o.key)){let l=s().map(d=>d.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&l.reverse(),cx.includes(o.key)){const d=l.indexOf(o.currentTarget);l=l.slice(d+1)}setTimeout(()=>U_(l)),o.preventDefault()}})})})});function m2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function U_(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function OH(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function v2(e,t){const n=nr(t);Zs(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}function F_(e){return e?"open":"closed"}function yN(e,t){return`${e}-trigger-${t}`}function SN(e,t){return`${e}-content-${t}`}function jg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var bN=iN,_N=lN,wN=dN,EN=fN,AN=hN,CN=gN,pv="Dialog",[xN,Zge]=qr(pv),[IH,ws]=xN(pv),TN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=y.useRef(null),l=y.useRef(null),[c,u]=Ui({prop:r,defaultProp:s??!1,onChange:i,caller:pv});return _.jsx(IH,{scope:t,triggerRef:a,contentRef:l,contentId:Ri(),titleId:Ri(),descriptionId:Ri(),open:c,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};TN.displayName=pv;var PN="DialogTrigger",NH=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ws(PN,n),i=st(t,s.triggerRef);return _.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":G_(s.open),...r,ref:i,onClick:Ve(e.onClick,s.onOpenToggle)})});NH.displayName=PN;var $_="DialogPortal",[LH,RN]=xN($_,{forceMount:void 0}),kN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=ws($_,t);return _.jsx(LH,{scope:t,forceMount:n,children:y.Children.map(r,o=>_.jsx(bs,{present:n||i.open,children:_.jsx(Jm,{asChild:!0,container:s,children:o})}))})};kN.displayName=$_;var Vg="DialogOverlay",j_=y.forwardRef((e,t)=>{const n=RN(Vg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ws(Vg,e.__scopeDialog);return i.modal?_.jsx(bs,{present:r||i.open,children:_.jsx(MH,{...s,ref:t})}):null});
154j_.displayName=Vg;var DH=Oc("DialogOverlay.RemoveScroll"),MH=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ws(Vg,n),i=tV(),o=st(t,i);return _.jsx(ev,{as:DH,allowPinchZoom:!0,shards:[s.contentRef],children:_.jsx(ze.div,{"data-state":G_(s.open),...r,ref:o,style:{pointerEvents:"auto",...r.style}})})}),Nc="DialogContent",V_=y.forwardRef((e,t)=>{const n=RN(Nc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=ws(Nc,e.__scopeDialog);return _.jsx(bs,{present:r||i.open,children:i.modal?_.jsx(UH,{...s,ref:t}):_.jsx(FH,{...s,ref:t})})});V_.displayName=Nc;var UH=y.forwardRef((e,t)=>{const n=ws(Nc,e.__scopeDialog),r=y.useRef(null),s=st(t,n.contentRef,r);return y.useEffect(()=>{const i=r.current;if(i)return c_(i)},[]),_.jsx(ON,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Ve(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ve(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:Ve(e.onFocusOutside,i=>i.preventDefault())})}),FH=y.forwardRef((e,t)=>{const n=ws(Nc,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return _.jsx(ON,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),ON=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=ws(Nc,n);return Xb(),_.jsx(_.Fragment,{children:_.jsx(Hm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(jf,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":G_(a.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>a.onOpenChange(!1)})})})}),IN="DialogTitle",B_=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ws(IN,n);return _.jsx(ze.h2,{id:s.titleId,...r,ref:t})});B_.displayName=IN;var NN="DialogDescription",z_=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ws(NN,n);return _.jsx(ze.p,{id:s.descriptionId,...r,ref:t})});z_.displayName=NN;var LN="DialogClose",DN=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ws(LN,n);return _.jsx(ze.button,{type:"button",...r,ref:t,onClick:Ve(e.onClick,()=>s.onOpenChange(!1))})});DN.displayName=LN;function G_(e){return e?"open":"closed"}var MN="Popover",[UN,eme]=qr(MN,[Jc]),gv=Jc(),[tme,Xo]=UN(MN),FN="PopoverAnchor",$H=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xo(FN,n),i=gv(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=s;return y.useEffect(()=>(o(),()=>a()),[o,a]),_.jsx(Xm,{...i,...r,ref:t})});$H.displayName=FN;var $N="PopoverTrigger",jH=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xo($N,n),i=gv(n),o=st(t,s.triggerRef),a=_.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":GN(s.open),...r,ref:o,onClick:Ve(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:_.jsx(Xm,{asChild:!0,...i,children:a})});jH.displayName=$N;var H_="PopoverPortal",[VH,BH]=UN(H_,{forceMount:void 0}),jN=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Xo(H_,t);return _.jsx(VH,{scope:t,forceMount:n,children:_.jsx(bs,{present:n||i.open,children:_.jsx(Jm,{asChild:!0,container:s,children:r})})})};jN.displayName=H_;var Lc="PopoverContent",VN=y.forwardRef((e,t)=>{const n=BH(Lc,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Xo(Lc,e.__scopePopover);return _.jsx(bs,{present:r||i.open,children:i.modal?_.jsx(GH,{...s,ref:t}):_.jsx(HH,{...s,ref:t})})});VN.displayName=Lc;var zH=Oc("PopoverContent.RemoveScroll"),GH=y.forwardRef((e,t)=>
154{const n=Xo(Lc,e.__scopePopover),r=y.useRef(null),s=st(t,r),i=y.useRef(!1);return y.useEffect(()=>{const o=r.current;if(o)return c_(o)},[]),_.jsx(ev,{as:zH,allowPinchZoom:!0,children:_.jsx(BN,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ve(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ve(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ve(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),HH=y.forwardRef((e,t)=>{const n=Xo(Lc,e.__scopePopover),r=y.useRef(!1),s=y.useRef(!1);return _.jsx(BN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),BN=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=Xo(Lc,n),g=gv(n);return Xb(),_.jsx(Hm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:_.jsx(jf,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:_.jsx(a_,{"data-state":GN(f.open),role:"dialog",id:f.contentId,...g,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),zN="PopoverClose",WH=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xo(zN,n);return _.jsx(ze.button,{type:"button",...r,ref:t,onClick:Ve(e.onClick,()=>s.onOpenChange(!1))})});WH.displayName=zN;var KH="PopoverArrow",qH=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=gv(n);return _.jsx(l_,{...s,...r,ref:t})});qH.displayName=KH;function GN(e){return e?"open":"closed"}var YH=jN,HN=VN,[mv,nme]=qr("Tooltip",[Jc]),vv=Jc(),WN="TooltipProvider",QH=700,y2="tooltip.open",[XH,W_]=mv(WN),KN=e=>{const{__scopeTooltip:t,delayDuration:n=QH,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=y.useRef(!0),a=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),_.jsx(XH,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:y.useCallback(()=>{r<=0||(window.clearTimeout(l.current),o.current=!1)},[r]),onClose:y.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:y.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:i})};KN.displayName=WN;var qd="Tooltip",[JH,yv]=mv(qd),qN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=e,l=W_(qd,e.__scopeTooltip),c=vv(t),[u,d]=y.useState(null),f=Ri(),g=y.useRef(0),h=o??l.disableHoverableContent,p=a??l.delayDuration,v=y.useRef(!1),[m,S]=Ui({prop:r,defaultProp:s??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(y2))):l.onClose(),i==null||i(E)},caller:qd}),b=y.useMemo(()=>m?v.current?"delayed-open":"instant-open":"closed",[m]),w=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,S(!0)},[S]),A=y.useCallback(()=>{window.clearTimeout(g.current),g.current=0,S(!1)},[S]),C=y.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,S(!0),g.current=0},p)},[p,S]);return y.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),_.jsx(RI,{...c,children:_.jsx(JH,{scope:t,contentId:f,open:m,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayedRef.current?C():w()},[l.isOpenDelayedRef,C,w]),onTriggerLeave:y.useCallback(()=>{h?A():(window.clearTimeout(g.current),g.current=0)},[A,h]),onOpen:w,onClose:A,disableHoverableContent:h,children:n})})};qN.displayName=qd;var S2="TooltipTrigger",YN=y.forwardRef((e,t)=>
154{const{__scopeTooltip:n,...r}=e,s=yv(S2,n),i=W_(S2,n),o=vv(n),a=y.useRef(null),l=st(t,a,s.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),d=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),_.jsx(Xm,{asChild:!0,...o,children:_.jsx(ze.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Ve(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ve(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:Ve(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ve(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:Ve(e.onBlur,s.onClose),onClick:Ve(e.onClick,s.onClose)})})});YN.displayName=S2;var ZH="TooltipPortal",[rme,eW]=mv(ZH,{forceMount:void 0}),Dc="TooltipContent",QN=y.forwardRef((e,t)=>{const n=eW(Dc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=yv(Dc,e.__scopeTooltip);return _.jsx(bs,{present:r||o.open,children:o.disableHoverableContent?_.jsx(XN,{side:s,...i,ref:t}):_.jsx(tW,{side:s,...i,ref:t})})}),tW=y.forwardRef((e,t)=>{const n=yv(Dc,e.__scopeTooltip),r=W_(Dc,e.__scopeTooltip),s=y.useRef(null),i=st(t,s),[o,a]=y.useState(null),{trigger:l,onClose:c}=n,u=s.current,{onPointerInTransitChange:d}=r,f=y.useCallback(()=>{a(null),d(!1)},[d]),g=y.useCallback((h,p)=>{const v=h.currentTarget,m={x:h.clientX,y:h.clientY},S=oW(m,v.getBoundingClientRect()),b=aW(m,S),w=lW(p.getBoundingClientRect()),A=uW([...b,...w]);a(A),d(!0)},[d]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(l&&u){const h=v=>g(v,u),p=v=>g(v,l);return l.addEventListener("pointerleave",h),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",p)}}},[l,u,g,f]),y.useEffect(()=>{if(o){const h=p=>{const v=p.target,m={x:p.clientX,y:p.clientY},S=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),b=!cW(m,o);S?f():b&&(f(),c())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[l,u,o,c,f]),_.jsx(XN,{...e,ref:i})}),[nW,rW]=mv(qd,{isInside:!1}),sW=Q$("TooltipContent"),XN=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,l=yv(Dc,n),c=vv(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(y2,u),()=>document.removeEventListener(y2,u)),[u]),y.useEffect(()=>{if(l.trigger){const d=f=>{f.target instanceof Node&&f.target.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),_.jsx(jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:_.jsxs(a_,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[_.jsx(sW,{children:r}),_.jsx(nW,{scope:n,isInside:!0,children:_.jsx(TB,{id:l.contentId,role:"tooltip",children:s||r})})]})})});QN.displayName=Dc;var JN="TooltipArrow",iW=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=vv(n);return rW(JN,n).isInside?null:_.jsx(l_,{...s,...r,ref:t})});iW.displayName=JN;function oW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function aW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function lW(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function cW(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i],l=t[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(s=!s)}return s}function uW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dW(t)}function dW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var fW=KN,hW=qN,pW=YN,ZN=QN,gW="Portal",e4=y.forwardRef((e,t)=>
154{var a;const{container:n,...r}=e,[s,i]=y.useState(!1);Zs(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Dm.createPortal(_.jsx(bt.div,{...r,ref:t}),o):null});e4.displayName=gW;var mW="ToastProvider",[t4,vW,yW]=av("Toast"),[n4,sme]=Vf("Toast",[yW]),[ime,Sv]=n4(mW),r4="ToastViewport",SW=["F8"],b2="toast.viewportPause",_2="toast.viewportResume",s4=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=SW,label:s="Notifications ({hotkey})",...i}=e,o=Sv(r4,n),a=vW(n),l=y.useRef(null),c=y.useRef(null),u=y.useRef(null),d=y.useRef(null),f=ur(t,d,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=o.toastCount>0;y.useEffect(()=>{const v=m=>{var b;r.length!==0&&r.every(w=>m[w]||m.code===w)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),y.useEffect(()=>{const v=l.current,m=d.current;if(h&&v&&m){const S=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent(b2);m.dispatchEvent(C),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(_2);m.dispatchEvent(C),o.isClosePausedRef.current=!1}},w=C=>{!v.contains(C.relatedTarget)&&b()},A=()=>{v.contains(document.activeElement)||b()};return v.addEventListener("focusin",S),v.addEventListener("focusout",w),v.addEventListener("pointermove",S),v.addEventListener("pointerleave",A),window.addEventListener("blur",S),window.addEventListener("focus",b),()=>{v.removeEventListener("focusin",S),v.removeEventListener("focusout",w),v.removeEventListener("pointermove",S),v.removeEventListener("pointerleave",A),window.removeEventListener("blur",S),window.removeEventListener("focus",b)}}},[h,o.isClosePausedRef]);const p=y.useCallback(({tabbingDirection:v})=>{const S=a().map(b=>{const w=b.ref.current,A=[w,...IW(w)];return v==="forwards"?A:A.reverse()});return(v==="forwards"?S.reverse():S).flat()},[a]);return y.useEffect(()=>{const v=d.current;if(v){const m=S=>{var A,C,E;const b=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!b){const x=document.activeElement,R=S.shiftKey;if(S.target===v&&R){(A=c.current)==null||A.focus();return}const I=p({tabbingDirection:R?"backwards":"forwards"}),U=I.findIndex(L=>L===x);dy(I.slice(U+1))?S.preventDefault():R?(C=c.current)==null||C.focus():(E=u.current)==null||E.focus()}};return v.addEventListener("keydown",m),()=>v.removeEventListener("keydown",m)}},[a,p]),_.jsxs(uH,{ref:l,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&_.jsx(w2,{ref:c,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"forwards"});dy(v)}}),_.jsx(t4.Slot,{scope:n,children:_.jsx(bt.ol,{tabIndex:-1,...i,ref:f})}),h&&_.jsx(w2,{ref:u,onFocusFromOutsideViewport:()=>{const v=p({tabbingDirection:"backwards"});dy(v)}})]})});s4.displayName=r4;var i4="ToastFocusProxy",w2=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=Sv(i4,n);return _.jsx(hv,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var c;const a=o.relatedTarget;!((c=i.viewport)!=null&&c.contains(a))&&r()}})});w2.displayName=i4;var zf="Toast",bW="toast.swipeStart",_W="toast.swipeMove",wW="toast.swipeCancel",EW="toast.swipeEnd",o4=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[a,l]=Zc({prop:r,defaultProp:s??!0,onChange:i,caller:zf});return _.jsx(il,{present:n||a,children:_.jsx(xW,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:nr(e.onPause),onResume:nr(e.onResume),onSwipeStart:lt(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:lt(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:lt(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:lt(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});o4.displayName=zf;var[AW,CW]=n4(zf,{onClose(){}}),xW=y.forwardRef((e,t)=>
154{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:g,...h}=e,p=Sv(zf,n),[v,m]=y.useState(null),S=ur(t,L=>m(L)),b=y.useRef(null),w=y.useRef(null),A=s||p.duration,C=y.useRef(0),E=y.useRef(A),x=y.useRef(0),{onToastAdd:R,onToastRemove:T}=p,P=nr(()=>{var z;(v==null?void 0:v.contains(document.activeElement))&&((z=p.viewport)==null||z.focus()),o()}),I=y.useCallback(L=>{!L||L===1/0||(window.clearTimeout(x.current),C.current=new Date().getTime(),x.current=window.setTimeout(P,L))},[P]);y.useEffect(()=>{const L=p.viewport;if(L){const z=()=>{I(E.current),c==null||c()},O=()=>{const j=new Date().getTime()-C.current;E.current=E.current-j,window.clearTimeout(x.current),l==null||l()};return L.addEventListener(b2,O),L.addEventListener(_2,z),()=>{L.removeEventListener(b2,O),L.removeEventListener(_2,z)}}},[p.viewport,A,l,c,I]),y.useEffect(()=>{i&&!p.isClosePausedRef.current&&I(A)},[i,A,p.isClosePausedRef,I]),y.useEffect(()=>(R(),()=>T()),[R,T]);const U=y.useMemo(()=>v?h4(v):null,[v]);return p.viewport?_.jsxs(_.Fragment,{children:[U&&_.jsx(TW,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:U}),_.jsx(AW,{scope:n,onClose:P,children:ti.createPortal(_.jsx(t4.ItemSlot,{scope:n,children:_.jsx(cH,{asChild:!0,onEscapeKeyDown:lt(a,()=>{p.isFocusedToastEscapeKeyDownRef.current||P(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:_.jsx(bt.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:S,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:lt(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:lt(e.onPointerDown,L=>{L.button===0&&(b.current={x:L.clientX,y:L.clientY})}),onPointerMove:lt(e.onPointerMove,L=>{if(!b.current)return;const z=L.clientX-b.current.x,O=L.clientY-b.current.y,j=!!w.current,N=["left","right"].includes(p.swipeDirection),V=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,k=N?V(0,z):0,$=N?0:V(0,O),M=L.pointerType==="touch"?10:2,B={x:k,y:$},H={originalEvent:L,delta:B};j?(w.current=B,qh(_W,d,H,{discrete:!1})):ux(B,p.swipeDirection,M)?(w.current=B,qh(bW,u,H,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(z)>M||Math.abs(O)>M)&&(b.current=null)}),onPointerUp:lt(e.onPointerUp,L=>{const z=w.current,O=L.target;if(O.hasPointerCapture(L.pointerId)&&O.releasePointerCapture(L.pointerId),w.current=null,b.current=null,z){const j=L.currentTarget,N={originalEvent:L,delta:z};ux(z,p.swipeDirection,p.swipeThreshold)?qh(EW,g,N,{discrete:!0}):qh(wW,f,N,{discrete:!0}),j.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),TW=e=>{const{__scopeToast:t,children:n,...r}=e,s=Sv(zf,t),[i,o]=y.useState(!1),[a,l]=y.useState(!1);return kW(()=>o(!0)),y.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:_.jsx(e4,{asChild:!0,children:_.jsx(hv,{...r,children:i&&_.jsxs(_.Fragment,{children:[s.label," ",n]})})})},PW="ToastTitle",a4=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(bt.div,{...r,ref:t})});a4.displayName=PW;var RW="ToastDescription",l4=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return _.jsx(bt.div,{...r,ref:t})});l4.displayName=RW;var c4="ToastAction",u4=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?_.jsx(f4,{altText:n,asChild:!0,children:_.jsx(K_,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${c4}\`. Expected non-empty \`string\`.`),null)});u4.displayName=c4;var d4="ToastClose",K_=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=CW(d4,n);return _.jsx(f4,{asChild:!0,children:_.jsx(bt.button,{type:"button",...r,ref:t,onClick:lt(e.onClick,s.onClose)})})});K_.displayName=d4;var f4=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return _.jsx(bt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function h4(e){const t=[];
154return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),OW(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...h4(r))}}),t}function qh(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Ug(s,i):s.dispatchEvent(i)}var ux=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function kW(e=()=>{}){const t=nr(e);Zs(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function OW(e){return e.nodeType===e.ELEMENT_NODE}function IW(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var p4=s4,g4=o4,m4=a4,v4=l4,y4=u4,S4=K_;function ue(...e){return D$(Vs(e))}const NW=Ss("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",brand:"bg-brand-purple-medium border border-foreground text-foreground hover:shadow-[-7px_6.5px_0px_rgba(0,0,0,1)] rounded-lg","brand-primary":"bg-brand-purple border border-foreground text-white hover:shadow-[-7px_6.5px_0px_rgba(0,0,0,1)] rounded-lg","brand-secondary":"bg-brand-yellow border border-foreground text-foreground hover:shadow-[-7px_6.5px_0px_rgba(0,0,0,1)] rounded-lg"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-lg px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Rt=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>_.jsx(r?kO:"button",{className:ue(NW({variant:t,size:n,className:e})),ref:i,...s}));Rt.displayName="Button";const Da=y.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
154ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Da.displayName="Input";const LW=y.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:ue("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));LW.displayName="Textarea";const b4=y.forwardRef(({className:e,...t},n)=>_.jsx(Bb,{ref:n,className:ue("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:_.jsx(DO,{className:ue("flex items-center justify-center text-current"),children:_.jsx(zb,{className:"h-4 w-4"})})}));b4.displayName=Bb.displayName;const DW=y.forwardRef(({className:e,...t},n)=>_.jsx(qb,{className:ue("grid gap-2",e),...t,ref:n}));DW.displayName=qb.displayName;const MW=y.forwardRef(({className:e,...t},n)=>_.jsx(Yb,{ref:n,className:ue("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:_.jsx(oI,{className:"flex items-center justify-center",children:_.jsx(vj,{className:"h-2.5 w-2.5 fill-current text-current"})})}));MW.displayName=Yb.displayName;const ome=VI,ame=GI,UW=y.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(u_,{ref:r,className:ue("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
154ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,_.jsx(HI,{asChild:!0,children:_.jsx($m,{className:"h-4 w-4 opacity-50"})})]}));UW.displayName=u_.displayName;const _4=y.forwardRef(({className:e,...t},n)=>_.jsx(g_,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(mj,{className:"h-4 w-4"})}));_4.displayName=g_.displayName;const w4=y.forwardRef(({className:e,...t},n)=>_.jsx(m_,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx($m,{className:"h-4 w-4"})}));w4.displayName=m_.displayName;const FW=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>_.jsx(KI,{children:_.jsxs(d_,{ref:s,className:ue("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[_.jsx(_4,{}),_.jsx(JI,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(w4,{})]})}));FW.displayName=d_.displayName;const $W=y.forwardRef(({className:e,...t},n)=>_.jsx(h_,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$W.displayName=h_.displayName;const jW=y.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(p_,{ref:r,className:ue("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(s3,{children:_.jsx(zb,{className:"h-4 w-4"})})}),_.jsx(n3,{children:t})]}));jW.displayName=p_.displayName;const VW=y.forwardRef(({className:e,...t},n)=>_.jsx(v_,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));VW.displayName=v_.displayName;const BW=y.forwardRef(({className:e,...t},n)=>_.jsx(S_,{className:ue("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:_.jsx(p3,{className:ue("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));BW.displayName=S_.displayName;const zW=Ss("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),zs=y.forwardRef(({className:e,...t},n)=>_.jsx(S3,{ref:n,className:ue(zW(),e),...t}));zs.displayName=S3.displayName;const GW="Clear search",HW=y.forwardRef(({className:e,onClear:t,value:n,...r},s)=>{const i=n!==void 0&&n!=="";return _.jsxs("div",{className:"relative",children:[_.jsx(Sj,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),_.jsx("input",{type:"search",className:ue("flex h-10 w-full rounded-full border border-input bg-background py-2 pl-10 pr-10 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,value:n,...r}),i&&t&&_.jsxs("button",{type:"button",onClick:t,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:[_.jsx(Gb,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:GW})]})]})});HW.displayName="SearchInput";const WW=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));
154WW.displayName="Card";const KW=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));KW.displayName="CardHeader";const qW=y.forwardRef(({className:e,children:t,...n},r)=>_.jsx("h3",{ref:r,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...n,children:t}));qW.displayName="CardTitle";const YW=y.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));YW.displayName="CardDescription";const QW=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));QW.displayName="CardContent";const XW=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));XW.displayName="CardFooter";const $o=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>_.jsx(_3,{ref:s,decorative:n,orientation:t,className:ue("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));$o.displayName=_3.displayName;const JW=y.forwardRef(({className:e,...t},n)=>_.jsx(O3,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));JW.displayName=O3.displayName;const ZW=y.forwardRef(({className:e,...t},n)=>_.jsx(I3,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ZW.displayName=I3.displayName;const eK=y.forwardRef(({className:e,...t},n)=>_.jsx(N3,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));eK.displayName=N3.displayName;const tK=y.forwardRef(({className:e,...t},n)=>_.jsx(bG,{ref:n,className:ue("border-b",e),...t}));tK.displayName="AccordionItem";const nK=y.forwardRef(({className:e,children:t,...n},r)=>_.jsx(_G,{className:"flex",children:_.jsxs(Q3,{ref:r,className:ue("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,_.jsx($m,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));nK.displayName=Q3.displayName;const rK=y.forwardRef(({className:e,children:t,...n},r)=>_.jsx(X3,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:ue("pb-4 pt-0",e),children:t})}));rK.displayName=X3.displayName;const sK="Previous slide",iK="Next slide",E4=y.createContext(null);function Gf(){const e=y.useContext(E4);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const oK=y.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:s,children:i,...o},a)=>{const[l,c]=O_({...t,axis:e==="horizontal"?"x":"y"},r),[u,d]=y.useState(!1),[f,g]=y.useState(!1),h=y.useCallback(b=>{b&&(d(b.canScrollPrev()),g(b.canScrollNext()))},[]),p=y.useCallback(()=>{c==null||c.scrollPrev()},[c]),v=y.useCallback(()=>{c==null||c.scrollNext()},[c]),m=y.useCallback(b=>{b.key==="ArrowLeft"?(b.preventDefault(),p()):b.key==="ArrowRight"&&(b.preventDefault(),v())},[p,v]);y.useEffect(()=>{!c||!n||n(c)},[c,n]),y.useEffect(()=>{if(c)return h(c),c.on("reInit",h),c.on("select",h),()=>{c.off("select",h)}},[c,h]);const S=y.useMemo(()=>({carouselRef:l,api:c,opts:t,orientation:e,scrollPrev:p,scrollNext:v,canScrollPrev:u,canScrollNext:f}),[l,c,t,e,p,v,u,f]);return _.jsx(E4.Provider,{value:S,children:_.jsx("div",{ref:a,onKeyDownCapture:m,className:ue("relative",s),role:"region","aria-roledescription":"carousel",...o,children:i})})});oK.displayName="Carousel";const aK=y.forwardRef(({className:e,...t},n)=>{const{carouselRef:r,orientation:s}=Gf();return _.jsx("div",{ref:r,className:"overflow-hidden",children:_.jsx("div",{ref:n,className:ue("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});
154aK.displayName="CarouselContent";const lK=y.forwardRef(({className:e,...t},n)=>{const{orientation:r}=Gf();return _.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:ue("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",e),...t})});lK.displayName="CarouselItem";const cK=y.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollPrev:o,canScrollPrev:a}=Gf();return _.jsxs(Rt,{ref:s,variant:t,size:n,className:ue("absolute h-8 w-8 rounded-full",i==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:o,...r,children:[_.jsx(pj,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:sK})]})});cK.displayName="CarouselPrevious";const uK=y.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollNext:o,canScrollNext:a}=Gf();return _.jsxs(Rt,{ref:s,variant:t,size:n,className:ue("absolute h-8 w-8 rounded-full",i==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:o,...r,children:[_.jsx(gj,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:iK})]})});uK.displayName="CarouselNext";const dK=y.forwardRef(({className:e,...t},n)=>{const{api:r}=Gf(),[s,i]=y.useState(0),[o,a]=y.useState([]);return y.useEffect(()=>{if(!r)return;a(r.scrollSnapList());const l=()=>{i(r.selectedScrollSnap())};return r.on("select",l),l(),()=>{r.off("select",l)}},[r]),_.jsx("div",{ref:n,className:ue("flex justify-center gap-2 pt-4",e),...t,children:o.map((l,c)=>_.jsx("button",{className:ue("h-2 w-2 rounded-full transition-colors",c===s?"bg-primary":"bg-muted-foreground/30"),onClick:()=>r==null?void 0:r.scrollTo(c),"aria-label":`Go to slide ${c+1}`},l))})});dK.displayName="CarouselDots";const fK=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:ue("w-full caption-bottom text-sm",e),...t})}));fK.displayName="Table";const hK=y.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:ue("[&_tr]:border-b",e),...t}));hK.displayName="TableHeader";const pK=y.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:ue("[&_tr:last-child]:border-0",e),...t}));pK.displayName="TableBody";const gK=y.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:ue("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));gK.displayName="TableFooter";const mK=y.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));mK.displayName="TableRow";const vK=y.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));vK.displayName="TableHead";const yK=y.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:ue("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));yK.displayName="TableCell";const SK=y.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:ue("mt-4 text-sm text-muted-foreground",e),...t}));SK.displayName="TableCaption";const bK=y.forwardRef(({className:e,onMouseDown:t,onKeyDown:n,tabIndex:r,style:s,role:i,...o},a)=>_.jsx("div",{ref:a,onMouseDown:t,onKeyDown:n,tabIndex:r,onClick:l=>l.stopPropagation(),style:s,role:i,className:ue("group/handle transition-opacity",e),...o,children:_.jsx("div",{className:"h-4 w-[2px] rounded-full bg-border transition-all group-hover/handle:h-6 group-hover/handle:bg-primary"})}));bK.displayName="TableResizeHandle";const dx=Ss("font-mono",{variants:{variant:{inline:"inline rounded bg-muted px-1.5 py-0.5 text-sm text-foreground",block:"block w-full overflow-x-auto rounded-lg bg-muted p-4 text-sm text-foreground"}},defaultVariants:{variant:"inline"}}),_K=y.forwardRef(({className:e,variant:t,language:n,children:r,...s},i)=>t==="block"?_.jsx("pre",{className:ue(dx({variant:t}),e),"data-language":n,...s,children:_.jsx("code",{ref:i,children:r})}
154):_.jsx("code",{ref:i,className:ue(dx({variant:t}),e),"data-language":n,...s,children:r}));_K.displayName="Code";const wK=Ss("rounded-lg border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"",outline:"bg-transparent"}},defaultVariants:{variant:"default"}}),EK=y.forwardRef(({className:e,variant:t,...n},r)=>_.jsx("div",{ref:r,className:ue(wK({variant:t}),e),...n}));EK.displayName="DataCard";const AK=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("flex flex-row items-center justify-between p-6 pb-2",e),...t}));AK.displayName="DataCardHeader";const CK=y.forwardRef(({className:e,children:t,...n},r)=>_.jsx("h3",{ref:r,className:ue("text-sm font-medium text-muted-foreground",e),...n,children:t}));CK.displayName="DataCardTitle";const xK=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("text-muted-foreground",e),...t}));xK.displayName="DataCardIcon";const TK=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));TK.displayName="DataCardContent";const PK=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:ue("text-2xl font-bold",e),...t}));PK.displayName="DataCardValue";const RK=y.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:ue("text-xs text-muted-foreground",e),...t}));RK.displayName="DataCardDescription";const kK=Ss("inline-flex items-center text-xs font-medium",{variants:{trend:{up:"text-green-600 dark:text-green-400",down:"text-red-600 dark:text-red-400",neutral:"text-muted-foreground"}},defaultVariants:{trend:"neutral"}}),OK=y.forwardRef(({className:e,trend:t,...n},r)=>_.jsx("span",{ref:r,className:ue(kK({trend:t}),e),...n}));OK.displayName="DataCardTrend";function IK(e=1500){const[t,n]=y.useState(!1),r=y.useRef();y.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const s=y.useCallback(async i=>{try{return await window.navigator.clipboard.writeText(i),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),e),!0}catch{return n(!1),!1}},[e]);return{copied:t,copy:s}}const NK=y.forwardRef(({value:e,copyLabel:t="Copy",copiedLabel:n="Copied",resetDelay:r=1500,onCopy:s,onClick:i,variant:o="ghost",size:a="icon",className:l,...c},u)=>{const{copied:d,copy:f}=IK(r),g=d?n:t;return _.jsx(Rt,{ref:u,variant:o,size:a,title:g,"aria-label":g,className:ue("h-6 w-6",l),...c,onClick:h=>{if(h.stopPropagation(),i==null||i(h),h.defaultPrevented)return;const p=typeof e=="function"?e():e;f(p).then(v=>{v&&(s==null||s(p))})},children:d?_.jsx(zb,{className:"h-3.5 w-3.5 text-emerald-500"}):_.jsx(yj,{className:"h-3.5 w-3.5"})})});NK.displayName="CopyButton";const LK=Ss("flex flex-col items-center justify-center gap-3 text-center",{variants:{variant:{empty:"",error:""},size:{default:"p-6",sm:"p-4",lg:"p-10"}},defaultVariants:{variant:"empty",size:"default"}}),DK=Ss("flex items-center justify-center",{variants:{variant:{empty:"text-muted-foreground/40",error:"text-destructive"}},defaultVariants:{variant:"empty"}}),MK=y.forwardRef(({className:e,variant:t,size:n,icon:r,title:s,description:i,action:o,...a},l)=>_.jsxs("div",{ref:l,className:ue(LK({variant:t,size:n}),e),...a,children:[r&&_.jsx("div",{className:ue(DK({variant:t})),children:r}),_.jsx("h3",{className:"text-base font-semibold text-foreground",children:s}),i&&_.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:i}),o&&_.jsx("div",{className:"mt-1",children:o})]}));MK.displayName="EmptyState";const UK=y.forwardRef(({...e},t)=>_.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));UK.displayName="Breadcrumb";const FK=y.forwardRef(({className:e,...t},n)=>_.jsx("ol",{ref:n,className:ue("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));FK.displayName="BreadcrumbList";const $K=y.forwardRef(({className:e,...t},n)=>_.jsx("li",{ref:n,className:ue("inline-flex items-center gap-1.5",e),...t}));$K.displayName="BreadcrumbItem";const jK=y.forwardRef(({asChild:e,className:t,...n},r)=>_.jsx(e?kO:"a",{ref:r,className:ue("transition-colors hover:text-foreground",t),...n}));jK.displayName="BreadcrumbLink";const VK=y.forwardRef(({className:e,...t},n)=>_.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ue("font-normal text-foreground",e),...t}));VK.displayName="BreadcrumbPage";const BK=y.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(bN,{ref:r,className:ue("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,_.jsx(A4,{})]}));BK.displayName=bN.displayName;const zK=y.forwardRef(({className:e,...t},n)=>_.jsx(_N,{ref:n,className:ue("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));zK.displayName=_N.displayName;const GK=Ss("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),HK=y.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(wN,{ref:r,className:ue(GK(),"group",e),...n,children:[t," ",_.jsx($m,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));HK.displayName=wN.displayName;const WK=y.forwardRef(({className:e,...t},n)=>_.jsx(AN,{ref:n,className:ue("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 left-0 top-0 w-full md:absolute md:w-auto",e),...t}));WK.displayName=AN.displayName;const A4=y.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:ue("absolute left-0 top-full flex justify-center"),children:_.jsx(CN,{className:ue("origin-top-center data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));A4.displayName=CN.displayName;const KK=y.forwardRef(({className:e,...t},n)=>_.jsx(EN,{ref:n,className:ue("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",e),...t,children:_.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));KK.displayName=EN.displayName;const qK="Close",YK=TN,QK=kN,C4=y.forwardRef(({className:e,...t},n)=>_.jsx(j_,{ref:n,className:ue("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));C4.displayName=j_.displayName;const x4=y.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(QK,{children:[_.jsx(C4,{}),_.jsxs(V_,{ref:r,className:ue("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,_.jsxs(DN,{className:"absolute right-4 top-4 roun
154ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx(Gb,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:qK})]})]})]}));x4.displayName=V_.displayName;const XK=({className:e,...t})=>_.jsx("div",{className:ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});XK.displayName="DialogHeader";const JK=({className:e,...t})=>_.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});JK.displayName="DialogFooter";const ZK=y.forwardRef(({className:e,...t},n)=>_.jsx(B_,{ref:n,className:ue("text-lg font-semibold leading-none tracking-tight",e),...t}));ZK.displayName=B_.displayName;const eq=y.forwardRef(({className:e,...t},n)=>_.jsx(z_,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));eq.displayName=z_.displayName;const tq=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>_.jsx(YH,{children:_.jsx(HN,{ref:s,align:t,sideOffset:n,className:ue("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",e),...r})}));tq.displayName=HN.displayName;const lme=fW,cme=hW,ume=pW,nq=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(ZN,{ref:r,sideOffset:t,className:ue("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md",e),...n}));nq.displayName=ZN.displayName;const rq=y.forwardRef(({className:e,...t},n)=>_.jsx(p4,{ref:n,className:ue("fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:max-w-[420px] sm:flex-col",e),...t}));rq.displayName=p4.displayName;const sq=Ss("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-bottom-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",success:"border-green-500 bg-green-50 text-green-900 dark:bg-green-950 dark:text-green-100",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),iq=y.forwardRef(({className:e,variant:t,...n},r)=>_.jsx(g4,{ref:r,className:ue(sq({variant:t}),e),...n}));iq.displayName=g4.displayName;const oq=y.forwardRef(({className:e,...t},n)=>_.jsx(y4,{ref:n,className:ue("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));oq.displayName=y4.displayName;const aq=y.forwardRef(({className:e,...t},n)=>_.jsx(S4,{ref:n,className:ue("absolute right-2 top-2 rounded-md p-1 text-foreground
154/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:_.jsx(Gb,{className:"h-4 w-4"})}));aq.displayName=S4.displayName;const lq=y.forwardRef(({className:e,...t},n)=>_.jsx(m4,{ref:n,className:ue("text-sm font-semibold",e),...t}));lq.displayName=m4.displayName;const cq=y.forwardRef(({className:e,...t},n)=>_.jsx(v4,{ref:n,className:ue("text-sm opacity-90",e),...t}));cq.displayName=v4.displayName;const uq=Ss("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function dme({className:e,variant:t,...n}){return _.jsx("div",{className:ue(uq({variant:t}),e),...n})}const fx=Ss("animate-spin text-muted-foreground",{variants:{size:{default:"h-6 w-6",sm:"h-4 w-4",lg:"h-8 w-8",xl:"h-12 w-12"}},defaultVariants:{size:"default"}}),ds=y.forwardRef(({className:e,size:t,fixed:n=!1,...r},s)=>n?_.jsx("div",{ref:s,className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80",...r,children:_.jsx(OC,{className:ue(fx({size:t}),e)})}):_.jsx("div",{ref:s,className:ue("flex items-center justify-center",e),...r,children:_.jsx(OC,{className:ue(fx({size:t}))})}));ds.displayName="Loader";y.createContext(void 0);const dq="data:image/svg+xml,%3csvg%20width='305'%20height='107'%20viewBox='0%200%20305%20107'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M52.2761%2023.5437C56.79%2031.9079%2059.291%2042.5026%2059.291%2053.531C59.291%2072.6757%2051.7271%2089.8998%2040.4423%2096.7771C40.5643%2097.1488%2040.6253%2097.4586%2040.6253%2097.8303C40.6253%2099.751%2039.1003%20101.3%2037.1484%20101.3C35.1964%20101.3%2035.8064%20101.114%2035.2574%20100.742V101.3C35.2574%20104.46%2032.7564%20107%2029.6455%20107C26.5345%20107%2024.0336%20104.46%2024.0336%20101.3C24.0336%2098.1401%2024.0336%20100.928%2024.0336%20100.742C23.4846%20101.114%2022.8136%20101.3%2022.1426%20101.3C20.2516%20101.3%2018.6657%2099.751%2018.6657%2097.8303C18.6657%2095.9097%2018.6657%2097.0869%2018.8487%2096.7771C7.56387%2089.8998%200%2072.6138%200%2053.531C0%2034.4482%202.50095%2031.7221%207.13687%2023.2959C6.95388%2023.172%206.77088%2022.9861%206.64888%2022.8002C5.12391%2021.0654%204.26992%2018.7111%204.08693%2016.2328C3.96493%2014.436%204.08693%2012.6393%204.75792%2011.0284C4.87991%2010.7805%205.18491%209.9751%205.91689%209.91314C6.70988%209.78923%207.19787%2010.5327%207.62487%2011.1523C7.80786%2011.4001%207.92986%2011.6479%208.11286%2011.7719C8.96684%2012.5773%2010.0648%2013.2588%2011.4678%2013.8784C12.1388%2014.1882%2012.8098%2014.436%2013.5418%2014.6838C15.2497%2012.949%2017.0187%2011.524%2018.9097%2010.3468C18.7877%2010.0371%2018.7267%209.66532%2018.7267%209.29357C18.7267%207.3729%2020.2516%205.76201%2022.2036%205.76201C24.1556%205.76201%2023.5456%205.94789%2024.0946%206.31963V5.70006C24.0946%202.54024%2026.5955%200%2029.7065%200C32.8174%200%2035.3184%202.54024%2035.3184%205.70006C35.3184%208.85987%2035.3184%206.0718%2035.3184%206.31963C35.8674%205.94789%2036.5384%205.76201%2037.2094%205.76201C39.1003%205.76201%2040.6863%207.31094%2040.6863%209.29357C40.6863%2011.2762%2040.6863%2010.0371%2040.5033%2010.3468C42.4553%2011.524%2044.2852%2013.011%2046.0542%2014.8697C46.7252%2014.6219%2047.4572%2014.3741%2048.1282%2014.0643C49.5311%2013.4447%2050.6291%2012.7632%2051.4221%2011.9577C51.5441%2011.8338%2051.7271%2011.586%2051.9101%2011.3382C52.3371%2010.7186%2052.8861%209.9751%2053.6181%2010.099C54.3501%2010.2229%2054.655%2010.9664%2054.777%2011.2762C55.387%2012.8871%2055.631%2014.7458%2055.448%2016.5426C55.265%2019.0208%2054.35%2021.4372%2052.8251%2023.11C52.7031%2023.2339%2052.5201%2023.4818%2052.2151%2023.6676V23.5437H52.2761ZM54.838%2053.5929C54.838%2031.4123%2043.5532%2013.3827%2029.7065%2013.3827C15.8597%2013.3827%204.57492%2031.4123%204.57492%2053.5929C4.57492%2075.7736%2015.8597%2093.8031%2029.7065%2093.8031C43.5532%2093.8031%2054.838%2075.7736%2054.838%2053.5929Z'%20fill='black'/%3e%3cpath%20d='M47.8824%2040.834C48.0654%2041.0819%2048.0044%2041.3917%2047.7604%2041.5775C47.5164%2041.7634%2047.2114%2041.7014%2047.0284%2041.4536C46.4184%2040.5243%2045.1375%2040.0906%2043.8565%2040.3384C42.7585%2040.5243%2041.8435%2041.2058%2041.1725%2041.8873C41.9045%2041.7634%2042.6365%2041.8873%2043.2465%2042.0732C44.5885%2042.6308%2045.5035%2043.9319%2045.8695%2045.7906C46.1744%2047.5254%2045.8695%2049.57%2045.1375%2051.5526C44.9545%2051.9863%2044.7715%2052.3581%2044.5885%2052.7298C45.1985%2052.1722%2045.7475%2051.6146%2046.2964%2050.9331C46.4794%2050.6852%2046.7844%2050.6852%2047.0284%2050.9331C47.2724%2051.1189%2047.2724%2051.4287%2047.0284%2051.6765C45.8085%2053.2255%2044.2225%2054.5885%2042.4535%2055.5179C41.2335%2056.6951%2039.8306%2057.3766%2038.5496%2057.3766C37.2686%2057.3766%2037.6346%2057.3146%2037.2076%2057.1288C35.3166%2056.3233%2034.2797%2053.969%2034.5237%2051.057C34.1577%2051.3668%2033.7307%2051.6765%2033.3647%2051.8624C33.1207%2051.9863%2032.8767%2052.0483%2032.6937%2052.0483C32.5107%2052.0483%2032.2667%2052.0483%2032.0837%2051.8005C31.7787%2051.4907%2031.8397%2051.057%2031.8397%2050.9331C31.8397%2050.0037%2032.2057%2049.0743%2032.6327%2048.2069C32.7547%2047.9591%2033.1207%2047.8352%2033.3647%2047.9591C33.6087%2048.083%2033.7307%2048.3928%2033.6087%2048.7026C33.2427%2049.3841%2033.0597%2050.1276%2032.9377%2050.9331C33.9137%2050.3754%2034.8286%2049.508%2035.7436%2048.3309C36.4756%2047.4015%2037.0856%2046.3482%2037.6346%2045.3569L37.8176%2045.0471C38.0006%2044.7373%2038.1226%2044.4276%2038.3056%2044.1797C38.4886%2043.808%2038.7936%2043.3743%2039.0376%2042.9406C39.2816%2042.5688%2039.5256%2042.1971%2039.8916%2041.8254C40.6845%2040.896%2041.9045%2039.7808%2043.6125%2039.409C45.2595%2039.0992%2046.9674%2039.7188%2047.8214%2040.958L47.8824%2040.834ZM41.2945%2046.7819L43.2465%2046.5341L41.5385%2045.5428L41.0505%2045.233C41.0505%2044.4895%2041.0505%2043.6221%2041.4165%2042.8786C40.9285%2042.8786%2040.3795%2043.1265%2039.8916%2043.4362C39.6476%2043.808%2039.4036%2044.1797%2039.2206%2044.5515C39.0376%2044.8
154613%2038.8546%2045.1091%2038.7326%2045.4189L38.5496%2045.7287C38.0006%2046.72%2037.3296%2047.8352%2036.5976%2048.8265C36.3536%2049.1363%2036.1096%2049.4461%2035.8656%2049.6939C35.2556%2052.6059%2035.9876%2055.2701%2037.6956%2055.9516C38.9156%2056.4472%2040.4405%2055.9516%2041.7825%2054.6505C41.7825%2054.5885%2041.9045%2054.5266%2041.9655%2054.4646C42.6365%2053.7831%2043.2465%2052.8537%2043.7955%2051.8624C42.8195%2051.6146%2041.7215%2049.6939%2041.2945%2047.2776C41.2945%2047.0917%2041.2945%2046.9058%2041.1725%2046.72H41.2945V46.7819Z'%20fill='black'/%3e%3cpath%20d='M29.7131%2013.3192C43.5599%2013.3192%2054.8447%2031.3487%2054.8447%2053.5294C54.8447%2075.7101%2043.5599%2093.7396%2029.7131%2093.7396C15.8663%2093.7396%204.58154%2075.7101%204.58154%2053.5294C4.58154%2031.3487%2015.8663%2013.3192%2029.7131%2013.3192ZM47.7688%2041.5717C48.0128%2041.3858%2048.0738%2041.076%2047.8908%2040.8282C47.0368%2039.5891%2045.3288%2038.9075%2043.6819%2039.2793C41.9739%2039.5891%2040.6929%2040.7662%2039.9609%2041.6956C39.6559%2042.0673%2039.3509%2042.4391%2039.1069%2042.8108C38.8019%2043.3065%2038.5579%2043.6782%2038.375%2044.05C38.192%2044.3598%2038.009%2044.6695%2037.887%2044.9174L37.704%2045.2272C37.155%2046.2185%2036.545%2047.2717%2035.813%2048.2011C34.898%2049.3783%2033.983%2050.1837%2033.007%2050.8033C33.129%2050.0598%2033.312%2049.3163%2033.678%2048.5728C33.8%2048.325%2033.678%2047.9533%2033.434%2047.8294C33.19%2047.7054%2032.824%2047.8294%2032.7021%2048.0772C32.2751%2048.9446%2032.0311%2049.8739%2031.9091%2050.8033C31.9091%2050.9272%2031.9091%2051.3609%2032.1531%2051.6707C32.3361%2051.8566%2032.5191%2051.9185%2032.763%2051.9185C33.007%2051.9185%2033.19%2051.9185%2033.434%2051.7327C33.861%2051.4848%2034.227%2051.237%2034.593%2050.9272C34.349%2053.8392%2035.325%2056.1936%2037.277%2056.999C37.704%2057.1849%2038.192%2057.2468%2038.6189%2057.2468C39.8999%2057.2468%2041.3029%2056.5653%2042.5229%2055.3881C44.2309%2054.4588%2045.8168%2053.1577%2047.0978%2051.5468C47.2808%2051.299%2047.2198%2050.9892%2047.0978%2050.8033C46.8538%2050.6174%2046.5488%2050.6794%2046.3658%2050.8033C45.8778%2051.4229%2045.2678%2052.0424%2044.6578%2052.6001C44.8408%2052.2283%2045.0238%2051.8566%2045.2068%2051.4229C45.9998%2049.4402%2046.2438%2047.3957%2045.9388%2045.6609C45.5728%2043.8021%2044.6578%2042.501%2043.3159%2041.9434C42.6449%2041.6956%2041.9739%2041.6336%2041.2419%2041.7576C41.9129%2041.076%2042.8279%2040.3945%2043.9259%2040.2086C45.1458%2039.9608%2046.4268%2040.3945%2047.0978%2041.3238C47.2808%2041.5717%2047.5858%2041.6336%2047.8298%2041.4478L47.7688%2041.5717ZM44.6578%2070.3818C44.7798%2070.3198%2044.7798%2070.1339%2044.6578%2070.01C44.6578%2069.8861%2044.4138%2069.8861%2044.2918%2070.01L25.5042%2084.508C25.3822%2084.5699%2025.3822%2084.7558%2025.5042%2084.8797C25.5042%2084.9417%2025.6262%2085.0036%2025.6872%2085.0036H25.8702L44.7188%2070.5057V70.3818H44.6578ZM38.07%2081.4721C38.192%2081.4101%2038.192%2081.2243%2038.07%2081.1003C38.07%2080.9764%2037.826%2080.9764%2037.704%2081.0384L32.885%2084.6319C32.7631%2084.6939%2032.7631%2084.8797%2032.885%2085.0036C32.885%2085.0656%2033.007%2085.1276%2033.068%2085.1276H33.251L38.07%2081.534V81.4721ZM36.789%2019.5149C36.911%2019.391%2036.911%2019.2671%2036.789%2019.1432C36.667%2019.0193%2036.545%2019.0193%2036.423%2019.1432L17.5743%2033.6412C17.4523%2033.6412%2017.4523%2033.889%2017.5743%2034.0129C17.5743%2034.0129%2017.6963%2034.1368%2017.7573%2034.1368H17.9403C17.9403%2034.1368%2036.728%2019.6388%2036.789%2019.6388V19.5149ZM34.654%2034.3227C34.776%2034.3227%2034.776%2034.0749%2034.654%2033.951C34.532%2033.827%2034.41%2033.827%2034.288%2033.951L29.4691%2037.5445C29.3471%2037.6684%2029.3471%2037.7923%2029.4691%2037.9162C29.4691%2037.9162%2029.5911%2038.0401%2029.7131%2038.0401C29.8351%2038.0401%2029.8351%2038.0401%2029.8351%2038.0401L34.654%2034.4466V34.3227ZM34.41%2067.0361C34.532%2066.9741%2034.532%2066.7882%2034.41%2066.6643C34.288%2066.5404%2034.166%2066.5404%2034.044%2066.6643L23.9182%2074.5948C23.7962%2074.6568%2023.7962%2074.8427%2023.9182%2074.9666C23.9182%2075.0285%2024.0402%2075.0905%2024.1012%2075.0905C24.1622%2075.0905%2024.2232%2075.0905%2024.2842%2075.0286L34.41%2067.098V67.0361ZM33.19%2063.4426C33.312%2063.3806%2033.312%2063.1947%2033.19%2063.0708C33.19%2062.9469%2032.946%2062.9469%2032.824%2063.0089L28.0051%2066.6024C27.8831%2066.6643%2027.8831%2066.8502%2028.0051%2066.9741C28.0051%2067.0361%2028.1271%2067.098%2028.1881%2067.098H28.3711L33.19%2063.5045V63.4426ZM31.2381%2019.7628C31.3601%2019.6388%2031.3601%2019.5149%2031.2381%2019.391C31.1161%2019.2671%2030.9941%2019.2671%2030.8721%2019.391L20.7463%2027.3215C20.6243%2027.4454%2020.6243%2027.5694%2020.7463%2027.6933C20.7463%2027.6933%2020.8683%2027.8172%2020.9293%2027.8172H21.1123L31.2381%2019.8867V19.7628ZM27.8831%2052.1664C28.1271%2051.8566%2028.1271%2051.4229%2028.1271%2051.299C28.0051%2050.3076%2027.7611%2049.3783%2027.3341%2048.5728C27.2121%2048.325%2026.9072%2048.2011%2026.6022%2048.325C26.2972%2048.4489%2026.2362%2048.7587%2026.3582%2049.0685C26.7242%2049.75%2026.9072%2050.4935%2027.0291%2051.299C26.0532%2050.7413%2025.1382%2049.8739%2024.2232%2048.6968C23.4912%2047.7674%2022.8812%2046.7141%2022.3322%2045.7228L22.1492%2045.3511C21.9662%2045.0413%2021.8442%2044.7935%2021.6612%2044.4837C21.4782%2044.1119%2021.1733%2043.6782%2020.9293%2043.2445C20.6853%2042.8728%2020.3803%2042.501%2020.0753%2042.1293C19.2823%2041.1999%2018.0623%2040.0847%2016.3543%2039.713C14.7074%2039.4032%2012.9994%2040.0228%2012.1454%2041.2619C11.9624%2041.5097%2012.0234%2041.8195%2012.2674%2042.0054C12.5114%2042.1913%2012.8164%2042.1293%2012.9994%2041.8815C13.6094%2041.0141%2014.8904%2040.5184%2016.1713%2040.7662C17.2693%2041.0141%2018.1843%2041.6336%2018.8553%2042.3152C18.1233%2042.1913%2017.3913%2042.3152%2016.7813%2042.501C15.4394%2043.0587%2014.5244%2044.3598%2014.1584%2046.2185C13.8534%2047.9533%2014.1584%2049.9979%2014.8904%2051.9805C15.0734%2052.4142%2015.2564%2052.7859%2015.4394%2053.1577C14.8294%2052.6001%2014.2194%2052.0424%2013.7314%2051.3609C13.5484%2051.1131%2013.2434%2051.1131%2012.9994%2051.3609C12.7554%2051.6087%2012.7554%2051.8566%2012.9994%2052.1044C14.2194%2053.6533%2015.8053%2055.0164%2017.5743%2055.9457C18.7943%2057.1229%202
1540.1973%2057.8045%2021.4782%2057.8045C22.7592%2057.8045%2022.3932%2057.7425%2022.8202%2057.5566C24.7112%2056.7512%2025.7482%2054.3968%2025.5042%2051.4848C25.8702%2051.7946%2026.2972%2052.0424%2026.7242%2052.2903C26.9681%2052.4142%2027.2121%2052.4761%2027.3951%2052.4761C27.5781%2052.4761%2027.8831%2052.4761%2028.0051%2052.2283L27.8831%2052.1664Z'%20fill='%23E4E3FD'/%3e%3cpath%20d='M44.7142%2070.0098C44.8362%2070.1337%2044.7142%2070.3196%2044.7142%2070.3815L25.8655%2084.8795H25.6825C25.6825%2084.8795%2025.4995%2084.8795%2025.4995%2084.7556C25.3775%2084.6317%2025.4995%2084.4458%2025.4995%2084.3839L44.2872%2069.8859C44.4092%2069.8239%2044.5922%2069.8239%2044.6532%2069.8859V70.0098H44.7142Z'%20fill='black'/%3e%3cpath%20d='M38.1312%2081.1002C38.2532%2081.2241%2038.1312%2081.41%2038.1312%2081.472L33.3123%2085.0655H33.1293C33.1293%2085.0655%2032.9463%2085.0655%2032.9463%2084.9416C32.9463%2084.8177%2032.9463%2084.6318%2032.9463%2084.5698L37.7652%2080.9763C37.8872%2080.9143%2038.0702%2080.9143%2038.1312%2081.0383V81.1002Z'%20fill='black'/%3e%3cpath%20d='M36.8397%2019.1433C36.9617%2019.2672%2036.8397%2019.4531%2036.8397%2019.5151L18.052%2034.013H17.869C17.808%2034.013%2017.686%2034.013%2017.686%2033.8891C17.686%2033.7652%2017.686%2033.5793%2017.686%2033.5174L36.5347%2019.0194C36.6567%2019.0194%2036.8397%2019.0194%2036.9007%2019.0194V19.1433H36.8397Z'%20fill='black'/%3e%3cpath%20d='M34.711%2033.957C34.711%2034.081%2034.711%2034.2668%2034.711%2034.3288L29.8921%2037.9223H29.7701C29.7701%2037.9223%2029.5871%2037.9223%2029.5261%2037.7984C29.4651%2037.6745%2029.5261%2037.4886%2029.5261%2037.4266L34.345%2033.8331C34.467%2033.8331%2034.65%2033.8331%2034.711%2033.8331V33.957Z'%20fill='black'/%3e%3cpath%20d='M34.41%2066.6623C34.41%2066.7862%2034.41%2066.972%2034.41%2067.034L24.2842%2074.9645C24.2842%2074.9645%2024.1622%2075.0265%2024.1012%2075.0265C24.0402%2075.0265%2023.9182%2075.0265%2023.9182%2074.9026C23.9182%2074.7786%2023.9182%2074.5928%2023.9182%2074.5308L34.044%2066.6003C34.166%2066.5383%2034.349%2066.5383%2034.41%2066.6003V66.6623Z'%20fill='black'/%3e%3cpath%20d='M33.2467%2063.0128C33.3687%2063.1367%2033.2467%2063.3226%2033.2467%2063.3846L28.4278%2066.9781H28.2448C28.2448%2066.9781%2028.0618%2066.9781%2028.0618%2066.8542C28.0618%2066.7302%2028.0618%2066.5444%2028.0618%2066.4824L32.8807%2062.8889C33.0027%2062.8269%2033.1857%2062.8269%2033.2467%2062.9509V63.0128Z'%20fill='black'/%3e%3cpath%20d='M31.2975%2019.3953C31.4195%2019.5192%2031.2975%2019.7051%2031.2975%2019.767L21.1717%2027.6976H20.9887C20.9277%2027.6976%2020.8057%2027.6976%2020.8057%2027.5736C20.6837%2027.4497%2020.8057%2027.2639%2020.8057%2027.2019L30.9315%2019.2714C31.0535%2019.1475%2031.2365%2019.2714%2031.2975%2019.2714V19.3953Z'%20fill='black'/%3e%3cpath%20d='M28.057%2051.2983C28.057%2051.4222%2028.057%2051.8559%2027.8131%2052.1657C27.6301%2052.3516%2027.4471%2052.4136%2027.2031%2052.4136C26.9591%2052.4136%2026.7761%2052.4136%2026.5321%2052.2277C26.1051%2051.9799%2025.7391%2051.732%2025.312
1541%2051.4222C25.5561%2054.3342%2024.5801%2056.6886%2022.6281%2057.494C22.2011%2057.6799%2021.7132%2057.7419%2021.2862%2057.7419C19.9442%2057.7419%2018.6022%2057.0603%2017.3822%2055.8832C15.6133%2054.9538%2014.0883%2053.6527%2012.8073%2052.0418C12.6243%2051.794%2012.6853%2051.4842%2012.8073%2051.2983C13.0513%2051.1125%2013.3563%2051.1744%2013.5393%2051.2983C14.0273%2051.9179%2014.6373%2052.5375%2015.2473%2053.0951C15.0643%2052.7233%2014.8813%2052.3516%2014.6983%2051.9179C13.9053%2049.9353%2013.6613%2047.8907%2013.9663%2046.1559C14.2713%2044.2972%2015.1863%2042.9961%2016.5892%2042.4385C17.2602%2042.1906%2017.9312%2042.1287%2018.6632%2042.2526C17.9922%2041.5711%2017.0772%2040.8895%2015.9793%2040.7037C14.7593%2040.4558%2013.4783%2040.8895%2012.8073%2041.8189C12.6243%2042.0667%2012.3193%2042.1287%2012.0753%2041.9428C11.8313%2041.7569%2011.7703%2041.4471%2011.9533%2041.1993C12.8073%2039.9602%2014.5153%2039.2786%2016.1623%2039.6504C17.8702%2039.9602%2019.0902%2041.1374%2019.8832%2042.0667C20.1882%2042.4385%2020.4932%2042.8102%2020.7372%2043.1819C21.0422%2043.6156%2021.2862%2044.0493%2021.4692%2044.4211C21.6522%2044.6689%2021.7742%2044.9787%2021.9572%2045.2885L22.1401%2045.6602C22.6891%2046.6515%2023.2991%2047.7048%2024.0311%2048.6342C24.9461%2049.8114%2025.8611%2050.6168%2026.8371%2051.2364C26.8371%2050.4929%2026.5321%2049.7494%2026.1661%2049.0059C26.0441%2048.7581%2026.1661%2048.4483%2026.4101%2048.2624C26.6541%2048.0766%2026.9591%2048.2624%2027.1421%2048.5103C27.5691%2049.3777%2027.813%2050.307%2027.935%2051.2364L28.057%2051.2983ZM22.2621%2056.4408C23.9701%2055.7592%2024.7631%2053.0951%2024.0921%2050.1831C24.0921%2050.1831%2024.0921%2050.0592%2023.9701%2050.0592C24.2751%2052.5375%2023.7871%2054.5201%2022.8111%2054.7679C21.7132%2054.9538%2020.4322%2052.9092%2019.8832%2050.1831C19.8832%2049.9972%2019.8832%2049.8114%2019.7612%2049.6255H19.8832L21.8352%2049.3777L20.1272%2048.3863L19.6392%2048.0766C19.6392%2046.5276%2020.0052%2045.3504%2020.6152%2044.9167C20.4322%2044.607%2020.2492%2044.2972%2020.0052%2043.9254C18.9682%2043.3059%2017.9312%2043.12%2017.0162%2043.4917C16.0403%2043.9254%2015.3083%2044.9167%2015.0643%2046.4037C14.7593%2047.9526%2015.0643%2049.8114%2015.7353%2051.5462C16.2843%2052.9092%2017.0772%2054.0864%2017.9312%2054.9538C18.0532%2054.9538%2018.1142%2055.0777%2018.1142%2055.1397C19.4562%2056.3788%2020.9202%2056.9364%2022.2011%2056.3788H22.2621V56.4408Z'%20fill='black'/%3e%3cpath%20d='M304.399%2055.3351C304.399%2056.8221%20304.643%2058.433%20304.521%2059.9199C304.338%2062.646%20302.325%2063.5754%20299.885%2063.5134H291.772C291.04%2063.5134%20290.552%2062.8939%20290.491%2062.2123C290.491%2061.1591%20290.369%2060.1058%20290.308%2058.9906C286.465%2062.2743%20281.768%2064.7526%20276.644%2064.0091C274.326%2063.6374%20272.252%2062.4602%20271.215%2060.2917C270.178%2058.1851%20270.178%2055.7688%20270.056%2053.4764C269.934%2050.4405%20269.873%2047.4046%20269.751%2044.3067C269.69%2041.5187%20269.446%2038.7306%20269.751%2035.9425C270.056%2033.5262%20270.91%2031.1718%20272.557%2029.3751C274.265%2027.5783%20276.644%2026.7109%20279.023%2026.587C281.646%2026.4011%20284.391%2027.1446%20286.831%2028.012C287.99%2028.4457%20289.088%2028.9414%20290.064%2029.5609C289.942%2026.8968%20289.82%2024.1707%20289.698%2021.5065C289.637%2019.7717%20289.393%2017.9749%20289.515%2016.2401C289.576%2014.6912%20290.43%2013.6379%20291.955%2013.4521C293.541%2013.2662%20295.188%2013.4521%20296.835%2013.4521C298.482%2013.4521%20299.763%2013.2042%20301.105%2013.4521C304.216%2014.1956%20303.667%2017.9749%20303.667%2020.4532C303.667%2027.1446%20303.301%2033.836%20303.545%2040.5893C303.667%2043.7491%20303.911%2046.9089%20304.094%2050.1307C304.094%2051.8655%20304.216%2053.5383%20304.277%2055.2731H304.399V55.3351ZM301.837%2060.5395C302.203%2060.1058%20302.02%2058.9906%20301.959%2058.4949C301.959%2057.6895%20301.959%2056.884%20301.837%2056.1405C301.593%2050.5644%20301.227%2045.0502%20300.983%2039.4741C300.8%2033.7121%20301.105%2027.95%20301.105%2022.188V17.7271C301.105%2017.3554%20301.227%2016.5499%20300.922%2016.2401C300.678%2015.9303%20299.946%2016.0543%20299.641%2016.0543H295.371C294.883%2
154016.0543%20292.321%2015.8684%20292.199%2016.0543C291.955%2016.426%20292.199%2017.4793%20292.199%2017.913L292.321%2019.8956C292.321%2021.2587%20292.443%2022.6837%20292.504%2024.0467C292.626%2026.7109%20292.748%2029.437%20292.87%2032.1012C293.175%2032.6588%20292.87%2033.1544%20292.565%2033.4642C292.016%2033.9599%20290.979%2033.8979%20290.552%2033.1544C289.21%2031.3577%20286.892%2030.6142%20284.879%2029.9946C282.561%2029.2511%20279.999%2028.7555%20277.62%2029.3751C273.045%2030.5522%20272.191%2035.3849%20272.191%2039.598C272.252%2044.4306%20272.496%2049.3253%20272.679%2054.1579C272.74%2055.9547%20272.801%2058.0612%20273.899%2059.6101C275.119%2061.283%20277.376%2061.5308%20279.267%2061.4069C283.598%2061.0971%20287.319%2058.371%20290.369%2055.3971C290.491%2055.2112%20290.613%2055.1492%20290.796%2055.0253C291.223%2054.7155%20291.711%2054.7775%20292.077%2055.0253C292.321%2055.2112%20292.504%2055.459%20292.626%2055.7688V56.0786C292.626%2057.6275%20292.809%2059.1764%20292.931%2060.6634C295.188%2060.6634%20297.384%2060.6015%20299.641%2060.6634C300.251%2060.6634%20301.349%2060.7873%20301.776%2060.2917V60.4776L301.837%2060.5395Z'%20fill='black'/%3e%3cpath%20d='M302.014%2058.4971C302.014%2058.9927%20302.197%2060.1079%20301.892%2060.5416C301.465%2061.0373%20300.306%2060.9134%20299.757%2060.9134C297.5%2060.8514%20295.304%2060.9134%20293.047%2060.9134C292.925%2059.3645%20292.864%2057.8155%20292.742%2056.3286V56.0188C292.742%2055.647%20292.437%2055.4612%20292.193%2055.2753C291.827%2055.0275%20291.339%2054.9655%20290.912%2055.2753C290.729%2055.3372%20290.607%2055.4612%20290.485%2055.647C287.435%2058.621%20283.714%2061.3471%20279.383%2061.6569C277.492%2061.7808%20275.235%2061.5949%20274.015%2059.8601C272.917%2058.3112%20272.917%2056.2047%20272.795%2054.4079C272.612%2049.5752%20272.368%2044.6806%20272.307%2039.848C272.307%2035.6968%20273.1%2030.8642%20277.736%2029.625C280.176%2029.0055%20282.677%2029.625%20284.995%2030.2446C287.008%2030.8642%20289.326%2031.6077%20290.668%2033.4044C291.095%2034.1479%20292.132%2034.2099%20292.681%2033.7142C293.108%2033.4044%20293.291%2032.8468%20292.986%2032.3511C292.864%2029.687%20292.742%2026.9609%20292.62%2024.2967C292.62%2022.9337%20292.498%2021.5086%20292.437%2020.1456L292.315%2018.163C292.315%2017.7293%20292.071%2016.614%20292.315%2016.3042C292.498%2016.0564%20294.999%2016.3042%20295.487%2016.3042H299.757C301.16%2016.3042%20300.794%2016.3042%20301.038%2016.4901C301.343%2016.7999%20301.221%2017.6053%20301.221%2017.9771V22.438C301.221%2028.2%20300.855%2033.962%20301.099%2039.724C301.282%2045.3002%20301.709%2050.8144%20301.953%2056.3905C301.953%2057.196%20301.953%2058.0014%20302.075%2058.7449V58.559L302.014%2058.4971ZM292.498%2045.1763C292.681%2043.0078%20292.681%2040.9012%20292.681%2038.7327C292.681%2036.5642%20292.681%2038.4229%20292.559%2038.299C292.559%2038.1132%20292.559%2037.9273%20292.376%2037.6795C291.522%2036.3784%20290.241%2035.8207%20288.777%2035.6349C287.374%2035.449%20285.727%2035.387%20284.385%2035.9447C281.213%2037.2458%20281.396%2041.5828%20281.213%2044.4947C281.03%2047.4067%20280.359%2051.8676%20283.531%2053.4166C285.056%2054.1601%20286.764%2053.9742%20288.35%2053.6024C289.875%2053.2307%20291.278%2052.735%20291.766%2051.0622C292.01%2050.1328%20292.071%2049.1415%20292.193%2048.2122C292.315%2047.2209%20292.376%2046.1676%20292.498%2045.1763Z'%20fill='%23E4E3FD'/%3e%3cpath%20d='M292.681%2038.6693C292.681%2040.8378%20292.681%2042.9443%20292.498%2045.1128C292.498%2046.1041%20292.315%2047.1574%20292.193%2048.1487C292.071%2049.0781%20292.01%2050.0694%20291.766%2050.9988C291.278%2052.6716%20289.875%2053.2292%20288.35%2053.539C286.703%2053.9107%20285.056%2054.0966%20283.531%2053.3531C280.359%2051.8042%20281.091%2047.3433%20281.213%2044.4313C281.396%2041.5193%20281.213%2037.1823%20284.385%2035.8812C285.727%2035.3236%20287.374%2035.3856%20288.777%2035.5714C290.241%2035.7573%20291.522%2036.3149%20292.376%2037.616C292.498%2037.8019%20292.559%2038.0497%20292.559%2038.2356C292.559%2038.4215%20292.559%2038.4834%20292.681%2038.6693ZM289.753%2047.2813C290.058%2044.4933%20290.18%2041.7052%20290.119%2038.9171C289.57%2038.1736%20288.35%2038.1736%20287.496%2038.1736C286.642%2038.1736%20285.117%2038.0497%20284.507%2039.103C283.958%2040.0323%20284.019%2041.2715%20283.897%2042.2628C283.775%2043.6878%20283.714%2045.0509%20283.653%2046.4759C283.653%2047.5911%20283.47%2048.9542%20283.775%2050.0694C284.08%2051.1227%20285.056%2051.4325%20286.032%2051.3705C286.642%2051.3705%20287.313%2051.1846%20287.923%2051.0607C288.289%2051.0607%20288.899%2050.9368%20289.143%2050.627C289.448%2050.3172%20289.448%2049.6357%20289.448%2049.202C289.57%2048.5824%20289.631%2047.9009%20289.692%2047.2813H289.753Z'%20fill='black'/%3e%3cpath%20d='M268.348%2024.6063V35.0151H263.956C260.906%2035.0151%20258.344%2035.5107%20256.209%2036.8738V60.8512H244.437V24.5443H256.209V29.1911C257.734%2027.0846%20260.296%2024.5443%20264.627%2024.5443H268.348V24.6063Z'%2
1540fill='black'/%3e%3cpath%20d='M238.277%2033.2125V52.2953C238.277%2058.1193%20235.593%2060.9074%20229.798%2060.9074H215.219C209.485%2060.9074%20206.74%2058.1812%20206.74%2052.2953V33.2125C206.74%2027.3885%20209.424%2024.6005%20215.219%2024.6005H229.798C235.532%2024.6005%20238.277%2027.3266%20238.277%2033.2125ZM226.809%2050.1888V35.381C226.809%2034.3897%20226.504%2034.018%20225.467%2034.018H219.672C218.696%2034.018%20218.33%2034.3277%20218.33%2035.381V50.1888C218.33%2051.1801%20218.635%2051.5518%20219.672%2051.5518H225.467C226.443%2051.5518%20226.809%2051.242%20226.809%2050.1888Z'%20fill='black'/%3e%3cpath%20d='M203.69%2024.6063V35.0151H199.298C196.249%2035.0151%20193.687%2035.5107%20191.552%2036.8738V60.8512H179.779V24.5443H191.552V29.1911C193.077%2027.0846%20195.639%2024.5443%20199.969%2024.5443H203.69V24.6063Z'%20fill='black'/%3e%3cpath%20d='M175.022%2024.6063V35.0151H170.63C167.581%2035.0151%20165.019%2035.5107%20162.884%2036.8738V60.8512H151.111V24.5443H162.884V29.1911C164.409%2027.0846%20166.971%2024.5443%20171.301%2024.5443H175.022V24.6063Z'%20fill='black'/%3e%3cpath%20d='M144.702%2011.8428H132.381V21.0744H144.702V11.8428Z'%20fill='black'/%3e%3cpath%20d='M144.4%2024.6005H132.628V60.9074H144.4V24.6005Z'%20fill='black'/%3e%3cpath%20d='M126.157%2032.8422V60.9088H114.384V35.6303C114.384%2034.639%20114.079%2034.2672%20112.92%2034.2672C110.541%2034.2672%20108.833%2034.8868%20106.515%2036.1879V60.9088H94.7422V35.6303C94.7422%2034.639%2094.4373%2034.2672%2093.2783%2034.2672C90.8993%2034.2672%2089.1913%2034.8868%2086.8734%2036.1879V60.9088H75.1006V24.6019H86.8734V28.815C88.6424%2026.7704%2091.0213%2024.1682%2096.7552%2024.1682C102.489%2024.1682%20105.173%2025.8411%20106.149%2029.3107C107.796%2026.8943%20110.846%2024.1682%20116.397%2024.1682C121.948%2024.1682%20126.218%2026.8943%20126.218%2032.7803H126.157V32.8422Z'%20fill='black'/%3e%3cpath%20d='M113.265%2097.6059V99.8236H109.597V79.9532H113.265V87.3159C114.225%2085.9853%20115.186%2085.0095%20117.893%2085.0095C120.601%2085.0095%20121.911%2086.1627%20121.911%2088.8239V96.0979C121.911%2098.7591%20120.776%2099.9123%20117.893%2099.9123C115.011%2099.9123%20114.225%2099.0252%20113.265%2097.6059ZM118.243%2095.6543V89.2674C118.243%2088.5578%20118.068%2088.3804%20117.195%2088.3804C115.361%2088.3804%20114.4%2088.6465%20113.265%2089.2674V95.6543C114.4%2096.2753%20115.273%2096.5414%20117.195%2096.5414C119.116%2096.5414%20118.243%2096.364%20118.243%2095.6543Z'%20fill='black'/%3e%3cpath%20d='M128.811%2099.8271L123.745%2085.1018H127.675L130.645%2095.8353L133.614%2085.1018H137.457L130.907%20104.174H127.326L128.723%2099.8271H128.811Z'%20fill='black'/%3e%3cpath%20d='M146.451%2080.7548H150.73L155.708%2091.9318L160.686%2080.7548H164.966V99.8267H161.123V87.6739L157.106%2097.2542H154.223L150.206%2087.6739V99.8267H146.538V80.7548H146.451Z'%20fill='black'/%3e%3cpath%20d='M172.128%2093.5289V96.1901C172.128%2096.6337%20172.303%2096.8111%20172.739%2096.8111H176.145C176.582%2096.8111%20176.757%2096.6337%20176.757%2096.1901V95.037H180.425V96.2789C180.425%2098.6739%20179.289%2099.8271%20176.931%2099.8271H171.953C169.595%2099.8271%20168.46%2098.6739%20168.46%2096.2789V88.6501C168.46%2086.255%20169.595%2085.1018%20171.953%2085.1018H176.931C179.289%2085.1018%20180.425%2086.255%20180.425%2088.6501V93.5289H172.128ZM172.128%2088.7388V90.9565H176.669V88.7388C176.669%2088.2953%20176.495%2088.1178%20176.058%2088.1178H172.652C172.215%2088.1178%20172.041%2088.2953%20172.041%2088.7388H172.128Z'%20fill='black'/%3e%3cpath%20d='M184.275%2096.2714V88.1991H182.092V85.1831H184.275V81.6348H187.856V85.1831H191V88.1991H187.856V96.1827C187.856%2096.6263%20188.031%2096.8037%20188.467%2096.8037H191V99.9084H187.681C185.323%2099.9084%20184.188%2098.7552%20184.188%2096.3601L184.275%2096.2714Z'%20fill='black'/%3e%3cpath%20d='M192.923%2095.7477C192.923%2092.643%20194.321%2091.5785%20196.679%2091.2237C197.901%2091.0463%20199.561%2090.8689%20201.307%2090.7802V88.8286C201.307%2088.3851%20201.133%2088.2077%20200.696%2088.2077H197.552C197.115%2088.2077%20196.941%2088.3851%20196.941%2088.8286V89.7157H193.273V88.7399C193.273%2086.3448%20194.408%2085.1917%20196.766%2085.1917H201.395C203.753%2085.1917%20204.888%2086.3448%20204.888%2088.7399V99.917H201.22V97.6106C200.259%2098.9412%20199.299%20100.006%20196.679%20100.006C194.059%20100.006%20192.749%2098.8525%20192.749%2095.7477H192.923ZM201.307%2095.5703V93.1753L197.465%2093.8849C196.766%2094.0623%20196.504%2094.2397%20196.504%2095.3042C196.504%2096.3687%20196.679%2096.7235%20197.465%2096.7235C199.211%2096.7235%20200.172%2096.1913%20201.307%2095.5703Z'%20fill='black'/%3e%3cpath%20d='M208.279%2079.9532H211.947V99.8236H208.279V79.9532Z'
154%20fill='black'/%3e%3cpath%20d='M215.791%2080.7548H225.572C228.105%2080.7548%20229.328%2081.9966%20229.328%2084.5691V87.1416C229.328%2088.3835%20228.891%2089.3593%20227.668%2090.069C228.978%2090.6899%20229.59%2091.7544%20229.59%2092.9963V96.0123C229.59%2098.5848%20228.367%2099.8267%20225.834%2099.8267H215.791V80.7548ZM224.961%2088.3835C225.398%2088.3835%20225.485%2088.2061%20225.485%2087.8513V84.8353C225.485%2084.3917%20225.31%2084.303%20224.961%2084.303H219.634V88.3835H224.961ZM225.136%2096.2784C225.572%2096.2784%20225.66%2096.101%20225.66%2095.7462V92.2866C225.66%2091.8431%20225.485%2091.7544%20225.136%2091.7544H219.634V96.2784H225.136Z'%20fill='black'/%3e%3cpath%20d='M236.056%2093.5289V96.1901C236.056%2096.6337%20236.23%2096.8111%20236.667%2096.8111H240.073C240.51%2096.8111%20240.684%2096.6337%20240.684%2096.1901V95.037H244.352V96.2789C244.352%2098.6739%20243.217%2099.8271%20240.859%2099.8271H235.881C233.523%2099.8271%20232.387%2098.6739%20232.387%2096.2789V88.6501C232.387%2086.255%20233.523%2085.1018%20235.881%2085.1018H240.859C243.217%2085.1018%20244.352%2086.255%20244.352%2088.6501V93.5289H236.056ZM236.056%2088.7388V90.9565H240.597V88.7388C240.597%2088.2953%20240.422%2088.1178%20239.986%2088.1178H236.58C236.143%2088.1178%20235.968%2088.2953%20235.968%2088.7388H236.056Z'%20fill='black'/%3e%3cpath%20d='M246.801%2095.7477C246.801%2092.643%20248.198%2091.5785%20250.556%2091.2237C251.779%2091.0463%20253.438%2090.8689%20255.185%2090.7802V88.8286C255.185%2088.3851%20255.01%2088.2077%20254.574%2088.2077H251.43C250.993%2088.2077%20250.818%2088.3851%20250.818%2088.8286V89.7157H247.15V88.7399C247.15%2086.3448%20248.286%2085.1917%20250.644%2085.1917H255.272C257.63%2085.1917%20258.766%2086.3448%20258.766%2088.7399V99.917H255.098V97.6106C254.137%2098.9412%20253.176%20100.006%20250.556%20100.006C247.936%20100.006%20246.626%2098.8525%20246.626%2095.7477H246.801ZM255.272%2095.5703V93.1753L251.43%2093.8849C250.731%2094.0623%20250.469%2094.2397%20250.469%2095.3042C250.469%2096.3687%20250.644%2096.7235%20251.43%2096.7235C253.176%2096.7235%20254.137%2096.1913%20255.272%2095.5703Z'%20fill='black'/%3e%3cpath%20d='M262.266%2085.1018H265.934V87.4082C266.895%2086.0776%20267.855%2085.1018%20270.039%2085.1018H271.174V88.6501H269.34C267.943%2088.6501%20266.982%2088.9162%20265.847%2089.5371V99.8271H262.178V85.1018H262.266Z'%20fill='black'/%3e%3c/svg%3e";var eu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Mc=typeof window>"u"||"Deno"in globalThis;function Nr(){}function fq(e,t){return typeof e=="function"?e(t):e}function E2(e){return typeof e=="number"&&e>=0&&e!==1/0}function T4(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hx(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==q_(o,t.options))return!1}else if(!Yd(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function px(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Ya(t.options.mutationKey)!==Ya(i))return!1}else if(!Yd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function q_(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ya)(e)}function Ya(e){return JSON.stringify(e,(t,n)=>A2(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Yd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Yd(e[n],t[n])):!1}function P4(e,t){if(e===t)return e;const n=gx(e)&&gx(t);if(n||A2(e)&&A2(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=P4(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return s===o&&l===s?e:a}return t}function Bg(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function gx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function A2(e){if(!mx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;
154return!(!mx(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mx(e){return Object.prototype.toString.call(e)==="[object Object]"}function hq(e){return new Promise(t=>{setTimeout(t,e)})}function C2(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?P4(e,t):t}function pq(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function gq(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var R4=Symbol(),k4=(e,t)=>!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===R4?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn,Ca,lo,sc,HT,mq=(HT=class extends eu{constructor(){super();Ie(this,Ca,void 0);Ie(this,lo,void 0);Ie(this,sc,void 0);Ce(this,sc,t=>{if(!Mc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,lo)||this.setEventListener(q(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,lo))==null||t.call(this),Ce(this,lo,void 0))}setEventListener(t){var n;Ce(this,sc,t),(n=q(this,lo))==null||n.call(this),Ce(this,lo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){q(this,Ca)!==t&&(Ce(this,Ca,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof q(this,Ca)=="boolean"?q(this,Ca):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ca=new WeakMap,lo=new WeakMap,sc=new WeakMap,HT),Y_=new mq,ic,co,oc,WT,vq=(WT=class extends eu{constructor(){super();Ie(this,ic,!0);Ie(this,co,void 0);Ie(this,oc,void 0);Ce(this,oc,t=>{if(!Mc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){q(this,co)||this.setEventListener(q(this,oc))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,co))==null||t.call(this),Ce(this,co,void 0))}setEventListener(t){var n;Ce(this,oc,t),(n=q(this,co))==null||n.call(this),Ce(this,co,t(this.setOnline.bind(this)))}setOnline(t){q(this,ic)!==t&&(Ce(this,ic,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return q(this,ic)}},ic=new WeakMap,co=new WeakMap,oc=new WeakMap,WT),zg=new vq;function yq(e){return Math.min(1e3*2**e,3e4)}function O4(e){return(e??"online")==="online"?zg.isOnline():!0}var I4=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fy(e){return e instanceof I4}function N4(e){let t=!1,n=0,r=!1,s,i,o;const a=new Promise((m,S)=>{i=m,o=S}),l=m=>{var S;r||(h(new I4(m)),(S=e.abort)==null||S.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>Y_.isFocused()&&(e.networkMode==="always"||zg.isOnline())&&e.canRun(),f=()=>O4(e.networkMode)&&e.canRun(),g=m=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,m),s==null||s(),i(m))},h=m=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,m),s==null||s(),o(m))},p=()=>new Promise(m=>{var S;s=b=>{(r||d())&&m(b)},(S=e.onPause)==null||S.call(e)}).then(()=>{var m;s=void 0,r||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(r)return;let m;const S=n===0?e.initialPromise:void 0;try{m=S??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(g).catch(b=>{var x;if(r)return;const w=e.retry??(Mc?0:3),A=e.retryDelay??yq,C=typeof A=="function"?A(n,b):A,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,b);if(t||!E){h(b);return}n++,(x=e.onFail)==null||x.call(e,n,b),hq(C).then(()=>d()?void 0:p()).then(()=>{t?h(b):v()})})};return{promise:a,cancel:l,continue:()=>(s==null||s(),a),cancelRetry:c,continueRetry:u,canStart:f,start:()=>(f()?v():p().then(v),a)}}function Sq(){let e=[],t=0,n=f=>{f()},r=f=>{f()},s=f=>setTimeout(f,0);const i=f=>{s=f},o=f=>{let g;t++;try{g=f()}finally{t--,t||c()}return g},a=f=>{t?e.push(f):s(()=>{n(f)})},l=f=>(...g)=>{a(()=>{f(...g)})},c=()=>{const f=e;e=[],f.length&&s(()=>{r(()=>{f.forEach(g=>{n(g)})})})};return{batch:o,batchCalls:l,schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:i}}var tn=Sq(),xa,KT,L4=(KT=class{constructor(){Ie(this,xa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E2(this.gcTime)&&Ce(this,xa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Mc?1/0:5*60*1e3))}clearGcTimeout(){q(this,xa)&&(clearTimeout(q(this,xa)),Ce(this,xa,void 0))}},xa=new WeakMap,KT),ac,lc,Ir,kn,_f,Ta,os,ci,qT,bq=(qT=class extends L4{constructor(t){super();Ie(this,os);Ie(this,ac,void 0);Ie(this,lc,void 0);Ie(this,Ir,void 0);Ie(this,kn,void 0);Ie(this,_f,void 0);Ie(this,Ta,void 0);Ce(this,Ta,!1),Ce(this,_f,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,Ir,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,ac,t.state||_q(this.options)),this.state=q(this,ac),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=q(this,kn))==null?void 0:t.promise}setOptions(t){this.options={...q(this,_f),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,Ir).remove(this)}setData(t,n){const r=C2(this.state.data,t,this.options);return Je(this,os,ci).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Je(this,os,ci).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=q(this,kn))==null?void 0:r.promise;return(s=q(this,kn))==null||s.cancel(t),n?n.then(Nr).catch(Nr):Prom
154ise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(q(this,ac))}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!T4(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,kn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,kn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),q(this,Ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(q(this,kn)&&(q(this,Ta)?q(this,kn).cancel({revert:!0}):q(this,kn).cancelRetry()),this.scheduleGc()),q(this,Ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,os,ci).call(this,{type:"invalidate"})}
154fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,kn))return q(this,kn).continueRetry(),q(this,kn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,s=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Ce(this,Ta,!0),r.signal)})},i=()=>{const d=k4(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),Ce(this,Ta,!1),this.options.persister?this.options.persister(d,f,this):d(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};s(o),(l=this.options.behavior)==null||l.onFetch(o,this),Ce(this,lc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Je(this,os,ci).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,g,h,p;fy(d)&&d.silent||Je(this,os,ci).call(this,{type:"error",error:d}),fy(d)||((g=(f=q(this,Ir).config).onError)==null||g.call(f,d,this),(p=(h=q(this,Ir).config).onSettled)==null||p.call(h,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ce(this,kn,N4({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,g,h,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}this.setData(d),(g=(f=q(this,Ir).config).onSuccess)==null||g.call(f,d,this),(p=(h=q(this,Ir).config).onSettled)==null||p.call(h,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(d,f)=>{Je(this,os,ci).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{Je(this,os,ci).call(this,{type:"pause"})},onContinue:()=>{Je(this,os,ci).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),q(this,kn).start()}},ac=new WeakMap,lc=new WeakMap,Ir=new WeakMap,kn=new WeakMap,_f=new WeakMap,Ta=new WeakMap,os=new WeakSet,ci=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...D4(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return fy(s)&&s.revert&&q(this,lc)?{...q(this,lc),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),tn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),q(this,Ir).notify({query:this,type:"updated",action:t})})},qT);function D4(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O4(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function _q(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rs,YT,M4=(YT=class extends eu{constructor(t={}){super();Ie(this,Rs,void 0);this.config=t,Ce(this,Rs,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??q_(s,n);let o=this.get(i);return o||(o=new bq({cache:this,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){q(this,Rs).has(t.queryHash)||(q(this,Rs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=q(this,Rs).get(t.queryHash);n&&(t.destroy(),n===t&&q(this,Rs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tn.batch(()=>
154{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return q(this,Rs).get(t)}getAll(){return[...q(this,Rs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>hx(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>hx(t,r)):n}notify(t){tn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rs=new WeakMap,YT),ks,jn,Pa,Os,Zi,QT,wq=(QT=class extends L4{constructor(t){super();Ie(this,Os);Ie(this,ks,void 0);Ie(this,jn,void 0);Ie(this,Pa,void 0);this.mutationId=t.mutationId,Ce(this,jn,t.mutationCache),Ce(this,ks,[]),this.state=t.state||U4(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){q(this,ks).includes(t)||(q(this,ks).push(t),this.clearGcTimeout(),q(this,jn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,ks,q(this,ks).filter(n=>n!==t)),this.scheduleGc(),q(this,jn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){q(this,ks).length||(this.state.status==="pending"?this.scheduleGc():q(this,jn).remove(this))}continue(){var t;return((t=q(this,Pa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,o,a,l,c,u,d,f,g,h,p,v,m,S,b,w,A,C,E;Ce(this,Pa,N4({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(x,R)=>{Je(this,Os,Zi).call(this,{type:"failed",failureCount:x,error:R})},onPause:()=>{Je(this,Os,Zi).call(this,{type:"pause"})},onContinue:()=>{Je(this,Os,Zi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,jn).canRun(this)}));const n=this.state.status==="pending",r=!q(this,Pa).canStart();try{if(!n){Je(this,Os,Zi).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(s=q(this,jn).config).onMutate)==null?void 0:i.call(s,t,this));const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));R!==this.state.context&&Je(this,Os,Zi).call(this,{type:"pending",context:R,variables:t,isPaused:r})}const x=await q(this,Pa).start();return await((c=(l=q(this,jn).config).onSuccess)==null?void 0:c.call(l,x,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,x,t,this.state.context)),await((g=(f=q(this,jn).config).onSettled)==null?void 0:g.call(f,x,null,this.state.variables,this.state.context,this)),await((p=(h=this.options).onSettled)==null?void 0:p.call(h,x,null,t,this.state.context)),Je(this,Os,Zi).call(this,{type:"success",data:x}),x}catch(x){try{throw await((m=(v=q(this,jn).config).onError)==null?void 0:m.call(v,x,t,this.state.context,this)),await((b=(S=this.options).onError)==null?void 0:b.call(S,x,t,this.state.context)),await((A=(w=q(this,jn).config).onSettled)==null?void 0:A.call(w,void 0,x,this.state.variables,this.state.context,this)),await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,x,t,this.state.context)),x}finally{Je(this,Os,Zi).call(this,{type:"error",error:x})}}finally{q(this,jn).runNext(this)}}},ks=new WeakMap,jn=new WeakMap,Pa=new WeakMap,Os=new WeakSet,Zi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tn.batch(()=>{q(this,ks).forEach(r=>{r.onMutationUpdate(t)}),q(this,jn).notify({mutation:this,type:"updated",action:t})})},QT);function U4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hr,wf,XT,F4=(XT=class extends eu{constructor(t={}){super();Ie(this,hr,void 0);Ie(this,wf,void 0);this.config=t,Ce(this,hr,new Map),Ce(this,wf,Date.now())}build(t,n,r){const s=new wq({mutationCache:this,mutationId:++gh(this,wf)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=Yh(t),r=q(this,hr).get(n)??[];r.push(t),q(this,hr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Yh(t);if(q(this,hr).has(n)){const s=(r=q(this,hr).get(n))==null?void 0:r.filter(i=>i!==t);
154s&&(s.length===0?q(this,hr).delete(n):q(this,hr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=q(this,hr).get(Yh(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=q(this,hr).get(Yh(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){tn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...q(this,hr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>px(n,r))}findAll(t={}){return this.getAll().filter(n=>px(t,n))}notify(t){tn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nr))))}},hr=new WeakMap,wf=new WeakMap,XT);function Yh(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Eq(e){return{onFetch:(t,n)=>{const r=async()=>{var h,p,v,m,S;const s=t.options,i=(v=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,o=((m=t.state.data)==null?void 0:m.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},d=k4(t.options,t.fetchOptions),f=async(b,w,A)=>{if(c)return Promise.reject();if(w==null&&b.pages.length)return Promise.resolve(b);const C={queryKey:t.queryKey,pageParam:w,direction:A?"backward":"forward",meta:t.options.meta};u(C);const E=await d(C),{maxPages:x}=t.options,R=A?gq:pq;return{pages:R(b.pages,E,x),pageParams:R(b.pageParams,w,x)}};let g;if(i&&o.length){const b=i==="backward",w=b?Aq:vx,A={pages:o,pageParams:a},C=w(s,A);g=await f(A,C,b)}else{g=await f(l,a[0]??s.initialPageParam);const b=e??o.length;for(let w=1;w<b;w++){const A=vx(s,g);g=await f(g,A)}}return g};t.options.persister?t.fetchFn=()=>{var s,i;return(i=(s=t.options).persister)==null?void 0:i.call(s,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function vx(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Aq(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Bt,uo,fo,cc,uc,ho,dc,fc,JT,Cq=(JT=class{constructor(e={}){Ie(this,Bt,void 0);Ie(this,uo,void 0);Ie(this,fo,void 0);Ie(this,cc,void 0);Ie(this,uc,void 0);Ie(this,ho,void 0);Ie(this,dc,void 0);Ie(this,fc,void 0);Ce(this,Bt,e.queryCache||new M4),Ce(this,uo,e.mutationCache||new F4),Ce(this,fo,e.defaultOptions||{}),Ce(this,cc,new Map),Ce(this,uc,new Map),Ce(this,ho,0)}mount(){gh(this,ho)._++,q(this,ho)===1&&(Ce(this,dc,Y_.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Bt).onFocus())})),Ce(this,fc,zg.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Bt).onOnline())})))}unmount(){var e,t;gh(this,ho)._--,q(this,ho)===0&&((e=q(this,dc))==null||e.call(this),Ce(this,dc,void 0),(t=q(this,fc))==null||t.call(this),Ce(this,fc,void 0))}isFetching(e){return q(this,Bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return q(this,uo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Bt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=q(this,Bt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(n.staleTime)&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return q(this,Bt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=q(this,Bt).get(r.queryHash),i=s==null?void 0:s.state.data,o=fq(t,i);if(o!==void 0)return q(this,Bt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return tn.batch(()=>q(this,Bt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Bt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=q(this,Bt);tn.batch(()=>
154{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=q(this,Bt),r={type:"active",...e};return tn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=tn.batch(()=>q(this,Bt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Nr).catch(Nr)}invalidateQueries(e={},t={}){return tn.batch(()=>{if(q(this,Bt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=tn.batch(()=>q(this,Bt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Nr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=q(this,Bt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nr).catch(Nr)}fetchInfiniteQuery(e){return e.behavior=Eq(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nr).catch(Nr)}resumePausedMutations(){return zg.isOnline()?q(this,uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,Bt)}getMutationCache(){return q(this,uo)}getDefaultOptions(){return q(this,fo)}setDefaultOptions(e){Ce(this,fo,e)}setQueryDefaults(e,t){q(this,cc).set(Ya(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...q(this,cc).values()];let n={};return t.forEach(r=>{Yd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){q(this,uc).set(Ya(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...q(this,uc).values()];let n={};return t.forEach(r=>{Yd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...q(this,fo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=q_(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===R4&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...q(this,fo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){q(this,Bt).clear(),q(this,uo).clear()}},Bt=new WeakMap,uo=new WeakMap,fo=new WeakMap,cc=new WeakMap,uc=new WeakMap,ho=new WeakMap,dc=new WeakMap,fc=new WeakMap,JT),Jn,mt,Ef,Vn,Ra,hc,Is,Af,pc,gc,ka,Oa,po,mc,Ia,Zu,Cf,x2,xf,T2,Tf,P2,Pf,R2,Rf,k2,kf,O2,Of,I2,hm,$4,ZT,xq=(ZT=class extends eu{constructor(t,n){super();Ie(this,Ia);Ie(this,Cf);Ie(this,xf);Ie(this,Tf);Ie(this,Pf);Ie(this,Rf);Ie(this,kf);Ie(this,Of);Ie(this,hm);Ie(this,Jn,void 0);Ie(this,mt,void 0);Ie(this,Ef,void 0);Ie(this,Vn,void 0);Ie(this,Ra,void 0);Ie(this,hc,void 0);Ie(this,Is,void 0);Ie(this,Af,void 0);Ie(this,pc,void 0);Ie(this,gc,void 0);Ie(this,ka,void 0);Ie(this,Oa,void 0);Ie(this,po,void 0);Ie(this,mc,new Set);this.options=n,Ce(this,Jn,t),Ce(this,Is,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,mt).addObserver(this),yx(q(this,mt),this.options)?Je(this,Ia,Zu).call(this):this.updateResult(),Je(this,Pf,R2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return N2(q(this,mt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return N2(q(this,mt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,Rf,k2).call(this),Je(this,kf,O2).call(this),q(this,mt).removeObserver(this)}setOptions(t,n){const r=this.options,s=q(this,mt);if(this.options=q(this,Jn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Je(this,Of,I2).call(this),q(this,mt).setOptions(this.options),r._defaulted&&!Bg(this.options,r)&&q(this,Jn).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,mt),observer:this});const i=this.hasListeners();i&&Sx(q(this,mt),s,this.options,r)&&Je(this,Ia,Zu).call(this),this.updateResult(n),i&&(q(this,mt)!==s||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Je(this,Cf,x2).call(this);const o=Je(this,xf,T2).call(this);i&&(q(this,mt)!==s||this.options.enabled!==r.enabled||o!==q(this,po))&&Je(this,Tf,P2).call(this,o)}getOptimisticResult(t){const n=q(this,Jn).getQueryCache().build(q(this,Jn),t),r=this.createResult(n,t);return Pq(this,r)&&(Ce(this,Vn,r),Ce(this,hc,this.options),Ce(this,Ra,q(this,mt).state)),r}getCurrentResult(){return q(this,Vn)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>
154(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){q(this,mc).add(t)}getCurrentQuery(){return q(this,mt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=q(this,Jn).defaultQueryOptions(t),r=q(this,Jn).getQueryCache().build(q(this,Jn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Je(this,Ia,Zu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,Vn)))}createResult(t,n){var E;const r=q(this,mt),s=this.options,i=q(this,Vn),o=q(this,Ra),a=q(this,hc),c=t!==r?t.state:q(this,Ef),{state:u}=t;let d={...u},f=!1,g;if(n._optimisticResults){const x=this.hasListeners(),R=!x&&yx(t,n),T=x&&Sx(t,r,n,s);(R||T)&&(d={...d,...D4(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:v}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(o==null?void 0:o.data)&&n.select===q(this,Af))g=q(this,pc);else try{Ce(this,Af,n.select),g=n.select(d.data),g=C2(i==null?void 0:i.data,g,n),Ce(this,pc,g),Ce(this,Is,null)}catch(x){Ce(this,Is,x)}else g=d.data;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let x;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))x=i.data;else if(x=typeof n.placeholderData=="function"?n.placeholderData((E=q(this,gc))==null?void 0:E.state.data,q(this,gc)):n.placeholderData,n.select&&x!==void 0)try{x=n.select(x),Ce(this,Is,null)}catch(R){Ce(this,Is,R)}x!==void 0&&(v="success",g=C2(i==null?void 0:i.data,x,n),f=!0)}q(this,Is)&&(h=q(this,Is),g=q(this,pc),p=Date.now(),v="error");const m=d.fetchStatus==="fetching",S=v==="pending",b=v==="error",w=S&&m,A=g!==void 0;return{status:v,fetchStatus:d.fetchStatus,isPending:S,isSuccess:v==="success",isError:b,isInitialLoading:w,isLoading:w,data:g,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:b&&!A,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&A,isStale:Q_(t,n),refetch:this.refetch}}updateResult(t){const n=q(this,Vn),r=this.createResult(q(this,mt),this.options);if(Ce(this,Ra,q(this,mt).state),Ce(this,hc,this.options),q(this,Ra).data!==void 0&&Ce(this,gc,q(this,mt)),Bg(r,n))return;Ce(this,Vn,r);const s={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!q(this,mc).size)return!0;const l=new Set(a??q(this,mc));return this.options.throwOnError&&l.add("error"),Object.keys(q(this,Vn)).some(c=>{const u=c;return q(this,Vn)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(s.listeners=!0),Je(this,hm,$4).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,Pf,R2).call(this)}},Jn=new WeakMap,mt=new WeakMap,Ef=new WeakMap,Vn=new WeakMap,Ra=new WeakMap,hc=new WeakMap,Is=new WeakMap,Af=new WeakMap,pc=new WeakMap,gc=new WeakMap,ka=new WeakMap,Oa=new WeakMap,po=new WeakMap,mc=new WeakMap,Ia=new WeakSet,Zu=function(t){Je(this,Of,I2).call(this);let n=q(this,mt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nr)),n},Cf=new WeakSet,x2=function(){if(Je(this,Rf,k2).call(this),Mc||q(this,Vn).isStale||!E2(this.options.staleTime))return;const n=T4(q(this,Vn).dataUpdatedAt,this.options.staleTime)+1;Ce(this,ka,setTimeout(()=>{q(this,Vn).isStale||this.updateResult()},n))},xf=new WeakSet,T2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(q(this,mt)):this.options.refetchInterval)??!1},Tf=new WeakSet,P2=function(t){Je(this,kf,O2).call(this),Ce(this,po,t),!(Mc||this.options.enabled===!1||!E2(q(this,po))||q(this,po)===0)&&Ce(this,Oa,setInterval(()=>{(this.options.refetchIntervalInBackground||Y_.isFocused())&&Je(this,Ia,Zu).call(this)},q(this,po)))},Pf=new WeakSet,R2=function(){Je(this,Cf,x2).call(this),Je(this,Tf,P2).call(this,Je(this,xf,T2).call(this))}
154,Rf=new WeakSet,k2=function(){q(this,ka)&&(clearTimeout(q(this,ka)),Ce(this,ka,void 0))},kf=new WeakSet,O2=function(){q(this,Oa)&&(clearInterval(q(this,Oa)),Ce(this,Oa,void 0))},Of=new WeakSet,I2=function(){const t=q(this,Jn).getQueryCache().build(q(this,Jn),this.options);if(t===q(this,mt))return;const n=q(this,mt);Ce(this,mt,t),Ce(this,Ef,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hm=new WeakSet,$4=function(t){tn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(q(this,Vn))}),q(this,Jn).getQueryCache().notify({query:q(this,mt),type:"observerResultsUpdated"})})},ZT);function Tq(e,t){return t.enabled!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function yx(e,t){return Tq(e,t)||e.state.data!==void 0&&N2(e,t,t.refetchOnMount)}function N2(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Q_(e,t)}return!1}function Sx(e,t,n,r){return(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Q_(e,n)}function Q_(e,t){return t.enabled!==!1&&e.isStaleByTime(t.staleTime)}function Pq(e,t){return!Bg(e.getCurrentResult(),t)}var go,mo,Zn,vi,vc,Np,If,L2,eP,Rq=(eP=class extends eu{constructor(n,r){super();Ie(this,vc);Ie(this,If);Ie(this,go,void 0);Ie(this,mo,void 0);Ie(this,Zn,void 0);Ie(this,vi,void 0);Ce(this,go,n),this.setOptions(r),this.bindMethods(),Je(this,vc,Np).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=q(this,go).defaultMutationOptions(n),Bg(this.options,r)||q(this,go).getMutationCache().notify({type:"observerOptionsUpdated",mutation:q(this,Zn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ya(r.mutationKey)!==Ya(this.options.mutationKey)?this.reset():((s=q(this,Zn))==null?void 0:s.state.status)==="pending"&&q(this,Zn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=q(this,Zn))==null||n.removeObserver(this)}onMutationUpdate(n){Je(this,vc,Np).call(this),Je(this,If,L2).call(this,n)}getCurrentResult(){return q(this,mo)}reset(){var n;(n=q(this,Zn))==null||n.removeObserver(this),Ce(this,Zn,void 0),Je(this,vc,Np).call(this),Je(this,If,L2).call(this)}mutate(n,r){var s;return Ce(this,vi,r),(s=q(this,Zn))==null||s.removeObserver(this),Ce(this,Zn,q(this,go).getMutationCache().build(q(this,go),this.options)),q(this,Zn).addObserver(this),q(this,Zn).execute(n)}},go=new WeakMap,mo=new WeakMap,Zn=new WeakMap,vi=new WeakMap,vc=new WeakSet,Np=function(){var r;const n=((r=q(this,Zn))==null?void 0:r.state)??U4();Ce(this,mo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},If=new WeakSet,L2=function(n){tn.batch(()=>{var r,s,i,o,a,l,c,u;if(q(this,vi)&&this.hasListeners()){const d=q(this,mo).variables,f=q(this,mo).context;(n==null?void 0:n.type)==="success"?((s=(r=q(this,vi)).onSuccess)==null||s.call(r,n.data,d,f),(o=(i=q(this,vi)).onSettled)==null||o.call(i,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=q(this,vi)).onError)==null||l.call(a,n.error,d,f),(u=(c=q(this,vi)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(q(this,mo))})})},eP),j4=y.createContext(void 0),tu=e=>{const t=y.useContext(j4);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},kq=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(j4.Provider,{value:e,children:t})),V4=y.createContext(!1),Oq=()=>y.useContext(V4);V4.Provider;function Iq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Nq=y.createContext(Iq()),Lq=()=>y.useContext(Nq);function B4(e,t){return typeof e=="function"?e(...t):!!e}function Dq(){}var Mq=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Uq=e=>{y.useEffect(()=>{e.clearReset()},[e])},Fq=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&B4(n,[e.error,r]),$q=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},jq=(e,t)=>
154(e==null?void 0:e.suspense)&&t.isPending,Vq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Bq(e,t,n){const r=tu(),s=Oq(),i=Lq(),o=r.defaultQueryOptions(e);o._optimisticResults=s?"isRestoring":"optimistic",$q(o),Mq(o,i),Uq(i);const[a]=y.useState(()=>new t(r,o)),l=a.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(c=>{const u=s?()=>{}:a.subscribe(tn.batchCalls(c));return a.updateResult(),u},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),y.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),jq(o,l))throw Vq(o,a,i);if(Fq({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function Gs(e,t){return Bq(e,xq)}function z4(e,t){const n=tu(),[r]=y.useState(()=>new Rq(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(tn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=y.useCallback((o,a)=>{r.mutate(o,a).catch(Dq)},[r]);if(s.error&&B4(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}/** 155 * @license lucide-react v0.575.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const G4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** 160 * @license lucide-react v0.575.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const zq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** 165 * @license lucide-react v0.575.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const Gq=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** 170 * @license lucide-react v0.575.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const bx=e=>{const t=Gq(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** 175 * @license lucide-react v0.575.0 - ISC 176 * 177 * This source code is licensed under the ISC license. 178 * See the LICENSE file in the root directory of this source tree. 179 */var Hq={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 180 * @license lucide-react v0.575.0 - ISC 181 * 182 * This source code is licensed under the ISC license. 183 * See the LICENSE file in the root directory of this source tree. 184 */const Wq=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** 185 * @license lucide-react v0.575.0 - ISC 186 * 187 * This source code is licensed under the ISC license. 188 * See the LICENSE file in the root directory of this source tree. 189 */const Kq=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>y.createElement("svg",{ref:l,...Hq,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:G4("lucide",s),...!i&&!Wq(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,u])=>y.createElement(c,u)),...Array.isArray(i)?i:[i]]));/** 190 * @license lucide-react v0.575.0 - ISC 191 * 192 * This source code is licensed under the ISC license. 193 * See the LICENSE file in the root directory of this source tree. 194 */const ct=(e,t)=>{const n=y.forwardRef(({className:r,...s},i)=>y.createElement(Kq,{ref:i,iconNode:t,className:G4(`lucide-${zq(bx(e))}`,`lucide-${e}`,r),...s}));return n.displayName=bx(e),n};/** 195 * @license lucide-react v0.575.0 - ISC 196 * 197 * This source code is licensed under the ISC license. 198 * See the LICENSE file in the root directory of this source tree. 199 */const qq=[["path",{d:"M12 6.528V3a1 1 0 0 1 1-1h0",key:"11qiee"}],["path",{d:"M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21",key:"110c12"}]],Yq=ct("apple",qq);/** 200 * @license lucide-react v0.575.0 - ISC 201 * 202 * This source code is licensed under the ISC license. 203 * See the LICENSE file in the root directory of this source tree. 204 */const Qq=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Xq=ct("book-open",Qq);/** 205 * @license lucide-react v0.575.0 - ISC 206 * 207 * This source code is licensed under the ISC license. 208 * See the LICENSE file in the root directory of this source tree. 209 */const Jq=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Zq=ct("briefcase",Jq);/** 210 * @license lucide-react v0.575.0 - ISC 211 * 212 * This source code is licensed under the ISC license. 213 * See the LICENSE file in the root directory of this source tree. 214 */const eY=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],tY=ct("calendar-clock",eY);/** 215 * @license lucide-react v0.575.0 - ISC 216 * 217 * This source code is licensed under the ISC license. 218 * See the LICENSE file in the root directory of this source tree. 219 */const nY=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],rY=ct("calendar",nY);/** 220 * @license lucide-react v0.575.0 - ISC 221 * 222 * This source code is licensed under the ISC license. 223 * See the LICENSE file in the root directory of this source tree. 224 */const sY=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jl=ct("check",sY);/** 225 * @license lucide-react v0.575.0 - ISC 226 * 227 * This source code is licensed under the ISC license. 228 * See the LICENSE file in the root directory of this source tree. 229 */const iY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],oY=ct("chevron-down",iY);/** 230 * @license lucide-react v0.575.0 - ISC 231 * 232 * This source code is licensed under the ISC license. 233 * See the LICENSE file in the root directory of this source tree. 234 */const aY=[["path",{d:"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057",key:"1uxyv8"}],["path",{d:"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78",key:"99tcn7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],lY=ct("cloud-off",aY);/** 235 * @license lucide-react v0.575.0 - ISC 236 * 237 * This source code is licensed under the ISC license. 238 * See the LICENSE file in the root directory of this source tree. 239 */const cY=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],uY=ct("code",cY);/** 240 * @license lucide-react v0.575.0 - ISC 241 * 242 * This source code is licensed under the ISC license. 243 * See the LICENSE file in the root directory of this source tree. 244 */const dY=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Gg=ct("copy",dY);/** 245 * @license lucide-react v0.575.0 - ISC 246 * 247 * This source code is licensed under the ISC license. 248 * See the LICENSE file in the root directory of this source tree. 249 */const fY=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],hY=ct("credit-card",fY);/** 250 * @license lucide-react v0.575.0 - ISC 251 * 252 * This source code is licensed under the ISC license. 253 * See the LICENSE file in the root directory of this source tree. 254 */const pY=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D2=ct("external-link",pY);/** 255 * @license lucide-react v0.575.0 - ISC 256 * 257 * This source code is licensed under the ISC license. 258 * See the LICENSE file in the root directory of this source tree. 259 */const gY=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],mY=ct("gamepad-2",gY);/** 260 * @license lucide-react v0.575.0 - ISC 261 * 262 * This source code is licensed under the ISC license. 263 * See the LICENSE file in the root directory of this source tree. 264 */const vY=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],yY=ct("key-round",vY);/** 265 * @license lucide-react v0.575.0 - ISC 266 * 267 * This source code is licensed under the ISC license. 268 * See the LICENSE file in the root directory of this source tree. 269 */const SY=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],bY=ct("layout-dashboard",SY);/** 270 * @license lucide-react v0.575.0 - ISC 271 * 272 * This source code is licensed under the ISC license. 273 * See the LICENSE file in the root directory of this source tree. 274 */const _Y=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qh=ct("loader-circle",_Y);/** 275 * @license lucide-react v0.575.0 - ISC 276 * 277 * This source code is licensed under the ISC license. 278 * See the LICENSE file in the root directory of this source tree. 279 */const wY=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],EY=ct("mail",wY);/** 280 * @license lucide-react v0.575.0 - ISC 281 * 282 * This source code is licensed under the ISC license. 283 * See the LICENSE file in the root directory of this source tree. 284 */const AY=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],CY=ct("menu",AY);/** 285 * @license lucide-react v0.575.0 - ISC 286 * 287 * This source code is licensed under the ISC license. 288 * See the LICENSE file in the root directory of this source tree. 289 */const xY=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],bv=ct("message-circle",xY);/** 290 * @license lucide-react v0.575.0 - ISC 291 * 292 * This source code is licensed under the ISC license. 293 * See the LICENSE file in the root directory of this source tree. 294 */const TY=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],H4=ct("monitor",TY);/** 295 * @license lucide-react v0.575.0 - ISC 296 * 297 * This source code is licensed under the ISC license. 298 * See the LICENSE file in the root directory of this source tree. 299 */const PY=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],RY=ct("moon",PY);/** 300 * @license lucide-react v0.575.0 - ISC 301 * 302 * This source code is licensed under the ISC license. 303 * See the LICENSE file in the root directory of this source tree. 304 */const kY=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hy=ct("refresh-cw",kY);/** 305 * @license lucide-react v0.575.0 - ISC 306 * 307 * This source code is licensed under the ISC license. 308 * See the LICENSE file in the root directory of this source tree. 309 */const OY=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],IY=ct("settings",OY);/** 310 * @license lucide-react v0.575.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */const NY=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
314y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],py=ct("shield-alert",NY);/** 315 * @license lucide-react v0.575.0 - ISC 316 * 317 * This source code is licensed under the ISC license. 318 * See the LICENSE file in the root directory of this source tree. 319 */const LY=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],DY=ct("shield-check",LY);/** 320 * @license lucide-react v0.575.0 - ISC 321 * 322 * This source code is licensed under the ISC license. 323 * See the LICENSE file in the root directory of this source tree. 324 */const MY=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],UY=ct("sun",MY);/** 325 * @license lucide-react v0.575.0 - ISC 326 * 327 * This source code is licensed under the ISC license. 328 * See the LICENSE file in the root directory of this source tree. 329 */const FY=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],_v=ct("terminal",FY);/** 330 * @license lucide-react v0.575.0 - ISC 331 * 332 * This source code is licensed under the ISC license. 333 * See the LICENSE file in the root directory of this source tree. 334 */const $Y=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],W4=ct("users",$Y);/** 335 * @license lucide-react v0.575.0 - ISC 336 * 337 * This source code is licensed under the ISC license. 338 * See the LICENSE file in the root directory of this source tree. 339 */const jY=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],VY=ct("wand-sparkles",jY);/** 340 * @license lucide-react v0.575.0 - ISC 341 * 342 * This source code is licensed under the ISC license. 343 * See the LICENSE file in the root directory of this source tree. 344 */const BY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zY=ct("x",BY);/** 345 * @remix-run/router v1.16.1 346 * 347 * Copyright (c) Remix Software Inc. 348 * 349 * This source code is licensed under the MIT license found in the 350 * LICENSE.md file in the root directory of this source tree. 351 * 352 * @license MIT 353 */function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(this,arguments)}var vt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(vt||(vt={}));const _x="popstate";function K4(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,s;s=t.map((g,h)=>u(g,typeof g=="string"?null:g.state,h===0?"default":void 0));let i=l(n??s.length-1),o=vt.Pop,a=null;function l(g){return Math.min(Math.max(g,0),s.length-1)}function c(){return s[i]}function u(g,h,p){h===void 0&&(h=null);let v=Qa(s?c().pathname:"/",g,h,p);return $i(v.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),v}function d(g){return typeof g=="string"?g:vs(g)}return{get index(){return i},get action(){return o},get location(){return c()},createHref:d,createURL(g){return new URL(d(g),"http://localhost")},encodeLocation(g){let h=typeof g=="string"?Qr(g):g;return{pathname:h.pathname||"",search:h.search||"",hash:h.hash||""}},push(g,h){o=vt.Push;let p=u(g,h);i+=1,s.splice(i,s.length,p),r&&a&&a({action:o,location:p,delta:1})},replace(g,h){o=vt.Replace;let p=u(g,h);s[i]=p,r&&a&&a({action:o,location:p,delta:0})},go(g){o=vt.Pop;let h=l(i+g),p=s[h];i=h,a&&a({action:o,location:p,delta:g})},listen(g){return a=g,()=>{a=null}}}}function q4(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return Qa("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:vs(s)}return Q4(t,n,null,e)}function Y4(e){e===void 0&&(e={});function t(s,i){let{pathname:o="/",search:a="",hash:l=""}=Qr(s.location.hash.substr(1));return!o.startsWith("/")&&!o.startsWith(".")&&(o="/"+o),Qa("",{pathname:o,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(s,i){let o=s.document.querySelector("base"),a="";if(o&&o.getAttribute("href")){let l=s.location.href,c=l.indexOf("#");a=c===-1?l:l.slice(0,c)}return a+"#"+(typeof i=="string"?i:vs(i))}function r(s,i){$i(s.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+J
353SON.stringify(i)+")")}return Q4(t,n,r,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $i(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function GY(){return Math.random().toString(36).substr(2,8)}function wx(e,t){return{usr:e.state,key:e.key,idx:t}}function Qa(e,t,n,r){return n===void 0&&(n=null),Tt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Qr(t):t,{state:n,key:t&&t.key||r||GY()})}function vs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Qr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Q4(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=vt.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Tt({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=vt.Pop;let v=u(),m=v==null?null:v-c;c=v,l&&l({action:a,location:p.location,delta:m})}function f(v,m){a=vt.Push;let S=Qa(p.location,v,m);n&&n(S,v),c=u()+1;let b=wx(S,c),w=p.createHref(S);try{o.pushState(b,"",w)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(w)}i&&l&&l({action:a,location:p.location,delta:1})}function g(v,m){a=vt.Replace;let S=Qa(p.location,v,m);n&&n(S,v),c=u();let b=wx(S,c),w=p.createHref(S);o.replaceState(b,"",w),i&&l&&l({action:a,location:p.location,delta:0})}function h(v){let m=s.location.origin!=="null"?s.location.origin:s.location.href,S=typeof v=="string"?v:vs(v);return S=S.replace(/ $/,"%20"),Fe(m,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,m)}let p={get action(){return a},get location(){return e(s,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(_x,d),l=v,()=>{s.removeEventListener(_x,d),l=null}},createHref(v){return t(s,v)},createURL:h,encodeLocation(v){let m=h(v);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:g,go(v){return o.go(v)}};return p}var Nt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Nt||(Nt={}));const HY=new Set(["lazy","caseSensitive","path","id","index","children"]);function WY(e){return e.index===!0}function M2(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,i)=>{let o=[...n,i],a=typeof s.id=="string"?s.id:o.join("-");if(Fe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Fe(!r[a],'Found a route id collision on i
353d "'+a+`". Route id's must be globally unique within Data Router usages`),WY(s)){let l=Tt({},s,t(s),{id:a});return r[a]=l,l}else{let l=Tt({},s,t(s),{id:a,children:void 0});return r[a]=l,s.children&&(l.children=M2(s.children,t,o,r)),l}})}function ba(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Qr(t):t,s=dr(r.pathname||"/",n);if(s==null)return null;let i=J4(e);KY(i);let o=null;for(let a=0;o==null&&a<i.length;++a){let l=iQ(s);o=nQ(i[a],l)}return o}function X4(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],handle:n.handle}}function J4(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Fe(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=Ks([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(Fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),J4(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:eQ(c,i.index),routesMeta:u})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of Z4(i.path))s(i,o,l)}),t}function Z4(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Z4(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function KY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tQ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qY=/^:[\w-]+$/,YY=3,QY=2,XY=1,JY=10,ZY=-2,Ex=e=>e==="*";function eQ(e,t){let n=e.split("/"),r=n.length;return n.some(Ex)&&(r+=ZY),t&&(r+=QY),n.filter(s=>!Ex(s)).reduce((s,i)=>s+(qY.test(i)?YY:i===""?XY:JY),r)}function tQ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function nQ(e,t){let{routesMeta:n}=e,r={},s="/",i=[];for(let o=0;o<n.length;++o){let a=n[o],l=o===n.length-1,c=s==="/"?t:t.slice(s.length)||"/",u=Qd({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!u)return null;
353Object.assign(r,u.params);let d=a.route;i.push({params:r,pathname:Ks([s,u.pathname]),pathnameBase:aQ(Ks([s,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(s=Ks([s,u.pathnameBase]))}return i}function rQ(e,t){t===void 0&&(t={});let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&($i(!1,'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".')),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",s=o=>o==null?"":typeof o=="string"?o:String(o),i=n.split(/\/+/).map((o,a,l)=>{if(a===l.length-1&&o==="*")return s(t["*"]);const u=o.match(/^:([\w-]+)(\??)$/);if(u){const[,d,f]=u;let g=t[d];return Fe(f==="?"||g!=null,'Missing ":'+d+'" param'),s(g)}return o.replace(/\?$/g,"")}).filter(o=>!!o);return r+i.join("/")}function Qd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=sQ(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:f,isOptional:g}=u;if(f==="*"){let p=a[d]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const h=a[d];return g&&!h?c[f]=void 0:c[f]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function sQ(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),$i(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function iQ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $i(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function dr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function eL(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Qr(e):e;return{pathname:n?n.startsWith("/")?n:oQ(n,t):t,search:lQ(r),hash:cQ(s)}}function oQ(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function gy(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function tL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wv(e,t){let n=tL(e);return t?n.map((r,s)=>s===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ev(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Qr(e):(s=Tt({},e),Fe(!s.pathname||!s.pathname.includes("?"),gy("?","pathname","search",s)),Fe(!s.pathname||!s.pathname.includes("#"),gy("#","pathname","hash",s)),Fe(!s.search||!s.search.includes("#"),gy("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=eL(s,a),c=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ks=e=>e.join("/").replace(/\/\/+/g,"/"),aQ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lQ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cQ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,uQ=function(t,n){n===void 0&&(n={});let r=typeof n=="number"?{status:n}:n,s=new Headers(r.headers);return s.has("Content-Type")||s.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(t),Tt({},r,{headers:s}))};
353class Hg extends Error{}class dQ{constructor(t,n){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],Fe(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let r;this.abortPromise=new Promise((i,o)=>r=o),this.controller=new AbortController;let s=()=>r(new Hg("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",s),this.controller.signal.addEventListener("abort",s),this.data=Object.entries(t).reduce((i,o)=>{let[a,l]=o;return Object.assign(i,{[a]:this.trackPromise(a,l)})},{}),this.done&&this.unlistenAbortSignal(),this.init=n}trackPromise(t,n){if(!(n instanceof Promise))return n;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let r=Promise.race([n,this.abortPromise]).then(s=>this.onSettle(r,t,void 0,s),s=>this.onSettle(r,t,s));return r.catch(()=>{}),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(t,n,r,s){if(this.controller.signal.aborted&&r instanceof Hg)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(n),this.done&&this.unlistenAbortSignal(),r===void 0&&s===void 0){let i=new Error('Deferred data for key "'+n+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>i}),this.emit(!1,n),Promise.reject(i)}return s===void 0?(Object.defineProperty(t,"_error",{get:()=>r}),this.emit(!1,n),Promise.reject(r)):(Object.defineProperty(t,"_data",{get:()=>s}),this.emit(!1,n),s)}emit(t,n){this.subscribers.forEach(r=>r(t,n))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,n)=>this.pendingKeysSet.delete(n)),this.emit(!0)}async resolveData(t){let n=!1;if(!this.done){let r=()=>this.cancel();t.addEventListener("abort",r),n=await new Promise(s=>{this.subscribe(i=>{t.removeEventListener("abort",r),(i||this.done)&&s(i)})})}return n}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return Fe(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,n)=>{let[r,s]=n;return Object.assign(t,{[r]:hQ(s)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function fQ(e){return e instanceof Promise&&e._tracked===!0}function hQ(e){if(!fQ(e))return e;if(e._error)throw e._error;return e._data}const pQ=function(t,n){n===void 0&&(n={});let r=typeof n=="number"?{status:n}:n;return new dQ(t,r)},nL=function(t,n){n===void 0&&(n=302);let r=n;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let s=new Headers(r.headers);return s.set("Location",t),new Response(null,Tt({},r,{headers:s}))},gQ=(e,t)=>{let n=nL(e,t);return n.headers.set("X-Remix-Reload-Document","true"),n};class Av{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Cv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const rL=["post","put","patch","delete"],mQ=new Set(rL),vQ=["get",...rL],yQ=new Set(vQ),SQ=new Set([301,302,303,307,308]),bQ=new Set([307,308]),my={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},El={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},X_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_Q=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),iL="remix-router-transitions";function J_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let J=e.detectErrorBoundary;s=ne=>({hasErrorBoundary:J(ne)})}else s=_Q;let i={},o=M2(e.routes,s,void 0,i),a,l=e.basename||"/",c=e.unstable_dataStrategy||CQ,u=Tt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prepe
353ndBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),d=null,f=new Set,g=null,h=null,p=null,v=e.hydrationData!=null,m=ba(o,e.history.location,l),S=null;if(m==null){let J=Lr(404,{pathname:e.history.location.pathname}),{matches:ne,route:ie}=Nx(o);m=ne,S={[ie.id]:J}}let b,w=m.some(J=>J.route.lazy),A=m.some(J=>J.route.loader);if(w)b=!1;else if(!A)b=!0;else if(u.v7_partialHydration){let J=e.hydrationData?e.hydrationData.loaderData:null,ne=e.hydrationData?e.hydrationData.errors:null,ie=fe=>fe.route.loader?typeof fe.route.loader=="function"&&fe.route.loader.hydrate===!0?!1:J&&J[fe.route.id]!==void 0||ne&&ne[fe.route.id]!==void 0:!0;if(ne){let fe=m.findIndex(Pe=>ne[Pe.route.id]!==void 0);b=m.slice(0,fe+1).every(ie)}else b=m.every(ie)}else b=e.hydrationData!=null;let C,E={historyAction:e.history.action,location:e.history.location,matches:m,initialized:b,navigation:my,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},x=vt.Pop,R=!1,T,P=!1,I=new Map,U=null,L=!1,z=!1,O=[],j=[],N=new Map,V=0,k=-1,$=new Map,M=new Set,B=new Map,H=new Map,X=new Set,te=new Map,Y=new Map,ae=!1;function Ae(){if(d=e.history.listen(J=>{let{action:ne,location:ie,delta:fe}=J;if(ae){ae=!1;return}$i(Y.size===0||fe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Pe=uh({currentLocation:E.location,nextLocation:ie,historyAction:ne});if(Pe&&fe!=null){ae=!0,e.history.go(fe*-1),cl(Pe,{state:"blocked",location:ie,proceed(){cl(Pe,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),e.history.go(fe)},reset(){let Ke=new Map(E.blockers);Ke.set(Pe,El),G({blockers:Ke})}});return}return ge(ne,ie)}),n){UQ(t,I);let J=()=>FQ(t,I);t.addEventListener("pagehide",J),U=()=>t.removeEventListener("pagehide",J)}return E.initialized||ge(vt.Pop,E.location,{initialHydration:!0}),C}function oe(){d&&d(),U&&U(),f.clear(),T&&T.abort(),E.fetchers.forEach((J,ne)=>zi(ne)),E.blockers.forEach((J,ne)=>ch(ne))}function K(J){return f.add(J),()=>f.delete(J)}function G(J,ne){ne===void 0&&(ne={}),E=Tt({},E,J);let ie=[],fe=[];u.v7_fetcherPersist&&E.fetchers.forEach((Pe,Ke)=>{Pe.state==="idle"&&(X.has(Ke)?fe.push(Ke):ie.push(Ke))}),[...f].forEach(Pe=>Pe(E,{deletedFetchers:fe,unstable_viewTransitionOpts:ne.viewTransitionOpts,unstable_flushSync:ne.flushSync===!0})),u.v7_fetcherPersist&&(ie.forEach(Pe=>E.fetchers.delete(Pe)),fe.forEach(Pe=>zi(Pe)))}function Q(J,ne,ie){var fe,Pe;let{flushSync:Ke}=ie===void 0?{}:ie,$e=E.actionData!=null&&E.navigation.formMethod!=null&&ls(E.navigation.formMethod)&&E.navigation.state==="loading"&&((fe=J.state)==null?void 0:fe._isRedirect)!==!0,ke;ne.actionData?Object.keys(ne.actionData).length>
3530?ke=ne.actionData:ke=null:$e?ke=E.actionData:ke=null;let Qe=ne.loaderData?Ox(E.loaderData,ne.loaderData,ne.matches||[],ne.errors):E.loaderData,We=E.blockers;We.size>0&&(We=new Map(We),We.forEach((He,It)=>We.set(It,El)));let hn=R===!0||E.navigation.formMethod!=null&&ls(E.navigation.formMethod)&&((Pe=J.state)==null?void 0:Pe._isRedirect)!==!0;a&&(o=a,a=void 0),L||x===vt.Pop||(x===vt.Push?e.history.push(J,J.state):x===vt.Replace&&e.history.replace(J,J.state));let pn;if(x===vt.Pop){let He=I.get(E.location.pathname);He&&He.has(J.pathname)?pn={currentLocation:E.location,nextLocation:J}:I.has(J.pathname)&&(pn={currentLocation:J,nextLocation:E.location})}else if(P){let He=I.get(E.location.pathname);He?He.add(J.pathname):(He=new Set([J.pathname]),I.set(E.location.pathname,He)),pn={currentLocation:E.location,nextLocation:J}}G(Tt({},ne,{actionData:ke,loaderData:Qe,historyAction:x,location:J,initialized:!0,navigation:my,revalidation:"idle",restoreScrollPosition:du(J,ne.matches||E.matches),preventScrollReset:hn,blockers:We}),{viewTransitionOpts:pn,flushSync:Ke===!0}),x=vt.Pop,R=!1,P=!1,L=!1,z=!1,O=[],j=[]}async function Z(J,ne){if(typeof J=="number"){e.history.go(J);return}let ie=U2(E.location,E.matches,l,u.v7_prependBasename,J,u.v7_relativeSplatPath,ne==null?void 0:ne.fromRouteId,ne==null?void 0:ne.relative),{path:fe,submission:Pe,error:Ke}=Ax(u.v7_normalizeFormMethod,!1,ie,ne),$e=E.location,ke=Qa(E.location,fe,ne&&ne.state);ke=Tt({},ke,e.history.encodeLocation(ke));let Qe=ne&&ne.replace!=null?ne.replace:void 0,We=vt.Push;Qe===!0?We=vt.Replace:Qe===!1||Pe!=null&&ls(Pe.formMethod)&&Pe.formAction===E.location.pathname+E.location.search&&(We=vt.Replace);let hn=ne&&"preventScrollReset"in ne?ne.preventScrollReset===!0:void 0,pn=(ne&&ne.unstable_flushSync)===!0,He=uh({currentLocation:$e,nextLocation:ke,historyAction:We});if(He){cl(He,{state:"blocked",location:ke,proceed(){cl(He,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),Z(J,ne)},reset(){let It=new Map(E.blockers);It.set(He,El),G({blockers:It})}});return}return await ge(We,ke,{submission:Pe,pendingError:Ke,preventScrollReset:hn,replace:ne&&ne.replace,enableViewTransition:ne&&ne.unstable_viewTransition,flushSync:pn})}function ee(){if(dn(),G({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){ge(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}ge(x||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function ge(J,ne,ie){T&&T.abort(),T=null,x=J,L=(ie&&ie.startUninterruptedRevalidation)===!0,dh(E.location,E.matches),R=(ie&&ie.preventScrollReset)===!0,P=(ie&&ie.enableViewTransition)===!0;let fe=a||o,Pe=ie&&ie.overrideNavigation,Ke=ba(fe,ne,l),$e=(ie&&ie.flushSync)===!0;if(!Ke){let He=Lr(404,{pathname:ne.pathname}),{matches:It,route:rn}=Nx(fe);ul(),Q(ne,{matches:It,loaderData:{},errors:{[rn.id]:He}},{flushSync:$e});return}if(E.initialized&&!z&&OQ(E.location,ne)&&!(ie&&ie.submission&&ls(ie.submission.formMethod))){Q(ne,{matches:Ke},{flushSync:$e});return}T=new AbortController;let ke=bl(e.history,ne,T.signal,ie&&ie.submission),Qe;if(ie&&ie.pendingError)Qe=[vd(Ke).route.id,{type:Nt.error,error:ie.pendingError}];else if(ie&&ie.submission&&ls(ie.submission.formMethod)){let He=await pe(ke,ne,ie.submission,Ke,{replace:ie.replace,flushSync:$e});if(He.shortCircuited)return;Qe=He.pendingActionResult,Pe=vy(ne,ie.submission),$e=!1,ke=bl(e.history,ke.url,ke.signal)}let{shortCircuited:We,loaderData:hn,errors:pn}=await xe(ke,ne,Ke,Pe,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,$e,Qe);We||(T=null,Q(ne,Tt({matches:Ke},Ix(Qe),{loaderData:hn,errors:pn})))}async function pe(J,ne,ie,fe,Pe){Pe===void 0&&(Pe={}),dn();let Ke=DQ(ne,ie);G({navigation:Ke},{flushSync:Pe.flushSync===!0});let $e,ke=$2(fe,ne);if(!ke.route.action&&!ke.route.lazy)$e={type:Nt.error,error:Lr(405,{method:J.method,pathname:ne.pathname,routeId:ke.route.id})};else if($e=(await Ot("action",J,[ke],fe))[0],J.signal.aborted)return{shortCircuited:!0};if(wa($e)){let Qe;return Pe&&Pe.replace!=null?Qe=Pe.replace:Qe=Px($e.response.headers.get("Location"),new URL(J.url),l)===E.location.pathname+E.location.search,await we(J,$e,{submission:ie,replace:Qe}),{shortCircuited:!0}}if(_a($e))throw Lr(400,{type:"defer-action"});if($r($e)){let Qe=vd(fe,ke.route.id);return(Pe&&Pe.replace)!==!0&&(x=vt.Push),{pendingActionResult:[Qe.route.id,$e]}}return{pendingActionResult:[ke.route.id,$e]}}async function xe(J,ne,ie,fe,Pe,Ke,$e,ke,Qe,We){let hn=fe||vy(ne,Pe),pn=Pe||Ke||Mx(hn),He=a||o,[It,rn]=Cx(e.history,E,ie,pn,ne,u.v7_partialHydration&&ke===!0,u.unstable_skipActionErrorRevalidation,z,O,j,X,B,M,He,l,We);if(ul(rt=>!(ie&&ie.some(Fn=>Fn.route.id===rt))||It&&It.some(Fn=>Fn.route.id===rt)),k=++V,It.length===0&&rn.length===0){let rt=ra();return Q(ne,Tt({matches:ie,loaderData:{},errors:We&&$r(We[1])?{[We[0]]:We[1].error}:null},Ix(We),rt?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Qe}),{shortCircuited:!0}}
353if(!L&&(!u.v7_partialHydration||!ke)){rn.forEach(Fn=>{let Rr=E.fetchers.get(Fn.key),gn=Du(void 0,Rr?Rr.data:void 0);E.fetchers.set(Fn.key,gn)});let rt;We&&!$r(We[1])?rt={[We[0]]:We[1].data}:E.actionData&&(Object.keys(E.actionData).length===0?rt=null:rt=E.actionData),G(Tt({navigation:hn},rt!==void 0?{actionData:rt}:{},rn.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Qe})}rn.forEach(rt=>{N.has(rt.key)&&Pr(rt.key),rt.controller&&N.set(rt.key,rt.controller)});let fu=()=>rn.forEach(rt=>Pr(rt.key));T&&T.signal.addEventListener("abort",fu);let{loaderResults:Hi,fetcherResults:dl}=await Un(E.matches,ie,It,rn,J);if(J.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",fu),rn.forEach(rt=>N.delete(rt.key));let fl=Lx([...Hi,...dl]);if(fl){if(fl.idx>=It.length){let rt=rn[fl.idx-It.length].key;M.add(rt)}return await we(J,fl.result,{replace:$e}),{shortCircuited:!0}}let{loaderData:hl,errors:As}=kx(E,ie,It,Hi,We,rn,dl,te);te.forEach((rt,Fn)=>{rt.subscribe(Rr=>{(Rr||rt.done)&&te.delete(Fn)})}),u.v7_partialHydration&&ke&&E.errors&&Object.entries(E.errors).filter(rt=>{let[Fn]=rt;return!It.some(Rr=>Rr.route.id===Fn)}).forEach(rt=>{let[Fn,Rr]=rt;As=Object.assign(As||{},{[Fn]:Rr})});let fh=ra(),hh=lh(k),ph=fh||hh||rn.length>0;return Tt({loaderData:hl,errors:As},ph?{fetchers:new Map(E.fetchers)}:{})}function Le(J,ne,ie,fe){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(J)&&Pr(J);let Pe=(fe&&fe.unstable_flushSync)===!0,Ke=a||o,$e=U2(E.location,E.matches,l,u.v7_prependBasename,ie,u.v7_relativeSplatPath,ne,fe==null?void 0:fe.relative),ke=ba(Ke,$e,l);if(!ke){Jr(J,ne,Lr(404,{pathname:$e}),{flushSync:Pe});return}let{path:Qe,submission:We,error:hn}=Ax(u.v7_normalizeFormMethod,!0,$e,fe);if(hn){Jr(J,ne,hn,{flushSync:Pe});return}let pn=$2(ke,Qe);if(R=(fe&&fe.preventScrollReset)===!0,We&&ls(We.formMethod)){Be(J,ne,Qe,pn,ke,Pe,We);return}B.set(J,{routeId:ne,path:Qe}),ye(J,ne,Qe,pn,ke,Pe,We)}async function Be(J,ne,ie,fe,Pe,Ke,$e){if(dn(),B.delete(J),!fe.route.action&&!fe.route.lazy){let gn=Lr(405,{method:$e.formMethod,pathname:ie,routeId:ne});Jr(J,ne,gn,{flushSync:Ke});return}let ke=E.fetchers.get(J);fn(J,MQ($e,ke),{flushSync:Ke});let Qe=new AbortController,We=bl(e.history,ie,Qe.signal,$e);N.set(J,Qe);let hn=V,He=(await Ot("action",We,[fe],Pe))[0];if(We.signal.aborted){N.get(J)===Qe&&N.delete(J);return}if(u.v7_fetcherPersist&&X.has(J)){if(wa(He)||$r(He)){fn(J,eo(void 0));return}}else{if(wa(He))if(N.delete(J),k>hn){fn(J,eo(void 0));return}else return M.add(J),fn(J,Du($e)),we(We,He,{fetcherSubmission:$e});if($r(He)){Jr(J,ne,He.error);return}}if(_a(He))throw Lr(400,{type:"defer-action"});let It=E.navigation.location||E.location,rn=bl(e.history,It,Qe.signal),fu=a||o,Hi=E.navigation.state!=="idle"?ba(fu,E.navigation.location,l):E.matches;Fe(Hi,"Didn't find any matches after fetcher action");let dl=++V;$.set(J,dl);let fl=Du($e,He.data);E.fetchers.set(J,fl);let[hl,As]=Cx(e.history,E,Hi,$e,It,!1,u.unstable_skipActionErrorRevalidation,z,O,j,X,B,M,fu,l,[fe.route.id,He]);As.filter(gn=>gn.key!==J).forEach(gn=>{let hu=gn.key,lE=E.fetchers.get(hu),e8=Du(void 0,lE?lE.data:void 0);E.fetchers.set(hu,e8),N.has(hu)&&Pr(hu),gn.controller&&N.set(hu,gn.controller)}),G({fetchers:new Map(E.fetchers)});let fh=()=>As.forEach(gn=>Pr(gn.key));Qe.signal.addEventListener("abort",fh);let{loaderResults:hh,fetcherResults:ph}=await Un(E.matches,Hi,hl,As,rn);if(Qe.signal.aborted)return;Qe.signal.removeEventListener("abort",fh),$.delete(J),N.delete(J),As.forEac
353h(gn=>N.delete(gn.key));let rt=Lx([...hh,...ph]);if(rt){if(rt.idx>=hl.length){let gn=As[rt.idx-hl.length].key;M.add(gn)}return we(rn,rt.result)}let{loaderData:Fn,errors:Rr}=kx(E,E.matches,hl,hh,void 0,As,ph,te);if(E.fetchers.has(J)){let gn=eo(He.data);E.fetchers.set(J,gn)}lh(dl),E.navigation.state==="loading"&&dl>k?(Fe(x,"Expected pending action"),T&&T.abort(),Q(E.navigation.location,{matches:Hi,loaderData:Fn,errors:Rr,fetchers:new Map(E.fetchers)})):(G({errors:Rr,loaderData:Ox(E.loaderData,Fn,Hi,Rr),fetchers:new Map(E.fetchers)}),z=!1)}async function ye(J,ne,ie,fe,Pe,Ke,$e){let ke=E.fetchers.get(J);fn(J,Du($e,ke?ke.data:void 0),{flushSync:Ke});let Qe=new AbortController,We=bl(e.history,ie,Qe.signal);N.set(J,Qe);let hn=V,He=(await Ot("loader",We,[fe],Pe))[0];if(_a(He)&&(He=await cL(He,We.signal,!0)||He),N.get(J)===Qe&&N.delete(J),!We.signal.aborted){if(X.has(J)){fn(J,eo(void 0));return}if(wa(He))if(k>hn){fn(J,eo(void 0));return}else{M.add(J),await we(We,He);return}if($r(He)){Jr(J,ne,He.error);return}Fe(!_a(He),"Unhandled fetcher deferred data"),fn(J,eo(He.data))}}async function we(J,ne,ie){let{submission:fe,fetcherSubmission:Pe,replace:Ke}=ie===void 0?{}:ie;ne.response.headers.has("X-Remix-Revalidate")&&(z=!0);let $e=ne.response.headers.get("Location");Fe($e,"Expected a Location header on the redirect Response"),$e=Px($e,new URL(J.url),l);let ke=Qa(E.location,$e,{_isRedirect:!0});if(n){let It=!1;if(ne.response.headers.has("X-Remix-Reload-Document"))It=!0;else if(X_.test($e)){const rn=e.history.createURL($e);It=rn.origin!==t.location.origin||dr(rn.pathname,l)==null}if(It){Ke?t.location.replace($e):t.location.assign($e);return}}T=null;let Qe=Ke===!0?vt.Replace:vt.Push,{formMethod:We,formAction:hn,formEncType:pn}=E.navigation;!fe&&!Pe&&We&&hn&&pn&&(fe=Mx(E.navigation));let He=fe||Pe;if(bQ.has(ne.response.status)&&He&&ls(He.formMethod))await ge(Qe,ke,{submission:Tt({},He,{formAction:$e}),preventScrollReset:R});else{let It=vy(ke,fe);await ge(Qe,ke,{overrideNavigation:It,fetcherSubmission:Pe,preventScrollReset:R})}}async function Ot(J,ne,ie,fe){try{let Pe=await xQ(c,J,ne,ie,fe,i,s);return await Promise.all(Pe.map((Ke,$e)=>{if(IQ(Ke)){let ke=Ke.result;return{type:Nt.redirect,response:RQ(ke,ne,ie[$e].route.id,fe,l,u.v7_relativeSplatPath)}}return PQ(Ke)}))}catch(Pe){return ie.map(()=>({type:Nt.error,error:Pe}))}}async function Un(J,ne,ie,fe,Pe){let[Ke,...$e]=await Promise.all([ie.length?Ot("loader",Pe,ie,ne):[],...fe.map(ke=>{if(ke.matches&&ke.match&&ke.controller){let Qe=bl(e.history,ke.path,ke.controller.signal);return Ot("loader",Qe,[ke.match],ke.matches).then(We=>We[0])}else return Promise.resolve({type:Nt.error,error:Lr(404,{pathname:ke.path})})})]);return await Promise.all([Dx(J,ie,Ke,Ke.map(()=>Pe.signal),!1,E.loaderData),Dx(J,fe.map(ke=>ke.match),$e,fe.map(ke=>ke.controller?ke.controller.signal:null),!0)]),{loaderResults:Ke,fetcherResults:$e}}function dn(){z=!0,O.push(...ul()),B.forEach((J,ne)=>{N.has(ne)&&(j.push(ne),Pr(ne))})}function fn(J,ne,ie){ie===void 0&&(ie={}),E.fetchers.set(J,ne),G({fetchers:new Map(E.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function Jr(J,ne,ie,fe){fe===void 0&&(fe={});let Pe=vd(E.matches,ne);zi(J),G({errors:{[Pe.route.id]:ie},fetchers:new Map(E.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function cu(J){return u.v7_fetcherPersist&&(H.set(J,(H.get(J)||0)+1),X.has(J)&&X.delete(J)),E.fetchers.get(J)||sL}function zi(J){let ne=E.fetchers.get(J);N.has(J)&&!(ne&&ne.state==="loading"&&$.has(J))&&Pr(J),B.delete(J),$.delete(J),M.delete(J),X.delete(J),E.fetchers.delete(J)}function Gi(J){if(u.v7_fetcherPersist){let ne=(H.get(J)||0)-1;ne<=0?(H.delete(J),X.add(J)):H.set(J,ne)}else zi(J);G({fetchers:new Map(E.fetchers)})}function Pr(J){let ne=N.get(J);Fe(ne,"Expected fetch controller: "+J),ne.abort(),N.delete(J)}function ll(J){for(let ne of J){let ie=cu(ne),fe=eo(ie.data);E.fetchers.set(ne,fe)}}function ra(){let J=[],ne=!1;for(let ie of M){let fe=E.fetchers.get(ie);Fe(fe,"Expected fetcher: "+ie),fe.state==="loading"&&(M.delete(ie),J.push(ie),ne=!0)}return ll(J),ne}function lh(J){let ne=[];for(let[ie,fe]of $)if(fe<J){let Pe=E.fetchers.get(ie);Fe(Pe,"Expected fetcher: "+ie),Pe.state==="loading"&&(Pr(ie),$.delete(ie),ne.pu
353sh(ie))}return ll(ne),ne.length>0}function s0(J,ne){let ie=E.blockers.get(J)||El;return Y.get(J)!==ne&&Y.set(J,ne),ie}function ch(J){E.blockers.delete(J),Y.delete(J)}function cl(J,ne){let ie=E.blockers.get(J)||El;Fe(ie.state==="unblocked"&&ne.state==="blocked"||ie.state==="blocked"&&ne.state==="blocked"||ie.state==="blocked"&&ne.state==="proceeding"||ie.state==="blocked"&&ne.state==="unblocked"||ie.state==="proceeding"&&ne.state==="unblocked","Invalid blocker state transition: "+ie.state+" -> "+ne.state);let fe=new Map(E.blockers);fe.set(J,ne),G({blockers:fe})}function uh(J){let{currentLocation:ne,nextLocation:ie,historyAction:fe}=J;if(Y.size===0)return;Y.size>1&&$i(!1,"A router only supports one blocker at a time");let Pe=Array.from(Y.entries()),[Ke,$e]=Pe[Pe.length-1],ke=E.blockers.get(Ke);if(!(ke&&ke.state==="proceeding")&&$e({currentLocation:ne,nextLocation:ie,historyAction:fe}))return Ke}function ul(J){let ne=[];return te.forEach((ie,fe)=>{(!J||J(fe))&&(ie.cancel(),ne.push(fe),te.delete(fe))}),ne}function i0(J,ne,ie){if(g=J,p=ne,h=ie||null,!v&&E.navigation===my){v=!0;let fe=du(E.location,E.matches);fe!=null&&G({restoreScrollPosition:fe})}return()=>{g=null,p=null,h=null}}function uu(J,ne){return h&&h(J,ne.map(fe=>X4(fe,E.loaderData)))||J.key}function dh(J,ne){if(g&&p){let ie=uu(J,ne);g[ie]=p()}}function du(J,ne){if(g){let ie=uu(J,ne),fe=g[ie];if(typeof fe=="number")return fe}return null}function o0(J){i={},a=M2(J,s,void 0,i)}return C={get basename(){return l},get future(){return u},get state(){return E},get routes(){return o},get window(){return t},initialize:Ae,subscribe:K,enableScrollRestoration:i0,navigate:Z,fetch:Le,revalidate:ee,createHref:J=>e.history.createHref(J),encodeLocation:J=>e.history.encodeLocation(J),getFetcher:cu,deleteFetcher:Gi,dispose:oe,getBlocker:s0,deleteBlocker:ch,_internalFetchControllers:N,_internalActiveDeferreds:te,_internalSetRoutes:o0},C}function wQ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function U2(e,t,n,r,s,i,o,a){let l,c;if(o){l=[];for(let d of t)if(l.push(d),d.route.id===o){c=d;break}}else l=t,c=t[t.length-1];let u=Ev(s||".",wv(l,i),dr(e.pathname,n)||e.pathname,a==="path");return s==null&&(u.search=e.search,u.hash=e.hash),(s==null||s===""||s===".")&&c&&c.route.index&&!Z_(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Ks([n,u.pathname])),vs(u)}function Ax(e,t,n,r){if(!r||!wQ(r))return{path:n};if(r.formMethod&&!LQ(r.formMethod))return{path:n,error:Lr(405,{method:r.formMethod})};let s=()=>({path:n,error:Lr(400,{type:"invalid-body"})}),i=r.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),a=aL(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ls(o))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,h)=>{let[p,v]=h;return""+g+p+"="+v+` 354`},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!ls(o))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}Fe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=F2(r.formData),c=r.formData;else if(r.body instanceof FormData)l=F2(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Rx(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Rx(l)}catch{return s()}let u={formMethod:o,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(ls(u.formMethod))return{path:n,submission:u};let d=Qr(n);return t&&d.search&&Z_(d.search)&&l.append("index",""),d.search="?"+l,{path:vs(d),submission:u}}function EQ(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Cx(e,t,n,r,s,i,o,a,l,c,u,d,f,g,h,p){let v=p?$r(p[1])?p[1].error:p[1].data:void 0,m=e.createURL(t.location),S=e.createURL(s),b=p&&$r(p[1])?p[0]:void 0,w=b?EQ(n,b):n,A=p?p[1].statusCode:void 0,C=o&&A&&A>=400,E=w.filter((R,T)=>{let{route:P}=R;if(P.lazy)return!0;
354if(P.loader==null)return!1;if(i)return typeof P.loader!="function"||P.loader.hydrate?!0:t.loaderData[P.id]===void 0&&(!t.errors||t.errors[P.id]===void 0);if(AQ(t.loaderData,t.matches[T],R)||l.some(L=>L===R.route.id))return!0;let I=t.matches[T],U=R;return xx(R,Tt({currentUrl:m,currentParams:I.params,nextUrl:S,nextParams:U.params},r,{actionResult:v,unstable_actionStatus:A,defaultShouldRevalidate:C?!1:a||m.pathname+m.search===S.pathname+S.search||m.search!==S.search||oL(I,U)}))}),x=[];return d.forEach((R,T)=>{if(i||!n.some(z=>z.route.id===R.routeId)||u.has(T))return;let P=ba(g,R.path,h);if(!P){x.push({key:T,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(T),U=$2(P,R.path),L=!1;f.has(T)?L=!1:c.includes(T)?L=!0:I&&I.state!=="idle"&&I.data===void 0?L=a:L=xx(U,Tt({currentUrl:m,currentParams:t.matches[t.matches.length-1].params,nextUrl:S,nextParams:n[n.length-1].params},r,{actionResult:v,unstable_actionStatus:A,defaultShouldRevalidate:C?!1:a})),L&&x.push({key:T,routeId:R.routeId,path:R.path,matches:P,match:U,controller:new AbortController})}),[E,x]}function AQ(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function oL(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function xx(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Tx(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];Fe(s,"No route found in manifest");let i={};for(let o in r){let l=s[o]!==void 0&&o!=="hasErrorBoundary";$i(!l,'Route "'+s.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!l&&!HY.has(o)&&(i[o]=r[o])}Object.assign(s,i),Object.assign(s,Tt({},t(s),{lazy:void 0}))}function CQ(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function xQ(e,t,n,r,s,i,o,a){let l=r.reduce((d,f)=>d.add(f.route.id),new Set),c=new Set,u=await e({matches:s.map(d=>{let f=l.has(d.route.id);return Tt({},d,{shouldLoad:f,resolve:h=>(c.add(d.route.id),f?TQ(t,n,d,i,o,h,a):Promise.resolve({type:Nt.data,result:void 0}))})}),request:n,params:s[0].params,context:a});return s.forEach(d=>Fe(c.has(d.route.id),'`match.resolve()` was not called for route id "'+d.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),u.filter((d,f)=>l.has(s[f].route.id))}async function TQ(e,t,n,r,s,i,o){let a,l,c=u=>{let d,f=new Promise((p,v)=>d=v);l=()=>d(),t.signal.addEventListener("abort",l);let g=p=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:o},...p!==void 0?[p]:[]),h;return i?h=i(p=>g(p)):h=(async()=>{try{return{type:"data",result:await g()}}catch(p){return{type:"error",result:p}}})(),Promise.race([h,f])};try{let u=n.route[e];if(n.route.lazy)if(u){let d,[f]=await Promise.all([c(u).catch(g=>{d=g}),Tx(n.route,s,r)]);if(d!==void 0)throw d;a=f}else if(await Tx(n.route,s,r),u=n.route[e],u)a=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Lr(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Nt.data,result:void 0};else if(u)a=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw Lr(404,{pathname:f})}Fe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Nt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return a}
354async function PQ(e){let{result:t,type:n,status:r}=e;if(lL(t)){let o;try{let a=t.headers.get("Content-Type");a&&/\bapplication\/json\b/.test(a)?t.body==null?o=null:o=await t.json():o=await t.text()}catch(a){return{type:Nt.error,error:a}}return n===Nt.error?{type:Nt.error,error:new Av(t.status,t.statusText,o),statusCode:t.status,headers:t.headers}:{type:Nt.data,data:o,statusCode:t.status,headers:t.headers}}if(n===Nt.error)return{type:Nt.error,error:t,statusCode:Cv(t)?t.status:r};if(NQ(t)){var s,i;return{type:Nt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}return{type:Nt.data,data:t,statusCode:r}}function RQ(e,t,n,r,s,i){let o=e.headers.get("Location");if(Fe(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!X_.test(o)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);o=U2(new URL(t.url),a,s,!0,o,i),e.headers.set("Location",o)}return e}function Px(e,t,n){if(X_.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=dr(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function bl(e,t,n,r){let s=e.createURL(aL(t)).toString(),i={signal:n};if(r&&ls(r.formMethod)){let{formMethod:o,formEncType:a}=r;i.method=o.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=F2(r.formData):i.body=r.formData}return new Request(s,i)}function F2(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Rx(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kQ(e,t,n,r,s,i){let o={},a=null,l,c=!1,u={},d=r&&$r(r[1])?r[1].error:void 0;return n.forEach((f,g)=>{let h=t[g].route.id;if(Fe(!wa(f),"Cannot handle redirect results in processLoaderData"),$r(f)){let p=f.error;d!==void 0&&(p=d,d=void 0),a=a||{};{let v=vd(e,h);a[v.route.id]==null&&(a[v.route.id]=p)}o[h]=void 0,c||(c=!0,l=Cv(f.error)?f.error.status:500),f.headers&&(u[h]=f.headers)}else _a(f)?(s.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!c&&(l=f.statusCode),f.headers&&(u[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(l=f.statusCode),f.headers&&(u[h]=f.headers))}),d!==void 0&&r&&(a={[r[0]]:d},o[r[0]]=void 0),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:u}}function kx(e,t,n,r,s,i,o,a){let{loaderData:l,errors:c}=kQ(t,n,r,s,a);for(let u=0;u<i.length;u++){let{key:d,match:f,controller:g}=i[u];Fe(o!==void 0&&o[u]!==void 0,"Did not find corresponding fetcher result");let h=o[u];if(!(g&&g.signal.aborted))if($r(h)){let p=vd(e.matches,f==null?void 0:f.route.id);c&&c[p.route.id]||(c=Tt({},c,{[p.route.id]:h.error})),e.fetchers.delete(d)}else if(wa(h))Fe(!1,"Unhandled fetcher revalidation redirect");else if(_a(h))Fe(!1,"Unhandled fetcher deferred data");else{let p=eo(h.data);e.fetchers.set(d,p)}}return{loaderData:l,errors:c}}function Ox(e,t,n,r){let s=Tt({},t);for(let i of n){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(s[o]=t[o]):e[o]!==void 0&&i.route.loader&&(s[o]=e[o]),r&&r.hasOwnProperty(o))break}return s}function Ix(e){return e?$r(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vd(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Nx(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Lr(e,t){let{pathname:n,routeId:r,method:s,type:i}=t===void 0?{}:t,o="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(o="Bad Request",s&&n&&r?a="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(o="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",a='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",s&&n&&r?a="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(a='Invalid request method "'+s.toUpperCase()+'"')),new Av(e||500,o,new Error(a),!0)}function Lx(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(wa(n))return{result:n,idx:t}}}function aL(e){let t=typeof e=="string"?Qr(e):e;return vs(Tt({},t,{hash:""}))}function OQ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function IQ(e){return lL(e.result)&&SQ.has(e.result.status)}function _a(e){return e.type===Nt.deferred}function $r(e){return e.type===Nt.error}function wa(e){return(e&&e.type)===Nt.redirect}function NQ(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function lL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function LQ(e){return yQ.has(e.toLowerCase())}function ls(e){return mQ.has(e.toLowerCase())}async function Dx(e,t,n,r,s,i){for(let o=0;o<n.length;o++){let a=n[o],l=t[o];if(!l)continue;let c=e.find(d=>d.route.id===l.route.id),u=c!=null&&!oL(c,l)&&(i&&i[l.route.id])!==void 0;if(_a(a)&&(s||u)){let d=r[o];Fe(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await cL(a,d,s).then(f=>{f&&(n[o]=f||n[o])})}}}async function cL(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Nt.data,data:e.deferredData.unwrappedData}
354}catch(s){return{type:Nt.error,error:s}}return{type:Nt.data,data:e.deferredData.data}}}function Z_(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $2(e,t){let n=typeof t=="string"?Qr(t).search:t.search;if(e[e.length-1].route.index&&Z_(n||""))return e[e.length-1];let r=tL(e);return r[r.length-1]}function Mx(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,json:o}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function vy(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function DQ(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Du(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function MQ(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function eo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function UQ(e,t){try{let n=e.sessionStorage.getItem(iL);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function FQ(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(iL,JSON.stringify(n))}catch(r){$i(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** 355 * React Router v6.23.1 356 * 357 * Copyright (c) Remix Software Inc. 358 * 359 * This source code is licensed under the MIT license found in the 360 * LICENSE.md file in the root directory of this source tree. 361 * 362 * @license MIT 363 */function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jo.apply(this,arguments)}const nu=y.createContext(null),Hf=y.createContext(null),Wg=y.createContext(null),xr=y.createContext(null),ru=y.createContext(null),Tr=y.createContext({outlet:null,matches:[],isDataRoute:!1}),uL=y.createContext(null);function dL(e,t){let{relative:n}=t===void 0?{}:t;Jo()||Fe(!1);let{basename:r,navigator:s}=y.useContext(xr),{hash:i,pathname:o,search:a}=su(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:Ks([r,o])),s.createHref({pathname:l,search:a,hash:i})}function Jo(){return y.useContext(ru)!=null}function Xr(){return Jo()||Fe(!1),y.useContext(ru).location}function $Q(){return y.useContext(ru).navigationType}function jQ(e){Jo()||Fe(!1);let{pathname:t}=Xr();return y.useMemo(()=>Qd(e,t),[t,e])}function fL(e){y.useContext(xr).static||y.useLayoutEffect(e)}function al(){let{isDataRoute:e}=y.useContext(Tr);return e?eX():VQ()}function VQ(){Jo()||Fe(!1);let e=y.useContext(nu),{basename:t,future:n,navigator:r}=y.useContext(xr),{matches:s}=y.useContext(Tr),{pathname:i}=Xr(),o=JSON.stringify(wv(s,n.v7_relativeSplatPath)),a=y.useRef(!1);return fL(()=>{a.current=!0}),y.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=Ev(c,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ks([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,o,i,e])}const hL=y.createContext(null);function BQ(){return y.useContext(hL)}function pL(e){let t=y.useContext(Tr).outlet;return t&&y.createElement(hL.Provider,{value:e},t)}function gL(){let{matches:e}=y.useContext(Tr),t=e[e.length-1];return t?t.params:{}}function su(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(xr),{matches:s}=y.useContext(Tr),{pathname:i}=Xr(),o=JSON.stringify(wv(s,r.v7_relativeSplatPath));return y.useMemo(()=>Ev(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function mL(e,t){return vL(e,t)}function vL(e,t,n,r){Jo()||Fe(!1);let{navigator:s}=y.useContext(xr),{matches:i}=y.useContext(Tr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Xr(),u;if(t){var d;let v=typeof t=="string"?Qr(t):t;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||Fe(!1),u=v}else u=c;let f=u.pathname||"/",g=f;if(l!=="/"){let v=l.replace(/^\//,"").split("/");g="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let h=ba(e,{pathname:g}),p=yL(h&&h.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Ks([l,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Ks([l,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r);return t&&p?y.createElement(ru.Provider,{value:{location:jo({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:vt.Pop}},p):p}function zQ(){let e=tw(),t=Cv(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application
363Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,null)}const GQ=y.createElement(zQ,null);class HQ extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Tr.Provider,{value:this.props.routeContext},y.createElement(uL.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function WQ(e){let{routeContext:t,match:n,children:r}=e,s=y.useContext(nu);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Tr.Provider,{value:t},r)}function yL(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||Fe(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:g}=n,h=d.route.loader&&f[d.route.id]===void 0&&(!g||g[d.route.id]===void 0);if(d.route.lazy||h){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let g,h=!1,p=null,v=null;n&&(g=a&&d.route.id?a[d.route.id]:void 0,p=d.route.errorElement||GQ,l&&(c<0&&f===0?(h=!0,v=null):c===f&&(h=!0,v=d.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,f+1)),S=()=>{let b;return g?b=p:h?b=v:d.route.Component?b=y.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,y.createElement(WQ,{match:d,routeContext:{outlet:u,matches:m,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?y.createElement(HQ,{location:n.location,revalidation:n.revalidation,component:p,error:g,children:S(),routeC
363ontext:{outlet:null,matches:m,isDataRoute:!0}}):S()},null)}var xv=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(xv||{}),fr=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fr||{});function ew(e){let t=y.useContext(nu);return t||Fe(!1),t}function Zo(e){let t=y.useContext(Hf);return t||Fe(!1),t}function KQ(e){let t=y.useContext(Tr);return t||Fe(!1),t}function Wf(e){let t=KQ(),n=t.matches[t.matches.length-1];return n.route.id||Fe(!1),n.route.id}function SL(){return Wf(fr.UseRouteId)}function bL(){return Zo(fr.UseNavigation).navigation}function qQ(){let e=ew(xv.UseRevalidator),t=Zo(fr.UseRevalidator);return y.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function _L(){let{matches:e,loaderData:t}=Zo(fr.UseMatches);return y.useMemo(()=>e.map(n=>X4(n,t)),[e,t])}function YQ(){let e=Zo(fr.UseLoaderData),t=Wf(fr.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function QQ(e){return Zo(fr.UseRouteLoaderData).loaderData[e]}function XQ(){let e=Zo(fr.UseActionData),t=Wf(fr.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function tw(){var e;let t=y.useContext(uL),n=Zo(fr.UseRouteError),r=Wf(fr.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function wL(){let e=y.useContext(Wg);return e==null?void 0:e._data}function JQ(){let e=y.useContext(Wg);return e==null?void 0:e._error}let ZQ=0;function EL(e){let{router:t,basename:n}=ew(xv.UseBlocker),r=Zo(fr.UseBlocker),[s,i]=y.useState(""),o=y.useCallback(a=>
363{if(typeof e!="function")return!!e;if(n==="/")return e(a);let{currentLocation:l,nextLocation:c,historyAction:u}=a;return e({currentLocation:jo({},l,{pathname:dr(l.pathname,n)||l.pathname}),nextLocation:jo({},c,{pathname:dr(c.pathname,n)||c.pathname}),historyAction:u})},[n,e]);return y.useEffect(()=>{let a=String(++ZQ);return i(a),()=>t.deleteBlocker(a)},[t]),y.useEffect(()=>{s!==""&&t.getBlocker(s,o)},[t,s,o]),s&&r.blockers.has(s)?r.blockers.get(s):El}function eX(){let{router:e}=ew(xv.UseNavigateStable),t=Wf(fr.UseNavigateStable),n=y.useRef(!1);return fL(()=>{n.current=!0}),y.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,jo({fromRouteId:t},i)))},[e,t])}const tX="startTransition",Ux=ji[tX];function nX(e){let{basename:t,children:n,initialEntries:r,initialIndex:s,future:i}=e,o=y.useRef();o.current==null&&(o.current=K4({initialEntries:r,initialIndex:s,v5Compat:!0}));let a=o.current,[l,c]=y.useState({action:a.action,location:a.location}),{v7_startTransition:u}=i||{},d=y.useCallback(f=>
363{u&&Ux?Ux(()=>c(f)):c(f)},[c,u]);return y.useLayoutEffect(()=>a.listen(d),[a,d]),y.createElement(iu,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:i})}function Kf(e){let{to:t,replace:n,state:r,relative:s}=e;Jo()||Fe(!1);let{future:i,static:o}=y.useContext(xr),{matches:a}=y.useContext(Tr),{pathname:l}=Xr(),c=al(),u=Ev(t,wv(a,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(u);return y.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:s}),[c,d,s,n,r]),null}function Tv(e){return pL(e.context)}function AL(e){Fe(!1)}function iu(e){let{basename:t="/",children:n=null,location:r,navigationType:s=vt.Pop,navigator:i,static:o=!1,future:a}=e;Jo()&&Fe(!1);let l=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:i,static:o,future:jo({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=Qr(r));let{pathname:u="/",search:d="",hash:f="",state:g=null,key:h="default"}=r,p=y.useMemo(()=>{let v=dr(u,l);return v==null?null:{location:{pathname:v,search:d,hash:f,state:g,key:h},navigationType:s}},[l,u,d,f,g,h,s]);return p==null?null:y.createElement(xr.Provider,{value:c},y.createElement(ru.Provider,{children:n,value:p}))}function rX(e){let{children:t,location:n}=e;return mL(Xd(t),n)}function sX(e){let{children:t,errorElement:n,resolve:r}=e;return y.createElement(oX,{resolve:r,errorElement:n},y.createElement(aX,null,t))}var Or=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Or||{});const iX=new Promise(()=>{});class oX extends y.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("<Await> caught the following error during render",t,n)}render(){let{children:t,errorElement:n,resolve:r}=this.props,s=null,i=Or.pending;if(!(r instanceof Promise))i=Or.success,s=Promise.resolve(),Object.defineProperty(s,"_tracked",{get:()=>!0}),Object.defineProperty(s,"_data",{get:()=>r});else if(this.state.error){i=Or.error;let o=this.state.error;s=Promise.reject().catch(()=>{}),Object.defineProperty(s,"_tracked",{get:()=>!0}),Object.defineProperty(s,"_error",{get:()=>o})}else r._tracked?(s=r,i="_error"in s?Or.error:"_data"in s?Or.success:Or.pending):(i=Or.pending,Object.defineProperty(r,"_tracked",{get:()=>!0}),s=r.then(o=>Object.defineProperty(r,"_data",{get:()=>o}),o=>Object.defineProperty(r,"_error",{get:()=>o})));if(i===Or.error&&s._error instanceof Hg)throw iX;if(i===Or.error&&!n)throw s._error;if(i===Or.error)return y.createElement(Wg.Provider,{value:s,children:n});if(i===Or.success)return y.createElement(Wg.Provider,{value:s,children:t});throw s}}function aX(e){let{children:t}=e,n=wL(),r=typeof t=="function"?t(n):t;return y.createElement(y.Fragment,null,r)}function Xd(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let i=[...t,s];if(r.type===y.Fragment){n.push.apply(n,Xd(r.props.children,i));return}r.type!==AL&&Fe(!1),!r.props.index||!r.props.children||Fe(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Xd(r.props.children,i)),n.push(o)}),n}function lX(e){return yL(e)}function nw(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function cX(e,t){return J_({basename:t==null?void 0:t.basename,future:jo({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:K4({initialEntries:t==null?void 0:t.initialEntries,initialIndex:t==null?void 0:t.initialIndex}),hydrationData:t==null?void 0:t.hydrationData,routes:e,mapRouteProperties:nw,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy}).initialize()}/** 364 * React Router DOM v6.23.1 365 * 366 * Copyright (c) Remix Software Inc. 367 * 368 * This source code is licensed under the MIT license found in the 369 * LICENSE.md file in the root directory of this source tree. 370 * 371 * @license MIT 372 */function cr(){return cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cr.apply(this,arguments)}function rw(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}const Lp="get",yy="application/x-www-form-urlencoded";function Pv(e){return e!=null&&typeof e.tagName=="string"}function uX(e){return Pv(e)&&e.tagName.toLowerCase()==="button"}function dX(e){return Pv(e)&&e.tagName.toLowerCase()==="form"}function fX(e){return Pv(e)&&e.tagName.toLowerCase()==="input"}function hX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pX(e,t){return e.button===0&&(!t||t==="_self")&&!hX(e)}function Kg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function gX(e,t){let n=Kg(e);return t&&t.forEach((r,s)=>
372{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}let Xh=null;function mX(){if(Xh===null)try{new FormData(document.createElement("form"),0),Xh=!1}catch{Xh=!0}return Xh}const vX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sy(e){return e!=null&&!vX.has(e)?null:e}function yX(e,t){let n,r,s,i,o;if(dX(e)){let a=e.getAttribute("action");r=a?dr(a,t):null,n=e.getAttribute("method")||Lp,s=Sy(e.getAttribute("enctype"))||yy,i=new FormData(e)}else if(uX(e)||fX(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?dr(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Lp,s=Sy(e.getAttribute("formenctype"))||Sy(a.getAttribute("enctype"))||yy,i=new FormData(a,e),!mX()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?c+".":"";i.append(f+"x","0"),i.append(f+"y","0")}else c&&i.append(c,d)}}else{if(Pv(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Lp,r=null,s=yy,o=e}return i&&s==="text/plain"&&(o=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:o}}const SX=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],bX=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],_X=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],wX="6";try{window.__reactRouterVersion=wX}catch{}function CL(e,t){return J_({basename:t==null?void 0:t.basename,future:cr({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:q4({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||xL(),routes:e,mapRouteProperties:nw,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,window:t==null?void 0:t.window}).initialize()}function EX(e,t){return J_({basename:t==null?void 0:t.basename,future:cr({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Y4({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||xL(),routes:e,mapRouteProperties:nw,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,window:t==null?void 0:t.window}).initialize()}function xL(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=cr({},t,{errors:AX(t.errors)})),t}function AX(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Av(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let o=new i(s.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const sw=y.createContext({isTransitioning:!1}),iw=y.createContext(new Map),CX="startTransition",Vo=ji[CX],xX="flushSync",Fx=t$[xX],TX="useId",$x=ji[TX];function PX(e){Vo?Vo(e):e()}function Mu(e){Fx?Fx(e):e()}class RX{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function TL(e){let{fallbackElement:t,router:n,future:r}=e,[s,i]=y.useState(n.state),[o,a]=y.useState(),[l,c]=y.useState({isTransitioning:!1}),[u,d]=y.useState(),[f,g]=y.useState(),[h,p]=y.useState(),v=y.useRef(new Map),{v7_startTransition:m}=r||{},S=y.useCallback(E=>{m?PX(E):E()},[m]),b=y.useCallback((E,x)=>{let{deletedFetchers:R,unstable_flushSync:T,unstable_viewTransitionOpts:P}=x;R.forEach(U=>v.current.delete(U)),E.fetchers.forEach((U,L)=>{U.data!==void 0&&v.current.set(L,U.data)});let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!P||I){T?Mu(()=>i(E)):S(()=>i(E));return}if(T){Mu(()=>{f&&(u&&u.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let U=n.window.document.startViewTransition(()=>{Mu(()=>i(E))});U.finished.finally(()=>{Mu(()=>{d(void 0),g(void 0),a(void 0),c({isTransitioning:!1})})}),Mu(()=>g(U));return}f?(u&&u.resolve(),f.skipTransition(),p({state:E,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(a(E),c({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[n.window,f,u,v,S]);y.useLayoutEffect(()=>n.subscribe(b),[n,b]),y.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new RX)},[l]),y.useEffect(()=>{if(u&&o&&n.window){let E=o,x=u.promise,R=n.window.document.startViewTransition(async()=>{S(()=>i(E)),await x});R.finished.finally(()=>{d(void 0),g(void 0),a(void 0),c({isTransitioning:!1})}),g(R)}},[S,o,u,n.window]),y.useEffect(()=>{u&&o&&s.location.key===o.location.key&&u.resolve()},[u,f,s.location,o]),y.useEffect(()=>{!l.isTransitioning&&h&&(a(h.state),c({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),p(void 0))},[l.isTransitioning,h]),y.useEffect(()=>{},[]);let w=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,x,R)=>n.navigate(E,{state:x,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(E,x,R)=>n.navigate(E,{replace:!0,state:x,preventScrollReset:R==null?void 0:R.preventScrollReset})}
372),[n]),A=n.basename||"/",C=y.useMemo(()=>({router:n,navigator:w,static:!1,basename:A}),[n,w,A]);return y.createElement(y.Fragment,null,y.createElement(nu.Provider,{value:C},y.createElement(Hf.Provider,{value:s},y.createElement(iw.Provider,{value:v.current},y.createElement(sw.Provider,{value:l},y.createElement(iu,{basename:A,location:s.location,navigationType:s.historyAction,navigator:w,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},s.initialized||n.future.v7_partialHydration?y.createElement(kX,{routes:n.routes,future:n.future,state:s}):t))))),null)}function kX(e){let{routes:t,future:n,state:r}=e;return vL(t,void 0,r,n)}function OX(e){let{basename:t,children:n,future:r,window:s}=e,i=y.useRef();i.current==null&&(i.current=q4({window:s,v5Compat:!0}));let o=i.current,[a,l]=y.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=y.useCallback(d=>{c&&Vo?Vo(()=>l(d)):l(d)},[l,c]);return y.useLayoutEffect(()=>o.listen(u),[o,u]),y.createElement(iu,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function IX(e){let{basename:t,children:n,future:r,window:s}=e,i=y.useRef();i.current==null&&(i.current=Y4({window:s,v5Compat:!0}));let o=i.current,[a,l]=y.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=y.useCallback(d=>{c&&Vo?Vo(()=>l(d)):l(d)},[l,c]);return y.useLayoutEffect(()=>o.listen(u),[o,u]),y.createElement(iu,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}function NX(e){let{basename:t,children:n,future:r,history:s}=e,[i,o]=y.useState({action:s.action,location:s.location}),{v7_startTransition:a}=r||{},l=y.useCallback(c=>{a&&Vo?Vo(()=>o(c)):o(c)},[o,a]);return y.useLayoutEffect(()=>s.listen(l),[s,l]),y.createElement(iu,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:s,future:r})}const LX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qg=y.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=t,f=rw(t,SX),{basename:g}=y.useContext(xr),h,p=!1;if(typeof c=="string"&&DX.test(c)&&(h=c,LX))try{let b=new URL(window.location.href),w=c.startsWith("//")?new URL(b.protocol+c):new URL(c),A=dr(w.pathname,g);w.origin===b.origin&&A!=null?c=A+w.search+w.hash:p=!0}catch{}let v=dL(c,{relative:s}),m=kL(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:s,unstable_viewTransition:d});function S(b){r&&r(b),b.defaultPrevented||m(b)}return y.createElement("a",cr({},f,{href:h||v,onClick:p||i?r:S,ref:n,target:l}))}),PL=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,unstable_viewTransition:c,children:u}=t,d=rw(t,bX),f=su(l,{relative:d.relative}),g=Xr(),h=y.useContext(Hf),{navigator:p,basename:v}=y.useContext(xr),m=h!=null&&LL(f)&&c===!0,S=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,b=g.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;s||(b=b.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&v&&(w=dr(w,v)||w);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let C=b===S||!o&&b.startsWith(S)&&b.charAt(A)==="/",E=w!=null&&(w===S||!o&&w.startsWith(S)&&w.charAt(S.length)==="/"),x={isActive:C,isPending:E,isTransitioning:m},R=C?r:void 0,T;typeof i=="function"?T=i(x):T=[i,C?"active":null,E?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let P=typeof a=="function"?a(x):a;return y.createElement(qg,cr({},d,{"aria-current":R,className:T,ref:n,style:P,to:l,unstable_viewTransition:c}),typeof u=="function"?u(x):u)}),RL=y.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:s,replace:i,state:o,method:a=Lp,action:l,onSubmit:c,relative:u,preventScrollReset:d,unstable_viewTransition:f}=e,g=rw(e,_X),h=lw(),p=IL(l,{relative:u}),v=a.toLowerCase()==="get"?"get":"post",m=S=>{if(c&&c(S),S.defaultPrevented)return;S.preventDefault();let b=S.nativeEvent.submitter,w=(b==null?void 0:b.getAttribute("formmethod"))||a;h(b||S.currentTarget,{fetcherKey:n,method:w,navigate:r,replace:i,state:o,relative:u,preventScrollReset:d,unstable_viewTransition:f})};return y.createElement("form",cr({ref:t,method:v,action:p,onSubmit:s?c:m},g))});function MX(e){let{getKey:t,storageKey:n}=e;return NL({getKey:t,storageKey:n}),null}var Uc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Uc||(Uc={}));var Jd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jd||(Jd={}));function Rv(e){let t=y.useContext(nu);return t||Fe(!1),t}function ow(e){let t=y.useContext(Hf);return t||Fe(!1),t}function kL(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a}=t===void 0?{}:t,l=al(),c=Xr(),u=su(e,{relative:o});return y.useCallback(d=>
372{if(pX(d,n)){d.preventDefault();let f=r!==void 0?r:vs(c)===vs(u);l(e,{replace:f,state:s,preventScrollReset:i,relative:o,unstable_viewTransition:a})}},[c,l,u,r,s,n,e,i,o,a])}function aw(e){let t=y.useRef(Kg(e)),n=y.useRef(!1),r=Xr(),s=y.useMemo(()=>gX(r.search,n.current?null:t.current),[r.search]),i=al(),o=y.useCallback((a,l)=>{const c=Kg(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}function UX(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let FX=0,OL=()=>"__"+String(++FX)+"__";function lw(){let{router:e}=Rv(Uc.UseSubmit),{basename:t}=y.useContext(xr),n=SL();return y.useCallback(function(r,s){s===void 0&&(s={}),UX();let{action:i,method:o,encType:a,formData:l,body:c}=yX(r,t);if(s.navigate===!1){let u=s.fetcherKey||OL();e.fetch(u,n,s.action||i,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||o,formEncType:s.encType||a,unstable_flushSync:s.unstable_flushSync})}else e.navigate(s.action||i,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||o,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:n,unstable_flushSync:s.unstable_flushSync,unstable_viewTransition:s.unstable_viewTransition})},[e,t,n])}function IL(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=y.useContext(xr),s=y.useContext(Tr);s||Fe(!1);let[i]=s.matches.slice(-1),o=cr({},su(e||".",{relative:n})),a=Xr();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search);l.has("index")&&l.get("index")===""&&(l.delete("index"),o.search=l.toString()?"?"+l.toString():"")}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:Ks([r,o.pathname])),vs(o)}function $X(e){var t;let{key:n}=e===void 0?{}:e,{router:r}=Rv(Uc.UseFetcher),s=ow(Jd.UseFetcher),i=y.useContext(iw),o=y.useContext(Tr),a=(t=o.matches[o.matches.length-1])==null?void 0:t.route.id;i||Fe(!1),o||Fe(!1),a==null&&Fe(!1);let l=$x?$x():"",[c,u]=y.useState(n||l);n&&n!==c?u(n):c||u(OL()),y.useEffect(()=>(r.getFetcher(c),()=>{r.deleteFetcher(c)}),[r,c]);let d=y.useCallback((S,b)=>{a||Fe(!1),r.fetch(c,a,S,b)},[c,a,r]),f=lw(),g=y.useCallback((S,b)=>{f(S,cr({},b,{navigate:!1,fetcherKey:c}))},[c,f]),h=y.useMemo(()=>y.forwardRef((b,w)=>y.createElement(RL,cr({},b,{navigate:!1,fetcherKey:c,ref:w}))),[c]),p=s.fetchers.get(c)||sL,v=i.get(c);return y.useMemo(()=>cr({Form:h,submit:g,load:d},p,{data:v}),[h,g,d,p,v])}function jX(){let e=ow(Jd.UseFetchers);return Array.from(e.fetchers.entries()).map(t=>{let[n,r]=t;return cr({},r,{key:n})})}const jx="react-router-scroll-positions";let Jh={};function NL(e){let{getKey:t,storageKey:n}=e===void 0?{}:e,{router:r}=Rv(Uc.UseScrollRestoration),{restoreScrollPosition:s,preventScrollReset:i}=ow(Jd.UseScrollRestoration),{basename:o}=y.useContext(xr),a=Xr(),l=_L(),c=bL();y.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),BX(y.useCallback(()=>{if(c.state==="idle"){let u=(t?t(a,l):null)||a.key;Jh[u]=window.scrollY}try{sessionStorage.setItem(n||jx,JSON.stringify(Jh))}catch{}window.history.scrollRestoration="auto"},[n,t,c.state,a,l])),typeof document<"u"&&(y.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(n||jx);u&&(Jh=JSON.parse(u))}catch{}},[n]),y.useLayoutEffect(()=>{let u=t&&o!=="/"?(f,g)=>t(cr({},f,{pathname:dr(f.pathname,o)||f.pathname}),g):t,d=r==null?void 0:r.enableScrollRestoration(Jh,()=>window.scrollY,u);return()=>d&&d()},[r,o,t]),y.useLayoutEffect(()=>{if(s!==!1){if(typeof s=="number"){window.scrollTo(0,s);return}if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}i!==!0&&window.scrollTo(0,0)}},[a,s,i]))}function VX(e,t){let{capture:n}=t||{};y.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("beforeunload",e,r),()=>{window.removeEventListener("beforeunload",e,r)}},[e,n])}function BX(e,t){let{capture:n}={};y.useEffect(()=>{let r=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,r),()=>{window.removeEventListener("pagehide",e,r)}},[e,n])}function zX(e){let{when:t,message:n}=e,r=EL(t);y.useEffect(()=>{r.state==="blocked"&&(window.confirm(n)?setTimeout(r.proceed,0):r.reset())},[r,n]),y.useEffect(()=>{r.state==="blocked"&&!t&&r.reset()},[r,t])}function LL(e,t){t===void 0&&(t={});let n=y.useContext(sw);n==null&&Fe(!1);let{basename:r}=Rv(Uc.useViewTransitionState),s=su(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=dr(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=dr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qd(s.pathname,o)!=null||Qd(s.pathname,i)!=null}const GX=Object.freeze(Object.defineProperty({__proto__:null,AbortedDeferredError:Hg,Await:sX,BrowserRouter:OX,Form:RL,HashRouter:IX,Link:qg,MemoryRouter:nX,NavLink:PL,Navigate:Kf,get NavigationType(){return vt},Outlet:Tv,Route:AL,Router:iu,RouterProvider:TL,Routes:rX,ScrollRestoration:MX,UNSAFE_DataRouterContext:nu,UNSAFE_DataRouterStateContext:Hf,UNSAFE_ErrorResponseImpl:Av,UNSAFE_FetchersContext:iw,UNSAFE_LocationContext:ru,UNSAFE_NavigationContext:xr,UNSAFE_RouteContext:Tr,UNSAFE_ViewTransitionContext:sw,UNSAFE_useRouteId:SL,UNSAFE_useScrollRestoration:NL,createBrowserRouter:CL,createHashRouter:EX,createMemoryRouter:cX,createPath:vs,createRoutesFromChildren:Xd,createRoutesFromElements:Xd,createSearchParams:Kg,defer:pQ,generatePath:rQ,isRouteErrorResponse:Cv,json:uQ,matchPath:Qd,matchRoutes:ba,parsePath:Qr,redirect:nL,redirectDocument:gQ,renderMatches:lX,resolvePath:eL,unstable_HistoryRouter:NX,unstable_usePrompt:zX,unstable_useViewTransitionState:LL,useActionData:XQ,useAsyncError:JQ,useAsyncValue:wL,useBeforeUnload:VX,useBlocker:EL,useFetcher:$X,useFetchers:jX,useFormAction:IL,useHref:dL,useInRouterContext:Jo,useLinkClickHandler:kL,useLoaderData:YQ,useLocation:Xr,useMatch:jQ,useMatches:_L,useNavigate:al,useNavigation:bL,useNavigationType:$Q,useOutlet:pL,useOutletContext:BQ,useParams:gL,useResolvedPath:su,useRevalidator:qQ,useRouteError:tw,useRouteLoaderData:QQ,useRoutes:mL,useSearchParams:aw,useSubmit:lw},Symbol.toStringTag,{value:"Module"})),Zd=e=>typeof e=="number"&&!isNaN(e),Ma=e=>typeof e=="string",Sr=e=>typeof e=="function",Dp=e=>Ma(e)||Sr(e)?e:null,j2=e=>y.isValidElement(e)||Ma(e)||Sr(e)||Zd(e);function HX(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function kv(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:i=300}=e;return function(o){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:d,isIn:f,playToast:g}=o;const h=r?`${t}--${l}`:t,p=r?`${n}--${l}
372`:n,v=y.useRef(0);return y.useLayoutEffect(()=>{const m=d.current,S=h.split(" "),b=w=>{w.target===d.current&&(g(),m.removeEventListener("animationend",b),m.removeEventListener("animationcancel",b),v.current===0&&w.type!=="animationcancel"&&m.classList.remove(...S))};m.classList.add(...S),m.addEventListener("animationend",b),m.addEventListener("animationcancel",b)},[]),y.useEffect(()=>{const m=d.current,S=()=>{m.removeEventListener("animationend",S),s?HX(m,u,i):u()};f||(c?S():(v.current=1,m.className+=` ${p}`,m.addEventListener("animationend",S)))},[f]),me.createElement(me.Fragment,null,a)}}function Vx(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Wn=new Map;let ef=[];const V2=new Set,WX=e=>V2.forEach(t=>t(e)),DL=()=>Wn.size>0;function ML(e,t){var n;if(t)return!((n=Wn.get(t))==null||!n.isToastActive(e));let r=!1;return Wn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function UL(e,t){j2(e)&&(DL()||ef.push({content:e,options:t}),Wn.forEach(n=>{n.buildToast(e,t)}))}function Bx(e,t){Wn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function KX(e){const{subscribe:t,getSnapshot:n,setProps:r}=y.useRef(function(i){const o=i.containerId||1;return{subscribe(a){const l=function(u,d,f){let g=1,h=0,p=[],v=[],m=[],S=d;const b=new Map,w=new Set,A=()=>
372{m=Array.from(b.values()),w.forEach(x=>x())},C=x=>{v=x==null?[]:v.filter(R=>R!==x),A()},E=x=>{const{toastId:R,onOpen:T,updateId:P,children:I}=x.props,U=P==null;x.staleId&&b.delete(x.staleId),b.set(R,x),v=[...v,x.props.toastId].filter(L=>L!==x.staleId),A(),f(Vx(x,U?"added":"updated")),U&&Sr(T)&&T(y.isValidElement(I)&&I.props)};return{id:u,props:S,observe:x=>(w.add(x),()=>w.delete(x)),toggle:(x,R)=>{b.forEach(T=>{R!=null&&R!==T.props.toastId||Sr(T.toggle)&&T.toggle(x)})},removeToast:C,toasts:b,clearQueue:()=>{h-=p.length,p=[]},buildToast:(x,R)=>{if((M=>{let{containerId:B,toastId:H,updateId:X}=M;const te=B?B!==u:u!==1,Y=b.has(H)&&X==null;return te||Y})(R))return;const{toastId:T,updateId:P,data:I,staleId:U,delay:L}=R,z=()=>{C(T)},O=P==null;O&&h++;const j={...S,style:S.toastStyle,key:g++,...Object.fromEntries(Object.entries(R).filter(M=>{let[B,H]=M;return H!=null})),toastId:T,updateId:P,data:I,closeToast:z,isIn:!1,className:Dp(R.className||S.toastClassName),bodyClassName:Dp(R.bodyClassName||S.bodyClassName),progressClassName:Dp(R.progressClassName||S.progressClassName),autoClose:!R.isLoading&&(N=R.autoClose,V=S.autoClose,N===!1||Zd(N)&&N>0?N:V),deleteToast(){const M=b.get(T),{onClose:B,children:H}=M.props;Sr(B)&&B(y.isValidElement(H)&&H.props),f(Vx(M,"removed")),b.delete(T),h--,h<0&&(h=0),p.length>0?E(p.shift()):A()}};var N,V;j.closeButton=S.closeButton,R.closeButton===!1||j2(R.closeButton)?j.closeButton=R.closeButton:R.closeButton===!0&&(j.closeButton=!j2(S.closeButton)||S.closeButton);let k=x;y.isValidElement(x)&&!Ma(x.type)?k=y.cloneElement(x,{closeToast:z,toastProps:j,data:I}):Sr(x)&&(k=x({closeToast:z,toastProps:j,data:I}));const $={content:k,props:j,staleId:U};S.limit&&S.limit>0&&h>S.limit&&O?p.push($):Zd(L)?setTimeout(()=>{E($)},L):E($)},setProps(x){S=x},setToggle:(x,R)=>{b.get(x).toggle=R},isToastActive:x=>v.some(R=>R===x),getSnapshot:()=>S.newestOnTop?m.reverse():m}}(o,i,WX);Wn.set(o,l);const c=l.observe(a);return ef.forEach(u=>UL(u.content,u.options)),ef=[],()=>{c(),Wn.delete(o)}},setProps(a){var l;(l=Wn.get(o))==null||l.setProps(a)},getSnapshot(){var a;return(a=Wn.get(o))==null?void 0:a.getSnapshot()}}}(e)).current;r(e);const s=y.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!s)return[];const o=new Map;return s.forEach(a=>{const{position:l}=a.props;o.has(l)||o.set(l,[]),o.get(l).push(a)}),Array.from(o,a=>i(a[0],a[1]))},isToastActive:ML,count:s==null?void 0:s.length}}function qX(e){const[t,n]=y.useState(!1),[r,s]=y.useState(!1),i=y.useRef(null),o=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:a,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:d}=e;var f,g;function h(){n(!0)}function p(){n(!1)}function v(b){const w=i.current;o.canDrag&&w&&(o.didMove=!0,t&&p(),o.delta=e.draggableDirection==="x"?b.clientX-o.start:b.clientY-o.start,o.start!==b.clientX&&(o.canCloseOnClick=!1),w.style.transform=`translate3d(${e.draggableDirection==="x"?`${o.delta}px, var(--y)`:`0, calc(${o.delta}px + var(--y))`},0)`,w.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function m(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",m);const b=i.current;if(o.canDrag&&o.didMove&&b){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();b.style.transition="transform 0.2s, opacity 0.2s",b.style.removeProperty("transform"),b.style.removeProperty("opacity")}}(g=Wn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||g.setToggle(f.id,f.fn),y.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||p(),window.addEventListener("focus",h),window.addEventListener("blur",p),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",p)}},[e.pauseOnFocusLoss]);const S={onPointerDown:function(b){if(e.draggable===!0||e.draggable===b.pointerType){o.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",m);const w=i.current;o.canCloseOnClick=!0,o.canDrag=!0,w.style.transition="none",e.draggableDirection==="x"?(o.start=b.clientX,o.removalDistance=w.offsetWidth*(e.draggablePercent/100)):(o.start=b.clientY,o.removalDistance=w.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(b){const{top:w,bottom:A,left:C,right:E}=i.current.getBoundingClientRect();b.nativeEvent.type!=="touchend"&&e.pauseOnHover&&b.clientX>=C&&b.clientX<=E&&b.clientY>
372=w&&b.clientY<=A?p():h()}};return a&&l&&(S.onMouseEnter=p,e.stacked||(S.onMouseLeave=h)),d&&(S.onClick=b=>{u&&u(b),o.canCloseOnClick&&c()}),{playToast:h,pauseToast:p,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:S}}function YX(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:i,className:o,style:a,controlledProgress:l,progress:c,rtl:u,isIn:d,theme:f}=e;const g=i||l&&c===0,h={...a,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(h.transform=`scaleX(${c})`);const p=Vs("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":u}),v=Sr(o)?o({rtl:u,type:s,defaultClassName:p}):Vs(p,o),m={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{d&&r()}};return me.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},me.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),me.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:v,style:h,...m}))}let QX=1;const FL=()=>""+QX++;function XX(e){return e&&(Ma(e.toastId)||Zd(e.toastId))?e.toastId:FL()}function yd(e,t){return UL(e,t),t.toastId}function Yg(e,t){return{...t,type:t&&t.type||e,toastId:XX(t)}}function Zh(e){return(t,n)=>yd(t,Yg(e,n))}function ht(e,t){return yd(e,Yg("default",t))}ht.loading=(e,t)=>
372yd(e,Yg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ht.promise=function(e,t,n){let r,{pending:s,error:i,success:o}=t;s&&(r=Ma(s)?ht.loading(s,n):ht.loading(s.render,{...n,...s}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,d,f)=>{if(d==null)return void ht.dismiss(r);const g={type:u,...a,...n,data:f},h=Ma(d)?{render:d}:d;return r?ht.update(r,{...g,...h}):ht(h.render,{...g,...h}),f},c=Sr(e)?e():e;return c.then(u=>l("success",o,u)).catch(u=>l("error",i,u)),c},ht.success=Zh("success"),ht.info=Zh("info"),ht.error=Zh("error"),ht.warning=Zh("warning"),ht.warn=ht.warning,ht.dark=(e,t)=>yd(e,Yg("default",{theme:"dark",...t})),ht.dismiss=function(e){(function(t){var n;if(DL()){if(t==null||Ma(n=t)||Zd(n))Wn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Wn.get(t.containerId);r?r.removeToast(t.id):Wn.forEach(s=>{s.removeToast(t.id)})}}else ef=ef.filter(r=>t!=null&&r.options.toastId!==t)})(e)},ht.clearWaitingQueue=function(e){e===void 0&&(e={}),Wn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},ht.isActive=ML,ht.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var i;let{containerId:o}=s;return(i=Wn.get(o||1))==null?void 0:i.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:FL()};i.toastId!==e&&(i.staleId=e);const o=i.render||s;delete i.render,yd(o,i)}},ht.done=e=>{ht.update(e,{progress:1})},ht.onChange=function(e){return V2.add(e),()=>{V2.delete(e)}},ht.play=e=>Bx(!0,e),ht.pause=e=>Bx(!1,e);const JX=typeof window<"u"?y.useLayoutEffect:y.useEffect,ep=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return me.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},by={info:function(e){return me.createElement(ep,{...e},me.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return me.createElement(ep,{...e},me.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return me.createElement(ep,{...e},me.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return me.createElement(ep,{...e},me.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return me.createElement("div",{className:"Toastify__spinner"})}},ZX=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:i}=qX(e),{closeButton:o,children:a,autoClose:l,onClick:c,type:u,hideProgressBar:d,closeToast:f,transition:g,position:h,className:p,style:v,bodyClassName:m,bodyStyle:S,progressClassName:b,progressStyle:w,updateId:A,role:C,progress:E,rtl:x,toastId:R,deleteToast:T,isIn:P,isLoading:I,closeOnClick:U,theme:L}=e,z=Vs("Toastify__toast",`Toastify__toast-theme--${L}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":U}),O=Sr(p)?p({rtl:x,position:h,type:u,defaultClassName:z}):Vs(z,p),j=function($){let{theme:M,type:B,isLoading:H,icon:X}=$,te=null;const Y={theme:M,type:B};return X===!1||(Sr(X)?te=X({...Y,isLoading:H}):y.isValidElement(X)?te=y.cloneElement(X,Y):H?te=by.spinner():(ae=>ae in by)(B)&&(te=by[B](Y))),te}(e),N=!!E||!l,V={closeToast:f,type:u,theme:L};let k=null;return o===!1||(k=Sr(o)?o(V):y.isValidElement(o)?y.cloneElement(o,V
372):function($){let{closeToast:M,theme:B,ariaLabel:H="close"}=$;return me.createElement("button",{className:`Toastify__close-button Toastify__close-button--${B}`,type:"button",onClick:X=>{X.stopPropagation(),M(X)},"aria-label":H},me.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},me.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(V)),me.createElement(g,{isIn:P,done:T,position:h,preventExitTransition:n,nodeRef:r,playToast:i},me.createElement("div",{id:R,onClick:c,"data-in":P,className:O,...s,style:v,ref:r},me.createElement("div",{...P&&{role:C},className:Sr(m)?m({type:u}):Vs("Toastify__toast-body",m),style:S},j!=null&&me.createElement("div",{className:Vs("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},j),me.createElement("div",null,a)),k,me.createElement(YX,{...A&&!N?{key:`pb-${A}`}:{},rtl:x,theme:L,delay:l,isRunning:t,isIn:P,closeToast:f,hide:d,type:u,style:w,className:b,controlledProgress:N,progress:E||0})))}
372,Ov=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},eJ=kv(Ov("bounce",!0)),tJ=kv(Ov("slide",!0));kv(Ov("zoom"));kv(Ov("flip"));const nJ={position:"top-right",transition:eJ,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function rJ(e){let t={...nJ,...e};const n=e.stacked,[r,s]=y.useState(!0),i=y.useRef(null),{getToastToRender:o,isToastActive:a,count:l}=KX(t),{className:c,style:u,rtl:d,containerId:f}=t;function g(p){const v=Vs("Toastify__toast-container",`Toastify__toast-container--${p}`,{"Toastify__toast-container--rtl":d});return Sr(c)?c({position:p,rtl:d,defaultClassName:v}):Vs(v,Dp(c))}function h(){n&&(s(!0),ht.play())}return JX(()=>{if(n){var p;const v=i.current.querySelectorAll('[data-in="true"]'),m=12,S=(p=t.position)==null?void 0:p.includes("top");let b=0,w=0;Array.from(v).reverse().forEach((A,C)=>{const E=A;E.classList.add("Toastify__toast--stacked"),C>0&&(E.dataset.collapsed=`${r}`),E.dataset.pos||(E.dataset.pos=S?"top":"bot");const x=b*(r?.2:1)+(r?0:m*C);E.style.setProperty("--y",`${S?x:-1*x}px`),E.style.setProperty("--g",`${m}`),E.style.setProperty("--s",""+(1-(r?w:0))),b+=E.offsetHeight,w+=.025})}},[r,l,n]),me.createElement("div",{ref:i,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),ht.pause())},onMouseLeave:h},o((p,v)=>{const m=v.length?{...u}:{...u,pointerEvents:"none"};return me.createElement("div",{className:g(p),style:m,key:`container-${p}`},v.map(S=>{let{content:b,props:w}=S;return me.createElement(ZX,{...w,stacked:n,collapseAll:h,isIn:a(w.toastId,w.containerId),style:w.style,key:`toast-${w.key}`},b)}))}))}const sJ="/assets/mirrord-logo-dark-DNb-8yUT.svg",iJ="/assets/mirrord-logo-light-BbbZ1bRc.svg";var Bo={};function ea(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function oJ(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function aJ(e){var t=oJ(e,"string");return Fc(t)=="symbol"?t:t+""}function zx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aJ(r.key),r)}}function ta(e,t,n){return t&&zx(e.prototype,t),n&&zx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var zr=function(){function e(){ea(this,e)}return ta(e,null,[{key:"setInstance",value:function(n,r){e._apps[n]=r}},{key:"getInstance",value:function(n){var r=e._apps[n];if(!r)throw Error("[".concat(n,"] FronteggApp not found"));return r}}]),e}();zr._apps={};const lJ=Object.freeze(Object.defineProperty({__proto__:null,AppHolder:zr},Symbol.toStringTag,{value:"Module"}));function cJ(e){if(Array.isArray(e))return e}function uJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,s=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return a}}function Gx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dJ(e,t){if(e){if(typeof e=="string")return Gx(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gx(e,t):void 0}}function fJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 373In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hJ(e,t){return cJ(e)||uJ(e,t)||dJ(e,t)||fJ()}function Hx(e,t,n,r,s,i,o){try{var a=e[i](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,s)}function Gt(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(l){Hx(i,r,s,o,a,"next",l)}
373function a(l){Hx(i,r,s,o,a,"throw",l)}o(void 0)})}}var $L={exports:{}},jL={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(jL);var pJ=jL.exports;(function(e){var t=pJ.default;function n(){e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var r,s={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(V,k,$){V[k]=$.value},l=typeof Symbol=="function"?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function f(V,k,$){return Object.defineProperty(V,k,{value:$,enumerable:!0,configurable:!0,writable:!0}),V[k]}try{f({},"")}catch{f=function($,M,B){return $[M]=B}}function g(V,k,$,M){var B=k&&k.prototype instanceof w?k:w,H=Object.create(B.prototype),X=new j(M||[]);return a(H,"_invoke",{value:U(V,$,X)}),H}function h(V,k,$){try{return{type:"normal",arg:V.call(k,$)}}catch(M){return{type:"throw",arg:M}}}s.wrap=g;var p="suspendedStart",v="suspendedYield",m="executing",S="completed",b={};function w(){}function A(){}function C(){}var E={};f(E,c,function(){return this});var x=Object.getPrototypeOf,R=x&&x(x(N([])));R&&R!==i&&o.call(R,c)&&(E=R);var T=C.prototype=w.prototype=Object.create(E);function P(V){["next","throw","return"].forEach(function(k){f(V,k,function($){return this._invoke(k,$)})})}function I(V,k){function $(B,H,X,te){var Y=h(V[B],V,H);if(Y.type!=="throw"){var ae=Y.arg,Ae=ae.value;return Ae&&t(Ae)=="object"&&o.call(Ae,"__await")?k.resolve(Ae.__await).then(function(oe){$("next",oe,X,te)},function(oe){$("throw",oe,X,te)}):k.resolve(Ae).then(function(oe){ae.value=oe,X(ae)},function(oe){return $("throw",oe,X,te)})}te(Y.arg)}var M;a(this,"_invoke",{value:function(H,X){function te(){return new k(function(Y,ae){$(H,X,Y,ae)})}return M=M?M.then(te,te):te()}})}function U(V,k,$){var M=p;return function(B,H){if(M===m)throw Error("Generator is already running");if(M===S){if(B==="throw")throw H;return{value:r,done:!0}}for($.method=B,$.arg=H;;){var X=$.delegate;if(X){var te=L(X,$);if(te){if(te===b)continue;return te}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(M===p)throw M=S,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);M=m;var Y=h(V,k,$);if(Y.type==="normal"){if(M=$.done?S:v,Y.arg===b)continue;return{value:Y.arg,done:$.done}}Y.type==="throw"&&(M=S,$.method="throw",$.arg=Y.arg)}}}function L(V,k){var $=k.method,M=V.iterator[$];if(M===r)return k.delegate=null,$==="throw"&&V.iterator.return&&(k.method="return",k.arg=r,L(V,k),k.method==="throw")||$!=="return"&&(k.method="throw",k.arg=new TypeError("The iterator does not provide a '"+$+"' method")),b;var B=h(M,V.iterator,k.arg);if(B.type==="throw")return k.method="throw",k.arg=B.arg,k.delegate=null,b;var H=B.arg;return H?H.done?(k[V.resultName]=H.value,k.next=V.nextLoc,k.method!=="return"&&(k.method="next",k.arg=r),k.delegate=null,b):H:(k.method="throw",k.arg=new TypeError("iterator result is not an object"),k.delegate=null,b)}function z(V){var k={tryLoc:V[0]};1 in V&&(k.catchLoc=V[1]),2 in V&&(k.finallyLoc=V[2],k.afterLoc=V[3]),this.tryEntries.push(k)}function O(V){var k=V.completion||{};k.type="normal",delete k.arg,V.completion=k}function j(V){this.tryEntries=[{tryLoc:"root"}],V.forEach(z,this),this.reset(!0)}function N(V){if(V||V===""){var k=V[c];if(k)return k.call(V);if(typeof V.next=="function")return V;if(!isNaN(V.length)){var $=-1,M=function B(){for(;++$<V.length;)if(o.call(V,$))return B.value=V[$],B.done=!1,B;return B.value=r,B.done=!0,B};return M.next=M}}throw new TypeError(t(V)+" is not iterable")}return A.prototype=C,a(T,"constructor",{value:C,configurable:!0}),a(C,"constructor",{value:A,configurable:!0}),A.displayName=f(C,d,"GeneratorFunction"),s.isGeneratorFunction=function(V){var k=typeof V=="function"&&V.constructor;return!!k&&(k===A||(k.displayName||k.name)==="GeneratorFunction")},s.mark=function(V){return Object.setPrototypeOf?Object.setPrototypeOf(V,C):(V.__proto__=C,f(V,d,"GeneratorFunction")),V.prototype=Object.create(T),V},s.awrap=function(V){return{__await:V}},P(I.prototype),f(I.prototype,u,function(){return this}),s.AsyncIterator=I,s.async=function(V,k,$,M,B){B===void 0&&(B=Promise);var H=new I(g(V,k,$,M),B);return s.isGeneratorFunction(k)?H:H.next().then(function(X){return X.done?X.value:H.next()})},P(T),f(T,d,"Generator"),f(T,c,function(){return this}),f(T,"toString",function(){return"[object Generator]"}),s.keys=function(V){var k=Object(V),$=[];for(var M in k)$.push(M);return $.reverse(),function B(){for(;$.length;){var H=$.pop();if(H in k)return B.value=H,B.done=!1,B}return B.done=!0,B}},s.values=N,j.prototype={constructor:j,reset:function(k){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEac
373h(O),!k)for(var $ in this)$.charAt(0)==="t"&&o.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=r)},stop:function(){this.done=!0;var k=this.tryEntries[0].completion;if(k.type==="throw")throw k.arg;return this.rval},dispatchException:function(k){if(this.done)throw k;var $=this;function M(ae,Ae){return X.type="throw",X.arg=k,$.next=ae,Ae&&($.method="next",$.arg=r),!!Ae}for(var B=this.tryEntries.length-1;B>=0;--B){var H=this.tryEntries[B],X=H.completion;if(H.tryLoc==="root")return M("end");if(H.tryLoc<=this.prev){var te=o.call(H,"catchLoc"),Y=o.call(H,"finallyLoc");if(te&&Y){if(this.prev<H.catchLoc)return M(H.catchLoc,!0);if(this.prev<H.finallyLoc)return M(H.finallyLoc)}else if(te){if(this.prev<H.catchLoc)return M(H.catchLoc,!0)}else{if(!Y)throw Error("try statement without catch or finally");if(this.prev<H.finallyLoc)return M(H.finallyLoc)}}}},abrupt:function(k,$){for(var M=this.tryEntries.length-1;M>=0;--M){var B=this.tryEntries[M];if(B.tryLoc<=this.prev&&o.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var H=B;break}}H&&(k==="break"||k==="continue")&&H.tryLoc<=$&&$<=H.finallyLoc&&(H=null);var X=H?H.completion:{};return X.type=k,X.arg=$,H?(this.method="next",this.next=H.finallyLoc,b):this.complete(X)},complete:function(k,$){if(k.type==="throw")throw k.arg;return k.type==="break"||k.type==="continue"?this.next=k.arg:k.type==="return"?(this.rval=this.arg=k.arg,this.method="return",this.next="end"):k.type==="normal"&&$&&(this.next=$),b},finish:function(k){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.finallyLoc===k)return this.complete(M.completion,M.afterLoc),O(M),b}},catch:function(k){for(var $=this.tryEntries.length-1;$>=0;--$){var M=this.tryEntries[$];if(M.tryLoc===k){var B=M.completion;if(B.type==="throw"){var H=B.arg;O(M)}return H}}throw Error("illegal catch attempt")},delegateYield:function(k,$,M){return this.delegate={iterator:N(k),resultName:$,nextLoc:M},this.method==="next"&&(this.arg=r),b}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})($L);var gJ=$L.exports,Mp=gJ(),mJ=Mp;try{regeneratorRuntime=Mp}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Mp:Function("r","regeneratorRuntime = r")(Mp)}const qe=Go(mJ),vJ="frontegg_external_mobile_browser";class yJ{constructor(){this.backToLoginImpl=void 0,this.loginWithSSO=t=>{if(this.isIOSNativeBridgeAvailable()){var n,r,s;(n=window.webkit)==null||(r=n.messageHandlers)==null||(s=r.FronteggNativeBridge)==null||s.postMessage(JSON.stringify({action:"loginWithSSO",payload:t}))}else if(this.isAndroidNativeBridgeAvailable()){var i;(i=window.FronteggNativeBridge)==null||i.loginWithSSO(t)}else throw new Error("FronteggNativeBridge is not available")},this.loginWithSocialLogin=t=>{if(this.isIOSNativeBridgeAvailable()){var n,r,s;(n=window.webkit)==null||(r=n.messageHandlers)==null||(s=r.FronteggNativeBridge)==null||s.postMessage(JSON.stringify({action:"loginWithSocialLogin",payload:t}))}else if(this.isAndroidNativeBridgeAvailable()){var i;(i=window.FronteggNativeBridge)==null||i.loginWithSocialLogin(t)}else throw new Error("FronteggNativeBridge is not available")},this.loginWithSocialLoginProvider=t=>{if(this.isIOSNativeBridgeAvailable()){var n,r,s;(n=window.webkit)==null||(r=n.messageHandlers)==null||(s=r.FronteggNativeBridge)==null||s.postMessage(JSON.stringify({action:"loginWithSocialLoginProvider",payload:t}))}else if(this.isAndroidNativeBridgeAvailable()){var i;(i=window.FronteggNativeBridge)==null||i.loginWithSocialLoginProvider(t)}else throw new Error("FronteggNativeBridge is not available")},this.loginWithCustomSocialLoginProvider=t=>{if(this.isIOSNativeBridgeAvailable()){var n,r,s;(n=window.webkit)==null||(r=n.messageHandlers)==null||(s=r.FronteggNativeBridge)==null||s.postMessage(JSON.stringify({action:"loginWithCustomSocialLoginProvider",payload:t}))}else if(this.isAndroidNativeBridgeAvailable()){var i;(i=window.FronteggNativeBridge)==null||i.loginWithCustomSocialLoginProvider(t)}else throw new Error("FronteggNativeBridge is not available")},this.suggestSavePassword=(t,n)=>{if(this.isIOSNativeBridgeAvailable()){var r,s,i;(r=window.webkit)==null||(s=r.messageHandlers)==null||(i=s.FronteggNativeBridge)==null||i.postMessage(JSON.stringify({action:"suggestSavePassword",payload:JSON.stringify({email:t,password:n})}))}else if(this.isAndroidNativeBridgeAvailable()){var o;(o=window.FronteggNativeBridge)==null||o.suggestSavePassword(t,n)}else throw new Error("FronteggNativeBridge is not available")},this.promptSocialLoginConsent=()=>{var t,n;return(t=(n=window.FronteggNativeBridgeFunctions)==null?void 0:n.shouldPromptSocialLoginConsent)!=null?t:!1}}isIOSNativeBridgeAvailable(){var t,n;return((t=window.webkit)==null||(n=t.messageHandlers)==null?void 0:n.FronteggNativeBridge)!=null}isAndroidNativeBridgeAvailable(){return window.FronteggNativeBridge!=null}isExternalMobileBrowser(){return sessionStorage.getItem(vJ)!==null&&this.backToLoginImpl!=null}setBackToLogin(t){this.backToLoginImpl=t}backToLogin(){if(this.backToLoginImpl){this.backToLoginImpl();return}}isSocialLoginAvailable(){return this.isAvailable("loginWithSocialLogin")}isSocialLoginProviderAvailable(){return this.isAvailable("loginWithSocialLoginProvider")}isCustomSocialLoginProviderAvailable(){return this.isAvailable("loginWithCustomSocialLoginProvider")}isLoginWithSSOAvailable(){return this.isAvailable("loginWithSSO")}isSuggestSavePasswordAvailable(){return this.isAvailable("suggestSavePassword")}isAvailable(t){if(this.isIOSNativeBridgeAvailable()||this.isAndroidNativeBridgeAvailable()){var n,r;return(n=(r=window.FronteggNativeBridgeFunctions)==null?void 0:r[t])!=null?n:!1}return!1}}const ed=new yJ;function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(null,arguments)}const SJ=Symbol(),cw=Symbol(),td="a",VL="f",Wx="p",BL="c",zL="t",GL="h",Up="w",HL="o",WL="k";let bJ=(e,t)=>
373new Proxy(e,t);const B2=Object.getPrototypeOf,z2=new WeakMap,KL=e=>e&&(z2.has(e)?z2.get(e):B2(e)===Object.prototype||B2(e)===Array.prototype),Kx=e=>typeof e=="object"&&e!==null,_J=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(t=>!t.configurable&&!t.writable),wJ=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create(B2(e),t)},EJ=(e,t)=>{const n={[VL]:t};let r=!1;const s=(a,l)=>{if(!r){let c=n[td].get(e);if(c||(c={},n[td].set(e,c)),a===Up)c[Up]=!0;else{let u=c[a];u||(u=new Set,c[a]=u),u.add(l)}}},i=()=>{r=!0,n[td].delete(e)},o={get(a,l){return l===cw?e:(s(WL,l),YL(Reflect.get(a,l),n[td],n[BL],n[zL]))},has(a,l){return l===SJ?(i(),!0):(s(GL,l),Reflect.has(a,l))},getOwnPropertyDescriptor(a,l){return s(HL,l),Reflect.getOwnPropertyDescriptor(a,l)},ownKeys(a){return s(Up),Reflect.ownKeys(a)}};return t&&(o.set=o.deleteProperty=()=>!1),[o,n]},qL=e=>e[cw]||e,YL=(e,t,n,r)=>{if(!KL(e))return e;let s=r&&r.get(e);if(!s){const l=qL(e);_J(l)?s=[l,wJ(l)]:s=[l],r==null||r.set(e,s)}const[i,o]=s;let a=n&&n.get(i);return(!a||a[1][VL]!==!!o)&&(a=EJ(i,!!o),a[1][Wx]=bJ(o||i,a[0]),n&&n.set(i,a)),a[1][td]=t,a[1][BL]=n,a[1][zL]=r,a[1][Wx]},AJ=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((s,i)=>s!==r[i])},QL=(e,t,n,r,s=Object.is)=>{if(s(e,t))return!1;if(!Kx(e)||!Kx(t))return!0;const i=n.get(qL(e));if(!i)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let o=null;for(const a of i[GL]||[])if(o=Reflect.has(e,a)!==Reflect.has(t,a),o)return o;if(i[Up]===!0){if(o=AJ(e,t),o)return o}else for(const a of i[HL]||[]){const l=!!Reflect.getOwnPropertyDescriptor(e,a),c=!!Reflect.getOwnPropertyDescriptor(t,a);if(o=l!==c,o)return o}for(const a of i[WL]||[])if(o=QL(e[a],t[a],n,r,s),o)return o;if(o===null)throw new Error("invalid used");return o},CJ=e=>KL(e)&&e[cw]||null,qx=(e,t=!0)=>{z2.set(e,t)},_y=e=>typeof e=="object"&&e!==null,ro=new WeakMap,nd=new WeakSet;function xJ(e=Object.is,t=(c,u)=>new Proxy(c,u),n=c=>_y(c)&&!nd.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},s=new WeakMap,i=(c,u,d=r)=>{const f=s.get(c);if((f==null?void 0:f[0])===u)return f[1];const g=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return qx(g,!0),s.set(c,[u,g]),Reflect.ownKeys(c).forEach(h=>{if(Object.getOwnPropertyDescriptor(g,h))return;const p=Reflect.get(c,h),{enumerable:v}=Reflect.getOwnPropertyDescriptor(c,h),m={value:p,enumerable:v,configurable:!0};if(nd.has(p))qx(p,!1);else if(p instanceof Promise)delete m.value,m.get=()=>d(p);else if(ro.has(p)){const[S,b]=ro.get(p);m.value=i(S,b(),d)}Object.defineProperty(g,h,m)}),Object.preventExtensions(g)},o=new WeakMap,a=[1,1],l=c=>{if(!_y(c))throw new Error("object required");const u=o.get(c);if(u)return u;let d=a[0];const f=new Set,g=(R,T=++a[0])=>{d!==T&&(d=T,f.forEach(P=>P(R,T)))};let h=a[1];const p=(R=++a[1])=>(h!==R&&!f.size&&(h=R,m.forEach(([T])=>{const P=T[1](R);P>d&&(d=P)})),d),v=R=>(T,P)=>{const I=[...T];I[1]=[R,...I[1]],g(I,P)},m=new Map,S=(R,T)=>{if(f.size){const P=T[3](v(R));m.set(R,[T,P])}else m.set(R,[T])},b=R=>{const T=m.get(R);if(T){var P;m.delete(R),(P=T[1])==null||P.call(T)}},w=R=>(f.add(R),f.size===1&&m.forEach(([P,I],U)=>{const L=P[3](v(U));m.set(U,[P,L])}),()=>{f.delete(R),f.size===0&&m.forEach(([P,I],U)=>{I&&(I(),m.set(U,[P]))})}),A=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),E=t(A,{deleteProperty(R,T){const P=Reflect.get(R,T);b(T);const I=Reflect.deleteProperty(R,T);return I&&g(["delete",[T],P]),I},set(R,T,P,I){const U=Reflect.has(R,T),L=Reflect.get(R,T,I);if(U&&(e(L,P)||o.has(P)&&e(L,o.get(P))))return!0;b(T),_y(P)&&(P=CJ(P)||P);let z=P;if(P instanceof Promise)P.then(O=>{P.status="fulfilled",P.value=O,g(["resolve",[T],O])}).catch(O=>{P.status="rejected",P.reason=O,g(["reject",[T],O])});else{!ro.has(P)&&n(P)&&(z=l(P));const O=!nd.has(z)&&ro.get(z);O&&S(T,O)}return Reflect.set(R,T,z,I),g(["set",[T],P,L]),!0}});o.set(c,E);const x=[A,p,i,w];
373return ro.set(E,x),Reflect.ownKeys(c).forEach(R=>{const T=Object.getOwnPropertyDescriptor(c,R);"value"in T&&(E[R]=c[R],delete T.value,delete T.writable),Object.defineProperty(A,R,T)}),E}){return[l,ro,nd,e,t,n,r,s,i,o,a]}const[TJ]=xJ();function PJ(e={}){return TJ(e)}function Ea(e,t,n){const r=ro.get(e);let s;const i=[],o=r[3];let a=!1;const c=o(u=>{if(i.push(u),n){t(i.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,c()}}function oo(e,t){const n=ro.get(e),[r,s,i]=n;return i(r,s(),t)}function RJ(e){return nd.add(e),e}function re(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const kJ=["enabled","name"],wy=Symbol();function OJ(e,t){typeof t=="string"&&(t={name:t});const n=t||{},{enabled:r,name:s=""}=n,i=re(n,kJ);let o;try{o=r&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!o)return;let a=!1;const l=o.connect(F({name:s},i)),c=Ea(e,d=>{const f=d.filter(([g,h])=>h[0]!==wy).map(([g,h])=>`${g}:${h.map(String).join(".")}`).join(", ");if(f)if(a)a=!1;else{const g=Object.assign({},oo(e));delete g[wy],l.send({type:f,updatedAt:new Date().toLocaleString()},g)}}),u=l.subscribe(d=>{var f,g;if(d.type==="ACTION"&&d.payload)try{Object.assign(e,JSON.parse(d.payload))}catch(S){console.error(`please dispatch a serializable value that JSON.parse() and proxy() support 374`,S)}if(d.type==="DISPATCH"&&d.state){var h,p;if(((h=d.payload)==null?void 0:h.type)==="JUMP_TO_ACTION"||((p=d.payload)==null?void 0:p.type)==="JUMP_TO_STATE"){a=!0;const S=JSON.parse(d.state);Object.assign(e,S)}e[wy]=d}else if(d.type==="DISPATCH"&&((f=d.payload)==null?void 0:f.type)==="COMMIT")l.init(oo(e));else if(d.type==="DISPATCH"&&((g=d.payload)==null?void 0:g.type)==="IMPORT_STATE"){var v,m;const S=(v=d.payload.nextLiftedState)==null?void 0:v.actionsById,b=((m=d.payload.nextLiftedState)==null?void 0:m.computedStates)||[];a=!0,b.forEach(({state:w},A)=>{const C=S[A]||"No action found";Object.assign(e,w),A===0?l.init(oo(e)):l.send(C,oo(e))})}});return l.init(oo(e)),()=>{c(),u==null||u()}}class de{constructor(){this.context=null,this.accessToken=null,this.user=null,this.requestSource=null,this.onRedirectTo=t=>window.location.href=t,this.logout=()=>window.location.href="/account/logout",this.entitlementsOptions=null,this.appName=null,this.sessionContext=void 0,this.basename=null,this.cdnUrl=null,this.assetsUrl=null,this.setContext=t=>{this.context=t},this.setAccessToken=t=>{this.accessToken=t},this.setUser=t=>{this.user=t},this.setRequestSource=t=>{this.requestSource=t},this.setOnRedirectTo=t=>{this.onRedirectTo=t},this.setLogout=t=>{this.logout=t},this.setEntitlementsOptions=t=>{this.entitlementsOptions=t},this.setSessionContext=t=>{this.sessionContext=t},this.setAppName=t=>{this.appName=t},this.getContext=()=>{var t;return(t=this.context)!=null?t:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}},this.getAccessToken=()=>this.accessToken,this.getRequestSource=()=>this.requestSource,this.getUser=()=>this.user,this.shouldLoadEntitlements=()=>{var t;return((t=this.entitlementsOptions)==null?void 0:t.enabled)||!1},this.isSessionPerTenantEnabled=()=>{var t;return((t=this.sessionContext)==null?void 0:t.enableSessionPerTenant)||!1},this.shouldSkipUserLoad=()=>{var t;return((t=this.sessionContext)==null?void 0:t.skipUserLoading)||!1},this.getAppName=()=>this.appName,this.setCdnUrl=t=>{this.cdnUrl=t},this.getCdnUrl=()=>this.cdnUrl,this.setAssetsUrl=t=>{this.assetsUrl=t},this.getAssetsUrl=()=>this.assetsUrl}static default(){return de.getInstance(Kt)}static for(t){return de.getInstance(t)}static getInstance(t="default"){return de._apps||(de._apps={}),de._apps[t]||(de._apps[t]=new de),de._apps[t]}static createInstance(t="default"){return de._apps[t]=new de,de._apps[t].appName=t,de._apps[t]}static setContext(t,n="default"){de.for(n).context=t}static setAccessToken(t,n=Kt){de.for(n).accessToken=t}static setUser(t,n="default"){de.for(n).user=t}static setRequestSource(t,n="default"){de.for(n).requestSource=t}static setOnRedirectTo(t,n="default"){de.for(n).onRedirectTo=t}static setLogout(t,n,r="default"){const s=de.for(r);s.logout=i=>{i?t(i):s.onRedirectTo(n,void 0)}}static setEntitlementsOptions(t,n="default"){de.for(n).entitlementsOptions=t}static setSessionContext(t,n="default"){de.for(n).sessionContext=t}static setAppName(t){de.for(t).appName=t}static getContext(t="default"){var n;return(n=de.for(t).context)!=null?n:{baseUrl:window.location.href,tokenResolver:()=>"my-authentication-token",logLevel:"error"}}static getAccessToken(t="default"){return de.for(t).accessToken}static getRequestSource(t="default"){return de.for(t).requestSource}static getBasename(t="default"){return de.for(t).basename}getBasename(){return this.basename}static setBasename(t,n=Kt){de.for(n).basename=t}setBasename(t){this.basename=t}static getUser(t="default"){return de.for(t).user}static onRedirectTo(t,n,r="default"){return de.for(r).onRedirectTo(t,n)}static logout(t,n="default"){return de.for(n).logout(t)}static shouldLoadEntitlements(t="default"){var n;return((n=de.for(t).entitlementsOptions)==null?void 0:n.enabled)||!1}static isSessionPerTenantEnabled(t="default"){var n;return((n=de.for(t).sessionContext)==null?void 0:n.enableSessionPerTenant)||!1}static getAppName(t="default"){return de.for(t).appName}}de._apps=void 0;const Kt="default",XL={getContext:()=>de.getContext(Kt),getAccessToken:()=>de.getAccessToken(Kt),setAccessToken:e=>
374de.setAccessToken(e,Kt),getUser:()=>de.getUser(Kt),setUser:e=>de.setUser(e,Kt),onRedirectTo:(e,t)=>de.onRedirectTo(e,t,Kt),setOnRedirectTo:e=>de.setOnRedirectTo(e,Kt),logout:e=>de.logout(e,Kt),getRequestSource:()=>de.getRequestSource(Kt),setRequestSource:e=>de.setRequestSource(e,Kt),isSessionPerTenantEnabled:()=>de.isSessionPerTenantEnabled(Kt),shouldLoadEntitlements:()=>de.shouldLoadEntitlements(Kt),getAppName:()=>de.getAppName(Kt),setEntitlementsOptions:e=>de.setEntitlementsOptions(e,Kt),setSessionContext:e=>de.setSessionContext(e,Kt),getBasename:()=>de.getBasename(Kt),setBasename:e=>de.setBasename(e,Kt)};class Vr extends Error{constructor(t,n,r,s,i,o,a){super(t),this._statusCode=void 0,this._traceId=void 0,this._errorCode=void 0,this._errorContext=void 0,this._errors=void 0,this._errorCodes=void 0,this._statusCode=n,this._traceId=r,this._errorCode=s,this._errorContext=i,this._errors=o,this._errorCodes=a}get statusCode(){return this._statusCode}get traceId(){return this._traceId}get errorCode(){return this._errorCode}get errorContext(){return this._errorContext}get errors(){return this._errors}get errorCodes(){return this._errorCodes}}const D={vendor:"/vendors",identity:{signup:{v1:{strategies:"/identity/resources/configurations/v1/sign-up/strategies"}},webAuthnDevices:{v1:"/identity/resources/users/webauthn/v1/devices"},auth:{v1:"/identity/resources/auth/v1",v2:"/identity/resources/auth/v2"},users:{v1:"/identity/resources/users/v1",v2:"/identity/resources/users/v2",v3:"/identity/resources/users/v3",roles:{v3:"/identity/resources/users/v3/roles"},groups:{v3:"/identity/resources/users/v3/groups"},tenants:{me:{v1:"/identity/resources/users/v1/me/tenants",v3:"/identity/resources/users/v3/me/tenants"}},apiTokens:{v1:"/identity/resources/users/api-tokens/v1"},accessTokens:{v1:"/identity/resources/users/access-tokens/v1"},sessions:{v1:"/identity/resources/users/sessions/v1",currentUser:{v1:"/identity/resources/users/sessions/v1/me"},configurations:{v1:"/identity/resources/configurations/sessions/v1"}},invitation:{resendAll:{v1:"/identity/resources/users/v1/invitation/reset/all"}},passwords:{resetBreachedPasswords:{v1:"/identity/resources/users/v1/passwords/breached/reset/bulk"}},authorization:{v1:"/identity/resources/users/v1/me/authorization"},temporary:{v1:"/identity/resources/users/temporary/v1",configuration:{v1:"/identity/resources/users/temporary/v1/configuration"}},phoneNumbers:{v1:"/identity/resources/users/phone-numbers/v1",v2:"/identity/resources/users/phone-numbers/v2"}},configurations:{v1:"/identity/resources/configurations/v1"},restrictions:{emailDomain:{v1:"/identity/resources/configurations/restrictions/v1/email-domain"},ip:{v1:"/identity/resources/configurations/v1/restrictions/ip"}},sso:{v1:"/identity/resources/sso/v1",v2:"/identity/resources/sso/v2",custom:{v1:"/identity/resources/sso/custom/v1"}},permissions:{v1:"/identity/resources/permissions/v1"},tenants:{apiTokens:{v1:"/identity/resources/tenants/api-tokens/v1",v2:"/identity/resources/tenants/api-tokens/v2"},accessTokens:{v1:"/identity/resources/tenants/access-tokens/v1"},invites:{user:{v1:"/identity/resources/tenants/invites/v1/user",v2:"/identity/resources/tenants/invites/v2/user"},verify:{v1:"/identity/resources/tenants/invites/v1/verify"},configuration:{v1:"/identity/resources/tenants/invites/v1/configuration"}},users:{v1:"/identity/resources/tenants/users/v1"}},roles:{v1:"/identity/resources/roles/v1",v2:"/identity/resources/roles/v2"},subTenants:{v1:"/identity/resources/sub-tenants/users/v1",v2:"/identity/resources/sub-tenants/users/v2"},impersonate:{v1:"/identity/resources/impersonation/v1"},applications:{v1:"/identity/resources/applications/v1"},groups:{v1:"/identity/resources/groups/v1",configurations:{v1:"/identity/resources/groups/v1/config"},getByIds:{v1:"/identity/resources/groups/v1/bulkGet"}},phoneNumbers:{v1:"/identity/resources/users/phone-numbers/v1"},emails:{v1:"/identity/resources/users/emails/v1"},usernames:{v1:"/identity/resources/usernames/v1"},approvalFlows:{v1:"/identity/resources/approval-flows/v1"}},team:{sso:{v1:"/team/resources/sso/v1",v2:"/team/resources/sso/v2"},members:{v1:"/team/resources/members/v1"}
374,roles:{v1:"/team/resources/roles/v1"},stats:{v1:"/team/resources/stats/v1"},profile:{v1:"/team/resources/profile"}},tenants:{accountSettings:{v1:"/tenants/resources/account-settings/v1"},hierarchy:{v1:"/tenants/resources/hierarchy/v1",tree:{v1:"/tenants/resources/hierarchy/v1/tree"},parents:{v1:"/tenants/resources/hierarchy/v1/parents"},v2:"/tenants/resources/hierarchy/v2",metadata:{v2:"/tenants/resources/hierarchy/v2/metadata"}},subTenants:{v1:"/tenants/resources/sub-tenants/v1"}},integrations:{configurations:{v1:"/integrations/resources/configurations/v1",v2:"/integrations/resources/configurations/v2"}},subscriptions:{billing:{subscriptions:{v1:"/subscriptions/resources/billing/subscriptions/v1"},plans:{v1:"/subscriptions/resources/billing/plans/v1"},invoices:{v1:"/subscriptions/resources/billing/invoices/v1"},paymentMethods:{v1:"/subscriptions/resources/billing/payment-methods/v1"},summaries:{v1:"/subscriptions/resources/billing/summaries/v1"},tenantConfiguration:{v1:"/subscriptions/resources/billing/tenant-configurations/v1"},configurations:{vendorPublicConfigurations:{v1:"/subscriptions/resources/billing/configurations/vendor-public-configurations/v1"}},paymentProviders:{stripe:{customers:{v1:"/subscriptions/resources/billing/payment-providers/stripe/customers/v1"},publicConfigurations:{v1:"/subscriptions/resources/billing/payment-providers/stripe/public-configurations/v1"},subscriptions:{v1:"/subscriptions/resources/billing/payment-providers/stripe/subscriptions/v1"},setupIntents:{v1:"/subscriptions/resources/billing/payment-providers/stripe/setup-intents/v1"}}}},paymentProviders:{v1:"/subscriptions/resources/payment-providers/v1"},managedSubscriptions:{v1:"/subscriptions/resources/subscriptions/v1"}},reports:{service:{v1:"/reports/resources/reports/v1",v2:"/reports/resources/reports/v2"},trigger:{v1:"/reports/engine/resources/triggers/v1"}},notifications:{v1:"/notification"},audits:{v1:"/audits"},events:{configurations:{v1:"/event/resources/configurations/v1"}},webhooks:{v1:"/webhook"},oauth:{v1:"/oauth"},featureFlags:{v1:"/flags"},directory:{v1:"/directory/resources/v1/configurations/scim2",temp:"/directory/resources/scim/temp"},entitlements:{v1:"/entitlements/api/v1/user-entitlements",v2:"/entitlements/api/v2/user-entitlements"},securityCenter:{recommendations:{v1:"/security-center/resources/recommendations/v1"},insights:{v1:"/security-center/resources/insights/v1"}},applications:{v1:"/applications/resources/applications/v1",tenant:{v1:"/applications/resources/applications/tenant-assignments/v1",v2:"/applications/resources/applications/tenant-assignments/v2"}},velo:{v1:"http://localhost:3037/resources/velo/v1"}},uw="We're facing some difficulties, Please try again",dw="ER-ADMIN-PORTAL-GENERIC-ERROR",IJ="frontegg-trace-id",Zl={frameWork:"x-frontegg-framework",fronteggSdkVersion:"x-frontegg-sdk",contentType:"Content-Type",source:"frontegg-source",scopedTenant:"frontegg-scoped-tenant"};let Qg;(function(e){e.AdminPortal="admin-portal",e.LoginBox="login-box"})(Qg||(Qg={}));let G2;(function(e){e.Nextjs="nextjs",e.React="react",e.Angular="angular",e.Vuejs="vuejs",e.Flutter="flutter",e.Ios="ios",e.Android="android",e.Vanillajs="vanillajs"})(G2||(G2={}));let Xg;(function(e){e.ASC="ASC",e.DESC="DESC"})(Xg||(Xg={}));class Ln{constructor(t){this.appName=void 0,this.getFronteggContext=()=>de.for(this.appName),this.prepareUrl=async(n,r)=>{const s=this.getFronteggContext().getContext(),i=this.getContextBaseUrl(n),o=await this.buildQueryParams(s,r);let a=n.startsWith("http")?n:`${i}${n}`;const l=Object.keys(o).length>0;if(o&&l){const c=new URLSearchParams(o);a+=`?${c}`}return a},this.buildQueryParams=async(n,r)=>{r||(r={});const s=await this.getAdditionalQueryParams(n);for(const o of s)r[o.key]=o.value;const i=Object.keys(r);for(const o of i){const a=r[o];r[o]=typeof a=="object"?JSON.stringify(a):a}return r},this.getAdditionalQueryParams=async n=>{let r=[];return n.additionalQueryParamsResolver&&(r=await n.additionalQueryParamsResolver()),r},this.getAdditionalHeaders=async n=>{let r=[];if(n.additionalHeadersResolver&&(r=await n.additionalHeadersResolver()),n.tenantResolver){const s=await n.tenantResolver();s!=null&&s.tenant&&r.push({key:"frontegg-login-alias",value:s.tenant})}return n.appId&&r.push({key:"frontegg-requested-application-id",value:n.appId}),r},this.buildRequestHeaders=async n=>{var r;const s=this.getFronteggContext(),i=s.getContext(),o=Ln.getMetadataHeaders(i),a=await((r=i==null?void 0:i.tokenResolver)!=null?r:s.getAccessToken)(),l=s.getRequestSource(),c=Ln.get
374ScopedTenant();n&&(o[Zl.contentType]=n),l&&(o[Zl.source]=l),a&&(o.Authorization=`Bearer ${a}`),c&&(o[Zl.scopedTenant]=c);for(const u of await this.getAdditionalHeaders(i))o[`${u.key}`]=`${u.value}`;return o},this.getResponseTraceId=n=>{var r,s;return n==null||(r=n.headers)==null||(s=r.get)==null?void 0:s.call(r,IJ)},this.sendRequest=async n=>{var r,s,i;const o=this.getFronteggContext().getContext(),a=await this.buildRequestHeaders(n.contentType),l=await this.prepareUrl(n.url,n.params),c=o.beforeRequestInterceptor,u={body:n.body?n.contentType==="application/json"?JSON.stringify(n.body):n.body:null,method:(r=n.method)!=null?r:"GET",headers:F({},a,n.headers),credentials:(s=(i=n.credentials)!=null?i:o.requestCredentials)!=null?s:"same-origin"},d=c?c(u,l):u,f=await fetch(l,d);if(f.status===302)return window.location.href=await f.text(),new Promise(()=>{});if(!f.ok){var g,h,p,v,m,S,b;if(f.status===413)throw new Vr("Error request is too large",f.status,this.getResponseTraceId(f),void 0);let w,A,C,E,x,R=!0;try{w=await f.text(),w=JSON.parse(w)}catch{R=!1}throw(g=w)!=null&&g.errorCode&&(A=w.errorCode),(h=w)!=null&&h.context&&typeof w.context=="object"&&(C=w.context),Array.isArray((p=w)==null?void 0:p.errors)&&(E=w.errors),Array.isArray((v=w)==null?void 0:v.errorCodes)&&(x=w.errorCodes),w.errors?w=w.errors.join(", "):typeof w!="string"&&(w=`Error ${f.status} - ${f.statusText}`),f.status>=400&&f.status<500&&["warn"].includes((m=o.logLevel)!=null?m:"")?console.warn(w):f.status===500&&["warn","error"].includes((S=o.logLevel)!=null?S:"")&&console.error(w),new Vr(R?w:uw,f.status,this.getResponseTraceId(f),(b=A)!=null?b:dw,C,E,x)}if(n.responseType==="stream")return f.body;if(!n.responseType||n.responseType==="json")try{return await f.json()}catch{return{}}else if(n.responseType==="blob"){const{outputFileName:w}=n.params;return await f.blob().then(A=>URL.createObjectURL(A)).then(A=>{const C=document.createElement("a");C.href=A,C.setAttribute("download",w||"output"),C.click()})}else return await f.text()},this.get=async(n,r,s)=>this.sendRequest(F({url:n,method:"GET",contentType:"application/json",params:r},s)),this.post=async(n,r,s)=>this.sendRequest(F({url:n,method:"POST",contentType:"application/json",body:r},s)),this.patch=async(n,r,s)=>this.sendRequest(F({url:n,method:"PATCH",contentType:"application/json",body:r},s)),this.put=async(n,r,s)=>this.sendRequest(F({url:n,method:"PUT",contentType:"application/json",body:r},s)),this.delete=async(n,r,s)=>this.sendRequest(F({url:n,method:"DELETE",contentType:"application/json",body:r},s)),this.postDownload=async(n,r,s,i)=>this.sendRequest(F({url:n,method:"POST",contentType:"application/json",responseType:"blob",body:r,params:s},i)),this.extractHeadersFromOptions=(n={})=>F({},n.jwt?{Authorization:n.jwt}:{}),this.getBaseUrl=(n,r,s=!0)=>Ln.getBaseUrl(n,r,s),this.getContextBaseUrl=(n,r=!0)=>{const s=this.getFronteggContext().getContext();return this.getBaseUrl(s,n,r)},this.getMetadataHeaders=n=>Ln.getMetadataHeaders(n),this.getContextMetadataHeaders=()=>{const n=this.getFronteggContext().getContext();return Ln.getMetadataHeaders(n)},this.appName=t}}Ln.getBaseUrl=(e,t,n=!0)=>{let r;typeof e.baseUrl=="function"?r=e.baseUrl(t):r=e.baseUrl;const s=e.urlPrefix||"frontegg",i=s==="frontegg"&&!n;return r.endsWith("/")||(r+="/"),!r.endsWith(s)&&!i&&(r+=s),r};Ln.getMetadataHeaders=e=>{var t,n;const r={};return e!=null&&(t=e.metadataHeaders)!=null&&t.fronteggSdkVersion&&(r[Zl.fronteggSdkVersion]=e.metadataHeaders.fronteggSdkVersion),e!=null&&(n=e.metadataHeaders)!=null&&n.framework&&(r[Zl.frameWork]=e.metadataHeaders.framework),r};Ln.getScopedTenant=()=>{const t=new URLSearchParams(window.location.search).get("tenantId");return t||null};const JL=new Ln("default");class tt{constructor(t){this.appName=void 0,this.fetchClient=void 0,this.get=async(n,r,s)=>this.fetchClient.get(n,r,s),this.post=async(n,r,s)=>this.fetchClient.post(n,r,s),this.patch=async(n,r,s)=>this.fetchClient.patch(n,r,s),this.put=async(n,r,s)=>this.fetchClient.put(n,r,s),this.delete=async(n,r,s)=>this.fetchClient.delete(n,r,s),this.postDownload=async(n,r,s,i)=>this.fetchClient.postDownload(n,r,s,i),this.extractHeadersFromOptions=(n={})=>this.fetchClient.extractHeadersFromOptions(n),this.appName=t,this.fetchClient=new Ln(t)}}class fw extends tt{constructor(t){super(t),this.getGlobalSecurityPolicy=async()=>this.get(D.identity.configurations.v1),this.getMfaPolicy=async()=>this.get(`${D.identity.configurations.v1}/mfa-policy`),this.getVendorMfaPolicy=async()=>this.get(`${D.identity.configurations.v1}/mfa-policy/vendor`),this.saveMfaPolicy=async n=>n.id?this.patch(`${D.identity.configurations.v1}/mfa-policy`,n):this.post(`${D.identity.configurations.v1}/mfa-policy`,n),this.getLockoutPolicy=async()=>this.get(`${D.identity.configurations.v1}/lockout-policy`),this.getVendorLockoutPolicy=async()=>this.get(`${D.identity.configurations.v1}/lockout-policy/vendor`),this.saveLockoutPolicy=async n=>n.id?this.patch(`${D.identity.configurations.v1}/lockout-policy`,n):this.post(`${D.identity.configurations.v1}/lockout-policy`,n),this.getCaptchaPolicy=async()=>{try{return await this.get(`${D.identity.configurations.v1}/captcha-policy/public`)}catch{return null}},this.getPasswordHistoryPolicy=async()=>this.get(`${D.identity.configurations.v1}/password-history-policy`),this.getVendorPasswordHistoryPolicy=async()=>this.get(`${D.identity.configurations.v1}/password-history-policy/vendor`),this.savePasswordHistoryPolicy=async n=>n.id?this.patch(`${D.identity.configurations.v1}/password-history-policy`,n):this.post(`${D.identity.configurations.v1}/password-history-policy`,n),this.getPasswordRotationPolicy=async()=>{try{return await this.get(`${D.identity.configurations.v1}/password-rotation`)}catch{return{}}},this.getVendorPasswordRotationPolicy=async()=>{try{return await this.get(`${D.identity.configurations.v1}/password-rotation/vendor`)}catch{return{}}},this.savePasswordRotationPolicy=async n=>this.post(`${D.identity.configurations.v1}/password-rotation`,n),this.getPasswordConfigPolicy=async()=>this.get(`${D.identity.configurations.v1}/password`),this.getDomainRestrictions=async()=>this.get(`${D.identity.restrictions.emailDomain.v1}`),this.getDomainRestrictionsConfig=async()=>this.get(`${D.identity.restrictions.emailDomain.v1}/config`),this.createDomainRestriction=async n=>this.post(`${D.identity.restrictions.emailDomain.v1}`,n),this.updateDomainRestrictionConfig=async n=>this.post(`${D.identity.restrictions.emailDomain.v1}/config`,n),this.deleteDomainRestriction=async n=>this.delete(`${D.identity.restrictions.emailDomain.v1}/${n}`),this.getIPRestrictions=async n=>this.get(`${D.identity.restrictions.ip.v1}`,n),this.getIPRestrictionsConfig=async()=>this.get(`${D.identity.restrictions.ip.v1}/config`),this.createIPRestriction=async n=>this.post(`${D.identity.restrictions.ip.v1}`,n),this.bulkCreateIPRestriction=async n=>this.post(`${D.identity.restrictions.ip.v1}/bulk`,n),this.updateIPRestrictionConfig=async n=>this.post(`${D.identity.restrictions.ip.v1}/config`,n),this.deleteIPRestriction=async n=>this.delete(`${D.identity.restrictions.ip.v1}/${n}`),this.testCurrentIp=async()=>this.post(`${D.identity.restrictions.ip.v1}/verify`),this.testCurrentIpInAllowList=async()=>this.post(`${D.identity.restrictions.ip.v1}/verify/allow`)}}const NJ=new fw("default");let Jg;(function(e){e.Microsoft="microsoft",e.Facebook="facebook",e.Google="google",e.Github="github",e.Slack="slack",e.Apple="apple",e.Linkedin="linkedin"})(Jg||(Jg={}));let at;(function(e){e.EmailAndPassword="EmailAndPassword",e.MagicLink="MagicLink",e.Code="Code",e.N
374oLocalAuthentication="NoLocalAuthentication",e.SmsCode="SmsCode",e.WebAuthN="WebAuthN",e.UsernameAndPassword="UsernameAndPassword",e.UsernameAndMagicLink="UsernameAndMagicLink",e.UsernameAndCode="UsernameAndCode",e.UsernameAndSms="UsernameAndSms"})(at||(at={}));let On;(function(e){e.ClientCredentials="ClientCredentials",e.AccessToken="AccessToken"})(On||(On={}));let ec;(function(e){e.Email="email",e.PhoneNumber="phoneNumber",e.Username="username"})(ec||(ec={}));let tf;(function(e){e.email="email",e.phoneNumber="phoneNumber",e.username="username"})(tf||(tf={}));let nf;(function(e){e.Email="email",e.Sms="sms"})(nf||(nf={}));const Iv="FRONTEGG_SEPARATE_TABS_BY_TENANT",LJ="admin_portal_use_current_user_tenants_v1_endpoint",Ey={flags:{}};class Kn{constructor(){var t;this._flags={},this._flags=(t=Ey.flags)!=null?t:{}}static getInstance(t="default"){return this._instances[t]}static set(t,n="default"){const r=new Kn;return r.set(t),Kn._instances[n]=r,r}static getFeatureFlags(t,n){const r=this.getInstance(n);return t.map(s=>(r==null?void 0:r._flags[s])==="on")}get flags(){var t;return(t=this.flags)!=null?t:{}}set(t){var n;this._flags=F({},(n=Ey==null?void 0:Ey.flags)!=null?n:{},t??{})}}Kn._instances={};class hw extends tt{constructor(t){super(t),this.loadFeatureFlags=async()=>this.get(D.featureFlags.v1)}}const DJ=new hw("default");class pw extends tt{constructor(t){super(t),this.GetUserJwt=async n=>this.post(`${D.identity.users.v3}/me/token`,n),this.getUsersV2=async(n,r)=>this.get(D.identity.users.v2,n,{headers:this.extractHeadersFromOptions(r)}),this.getUsersV3=async(n,r)=>this.get(D.identity.users.v3,n,{headers:this.extractHeadersFromOptions(r)}),this.getUsersRoles=async(n,r)=>this.get(D.identity.users.roles.v3,F({},n,{ids:n.ids.join(",")}),{headers:this.extractHeadersFromOptions(r)}),this.getUsersUsernames=async n=>this.get(D.identity.usernames.v1,F({},n,{userIds:n.userIds.join(",")})),this.getUsersGroups=async(n,r)=>this.get(D.identity.users.groups.v3,F({},n,{ids:n.ids.join(",")}),{headers:this.extractHeadersFromOptions(r)}),this.getCurrentUserTenantsV3=async n=>this.get(D.identity.users.tenants.me.v3,void 0,{headers:this.extractHeadersFromOptions(n)}),this.getCurrentUserTenantsV1=async n=>this.get(D.identity.users.tenants.me.v1,void 0,{headers:this.extractHeadersFromOptions(n)}),this.sendResetBreachedPasswordEmails=async()=>this.post(D.identity.users.passwords.resetBreachedPasswords.v1),this.updateUserProfileV2=async n=>this.put(`${D.identity.users.v2}/me`,n),this.unlockMe=async n=>this.post(`${D.identity.users.v3}/me/unlock`,n)}}const MJ=new pw("default");async function UJ({shouldLoad:e,action:t}){if(e)return await t()}function gw(e){e&&sessionStorage.setItem(Iv,e)}function H2(){sessionStorage.removeItem(Iv)}function pa(e){return de.for(e).isSessionPerTenantEnabled()?sessionStorage.getItem(Iv):null}function Zg(e){if(de.for(e).shouldSkipUserLoad())return async()=>({tenants:[],activeTenant:{}});const n=new pw(e),[r]=Kn.getFeatureFlags([LJ],e);return de.for(e).isSessionPerTenantEnabled()||r?n.getCurrentUserTenantsV1:n.getCurrentUserTenantsV3}const FJ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";class $J extends Error{constructor(t){super(t)}}function jJ(e){const t=String(e).replace(/=+$/,"");if(t.length%4===1)throw new $J("'atob' failed: The string to be decoded is not correctly encoded.");let n="";for(let r=0,s,i,o=0;i=t.charAt(o++);~i&&(s=r%4?s*64+i:i,r++%4)?n+=String.fromCharCode(255&s>>(-2*r&6)):0)i=FJ.indexOf(i);return n}const ZL=typeof window<"u"&&window.atob&&window.atob.bind(window)||jJ;function VJ(e){return decodeURIComponent(ZL(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}const BJ=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}try{return VJ(t)}catch{return ZL(t)}};class zJ extends Error{constructor(t){super(t)}}const Uu=(e,t={})=>{const n=t.header?0:1;try{return JSON.parse(BJ(e.split(".")[n]))}catch(r){throw new zJ("Invalid token specified: "+r.message)}};let xt;(function(e){e.ALLOW="ALLOW",e.BLOCK="BLOCK"})(xt||(xt={}));let em;(function(e){e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SmsCode="SmsCode",e.SmsCodeV2="SmsCodeV2",e.Passkeys="Passkeys",e.UsernameAndPassword="UsernameAndPassword",e.UsernameAndMagicLink="UsernameAndMagicLink",e.UsernameAndCode="UsernameAndCode",e.UsernameAndSms="UsernameAndSms"})(em||(em={}));let rf;(function(e){e.Platform="Platform",e.CrossPlatform="CrossPlatform"})(rf||(rf={}));let tc;(function(e){e.AuthenticatorApp="AuthenticatorApp",e.WebAuthnPlatform="WebAuthnPlatform",e.WebAuthnCrossPlatform="WebAuthnCrossPlatform",e.SMS="SMS",e.EmailCode="EmailCode"})(tc||(tc={}));const e5="admin_portal_should_load_authorization";class mw extends tt{constructor(t){super(t),this.switchTenant=async n=>(de.for(this.appName).isSessionPerTenantEnabled()&&gw(n.tenantId),this.put(`${D.identity.users.v1}/tenant`,n)),this.getTenants=async()=>this.get(`${D.identity.users.v2}
374/me/tenants`),this.getSubTenants=async n=>this.get(D.tenants.hierarchy.v1,void 0,{headers:this.extractHeadersFromOptions(n)}),this.getSubTenantsAsTree=async n=>this.get(D.tenants.hierarchy.tree.v1,void 0,{headers:this.extractHeadersFromOptions(n)}),this.getParentTenants=async n=>this.get(D.tenants.hierarchy.parents.v1,void 0,{headers:this.extractHeadersFromOptions(n)}),this.getParentTenantsById=async(n,r)=>this.get(`${D.tenants.hierarchy.parents.v1}/${n}`,void 0,{headers:this.extractHeadersFromOptions(r)}),this.getTenantsUsersCount=async(n,r)=>this.post(`${D.identity.tenants.users.v1}/count`,n,{headers:this.extractHeadersFromOptions(r)}),this.searchSubTenants=async(n,r)=>this.get(D.tenants.hierarchy.v2,n,{headers:this.extractHeadersFromOptions(r)}),this.getHierarchyMetadata=async(n,r)=>this.get(D.tenants.hierarchy.metadata.v2,F({},n,{_tenantIds:n._tenantIds.join(",")}),{headers:this.extractHeadersFromOptions(r)})}}const GJ=new mw("default");class vw extends tt{constructor(t){super(t),this.loadEntitlementsV2=async()=>this.get(D.entitlements.v2)}}const HJ=new vw("default"),WJ=["type"],KJ=["type"],qJ=["type"];class t5 extends tt{constructor(t){super(t),this.tenantsApi=new mw(this.appName),this.entitlementsApi=new vw(this.appName),this.securityPolicy=new fw(this.appName),this.generateLoginResponse=async n=>{if(!n.accessToken)return n;const r=de.for(this.appName);r.setAccessToken(n.accessToken);const s=await this.getMeAndEntitlements(),i=n.accessToken?Uu(n.accessToken):{},o=F({},n,i,s);return r.setUser(o),o},this.generateLoginResponseV2=async n=>{if(!n.accessToken)return{user:n};const r=de.for(this.appName);r.setAccessToken(n.accessToken);const[s,i]=await Promise.all([this.getMeAndEntitlements(),this.tenantsApi.getTenants()]),o=n.accessToken?Uu(n.accessToken):{},a=F({},n,o,s);return r.setUser(a),{user:a,tenants:i}},this.generateLoginResponseV3=async n=>{const{accessToken:r}=n;if(!r)return{user:n};const s=de.for(this.appName);s.setAccessToken(r);const[i,o]=await Promise.all([this.getMeAndEntitlements(),Zg(this.appName)()]),a=r?Uu(r):{},l=F({},n,a,i),c=this.resolveSessionTenant(s,l,a,o);return s.setUser(l),{user:l,tenants:o.tenants,activeTenant:c}},this.generateLoginResponseFromOAuthResponse=async n=>{const r=de.for(this.appName);r.setAccessToken(n.id_token);const s=await this.getMeAndEntitlements(),i=n.id_token?Uu(n.id_token):{},o=F({mfaRequired:!1,accessToken:n.id_token,refreshToken:n.refresh_token},i,s,{expiresIn:n.expires_in||300});return r.setUser(o),o},this.generateLoginResponseFromOAuthResponseV2=async n=>{const r=de.for(this.appName);r.setAccessToken(n.id_token);const[s,i]=await Promise.all([this.getMeAndEntitlements(),Zg(this.appName)()]),o=n.id_token?Uu(n.id_token):{},a=F({mfaRequired:!1,accessToken:n.id_token,refreshToken:n.refresh_token},o,s,{expiresIn:n.expires_in||300}),l=this.resolveSessionTenant(r,a,o,i);return r.setUser(a),{user:a,tenants:i.tenants,activeTenant:l}},this.preLogin=async n=>{try{const{address:r}=await this.post(`${D.identity.auth.v1}/user/saml/prelogin`,n);return r}catch{return null}},this.preLoginWithIdpType=async n=>this.post(`${D.identity.auth.v1}/user/saml/prelogin`,n),this.postLogin=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/saml/postlogin`,n);return this.generateLoginResponse(r)},this.oidcPostLogin=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/oidc/postlogin`,n);return this.generateLoginResponse(r)},this.login=async n=>{const r=await this.post(`${D.identity.auth.v1}/user`,n);return this.generateLoginResponse(r)},this.loginv2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user`,n);return this.generateLoginResponseV3(r)},this.loginWithMfa=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/verify`,n);return this.generateLoginResponse(r)},this.loginWithMfaV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/verify`,n);return this.generateLoginResponseV3(r)},this.activateAccount=async n=>this.post(`${D.identity.users.v1}/activate`,n),this.activateAccountV2=async n=>{const r=await this.post(`${D.identity.users.v1}/activate`,n);return this.generateLoginResponseV3(r)},this.activateAccountWithOTC=async n=>{const r=await this.post(`${D.identity.users.v1}/activate/code`,n);return this.generateLoginResponseV3(r)},this.submitApprovalAction=async n=>this.post(`${D.identity.approvalFlows.v1}/approver-action`,n),this.getApprovalExecutionData=async n=>this.get(`${D.identity.approvalFlows.v1}/execution-data`,n),this.getActivateAccountStrategy=async n=>this.get(`${D.identity.users.v1}/activate/strategy`,n),this.resendActivationEmail=async n=>this.post(`${D.identity.users.v1}/activate/reset`,n),this.resendInvitationEmail=async n=>this.post(`${D.identity.users.v1}/invitation/reset`,n),this.acceptInvitation=async n=>this.post(`${D.identity.users.v1}/invitation/accept`,n),this.acceptInvitationWithOTC=async n=>this.post(`${D.identity.users.v1}/invitation/accept/code`,n),this.refreshToken=async()=>{const n=pa(this.appName),r=await this.post(`${D.identity.auth.v1}/user/token/refresh`,{tenantId:n});return this.generateLoginResponse(r)},this.refreshTokenV2=async()=>{const n=pa(this.appName),r=await this.post(`${D.identity.auth.v1}/user/token/refresh`,{tenantId:n});return this.generateLoginResponseV2(r)},this.refreshTokenV3=async()=>{const n=pa(this.appName),r=await this.post(`${D.identity.auth.v1}/user/token/refresh`,{tenantId:n});return this.generateLoginResponseV3(r)},this.logout=async()=>this.post(`${D.identity.auth.v1}/logout`),this.OAuthLogout=async n=>this.get(`${D.oauth.v1}/logout`,n),this.forgotPassword=async n=>this.post(`${D.identity.users.v1}/passwords/reset`,n),this.resetPassword=async n=>this.post(`${D.identity.users.v1}/passwords/reset/verify`,n),this.resetPasswordViaEmail=async n=>this.post(`${D.identity.users.v2}/passwords/reset/email`,n),this.resetPasswordViaSms=async n=>this.post(`${D.identity.users.v2}/passwords/reset/sms`,n),this.verifyPasswordViaSms=async n=>this.post(`${D.identity.users.v2}/passwords/reset/sms/verify`,n),this.getPasswordRecoveryStrategies=async()=>this.get(`${D.identity.configurations.v1}/password-recovery/strategies`),this.loadPasswordConfig=async n=>this.get(`${D.identity.users.v1}/passwords/config`,n),this.validateResetPasswordToken=async n=>this.post(`${D.identity.users.v1}
374/passwords/reset/validate`,n),this.getSignUpStrategies=async()=>this.get(`${D.identity.signup.v1.strategies}`),this.recoverMfaToken=async n=>this.post(`${D.identity.auth.v1}/user/mfa/recover`,n),this.enrollMfa=async()=>this.post(`${D.identity.users.v1}/mfa/enroll`),this.preEnrollMFAAuthenticatorApp=async()=>this.post(`${D.identity.users.v1}/mfa/authenticator/enroll`),this.enrollMFAAuthenticatorApp=async n=>this.post(`${D.identity.users.v1}/mfa/authenticator/enroll/verify`,n),this.preEnrollMFASMS=async n=>this.post(`${D.identity.users.v1}/mfa/sms/enroll`,n),this.enrollMFASMS=async n=>this.post(`${D.identity.users.v1}/mfa/sms/enroll/verify`,n),this.preEnrollMFAWebAuthn=async()=>this.post(`${D.identity.users.v1}/mfa/webauthn/enroll`),this.enrollMFAWebAuthn=async n=>this.post(`${D.identity.users.v1}/mfa/webauthn/enroll/verify`,n),this.verifyMfa=async n=>this.post(`${D.identity.users.v1}/mfa/enroll/verify`,n),this.disableMfa=async n=>this.post(`${D.identity.users.v1}/mfa/disable`,n),this.disableMFAAuthenticatorApp=async(n,r)=>this.post(`${D.identity.users.v1}/mfa/authenticator/${n}/disable/verify`,r),this.preDisableMFASMS=async n=>this.post(`${D.identity.users.v1}/mfa/sms/${n}/disable`),this.disableMFASMS=async(n,r)=>this.post(`${D.identity.users.v1}/mfa/sms/${n}/disable/verify`,r),this.preDisableMFAWebAuthn=async n=>this.post(`${D.identity.users.v1}/mfa/webauthn/${n}/disable`),this.disableMFAWebAuthn=async(n,r)=>this.post(`${D.identity.users.v1}/mfa/webauthn/${n}/disable/verify`,r),this.getMFADevices=async()=>this.get(`${D.identity.users.v1}/mfa/devices`),this.preEnrollMFAAuthenticatorAppForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/authenticator/enroll`,n),this.enrollMFAAuthenticatorAppForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/authenticator/enroll/verify`,n),this.enrollMFAAuthenticatorAppForLoginV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/authenticator/enroll/verify`,n);return this.generateLoginResponseV3(r)},this.verifyMFAAuthenticatorAppForLogin=async(n,r)=>this.post(`${D.identity.auth.v1}/user/mfa/authenticator/${n}/verify`,r),this.preVerifyMFAEmailCode=async n=>this.post(`${D.identity.auth.v1}/user/mfa/emailcode`,n),this.verifyMFAEmailCode=async n=>this.post(`${D.identity.auth.v1}/user/mfa/emailcode/verify`,n),this.verifyMFAEmailCodeV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/emailcode/verify`,n);return this.generateLoginResponseV3(r)},this.preEnrollMFASMSForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/sms/enroll`,n),this.enrollMFASMSForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/sms/enroll/verify`,n),this.enrollMFASMSForLoginV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/sms/enroll/verify`,n);return this.generateLoginResponseV3(r)},this.preVerifyMFASMSForLogin=async(n,r)=>this.post(`${D.identity.auth.v1}/user/mfa/sms/${n}`,r),this.verifyMFASMSForLogin=async(n,r)=>this.post(`${D.identity.auth.v1}/user/mfa/sms/${n}/verify`,r),this.verifyMFASMSForLoginV2=async(n,r)=>{const s=await this.post(`${D.identity.auth.v1}/user/mfa/sms/${n}/verify`,r);return this.generateLoginResponseV3(s)},this.preEnrollMFAWebAuthnForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/webauthn/enroll`,n),this.enrollMFAWebAuthnForLogin=async n=>this.post(`${D.identity.auth.v1}/user/mfa/webauthn/enroll/verify`,n),this.enrollMFAWebAuthnForLoginV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/mfa/webauthn/enroll/verify`,n);return this.generateLoginResponseV3(r)},this.preVerifyMFAWebAuthnForLogin=async(n,r)=>this.post(`${D.identity.auth.v1}/user/mfa/webauthn/${n}`,r),this.verifyMFAWebAuthnForLogin=async(n,r)=>this.post(`${D.identity.auth.v1}/user/mfa/webauthn/${n}/verify`,r),this.verifyMFAWebAuthnForLoginV2=async(n,r)=>{const s=await this.post(`${D.identity.auth.v1}/user/mfa/webauthn/${n}/verify`,r);return this.generateLoginResponseV3(s)}
374,this.getSamlConfiguration=async()=>this.get(`${D.team.sso.v1}/saml/configurations`),this.updateSamlConfiguration=async n=>this.post(`${D.team.sso.v1}/saml/configurations`,n),this.getSamlVendorConfiguration=async()=>this.get(`${D.team.sso.v1}/saml/configurations/vendor-config`),this.updateSamlVendorMetadata=async n=>this.put(`${D.team.sso.v1}/saml/configurations/metadata`,n),this.validateSamlDomain=async()=>this.put(`${D.team.sso.v1}/saml/validations/domain`),this.getSamlRoles=async()=>this.get(`${D.team.sso.v1}/saml/configurations/roles/default`),this.getSamlRolesGroups=async()=>this.get(`${D.team.sso.v2}/saml/configurations/groups`),this.updateSamlRoles=async({roleIds:n})=>this.post(`${D.team.sso.v1}/saml/configurations/roles/default`,{roleIds:n}),this.createSamlGroup=async({roleIds:n,group:r})=>this.post(`${D.team.sso.v2}/saml/configurations/groups`,{group:r,roleIds:n}),this.updateSamlGroup=async({roleIds:n,group:r,id:s})=>this.patch(`${D.team.sso.v2}/saml/configurations/groups/${s}`,{group:r,roleIds:n}),this.deleteSamlGroup=async({id:n})=>this.delete(`${D.team.sso.v2}/saml/configurations/groups/${n}`),this.getOidcConfiguration=async()=>this.get(`${D.team.sso.v1}/oidc/configurations`),this.getSSOPublicConfiguration=async()=>this.get(`${D.team.sso.v2}/configurations/public`),this.getSocialLoginProviders=async()=>this.get(D.identity.sso.v1),this.getSocialLoginProvidersV2=async()=>this.get(D.identity.sso.v2),this.getSocialLoginProvidersV2ForAuthenticatedUser=async()=>this.get(`${D.identity.sso.v2}/authenticated`),this.getCustomSocialLoginProvidersV1=async()=>this.get(D.identity.sso.custom.v1),this.loginViaSocialLogin=async n=>{const r={};return n.code&&(r.code=n.code),n.idToken&&(r.id_token=n.idToken),n.redirectUri&&(r.redirectUri=n.redirectUri),n.codeVerifier&&(r.code_verifier=n.codeVerifier),n.codeVerifierPkce&&(r.code_verifier_pkce=n.codeVerifierPkce),n.state&&(r.state=n.state),this.post(`${D.identity.auth.v1}/user/sso/${n.provider}/postlogin`,{metadata:n.metadata,invitationToken:n.invitationToken},{params:r})},this.getVendorConfig=async()=>this.get(`${D.identity.configurations.v1}/public`),this.signUp=async(n,r)=>{const{shouldActivate:s,authResponse:i,userId:o,tenantId:a,activationToken:l}=await this.post(n,r),c={shouldActivate:s,userId:o,tenantId:a};if(!s&&i){const{user:u,tenants:d,activeTenant:f}=await this.generateLoginResponseV3(i);return F({},c,{user:u,tenants:d,activeTenant:f})}return F({},c,{activationToken:l})}
374,this.signUpUser=async n=>this.signUp(`${D.identity.users.v1}/signUp`,n),this.signUpUserWithPhoneNumber=async n=>this.signUp(`${D.identity.users.v1}/signUp/phoneNumber`,n),this.signUpUserWithUsername=async n=>this.signUp(`${D.identity.users.v1}/signUp/username`,n),this.getCurrentUserSessions=async()=>this.get(D.identity.users.sessions.currentUser.v1),this.getCurrentUserSession=async()=>this.get(`${D.identity.users.sessions.currentUser.v1}/current`),this.revokeSessionsForUser=async n=>this.post(`${D.identity.users.sessions.v1}/revoke`,{userId:n}),this.getSessionConfigurations=async()=>this.get(D.identity.users.sessions.configurations.v1),this.createOrUpdateSessionConfigrations=async n=>{await this.post(D.identity.users.sessions.configurations.v1,n)},this.deleteSessionForUser=async n=>{await this.delete(`${D.identity.users.sessions.currentUser.v1}/${n}`)},this.deleteAllSessionsForUser=async()=>{await this.delete(`${D.identity.users.sessions.currentUser.v1}/all`)},this.getUserAccessTokensData=async()=>this.get(D.identity.users.accessTokens.v1),this.getTenantAccessTokensData=async()=>this.get(D.identity.tenants.accessTokens.v1),this.deleteTenantAccessToken=async({id:n})=>{await this.delete(`${D.identity.tenants.accessTokens.v1}/${n}`)},this.deleteUserAccessToken=async({id:n})=>{await this.delete(`${D.identity.users.accessTokens.v1}/${n}`)},this.createUserAccessToken=async n=>this.post(D.identity.users.accessTokens.v1,n),this.createTenantAccessToken=async n=>this.post(D.identity.tenants.accessTokens.v1,n),this.getUserApiTokensData=async()=>this.get(D.identity.users.apiTokens.v1),this.getTenantApiTokensData=async()=>this.get(D.identity.tenants.apiTokens.v1),this.updateUserApiTokensData=async n=>this.post(D.identity.users.apiTokens.v1,n),this.updateTenantApiTokensData=async n=>this.post(D.identity.tenants.apiTokens.v2,n),this.deleteTenantApiToken=async({tokenId:n})=>{await this.delete(`${D.identity.tenants.apiTokens.v1}/${n}`)},this.deleteUserApiToken=async({tokenId:n})=>{await this.delete(`${D.identity.users.apiTokens.v1}/${n}`)},this.getUserById=async({userId:n})=>this.get(`${D.identity.users.v1}/${n}`),this.checkIfAllowToRememberMfaDevice=async n=>this.get(`${D.identity.configurations.v1}/mfa-policy/allow-remember-device`,{mfaToken:n}),this.passwordlessPreLogin=async n=>{var r;let{type:s}=n,i=re(n,WJ);const a=((r={[at.UsernameAndCode]:at.Code,[at.UsernameAndMagicLink]:at.MagicLink,[at.UsernameAndSms]:at.SmsCode,[at.UsernameAndPassword]:at.EmailAndPassword}[s])==null?void 0:r.toLowerCase())||s.toLowerCase();return this.post(`${D.identity.auth.v1}/passwordless/${a}/prelogin`,i)},this.passwordlessPostLoginV2=async n=>{let{type:r}=n,s=re(n,KJ);const i=await this.post(`${D.identity.auth.v1}/passwordless/${r.toLocaleLowerCase()}/postlogin`,s);return this.generateLoginResponseV3(i)},this.passwordlessPostLogin=async n=>{let{type:r}=n,s=re(n,qJ);return this.post(`${D.identity.auth.v1}/passwordless/${r.toLocaleLowerCase()}/postlogin`,s)},this.verifyInviteToken=async({token:n})=>this.post(D.identity.tenants.invites.verify.v1,{token:n}),this.getSSOConfigurations=async()=>this.get(`${D.team.sso.v1}/configurations`),this.createSSOConfiguration=async n=>this.post(`${D.team.sso.v1}/configurations`,n),this.updateSSOConfiguration=async(n,r)=>this.patch(`${D.team.sso.v1}/configurations/${n}`,r),this.deleteSSOConfiguration=async n=>{await this.delete(`${D.team.sso.v1}/configurations/${n}`)},this.createSSOConfigurationByMetadata=async n=>this.post(`${D.team.sso.v1}/configurations/metadata`,n),this.updateSSOConfigurationByMetadata=async(n,r)=>this.put(`${D.team.sso.v1}/configurations/${n}/metadata`,r),this.createSSOConfigurationByMetadataUrl=async n=>this.post(`${D.team.sso.v1}/configurations/metadata-url`,n),this.updateSSOConfigurationByMetadataUrl=async(n,r)=>this.put(`${D.team.sso.v1}/configurations/${n}/metadata-url`,r),this.createSSODomain=async(n,r)=>this.post(`${D.team.sso.v1}/configurations/${n}/domains`,r),this.deleteSSODomain=async(n,r)=>this.delete(`${D.team.sso.v1}/configurations/${n}/domains/${r}`),this.validateSSODomain=async(n,r)=>this.put(`${D.team.sso.v1}/configurations/${n}/domains/${r}/validate`),this.validateSSODomainV2=async(n,r)=>this.put(`${D.team.sso.v2}/configurations/${n}/domains/${r}
374/validate`),this.getSSODefaultRoles=async n=>this.get(`${D.team.sso.v1}/configurations/${n}/roles`),this.setSSODefaultRoles=async(n,r)=>this.put(`${D.team.sso.v1}/configurations/${n}/roles`,r),this.createSSOGroup=async(n,r)=>this.post(`${D.team.sso.v1}/configurations/${n}/groups`,r),this.updateSSOGroup=async(n,{roleIds:r,group:s,id:i})=>this.patch(`${D.team.sso.v1}/configurations/${n}/groups/${i}`,{group:s,roleIds:r}),this.deleteSSOGroup=async(n,r)=>this.delete(`${D.team.sso.v1}/configurations/${n}/groups/${r}`),this.getSSOGroups=async n=>this.get(`${D.team.sso.v1}/configurations/${n}/groups`),this.preLoginV2=async n=>this.post(`${D.identity.auth.v2}/user/sso/prelogin`,n),this.oidcPostLoginV2=async n=>{const r=await this.post(`${D.identity.auth.v2}/user/oidc/postlogin`,n);return this.generateLoginResponse(r)},this.exchangeOAuthTokensV2=async n=>{const r=await this.post(`${D.oauth.v1}/token`,n);return this.generateLoginResponseFromOAuthResponseV2(r)},this.silentOAuthRefreshTokenV2=async()=>{const n=pa(this.appName),r=await this.post(`${D.oauth.v1}/authorize/silent`,{tenantId:n});return this.generateLoginResponseFromOAuthResponseV2(r)},this.exchangeOAuthTokens=async n=>{const r=await this.post(`${D.oauth.v1}/token`,n);return this.generateLoginResponseFromOAuthResponse(r)},this.silentOAuthRefreshToken=async()=>{const n=pa(this.appName),r=await this.post(`${D.oauth.v1}/authorize/silent`,{tenantId:n});return this.generateLoginResponseFromOAuthResponse(r)},this.resetPhoneNumber=async n=>this.post(`${D.identity.users.v1}/phone/reset`,n),this.verifyResetPhoneNumber=async n=>this.post(`${D.identity.users.v1}/phone/reset/verify`,n),this.changePhoneNumberWithVerification=async n=>this.post(`${D.identity.users.v1}/phone`,n),this.verifyChangePhoneNumber=async n=>this.post(`${D.identity.users.v1}/phone/verify`,n),this.changePhoneNumber=async n=>this.put(`${D.identity.users.v1}/phone/change`,n),this.webAuthnPreLogin=async n=>this.post(`${D.identity.auth.v1}/webauthn/prelogin`,n),this.webAuthnPostLogin=async n=>this.post(`${D.identity.auth.v1}/webauthn/postlogin`,n),this.webAuthnPostLoginV2=async n=>{const r=await this.post(`${D.identity.auth.v1}/webauthn/postlogin`,n);return this.generateLoginResponseV3(r)},this.webAuthnCreateNewDeviceSession=async()=>this.post(D.identity.webAuthnDevices.v1),this.getWebAuthnDevices=async()=>this.get(D.identity.webAuthnDevices.v1),this.deleteWebAuthnDevice=async n=>this.delete(`${D.identity.webAuthnDevices.v1}/${n}`),this.verifyNewDeviceSession=async n=>this.post(`${D.identity.webAuthnDevices.v1}/verify`,n),this.getVendorPublicAuthStrategiesConfig=async()=>this.get(`${D.identity.configurations.v1}/auth/strategies/public`),this.getPublicAuthStrategiesConfigForAuthenticatedUser=async()=>this.get(`${D.identity.configurations.v1}/auth/strategies`),this.getMFAStrategiesConfig=async()=>this.get(`${D.identity.configurations.v1}/mfa/strategies`),this.getUserAuthorization=async()=>this.get(`${D.identity.users.authorization.v1}`),this.getMeV2=async()=>this.get(`${D.identity.users.v2}/me`),this.noThrowLoadEntitlements=async()=>{try{return await this.entitlementsApi.loadEntitlementsV2()}catch{}},this.getMeAndEntitlements=async()=>{if(de.for(this.appName).shouldSkipUserLoad())return{roles:[],permissions:[],groups:[],tenants:[]};const s=[{action:this.getMeV2,shouldLoad:!0},{action:this.noThrowLoadEntitlements,shouldLoad:this.shouldLoadEntitlements()},{action:this.getUserAuthorization,shouldLoad:this.shouldLoadMeAuthorization()}].map(c=>UJ(c)),[i,o,a]=await Promise.all(s),l=pa(this.appName);return l&&(i.tenantId=l),F({},i,a??{},{entitlements:o})},this.generateStepupSession=async n=>{const r=await this.post(`${D.identity.auth.v1}/user/step-up/generate`,n);return r.accessToken?this.generateLoginResponseV3(r):r},this.getGlobalSecurityPolicy=this.securityPolicy.getGlobalSecurityPolicy.bind(this.securityPolicy),this.getMfaPolicy=this.securityPolicy.getMfaPolicy.bind(this.securityPolicy),this.getVendorMfaPolicy=this.securityPolicy.getVendorMfaPolicy.bind(this.securityPolicy),this.saveMfaPolicy=this.securityPolicy.saveMfaPolicy.bind(this.securityPolicy),this.getLockoutPolicy=this.securityPolicy.getLockoutPolicy.bind(this.securityPolicy),this.getVendorLockoutPolicy=this.securityPolicy.getVendorLockoutPolicy.bind(this.securityPolicy),this.saveLockoutPolicy=this.securityPolicy.saveLockoutPolicy.bind(this.securityPolicy),this.getCaptchaPolicy=this.securityPolicy.getCaptchaPolicy.bind(this.securityPolicy),this.getPasswordHistoryPolicy=this.securityPolicy.getPasswordHistoryPolicy.bind(this.securityPolicy),this.getVendorPasswordHistoryPolicy=this.securityPolicy.getVendorPasswordHistoryPolicy.bind(this.securityPolicy),this.savePasswordHistoryPolicy=this.securityPolicy.savePasswordHistoryPolicy.bind(this.securityPolicy),this.getPasswordConfigPolicy=this.securityPolicy.getPasswordConfigPolicy.bind(this.securityPolicy),this.getDomainRestrictions=this.securityPolicy.getDomainRestrictions.bind(this.securityPolicy),this.getDomainRestrictionsConfig=this.securityPolicy.getDomainRestrictionsConfig.bind(this.securityPolicy),this.createDomainRestriction=this.securityPolicy.createDomainRestriction.bind(this.securityPolicy),this.updateDomainRestrictionConfig=this.securityPolicy.updateDomainRestrictionConfig.bind(this.securityPolicy),this.deleteDomainRestriction=this.securityPolicy.deleteDomainRestriction.bind(this.securityPolicy),this.getIPRestrictions=this.securityPolicy.getIPRestrictions.bind(this.securityPolicy),this.getIPRestrictionsConfig=this.securityPolicy.getIPRestrictionsConfig.bind(this.securityPolicy),this.createIPRestriction=this.securityPolicy.createIPRestriction.bind(this.securityPolicy),this.bulkCreateIPRestriction=this.securityPolicy.bulkCreateIPRestriction.bind(this.securityPolicy),this.updateIPRestrictionConfig=this.securityPolicy.updateIPRestrictionConfig.bind(this.securityPolicy),this.deleteIPRestriction=this.securityPolicy.deleteIPRestriction.bind(this.securityPolicy),this.testCurrentIp=this.securityPolicy.testCurrentIp.bind(this.securityPolicy),this.testCurrentIpInAllowList=this.securityPolicy.testCurrentIpInAllowList.bind(this.securityPolicy)}shouldLoadEntitlements(){return de.for(this.appName).shouldLoadEntitlements()}shouldLoadMeAuthorization(){const[t]=Kn.getFeatureFlags([e5],this.appName);return t}resolveSessionTenant(t,n,r,s){let{activeTenant:i}=s;if(t.isSessionPerTenantEnabled()&&(r.tenantId&&(n.tenantId=r.tenantId),n.tenantId)){gw(n.tenantId);const o=s.tenants.find(a=>a.tenantId===n.tenantId);o&&(i=o)}return i}}const YJ=new t5("default");
374class QJ extends tt{constructor(...t){super(...t),this.getSubscriptionInvoices=async()=>this.get(D.subscriptions.billing.invoices.v1),this.getSubscriptionInvoice=async n=>this.get(`${D.subscriptions.billing.invoices.v1}/${n}`),this.getSubscriptionInvoicePdf=async(n,r)=>this.get(`${D.subscriptions.billing.invoices.v1}/${n}/pdf`,{outputFileName:r},{responseType:"blob"})}}class XJ extends tt{constructor(...t){super(...t),this.getManagedSubscription=async n=>this.get(`${D.subscriptions.managedSubscriptions.v1}/${n}`),this.getManagedSubscriptions=async()=>this.get(D.subscriptions.managedSubscriptions.v1),this.cancelManagedSubscription=async n=>this.put(`${D.subscriptions.managedSubscriptions.v1}/${n}/cancellations/`,{}),this.renewManagedSubscription=async n=>this.put(`${D.subscriptions.managedSubscriptions.v1}/${n}/renewals/`,{}),this.updateManagedSubscription=async(n,{paymentMethodId:r,planId:s})=>this.put(`${D.subscriptions.managedSubscriptions.v1}/${n}`,{paymentMethodId:r,planId:s})}}const JJ=["email"];class ZJ extends tt{constructor(...t){super(...t),this.getPaymentMethods=async()=>this.get(D.subscriptions.billing.paymentMethods.v1),this.getPaymentMethod=async n=>this.get(`${D.subscriptions.billing.paymentMethods.v1}/${n}`),this.updatePaymentMethodBillingDetails=async(n,r)=>{let{email:s}=r,i=re(r,JJ);return this.patch(`${D.subscriptions.billing.paymentMethods.v1}/${n}/billing-details`,{email:s,address:i})}}}class eZ extends tt{constructor(...t){super(...t),this.getPaymentProviders=async()=>this.get(D.subscriptions.paymentProviders.v1)}}class tZ extends tt{constructor(...t){super(...t),this.getSubscriptionPlans=async()=>this.get(D.subscriptions.billing.plans.v1),this.getSubscriptionPlan=async n=>this.get(`${D.subscriptions.billing.plans.v1}/${n}`)}}class nZ extends tt{constructor(...t){super(...t),this.getSubscriptions=async()=>this.get(D.subscriptions.billing.subscriptions.v1),this.getSubscription=async n=>this.get(`${D.subscriptions.billing.subscriptions.v1}/${n}`),this.cancelSubscription=async n=>this.put(`${D.subscriptions.billing.subscriptions.v1}/${n}/cancellations/`,{}),this.renewSubscription=async n=>this.put(`${D.subscriptions.billing.subscriptions.v1}/${n}/renewals/`,{}),this.updateSubscription=async(n,{paymentMethodId:r,planId:s})=>this.put(`${D.subscriptions.billing.subscriptions.v1}/${n}`,{paymentMethodId:r,planId:s})}}class rZ extends tt{constructor(...t){super(...t),this.getSubscriptionSummaries=async n=>this.get(`${D.subscriptions.billing.summaries.v1}/${n}`)}}class sZ extends tt{constructor(...t){super(...t),this.getTenantConfiguration=async n=>this.get(`${D.subscriptions.billing.tenantConfiguration.v1}/${n}`),this.createTenantConfiguration=async n=>this.post(D.subscriptions.billing.tenantConfiguration.v1,n)}}class iZ extends tt{constructor(...t){super(...t),this.getVendorPublicConfigurations=async()=>this.get(D.subscriptions.billing.configurations.vendorPublicConfigurations.v1)}}class oZ extends tt{constructor(...t){super(...t),this.createSubscription=async n=>this.post(D.subscriptions.billing.paymentProviders.stripe.subscriptions.v1,n),this.getStripeCustomer=async n=>this.get(`${D.subscriptions.billing.paymentProviders.stripe.customers.v1}/${n}`),this.createStripeCustomer=async n=>this.post(D.subscriptions.billing.paymentProviders.stripe.customers.v1,n),this.getStripePaymentProviderConfiguration=async()=>this.get(D.subscriptions.billing.paymentProviders.stripe.publicConfigurations.v1),this.createStripePaymentMethodSetupIntentSecret=async n=>this.post(D.subscriptions.billing.paymentProviders.stripe.setupIntents.v1,n)}}let gr;(function(e){e.ACTIVE="active",e.CANCELED="canceled",e.INCOMPLETE="incomplete",e.EXPIRED="expired",e.TRIALING="trialing",e.TRIAL_ENDED="trialEnded"})(gr||(gr={}));let sf;(function(e){e.UNKNWON="unknown",e.CARD="card"})(sf||(sf={}));let of;(function(e){e.AT_PERIOD_END="atPeriodEnd"})(of||(of={}));let $c;(function(e){e.Stripe="Stripe"})($c||($c={}));let Yx;(function(e){e.CHANGE_TO_DEFAULT="change_to_default",e.RETAIN_TRIAL="retain_trial"})(Yx||(Yx={}));let Qx;(function(e){e.CREATE="create_customer"})(Qx||(Qx={}));
374class n5 extends tt{constructor(t){super(t),this.invoicesApi=new QJ(this.appName),this.managedSubscriptionApi=new XJ(this.appName),this.paymentMethodsApi=new ZJ(this.appName),this.paymentProvidersApi=new eZ(this.appName),this.plansApi=new tZ(this.appName),this.subscriptionApi=new nZ(this.appName),this.summariesApi=new rZ(this.appName),this.subscriptionTenantConfigApi=new sZ(this.appName),this.vendorPublicConfigApi=new iZ(this.appName),this.stripeProviderApi=new oZ(this.appName),this.getSubscriptionInvoices=this.invoicesApi.getSubscriptionInvoices.bind(this.invoicesApi),this.getSubscriptionInvoice=this.invoicesApi.getSubscriptionInvoice.bind(this.invoicesApi),this.getSubscriptionInvoicePdf=this.invoicesApi.getSubscriptionInvoicePdf.bind(this.invoicesApi),this.getManagedSubscription=this.managedSubscriptionApi.getManagedSubscription.bind(this.managedSubscriptionApi),this.getManagedSubscriptions=this.managedSubscriptionApi.getManagedSubscriptions.bind(this.managedSubscriptionApi),this.cancelManagedSubscription=this.managedSubscriptionApi.cancelManagedSubscription.bind(this.managedSubscriptionApi),this.renewManagedSubscription=this.managedSubscriptionApi.renewManagedSubscription.bind(this.managedSubscriptionApi),this.updateManagedSubscription=this.managedSubscriptionApi.updateManagedSubscription.bind(this.managedSubscriptionApi),this.getPaymentMethods=this.paymentMethodsApi.getPaymentMethods.bind(this.paymentMethodsApi),this.getPaymentMethod=this.paymentMethodsApi.getPaymentMethod.bind(this.paymentMethodsApi),this.updatePaymentMethodBillingDetails=this.paymentMethodsApi.updatePaymentMethodBillingDetails.bind(this.paymentMethodsApi),this.getPaymentProviders=this.paymentProvidersApi.getPaymentProviders.bind(this.paymentProvidersApi),this.getSubscriptionPlans=this.plansApi.getSubscriptionPlans.bind(this.plansApi),this.getSubscriptionPlan=this.plansApi.getSubscriptionPlan.bind(this.plansApi),this.getSubscriptions=this.subscriptionApi.getSubscriptions.bind(this.subscriptionApi),this.getSubscription=this.subscriptionApi.getSubscription.bind(this.subscriptionApi),this.cancelSubscription=this.subscriptionApi.cancelSubscription.bind(this.subscriptionApi),this.renewSubscription=this.subscriptionApi.renewSubscription.bind(this.subscriptionApi),this.updateSubscription=this.subscriptionApi.updateSubscription.bind(this.subscriptionApi),this.getSubscriptionSummaries=this.summariesApi.getSubscriptionSummaries.bind(this.summariesApi),this.getTenantConfiguration=this.subscriptionTenantConfigApi.getTenantConfiguration.bind(this.subscriptionTenantConfigApi),this.createTenantConfiguration=this.subscriptionTenantConfigApi.createTenantConfiguration.bind(this.subscriptionTenantConfigApi),this.getVendorPublicConfigurations=this.vendorPublicConfigApi.getVendorPublicConfigurations.bind(this.vendorPublicConfigApi),this.createSubscription=this.stripeProviderApi.createSubscription.bind(this.stripeProviderApi),this.getStripeCustomer=this.stripeProviderApi.getStripeCustomer.bind(this.stripeProviderApi),this.createStripeCustomer=this.stripeProviderApi.createStripeCustomer.bind(this.stripeProviderApi),this.getStripePaymentProviderConfiguration=this.stripeProviderApi.getStripePaymentProviderConfiguration.bind(this.stripeProviderApi),this.createStripePaymentMethodSetupIntentSecret=this.stripeProviderApi.createStripePaymentMethodSetupIntentSecret.bind(this.stripeProviderApi)}}const aZ=new n5("default");class r5 extends tt{constructor(t){super(t),this.getProfile=async n=>this.get(`${D.identity.users.v2}/me`,n??{addRoles:!0}),this.updateEmail=async n=>this.post(`${D.identity.users.v1}/email/me`,{email:n}),this.verifyEmail=async(n,r)=>this.post(`${D.identity.users.v1}/email/me/verify`,{email:n,code:r}),this.updateProfile=async n=>this.put(`${D.identity.users.v2}/me`,n),this.updateProfileImage=async n=>this.put(`${D.team.profile.v1}/me/image/v1`,n,{responseType:"plain",contentType:void 0}),this.changePassword=async n=>this.post(`${D.identity.users.v1}/passwords/change`,n),this.loadUsers=async n=>{var r,s,i,o,a,l;const c=(n.filter||[]).reduce((d,f)=>F({},d,{[f.id]:f.value}),{}),u=(r=n.sort)!=null&&r.length?{sortBy:(s=(i=n.sort)==null||(o=i[0])==null?void 0:o.id)!=null?s:"name",sortDirection:(a=n.sort)!=null&&(l=a[0])!=null&&l.desc?"desc":"asc"}:null;return this.get(D.team.members.v1,F({pageOffset:n.pageOffset,pageSize:n.pageSize},c,u))}
374,this.addUser=async n=>this.post(D.identity.users.v2,F({},n,{provider:"local"})),this.deleteUser=async n=>this.delete(`${D.team.members.v1}/${n.userId}`),this.updateUser=async n=>this.put(D.team.members.v1,n),this.updateUserExpirationTime=async n=>{const{userId:r,expirationInSeconds:s}=n;return this.put(`${D.identity.users.temporary.v1}/${r}`,{expirationInSeconds:s})},this.setPermanentUser=async n=>this.delete(`${D.identity.users.temporary.v1}/${n}`),this.getTemporaryUserConfiguration=async()=>this.get(D.identity.users.temporary.configuration.v1),this.createInviteUserLink=async n=>this.post(D.identity.tenants.invites.user.v1,F({},n)),this.createInviteUserLinkV2=async n=>this.post(D.identity.tenants.invites.user.v2,F({},n)),this.updateInviteUserLink=async n=>this.patch(D.identity.tenants.invites.user.v1,F({},n)),this.deleteInviteUserLink=async()=>this.delete(D.identity.tenants.invites.user.v1),this.getInviteUserLink=async()=>this.get(D.identity.tenants.invites.user.v1),this.getInviteLinkConfiguration=async()=>this.get(D.identity.tenants.invites.configuration.v1),this.loadAvailableRoles=async()=>this.get(D.team.roles.v1),this.loadAvailablePermissions=async()=>this.get(D.identity.permissions.v1),this.loadStats=async()=>this.get(`${D.team.stats.v1}/members`),this.resendActivationLink=async n=>this.post(`${D.team.members.v1}/${n.userId}/resendActivationEmail`,{}),this.resendInvitationLink=async n=>this.post(D.identity.users.v2,F({},n,{provider:"local"})),this.resendInvitationLinkToAllTenants=async n=>this.post(D.identity.users.invitation.resendAll.v1,F({},n)),this.disableUser=async n=>this.post(`${D.identity.tenants.users.v1}/${n}/disable`),this.enableUser=async n=>this.post(`${D.identity.tenants.users.v1}/${n}/enable`)}}const lZ=new r5("default");class s5 extends tt{constructor(t){super(t),this.getMetadata=async n=>{var r,s;const i=await this.get("/metadata",n);if(i!=null&&(r=i.rows)!=null&&r[0])return i==null||(s=i.rows)==null?void 0:s[0];throw new Error(`metadata not found: ${n.entityName}`)},this.getAdminBoxMetadata=async()=>this.get("/metadata/admin-box"),this.updateAdminBoxMetadata=async n=>this.post("/metadata/admin-box",n),this.getIpMetadata=async n=>{const r=await this.get(`/metadata/ip/${n}`);if(r)return r;throw new Error("ip metadata not found")},this.getCurrentUserIpMetadata=async()=>{const n=await this.get("/metadata/ipme");if(n)return n;throw new Error("ip metadata not found")},this.getNotificationsMetadata=async()=>this.getMetadata({entityName:"notifications"}),this.getSamlMetadata=async()=>this.getMetadata({entityName:"saml"}),this.getAuditsMetadata=async()=>this.getMetadata({entityName:"audits"}),this.getIpAdressMetadata=async n=>this.getIpMetadata(n)}}const cZ=new s5("default"),uZ=["dataFilters"],dZ=["templateId","dataFilters"],fZ=["dataFilters"];class i5 extends tt{constructor(t){super(t),this.getReports=async n=>this.get(`${D.reports.service.v2}/tenant-reports`,n),this.getReport=async n=>this.get(`${D.reports.service.v2}/${n.id}/tenant-reports`),this.renderReport=async n=>{let{dataFilters:r}=n,s=re(n,uZ);return{html:await this.get(`${D.reports.trigger.v1}/preview-report`,F({},s,{dataFilters:btoa(JSON.stringify(r||{})),responseType:"html"}),{responseType:"plain"})}},this.scheduleReport=async n=>{let{templateId:r,dataFilters:s}=n,i=re(n,dZ);return this.post(`${D.reports.service.v2}/${r}/tenant-reports`,F({},i,{dataFilters:btoa(JSON.stringify(s||{}))}))},this.downloadReport=async n=>{let{dataFilters:r}=n,s=re(n,fZ);const i=await this.get(`${D.reports.trigger.v1}/preview-report`,F({},s,{dataFilters:btoa(JSON.stringify(r||{}))}),{responseType:"blob"});let o="text/html",a="html";s.responseType==="pdf"?(o="application/pdf",a="pdf"):s.responseType==="image"&&(o="image/jpeg",a="jpg");const l=new Blob([i],{type:o}),c=URL.createObjectURL(l),u=document.createElement("a");u.href=c,u.setAttribute("download",`report_${s.name||""}.${a}`),u.click(),setTimeout(u.remove.bind(u))},this.sendReport=async n=>this.post(`${D.reports.trigger.v1}/tenant-reports`,n)}}const hZ=new i5("default"),pZ=["eventKey"],gZ=["eventKey"];
374class o5 extends tt{constructor(t){super(t),this.getSlackConfiguration=()=>this.get(`${D.integrations.configurations.v1}/slack`),this.getSlackScope=()=>this.get(`${D.integrations.configurations.v1}/slack/applications`),this.getSlackChannels=()=>this.get(`${D.integrations.configurations.v1}/slack/channels`),this.postSlackConfiguration=n=>n.id?this.patch(`${D.integrations.configurations.v1}/slack/subscription/${n.id}`,n):this.post(`${D.integrations.configurations.v1}/slack/subscriptions`,n),this.deleteSlackConfiguration=n=>this.delete(`${D.integrations.configurations.v1}/slack/subscriptions/${n.id}`),this.postSlackCode=n=>this.post(`${D.integrations.configurations.v1}/slack/applications/registrations`,{code:n}),this.getEmailConfiguration=()=>this.get(`${D.integrations.configurations.v1}/emails`),this.postEmailConfiguration=n=>{let{eventKey:r}=n,s=re(n,pZ);return this.post(`${D.integrations.configurations.v1}/emails/${r}`,s)},this.patchEmailConfiguration=({eventKey:n,enabled:r})=>this.patch(`${D.integrations.configurations.v1}/emails/${n}`,{enabled:r}),this.deleteEmailSubscriptions=(n,r)=>this.delete(`${D.integrations.configurations.v1}/emails/${n}/subscriptions/${r}`),this.putEmailSubscriptions=(n,r,s)=>this.put(`${D.integrations.configurations.v1}/emails/${r}/subscriptions/${n}`,s),this.deleteEmailConfiguration=n=>
374this.delete(`${D.integrations.configurations.v1}/emails/${n}`),this.getSMSConfiguration=()=>this.get(`${D.integrations.configurations.v2}/sms`),this.postSMSConfiguration=n=>{let{eventKey:r}=n,s=re(n,gZ);return this.post(`${D.integrations.configurations.v2}/sms/${r}`,s)},this.patchSMSConfiguration=({eventKey:n,enabled:r})=>this.patch(`${D.integrations.configurations.v2}/sms/${n}`,{enabled:r}),this.deleteSMSSubscriptions=(n,r)=>this.delete(`${D.integrations.configurations.v2}/sms/${n}/subscriptions/${r}`),this.putSMSSubscriptions=(n,r,s)=>this.put(`${D.integrations.configurations.v2}/sms/${r}/subscriptions/${n}`,s),this.deleteSMSConfiguration=n=>this.delete(`${D.integrations.configurations.v2}/sms/${n}`),this.getWebhooksConfigurations=()=>this.get(D.webhooks.v1),this.postWebhooksConfiguration=n=>n._id?this.patch(`${D.webhooks.v1}/${n._id}`,n):this.post(`${D.webhooks.v1}/custom`,n),this.deleteWebhooksConfiguration=n=>this.delete(`${D.webhooks.v1}/${n}`),this.getWebhookLog=(n,r=0,s=10)=>{const i=new URLSearchParams({id:n,offset:`${r}`,limit:`${s}`});return this.get(`${D.webhooks.v1}/logs/?${i.toString()}`)},this.postWebhookTest=n=>this.post(`${D.webhooks.v1}/test`,n),this.postWebhookRetry=n=>this.post(`${D.webhooks.v1}/logs/${n}/retries`),this.getCategories=()=>this.get(`${D.events.configurations.v1}/categories`),this.getChannelMaps=n=>this.get(D.events.configurations.v1,{channels:n})}}const mZ=new o5("default");class a5 extends tt{constructor(t){super(t),this.getNotifications=async n=>this.get(D.notifications.v1,{params:n}),this.updateNotificationStatus=async n=>this.put(`${D.notifications.v1}/status`,{params:n}),this.updateNotificationIsPinned=async n=>{const{notificationId:r,pinStatus:s}=n;return this.put(`${D.notifications.v1}/${s}`,{notificationId:r})},this.markAllAsRead=async()=>this.post(`${D.notifications.v1}/status/mark-all-read`)}}const vZ=new a5("default"),yZ=["endpoint","headerProps"];class l5 extends tt{constructor(t){super(t),this.getAudits=async n=>this.get(D.audits.v1,n),this.getAuditsStats=async n=>this.get(`${D.audits.v1}/stats`,n),this.exportAudits=async n=>{const{endpoint:r,headerProps:s}=n,i=re(n,yZ);return this.postDownload(`${D.audits.v1}/export/${r}`,{properties:s},i)}}}const SZ=new l5("default");class c5 extends tt{constructor(t){super(t),this.updateSettings=async(n,r)=>this.put(D.tenants.accountSettings.v1,n,{headers:this.extractHeadersFromOptions(r)}),this.getSettings=async n=>this.get(D.tenants.accountSettings.v1,void 0,{headers:this.extractHeadersFromOptions(n)}),this.getPublicSettings=async()=>this.get(`${D.tenants.accountSettings.v1}/public`)}}const bZ=new c5("default"),_Z=["roleId"],wZ=["roleId"],EZ=["permissionId"];class u5 extends tt{constructor(t){super(t),this.getRoles=async()=>this.get(D.identity.roles.v1),this.addRole=async n=>this.post(D.identity.roles.v1,n),this.deleteRole=async({roleId:n})=>this.delete(`${D.identity.roles.v1}/${n}`),this.updateRole=async n=>{let{roleId:r}=n,s=re(n,_Z);return this.patch(`${D.identity.roles.v1}/${r}`,s)},this.attachPermissionsToRole=async n=>{let{roleId:r}=n,s=re(n,wZ);return this.put(`${D.identity.roles.v1}/${r}/permissions`,s)},this.getPermissions=async()=>this.get(D.identity.permissions.v1),this.attachPermissionToRoles=async n=>{let{permissionId:r}=n,s=re(n,EZ);return this.put(`${D.identity.permissions.v1}/${r}/roles`,s)},this.getPermissionCategories=async()=>this.get(`${D.identity.permissions.v1}/categories`),this.addRoleV2=async n=>this.post(D.identity.roles.v2,n)}}const AZ=new u5("default");class d5 extends tt{constructor(t){super(t),this.getVendorPublicInfo=async()=>this.get(`${D.vendor}/public`)}}const CZ=new d5("default");class f5 extends tt{constructor(t){super(t),this.loadAllUsers=async n=>this.get(D.identity.subTenants.v1,n),this.addUserToTenantAndSubTenants=async n=>this.post(D.identity.subTenants.v1,n),this.removeUserFromTenantAndSubTenants=async(n,r)=>this.delete(D.identity.subTenants.v1,n,{headers:this.extractHeadersFromOptions(r)}),this.addUserRolesForSubTenants=async(n,r,s)=>this.post(`${D.identity.subTenants.v1}/${n}/roles`,r,{headers:this.extractHeadersFromOptions(s)}),this.removeUserRolesFromSubTenants=async(n,r,s)=>this.delete(`${D.identity.subTenants.v1}/${n}/roles`,r,{headers:this.extractHeadersFromOptions(s)}),this.setUserRolesForSubTenants=async(n,r,s)=>this.patch(`${D.identity.subTenants.v1}/${n}/roles`,r,{headers:this.extractHeadersFromOptions(s)}),this.createSubTenant=async(n,r)=>this.post(D.tenants.subTenants.v1,n,{headers:this.extractHeadersFromOptions(r)}),this.deleteSubTenant=async(n,r)=>this.delete(`${D.tenants.subTenants.v1}/${n}`,void 0,{headers:this.extractHeadersFromOptions(r)}),this.updateSubTenant=async({tenantId:n}
374,r,s)=>this.patch(`${D.tenants.subTenants.v1}/${n}`,r,{headers:this.extractHeadersFromOptions(s)}),this.updateSubTenantManagement=async({tenantId:n},r,s)=>this.put(`${D.tenants.subTenants.v1}/${n}/management`,r,{headers:this.extractHeadersFromOptions(s)}),this.updateSubAccountAccess=async(n,r,s)=>this.put(`${D.identity.subTenants.v1}/${n}/access`,r,{headers:this.extractHeadersFromOptions(s)}),this.addUsersToSubTenant=async(n,r)=>this.post(`${D.identity.subTenants.v2}/`,n,{headers:this.extractHeadersFromOptions(r)})}updateSubTenantHierarchySettings({tenantId:t},n,r){return this.put(`${D.tenants.subTenants.v1}/${t}/hierarchy-settings`,n,{headers:this.extractHeadersFromOptions(r)})}}const xZ=new f5("default");class yw extends tt{constructor(t){super(t),this.getConfigs=async()=>this.get(`${D.directory.v1}`),this.updateConfiguration=async(n,r)=>this.patch(`${D.directory.v1}/${n}`,r),this.createConfiguration=async n=>this.post(`${D.directory.v1}`,n),this.deleteConfiguration=async(n,r)=>this.delete(`${D.directory.v1}/${n}`,{deleteAll:r}),this.countConfigurationUsers=async n=>this.get(`${D.directory.temp}/${n}/Users/count`)}}const TZ=new yw("default");class h5 extends tt{constructor(t){super(t),this.impersonate=async n=>this.post(`${D.identity.impersonate.v1}`,n)}}const PZ=new h5("default"),RZ=["groupId"];class p5 extends tt{constructor(t){super(t),this.getGroupById=async({groupId:n},r)=>this.get(`${D.identity.groups.v1}/${n}`,F({},r)),this.getGroups=async n=>this.get(`${D.identity.groups.v1}`,F({},n)),this.getGroupsByIds=async(n,r)=>this.post(`${D.identity.groups.getByIds.v1}`,n,{params:r}),this.createGroup=async n=>this.post(`${D.identity.groups.v1}`,n),this.updateGroup=async n=>{let{groupId:r}=n,s=re(n,RZ);return this.patch(`${D.identity.groups.v1}/${r}`,s)},this.deleteGroup=async n=>this.delete(`${D.identity.groups.v1}/${n}`),this.addRolesToGroup=async(n,r)=>this.post(`${D.identity.groups.v1}/${n}/roles`,r),this.deleteRolesFromGroup=async(n,r)=>this.delete(`${D.identity.groups.v1}/${n}/roles`,r),this.addUsersToGroup=async(n,r)=>this.post(`${D.identity.groups.v1}/${n}/users`,r),this.deleteUsersFromGroup=async(n,r)=>this.delete(`${D.identity.groups.v1}/${n}/users`,r),this.getGroupConfiguration=async()=>this.get(`${D.identity.groups.configurations.v1}`),this.updateGroupConfiguration=async n=>this.post(`${D.identity.groups.configurations.v1}`,n)}}const kZ=new p5("default");class g5 extends tt{constructor(t){super(t),this.getRecommendations=async()=>this.get(D.securityCenter.recommendations.v1),this.getInsights=async()=>this.get(D.securityCenter.insights.v1)}}const OZ=new g5("default");class m5 extends tt{constructor(t){super(t),this.getUserPhoneNumbers=async n=>this.get(`${D.identity.phoneNumbers.v1}`,n),this.getUserOwnPhoneNumbers=async()=>this.get(`${D.identity.phoneNumbers.v1}/me`),this.createPhoneNumber=async n=>this.post(`${D.identity.phoneNumbers.v1}`,n),this.deletePhoneNumber=async n=>this.delete(`${D.identity.phoneNumbers.v1}/${n}`),this.preVerifyPhoneNumber=async n=>this.post(`${D.identity.phoneNumbers.v1}/preverify`,n),this.verifyPhoneNumber=async n=>this.post(`${D.identity.phoneNumbers.v1}/verify`,n),this.verifyDeletePhoneNumber=async(n,r)=>this.post(`${D.identity.phoneNumbers.v1}/${n}/delete/verify`,r),this.getUsersPhoneNumberV2=async(n,r)=>this.get(D.identity.users.phoneNumbers.v2,n,{headers:this.extractHeadersFromOptions(r)})}}const IZ=new m5("default");class v5 extends tt{constructor(t){super(t),this.getUsersEmailsV1=async(n,r)=>this.get(D.identity.emails.v1,n,{headers:this.extractHeadersFromOptions(r)})}}const NZ=new v5("default");class y5 extends tt{constructor(t){super(t),this.getUserApplicationsId=async({userId:n})=>this.get(`${D.identity.applications.v1}/${n}/apps`),this.getUsersApplicationsId=async({userIds:n})=>this.get(`${D.identity.applications.v1}/users-apps`,{userIds:n.join(",")}),this.getTenantsApplications=async()=>this.get(D.applications.tenant.v1),this.getTenantsApplicationsV2=async()=>this.get(D.applications.tenant.v2),this.getApplicationsData=async({appIds:n,includeFreeAccess:r=!0})=>this.get(D.applications.v1,{ids:n.join(","),_includeFreeAccess:r}),this.assignUserToApplications=async n=>this.post(`${D.identity.applications.v1}/apps-user`,n),this.unassignUserFromApplications=async n=>this.delete(`${D.identity.applications.v1}/user-apps`,n),this.getUsersOfApplications=async({appIds:n})=>this.get(`${D.identity.applications.v1}/apps-users`,{appIds:n.join(",")})}}const LZ=new y5("default"),la={"x-frontegg-api-key":"my-frontegg-api-key","frontegg-vendor-id":"04ae2174-d8d9-4a90-8bab-2548e210a508","frontegg-tenant-id":"02e6ab6f-8b25-48e4-b06d-2c53745ce213","frontegg-user-id":"e5c397a1-7120-4753-9216-e5d7f35d1f2d"};class S5 extends tt{constructor(t){super(t),this.getAgentsConfig=async()=>this.get(`${D.velo.v1}/config`,void 0,{headers:la}),this.getConversations=async()=>this.get(`${D.velo.v1}/conversations`,void 0,{headers:la}),this.getConversationById=async n=>this.get(`${D.velo.v1}/conversation/${n.id}`,void 0,{headers:la}),this.createConversation=async n=>this.post(`${D.velo.v1}
374/conversations`,{message:n.message,stream:n.stream},{responseType:n.stream===!1?"json":"stream",headers:la}),this.sendMessage=async n=>this.post(`${D.velo.v1}/conversation/${n.conversationId}/messages`,{message:n.message,stream:n.stream},{responseType:n.stream===!1?"json":"stream",headers:la}),this.sendApiResponse=async n=>this.post(`${D.velo.v1}/conversation/${n.conversationId}/response/${n.callId}`,{data:n.data,status:n.status,stream:n.stream},{responseType:n.stream===!1?"json":"stream",headers:la}),this.getConversationResource=async n=>this.get(`${D.velo.v1}/conversation/${n.conversationId}/resource/${n.resourceId}`,void 0,{headers:la})}}const DZ=new S5("default");class b5 extends tt{constructor(t){super(t),this.getUsernamesV1=async(n,r)=>this.get(`${D.identity.usernames.v1}`,n,{headers:this.extractHeadersFromOptions(r)}),this.getUserOwnUsername=async()=>this.get(`${D.identity.usernames.v1}/me`),this.createUsername=async n=>this.post(`${D.identity.usernames.v1}`,n),this.deleteUsername=async n=>this.delete(`${D.identity.usernames.v1}/${n}`)}}const MZ=new b5("default");class _5 extends tt{constructor(t){super(t),this.getUserEmailPolicyConfig=async()=>this.get(`${D.identity.configurations.v1}/user-emails-policy`)}}const UZ=new _5("default");let W2;(function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"})(W2||(W2={}));let K2;(function(e){e.createdAt="createdAt",e.name="name",e.tenantId="tenantId"})(K2||(K2={}));let q2;(function(e){e.CUSTOMER="customer",e.SPAM="spam",e.TEST="test",e.RESELLER="reseller",e.HEADQUARTER="headquarter"})(q2||(q2={}));let At;(function(e){e.NEVER="NEVER",e.ALWAYS="ALWAYS",e.ASSIGNABLE="ASSIGNABLE"})(At||(At={}));let tm;(function(e){e.DEFAULT_OFF="defaultOff",e.DEFAULT_ON="defaultOn",e.ALWAYS_ON="alwaysOn"})(tm||(tm={}));const FZ=[/^(.*)\/logout$/g,"/logout",/^\/identity\/resources\/auth\/v[0-9]*\/user\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/impersonation\/v[0-9]$/g,/^\/identity\/resources\/auth\/v[0-9]*\/passwordless\/[^\/]*\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/webauthn\/postlogin$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/token\/refresh$/g,/^\/identity\/resources\/users\/v[0-9]*\/signUp$/g,/^\/identity\/resources\/users\/v[0-9]*\/activate$/g,/^\/identity\/resources\/users\/v[0-9]*\/invitation\/accept$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/verify$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/[^\/]*\/[^\/]*\/verify$/g,/^\/identity\/resources\/auth\/v[0-9]*\/user\/mfa\/[^\/]*\/verify$/g,/^\/oauth\/token$/g,/^\/oauth\/authorize\/silent$/g],$Z=`${D.identity.auth.v1}/user/token/refresh`,jZ=`${D.oauth.v1}/authorize/silent`,VZ=`${D.identity.users.v2}/me`,BZ=`${D.identity.users.v2}/me/tenants`,zZ=`${D.identity.users.v3}/me/tenants`,GZ=D.entitlements.v2;let Y2;(function(e){e.FRONTEGG="frontegg",e.OKTA="okta",e.AZURE_AD="azure-ad",e.OTHER="other"})(Y2||(Y2={}));let nm;(function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"})(nm||(nm={}));let on;(function(e){e.FRONTEGG="frontegg",e.SCIM2="scim2"})(on||(on={}));let rm;(function(e){e.createdAt="createdAt",e.name="name",e.email="email",e.id="id",e.verified="verified",e.isLocked="isLocked",e.provider="provider",e.tenantId="tenantId"})(rm||(rm={}));let nc;(function(e){e.MFA_UNENROLLED="mfa-unenrolled",e.BREACHED_PASSWORDS="breached-passwords",e.INACTIVE="inactive"})(nc||(nc={}));const HZ=["local","saml","google","github","facebook","microsoft","scim2","slack"];let Q2;(function(e){e.MISSING_PERMISSION="MISSING_PERMISSION",e.MISSING_FEATURE="MISSING_FEATURE",e.BUNDLE_EXPIRED="BUNDLE_EXPIRED"})(Q2||(Q2={}));let af;(function(e){e.FORCE_MFA="FORCE_MFA",e.BREACHED_PASSWORDS_EXIST="BREACHED_PASSWORDS_EXIST",e.ENABLE_USER_LOCKOUT="ENABLE_USER_LOCKOUT",e.STRENGTHEN_USER_LOCKOUT="STRENGTHEN_USER_LOCKOUT",e.ENABLE_PASSWORD_HISTORY="ENABLE_PASSWORD_HISTORY",e.STRENGTHEN_PASSWORD_HISTORY="STRENGTHEN_PASSWORD_HISTORY",e.ENABLE_FORCE_RELOGIN="ENABLE_FORCE_RELOGIN",e.SET_FORCE_RELOGIN="SET_FORCE_RELOGIN",e.ENABLE_SESSION_CONCURRENCY="ENABLE_SESSION_CONCURRENCY",e.SET_SESSION_CONCURRENCY="SET_SESSION_CONCURRENCY",e.ENABLE_IDLE_SESSION="ENABLE_IDLE_SESSION",e.SET_IDLE_SESSION="SET_IDLE_SESSION",e.ENABLE_IP_RESTRICTIONS="ENABLE_IP_RESTRICTIONS",e.CHANGE_IP_TO_ALLOWLIST="CHANGE_IP_TO_ALLOWLIST",e.ENABLE_DOMAIN_RESTRICTIONS="ENABLE_DOMAIN_RESTRICTIONS",e.CHANGE_DOMAIN_TO_ALLOWLIST="CHANGE_DOMAIN_TO_ALLOWLIST",e.CONFIGURE_SSO="CONFIGURE_SSO"})(af||(af={}));let Aa;(function(e){e.MFA_FORCED="MFA_FORCED",e.PARTIALLY_FORCED_MFA="PARTIALLY_FORCED_MFA",e.PARTIAL_MFA_USAGE="PARTIAL_MFA_USAGE",e.FULL_MFA_USAGE="FULL_MFA_USAGE",e.BREACHED_PASSWORD_USERS_EXIST="BREACHED_PASSWORD_USERS_EXIST",e.IMPROVE_LOCKOUT_POLICY="IMPROVE_LOCKOUT_POLICY",e.IMPROVE_PASSWORD_HISTORY_POLICY="IMPROVE_PASSWORD_HISTORY_POLICY",e.NO_SESSION_SETTINGS="NO_SESSION_SETTINGS",e.PARTIAL_SESSION_SETTINGS="PARTIAL_SESSION_SETTINGS",e.FULL_SESSION_SETTINGS="FULL_SESSION_SETTINGS",e.NO_IP_RESTRICTIONS="NO_IP_RESTRICTIONS",e.IP_ALLOWLIST="IP_ALLOWLIST",e.IP_DENYLIST="IP_DENYLIST",e.NO_DOMAIN_RESTRICTIONS="NO_DOMAIN_RESTRICTIONS",e.DOMAIN_ALLOWLIST="DOMAIN_ALLOWLIST",e.DOMAIN_DENYLIST="DOMAIN_DENYLIST",e.FULL_PASSWORD_SETTINGS="FULL_PASSWORD_SETTINGS"})(Aa||(Aa={}));let X2;(function(e){e.SEND_RESET_BREACHED_PASSWORD_EMAIL="SEND_RESET_BREACHED_PASSWORD_EMAIL",e.ADJUST_FORCE_RELOGIN="ADJUST_FORCE_RELOGIN",e.ADJUST_MAX_CONCURRENT_SESSIONS="ADJUST_MAX_CONCURRENT_SESSIONS",e.ADJUST_IDLE_TIMEOUT="ADJUST_IDLE_TIMEOUT"})(X2||(X2={}));let lf;(function(e){e.SEVERE="SEVERE",e.WARNING="WARNING",e.INFO="INFO"})(lf||(lf={}));let Ci;(function(e){e.MFA="MFA",e.SESSIONS="SESSIONS",e.PASSWORD="PASSWORD",e.INACTIVITY="INACTIVITY",e.IP="IP",e.DOMAIN="DOMAIN",e.SSO="SSO"})(Ci||(Ci={}));let bo;(function(e){e.FREE_ACCESS="FREE_ACCESS",e.MANAGED_ACCESS="MANAGED_ACCESS"})(bo||(bo={}));/** @license Frontegg v7.104.0 375 * 376 * This source code is licensed under the MIT license found in the 377 * LICENSE file in the root directory of this source tree. 378 */const w5={auth:YJ,securityPolicy:NJ,teams:lZ,metadata:cZ,reports:hZ,connectivity:mZ,notifications:vZ,audits:SZ,tenants:GJ,accountSettings:bZ,roles:AZ,subscriptions:aZ,vendor:CZ,subTenants:xZ,featureFlags:DJ,directory:TZ,impersonate:PZ,groups:kZ,users:MJ,entitlements:HJ,securityCenter:OZ,userPhoneNumbers:IZ,usersEmails:NZ,applications:LZ,velo:DZ,usernames:MZ,userEmailPolicy:UZ},qf=e=>({auth:new t5(e),securityPolicy:new fw(e),teams:new r5(e),metadata:new s5(e),reports:new i5(e),connectivity:new o5(e),notifications:new a5(e),audits:new l5(e),tenants:new mw(e),accountSettings:new c5(e),roles:new u5(e),subscriptions:new n5(e),vendor:new d5(e),subTenants:new f5(e),featureFlags:new hw(e),directory:new yw(e),impersonate:new h5(e),groups:new p5(e),users:new pw(e),entitlements:new vw(e),securityCenter:new g5(e),userPhoneNumbers:new m5(e),usersEmails:new v5(e),applications:new y5(e),velo:new S5(e),usernames:new b5(e),userEmailPolicy:new _5(e)}),WZ={fetch:JL,FetchClient:Ln,ContextHolder:de,FronteggContext:XL,api:w5,createApiClient:qf,FronteggApiError:Vr,AuthStrategyEnum:at,MachineToMachineAuthStrategy:On,SocialLoginProviders:Jg,ISubscriptionCancellationPolicy:of,ISubscriptionStatus:gr,PaymentMethodType:sf,ProviderType:$c,EIdentifierType:tf}
378,E5=Object.freeze(Object.defineProperty({__proto__:null,get ApplicationAccessType(){return bo},get AuthStrategyEnum(){return at},ContextHolder:de,DirectoryApi:yw,get EIdentifierType(){return tf},FRONTEGG_SEPARATE_TABS_BY_TENANT:Iv,FeatureFlags:Kn,FeatureFlagsApi:hw,FetchClient:Ln,FronteggApiError:Vr,FronteggContext:XL,get FronteggFrameworks(){return G2},GENERIC_ERROR_CODE:dw,GENERIC_ERROR_MESSAGE:uw,get GetUsersFilterPreset(){return nc},get GroupManagedByEnum(){return on},get GroupRelations(){return nm},get ISubscriptionCancellationPolicy(){return of},get ISubscriptionStatus(){return gr},get InsightCode(){return Aa},LOAD_AUTHORIZATION_FF:e5,get MFAStrategyEnum(){return tc},get MachineToMachineAuthStrategy(){return On},get NotEntitledJustification(){return Q2},get PaginationOrderEnum(){return Xg},get PasswordRecoveryStrategyEnum(){return nf},get PaymentMethodType(){return sf},get PermissionAssignmentTypeEnum(){return At},get ProviderType(){return $c},get RecommendationActionKey(){return X2},get RecommendationCode(){return af},get RecommendationSeverity(){return lf},get RequestSource(){return Qg},get RestrictionType(){return xt},get ScimConnectionSource(){return Y2},get SecondaryAuthStrategy(){return em},get SecurityCategory(){return Ci},get SignUpStrategyEnum(){return ec},get SocialLoginProviders(){return Jg},get SortByEnum(){return rm},get SubAccountAccessTypeEnum(){return tm},get TenantSortByEnum(){return K2},get TenantType(){return q2},get UserManagedByEnum(){return W2},get WebAuthnDeviceType(){return rf},api:w5,createApiClient:qf,default:WZ,fetch:JL,fronteggAuthApiRoutesRegex:FZ,fronteggEntitlementsV2Url:GZ,fronteggHeaders:Zl,fronteggRefreshTokenUrl:$Z,fronteggSilentRefreshTokenUrl:jZ,fronteggTenantsUrl:BZ,fronteggTenantsV3Url:zZ,fronteggUsersUrl:VZ,getCurrentUserTenantsFunction:Zg,getTabTenantFromSessionStorage:pa,providersArray:HZ,removeTabTenantFromSessionStorage:H2,setTabTenantInSessionStorage:gw},Symbol.toStringTag,{value:"Module"}));var KZ=function(t){return qZ(t)&&!YZ(t)};function qZ(e){return!!e&&typeof e=="object"}function YZ(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||JZ(e)}var QZ=typeof Symbol=="function"&&Symbol.for,XZ=QZ?Symbol.for("react.element"):60103;function JZ(e){return e.$$typeof===XZ}function ZZ(e){return Array.isArray(e)?[]:{}}function cf(e,t){return t.clone!==!1&&t.isMergeableObject(e)?jc(ZZ(e),e,t):e}function eee(e,t,n){return e.concat(t).map(function(r){return cf(r,n)})}function tee(e,t){if(!t.customMerge)return jc;var n=t.customMerge(e);return typeof n=="function"?n:jc}function nee(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Xx(e){return Object.keys(e).concat(nee(e))}function A5(e,t){try{return t in e}catch{return!1}}function ree(e,t){return A5(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function see(e,t,n){var r={};return n.isMergeableObject(e)&&Xx(e).forEach(function(s){r[s]=cf(e[s],n)}),Xx(t).forEach(function(s){ree(e,s)||(A5(e,s)&&n.isMergeableObject(t[s])?r[s]=tee(s,n)(e[s],t[s],n):r[s]=cf(t[s],n))}),r}function jc(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||eee,n.isMergeableObject=n.isMergeableObject||KZ,n.cloneUnlessOtherwiseSpecified=cf;var r=Array.isArray(t),s=Array.isArray(e),i=r===s;return i?r?n.arrayMerge(e,t,n):see(e,t,n):cf(t,n)}jc.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,s){return jc(r,s,n)},{})};var iee=jc,oee=iee;const ma=Go(oee),Ue=(e,t)=>{const n=ma(e,F({},t));return PJ(F({__isProxy:!0},n))};let Dr;(function(e){e.validate="validate",e.invalid="invalid",e.pending="pending",e.success="success",e.failed="failed"})(Dr||(Dr={}));const C5={step:Dr.validate},aee=e=>Ue(C5,e);/*! 379 * isobject <https://github.com/jonschlinkert/isobject> 380 * 381 * Copyright (c) 2014-2017, Jon Schlinkert. 382 * Released under the MIT License. 383 */var x5=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! 384 * get-value <https://github.com/jonschlinkert/get-value> 385 * 386 * Copyright (c) 2014-2018, Jon Schlinkert. 387 * Released under the MIT License. 388 */const T5=x5;var lee=function(e,t,n){if(T5(n)||(n={default:n}),!Zx(e))return typeof n.default<"u"?n.default:e;typeof t=="number"&&(t=String(t));const r=Array.isArray(t),s=typeof t=="string",i=n.separator||".",o=n.joinChar||(typeof i=="string"?i:".");if(!s&&!r)return e;if(s&&t in e)return Ay(t,e,n)?e[t]:n.default;let a=r?t:cee(t,i,n),l=a.length,c=0;do{let u=a[c];for(typeof u=="number"&&(u=String(u));u&&u.slice(-1)==="\\";)u=Jx([u.slice(0,-1),a[++c]||""],o,n);if(u in e){if(!Ay(u,e,n))return n.default;e=e[u]}else{let d=!1,f=c+1;for(;f<l;)if(u=Jx([u,a[f++]],o,n),d=u in e){if(!Ay(u,e,n))return n.default;e=e[u],c=f-1;break}if(!d)return n.default}}while(++c<l&&Zx(e));return c===l?e:n.default};function Jx(e,t,n){return typeof n.join=="function"?n.join(e):e[0]+t+e[1]}function cee(e,t,n){return typeof n.split=="function"?n.split(e):e.split(t)}
388function Ay(e,t,n){return typeof n.isValid=="function"?n.isValid(e,t):!0}function Zx(e){return T5(e)||Array.isArray(e)||typeof e=="function"}const P5=Go(lee);/*! 389 * is-primitive <https://github.com/jonschlinkert/is-primitive> 390 * 391 * Copyright (c) 2014-present, Jon Schlinkert. 392 * Released under the MIT License. 393 */var uee=function(t){return typeof t=="object"?t===null:typeof t!="function"};/*! 394 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 395 * 396 * Copyright (c) 2014-2017, Jon Schlinkert. 397 * Released under the MIT License. 398 */var dee=x5;function eT(e){return dee(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var fee=function(t){var n,r;return!(eT(t)===!1||(n=t.constructor,typeof n!="function")||(r=n.prototype,eT(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*! 399 * set-value <https://github.com/jonschlinkert/set-value> 400 * 401 * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert). 402 * Released under the MIT License. 403 */const{deleteProperty:hee}=Reflect,pee=uee,tT=fee,nT=e=>typeof e=="object"&&e!==null||typeof e=="function",gee=e=>e==="__proto__"||e==="constructor"||e==="prototype",Sw=e=>{if(!pee(e))throw new TypeError("Object keys must be strings or symbols");if(gee(e))throw new Error(`Cannot set unsafe key: "${e}"`)},mee=e=>Array.isArray(e)?e.flat().map(String).join(","):e,vee=(e,t)=>{if(typeof e!="string"||!t)return e;let n=e+";";return t.arrays!==void 0&&(n+=`arrays=${t.arrays};`),t.separator!==void 0&&(n+=`separator=${t.separator};`),t.split!==void 0&&(n+=`split=${t.split};`),t.merge!==void 0&&(n+=`merge=${t.merge};`),t.preservePaths!==void 0&&(n+=`preservePaths=${t.preservePaths};`),n},yee=(e,t,n)=>{const r=mee(t?vee(e,t):e);Sw(r);const s=Xa.cache.get(r)||n();return Xa.cache.set(r,s),s},See=(e,t={})=>{const n=t.separator||".",r=n==="/"?!1:t.preservePaths;if(typeof e=="string"&&r!==!1&&/\//.test(e))return[e];const s=[];let i="";const o=a=>{let l;a.trim()!==""&&Number.isInteger(l=Number(a))?s.push(l):s.push(a)};for(let a=0;a<e.length;a++){const l=e[a];if(l==="\\"){i+=e[++a];continue}if(l===n){o(i),i="";continue}i+=l}return i&&o(i),s},R5=(e,t)=>t&&typeof t.split=="function"?t.split(e):typeof e=="symbol"?[e]:Array.isArray(e)?e:yee(e,t,()=>See(e,t)),bee=(e,t,n,r)=>{if(Sw(t),n===void 0)hee(e,t);else if(r&&r.merge){const s=r.merge==="function"?r.merge:Object.assign;
403s&&tT(e[t])&&tT(n)?e[t]=s(e[t],n):e[t]=n}else e[t]=n;return e},Xa=(e,t,n,r)=>{if(!t||!nT(e))return e;const s=R5(t,r);let i=e;for(let o=0;o<s.length;o++){const a=s[o],l=s[o+1];if(Sw(a),l===void 0){bee(i,a,n,r);break}if(typeof l=="number"&&!Array.isArray(i[a])){i=i[a]=[];continue}nT(i[a])||(i[a]={}),i=i[a]}return e};Xa.split=R5;Xa.cache=new Map;Xa.clear=()=>{Xa.cache=new Map};var _ee=Xa;const J2=Go(_ee),bw="http://schemas.openid.net/pape/policies/2007/06/multi-factor",k5="mfa",O5=["otp","sms","hwk"],xi="SHOULD_STEP_UP",_w="maxAge";let Ye;(function(e){e.preLogin="preLogin",e.magicLinkPreLoginSuccess="magicLinkPreLoginSuccess",e.loginWithSmsOtc="loginWithSmsOtc",e.loginWithQuickSmsOtc="loginWithQuickSmsOtc",e.loginWithOtc="loginWithOtc",e.loginWithPassword="loginWithPassword",e.loginWithTwoFactor="loginWithTwoFactor",e.redirectToSSO="redirectToSSO",e.loginWithSSOFailed="loginWithSSOFailed",e.success="success",e.forceTwoFactor="forceTwoFactor",e.recoverTwoFactor="recoverTwoFactor",e.promptPasskeys="promptPasskeys",e.breachedPassword="breachedPassword",e.breachedPasswordSuccess="breachedPasswordSuccess",e.passwordRotationExpired="passwordRotationExpired",e.passwordRotationNotification="passwordRotationNotification",e.magicLinkPostLoginSuccess="magicLinkPostLoginSuccess"})(Ye||(Ye={}));let zn;(function(e){e.Login="login",e.RegisterQuickLogin="registerQuickLogin"})(zn||(zn={}));let Z2;(function(e){e.Internal="internal",e.UsbKey="usb-key",e.Android="android",e.Sms="sms"})(Z2||(Z2={}));let e1;(function(e){e["social-login"]="social-login",e["custom-social-login"]="custom-social-login",e.direct="direct",e.signup="signup"})(e1||(e1={}));const I5={[at.Code]:Ye.loginWithOtc,[at.EmailAndPassword]:Ye.loginWithPassword,[at.MagicLink]:Ye.magicLinkPreLoginSuccess,[at.SmsCode]:Ye.loginWithSmsOtc,[at.UsernameAndPassword]:Ye.loginWithPassword,[at.UsernameAndMagicLink]:Ye.magicLinkPreLoginSuccess,[at.UsernameAndCode]:Ye.loginWithOtc,[at.UsernameAndSms]:Ye.loginWithSmsOtc},ww={authenticatedUrl:"/",loginUrl:"/account/login",stepUpUrl:"/account/step-up",logoutUrl:"/account/logout",activateUrl:"/account/activate",impersonationUrl:"/account/impersonate",acceptInvitationUrl:"/account/invitation/accept",forgetPasswordUrl:"/account/forget-password",resetPhoneNumberUrl:"/account/reset-phone-number",resetPasswordUrl:"/account/reset-password",socialLoginCallbackUrl:"/account/social/success",signUpUrl:"/account/sign-up",oidcRedirectUrl:"/account/oidc/callback",samlCallbackUrl:"/account/saml/callback",magicLinkCallbackUrl:"/account/login/magic-link",hostedLoginRedirectUrl:"/oauth/callback",openAppUrl:"/account/redirect",unlockAccountUrl:"/account/unlock",activateWithOTCUrl:"/account/activate/code",acceptInvitationWithOTCUrl:"/account/invitation/code",approvalFlowUrl:"/account/approval-flow",mfaMobileAuthenticator:"/account/mfa-mobile-authenticator"},Sd="FRONTEGG_AFTER_AUTH_REDIRECT_URL",t1="HOSTED_LOGIN_VERIFIER_KEY",br={retryCount:3},he=(e=500)=>new Promise(t=>{setTimeout(t,e)}),sm=async(e,t,n,r)=>{let s=0;for(;s<t-1;)try{const i=await e();if(r&&i===null){if(s++,s>=t)return i;await new Promise(o=>setTimeout(o,n))}else return i}catch(i){if(s++,s>=t)throw i;await new Promise(o=>setTimeout(o,n))}return await e()},Oe=async(e,t)=>t?sm(e,t.retryCount,t.delay||500,t.shouldRetryWhenNull):e(),mi=e=>F({},e,{retryConfig:br}),Ew=e=>(e==null?void 0:e.traceId)||void 0;function Aw(e,t){const n=F({},e);return t.forEach(r=>{delete n[r]}),n}function wee(e){const t=typeof e;return(e==null?void 0:e.constructor)==={}.constructor||t==="undefined"||e===null||t==="boolean"||t==="number"||t==="string"||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof File||e instanceof FileList||e instanceof ArrayBuffer||e instanceof ImageData||e instanceof ImageBitmap||e instanceof Array||e instanceof Map||e instanceof Set}function Cw(e){return e==null?void 0:wee(e)&&e.__isProxy!==void 0}const N5=e=>JSON.parse(JSON.stringify(e)),Ne=(e,t,n)=>{const r=N5(n),s=P5(e,t);for(const i in s)i!=="__isProxy"&&(i in r?J2(e,[...t,i],r[i]):J2(e,[...t,i],void 0))},xw=e=>!!(e!=null&&e.statusCode),L5=e=>e instanceof Error?!0:(e==null?void 0:e.message)&&(e==null?void 0:e.stack)&&(e==null?void 0:e.name)==="Error",W=(e,t)=>e?xw(e)?(console.error(e.message),e):(L5(e)?console.error(e.message):typeof e=="string"&&console.error(e),t??new Vr(uw,500,null,dw)):t,jl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",rd=new Uint8Array(256);for(let e=0;e<jl.length;e++)rd[jl.charCodeAt(e)]=e;const D5=e=>{const t=new Uint8Array(e),n=t.length;let r,s="";for(r=0;r<n;r+=3)s+=jl[t[r]>>2],s+=jl[(t[r]&3)<<4|t[r+1]>>4],s+=jl[(t[r+1]&15)<<2|t[r+2]>>6],s+=jl[t[r+2]&63];return n%3===2?s=s.substring(0,s.length-1):n%3===1&&(s=s.substring(0,s.length-2)),s},Gn=e=>{const t=e.length*.75,n=e.length;let r,s=0,i,o,a,l;const c=new Uint8Array(t);for(r=0;r<n;r+=4)i=rd[e.charCodeAt(r)],o=rd[e.charCodeAt(r+1)],a=rd[e.charCodeAt(r+2)],l=rd[e.charCodeAt(r+3)],c[s++]=i<<2|o>>4,c[s++]=(o&15)<<4|a>>2,c[s++]=(a&3)<<6|l&63;return c.buffer};function M5(e,t="file"){const n=(l,c)=>{const d=atob(l),f=[];for(let g=0;g<d.length;g+=512){const h=d.slice(g,g+512),p=new Array(h.length);for(let v=0;v<h.length;
403v++)p[v]=h.charCodeAt(v);f.push(new Uint8Array(p))}return new Blob(f,{type:c})},r=e.match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/);if(r==null)return null;const s=`image/${r[1]}`,i=r[2],o=n(i,s),a=new FormData;return a.append(t,new File([o],t,{type:s})),a}const Ii=e=>{if(e instanceof Array){const t=[];for(const n of e)t.push(Ii(n));return t}else{if(e instanceof ArrayBuffer)return D5(e);if(e instanceof Object){const t={};for(const n in e)t[n]=Ii(e[n]);return t}}return e},uf=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsText(e),r.onload=()=>t(r.result),r.onerror=n});/** 404 * 405 * THIS IS CUSTOM VERSION OF JS-SHA256 that will be used only 406 * on non-secure domain due to the native `crypto.subtle.digest` 407 * isn't accessible from non-secure domains. 408 * 409 * NOTE: Changes from 0.9.0: 410 * - Remove any usage of eval scripts 411 * - Remove support for UMD and AMD exports 412 * - Remove support for CommonJS 413 * - Make it typescript 414 * 415 * [js-sha256]{@link https://github.com/emn178/js-sha256} 416 * 417 * @version 0.9.0 418 * @author Chen, Yi-Cyuan [[email protected]] 419 * @copyright Chen, Yi-Cyuan 2014-2017 420 * @license MIT 421 */const rc="input is invalid type",df=typeof ArrayBuffer<"u",Re="0123456789abcdef".split(""),Eee=[-2147483648,8388608,32768,128],es=[24,16,8,0],tp=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],im=["hex","array","digest","arrayBuffer"],sn=[];Array.isArray||(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"});df&&!ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return typeof e=="object"&&e.buffer&&e.buffer.constructor===ArrayBuffer});const rT=function(e){return function(t){const r=new Si(!0).update(t);return r==null?void 0:r[e]()}},Aee=function(){const e=rT("hex");e.create=function(){return new Si},e.update=function(t){return e.create().update(t)};for(let t=0;t<im.length;++t){const n=im[t];e[n]=rT(n)}return e},sT=function(e){return function(t,n){const s=new U5(t,!0).update(n);return s==null?void 0:s[e]()}},Cee=function(){const e=sT("hex");e.create=function(t){return new U5(t)},e.update=function(t,n){return e.create(t).update(n)};for(let t=0;t<im.length;++t){const n=im[t];e[n]=sT(n)}return e};class Si{constructor(t=!1){this.blocks=void 0,this.h0=void 0,this.h1=void 0,this.h2=void 0,this.h3=void 0,this.h4=void 0,this.h5=void 0,this.h6=void 0,this.h7=void 0,this.block=void 0,this.start=void 0,this.bytes=void 0,this.hBytes=void 0,this.finalized=void 0,this.hashed=void 0,this.first=void 0,this.lastByteIndex=void 0,this.sharedMemory=!1,this.toString=()=>this.hex(),this.array=()=>Si.prototype.digest(),t?(sn[0]=sn[16]=sn[1]=sn[2]=sn[3]=sn[4]=sn[5]=sn[6]=sn[7]=sn[8]=sn[9]=sn[10]=sn[11]=sn[12]=sn[13]=sn[14]=sn[15]=0,this.blocks=sn):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.sharedMemory=t}update(t){if(this.finalized)return;let n;const r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(rc);if(df&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!df||!ArrayBuffer.isView(t)))throw new Error(rc)}else throw new Error(rc);n=!0}let s,i=0,o;const a=t.length,l=this.blocks;for(;i<a;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),n)for(o=this.start;i<a&&o<64;++i)l[o>>2]|=t[i]<<es[o++&3];else for(o=this.start;i<a&&o<64;++i)s=t.charCodeAt(i),s<128?l[o>>2]|=s<<es[o++&3]:s<2048?(l[o>>2]|=(192|s>>6)<<es[o++&3],l[o>>2]|=(128|s&63)<<es[o++&3]):s<55296||s>=57344?(l[o>>2]|=(224|s>>12)<<es[o++&3],l[o>>2]|=(128|s>>6&63)<<es[o++&3],l[o>>
4212]|=(128|s&63)<<es[o++&3]):(s=65536+((s&1023)<<10|t.charCodeAt(++i)&1023),l[o>>2]|=(240|s>>18)<<es[o++&3],l[o>>2]|=(128|s>>12&63)<<es[o++&3],l[o>>2]|=(128|s>>6&63)<<es[o++&3],l[o>>2]|=(128|s&63)<<es[o++&3]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=l[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}finalize(){if(this.finalized)return;this.finalized=!0;const t=this.blocks,n=this.lastByteIndex;t[16]=this.block,t[n>>2]|=Eee[n&3],this.block=t[16],n>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}hash(){let t=this.h0,n=this.h1,r=this.h2,s=this.h3,i=this.h4,o=this.h5,a=this.h6,l=this.h7,c,u,d,f,g,h,p,v,m,S,b;const w=this.blocks;for(c=16;c<64;++c)g=w[c-15],u=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=w[c-2],d=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,w[c]=w[c-16]+u+w[c-7]+d<<0;for(b=n&r,c=0;c<64;c+=4)this.first?(v=704751109,g=w[0]-210244248,l=g-1521486534<<0,s=g+143694565<<0,this.first=!1):(u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),d=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),v=t&n,f=v^t&r^b,p=i&o^~i&a,g=l+d+p+tp[c]+w[c],h=u+f,l=s+g<<0,s=g+h<<0),u=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),d=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),m=s&t,f=m^s&n^v,p=l&i^~l&o,g=a+d+p+tp[c+1]+w[c+1],h=u+f,a=r+g<<0,r=g+h<<0,u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),S=r&s,f=S^r&t^m,p=a&l^~a&i,g=o+d+p+tp[c+2]+w[c+2],h=u+f,o=n+g<<0,n=g+h<<0,u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),b=n&r,f=b^n&s^S,p=o&a^~o&l,g=i+d+p+tp[c+3]+w[c+3],h=u+f,i=t+g<<0,t=g+h<<0;this.h0=this.h0+t<<0,this.h1=this.h1+n<<0,this.h2=this.h2+r<<0,this.h3=this.h3+s<<0,this.h4=this.h4+i<<0,this.h5=this.h5+o<<0,this.h6=this.h6+a<<0,this.h7=this.h7+l<<0}hex(){this.finalize();const t=this.h0,n=this.h1,r=this.h2,s=this.h3,i=this.h4,o=this.h5,a=this.h6,l=this.h7;let c=Re[t>>28&15]+Re[t>>24&15]+Re[t>>20&15]+Re[t>>16&15]+Re[t>>12&15]+Re[t>>8&15]+Re[t>>4&15]+Re[t&15]+Re[n>>28&15]+Re[n>>24&15]+Re[n>>20&15]+Re[n>>16&15]+Re[n>>12&15]+Re[n>>8&15]+Re[n>>4&15]+Re[n&15]+Re[r>>28&15]+Re[r>>24&15]+Re[r>>20&15]+Re[r>>16&15]+Re[r>>12&15]+Re[r>>8&15]+Re[r>>4&15]+Re[r&15]+Re[s>>28&15]+Re[s>>24&15]+Re[s>>20&15]+Re[s>>16&15]+Re[s>>12&15]+Re[s>>8&15]+Re[s>>4&15]+Re[s&15]+Re[i>>28&15]+Re[i>>24&15]+Re[i>>20&15]+Re[i>>16&15]+Re[i>>12&15]+Re[i>>8&15]+Re[i>>4&15]+Re[i&15]+Re[o>>28&15]+Re[o>>24&15]+Re[o>>20&15]+Re[o>>16&15]+Re[o>>12&15]+Re[o>>8&15]+Re[o>>4&15]+Re[o&15]+Re[a>>28&15]+Re[a>>24&15]+Re[a>>20&15]+Re[a>>16&15]+Re[a>>12&15]+Re[a>>8&15]+Re[a>>4&15]+Re[a&15];return c+=Re[l>>28&15]+Re[l>>24&15]+Re[l>>20&15]+Re[l>>16&15]+Re[l>>12&15]+Re[l>>8&15]+Re[l>>4&15]+Re[l&15],c}digest(){this.finalize();const t=this.h0,n=this.h1,r=this.h2,s=this.h3,i=this.h4,o=this.h5,a=this.h6,l=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,r>>24&255,r>>16&255,r>>8&255,r&255,s>>24&255,s>>16&255,s>>8&255,s&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255,a>>24&255,a>>16&255,a>>8&255,a&255];return c.push(l>>24&255,l>>16&255,l>>8&255,l&255),c}arrayBuffer(){this.finalize();const t=new ArrayBuffer(32),n=new DataView(t);return n.setUint32(0,this.h0),n.setUint32(4,this.h1),n.setUint32(8,this.h2),n.setUint32(12,this.h3),n.setUint32(16,this.h4),n.setUint32(20,this.h5),n.setUint32(24,this.h6),n.setUint32(28,this.h7),t}}class U5 extends Si{constructor(t,n=!1){super(n),this.inner=void 0,this.oKeyPad=void 0;let r;const s=typeof t;if(s==="string"){const l=[],c=t.length;let u=0,d;for(r=0;r<c;++r)d=t.charCodeAt(r),d<128?l[u++]=d:d<2048?(l[u++]=192|d>>6,l[u++]=128|d&63):d<55296||d>=57344?(l[u++]=224|d>>12,l[u++]=128|d>>6&63,l[u++]=128|d&63):(d=65536+((d&1023)<<10|t.charCodeAt(++r)&1023),l[u++]=240|d>>18,l[u++]=128|d>>12&63,l[u++]=128|d>>6&63,l[u++]=128|d&63);t=l}else if(s==="object"){if(t===null)throw new Error(rc);if(df&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!df||!ArrayBuffer.isView(t)))throw new Error(rc)}else throw new Error(rc);if(t.length>64){var i;t=(i=new Si(!0).update(t))==null?void 0:i.array()}const o=[],a=[];for(r=0;r<64;++r){const l=t[r]||0;o[r]=92^l,a[r]=54^l}Si.call(this,n),this.update(a),this.oKeyPad=o,this.inner=!0,this.sharedMemory=n}finalize(){if(super.finalize(),this.inner){this.inner=!1;const t=this.array();Si.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Si.prototype.finalize.call(this)}}}const F5=Aee(),xee=Cee();async function $5(e){const t=F5.digest(new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}
421async function j5(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async function V5(e){var t,n;return(t=window.crypto)!=null&&(n=t.subtle)!=null&&n.digest?j5(e):(console.warn("Generating CodeChallenge in non-secure domain:",window.location.origin),$5(e))}function n1(e=16){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}let ln;(function(e){e.SIGNUP_COMPLETED="signup_completed",e.USER_VERIFIED="user_verified",e.LOGIN_COMPLETED="login_completed"})(ln||(ln={}));function Dn(e,t){var n,r;(n=(r=window).onFronteggEvent)==null||n.call(r,e,t)}const B5=(e,t,n)=>{const r=a=>{Object.assign(e.auth.acceptInvitationState,a)};return{setAcceptInvitationState:r,resetAcceptInvitationState:()=>{Ne(e,["auth","acceptInvitationState"],C5)},acceptInvitation:async a=>{if(!a.token||!a.userId){r({error:void 0,step:Dr.invalid});return}try{r({error:void 0,step:Dr.pending}),await t.auth.acceptInvitation(a),r({step:Dr.success})}catch(l){r({step:Dr.failed,error:W(l)})}},acceptInvitationWithOTC:async a=>{if(!a.token||!a.userId||!a.code){r({error:void 0,step:Dr.invalid});return}try{r({error:void 0,step:Dr.pending}),await t.auth.acceptInvitationWithOTC(a),r({step:Dr.success})}catch(l){r({step:Dr.validate,error:W(l)})}}}},z5={loading:!1},Tee=e=>Ue(z5,e),Pee=["activeTenant","tenants"],G5=(e,t,n)=>{const r=l=>{Object.assign(e.auth.accountSettingsState,l)},s=()=>{Ne(e,["auth","accountSettingsState"],z5)},i=({newSettingValues:l})=>{const c=e.auth.tenantsState,{activeTenant:u,tenants:d}=c,f=re(c,Pee),g=d.map(p=>p.id!==(u==null?void 0:u.id)?p:F({},p,l)),h=F({},u,l);n.setTenantsState(F({},f,{tenants:g,activeTenant:h}))};return{setAccountSettingsState:r,resetAccountSettingsState:s,saveAccountSettings:async l=>{try{var c;r({loading:!0});const{address:d,timezone:f,dateFormat:g,timeFormat:h,currency:p,logo:v}=e.auth.accountSettingsState,m=await t.accountSettings.updateSettings(F({address:d,timezone:f,dateFormat:g,timeFormat:h,currency:p,logo:v},l));i({newSettingValues:m}),r(F({},m,{loading:!1})),(c=l.callback)==null||c.call(l,m)}catch(d){var u;r({loading:!1,error:W(d)}),(u=l.callback)==null||u.call(l,null,d)}},loadAccountSettings:async l=>{r({loading:!(l!=null&&l.silentLoading),error:null});try{const c=await Oe(()=>t.accountSettings.getSettings(),l==null?void 0:l.retryConfig);r(F({},c,{loading:!1}))}catch(c){r({loading:!1,error:W(c)})}}}};let bi;(function(e){e.activating="activating",e.success="success",e.resend="resend",e.activatingForm="activatingForm"})(bi||(bi={}));const H5={step:bi.activating,loading:!1,submitting:!1,resentEmail:!1,activationStrategy:{loading:!1}},Ree=e=>Ue(H5,e);let Mr;(function(e){e.LOAD_FEATURE_FLAGS="LOAD_FEATURE_FLAGS,",e.LOAD_ADMIN_BOX_METADATA="LOAD_ADMIN_BOX_METADATA,",e.LOAD_SSO_PUBLIC_CONFIGURATION="LOAD_SSO_PUBLIC_CONFIGURATION,",e.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY="LOAD_PUBLIC_AUTH_STRATEGIES_POLICY,",e.LOAD_ALLOW_SIGNUPS="LOAD_ALLOW_SIGNUPS,",e.LOAD_CUSTOM_LOGIN_ROUTES="LOAD_CUSTOM_LOGIN_ROUTES",e.LOAD_PASSWORD_CONFIGURATION="LOAD_PASSWORD_CONFIGURATION"})(Mr||(Mr={}));let Vc;(function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORDLESS="PASSWORDLESS",e.ACTIVATION_LINK="ACTIVATION_LINK"})(Vc||(Vc={}));let No;(function(e){e.SOCIAL_LOGIN="SOCIAL_LOGIN",e.PASSWORD="PASSWORD",e.PHONE_NUMBER="PHONE_NUMBER",e.USERNAME="USERNAME"})(No||(No={}));let yn;(function(e){e.profile="profile",e.privacy="privacy",e.personalApiTokens="personalApiTokens",e.account="account",e.users="users",e.groups="groups",e.security="security",e.sso="sso",e.audits="audits",e.webhooks="webhooks",e.apiTokens="apiTokens",e.roles="roles",e.subscriptions="subscription",e.allAccounts="allAccounts"})(yn||(yn={}));const kee={profile:yn.profile,privacy:yn.privacy,personalApiTokens:yn.personalApiTokens,account:yn.account,users:yn.users,groups:yn.groups,security:yn.security,sso:yn.sso,audits:yn.audits,webhooks:yn.webhooks,apiTokens:yn.apiTokens,roles:yn.roles,subscriptions:yn.subscriptions,allAccounts:yn.allAccounts};var Oee=function e(t,n){if(t===n)return!0;
421if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const Iee=Go(Oee);var Tw={},Pw={},Nv={},ou={},Rw={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RuleEvaluationResultEnum=e.TreatmentEnum=e.ConditionLogicEnum=void 0,function(t){t.And="and"}(e.ConditionLogicEnum||(e.ConditionLogicEnum={})),function(t){t.True="true",t.False="false"}(e.TreatmentEnum||(e.TreatmentEnum={})),function(t){t.Treatable="treatable",t.Insufficient="insufficient"}(e.RuleEvaluationResultEnum||(e.RuleEvaluationResultEnum={}))})(Rw);var Lv={},W5={},Dv={},Mv={},K5={},si={},q5={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.OperationEnum=void 0,function(t){t.InList="in_list",t.StartsWith="starts_with",t.EndsWith="ends_with",t.Contains="contains",t.Matches="matches",t.Equal="equal",t.GreaterThan="greater_than",t.GreaterThanEqual="greater_than_equal",t.LesserThan="lower_than",t.LesserThanEqual="lower_than_equal",t.BetweenNumeric="between_numeric",t.Is="is",t.On="on",t.BetweenDate="between_date",t.OnOrAfter="on_or_after",t.OnOrBefore="on_or_before"}(e.OperationEnum||(e.OperationEnum={}))})(q5);(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(q5,e)})(si);var mr={};Object.defineProperty(mr,"__esModule",{value:!0});mr.useMatchesOperation=mr.useInListOperation=mr.useContainsOperation=mr.useEndsWithOperation=mr.useStartsWithOperation=void 0;function Nee(e){return t=>({isValid:e.list.some(n=>t.startsWith(n))})}mr.useStartsWithOperation=Nee;function Lee(e){return t=>({isValid:e.list.some(n=>t.endsWith(n))})}mr.useEndsWithOperation=Lee;function Dee(e){return t=>({isValid:e.list.some(n=>t.includes(n))})}mr.useContainsOperation=Dee;function Mee(e){return t=>({isValid:e.list.includes(t)})}mr.useInListOperation=Mee;function Uee(e){return t=>{let n;try{n=new RegExp(e.string)}catch{return{isValid:!1}}return{isValid:n.test(t)}}}mr.useMatchesOperation=Uee;var Y5={};Object.defineProperty(Y5,"__esModule",{value:!0});(function(e){var t=je&&je.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,l,c)}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=je&&je.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.StringOperationsMapper=void 0;const r=si,s=mr;n(mr,e),n(Y5,e),e.StringOperationsMapper={[r.OperationEnum.StartsWith]:i=>(0,s.useStartsWithOperation)(i),[r.OperationEnum.EndsWith]:i=>(0,s.useEndsWithOperation)(i),[r.OperationEnum.Contains]:i=>(0,s.useContainsOperation)(i),[r.OperationEnum.InList]:i=>(0,s.useInListOperation)(i),[r.OperationEnum.Matches]:i=>(0,s.useMatchesOperation)(i)}})(K5);var kw={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.useBetweenNumericOperation=Hn.useLesserThanEqualOperation=Hn.useLesserThanOperation=Hn.useGreaterThanEqualOperation=Hn.useGreaterThanOperation=Hn.useEqualsOperation=void 0;function Fee(e){return t=>({isValid:t===e.number})}Hn.useEqualsOperation=Fee;function $ee(e){return t=>({isValid:t>e.number})}Hn.useGreaterThanOperation=$ee;function jee(e){return t=>({isValid:t>=e.number})}Hn.useGreaterThanEqualOperation=jee;function Vee(e){return t=>({isValid:t<e.number})}Hn.useLesserThanOperation=Vee;function Bee(e){return t=>({isValid:t<=e.number})}Hn.useLesserThanEqualOperation=Bee;function zee(e){return t=>({isValid:t>=e.start&&t<=e.end})}Hn.useBetweenNumericOperation=zee;var Q5={};
421(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumericSanitizersMapper=e.sanitizeNumericRange=e.sanitizeSingleNumber=void 0;const t=si,n=i=>typeof i=="number",r=i=>{const o=i.number!==void 0&&n(i.number)?{number:i.number}:void 0;return{isSanitized:!!o,sanitizedValue:o}};e.sanitizeSingleNumber=r;const s=i=>{const o=i.start!==void 0&&i.end!==void 0&&n(i.start)&&n(i.end)?{start:i.start,end:i.end}:void 0;return{isSanitized:!!o,sanitizedValue:o}};e.sanitizeNumericRange=s,e.NumericSanitizersMapper={[t.OperationEnum.Equal]:e.sanitizeSingleNumber,[t.OperationEnum.GreaterThan]:e.sanitizeSingleNumber,[t.OperationEnum.GreaterThanEqual]:e.sanitizeSingleNumber,[t.OperationEnum.LesserThan]:e.sanitizeSingleNumber,[t.OperationEnum.LesserThanEqual]:e.sanitizeSingleNumber,[t.OperationEnum.BetweenNumeric]:e.sanitizeNumericRange}})(Q5);var X5={};Object.defineProperty(X5,"__esModule",{value:!0});(function(e){var t=je&&je.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,l,c)}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=je&&je.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.NumericOperationsMapper=void 0;const r=si,s=Hn;e.NumericOperationsMapper={[r.OperationEnum.Equal]:i=>(0,s.useEqualsOperation)(i),[r.OperationEnum.GreaterThan]:i=>(0,s.useGreaterThanOperation)(i),[r.OperationEnum.GreaterThanEqual]:i=>(0,s.useGreaterThanEqualOperation)(i),[r.OperationEnum.LesserThan]:i=>(0,s.useLesserThanOperation)(i),[r.OperationEnum.LesserThanEqual]:i=>(0,s.useLesserThanEqualOperation)(i),[r.OperationEnum.BetweenNumeric]:i=>(0,s.useBetweenNumericOperation)(i)},n(Hn,e),n(Q5,e),n(X5,e)})(kw);var J5={},fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.useDateBetweenOperation=fs.useDateOnOrBeforeOperation=fs.useDateOnOrAfterOperation=fs.useDateOnOperation=void 0;function Gee(e){return t=>({isValid:t.getTime()===e.date.getTime()})}fs.useDateOnOperation=Gee;function Hee(e){return t=>({isValid:t.getTime()>=e.date.getTime()})}fs.useDateOnOrAfterOperation=Hee;function Wee(e){return t=>({isValid:t.getTime()<=e.date.getTime()})}fs.useDateOnOrBeforeOperation=Wee;function Kee(e){return t=>({isValid:t.getTime()>=e.start.getTime()&&t.getTime()<=e.end.getTime()})}fs.useDateBetweenOperation=Kee;var Z5={};Object.defineProperty(Z5,"__esModule",{value:!0});(function(e){var t=je&&je.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,l,c)}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=je&&je.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.DateOperationsMapper=void 0;const r=si,s=fs;n(fs,e),n(Z5,e),e.DateOperationsMapper={[r.OperationEnum.On]:i=>(0,s.useDateOnOperation)(i),[r.OperationEnum.OnOrAfter]:i=>(0,s.useDateOnOrAfterOperation)(i),[r.OperationEnum.OnOrBefore]:i=>(0,s.useDateOnOrBeforeOperation)(i),[r.OperationEnum.BetweenDate]:i=>(0,s.useDateBetweenOperation)(i)}})(J5);var Ow={},ff={};Object.defineProperty(ff,"__esModule",{value:!0});ff.useIsOperation=void 0;function qee(e){return t=>({isValid:t===e.boolean})}ff.useIsOperation=qee;var eD={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanSanitizersMapper=e.singleBooleanSanitizer=void 0;const t=si,n=s=>typeof s=="boolean",r=s=>{const i=s.boolean!==void 0&&n(s.boolean)?{boolean:s.boolean}:void 0;return{isSanitized:!!i,sanitizedValue:i}};e.singleBooleanSanitizer=r,e.BooleanSanitizersMapper={[t.OperationEnum.Is]:e.singleBooleanSanitizer}})(eD);(function(e){var t=je&&je.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,l,c)}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=je&&je.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&t(o,i,a)};
421Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanOperationsMapper=void 0;const r=si,s=ff;n(ff,e),n(eD,e),e.BooleanOperationsMapper={[r.OperationEnum.Is]:i=>(0,s.useIsOperation)(i)}})(Ow);Object.defineProperty(Mv,"__esModule",{value:!0});Mv.useOperation=void 0;const Yee=K5,Qee=kw,Xee=J5,Jee=Ow,Zee={...Yee.StringOperationsMapper,...Qee.NumericOperationsMapper,...Xee.DateOperationsMapper,...Jee.BooleanOperationsMapper};function ete(e,t){const n=Zee[e];return n?n(t):void 0}Mv.useOperation=ete;var Uv={},tD={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringSanitizersMapper=e.sanitizeListString=e.sanitizeSingleString=void 0;const t=si,n=i=>typeof i=="string",r=i=>{const o=i.string!==void 0&&n(i.string)?{string:i.string}:void 0;return{isSanitized:!!o,sanitizedValue:o}};e.sanitizeSingleString=r;const s=i=>{const o=i.list!==void 0&&i.list.every(a=>n(a))?{list:i.list}:void 0;return{isSanitized:!!o,sanitizedValue:o}};e.sanitizeListString=s,e.StringSanitizersMapper={[t.OperationEnum.Matches]:e.sanitizeSingleString,[t.OperationEnum.Contains]:e.sanitizeListString,[t.OperationEnum.StartsWith]:e.sanitizeListString,[t.OperationEnum.EndsWith]:e.sanitizeListString,[t.OperationEnum.InList]:e.sanitizeListString}})(tD);var nD={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}
421),e.DateSanitizersMapper=e.sanitizeDateRange=e.sanitizeSingleDate=e.isValidDate=e.sanitizeDateValue=void 0;const t=si,n=o=>new Date(o);e.sanitizeDateValue=n;const r=o=>o instanceof Date&&!isNaN(o);e.isValidDate=r;const s=o=>{const a=o.date?(0,e.sanitizeDateValue)(o.date):void 0,l=a&&(0,e.isValidDate)(a)?{date:a}:void 0;return{isSanitized:!!l,sanitizedValue:l}};e.sanitizeSingleDate=s;const i=o=>{const a=o.start?(0,e.sanitizeDateValue)(o.start):void 0,l=o.end?(0,e.sanitizeDateValue)(o.end):void 0,c=a&&l&&(0,e.isValidDate)(a)&&(0,e.isValidDate)(l)?{start:a,end:l}:void 0;return{isSanitized:!!c,sanitizedValue:c}};e.sanitizeDateRange=i,e.DateSanitizersMapper={[t.OperationEnum.On]:e.sanitizeSingleDate,[t.OperationEnum.OnOrAfter]:e.sanitizeSingleDate,[t.OperationEnum.OnOrBefore]:e.sanitizeSingleDate,[t.OperationEnum.BetweenDate]:e.sanitizeDateRange}})(nD);Object.defineProperty(Uv,"__esModule",{value:!0});Uv.useSanitizer=void 0;const tte=Ow,nte=tD,rte=nD,ste=kw,ite={...nte.StringSanitizersMapper,...ste.NumericSanitizersMapper,...rte.DateSanitizersMapper,...tte.BooleanSanitizersMapper};function ote(e){return ite[e]}Uv.useSanitizer=ote;Object.defineProperty(Dv,"__esModule",{value:!0});Dv.createConditionEvaluator=void 0;const ate=Mv,lte=Uv;function iT(){return()=>!1}function cte(e){const t=(0,lte.useSanitizer)(e.condition.op);if(!t)return iT();const{isSanitized:n,sanitizedValue:r}=t(e.condition.value);if(!n||r===void 0)return iT();const s=(0,ate.useOperation)(e.condition.op,r);return i=>{const o=e.condition.attribute,a=i[o];if(a===void 0||!s)return!1;const{isValid:l}=s(a);return e.condition.negate?!l:l}}Dv.createConditionEvaluator=cte;var rD={};Object.defineProperty(rD,"__esModule",{value:!0});(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Dv,e),n(rD,e)})(W5);Object.defineProperty(Lv,"__esModule",{value:!0});Lv.createRuleEvaluator=void 0;const oT=Rw,ute=W5;function dte(e){return t=>e.rule.conditions.every(r=>(0,ute.createConditionEvaluator)({condition:r})(t))?oT.RuleEvaluationResultEnum.Treatable:oT.RuleEvaluationResultEnum.Insufficient}Lv.createRuleEvaluator=dte;(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Rw,e),n(Lv,e)})(ou);Object.defineProperty(Nv,"__esModule",{value:!0});Nv.evaluateFeatureFlag=void 0;const aT=ou;function fte(e,t){if(!e.on)return{treatment:e.offTreatment};const n=hte(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}Nv.evaluateFeatureFlag=fte;function hte(e,t){var n;return(n=e.rules)===null||n===void 0?void 0:n.find(r=>(0,aT.createRuleEvaluator)({rule:r})(t)===aT.RuleEvaluationResultEnum.Treatable)}(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Nv,e)})(Pw);var Iw={},Fv={};Object.defineProperty(Fv,"__esModule",{value:!0});Fv.evaluatePlan=void 0;const lT=ou;function pte(e,t){const n=gte(e,t);return n?{treatment:n.treatment}:{treatment:e.defaultTreatment}}Fv.evaluatePlan=pte;function gte(e,t){var n;return(n=e.rules)===null||n===void 0?void 0:n.find(r=>(0,lT.createRuleEvaluator)({rule:r})(t)===lT.RuleEvaluationResultEnum.Treatable)}(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};
421Object.defineProperty(e,"__esModule",{value:!0}),n(Fv,e)})(Iw);var sD={},iD={},Yf={},na={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NO_EXPIRATION_TIME=e.NotEntitledJustification=void 0,function(t){t.MISSING_FEATURE="MISSING_FEATURE",t.MISSING_PERMISSION="MISSING_PERMISSION",t.BUNDLE_EXPIRED="BUNDLE_EXPIRED"}(e.NotEntitledJustification||(e.NotEntitledJustification={})),e.NO_EXPIRATION_TIME=-1})(na);var $v={},Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.createPermissionCheckRegex=Ja.checkPermission=void 0;function mte(e,t){return Object.keys(e).some(n=>oD(n).test(t))}Ja.checkPermission=mte;function oD(e){return new RegExp("^"+e.replace(/\./g,"\\.").replace(/\*/g,".*")+"$","gs")}Ja.createPermissionCheckRegex=oD;var qs={},jv={};Object.defineProperty(jv,"__esModule",{value:!0});jv.flatten=void 0;function vte(e,t){t=t||{};const n=(t==null?void 0:t.delimiter)||".",r=t==null?void 0:t.maxDepth,s=(t==null?void 0:t.transformKey)||Ste,i={};function o(a,l,c){c=c||1,Object.keys(a).forEach(function(u){const d=a[u],f=(t==null?void 0:t.safe)&&Array.isArray(d),g=Object.prototype.toString.call(d),h=yte(d),p=g==="[object Object]"||g==="[object Array]",v=l?l+n+s(u):s(u);if(!f&&!h&&p&&Object.keys(d).length&&(!(t!=null&&t.maxDepth)||r&&c<r))return o(d,v,c+1);i[v]=d})}return o(e),i}jv.flatten=vte;function yte(e){return e&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Ste(e){return e}Object.defineProperty(qs,"__esModule",{value:!0});qs.modifyObjectKeysWithPrefix=qs.defaultFronteggAttributesMapper=qs.prepareAttributes=void 0;const bte=jv;function _te(e={},t){const{custom:n={},jwt:r={}}=e,s=(0,bte.flatten)(r),i=t?t(r):aD(r);return{...n,...r1(i,"frontegg."),...r1(s,"jwt.")}}qs.prepareAttributes=_te;function aD(e){return{email:e.email,emailVerified:e.email_verified,tenantId:e.tenantId,userId:e.id}}qs.defaultFronteggAttributesMapper=aD;function r1(e,t){return Object.keys(e).reduce((n,r)=>(n[`${t}${r}`]=e[r],n),{})}qs.modifyObjectKeysWithPrefix=r1;var Bc={};Object.defineProperty(Bc,"__esModule",{value:!0});Bc.shouldContinue=Bc.getResult=void 0;const Cy=na;function wte(e){let t=!1;for(const n of e){if(n.isEntitled)return n;n.justification===Cy.NotEntitledJustification.BUNDLE_EXPIRED&&(t=!0)}return{isEntitled:!1,justification:t?Cy.NotEntitledJustification.BUNDLE_EXPIRED:Cy.NotEntitledJustification.MISSING_FEATURE}}Bc.getResult=wte;function Ete(e){return e.every(({isEntitled:t})=>!t)}Bc.shouldContinue=Ete;(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ja,e),n(qs,e),n(Bc,e)})($v);var Vv={},Bv={};Object.defineProperty(Bv,"__esModule",{value:!0});Bv.directEntitlementEvalutor=void 0;const xy=na;function Ate(e,t,n={}){const r=t.features[e];let s=!1;return r&&r.expireTime!==null&&(s=r.expireTime!==xy.NO_EXPIRATION_TIME&&r.expireTime<Date.now(),!s)?{isEntitled:!0}:{isEntitled:!1,justification:s?xy.NotEntitledJustification.BUNDLE_EXPIRED:xy.NotEntitledJustification.MISSING_FEATURE}}Bv.directEntitlementEvalutor=Ate;var zv={};Object.defineProperty(zv,"__esModule",{value:!0});zv.featureFlagEvaluator=void 0;const Cte=na,xte=Pw,Tte=qs,Pte=ou;function Rte(e,t,n={}){const r=t.features[e];if(r&&r.featureFlag){const s=(0,Tte.prepareAttributes)(n),{treatment:i}=(0,xte.evaluateFeatureFlag)(r.featureFlag,s);if(i===Pte.TreatmentEnum.True)return{isEntitled:!0}}return{isEntitled:!1,justification:Cte.NotEntitledJustification.MISSING_FEATURE}}zv.featureFlagEvaluator=Rte;var Gv={};Object.defineProperty(Gv,"__esModule",{value:!0});Gv.planTargetingRulesEvalutor=void 0;const kte=na,Ote=qs,Ite=ou,Nte=Iw;function Lte(e,t,n={}){const r=t.features[e];if(r&&r.planIds&&r.planIds.length>0){const s=(0,Ote.prepareAttributes)(n),i=t.plans;for(const o of r.planIds){const a=i[o];if(a){const{treatment:l}=(0,Nte.evaluatePlan)(a,s);if(l===Ite.TreatmentEnum.True)return{isEntitled:!0}}}}return{isEntitled:!1,justification:kte.NotEntitledJustification.MISSING_FEATURE}}Gv.planTargetingRulesEvalutor=Lte;
421Object.defineProperty(Vv,"__esModule",{value:!0});Vv.getIsEntitledEvaluators=void 0;const Dte=Bv,Mte=zv,Ute=Gv;function Fte(){return[Dte.directEntitlementEvalutor,Mte.featureFlagEvaluator,Ute.planTargetingRulesEvalutor]}Vv.getIsEntitledEvaluators=Fte;Object.defineProperty(Yf,"__esModule",{value:!0});Yf.evaluateIsEntitledToFeature=void 0;const $te=na,cT=$v,jte=Vv;function Vte(e,t,n={}){if(!t)return{isEntitled:!1,justification:$te.NotEntitledJustification.MISSING_FEATURE};const r=[];for(const s of(0,jte.getIsEntitledEvaluators)())if(r.push(s(e,t,n)),!(0,cT.shouldContinue)(r))break;return(0,cT.getResult)(r)}Yf.evaluateIsEntitledToFeature=Vte;(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Yf,e)})(iD);var lD={},Hv={};Object.defineProperty(Hv,"__esModule",{value:!0});Hv.evaluateIsEntitledToPermissions=void 0;const Bte=Yf,uT=na,dT=$v,zte=Ja;function Gte(e,t,n){if(!t)return{isEntitled:!1,justification:uT.NotEntitledJustification.MISSING_PERMISSION};if(!(0,zte.checkPermission)(t.permissions,e))return{isEntitled:!1,justification:uT.NotEntitledJustification.MISSING_PERMISSION};const s=Hte(e,t);if(!s.length)return{isEntitled:!0};const i=[];for(const o of s)if(i.push((0,Bte.evaluateIsEntitledToFeature)(o,t,n)),!(0,dT.shouldContinue)(i))break;return(0,dT.getResult)(i)}Hv.evaluateIsEntitledToPermissions=Gte;function Hte(e,t){return Object.keys(t.features).filter(n=>t.features[n].linkedPermissions.includes(e))}(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Hv,e)})(lD);(function(e){var t=je&&je.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),n=je&&je.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,r,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(iD,e),n(lD,e),n(na,e),n($v,e)})(sD);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NotEntitledJustification=e.createPermissionCheckRegex=e.checkPermission=e.prepareAttributes=e.evaluateIsEntitledToPermissions=e.evaluateIsEntitledToFeature=e.OperationEnum=e.TreatmentEnum=e.evaluatePlan=e.evaluateFeatureFlag=void 0;var t=Pw;Object.defineProperty(e,"evaluateFeatureFlag",{enumerable:!0,get:function(){return t.evaluateFeatureFlag}});var n=Iw;Object.defineProperty(e,"evaluatePlan",{enumerable:!0,get:function(){return n.evaluatePlan}});var r=ou;Object.defineProperty(e,"TreatmentEnum",{enumerable:!0,get:function(){return r.TreatmentEnum}});var s=si;Object.defineProperty(e,"OperationEnum",{enumerable:!0,get:function(){return s.OperationEnum}});var i=sD;Object.defineProperty(e,"evaluateIsEntitledToFeature",{enumerable:!0,get:function(){return i.evaluateIsEntitledToFeature}}),Object.defineProperty(e,"evaluateIsEntitledToPermissions",{enumerable:!0,get:function(){return i.evaluateIsEntitledToPermissions}}),Object.defineProperty(e,"prepareAttributes",{enumerable:!0,get:function(){return i.prepareAttributes}}),Object.defineProperty(e,"checkPermission",{enumerable:!0,get:function(){return i.checkPermission}}),Object.defineProperty(e,"createPermissionCheckRegex",{enumerable:!0,get:function(){return i.createPermissionCheckRegex}}),Object.defineProperty(e,"NotEntitledJustification",{enumerable:!0,get:function(){return i.NotEntitledJustification}})})(Tw);const Wte="You must first enable entitlements via Frontegg options to use this function",cD=(e="default")=>{if(!de.for(e).shouldLoadEntitlements())throw new Error(Wte)},Wv=(e,t,n,r,s="default")=>(cD(s),Tw.evaluateIsEntitledToPermissions(t,e,n)),Kv=(e,t,n,r,s="default")=>(cD(s),Tw.evaluateIsEntitledToFeature(t,e,n)),Nw=(e,t,n,r,s="default")=>"permissionKey"in t?Wv(e,t.permissionKey,n,r,s):Kv(e,t.featureKey,n,r,s);function Lw(e,t){return Iee(e,t)}let Dt;(function(e){e.verify="verify",e.recoveryCode="recoveryCode",e.authenticatorApp="authenticatorApp",e.smsSetPhoneNumber="smsSetPhoneNumber",e.smsVerifyCode="smsVerifyCode",e.emailVerifyCode="emailVerifyCode",e.noMFAEnrolledStepUp="noMFAEnrolledStepUp"})(Dt||(Dt={}));const Dw=e=>{try{return new URL(e),!0}catch{return!1}},Kte=(e,t)=>
421{const n=new URL(window.location.href),r=new URL(e),s=r.origin===n.origin;return t.includes(r.origin)||s},uD=({authenticatedUrl:e,enforceRedirectToSameSite:t,allowedRedirectOrigins:n,includeQueryParam:r})=>{const s=new URL(window.location.href);let i=e;const o=s.searchParams.get("redirectUrl");return o?!t||!Dw(o)||Kte(o,n)?i=o:console.warn("The redirect url param is not valid, the origin is a different site"):r&&(i+=window.location.search),i},Mw=e=>{const{searchParams:t}=new URL(e),n=t.toString();if(n)return`?${n}`},dD=(e,t=!1)=>{const{pathname:n,href:r}=new URL(e);if(t)return r;const s=Mw(e);return s?n+s:n},qv=e=>{const n=new URLSearchParams(window.location.search).get(e);return n??void 0},Uw="tenantId",fD=e=>{const t=+!!e.webauthn.length,n=+!!e.phones.length,r=+!!e.authenticators.length,s=+!!e.emails.length,i=t+n+r+s;return{numberOfWebAuthnDevices:t,numberOfPhoneDevices:n,numberOfAuthenticators:r,numberOfEmails:s,totalDevices:i}},Fw=e=>{const{numberOfPhoneDevices:t,numberOfAuthenticators:n,numberOfEmails:r,totalDevices:s}=fD(e);if(s===1){if(n)return Dt.authenticatorApp;if(t)return Dt.smsVerifyCode;if(r)return Dt.emailVerifyCode}return Dt.verify},hD=e=>{if(e.length===1){const[t]=e;if(t===tc.AuthenticatorApp)return Dt.authenticatorApp;if(t===tc.SMS)return Dt.smsSetPhoneNumber;if(t===tc.EmailCode)return Dt.emailVerifyCode}return Dt.verify},pD=e=>e==="/oauth/callback";function gD(e){return"email"in e&&typeof e.email=="string"}function mD(e){return"username"in e&&typeof e.username=="string"}const s1=e=>{const t=de.for(e.root.appName).getBasename();return t!=null&&t.endsWith("/")?t.slice(0,-1):t},Yv=e=>e.passwordExpiresIn!==void 0&&e.notificationPeriod!==void 0&&e.passwordExpiresIn<=e.notificationPeriod,Qf=(e,{maxAge:t}={})=>
421{if(!e)return!1;const{amr:n=[],acr:r="",auth_time:s}=e;if(t&&s&&!(Date.now()/1e3-s<=t))return!1;const i=r===bw,o=n.indexOf(k5)!==-1,a=O5.find(l=>n.indexOf(l))!==void 0;return i&&o&&a};function $w(){const e=window.location.pathname+window.location.search;window.localStorage.setItem(Sd,e)}const jw=(e,t,n)=>{$w();const r=new URLSearchParams(window.location.search);n&&r.set(_w,n.toString()),t(`${e}${r?`?${r}`:""}`,{refresh:!1})},qte=["phoneNumber","email","username"],Yte=["authenticatedUrl"],Ns=(e,t)=>{const n=de.for(t);return e.mfaRequired&&e.mfaToken?(n.setAccessToken(null),n.setUser(null),!0):(n.setAccessToken(e.accessToken),n.setUser(e),!1)},Qv=(e,t)=>{const n=de.for(t);return e.resetPasswordToken?(n.setAccessToken(null),!0):(n.setAccessToken(e.accessToken),n.setUser(e),!1)},Vw=(e,t=[])=>Object.entries(e).reduce((n,[r,s])=>typeof s=="object"?[...n,...Vw(s,[...t,r])]:[...n,{type:[...t,r].join("/"),payload:s}],[]),i1=e=>{if(e==="path"){var t;return((t=window)!=null?t:document).location.pathname}else{var n;const r=(((n=window)!=null?n:document).location.hash||"#").substring(1);return r.indexOf("?")!==-1?r.substring(0,r.indexOf("?")):r}},Fp=e=>{const{phoneNumber:t,email:n,username:r}=e,s=re(e,qte);return n!=null&&n.length&&Object.assign(s,{email:n}),t!=null&&t.length&&Object.assign(s,{phoneNumber:t}),r!=null&&r.length&&Object.assign(s,{username:r}),s},Qte=(e,t)=>{const n=F({},ww,t),r=re(n,Yte);return Object.values(r).includes(e)};let Ee;(function(e){e.USERS="USERS",e.STATS="STATS",e.UPDATE_USER="UPDATE_USER",e.DELETE_USER="DELETE_USER",e.RESEND_ACTIVATE_LINK="RESEND_ACTIVATE_LINK",e.RESEND_INVITATION_LINK="RESEND_INVITATION_LINK",e.ROLES_AND_PERMISSIONS="ROLES_AND_PERMISSIONS",e.CREATE_TOKEN_LINK="CREATE_TOKEN_LINK",e.GET_TOKEN_LINK="GET_TOKEN_LINK",e.UPDATE_TOKEN_LINK="UPDATE_TOKEN_LINK",e.DELETE_TOKEN_LINK="DELETE_TOKEN_LINK",e.CONFIG_TOKEN_LINK="CONFIG_TOKEN_LINK",e.CONFIG_TEMPORARY_USERS="CONFIG_TEMPORARY_USERS",e.UPDATE_USER_EXPIRATION_TIME="UPDATE_USER_EXPIRATION_TIME"})(Ee||(Ee={}));const Xte=["user"],Jte=["callback","events"],Zte=["user"],ene=["callback","events"],tne=["user"],nne=["callback"],rne=["callback"],vD=(e,t,n)=>{const r=n,s=g=>{Object.assign(e.auth.activateAccountState,g)},i=()=>{Ne(e,["auth","activateAccountState"],H5)},o=g=>{Object.assign(e.auth.activateAccountState.activationStrategy,g)},a=async g=>{const{userId:h,token:p}=g;s({loading:!0,step:bi.activating});try{e.auth.isAuthenticated&&await r.silentLogout();const m=await t.auth.getActivateAccountStrategy({userId:h,token:p});o({strategy:m,loading:!1,error:void 0}),m.shouldSetPassword&&s({loading:!1,step:bi.activatingForm})}catch(v){s({loading:!1,error:W(v)})}},l=async({loginResponse:g,events:h,onRedirectTo:p,routes:v})=>{const{user:m}=g,S=re(g,Xte);if(m.redirectLocation){window.location.href=m.redirectLocation;return}if(Ns(m,e.root.appName)){s({step:bi.success});const C=await r.getMfaRequiredState(m);r.setAuthState(C),await he(1e3),p(v.loginUrl,{preserveQueryParams:!0})}else{var b,w,A;s({step:bi.success});const C={email:m.email,origin:Vc.ACTIVATION_LINK,id:m.id,tenantId:m.tenantId,name:m.name,createdAt:(b=m==null?void 0:m.createdAt)!=null?b:new Date};h==null||(w=h.userVerified)==null||w.call(h,C),Dn(ln.USER_VERIFIED,C);const E={tenantId:m.tenantId,userId:m.id,authenticationType:"activation_link",createdAt:(A=m==null?void 0:m.createdAt)!=null?A:new Date,email:m.email,name:m.name};Dn(ln.LOGIN_COMPLETED,E),r.afterAuthenticationStateUpdate(F({user:m},S),{isAuthenticated:!0}),await he(5e3),await r.afterAuthNavigation(),i()}};return{setActivateState:s,resetActivateState:i,setActivateStrategyState:o,activateAccount:async g=>{const{callback:h,events:p}=g,v=re(g,Jte);s({loading:!0,submitting:!0});try{const m=de.for(e.root.appName).onRedirectTo,S=e.auth.routes,b=await t.auth.activateAccountV2(v),{user:w}=b,A=re(b,Zte);s({submitting:!1}),await l({loginResponse:F({user:w},A),events:p,onRedirectTo:m,routes:S}),h==null||h(!0)}catch(m){s({loading:!1,error:W(m)})}},preActivateAccount:a,getActivateAccountStrategy:async g=>{const{callback:h}=g,p=re(g,nne);o({loading:!0});try{const v=await t.auth.getActivateAccountStrategy(p);o({strategy:v,loading:!1,error:void 0}),h==null||h(v)}catch(v){o({loading:!1,error:W(v)})}}
421,resendActivationEmail:async g=>{const{callback:h}=g,p=re(g,rne);r.setTeamLoader({key:Ee.RESEND_ACTIVATE_LINK,value:p.email}),s({loading:!0});try{await t.auth.resendActivationEmail(p),s({loading:!1,error:void 0,resentEmail:!0}),h==null||h(!0)}catch(v){s({loading:!1,error:W(v)}),h==null||h(null,v)}finally{r.setTeamLoader({key:Ee.RESEND_ACTIVATE_LINK,value:!1})}},activateAccountWithCode:async g=>{const{callback:h,events:p}=g,v=re(g,ene);s({loading:!0,submitting:!0});try{const m=de.for(e.root.appName).onRedirectTo,S=e.auth.routes,b=await t.auth.activateAccountWithOTC(v),{user:w}=b,A=re(b,tne);s({submitting:!1}),await l({loginResponse:F({user:w},A),events:p,onRedirectTo:m,routes:S}),h==null||h(!0)}catch(m){s({submitting:!1,loading:!1,error:W(m),step:bi.activating})}}}},yD={loading:!1,error:void 0,unlockAccountSuccess:!1},sne=e=>Ue(yD,e),SD=(e,t,n)=>{const r=o=>{Object.assign(e.auth.unlockAccountState,o)};return{setUnlockAccountState:r,resetUnlockAccountState:()=>{Ne(e,["auth","activateAccountState"],yD)},unlockAccount:async o=>{const{token:a}=o,l=de.for(e.root.appName).onRedirectTo,c=e.auth.routes;r({loading:!0});try{await t.users.unlockMe({token:a}),r({loading:!1,error:void 0,unlockAccountSuccess:!0}),await he(5e3),l(c.loginUrl)}catch(u){r({loading:!1,error:W(u)})}}}};let zc;(function(e){e.form="form",e.success="success",e.failed="failed"})(zc||(zc={}));const bD={loading:!1,submitting:!1,error:void 0,step:zc.form,executionData:void 0,loadingExecutionData:!1,executionDataError:void 0},ine=e=>Ue(bD,e),one=["callback"],ane=["callback"],_D=(e,t,n)=>{const r=a=>{Object.assign(e.auth.approvalFlowState,a)};return{setApprovalFlowState:r,resetApprovalFlowState:()=>{Ne(e,["auth","approvalFlowState"],bD)},submitApprovalAction:async a=>{const{callback:l}=a,c=re(a,one);r({submitting:!0,error:void 0});try{await t.auth.submitApprovalAction(c),r({submitting:!1,step:zc.success,error:void 0}),l==null||l(!0)}catch(u){r({submitting:!1,step:zc.failed,error:W(u)}),l==null||l(null,u)}},getApprovalExecutionData:async a=>{const{callback:l}=a,c=re(a,ane);r({loadingExecutionData:!0,executionDataError:void 0});try{const u=await t.auth.getApprovalExecutionData(c);r({loadingExecutionData:!1,executionData:u,executionDataError:void 0}),l==null||l(!0)}catch(u){r({loadingExecutionData:!1,executionDataError:W(u)}),l==null||l(null,u)}}}},wD={apiTokenType:null,showAddTokenDialog:!1,createdByUserIdColumn:"show",deleteTokenDialog:{open:!1,clientId:""},successDialog:{open:!1,secret:"",clientId:""},loaders:{},apiTokensDataTenant:[],apiTokensDataUser:[],roles:[],permissions:[],errors:{}},lne=e=>Ue(wD,e);let ut;(function(e){e.LOAD_API_TOKENS="LOAD_API_TOKENS",e.ADD_API_TOKEN="ADD_API_TOKEN",e.DELETE_API_TOKEN="DELETE_API_TOKEN"})(ut||(ut={}));const ED=(e,t,n)=>{const r=h=>{Object.assign(e.auth.apiTokensState,{loaders:F({},e.auth.apiTokensState.loaders,{[h.key]:h.value})})},s=h=>{Object.assign(e.auth.apiTokensState,{errors:F({},e.auth.apiTokensState.errors,{[h.key]:h.value}),loaders:F({},e.auth.apiTokensState.loaders,{[h.key]:!1})})},i=h=>{Object.assign(e.auth.apiTokensState,h)};return{setApiTokensLoader:r,setApiTokensError:s,setApiTokensState:i,resetApiTokensState:()=>{Ne(e,["auth","apiTokensState"],wD)},loadApiTokens:async h=>{h!=null&&h.silentLoading||r({key:ut.LOAD_API_TOKENS,value:!0});try{var p;const[m=[],S=[]]=await Promise.all([t.auth.getUserApiTokensData(),t.auth.getTenantApiTokensData()]);i({apiTokensDataUser:m,apiTokensDataTenant:S}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(p=h.callback)==null||p.call(h,!0)}catch(m){var v;s({key:ut.LOAD_API_TOKENS,value:W(m)}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(v=h.callback)==null||v.call(h,null,m)}},loadUserApiTokens:async h=>{h!=null&&h.silentLoading||r({key:ut.LOAD_API_TOKENS,value:!0});try{var p,v;const[S=[],b]=await Promise.all([Oe(()=>t.auth.getUserApiTokensData(),h==null?void 0:h.retryConfig),Oe(()=>t.auth.getUserAccessTokensData(),h==null?void 0:h.retryConfig)]),C=((p=b.accessTokens)!=null?p:[]).map(E=>F({},E,{type:On.AccessToken})).concat(S.map(E=>F({},E,{type:On.ClientCredentials}))).sort((E,x)=>new Date(x.createdAt)-new Date(E.createdAt));i({apiTokensDataUser:C??[]}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(v=h.callback)==null||v.call(h,!0)}catch(S){var m;s({key:ut.LOAD_API_TOKENS,value:W(S)}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(m=h.callback)==null||m.call(h,null,S)}},loadTenantApiTokens:async h=>{h!=null&&h.silentLoading||r({key:ut.LOAD_API_TOKENS,value:!0});try{var p,v;const[S=[],b]=await Promise.all([Oe(()=>t.auth.getTenantApiTokensData(),h==null?void 0:h.retryConfig),Oe(()=>t.auth.getTenantAccessTokensData(),h==null?void 0:h.retryConfig)]),C=((p=b==null?void 0:b.accessTokens)!=null?p:[]).map(E=>F({},E,{type:On.AccessToken})).concat(S.map(E=>F({},E,{type:On.ClientCredentials}))).sort((E,x)=>new Date(x.createdAt)-new Date(E.createdAt));i({apiTokensDataTenant:C??[]}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(v=h.callback)==null||v.call(h,!0)}catch(S){var m;s({key:ut.LOAD_API_TOKENS,value:W(S)}),r({key:ut.LOAD_API_TOKENS,value:!1}),h==null||(m=h.callback)==null||m.call(h,null,S)}},addTenantApiToken:async h=>{const{description:p,roleIds:v,expires:m,callback:S}=h,b=ut.ADD_API_TOKEN;r({key:b,value:!0});try{const{policy:w}=e.auth.securityPolicyState.publicPolicy,A=(w==null?void 0:w.machineToMachineAuthStrategy)===On.AccessToken;let C,E=null;m&&(E=m*1440),A?C=await t.auth.createTenantAccessToken({description:p,expiresInMinutes:E,roleIds:v}):C=await t.auth.updateTenantApiTokensData({description:p,roleIds:v,expires
421InMinutes:E}),i({showAddTokenDialog:!1}),await he(200);const x=A?On.AccessToken:On.ClientCredentials;e.auth.apiTokensState.apiTokensDataTenant.unshift(F({},C,{type:x})),e.auth.apiTokensState.successDialog={open:!0,secret:C.secret,clientId:A?void 0:C.clientId},S==null||S(null)}catch(w){s({key:b,value:W(w)}),S==null||S(null,w)}finally{r({key:b,value:!1})}},addUserApiToken:async h=>{const{description:p,expires:v,callback:m}=h,S=ut.ADD_API_TOKEN;r({key:S,value:!0});try{const{policy:b}=e.auth.securityPolicyState.publicPolicy,w=(b==null?void 0:b.machineToMachineAuthStrategy)===On.AccessToken;let A,C=null;v&&(C=v*1440),w?A=await t.auth.createUserAccessToken({description:p,expiresInMinutes:C}):A=await t.auth.updateUserApiTokensData({description:p,expiresInMinutes:C}),i({showAddTokenDialog:!1}),await he(200);const E=w?On.AccessToken:On.ClientCredentials;e.auth.apiTokensState.apiTokensDataUser.unshift(F({},A,{type:E})),e.auth.apiTokensState.successDialog={open:!0,secret:A.secret,clientId:w?void 0:A.clientId},m==null||m(null)}catch(b){s({key:S,value:W(b)}),m==null||m(null,b)}finally{r({key:S,value:!1})}},deleteUserApiToken:async h=>
421{const p=ut.DELETE_API_TOKEN;r({key:p,value:!0});try{const v=e.auth.apiTokensState.apiTokensDataUser;v.some(S=>S.id===h)?(await t.auth.deleteUserAccessToken({id:h}),i({apiTokensDataUser:v.filter(S=>S.id!==h),deleteTokenDialog:{open:!1,id:h}})):(await t.auth.deleteUserApiToken({tokenId:h}),i({apiTokensDataUser:v.filter(S=>S.clientId!==h),deleteTokenDialog:{open:!1,clientId:h}}))}catch(v){s({key:p,value:W(v)})}finally{r({key:p,value:!1})}},deleteTenantApiToken:async h=>{const p=ut.DELETE_API_TOKEN;r({key:p,value:!0});try{const v=e.auth.apiTokensState.apiTokensDataTenant;v.some(S=>S.id===h)?(await t.auth.deleteTenantAccessToken({id:h}),i({apiTokensDataTenant:v.filter(S=>S.id!==h),deleteTokenDialog:{open:!1,id:h}})):(await t.auth.deleteTenantApiToken({tokenId:h}),i({apiTokensDataTenant:v.filter(S=>S.clientId!==h),deleteTokenDialog:{open:!1,id:h}}))}catch(v){s({key:p,value:W(v)})}finally{r({key:p,value:!1})}}}},AD={loading:!0,fetching:!0,error:null,userApplications:[],accountApplications:[],combinedUserApplications:[]},cne=e=>Ue(AD,e),une=e=>{var t;return(t=e.map(({appIds:n})=>n).reduce((n,r)=>(r==null||r.forEach(s=>{n&&!n.includes(s)&&n.push(s)}),n),[]))!=null?t:[]},dne=(e,t)=>{if(!e&&!t)return[];const n=new Set((e==null?void 0:e.map(o=>o.id))||[]),s=((t==null?void 0:t.filter(o=>o.tenantApplicationAccessType===bo.FREE_ACCESS))||[]).filter(o=>!n.has(o.id));return[...e||[],...s]},CD=(e,t,n)=>{const r=n,s=p=>{Object.assign(e.auth.applicationsState,p)},i=()=>{Ne(e,["auth","applicationsState"],AD)},o=()=>{const{userApplications:p,accountApplications:v}=e.auth.applicationsState,m=dne(p,v);s({combinedUserApplications:m})},a=async p=>{s({loading:!0,fetching:!0});try{var v,m;const S=(v=(m=e.auth.user)==null?void 0:m.id)!=null?v:"",b=p==null?void 0:p.retryConfig,w=await Oe(()=>t.applications.getUserApplicationsId({userId:S}),b),A=await Oe(()=>t.applications.getApplicationsData({appIds:w}),b);s({userApplications:A,fetching:!1,loading:!1}),o()}catch(S){s({loading:!1,fetching:!1,error:W(S)})}},l=async p=>{const v=p==null?void 0:p.retryConfig;s({loading:!0,fetching:!0});try{const m=await Oe(()=>t.applications.getTenantsApplicationsV2(),v),S=[...new Set(m.flatMap(E=>E.assignments.map(x=>x.appId)))],b=await Oe(()=>t.applications.getApplicationsData({appIds:S}),v),w=await Oe(()=>t.applications.getUsersOfApplications({appIds:S}),v),A=new Map;m.forEach(E=>{E.assignments.forEach(x=>{A.set(x.appId,x.accessType)})});const C=b.map(E=>{var x;return F({},E,{userIds:(x=w.find(R=>R.appId===E.id))==null?void 0:x.userIds,tenantApplicationAccessType:A.get(E.id)})});s({accountApplications:C,fetching:!1,loading:!1}),o()}catch(m){s({loading:!1,fetching:!1,error:W(m)})}},c=async({userIds:p,retryConfig:v})=>{try{const[m,S]=await Promise.all([Oe(()=>t.applications.getUsersApplicationsId({userIds:p}),v),Oe(()=>t.applications.getTenantsApplicationsV2(),v)]),b=S.flatMap(E=>E.assignments).filter(E=>E.accessType===bo.FREE_ACCESS).map(E=>E.appId),w=une(m),A=[...new Set([...w,...b])];let C=new Map;if(A.length>0){const E=await Oe(()=>t.applications.getApplicationsData({appIds:A}),v);C=new Map(E.map(x=>[x.id,x]))}return p.reduce((E,x)=>{var R,T;const P=[],I=new Set((R=(T=m.find(U=>U.userId===x))==null?void 0:T.appIds)!=null?R:[]);
421return C.forEach((U,L)=>{(I.has(L)||U.accessType===bo.FREE_ACCESS||b.includes(L))&&P.push(U)}),E[x]=P,E},{})}catch(m){s({error:W(m)})}},u="Assignment action failed. Try again or contact support.";return{setApplicationsState:s,resetApplicationsState:i,loadUserApplications:a,loadAccountApplications:l,loadMultipleUsersApplications:c,assignUserToApps:async p=>{const{userId:v,appIds:m,callback:S}=p;try{var b,w,A,C,E,x,R,T,P;const I=(b=(w=e.auth)==null||(A=w.user)==null?void 0:A.tenantId)!=null?b:"";await t.applications.assignUserToApplications({userId:v,appIds:m,tenantId:I});const U=(C=e.auth)==null||(E=C.applicationsState)==null?void 0:E.accountApplications,L=(x=(R=e.auth)==null||(T=R.teamState)==null?void 0:T.users)!=null?x:[],z=(P=U==null?void 0:U.filter(O=>m.includes(O.id)))!=null?P:[];z!=null&&z.length&&n.setTeamState({users:L.map(O=>{var j;return O.id===v?F({},O,{applications:[...(j=O.applications)!=null?j:[],...z]}):O})}),S==null||S(!0)}catch(I){s({error:W(I,u)}),S==null||S(!1)}},unassignUserFromApps:async p=>{const{userId:v,appIds:m,callback:S}=p;try{var b,w,A,C,E,x,R;const T=(b=(w=e.auth)==null||(A=w.user)==null?void 0:A.tenantId)!=null?b:"";await t.applications.unassignUserFromApplications({userId:v,appIds:m,tenantId:T});const P=(C=(E=e.auth)==null||(x=E.teamState)==null?void 0:x.users)!=null?C:[],I=(R=P.find(U=>U.id===v))==null?void 0:R.applications;I!=null&&I.length&&m.length&&n.setTeamState({users:P.map(U=>U.id===v?F({},U,{applications:I.filter(L=>!m.includes(L.id))}):U)}),S==null||S(!0)}catch(T){s({error:W(T,u)}),S==null||S(!1)}},assignNewUserToApps:async({appIds:p,user:v})=>{var m,S,b;const[w]=await r.getFeatureFlags(["multi-apps-admin-portal"]);if(!w)return;const A=(m=e.auth)==null||(S=m.applicationsState)==null?void 0:S.accountApplications,C=(b=A==null?void 0:A.filter(T=>T.accessType===bo.FREE_ACCESS||T.tenantApplicationAccessType===bo.FREE_ACCESS))!=null?b:[];if(p!=null&&p.length){var E,x,R;const T=(E=(x=e.auth)==null||(R=x.user)==null?void 0:R.tenantId)!=null?E:"";return await t.applications.assignUserToApplications({userId:v.id,appIds:p,tenantId:T}),p.map(P=>{var I;return(I=A==null?void 0:A.find(U=>U.id===P))!=null?I:[]}).concat(C)}else return C},mapUsersWithApplicationData:async({shouldLoadApps:p,users:v,retryConfig:m})=>{const[S]=await n.getFeatureFlags(["multi-apps-admin-portal"]);if(!S||!p)return v;const b=v.map(A=>A.id),w=await c({userIds:b,retryConfig:m});return w?v.map(A=>w!=null&&w[A.id]?F({},A,{applications:w[A.id]}):A):v}}},xD={loading:!0,error:null},fne=e=>Ue(xD,e),hne=["callback"],TD=(e,t,n)=>{const r=n,s=u=>{Object.assign(e.auth.customLoginState,u)},i=()=>{Ne(e,["auth","customLoginState"],xD)},o=async()=>{s({loading:!0});try{const u=await t.metadata.getAdminBoxMetadata();s({tenantMetadata:u,loading:!1})}catch(u){s({loading:!1,error:W(u)})}},a=async u=>{const{callback:d}=u,f=re(u,hne);try{s({error:null,saving:!0});const g=Vw(f);if(g.length===0)throw new Error("No changes to update");await t.metadata.updateAdminBoxMetadata({actions:g});const h=await t.metadata.getAdminBoxMetadata();s({tenantMetadata:h,saving:!1}),d==null||d(!0)}catch(g){s({error:W(g,"No changes to update"),saving:!1}),d==null||d(null,g)}},l=async()=>{var u,d,f;if(e.auth.isAuthenticated){var h,p;return(h=(p=e.auth.tenantsState.activeTenant)==null?void 0:p.hasCustomLogin)!=null?h:!1}return!!((u=await((d=de.for(e.root.appName).getContext())==null||(f=d.tenantResolver)==null?void 0:f.call(d)))==null?void 0:u.tenant)};return{setCustomLoginState:s,resetCustomLoginState:i,loadTenantMetadata:o,updateTenantMetadata:a,customLoginEnabled:l,loadCustomLoginRoutes:async u=>{try{var d,f;if(!await l()){var g;u==null||(g=u.callback)==null||g.call(u,!0);return}const m=e.auth.isAuthenticated,{getSettings:S,getPublicSettings:b}=t.accountSettings,{applicationUrl:w}=await Oe(m?S:b,u==null?void 0:u.retryConfig);if(!w){var h;u==null||(h=u.callback)==null||h.call(u,!0);return}const A=e.auth.routes,C=(d=Mw(w))!=null?d:"";r.setAuthState({routes:F({},A,{customLoginAuthenticatedUrl:w,customLoginUrl:A.loginUrl+C})}),s({customLoginSearchParams:C??void 0}),u==null||(f=u.callback)==null||f.call(u,!0)}catch(v){var p;u==null||(p=u.callback)==null||p.call(u,null,v)}}}};let Ls;(function(e){e.forgotPassword="forgotPassword",e.resetPasswordViaSms="resetPasswordViaSms",e.passwordRecoverySelector="passwordRecoverySelector",e.resetPasswordPage="resetPasswordPage",e.forgotPasswordEmailSuccess="forgotPasswordEmailSuccess",e.resetPasswordSuccess="resetPasswordSuccess"})(Ls||(Ls={}));const PD={step:Ls.forgotPassword,loading:!1,identifier:"",identifierType:tf.email,sessionId:"",userId:"",token:"",passwordConfig:null,resetTokenValidationStatus:"idle"},pne=e=>Ue(PD,e),ui={UNKNOWN_ERROR:"unknownError",SENDING_RECOVERY_EMAIL_ERROR:"sendingRecoveryEmailError",SENDING_RECOVERY_SMS_ERROR:"sendingRecoverySmsError",SESSION_ID_NOT_FOUND:"sessionIdNotFound",INVALID_SERVER_RESPONSE:"invalidServerResponse",VERIFYING_SMS_ERROR:"verifyingSmsError",NO_ACTIVE_RECOVERY_METHODS:"noActiveRecoveryMethods",DETERMINING_RECOVERY_STRATEGY_ERROR:"determiningRecoveryStrategyError"},gne=["callback"],RD=(e,t,n)=>{const r=async()=>{s({loading:!0});try{const h=await t.auth.getPasswordRecoveryStrategies();s({loading:!1,activeStrategies:h})}catch(h){s({loading:!1,error:W(h)})}},s=h=>{Object.assign(e.auth.forgotPasswordState,h)},i=()=>{Ne(e,["auth","forgotPasswordState"],PD)},o=async h=>{s({loading:!0});try{var p;await t.auth.forgotPassword(h),s({loading:!1,error:void 0,step:Ls.forgotPasswordEmailSuccess}),(p=h.callback)==null||p.call(h,!0)}catch(m){var v;s({loading:!1,error:W(m,ui.UNKNOWN_ERROR)}),(v=h.callback)==null||v.call(h,!1,m)}},a=async()=>{const{identifier:h,identifierType:p}=e.auth.forgotPasswordState;s({loading:!0});try{await t.auth.resetPasswordViaEmail({identifier:h,identifierType:p}),s({loading:!1,error:void 0,step:Ls.forgotPasswordEmailSuccess})}catch(v){s({loading:!1,error:W(v,ui.SENDING_RECOVERY_EMAIL_ERROR)})}};return{loadPasswordRecoveryStrategies:r,setForgotPasswordState:s,resetForgotPasswordState:i,forgotPassword:o,resetPassword:async h=>{const{callback:p}=h,v=re(h,gne);s({loading:!0});try{await t.auth.resetPassword(v),s({loading:!1,error:void 0,step:Ls.resetPasswordSuccess}),p==null||p(!0)}catch(m){s({loading:!1,error:W(m)}),p==null||p(!1,m)}},loadPasswordConfig:async h=>{s({loading:!0});try{var p;const m=await t.auth.loadPasswordConfig(h?{userId:h.userId}:void 0);if(h!=null&&(p=h.signal)!=null&&p.aborted)return;s({loading:!1,passwordConfig:m})}catch(m){var v;if(h!=null&&(v=h.signal)!=null&&v.aborted)return;s({loading:!1,error:W(m)})}},validateResetPasswordToken:async h=>{if(h.skipValidation||e.auth.forgotPasswordState.resetTokenValidationStatus==="valid"){var p;(p=h.signal)!=null&&p.aborted||s({resetTokenValidationStatus:"val
421id",error:void 0});return}s({resetTokenValidationStatus:"pending",error:void 0});try{var v;if(await t.auth.validateResetPasswordToken({userId:h.userId,token:h.token}),(v=h.signal)!=null&&v.aborted)return;s({resetTokenValidationStatus:"valid",error:void 0})}catch(S){var m;if((m=h.signal)!=null&&m.aborted)return;const b=W(S);if(xw(b)){const w=b.statusCode,A=w===400||w===403||w===410||w===422,C=w===401||w===404||w>=500;if(A){s({resetTokenValidationStatus:"invalid",error:void 0});return}if(C){s({resetTokenValidationStatus:"valid",error:void 0});return}}s({resetTokenValidationStatus:"valid",error:void 0})}},determinePasswordRecoveryStrategy:async h=>{s({loading:!0,error:void 0,identifier:h.identifier,identifierType:h.identifierType});try{const p=await t.auth.getPasswordRecoveryStrategies(),v=p.some(S=>S.strategy===nf.Email&&S.isActive),m=p.some(S=>S.strategy===nf.Sms&&S.isActive);v&&m?s({loading:!1,step:Ls.passwordRecoverySelector,activeStrategies:p}):v?await a():s(m?{loading:!1,step:Ls.resetPasswordViaSms,activeStrategies:p}:{loading:!1,error:ui.NO_ACTIVE_RECOVERY_METHODS,activeStrategies:p})}catch(p){s({loading:!1,error:W(p,ui.DETERMINING_RECOVERY_STRATEGY_ERROR)})}},sendPasswordRecoveryEmail:a,sendPasswordRecoverySms:async()=>{const{identifier:h,identifierType:p}=e.auth.forgotPasswordState;s({loading:!0});try{const v=await t.auth.resetPasswordViaSms({identifier:h,identifierType:p});s({loading:!1,error:void 0,sessionId:v.sessionId})}catch(v){s({loading:!1,error:W(v,ui.SENDING_RECOVERY_SMS_ERROR)})}},verifyPasswordViaSms:async h=>{const{sessionId:p}=e.auth.forgotPasswordState;if(!p){s({loading:!1,error:ui.SESSION_ID_NOT_FOUND});return}s({loading:!0});try{const v=await t.auth.verifyPasswordViaSms({otcToken:h.otcToken,sessionId:p});if(!v.userId||!v.token)throw new Error(ui.INVALID_SERVER_RESPONSE);s({loading:!1,error:void 0,userId:v.userId,token:v.token,step:Ls.resetPasswordPage,resetTokenValidationStatus:"valid"})}catch(v){s({loading:!1,error:W(v,ui.VERIFYING_SMS_ERROR)})}}}};let hf;(function(e){e.success="success",e.notification="notification"})(hf||(hf={}));const mne={step:hf.notification},vne=e=>Ue(mne,e),kD=(e,t,n)=>{const r=i=>{Object.assign(e.auth.passwordRotationState,i)};return{setStep:i=>{r({step:i})}}},OD={loaders:{},errors:{},groups:[],groupsConfiguration:{}},yne=e=>Ue(OD,e);let Ct;(function(e){e.CREATE_GROUP="CREATE_GROUP",e.GET_GROUP="GET_GROUP",e.GET_GROUPS="GET_GROUPS",e.DELETE_GROUP="DELETE_GROUP",e.UPDATE_GROUP="UPDATE_GROUP",e.ADD_USERS_TO_GROUP="ADD_USERS_TO_GROUP",e.DELETE_USERS_FROM_GROUP="DELETE_USERS_FROM_GROUP",e.ADD_ROLES_TO_GROUP="ADD_ROLES_TO_GROUP",e.DELETE_ROLES_FROM_GROUP="DELETE_ROLES_FROM_GROUP",e.GET_GROUP_CONFIGURATION="GET_GROUP_CONFIGURATION",e.UPDATE_GROUP_CONFIGURATION="UPDATE_GROUP_CONFIGURATION",e.GET_TEAM_USERS="GET_TEAM_USERS"})(Ct||(Ct={}));let pf;(function(e){e.roles="roles",e.users="users",e.rolesAndUsers="rolesAndUsers"})(pf||(pf={}));const Sne=["roleIds","userIds"],ID=(e,t,n)=>{const r=b=>{Object.assign(e.auth.groupsState,{loaders:F({},e.auth.groupsState.loaders,{[b.key]:b.value})})},s=b=>{Object.assign(e.auth.groupsState,{errors:F({},e.auth.groupsState.errors,{[b.key]:b.value}),loaders:F({},e.auth.groupsState.loaders,{[b.key]:!1})})},i=b=>{Object.assign(e.auth.groupsState,b)},o=()=>{Ne(e,["auth","groupsState"],OD)},a=async b=>{const w=Ct.GET_GROUPS,A=e.auth.groupsState;r({key:w,value:!0});try{const{groups:C}=await Oe(()=>t.groups.getGroups({_groupsRelations:pf.rolesAndUsers}),b==null?void 0:b.retryConfig);i(F({groups:C},A.selectedGroup&&{selectedGroup:C.find(E=>{var x;return E.id===((x=A.selectedGroup)==null?void 0:x.id)})}))}catch(C){s({key:w,value:W(C)})}finally{r({key:w,value:!1})}},l=async b=>{const w=Ct.GET_GROUP;r({key:w,value:!0});try{const A=await t.groups.getGroupById({groupId:b.groupId},{_groupsRelations:pf.rolesAndUsers});i({selectedGroup:A})}catch(A){s({key:w,value:W(A)})}finally{r({key:w,value:!1})}},c=async b=>{const w=Ct.CREATE_GROUP,{roleIds:A,userIds:C}=b,E=re(b,Sne);r({key:w,value:!0});try{var x;const T=await t.groups.createGroup(F({name:E.name},!!E.description&&{description:E.description},{color:E.color}));C!=null&&C.length&&h({groupId:T.id,userIds:C}),A!=null&&A.length&&f({groupId:T.id,roleIds:A}),await a(),b==null||(x=b.callback)==null||x.call(b,!0)}catch(T){var R;
421s({key:w,value:W(T)}),b==null||(R=b.callback)==null||R.call(b,!1)}finally{r({key:w,value:!1})}},u=async b=>{const w=Ct.UPDATE_GROUP;r({key:w,value:!0});try{var A;await t.groups.updateGroup(b),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;s({key:w,value:W(E)}),b==null||(C=b.callback)==null||C.call(b,!1)}finally{r({key:w,value:!1})}},d=async b=>{const w=Ct.DELETE_GROUP;r({key:w,value:!0});try{var A;await t.groups.deleteGroup(b.groupId),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;s({key:w,value:W(E)}),b==null||(C=b.callback)==null||C.call(b,!1,E)}finally{r({key:w,value:!1})}},f=async b=>{const w=Ct.ADD_ROLES_TO_GROUP;r({key:w,value:!0});try{var A;await t.groups.addRolesToGroup(b.groupId,{roleIds:b.roleIds}),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;s({key:w,value:W(E)}),b==null||(C=b.callback)==null||C.call(b,!1)}finally{r({key:w,value:!1})}},g=async b=>{const w=Ct.DELETE_ROLES_FROM_GROUP;r({key:w,value:!0});try{var A;await t.groups.deleteRolesFromGroup(b.groupId,{roleIds:b.roleIds}),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;s({key:w,value:W(E)}),b==null||(C=b.callback)==null||C.call(b,!1)}finally{r({key:w,value:!1})}},h=async b=>{const w=Ct.ADD_USERS_TO_GROUP;r({key:w,value:!0});try{var A;await t.groups.addUsersToGroup(b.groupId,{userIds:b.userIds}),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;b==null||(C=b.callback)==null||C.call(b,!1),s({key:w,value:W(E)})}finally{r({key:w,value:!1})}},p=async b=>{const w=Ct.DELETE_USERS_FROM_GROUP;r({key:w,value:!0});try{var A;await t.groups.deleteUsersFromGroup(b.groupId,{userIds:b.userIds}),await a(),b==null||(A=b.callback)==null||A.call(b,!0)}catch(E){var C;s({key:w,value:W(E)}),b==null||(C=b.callback)==null||C.call(b,!1)}finally{r({key:w,value:!1})}},v=async b=>{const w=Ct.GET_GROUP_CONFIGURATION;r({key:w,value:!0});try{const A=await Oe(()=>t.groups.getGroupConfiguration(),b==null?void 0:b.retryConfig);i({groupsConfiguration:A})}catch(A){s({key:w,value:W(A)})}finally{r({key:w,value:!1})}};return{setUsersGroupsLoader:r,setUsersGroupsError:s,setGroupsState:i,resetUsersGroupsState:o,loadGroups:a,getGroupById:l,createGroup:c,updateGroup:u,deleteGroup:d,addRolesToGroup:f,deleteRolesFromGroup:g,addUsersToGroup:h,deleteUsersFromGroup:p,getGroupConfiguration:v,updateGroupConfiguration:async b=>{const w=Ct.UPDATE_GROUP_CONFIGURATION;r({key:w,value:!0});try{await t.groups.updateGroupConfiguration(b),await v()}catch(A){s({key:w,value:W(A)})}finally{r({key:w,value:!1})}},getTeamUsers:async b=>{const w=Ct.GET_TEAM_USERS;r({key:w,value:!0});try{const{items:A}=await t.users.getUsersV2({_filter:b.filter,_offset:b.pageOffset,_limit:b.pageSize,_includeSubTenants:!1});i({teamUsers:A})}catch(A){s({key:w,value:W(A)})}finally{r({key:w,value:!1})}}}},ND={addGroupDialogState:{loading:!1,open:!1},editGroupDialogState:{loading:!1,open:!1},deleteGroupDialogState:{loading:!1,open:!1},addMembersToGroupDialogState:{loading:!1,open:!1,userIds:[]},deleteMemberFromGroupDialogState:{loading:!1,open:!1}},bne=e=>Ue(ND,e),LD=(e,t,n)=>({setGroupsDialogsState:p=>{Object.assign(e.auth.groupsDialogsState,p)},resetGroupsDialogsState:()=>{Ne(e,["auth","groupsDialogsState"],ND)},openAddGroupDialog:()=>{e.auth.groupsDialogsState.addGroupDialogState.open=!0},closeAddGroupDialog:()=>{Object.assign(e.auth.groupsDialogsState.addGroupDialogState,{open:!1,group:void 0})},openAddMembersToGroupDialog:()=>{e.auth.groupsDialogsState.addMembersToGroupDialogState.open=!0},closeAddMembersToGroupDialog:()=>{Object.assign(e.auth.groupsDialogsState.addMembersToGroupDialogState,{open:!1,userIds:[]})},openEditGroupDialog:p=>{Object.assign(e.auth.groupsDialogsState.editGroupDialogState,F({},p,{open:!0}))},closeEditGroupDialog:()=>{Object.assign(e.auth.groupsDialogsState.editGroupDialogState,{open:!1,loading:!1,group:void 0})},openDeleteGroupDialog:p=>{Object.assign(e.auth.groupsDialogsState.deleteGroupDialogState,F({},p,{open:!0}))},closeDeleteGroupDialog:()=>{Object.assign(e.auth.groupsDialogsState.deleteGroupDialogState,{open:!1,loading:!1,group:void 0})},openDeleteMemberFromGroupDialog:p=>{Object.assign(e.auth.groupsDialogsState.deleteMemberFromGroupDialogState,p)},closeDeleteMemberFromGroupDialog:()=>{Object.assign(e.auth.groupsDialogsState.deleteMemberFromGroupDialogState,{open:!1,userId:void 0,email:void 0})}});let gf;(function(e){e.impersonating="impersonating",e.success="success"})(gf||(gf={}));const DD={step:gf.impersonating,loading:!1},_ne=e=>Ue(DD,e),wne=["callback","events"],MD=(e,t,n)=>{const r=n,s=a=>{Object.assign(e.auth.impersonateState,a)},i=()=>{Ne(e,["auth","impersonateState"],DD)};return{setImpersonateState:s,resetImpersonateState:i,impersonate:async a=>{const{callback:l}=a,c=re(a,wne);s({loading:!0});try{const u=await t.impersonate.impersonate(c);s({step:gf.success}),await he(1e3),await r.afterAuthNavigation({preventRedirectUrlOriginCleaning:!0}),i(),l==null||l(!0)}catch(u){s({loading:!1,error:W(u)})}}}},UD={flow:zn.Login,step:Ye.preLogin,loading:!1,email:"",tenants:[]},Ene=e=>Ue(UD,e),Ane=(e,t,n)=>{const r=n;function s(u){var d,f;return u.startsWith((d=window)==null?void 0:d.location.origin)?u.replace((f=window)==null?void 0:f.location.origin,""):u}function i({user:u,tenants:d=[],activeTenant:f},g={}){const h=e.auth.tenantsState;r.setAuthState(F({user:u,tenantsState:F({},h,{tenants:d,activeTenant:f,loading:!1})},g))}async function o({customLoginAuthenticatedUrl:u,preventRedirectUrlOriginCleaning:d}){const{routes:f,includeQueryParam:g=!1,enforceRedirectToSameSite:h=!1,allowedRedirectOrigins:p=[]}=e.auth,v=window.localStorage.getItem(Sd);if(u&&!v)return dD(u,d);const{authenticatedUrl:m,loginUrl:S,logoutUrl:b,socialLoginCallbackUrl:w,activateUrl:A,activateWithOTCUrl:C}=f;let E=v;(!E||[S,b,w,A,C].includes(E))&&(E=m);const x=uD({authenticatedUrl:E,includeQueryParam:g,enforceRedirectToSameSite:h,allowedRedirectOrigins:p});return d?x:s(x)}const a=async(u,d={})=>{const{customLoginAuthenticatedUrl:f,forceStepUpUrl:g,shouldStepUpDuringLogin:h,preventRedirectUrlOriginCleaning:p=!1}=d,v=e.auth.onRedirectTo;let m;if(g)m=g;else{var S;if(h){const b=window.localStorage.getItem(Sd);b&&!Dw(b)&&(m=b)}m||(m=await o({customLoginAuthenticatedUrl:f,preventRedirectUrlOriginCleaning:p})),(S=window)==null||S.localStorage.removeItem(Sd)}await he(200),await u(),v(m,{refresh:m.startsWith("http")})};return{afterAuthNavigationUtil:a,afterAuthNavigation:async u=>{var d,f;const{customLoginAuthenticatedUrl:g,stepUpUrl:h}=e.auth.routes,p=(d=window)==null?void 0:d.localStorage.getItem(xi),v=e.auth.user;if(p){var m;(m=window)==null||m.localStorage.removeItem(xi)}if(h&&p&&!Qf(v))return a(r.resetLoginState,{forceStepUpUrl:h});let S=g;if(!g){var b;await r.loadCustomLoginRoutes(),S=(b=e.auth.routes)==null?void 0:b.customLoginAuthenticatedUrl}return a(r.resetLoginState,{customLoginAuthenticatedUrl:S,shouldStepUpDuringLogin:!!p,preventRedirectUrlOriginCleaning:(f=u==null?void 0:u.preventRedirectUrlOriginCleaning)!=null?f:!1})},afterStepUpAuthNavigation:async()=>a(r.resetStepUpState),afterAuthenticationStateUpdate:i}};function Cne(e,t,n){const r=n,s=async l=>{const c=e.root.appName;return Kn.getFeatureFlags(l,c)},i=async()=>await r.afterStepUpAuthNavigation(),o=async(l,c)=>{const u=e.auth.loginState,d=e.auth.mfaState.step,[f]=await r.getFeatureFlags(["security-center-show-login-flows"]);if(u.flow===zn.Login){if(f&&u.isBreachedPassword&&!l){r.setLoginState({step:Ye.breachedPassword,loading:!1});return}if(Qv(c,e.root.appName)){r.setLoginState({step:Ye.passwordRotationExpired,loading:!1,resetPasswordToken:c.resetPasswordToken,userId:c.userId});return}if(Yv(c)){r.setLoginState({step:Ye.passwordRotationNotification,loading:!1});return}const g=await r.__shouldShowPromptPasskeys();
421d===Dt.smsVerifyCode&&g?r.setLoginState({step:Ye.promptPasskeys,loading:!1}):await r.afterAuthNavigation()}};return{postHandleVerifyMFAResponseForStepUp:i,postHandleVerifyMFAResponseForLogin:o,handleVerifyMFAResponse:async(l,c=!1)=>{const{user:u,tenants:d,activeTenant:f}=l;r.setUser(u),r.setTenantsState({tenants:d,activeTenant:f,loading:!1}),u.id&&localStorage.setItem("userId",u.id);const g=!!u.accessToken;if(r.setAuthState({isAuthenticated:g}),g&&!c){const h={tenantId:u.tenantId,userId:u.id,authenticationType:"mfa",createdAt:new Date,email:u.email,name:u.name};Dn(ln.LOGIN_COMPLETED,h)}return c?await i():await o(g,u)},getFeatureFlags:s}}const xne=(e,t,n)=>({getMfaRequiredState:async(s,i,o=!1,a)=>{var l,c,u;let d=Ye.loginWithTwoFactor;const f={step:Dt.verify,loading:!1,saving:!1},g=e.auth.loginState;let h,p;try{const b=await Oe(()=>t.auth.checkIfAllowToRememberMfaDevice(s.mfaToken),i);h=b.isAllowedToRemember,p=b.mfaDeviceExpiration}catch(b){if(!o)throw b}!("mfaEnrolled"in s&&!s.mfaEnrolled)||((l=s.mfaDevices)==null||(c=l.emails)==null?void 0:c.length)?Object.assign(f,{mfaDevices:s.mfaDevices,mfaToken:s.mfaToken,step:Fw(s.mfaDevices)}):(Object.assign(f,{step:hD(s.mfaStrategies),qrCode:s.qrCode,recoveryCode:s.recoveryCode,loading:!1,mfaToken:s.mfaToken,mfaStrategies:s.mfaStrategies}),d=Ye.forceTwoFactor);let m={};const S=localStorage.getItem("register-quick-login");return S&&(m={quickLoginToRegister:S,flow:zn.RegisterQuickLogin}),{user:void 0,isAuthenticated:!1,mfaState:f,loginState:F({},g,m,{mfaToken:s.mfaToken,mfaRequired:s.mfaRequired,loading:!1,error:void 0,step:d,tenantsLoading:!0,email:(u=s.userEmail)!=null?u:a,tenants:[],allowRememberMfaDevice:h,mfaDeviceExpiration:p,isBreachedPassword:s.isBreachedPassword})}}}),Tne=["callback"],Pne=(e,t,n)=>{const r=n;async function s(c,u,d){const f=e.auth.loginState;let g={};if(!d){const h=f.flow===zn.Login?Ye.success:f.step;g={loginState:{flow:f.flow,quickLoginToRegister:f.quickLoginToRegister,loading:!1,step:h,error:void 0,tenants:c}}}return F({},g,{isAuthenticated:u})}async function i(c,u,d){const f=e.auth.loginState;if(f.flow!==zn.Login)return;const[g]=await r.getFeatureFlags(["security-center-show-login-flows"]);if(g&&f.isBreachedPassword&&!c){r.setLoginState({step:Ye.breachedPassword,loading:!1}),d==null||d(!0);return}if(Qv(u,e.root.appName)){r.setLoginState({step:Ye.passwordRotationExpired,loading:!1,resetPasswordToken:u.resetPasswordToken,userId:u.userId}),d==null||d(!0);return}if(Yv(u)){r.setLoginState({step:Ye.passwordRotationNotification,loading:!1}),d==null||d(!0);return}await r.__shouldShowPromptPasskeys()?r.setLoginState({step:Ye.promptPasskeys,loading:!1}):await r.afterAuthNavigation(),d==null||d(!0)}async function o(c){await r.afterStepUpAuthNavigation(),c==null||c(!0)}const a=async(c,u,d)=>{let{callback:f}=c,g=re(c,Tne);u({loading:!0,error:void 0});try{const{user:h,tenants:p=[],activeTenant:v}=await t.auth.loginWithMfaV2(g),m=!!h.accessToken,S=await s(p,m,d);if(await r.afterAuthenticationStateUpdate({user:h,tenants:p,activeTenant:v},S),m&&!d){const b={tenantId:h.tenantId,userId:h.id,authenticationType:"mfa",createdAt:new Date,email:h.email,name:h.name};Dn(ln.LOGIN_COMPLETED,b)}return h.id&&localStorage.setItem("userId",h.id),u({loading:!1,error:void 0}),d?await o(f):await i(m,h,f)}catch(h){u({loading:!1,error:W(h)}),f==null||f(!1,h)}};return{mfaWithAuthenticator:a,loginWithMfa:async c=>await a(c,r.setLoginState,!1)}},Rne=["callback"],kne=["callback"],One=(e,t,n)=>{const r=n,s=async(l,c)=>{var u;let{callback:d}=l,f=re(l,Rne);c=(u=c)!=null?u:r.setLoginState,c({loading:!0,error:void 0});try{const g=await t.auth.preVerifyMFAEmailCode(f);r.setMfaState({otcToken:g.otcToken,step:Dt.emailVerifyCode}),c({loading:!1,error:void 0}),d==null||d(!0)}catch(g){c({error:W(g)}),d==null||d(null)}},i=async(l,c)=>{var u;let{callback:d}=l,f=re(l,kne);c=(u=c)!=null?u:r.setLoginState,c({loading:!0});try{const g=await t.auth.verifyMFAEmailCodeV2(f);await r.handleVerifyMFAResponse(g),c({loading:!1,error:void 0}),d==null||d(!0)}catch(g){c({loading:!1,error:W(g)}),d==null||d(null)}};return{preVerifyMFAEmailCode:s,verifyMFAEmailCode:i,preVerifyMFAEmailCodeForLogin:async l=>await s(l,r.setLoginState),verifyMFAEmailCodeForLogin:async l=>await i(l,r.setLoginState)}},Ine=["callback","deviceId"],Nne=["callback","deviceId"],Lne=(e,t,n)=>{const r=n,s=async(l,c)=>{let{callback:u,deviceId:d}=l,f=re(l,Ine);c({loading:!1,error:void 0});try{const g=await t.auth.preVerifyMFASMSForLogin(d,f);r.setMfaState({otcToken:g.otcToken,step:Dt.smsVerifyCode,phoneNumber:g.phoneNumber}),c({loading:!1,error:void 0}),u==null||u(!0)}catch(g){c({loading:!1,error:W(g)}),u==null||u(null)}},i=async(l,c,u=!1)=>{let{callback:d,deviceId:f}=l,g=re(l,Nne);c({loading:!0});try{const h=await t.auth.verifyMFASMSForLoginV2(f,g);await r.handleVerifyMFAResponse(h,u),c({loading:!1,error:void 0}),d==null||d(!0)}catch(h){c({loading:!1,error:W(h)}),d==null||d(null)}};return{preVerifyMFASMS:s,verifyMFASMS:i,preVerifyMFASMSForLogin:async l=>await s(l,r.setLoginState),verifyMFASMSForLogin:async l=>await i(l,r.setLoginState,!1)}},Dne=["callback","deviceId"],Mne=["callback","deviceId"],Une=(e,t,n)=>{const r=n,s=async(l,c)=>{let{callback:u,deviceId:d}=l,f=re(l,Dne);c({loading:!0});try{var g;const h=await t.auth.preVerifyMFAWebAuthnForLogin(d,f),p=F({},h.options,{challenge:Gn(h.options.challenge),allowCredentials:(g=h.options.allowCredentials)==null?void 0:g.map(v=>F({},v,{id:Gn(v.id)}
421))});c({loading:!1,error:void 0}),u==null||u({options:p,webauthnToken:h.webauthnToken})}catch(h){c({loading:!1,error:W(h)}),u==null||u(null)}},i=async(l,c,u)=>{let{callback:d,deviceId:f}=l,g=re(l,Mne);c({loading:!0});try{const h=Ii(g.publicKey),p=await t.auth.verifyMFAWebAuthnForLoginV2(f,F({},g,{options:h}));await r.handleVerifyMFAResponse(p,u),c({loading:!1,error:void 0}),d==null||d(!0)}catch(h){c({loading:!1,error:W(h)}),d==null||d(null)}};return{preVerifyMFAWebAuthn:s,verifyMFAWebAuthn:i,preVerifyMFAWebAuthnForLogin:async l=>await s(l,r.setLoginState),verifyMFAWebAuthnForLogin:async l=>await i(l,r.setLoginState,!1)}},Fne=(e,t,n)=>{const r=n,s=async()=>{const c=await t.auth.silentOAuthRefreshTokenV2();if(c!=null&&c.user)await r.afterAuthenticationStateUpdate(c,{isAuthenticated:!0,isLoading:!1});else throw new Error("couldn't refresh user token with oauth service")},i=async c=>{var u;const{routes:d,onRedirectTo:f}=e.auth,{context:g,urlStrategy:h}=e.root;if(i1(h)===d.hostedLoginRedirectUrl){console.debug("Calling loginWithRedirect while in hostedLoginCallback route");return}r.setAuthState({isLoading:!0});const v=n1(),m=n1(),S=await V5(m);localStorage.setItem(t1,m);const b=s1(e);let w=`${window.location.origin}${h==="path"?"":"#"}${b??""}${d.hostedLoginRedirectUrl}`;await r.loadCustomLoginRoutes();const A=(u=e.auth.customLoginState)==null?void 0:u.customLoginSearchParams;A&&(w.endsWith("/")&&(w=w.slice(0,-1)),w+=A);const E=`${t.fetch.getBaseUrl(g,"/oauth/authorize")}/oauth/authorize`,x=F({response_type:"code",client_id:g.appId||g.clientId||"INVALID-CLIENT-ID",scope:"openid email profile",redirect_uri:w,code_challenge:S,code_challenge_method:"S256",nonce:v},c);if(g.tenantResolver){var R;const U=await((R=g.tenantResolver)==null?void 0:R.call(g));U!=null&&U.tenant&&(x.organization=U.tenant)}const T=qv(Uw);T&&(x.tenantId=T);const P=new URLSearchParams(x),I=`${E}?${P.toString()}`;f(I,{refresh:!0})};return{requestHostedLoginAuthorize:async c=>{var u;(u=localStorage)==null||u.removeItem(xi);const d=e.auth.disableSilentRefresh;if((c==null?void 0:c.prompt)==="login")return await i(c);try{if(d)throw new Error("silent refresh is disabled");return await s()}catch{return await i(c)}},requestHostedLoginAuthorizeV2:async c=>{var u,d;const{shouldRedirectToLogin:f,firstTime:g,loginDirectAction:h}=c??{};let{additionalParams:p}=c??{};if((u=localStorage)==null||u.removeItem(xi),g){const m=e.root.urlStrategy,S=i1(m);if(r.setAuthState({isLoading:!0}),pD(S))return}const v=e.auth.disableSilentRefresh;if(h&&(p=p||{},p.login_direct_action=btoa(JSON.stringify(h))),((d=p)==null?void 0:d.prompt)==="login")return await i(p);try{if(v)throw new Error("silent refresh is disabled");return await s()}catch{if(!f){r.setAuthState({isLoading:!1});return}return await i(p)}},__requestHostedLoginAuthorize:i,__requestHostedLoginSilentAuthorize:s,handleHostedLoginCallback:async c=>{var u;const d=localStorage.getItem(t1)||"INVALID-CODE-VERIFIER",f=e.auth.routes,g=e.root.urlStrategy,h=s1(e);let p=`${window.location.origin}${g==="path"?"":"#"}${h??""}${f.hostedLoginRedirectUrl}`;await r.loadCustomLoginRoutes();const v=(u=e.auth.customLoginState)==null?void 0:u.customLoginSearchParams;v&&(p.endsWith("/")&&(p=p.slice(0,-1)),p+=v);const m={code:c.code,redirect_uri:p,code_verifier:d,grant_type:"authorization_code"},S=window.localStorage.getItem(xi);try{const b=await t.auth.exchangeOAuthTokensV2(m),w=b.user;if(r.afterAuthenticationStateUpdate(b,{isAuthenticated:!0,isLoading:!1}),!S){const A={tenantId:w==null?void 0:w.tenantId,userId:w==null?void 0:w.id,authenticationType:"hosted",createdAt:w==null?void 0:w.createdAt,email:w==null?void 0:w.email,name:w==null?void 0:w.name};Dn(ln.LOGIN_COMPLETED,A)}}catch(b){r.setAuthState({isLoading:!1}),console.error("Failed to exchangeOAuthTokens",b)}finally{const b=e.auth.user;window.localStorage.removeItem(xi),S&&Qf(b)?await r.afterStepUpAuthNavigation():await r.afterAuthNavigation()}}}};let Sn;(function(e){e.LOAD_SSO_CONFIGURATIONS="LOAD_SSO_CONFIGURATIONS",e.SAVE_SSO_CONFIGURATION="SAVE_SSO_CONFIGURATION",e.UPDATE_SSO_CONFIGURATION="UPDATE_SSO_CONFIGURATION",e.SAVE_SSO_CONFIGURATION_BY_METADATA="SAVE_SSO_CONFIGURATION_BY_METADATA",e.UPDATE_SSO_CONFIGURATION_BY_METADATA="UPDATE_SSO_CONFIGURATION",e.DELETE_SSO_CONFIGURATION="DELETE_SSO_CONFIGURATION",e.SAVE_SSO_DOMAIN="SAVE_SSO_DOMAIN",e.DELETE_SSO_DOMAIN="DELETE_SSO_DOMAIN",e.VALIDATE_SSO_DOMAIN="VALIDATE_SSO_DOMAIN",e.UPDATE_SSO_DEFAULT_ROLES="UPDATE_SSO_DEFAULT_ROLES",e.DELETE_SSO_GROUPS="DELETE_SSO_GROUPS",e.SAVE_SSO_GROUPS="SAVE_SSO_GROUPS",e.GET_SSO_AUTHORIZATION_ROLES="GET_SSO_AUTHORIZATION_ROLES"})(Sn||(Sn={}));let mf;(function(e){e.Saml="saml",e.Okta="okta",e.Azure="azure",e.Google="google",e.Oidc="oidc"})(mf||(mf={}));const $ne=["callback","error"],jne=["callback"],Vne=["callback"],Bne=["callback"],zne=["callback"],Gne=["callback","events"],Hne=["callback"],Wne=["callback"],Kne=["user"],qne=["callback"],Yne=["callback"],Qne=["callback"],Xne=["callback"],Jne=["callback"],Zne=["callback"],FD=(e,t,n)=>{const r=n,s=de.for(e.root.appName),i=async()=>{const K=e.auth.user;
421if(!(K!=null&&K.refreshToken)){s.setAccessToken(null),s.setUser(null),r.setAuthState({user:null,isAuthenticated:!1});return}try{const G={grant_type:"refresh_token",refresh_token:K==null?void 0:K.refreshToken},Q=await t.auth.exchangeOAuthTokensV2(G),Z=await c(Q.user);r.afterAuthenticationStateUpdate(F({},Q,{user:Z}),{isAuthenticated:!0})}catch{s.setAccessToken(null),s.setUser(null),r.setAuthState({user:null,isAuthenticated:!1})}},o=K=>{var G;const{routes:Q,loginState:Z}=e.auth,ee=(G=localStorage.getItem("register-quick-login"))!=null?G:Z.quickLoginToRegister;return ee&&localStorage.getItem(`${K.id}-${ee}`)!=="true"&&!window.location.pathname.endsWith(Q.logoutUrl)},a=async()=>{try{const{routes:G,loginState:Q,onRedirectTo:Z}=e.auth,{user:ee,tenants:ge=[],activeTenant:pe}=await t.auth.refreshTokenV3();if(Ns(ee,e.root.appName)){const xe=await r.getMfaRequiredState(ee);r.setAuthState(xe),Z(G.loginUrl,{preserveQueryParams:!0})}else{var K;ee.id&&localStorage.setItem("userId",ee.id);const xe=(K=localStorage.getItem("register-quick-login"))!=null?K:Q.quickLoginToRegister,Le=o(ee),Be=await c(ee);r.afterAuthenticationStateUpdate({user:Be,tenants:ge,activeTenant:pe},{loginState:F({},Q,{quickLoginToRegister:xe,flow:Le?zn.RegisterQuickLogin:zn.Login}),isAuthenticated:!0}),await u({shouldNavigateToRegisterQuickLogin:Le})}}catch{s.setAccessToken(null),s.setUser(null),r.setAuthState({user:void 0,isAuthenticated:!1})}},l=async()=>{e.auth.hostedLoginBox?await i():await a()},c=async K=>{var G;const Q=(G=e.auth.user)==null?void 0:G.entitlements;return Lw(Q,K==null?void 0:K.entitlements)?F({},K,{entitlements:Q}):K},u=async({shouldNavigateToRegisterQuickLogin:K,isSocialLoginRefreshToken:G=!1})=>{var Q;const Z=new URL((Q=window)==null?void 0:Q.location.href),{routes:ee,loginState:ge,onRedirectTo:pe}=e.auth,[xe]=Kn.getFeatureFlags(["prevent-auth-redirect-on-social-login"],e.root.appName),Le=Z.searchParams.get("invitationToken"),Be=[ee.socialLoginCallbackUrl,ee.oidcRedirectUrl,ee.samlCallbackUrl,ee.magicLinkCallbackUrl];if(Le||Be.push(ee.loginUrl,ee.signUpUrl),K)pe(ee.loginUrl);else if(Be.some(ye=>ye&&window.location.pathname.endsWith(ye)))if(ge.isNewUser&&ee.signUpSuccessUrl&&ee.socialLoginCallbackUrl===window.location.pathname)pe(ee.signUpSuccessUrl,{refresh:ee.signUpSuccessUrl.startsWith("http")});else{const ye=ee.socialLoginCallbackUrl&&window.location.pathname.endsWith(ee.socialLoginCallbackUrl);if(!G&&xe&&ye)return;await r.afterAuthNavigation()}},d=async K=>{try{var G;const{isActive:Z}=await Oe(t.auth.getSSOPublicConfiguration,K==null?void 0:K.retryConfig);r.setAuthState({isSSOAuth:Z}),K==null||(G=K.callback)==null||G.call(K,{isSSOAuth:Z})}catch(Z){var Q;r.setAuthState({isSSOAuth:!1}),K==null||(Q=K.callback)==null||Q.call(K,null,Z)}},f=async K=>{let G;try{var Q;const Z=await Oe(t.metadata.getSamlMetadata,K==null?void 0:K.retryConfig);G=Z==null||(Q=Z.configuration)==null?void 0:Q.acsUrl}catch(Z){console.error(Z)}r.setAuthState({ssoACS:G})},g=async({accessToken:K,user:G})=>{if(!K){r.setAuthState({user:void 0,isAuthenticated:!1});return}const{onRedirectTo:Q,routes:Z}=e.auth;if(Ns(G,e.root.appName)){const ee=await r.getMfaRequiredState(G,br,!0);r.setAuthState(ee),Q(Z.loginUrl,{preserveQueryParams:!0})}},h=K=>{Object.assign(e.auth.loginState,K)},p=()=>{Ne(e,["auth","loginState"],UD)},v=K=>mi({callback:(Q,Z)=>{!Z||Z.statusCode<500||r.setErrorByRequestName({requestName:K,traceId:Ew(Z)})}}),m=async K=>{const G=[],Q=[];G.push(l()),K&&(r.setAuthState({isLoading:!0}),G.push(r.loadSocialLoginsConfigurationV2(mi())),G.push(r.loadAllowSignUps(v(Mr.LOAD_ALLOW_SIGNUPS))),G.push(r.loadPublicAuthStrategiesPolicy(v(Mr.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY))),G.push(r.loadSignUpStrategies()),G.push(d(v(Mr.LOAD_SSO_PUBLIC_CONFIGURATION))),G.push(r.loadVendorPublicInfo(mi())),G.push(f(mi())),Q.push(r.loadCustomLoginRoutes(v(Mr.LOAD_CUSTOM_LOGIN_ROUTES)))),await Promise.all(G),Q.length>0&&await Promise.all(Q),r.setAuthState({isLoading:!1})},S=async K=>{const G=[];G.push(r.loadSocialLoginsConfigurationV2(mi())),G.push(r.loadAllowSignUps(v(Mr.LOAD_ALLOW_SIGNUPS))),G.push(d(v(Mr.LOAD_SSO_PUBLIC_CONFIGURATION))),G.push(r.loadSignUpStrategies()),G.push(r.loadVendorPublicInfo(mi())),G.push(f()),G.push(g(K)),G.push(r.loadCustomLoginRoutes(v(Mr.LOAD_CUSTOM_LOGIN_ROUTES))),await Promise.all(G)},b=async K=>{let{callback:G,error:Q}=K,Z=re(K,$ne);const ee=e.auth.securityPolicyState.publicPolicy.policy;if(!(ee!=null&&ee.authStrategy)){r.setLoginState({step:Ye.loginWithPassword,loading:!1}),G==null||G();return}(ee==null?void 0:ee.authStrategy)===at.EmailAndPassword?(r.setLoginState({step:Ye.loginWithPassword,loading:!1}),G==null||G()):[at.MagicLink,at.Code,at.SmsCode].includes(ee==null?void 0:ee.authStrategy)?await r.passwordlessPreLogin(F({},Z,{type:ee==null?void 0:ee.authStrategy,callback:G})):(r.setLoginState({step:Ye.loginWithPassword,loading:!1,error:W(Q)}),G==null||G())},w=async K=>{const{email:G,username:Q,recaptchaToken:Z,invitationToken:ee,callback:ge}=K;h({loading:!0});try{const Be=e.auth.onRedirectTo,ye=qv(Uw),we=await t.auth.preLoginV2(F({},G?{email:G}:{},Q?{username:Q}:{},{tenantId:ye})),{address:Ot,idpType:Un}=we??{};if(Ot){let dn=Ot;
421if(Un===mf.Oidc&&!dn.includes("redirect_uri")){const{oidcRedirectUrl:fn}=e.auth.routes;dn+=`&redirect_uri=${window.location.origin}${fn}`}if(ed.isLoginWithSSOAvailable()){var pe;ed.loginWithSSO((pe=G??Q)!=null?pe:""),h({loading:!1}),ge==null||ge()}else h({step:Ye.redirectToSSO,loading:!1,ssoRedirectUrl:dn}),setTimeout(()=>{Be(dn,{refresh:!0})},2e3)}else{var xe;await b({email:(xe=G??Q)!=null?xe:"",recaptchaToken:Z,callback:ge,invitationToken:ee})}}catch(Be){var Le;await b({email:(Le=G??Q)!=null?Le:"",recaptchaToken:Z,callback:ge,invitationToken:ee,error:Be})}},A=async K=>{const{onRedirectTo:G,routes:Q}=e.auth;h({loading:!0});try{const ee=await t.auth.postLogin(K),ge=!!ee.accessToken;if(r.setAuthState({user:ee.accessToken?ee:void 0,isAuthenticated:ge}),ge){var Z;const pe={tenantId:ee.tenantId,userId:ee.id,authenticationType:"password",createdAt:(Z=ee==null?void 0:ee.createdAt)!=null?Z:new Date,email:ee.email,name:ee.name};Dn(ln.LOGIN_COMPLETED,pe)}await r.afterAuthNavigation()}catch{setTimeout(()=>{G(Q.authenticatedUrl)},1e3),h({step:Ye.loginWithSSOFailed,loading:!1})}},C=async K=>{const{email:G,username:Q,password:Z,recaptchaToken:ee,invitationToken:ge,callback:pe}=K;h({loading:!0});try{const{user:Le,tenants:Be=[],activeTenant:ye}=await t.auth.loginv2(F({},G?{email:G}:{},Q?{username:Q}:{},{password:Z,recaptchaToken:ee,invitationToken:ge})),{onRedirectTo:we,routes:Ot}=e.auth;if(Ns(Le,e.root.appName)){const Un=await r.getMfaRequiredState(Le,br,!0,G);r.setAuthState(Un),we(Ot.loginUrl,{preserveQueryParams:!0})}else{const[Un]=await r.getFeatureFlags(["security-center-show-login-flows"]);if(Qv(Le,e.root.appName))h({step:Ye.passwordRotationExpired,loading:!1,resetPasswordToken:Le.resetPasswordToken,userId:Le.userId});else{const dn=e.auth.loginState,fn=!!Le.accessToken;if(Le.id&&localStorage.setItem("userId",Le.id),r.afterAuthenticationStateUpdate({user:Le,tenants:Be,activeTenant:ye},{loginState:{flow:dn.flow,quickLoginToRegister:dn.quickLoginToRegister,email:G,loading:!1,error:void 0,mfaToken:Le.mfaToken,step:dn.flow===zn.Login?Ye.success:dn.step,tenants:Be,tenantsLoading:!0,isBreachedPassword:Le.isBreachedPassword},isAuthenticated:fn}),fn){var xe;const Jr={tenantId:Le.tenantId,userId:Le.id,authenticationType:"password",createdAt:(xe=Le==null?void 0:Le.createdAt)!=null?xe:new Date,email:G,name:Le.name};Dn(ln.LOGIN_COMPLETED,Jr)}dn.flow===zn.Login&&(Un&&Le.isBreachedPassword&&!fn?h({step:Ye.breachedPassword,loading:!1}):fn&&(Yv(Le)?h({step:Ye.passwordRotationNotification,loading:!1}):await r.__shouldShowPromptPasskeys()?(h({step:Ye.promptPasskeys,loading:!1}),we(Ot.loginUrl,{preserveQueryParams:!0})):await r.afterAuthNavigation()))}}ed.isSuggestSavePasswordAvailable()&&ed.suggestSavePassword(G,Z),localStorage.removeItem("register-quick-login"),pe==null||pe(!0)}catch(Le){s.setAccessToken(null),s.setUser(null),pe==null||pe(!1,Le),h({email:G,error:W(Le),loading:!1})}},E=async K=>{const G=e.auth.hostedLoginBox;r.setAuthState({isLoading:!0});try{G?await t.auth.OAuthLogout():await t.auth.logout()}catch{}s.isSessionPerTenantEnabled()&&H2(),r.resetAuthState(),await r.requestAuthorize(!0),K==null||K()},x=async K=>{var G;try{await t.auth.logout()}catch{}s.isSessionPerTenantEnabled()&&H2(),setTimeout(()=>{var Q;return K==null||(Q=K.callback)==null?void 0:Q.call(K,!0)},(G=K==null?void 0:K.callbackTimeout)!=null?G:500)},R=async K=>{h({loading:!0});try{var G;await t.auth.recoverMfaToken(K),h({loading:!1,error:void 0,step:Ye.preLogin}),r.setAuthState({user:void 0,isAuthenticated:!1}),(G=K.callback)==null||G.call(K,!0)}catch(Z){var Q;h({error:W(Z),loading:!1}),(Q=K.callback)==null||Q.call(K,!1,Z)}},T=async K=>{const{callback:G}=K,Q=re(K,jne);try{h({loading:!0});const Z=await t.auth.passwordlessPreLogin(F({},Q,{type:at.SmsCode}));h({step:Ye.loginWithQuickSmsOtc,loading:!1,phoneNumber:Z==null?void 0:Z.phoneNumber,error:void 0}),G==null||G(!0)}catch(Z){h({error:W(Z),loading:!1}),G==null||G(!1,Z)}},P=async K=>{const{callback:G}=K,Q=re(K,Vne);try{h({loading:!0});const Z=await t.auth.changePhoneNumberWithVerification(Q);h({phoneNumber:Q.phoneNumber,loading:!1,changePhoneId:Z.changePhoneId,step:Ye.loginWithQuickSmsOtc,error:void 0}),G==null||G(!0)}catch(Z){h({error:W(Z),loading:!1})}},I=async K=>{const{callback:G}=K,Q=re(K,Bne);try{h({loading:!0}),await t.auth.verifyChangePhoneNumber(Q),h({loading:!1}),G==null||G(!0)}catch(Z){h({error:W(Z),loading:!1})}},U=async K=>{const{callback:G}=K,Q=re(K,zne);try{var Z;h({loading:!0});let ee;gD(Q)&&(ee=Q.email);let ge;mD(Q)&&(ge=Q.username);const pe=await t.auth.passwordlessPreLogin(F({},Q,{email:ee,username:(Z=ge)!=null?Z:""})),xe=I5[Q.type];h({step:xe,loading:!1,phoneNumber:pe==null?void 0:pe.phoneNumber,email:ee,username:ge,error:void 0}),G==null||G()}catch(ee){h({error:W(ee),loading:!1}),G==null||G(null,ee)}},L=async K=>{const{callback:G,events:Q}=K,Z=re(K,Gne);try{h({loading:!0});const{user:pe,tenants:xe=[],activeTenant:Le}=await t.auth.passwordlessPostLoginV2(Z),{routes:Be,onRedirectTo:ye}=e.auth;if(Ns(pe,e.root.appName)){const we=await r.getMfaRequiredState(pe);r.setAuthState(we),ye(Be.loginUrl,{preserveQueryParams:!0})}else{var ee;const we=e.auth.loginState;if(pe.emailVerified){var ge;const Un={email:pe.email,origin:Vc.PASSWORDLESS,id:pe.id,tenantId:pe.tenantId,createdAt:new Date,name:pe.name};Q==null||(ge=Q.userVerified)==null||ge.call(Q,Un),Dn(ln.USER_VERIFIED,Un)}const Ot={tenantId:pe.tenantId,userId:pe.id,authenticationType:"magic_link",createdAt:(ee=pe==null?void 0:pe.createdAt)!=null?ee:new Date,email:pe.email,name:pe.name};Dn(ln.LOGIN_COMPLETED,Ot),pe.id&&localStorage.setItem("userId",pe.id),r.afterAuthenticationStateUpdate({user:pe,tenants:xe,activeTenant:Le}),h({error:void 0}),r.setAuthState({isLoading:!1}),we.flow===zn.Login?await r.__shouldShowPromptPasskeys()?(r.setLoginState({step:Ye.promptPasskeys,loading:!1}),ye(Be.loginUrl,{preserveQueryParams:!0})):(r.setAuthState({isAuthenticated:!0}),K.type===at.MagicLink&&(r.setLoginState({step:Ye.magicLinkPostLoginSuccess,loading:!1}),await he(5e3)),await r.afterAuthNavigation()):ye(Be.loginUrl,{preserveQueryParams:!0}),localStorage.removeItem("register-quick-login"),G==null||G(!0)}}catch(pe){h({error:W(pe,"Failed to authenticate")}),G==null||G(null,pe)}finally{h({loading:!1})}},z=async K=>{try{h({loading:!0});const{name:G}=await t.auth.verifyInviteToken(K);h({inviteTokenTenantName:G})}catch(G){h({inviteTokenError:W(G,"We couldn't verify your invitation")})}finally{h({loading:!1})}},O=async K=>{const{callback:G}=K,Q=re(K,Hne);try{var Z;r.setPasskeysState({loading:!0}),h({loading:!0});const{options:ee}=await t.auth.webAuthnPreLogin(Q);ee.challenge=Gn(ee.challenge),ee.allowCredentials=(Z=ee.allowCredentials)==null?void 0:Z.map(ge=>F({},ge,{id:Gn(ge.id)})),h({error:void 0}),G==null||G(ee)}catch(ee){h({error:W(ee)}),G==null||G(null)}finally{r.setPasskeysState({loading:!1}),h({loading:!1})}},j=async K=>{const{callback:G}=K,Q=re(K,Wne);try{var Z;r.setPasskeysState({loading:!0}),h({loading:!0});const ge=Ii(Q.publicKey),pe=await t.auth.webAuthnPostLoginV2(F({},ge,{response:F({},ge.response,{userHandle:(Z=ge.response.userHandle)!=null?Z:void 0}),recaptchaToken:Q.recaptchaToken,invitationToken:Q.invitationToken})),{user:xe}=pe,Le=re(pe,Kne);if(Ns(xe,e.root.appName)){const{routes:Be,onRedirectTo:ye}=e.auth,we=await r.getMfaRequiredState(xe);r.setAuthState(we),ye(Be.loginUrl,{preserveQueryParams:!0})}else{var ee;xe.id&&localStorage.setItem("userId",xe.id),r.afterAuthenticationStateUpdate(F({user:xe},Le),{isAuthenticated:!0}),h({error:void 0});const Be={tenantId:xe.tenantId,userId:xe.id,authenticationType:"webauthn",createdAt:(ee=xe==null?void 0:xe.createdAt)!=null?ee:new Date,email:xe.email,name:xe.name};Dn(ln.LOGIN_COMPLETED,Be),await r.afterAuthNavigation(),G==null||G(!0)}}catch(ge){h({error:W(ge)}),G==null||G(null)}finally{r.setPasskeysState({loading:!1}),h({loading:!1})}},N=async K=>{const{callback:G}=K;try{h({loading:!0});const{options:Q}=await t.auth.webAuthnCreateNewDeviceSession();Q.user.id=Gn(Q.user.id),Q.challenge=Gn(Q.challenge),Q.excludeCredentials=[],G==null||G(Q)}catch(Q){h({error:W(Q)}),G==null||G(null)}finally{h({loading:!1})}},V=async K=>{const{callback:G}=K,Q=re(K,qne);try{h({loading:!0});const Z=Ii(Q.publicKey),ee=(Z==null?void 0:Z.authenticatorAttachment)==="platform"?rf.Platform:rf.CrossPlatform;await t.auth.verifyNewDeviceSession({id:Z.id,response:Z.response,deviceType:ee}),G==null||G(!0)}catch(Z){h({error:W(Z)}),G==null||G(null)}finally{h({loading:!1})}},k=async K=>{const{callback:G}=K;try{r.setAuthState({userIpData:{loading:!0}});const{ip:Q,country_code:Z}=await t.metadata.getCurrentUserIpMetadata();r.setAuthState({userIpData:{ip:Q,countryCode:Z,loading:!1}}),r.setAuthState({userIp:Q}),G==null||G({ip:Q,countryCode:Z})}catch{r.setAuthState({userIpData:{loading:!1}}),G==null||G(!1)}},$=async K=>{const{callback:G}=K,Q=re(K,Yne);h({loading:!0});try{var Z;const ee=await t.auth.preEnrollMFAWebAuthnForLogin(Q),ge=F({},ee.options,{challenge:Gn(ee.options.challenge),user:F({},ee.options.user,{id:Gn(ee.options.user.id)}),excludeCredentials:(Z=ee.options.excludeCredentials)==null?void 0:Z.map(pe=>F({},pe,{id:Gn(pe.id)}))});h({loading:!1}),G==null||G({options:ge,webauthnToken:ee.webauthnToken})}catch(ee){h({loading:!1,error:W(ee)}),G==null||G(null)}},M=async K=>{const{callback:G}=K,Q=re(K,Qne);h({loading:!0});try{const Z=Ii(Q.publicKey),ee=await t.auth.enrollMFAWebAuthnForLoginV2(F({},Q,{options:Z}));await te(ee),h({loading:!1}),G==null||G(!0)}catch(Z){h({loading:!1,error:W(Z)}),G==null||G(null)}},B=async K=>{const{callback:G}=K,Q=re(K,Xne);h({loading:!0});try{const Z=await t.auth.enrollMFAAuthenticatorAppForLoginV2(Q);await te(Z),h({loading:!1}),G==null||G(!0)}catch(Z){h({loading:!1,error:W(Z)}),G==null||G(null)}},H=async K=>{const{callback:G}=K,Q=re(K,Jne);h({loading:!0});try{const Z=await t.auth.preEnrollMFASMSForLogin(Q);r.setMfaState({otcToken:Z.otcToken,step:Dt.smsVerifyCode,phoneNumber:Z.phoneNumber}),h({loading:!1}),G==null||G(!0)}catch(Z){h({loading:!1,error:W(Z)}),G==null||G(null)}},X=async K=>{const{callback:G}=K,Q=re(K,Zne);h({loading:!0});try{const Z=await t.auth.enrollMFASMSForLoginV2(Q);await te(Z),h({loading:!1}),G==null||G(!0)}catch(Z){h({loading:!1,error:W(Z)}),G==null||G(null)}},te=async K=>{const{user:G,tenants:Q=[],activeTenant:Z}=K,ee={step:Dt.recoveryCode,loading:!1,error:void 0,saving:!1};
421G!=null&&G.recoveryCode&&(ee.recoveryCode=G.recoveryCode),r.setMfaState(ee),r.setUser(G),r.setTenantsState({tenants:Q,activeTenant:Z,loading:!1}),G.id&&localStorage.setItem("userId",G.id)},Y=async K=>{h({loading:!0});try{await t.auth.forgotPassword(K),h({loading:!1,error:void 0,step:Ye.breachedPasswordSuccess}),r.setAuthState({isAuthenticated:!1})}catch(G){h({loading:!1,error:W(G)})}},ae=async()=>{const{user:K}=e.auth;if(!(K!=null&&K.refreshToken)){s.setAccessToken(null),s.setUser(null),r.setAuthState({user:null,isAuthenticated:!1});return}try{const G={grant_type:"refresh_token",refresh_token:K==null?void 0:K.refreshToken},Q=await t.auth.exchangeOAuthTokensV2(G),Z=await c(Q.user);r.afterAuthenticationStateUpdate(F({},Q,{user:Z}),{isAuthenticated:!0})}catch{s.setAccessToken(null),s.setUser(null),r.setAuthState({user:null,isAuthenticated:!1})}},Ae=async()=>{try{const{routes:G,loginState:Q,onRedirectTo:Z}=e.auth,{user:ee,tenants:ge=[],activeTenant:pe}=await t.auth.refreshTokenV3();if(Ns(ee,e.root.appName)){const xe=await r.getMfaRequiredState(ee);r.setAuthState(xe),Z(G.loginUrl,{preserveQueryParams:!0})}else{const xe=await c(ee);if(await r.__shouldShowPromptPasskeys())r.setLoginState({step:Ye.promptPasskeys,loading:!1}),r.afterAuthenticationStateUpdate({user:xe,tenants:ge,activeTenant:pe},{isLoading:!1}),Z(G.loginUrl,{preserveQueryParams:!0});else{var K;ee.id&&localStorage.setItem("userId",ee.id);const Be=(K=localStorage.getItem("register-quick-login"))!=null?K:Q.quickLoginToRegister,ye=o(ee);r.afterAuthenticationStateUpdate({user:xe,tenants:ge,activeTenant:pe},{loginState:F({},Q,{quickLoginToRegister:Be,flow:ye?zn.RegisterQuickLogin:zn.Login}),isAuthenticated:!0}),await u({shouldNavigateToRegisterQuickLogin:ye,isSocialLoginRefreshToken:!0})}}}catch{s.setAccessToken(null),s.setUser(null),r.setAuthState({user:void 0,isAuthenticated:!1})}};return F({setLoginState:h,resetLoginState:p,requestAuthorize:m,requestAuthorizeSSR:S,preLogin:w,postLogin:A,login:C,logout:E,silentLogout:x,recoverMfa:R,quickSmsPasswordlessPreLogin:T,changePhoneNumberWithVerification:P,verifyChangePhoneNumber:I,passwordlessPreLogin:U,passwordlessPostLogin:L,verifyInviteToken:z,webAuthnPrelogin:O,webAuthnPostLogin:j,webAuthnCreateNewDeviceSession:N,webAuthnVerifyNewDeviceSession:V,getUserIP:k,preEnrollMFAWebAuthnForLogin:$,enrollMFAWebAuthnForLogin:M,enrollMFAAuthenticatorAppForLogin:B,preEnrollMFASMSForLogin:H,enrollMFASMSForLogin:X,handleEnrollMFAResponse:te,resetBreachedPassword:Y,refreshTokenForSocialLogins:async()=>{e.auth.hostedLoginBox?await ae():await Ae()},__refreshToken:l},Fne(e,t,n),Ane(e,t,n),Cne(e,t,n),xne(e,t),Pne(e,t,n),One(e,t,n),Lne(e,t,n),Une(e,t,n))},$D={step:Dt.verify,loading:!1,saving:!1},ere=e=>Ue($D,e),tre=["callback"],nre=["callback"],rre=["user"],sre=["deviceId"],ire=["deviceId"],ore=["callback"],are=["callback"],lre=["deviceId","callback"],jD=(e,t,n)=>{const r=n;async function s(A){const C=e.auth.mfaState.step;return{step:A.recoveryCode?Dt.recoveryCode:C,loading:!1,saving:!1,error:void 0,recoveryCode:A==null?void 0:A.recoveryCode}}const i=A=>{Object.assign(e.auth.mfaState,A)};return{setMfaState:i,resetMfaState:()=>{Ne(e,["auth","mfaState"],$D)},getMFADevices:async()=>{i({loading:!0});try{const A=await t.auth.getMFADevices();i({loading:!1,error:void 0,mfaDevices:A})}catch(A){i({loading:!1,error:W(A)})}},getMFAStrategies:async A=>{i({loading:!0});try{const E=(await Oe(()=>t.auth.getMFAStrategiesConfig(),A==null?void 0:A.retryConfig)).strategies.filter(({isActive:x})=>x).map(({strategy:x})=>x);i({loading:!1,error:void 0,mfaStrategies:E})}catch(C){i({loading:!1,error:W(C)})}},enrollMfa:async()=>{i({saving:!0});try{const{qrCode:A}=await t.auth.enrollMfa();i({saving:!1,error:void 0,qrCode:A})}catch(A){i({saving:!1,error:W(A)})}},verifyMfa:async A=>{const{callback:C}=A,E=re(A,tre);i({saving:!0});try{const x=e.auth.user,R=await t.auth.verifyMfa(E),T=await t.auth.getMFADevices(),P=await s(R);i(F({},P,{mfaDevices:T})),r.setUser(F({},x,{mfaEnrolled:!0})),C==null||C(P.recoveryCode)}catch(x){i({saving:!1,error:W(x)}),C==null||C(null,x)}}
421,verifyMfaAfterForce:async A=>{const{callback:C}=A,E=re(A,nre);i({loading:!0});try{const R=await t.auth.loginWithMfaV2(E),{user:T}=R,P=re(R,rre),I={step:Dt.recoveryCode,loading:!1,saving:!1,error:void 0};if(T!=null&&T.recoveryCode&&(I.recoveryCode=T.recoveryCode),i(I),await r.afterAuthenticationStateUpdate(F({user:T},P)),T!=null&&T.accessToken){var x;const U={tenantId:T==null?void 0:T.tenantId,userId:T==null?void 0:T.id,authenticationType:"mfa",createdAt:(x=T==null?void 0:T.createdAt)!=null?x:new Date,email:T==null?void 0:T.email,name:T==null?void 0:T.name};Dn(ln.LOGIN_COMPLETED,U)}C==null||C(I.recoveryCode)}catch(R){i({loading:!1,error:W(R)}),C==null||C(null,R)}},disableMfa:async A=>{i({saving:!0});try{var C;await t.auth.disableMfa(A);const x=await t.auth.getMFADevices();i({saving:!1,error:void 0,mfaDevices:x}),(C=A.callback)==null||C.call(A,!0)}catch(x){var E;i({saving:!1,error:W(x)}),(E=A.callback)==null||E.call(A,!1,x)}},preDisableMfaSms:async A=>{const{deviceId:C}=A,E=re(A,sre);i({saving:!0});try{var x;const T=await t.auth.preDisableMFASMS(C);i({saving:!1,error:void 0,otcToken:T.otcToken,phoneNumber:T.phoneNumber}),(x=E.callback)==null||x.call(E,!0)}catch(T){var R;i({saving:!1,error:W(T)}),(R=E.callback)==null||R.call(E,!1,T)}},disableMfaSms:async A=>{const{deviceId:C}=A,E=re(A,ire);i({saving:!0});try{var x;await t.auth.disableMFASMS(C,E);const T=await t.auth.getMFADevices();i({saving:!1,error:void 0,mfaDevices:T}),(x=E.callback)==null||x.call(E,!0)}catch(T){var R;i({saving:!1,error:W(T)}),(R=E.callback)==null||R.call(E,!1,T)}},preEnrollMfaSms:async A=>{i({saving:!0});try{var C;const x=await t.auth.preEnrollMFASMS(A);i({saving:!1,error:void 0,otcToken:x.otcToken,phoneNumber:x.phoneNumber}),(C=A.callback)==null||C.call(A,!0)}catch(x){var E;i({saving:!1,error:W(x)}),(E=A.callback)==null||E.call(A,!1,x)}},enrollMfaSms:async A=>{const{callback:C}=A,E=re(A,ore);i({saving:!0});try{const x=await t.auth.enrollMFASMS(E),R=await t.auth.getMFADevices(),T=await s(x);i(F({},T,{mfaDevices:R})),C==null||C(T.recoveryCode)}catch(x){i({saving:!1,error:W(x)}),C==null||C(null,x)}},preEnrollMfaWebAuthn:async A=>{i({saving:!0});try{var C,E;const R=await t.auth.preEnrollMFAWebAuthn(),T=F({},R.options,{challenge:Gn(R.options.challenge),user:F({},R.options.user,{id:Gn(R.options.user.id)}),excludeCredentials:(C=R.options.excludeCredentials)==null?void 0:C.map(P=>F({},P,{id:Gn(P.id)}))});i({saving:!1}),(E=A.callback)==null||E.call(A,{options:T,webauthnToken:R.webauthnToken})}catch(R){var x;i({saving:!1,error:W(R)}),(x=A.callback)==null||x.call(A,null,R)}},enrollMfaWebAuthn:async A=>{const{callback:C}=A,E=re(A,are);i({saving:!0});try{const x=Ii(E.publicKey),R=await t.auth.enrollMFAWebAuthn(F({},E,{options:x})),T=await t.auth.getMFADevices(),P=await s(R);i(F({},P,{mfaDevices:T})),C==null||C(P.recoveryCode)}catch(x){i({saving:!1,error:W(x)}),C==null||C(null,x)}},preDisableMfaWebAuthn:async A=>{const{deviceId:C,callback:E}=A;i({saving:!0});try{var x;const R=await t.auth.preDisableMFAWebAuthn(C),T=F({},R.options,{challenge:Gn(R.options.challenge),allowCredentials:(x=R.options.allowCredentials)==null?void 0:x.map(P=>F({},P,{id:Gn(P.id)}))});i({saving:!1}),E==null||E({options:T,webauthnToken:R.webauthnToken})}catch(R){i({saving:!1,error:W(R)}),E==null||E(null,R)}},disableMfaWebAuthn:async A=>{const{deviceId:C,callback:E}=A,x=re(A,lre);i({saving:!0});try{const R=Ii(x.publicKey);await t.auth.disableMFAWebAuthn(C,F({},x,{options:R}));const T=await t.auth.getMFADevices();i({saving:!1,error:void 0,mfaDevices:T}),E==null||E(!0)}catch(R){i({saving:!1,error:W(R)}),E==null||E(!1,R)}},__getMfaStateAfterEnroll:s}},o1={loaders:{},errors:{},accounts:{tenantId:"",children:[]},accountsQueryParams:{_limit:50,_offset:0,_filter:"",_subTenantId:""},searchAccountsData:[],rootAccount:{tenantId:""},selectedAccount:{tenantId:"",userJwt:{accessToken:"",expiresIn:0,expires:""},users:[],usersQueryParams:{_offset:0,_limit:10,_order:Xg.DESC,_sortBy:rm.name},usersPageOffset:0,accountSettings:{}}},cre=e=>Ue(o1,e);let Jt;(function(e){e.GET_ACCOUNTS="GET_ACCOUNTS",e.SEARCH_ACCOUNTS="SEARCH_ACCOUNTS",e.SET_ROOT_A
421CCOUNT_DATA="SET_ROOT_ACCOUNT_DATA",e.SET_SELECTED_SUB_ACCOUNT_DATA="SET_SELECTED_SUB_ACCOUNT_DATA",e.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT="LOAD_NUMBER_OF_USERS_FOR_ACCOUNT",e.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER="UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER",e.CREATE_SUB_ACCOUNT="CREATE_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT="UPDATE_SUB_ACCOUNT",e.DELETE_SUB_ACCOUNT="DELETE_SUB_ACCOUNT",e.GET_ACCOUNT_USERS="GET_ACCOUNT_USERS",e.ADD_USERS_TO_ACCOUNT="ADD_USERS_TO_ACCOUNT",e.DELETE_USERS_FROM_ACCOUNT="DELETE_USERS_FROM_ACCOUNT",e.SET_USER_ROLES_FOR_SUB_ACCOUNT="SET_USER_ROLES_FOR_SUB_ACCOUNT",e.UPDATE_SUB_ACCOUNT_SETTINGS="UPDATE_SUB_ACCOUNT_SETTINGS",e.UPDATE_SUB_ACCOUNT_MANAGEMENT="UPDATE_SUB_ACCOUNT_MANAGEMENT",e.UPDATE_SUB_ACCOUNT_HIERARCHY_SETTINGS="UPDATE_SUB_ACCOUNT_HIERARCHY_SETTINGS",e.GET_USER_JWT="GET_USER_JWT",e.GET_TEAM_USERS="GET_TEAM_USERS"})(Jt||(Jt={}));function Al(e,t,n){var r,s;if(e.tenantId===t){var i;const a=[...(i=e==null?void 0:e.children)!=null?i:[],...n].filter((l,c,u)=>c===u.findIndex(d=>d.tenantId===l.tenantId));return F({},e,{children:a})}return F({},e,{children:(r=e==null||(s=e.children)==null?void 0:s.map(o=>Al(o,t,n)))!=null?r:[]})}const fT=({items:e},t)=>e.map(n=>{var r,s;return{name:n.name,tenantId:n.tenantId,numberOfUsers:(r=(s=t.find(i=>i.tenantId===n.tenantId))==null?void 0:s.totalUsers)!=null?r:0,createdAt:n.createdAt,metadata:n.metadata,isReseller:n.isReseller,subAccountAccessType:n.subAccountAccessType}});function $p(e,t){var n;return F({},e,{children:(n=e.children)!=null&&n.length?e.children.filter(r=>r.tenantId!==t).map(r=>$p(r,t)):[]})}const jp=(e,t,n)=>{var r,s;return e.tenantId===t?F({},e,{name:n}):F({},e,{children:(r=e==null||(s=e.children)==null?void 0:s.map(i=>jp(i,t,n)))!=null?r:[]})},Vp=(e,t,n)=>{var r,s;return e.tenantId===t?F({},e,{subAccountAccessType:n}):F({},e,{children:(r=e==null||(s=e.children)==null?void 0:s.map(i=>Vp(i,t,n)))!=null?r:[]})},Bp=(e,t,n)=>{var r,s;return e?e.tenantId===t?F({},e,{isReseller:n}):F({},e,{children:(r=e==null||(s=e.children)==null?void 0:s.map(i=>Bp(i,t,n)))!=null?r:[]}):{}},VD=(e,t,n)=>{const r=P=>{Object.assign(e.auth.allAccountsState,{loaders:F({},e.auth.allAccountsState.loaders,{[P.key]:P.value})})},s=P=>{Object.assign(e.auth.allAccountsState,{errors:F({},e.auth.allAccountsState.errors,{[P.key]:P.value}),loaders:F({},e.auth.allAccountsState.loaders,{[P.key]:!1})})},i=P=>{Object.assign(e.auth.allAccountsState,P)},o=P=>{Object.assign(e.auth.allAccountsState.selectedAccount,P)},a=()=>{Ne(e,["auth","allAccountsState"],o1)},l=()=>{Ne(e,["auth","allAccountsState","selectedAccount"],o1.selectedAccount)},c=()=>e.auth.allAccountsState,u=async P=>{const I=Jt.GET_ACCOUNTS;r({key:I,value:!0});const{accountsQueryParams:U}=c(),{jwt:L,_limit:z,_offset:O}=P,j={_offset:O??U._offset,_limit:z??U._limit,_subTenantId:P==null?void 0:P._subTenantId};try{if(!!L){var N;const{selectedAccount:$}=c(),{items:M,_links:B}=await t.tenants.searchSubTenants(j,{jwt:L}),H=await t.tenants.getTenantsUsersCount({tenantIds:M.map(Y=>Y.tenantId)},{jwt:L}),X=fT({items:M},H),te=Al($.accounts?$.accounts:$,(N=P==null?void 0:P._subTenantId)!=null?N:"",X.map(Y=>({name:Y.name,tenantId:Y.tenantId,numberOfUsers:Y.numberOfUsers,createdAt:Y.createdAt,metadata:Y.metadata,children:[],loadMoreLink:B==null?void 0:B.next,isReseller:Y.isReseller})));o({accounts:te})}else{var V;const{accounts:$}=c(),{items:M,_links:B}=await t.tenants.searchSubTenants(j),H=await t.tenants.getTenantsUsersCount({tenantIds:M.map(Y=>Y.tenantId)}),X=fT({items:M},H),te=Al($,(V=P==null?void 0:P._subTenantId)!=null?V:"",X.map(Y=>({name:Y.name,tenantId:Y.tenantId,numberOfUsers:Y.numberOfUsers,createdAt:Y.createdAt,metadata:Y.metadata,children:[],loadMoreLink:B==null?void 0:B.next,isReseller:Y.isReseller})));i({accounts:te})}}catch(k){s({key:I,value:W(k)})}finally{r({key:I,value:!1})}},d=async P=>{const{jwt:I}=P,U=Jt.SEARCH_ACCOUNTS;r({key:U,value:!0});const{rootAccount:L}=c();try{if(P!=null&&P._subTenantId){var z;const{items:O}=await t.tenants.searchSubTenants({_offset:0,_limit:50,_filter:(z=P==null?void 0:P._filter)!=null?z:"",_subTenantId:P._subTenantId},{jwt:I});i({searchAccountsData:[...O,{name:L.name,tenantId:L.tenantId}]})}}catch(O){s({key:U,value:W(O)})}finally{r({key:U,value:!1})}},f=async P=>{const I=Jt.UPDATE_SUB_ACCOUNT_ACCESS_FOR_USER;r({key:I,value:!0});const{selectedAccount:U}
421=c(),{userId:L,allowAccess:z,jwt:O,callback:j}=P;try{var N;await t.subTenants.updateSubAccountAccess(L,{allowAccess:z},{jwt:O}),o({users:U==null||(N=U.users)==null?void 0:N.map(V=>V.id===L?F({},V,{subAccountAccessAllowed:z}):V)}),j==null||j(!0)}catch(V){s({key:I,value:W(V)}),j==null||j(!1)}finally{r({key:I,value:!1})}},g=async P=>{const I=Jt.CREATE_SUB_ACCOUNT;r({key:I,value:!0});const{name:U,parentTenantId:L,tenantId:z,jwt:O,callback:j}=P;try{if(!!O){const{accounts:V,selectedAccount:k}=c(),$=await t.subTenants.createSubTenant({name:U,parentTenantId:L,tenantId:z},{jwt:O}),M=Al(V,L??"",[{name:$.name,tenantId:$.tenantId,numberOfUsers:0,createdAt:new Date}]),B=Al(F({name:"",tenantId:""},k==null?void 0:k.accounts),L??"",[{name:$.name,tenantId:$.tenantId,numberOfUsers:0,createdAt:new Date}]);i({accounts:M}),o({accounts:B})}else{const{accounts:V}=c(),k=await t.subTenants.createSubTenant({name:U,tenantId:z,parentTenantId:L}),$=Al(V,L??"",[{name:k.name,tenantId:k.tenantId,numberOfUsers:0,createdAt:new Date}]);i({accounts:$})}j==null||j(!0)}
421catch(N){s({key:I,value:W(N)}),j==null||j(!1)}finally{r({key:I,value:!1})}},h=async P=>{},p=async P=>{const I=Jt.DELETE_SUB_ACCOUNT;r({key:I,value:!0});const{jwt:U,tenantId:L,callback:z}=P;try{if(!!U){const{selectedAccount:j,accounts:N}=c();await t.subTenants.deleteSubTenant(L,{jwt:U});const V=$p(N,L),k=$p(j.accounts,L);i({accounts:V}),o({accounts:k})}else{const{accounts:j}=c();await t.subTenants.deleteSubTenant(L);const N=$p(j,L);i({accounts:N})}z==null||z(!0)}catch(O){s({key:I,value:W(O)}),z==null||z(!1)}finally{r({key:I,value:!1})}},v=async P=>{const I=Jt.UPDATE_SUB_ACCOUNT_HIERARCHY_SETTINGS;r({key:I,value:!0});const{jwt:U,callback:L,tenantId:z,subAccountAccessType:O}=P;if(O)try{if(!!U){const{selectedAccount:N,accounts:V}=c();await t.subTenants.updateSubTenantHierarchySettings({tenantId:z},{subAccountAccessType:O},{jwt:U});const k=Vp(N.accounts,z,O);o({subAccountAccessType:O,accounts:k});const $=Vp(V,z,O);i({accounts:$})}else{const{accounts:N}=c();await t.subTenants.updateSubTenantHierarchySettings({tenantId:z},{subAccountAccessType:O});const V=Vp(N,z,O);i({accounts:V})}L==null||L(!0)}catch(j){s({key:I,value:W(j)}),L==null||L(!1)}finally{r({key:I,value:!1})}},m=async P=>{const I=Jt.UPDATE_SUB_ACCOUNT_HIERARCHY_SETTINGS;r({key:I,value:!0});const{jwt:U,name:L,callback:z,tenantId:O}=P;try{if(!!U){const{selectedAccount:N,accounts:V}=c();await t.subTenants.updateSubTenant({tenantId:O},{name:L},{jwt:U});const k=jp(N.accounts,O,L);o({name:L,accounts:k});const $=jp(V,O,L);i({accounts:$})}else{const{accounts:N}=c();await t.subTenants.updateSubTenant({tenantId:O},{name:L});const V=jp(N,O,L);i({accounts:V})}z==null||z(!0)}catch(j){s({key:I,value:W(j)}),z==null||z(!1)}finally{r({key:I,value:!1})}},S=async P=>{const I=Jt.UPDATE_SUB_ACCOUNT_MANAGEMENT;n.setAllAccountsLoader({key:I,value:!0});const{jwt:U,isReseller:L,callback:z,tenantId:O,shouldUpdateSelectedAccount:j}=P,N=!!U;try{if(j){const{selectedAccount:V,accounts:k}=e.auth.allAccountsState;await t.subTenants.updateSubTenantManagement({tenantId:O},{isReseller:L},U?{jwt:U}:void 0);const $=Bp(V.accounts,O,L??!1);o({accounts:$}),N||o({isReseller:L});const M=Bp(k,O,L??!1);i({accounts:M})}else{const{accounts:V}=e.auth.allAccountsState;t.subTenants.updateSubTenantManagement({tenantId:O},{isReseller:L},U?{jwt:U}:void 0);const k=Bp(V,O,L??!1);i({accounts:k})}z==null||z(!0)}catch(V){s({key:I,value:W(V)}),z==null||z(!1)}finally{r({key:I,value:!1})}},b=async P=>{const{users:I,tenantId:U,jwt:L,callback:z,allowSubAccountAccess:O=!1,roleIds:j}=P,N=Jt.ADD_USERS_TO_ACCOUNT;try{r({key:N,value:!0}),await t.subTenants.addUsersToSubTenant({users:I,tenantId:U,allowSubAccountAccess:O,roleIds:j},{jwt:L}),await w({jwt:L,_tenantId:U}),z==null||z(!0)}catch(V){s({key:N,value:W(V)}),z==null||z(!1)}finally{r({key:N,value:!1})}},w=async P=>{var I,U,L,z,O,j,N,V;const{jwt:k,_tenantId:$,_email:M}=P,B=Jt.GET_ACCOUNT_USERS;r({key:B,value:!0});const H=c(),X=(I=(U=P==null?void 0:P._offset)!=null?U:H==null||(L=H.selectedAccount)==null||(z=L.usersQueryParams)==null?void 0:z._offset)!=null?I:0,te=(O=(j=P==null?void 0:P._limit)!=null?j:H==null||(N=H.selectedAccount)==null||(V=N.usersQueryParams)==null?void 0:V._limit)!=null?O:10,Y=F({_offset:X,_limit:te,_tenantId:$,_includeSubTenants:!1},!!M&&{_email:M});try{const{items:ae,_metadata:{totalItems:Ae,totalPages:oe}}=await t.users.getUsersV3(Y,{jwt:k}),K={totalUsersItems:Ae,totalUsersPages:oe,usersQueryParams:F({_offset:X??0,_limit:te??10},!!M&&{_email:M})};if(ae.length){const G=ae.map(ge=>ge.id),Q=await t.roles.getRoles(),Z=await t.users.getUsersRoles({ids:G},{jwt:k}),ee=ae.map(ge=>{var pe,xe;const Le=Z==null||(pe=Z.find(Be=>Be.userId===ge.id))==null?void 0:pe.roleIds;return F({},ge,{roles:(xe=Le==null?void 0:Le.map(Be=>{var ye;return(ye=Q==null?void 0:Q.find(we=>we.id===Be))!=null?ye:[]}))!=null?xe:[]})});o(F({users:ee},K))}else o(F({users:[]},K))}catch(ae){s({key:B,value:W(ae)})}finally{r({key:B,value:!1})}};return{setAllAccountsLoader:r,setAllAccountsError:s,setAllAccountsState:i,setSelectedAccountState:o,resetAllAccountsState:a,clearSelectedAccount:l,loadAccounts:u,searchAccounts:d,updateSubAccountAccessForUser:f,createSubAccount:g,updateSubAccount:h,deleteSubAccount:p,updateSubAccountSettings:m,updateSubAccountManagement:S,updateSubAccountHierarchySettings:v,addUsersToAccount:b,getAccountUsers:w,deleteUsersFromAccount:async P=>
421{const I=Jt.DELETE_USERS_FROM_ACCOUNT;r({key:I,value:!0});const{userId:U,subTenants:L,jwt:z,callback:O}=P;try{await t.subTenants.removeUserFromTenantAndSubTenants({userId:U,subTenants:L},{jwt:z}),await w({jwt:z,_tenantId:L[0].tenantId}),O==null||O(!0)}catch(j){s({key:I,value:W(j)}),O==null||O(!1)}finally{r({key:I,value:!1})}},setUserRolesForSubAccount:async P=>{const{userId:I,subTenantsRoles:U,jwt:L,callback:z}=P,O=Jt.SET_USER_ROLES_FOR_SUB_ACCOUNT;try{r({key:O,value:!0});const{selectedAccount:j}=c();await t.subTenants.setUserRolesForSubTenants(I,{subTenantsRoles:U},{jwt:L}),await w({jwt:L,_tenantId:j.tenantId}),z==null||z(!0)}catch(j){s({key:O,value:W(j)}),z==null||z(!1)}finally{r({key:O,value:!1})}},getUserJwtForSubAccount:async P=>{const{tenantId:I,callback:U}=P,L=Jt.GET_USER_JWT;try{r({key:L,value:!0});const z=await t.users.GetUserJwt({tenantId:I});o({userJwt:z,accessPermission:!0}),U==null||U(!0)}catch(z){s({key:L,value:W(z)}),o({accessPermission:!1}),U==null||U(!1)}finally{r({key:L,value:!1})}},setRootAccountData:async()=>{const P=Jt.SET_ROOT_ACCOUNT_DATA;r({key:P,value:!0});const{activeTenant:I}=e.auth.tenantsState,{accounts:U}=c();if(I)try{var L;const z=await t.tenants.getTenantsUsersCount({tenantIds:[I==null?void 0:I.tenantId]}),O={name:I==null?void 0:I.name,tenantId:I==null?void 0:I.tenantId,numberOfUsers:(L=z[0])==null?void 0:L.totalUsers,createdAt:I==null?void 0:I.createdAt};i({rootAccount:O,accounts:F({},U,O)})}catch(z){s({key:P,value:W(z)})}finally{r({key:P,value:!1})}},setSelectedSubAccountData:async P=>{const{jwt:I}=P,U=Jt.SET_SELECTED_SUB_ACCOUNT_DATA;try{var L,z,O,j,N,V,k;r({key:U,value:!0});const $=await t.accountSettings.getSettings({jwt:I}),[M,B,H]=await Promise.all([t.tenants.getTenantsUsersCount({tenantIds:[(L=$==null?void 0:$.tenantId)!=null?L:""]},{jwt:I}),t.tenants.getParentTenants({jwt:I}),t.tenants.getHierarchyMetadata({_tenantIds:[(z=$==null?void 0:$.tenantId)!=null?z:""]},{jwt:I})]);o({tenantId:(O=$.tenantId)!=null?O:"",name:$.name,numberOfUsersObject:M[0],parentsAccounts:B,numberOfSubAccounts:(j=H[0])==null?void 0:j.totalSubTenants,accountSettings:$,accounts:{name:$.name,tenantId:(N=$.tenantId)!=null?N:"",numberOfUsers:(V=M[0])==null?void 0:V.totalUsers,createdAt:void 0,children:[]}}),await w({jwt:I,_tenantId:(k=$==null?void 0:$.tenantId)!=null?k:""})}catch($){s({key:U,value:W($)})}finally{r({key:U,value:!1})}},loadNumberOfUsersForSelectedSubAccount:async P=>{const{tenantId:I,jwt:U}=P,L=Jt.LOAD_NUMBER_OF_USERS_FOR_ACCOUNT;try{r({key:L,value:!0});const z=await t.tenants.getTenantsUsersCount({tenantIds:[I]},{jwt:U});o({numberOfUsersObject:z[0]})}catch(z){s({key:L,value:W(z)})}finally{r({key:L,value:!1})}}}},rs={createSubAccountDialog:{loading:!1,open:!1,error:!1,jwt:"",canSelectParentAccount:!1},updateSubAccountDialog:{accountId:"",accountName:"",loading:!1,open:!1,error:!1,jwt:""},disableSubAccountManagementDialog:{accountId:"",accountName:"",loading:!1,open:!1,error:!1},enableSubAccountManagementDialog:{accountId:"",accountName:"",loading:!1,open:!1,error:!1},updateSubAccountHierarchySettingsDialog:{accountId:"",accountName:"",subAccountAccessType:tm.DEFAULT_OFF,loading:!1,open:!1,error:!1},deleteSubAccountDialog:{accountId:"",accountName:"",isParentAccount:!1,loading:!1,open:!1,error:!1,jwt:""},addUsersToAccountDialog:{loading:!1,open:!1,accountName:"",accountId:"",permissionToGiveAccessToSubAccounts:!1,jwt:""},deleteUserFromAccountDialog:{userId:"",userName:"",accountId:"",loading:!1,open:!1,jwt:""},editUserRolesDialog:{loading:!1,open:!1,jwt:"",accountId:"",userId:"",userName:"",userRoles:[]}},ure=e=>Ue(rs,e),BD=(e,t,n)=>({setAllAccountDialogsState:E=>{Object.assign(e.auth.allAccountsDialogsState,E)},resetAllAccountDialogsState:()=>{Ne(e,["auth","allAccountsDialogsState"],rs)},openCreateSubAccountDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.createSubAccountDialog,F({},E,{open:!0}))},closeCreateSubAccountDialog:()=>{Ne(e,["auth","allAccountsDialogsState","createSubAccountDialog"],rs.createSubAccountDialog)},openUpdateSubAccountDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.updateSubAccountDialog,F({},E,{open:!0}))},closeUpdateSubAccountDialog:()=>{Ne(e,["auth","allAccountsDialogsState","updateSubAccountDialog"],rs.updateSubAccountDialog)},openEnableSubAccountManagementDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.enableSubAccountManagementDialog,F({},E,{open:!0}))},closeEnableSubAccountManagementDialog:()=>{Ne(e,["auth","allAccountsDialogsState","enableSubAccountManagementDialog"],rs.enableSubAccountManagementDialog)},openUpdateSubAccountHierarchySettingsDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.updateSubAccountHierarchySettingsDialog,F({},E,{open:!0}))},closeUpdateSubAccountHierarchySettingsDialog:()=>{Ne(e,["auth","allAccountsDialogsState","updateSubAccountHierarchySettingsDialog"],rs.updateSubAccountHierarchySettingsDialog)},openDisableSubAccountManagementDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.disableSubAccountManagementDialog,F({},E,{open:!0}))},closeDisableSubAccountManagementDialog:()=>{Ne(e,["auth","allAccountsDialogsState","disableSubAccountManagementDialog"],rs.disableSubAccountManagementDialog)},openDeleteSubAccountDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.deleteSubAccountDialog,F({},E,{open:!0}))},closeDeleteSubAccountDialog:()=>{Ne(e,["auth","allAccountsDialogsState","deleteSubAccountDialog"],rs.deleteSubAccountDialog)},openAddUsersToAccountDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.addUsersToAccountDialog,F({},E,{open:!0}))},closeAddUsersToAccountDialog:()=>{Ne(e,["auth","allAccountsDialogsState","addUsersToAccountDialog"],rs.addUsersToAccountDialog)},openDeleteUserFromAccountDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.deleteUserFromAccountDialog,F({},E,{open:!0}))},closeDeleteUserFromAccountDialog:()=>{Ne(e,["auth","allAccountsDialogsState","deleteUserFromAccountDialog"],rs.deleteUserFromAccountDialog)},openEditUserRolesDialog:E=>{Object.assign(e.auth.allAccountsDialogsState.editUserRolesDialog,F({},E,{open:!0}))},closeEditUserRolesDialog:()=>{Ne(e,["auth","allAccountsDialogsState","editUserRolesDialog"],rs.editUserRolesDialog)}}),zD={devices:[],loading:!1,error:null},dre=e=>Ue(zD,e),GD=(e,t,n)=>{const r=n,s=u=>{Object.assign(e.auth.passkeysState,u)},i=()=>{Ne(e,["auth","passkeysState"],zD)},o=async()=>{s({loading:!0});try{const{devices:u}=await t.auth.getWebAuthnDevices();s({devices:u,loading:!1})}catch(u){s({loading:!1,error:W(u,null)})}},a=async u=>{const{callback:d,deviceId:f}=u;s({loading:!0});try{await t.auth.deleteWebAuthnDevice(f);const h=e.auth.passkeysState.devices.filter(p=>p.id!==f);s({devices:h,loading:!1}),d==null||d(!0)}catch(g){s({loading:!1,error:W(g,null)}),d==null||d(null,g)}};async function l(u){var d;return!!(u!=null&&(d=u.secondaryAuthStrategies)!=null&&d.some(({isActive:f,strategy:g})=>f&&g===em.Passkeys))}async function c(){const{publicAuthStrategyPolicy:u}=e.auth.securityPolicyState,{policy:d}=u,f=await l(d),g=localStorage.getItem("preferred-login-method")==="Passkeys",h=localStorage.getItem("dont-show-again-prompt-passkeys")==="true",[p]=await r.getFeatureFlags(["show-passkeys-new"]);if(!p||!f||g||h)return!1;{const{devices:v}=await t.auth.getWebAuthnDevices();return s({devices:v??[]}),(v!=null&&v.length?v.length:0)===0}}return{setPasskeysState:s,resetPasskeysState:i,loadWebAuthnDevices:o,deleteWebAuthnDevice:a,__shouldShowPromptPasskeys:c}},HD={loading:!1,error:null},fre=e=>Ue(HD,e),hre=["callback","profilePictureUrl"],WD=(e,t,n)=>{const r=n,s=d=>{Object.assign(e.auth.profileState,d)};return{setProfileState:s,resetProfileState:()=>{Ne(e,["auth","profileState"],HD)},loadProfile:async()=>{s({loading:!0});try{const d=await sm(t.auth.getMeAndEntitlements,3,2e3),f=e.auth.user,g=F({},f,d);r.setUser(g),s({profile:d,loading:!1})}catch(d){s({loading:!1,error:W(d)})}},saveProfile:async d=>{const{callback:f,profilePictureUrl:g}=d,h=re(d,hre);s({saving:!0,error:null,loading:!0});try{var p;const v=(p=e.auth.profileState.profile)!=null?p:{};let m=v.profilePictureUrl;if(g!==v.profilePictureUrl&&g&&(g||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)){const E=M5(g,"image");if(E){m=await t.teams.updateProfileImage(E);const x=Date.now().toString(),R=new URL(m);R.searchParams.set("t",x),m=R.href}}const S=F({},v,h,{profilePictureUrl:m});await t.users.updateUserProfileV2(S);const b=e.auth.user,w=await sm(t.auth.getMeAndEntitlements,3,2e3),A=F({},b,w);r.setUser(A),r.setProfileState({profile:w,saving:!1,loading:!1}),f==null||f(w)}catch(v){s({saving:!1,error:W(v),loading:!1}),f==null||f(null,v)}},changePassword:async d=>{s({loading:!0});try{var f;await t.teams.changePassword(d),s({loading:!1,error:void 0}),(f=d.callback)==null||f.call(d,!0)}catch(h){var g;s({loading:!1,error:W(h)}),(g=d.callback)==null||g.call(d,null,h)}},updateEmail:async d=>{const{email:f,callback:g}=d;s({saving:!0,error:null,loading:!0});try{await t.teams.updateEmail(f),s({saving:!1,error:null,loading:!1}),g==null||g(!0)}catch(h){s({saving:!1,error:W(h),loading:!1}),g==null||g(null,h)}},verifyEmail:async d=>{const{email:f,code:g,callback:h}=d;s({saving:!0,error:null,loading:!0});try{await t.teams.verifyEmail(f,g),await r.__refreshToken(),s({saving:!1,error:null,loading:!1}),h==null||h(!0)}
421catch(p){s({saving:!1,error:W(p),loading:!1}),h==null||h(null,p)}}}},KD={loading:!1},pre=e=>Ue(KD,e),gre=["callback"],mre=["id"],qD=(e,t,n)=>{const r=u=>{Object.assign(e.auth.provisioningState,u)},s=()=>{Ne(e,["auth","provisioningState"],KD)},i=async(u,d)=>{const{count:f}=await Oe(()=>t.directory.countConfigurationUsers(u.id),d);return F({},u,{count:f})};return{setProvisioningState:r,resetProvisioningState:s,__loadCountForConnection:i,loadProvisionConnections:async u=>{r({loading:!0,error:null});try{const d=u==null?void 0:u.retryConfig,f=await Oe(()=>t.directory.getConfigs(),d),g=await Promise.all(f.map(h=>i(h,d)));r({connections:g,loading:!1})}catch(d){r({error:W(d),loading:!1})}},createProvisionConnection:async u=>{const{callback:d}=u,f=re(u,gre);r({loading:!0,error:null});try{const g=await t.directory.createConfiguration(f),h=await t.directory.getConfigs(),p=await Promise.all(h.map(v=>i(v)));r({connections:p,loading:!1}),d==null||d(g)}catch(g){r({error:W(g),loading:!1})}},deleteProvisionConnection:async u=>{const{id:d,callback:f}=u;r({loading:!0,error:null});try{await t.directory.deleteConfiguration(d,u.deleteAll);const g=await t.directory.getConfigs(),h=await Promise.all(g.map(p=>i(p)));r({connections:h,loading:!1}),f==null||f(!0)}catch(g){r({error:W(g),loading:!1}),f==null||f(!1,g)}},updateProvisionConnection:async u=>{const{id:d}=u,f=re(u,mre);r({loading:!0,error:null});try{await t.directory.updateConfiguration(d,f);const g=await t.directory.getConfigs(),h=await Promise.all(g.map(p=>i(p)));r({connections:h,loading:!1})}catch(g){r({error:W(g),loading:!1})}}}};let Gc;(function(e){e.ResetPhoneNumber="ResetPhoneNumber",e.VerifyResetPhoneNumber="VerifyResetPhoneNumber",e.ChangePhoneNumber="ChangePhoneNumber"})(Gc||(Gc={}));const YD={step:Gc.ResetPhoneNumber,loading:!1},vre=e=>Ue(YD,e),yre=["callback"],Sre=["callback"],bre=["callback"],QD=(e,t,n)=>{const r=n,s=c=>{Object.assign(e.auth.resetPhoneNumberState,c)};return{setResetPhoneNumberState:s,resetResetPhoneNumberState:()=>{Ne(e,["auth","resetPhoneNumberState"],YD)},resetPhoneNumber:async c=>{const{callback:u}=c,d=re(c,yre);s({loading:!0});try{const f=await t.auth.resetPhoneNumber(d);s({loading:!1,error:void 0,resetPhoneNumberToken:f.resetPhoneNumberToken,step:Gc.VerifyResetPhoneNumber}),r.setLoginState({email:d.email})}catch(f){s({loading:!1,error:W(f)}),u==null||u(null,f)}},verifyResetPhoneNumber:async c=>{const{callback:u}=c,d=re(c,Sre);s({loading:!0});try{const f=await t.auth.verifyResetPhoneNumber(d);s({loading:!1,error:void 0,changePhoneNumberToken:f.changePhoneNumberToken,step:Gc.ChangePhoneNumber}),u==null||u(!0)}catch(f){s({loading:!1,error:W(f)}),u==null||u(null,f)}},changePhoneNumber:async c=>{const{callback:u}=c,d=re(c,bre);s({loading:!0});try{const{onRedirectTo:f,routes:g}=e.auth;await t.auth.changePhoneNumber({phoneNumber:d.phoneNumber,changePhoneNumberToken:d.changePhoneNumberToken}),r.setLoginState({step:Ye.loginWithSmsOtc}),await r.passwordlessPreLogin({type:at.SmsCode,email:d.email,recaptchaToken:d.recaptchaToken}),f(g.loginUrl),s({loading:!1}),u==null||u(!0)}catch(f){s({loading:!1,error:W(f)}),u==null||u(null,f)}}}},XD={loaders:{},errors:{},roles:[],permissions:[],permissionCategories:[]},_re=e=>Ue(XD,e);let cs;(function(e){e.EDIT_ROLE_DIALOG="editRoleDialog",e.DELETE_ROLE_DIALOG="deleteRoleDialog",e.LOAD_ROLES="loadRoles",e.ADD_ROLE="addRole",e.MANAGE_PERMISSIONS="managePermissions"})(cs||(cs={}));const wre=["callback"],Ere=["callback"],Are=["callback"],Cre=["callback"],xre=["callback"],Tre=["callback"],JD=(e,t,n)=>{const r=h=>{Object.assign(e.auth.rolesState,h)},s=()=>{Ne(e,["auth","rolesState"],XD)},i=h=>{Object.assign(e.auth.rolesState,{loaders:F({},e.auth.rolesState.loaders,{[h.key]:h.value})})},o=h=>{Object.assign(e.auth.rolesState,{errors:F({},e.auth.rolesState.errors,{[h.key]:h.value}),loaders:F({},e.auth.rolesState.loaders,{[h.key]:!1})})},a=async h=>{var p;const v=cs.LOAD_ROLES;i({key:v,value:!((p=h==null?void 0:h.silentLoading)!=null&&p)});try{const m=h==null?void 0:h.retryConfig,[S,b,w]=await Promise.all([Oe(()=>t.roles.getRoles(),m),Oe(()=>t.roles.getPermissions(),m),Oe(()=>t.roles.getPermissionCategories(),m)]),{selectedRole:A}=e.auth.rolesState,C=S==null?void 0:S.find(({id:E})=>(A==null?void 0:A.id)===E);r({roles:S,permissions:b,permissionCategories:w,selectedRole:C})}catch(m){o({key:v,value:W(m)})}finally{i({key:v,value:!1})}},l=async h=>{const{callback:p}=h,v=re(h,wre),m=cs.ADD_ROLE;i({key:m,value:!0});try{const S=await t.roles.addRole(v);await a({silentLoading:!0}),p==null||p(S)}catch(S){o({key:m,value:W(S)}),p==null||p(null,S)}finally{i({key:m,value:!1})}},c=async h=>{const{callback:p}=h,v=re(h,Ere),m=cs.ADD_ROLE;i({key:m,value:!0});try{const S=await t.roles.addRoleV2(v);await a({silentLoading:!0}),p==null||p(S)}catch(S){o({key:m,value:W(S)}),p==null||p(null,S)}finally{i({key:m,value:!1})}},u=async h=>{const{callback:p}=h,v=re(h,Are),m=cs.EDIT_ROLE_DIALOG;i({key:m,value:!0});try{const S=await t.roles.updateRole(v);await a({silentLoading:!0}),r({saving:!1}),p==null||p(S)}catch(S){o({key:m,value:W(S)}),p==null||p(null,S)}finally{i({key:m,value:!1})}},d=async h=>{const{callback:p}=h,v=re(h,Cre),m=cs.DELETE_ROLE_DIALOG;i({key:m,value:!0});try{await t.roles.deleteRole(v),await a({silentLoading:!0}),r({saving:!1}),p==null||p(!0)}catch(S){o({key:m,value:W(S)}),p==null||p(!1,S)}finally{i({key:m,value:!1})}},f=async h=>{const{callback:p}=h,v=re(h,xre),m=cs.MANAGE_PERMISSIONS;i({key:m,value:!0});try{const S=await t.roles.attachPermissionsToRole(v);await a({silentLoading:!0}),r({saving:!1}),p==null||p(S)}catch(S){o({key:m,value:W(S)}),p==null||p(null,S)}finally{i({key:m,value:!1})}};return{setRolesState:r,setRolesStateLoader:i,setRolesStateError:o,resetRolesState:s,loadRolesAndPermissions:a,addRole:l,addRoleV2:c,updateRole:u,deleteRole:d,attachPermissionsToRole:f,attachPermissionToRoles:async h=>{const{callback:p}=h,v=re(h,Tre),m=cs.MANAGE_PERMISSIONS;i({key:m,value:!0});try{await Promise.all(v.roleIds.map(S=>f({roleId:S,permissionIds:[v.permissionId]}))),await a({silentLoading:!0}),p==null||p(!0)}catch(S){o({key:m,value:W(S)}),p==null||p(null,S)}finally{i({key:m,value:!1})}}}},Pre={ipRestrictions:{loading:!1,pagination:{_offset:0,_limit:4,_filter:xt.ALLOW},totalPages:1,userIpValid:!1},emailDomainRestrictions:{loading:!1}},Rre=e=>Ue(Pre,e),kre=["callback"],Ore=["callback"],Ire=["callback"],Nre=["callback"],ZD=(e,t,n)=>{const r=n,s=U=>{var L,z,O;return{_filter:(L=U==null?void 0:U._filter)!=null?L:xt.ALLOW,_limit:(z=U==null?void 0:U._limit)!=null?z:10,_offset:(O=U==null?void 0:U._offset)!=null?O:0}},i=U=>async(...L)=>{const[z]=await r.getFeatureFlags(["security-center-admin-portal-major-version"]);await U(...L),z&&(await r.loadRecommendations(mi()),await r.loadInsights(mi()))},o=U=>{Object.assign(e.auth.restrictionsState,U)},a=U=>{Object.assign(e.auth.restrictionsState.ipRestrictions,U)},l=U=>{Object.assign(e.auth.restrictionsState.emailDomainRestrictions,U)},c=async()=>{a({loading:!0,error:null});try{const U=e.auth.restrictionsState.ipRestrictions,L=await t.auth.getIPRestrictionsConfig(),z=s({_filter:L.strategy,_limit:U.pagination._limit,_offset:U.pagination._offset}),{items:O,_metadata:{totalPages:j}}=await t.auth.getIPRestrictions(z);a({data:{restrictions:O,config:L},totalPages:j,pagination:z,loading:!1})}catch(U){a({error:W(U),loading:!1})}},u=async U=>{const{callback:L}=U,z=re(U,kre);a({saving:!0,error:null});try{var O,j;await t.auth.createIPRestriction(z);const N=e.auth.restrictionsState.ipRestrictions,V=s(N.pagination),{items:k,_metadata:{totalPages:$}}=await t.auth.getIPRestrictions(V),M=k;await g(),a({data:{config:(O=(j=N.data)==null?void 0:j.config)!=null?O:{isActive:!1,strategy:xt.ALLOW},restrictions:M},pagination:V,totalPages:$,saving:!1}),L==null||L(!0)}catch(N){a({saving:!1,error:W(N)}),L==null||L(null,N)}},d=async U=>{const{callback:L}=U,z=re(U,Ore);a({saving:!0,error:null});try{await t.auth.updateIPRestrictionConfig(z);const O=e.auth.restrictionsState.ipRestrictions,j=await t.auth.getIPRestrictionsConfig(),N=s(F({},O.pagination,{_filter:j.strategy})),{items:V,_metadata:{totalPages:k}}=await t.auth.getIPRestrictions(N),$=V;await g(),a({data:{config:j,restrictions:$},pagination:N,totalPages:k,saving:!1}),L==null||L(!0)}catch(O){a({saving:!1,error:W(O)}),L==null||L(null,O)}},f=async U=>{const{id:L,callback:z}=U;a({saving:!0,error:null});try{var O;await t.auth.deleteIPRestriction(L);const j=e.auth.restrictionsState.ipRestrictions,N=s(j.pagination),{items:V,_metadata:{totalPages:k}}=await t.auth.getIPRestrictions(N),$=V;await g(),a({data:{config:((O=j.data)==null?void 0:O.config)||{isActive:!1,strategy:xt.ALLOW},restrictions:$},pagination:N,totalPages:k,saving:!1}),z==null||z(!0)}catch(j){a({saving:!1,error:W(j)}),z==null||z(null,j)}},g=async()=>{try{const{valid:U}=await t.auth.testCurrentIpInAllowList();
421a({userIpValid:U})}catch(U){a({error:W(U)})}},h=async U=>{const{callback:L}=U;a({saving:!0,error:null});try{var z,O;const j=(z=((O=e.auth.userIpData)==null?void 0:O.ip)||e.auth.userIp)!=null?z:"";await Promise.all([t.auth.createIPRestriction({ip:j,isActive:!0,description:"My IP",strategy:xt.ALLOW}),t.auth.updateIPRestrictionConfig({isActive:!0})]);const N=e.auth.restrictionsState.ipRestrictions,V=s(N.pagination),{items:k,_metadata:{totalPages:$}}=await t.auth.getIPRestrictions(V),M=k;a({data:{config:{isActive:!0,strategy:xt.ALLOW},restrictions:M},userIpValid:!0,pagination:V,totalPages:$,saving:!1}),L==null||L(!0)}catch(j){a({saving:!1,error:j}),L==null||L(!1,j)}},p=async()=>{l({loading:!0,error:null});try{const U=await t.auth.getDomainRestrictionsConfig(),z=(await t.auth.getDomainRestrictions()).items.filter(O=>O.type===U.listType);l({data:{restrictions:z,config:U},loading:!1})}catch(U){l({error:W(U),loading:!1})}},v=async U=>{const{callback:L}=U,z=re(U,Ire);l({saving:!0,error:null});const O=e.auth.restrictionsState.emailDomainRestrictions;try{var j;await t.auth.createDomainRestriction(z);const V=(await t.auth.getDomainRestrictions()).items.filter(k=>{var $;return k.type===(($=O.data)==null?void 0:$.config.listType)});l({data:{config:((j=O.data)==null?void 0:j.config)||{active:!1,blockPublicDomains:!1,listType:z.type},restrictions:V},saving:!1}),L==null||L(!0)}catch(N){l({saving:!1,error:W(N)}),L==null||L(null,N)}},m=async U=>{const{callback:L}=U,z=re(U,Nre);l({saving:!0,error:null});try{const O=await t.auth.updateDomainRestrictionConfig(z),N=(await t.auth.getDomainRestrictions()).items.filter(V=>V.type===O.listType);l({data:{config:O,restrictions:N},saving:!1}),L==null||L(!0)}catch(O){l({saving:!1,error:W(O)}),L==null||L(null,O)}},S=async U=>{const{id:L}=U;l({saving:!0,error:null});const z=e.auth.restrictionsState.emailDomainRestrictions;try{var O;await t.auth.deleteDomainRestriction(L);const N=(await t.auth.getDomainRestrictions()).items.filter(V=>{var k;return V.type===((k=z.data)==null?void 0:k.config.listType)});l({data:{config:((O=z.data)==null?void 0:O.config)||{active:!1,blockPublicDomains:!1,listType:xt.ALLOW},restrictions:N},saving:!1})}catch(j){l({saving:!1,error:W(j)})}},b=i(c),w=i(u),A=i(d),C=i(f),E=i(g),x=i(h),R=i(p),T=i(v),P=i(m),I=i(S);return{setRestrictionsState:o,setIpRestrictionsState:a,setEmailDomainRestrictionsState:l,__securityCenterSagaWrapper:i,loadIpRestrictions:b,saveIpRestriction:w,saveIpRestrictionsConfig:A,deleteIpRestriction:C,checkIfUserIpValid:E,addCurrentUserIpAndActivate:x,loadEmailDomainRestrictions:R,saveEmailDomainRestriction:T,saveEmailDomainRestrictionsConfig:P,deleteEmailDomainRestriction:I}},eM={loaders:{},errors:{},recommendations:void 0,insights:void 0,hasSecurityChanges:!1,score:0,breachedPasswordUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},unenrolledMfaUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10}},inactiveUsersTable:{users:[],usersPageOffset:0,totalUsersItems:0,totalUsersPages:0,queryParams:{_offset:0,_limit:10,_maxInactiveSeconds:7776e3}}},Lre=e=>Ue(eM,e);let In;(function(e){e.RECOMMENDATIONS="recommendations",e.INSIGHTS="insights",e.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS="sendBulkResetBreachedPasswordEmails",e.SEND_BREACHED_PASSWORD_EMAIL="sendBreachedPasswordEmail",e.BREACHED_PASSWORD_USERS_TABLE="breachedPasswordUsersTable",e.UNENROLLED_MFA_USERS_TABLE="unenrolledMfaUsersTable",e.INACTIVE_USERS_TABLE="inactiveUsersTable"})(In||(In={}));const Dre=["callback"],tM=(e,t,n)=>{const r=n,s=async S=>{const b=S.map(E=>E.id),w=await t.roles.getRoles(),A=await t.users.getUsersRoles({ids:b});return S.map(E=>{var x,R;const T=A==null||(x=A.find(P=>P.userId===E.id))==null?void 0:x.roleIds;return F({},E,{roles:(R=T==null?void 0:T.map(P=>{var I;return(I=w==null?void 0:w.find(U=>U.id===P))!=null?I:[]}))!=null?R:[]})})},i=async S=>{var b,w,A,C;const{key:E,tableState:x,updateStateKey:R,_offset:T,_limit:P,_preset:I,_email:U,_maxInactiveSeconds:L}=S;c({key:E,value:!1}),l({key:E,value:!0});const z=(b=T??(x==null||(w=x.queryParams)==null?void 0:w._offset))!=null?b:0,O=(A=P??(x==null||(C=x.queryParams)==null?void 0:C._limit))!=null?A:10,j=F({_offset:z,_limit:O,_includeSubTenants:!1,_preset:I,_maxInactiveSeconds:L},!!U&&{_email:U});try{const{items:N,_metadata:{totalItems:V,totalPages:k}}=await t.users.getUsersV3(j),$={totalUsersItems:V,totalUsersPages:k,usersPageOffset:z,queryParams:F({_offset:z,_limit:O,_maxInactiveSeconds:L},!!U&&{_email:U})};if(N.length){const M=await s(N);r.setSecurityCenterState({[R]:F({users:M},$)})}else o({[R]:F({users:[]},$)})}catch(N){c({key:E,value:W(N)})}finally{l({key:E,value:!1})}},o=S=>{Object.assign(e.auth.securityCenterState,S)},a=()=>{Ne(e,["auth","securityCenterState"],eM)},l=S=>{Object.assign(e.auth.securityCenterState,{loaders:F({},e.auth.securityCenterState.loaders,{[S.key]:S.value})})},c=S=>{Object.assign(e.auth.securityCenterState,{errors:F({},e.auth.securityCenterState.errors,{[S.key]:S.value}),loaders:F({},e.auth.securityCenterState.loaders,{[S.key]:!1})})};return{setSecurityCenterState:o,resetSecurityCenterState:a,setSecurityCenterStateLoader:l,setSecurityCenterStateError:c,loadRecommendations:async S=>{const b=In.RECOMMENDATIONS;l({key:b,value:!0});try{var w;const{recommendations:A,scoring:C}=await Oe(()=>t.securityCenter.getRecommendations(),S==null?void 0:S.retryConfig);o({recommendations:A.items,score:(w=C==null?void 0:C.score)!=null?w:0})}catch(A){c({key:b,value:W(A)})}finally{l({key:b,value:!1})}},loadInsights:async S=>{const b=In.INSIGHTS;l({key:b,value:!0});try{const{insights:w}=await await Oe(()=>t.securityCenter.getInsights(),S==null?void 0:S.retryConfig);o({insights:w.items})}catch(w){c({key:b,value:W(w)})}finally{l({key:b,value:!1})}},sendResetBreachedPasswordEmail:async S=>{const{callback:b}=S,w=re(S,Dre),A=In.SEND_BREACHED_PASSWORD_EMAIL;c({key:A,value:!1}),l({key:A,value:!0});try{await t.auth.forgotPassword(w),b==null||b(!0)}catch(C){c({key:A,value:W(C)}),b==null||b(!1,C)}finally{l({key:A,value:!1})}},sendBulkResetBreachedPasswordEmails:async S=>{const{callback:b}=S,w=In.SEND_BULK_RESET_BREACHED_PASSWORD_EMAILS;c({key:w,value:!1}),l({key:w,value:!0});try{await t.users.sendResetBreachedPasswordEmails(),b==null||b(!0)}catch(A){c({key:w,value:W(A)}),b==null||b(!1)}finally{l({key:w,value:!1})}},loadBreachedPasswordUsers:async S=>{var b;const w=In.BREACHED_PASSWORD_USERS_TABLE,A=(b=e.auth.securityCenterState)==null?void 0:b.breachedPasswordUsersTable;await i(F({key:w,updateStateKey:"breachedPasswordUsersTable",_preset
421:nc.BREACHED_PASSWORDS,tableState:A},S))},loadUnenrolledMfaUsers:async S=>{var b;const w=In.UNENROLLED_MFA_USERS_TABLE,A=(b=e.auth.securityCenterState)==null?void 0:b.unenrolledMfaUsersTable;await i(F({key:w,updateStateKey:"unenrolledMfaUsersTable",_preset:nc.MFA_UNENROLLED,tableState:A},S))},loadInactiveUsers:async S=>{var b;const w=In.INACTIVE_USERS_TABLE,A=(b=e.auth.securityCenterState)==null?void 0:b.inactiveUsersTable;await i(F({key:w,updateStateKey:"inactiveUsersTable",_preset:nc.INACTIVE,tableState:A},S))},markSecurityCenterStateAsChanged:(S=!0)=>{o({hasSecurityChanges:S})}}},nM={globalPolicy:{loading:!0},publicPolicy:{loading:!1},vendorMfaPolicy:{loading:!0},mfaPolicy:{loading:!0},vendorLockoutPolicy:{loading:!0},lockoutPolicy:{loading:!0},captchaPolicy:{loading:!0},passwordHistoryPolicy:{loading:!0},passwordPolicy:{loading:!0},vendorPasswordHistoryPolicy:{loading:!0},publicAuthStrategyPolicy:{loading:!0},passwordRotationPolicy:{loading:!0}},Mre=e=>Ue(nM,e);function Ure(e,t){const n=t!=null,r=e!=null;if(!(!n&&!r))return n?r?Math.min(e,t):t:e}const Fre=["callback"],$re=["callback"],jre=["callback"],Vre=["callback"],rM=(e,t,n)=>{const r=n,s=async(M,B)=>{var H,X;if(!await r.customLoginEnabled())return M;const Y=await i(B);return Y!=null&&(H=Y.mainAuthStrategies)!=null&&(X=H[0])!=null&&X.strategy?F({},M,{authStrategy:Y.mainAuthStrategies[0].strategy}):M},i=async M=>{const B=e.auth.isAuthenticated;let H;return B?H=await Oe(t.auth.getPublicAuthStrategiesConfigForAuthenticatedUser,M):H=await Oe(t.auth.getVendorPublicAuthStrategiesConfig,M),H},o=async M=>{var B,H;const X=await r.customLoginEnabled();if(!M||!X)return;const{policy:te}=(B=(H=e.auth.securityPolicyState)==null?void 0:H.publicPolicy)!=null?B:{policy:null};c({policy:F({},te,{authStrategy:M}),loading:!1})},a=M=>{Object.assign(e.auth.securityPolicyState,M)},l=M=>{Object.assign(e.auth.securityPolicyState.globalPolicy,M)},c=M=>{Object.assign(e.auth.securityPolicyState.publicPolicy,M)},u=M=>{Object.assign(e.auth.securityPolicyState.mfaPolicy,M)},d=M=>{Object.assign(e.auth.securityPolicyState.vendorMfaPolicy,M)},f=M=>{Object.assign(e.auth.securityPolicyState.lockoutPolicy,M)},g=M=>{Object.assign(e.auth.securityPolicyState.vendorLockoutPolicy,M)},h=M=>{Object.assign(e.auth.securityPolicyState.captchaPolicy,M)},p=M=>{Object.assign(e.auth.securityPolicyState.passwordHistoryPolicy,M)},v=M=>{Object.assign(e.auth.securityPolicyState.vendorPasswordHistoryPolicy,M)},m=M=>{Object.assign(e.auth.securityPolicyState.passwordRotationPolicy,M)},S=M=>{Object.assign(e.auth.securityPolicyState.passwordPolicy,M)},b=M=>{Object.assign(e.auth.securityPolicyState.publicAuthStrategyPolicy,M)},w=()=>{Ne(e,["auth","securityPolicyState"],nM)},A=async M=>{const B={retryConfig:M==null?void 0:M.retryConfig};await Promise.all([C(),R(),T(B),P(B),I(B),z(),U(B),j(B)])},C=async M=>{l({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getGlobalSecurityPolicy(),M==null?void 0:M.retryConfig);l({policy:B,loading:!1})}catch(B){l({error:W(B),loading:!1})}},E=async M=>{c({loading:!0,error:null});try{const B=await t.auth.getVendorConfig(),H=await s(B,M==null?void 0:M.retryConfig);c({policy:H,loading:!1})}catch(B){c({error:W(B),loading:!1})}},x=async M=>{S({loading:!0,error:null});try{var B;const X=await Oe(()=>t.auth.getPasswordConfigPolicy(),M==null?void 0:M.retryConfig);S({policy:X,loading:!1}),M==null||(B=M.callback)==null||B.call(M,X)}catch(X){var H;S({error:W(X),loading:!1}),M==null||(H=M.callback)==null||H.call(M,null,X)}},R=async M=>{u({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getMfaPolicy(),M==null?void 0:M.retryConfig);u({policy:B,loading:!1})}catch(B){u({error:W(B),loading:!1})}},T=async M=>{u({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getVendorMfaPolicy(),M==null?void 0:M.retryConfig);d({policy:B,loading:!1})}catch(B){d({error:W(B),loading:!1})}},P=async M=>{f({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getLockoutPolicy(),M==null?void 0:M.retryConfig);f({policy:B,loading:!1})}catch(B){f({error:W(B),loading:!1})}},I=async M=>{g({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getVendorLockoutPolicy(),M==null?void 0:M.retryConfig);g({policy:B,loading:!1})}catch(B){g({error:W(B),loading:!1})}},U=async M=>{f({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getCaptchaPolicy(),M==null?void 0:M.retryConfig);h({policy:B,loading:!1})}catch(B){h({error:W(B),loading:!1})}},L=async()=>{p({loading:!0,error:null});try{const M=await t.auth.getPasswordHistoryPolicy();p({policy:M,loading:!1})}catch(M){p({error:W(M),loading:!1})}},z=async M=>{v({loading:!0,error:null});try{const B=await Oe(()=>t.auth.getVendorPasswordHistoryPolicy(),M==null?void 0:M.retryConfig);v({policy:B,loading:!1})}catch(B){v({error:W(B),loading:!1})}},O=async()=>{m({loading:!0,error:null});try{const M=await t.securityPolicy.getPasswordRotationPolicy(),B=await t.securityPolicy.getVendorPasswordRotationPolicy(),H={passwordRotationVendorConfig:B};M&&(B!=null&&B.isActive?H.passwordRotationTenantConfig=M!=null&&M.isActive?F({},M,{rotationPeriod:Ure(B.rotationPeriod,M.rotationPeriod)}):B:H.passwordRotationTenantConfig=M),m({policy:F({},H),loading:!1})}catch(M){m({error:W(M),loading:!1})}},j=async M=>{b({loading:!0,error:null});try{var B,H,X;const Y=await i(M==null?void 0:M.retryConfig);await o(Y==null||(B=Y.mainAuthStrategies)==null||(H=B[0])==null?void 0:H.strategy),b({policy:Y,loading:!1}),M==null||(X=M.callback)==null||X.call(M,Y)}catch(Y){var te;b({error:W(Y),loading:!1}),M==null||(te=M.callback)==null||te.call(M,null,Y)}};return{setSecurityPolicyState:a,setSecurityPolicyGlobalState:l,setSecurityPolicyPublicState:c,setSecurityPolicyMfaState:u,setSecurityPolicyVendorMfaState:d,setSecurityPolicyLockoutState:f,setSecurityPolicyVendorLockoutState:g,setSecurityPolicyCaptchaState:h,setSecurityPolicyPasswordHistoryState:p,setSecurityPolicyVendorPasswordHistoryState:v,setSecurityPolicyPasswordRotationState:m,resetSecurityPolicyState:w,setSecurityPolicyPasswordState:S,setSecurityPolicyAuthStrategyPublicState:b,loadSecurityPolicy:A,loadGlobalSecurityPolicy:C,loadPublicSecurityPolicy:E,loadVendorPasswordConfig:x,loadSecurityPolicyMfa:R,loadSecurityPolicyVendorMfa:T,loadSecurityPolicyLockout:P,loadSecurityPolicyVendorLockout:I,loadSecurityPolicyCaptcha:U,loadSecurityPolicyPasswordHistory:L,loadSecurityPolicyVendorPasswordHistory:z,loadSecurityPolicyPasswordRotation:O,loadPublicAuthStrategiesPolicy:j,saveSecurityPolicyMfa:async M=>{const{callback:B}=M,H=re(M,Fre);u({saving:!0,error:null});try{const X=await t.auth.securityPolicy.saveMfaPolicy(H);u({policy:X,saving:!1}),B==null||B(X)}catch(X){u({saving:!1,error:W(X)}),B==null||B(null,X)}},saveSecurityPolicyLockout:async M=>{const{callback:B}=M,H=re(M,$re);f({saving:!0,error:null});try{const X=await t.auth.saveLockoutPolicy(H);f({policy:X,saving:!1}),B==null||B(X)}catch(X){f({saving:!1,error:W(X)}),B==null||B(null,X)}},saveSecurityPolicyPasswordHistory:async M=>{const{callback:B}=M,H=re(M,jre);p({saving:!0,error:null});try{const X=await t.auth.savePasswordHistoryPolicy(H);p({policy:X,saving:!1}),B==null||B(X)}catch(X){p({saving:!1,error:W(X)}),B==null||B(null,X)}},saveSecurityPolicyPasswordRotation:async M=>{const{callback:B}=M,H=re(M,Vre);m({saving:!0,error:null});try{await t.securityPolicy.savePasswordRotationPolicy(H.passwordRotationTenantConfig||{}),m({policy:H,saving:!1}),B==null||B(H)}
421catch(X){m({saving:!1,error:W(X)}),B==null||B(null,X)}},__getSecurityPolicyPublicStateWithCustomLogin:s}},sM={loading:!1,configurations:{}},Bre=e=>Ue(sM,e),zre=["callback"],iM=(e,t,n)=>{const r=n,s=l=>{Object.assign(e.auth.sessionsPolicyState,l)};return{setSessionsPolicyState:s,resetSessionsPolicyState:()=>{Ne(e,["auth","sessionsPolicyState"],sM)},loadSessionsPolicy:async()=>{s({loading:!0,error:null});try{const l=await t.auth.getSessionConfigurations();s({configurations:l,loading:!1})}catch(l){r.setSessionsState({error:l,loading:!1})}},createOrUpdateSessionsPolicy:async l=>{const{callback:c}=l,u=re(l,zre);try{s({loading:!0,error:null}),await t.auth.createOrUpdateSessionConfigrations(u),await r.loadSessionsPolicy(),c==null||c(!0)}catch(d){s({error:d,loading:!1})}}}},oM={loading:!1,sessions:[]},Gre=e=>Ue(oM,e),aM=(e,t,n)=>{const r=u=>{Object.assign(e.auth.sessionsState,u)},s=()=>{Ne(e,["auth","sessionsState"],oM)},i=async u=>{r({loading:!0,error:null});try{const d=await Oe(()=>t.auth.getCurrentUserSessions(),u==null?void 0:u.retryConfig);r({sessions:d,loading:!1})}catch(d){r({error:W(d),loading:!1})}};return{setSessionsState:r,resetSessionsState:s,loadUserSessions:i,loadCurrentUserSession:async()=>{r({loading:!0,error:null});try{const u=await t.auth.getCurrentUserSession();r({currentSession:u,loading:!1})}catch(u){r({error:W(u),loading:!1})}},deleteUserSession:async u=>{const{id:d}=u;r({loading:!0,error:null});try{await t.auth.deleteSessionForUser(d),await i()}catch(f){r({error:W(f),loading:!1})}},deleteAllUserSessions:async()=>{r({loading:!0,error:null});try{await t.auth.deleteAllSessionsForUser(),await i()}catch(u){r({error:W(u),loading:!1})}},revokeUserSessions:async u=>{const{callback:d,userId:f}=u;r({loading:!0,error:null});try{await t.auth.revokeSessionsForUser(f),r({loading:!1}),d==null||d(!0)}catch(g){r({error:W(g),loading:!1}),d==null||d(!1)}}}};let _o;(function(e){e.SignUp="SignUp",e.SignUpSuccess="SignUpSuccess",e.VerifyPhone="VerifyPhone"})(_o||(_o={}));const lM={loading:!1,allowSignUps:!1,allowNotVerifiedUsersLogin:!1,firstLoad:!0,stage:_o.SignUp,strategies:{[ec.Email]:{enabled:!0,required:!0},[ec.PhoneNumber]:{enabled:!1,required:!1},[ec.Username]:{enabled:!1,required:!1}}},Hre=e=>Ue(lM,e),Wre=["events","url"],Kre=["events","url"],qre=["events","url"],cM=(e,t,n)=>{const r=n,s=de.for(e.root.appName),i=h=>{Object.assign(e.auth.signUpState,h)},o=()=>{Ne(e,["auth","signUpState"],lM)},a=()=>{const{allowSignUps:h,allowNotVerifiedUsersLogin:p}=e.auth.signUpState;o(),i({allowSignUps:h,allowNotVerifiedUsersLogin:p})},l=(h,p,v,m,S,b=No.PASSWORD)=>{var w;const{email:A,name:C,companyName:E,phoneNumber:x,url:R}=h,T={email:A,name:C,companyName:E,url:R,phoneNumber:x||void 0,authenticationType:b,id:p,tenantId:v,createdAt:new Date,activationToken:m};S==null||(w=S.signUpComplete)==null||w.call(S,T),Dn(ln.SIGNUP_COMPLETED,T)},c=async h=>{const{events:p}=h,v=re(h,Wre);if(i({loading:!0}),!v.phoneNumber)throw new Error("Phone number is required for phone number signup");try{var m,S,b;const{routes:w,onRedirectTo:A}=e.auth,{tenantId:C,userId:E,activationToken:x}=await t.auth.signUpUserWithPhoneNumber(Fp(v));v.invitationToken||l(v,E,C,x,p,No.PHONE_NUMBER);const{enabled:R,siteKey:T}=(m=e.auth.securityPolicyState.captchaPolicy.policy)!=null?m:{},P=R&&T?await((S=window.grecaptcha)==null||(b=S.execute)==null?void 0:b.call(S,{action:"login"})):"";r.passwordlessPreLogin({recaptchaToken:P,phoneNumber:v.phoneNumber,type:at.SmsCode,callback:(I,U)=>{if(!I&&U)throw U;A(w.loginUrl),r.setLoginState({step:Ye.loginWithSmsOtc,phoneNumber:v.phoneNumber})}})}catch(w){s.setAccessToken(null),s.setUser(null),i({error:W(w)})}finally{i({loading:!1})}},u=async h=>{const{events:p}=h,v=re(h,Kre);if(i({loading:!0}),!v.username)throw new Error("Username is required for username signup");try{const{routes:m,onRedirectTo:S}=e.auth,{shouldActivate:b,user:w,tenantId:A,userId:C,tenants:E=[],activeTenant:x,activationToken:R}=await t.auth.signUpUserWithUsername(Fp(v));if(v.invitationToken||l(v,C,A,R,p,No.USERNAME),!b&&w&&Ns(w,e.root.appName)){const T=await r.getMfaRequiredState(w,br,!0,v.email);r.setAuthState(T),S(m.loginUrl)}else if(b&&R){const T=new URLSearchParams({userId:C||"",token:R||""}),P=`${m.activateWithOTCUrl}?${T.toString()}`;i({loading:!1,shouldActivate:b,stage:_o.SignUpSuccess}),S(P)}else{const T=e.auth.tenantsState;i({loading:!1,shouldActivate:b,stage:_o.SignUpSuccess}),r.setAuthState({user:w,isAuthenticated:!!(w!=null&&w.accessToken),tenantsState:F({},T,{tenants:E,activeTenant:x})})}}catch(m){s.setAccessToken(null),s.setUser(null),i({error:W(m)})}finally{i({loading:!1})}};return{setSignUpState:i,resetSignUpState:o,resetSignUpStateSoft:a,signUpUser:async h=>{const{events:p}=h,v=re(h,qre);i({loading:!0});const m=e.auth.signUpState.strategies.phoneNumber;if(m!=null&&m.required&&m!=null&&m.enabled&&v.phoneNumber)return c(h);const S=e.auth.signUpState.strategies.username;if(S!=null&&S.required&&S!=null&&S.enabled&&v.username)return u(h);try{const{routes:b,onRedirectTo:w}=e.auth,{shouldActivate:A,user:C,tenantId:E,userId:x,tenants:R=[],activeTenant:T,activationToken:P}=await t.auth.signUpUser(Fp(v));if(v.invitationToken||l(v,x,E,P,p),!A&&C&&Ns(C,e.root.appName)){const I=await r.getMfaRequiredState(C,br,!0,v.email);r.setAuthState(I),w(b.loginUrl)}else if(A&&P){const I=new URLSearchParams({userId:x||"",token:P||""}),U=`${b.activateWithOTCUrl}?${I.toString()}`;i({loading:!1,shouldActivate:A,stage:_o.SignUpSuccess}),w(U)}else{const I=e.auth.tenantsState;i({loading:!1,shouldActivate:A,stage:_o.SignUpSuccess}),r.setAuthState({user:C,isAuthenticated:!!(C!=null&&C.accessToken),tenantsState:F({},I,{tenants:R,activeTenant:T})})}}catch(b){s.setAccessToken(null),s.setUser(null),i({error:W(b)})}finally{i({loading:!1})}},loadAllowSignUps:async h=>{i({loading:!0});try{var p;const m=await Oe(t.auth.getVendorConfig,h==null?void 0:h.retryConfig),S=await r.__getSecurityPolicyPublicStateWithCustomLogin(m,h==null?void 0:h.retryConfig),{allowSignups:b,allowNotVerifiedUsersLogin:w}=m;i({loading:!1,allowSignUps:b,allowNotVerifiedUsersLogin:w,firstLoad:!1}),r.setSecurityPolicyPublicState({policy:S,loading:!1}),h==null||(p=h.callback)==null||p.call(h,S||m)}catch(m){var v;i({loading:!1,error:W(m),firstLoad:!1}),h==null||(v=h.callback)==null||v.call(h,null,m)}},loadSignUpStrategies:async()=>{try{const h=await t.auth.getSignUpStrategies();i({strategies:h.reduce((p,{isActive:v,strategy:m,isRequired:S})=>(p[m]={enabled:v,required:S},p),{})})}catch{}}}},uM={loading:!1,error:null,phoneNumbers:void 0},Yre=e=>Ue(uM,e),Qre=["callback"],Xre=["callback"],Jre=["callback"],Zre=["callback","phoneId"],ese=["callback","phoneId"],tse=["callback"],dM=(e,t,n)=>{const r=g=>{Object.assign(e.auth.smsState,g)},s=()=>{Ne(e,["auth","smsState"],uM)},i=async()=>{r({loading:!0});const g={_limit:10,_offset:0};try{const{items:h}=await t.userPhoneNumbers.getUserPhoneNumbers(g);r({phoneNumbers:h})}catch(h){r({error:W(h)})}finally{r({loading:!1})}},o=async()=>{r({loading:!0});try{const g=await t.userPhoneNumbers.getUserOwnPhoneNumbers();r({phoneNumbers:g})}catch(g){r({error:W(g)})}finally{r({loading:!1})}};return{setSmsState:r,resetSmsState:s,loadPhoneNumbers:i,loadUserOwnPhoneNumbers:o,setUpPhoneNumber:async g=>{const{callback:h}=g,p=re(g,Xre);try{const{otcToken:v}=await t.userPhoneNumbers.createPhoneNumber(p);r({otcToken:v}),await i(),h==null||h(!0)}catch(v){r({error:W(v)}),h==null||h(!1,v)}},setUpOwnPhoneNumber:async g=>{const{callback:h}=g,p=re(g,Qre);try{const{otcToken:v}=await t.userPhoneNumbers.createPhoneNumber(p);r({otcToken:v}),await o(),h==null||h(!0)}catch(v){r({error:W(v)}),h==null||h(!1,v)}},verifyPhoneNumber:async g=>{const{callback:h}=g,p=re(g,Jre);r({loading:!0});try{await t.userPhoneNumbers.verifyPhoneNumber(p),await i(),h==null||h(!0)}catch(v){r({error:W(v)}),h==null||h(!1,v)}finally{r({loading:!1})}},deletePhoneNumber:async g=>{const{callback:h,phoneId:p}=g;re(g,Zre),r({loading:!0});try{const{otcToken:v}=await t.userPhoneNumbers.deletePhoneNumber(p);r({otcToken:v}),h==null||h(!0)}catch(v){r({error:W(v)}),h==null||h(!1,v)}finally{r({loading:!1})}},verifyDeletePhoneNumber:async g=>{const{callback:h,phoneId:p}=g,v=re(g,ese);r({loading:!0});try{await t.userPhoneNumbers.verifyDeletePhoneNumber(p,v),await i(),h==null||h(!0)}catch(m){r({error:W(m)}),h==null||h(!1,m)}finally{r({loading:!1})}},preVerifyPhoneNumber:async g=>{const{callback:h}=g,p=re(g,tse);r({loading:!0});try{const{otcToken:v}=await t.userPhoneNumbers.preVerifyPhoneNumber(p);r({otcToken:v}),h==null||h(!0)}catch(v){r({error:W(v)}),h==null||h(!1,v)}finally{r({loading:!1})}}}},fM={firstLoad:!0,loading:!1,error:""},nse=e=>Ue(fM,e),rse=["authorizationUrl"],sse=["events","url"],hM=(e,t,n)=>{const r=n,s=async d=>{const f=e.auth.isAuthenticated;let g;return f?g=await Oe(t.auth.getSocialLoginProvidersV2ForAuthenticatedUser,d):g=await Oe(t.auth.getSocialLoginProvidersV2,d),g},i=d=>{Object.assign(e.auth.socialLoginState,d)};return{setSocialLoginsState:i,resetSocialLoginsState:()=>{Ne(e,["auth","socialLoginState"],fM)},setSocialLoginError:d=>{i({error:d.error,loading:!1,firstLoad:!1})},loadSocialLoginsConfiguration:async()=>{try{i({loading:!0});const d=await t.auth.getSocialLoginProviders();i({socialLoginsConfig:d,loading:!1,firstLoad:!1})}catch(d){i({error:W(d),loading:!1,firstLoad:!1})}},loadSocialLoginsConfigurationV2:async d=>{try{var f;const h=e.root.context;i({loading:!0});const p=await s(d==null?void 0:d.retryConfig),{providers:v}=await Oe(t.auth.getCustomSocialLoginProvidersV1,d==null?void 0:d.retryConfig),S={socialLoginsConfigV2:p.map(b=>{let{authorizationUrl:w}=b,A=re(b,rse);const C=t.fetch.getBaseUrl(h,w??"");return F({},A,{authorizationUrl:w?`${C}${w}`:null})}),customSocialLoginsConfig:v,loading:!1,firstLoad:!1};i(S),d==null||(f=d.callback)==null||f.call(d,S)}catch(h){var g;d==null||(g=d.callback)==null||g.call(d,null,h),i({error:W(h),loading:!1,firstLoad:!1})}},loginViaSocialLogin:async d=>{const{events:f,url:g}=d,h=re(d,sse);try{i({loading:!0});const{email:m,isNewUser:S,userId:b,tenantId:w,name:A}=await t.auth.loginViaSocialLogin(h);if(S){var p,v;const E={email:m,url:g,createdAt:new Date,id:b,tenantId:w},x=F({}
421,E,{name:A,socialProvider:h.provider,authenticationType:No.SOCIAL_LOGIN});f==null||(p=f.signUpComplete)==null||p.call(f,x),Dn(ln.SIGNUP_COMPLETED,x);const R=F({},E,{origin:Vc.SOCIAL_LOGIN,name:A});f==null||(v=f.userVerified)==null||v.call(f,R),Dn(ln.USER_VERIFIED,R)}const C={tenantId:w,userId:b,authenticationType:No.SOCIAL_LOGIN,createdAt:new Date,provider:h.provider,email:m,name:A,isFirstLogin:S};Dn(ln.LOGIN_COMPLETED,C),b&&localStorage.setItem("userId",b),r.setLoginState({email:m,isNewUser:S}),r.refreshTokenForSocialLogins(),localStorage.removeItem("register-quick-login"),i({loading:!1})}catch(m){i({loading:!1,error:W(m,"Failed to authenticate"),firstLoad:!1})}}}},pM={firstLoad:!0,loading:!0,saving:!1,errors:{},loaders:{},ssoConfigurations:[]},ise=e=>Ue(pM,e),ose=["callback","samlVendor"],ase=(e,t,n)=>{const r=n,s=async()=>{try{const w=await t.auth.getSamlRoles(),A=await t.auth.getSamlRolesGroups();o({authorizationRoles:w.roleIds,rolesGroups:A,error:void 0})}catch(w){o({error:W(w)})}},i=async w=>{try{await Promise.all(w.map(A=>t.auth.updateSamlGroup({id:A.id,roleIds:A.roleIds,group:A.group})))}catch(A){o({error:W(A)})}},o=w=>{Object.assign(e.auth.ssoState,w)};return{setSSOState:o,resetSSOState:()=>{Ne(e,["auth","ssoState"],pM)},setSSOLoader:w=>{Object.assign(e.auth.ssoState,{loaders:F({},e.auth.ssoState.loaders,{[w.key]:w.value})})},setSSOError:w=>{Object.assign(e.auth.ssoState,{errors:F({},e.auth.ssoState.errors,{[w.key]:w.value}),loaders:F({},e.auth.ssoState.loaders,{[w.key]:!1})})},loadSSOConfigurations:async()=>{try{var w,A;o({loading:!0});const C=await t.auth.getSamlConfiguration(),E=await t.auth.getOidcConfiguration(),x=await t.metadata.getSamlMetadata();C.acsUrl=x==null||(w=x.configuration)==null?void 0:w.acsUrl,C.spEntityId=x==null||(A=x.configuration)==null?void 0:A.spEntityId,C.isSamlActive=x==null?void 0:x.isActive,o({samlConfiguration:C,oidcConfiguration:E,loading:!1,firstLoad:!1})}catch(C){o({error:W(C),loading:!1})}},saveSSOConfigurations:async w=>{const{callback:A,samlVendor:C}=w,E=re(w,ose),x=e.auth.ssoState.samlConfiguration,R=F({},x,E);let T="saving";(R==null?void 0:R.enabled)!==(x==null?void 0:x.enabled)&&(T="loading");
421try{if(!(R!=null&&R.domain)){o({samlConfiguration:F({},x,R)});return}else o({error:void 0,[T]:!0});if(w.type===mf.Saml){var P,I;const O=await t.metadata.getSamlMetadata();R.acsUrl=O==null||(P=O.configuration)==null?void 0:P.acsUrl,R.spEntityId=O==null||(I=O.configuration)==null?void 0:I.spEntityId}const L=Aw(R,["validated","generatedVerification","createdAt","updatedAt"]);(x==null?void 0:x.domain)!==(L==null?void 0:L.domain)&&(L.ssoEndpoint="",L.publicCertificate="",L.signRequest=!1),L.type=C==null?void 0:C.toLowerCase();const z=await t.auth.updateSamlConfiguration(L);z.isSamlActive=x==null?void 0:x.isSamlActive,o({samlConfiguration:z,error:void 0,[T]:!1}),A==null||A(!0)}catch(U){o({samlConfiguration:x,error:W(U),[T]:!1}),A==null||A(null,U)}},saveSSOConfigurationsFile:async w=>{const A=e.auth.ssoState.samlConfiguration,C="saving";o({error:void 0,[C]:!0});try{const E=await uf(w[0]),x=await t.auth.updateSamlVendorMetadata({metadata:E});x.isSamlActive=A==null?void 0:A.isSamlActive,o({samlConfiguration:x,error:void 0,[C]:!1})}catch(E){o({samlConfiguration:A,error:W(E),[C]:!1})}},saveSSOConfigurationsFileWithCallback:async w=>{const{configFile:A,callback:C}=w,E=e.auth.ssoState.samlConfiguration,x="saving";o({error:void 0,[x]:!0});try{const R=await uf(A),T=await t.auth.updateSamlVendorMetadata({metadata:R});T.isSamlActive=E==null?void 0:E.isSamlActive,o({samlConfiguration:T,error:void 0,[x]:!1}),C==null||C(!0)}catch(R){o({samlConfiguration:E,error:W(R),[x]:!1}),C==null||C(null,R)}},validateSSODomain:async w=>{const{callback:A}=w??{},C=e.auth.ssoState.samlConfiguration;if(!C){const E=new Error("IllegalState: samlConfiguration is not defined");console.error(E),A==null||A(null,E);return}try{o({error:void 0,saving:!0}),await t.auth.validateSamlDomain(),o({samlConfiguration:F({},C,{validated:!0}),error:void 0,saving:!1}),A==null||A(!0)}catch(E){o({samlConfiguration:F({},C,{validated:!1}),error:W(E),saving:!1}),A==null||A(null,E)}},loadSSOAuthorizationRoles:async()=>{try{const w=await t.auth.getSamlRoles(),A=await t.auth.getSamlRolesGroups();o({authorizationRoles:w.roleIds,rolesGroups:A,error:void 0})}catch(w){o({error:W(w)})}},updateSSOAuthorizationRoles:async w=>{const{callback:A,authorizationRoles:C,groups:E}=w;try{o({error:void 0,saving:!0}),await t.auth.updateSamlRoles({roleIds:C}),E&&await i(E),await s(),o({error:void 0,saving:!1}),A==null||A(!0)}catch(x){o({error:W(x),saving:!1}),A==null||A(null,x)}},deleteSamlGroup:async w=>{const{id:A,callback:C}=w;try{o({error:void 0,saving:!0}),await t.auth.deleteSamlGroup({id:A}),await s(),o({error:void 0,saving:!1}),C==null||C(!0)}catch(E){o({error:W(E),saving:!1}),C==null||C(null,E)}},createSamlGroup:async w=>{const{group:A,roleIds:C,callback:E}=w;try{o({error:void 0,saving:!0}),await t.auth.createSamlGroup({group:A,roleIds:C}),await s(),o({error:void 0,saving:!1}),E==null||E(!0)}catch(x){o({error:W(x),saving:!1}),E==null||E(null,x)}},oidcPostlogin:async w=>{const A={code:w.code,redirectUri:w.redirectUri,RelayState:w.state};try{o({loading:!0}),await t.auth.oidcPostLoginV2(A),await r.__refreshToken(),o({loading:!1})}catch(C){o({loading:!1,error:W(C,"Failed to authenticate"),firstLoad:!1})}}}},lse=["callback"],cse=["callback","ssoConfigId"],use=["callback","ssoConfigId"],dse=["callback","ssoConfigId"],fse=(e,t,n)=>{const r=n,s=async A=>{try{return await Oe(()=>t.auth.getOidcConfiguration(),A)}catch{return null}},i=async A=>{try{return await Oe(()=>t.metadata.getSamlMetadata(),A)}catch{return null}},o=async(A,C,E)=>{r.setSSOLoader({key:A,value:!0});try{await E()}catch(x){r.setSSOError({key:A,value:W(x)}),C==null||C(null,x)}finally{r.setSSOLoader({key:A,value:!1})}};return{loadSSOConfigurationsV2:async A=>{await o(Sn.LOAD_SSO_CONFIGURATIONS,void 0,async()=>{const[C,E]=await Promise.all([s(A==null?void 0:A.retryConfig),i(A==null?void 0:A.retryConfig)]),x=await Oe(()=>t.auth.getSSOConfigurations(),A==null?void 0:A.retryConfig);r.setSSOState({ssoConfigurations:x,oidcConfiguration:C,samlMetadata:E})})},saveSSOConfigurationV2:async A=>{const{callback:C}=A,E=re(A,lse),x=e.auth.ssoState.ssoConfigurations;await o(Sn.SAVE_SSO_CONFIGURATION,C,async()=>{var R;const T=await t.auth.createSSOConfiguration(F({},E,{enabled:(R=E.enabled)!=null?R:!1}));r.setSSOState({ssoConfigurations:[...x,T]}),C==null||C(T)})},updateSSOConfiguration:async A=>{const{callback:C,ssoConfigId:E}=A,x=re(A,cse),R=e.auth.ssoState.ssoConfigurations;await o(Sn.UPDATE_SSO_CONFIGURATION,C,async()=>{const T=await t.auth.updateSSOConfiguration(E,x),P=R.map(I=>I.id===E?T:I);r.setSSOState({ssoConfigurations:P}),C==null||C(T)})},deleteSSOConfiguration:async A=>{const{ssoConfigId:C,callback:E}=A,x=e.auth.ssoState.ssoConfigurations;await o(Sn.DELETE_SSO_CONFIGURATION,E,async()=>{await t.auth.deleteSSOConfiguration(C),r.setSSOState({ssoConfigurations:x.filter(({id:R})=>R!==C)}),E==null||E(!0)})},saveSSODomain:async A=>{const{callback:C,ssoConfigId:E}=A,x=re(A,use),R=e.auth.ssoState.ssoConfigurations;await o(Sn.SAVE_SSO_DOMAIN,C,async()=>{const T=await t.auth.createSSODomain(E,x),P=R.map(I=>I.id===E?F({},I,{domains:[...I.domains,T]}):I);r.setSSOState({ssoConfigurations:P}),C==null||C(T)})},deleteSSODomain:async A=>{const{ssoConfigId:C,domainId:E,callback:x}=A,R=e.auth.ssoState.ssoConfigurations;await o(Sn.DELETE_SSO_DOMAIN,x,async()=>{await t.auth.deleteSSODomain(C,E);const T=R.map(P=>P.id===C?F({},P,{domains:P.domains.filter(({id:I})=>I!==E)}):P);r.setSSOState({ssoConfigurations:T}),x==null||x(!0)})},validateSSODomainV2:async A=>{const{callback:C,domainId:E,ssoConfigId:x}=A;await o(Sn.VALIDATE_SSO_DOMAIN,C,async()=>{const R=e.auth.ssoState.ssoConfigurations;await t.auth.validateSSODomainV2(x,E);const T=R.map(P=>P.id===x?F({},P,{domains:P.domains.map(I=>I.id===E?F({},I,{validated:!0}):I)}):P);r.setSSOState({ssoConfigurations:T}),C==null||C(!0)})},setSSOGroups:async A=>{const{groupsToAdd:C,groupsToDelete:E,ssoConfigId:x,callback:R}=A;await o(Sn.SAVE_SSO_GROUPS,R,async()=>{const T=e.auth.ssoState.ssoConfigurations;await Promise.all(E.map(U=>t.auth.deleteSSOGroup(x,U))),await Promise.all(C.map(U=>t.auth.createSSOGroup(x,U)));const P=await t.auth.getSSOGroups(x),I=T.map(U=>U.id===x?F({},U,{groups:P}):U);r.setSSOState({ssoConfigurations:I}),R==null||R(!0)})},updateSSOGroups:async A=>{const{ssoConfigId:C,changedGroups:E,callback:x}=A;await o(Sn.SAVE_SSO_GROUPS,x,async()=>{await Promise.all(E.map(R=>t.auth.updateSSOGroup(C,R))),x==null||x(!0)})},setSSODefaultRoles:async A=>{const{callback:C,ssoConfigId:E,roleIds:x}=A;await o(Sn.UPDATE_SSO_DEFAULT_ROLES,C,async()=>{const R=e.auth.ssoState.ssoConfigurations;await t.auth.setSSODefaultRoles(E,{roleIds:x});const T=R.map(P=>P.id===E?F({},P,{roleIds:x}):P);r.setSSOState({ssoConfigurations:T}),C==null||C(!0)})},saveSSOConfigurationByMetadata:async A=>{const{configFile:C,callback:E}=A;await o(Sn.SAVE_SSO_CONFIGURATION_BY_METADATA,E,async()=>{const x=e.auth.ssoState.ssoConfigurations,R=await uf(C),T=await t.auth.createSSOConfigurationByMetadata({metadata:R});r.setSSOState({ssoConfigurations:[...x,T]}),E==null||E(T)})},updateSSOConfigurationByMetadata:async A=>{const{callback:C,ssoConfigId:E,configFile:x}=A;await o(Sn.UPDATE_SSO_CONFIGURATION_BY_METADATA,C,async()=>{const R=e.auth.ssoState.ssoConfigurations,T=await uf(x),P=await t.auth.updateSSOConfigurationByMetadata(E,{metadata:T}),I=R.map(U=>U.id===E?P:U);r.setSSOState({ssoConfigurations:I}),C==null||C(P)})},saveSSOConfigurationByUrl:async A=>{const{metadataUrl:C,configMetadata:E,ssoConfigId:x,callback:R}=A;await o(Sn.SAVE_SSO_CONFIGURATION_BY_METADATA,R,async()=>{const T=e.auth.ssoState.ssoConfigurations,P={url:C,configMetadata:E};let I,U;x?(I=await t.auth.updateSSOConfigurationByMetadataUrl(x,P),U=T.map(L=>L.id===x?I:L)):(I=await t.auth.createSSOConfigurationByMetadataUrl(P),U=[I,...T]),r.setSSOState({ssoConfigurations:U}),R==null||R(I)})},saveSSOConfigurationByData:async A=>{const{callback:C,ssoConfigId:E}=A,x=re(A,dse),R=e.auth.ssoState.ssoConfigurations;await o(Sn.SAVE_SSO_CONFIGURATION,C,async()=>{let T,P;E?(T=await t.auth.updateSSOConfiguration(E,x),P=R.map(I=>I.id===E?T:I)):(T=await t.auth.createSSOConfiguration(x),P=[T,...R]),r.setSSOState({ssoConfigurations:P}),C==null||C(T)})}}},gM=(e,t,n)=>F({},ase(e,t,n),fse(e,t,n)),mM={loading:!1,mfaDevices:void 0,mfaToken:""},hse=e=>Ue(mM,e),pse="MFA is not enrolled",gse=e=>(e==null?void 0:e.message)===pse,mse=(e,t,n)=>{const r=n,s=async l=>{await r.afterAuthenticationStateUpdate(l),await r.afterStepUpAuthNavigation()},i=async({mfaToken:l,mfaDevices:c})=>{r.setStepUpState({mfaDevices:c,mfaToken:l});const u=await Fw(c);r.setMfaState({step:u})},o=async l=>{if(gse(l)){r.setMfaState({step:Dt.noMFAEnrolledStepUp});return}window.localStorage.setItem(xi,"true");const c=e.auth.routes;de.for(e.root.appName).onRedirectTo(c.logoutUrl,{preserveQueryParams:!0})};return{generateStepUpSession:async l=>{const{maxAge:c,callback:u}=l;r.setStepUpState({mfaDevices:void 0,mfaToken:""});try{const d=await t.auth.generateStepupSession({maxAge:c});d.hasOwnProperty("user")?await s(d):await i(d),u==null||u(!0)}catch(d){u==null||u(!1),await o(d)}}}},vse=(e,t,n)=>{const r=n;return{stepUpHostedLogin:async i=>{var o,a;const l={acr_values:bw},{maxAge:c}=i||{};c!==void 0&&(l.max_age=c.toString());const u=(o=e.auth.tenantsState)==null||(a=o.activeTenant)==null?void 0:a.alias;u&&(l.organization=u),$w(),window.localStorage.setItem(xi,"true"),await r.__requestHostedLoginAuthorize(l)}}},vM=(e,t,n)=>{const r=n;return F({setStepUpState:g=>{Object.assign(e.auth.stepUpState,g)},resetStepUpState:()=>{Ne(e,["auth","stepUpState"],mM)},stepUpWithAuthenticator:async g=>{await r.mfaWithAuthenticator(g,r.setStepUpState,!0)},preVerifyMFASMSForStepUp:async g=>{await r.preVerifyMFASMS(g,r.setStepUpState)},verifyMFASMSForStepUp:async g=>{await r.verifyMFASMS(g,r.setStepUpState,!0)},preVerifyMFAWebAuthnForStepUp:async g=>{await r.preVerifyMFAWebAuthn(g,r.setStepUpState)},verifyMFAWebAuthnForStepUp:async g=>{await r.verifyMFAWebAuthn(g,r.setStepUpState,!0)},preVerifyMFAEmailCodeForStepUp:async g=>{await r.preVerifyMFAEmailCode(g,r.setStepUpState)},verifyMFAEmailCodeForStepUp:async g=>{await r.verifyMFAEmailCode(g,r.setStepUpState)}},mse(e,t,n),vse(e,t,n))},yM={loaders:{},pageOffset:0,pageSize:20,errors:{},users:[],allUsers:[],roles:[],permissions:[],totalPages:0,shouldShowSubTenantUsersIfReseller:!1,allUsersQueryParams:{_filter:null,_offset:0,_limit:20,_order:"DESC",_sortBy:"name"},addUserDialogState:{loading:!1,open:!1},deleteUserDialogState:{loading:!1,open:!1},lockUserDialogState:{loading:!1,open:!1},enableUserDialogState:{loading:!1,open:!1},disableUserDialogState:{loading:!1,open:!1}},yse=e=>Ue(yM,e),Sse=["callback","appIds"],bse=["roles"],_se=["callback","profileImage"],wse=["callback"],Ese=["callback"],Ase=["callback"],Cse=(e,t,n)=>{const r=n,s=async T=>{try{const{groups:P}=await Oe(()=>t.groups.getGroups({_groupsRelations:nm.roles}),T);return P}catch{return[]}},i=async(T,P)=>
421{const{shouldLoadRoles:I=!0,shouldLoadApps:U,shouldLoadEmails:L=!1,retryConfig:z}=P,O=T.map(Y=>Y.id),[{items:j},{items:N},{items:V},k,$,M,{items:B},H]=await Promise.all([O.length>0?t.users.getUsersUsernames({userIds:O}):{items:[]},O.length>0?t.userPhoneNumbers.getUsersPhoneNumberV2({userIds:O.join(",")}):{items:[]},t.teams.loadAvailableRoles(),t.teams.loadAvailablePermissions(),O.length>0?t.users.getUsersRoles({ids:O}):[],O.length>0?t.users.getUsersGroups({ids:O}):[],L&&O.length>0?t.usersEmails.getUsersEmailsV1({userIds:O.join(",")}):{items:[]},s(z),I?c({retryConfig:z}):void 0]),X=T.map(Y=>{var ae,Ae,oe;const K=$.find(we=>we.userId===Y.id),G=(K==null?void 0:K.roleIds)||[],Q=V.filter(we=>G.includes(we.id)),Z=M.find(we=>we.userId===Y.id),ee=(Z==null?void 0:Z.groupIds)||[],ge=H.filter(we=>ee.includes(we.id)),pe=j==null||(ae=j.find(we=>we.userId===Y.id))==null?void 0:ae.username,xe=N==null||(Ae=N.find(we=>we.userId===Y.id))==null?void 0:Ae.phoneNumber,Le=(B==null?void 0:B.filter(we=>we.userId===Y.id))||[],Be=(oe=Le.find(we=>we.isPrimary))==null?void 0:oe.email,ye=Le.map(we=>({email:we.email,isPrimary:we.isPrimary}));return Y.name||(Y.name=pe),F({},Y,{username:pe,phoneNumber:xe},L&&Be?{email:Be}:{},L&&ye.length>0?{emails:ye}:{},{roles:Q,roleIds:G,groups:ge,permissions:Q.flatMap(we=>we.permissions)})});return{enrichedUsers:await n.mapUsersWithApplicationData({shouldLoadApps:U,users:X,retryConfig:z}),roles:V,permissions:k}},o=(T,P,I,U,L,z)=>{n.setTeamState({users:T,totalPages:U,totalItems:L,roles:P,permissions:I}),r.setTeamLoader({key:Ee.USERS,value:!1}),z==null||z(T)},a=(T,P,I)=>{I&&console.error(I,T),r.setTeamError({key:Ee.USERS,value:W(T)}),r.setTeamState({totalPages:0,users:[]}),r.setTeamLoader({key:Ee.USERS,value:!1}),P==null||P(null,T)},l=async(T,P,I=!0,U)=>{var L,z,O;const{silentLoading:j,callback:N,shouldLoadEmails:V=!1,retryConfig:k}=T,$=e.auth.teamState,M=(L=T._limit)!=null?L:$.pageSize,B=(z=T._offset)!=null?z:$.pageOffset,H=(O=T==null?void 0:T.shouldShowSubTenantUsersIfReseller)!=null?O:$==null?void 0:$.shouldShowSubTenantUsersIfReseller;r.setTeamLoader({key:Ee.USERS,value:!j}),r.setTeamState({pageSize:M,pageOffset:B});try{const X=await P(B,M);if(!X.items||X.items.length===0){n.setTeamState({users:[],totalPages:0,totalItems:0}),r.setTeamLoader({key:Ee.USERS,value:!1}),N==null||N([]);return}const te=X.items.map(K=>K.userId),{items:Y}=await t.users.getUsersV3({ids:te.join(","),_includeSubTenants:H}),{enrichedUsers:ae,roles:Ae,permissions:oe}=await i(Y,{shouldLoadRoles:I,shouldLoadApps:U,shouldLoadEmails:V,retryConfig:k});o(ae,Ae,oe,X._metadata.totalPages,X._metadata.totalItems,N)}catch(X){a(X,N,`Failed to load users by search criteria in fetch function: ${P.name}`)}},c=async T=>{r.setTeamLoader({key:Ee.ROLES_AND_PERMISSIONS,value:!0});try{var P;const U=T==null?void 0:T.retryConfig,[{items:L},{items:z}]=await Promise.all([Oe(()=>t.teams.loadAvailableRoles(),U),Oe(()=>t.teams.loadAvailablePermissions(),U)]);r.setTeamState({roles:L,permissions:z}),T==null||(P=T.callback)==null||P.call(T,{roles:L,permissions:z})}catch(U){var I;T==null||(I=T.callback)==null||I.call(T,null,U),r.setTeamError({key:Ee.ROLES_AND_PERMISSIONS,value:W(U)})}finally{r.setTeamLoader({key:Ee.ROLES_AND_PERMISSIONS,value:!1})}},u=async T=>{var P,I,U,L;const{silentLoading:z,callback:O}=T,j=e.auth.teamState,N=(P=T.pageSize)!=null?P:j.pageSize,V=(I=T.pageOffset)!=null?I:j.pageOffset,k=(U=T.filter)!=null?U:j.filter,$=(L=T.sort)!=null?L:j.sort;r.setTeamLoader({key:Ee.USERS,value:!z}),r.setTeamState({pageSize:N,pageOffset:V,filter:k,sort:$});try{const[{items:M,totalPages:B,totalItems:H}]=await Promise.all([t.teams.loadUsers({pageSize:N,pageOffset:V,filter:k,sort:$}),c()]);r.setTeamState({users:M,totalPages:B,totalItems:H}),O==null||O(M)}catch(M){r.setTeamError({key:Ee.USERS,value:W(M)}),r.setTeamState({totalPages:0,users:[]}),O==null||O(null,M)}r.setTeamLoader({key:Ee.USERS,value:!1})},d=async T=>{var P,I,U,L,z;const{silentLoading:O,callback:j,shouldLoadRoles:N=!0,shouldLoadApps:V,retryConfig:k}=T,$=e.auth.teamState,M=(P=T.pageSize)!=null?P:$.pageSize,B=(I=T.pageOffset)!=null?I:$.pageOffset,H=(U=T.filter)!=null?U:$.filterV2,X=(L=T.sort)!=null?L:$.sortV2,te=(z=T==null?void 0:T.shouldShowSubTenantUsersIfReseller)!=null?z:$==null?void 0:$.shouldShowSubTenantUsersIfReseller;r.setTeamLoader({key:Ee.USERS,value:!O}),r.setTeamState({pageSize:M,pageOffset:B,filterV2:H,sortV2:X});try{const[{items:Y,_metadata:{totalPages:ae,totalItems:Ae}},{items:oe},{items:K},G]=await Promise.all([Oe(()=>t.users.getUsersV2(F({},(H==null?void 0:H.length)&&{_filter:H},X&&{_sortBy:X},T.order&&{_order:T.order},{_offset:B,_limit:M,_includeSubTenants:te})),k),Oe(()=>t.teams.loadAvailableRoles(),k),Oe(()=>t.teams.loadAvailablePermissions(),k),s(k),N?c({retryConfig:k}):void 0]),Z=Y.map(ge=>{var pe;const xe=ge==null||(pe=ge.groups)==null?void 0:pe.map(Le=>G.filter(Be=>Be.id===Le.id)).flat();return F({},ge,{groups:xe})}).map(ge=>F({},ge,{roleIds:ge.roles.map(pe=>pe.id)})),ee=await n.mapUsersWithApplicationData({shouldLoadApps:V,users:Z,retryConfig:k});n.setTeamState({users:ee,totalPages:ae,totalItems:Ae,roles:oe,permissions:K}),j==null||j(Y)}catch(Y){console.error("Failed to load users",Y),r.setTeamError({key:Ee.USERS,value:W(Y)}),r.setTeamState({totalPages:0,users:[]}),j==null||j(null,Y)}r.setTeamLoader({key:Ee.USERS,value:!1})},f=async T=>{var P,I,U,L;const{silentLoading:z,callback:O,shouldLoadRoles:j=!0,shouldLoadApps:N,shouldLoadEmail
421s:V=!1,retryConfig:k}=T,$=e.auth.teamState,M=(P=T.pageSize)!=null?P:$.pageSize,B=(I=T.pageOffset)!=null?I:$.pageOffset,H=(U=T.sort)!=null?U:$.sortV2,X=(L=T==null?void 0:T.shouldShowSubTenantUsersIfReseller)!=null?L:$==null?void 0:$.shouldShowSubTenantUsersIfReseller;r.setTeamLoader({key:Ee.USERS,value:!z}),r.setTeamState({pageSize:M,pageOffset:B});try{const{items:te,_metadata:{totalPages:Y,totalItems:ae}}=await t.users.getUsersV3(F({},H&&{_sortBy:H},T.order&&{_order:T.order},{_offset:B,_limit:M,_includeSubTenants:X},g(T))),{enrichedUsers:Ae,roles:oe,permissions:K}=await i(te,{shouldLoadRoles:j,shouldLoadApps:N,shouldLoadEmails:V,retryConfig:k});o(Ae,oe,K,Y,ae,O)}catch(te){a(te,O,"Failed to load users v3")}},g=T=>{const{identifier:P,identifierType:I,email:U,namePrefix:L}=T;return U!=null&&U.length?{_email:U}:L!=null&&L.length?{_namePrefix:L}:I==="username"&&P!=null&&P.length?{_identifier:P,_identifierType:"username"}:{}};return{loadRoles:c,loadUsers:u,loadUsersV2:d,loadUsersV3:f,loadUsersByGetUsersPhoneNumberV2:async T=>{const{_phoneNumber:P,shouldLoadRoles:I=!0,shouldLoadApps:U,shouldLoadEmails:L=!1}=T;return l(T,(z,O)=>t.userPhoneNumbers.getUsersPhoneNumberV2({_phoneNumber:P,_offset:z,_limit:O}),I,U)},loadUsersByGetUsernamesV1:async T=>{const{_usernamePrefix:P,shouldLoadRoles:I=!0,shouldLoadApps:U,shouldLoadEmails:L=!1}=T;return l(T,(z,O)=>t.usernames.getUsernamesV1({_usernamePrefix:P,_offset:z,_limit:O}),I,U)},loadUsersByGetEmailsV1:async T=>{const{_email:P,shouldLoadRoles:I=!0,shouldLoadApps:U,shouldLoadEmails:L=!1}=T;return l(T,(z,O)=>t.usersEmails.getUsersEmailsV1({_email:P,_offset:z,_limit:O}),I,U)},addUser:async T=>{const{callback:P,appIds:I}=T,U=re(T,Sse),L=e.auth.teamState;r.setTeamState({addUserDialogState:F({},L.addUserDialogState,{loading:!0})});try{var z;const O=await t.teams.addUser(U),{roles:j}=O,N=re(O,bse),V=(z=j==null?void 0:j.map(M=>M.id))!=null?z:[],k=F({},N,{roleIds:V,roles:j||[],groups:[]}),$=await n.assignNewUserToApps({appIds:I,user:k});$&&(k.applications=$),P==null||P(k),r.setTeamState({users:[k,...L.users],addUserDialogState:{open:!1,loading:!1}})}catch(O){console.error("Failed to add user",O),r.setTeamState({addUserDialogState:F({},L.addUserDialogState,{loading:!1,error:W(O)})}),P==null||P(null,O)}},addUsersBulk:async T=>{const{callback:P}=T,I=e.auth.teamState;r.setTeamState({addUserDialogState:F({},I.addUserDialogState,{loading:!0})});const U=[],L=[],z=T.emails.map(j=>F({email:j,roleIds:T.roleIds},T.expirationInSeconds&&{expirationInSeconds:T.expirationInSeconds}));r.setTeamState({addUserDialogState:{open:!0,loading:!0}});for(let j=0;j<z.length;j++){const N=z.at(j);try{await t.teams.addUser(N),U.push(N.email)}catch{L.push(N.email)}}const O={pageOffset:0,pageSize:10,filter:"",silentLoading:T.emails.length>0};await r.loadUsersV2(O),r.setTeamState({addUserDialogState:{loading:!1}}),P==null||P({unallowedEmails:L,allowedEmails:U})},updateUser:async T=>{const{callback:P}=T,I=re(T,_se),{id:U}=I,L=e.auth.teamState,z=L.users.find(j=>j.id===I.id);if(z===void 0){P==null||P(null,"User not in state");return}r.setTeamLoader({key:Ee.UPDATE_USER,value:U||""}),r.setTeamState({addUserDialogState:F({},L.addUserDialogState,{loading:!0})}),r.setTeamState({addUserDialogState:F({},L.addUserDialogState,{loading:!0}),users:L.users.map(j=>j.id===I.id?F({},j,I):j)});try{var O;z.roleIds.length>0&&((O=I.roleIds)==null?void 0:O.length)===0&&(I.roleIds=[""]);const{item:j}=await t.teams.updateUser(I);P==null||P(j),r.setTeamState({users:L.users.map(N=>N.id===j.id?F({},N,j,{groups:N.groups,createdAt:N.createdAt,customData:N.customData,lastLogin:N.lastLogin}):N)}),r.setTeamLoader({key:Ee.UPDATE_USER,value:!1})}catch(j){r.setTeamState({addUserDialogState:F({},L.addUserDialogState,{loading:!1,error:W(j)}),users:L.users.map(N=>N.id===I.id?F({},N,z):N)}),r.setTeamLoader({key:Ee.UPDATE_USER,value:!1}),P==null||P(null,j)}},deleteUser:async T=>{const{callback:P}=T,I=re(T,wse),U=e.auth.teamState;r.setTeamState({deleteUserDialogState:F({},U.deleteUserDialogState,{loading:!0})});try{await t.teams.deleteUser(I),P==null||P(!0),r.setTeamState({users:U.users.filter(L=>L.id!==I.userId),deleteUserDialogState:{open:!1,loading:!1}})}catch(L){r.setTeamState({deleteUserDialogState:F({},U.deleteUserDialogState,{loading:!1,error:W(L)})}),P==null||P(null,L)}},enableUser:async T=>{const{callback:P,userId:I}=T,U=e.auth.teamState;r.setTeamState({enableUserDialogState:F({},U.enableUserDialogState,{loading:!0})});try{await t.teams.enableUser(I),P==null||P(!0),r.setTeamState({users:U.users.map(L=>L.id===I?F({},L,{isDisabled:!1}):L),enableUserDialogState:{open:!1,loading:!1}})}catch(L){r.setTeamState({enableUserDialogState:F({},U.enableUserDialogState,{loading:!1,error:W(L)})}),P==null||P(null,L)}},disableUser:async T=>{const{callback:P,userId:I}=T,U=e.auth.teamState;r.setTeamState({disableUserDialogState:F({},U.disableUserDialogState,{loading:!0})});try{await t.teams.disableUser(I),P==null||P(!0),r.setTeamState({users:U.users.map(L=>L.id===I?F({},L,{isDisabled:!0}):L),disableUserDialogState:{open:!1,loading:!1}})}catch(L){r.setTeamState({disableUserDialogState:F({},U.disableUserDialogState,{loading:!1,error:W(L)})}),P==null||P(null,L)}},getTemporaryUsersConfig:async T=>{r.setTeamError({key:Ee.CONFIG_TEMPORARY_USERS,value:!1});try{const P=await Oe(()=>t.teams.getTemporaryUserConfiguration(),T==null?void 0:T.retryConfig);r.setTeamState({temporaryUsersConfig:P})}catch(P){r.setTeamError({key:Ee.CONFIG_TEMPORARY_USERS,value:W(P)})}},updateUserExpirationTime:async T=>{const{callback:P}=T,I=re(T,Ese),U=e.auth.teamState;r.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!0});try{const L=await t.teams.updateUserExpirationTime(I);r.setTeamState({users:U.users.map(z=>z.id===I.userId?F({},z,{temporaryExpirationDate:new Date(L.temporaryExpirationDate)}):z)}),P==null||P(!0)}catch(L){r.setTeamError({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:W(L)}),P==null||P(null,L)}finally{r.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!1})}},setUserAsPermanent:async T=>{const{callback:P}=T,I=re(T,Ase),U=e.auth.teamState;r.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!0});try{await t.teams.setPermanentUser(I.userId),r.setTeamState({users:U.users.map(L=>L.id===I.userId?F({},L,{temporaryExpirationDate:void 0}):L)}),P==null||P(!0)}catch(L){r.setTeamError({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:W(L)}),P==null||P(null,L)}finally{r.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!1})}}}},xse=["callback","userId"],Tse=["callback"],Pse=["callback"],Rse=(e,t,n)=>{const r=n;return{loadAllSubTenantsUsers:async l=>{var c,u,d,f,g;const{silentLoading:h,callback:p}=l,m=e.auth.teamState.allUsersQueryParams,S=(c=l._limit)!=null?c:m._limit,b=(u=l._offset)!=null?u:m._offset,w=(d=l._filter)!=null?d:m._filter,A=(f=l._sortBy)!=null?f:m._sortBy,C=(g=l._order)!=null?g:m._order,E={_limit:S||20,_offset:b||0,_filter:w||"",_sortBy:A||"name",_order:C||"DESC"};r.setTeamLoader({key:Ee.USERS,value:!h}),r.setTeamState({allUsersQueryParams:E,pageOffset:E._offset});try{const[{items:x,_metadata:{totalPages:R,totalItems:T}},{items:P},{items:I}]=await Promise.all([t.subTenants.loadAllUsers(F({},E)),t.teams.loadAvailableRoles(),t.teams.loadAvailablePermissions()]);r.setTeamState({allUsers:x,totalPages:R,totalItems:T,roles:P,permissions:I}),p==null||p(x)}
421catch(x){r.setTeamError({key:Ee.USERS,value:W(x)}),r.setTeamState({totalPages:0,users:[]}),p==null||p(null,x)}r.setTeamLoader({key:Ee.USERS,value:!1})},setUserRolesForSubTenants:async l=>{const{callback:c,userId:u}=l,d=re(l,xse),f=e.auth.teamState;r.setTeamState({addUserDialogState:F({},f.addUserDialogState,{loading:!0})});try{await t.subTenants.setUserRolesForSubTenants(u,d);const g=f.allUsers.find(p=>p.id===u);let h=[];g&&(h=g.tenants.map(p=>{var v;return F({},p,{roles:((v=d.subTenantsRoles.find(m=>m.tenantId===p.tenantId))==null?void 0:v.roleIds.map(m=>f.roles.find(({id:b})=>m===b)).filter(m=>m))||p.roles})})),r.setTeamState({allUsers:[...f.allUsers.filter(p=>p.id!==u),...g?[F({},g,{tenants:h})]:[]],addUserDialogState:{open:!1,loading:!1}}),c==null||c(!0)}catch(g){r.setTeamState({addUserDialogState:F({},f.addUserDialogState,{loading:!1,error:W(g)})}),c==null||c(null,g)}},deleteUserFromSubTenants:async l=>{const{callback:c}=l,u=re(l,Tse),d=e.auth.teamState;r.setTeamState({deleteUserDialogState:F({},d.deleteUserDialogState,{loading:!0})});try{await t.subTenants.removeUserFromTenantAndSubTenants(u),c==null||c(!0),r.setTeamState({allUsers:d.allUsers.filter(f=>f.id!==u.userId&&f.tenants.length===u.subTenants.length),deleteUserDialogState:{open:!1,loading:!1}})}catch(f){r.setTeamState({deleteUserDialogState:F({},d.deleteUserDialogState,{loading:!1,error:W(f)})}),c==null||c(null,f)}},addUserToSubTenants:async l=>{const{callback:c}=l,u=re(l,Pse),d=e.auth.teamState;r.setTeamState({addUserDialogState:F({},d.addUserDialogState,{loading:!0})});try{await t.subTenants.addUserToTenantAndSubTenants(u);const{items:f,_metadata:{totalPages:g,totalItems:h}}=await t.subTenants.loadAllUsers({_limit:20,_offset:0,_filter:"",_sortBy:"name",_order:"DESC"});r.setTeamState({allUsers:f,totalPages:g,totalItems:h,addUserDialogState:{open:!1,loading:!1}}),c==null||c(null)}catch(f){r.setTeamState({addUserDialogState:F({},d.addUserDialogState,{loading:!1,error:W(f)})}),c==null||c(null,f)}}}},kse=["callback"],Ose=["callback"],Ise=["callback"],Nse=["callback"],Lse=(e,t,n)=>{const r=n,s=async(c,u,d,f)=>{r.setTeamLoader({key:c,value:u});try{await f()}catch(g){r.setTeamError({key:c,value:W(g)}),d==null||d(null,g)}finally{r.setTeamLoader({key:c,value:!1})}};return{resendActivationLink:async c=>{const{callback:u}=c,d=re(c,kse);await s(Ee.RESEND_ACTIVATE_LINK,d.userId,u,async()=>{await t.teams.resendActivationLink(d),u==null||u(!0)})},resendInvitationLink:async c=>{const{callback:u}=c,d=re(c,Ose);await s(Ee.RESEND_INVITATION_LINK,d.email,u,async()=>{await t.teams.resendInvitationLink(d),u==null||u(!0)})},resendInvitationEmail:async c=>{const{callback:u}=c,d=re(c,Ise);await s(Ee.RESEND_INVITATION_LINK,u,d.email,async()=>{await t.auth.resendInvitationEmail(d),u==null||u(!0)})},resendInvitationLinkToAllSubTenants:async c=>{const{callback:u}=c,d=re(c,Nse);await s(Ee.RESEND_INVITATION_LINK,d.email,u,async()=>{await t.teams.resendInvitationLinkToAllTenants(d),u==null||u(!0)})}}},Dse=(e,t,n)=>{const r=n,s=async c=>{r.setTeamError({key:Ee.CONFIG_TOKEN_LINK,value:!1});try{const u=await Oe(()=>t.teams.getInviteLinkConfiguration(),c);r.setTeamState({inviteTokenState:F({},u)})}catch(u){r.setTeamError({key:Ee.CONFIG_TOKEN_LINK,value:W(u)})}};return{getInvitationLink:async c=>{r.setTeamError({key:Ee.GET_TOKEN_LINK,value:!1});try{const u=c==null?void 0:c.retryConfig;await s(u);const d=await Oe(()=>t.teams.getInviteUserLink(),u),{inviteTokenState:f}=e.auth.teamState;r.setTeamState({inviteTokenState:F({},f,d)})}catch(u){r.setTeamError({key:Ee.GET_TOKEN_LINK,value:W(u)})}},createInvitationLink:async c=>{const{callback:u,expiresInMinutes:d,shouldSendEmail:f,roleIds:g}=c;r.setTeamError({key:Ee.CREATE_TOKEN_LINK,value:!1});const{inviteTokenState:h}=e.auth.teamState;try{const[p]=await r.getFeatureFlags(["invite_user_modal_enhancements_frontend"]);let v;p?v=await t.teams.createInviteUserLinkV2({expiresInMinutes:d??43200,shouldSendEmail:f??!0,roleIds:g??[]}):v=await t.teams.createInviteUserLink({expiresInMinutes:43200}),r.setTeamState({inviteTokenState:F({},h,v)}),u==null||u(v.token)}catch(p){u==null||u(null,p),r.setTeamError({key:Ee.CREATE_TOKEN_LINK,value:W(p)})}},updateInvitationLink:async c=>
421{const{callback:u,expiresInMinutes:d,shouldSendEmail:f}=c;r.setTeamError({key:Ee.UPDATE_TOKEN_LINK,value:!1});try{const{inviteTokenState:g}=e.auth.teamState,h=await t.teams.updateInviteUserLink({expiresInMinutes:d,shouldSendEmail:f});r.setTeamState({inviteTokenState:F({},g,h)}),u==null||u(!0)}catch(g){u==null||u(null,g),r.setTeamError({key:Ee.UPDATE_TOKEN_LINK,value:W(g)})}},deleteInvitationLink:async c=>{const{callback:u}=c??{};r.setTeamError({key:Ee.DELETE_TOKEN_LINK,value:!1});try{await t.teams.deleteInviteUserLink(),await s(),u==null||u(!0)}catch(d){r.setTeamError({key:Ee.DELETE_TOKEN_LINK,value:W(d)}),u==null||u(!1,d)}}}},SM=(e,t,n)=>{const r=f=>{Object.assign(e.auth.teamState,f)};return F({setTeamLoader:f=>{Object.assign(e.auth.teamState,{loaders:F({},e.auth.teamState.loaders,{[f.key]:f.value})})},setTeamError:f=>{Object.assign(e.auth.teamState,{errors:F({},e.auth.teamState.errors,{[f.key]:f.value}),loaders:F({},e.auth.teamState.loaders,{[f.key]:!1})})},setTeamState:r,resetTeamState:()=>{Ne(e,["auth","teamState"],yM)},openAddUserDialog:f=>{r({addUserDialogState:F({open:!0,loading:!1,error:!1},f)})},closeAddUserDialog:f=>{var g,h;(g=(h=e.auth.teamState.addUserDialogState).onClose)==null||g.call(h,f),r({addUserDialogState:{loading:!1,error:!1,open:!1}})},openDeleteUserDialog:f=>{r({deleteUserDialogState:F({open:!0,loading:!1,error:!1},f)})},closeDeleteUserDialog:f=>{var g,h;(g=(h=e.auth.teamState.deleteUserDialogState).onClose)==null||g.call(h,f),r({deleteUserDialogState:{loading:!1,error:!1,open:!1}})},lockUser:async f=>{}},Cse(e,t,n),Rse(e,t,n),Lse(e,t,n),Dse(e,t,n))},bM={tenants:[],subTenants:[],switchingTenant:!1,loading:!0,tenantTree:null},Mse=e=>Ue(bM,e),_M=(e,t,n)=>{const r=n,s=u=>{Object.assign(e.auth.tenantsState,u)};return{setTenantsState:s,resetTenantsState:()=>{Ne(e,["auth","tenantsState"],bM)},switchTenant:async u=>{const{tenantId:d,silentReload:f,callback:g}=u;f?r.setTenantsState({switchingTenant:!0}):r.setAuthState({isLoading:!0});try{await t.tenants.switchTenant({tenantId:d}),f&&r.resetAuthState({isLoading:!1,isAuthenticated:!0,user:e.auth.user}),await r.__refreshToken(),(g==null?void 0:g(!0))||(f?r.setTenantsState({switchingTenant:!1}):r.setAuthState({isLoading:!1}))}catch(h){f?r.setTenantsState({switchingTenant:!1}):r.setAuthState({isLoading:!1}),g==null||g(!1,h)}},loadTenants:async u=>{s({loading:!0});try{var d;const h=await Zg(e.root.appName)();s({tenants:h.tenants,activeTenant:h.activeTenant,loading:!1}),u==null||(d=u.callback)==null||d.call(u,[])}catch(g){var f;u==null||(f=u.callback)==null||f.call(u,[],g),s({loading:!1})}},loadSubTenants:async u=>{s({loading:!0});try{var d;const g=await retryIfNeeded(()=>t.tenants.getSubTenants(),u==null?void 0:u.retryConfig);s({subTenants:g,loading:!1}),u==null||(d=u.callback)==null||d.call(u,!0)}catch(g){var f;s({loading:!1}),u==null||(f=u.callback)==null||f.call(u,null,g)}},loadSubTenantsTree:async u=>{s({loading:!0});try{var d;const g=await t.tenants.getSubTenantsAsTree();s({tenantTree:g,loading:!1}),u==null||(d=u.callback)==null||d.call(u,!0)}catch(g){var f;s({loading:!1}),u==null||(f=u.callback)==null||f.call(u,null,g)}}}},wM={loading:!1,error:null,username:void 0,fetching:!0},Use=e=>Ue(wM,e),EM=(e,t,n)=>{const r=l=>{Object.assign(e.auth.usernamesState,l)},s=()=>{Ne(e,["auth","usernamesState"],wM)},i=async()=>{r({loading:!0});try{const l=await t.usernames.getUserOwnUsername();r({username:l==null?void 0:l.username,loading:!1,fetching:!1})}catch(l){r({error:W(l),fetching:!1})}finally{r({loading:!1,fetching:!1})}},o=async l=>{r({loading:!0});try{if(e.auth.usernamesState.username===l.username){var c;(c=l.callback)==null||c.call(l);return}if(e.auth.usernamesState.username&&e.auth.usernamesState.username!==l.username&&(await a(e.auth.usernamesState.username),!l.username)){var u;r({username:void 0,loading:!1}),(u=l.callback)==null||u.call(l);return}if(l.username){var d;await t.usernames.createUsername(l),r({username:l.username,loading:!1}),(d=l.callback)==null||d.call(l)}}catch(f){r({error:W(f)})}finally{r({loading:!1})}},a=async l=>{r({loading:!0});try{await t.usernames.deleteUsername(l),r({username:void 0,loading:!1})}catch(c){r({error:W(c)})}finally{r({loading:!1})}};return{resetUsernamesState:s,loadUserOwnUsername:i,saveUserUsername:o,deleteUserUsername:a}},Fse={userEmailPolicyConfig:null,loading:!1},$se=e=>Ue(Fse,e),AM=(e,t,n)=>{const r=i=>{Object.assign(e.auth.userEmailPolicyState,i)};return{loadUserEmailPolicyState:async()=>{r({loading:!0});try{const i=await t.userEmailPolicy.getUserEmailPolicyConfig();r({loading:!1,userEmailPolicyConfig:i})}catch(i){r({loading:!1,error:W(i)})}},setUserEmailPolicyState:r}},CM=(e,t,n)=>{const r=o=>{e.auth.user&&(e.auth.user.entitlements=o)},s=o=>{var a;const l=(a=e.auth.user)==null?void 0:a.entitlements;
421Lw(l,o)||r(o)};return{setEntitlements:r,handleFetchedEntitlements:s,loadEntitlements:async o=>{const a=o==null?void 0:o.callback;try{const l=await t.entitlements.loadEntitlementsV2();s(l),a==null||a(!0)}catch{a==null||a(!1)}}}};let a1;(function(e){e[e.Email=0]="Email",e[e.Otc=1]="Otc",e[e.Success=2]="Success"})(a1||(a1={}));const jse=["routes"],Vse=["requestName"],xM=e=>{const t=e??{},{routes:n}=t,r=re(t,jse);return Ue(F({routes:F({},ww,n),onRedirectTo:()=>{},isAuthenticated:!1,isLoading:!0,isSSOAuth:!1,user:null,error:void 0,errorByRequest:{},userIp:void 0,userIpData:{loading:!1}},r,{acceptInvitationState:aee(r==null?void 0:r.acceptInvitationState),accountSettingsState:Tee(r==null?void 0:r.accountSettingsState),activateAccountState:Ree(r==null?void 0:r.activateAccountState),unlockAccountState:sne(r==null?void 0:r.unlockAccountState),approvalFlowState:ine(r==null?void 0:r.approvalFlowState),apiTokensState:lne(r==null?void 0:r.apiTokensState),applicationsState:cne(r==null?void 0:r.applicationsState),customLoginState:fne(r==null?void 0:r.customLoginState),forgotPasswordState:pne(r==null?void 0:r.forgotPasswordState),passwordRotationState:vne(r==null?void 0:r.passwordRotationState),groupsState:yne(r==null?void 0:r.groupsState),groupsDialogsState:bne(r==null?void 0:r.groupsDialogsState),impersonateState:_ne(r==null?void 0:r.impersonateState),loginState:Ene(r==null?void 0:r.loginState),mfaState:ere(r==null?void 0:r.mfaState),allAccountsState:cre(r==null?void 0:r.allAccountsState),allAccountsDialogsState:ure(r==null?void 0:r.allAccountsDialogsState),passkeysState:dre(r==null?void 0:r.passkeysState),profileState:fre(r==null?void 0:r.profileState),provisioningState:pre(r==null?void 0:r.provisioningState),resetPhoneNumberState:vre(r==null?void 0:r.resetPhoneNumberState),rolesState:_re(r==null?void 0:r.rolesState),restrictionsState:Rre(r==null?void 0:r.restrictionsState),securityCenterState:Lre(r==null?void 0:r.securityCenterState),securityPolicyState:Mre(r==null?void 0:r.securityPolicyState),sessionsPolicyState:Bre(r==null?void 0:r.sessionsPolicyState),sessionsState:Gre(r==null?void 0:r.sessionsState),signUpState:Hre(r==null?void 0:r.signUpState),smsState:Yre(r==null?void 0:r.smsState),socialLoginState:nse(r==null?void 0:r.socialLoginState),ssoState:ise(r==null?void 0:r.ssoState),stepUpState:hse(r==null?void 0:r.stepUpState),teamState:yse(r==null?void 0:r.teamState),tenantsState:Mse(r==null?void 0:r.tenantsState),usernamesState:Use(r==null?void 0:r.usernamesState),userEmailPolicyState:$se(r==null?void 0:r.userEmailPolicyState)}))},TM=(e,t,n,r)=>{const s=oe=>{Object.keys(oe).forEach(K=>{const G=K;Cw(e.auth[G])?Object.assign(e.auth[G],oe[G]):e.auth[G]=oe[G]})},i=(oe={})=>{Ne(e,["auth"],F({},r,oe))},o=oe=>{s({user:oe})},a=oe=>{let{requestName:K}=oe,G=re(oe,Vse);e.auth.errorByRequest=F({},e.auth.errorByRequest,{[K]:F({},G,{isError:!0})})},l=B5(e,t),c=G5(e,t,n),u=vD(e,t,n),d=SD(e,t),f=_D(e,t),g=ED(e,t),h=CD(e,t,n),p=TD(e,t,n),v=CM(e,t),m=RD(e,t),S=kD(e),b=ID(e,t),w=LD(e),A=MD(e,t,n),C=FD(e,t,n),E=jD(e,t,n),x=VD(e,t,n),R=BD(e),T=GD(e,t,n),P=WD(e,t,n),I=qD(e,t),U=QD(e,t,n),L=JD(e,t),z=ZD(e,t,n),O=tM(e,t,n),j=rM(e,t,n),N=iM(e,t,n),V=aM(e,t),k=cM(e,t,n),$=dM(e,t),M=hM(e,t,n),B=gM(e,t,n),H=vM(e,t,n),X=SM(e,t,n),te=_M(e,t,n),Y=EM(e,t),ae=AM(e,t),Ae={acceptInvitationActions:l,accountSettingsActions:c,activateAccountActions:u,unlockAccountActions:d,approvalFlowActions:f,apiTokensActions:g,applicationsActions:h,customLoginActions:p,entitlementsActions:v,forgotPasswordActions:m,passwordRotationActions:S,groupsActions:b,groupsDialogsActions:w,impersonateActions:A,loginActions:C,mfaActions:E,allAccountsActions:x,allAccountsDialogActions:R,passkeysActions:T,profileActions:P,provisioningActions:I,resetPhoneNumberActions:U,rolesActions:L,restrictionsActions:z,securityCenterActions:O,securityPolicyActions:j,sessionsPolicyActions:N,sessionsActions:V,signUpActions:k,smsActions:$,socialLoginActions:M,ssoActions:B,stepUpActions:H,teamActions:X,tenantsActions:te,usernamesActions:Y,usersEmailsPolicyActions:ae};return[F({setAuthState:s,setErrorByRequestName:a,setState:s,resetAuthState:i,setUser:o},Object.values(Ae).reduce((oe,K)=>F({},oe,K),{})),Ae]},PM={isLoading:!1,isSaving:!1,list:[],processIds:[],slackChannels:{isLoading:!1}},RM=e=>Ue(PM,e),Bse=["email","slack","sms","webhook"],Fu={sms:{title:"connectivity.sms",events:e=>(e==null?void 0:e.length)||0,isActive:e=>{var t;return(t=e==null?void 0:e.some(({enabled:n})=>n))!=null?t:!1},image:"sms"},email:{title:"common.email",events:e=>(e==null?void 0:e.length)||0,isActive:e=>{var t;return(t=e==null?void 0:e.some(({enabled:n})=>n))!=null?t:!1},image:"email"},slack:{title:"connectivity.slack",events:e=>{var t;return(e==null||(t=e.slackSubscriptions)==null?void 0:t.length)||0},isActive:e=>!!(e!=null&&e.slackSubscriptions.some(({isActive:t})=>t)),image:"slack"},webhook:{title:"connectivity.webhook",events:e=>(e==null?void 0:e.length)||0,isActive:e=>{var t;return(t=e==null?void 0:e.some(({isActive:n})=>n))!=null?t:!1},image:"webhook"}},zse=["id"],Gse=["id","enabled"],Bw=(e,t,n)=>{const r={slack:t.connectivity.getSlackConfiguration,email:t.connectivity.getEmailConfiguration,sms:t.connectivity.getSMSConfiguration,webhook:t.connectivity.getWebhooksConfigurations,categories:t.connectivity.getCategories,channelMap:t.connectivity.getChannelMaps},s=["categories","channelMap"],i={slack:t.connectivity.postSlackConfiguration,email:t.connectivity.postEmailConfiguration,sms:t.connectivity.postSMSConfiguration,webhook:t.connectivity.postWebhooksConfiguration},o=P=>{Object.assign(e.connectivity,P)},a=P=>{var I;const U=(I=e.connectivity.retryResult)!=null?I:{};e.connectivity.retryResult=F({},U,P)},l=()=>{Ne(e,["connectivity"],PM)},c=async(P,I,U)=>{try{return await Oe(()=>r[P](I),U)}catch{return}},u=async()=>{try{o({slackChannels:{isLoading:!0}});const P=await t.connectivity.getSlackChannels();o({error:void 0,slackChannels:{isLoading:!1,data:P}})}catch{o({error:void 0,slackChannels:{isLoading:!1}})}},d=async P=>{const I=P??Bse;o({isLoading:!0});try{const U=await Promise.all([...I.map(O=>c(O,void 0,br)),c("categories",void 0,br),(async()=>(await Promise.all(I.map(j=>c("channelMap",j,br)))).reduce((j,N,V)=>F({},j,{[`${I[V]}`]:N}),{}))()]),L=await c("webhook",void 0,br),z=U.reduce((O,j,N)=>I[N]?U[U.length-1][I[N]].length?F({},O,{[`${I[N]}`]:j,list:[...O.list,{id:N,key:I[N],events:Fu[I[N]].events(j),active:Fu[I[N]].isActive(j),platform:Fu[I[N]].title,image:Fu[I[N]].image}]}):O:F({},O,{[`${s[N-I.length]}`]:j}),{list:[],webhook:L});o(F({},z,{error:void 0,isSaving:!1,isLoading:!1}))}catch(U){o({isLoading:!1,error:W(U)})}},f=async P=>{var I;const U=(I=e.connectivity.slack)==null?void 0:I.slackSubscriptions;if(!U)return;const{slackSubscriptions:L}=P;await Promise.all([...L.reduce((z,O)=>{var j,N;
421return!O.id&&O.slackEvents&&(j=O.slackEvents[0].channelIds)!=null&&j.length?[...z,O]:(U==null?void 0:U.find(k=>{let{id:$}=k,M=re(k,zse);return $===O.id&&JSON.stringify(F({id:$},M))!==JSON.stringify(O)}))&&O.slackEvents&&(N=O.slackEvents[0].channelIds)!=null&&N.length?[...z,O]:z},[]).map(z=>i.slack(z)),...L.reduce((z,O)=>O.id&&!O.slackEvents[0].channelIds.length?[...z,O]:z,[]).map(z=>t.connectivity.deleteSlackConfiguration(z))])},g=async(P,I)=>{const U=e.connectivity.processIds,L=e.connectivity[I];if(!L)return;let z=[];try{z=await Promise.all([...P.reduce((O,j)=>!L.find(({eventKey:V})=>V===j.eventKey)&&j.subscriptions[0].recipients.filter(V=>V).length?[...O,j]:O,[]).map(O=>I==="email"?t.connectivity.postEmailConfiguration(O):t.connectivity.postSMSConfiguration(O)),...P.reduce((O,j)=>{const N=L.find(({eventKey:V})=>V===j.eventKey);return N&&JSON.stringify(N)!==JSON.stringify(j)?[...O,j]:O},[]).map(O=>{const{subscriptions:j,eventKey:N}=O,V=j[0],{id:k="",enabled:$}=V,M=re(V,Gse);return Promise.all([I==="email"?t.connectivity.patchEmailConfiguration({eventKey:N,enabled:$}):t.connectivity.patchSMSConfiguration({eventKey:N,enabled:$}),I==="email"?t.connectivity.putEmailSubscriptions(k,N,F({},M,{enabled:$})):t.connectivity.putSMSSubscriptions(k,N,F({},M,{enabled:$}))])}),...P.reduce((O,j)=>{const N=L.find(({eventKey:V})=>V===j.eventKey);return N&&N.subscriptions[0].recipients.length&&!j.subscriptions[0].recipients.filter(V=>!!V).length?[...O,j]:O},[]).map(({eventKey:O,subscriptions:j})=>I==="email"?t.connectivity.deleteEmailSubscriptions(O,j[0].id||""):t.connectivity.deleteSMSSubscriptions(O,j[0].id||""))])}catch{}if(z.length){const O=await c(I);o({error:void 0,isSaving:!1,[`${I}`]:O,processIds:O.id?U.filter(j=>j!==O.id):U}),await h(I,O)}else o({error:void 0,isSaving:!1,[`${I}`]:L,processIds:U})},h=async(P,I)=>{const{list:U}=e.connectivity,L=U.find(({key:O})=>O===P);if(!L)return;const z=Fu[P].isActive(I);z!==L.active&&o({list:U.map(O=>O.key===P?F({},O,{active:z}):O)})},p=async P=>{const{platform:I,data:U,callback:L}=P,z=e.connectivity.processIds;try{if(o({isSaving:!0,processIds:I==="webhook"?[U._id,...z]:z}),I==="slack"?await f(U):["sms","email"].includes(I)?await g(U,I):await i[I](U),!["sms","email"].includes(I)){const O=await c(I);I==="webhook"&&(O.id=U._id),o({error:void 0,isSaving:!1,[`${I}`]:O,processIds:O.id?z.filter(j=>j!==O.id):z}),await h(I,O),L==null||L(!0)}}catch(O){o({error:W(O),isSaving:!1,isLoading:!1})}},v=async P=>{try{await t.connectivity.postSlackCode(P)}catch{}o({error:void 0,isSaving:!1})},m=async()=>{const P=e.connectivity.slackChannels;try{o({slackChannels:F({},P,{isLoadingScope:!0})});const{clientId:I}=await t.connectivity.getSlackScope();o({slackChannels:{error:void 0,clientId:I,isLoadingScope:!1,isLoading:!1}})}catch{o({slackChannels:{error:void 0,isLoadingScope:!1,isLoading:!1}})}},S=async P=>{const{callback:I,webhookId:U}=P,L=e.connectivity.processIds;try{o({isSaving:!0}),await t.connectivity.deleteWebhooksConfiguration(U)}catch(O){I==null||I(null,W(O))}const z=await c("webhook");z&&o({error:void 0,isSaving:!1,webhook:z,processIds:z.id?L.filter(O=>O!==z.id):L}),I==null||I(!0)},b=async P=>{try{o({isTesting:!0});const{statusCode:I,body:U}=await t.connectivity.postWebhookTest(P);if([201,200].includes(I)){const L=JSON.stringify(U,null,2);o({isTesting:!1,testResult:{status:"success",message:L}})}else o({isTesting:!1,testResult:{status:"failed"}})}catch(I){o({isTesting:!1,testResult:{status:"failed",message:W(I)}})}},w=async P=>{try{const{statusCode:I}=await t.connectivity.postWebhookRetry(P);a({[P]:{isProcess:!1,success:I===202}})}catch{a({[P]:{isProcess:!1,success:!1}})}},A=async P=>{const{id:I,limit:U,offset:L}=P,z=e.connectivity.webhookLogs;try{o({webhookLogs:F({},z,{isLoading:!0})});const O=await t.connectivity.getWebhookLog(I,L,U);o({error:void 0,webhookLogs:F({isLoading:!1},O)})}catch{o({error:void 0,webhookLogs:{isLoading:!1}})}};return{setConnectivityState:o,initData:l,resetConnectivityState:l,loadSlackActions:u,loadSlackChannels:u,loadDataAction:d,loadConnectivityChannels:d,postDataAction:p,postChannelData:p,postCodeAction:v,postSlackCode:v,loadScope:m,loadSlackPermissions:m,deleteWebhookConfigAction:S,deleteWebhookConfig:S,postWebhookTestAction:b,postWebhookTest:b,postWebhookRetryAction:w,postWebhookRetry:w,loadWebhookLogsAction:A,loadWebhookLogs:A,cleanWebhookTestData:()=>{o({testResult:void 0})},cleanWebhookLogsData:async()=>{o({webhookLogs:void 0})},cleanWebhookTestMessage:async P=>{var I;o({testResult:{status:(I=P.testResult)==null?void 0:I.status,message:void 0}})},cleanError:async()=>{o({error:void 0})},cleanSlackData:async()=>{o({slackChannels:{isLoading:!1}})}}};let l1;(function(e){e.UNKNWON="unknown",e.CARD="card"})(l1||(l1={}));const kM={loading:!1,error:null,fetching:!0,config:null},Hse=e=>Ue(kM,e);let vf;(function(e){e.STRIPE="Stripe"})(vf||(vf={}));let Ds;(function(e){e.ACTIVE="ACTIVE",e.CANCELED="CANCELED",e.INCOMPLETE="INCOMPLETE",e.EXPIRED="EXPIRED",e.TRIALING="TRIALING"})(Ds||(Ds={}));let om;
421(function(e){e.AT_PERIOD_END="atPeriodEnd"})(om||(om={}));const OM=(e,t,n)=>{const r=l=>{Object.assign(e.subscriptions.config,l)},s=()=>{Ne(e,["subscriptions","config"],kM)},i=l=>{Object.assign(e.subscriptions.config,{error:l,loading:!1,fetching:!1})},o=async()=>{r({loading:!0});try{const l=await t.subscriptions.getStripePaymentProviderConfiguration(),c={paymentProvider:vf.STRIPE,apiKey:l.publishableKey};r({config:c}),r({loading:!1,fetching:!1})}catch(l){i(W(l))}};return{setPaymentConfigState:r,resetPaymentConfigState:s,loadPaymentConfiguration:async()=>{r({loading:!0});try{var l;((l=await t.subscriptions.getPaymentProviders())!=null?l:[]).find(d=>d.status==="1"&&d.providerType===$c.Stripe)?await o():i(W("Payment provider not configured"))}catch(c){i(W(c))}}}},IM={loading:!1,error:null,fetching:!0},Wse=e=>Ue(IM,e);function Kse({policy:e}){return{policy:qse()}}function qse(e){return om.AT_PERIOD_END}function Yse(e){switch(e){case gr.ACTIVE:return Ds.ACTIVE;case gr.INCOMPLETE:return Ds.INCOMPLETE;case gr.CANCELED:return Ds.CANCELED;case gr.EXPIRED:return Ds.EXPIRED;case gr.TRIALING:return Ds.TRIALING;default:return Ds.EXPIRED}}const NM=(e,t,n)=>{const r=n,s=c=>{Object.assign(e.subscriptions.billing.information,c)},i=()=>{Ne(e,["subscriptions","billing","information"],IM)},o=c=>{s({error:c,loading:!1,fetching:!1})},a=async(c,u)=>{s({loading:!0});try{var d,f;const g=await t.subscriptions.getSubscriptionSummaries(c),{currentPlanId:h,externallyManaged:p}=g;let v=null,m;p?m=await t.subscriptions.getSubscriptionPlan(h):([,m]=await Promise.all([r.loadSubscription(),t.subscriptions.getSubscriptionPlan(h)]),v=e.subscriptions.billing.subscription.subscription||null),s(F({loading:!1,fetching:!1,summary:g},v?{subscription:{id:v.id,externalId:v.externalId,startDate:v.startDate,currentPeriodStart:v.currentPeriodStart,currentPeriodEnd:v.currentPeriodEnd,status:u?Ds.ACTIVE:Yse(v.status),cancellation:v.cancellation&&Kse(v.cancellation),trialEnd:v.trialEnd?v.trialEnd:null}}:{},m?{plan:{id:m.id,name:m.name,description:m.description,price:((d=m.price)==null?void 0:d.amount)||0,currency:((f=m.price)==null?void 0:f.currency)||"usd",recurringInterval:"month",slug:m.slug}}:{}))}catch(g){o(W(g))}};return{setBillingInformationState:s,resetBillingInformationState:i,loadSummaries:a,loadBillingInformation:async c=>{var u,d;const f=(u=e.subscriptions.config.config)==null?void 0:u.paymentProvider,g=(d=e.auth.user)==null?void 0:d.tenantId;if(!f||!g){o(new Vr(f?"Not authorized":"Internal feature failure",500,null));return}await a(g,c)}}},LM={loading:!1,error:null,fetching:!0,invoices:[],invoiceDownload:{loading:!1,error:null}},Qse=e=>Ue(LM,e),DM=(e,t,n)=>{const r=c=>{Object.assign(e.subscriptions.billing.invoices,c)},s=()=>{Ne(e,["subscriptions","billing","invoices"],LM)},i=c=>{r({error:c,loading:!1,fetching:!1})},o=c=>{Object.assign(e.subscriptions.billing.invoices.invoiceDownload,c)},a=async()=>{r({loading:!0});try{const u=(await t.subscriptions.getSubscriptionInvoices()).map(d=>({id:d.id,externalId:d.externalId,subscriptionId:d.subscriptionId,paymentDate:new Date(Date.parse(d.paymentDate)),totalAmount:+((d.totalAmount||0)/100).toFixed(2),currency:d.currency||"usd",paid:d.paid||!1,receiptNumber:d.receiptNumber}));r({loading:!1,fetching:!1,invoices:u})}catch(c){i(W(c))}},l=async c=>{o({loading:!0,error:null});try{await t.subscriptions.getSubscriptionInvoicePdf(c.invoiceId,c.filename),o({loading:!1,error:null})}catch(u){o({loading:!1,error:W(u,null)})}};return{setBillingInvoiceState:r,resetBillingInvoiceState:s,loadInvoices:a,loadBillingInvoices:a,downloadInvoice:l,downloadBillingInvoice:l}},MM={loading:!1,error:null,fetching:!0},Xse=e=>Ue(MM,e),UM=(e,t,n)=>{const r=f=>{Object.assign(e.subscriptions.billing.paymentMethod,f)},s=()=>{Ne(e,["subscriptions","billing","paymentMethod"],MM)},i=f=>{r({loading:f})},o=f=>{r({error:f,loading:!1,fetching:!1})},a=async()=>{i(!0);try{const g=(await t.subscriptions.getPaymentMethods())[0];r({paymentMethod:g,loading:!1,fetching:!1})}catch(f){o(W(f))}};return{setBillingPaymentMethodState:r,resetBillingPaymentMethodState:s,loadPaymentMethod:a,submitPaymentMethod:async()=>{i(!0)},submitPaymentMethodError:async f=>{o(f)},submitPaymentMethodSuccess:async()=>await a(),updatePaymentMethodBillingDetails:async f=>{i(!0);const{id:g,email:h,address:p,callback:v}=f;try{await t.subscriptions.updatePaymentMethodBillingDetails(g,F({email:h},p)),await a(),v==null||v(!0)}catch(m){o(W(m)),v==null||v(!1,m)}finally{i(!1)}}}},FM={loading:!1,error:null,fetching:!0,cancellation:{loading:!1,error:null},renewal:{loading:!1,error:null}},Jse=e=>Ue(FM,e),$M=(e,t,n)=>{const r=n,s=v=>{Object.assign(e.subscriptions.billing.subscription,v)},i=()=>{Ne(e,["subscriptions","billing","subscription"],FM)},o=v=>{s({error:v,loading:!1,fetching:!1})},a=v=>{s({loading:v})},l=v=>{Object.assign(e.subscriptions.billing.subscription.cancellation,{loading:v})},c=v=>{Object.assign(e.subscriptions.billing.subscription.cancellation,{error:v})},u=v=>{Object.assign(e.subscriptions.billing.subscription.renewal,{loading:v})},d=v=>{Object.assign(e.subscriptions.billing.subscription.renewal,{error:v})},f=async()=>{a(!0);try{const[v]=await t.subscriptions.getManagedSubscriptions();s({subscription:v,fetching:!1,loading:!1,error:null})}catch(v){o(W(v))}};return{setBillingSubscriptionState:s,resetBillingSubscriptionState:i,setCancellationLoading:l,setCancellationError:c,setRenewalLoading:u,setRenewalError:d,loadSubscription:f,loadSubscriptionTenant:async()=>{var v;const m=(v=e.auth.user)==null?void 0:v.tenantId;if(!m){o(new Vr("TenantId is not defined",500,null));return}await r.loadSummaries(m)},cancelSubscription:async()=>{const{subscription:v}=e.subscriptions.billing.subscription;if(!v){c(new Vr("Subscription not found",500,null));return}if(v!=null&&v.externallyManaged){c(new Vr("Billing is externally managed",500,null));return}const{id:m,cancellation:S,status:b}=v||{};if(!S&&b===gr.ACTIVE)try{l(!0),await t.subscriptions.cancelManagedSubscription(m),await f(),l(!1)}catch(A){c(W(A))}},renewSubscription:async()=>{const{subscription:v}=e.subscriptions.billing.subscription;if(!v){d(new Vr("Subscription not found",500,null));return}if(v!=null&&v.externallyManaged){d(new Vr("Billing is externally managed",500,null));return}const{id:m,cancellation:S}=v||{};if((S==null?void 0:S.policy)===of.AT_PERIOD_END)try{u(!0),await t.subscriptions.renewManagedSubscription(m),await f(),u(!1)}catch(w){d(W(w))}}}}
421,Zse=e=>Ue({information:Wse(e==null?void 0:e.information),invoices:Qse(e==null?void 0:e.invoices),paymentMethod:Xse(e==null?void 0:e.paymentMethod),subscription:Jse(e==null?void 0:e.subscription)}),eie=(e,t,n)=>{const r=NM(e,t,n),s=UM(e,t),i=DM(e,t),o=$M(e,t,n);return[F({},r,s,i,o),{information:r,invoices:i,paymentMethod:s,subscription:o}]},jM={loading:!1,error:null,fetching:!0,plans:[]},tie=e=>Ue(jM,e),VM=(e,t,n)=>{const r=a=>{Object.assign(e.subscriptions.plans,a)},s=()=>{Ne(e,["subscriptions","plans"],jM)},i=a=>{r({loading:!1,fetching:!1,error:a})};return{setPlansState:r,resetPlansState:s,loadPlans:async()=>{r({loading:!0});try{const l=(await t.subscriptions.getSubscriptionPlans()).map(c=>{var u,d;return{id:c.id,name:c.name,description:c.description,price:((u=c.price)==null?void 0:u.amount)||0,currency:((d=c.price)==null?void 0:d.currency)||"usd",recurringInterval:"month",slug:c.slug}});r({fetching:!1,loading:!1,plans:l})}catch(a){i(W(a))}}}},BM={fetching:!0,loading:!1,error:null,confirmed:!1},nie=e=>Ue(BM,e),zM=(e,t,n)=>{const r=n,s=d=>{Object.assign(e.subscriptions.checkout,d)};return{setCheckoutState:s,resetCheckoutState:()=>{Ne(e,["subscriptions","checkout"],BM)},loadCheckout:()=>{s({fetching:!1,loading:!1,error:null,confirmed:!1})},resetCheckout:()=>{s({loading:!1,error:null,confirmed:!1})},submitCheckout:()=>{s({loading:!0,error:null})},confirmCheckout:async d=>{const{paymentMethodId:f,planId:g}=d,h=e.subscriptions.billing.subscription.subscription,p=e.subscriptions.billing.information.summary,v=(h==null?void 0:h.status)===gr.TRIALING,m=!!(p!=null&&p.paymentMethodId);if(!h){s({loading:!1,error:new Vr("Subscription not found",500,null)});return}if(s({loading:!0,error:null}),v&&m){s({loading:!1,error:null,confirmed:!0}),r.setBillingSubscriptionState({subscription:F({},h,{status:gr.ACTIVE})});return}try{await t.subscriptions.updateManagedSubscription(h.id,{paymentMethodId:f,planId:g}),await Promise.all([r.loadBillingInformation(),r.loadPaymentMethod(),r.loadInvoices()]),s({loading:!1,error:null,confirmed:!0})}catch(S){s({loading:!1,error:W(S)})}},errorCheckout:d=>{s({loading:!1,error:d})}}},GM={loading:!1,error:null,cardSetupIntentSecret:null},rie=e=>Ue(GM,e),HM=(e,t,n)=>{const r=a=>{Object.assign(e.subscriptions.stripe,a)},s=()=>{Ne(e,["subscriptions","stripe"],GM)},i=a=>{Object.assign(e.subscriptions.stripe,{error:a,loading:!1,fetching:!1})};return{createCardSetupIntentSecret:async a=>{r({loading:!0,error:null,cardSetupIntentSecret:null});try{const l={};a&&(l.paymentMethodId=a);const{setupIntentSecret:c}=await t.subscriptions.createStripePaymentMethodSetupIntentSecret(l);r({cardSetupIntentSecret:c,loading:!1})}catch(l){i(W(l))}},setStripeState:r,resetStripeState:s}},WM={loading:!1,fetching:!0,vendorPublicConfig:null},sie=e=>Ue(WM,e),KM=(e,t,n)=>{const r=l=>{Object.assign(e.subscriptions.vendorPublicConfig,l)},s=()=>{Ne(e,["subscriptions","vendorPublicConfig"],WM)},i=l=>{Object.assign(e.subscriptions.vendorPublicConfig,{error:l,loading:!1,fetching:!1})},o=l=>{Object.assign(e.subscriptions.vendorPublicConfig,{error:null,loading:l})};return{setVendorPublicConfigState:r,resetVendorPublicConfigState:s,setVendorPublicConfigError:i,setVendorPublicConfigLoading:o,loadVendorPublicConfiguration:async()=>{o(!0);try{const l=await t.subscriptions.getVendorPublicConfigurations();r({fetching:!1,loading:!1,vendorPublicConfig:l})}catch(l){i(W(l))}}}},qM=e=>Ue({config:Hse(e==null?void 0:e.config),billing:Zse(e==null?void 0:e.billing),plans:tie(e==null?void 0:e.plans),checkout:nie(e==null?void 0:e.checkout),stripe:rie(e==null?void 0:e.stripe),vendorPublicConfig:sie(e==null?void 0:e.vendorPublicConfig)}),YM=(e,t,n)=>{const r=OM(e,t),[s,i]=eie(e,t,n),o=VM(e,t),a=zM(e,t,n),l=HM(e,t),c=KM(e,t);return[F({},r,s,o,a,l,c),{config:r,billing:i,plans:o,checkout:a,stripe:l,vendorPublicConfig:c}]},QM={loading:!1},XM=e=>Ue(QM,e),zw=(e,t,n)=>{const r=o=>{Object.assign(e.vendor,o)},s=()=>{Ne(e,["vendor"],QM)},i=async o=>{r({loading:!0});try{var a;const l=await Oe(()=>t.vendor.getVendorPublicInfo(),o==null?void 0:o.retryConfig);l.whiteLabelMode=(a=l.whiteLabelMode)!=null?a:!1,r(F({},l,{loading:!1}))}catch(l){r({loading:!1}),console.error("failed to getVendorPublicInfo - ",l)}};return{setVendorState:r,resetVendorState:s,loadVendorPublicInfo:i,loadVendorPublicConfiguration:i}},JM={loading:!0,pageOffset:0,pageSize:20,logs:[],sort:[],filter:[],totalPages:0,isDownloadingCsv:!1},iie=e=>Ue(JM,e),ZM=(e,t,n)=>{const r=n,s=l=>{Object.assign(e.auditLogs.auditLogsState,l)};return{setAuditLogsState:s,resetAuditLogsState:()=>{Ne(e,["auditLogs","auditLogsState"],JM)},exportAuditsCsv:async()=>{const l=e.auditLogs.auditLogsState,{columns:c}
421=e.auditLogs.auditsMetadataState;try{const u=l.filter,f=l.sort.reduce((p,v)=>F({},p,{sortBy:v.id,sortDirection:v.desc?"desc":"asc"}),{}),g=u.reduce((p,v)=>F({},p,{[v.id]:v.value}),{});s({isDownloadingCsv:!0}),await t.audits.exportAudits(F({endpoint:"csv/v2",headerProps:c,offset:0,outputFileName:"audits.csv"},f,g))}catch(u){console.error("failed to export audits - ",u)}s({isDownloadingCsv:!1})},loadAuditLogs:async l=>{s({loading:!(l!=null&&l.silentLoading),error:null});const c=e.auditLogs.auditLogsState,u=l==null?void 0:l.retryConfig,{columns:d}=e.auditLogs.auditsMetadataState;try{var f,g,h,p,v;const S=(f=l.pageSize)!=null?f:c.pageSize,b=(g=l.pageOffset)!=null?g:c.pageOffset,w=(h=l.filter)!=null?h:c.filter,A=(p=l.sort)!=null?p:c.sort;s({pageSize:S,pageOffset:b,filter:w,sort:A});const C=A.reduce((T,P)=>F({},T,{sortBy:P.id,sortDirection:P.desc?"desc":"asc"}),{}),E=w.reduce((T,P)=>F({},T,{[P.id]:P.value}),{});d||await r.loadAuditsMetadata({retryConfig:u});const{data:x,total:R}=await Oe(()=>t.audits.getAudits(F({offset:b,count:S},C,E)),u);s({loading:!1,logs:x??[],totalPages:+Math.ceil(R/S)}),l==null||(v=l.callback)==null||v.call(l,!0)}catch(S){var m;s({loading:!1,error:W(S)}),l==null||(m=l.callback)==null||m.call(l,null,S)}}}},e6={loading:!0},oie=e=>Ue(e6,e),t6=(e,t,n)=>{const r=o=>{Object.assign(e.auditLogs.auditsMetadataState,o)};return{setAuditsMetadataState:r,resetAuditsMetadataState:()=>{Ne(e,["auditLogs","auditsMetadataState"],e6)},loadAuditsMetadata:async o=>{r({loading:!0,error:null});try{const{properties:a}=await Oe(()=>t.metadata.getAuditsMetadata(),o==null?void 0:o.retryConfig);r({columns:a,loading:!1})}catch(a){r({error:a,loading:!1})}}}},n6=e=>({auditLogsState:iie(e==null?void 0:e.auditLogsState),auditsMetadataState:oie(e==null?void 0:e.auditsMetadataState)}),r6=(e,t,n)=>F({},ZM(e,t,n),t6(e,t)),aie={total:0,offset:0,filter:"",sortBy:"createdAt",context:null,filters:[],rowsData:[],lastUpdated:new Date,isLoading:!0,isFetchMore:!1,totalToday:0,currentPage:0,headerProps:[],sortDirection:"desc",severeThisWeek:0,predefinedFilters:[],isDownloadingCsv:!1,virtualScroll:!1},lie=e=>Ue(aie,e),hT=20,cie=(e,t,n)=>{const r=()=>{e.audits.isLoading=!0},s=()=>{e.audits.isLoading=!1},i=()=>{e.audits.isDownloadingCsv=!0},o=()=>{e.audits.isDownloadingCsv=!1},a=w=>{e.audits.error=void 0,e.audits.totalToday=w.totalToday,e.audits.severeThisWeek=w.severeThisWeek},l=w=>{var A;e.audits.error=(A=e.audits.error)!=null?A:{},Object.assign(e.audits.error,{[w.name]:w.error})},c=w=>{e.audits.error={},e.audits.headerProps=w.properties,e.audits.themeAudits=w.theme?w.theme.styles:{}},u=w=>{e.audits.error={},e.audits.rowsData=w.rowsData,e.audits.lastUpdated=new Date,e.audits.total=w.total},d=w=>{e.audits.filters=w,e.audits.currentPage=0,e.audits.offset=0,e.audits.isLoading=!0},f=async()=>{const{sortBy:w,sortDirection:A}=e.audits;try{const C=await t.audits.getAuditsStats({sortBy:w,sortDirection:A,count:hT});a(C)}catch(C){const E={name:"stats",error:C};console.error("failed to load stats - ",C),l(E)}},g=async()=>{try{const w=await t.metadata.getAuditsMetadata();c(w)}catch(w){const A={name:"metadata",error:w};console.error("failed to load metadata - ",w),l(A)}},h=w=>w.reduce((A,C)=>(A[C.key]=C.value,A),{}),p=async w=>{const{filters:A,sortBy:C,sortDirection:E,filter:x,offset:R,virtualScroll:T}=e.audits,{appendMode:P=T,onlyOneLoad:I=!0,offset:U=0}=w||{},{rowsData:L}=P?e.audits:{rowsData:[]};try{const z=h(A),{data:O,total:j}=await t.audits.getAudits(F({},T&&{paginationMode:"virtual"},{sortDirection:E,sortBy:C,filter:x},z,{offset:T?L.length+U||L.length+R:U||R,count:hT}));u({rowsData:[...L,...O],total:j}),I&&s()}catch(z){const O={name:"audits",error:z};console.error("failed to load audits - ",z),l(O)}};return{initData:async()=>{r(),await Promise.all([f(),g(),p({onlyOneLoad:!1})]),s()},loadAudits:p,removeFilter:async w=>{const{filters:A}=e.audits,C=A.findIndex(x=>x.key===w.key);if(C<0)return;const E=[...A.slice(0,C),...A.slice(C+1)];d(E)},filterData:async w=>{const{filters:A}=e.audits;let C=A.findIndex(x=>x.key===w.key);C<0&&(C=A.length);const E=[...A.slice(0,C),w,...A.slice(C+1)];d(E)},exportCSV:async()=>{const{filters:w,sortBy:A,sortDirection:C,filter:E,headerProps:x=[]}=e.audits,R=h(w);i();const T="audits.csv";try{await t.audits.exportAudits(F({endpoint:"csv/v2",headerProps:x,sortDirection:C,sortBy:A,filter:E},R,{offset:0,outputFileName:T}))}catch(P){console.error("failed to export audits - ",P)}finally{o()}}}},Ge=(e,t)=>
421Object.keys(e).reduce((n,r)=>{const s=r;return t.includes(r)?F({},n,{[r]:e[s]}):F({},n,{[r]:()=>{console.debug(`Action ${String(r)} was called`)}})},{}),uie=(e,t,n)=>{const r=B5(e,t);return Ge(r,["setAcceptInvitationState","resetAcceptInvitationState"])},die=(e,t,n)=>{const r=G5(e,t,n),s=Ge(r,["setAccountSettingsState","resetAccountSettingsState"]);return s.saveAccountSettings=async i=>{var o;s.setAccountSettingsState({loading:!0}),await he();const a=e.auth.accountSettingsState,{address:l,timezone:c,dateFormat:u,timeFormat:d,currency:f,logo:g}=a,h=F({address:l,timezone:c,dateFormat:u,timeFormat:d,currency:f,logo:g},i);s.setAccountSettingsState(F({},h,{loading:!1})),(o=i.callback)==null||o.call(i,h)},s.loadAccountSettings=async i=>{s.setAccountSettingsState({loading:!(i!=null&&i.silentLoading),error:null}),await he(),s.setAccountSettingsState(F({address:"Tel-aviv",timezone:"Asia/Jerusalem",dateFormat:"DD/MM/YYYY",timeFormat:"HH:mm",currency:"USD",loading:!1},i))},s},fie=(e,t,n)=>{const r=vD(e,t,n);return Ge(r,["setActivateState","resetActivateState","setActivateStrategyState"])},hie=(e,t,n)=>{const r=_D(e,t);return Ge(r,["setApprovalFlowState","resetApprovalFlowState","getApprovalExecutionData"])},pie=(e,t,n)=>{const r=VD(e,t,n);return Ge(r,["setAllAccountsLoader","setAllAccountsError","setAllAccountsState","setSelectedAccountState","resetAllAccountsState","clearSelectedAccount"])},c1={clientId:"CLIENT_ID_16806d3d-8fc3-4450-be97-abdaf66b723e",secret:"SECRET_16806d3d-8fc3-4450-be97-abdaf66b723e",createdAt:"createdAt",description:"Demo API Token (preview only)"},np=F({},c1,{roleIds:[],tenantId:"my-tenant-id",createdByUserId:"createdByUserId"}),Za=[{id:"a040dcf6-b907-4e83-9970-6bd23c88fd40",key:"ReadOnly",name:"Read Only",description:null,isDefault:!1,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],vendorId:"vendorId"},{id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0",key:"Admin",name:"Admin",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","16647407-ed6f-4ca6-83a0-86225d921959","f403c6b9-1abe-4ec7-9971-aa032255fc25","a43e059d-d731-44b1-94bb-fb6b16c62210"],vendorId:"vendorId"},{id:"1234",key:"Support",name:"Support",description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03","f26b00f8-ffe0-4739-b15c-7db15c27ea26","a9c803b0-ebfa-49b9-9607-f0d3a390ee61"],tenantId:"tenantId",vendorId:"vendorId"}],gie=[{id:"roleId",key:"admin",isDefault:!1,name:"Admin",description:null,permissions:["8d71b676-754c-4600-afe7-ca5add1e6809","04dbcc11-61db-40a9-9577-9b73e50d1d03"],tenantId:"tenantId",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date}],mie=[{id:"8d71b676-754c-4600-afe7-ca5add1e6809",key:"fe.*",name:"General Admin",description:"description",categoryId:"category",fePermission:!0,createdAt:new Date,updatedAt:new Date,roleIds:[]}],am={sub:"",tenants:[],id:"testId",name:"Demo User Name",email:"[email protected]",mfaEnrolled:!0,profilePictureUrl:"https://www.gravatar.com/avatar/42b2ad2bad6fc9b9db5086dfcf8072ac?d=https://ui-avatars.com/api/fe/128/random?t=1617261890875?t=1617261917434",roles:gie,permissions:mie,tenantId:"my-tenant-id",tenantIds:["my-tenant-id"],activatedForTenant:!0,metadata:JSON.stringify({phoneNumber:"+972-54123456",jobTitle:"Developer",address:{city:"Tel Aviv",country:"Israel"}}),verified:!1},ao=F({},am,{accessToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1MTY5YmY0Zi02YmI5LTQ5NGMtOGNkZS05MDc4NDQ0NWY4MDciLCJuYW1lIjoiRHVtbXkgVXNlciIsImVtYWlsIjoiZHVtbXlAZnJvbnRlZ2cuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsIm1ldGFkYXRhIjp7fSwicm9sZXMiOlsiYWRtaW4iXSwicGVybWlzc2lvbnMiOlsiZmUuKiJdLCJ0ZW5hbnRJZCI6Im15LXRlbmFudC1pZCIsInRlbmFudElkcyI6WyJteS10ZW5hbnQtaWQiXSwicHJvZmlsZVBpY3R1cmVVcmwiOiJodHRwczovL3d3dy5ncmF2YXRhci5jb20vYXZhdGFyLzQyYjJhZDJiYWQ2ZmM5YjlkYjUwODZkZmNmODA3MmFjP2Q9aHR0cHM6Ly91aS1hdmF0YXJzLmNvbS9hcGkvZmUvMTI4L3JhbmRvbT90PTE2MTcyNjE4OTA4NzU_dD0xNjE3MjYxOTE3NDM0IiwidHlwZSI6InVzZXJUb2tlbiIsImlhdCI6MTYxNzkwNjMyNCwiZXhwIjoxNjE3OTkyNzI0LCJpc3MiOiJmcm9udGVnZyJ9.paaXLkpWEWbQmUtoK2P8IwXCxK4WJp7XhXonvzF8g1I",expires
421In:86400,mfaRequired:!1,refreshToken:"refresh-token-dummy-de39dc9c-9d22-4852-b7f5-c3c0aa613b58",type:"userToken",iat:1617906324,exp:1617992724,iss:"frontegg",email_verified:!0}),vie={loading:!1,error:void 0,saving:!0,profile:am},yie={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date,allowOverrideEnforcePasswordHistory:!0,allowOverridePasswordComplexity:!1,allowOverridePasswordExpiration:!1,allowSignups:!0,apiTokensEnabled:!0,cookieSameSite:"cookieSameSite",defaultRefreshTokenExpiration:0,defaultTokenExpiration:1,publicKey:"publicKey"},Sie={allowSignups:!0,allowNotVerifiedUsersLogin:!1,apiTokensEnabled:!0,forcePermissions:!1,authStrategy:at.EmailAndPassword,machineToMachineAuthStrategy:On.ClientCredentials},pT={id:"id",enforceMFAType:"DontForce",createdAt:new Date,updatedAt:new Date},ca={id:"id",enabled:!0,maxAttempts:1,createdAt:new Date,updatedAt:new Date},rp={id:"id",enabled:!0,historySize:1,createdAt:new Date,updatedAt:new Date},s6={enabled:!0,domain:"domain",validated:!0,generatedVerification:"generatedVerification",ssoEndpoint:"ssoEndpoint",publicCertificate:"publicCertificate",signRequest:!0,createdAt:new Date,updatedAt:new Date,acsUrl:void 0,spEntityId:void 0,oidcClientId:void 0,oidcSecret:void 0,type:void 0},sp={id:"id",createdAt:"createdAt",updatedAt:"updatedAt",properties:[],vendorId:"vendorId",entityName:"saml",isActive:!0,configuration:{acsUrl:"acsUrl",spEntityId:"spEntityId"}},sd=[{id:"id",description:"description",key:"key",name:"name",permissions:[],permissionLevel:1}],gT={firstLoad:!1,loading:!1,error:void 0,saving:!1,samlConfiguration:s6,roles:sd,authorizationRoles:[],errors:{},loaders:{},ssoConfigurations:[]},ip=[{description:"string",fePermission:!0,id:"id",key:"key",name:"name",roleIds:[],createdAt:new Date,updatedAt:new Date,categoryId:"categoryId"}],zp={id:"id2",email:"[email protected]",name:"Demo User Name2",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,verified:!1,createdAt:new Date().toISOString(),customData:void 0,lastLogin:void 0,mfaEnabled:void 0,roles:[Za[0]],groups:[{id:"id2",name:"Developers",color:"#03A9F4",roles:[Za[0]],managedBy:on.FRONTEGG}]},bie={id:zp.id,email:zp.email,name:zp.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[Za[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},Ua={id:"id",email:"[email protected]",name:"Demo User Name",phone:void 0,profileImage:void 0,profileImageUrl:void 0,tenantId:"tenantId",vendorId:"vendorId",roleIds:[],activatedForTenant:!0,createdAt:new Date(2022,4,1).toISOString(),verified:!0,customData:void 0,lastLogin:new Date(2022,5,25).toISOString(),mfaEnabled:void 0,roles:[Za[1]],groups:[{id:"id1",name:"Designers",color:"#E1F5E2",roles:[Za[0]],managedBy:on.FRONTEGG}]},_ie={id:Ua.id,email:Ua.email,name:Ua.name,phoneNumber:void 0,profileImage:void 0,tenantId:"tenantId",activatedForTenant:!0,createdAt:new Date(2022,4,1),verified:!0,lastLogin:new Date(2022,5,25),mfaEnrolled:!1,roles:[Za[1]],tenantIds:[],metadata:"",sub:"",tenants:[]},wie={metadata:"",mfaEnrolled:!1,provider:"",sub:"",tenantIds:[],tenants:[],verified:!1,id:"id",email:"email",name:"name",tenantId:"tenantId",createdAt:new Date},mT=[Ua,zp],Gw=[_ie,bie],vT=[wie],yT=[{id:"my-tenant-id",isReseller:!1,name:"Frontegg demo",deletedAt:null,metadata:void 0,tenantId:"my-tenant-id",vendorId:"vendorId",createdAt:new Date,updatedAt:new Date,address:void 0,timezone:void 0,dateFormat:void 0,timeFormat:void 0,currency:void 0,logo:void 0}],ST=[{id:"laptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date,ipAddress:"190.194.88.251",current:!0},{id:"iphone",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",createdAt:new Date(Date.now()-1e4),ipAddress:"191.49.203.21"},{id:"tablet",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",createdAt:new Date(Date.now()-3e4),ipAddress:"130.19.196.136"},{id:"anotherlaptop",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",createdAt:new Date(Date.now()-1002232300),ipAddress:"2.228.163.92"}],bT={isActive:!0,strategy:xt.ALLOW},u1=[{updatedAt:new Date,createdAt:new Date,id:"1",ip:"255.255.255.255",isActive:!0,strategy:xt.ALLOW,description:"My IP"},{updatedAt:new Date,createdAt:new Date,id:"2",ip:"255.255.255.254",isActive:!0,strategy:xt.ALLOW,description:"IP 2"},{updatedAt:new Date,createdAt:new Date,id:"3",ip:"255.255.255.253",isActive:!0,strategy:xt.BLOCK,description:"IP 3"},{updatedAt:new Date,createdAt:new Date,id:"4",ip:"255.255.255.253",isActive:!0,strategy:xt.BLOCK,description:"IP 4"}],ts=e=>{const t=[];return Array.from({length:e}
421).forEach((n,r)=>{t.push(F({},Ua,{name:"Demo User",id:`id${r}`,profilePictureUrl:null,createdAt:new Date}))}),t},ns=e=>({id:"b43b2c4b-e056-4eec-8c55-d200a475bbc0"+e,key:e,name:e,description:null,isDefault:!0,createdAt:new Date,updatedAt:new Date,permissions:[],tenantId:"tenantId",vendorId:"vendorId"}),Eie=[{id:"id1",name:"Designers",color:"#E1F5E2",description:"The whole design team",users:ts(6),roles:[ns("Editor")],metadata:'{"lastTermsCheck":"2022-08-16T10:31:11.270Z"}',managedBy:on.FRONTEGG},{id:"id2",name:"Developers",color:"#03A9F4",description:"All frontend and backend developers",users:ts(44),roles:[ns("Editor")],managedBy:on.FRONTEGG},{id:"id3",name:"Product",color:"#E1583E",description:"PMs and team leads",users:ts(8),roles:[ns("Viewer")],managedBy:on.FRONTEGG},{id:"id4",name:"Management",color:"#9AE0FF",description:"Executives",users:ts(5),roles:[ns("Admin")],managedBy:on.FRONTEGG},{id:"id5",name:"Sales",color:"#ED8E7C",users:ts(21),description:"BDR, AE, and inside sales",roles:[ns("Viewer")],managedBy:on.FRONTEGG},{id:"id6",name:"Support",color:"#A79D7B",users:ts(23),description:"Dev success and customer success",roles:[ns("Admin")],managedBy:on.FRONTEGG},{id:"id7",name:"Marketing",color:"#2CA744",users:ts(10),description:"The marketing department",roles:[ns("Viewer")],managedBy:on.FRONTEGG},{id:"id8",name:"HR",color:"#EAE1C2",users:ts(4),description:"Human resources",roles:[ns("Viewer")],managedBy:on.FRONTEGG},{id:"id9",name:"Finance",color:"#5587C0",users:ts(3),roles:[ns("Viewer")],managedBy:on.FRONTEGG},{id:"id10",name:"Operations",color:"#B1CAE7",users:ts(8),roles:[ns("Editor")],managedBy:on.FRONTEGG},{id:"id11",name:"Legal",color:"#2CA744",users:ts(4),roles:[ns("Viewer")],managedBy:on.FRONTEGG}],_T={scoring:{score:79},recommendations:{items:[{code:af.FORCE_MFA,severity:lf.WARNING,category:Ci.MFA},{code:af.ENABLE_FORCE_RELOGIN,severity:lf.WARNING,category:Ci.SESSIONS}]}},Aie={insights:{items:[{category:Ci.MFA,code:Aa.PARTIALLY_FORCED_MFA,metadata:{totalUsers:2,mfa:{enrolledUsersCount:1}}},{category:Ci.SESSIONS,code:Aa.PARTIAL_SESSION_SETTINGS,metadata:{totalUsers:2,sessions:{idleTimeoutRecommendation:1800}}},{category:Ci.PASSWORD,code:Aa.IMPROVE_PASSWORD_HISTORY_POLICY,metadata:{password:{userLockoutRecommendation:5,historyRecommendations:5}}},{category:Ci.DOMAIN,code:Aa.NO_IP_RESTRICTIONS,metadata:{restrictions:{ipsCount:1,domainsCount:1}}}]}},Cie={users:Gw,totalUsersItems:2,totalUsersPages:1,usersPageOffset:0},xie={users:[Gw[0]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0,queryParams:{_maxInactiveSeconds:7776e3}},Tie={users:[Gw[1]],totalUsersItems:1,totalUsersPages:1,usersPageOffset:0};At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE,At.ASSIGNABLE;var vn=[];for(var Ty=0;Ty<256;++Ty)vn.push((Ty+256).toString(16).slice(1));function Pie(e,t=0){return(vn[e[t+0]]+vn[e[t+1]]+vn[e[t+2]]+vn[e[t+3]]+"-"+vn[e[t+4]]+vn[e[t+5]]+"-"+vn[e[t+6]]+vn[e[t+7]]+"-"+vn[e[t+8]]+vn[e[t+9]]+"-"+vn[e[t+10]]+vn[e[t+11]]+vn[e[t+12]]+vn[e[t+13]]+vn[e[t+14]]+vn[e[t+15]]).toLowerCase()}var op,Rie=new Uint8Array(16);function kie(){if(!op&&(op=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!op))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return op(Rie)}var Oie=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const wT={randomUUID:Oie};function lm(e,t,n){if(wT.randomUUID&&!t&&!e)return wT.randomUUID();e=e||{};var r=e.random||(e.rng||kie)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Pie(r)}const Iie=(e,t,n)=>{const r=ED(e,t),s=Ge(r,["setApiTokensState","resetApiTokensState","setApiTokensLoader","setApiTokensError"]);return s.addTenantApiToken=async i=>{const{description:o,roleIds:a,callback:l}=i;s.setApiTokensLoader({key:ut.ADD_API_TOKEN,value:!0});const{apiTokensDataTenant:c}=e.auth.apiTokensState,u=F({},np,{description:o,roleIds:a,clientId:`CLIENT_ID_${lm()}`});s.setApiTokensState({showAddTokenDialog:!1}),await he(200),s.setApiTokensState({apiTokensDataTenant:[...c,u],successDialog:{o
421pen:!0,secret:u.secret,clientId:u.clientId}}),await he(200),s.setApiTokensLoader({key:ut.ADD_API_TOKEN,value:!1}),l==null||l(null)},s.deleteTenantApiToken=async i=>{s.setApiTokensLoader({key:ut.DELETE_API_TOKEN,value:!0}),await he(200);const o=[np];s.setApiTokensState({apiTokensDataTenant:o.filter(a=>a.clientId!==i),deleteTokenDialog:{open:!1,clientId:i}}),s.setApiTokensLoader({key:ut.DELETE_API_TOKEN,value:!1})},s.loadApiTokens=async i=>{var o;i!=null&&i.silentLoading||s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!0});const a=[c1],l=[np];s.setApiTokensState({apiTokensDataUser:a,apiTokensDataTenant:l}),await he(200),s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!1}),i==null||(o=i.callback)==null||o.call(i,!0)},s.loadUserApiTokens=async i=>{var o;i!=null&&i.silentLoading||s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!0});const a=[c1];s.setApiTokensState({apiTokensDataUser:a}),await he(200),s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!1}),i==null||(o=i.callback)==null||o.call(i,!0)},s.loadTenantApiTokens=async i=>{var o;i!=null&&i.silentLoading||s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!0});const a=[np];s.setApiTokensState({apiTokensDataTenant:a}),await he(200),s.setApiTokensLoader({key:ut.LOAD_API_TOKENS,value:!1}),i==null||(o=i.callback)==null||o.call(i,!0)},s},Nie=(e,t,n)=>{const r=CD(e,t,n);return Ge(r,["setApplicationsState","resetApplicationsState"])},Lie=(e,t,n)=>{const r=TD(e,t,n),s=Ge(r,["setCustomLoginState","resetCustomLoginState"]);return s.loadTenantMetadata=async()=>{s.setCustomLoginState({loading:!0}),await he(),s.setCustomLoginState({loading:!1})},s.updateTenantMetadata=async i=>{const{callback:o}=i;s.setCustomLoginState({loading:!0,error:null}),await he(),s.setCustomLoginState({loading:!1,error:null}),o==null||o(!0)},s},Die=(e,t,n)=>{const r=CM(e,t);return Ge(r,["setEntitlements","handleFetchedEntitlements"])},Mie=(e,t,n)=>{const r=RD(e,t),s=Ge(r,["setForgotPasswordState","resetForgotPasswordState"]);return s.loadPasswordConfig=async i=>{s.setForgotPasswordState({loading:!0});try{s.setForgotPasswordState({loading:!1,passwordConfig:{allowPassphrases:!0,maxLength:128,minLength:6,minPhraseLength:6,minOptionalTestsToPass:1}})}catch(o){s.setForgotPasswordState({loading:!1,error:W(o)})}},s.validateResetPasswordToken=async i=>{if(i.skipValidation){s.setForgotPasswordState({resetTokenValidationStatus:"valid"});return}s.setForgotPasswordState({resetTokenValidationStatus:"pending"}),s.setForgotPasswordState({resetTokenValidationStatus:"valid"})},s},Uie=(e,t,n)=>{const r=kD(e),s=Ge(r,["setStep"]);return s.setStep(hf.success),s},Fie=(e,t,n)=>{const r=ID(e,t),s=Ge(r,["setGroupsState","resetUsersGroupsState","setUsersGroupsLoader","setUsersGroupsError"]);return s.loadGroups=async()=>{const i=Ct.GET_GROUPS;s.setUsersGroupsLoader({key:i,value:!0});const o=Eie;s.setGroupsState({groups:o}),s.setUsersGroupsLoader({key:i,value:!1})},s.createGroup=async i=>{var o;const a=Ct.CREATE_GROUP,{groups:l}=e.auth.groupsState;s.setUsersGroupsLoader({key:a,value:!0}),await he(500),s.setGroupsState({groups:[F({},i,{id:`${i.name}ID`,managedBy:on.FRONTEGG}),...l??[]]}),i==null||(o=i.callback)==null||o.call(i,!0),s.setUsersGroupsLoader({key:a,value:!1})},s.updateGroup=async i=>{var o,a,l,c,u;const d=Ct.UPDATE_GROUP,f=e.auth.groupsState;s.setUsersGroupsLoader({key:d,value:!0}),await he(500),s.setGroupsState({groups:f==null||(o=f.groups)==null?void 0:o.map(g=>{var h;return g.id===i.groupId?F({},i,{id:i.groupId,name:(h=i==null?void 0:i.name)!=null?h:"",managedBy:on.FRONTEGG}):g}),selectedGroup:F({},f==null?void 0:f.selectedGroup,{name:(a=i==null?void 0:i.name)!=null?a:"",color:(l=i==null?void 0:i.color)!=null?l:"",description:(c=i==null?void 0:i.description)!=null?c:""})}),i==null||(u=i.callback)==null||u.call(i,!0),s.setUsersGroupsLoader({key:d,value:!1})},s.deleteGroup=async i=>{var o,a;const l=Ct.DELETE_GROUP,c=e.auth.groupsState;s.setUsersGroupsLoader({key:l,value:!0}),await he(500),s.setGroupsState({groups:c==null||(o=c.groups)==null?void 0:o.filter(u=>u.id!==i.groupId)}),i==null||(a=i.callback)==null||a.call(i,!0),s.setUsersGroupsLoader({key:l,value:!1})},s.addRolesToGroup=async i=>{var o,a;const l=Ct.ADD_ROLES_TO_GROUP,c=e.auth.groupsState;s.setUsersGroupsLoader({key:l,value:!0}),await he(500),s.setGroupsState({groups:c==null||(o=c.groups)==null?void 0:o.map(u=>{var d;return u.id===i.groupId?F({},u,{roles:[...(d=u==null?void 0:u.roles)!=null?d:[],...i.roleIds.map(f=>({id:f,name:f}))]}):u})}),i==null||(a=i.callback)==null||a.call(i,!0),s.setUsersGroupsLoader({key:l,value:!1})},s.deleteRolesFromGroup=async i=>{var o,a;const l=Ct.DELETE_ROLES_FROM_GROUP,c=e.auth.groupsState;s.setUsersGroupsLoader({key:l,value:!0}),await he(500),s.setGroupsState({groups:c==null||(o=c.groups)==null?void 0:o.map(u=>{var d;return u.id===i.groupId?F({},u,{roles:u==null||(d=u.roles)==null?void 0:d.filter(f=>!i.roleIds.includes(f.id))}):u})}),i==null||(a=i.callback)==null||a.call(i,!0),s.setUsersGroupsLoader({key:l,value:!1})},s.addUsersToGroup=async i=>{var o,a;const l=Ct.ADD_USERS_TO_GROUP,c=e.auth.groupsState;s.setUsersGroupsLoader({key:l,value:!0}),await he(500),s.setGroupsState({groups:c==null||(o=c.groups)==null?void 0:o.map(u=>{var d;return u.id===i.groupId?F({},u,{users:[...(d=u==null?void 0:u.users)!=null?d:[],...i.userIds.map(f=>({id:f,name:f}))]}):u})}),i==null||(a=i.callback)==null||a.call(i,!0),s.setUsersGroupsLoader({key:l,value:!1})},s.deleteUsersFromGroup=async i=>{var o,a;const l=Ct.DELETE_USERS_FROM_GROUP,c=e.auth.groupsState;s.setUsersGroupsLoader({key:l,value:!0}),await he(500),s.setGroupsState({groups:c==null||(o=c.groups)==null?void 0:o.map(u=>{var d;return u.id===i.groupId?F({},u,{users:u==null||(d=u.users)==null?void 0:d.filter(f=>!i.userIds.includes(f.id))}):u})}),i==null||(a=i.callback)==null||a.call(i,!0),s.setUsersGroupsLoader({key:l,value:!1})},s.getGroupConfiguration=async()=>{const i=Ct.GET_GROUP_CONFIGURATION,{groupsConfiguration:o}=e.auth.groupsState;s.setUsersGroupsLoader({key:i,value:!0}),o&&s.setGroupsState({groupsConfiguration:F({},o)}),s.setUsersGroupsLoader({key:i,value:!1})},s.updateGroupConfiguration=async i=>{const o=Ct.UPDATE_GROUP_CONFIGURATION,{groupsConfiguration:a}=e.auth.groupsState;s.setUsersGroupsLoader({key:o,value:!0}),a&&s.setGroupsState({groupsConfiguration:F({},a,i)}),s.setUsersGroupsLoader({key:o,value:!1})},s},$ie=(e,t,n)=>{const r=MD(e,t,n);return Ge(r,["setImpersonateState","resetImpersonateState"])},jie=(e,t,n)=>{const r=n,s=FD(e,t,r),i=Ge(s,["setLoginState","resetLoginState","afterAuthNavigation"]);return i.requestAuthorize=async o=>{o&&r.setAuthState({isLoading:!0});const a=ao;await r.loadTenants(),r.setAuthState({user:a,isAuthenticated:!0,isLoading:!1})},i.getUserIP=async o=>{const{callback:a}=o;try{const{ip:l}=u1[0];await r.setAuthState({userIpData:{ip:l},userIp:l}),a==null||a(!0,l)}catch(l){a==null||a(!1,l)}},i},Vie=["callback"],Bie=["callback"],zie=(e,t,n)=>{const r=n,s=jD(e,t,r),i=Ge(s,["setMfaState","resetMfaState"]);return i.enrollMfa=async()=>{i.setMfaState({saving:!0}),i.setMfaState({saving:!1,error:void 0,qrCode:"test"})},i.verifyMfa=async o=>{const{callback:a}=o;re(o,Vie);const{mfaDevices:l={webauthn:[],phones:[],authenticators:[],emails:[]}}=e.auth.mfaState;i.setMfaState({saving:!0}),await he();const c={token:"token",recoveryCode:"recoveryCode"},u={step:Dt.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:F({},l,{authenticators:[{id:"authenticator-id"}]})};c!=null&&c.recoveryCode&&(u.recoveryCode=c.recoveryCode),i.setMfaState(u),r.setUser(F({},ao,{mfaEnrolled:!0})),a==null||a(u.recoveryCode)},i.disableMfa=async o=>{var a;const{mfaDevices:l={webauthn:[],phones:[],authenticators:[],emails:[]}}=e.auth.mfaState;i.setMfaState({saving:!0}),await he(),i.setMfaState({saving:!1,error:void 0,mfaDevices:F({},l,{authenticators:[]})}),r.setUser(F({},ao)),(a=o.callback)==null||a.call(o,!0)},i.verifyMfaAfterForce=async o=>{const{callback:a}=o,l=re(o,Bie);i.setMfaState({loading:!0}),await he();const c=F({},l,{recoveryCode:"recoveryCode"}),u={step:Dt.recoveryCode,loading:!1,error:void 0,saving:!1};c!=null&&c.recoveryCode&&(u.recoveryCode=c.recoveryCode),i.setMfaState(u),await he(),r.setUser(F({},ao,{mfaEnrolled:!0})),a==null||a(u.recoveryCode)},i.preDisableMfaSms=async o=>{i.setMfaState({saving:!0});try{var a;i.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"}),(a=o.callback)==null||a.call(o,!0)}catch(c){var l;i.setMfaState({saving:!1,error:W(c)}),(l=o.callback)==null||l.call(o,!1,c)}},i.disableMfaSms=async o=>{var a;const{mfaDevices:l={webauthn:[],phones:[],authenticators:[],emails:[]}}=e.auth.mfaState;i.setMfaState({saving:!0}),await he(),i.setMfaState({loading:!1,error:void 0,mfaDevices:F({},l,{phones:[]})}),r.setUser(F({},ao)),(a=o.callback)==null||a.call(o,!0)},i.preEnrollMfaSms=async o=>{var a;i.setMfaState({saving:!0}),await he(),i.setMfaState({saving:!1,error:void 0,otcToken:"otc-token",phoneNumber:"+972504589346"}),(a=o.callback)==null||a.call(o,!0)},i.enrollMfaSms=async o=>{const{callback:a}=o,{mfaDevices:l={webauthn:[],phones:[],authenticators:[],emails:[]}}=e.auth.mfaState;i.setMfaState({saving:!0}),await he();const c={token:"token",recoveryCode:"recoveryCode"},u={step:Dt.recoveryCode,loading:!1,error:void 0,saving:!1,mfaDevices:F({},l,{phones:[{id:"phone-id",phoneNumber:"+972504589346"}]})};c!=null&&c.recoveryCode&&(u.recoveryCode=c.recoveryCode),i.setMfaState(u),r.setUser(F({},ao,{mfaEnrolled:!0})),a==null||a(u.recoveryCode)},i},Gie=(e,t,n)=>{const r=GD(e,t,n);return Ge(r,["setPasskeysState","resetPasskeysState"])},Hie=["callback","profilePictureUrl"],Wie=(e,t,n)=>{const r=WD(e,t,n),s=Ge(r,["setProfileState","resetProfileState"]);return s.loadProfile=async()=>{s.setProfileState({loading:!0}),await he(),n.setUser(F({},ao,am)),s.setProfileState({loading:!1,profile:am})},s.saveProfile=async i=>{const{callback:o,profilePictureUrl:a}=i,l=re(i,Hie);s.setProfileState({saving:!0,error:null});const c=vie;let u=c.profile.profilePictureUrl;a!==c.profile.profilePictureUrl&&a&&(a||"").match(/^data:image\/([A-Za-z-+\/]+);base64,(.+)$/)&&(u=a);const d=F({},c.profile,l,{profilePictureUrl:u}),f=ao;await he(),n.setUser(F({},f,d)),s.setProfileState({loading:!1,error:null,saving:!1,profile:d}),o==null||o(d)},s.changePassword=async i=>{var o;s.setProfileState({loading:!0}),await he(),s.setProfileState({loading:!1,error:void 0}),(o=i.callback)==null||o.call(i,!0)},s.updateEmail=async i=>{var o;s.setProfileState({saving:!0,error:null,loading:!0}),await he(),s.setProfileState({saving:!1,error:null,loading:!1}),(o=i.callback)==null||o.call(i,!0)},s.verifyEmail=async i=>{var o;s.setProfileState({saving:!0,error:null,loading:!0}),await he(),s.setProfileState({saving:!1,error:null,loading:!1}),(o=i.callback)==null||o.call(i,!0)},s},Kie=(e,t,n)=>{const r=qD(e,t);return Ge(r,["setProvisioningState","resetProvisioningState"])},qie=(e,t,n)=>{const r=QD(e,t,n);
421return Ge(r,["setResetPhoneNumberState","resetResetPhoneNumberState"])},Yie=(e,t,n)=>{const r=JD(e,t),s=Ge(r,["setRolesState","setRolesStateError","setRolesStateLoader","resetRolesState"]);return s.loadRolesAndPermissions=async i=>{var o;const a=cs.LOAD_ROLES;s.setRolesStateLoader({key:a,value:!((o=i==null?void 0:i.silentLoading)!=null&&o)});try{s.setRolesState({roles:Za})}catch(l){s.setRolesStateError({key:a,value:W(l)})}finally{s.setRolesStateLoader({key:a,value:!1})}},s},Qie=["callback"],Xie=["callback"],Jie=["callback"],Zie=["callback"],eoe=(e,t,n)=>{const r=ZD(e,t,n),s=Ge(r,["setRestrictionsState","setIpRestrictionsState","setEmailDomainRestrictionsState"]);return s.loadIpRestrictions=async()=>{s.setIpRestrictionsState({loading:!0,error:null}),s.setIpRestrictionsState({data:{restrictions:u1.filter(i=>i.strategy===bT.strategy),config:bT},totalPages:1,pagination:{_filter:xt.ALLOW,_limit:50,_offset:0},loading:!1})},s.loadEmailDomainRestrictions=async()=>{s.setEmailDomainRestrictionsState({loading:!0,error:null}),s.setEmailDomainRestrictionsState({loading:!1,data:{restrictions:[{domain:"mock.com",id:"1",type:xt.ALLOW}],config:{active:!0,listType:xt.ALLOW,blockPublicDomains:!1}}})},s.saveIpRestriction=async i=>{var o,a,l;const{callback:c}=i,u=re(i,Qie);s.setIpRestrictionsState({saving:!0,error:null});const d=e.auth.restrictionsState.ipRestrictions,f=d.data.restrictions.filter(g=>g.ip!==u.ip);s.setIpRestrictionsState({data:{config:(o=(a=d.data)==null?void 0:a.config)!=null?o:{isActive:!1,strategy:xt.ALLOW},restrictions:[...f,F({},u,{createdAt:new Date,updatedAt:new Date,id:lm(),isActive:(l=u.isActive)!=null?l:!0,strategy:d.data.config.strategy})]},totalPages:1,pagination:{_filter:xt.ALLOW,_limit:50,_offset:0},saving:!1}),c==null||c(!0)},s.saveIpRestrictionsConfig=async i=>{var o,a,l;const{callback:c}=i,u=re(i,Xie),d=e.auth.restrictionsState.ipRestrictions;s.setIpRestrictionsState({saving:!0,error:null}),s.setIpRestrictionsState({data:{config:F({},(o=d.data)==null?void 0:o.config,u),restrictions:(a=(l=d.data)==null?void 0:l.restrictions)!=null?a:[]},pagination:{_filter:xt.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1}),s.setIpRestrictionsState({saving:!1,error:null}),c==null||c(!0)},s.deleteIpRestriction=async i=>{var o;const{callback:a,id:l}=i;s.setIpRestrictionsState({saving:!0,error:null});const c=e.auth.restrictionsState.ipRestrictions;s.setIpRestrictionsState({data:{config:((o=c.data)==null?void 0:o.config)||{isActive:!1,strategy:xt.ALLOW},restrictions:c.data.restrictions.filter(u=>u.id!==l)},pagination:{_filter:xt.ALLOW,_limit:50,_offset:0},totalPages:1,saving:!1,error:null}),a==null||a(!0)},s.checkIfUserIpValid=async()=>{s.setIpRestrictionsState({loading:!0,error:null});try{const i=e.auth.restrictionsState.ipRestrictions,o=u1[0].ip,a=!!i.data.restrictions.find(l=>l.isActive&&l.ip===o);s.setIpRestrictionsState({userIpValid:a,loading:!1})}catch(i){s.setIpRestrictionsState({error:W(i),loading:!1})}},s.saveEmailDomainRestriction=async i=>{var o,a;const{callback:l}=i,c=re(i,Jie),u=e.auth.restrictionsState.emailDomainRestrictions;s.setEmailDomainRestrictionsState({saving:!0,error:null}),await he(),l==null||l(!0),s.setEmailDomainRestrictionsState({data:{config:((o=u.data)==null?void 0:o.config)||{active:!1,blockPublicDomains:!1,listType:c.type},restrictions:[...((a=u.data)==null?void 0:a.restrictions)||[],F({},c,{id:Date.now().toString()})]},saving:!1})},s.saveEmailDomainRestrictionsConfig=async i=>{var o;const{callback:a}=i,l=re(i,Zie),c=e.auth.restrictionsState.emailDomainRestrictions;s.setEmailDomainRestrictionsState({saving:!0,error:null}),await he(),a==null||a(!0),s.setEmailDomainRestrictionsState({data:{config:{active:l.active,blockPublicDomains:l.blockPublicDomains||!1,listType:l.type||xt.ALLOW},restrictions:[...((o=c.data)==null?void 0:o.restrictions)||[]]},saving:!1})},s.deleteEmailDomainRestriction=async i=>{var o,a;const{id:l}=i,c=e.auth.restrictionsState.emailDomainRestrictions;s.setEmailDomainRestrictionsState({saving:!0,error:null}),await he(),s.setEmailDomainRestrictionsState({data:{config:((o=c.data)==null?void 0:o.config)||{active:!1,blockPublicDomains:!1,listType:xt.ALLOW},restrictions:(((a=c.data)==null?void 0:a.restrictions)||[]).filter(u=>u.id===l)},saving:!1})},s},toe=(e,t,n)=>{const r=tM(e,t,n),s=Ge(r,["setSecurityCenterState","setSecurityCenterStateError","setSecurityCenterStateLoader","resetSecurityCenterState"]);return s.loadRecommendations=async()=>{const i=In.RECOMMENDATIONS;s.setSecurityCenterStateLoader({key:i,value:!0}
421),await he(),s.setSecurityCenterState({recommendations:_T.recommendations.items,score:_T.scoring.score}),s.setSecurityCenterStateLoader({key:i,value:!1})},s.loadInsights=async()=>{const i=In.INSIGHTS;s.setSecurityCenterStateLoader({key:i,value:!0}),await he(),s.setSecurityCenterState({insights:Aie.insights.items}),s.setSecurityCenterStateLoader({key:i,value:!1})},s.loadBreachedPasswordUsers=async()=>{const i=In.BREACHED_PASSWORD_USERS_TABLE;s.setSecurityCenterStateLoader({key:i,value:!0}),await he(),s.setSecurityCenterState({breachedPasswordUsersTable:Cie}),s.setSecurityCenterStateLoader({key:i,value:!1})},s.loadUnenrolledMfaUsers=async()=>{const i=In.UNENROLLED_MFA_USERS_TABLE;s.setSecurityCenterStateLoader({key:i,value:!0}),await he(),s.setSecurityCenterState({unenrolledMfaUsersTable:Tie}),s.setSecurityCenterStateLoader({key:i,value:!1})},s.loadInactiveUsers=async()=>{const i=In.INACTIVE_USERS_TABLE;s.setSecurityCenterStateLoader({key:i,value:!0}),await he(),s.setSecurityCenterState({inactiveUsersTable:xie}),s.setSecurityCenterStateLoader({key:i,value:!1})},s.sendResetBreachedPasswordEmail=async i=>{const{callback:o}=i,a=In.SEND_BREACHED_PASSWORD_EMAIL;s.setSecurityCenterStateLoader({key:a,value:!0}),await he(),o==null||o(!0),s.setSecurityCenterStateLoader({key:a,value:!1})},s},noe=["callback"],roe=["callback"],soe=["callback"],ioe=(e,t,n)=>{const r=rM(e,t,n),s=Ge(r,["setSecurityPolicyState","setSecurityPolicyGlobalState","setSecurityPolicyPublicState","setSecurityPolicyMfaState","setSecurityPolicyVendorMfaState","setSecurityPolicyLockoutState","setSecurityPolicyVendorLockoutState","setSecurityPolicyCaptchaState","setSecurityPolicyPasswordHistoryState","setSecurityPolicyVendorPasswordHistoryState","resetSecurityPolicyState","setSecurityPolicyPasswordState","setSecurityPolicyAuthStrategyPublicState"]);return s.loadSecurityPolicy=async()=>{s.setSecurityPolicyGlobalState({loading:!0,error:null}),await Promise.all([s.loadSecurityPolicyMfa(),s.loadSecurityPolicyVendorMfa(),s.loadSecurityPolicyLockout(),s.loadSecurityPolicyVendorLockout(),s.loadSecurityPolicyPasswordHistory(),s.loadSecurityPolicyVendorPasswordHistory(),s.loadSecurityPolicyCaptcha()]),await he(),s.setSecurityPolicyGlobalState({policy:yie,loading:!1})},s.loadPublicSecurityPolicy=async()=>{s.setSecurityPolicyPublicState({loading:!0,error:null});try{s.setSecurityPolicyPublicState({policy:Sie,loading:!1})}catch(i){s.setSecurityPolicyPublicState({error:W(i),loading:!1})}},s.saveSecurityPolicyMfa=async i=>{var o;const{callback:a}=i,l=re(i,noe);s.setSecurityPolicyMfaState({saving:!0,error:null});const c=F({},ca,{id:(o=l.id)!=null?o:ca.id,enforceMFAType:l.enforceMFAType});await he(),s.setSecurityPolicyMfaState({policy:c,saving:!1}),a==null||a(c)},s.loadSecurityPolicyMfa=async()=>{s.setSecurityPolicyMfaState({loading:!0,error:null}),await he(),s.setSecurityPolicyMfaState({policy:pT,loading:!1})},s.loadSecurityPolicyVendorMfa=async()=>{s.setSecurityPolicyVendorMfaState({loading:!0,error:null}),await he(),s.setSecurityPolicyVendorMfaState({policy:pT,loading:!1})},s.saveSecurityPolicyLockout=async i=>{const{callback:o}=i,a=re(i,roe);s.setSecurityPolicyLockoutState({saving:!0,error:null}),await he();const l=F({},ca,a,{id:a.id?a.id:ca.id});o==null||o(l),s.setSecurityPolicyLockoutState({policy:l,saving:!1})},s.loadSecurityPolicyLockout=async()=>{s.setSecurityPolicyLockoutState({loading:!0,error:null}),await he(),s.setSecurityPolicyLockoutState({policy:ca,loading:!1})},s.loadSecurityPolicyVendorLockout=async()=>{s.setSecurityPolicyVendorLockoutState({loading:!0,error:null}),await he(),s.setSecurityPolicyVendorLockoutState({policy:ca,loading:!1})},s.loadSecurityPolicyCaptcha=async()=>{s.setSecurityPolicyLockoutState({loading:!0,error:null}),await he(),s.setSecurityPolicyLockoutState({policy:ca,loading:!1})},s.saveSecurityPolicyPasswordHistory=async i=>{const{callback:o}=i,a=re(i,soe);s.setSecurityPolicyPasswordHistoryState({saving:!0,error:null}),await he();const l=F({},rp,a,{id:a.id?a.id:rp.id});o==null||o(l),s.setSecurityPolicyPasswordHistoryState({policy:l,saving:!1})},s.loadSecurityPolicyPasswordHistory=async()=>{s.setSecurityPolicyPasswordHistoryState({loading:!0,error:null}),await he(),s.setSecurityPolicyPasswordHistoryState({policy:rp,loading:!1})},s.loadSecurityPolicyVendorPasswordHistory=async()=>{s.setSecurityPolicyVendorPasswordHistoryState({loading:!0,error:null}),await he(),s.setSecurityPolicyVendorPasswordHistoryState({policy:rp,loading:!1})},s},ooe=["callback"],aoe=(e,t,n)=>
421{const r=iM(e,t,n),s=Ge(r,["setSessionsPolicyState","resetSessionsPolicyState"]);return s.loadSessionsPolicy=async()=>{s.setSessionsPolicyState({loading:!0,error:null});const i=e.auth.sessionsPolicyState;s.setSessionsPolicyState(F({},i,{loading:!1}))},s.createOrUpdateSessionsPolicy=async i=>{const{callback:o}=i,a=re(i,ooe);s.setSessionsPolicyState({loading:!0,error:null}),o==null||o(!0),s.setSessionsPolicyState({configurations:a,loading:!1})},s},loe=(e,t,n)=>{const r=aM(e,t),s=Ge(r,["setSessionsState","resetSessionsState"]);return s.loadUserSessions=async()=>{s.setSessionsState({loading:!0,error:null}),s.setSessionsState({sessions:ST,loading:!1})},s.deleteUserSession=async i=>{const{id:o}=i;s.setSessionsState({loading:!0,error:null});const l=e.auth.sessionsState.sessions.filter(c=>c.id!==o);s.setSessionsState({sessions:l,loading:!1})},s.deleteAllUserSessions=async()=>{s.setSessionsState({loading:!0,error:null});const i=ST.filter(o=>o.current);s.setSessionsState({sessions:i,loading:!1})},s},coe=(e,t,n)=>{const r=cM(e,t,n
421);return Ge(r,["setSignUpState","resetSignUpState","resetSignUpStateSoft"])},uoe=(e,t,n)=>{const r=dM(e,t);return Ge(r,["setSmsState","resetSmsState"])},doe=(e,t,n)=>{const r=hM(e,t,n);return Ge(r,["setSocialLoginsState","resetSocialLoginsState","setSocialLoginError"])},foe=["callback","samlVendor"],hoe=(e,t,n)=>{const r=gM(e,t,n),s=Ge(r,["setSSOState","resetSSOState"]);return s.loadSSOConfigurations=async()=>{s.setSSOState({loading:!0}),await he(),s.setSSOState({samlConfiguration:s6,loading:!1,firstLoad:!1})},s.saveSSOConfigurations=async i=>{var o,a;const{callback:l,samlVendor:c}=i,u=re(i,foe),d=gT.samlConfiguration,f=F({},d,u);let g="saving";if((f==null?void 0:f.enabled)!==d.enabled&&(g="loading"),!(f!=null&&f.domain)){s.setSSOState({samlConfiguration:F({},d,f)});return}else s.setSSOState({error:void 0,[g]:!0});await he(),f.acsUrl=sp==null||(o=sp.configuration)==null?void 0:o.acsUrl,f.spEntityId=sp==null||(a=sp.configuration)==null?void 0:a.spEntityId;const p=Aw(f,["validated","generatedVerification","createdAt","updatedAt"]);(d==null?void 0:d.domain)!==(p==null?void 0:p.domain)&&(p.ssoEndpoint="",p.publicCertificate="",p.signRequest=!1),p.type=c==null?void 0:c.toLowerCase(),await he(),s.setSSOState({samlConfiguration:p,error:void 0,[g]:!1}),l==null||l(!0)},s.saveSSOConfigurationsFile=async i=>{const o="saving";s.setSSOState({error:void 0,[o]:!0});const a=e.auth.ssoState.samlConfiguration,l=F({},a,{enabled:!0},i[0]);s.setSSOState({samlConfiguration:l,error:void 0,[o]:!1})},s.validateSSODomain=async i=>{const{callback:o}=i??{},a=gT.samlConfiguration;s.setSSOState({error:void 0,saving:!0}),await he(),s.setSSOState({samlConfiguration:F({},a,{validated:!0}),error:void 0,saving:!1}),o==null||o(!0)},s.loadSSOAuthorizationRoles=async()=>{await he();const i={roleIds:["1","2","3"]};s.setSSOState({authorizationRoles:i.roleIds,error:void 0})},s.updateSSOAuthorizationRoles=async i=>{const{callback:o,authorizationRoles:a}=i;s.setSSOState({error:void 0,saving:!0}),await he(),s.setSSOState({authorizationRoles:a,error:void 0,saving:!1}),o==null||o(!0)},s},poe=(e,t,n)=>{const r=vM(e,t,n);return Ge(r,["setStepUpState","resetStepUpState"])},goe=["callback"],moe=["callback"],voe=["callback","profileImage"],yoe=["callback"],Soe=["callback"],boe=["callback"],_oe=["callback"],woe=["callback"],Eoe=["callback"],Aoe=["callback"],Coe=["callback"],xoe=(e,t,n)=>{const r=SM(e,t,n),s=Ge(r,["setTeamState","resetTeamState","setTeamLoader","setTeamError","openAddUserDialog","closeAddUserDialog","openDeleteUserDialog","closeDeleteUserDialog"]);return s.loadUsersV3=async i=>{var o,a,l,c;const{silentLoading:u,callback:d}=i,f=e.auth.teamState,g=(o=i.pageSize)!=null?o:f.pageSize,h=(a=i.pageOffset)!=null?a:f.pageOffset,p=(l=i.filter)!=null?l:f.filterV2,v=(c=i.sort)!=null?c:f.sortV2;s.setTeamLoader({key:Ee.USERS,value:!u}),s.setTeamState({pageSize:g,pageOffset:h,filterV2:p,sortV2:v});const m=2,S=10;await he(),s.setTeamState({users:mT,totalPages:m,totalItems:S,roles:sd,permissions:ip}),s.setTeamLoader({key:Ee.USERS,value:!1}),d==null||d(mT)},s.loadAllSubTenantsUsers=async i=>{var o,a,l,c,u;const{silentLoading:d,callback:f}=i,g=e.auth.teamState,h=(o=i._limit)!=null?o:g.allUsersQueryParams._limit,p=(a=i._offset)!=null?a:g.allUsersQueryParams._offset,v=(l=i._filter)!=null?l:g.allUsersQueryParams._filter,m=(c=i._sortBy)!=null?c:g.allUsersQueryParams._sortBy,S=(u=i._order)!=null?u:g.allUsersQueryParams._order;s.setTeamLoader({key:Ee.USERS,value:!d}),s.setTeamState({allUsersQueryParams:{_limit:h,_offset:p,_filter:v,_sortBy:m,_order:S}});const b=2,w=10;await he(),s.setTeamState({allUsers:vT,totalPages:b,totalItems:w,roles:sd,permissions:ip}),s.setTeamLoader({key:Ee.USERS,value:!1}),f==null||f(vT)},s.loadRoles=async i=>{var o;s.setTeamLoader({key:Ee.ROLES_AND_PERMISSIONS,value:!0}),await he(),s.setTeamState({roles:sd,permissions:ip}),s.setTeamLoader({key:Ee.ROLES_AND_PERMISSIONS,value:!0}),i==null||(o=i.callback)==null||o.call(i,{roles:sd,permissions:ip})},s.addUser=async i=>{const{callback:o}=i,a=re(i,goe),l=e.auth.teamState;s.setTeamState({addUserDialogState:F({},l.addUserDialogState,{loading:!0})}),await he();const c=new Date,u=F({},Ua,{groups:[]},a,{id:`${lm()}`,temporaryExpirationDate:a.expirationInSeconds?new Date(c.setSeconds(c.getSeconds()+a.expirationInSeconds)):void 0});o==null||o(u),s.setTeamState({users:[u,...l.users],addUserDialogState:{open:!1,loading:!1}})},s.addUserToSubTenants=async i=>{const{callback:o}=i,a=re(i,moe),l=e.auth.teamState;s.setTeamState({addUserDialogState:F({},l.addUserDialogState,{loading:!0})}),await he();const c=F({},Ua,a,{id:`${lm()}`});s.setTeamState({users:[c,...l.users],addUserDialogState:{open:!1,loading:!1}}),o==null||o(null)},s.updateUser=async i=>{var o;const{callback:a}=i,l=re(i,voe),{id:c}=l,u=e.auth.teamState,d=u.users.find(g=>g.id===l.id);s.setTeamLoader({key:Ee.UPDATE_USER,value:c||""}),s.setTeamState({addUserDialogState:F({},u.addUserDialogState,{loading:!0})}),s.setTeamState({addUserDialogState:F({},u.addUserDialogState,{loading:!0}),users:u.users.map(g=>g.id===l.id?F({},g,l):g)}),d.roleIds.length>0&&((o=l.roleIds)==null?void 0:o.length)===0&&(l.roleIds=[""]),await he();const f=F({},d,l);a==null||a(f),s.setTeamState({users:u.users.map(g=>g.id===f.id?F({},g,f,{createdAt:g.createdAt,customData:g.customData,lastLogin:g.lastLogin}):g)}),s.setTeamLoader({key:Ee.UPDATE_USER,value:!1})},s.deleteUser=async i=>{const{callback:o}=i,a=re(i,yoe),l=e.auth.teamState;s.setTeamState({deleteUserDialogState:F({},l.deleteUserDialogState,{loading:!0})}),await he(),o==null||o(!0),s.setTeamState({users:l.users.filter(c=>c.id!==a.userId),deleteUserDialogState:{open:!1,loading:!1}})},s.updateUserExpirationTime=async i=>{const{callback:o}=i,a=re(i,Soe),l=e.auth.teamState;s.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!0});const c=new Date;s.setTeamState({users:l.users.map(u=>u.id===a.userId?F({},u,{temporaryExpirationDate:a.expirationInSeconds?new Date(c.setSeconds(c.getSeconds()+a.expirationInSeconds)):void 0}):u)}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!1})},s.setUserAsPermanent=async i=>{const{callback:o}=i,a=re(i,boe),l=e.auth.teamState;s.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!0}),s.setTeamState({users:l.users.map(c=>c.id===a.userId?F({},c,{temporaryExpirationDate:void 0}):c)}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.UPDATE_USER_EXPIRATION_TIME,value:!1})},s.deleteUserFromSubTenants=async i=>{const{callback:o}=i,a=re(i,_oe),l=e.auth.teamState;s.setTeamState({deleteUserDialogState:F({},l.deleteUserDialogState,{loading:!0})}),await he(),o==null||o(!0),s.setTeamState({allUsers:l.allUsers.filter(c=>c.id!==a.userId),deleteUserDialogState:{open:!1,loading:!1}})},s.resendActivationLink=async i=>{const{callback:o}=i,a=re(i,woe);s.setTeamLoader({key:Ee.RESEND_ACTIVATE_LINK,value:a.userId}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.RESEND_ACTIVATE_LINK,value:!1})},s.resendInvitationLink=async i=>{const{callback:o}=i,a=re(i,Eoe);s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:a.email}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:!1})},s.resendInvitationEmail=async i=>{const{callback:o}=i,a=re(i,Aoe);s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:a.email}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:!1})},s.resendInvitationLinkToAllSubTenants=async i=>{const{callback:o}=i,a=re(i,Coe);s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:a.email}),await he(),o==null||o(!0),s.setTeamLoader({key:Ee.RESEND_INVITATION_LINK,value:!1})},s},Toe=(e,t,n)=>{const r=_M(e,t,n),s=Ge(r,["setTenantsState","resetTenantsState"]);return s.loadTenants=async()=>{s.setTenantsState({loading:!0}),s.setTenantsState({tenants:yT,activeTenant:yT[0],loading:!1})},s},Poe=(e,t,n)=>{const r=SD(e,t);return Ge(r,["setUnlockAccountState","resetUnlockAccountState"])},Roe=(e,t,n)=>{const r=AM(e,t);return Ge(r,["setUserEmailPolicyState"])},koe=["requestName"],Ooe=(e,t,n,r)=>{const s=uie(e,t),i=die(e,t,n),o=Poe(e,t),a=fie(e,t,n),l=hie(e,t),c=pie(e,t,n),u=BD(e),d=Iie(e,t),f=Nie(e,t,n),g=Lie(e,t,n),h=Die(e,t),p=Mie(e,t),v=Uie(e),m=Fie(e,t),S=LD(e),b=$ie(e,t,n),w=jie(e,t,n),A=zie(e,t,n),C=Gie(e,t,n),E=Wie(e,t,n),x=Kie(e,t),R=qie(e,t,n),T=eoe(e,t,n),P=Yie(e,t),I=toe(e,t,n),U=ioe(e,t,n),L=loe(e,t),z=aoe(e,t,n),O=coe(e,t,n),j=uoe(e,t),N=doe(e,t,n),V=hoe(e,t,n),k=poe(e,t,n),$=xoe(e,t,n),M=Toe(e,t,n),B=EM(e,t),H=Roe(e,t),X={acceptInvitationActions:s,accountSettingsActions:i,unlockAccountActions:o,activateAccountActions:a,approvalFlowActions:l,allAccountsActions:c,allAccountsDialogActions:u,apiTokensActions:d,applicationsActions:f,customLoginActions:g,entitlementsActions:h,forgotPasswordActions:p,passwordRotationActions:v,groupsActions:m,groupsDialogsActions:S,impersonateActions:b,loginActions:w,mfaActions:A,passkeysActions:C,profileActions:E,provisioningActions:x,resetPhoneNumberActions:R,restrictionsActions:T,rolesActions:P,securityCenterActions:I,securityPolicyActions:U,sessionsActions:L,sessionsPolicyActions:z,signUpActions:O,smsActions:j,socialLoginActions:N,ssoActions:V,stepUpActions:k,teamActions:$,tenantsActions:M,usernamesActions:B,usersEmailsPolicyActions:H},te=K=>
421{Object.keys(K).forEach(G=>{const Q=G;Cw(e.auth[Q])?Object.assign(e.auth[Q],K[Q]):e.auth[Q]=K[Q]})};return{authActions:F({setState:te,setAuthState:te,setErrorByRequestName:K=>{let{requestName:G}=K,Q=re(K,koe);e.auth.errorByRequest=F({},e.auth.errorByRequest,{[G]:F({},Q,{isError:!0})})},resetAuthState:()=>{Ne(e,["auth"],r)},setUser:K=>{te({user:K})}},s,i,a,o,l,c,u,d,f,g,h,p,v,m,S,b,w,A,C,E,x,R,T,P,I,U,L,z,O,j,N,V,k,$,M,B,H),authStateActions:X}},Ioe=(e,t)=>(n,r)=>n[e]>r[e]?t?-1:1:r[e]>n[e]?t?1:-1:0,Noe=e=>t=>e.filter(Loe).every(n=>t[n.id].includes(n.value)),Loe=e=>e.id!=="createdAt",Doe=(e,t)=>{const{data:n}=Uoe;let r=n.filter(Noe(e));if(t.length){const{id:s,desc:i=!1}=t[0];r=r.sort(Ioe(s,i))}return{data:r,total:r.length}},Moe=()=>{switch(Math.floor(Math.random()*6)){case 0:return{action:"Updated profile",description:"User updated profile details",severity:"Info"};case 1:return{action:"User logged in",severity:"Info",description:"User logged in to the product"};case 2:return{action:"User failed to login",severity:"High",description:"User failed to login with password"};case 3:return{action:"Added user",severity:"Info",description:"Added user [email protected] to tenant"};case 4:return{action:"Assigned roles",severity:"Info",description:"Assigned 0 roles for user"};case 5:return{action:"Removed user [email protected] from account",severity:"Info",description:"Removed access from the account for user [email protected]"}}},Uoe={total:20,data:Array.from(Array(5).keys()).map(e=>F({ip:"198.143.51.1",user:"Demo User Name",email:"[email protected]"},Moe(),{json:{key1:"value1",key2:"value2",key3:"value3",key4:"value4"},tenantId:"my-tenant-id",vendorId:"my-vendor-id",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",createdAt:`2022-04-07 10:${50-e}:40.201`}))},Foe={properties:[{showInTable:!0,name:"createdAt",displayName:"Time",type:"Timestamp",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!1},{showInTable:!0,name:"email",displayName:"User",type:"Email",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"action",displayName:"Action",type:"AlphaNumeric",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!0,name:"description",type:"AlphaNumeric",sortable:!1,filterable:!1,displayName:"Description",isPredefined:!0,chosen:!1,selected:!1},{showInTable:!0,name:"ip",displayName:"IP Address",type:"IpAddress",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"severity",displayName:"Severity",type:"Severity",sortable:!0,filterable:!0,showInMoreInfo:"Always",chosen:!1,selected:!1,isPredefined:!0},{showInTable:!1,name:"userAgent",displayName:"User Agent",type:"AlphaNumeric",filterable:!0,sortable:!0,isPredefined:!0,chosen:!1,selected:!1},{showInTable:!1,name:"json",type:"Json",sortable:!0,filterable:!0,displayName:"Json Data",showInMoreInfo:"Always",isPredefined:!1}]},$oe=(e,t,n)=>{const r=ZM(e,t,n),s=Ge(r,["setAuditLogsState","resetAuditLogsState"]);return s.loadAuditLogs=async i=>{s.setAuditLogsState({loading:!i.silentLoading,error:null});const o=e.auditLogs.auditLogsState,{columns:a}=e.auditLogs.auditsMetadataState;try{var l,c,u,d,f;const h=(l=i.pageSize)!=null?l:o.pageSize,p=(c=i.pageOffset)!=null?c:o.pageOffset,v=(u=i.filter)!=null?u:o.filter,m=(d=i.sort)!=null?d:o.sort;s.setAuditLogsState({pageSize:h,pageOffset:p,filter:v,sort:m}),a||await n.loadAuditsMetadata();const{data:S,total:b}=Doe(v,m);s.setAuditLogsState({loading:!1,logs:S??[],totalPages:+Math.ceil(b/h)}),i==null||(f=i.callback)==null||f.call(i,!0)}catch(h){var g;s.setAuditLogsState({loading:!1,error:W(h)}),i==null||(g=i.callback)==null||g.call(i,null,h)}},s},joe=(e,t,n)=>{const r=t6(e,t),s=Ge(r,["setAuditsMetadataState","resetAuditsMetadataState"]);return s.loadAuditsMetadata=async()=>{s.setAuditsMetadataState({loading:!0,error:null});try{const{properties:i}=Foe;s.setAuditsMetadataState({columns:i,loading:!1})}catch(i){s.setAuditsMetadataState({error:i,loading:!1})}},s},Voe=(e,t,n)=>{const r=$oe(e,t,n),s=joe(e,t);return F({},r,s)},Boe=(e,t,n)=>{const r=Bw(e,t);return Ge(r,["setConnectivityState","resetConnectivityState","initData","resetConnectivityState","cleanWebhookTestData","cleanWebhookLogsData","cleanWebhookTestMessage","cleanError","cleanSlackData"])},zoe=(e,t,n)=>{const r=OM(e,t),s=Ge(r,["setPaymentConfigState","resetPaymentConfigState"]);return s.loadPaymentConfiguration=async()=>{s.setPaymentConfigState({loading:!0}),await he(500),s.setPaymentConfigState({loading:!1,fetching:!1,config:{paymentProvider:vf.STRIPE,apiKey:""}})},s},i6={id:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",externalId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",startDate:"2021-09-20T08:08:51.000Z",status:gr.ACTIVE,externallyManaged:!1,cancellation:null,currentPeriodStart:"2021-09-20T08:08:51.000Z",currentPeriodEnd:"2021-10-20T08:08:51.000Z",plan:{slug:"test"}},Cl=[{id:"prod_J60fUEvI7qV1eL",externalId:"prod_J60fUEvI7qV1eL",name:"Premium",description:"",price:{i
421d:"price_1IToe8Ewsu4qiqnndAV76J69",externalId:"price_1IToe8Ewsu4qiqnndAV76J69",currency:"usd",amount:1e4},slug:"premium"},{id:"prod_J60duauCpXfcur",externalId:"prod_J60duauCpXfcur",name:"Free",description:"Totally free plan. Nothing to pay.",price:{id:"price_1ITocfEwsu4qiqnnnBHDx9fQ",externalId:"price_1ITocfEwsu4qiqnnnBHDx9fQ",currency:"usd",amount:0},slug:"free"}],Goe=[{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-09-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""},{id:"in_1JbhYWEwsu4qiqnnrUh6hsHa",externalId:"in_1JbhYWEwsu4qiqnnrUh6hsHa",subscriptionId:"sub_1JbhYVEwsu4qiqnnfMhYAdY6",paymentDate:"2021-08-20T08:08:51.000Z",totalAmount:1e4,currency:"usd",paid:!0,receiptNumber:""}],Hoe=[{id:"id",externalId:"externalId",type:sf.CARD,isDefault:!0,last4:"4242",expMonth:11,expYear:25,brand:"visa",billingDetails:{name:"Dummy",email:"[email protected]"}}],Woe={allowPlanDowngrade:!0,allowPlanCancellation:!0},Koe=(e,t,n)=>{const r=NM(e,t,n),s=Ge(r,["setBillingInformationState","resetBillingInformationState"]);return s.loadBillingInformation=async()=>{var i,o;s.setBillingInformationState({loading:!0}),await he(500),s.setBillingInformationState({loading:!1,fetching:!1,summary:{subscriptionId:i6.id,paymentMethodId:"mockPaymentMethodId",tenantConfigurationId:"mockTenantConfigurationId",providerType:$c.Stripe,externallyManaged:!1,currentPlanId:Cl[0].id,defaultPlanId:Cl[0].id},plan:F({},Cl[0],{price:(i=Cl[0].price)==null?void 0:i.amount,currency:(o=Cl[0].price)==null?void 0:o.currency,recurringInterval:"month"})})},s},qoe=(e,t,n)=>{const r=UM(e,t),s=Ge(r,["setBillingPaymentMethodState","resetBillingPaymentMethodState"]);return s.loadPaymentMethod=async()=>{s.setBillingPaymentMethodState({loading:!0}),await he(500),s.setBillingPaymentMethodState({paymentMethod:Hoe[0],loading:!1,fetching:!1})},s},Yoe=(e,t,n)=>{const r=DM(e,t),s=Ge(r,["setBillingInvoiceState","resetBillingInvoiceState"]);return s.loadBillingInvoices=async()=>{s.setBillingInvoiceState({loading:!0}),await he(500);const i="Premium";s.setBillingInvoiceState({loading:!1,fetching:!1,invoices:Goe.map(o=>F({},o,{selectedPlan:i,paymentDate:new Date(Date.parse(o.paymentDate)),totalAmount:+((o.totalAmount||0)/100).toFixed(2)}))})},s.loadInvoices=s.loadBillingInvoices,s},Qoe=(e,t,n)=>{const r=$M(e,t,n),s=Ge(r,["setBillingSubscriptionState","resetBillingSubscriptionState","setCancellationLoading","setCancellationError","setRenewalLoading","setRenewalError"]);return s.loadSubscription=async()=>{s.setBillingSubscriptionState({loading:!0}),await he(500),s.setBillingSubscriptionState({subscription:i6,fetching:!1,loading:!1,error:null})},s},Xoe=(e,t,n)=>{const r=Koe(e,t,n),s=qoe(e,t),i=Yoe(e,t),o=Qoe(e,t,n);return[F({},r,s,i,o),{information:r,invoices:i,paymentMethod:s,subscription:o}]},Joe=(e,t,n)=>{const r=VM(e,t),s=Ge(r,["setPlansState","resetPlansState"]);return s.loadPlans=async()=>{s.setPlansState({loading:!0}),await he(500),s.setPlansState({fetching:!1,loading:!1,plans:Cl.map(i=>{var o,a;return F({},i,{price:((o=i.price)==null?void 0:o.amount)||0,currency:((a=i.price)==null?void 0:a.currency)||"usd",recurringInterval:"month"})})})},s},Zoe=(e,t,n)=>{const r=zM(e,t,n);return Ge(r,["setCheckoutState","resetCheckoutState","errorCheckout","resetCheckout"])},eae=(e,t,n)=>{const r=HM(e,t);return Ge(r,[])},tae=(e,t,n)=>{const r=KM(e,t),s=Ge(r,["setVendorPublicConfigState","resetVendorPublicConfigState","setVendorPublicConfigError","setVendorPublicConfigLoading"]);return s.loadVendorPublicConfiguration=async()=>{s.setVendorPublicConfigLoading(!0),await he(),s.setVendorPublicConfigState({fetching:!1,loading:!1,vendorPublicConfig:Woe})},s},nae=(e,t,n)=>{const r=zoe(e,t),[s,i]=Xoe(e,t,n),o=Joe(e,t),a=Zoe(e,t,n),l=eae(e,t),c=tae(e,t);return[F({},r,s,o,a,l,c),{config:r,billing:i,plans:o,checkout:a,stripe:l,vendorPublicConfig:c}]},rae=(e,t,n)=>{const r=zw(e,t),s=Ge(r,["setVendorState","resetVendorState"]);return s.loadVendorPublicInfo=async()=>{try{s.setVendorState({whiteLabelMode:!1}),await he()}catch(i){console.error("failed to getVendorPublicInfo - ",i)}},s.loadVendorPublicConfiguration=s.loadVendorPublicInfo,s},sae=(e,t,n,r)=>{const{authActions:s,authStateActions:i}=Ooe(e,t,n,r),o=Boe(e,t),[a,l]=nae(e,t,n),c=rae(e,t),u=Voe(e,t,n);return{authActions:s,authStateActions:i,connectivityActions:o,subscriptionsActions:a,subscriptionsStateActions:l,vend
421orActions:c,auditsActions:u}},Hw=(e,t,n=!1,r,s,i=!1,o="path")=>Xv({name:e.appName,context:e.context,storeHolder:t,previewMode:n,builderMode:i,urlStrategy:o,initialState:{root:F({},e),auth:F({},s==null?void 0:s.auth,r),connectivity:F({},s==null?void 0:s.connectivity),subscriptions:F({},s==null?void 0:s.subscriptions),vendor:F({},s==null?void 0:s.vendor),auditLogs:F({},s==null?void 0:s.auditLogs),audits:F({},s==null?void 0:s.audits)}}),Xv=e=>{var t,n,r,s,i,o,a;const{storeHolder:l}=e,c=typeof window>"u";let u=l;if(c&&l==null)throw Error("createFronteggStore(initState, storeHolder) failed, storeHolder must not be null in Server-Side rendering");if(u||(u=window),u.store)return u.store;const d=e.name||"default",{context:f,previewMode:g=!1,builderMode:h=!1,urlStrategy:p="path"}=e,v=de.for(d);!g&&!h&&v.setContext(f),f.requestCredentials===void 0&&(f.requestCredentials="include");const m=xM((t=e.initialState)==null?void 0:t.auth),S=RM((n=e.initialState)==null?void 0:n.connectivity),b=qM((r=e.initialState)==null?void 0:r.subscriptions),w=XM((s=e.initialState)==null?void 0:s.vendor),A=n6((i=e.initialState)==null?void 0:i.auditLogs),C=lie((o=e.initialState)==null?void 0:o.audits),E=(a=e.initialState)==null?void 0:a.auth;
421E&&Object.keys(E).forEach(z=>{J2(m,z,E[z],{merge:!0})});const x=JSON.parse(JSON.stringify(m)),R=Ue({root:{appName:d,context:f,urlStrategy:p,previewMode:g},auth:m,connectivity:S,subscriptions:b,vendor:w,auditLogs:A,audits:C});typeof window<"u"&&window.localStorage&&window.localStorage.DEBUG_FRONTEGG_STORE==="true"&&OJ(R,{name:`${d} Store`,enabled:!0});const T={},P={};v.setContext(e.context),v.setAppName(d);const I=qf(d),U=new Ln(d),L=F({},I,{fetch:U});if(e.previewMode||e.builderMode){const{authActions:z,authStateActions:O,connectivityActions:j,subscriptionsActions:N,subscriptionsStateActions:V,vendorActions:k,auditsActions:$}=sae(R,L,P,x);T.auth=O,T.connectivity=j,T.subscriptions=V,T.vendor=k,T.auditLogs=$,T.audits={},Object.assign(P,F({},z,j,N,k,$));const M={dispatch:B=>{setTimeout(()=>{const[H,...X]=B.type.split("/"),te=X.join("/");H==="auth"&&typeof z[te]=="function"?z[te](B.payload):H==="connectivity"&&typeof j[te]=="function"?j[te](B.payload):H==="subscriptions"&&typeof N[te]=="function"?N[te](B.payload):H==="vendor"&&typeof k[te]=="function"&&k[te](B.payload)})},getState:()=>R,subscribe:B=>Ea(R,B),subscribeStateChanged:B=>Ea(R,()=>B(R)),store:R,actions:P,stateActions:T};return e.previewMode&&M.dispatch({type:"auth/requestAuthorize",payload:!0}),u&&(u.store=M),M}else{const[z,O]=TM(R,L,P,x),j=Bw(R,L),[N,V]=YM(R,L,P),k=zw(R,L),$=r6(R,L,P),M=cie(R,L);return T.auth=O,T.connectivity=j,T.subscriptions=V,T.vendor=k,T.auditLogs=$,T.audits=M,Object.assign(P,F({},z,j,N,k,$)),{dispatch:B=>{const[H,...X]=B.type.split("/"),te=X.join("/");H==="auth"&&typeof z[te]=="function"?z[te](B.payload):H==="connectivity"&&typeof j[te]=="function"?j[te](B.payload):H==="subscriptions"&&typeof N[te]=="function"?N[te](B.payload):H==="vendor"&&typeof k[te]=="function"&&k[te](B.payload)},getState:()=>R,subscribe:B=>Ea(R,B),subscribeStateChanged:B=>Ea(R,()=>B(R)),store:R,actions:P,stateActions:T}}};/** @license Frontegg v7.104.0 422 * 423 * This source code is licensed under the MIT license found in the 424 * LICENSE file in the root directory of this source tree. 425 */const o6=Object.freeze(Object.defineProperty({__proto__:null,ACR_VALUE:bw,AMR_ADDITIONAL_VALUE:O5,AMR_MFA_VALUE:k5,get AcceptInvitationStep(){return Dr},get ActivateAccountStep(){return bi},AdminPortalPages:kee,get AdminPortalPagesForEvents(){return yn},get AllAccountsStateKeys(){return Jt},get ApiStateKeys(){return ut},get ApprovalFlowStep(){return zc},get AuthStrategyEnum(){return at},get AuthenticationTypes(){return No},DEFAULT_RETRY_CONFIG:br,get EditEmailView(){return a1},FORGOT_PASSWORD_ERROR_KEYS:ui,FRONTEGG_AFTER_AUTH_REDIRECT_URL:Sd,get ForgotPasswordStep(){return Ls},FronteggNativeModule:ed,get GTMEventAction(){return ln},get GroupRelations(){return pf},get GroupsStateKeys(){return Ct},HOSTED_LOGIN_VERIFIER_KEY:t1,get ImpersonateStep(){return gf},get LoginActionTypes(){return e1},get LoginFlow(){return zn},get LoginStep(){return Ye},get MFAStep(){return Dt},get MachineToMachineAuthStrategy(){return On},get PasswordRotationStep(){return hf},get PaymentMethodType(){return l1},get PaymentProvider(){return vf},get QuickLoginStrategy(){return Z2},get REQUEST_NAME(){return Mr},get ResetPhoneNumberStep(){return Gc},get RolesStateKeys(){return cs},SHOULD_STEP_UP_KEY:xi,get SSOStateKeys(){return Sn},STEP_UP_MAX_AGE_PARAM_NAME:_w,get SamlVendors(){return mf},get SecurityCenterStateKeys(){return In},get SignUpStage(){return _o},get SubscriptionCancellationPolicy(){return om},get SubscriptionStatus(){return Ds},TENANT_ID_PARAM_KEY:Uw,get TeamStateKeys(){return Ee},get UserVerifiedOriginTypes(){return Vc},authStrategyLoginStepMap:I5,base64ToFormData:M5,base64urlDecode:Gn,base64urlEncode:D5,buildAuditsActions:r6,buildAuthActions:TM,buildConnectivityActions:Bw,buildSubscriptionsActions:YM,buildVendorActions:zw,createAuditsState:n6,createAuthState:xM,createConnectivityState:RM,createFronteggStore:Hw,createProxy:Ue,createRandomString:n1,createStore:Xv,createSubscriptionsState:qM,createVendorState:XM,deepClone:N5,deepResetState:Ne,defaultFronteggRoutes:ww,delay:he,errorHandler:W,errorTraceId:Ew,generateCodeChallenge:V5,generateCodeChallengeNative:j5,generateCodeChallengePureJs:$5,getBaseNameWithoutSlashSuffix:s1,getEntitlements:Nw,getFeatureEntitlements:Kv,getMfaStepForEnrolledUsers:Fw,getMfaStepForNotEnrolledUsers:hD,getNumberOfMfaDevices:fD,getPathAndSearchParamsFromUrl:dD,getPermissionEntitlements:Wv,getRedirectUrl:uD,getSearchParam:qv,getSearchParamsFromUrl:Mw,getUri:i1,hmac:xee,isAbsoluteUrl:Dw,isAuthRoute:Qte,isEmailPayload:gD,isEntitlementsDeeplyEqual:Lw,isError:L5,isFronteggApiError:xw,isMfaRequired:Ns,isOauthCallbackRoute:pD,isProxy:Cw,isResetPasswordRequired:Qv,isSteppedUp:Qf,
425isUsernamePayload:mD,mapMetaDataObjectToActions:Vw,omitProps:Aw,prepareIdentifiersForSignup:Fp,publicKeyCredentialToJSON:Ii,readFileAsText:uf,redirectByStepUpUrl:jw,ref:RJ,reportGTMEvent:Dn,retry:sm,retryIfNeeded:Oe,setAfterAuthRedirectUrlForStepUp:$w,sha256:F5,shouldShowPasswordRotationPromptFunc:Yv,snapshot:oo,subscribe:Ea,withRetryConfig:mi},Symbol.toStringTag,{value:"Module"}));let d1;(function(e){e.phoneNumber="phoneNumber",e.username="username"})(d1||(d1={}));let f1;(function(e){e.ALLOWED="allowedCountries",e.BLOCKED="blockedCountries"})(f1||(f1={}));let h1;(function(e){e.Name="name",e.Username="username",e.PhoneNumber="phoneNumber",e.Address="address",e.JobTitle="jobTitle"})(h1||(h1={}));let p1;(function(e){e.LoginSessions="loginSessions",e.Mfa="mfa"})(p1||(p1={}));let g1;(function(e){e.Name="name",e.PhoneNumber="phoneNumber",e.Username="username"})(g1||(g1={}));let m1;(function(e){e.CompanyName="companyName",e.Address="address",e.Website="website",e.Timezone="timezone",e.Currency="currency"})(m1||(m1={}));let v1;(function(e){e.FullName="fullName",e.Email="email",e.Groups="groups",e.Roles="roles",e.Status="status",e.LastSeen="lastSeen",e.ManagedBy="managedBy",e.Username="username",e.PhoneNumber="phoneNumber"})(v1||(v1={}));let y1;(function(e){e.Invoices="invoices"})(y1||(y1={}));let S1;(function(e){e.SessionManagement="sessionManagement",e.GeneralSettings="generalSettings",e.IpRestrictions="ipRestrictions",e.DomainRestrictions="domainRestrictions"})(S1||(S1={}));let b1;(function(e){e.IdleSessionTimeout="idleSessionTimeout",e.ForceReLogin="forceReLogin",e.MaximumConcurrentSessions="maximumConcurrentSessions"})(b1||(b1={}));let _1;(function(e){e.Mfa="mfa",e.UserLockout="userLockout",e.PasswordHistory="passwordHistory"})(_1||(_1={}));let w1;(function(e){e.IpAddressRestrictions="ipAddressRestrictions"})(w1||(w1={}));let E1;(function(e){e.RestrictSignupByEmailDomain="restrictSignupByEmailDomain"})(E1||(E1={}));let A1;(function(e){e.Settings="settings",e.CustomLogin="customLogin"})(A1||(A1={}));const iae={hidden:"hidden",viewOnly:"viewOnly",edit:"edit"},oae={hidden:"hidden",edit:"edit"},aae={hidden:"hidden",always:"always"};function Ww(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function lae(e){e=e.substr(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,s)=>s<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function cae(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function Xf(e){if(e.type)return e;if(e.charAt(0)==="#")return Xf(lae(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error("MUI: Unsupported `%s` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). "+e);const r=e.substring(t+1,e.length-1);let s,i;if(n==="color"){if(i=r.split(" "),s=i.shift(),i.length===4&&i[3].charAt(0)==="/"&&(i[3]=i[3].substr(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(s)===-1)throw new Error("MUI: unsupported `%s` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020."+s)}else i=r.split(",");const o=i.map(a=>parseFloat(a));return{type:n,values:o,colorSpace:s}}function Kw(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((s,i)=>i<3?parseInt(s,10):s):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function ap(e){if(e.indexOf("#")===0)return e;const{values:t}=Xf(e);return`#${t.map((n,r)=>cae(r===3?Math.round(255*n):n)).join("")}`}function uae(e,t){return e=Xf(e),t=Ww(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Kw(e)}function Gp(e,t){if(e=Xf(e),t=Ww(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Kw(e)}function a6(e,t){if(e=Xf(e),t=Ww(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Kw(e)}const Py=e=>{if(e)return{main:e,light:ap(a6(e,.4)),dark:ap(Gp(e,.15)),hover:ap(Gp(e,.15)),active:ap(Gp(e,.2))}}
425,lp=e=>{if(e)return{main:e,light:a6(e,.7),dark:Gp(e,.2)}},dae=(e,t)=>{var n,r,s,i,o,a,l,c,u,d,f,g;return!(e!=null&&e.palette)||typeof(e==null||(n=e.palette)==null?void 0:n.primary)!="string"?{}:F({},t,{palette:{primary:F({},Py(e==null||(r=e.palette)==null?void 0:r.primary),{contrastText:(s=e==null||(i=e.palette)==null?void 0:i.primaryText)!=null?s:"#000000"}),secondary:F({},Py(e==null||(o=e.palette)==null?void 0:o.secondary),{contrastText:(a=e==null||(l=e.palette)==null?void 0:l.secondaryText)!=null?a:"#000000"}),danger:F({},Py(e==null||(c=e.palette)==null?void 0:c.error),{contrastText:"#FFF"}),success:F({},lp(e==null||(u=e.palette)==null?void 0:u.success),{contrastText:"#FFF"}),error:F({},lp(e==null||(d=e.palette)==null?void 0:d.error),{contrastText:"#FFF"}),warning:F({},lp(e==null||(f=e.palette)==null?void 0:f.warning),{contrastText:"#FFF"}),info:F({},lp(e==null||(g=e.palette)==null?void 0:g.info),{contrastText:"#FFF"})}})},Pn={theme:{},themeV2:{},localizations:{},navigation:{usage:{visibility:"hidden",permissions:["fe.usage.read"],featureFlag:"fe-usage-page"},webhooks:{visibility:"hidden",permissions:["fe.connectivity.read.webhooks"]},roles:{visibility:"hidden",permissions:["fe.secure.read.roles"]},users:{visibility:"always",permissions:["fe.secure.read.users"],inviteDialog:{phoneNumberField:"optional"}},personalApiTokens:{visibility:"hidden",permissions:["fe.secure.read.userApiTokens"]},apiTokens:{visibility:"hidden",permissions:["fe.secure.read.tenantApiTokens"]},profile:{visibility:"always"},privacy:{visibility:"always"},account:{visibility:"always",permissions:["fe.secure.read.accountSettings"]},security:{visibility:"always",permissions:["fe.secure.read.securityPolicy"]},sso:{visibility:"hidden",permissions:["fe.secure.read.samlConfiguration"]},provisioning:{visibility:"hidden",permissions:["fe.secure.read.provisioningConfiguration"]},audits:{visibility:"always",permissions:["fe.secure.read.audits"]},subscriptions:{visibility:"hidden",permissions:["fe.subscriptions.*"]},allAccounts:{visibility:"byPermissions",permissions:["fe.account-hierarchy.read.subAccount"]},groups:{visibility:"hidden",permissions:["fe.secure.read.groups"]}}};class ei{constructor(){this._theme=Pn.theme,this._themeV2=Pn.themeV2,this._navigation=Pn.navigation,this._localizations=Pn.localizations,this._integrations=Pn.integrations}static getInstance(t="default"){return this._instances[t]}static set(t,n="default"){const r=new ei;return r.set(t),ei._instances[n]=r,r}get theme(){var t;return(t=this._theme)!=null?t:{}}get themeV2(){var t;return(t=this._themeV2)!=null?t:{}}get navigation(){var t;return(t=this._navigation)!=null?t:{}}get localizations(){var t;return(t=this._localizations)!=null?t:{}}get integrations(){var t;return(t=this._integrations)!=null?t:{}}set(t){try{var n,r,s,i,o,a,l,c,u;this._navigation=ma.all([(n=Pn.navigation)!=null?n:{},(r=t==null?void 0:t.navigation)!=null?r:{}]),this._theme=ma.all([(s=Pn.theme)!=null?s:{},dae(t==null?void 0:t.theme,Pn.theme)]),this._themeV2=ma.all([(i=Pn.themeV2)!=null?i:{},(o=t==null?void 0:t.themeV2)!=null?o:{}]),this._localizations=ma.all([(a=Pn.localizations)!=null?a:{},(l=t==null?void 0:t.localizations)!=null?l:{}]),this._integrations=ma.all([(c=Pn.integrations)!=null?c:{},(u=t==null?void 0:t.integrations)!=null?u:{}])}catch{this._navigation=Pn.navigation,this._theme=Pn.theme,this._themeV2=Pn.themeV2,this._localizations=Pn.localizations,this._integrations=Pn.integrations}}}ei._instances={};/** @license Frontegg v7.104.0 426 * 427 * This source code is licensed under the MIT license found in the 428 * LICENSE file in the root directory of this source tree. 429 */const l6=Object.freeze(Object.defineProperty({__proto__:null,get AccountDetailsPageTabs(){return A1},get AccountPageFields(){return m1},get COUNTRY_FILTER_TYPE(){return f1},get DomainRestrictionsTabFields(){return E1},get GeneralSettingsTabFields(){return _1},get InviteUserModalFields(){return g1},get IpRestrictionsTabFields(){return w1},Metadata:ei,get PrivacyPageFields(){return p1},get ProfilePageFields(){return h1},get SecurityPageTabs(){return S1},get SessionManagementTabFields(){return b1},get SignupFields(){return d1},get SubscriptionsPageFields(){return y1},get UsersTableColumns(){return v1}
429,alpha:uae,columnVisibility:aae,fieldAppearance:iae,tabAppearance:oae},Symbol.toStringTag,{value:"Module"}));var c6=function(t){return t.replace(/\W+/g," ").split(/ |\B(?=[A-Z])/).map(function(n){return n.toLowerCase()}).join("")},ga=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=document.createElement(n);return Object.keys(r).forEach(function(i){return s.setAttribute(i,r[i])}),t.appendChild(s),s},qw=function(t){return new Promise(function(n,r){var s=4e3,i=setInterval(function(){if(t.themeSetter!=null){clearInterval(i),n(!0);return}if(s<0){r("Failed to load Renderer with themeSetter"),clearInterval(i);return}s-=50},50)})},u6=function(t){var n=t.toString();if(n){var r=new URL(window.location.href);r.search=n,window.history.pushState(null,"",r.toString())}};const ET={cdnVersion:"7.104.0"};var C1={admin_portal_ip_restrictions:"on",admin_portal_domain_restrictions:"on","new-mfa-pages":"on","show-passkeys-new":"on","groups-admin-box-new":"on","msp-all-accounts-new":"on","temporary-users":"on"},fae=function(t){return/^GTM-[a-zA-Z0-9]+$/.test(t)},hae=function(t){var n,r=ei.getInstance(t),s=r==null||(n=r.integrations)==null?void 0:n.gtm;s==null||s.filter(function(i){var o=i.id,a=i.enabled;return a&&fae(o)}).forEach(function(i){var o=i.id,a=document.createElement("script");a.innerHTML=` 430 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 431 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 432 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
433 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 434 })(window,document,'script','dataLayer','`.concat(o,`'); 435 `),document.body.appendChild(a)})},d6=function(){var e=Gt(qe.mark(function t(n,r,s){var i,o,a,l;return qe.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o=(i=n.metadataOverrides)==null?void 0:i.url,o){u.next=3;break}return u.abrupt("return",n);case 3:return u.prev=3,u.next=6,Oe(function(){return r.sendRequest({url:o,method:"GET",credentials:"omit"})},s);case 6:if(a=u.sent,!a){u.next=10;break}return l=ma(n,a),u.abrupt("return",l);case 10:u.next=15;break;case 12:u.prev=12,u.t0=u.catch(3),console.error("Failed to get metadata overrides",u.t0);case 15:return u.abrupt("return",n);case 16:case"end":return u.stop()}},t,null,[[3,12]])}));return function(n,r,s){return e.apply(this,arguments)}}(),Jv=function(){function e(t,n){var r=this,s,i,o,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;ea(this,e),this.name=void 0,this.iframeRendering=void 0,this.options=void 0,this.loading=!0,this.cdnUrl="https://assets.frontegg.com/admin-box/".concat(ET.cdnVersion),this.assetsUrl="https://adminBox.frontegg.com/admin-box/".concat(ET.cdnVersion),this.customElementName="",this.adminPortalEl=void 0,this.adminPortalRenderer=void 0,this.loginBoxEl=void 0,this.checkoutDialogEl=void 0,this.checkoutDialogRenderer=void 0,this.adminPortalContainer=void 0,this.loginBoxContainer=void 0,this.checkoutDialogContainer=void 0,this.loginBoxRenderer=void 0,this.store=void 0,this.loadingListeners=[],this.fetchClient=void 0,this.apiClient=void 0,this.updateLocalizations=void 0,this.loadAdminBoxMetadata=Gt(qe.mark(function v(){var m,S,b,w,A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(r.options.metadata){E.next=21;break}return E.prev=1,E.next=4,Oe(function(){return r.fetchClient.get("/metadata",{entityName:"adminBox"})},br);case 4:return w=E.sent,A=(m=w==null||(S=w.rows)==null||(b=S[0])==null?void 0:b.configuration)!=null?m:{},E.prev=6,E.next=9,d6(A,r.fetchClient,br);case 9:r.options.metadata=E.sent,E.next=15;break;case 12:E.prev=12,E.t0=E.catch(6),console.error("failed to get admin portal overridden metadata",E.t0);case 15:E.next=21;break;case 17:E.prev=17,E.t1=E.catch(1),console.error("failed to get admin portal metadata",E.t1),r.dispatchErrorByRequestName(E.t1,Mr.LOAD_ADMIN_BOX_METADATA);case 21:ei.set(r.options.metadata,r.name);case 22:case"end":return E.stop()}},v,null,[[1,17],[6,12]])})),this.requestAuthorize=Gt(qe.mark(function v(){var m,S,b;return qe.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:b=(m=r.options.authOptions)==null||(S=m.hostedLoginOptions)==null?void 0:S.loadUserOnFirstLoad,!r.options.builderMode&&r.options.framework!=="nextjs"&&(r.options.hostedLoginBox&&!r.options.customLoginBox?b&&r.store.dispatch({type:"auth/requestHostedLoginAuthorizeV2",payload:{shouldRedirectToLogin:!1,firstTime:!0}}):r.store.dispatch({type:"auth/requestAuthorize",payload:!0}));case 2:case"end":return A.stop()}},v)})),this.loadFeatureFlags=Gt(qe.mark(function v(){var m;return qe.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(!(r.options.previewMode||r.options.builderMode)){b.next=4;break}Kn.set(C1,r.name),b.next=16;break;case 4:return b.prev=4,b.next=7,Oe(function(){return r.apiClient.featureFlags.loadFeatureFlags()},br);case 7:m=b.sent,r.options.overrideFeatureFlags&&Object.assign(m,r.options.overrideFeatureFlags),Kn.set(m,r.name),b.next=16;break;case 12:b.prev=12,b.t0=b.catch(4),console.error("failed to get admin portal feature flags",b.t0),r.dispatchErrorByRequestName(b.t0,Mr.LOAD_FEATURE_FLAGS);case 16:case"end":return b.stop()}},v,null,[[4,12]])})),this.setFeatureFlagsForPreview=function(v){Kn.set(Object.assign({},C1,v),r.name)},this.queryFeatureFlags=function(v){return Kn.getFeatureFlags(v,r.name)},this.updateLocalizationsSetter=function(v){r.updateLocalizations=v},this.getEntitlementsFromStore=function(){var v;return(v=r.store.getState().auth.user)==null?void 0:v.entitlements},this.getUserFromStore=function(){return r.store.getState().auth.user},this.getEntitlementsQueryData=function(v){var m=r.getUserFromStore(),S=r.getEntitlementsFromStore(),b={custom:v,jwt:m};return{entitlements:S,attributes:b}},this.createCMCRenderOptions=function(v,m){return{injector:r,options:r.options,props:v,themeOptions:m.themeOptions,localizations:m.localizations,containerStyle:m.containerStyle}},this.renderUsersTable=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderUsersTable(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.renderInviteUserDialog=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderInviteUserDialog(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.renderChangePasswordForm=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderChangePasswordForm(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.renderProfilePage=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderProfilePage(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.renderEditEmailForm=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderEditEmailForm(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.renderSsoGuideDialog=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");
435case 2:return A=E.sent,E.abrupt("return",A.renderSsoGuideDialog(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.getUsersTableStore=function(){var v=Gt(qe.mark(function m(S){var b;return qe.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,r.loadScript("FronteggAdminPortal");case 2:return b=A.sent,A.abrupt("return",b.useUsersTableStore(S));case 4:case"end":return A.stop()}},m)}));return function(m){return v.apply(this,arguments)}}(),this.getInviteUserDialogStore=function(){var v=Gt(qe.mark(function m(S){var b;return qe.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,r.loadScript("FronteggAdminPortal");case 2:return b=A.sent,A.abrupt("return",b.useInviteUserDialogStore(S));case 4:case"end":return A.stop()}},m)}));return function(m){return v.apply(this,arguments)}}(),this.getSsoGuideDialogStore=function(){var v=Gt(qe.mark(function m(S){var b;return qe.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,r.loadScript("FronteggAdminPortal");case 2:return b=A.sent,A.abrupt("return",b.useSsoGuideDialogStore(S));case 4:case"end":return A.stop()}},m)}));return function(m){return v.apply(this,arguments)}}(),this.renderScimGuideDialog=function(){var v=Gt(qe.mark(function m(S,b,w){var A;return qe.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,r.loadScript("FronteggAdminPortal");case 2:return A=E.sent,E.abrupt("return",A.renderScimGuideDialog(S,r.createCMCRenderOptions(b,w)));case 4:case"end":return E.stop()}},m)}));return function(m,S,b){return v.apply(this,arguments)}}(),this.getScimGuideDialogStore=function(){var v=Gt(qe.mark(function m(S){var b;return qe.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,r.loadScript("FronteggAdminPortal");case 2:return b=A.sent,A.abrupt("return",b.useScimGuideDialogStore(S));case 4:case"end":return A.stop()}},m)}));return function(m){return v.apply(this,arguments)}}();var c=c6(n),u="frontegg-app-".concat(c);this.iframeRendering=a,this.name=c,this.options=Object.assign({},t,{contextOptions:Object.assign({requestCredentials:"include"},t.contextOptions)}),this.fetchClient=new Ln(this.name),this.apiClient=qf(this.name),this.options.cdnUrl&&(this.cdnUrl=this.options.cdnUrl),this.options.assetsUrl&&(this.assetsUrl=this.options.assetsUrl),de.for(this.name).setCdnUrl(this.cdnUrl),de.for(this.name).setAssetsUrl(this.assetsUrl),this.customElementName=u;var d=this.options.authOptions?Object.assign({},this.options.authOptions,{hostedLoginBox:this.options.hostedLoginBox}):{hostedLoginBox:this.options.hostedLoginBox};if(d.onRedirectTo=t.onRedirectTo,d.disableSilentRefresh=(s=this.options.authOptions)==null?void 0:s.disableSilentRefresh,this.options.store){if(this.store=this.options.store,!l&&this.options.store.getState().root.appName!==n)throw Error("Mismatch in store names")}else{var f,g;this.store=Xv({context:this.options.contextOptions,name:this.name,builderMode:this.options.builderMode,previewMode:this.options.previewMode,storeHolder:this,urlStrategy:this.options.urlStrategy,initialState:{auth:Object.assign({},d,(f=this.options.authOptions)!=null?f:{}),auditLogs:Object.assign({},(g=this.options.auditsOptions)!=null?g:{})}})}zr.setInstance(c,this);var h=de.for(c);h.setAppName(c),this.setEntitlementsOptions(t.entitlementsOptions),this.setSessionContext({enableSessionPerTenant:(i=t.authOptions)==null?void 0:i.enableSessionPerTenant,skipUserLoading:(o=t.authOptions)==null?void 0:o.skipUserLoading});var p=t.basename;p&&h.setBasename(p)}return ta(e,[{key:"setEntitlementsOptions",value:function(n){de.for(this.name).setEntitlementsOptions(Object.assign({},n))}},{key:"setSessionContext",value:function(n){de.for(this.name).setSessionContext(Object.assign({},n))}},{key:"dispatchErrorByRequestName",value:function(n,r){(n==null?void 0:n.statusCode)<500||this.store.dispatch({type:"auth/setErrorByRequestName",payload:{requestName:r,traceId:Ew(n)}})}},{key:"initContainers",value:function(){var t=Gt(qe.mark(function r(s){return qe.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.adminPortalEl=s.adminPortalEl,this.loginBoxEl=s.loginBoxEl,this.checkoutDialogEl=s.checkoutDialogEl,this.adminPortalContainer=s.adminPortalContainer,this.loginBoxContainer=s.loginBoxContainer,this.checkoutDialogContainer=s.checkoutDialogContainer;try{this.options.framework!=="nextjs"&&document.body.classList.add("frontegg-loading")}catch{console.error("Failed to add frontegg-loading to body classList")}return o.next=9,Promise.all([this.loadFeatureFlags(),this.loadAdminBoxMetadata(),this.requestAuthorize()]);case 9:!this.options.previewMode&&!this.options.customLoginBox&&(this.loadLoginBox(),hae(this.name)),this.options.lazyLoadAdminPortal||this.loadScript("FronteggAdminPortal");case 11:case"end":return o.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"updateMetadata",value:function(n){if(ei.set(n,this.name),n!=null&&n.localizations){var r;(r=this.updateLocalizations)==null||r.call(this,n.localizations)}}},{key:"addOnLoadedListener",value:function(n){if(!this.loading){n();return}this.loadingListeners.push(n)}},{key:"ready",value:function(n){this.loading?n():this.addOnLoadedListener(n)}},{key:"loginWithRedirect",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/requestHostedLoginAuthorize",payload:n})}},{key:"loginWithRedirectV2",value:function(n){this.store.dispatch({type:"auth/requestHostedLoginAuthorizeV2",payload:n})}},{key:"logout",value:function(n){this.store.dispatch({type:"auth/setState",payload:{isLoading:!0}}),this.store.dispatch({type:"auth/logout",payload:n})}},{key:"loadScript",value:function(n){var r=this;return new Promise(function(s,i){var o=window;if(o[n]){s(o[n]);return}var a={FronteggLoginBox:"login-box/index.js",FronteggAdminPortal:"admin-portal/index.js"},l=document.createElement("script");l.src="".concat(r.cdnUrl,"/").concat(a[n]),l.setAttribute("id","".concat(n,"Script")),l.setAttribute("cdn-url",r.cdnUrl),l.onload=function(){o["".concat(n,"Init")]?s(o["".concat(n,"Init")]({FronteggRestApi:E5,FronteggTypes:l6,FronteggReduxStore:o6})):s(o[n])},l.onerror=function(c){console.log("Profile page error",c),i(c)},document.body.append(l)})}},{key:"loadLoginBox",value:function(){var t=Gt(qe.mark(function r(){var s;return qe.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.loadScript("FronteggLoginBox");case 2:s=o.sent,s.render(this.loginBoxEl,{injector:this,options:this.options}
435),this.loading=!1,this.loadingListeners.forEach(function(a){try{a()}catch(l){console.error("Failed to call loadLoginBoxListener",l)}}),this.loadingListeners=[];case 7:case"end":return o.stop()}},r,this)}));function n(){return t.apply(this,arguments)}return n}()},{key:"showAdminPortal",value:function(){var t=Gt(qe.mark(function r(s){var i,o,a,l,c,u;return qe.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return i=s??{isMultiApp:!1},o=i.isMultiApp,a=this.queryFeatureFlags(["multi-apps-admin-portal"]),l=hJ(a,1),c=l[0],de.for(this.name).setRequestSource(Qg.AdminPortal),f.next=5,this.loadScript("FronteggAdminPortal");case 5:u=f.sent,this.adminPortalRenderer=u.render(this.adminPortalEl,{injector:this,options:Object.assign({isMultiApp:c&&o},this.options)});case 7:case"end":return f.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"openHostedAdminPortal",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=this.options.contextOptions.baseUrl,s="".concat(r,"/oauth/portal");if(n){window.open(s,"_blank");return}window.location.href=s}},{key:"hideAdminPortal",value:function(){try{var n,r=new URLSearchParams(window.location.search);(n=this.adminPortalRenderer)==null||n.unmount(),u6(r),de.for(this.name).setRequestSource(null)}catch(s){console.error("Failed to unmount admin portal",s)}}},{key:"showCheckoutDialog",value:function(){var t=Gt(qe.mark(function r(s){var i;return qe.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.loadScript("FronteggAdminPortal");case 2:i=a.sent,this.checkoutDialogRenderer=i.renderCheckoutDialog(this.checkoutDialogEl,Object.assign({injector:this},s,{options:this.options}));case 4:case"end":return a.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"hideCheckoutDialog",value:function(){try{var n;(n=this.checkoutDialogRenderer)==null||n.unmount()}catch(r){console.error("Failed to unmount checkout dialog",r)}}},{key:"getFeatureEntitlements",value:function(n,r){var s=this.getEntitlementsQueryData(r),i=s.entitlements,o=s.attributes;return Kv(i,n,o)}},{key:"getPermissionEntitlements",value:function(n,r){var s=this.getEntitlementsQueryData(r),i=s.entitlements,o=s.attributes;return Wv(i,n,o)}},{key:"getEntitlements",value:function(n,r){return"permissionKey"in n?this.getPermissionEntitlements(n.permissionKey,r):this.getFeatureEntitlements(n.featureKey,r)}},{key:"loadEntitlements",value:function(n){this.store.dispatch({type:"auth/loadEntitlements",payload:{callback:n}})}},{key:"stepUp",value:function(n){var r=this.store.getState(),s=(r==null?void 0:r.auth)||{},i=s.hostedLoginBox,o=s.routes.stepUpUrl;if(i){this.store.dispatch({type:"auth/stepUpHostedLogin",payload:n});return}jw(o,r.auth.onRedirectTo,n==null?void 0:n.maxAge)}},{key:"isSteppedUp",value:function(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=((n=this.store.getState())==null?void 0:n.auth)||{},i=s.user;return Qf(i,r)}},{key:"switchTenant",value:function(n){this.store.dispatch({type:"auth/switchTenant",payload:n})}},{key:"close",value:function(){this.hideAdminPortal(),this.hideCheckoutDialog()}}]),e}(),pae=function(){function e(){ea(this,e)}return ta(e,null,[{key:"setAuthentication",value:function(n,r,s){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"default",o=zr.getInstance(i),a=de.for(i);n&&r?(a.setAccessToken(r),a.setUser(Object.assign({},s,{accessToken:r})),o.store.actions.setAuthState({isLoading:!1,isAuthenticated:n,user:s}),o.store.actions.loadTenants()):(a.setAccessToken(null),a.setUser(null),o.store.actions.setAuthState({isLoading:!1,isAuthenticated:!1,user:null}))}}]),e}(),gae=function(){function e(){ea(this,e)}return ta(e,null,[{key:"show",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"default";zr.getInstance(n).showAdminPortal()}},{key:"showMultiApp",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"default";zr.getInstance(n).showAdminPortal({isMultiApp:!0})}},{key:"openHosted",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default";zr.getInstance(r).openHostedAdminPortal(n)}},{key:"hide",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"default";zr.getInstance(n).hideAdminPortal()}}]),e}(),mae=function(){function e(){ea(this,e)}return ta(e,null,[{key:"show",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default";zr.getInstance(r).showCheckoutDialog(n)}},{key:"hide",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"default";zr.getInstance(n).hideCheckoutDialog()}}]),e}(),vae=function(t){var n,r=window.FronteggAdminPortal.adminPortalStaticThemesDefaults;return(n=r[t])!=null?n:void 0},yae=function(){function e(t,n,r,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};ea(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.setRoute=function(){},this.themeSetter=void 0,this.localizationsSetter=void 0,this.themeOptions={},this.localizations={};var a={baseUrl:"preview"};if(r){if(this.store=r,!i&&r.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=Hw({context:a,appName:t},this,!0,void 0,void 0,!0);this.themeOptions=n,this.localizations=o,this.options=Object.assign({themeOptions:n,localizations:o,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:a},s),this.app=new Jv(this.options,t,!0),ei.set({},t)}return ta(e,[{key:"render",value:function(){var t=Gt(qe.mark(function r(s){var i=this,o,a,l,c,u;return qe.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=s.querySelector("#root"),o||(o=s.ownerDocument.createElement("div"),o.setAttribute("id","root"),s.appendChild(o)),this.app.adminPortalContainer=s,this.app.adminPortalEl=o,a=function(h){i.themeSetter=h},l=function(h){i.localizationsSetter=h},c=function(h){i.setRoute=h},f.next=9,this.app.loadScript("FronteggAdminPortal");case 9:return u=f.sent,this.app.adminPortalRenderer=u.renderPage(o,{options:this.options,injector:this.app,setThemeSetter:a,setStaticRouteSetter:c,setLocalizationsSetter:l}),this.app.loading=!1,f.next=14,qw(this);case 14:case"end":return f.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"unmount",value:function(){try{var n;(n=this.app.adminPortalRenderer)==null||n.unmount()}catch(r){console.error("Failed to unmount admin Portal renderer",r)}}},{key:"setTheme",value:function(n){var r;this.themeOptions=n,this.themeSetter||console.warn("this.themeSetter is not defined yet"),(r=this.themeSetter)==null||r.call(this,this.themeOptions)}},{key:"setLocalization",value:function(n){var r;this.localizations=n,this.localizationsSetter||console.warn("this.localizationsSetter is not defined yet"),(r=this.localizationsSetter)==null||r.call(this,this.localizations)}},{key:"setStaticRoute",value:function(n){var r;this.setRoute||console.warn("this.setRoute is not defined yet"),(r=this.setRoute)==null||r.call(this,n)}}]),e}(),f6="modern",Sae=function(t){var n,r=window.FronteggAdminPortal.themes;return(n=r[t])!=null?n:r[f6]},bae=function(){function e(t,n,r,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};ea(this,e),this.app=void 0,this.options=void 0,this.store=void 0,this.themeSetter=void 0,this.localizationsSetter=void 0,this.setRoute=function(){},this.themeOptions={},this.localizations={};var a={baseUrl:"preview"};if(r){if(this.store=r,!i&&r.getState().root.appName!==t)throw Error("Mismatch in store names")}else this.store=Hw({context:a,appName:t},this,!0,void 0,void 0,!0);this.themeOptions=n,this.localizations=o,this.options=Object.assign({themeOptions:n,localizations:o,iframeRendering:!0,metadata:{},previewMode:!0,builderMode:!0,store:this.store,contextOptions:a,onRedirectTo:function(){console.debug("path")}},s),this.app=new Jv(this.options,t,!0,i),ei.set({},t)}return ta(e,[{key:"render",value:function(){var t=Gt(qe.mark(function r(s){var i=this,o,a,l,c,u,d,f=arguments;return qe.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=f.length>1&&f[1]!==void 0?f[1]:"/account/login",a=s.querySelector("#root"),a||(a=s.ownerDocument.createElement("div"),a.setAttribute("id","root"),s.appendChild(a)),this.app.loginBoxContainer=s,this.app.loginBoxEl=a,l=function(v){i.themeSetter=v},c=function(v){i.localizationsSetter=v},u=function(v){i.setRoute=v},h.next=10,this.app.loadScript("FronteggLoginBox");case 10:return d=h.sent,this.app.loginBoxRenderer=d.renderPage(a,{options:this.options,injector:this.app,setThemeSetter:l,setStaticRouteSetter:u,setLocalizationsSetter:c,onFiberUpdateListener:this.options.onFiberUpdateListener,staticRoute:o}),h.next=14,qw(this);case 14:case"end":return h.stop()}},r,this)}));function n(r){return t.apply(this,arguments)}return n}()},{key:"unmount",value:function(){try{var n;(n=this.app.loginBoxRenderer)==null||n.unmount()}catch(r){console.error("Failed to unmount login box renderer",r)}}},{key:"setTheme",value:function(n){var r;this.themeOptions=n,this.themeSetter||console.warn("this.themeSetter is not defined yet"),(r=this.themeSetter)==null||r.call(this,this.themeOptions)}},{key:"setLocalization",value:function(n){var r;this.localizations=n,this.localizationsSetter||console.warn("this.localizationsSetter is not defined yet"),(r=this.localizationsSetter)==null||r.call(this,this.localizations)}},{key:"setStaticRoute",value:function(n){var r;this.setRoute||console.warn("this.setRoute is not defined yet"),(r=this.setRoute)==null||r.call(this,n)}},{key:"setStore",value:function(n){this.store.dispatch({type:"auth/setState",payload:n})}}]),e}();function yf(e,t){return yf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yf(e,t)}function _ae(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yf(e,t)}function wae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eae(e,t){if(t&&(Fc(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wae(e)}function Sf(e){return Sf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sf(e)}function Aae(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function h6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h6=function(){return!!e})()}function Cae(e,t,n){if(h6())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var s=new(e.bind.apply(e,r));return n&&yf(s,n.prototype),s}function x1(e){var t=typeof Map=="function"?new Map:void 0;return x1=function(r){if(r===null||!Aae(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,s)}function s(){return Cae(r,arguments,Sf(this).constructor)}return s.prototype=Object.create(r.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),yf(s,r)},x1(e)}function xae(e){var t=Tae();return function(){var r=Sf(e),s;if(t){var i=Sf(this).constructor;s=Reflect.construct(r,arguments,i)}else s=r.apply(this,arguments);return Eae(this,s)}}function Tae(){if(typeof Reflect>"u"||!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{return!1}}var Pae=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default",r=new Jv(t,n);if(typeof document<"u"){var s;if(!t.contextOptions.baseUrl){var i=new Error('Edit <FronteggProvider/> options { ContextOptions: { baseUrl: "" } } in order to connect your application');throw document.body.innerHTML="",alert(i.message),i}if(!customElements.get("frontegg-app")){var o=function(l){_ae(u,l);var c=xae(u);function u(){var d;ea(this,u);for(var f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return d=c.call.apply(c,[this].concat(g)),d.app=null,d}
435return ta(u,[{key:"connectedCallback",value:function(){this.updateContent()}},{key:"attributeChangedCallback",value:function(f,g,h){if(f==="app-name"){if(g===null||g===h)return;this.innerHTML="",h===null?this.remove():this.updateContent()}console.debug("attributeChangedCallback",f,g,h)}},{key:"updateContent",value:function(){var f,g=(f=this.getAttribute("app-name"))!=null?f:"default",h=zr.getInstance(g);if(h===null)throw Error("FronteggApp not found for appName: '".concat(g,"'"));this.setAttribute("id","frontegg-app-".concat(h.name));var p=ga(this,"div",{id:"frontegg-admin-portal-container-".concat(h.name)}),v=ga(this,"div",{id:"frontegg-login-box-container-".concat(h.name)}),m=ga(this,"div",{id:"frontegg-checkout-dialog-container-".concat(h.name)}),S=p.attachShadow({mode:"open"}),b=t.iframeRendering?v:v.attachShadow({mode:"open"}),w=m.attachShadow({mode:"open"}),A=ga(S,"div",{id:"frontegg-admin-portal-".concat(h.name),class:"frontegg-root-content"}),C=ga(b,"div",{id:"frontegg-login-box-".concat(h.name),class:"frontegg-root-content"}),E=ga(w,"div",{id:"frontegg-checkout-dialog-".concat(h.name),class:"frontegg-root-content"});h.initContainers({adminPortalEl:A,loginBoxEl:C,adminPortalContainer:p,loginBoxContainer:v,checkoutDialogContainer:m,checkoutDialogEl:E})}}],[{key:"observedAttributes",get:function(){return["app-name"]}}]),u}(x1(HTMLElement));customElements.define("frontegg-app",o)}(s=document.querySelector('frontegg-app[app-name="'.concat(r.name,'"]')))==null||s.remove();var a=document.createElement("frontegg-app");a.setAttribute("app-name",r.name),document.body.appendChild(a)}return r};/** @license Frontegg v7.104.0 436 * 437 * This source code is licensed under the MIT license found in the 438 * LICENSE file in the root directory of this source tree. 439 */const Rae=Object.freeze(Object.defineProperty({__proto__:null,AdminPortal:gae,AdminPortalRenderer:yae,AppHolder:zr,CheckoutDialog:mae,FronteggApp:Jv,HostedLogin:pae,LoginBoxRenderer:bae,createElement:ga,defaultTheme:f6,formatName:c6,getOverriddenMetadata:d6,getThemeAdminByName:vae,getThemeByName:Sae,initialize:Pae,mockFlagsList:C1,restoreSearchParams:u6,waitThemeSetter:qw},Symbol.toStringTag,{value:"Module"})),kae=el(Rae),Jf=y.createContext(null),le=()=>y.useContext(Jf),p6=e=>_.jsx(Jf.Provider,{value:e.store,children:e.children});var g6={exports:{}},m6={};/** 440 * @license React 441 * use-sync-external-store-shim.production.js 442 * 443 * Copyright (c) Meta Platforms, Inc. and affiliates. 444 * 445 * This source code is licensed under the MIT license found in the 446 * LICENSE file in the root directory of this source tree. 447 */var Hc=y;function Oae(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Iae=typeof Object.is=="function"?Object.is:Oae,Nae=Hc.useState,Lae=Hc.useEffect,Dae=Hc.useLayoutEffect,Mae=Hc.useDebugValue;function Uae(e,t){var n=t(),r=Nae({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return Dae(function(){s.value=n,s.getSnapshot=t,Ry(s)&&i({inst:s})},[e,n,t]),Lae(function(){return Ry(s)&&i({inst:s}),e(function(){Ry(s)&&i({inst:s})})},[e]),Mae(n),n}function Ry(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Iae(e,n)}catch{return!0}}function Fae(e,t){return t()}var $ae=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fae:Uae;m6.useSyncExternalStore=Hc.useSyncExternalStore!==void 0?Hc.useSyncExternalStore:$ae;g6.exports=m6;var jae=g6.exports;const Vae=Go(jae),{useSyncExternalStore:Bae}=Vae,zae=new WeakMap;function De(e,t){const n=t==null?void 0:t.sync,r=y.useRef(),s=y.useRef();let i=!0;const o=Bae(y.useCallback(c=>{const u=Ea(e,c,n);return c(),u},[e,n]),()=>{const c=oo(e,me.use);try{if(!i&&r.current&&s.current&&!QL(r.current,c,s.current,new WeakMap))return r.current}catch{}return c},()=>oo(e,me.use));i=!1;const a=new WeakMap;y.useEffect(()=>{r.current=o,s.current=a});const l=y.useMemo(()=>new WeakMap,[]);return YL(o,a,l,zae)}var v6={exports:{}},pt={};/** @license React v17.0.2 448 * react-is.production.min.js 449 * 450 * Copyright (c) Facebook, Inc. and its affiliates. 451 * 452 * This source code is licensed under the MIT license found in the 453 * LICENSE file in the root directory of this source tree. 454 */var Zv=60103,e0=60106,Zf=60107,eh=60108,th=60114,nh=60109,rh=60110,sh=60112,ih=60113,Yw=60120,oh=60115,ah=60116,y6=60121,S6=60122,b6=60117,_6=60129,w6=60131;if(typeof Symbol=="function"&&Symbol.for){var mn=Symbol.for;Zv=mn("react.element"),e0=mn("react.portal"),Zf=mn("react.fragment"),eh=mn("react.strict_mode"),th=mn("react.profiler"),nh=mn("react.provider"),rh=mn("react.context"),sh=mn("react.forward_ref"),ih=mn("react.suspense"),Yw=mn("react.suspense_list"),oh=mn("react.memo"),ah=mn("react.lazy"),y6=mn("react.block"),S6=mn("react.server.block"),b6=mn("react.fundamental"),_6=mn("react.debug_trace_mode"),w6=mn("react.legacy_hidden")}function Es(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Zv:switch(e=e.type,e){case Zf:case th:case eh:case ih:case Yw:return e;default:switch(e=e&&e.$$typeof,e){case rh:case sh:case ah:case oh:case nh:return e;default:return t}}case e0:return t}}}var Gae=nh,Hae=Zv,Wae=sh,Kae=Zf,qae=ah,Yae=oh,Qae=e0,Xae=th,Jae=eh,Zae=ih;pt.ContextConsumer=rh;pt.ContextProvider=Gae;pt.Element=Hae;pt.ForwardRef=Wae;pt.Fragment=Kae;pt.Lazy=qae;pt.Memo=Yae;pt.Portal=Qae;pt.Profiler=Xae;pt.StrictMode=Jae;pt.Suspense=Zae;pt.isAsyncMode=function(){return!1};pt.isConcurrentMode=function(){return!1};pt.isContextConsumer=function(e){return Es(e)===rh};pt.isContextProvider=function(e){return Es(e)===nh};pt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zv};pt.isForwardRef=function(e){return Es(e)===sh};pt.isFragment=function(e){return Es(e)===Zf};
454pt.isLazy=function(e){return Es(e)===ah};pt.isMemo=function(e){return Es(e)===oh};pt.isPortal=function(e){return Es(e)===e0};pt.isProfiler=function(e){return Es(e)===th};pt.isStrictMode=function(e){return Es(e)===eh};pt.isSuspense=function(e){return Es(e)===ih};pt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Zf||e===th||e===_6||e===eh||e===ih||e===Yw||e===w6||typeof e=="object"&&e!==null&&(e.$$typeof===ah||e.$$typeof===oh||e.$$typeof===nh||e.$$typeof===rh||e.$$typeof===sh||e.$$typeof===b6||e.$$typeof===y6||e[0]===S6)};pt.typeOf=Es;v6.exports=pt;var AT=v6.exports;class zo{static set(t,n){zo.components[t]=n}static get(t){return zo.components[t]}}zo.components={};const ele=(e,t,n)=>{const r=t.split(".");let s=e;for(;r.length>1;)s=s[r.shift()];s[r.shift()]=n},tle=e=>{var t;const{app:n,themeKey:r}=e,s=zo.get(r),[i,o]=y.useState(!1),[a,l]=y.useState({}),c=y.useCallback((h={})=>{o(!0),l(h)},[]),u=y.useCallback(()=>{o(!1)},[]);ele(n.options.themeOptions,r,{type:"slot",themeKey:r,mount:c,unmount:u});let d=(t=n.loginBoxContainer)==null?void 0:t.querySelector(`[slot="${r}"]`);if(!d&&typeof document!==void 0){var f;d=document.createElement("div"),d.slot=r,(f=n.loginBoxContainer)==null||f.appendChild(d)}const g=s?me.createElement(s,a):null;return d&&i?_.jsx(me.Fragment,{children:Dm.createPortal(g,d)}):_.jsx(_.Fragment,{})},nle=({app:e,themeOptions:t})=>{const n=y.useMemo(()=>{if(!t||!t.loginBox)return[];const r=(s,i,o)=>{if(s==="overrideSignupFields")return[];if(typeof i!="object"&&typeof i!="function")return[];if(typeof i=="function"&&s)try{const a=me.createElement(i,{title:"title"});if(y.isValidElement(a)||AT.isElement(a)){const l=`${o}.${s}`;return zo.set(l,i),[l]}}catch{}if(y.isValidElement(i)||AT.isElement(i)||i===null){const a=`${o}.${s}`;return zo.set(a,i),[a]}else{const a=[];
454return Object.keys(i).forEach(l=>{a.push(...r(l,i[l],o===""?s:`${o}.${s}`))}),a}};return r("loginBox",t.loginBox,"")},[]);return _.jsx(_.Fragment,{children:n.map(r=>_.jsx(tle,{app:e,themeKey:r},r))})},rle=["urlStrategy","onRedirectTo","renderByRoute","customLoader","customStyles","contextOptions"],E6=y.createContext({}),sle=e=>{var t,n;return typeof window<"u"&&((t=window.history)==null||(n=t.pushState)==null?void 0:n.call(t,null,"",e))},ile=e=>{var t,n;return typeof window<"u"&&((t=window.history)==null||(n=t.pushState)==null?void 0:n.call(t,null,"",`#${e}`))},t0=()=>{var e,t;const n=y.useContext(E6),{urlStrategy:r="path",onRedirectTo:s=r==="path"?sle:ile,renderByRoute:i=!1,customLoader:o=!1,customStyles:a,contextOptions:l}=n,c=re(n,rle),u=(e=(t=c.injector)==null?void 0:t.name)!=null?e:"default";return F({isShadowDom:!0,onRedirectTo:s,renderByRoute:i,customLoader:o,customStyles:a,urlStrategy:r,contextOptions:F({requestCredentials:"include"},l)},c,{appName:u,fetchClient:new Ln(u),apiClient:qf(u)})},au=()=>De(le().store.root),ole={state:e=>e,actions:e=>e};function lu(e=ole.state){const t=le().store.auth;return e(De(t))}function A6(){const e=le().store.auth;return De(e)}const ale=()=>{const{actions:e}=y.useContext(Jf);return e.requestHostedLoginAuthorize},C6=()=>{const{actions:e}=y.useContext(Jf);return e.requestHostedLoginAuthorizeV2},lle=()=>le().actions,Qw=()=>{const{onRedirectTo:e}=lu(),{appName:t}=au();return e||de.for(t).onRedirectTo},n0=()=>A6().routes,cle=()=>{const{isAuthenticated:e}=De(le().store.auth);return e},ule=()=>{const e=n0(),t=Qw(),n=C6(),{user:r,hostedLoginBox:s}=lu(),i={},o=typeof window>"u";return y.useEffect(()=>{if(r==null&&!o)if(s)n({shouldRedirectToLogin:!0});else{const{loginUrl:a,customLoginUrl:l}=e;t(l??a,{refresh:!0})}},[s,r,e,t,n]),r==null&&!o?i:r||i},Xw=()=>{const{user:e}=lu();return e||null},dle=()=>le().actions,fle=e=>e;function hle(e=fle){const t=le().store.auth.acceptInvitationState;return e(De(t))}const ple=()=>le().stateActions.auth.acceptInvitationActions,gle=e=>e;function mle(e=gle){const t=le().store.auth.unlockAccountState;return e(De(t))}const vle=()=>le().stateActions.auth.unlockAccountActions,yle=e=>e;function Sle(e=yle){const t=le().store.auth.activateAccountState;return e(De(t))}const ble=()=>le().stateActions.auth.activateAccountActions,_le=e=>e;function wle(e=_le){const t=le().store.auth.approvalFlowState;return e(De(t))}const Ele=()=>le().stateActions.auth.approvalFlowActions,Ale=e=>e;function Cle(e=Ale){const t=le().store.auth.allAccountsState;return e(De(t))}const xle=()=>le().stateActions.auth.allAccountsActions;function Tle(){const e=le().store.auth.allAccountsDialogsState;return De(e)}const Ple=()=>le().stateActions.auth.allAccountsDialogActions;function Rle(){const e=le().store.auth.apiTokensState;return De(e)}const kle=()=>le().stateActions.auth.apiTokensActions;function x6(){const e=le().store.auth.customLoginState;return De(e)}const Ole=()=>le().stateActions.auth.customLoginActions,Ile=()=>{var e,t,n;const r=(e=x6().tenantMetadata)==null||(t=e.configuration)==null||(n=t.themeV2)==null?void 0:n.loginBox,s=y.useCallback(i=>i&&r?P5(r,i):r,[r]);return{customLoginTheme:r,getCustomLoginThemeValue:s}},T6=e=>{var t;const{injector:n}=t0();return Kn.getFeatureFlags(e,(t=n==null?void 0:n.name)!=null?t:"default")},Nle=()=>{const{injector:e}=t0();return t=>{var n;return Kn.getFeatureFlags(t,(n=e==null?void 0:e.name)!=null?n:"default")}},P6=()=>{var e,t;const n=le().store.auth;return(e=(t=De(n).user)==null?void 0:t.entitlements)!=null?e:{}},R6=()=>Xw()||void 0,Jw=e=>{const t=R6();return{entitlements:P6(),attributes:{custom:e,jwt:t}}},Lle=(e,t)=>{const{entitlements:n,attributes:r}=Jw(t),{appName:s}=au();return Kv(n,e,r,void 0,s)},Dle=(e,t)=>{const{entitlements:n,attributes:r}=Jw(t),{appName:s}=au();return Wv(n,e,r,void 0,s)},Mle=(e,t)=>{const{entitlements:n,attributes:r}=Jw(t),{appName:s}=au();return Nw(n,e,r,void 0,s)},k6=()=>{const e=R6(),t=P6(),{appName:n}=au();return y.useMemo(()=>({isEntitledTo:(r,s)=>Nw(t,r,{custom:s,jwt:e},void 0,n)}),[e,t])},Ule=()=>{var e;const{entitlementsOptions:t}=t0(),n=(e=t==null?void 0:t.enabled)!=null?e:!1,{isEntitledTo:r}=k6(),[s]=T6(["admin-portal-use-is-entitled"]);return{isEntitlementsEnabled:n,isEntitledTo:r,verifyIsEntitledFF:s}};function Fle(){const e=le().store.auth.forgotPasswordState;return De(e)}const $le=()=>le().stateActions.auth.forgotPasswordActions;function jle(){const e=le().store.auth.passwordRotationState;return De(e)}const Vle=()=>le().stateActions.auth.passwordRotationActions;function Ble(){return De(le().store.auth.groupsState)}const zle=()=>le().stateActions.auth.groupsActions;function Gle(){return De(le().store.auth.groupsDialogsState)}const Hle=()=>le().stateActions.auth.groupsDialogsActions;function Wle(){return De(le().store.auth.impersonateState)}const Kle=()=>le().stateActions.auth.impersonateActions;function qle(){return De(le().store.auth.loginState)}const Yle=()=>le().stateActions.auth.loginActions,Qle=e=>e;function Xle(e=Qle){const{mfaState:t}=le().store.auth;return e(De(t))}const Jle=()=>le().stateActions.auth.mfaActions;function Zle(){return De(le().store.auth.passkeysState)}const ece=()=>le().stateActions.auth.passkeysActions;function O6(){return De(le().store.auth.profileState)}const I6=()=>le().stateActions.auth.profileActions,tce=()=>{const{loading:e}=O6(),{loadProfile:t}=I6();y.useEffect(()=>{!e&&t()},[])};function nce(){return De(le().store.auth.provisioningState)}const rce=()=>le().stateActions.auth.provisioningActions;function sce(){return De(le().store.auth.resetPhoneNumberState)}const ice=()=>le().stateActions.auth.resetPhoneNumberActions;function oce(){return De(le().store.auth.rolesState)}const ace=()=>le().stateActions.auth.rolesActions;function lce(){return De(le().store.auth.sessionsState)}const cce=()=>le().stateActions.auth.sessionsActions,uce=e=>e;function dce(e=uce){const{signUpState:t}=le().store.auth;return e(De(t))}const fce=()=>le().stateActions.auth.signUpActions;function hce(){return De(le().store.auth.smsState)}const pce=()=>le().stateActions.auth.smsActions,gce=e=>e;function mce(e=gce){return e(De(le().store.auth.socialLoginState))}const vce=()=>le().stateActions.auth.socialLoginActions,yce=e=>e;function Sce(e=yce){return e(De(le().store.auth.ssoState))}const bce=()=>le().stateActions.auth.ssoActions;function _ce(){return De(le().store.auth.stepUpState)}const N6=()=>le().stateActions.auth.stepUpActions,wce=()=>{const e=qv(_w);return e===void 0?void 0:+e},Ece=()=>{const{stepUpUrl:e}=n0(),{hostedLoginBox:t}=lu(),{stepUpHostedLogin:n}=N6(),r=Qw();return y.useCallback(s=>{if(t){n(s||{});return}jw(e,r,s==null?void 0:s.maxAge)},[e,r,n,t])},Ace=(e={})=>{const t=Xw();return Qf(t,e)};function L6(){const e=le().store.auth.teamState;return De(e)}const D6=()=>le().stateActions.auth.teamActions,Cce=e=>e;function xce(e=Cce){return e(L6())}const Tce=()=>D6();function Zw(){const e=le().store.auth.restrictionsState;return De(e)}const eE=()=>le().stateActions.auth.restrictionsActions,Pce=()=>{const{loading:e,data:t,saving:n,error:r,pagination:s,totalPages:i,userIpValid:o}=Zw().ipRestrictions,{loadIpRestrictions:a}=eE();return y.useEffect(()=>{!t&&!e&&a()},[a,t,e]),{loading:e,saving:n,error:r,data:t,pagination:s,totalPages:i,userIpValid:o}},Rce=()=>{const{loading:e,data:t,saving:n,error:r}=Zw().emailDomainRestrictions,{loadEmailDomainRestrictions:s}=eE();return y.useEffect(()=>{!t&&!e&&s()},[s,t,e]),{loading:e,saving:n,error:r,data:t}};function kce(){const e=le().store.auth.securityCenterState;return De(e)}const Oce=()=>le().stateActions.auth.securityCenterActions,Ice=e=>e;function tE(e=Ice){const t=le().store.auth.securityPolicyState;return e(De(t))}const nE=()=>le().stateActions.auth.securityPolicyActions,Nce=(e=!1)=>{const{publicPolicy:t}=tE(),{loadPublicSecurityPolicy:n}=nE();return y.useEffect(()=>{(e||!t.policy)&&n()},[e,n]),t},Lce=(e=!1)=>{const{publicAuthStrategyPolicy:t}=tE(),{loadPublicAuthStrategiesPolicy:n}=nE();return y.useEffect(()=>{(e||!t.policy)&&!t.error&&n()},[e,n]),t};function Dce(){const e=le().store.auth.sessionsPolicyState;return De(e)}const Mce=()=>le().stateActions.auth.sessionsPolicyActions;function Uce(){const e=le().store.auth.tenantsState;return De(e)}const Fce=()=>le().stateActions.auth.tenantsActions,$ce=e=>e;function jce(e=$ce){const t=le().store.auth.userEmailPolicyState;return e(De(t))}const Vce=()=>le().stateActions.auth.usersEmailsPolicyActions;function Bce(){const e=le().store.auth.applicationsState;return De(e)}const zce=()=>le().stateActions.auth.applicationsActions;function Gce(){return De(le().store.auth.usernamesState)}const Hce=()=>le().stateActions.auth.usernamesActions,Wce={state:e=>e,actions:e=>e};function Kce(e=Wce.state){const t=le().store.auditLogs;return e(De(t))}const qce=()=>le().stateActions.auditLogs;function Yce(){const e=le().store.auditLogs.auditLogsState;return De(e)}const Qce=()=>le().stateActions.auditLogs;
454function Xce(){const e=le().store.auditLogs.auditsMetadataState;return De(e)}const Jce=()=>le().stateActions.auditLogs;function Zce(){const e=le().store.connectivity;return De(e)}const eue=()=>le().stateActions.connectivity;function ii(){return le().store.subscriptions}const tue=()=>{const{config:e}=ii();return De(e)},nue=()=>le().stateActions.subscriptions.config,rue=()=>{const{plans:e}=ii();return De(e)},sue=()=>le().stateActions.subscriptions.plans,iue=()=>{const{checkout:e}=ii();return De(e)},oue=()=>le().stateActions.subscriptions.checkout,rE=e=>le().stateActions.subscriptions.billing[e],aue=()=>{const{billing:e}=ii();return De(e.information)},lue=()=>rE("information"),cue=()=>{const{billing:e}=ii();return De(e.paymentMethod)},uue=()=>rE("paymentMethod"),due=()=>{const{billing:e}=ii();return De(e.invoices)},fue=()=>rE("invoices"),hue=()=>{const{billing:e}=ii(),{cancellation:t}=De(e.subscription);return t},pue=()=>{const{billing:e}=ii(),{renewal:t}=De(e.subscription);return t},gue=()=>{const{billing:e}=ii();return De(e.subscription)},mue=()=>{const e=le().stateActions.subscriptions.billing.subscription;return F({},e,{load:e.loadSubscription})},vue=()=>{const{stripe:e}=ii();return De(e)},yue=()=>le().stateActions.subscriptions.stripe,Sue=()=>De(le().store.subscriptions.vendorPublicConfig),bue=()=>le().stateActions.subscriptions.vendorPublicConfig,_ue=e=>e;function wue(e=_ue){const t=le().store.vendor;return e(De(t))}const Eue=()=>le().stateActions.vendor;let bf;(function(e){e.localization="localization",e.themeOptionKey="themeOptionKey",e.leaf="leaf",e.pageRoot="pageRoot"})(bf||(bf={}));const sE=(e,t)=>{const n=y.useRef(t);return n.current.__frontegg_key__=e,n},Aue=e=>{sE(bf.leaf,{key:e})},Cue=()=>{sE(bf.pageRoot,{key:"pageRoot"})},xue=({onFiberUpdateListener:e,children:t})=>e?me.createElement(me.Profiler,{id:"overlay-profiler",children:t,onRender:e}):me.createElement(me.Fragment,{children:t}),Tue=["authenticatedUrl","signUpSuccessUrl","openAppUrl"],Pue=e=>{e?document.body.classList.add("frontegg-loading"):document.body.classList.remove("frontegg-loading")},Rue=({children:e,basename:t})=>{const n=n0(),r=y.useRef(window.location.pathname),s=y.useRef(0),[i,o]=y.useState(window.location.pathname),a=y.useCallback(()=>{r.current!==window.location.pathname&&(r.current=window.location.pathname,o(document.location.pathname)),s.current=window.requestAnimationFrame(a)},[]);y.useEffect(()=>(document.addEventListener("frontegg_onRedirectTo_fired",()=>{r.current!==window.location.pathname&&(r.current=window.location.pathname,o(document.location.pathname))}),window.addEventListener("popstate",()=>{r.current!==window.location.pathname&&(r.current=window.location.pathname,o(document.location.pathname))}),s.current=window.requestAnimationFrame(a),()=>{window.cancelAnimationFrame(s.current)}),[a,o]);const l=t&&t.endsWith("/")?t.substring(0,t.length-1):"",{openAppUrl:c}=n,u=re(n,Tue);return Object.values(u).map(d=>`${l}${d}`).indexOf(i)!==-1||i.startsWith(`${l}${c}`)?null:_.jsx(_.Fragment,{children:e})},kue=({children:e,app:t,setLoading:n})=>{var r,s;const{isLoading:i}=lu(),o=!t||(t==null||(r=t.options)==null?void 0:r.customLoginBox)===!0,a=(t==null||(s=t.options)==null?void 0:s.framework)==="nextjs",l=o||a,c=y.useRef(void 0);return i!==c.current&&!a&&(c.current=i,setTimeout(()=>{n(i)})),l?_.jsx(_.Fragment,{children:e}):i&&!a?null:_.jsx(Rue,{basename:t==null?void 0:t.options.basename,children:e})},Oue=e=>{var t,n,r,s,i,o,a,l,c,u;const{children:d,app:f,contextOptions:g,setLoading:h=Pue,alwaysVisibleChildren:p}=e,v=(t=f==null||(n=f.options)==null?void 0:n.contextOptions)!=null?t:g;if(!v)throw Error("contextOptions must not be null or undefined");const m=(r=f==null||(s=f.options)==null?void 0:s.previewMode)!=null?r:!1,S=(i=f==null||(o=f.options)==null?void 0:o.builderMode)!=null?i:!1,b=f==null||(a=f.options)==null?void 0:a.auditsOptions,w=f!=null&&(l=f.options)!=null&&l.authOptions?F({},f.options.authOptions,{hostedLoginBox:f.options.hostedLoginBox}):{hostedLoginBox:f==null||(c=f.options)==null?void 0:c.hostedLoginBox},A=(u=f==null?void 0:f.name)!=null?u:"default";de.for(A).setContext(v);const C=y.useMemo(()=>{var E,x;return(E=f==null?void 0:f.store)!=null?E:Xv({name:A,context:v,previewMode:m,builderMode:S,initialState:{auth:w,audits:b},urlStrategy:f==null||(x=f.options)==null?void 0:x.urlStrategy,storeHolder:f})},[f,m]);
454return _.jsxs(p6,{store:C,children:[p,_.jsx(kue,{setLoading:h,app:f,children:d})]})};/** @license Frontegg v7.104.0 455 * 456 * This source code is licensed under the MIT license found in the 457 * LICENSE file in the root directory of this source tree. 458 */const Iue=Object.freeze(Object.defineProperty({__proto__:null,CustomComponentHolder:zo,CustomComponentRegister:nle,FronteggStoreContext:Jf,FronteggStoreProvider:Oue,get OverlayKeys(){return bf},OverlayProfiler:xue,Provider:p6,ShadowDomContext:E6,getMaxAgeFromQueryParam:wce,reloadProfileIfNeeded:tce,useAcceptInvitationActions:ple,useAcceptInvitationState:hle,useActivateAccountActions:ble,useActivateAccountState:Sle,useAllAccountsActions:xle,useAllAccountsDialogsActions:Ple,useAllAccountsDialogsState:Tle,useAllAccountsState:Cle,useApiTokensActions:kle,useApiTokensState:Rle,useApplicationsActions:zce,useApplicationsState:Bce,useApprovalFlowActions:Ele,useApprovalFlowState:wle,useAuditLogsActions:Qce,useAuditLogsState:Yce,useAuditsActions:qce,useAuditsMetadataActions:Jce,useAuditsMetadataState:Xce,useAuditsState:Kce,useAuth:lu,useAuthActions:lle,useAuthRoutes:n0,useAuthState:A6,useAuthTeamActions:Tce,useAuthTeamState:xce,useAuthUser:ule,useAuthUserOrNull:Xw,useBillingInformation:aue,useBillingInformationActions:lue,useCheckout:iue,useCheckoutActions:oue,useConnectivityActions:eue,useConnectivityState:Zce,useCustomLoginActions:Ole,useCustomLoginState:x6,useCustomLoginTheme:Ile,useEmailDomainRestrictions:Rce,useEntitlements:Mle,useEntitlementsActions:k6,useEntitlementsOptions:Ule,useFeatureEntitlements:Lle,useFeatureFlags:T6,useFeatureFlagsChecker:Nle,useForgotPasswordActions:$le,useForgotPasswordState:Fle,useGroupsActions:zle,useGroupsDialogsActions:Hle,useGroupsDialogsState:Gle,useGroupsState:Ble,useImpersonateActions:Kle,useImpersonateState:Wle,useInvoices:due,useInvoicesActions:fue,useIpRestrictions:Pce,useIsAuthenticated:cle,useIsSteppedUp:Ace,useLoginActions:Yle,useLoginState:qle,useLoginWithRedirect:ale,useLoginWithRedirectV2:C6,useMfaActions:Jle,useMfaState:Xle,useOnRedirectTo:Qw,useOverlayLeaf:Aue,useOverlayPageRoot:Cue,useOverlayRef:sE,usePasskeysActions:ece,usePasskeysState:Zle,usePasswordRotationActions:Vle,usePasswordRotationState:jle,usePaymentMethod:cue,usePaymentMethodActions:uue,usePaymentProvider:tue,usePaymentProviderActions:nue,usePermissionEntitlements:Dle,usePlans:rue,usePlansActions:sue,useProfileActions:I6,useProfileState:O6,useProvisioningActions:rce,useProvisioningState:nce,usePublicAuthStrategiesPolicySettings:Lce,usePublicPolicySettings:Nce,useResetPhoneNumberActions:ice,useResetPhoneNumberState:sce,useRestrictionsActions:eE,useRestrictionsState:Zw,useRolesActions:ace,useRolesState:oce,useRootState:au,useSSOActions:bce,useSSOState:Sce,useSecurityCenterActions:Oce,useSecurityCenterState:kce,useSecurityPolicyActions:nE,useSecurityPolicyState:tE,useSessionsActions:cce,useSessionsPolicyActions:Mce,useSessionsPolicyState:Dce,useSessionsState:lce,useShadowDom:t0,useSignUpActions:fce,useSignUpState:dce,useSmsActions:pce,useSmsState:hce,useSnapshot:De,useSocialLoginActions:vce,useSocialLoginState:mce,useStepUp:Ece,useStepUpActions:N6,useStepUpState:_ce,useStore:le,useStoreActions:dle,useStripeActions:yue,useStripeState:vue,useSubscription:gue,useSubscriptionActions:mue,useSubscriptionCancellation:hue,useSubscriptionRenewal:pue,useTeamActions:D6,useTeamState:L6,useTenantsActions:Fce,useTenantsState:Uce,useUnlockAccountActions:vle,useUnlockAccountState:mle,useUsernamesActions:Hce,useUsernamesState:Gce,useUsersEmailsPolicyActions:Vce,useUsersEmailsPolicyState:jce,useVendorActions:Eue,useVendorPublicConfig:Sue,useVendorPublicConfigActions:bue,useVendorState:wue},Symbol.toStringTag,{value:"Module"})),Nue=el(Iue),Lue=el(GX),Due=el(E5),Mue=el(lJ),Uue=el(o6),Fue="react",$ue="React is a JavaScript library for building user interfaces.",jue=["react"],Vue="18.3.1",Bue="https://reactjs.org/",zue="https://github.com/facebook/react/issues",Gue="MIT",Hue=["LICENSE","README.md","index.js","cjs/","umd/","jsx-runtime.js","jsx-dev-runtime.js","react.shared-subset.js"],Wue="index.js",Kue={".":{"react-server":"./react.shared-subset.js",default:"./index.js"},"./package.json":"./package.json","./jsx-runtime":"./jsx-runtime.js","./jsx-dev-runtime":"./jsx-dev-runtime.js"},que={type:"git",url:"https://github.com/facebook/react.git",directory:"packages/react"},Yue={node:">=0.10.0"},Que={"loose-envify":"^1.1.0"},Xue={transform:["loose-envify"]}
458,Jue={name:Fue,description:$ue,keywords:jue,version:Vue,homepage:Bue,bugs:zue,license:Gue,files:Hue,main:Wue,exports:Kue,repository:que,engines:Yue,dependencies:Que,browserify:Xue},Zue=el(l6);(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(k){return k&&typeof k=="object"&&"default"in k?k.default:k}var n=y,r=t(n),s=kae,i=Nue,o=Lue,a=Due,l=Mue,c=Uue,u=t(Jue),d=Zue;/*! ***************************************************************************** 459 Copyright (c) Microsoft Corporation. 460 461 Permission to use, copy, modify, and/or distribute this software for any 462 purpose with or without fee is hereby granted. 463 464 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 465 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 466 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 467 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 468 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 469 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 470 PERFORMANCE OF THIS SOFTWARE. 471 ***************************************************************************** */var f=function(){return f=Object.assign||function($){for(var M,B=1,H=arguments.length;B<H;B++){M=arguments[B];for(var X in M)Object.prototype.hasOwnProperty.call(M,X)&&($[X]=M[X])}return $},f.apply(this,arguments)};function g(k,$){var M={};for(var B in k)Object.prototype.hasOwnProperty.call(k,B)&&$.indexOf(B)<0&&(M[B]=k[B]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var H=0,B=Object.getOwnPropertySymbols(k);H<B.length;H++)$.indexOf(B[H])<0&&Object.prototype.propertyIsEnumerable.call(k,B[H])&&(M[B[H]]=k[B[H]]);return M}var h=o.BrowserRouter,p=function(){var k,$,M,B=!((k=o.useInRouterContext)===null||k===void 0)&&k.call(o)?($=o.useNavigate)===null||$===void 0?void 0:$.call(o):null,H=(M=o.useHistory)===null||M===void 0?void 0:M.call(o);if(B){var X=function(Y,ae){ae?B(Y,{state:ae}):B(Y)},te=function(Y,ae){B(Y,{state:ae,replace:!0})};return{push:X,replace:te}}return H},v={version:"7.12.21"},m=function(k){var $=new URLSearchParams(k);return $.delete("redirectUrl"),$.toString()},S=function(k){var $=k.routes,M=k.history,B=n.useRef(),H=n.useRef(),X=o.useLocation(),te=X.pathname,Y=X.search;n.useEffect(function(){Y&&(B.current=Y,H.current=te)},[]),n.useEffect(function(){var ae=!!Object.values($).find(function(oe){return oe===H.current});if(!Y&&B.current&&ae){var Ae=m(B.current);M.push(te+("?"+Ae))}H.current=te},[te,Y,$])},b=function(k){var $=k.history,M=i.useAuthRoutes().signUpUrl;return S({routes:{signUpUrl:M},history:$}),r.createElement(r.Fragment,null)},w=function(k){var $=k.isExternalHistory,M=k.app,B=k.themeOptions,H=k.history;return r.createElement(r.Fragment,null,r.createElement(i.CustomComponentRegister,{app:M,themeOptions:B}),!$&&r.createElement(b,{history:H}))},A=function(k){var $=p();return r.createElement(E,f({history:$},k))};function C(k,$){var M=($==null?void 0:$.stepUpUrl)||c.defaultFronteggRoutes.stepUpUrl;return M&&k.startsWith(M)}var E=function(k){var $,M,B=k.history,H=k.appName,X=k.isExternalHistory,te=X===void 0?!1:X,Y=g(k,["history","appName","isExternalHistory"]),ae=typeof window>"u",Ae="@frontegg/react@"+v.version,oe=($=Y.basename)!==null&&$!==void 0?$:"",K=n.useRef(function(){return!1});n.useEffect(function(){K.current=function(Z){var ee;return c.isAuthRoute(Z,(ee=Y.authOptions)===null||ee===void 0?void 0:ee.routes)}},[(M=Y.authOptions)===null||M===void 0?void 0:M.routes]);var G=n.useCallback(function(Z,ee){var ge,pe,xe=Z;if(oe&&typeof oe=="string"&&oe.length>0&&xe.startsWith(oe)&&(xe=xe.substring(oe.length)),(ee!=null&&ee.preserveQueryParams||K.current(xe))&&(xe=""+xe+window.location.search),C(xe,(ge=Y.authOptions)===null||ge===void 0?void 0:ge.routes)){(pe=window==null?void 0:window.history)===null||pe===void 0||pe.pushState(null,"",xe);return}ee!=null&&ee.refresh&&!ae?window.Cypress&&!Y.hostedRuntime?B.push(xe):window.location.href=xe:ee!=null&&ee.replace?B.replace(xe):B.push(xe)},[]),Q=n.useMemo(function(){var Z;try{return l.AppHolder.getInstance(H??"default")}catch{return s.initialize(f(f({}
471,Y),{basename:(Z=Y.basename)!==null&&Z!==void 0?Z:oe,contextOptions:f({requestCredentials:"include",metadataHeaders:{framework:a.FronteggFrameworks.React+"@"+u.version,fronteggSdkVersion:Ae}},Y.contextOptions),onRedirectTo:G}),H??"default")}},[]);return a.ContextHolder.setOnRedirectTo(G),r.createElement(i.FronteggStoreProvider,f({},f(f({},Y),{app:Q}),{alwaysVisibleChildren:r.createElement(w,{app:Q,themeOptions:Y.themeOptions,history:B,isExternalHistory:te})}))},x=function(k){var $=p();return k.history||$?r.createElement(E,f({history:k.history||$,isExternalHistory:!!k.history},k),k.children):r.createElement(h,{basename:k.basename},r.createElement(A,f({},k),k.children))},R=function(k){var $,M,B=!0,H=i.useAuthUserOrNull();if(!(H!=null&&H.superUser)){if(k.requiredPermissions){B=!1;for(var X=function(Q){!(($=H==null?void 0:H.permissions)===null||$===void 0)&&$.find(function(Z){var ee=Z.key;return ee===Q})&&(B=!0)},te=0,Y=k.requiredPermissions;te<Y.length;te++){var ae=Y[te];X(ae)}}if(k.requiredRoles){B=!1;for(var Ae=function(Q){!((M=H==null?void 0:H.roles)===null||M===void 0)&&M.find(function(Z){var ee=Z.key;return ee===Q})&&(B=!0)},oe=0,K=k.requiredRoles;oe<K.length;oe++){var G=K[oe];Ae(G)}}}return typeof k.render=="function"?r.createElement(r.Fragment,null,k.render(B)):B?r.createElement(r.Fragment,null,k.children):null},T=function(k){k===void 0&&(k="default");var $=n.useState({open:!1,error:null,success:!1}),M=$[0],B=M.open,H=M.error,X=M.success,te=$[1],Y=n.useCallback(function(K){te({open:!0,success:!1,error:K})},[]),ae=n.useCallback(function(){te({open:!1,success:!0,error:null})},[]),Ae=n.useCallback(function(K){s.CheckoutDialog.show({plan:K,onClose:oe,onError:Y,onSuccess:ae},k),te({open:!0,success:!1,error:null})},[k]),oe=n.useCallback(function(){s.CheckoutDialog.hide(k),te({open:!1,error:null,success:!1})},[k]);return n.useMemo(function(){return{open:B,showDialog:Ae,hideDialog:oe,error:H,success:X}},[B,Ae,oe,H,X])},P=function(k){var $=i.useIsAuthenticated();return $?r.createElement(I,f({},k)):null},I=function(k){var $=k.maxAge,M=k.preventSteppingUp,B=k.render,H=k.children,X=i.useIsSteppedUp({maxAge:$}),te=i.useStepUp(),Y=n.useRef(!1);return n.useEffect(function(){if(X){Y.current=!1;return}Y.current||(M||te({maxAge:$}),Y.current=!0)},[X,$,M,te]),typeof B=="function"?r.createElement(r.Fragment,null,B(X)):X?r.createElement(r.Fragment,null,H):null},U=n.memo(function(k){var $=k.themeOptions,M=k.props,B=k.localizations,H=k.hostStyle,X=k.renderComponent,te=r.useRef(null);return r.useLayoutEffect(function(){var Y=s.AppHolder.getInstance("default");if(te.current){if(console.log({app:Y}),!Y[X])throw new Error("Component "+X+" is not supported");Y[X](te.current,M,{themeOptions:$,localizations:B}).then(function(ae){return ae})}},[]),r.createElement("div",{style:f({},H),ref:te})},function(){return!0}),L=function(k){return r.createElement(U,f({renderComponent:"renderUsersTable"},k))},z=function(k){return r.createElement(U,f({renderComponent:"renderInviteUserDialog"},k))},O=function(k){return r.createElement(U,f({renderComponent:"renderChangePasswordForm"},k))},j=function(k){return r.createElement(U,f({renderComponent:"renderProfilePage"},k))},N=function(k){var $=s.AppHolder.getInstance("default"),M=n.useState(c.createProxy({onSearch:function(){},searchQuery:"",searching:!1})),B=M[0],H=M[1];return r.useLayoutEffect(function(){$.getUsersTableStore({id:k}).then(function(X){H(X)}).catch(function(X){console.error("Error getting users table store",X)})},[]),i.useSnapshot(B)},V=function(k){var $=s.AppHolder.getInstance("default"),M=n.useState(c.createProxy({dialogOpen:!1,openDialog:function(){},closeDialog:function(){}})),B=M[0],H=M[1];return r.useLayoutEffect(function(){$.getInviteUserDialogStore({id:k}).then(function(X){H(X)}).catch(function(X){console.error("Error getting invite user dialog store",X)})},[]),i.useSnapshot(B)};
471Object.keys(i).forEach(function(k){k!=="default"&&Object.defineProperty(e,k,{enumerable:!0,get:function(){return i[k]}})}),Object.keys(d).forEach(function(k){k!=="default"&&Object.defineProperty(e,k,{enumerable:!0,get:function(){return d[k]}})}),Object.defineProperty(e,"AdminPortal",{enumerable:!0,get:function(){return s.AdminPortal}}),Object.defineProperty(e,"CheckoutDialog",{enumerable:!0,get:function(){return s.CheckoutDialog}}),Object.defineProperty(e,"HostedLogin",{enumerable:!0,get:function(){return s.HostedLogin}}),Object.defineProperty(e,"ContextHolder",{enumerable:!0,get:function(){return a.ContextHolder}}),e.AuthorizedContent=R,e.CMCComponent=U,e.ChangePasswordForm=O,e.Connector=E,e.ConnectorHistory=A,e.FronteggProvider=x,e.InviteUserDialog=z,e.ProfilePage=j,e.SteppedUpContent=P,e.UsersTable=L,e.useCheckoutDialog=T,e.useInviteUserDialog=V,e.useUsersTable=N})(Bo);const ede="/api/v1",tde=404,r0=1e3,nde=60,rde=30,sde=5,ide=10,ode=120,CT=r0*rde,cm=r0*nde*sde,M6=r0*ide,ade=r0*ode;async function gt(e,t){const n={};return t.auth!==void 0&&(n.authorization=`Bearer ${t.auth}`),t.body!==void 0&&(n["content-type"]="application/json"),await fetch(`${ede}${e}`,{method:t.method,headers:n,...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}async function _t(e){if(!e.ok){const t=await e.text();throw new Error(`${e.status}: ${t}`)}return e}async function Xt(e){return await e.json()}const xT=e=>({queryKey:["organization",e],queryFn:()=>gt("/organization",{method:"GET",auth:e}).then(async t=>t.status===tde?null:await _t(t)).then(async t=>t===null?null:await Xt(t))}),lde={teams:"Team",enterprise:"Enterprise",free:"Free"};function cde(e){let t;if(e.billing){const n=e.billing.status.state==="active"?{state:"active",deactivationAt:e.billing.status.deactivationAt?new Date(e.billing.status.deactivationAt):void 0}:{state:e.billing.status.state,at:new Date(e.billing.status.at)};t={cycle:e.billing.cycle,status:n,nextPayment:e.billing.nextPayment===void 0?void 0:new Date(e.billing.nextPayment),isPastDue:e.billing.isPastDue}}return{name:e.name,licenseType:e.licenseType,isTrial:e.isTrial,maxSeats:e.maxSeats,usedSeats:e.usedSeats,fingerprint:e.fingerprint,validTo:e.validTo?new Date(e.validTo):void 0,billing:t}}const U6=e=>({queryKey:["licenses",e],queryFn:()=>gt("/licenses",{method:"GET",auth:e}).then(_t).then(Xt).then(t=>t.map(cde)),refetchInterval:CT,staleTime:CT}),um=e=>(e.scope??"operator")==="operator",hme=e=>e.scope==="read_only",dm=e=>(e??[]).some(t=>um(t)&&t.lastUsedAt!==null),Hp=e=>({queryKey:["api-keys",e],queryFn:()=>gt("/api-keys",{method:"GET",auth:e}).then(_t).then(Xt)}),F6=(e,t="")=>e==="read_only"?`/api-keys/read-only${t}`:`/api-keys${t}`,ude=(e,t)=>({mutationFn:({name:n,identityConsent:r,scope:s})=>gt(F6(s),{method:"POST",auth:e,body:{name:n,identityConsent:r,scope:s}}).then(_t).then(Xt),onSettled(){t.invalidateQueries({queryKey:["api-keys",e]})}}),pme=(e,t)=>({mutationFn:({graceSeconds:n,scope:r})=>gt(F6(r,"/rotate"),{method:"POST",auth:e,body:{graceSeconds:n,scope:r}}).then(_t).then(Xt),onSettled(){t.invalidateQueries({queryKey:["api-keys",e]})}}),gme=(e,t)=>({mutationFn:n=>gt(`/api-keys/${encodeURIComponent(n)}`,{method:"DELETE",auth:e}).then(_t),onSettled(){t.invalidateQueries({queryKey:["api-keys",e]})}}),mme=(e,t)=>
471({mutationFn:n=>gt("/organization/identity-consent",{method:"PUT",auth:e,body:{identityConsent:n}}).then(_t),onSettled(){t.invalidateQueries({queryKey:["api-keys",e]})}}),vme=e=>({queryKey:["dashboard-availability",e],queryFn:()=>gt("/dashboard/availability",{method:"GET",auth:e}).then(_t).then(Xt)}),$6={queryKey:["frontegg"],queryFn:()=>gt("/frontegg",{method:"GET"}).then(_t).then(Xt)},dde=e=>({queryKey:["paddle-config",e],queryFn:()=>gt("/paddle/paddle-config",{method:"GET",auth:e}).then(_t).then(Xt)}),fde=e=>({queryKey:["checkout-config",e],queryFn:()=>gt("/paddle/checkout-config",{method:"GET",auth:e}).then(_t).then(Xt)}),yme=(e,t)=>({queryKey:["statistics",e,t],queryFn:()=>gt(`/licenses/${t}/statistics`,{method:"GET",auth:e}).then(_t).then(Xt),refetchInterval:cm,staleTime:cm}),hde=(e,t)=>({queryKey:["checklist",e,t],queryFn:()=>gt(`/licenses/${t}/checklist`,{method:"GET",auth:e}).then(_t).then(Xt),refetchInterval:cm,staleTime:cm});async function pde(e){await gt("/organization/prepare-contact",{method:"POST",auth:e})}const gde=(e,t)=>({mutationFn:n=>gt("/organization",{method:"POST",auth:e,body:n}).then(_t).then(Xt),onSuccess(n){t.setQueryData(["organization",e],n)},async onError(n){n.message.startsWith("409")&&await t.invalidateQueries({queryKey:["organization",e],exact:!0})}}),Sme=(e,t)=>({mutationFn:n=>gt("/organization/claim",{method:"POST",auth:e,body:n}).then(_t).then(Xt),onSuccess(n){t.setQueryData(["organization",e],n)},async onError(n){n.message.startsWith("409")&&await t.invalidateQueries({queryKey:["organization",e],exact:!0})}}),bme=(e,t,n,r,s)=>({queryKey:["price-preview",t,n,r,s],queryFn:()=>e.PricePreview({customerId:t,items:n,...r!==void 0?{discountId:r}:{},...s?{address:{countryCode:s}}:{}}).then(i=>{const o=[];return i.data.details.lineItems.forEach(a=>{a.price.billingCycle!==null&&o.push({currencyCode:a.price.unitPrice.currencyCode,priceId:a.price.id,quantity:a.quantity,totalPrice:parseInt(a.totals.total,10)/100,totalTax:parseInt(a.totals.tax,10)/100,subtotalPrice:parseInt(a.totals.subtotal,10)/100,formattedUnitPrice:a.formattedUnitTotals.total,formattedTotalPrice:a.formattedTotals.total,minQuantity:a.price.quantity.minimum,maxQuantity:a.price.quantity.maximum,cycle:a.price.billingCycle})}),o}),staleTime:M6}),_me=(e,t)=>({mutationFn:n=>gt(`/licenses/${t}`,{method:"PATCH",auth:e,body:n}).then(_t)}),wme=(e,t,n,r,s,i)=>({enabled:i,queryKey:["license-update-preview",e,t,n,r,s],queryFn:()=>gt(`/licenses/${t}/preview`,{method:"PATCH",auth:e,body:{maxSeats:n,priceId:r,discountId:s}}).then(_t).then(Xt),staleTime:M6}),Eme=(e,t)=>({mutationFn:()=>gt(`/licenses/${t}/cancel`,{method:"POST",auth:e}).then(_t)}),Ame=(e,t)=>
471({mutationFn:()=>gt(`/licenses/${t}/resume`,{method:"POST",auth:e}).then(_t)}),Cme=(e,t)=>({queryKey:[e,t],staleTime:0,queryFn:()=>gt(`/licenses/${t}/update-payment-method`,{method:"GET",auth:e}).then(_t).then(Xt),retry:!1}),xme=e=>({mutationFn:t=>gt("/paddle/billing-email",{method:"PATCH",auth:e,body:t}).then(_t).then(Xt)}),Tme=e=>({queryKey:["billing-information",e],queryFn:()=>gt("/paddle/billing-information",{method:"GET",auth:e}).then(_t).then(Xt)}),Pme=(e,t)=>({queryKey:["invoices",e,t??null],queryFn:()=>{const n=t?`?after=${encodeURIComponent(t)}`:"";return gt(`/paddle/invoices${n}`,{method:"GET",auth:e}).then(_t).then(Xt)}});async function Rme(e,t){return(await gt(`/paddle/invoices/${t}/pdf`,{method:"GET",auth:e}).then(_t).then(Xt)).url}async function kme(e,t){const n=await gt("/paddle/invoices/archive",{method:"POST",auth:e,body:{ids:t??[]}});return await _t(n),await n.blob()}const Ome=(e,t,n,r)=>({queryKey:[e,t,n],staleTime:ade,queryFn:()=>gt(`/paddle/discounts?code=${t}&price=${n}`,{method:"GET",auth:e}).then(_t).then(Xt),enabled:r,retry:!1}),iE="mirrord.pendingClaimCode",mde=1e3,vde=60,yde=15,Sde=mde*vde*yde,T1="/claim",bde="code",oE=()=>{let e;try{e=localStorage.getItem(iE)}catch{return null}if(e===null)return null;let t;try{t=JSON.parse(e)}catch{return fm(),null}const{code:n,expiresAt:r}=t;return typeof n!="string"||n===""||typeof r!="number"||r<=Date.now()?(fm(),null):{code:n,expiresAt:r,redirected:t.redirected===!0}},j6=e=>{try{localStorage.setItem(iE,JSON.stringify(e))}catch{}},_de=e=>{j6({code:e,expiresAt:Date.now()+Sde,redirected:!1})},Ime=()=>{var e;return((e=oE())==null?void 0:e.code)??null},wde=()=>{const e=oE();return e!==null&&!e.redirected},Ede=()=>{const e=oE();e!==null&&!e.redirected&&j6({...e,redirected:!0})},fm=()=>{try{localStorage.removeItem(iE)}catch{}},Ade=["fe.connectivity.*","fe.secure.*"],Cde=e=>Ade.every(t=>e.includes(t)),V6=me.createContext(void 0),xde=e=>{const{user:t,isAuthenticated:n}=Bo.useAuth(),{logoutUrl:r}=Bo.useAuthRoutes(),s=al(),i=tl(),o=y.useCallback(()=>{i.reset(),s(r)},[r,s,i]),a=y.useRef(!1);y.useEffect(()=>{a.current&&!n&&fm(),a.current=n},[n]);const l=y.useMemo(()=>{if(n&&t){const c=t.permissions.map(d=>d.key);let u;try{u=JSON.parse(t.metadata).flags??{}}catch{u={}}return{accessToken:t.accessToken,name:t.name,email:t.email,permissions:c,canManageOrganization:Cde(c),profilePicture:t.profilePictureUrl,tenantId:t.tenantId,flags:u,logout:o}}else return null},[t,n,o]);return _.jsx(V6.Provider,{value:l,children:e.children})},Tde=()=>{const e=y.useContext(V6);if(e===void 0)throw new Error("outside user data context");return e},oi=()=>{const e=Tde();if(!e)throw new Error("user not authenticated");return e},Pde=e=>{const{data:t}=Gs($6),n=tl(),r={signUpComplete:s=>{n.identify(s.email),s.tenantId&&n.group("organization",s.tenantId,{name:s.companyName}),n.capture("user_signed_up",{email:s.email,name:s.name,companyName:s.companyName,authenticationType:s.authenticationType,socialProvider:s.socialProvider,tenantId:s.tenantId})}};return t!==void 0?_.jsx(Bo.FronteggProvider,{events:r,contextOptions:t,hostedLoginBox:!1,children:_.jsx(y.Suspense,{fallback:_.jsx(ds,{fixed:!0}),children:e.children})}):_.jsx(ds,{fixed:!0})},Rde=e=>{const t=tl(),n=Bo.useAuthUser(),{isAuthenticated:r,isLoading:s}=Bo.useAuth();return y.useEffect(()=>{const i=n.email;if(i){const o=document.cookie.split(";").find(l=>l.trim().startsWith("hubspotutk=")),a=o==null?void 0:o.substring(o.indexOf("=")+1);t.identify(i,{...a&&{hubspot_user_token:a}}),t.group("organization",n.tenantId),t.capture("$pageview")}},[n.email,t,n.tenantId]),!s&&r?_.jsx(_.Fragment,{children:e.children}):_.jsx(ds,{fixed:!0})},kde=e=>_.jsx(Pde,{children:_.jsx(xde,{children:e.children})});function TT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ode(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TT(Object(n),!0).forEach(function(r){Nde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEac
vendor: 4,630 bytes, line 471
471h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P1(){P1=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,s=Object.defineProperty||function(O,j,N){O[j]=N.value},i=typeof Symbol=="function"?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(O,j,N){return Object.defineProperty(O,j,{value:N,enumerable:!0,configurable:!0,writable:!0}),O[j]}try{c({},"")}catch{c=function(j,N,V){return j[N]=V}}function u(O,j,N,V){var k=j&&j.prototype instanceof m?j:m,$=Object.create(k.prototype),M=new L(V||[]);return s($,"_invoke",{value:T(O,N,M)}),$}function d(O,j,N){try{return{type:"normal",arg:O.call(j,N)}}catch(V){return{type:"throw",arg:V}}}t.wrap=u;var f="suspendedStart",g="suspendedYield",h="executing",p="completed",v={};function m(){}function S(){}function b(){}var w={};c(w,o,function(){return this});var A=Object.getPrototypeOf,C=A&&A(A(z([])));C&&C!==n&&r.call(C,o)&&(w=C);var E=b.prototype=m.prototype=Object.create(w);function x(O){["next","throw","return"].forEach(function(j){c(O,j,function(N){return this._invoke(j,N)})})}function R(O,j){function N(k,$,M,B){var H=d(O[k],O,$);if(H.type!=="throw"){var X=H.arg,te=X.value;return te&&typeof te=="object"&&r.call(te,"__await")?j.resolve(te.__await).then(function(Y){N("next",Y,M,B)},function(Y){N("throw",Y,M,B)}):j.resolve(te).then(function(Y){X.value=Y,M(X)},function(Y){return N("throw",Y,M,B)})}B(H.arg)}var V;s(this,"_invoke",{value:function(k,$){function M(){return new j(function(B,H){N(k,$,B,H)})}return V=V?V.then(M,M):M()}})}function T(O,j,N){var V=f;return function(k,$){if(V===h)throw new Error("Generator is already running");if(V===p){if(k==="throw")throw $;return{value:e,done:!0}}for(N.method=k,N.arg=$;;){var M=N.delegate;if(M){var B=P(M,N);if(B){if(B===v)continue;return B}}if(N.method==="next")N.sent=N._sent=N.arg;else if(N.method==="throw"){if(V===f)throw V=p,N.arg;N.dispatchException(N.arg)}else N.method==="return"&&N.abrupt("return",N.arg);V=h;var H=d(O,j,N);if(H.type==="normal"){if(V=N.done?p:g,H.arg===v)continue;return{value:H.arg,done:N.done}}H.type==="throw"&&(V=p,N.method="throw",N.arg=H.arg)}}}function P(O,j){var N=j.method,V=O.iterator[N];if(V===e)return j.delegate=null,N==="throw"&&O.iterator.return&&(j.method="return",j.arg=e,P(O,j),j.method==="throw")||N!=="return"&&(j.method="throw",j.arg=new TypeError("The iterator does not provide a '"+N+"' method")),v;var k=d(V,O.iterator,j.arg);if(k.type==="throw")return j.method="throw",j.arg=k.arg,j.delegate=null,v;var $=k.arg;return $?$.done?(j[O.resultName]=$.value,j.next=O.nextLoc,j.method!=="return"&&(j.method="next",j.arg=e),j.delegate=null,v):$:(j.method="throw",j.arg=new TypeError("iterator result is not an object"),j.delegate=null,v)}function I(O){var j={tryLoc:O[0]};1 in O&&(j.catchLoc=O[1]),2 in O&&(j.finallyLoc=O[2],j.afterLoc=O[3]),this.tryEntries.push(j)}function U(O){var j=O.completion||{};j.type="normal",delete j.arg,O.completion=j}function L(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(I,this),this.reset(!0)}function z(O){if(O||O===""){var j=O[o];if(j)return j.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var N=-1,V=function k(){for(;++N<O.length;)if(r.call(O,N))return k.value=O[N],k.done=!1,k;return k.value=e,k.done=!0,k};return V.next=V}}throw new TypeError(typeof O+" is not iterable")}return S.prototype=b,s(E,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:S,configurable:!0}),S.displayName=c(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(O){var j=typeof O=="function"&&O.constructor;return!!j&&(j===S||(j.displayName||j.name)==="GeneratorFunction")},t.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,b):(O.__proto__=b,c(O,l,"GeneratorFunction")),O.prototype=Object.create(E),O},t.awrap=function(O){return{__await:O}},x(R.prototype),c(R.prototype,a,function(){return this}),t.AsyncIterator=R,t.async=function(O,j,N,V,k){k===void 0&&(k=Promise);var $=new R(u(O,j,N,V),k);return t.isGeneratorFunction(j)?$:$.next().then(function(M){return M.done?M.value:$.next()})},x(E),c(E,l,"Generator"),c(E,o,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),t.keys=function(O){var j=Object(O),N=[];for(var V in j)N.push(V);return N.reverse(),function k(){for(;N.length;){var $=N.pop();if($ in j)return k.value=$,k.done=!1,k}return k.done=!0,k}},t.values=z,L.prototype={constructor:L,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEac
471h(U),!O)for(var j in this)j.charAt(0)==="t"&&r.call(this,j)&&!isNaN(+j.slice(1))&&(this[j]=e)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var j=this;function N(H,X){return $.type="throw",$.arg=O,j.next=H,X&&(j.method="next",j.arg=e),!!X}for(var V=this.tryEntries.length-1;V>=0;--V){var k=this.tryEntries[V],$=k.completion;if(k.tryLoc==="root")return N("end");if(k.tryLoc<=this.prev){var M=r.call(k,"catchLoc"),B=r.call(k,"finallyLoc");if(M&&B){if(this.prev<k.catchLoc)return N(k.catchLoc,!0);if(this.prev<k.finallyLoc)return N(k.finallyLoc)}else if(M){if(this.prev<k.catchLoc)return N(k.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<k.finallyLoc)return N(k.finallyLoc)}}}},abrupt:function(O,j){for(var N=this.tryEntries.length-1;N>=0;--N){var V=this.tryEntries[N];if(V.tryLoc<=this.prev&&r.call(V,"finallyLoc")&&this.prev<V.finallyLoc){var k=V;break}}k&&(O==="break"||O==="continue")&&k.tryLoc<=j&&j<=k.finallyLoc&&(k=null);var $=k?k.completion:{};return $.type=O,$.arg=j,k?(this.method="next",this.next=k.finallyLoc,v):this.complete($)},complete:function(O,j){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&j&&(this.next=j),v},finish:function(O){for(var j=this.tryEntries.length-1;j>=0;--j){var N=this.tryEntries[j];if(N.finallyLoc===O)return this.complete(N.completion,N.afterLoc),U(N),v}},catch:function(O){for(var j=this.tryEntries.length-1;j>=0;--j){var N=this.tryEntries[j];if(N.tryLoc===O){var V=N.completion;if(V.type==="throw"){var k=V.arg;U(N)}return k}}throw new Error("illegal catch attempt")},delegateYield:function(O,j,N){return this.delegate={iterator:z(O),resultName:j,nextLoc:N},this.method==="next"&&(this.arg=e),v}},t}function PT(e,t,n,r,s,i,o){try{var a=e[i](o),l=a.value}catch(c){n(c);return}a.done?t(l):Promise.resolve(l).then(r,s)}function Ide(e){return function(){var t=this,n=arguments;return new Promise(function(r,s){var i=e.apply(t,n);function o(l){PT(i,r,s,o,a,"next",l)}function a(l){PT(i,r,s,o,a,"throw",l)}o(void 0)})}}function Nde(e,t,n){return t=Ude(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lde(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Dde(e,t){if(e==null)return{};var n=Lde(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mde(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ude(e){var t=Mde(e,"string");return typeof t=="symbol"?t:String(t)}var B6="https://cdn.paddle.com/paddle/v2/paddle.js";function Fde(){return document.querySelector('script[src="'.concat(B6,'"]'))||void 0}function $de(e){var t=document.createElement("script");t.src=e;var n=document.head||document.body;if(!n)throw new Error("Cannot inject Paddle.js. It needs a <head> or <body> element.");return n.appendChild(t),t}var cp;
471function jde(){return cp!==void 0||(cp=new Promise(function(e,t){if(typeof window>"u"){e(void 0);return}if(window.Paddle){e(window.Paddle);return}try{var n=Fde();n||(n=$de(B6)),n.addEventListener("load",function(){window.Paddle?e(window.Paddle):t(new Error("Paddle.js not available"))}),n.addEventListener("error",function(){t(new Error("Failed to load Paddle.js"))})}catch(r){t(r);return}})),cp}var R1;(function(e){e.CHECKOUT_LOADED="checkout.loaded",e.CHECKOUT_CLOSED="checkout.closed",e.CHECKOUT_UPDATED="checkout.updated",e.CHECKOUT_COMPLETED="checkout.completed",e.CHECKOUT_ERROR="checkout.error",e.CHECKOUT_FAILED="checkout.failed",e.CHECKOUT_ITEMS_UPDATED="checkout.items.updated",e.CHECKOUT_ITEMS_REMOVED="checkout.items.removed",e.CHECKOUT_CUSTOMER_CREATED="checkout.customer.created",e.CHECKOUT_CUSTOMER_UPDATED="checkout.customer.updated",e.CHECKOUT_CUSTOMER_REMOVED="checkout.customer.removed",e.CHECKOUT_PAYMENT_SELECTED="checkout.payment.selected",e.CHECKOUT_PAYMENT_INITIATED="checkout.payment.initiated",e.CHECKOUT_PAYMENT_FAILED="checkout.payment.failed",e.CHECKOUT_DISCOUNT_APPLIED="checkout.discount.applied",e.CHECKOUT_DISCOUNT_REMOVED="checkout.discount.removed"})(R1||(R1={}));var RT;(function(e){e.DAY="day",e.WEEK="week",e.MONTH="month",e.YEAR="year"})(RT||(RT={}));var kT;(function(e){e.ALIPAY="alipay",e.APPLE_PAY="apple-pay",e.CARD="card",e.GOOGLE_PAY="google-pay",e.IDEAL="ideal",e.PAYPAL="paypal",e.WIRE_TRANSFER="wire-transfer",e.NONE="none"})(kT||(kT={}));var OT;(function(e){e.AMERICAN_EXPRESS="american_express",e.DINERS_CLUB="diners_club",e.DISCOVER="discover",e.JCB="jcb",e.MADA="mada",e.MAESTRO="maestro",e.MASTER_CARD="mastercard",e.UNION_PAY="union_pay",e.VISA="visa",e.UNKNOWN="unknown"})(OT||(OT={}));var k1;(function(e){e.DRAFT="draft",e.READY="ready",e.COMPLETED="completed",e.BILLED="billed",e.canceled="canceled",e.PAST_DUE="past_due"})(k1||(k1={}));var Vde=["environment"];function Bde(e){return O1.apply(this,arguments)}function O1(){return O1=Ide(P1().mark(function e(t){var n,r,s;return P1().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,jde();case 2:if(n=o.sent,!n){o.next=8;break}if(t){r=t.environment,s=Dde(t,Vde);try{r&&n.Environment.set(r),n.Setup(Ode({},s))}catch(a){console.warn("Paddle Initialization failed. Please check the inputs",a)}}return o.abrupt("return",n);case 8:return console.warn("Error Loading Paddle"),o.abrupt("return");case 10:case"end":return o.stop()}},e)})),O1.apply(this,arguments)}const z6=me.createContext(void 0),zde=e=>{const[t,n]=y.useState(null),{accessToken:r}=oi(),{data:s}=Gs(dde(r)),i=s==null?void 0:s.token,o=s==null?void 0:s.environment,a=al(),l=tu();return y.useEffect(()=>{async function c(u,d){const f=await Bde({environment:d,token:u,checkout:{settings:{displayMode:"overlay",allowLogout:!1}},eventCallback(g){var h;if(g.name===R1.CHECKOUT_CLOSED){if(((h=g.data)==null?void 0:h.status)===k1.COMPLETED){l.invalidateQueries({queryKey:["licenses"]}),a("/billing",{state:{checkoutCompleted:!0}});return}a("/billing")}}});f!==void 0&&n(f)}i&&o&&c(i,o)},[n,i,o,a,l]),_.jsx(z6.Provider,{value:t,children:e.children})},G6=me.createContext(void 0),Nme=()=>{const e=y.useContext(G6);if(e===void 0)throw new Error("outside checkout context");return e},Lme=e=>{const[t,n]=y.useState(),r=y.useContext(z6),{accessToken:s}=oi(),{data:i}=Gs(fde(s)),o=i==null?void 0:i.customerId,a=i==null?void 0:i.prices;if(r===void 0)throw new Error("outside paddle context");return y.useEffect(()=>{!r||!o||!a||n({getPaddle(){return r},getCustomerId(){return o},openCheckout(l,c,u,d){const f={};u.type==="trial"?f.overwrite=u.fingerprint:f.overwrite_canceled=u.fingerprint;const g={customer:{id:o},items:[{priceId:l,quantity:c}],customData:f,...d!==void 0?{discountId:d}:{}};r.Checkout.open(g)},openCheckoutForTx(l){r.Checkout.open({customer:{id:o},transactionId:l,settings:{displayMode:"overlay",allowLogout:!1}})},getPriceIds(){return a}})},[n,r,o,a]),t!=null?_.jsx(G6.Provider,{value:t,children:e.children}):_.jsx(ds,{fixed:!1})},Gde=()=>{const e=Xr(),t=al();return y.useEffect(()=>{e.pathname!==T1&&wde()&&(Ede(),t(T1,{replace:!0}))},[e.pathname,t]),null},Hde="© MetalBear",Wde="Legal",Kde=()=>_.jsx("footer",{className:"px-6 lg:px-8 py-4 border-t border-border",children:_.jsxs("p",{className:"text-xs text-muted-foreground",children:[Hde," ",new Date().getFullYear()," ",_.jsx("span",{className:"mx-1",children:"·"}),_.jsx("a",{href:"https://metalbear.com/legal",className:"hover:text-foreground transition-colors",children:Wde})]})}),qde="143742664",Yde="53036d76-d0a3-4378-8c0e-503d7fa74e09";function Qde(){const e=document.cookie.split(";").find(t=>t.trim().startsWith("hubspotutk="));return e?e.split("=")[1]??null:null}function Xde(e){const t=window;t.dataLayer=t.dataLayer??[],t.dataLayer.push({event:"signup_completed",user_email:e})}function Jde(e,t,n){const r=Qde(),s=t.split(" "),i=s[0]??"",o=s.length>1?s.slice(1).join(" "):"",a={context:{hutk:r,pageUri:window.location.href,pageName:document.title},fields:[{objectTypeId:"0-1",name:"email",value:e},{objectTypeId:"0-1",name:"firstname",value:i},{objectTypeId:"0-1",name:"lastname",value:o},{objectTypeId:"0-1",name:"company",value:n}]};fetch(`https://forms-eu1.hsforms.com/submissions/v3/integration/submit/${qde}/${Yde}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(()=>{})}function Zde(e,t,n){Xde(e),Jde(e,t,n)}const efe="Role",tfe="Select your role",nfe="How did you hear about us?",rfe="Select an option",IT="Please specify",sfe=[["engineering","Engineering"],["devops","DevOps"],["SRE","SRE"],["devex","DevEx"],["platform","Platform"],["other","Other"]],ife=[["friend","Recommended by a friend"],["twitter","Twitter"],["reddit","Reddit"],["linkedin","LinkedIn"],["google","Google"],["blog","Blog Post"],["other","Other"]],NT="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",ofe=({value:e,onUpdate:t})=>_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{htmlFor:"role",children:efe}),_.jsxs("select",{id:"role",value:e.userFunction??"",onChange:n=>{t({userFunction:n.target.value||void 0,userFunctionOther:n.target.value==="other"?e.userFunctionOther:void 0})},className:NT,children:[_.jsx("option",{value:"",children:tfe}),sfe.map(([n,r])=>_.jsx("option",{value:n,children:r},n))]}),e.userFunction==="other"&&_.jsx(Da,{type:"text",placeholder:IT,value:e.userFunctionOther??"",onChange:n=>{t({userFunctionOther:n.target.value})},className:"mt-1"})]}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{htmlFor:"heardFrom",children:nfe}),_.jsxs("select",{id:"heardFrom",value:e.userHeardFrom??"",onChange:n=>{t({userHeardFrom:n.target.value||void 0,userHeardFromOther:n.target.value==="other"?e.userHeardFromOther:void 0})},className:NT,children:[_.jsx("option",{value:"",children:rfe}),ife.map(([n,r])=>_.jsx("option",{value:n,children:r},n))]}),e.userHeardFrom==="other"&&_.jsx(Da,{type:"text",placeholder:IT,value:e.userHeardFromOther??"",onChange:n=>{t({userHeardFromOther:n.target.value})},className:"mt-1"})]})]}),afe="About you",lfe="Help us personalize your experience.",cfe="Team size",ufe="Preferred IDE",dfe="Phone number (optional)",ffe="Back",hfe=({className:e})=>_.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{fill:"#007ACC",d:"M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z"})}),pfe=({className:e})=>_.jsx("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{d:"M0 0v24h24V0zm3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556-.167.444-.39.777-.723 1.11-.277.279-.666.557-1.11.668a3.933 3.933 0 0 1-1.445.278c-.778
4710-1.444-.167-1.944-.445a4.81 4.81 0 0 1-1.279-1.056l1.39-1.555c.277.334.555.555.833.722.277.167.611.278.945.278.389 0 .721-.111 1-.389.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z"})}),gfe=[["2-10","2-10"],["10-50","10-50"],["50+","50+"]],mfe=[{value:"vscode",label:"VS Code",icon:_.jsx(hfe,{className:"w-5 h-5"})},{value:"intellij",label:"IntelliJ",icon:_.jsx(pfe,{className:"w-5 h-5"})},{value:"cli",label:"CLI",icon:_.jsx(_v,{className:"w-5 h-5"})}],vfe=({formState:e,onUpdate:t,onNext:n,onBack:r,isSubmitting:s})=>_.jsxs("div",{className:"flex flex-col gap-5",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:afe}),_.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:lfe})]}),_.jsx($o,{}),_.jsx(ofe,{value:e,onUpdate:t}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{children:cfe}),_.jsx("div",{className:"flex gap-2",children:gfe.map(([i,o])=>_.jsx("button",{type:"button",onClick:()=>{t({teamSize:i})},className:` 472 flex-1 px-3 py-2 text-sm rounded-md border transition-all 473 ${e.teamSize===i?"border-primary bg-primary/15 text-primary font-medium":"border-border hover:border-muted-foreground text-muted-foreground"} 474 `,children:o},i))})]}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{children:ufe}),_.jsx("div",{className:"flex gap-2",children:mfe.map(i=>_.jsxs("button",{type:"button",onClick:()=>{t({idePreference:i.value})},className:` 475 flex-1 flex flex-col items-center gap-1.5 px-3 py-3 rounded-md border transition-all 476 ${e.idePreference===i.value?"border-primary bg-primary/15 text-primary font-medium":"border-border hover:border-muted-foreground text-muted-foreground"} 477 `,children:[i.icon,_.jsx("span",{className:"text-sm",children:i.label})]},i.value))})]}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{htmlFor:"phone",children:dfe}),_.jsx(Da,{id:"phone",type:"tel",value:e.phoneNumber??"",onChange:i=>{t({phoneNumber:i.target.value})},placeholder:"+1 (555) 000-0000"})]}),_.jsxs("div",{className:"flex gap-3",children:[_.jsx(Rt,{variant:"outline",size:"lg",className:"flex-1",onClick:r,children:ffe}),_.jsx(Rt,{size:"lg",className:"flex-1",onClick:n,disabled:s,children:s?"Creating account...":"Continue"})]})]}),yfe={vscode:{label:"Install VS Code Extension",url:"https://marketplace.visualstudio.com/items?itemName=MetalBear.mirrord",icon:_.jsx(H4,{className:"w-4 h-4"})},intellij:{label:"Install IntelliJ Plugin",url:"https://plugins.jetbrains.com/plugin/19772-mirrord",icon:_.jsx(uY,{className:"w-4 h-4"})}},ky="mirrord wizard",Sfe=2e3,bfe="Create your first mirrord config",_fe="Generate a",LT="mirrord-config.json",wfe="for your project using the interactive wizard.",Efe="Use mirrord directly from your IDE",Afe="You're all set to use mirrord from the CLI!",Cfe="Run this in your terminal",xfe="1",Tfe="2",Pfe="3",Rfe="This opens an interactive wizard in your browser that connects to your cluster.",kfe="Choose a mode (mirror, replace, or filter traffic), then pick a target from your cluster.",Ofe="Download the generated",Ife="and use it with your IDE extension or the CLI.",Nfe="View full configuration docs",Lfe="Back",Dfe="Go to Dashboard",Mfe=({idePreference:e,onFinish:t,onBack:n})=>{const r=tl(),[s,i]=y.useState(!1),o=y.useCallback(()=>{navigator.clipboard.writeText(ky),r.capture("wizard_code_block_copied",{step:5,step_name:"first_session",command:ky}),i(!0),setTimeout(()=>{i(!1)},Sfe)},[r]),a=e&&e!=="cli"?yfe[e]:null;return _.jsxs("div",{className:"flex flex-col gap-5",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:bfe}),_.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[_fe," ",_.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:LT})," ",wfe]})]}),_.jsx($o,{}),a&&_.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 border border-primary/20 bg-primary/10 rounded-md hover:bg-primary/15 transition-colors",children:[_.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-primary/15 text-primary",children:a.icon}),_.jsxs("div",{className:"flex-1",children:[_.jsx("span",{className:"text-sm font-medium text-primary",children:a.label}),_.jsx("p",{className:"text-xs text-muted-foreground",children:Efe})]}),_.jsx(D2,{className:"w-4 h-4 text-primary"})]}),!a&&e==="cli"&&_.jsxs("div",{className:"flex items-center gap-2 p-3 bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900 rounded-md",children:[_.jsx(_v,{className:"w-4 h-4 text-green-600 dark:text-green-400"}),_.jsx("span",{className:"text-sm text-green-700 dark:text-green-300",children:Afe})]}),_.jsxs("div",{className:"border border-border rounded-lg p-4",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(VY,{className:"w-4 h-4 text-primary"}),_.jsx("span",{className:"font-medium text-foreground",children:Cfe})]}),_.jsxs("div",{className:"flex items-center bg-gray-900 rounded-md overflow-hidden mb-3",children:[_.jsx("code",{className:"flex-1 text-sm text-green-400 px-3 py-2.5 overflow-x-auto whitespace-nowrap scrollbar-hide",children:ky}),_.jsx("button",{onClick:o,className:"px-3 py-2.5 text-gray-400 hover:text-white transition-colors",children:s?_.
477jsx(Jl,{className:"w-4 h-4 text-green-400"}):_.jsx(Gg,{className:"w-4 h-4"})})]}),_.jsxs("ol",{className:"flex flex-col gap-2",children:[_.jsxs("li",{className:"flex items-start gap-2",children:[_.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-primary/15 text-primary text-xs font-medium shrink-0 mt-0.5",children:xfe}),_.jsx("span",{className:"text-sm text-foreground",children:Rfe})]}),_.jsxs("li",{className:"flex items-start gap-2",children:[_.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-primary/15 text-primary text-xs font-medium shrink-0 mt-0.5",children:Tfe}),_.jsx("span",{className:"text-sm text-foreground",children:kfe})]}),_.jsxs("li",{className:"flex items-start gap-2",children:[_.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-primary/15 text-primary text-xs font-medium shrink-0 mt-0.5",children:Pfe}),_.jsxs("span",{className:"text-sm text-foreground",children:[Ofe," ",_.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:LT})," ",Ife]})]})]})]}),_.jsxs("a",{href:"https://metalbear.com/mirrord/docs/config/options/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:[Nfe," ",_.jsx(D2,{className:"w-3 h-3"})]}),_.jsxs("div",{className:"flex gap-3",children:[_.jsx(Rt,{variant:"outline",size:"lg",className:"flex-1",onClick:n,children:Lfe}),_.jsx(Rt,{size:"lg",className:"flex-1",onClick:t,children:Dfe})]})]})},Ufe=2e3,Ffe="Install the mirrord CLI",$fe="Install the mirrord CLI to run your first session.",jfe="macOS",Vfe="Linux",Bfe="Verify the installation",zfe="mirrord --version",Gfe="You'll need the CLI for the next step: running your first session against the operator you just installed.",Hfe="Back",Wfe="Continue",up={mac:{label:"macOS (Homebrew)",cmd:"brew install metalbear-co/mirrord/mirrord"},linux:{label:"Linux / macOS (shell script)",cmd:"curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | sh"}},Kfe=({onNext:e,onBack:t})=>{const n=tl(),[r,s]=y.useState("mac"),[i,o]=y.useState(!1),a=y.useCallback(()=>{navigator.clipboard.writeText(up[r].cmd),n.capture("wizard_code_block_copied",{step:3,step_name:"install_cli",command:up[r].cmd,platform:r}),o(!0),setTimeout(()=>{o(!1)},Ufe)},[r,n]);return _.jsxs("div",{className:"flex flex-col gap-5",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:Ffe}),_.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:$fe})]}),_.jsx($o,{}),_.jsxs("div",{className:"flex gap-2",children:[_.jsxs("button",{type:"button",onClick:()=>{s("mac"),o(!1)},className:` 478 flex-1 flex items-center justify-center gap-2 px-3 py-2.5 rounded-md border transition-all text-sm 479 ${r==="mac"?"border-primary bg-primary/15 text-primary font-medium":"border-border hover:border-muted-foreground text-muted-foreground"} 480 `,children:[_.jsx(Yq,{className:"w-4 h-4"}),jfe]}),_.jsxs("button",{type:"button",onClick:()=>{s("linux"),o(!1)},className:` 481 flex-1 flex items-center justify-center gap-2 px-3 py-2.5 rounded-md border transition-all text-sm 482 ${r==="linux"?"border-primary bg-primary/15 text-primary font-medium":"border-border hover:border-muted-foreground text-muted-foreground"} 483 `,children:[_.jsx(H4,{className:"w-4 h-4"}),Vfe]})]}),_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:up[r].label}),_.jsxs("div",{className:"flex items-center bg-gray-900 rounded-md overflow-hidden",children:[_.jsx("code",{className:"flex-1 text-sm text-green-400 px-3 py-2.5 overflow-x-auto whitespace-nowrap scrollbar-hide",children:up[r].cmd}),_.jsx("button",{onClick:a,className:"px-3 py-2.5 text-gray-400 hover:text-white transition-colors",title:"Copy to clipboard",children:i?_.jsx(Jl,{className:"w-4 h-4 text-green-400"}):_.jsx(Gg,{className:"w-4 h-4"})})]})]}),_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:Bfe}),_.jsx("div",{className:"flex items-center bg-gray-900 rounded-md overflow-hidden",children:_.jsx("code",{className:"flex-1 text-sm text-green-400 px-3 py-2.5",children:zfe})})]}),_.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted rounded-md",children:[_.jsx(_v,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),_.jsx("p",{className:"text-xs text-muted-foreground",children:Gfe})]}),_.jsxs("div",{className:"flex gap-3",children:[_.jsx(Rt,{variant:"outline",size:"lg",className:"flex-1",onClick:t,children:Hfe}),_.jsx(Rt,{size:"lg",className:"flex-1",onClick:e,children:Wfe})]})]})},Dme={title:"Settings",description:"Manage your organization's operator settings."},Mme={sectionTitle:"Usage API key",generate:"Generate usage API key",generating:"Generating your usage API keyâ¦",noActiveKey:"No usage API key yet.",newKeyTitle:"Your new usage API key",copyKey:"Copy usage API key",examplesTitle:"Pull your usage data",examplesHint:"Exchange the key for a token first; a token lasts ten minutes, so a script fetches one per run. The key is read-only, but it grants access to your usage data, engineer identities included while sharing is on, so store it as a secret. The report and trends match the usage dashboard; session rows are the raw export.",identityNote:"Engineer identities and targets appear in session rows and the report only while identity sharing is on for your organization.",revoke:"Revoke",revokeConfirm:"Revoke now",serverWithoutScopes:"This server does not support read-only keys yet, so the key it returned is being withdrawn. Try again after the next deployment.",revokeCancel:"Keep it",rotatePlaceholder:"Rotateâ¦",rotateLabels:{0:"Rotate now",3600:"Rotate, 1 hour overlap",86400:"Rotate, 1 day overlap",604800:"Rotate, 7 day overlap"}
483,stops:"Stops ",endpoints:{token:"Exchange the key for a token (valid for ten minutes)",report:"Usage report for a period",trends:"Daily trends",sessions:"Session rows, one page; pass nextCursor back as cursor= for the next one"},copyLabel:{token:"Copy token request",report:"Copy report request",trends:"Copy trends request",sessions:"Copy sessions request"},adminRequired:"Contact an organization admin to manage the usage API key."},dp={sectionTitle:"Operator API Key",generate:"Generate API Key",generating:"Generating your API keyâ¦",noActiveKey:"No active API key yet.",neverUsed:"Never used",revokePlaceholder:"Revokeâ¦",copyKey:"Copy API key",newKeyTitle:"Your new API key",copyNow:"Copy now",onlyShownOnce:"This is the only time the key is shown â store it now.",installTitle:"Install the mirrord Operator",recommended:"Recommended",bookDemo:"Book a demo",done:"Done",method:{k8sSecret:"Kubernetes secret",gsm:"Google Secret Manager",inline:"Inline (dev/test)"},step:{addRepo:"1. Add the MetalBear Helm repository",provideKey:"2. Provide the API key, one of these ways",install:"3. Install the chart",verify:"4. Verify the installation"},copyLabel:{helmRepo:"Copy helm repo command",kubectl:"Copy kubectl command",keyRef:"Copy keyRef snippet",gsmRef:"Copy gsmRef snippet",inline:"Copy key snippet",helmInstall:"Copy helm install command",verify:"Copy verify command"},graceLabels:{0:"Revoke now",3600:"Revoke in 1 hour",86400:"Revoke in 1 day",604800:"Revoke in 7 days"},command:{k8sSecretName:"mirrord-operator-cloud-api-key",helmRepo:"helm repo add metalbear https://metalbear-co.github.io/charts",helmInstall:"helm install -f values.yaml mirrord-operator metalbear/mirrord-operator",verify:"mirrord operator status",valuesYamlUrl:"https://github.com/metalbear-co/charts/blob/main/mirrord-operator/values.yaml",bookDemoUrl:"https://meetings-eu1.hubspot.com/mirrord/mirrord-demo"}},Ume={title:"An agent set up mirrord for Teams for you",description:"Claim the organization it created to manage it from this account. Teammates can be invited once it is yours.",codeLabel:"Claim code",organizationName:"Organization name",yourName:"Your name",submit:"Claim organization",submitting:"Claimingâ¦",success:"Organization claimed",missingCodeTitle:"Missing claim code",missingCode:"Open the claim link exactly as the agent printed it, including the code.",alreadyHasOrganization:"This account already has an organization",keyConflict:"Your organization already has an active API key. Revoke it, then claim again; the claim link stays valid.",shareIdentityLabel:"Share identity-level usage data with mirrord cloud",shareIdentityHint:"Gives your usage dashboard per-user detail (usernames, targets). Uncheck to keep telemetry anonymized; the dashboard then shows pseudonymous IDs.",invalidCode:"This claim link was already used or is invalid",failed:"Failed to claim organization"},DT=new Set(["install_failed","other"]),qfe=[{value:"no_cluster_access",label:"Someone else manages our cluster",icon:W4},{value:"needs_approval",label:"Waiting on security/IT approval",icon:DY},{value:"install_failed",label:"The install commands failed",icon:_v},{value:"no_cluster",label:"No cluster to try this on",icon:lY},{value:"other",label:"Something else",icon:bv}],Yfe="Stuck on the operator install?",Qfe="Tell us why â or grab time with an engineer below.",Xfe="Anything else that would help us? (optional)",Jfe="Send",Zfe="Back",ehe="Having an issue?",the="Schedule an install session",nhe="Schedule an install session",rhe="An engineer will help you get mirrord running.",she="Leave your preferred date(s) and time and we'll get back to you with an invite asap.",ihe="e.g. Tuesday or Wednesday next week, 14:00-16:00 CET",ohe="Request session",ahe=({trigger:e,onSubmit:t,onScheduleRequest:n})=>{const[r,s]=y.useState(null),[i,o]=y.useState(""),[a,l]=y.useState(!0),[c,u]=y.useState(!1),[d,f]=y.useState(""),g=p=>{DT.has(p)?s(p):t(p,"")},h=r!==null&&DT.has(r);return _.jsx("div",{"data-testid":"operator-blocker-survey","data-trigger":e,className:"fixed bottom-4 right-4 z-50",children:a?_.jsxs("div",{className:"w-96 max-w-[calc(100vw-2rem)] rounded-xl border border-border bg-card shadow-xl overflow-hidden animate-survey-pop motion-reduce:animate-none",children:[_.jsxs("div",{className:"flex items-start justify-between gap-2 bg-primary px-4 py-3",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-semibold text-primary-foreground",children:c?nhe:Yfe}
483),_.jsx("p",{className:"text-xs text-primary-foreground/80",children:c?rhe:Qfe})]}),_.jsx("button",{onClick:()=>{l(!1)},"aria-label":"Minimize",className:"text-primary-foreground/80 hover:text-primary-foreground shrink-0 mt-0.5",children:_.jsx(oY,{className:"w-4 h-4"})})]}),_.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[!c&&_.jsxs(_.Fragment,{children:[qfe.map(p=>{const v=p.icon;return _.jsxs("button",{onClick:()=>{g(p.value)},className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors ${r===p.value?"border-primary bg-primary/10 text-foreground":"border-border text-foreground hover:border-primary hover:bg-primary/10"}`,children:[_.jsx("span",{className:"rounded-md bg-primary/15 p-1.5 text-primary shrink-0",children:_.jsx(v,{className:"w-3.5 h-3.5"})}),p.label]},p.value)}),h&&_.jsx("textarea",{value:i,onChange:p=>{o(p.target.value)},placeholder:Xfe,rows:2,className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm resize-none"}),h&&_.jsx("div",{className:"flex justify-end",children:_.jsx(Rt,{size:"sm",onClick:()=>{t(r,i.trim())},children:Jfe})}),_.jsx("div",{className:"border-t border-border pt-2",children:_.jsxs("button",{onClick:()=>{u(!0)},className:"flex w-full items-center gap-2.5 rounded-lg border border-border px-3 py-2 text-left text-sm text-foreground transition-colors hover:border-primary hover:bg-primary/10",children:[_.jsx("span",{className:"rounded-md bg-primary/15 p-1.5 text-primary shrink-0",children:_.jsx(tY,{className:"w-3.5 h-3.5"})}),the]})})]}),c&&_.jsxs(_.Fragment,{children:[_.jsx("p",{className:"text-sm text-foreground",children:she}),_.jsx("textarea",{value:d,onChange:p=>{f(p.target.value)},placeholder:ihe,rows:2,"aria-label":"Preferred date(s) and time",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm resize-none"}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx(Rt,{size:"sm",variant:"outline",onClick:()=>{u(!1)},children:Zfe}),_.jsx(Rt,{size:"sm",disabled:d.trim()==="",onClick:()=>{n(d.trim())},children:ohe})]})]})]})]}):_.jsxs("button",{onClick:()=>{l(!0)},className:"flex items-center gap-2 rounded-full bg-primary px-4 py-3 text-sm font-medium text-primary-foreground shadow-lg hover:bg-primary/90 transition-colors animate-survey-pop motion-reduce:animate-none",children:[_.jsx(bv,{className:"w-4 h-4"}),ehe]})})},Oy=e=>!dm(e)&&(e??[]).some(t=>um(t)&&t.revokedAt===null),lhe="<YOUR_API_KEY>",che="Share identity-level usage data with mirrord cloud",uhe="Gives your usage dashboard per-user detail (usernames, targets). Uncheck to keep telemetry anonymized.",dhe=2e3,fhe=5e3,hhe=6e5,phe="Install the Operator",ghe="Generate your operator API key, then install the operator in your cluster to start your free trial.",mhe="Operator connected â your API key was used.",vhe="Your API key â copy it now, it won't be shown again",yhe="For production, store the key in a Kubernetes secret and use",She="cloud.apiKey.keyRef",bhe="instead â see the API key section in Settings.",_he="Waiting for the operator to connect. The cluster has to pull the image and start the pod first.",whe="Not connected yet. Check the operator pod with",Ehe="kubectl get pods -n mirrord",Ahe=", then verify again.",Che="Couldn't reach mirrord cloud to check. Try verifying again in a moment.",xhe="Verify Installation",The="The cluster needs access to",Phe="analytics.metalbear.com",Rhe="and",khe="app.metalbear.com",Ohe=". Can't allow that?",Ihe="to get an air-gapped license.",Nhe="Can't install it yourself?",Lhe="Invite a colleague to your organization to install the operator.",Dhe="Invite sent to",MT=".",Mhe="Send invite",Uhe="Need help?",Fhe="Join our Slack community",$he="Back",jhe="Continue",Vhe="An organization admin must generate the API key and install the operator. Contact an admin to complete this step.",B
483he=({onNext:e,onBack:t})=>{var Be;const{accessToken:n,tenantId:r,canManageOrganization:s}=oi(),i=tu(),o=tl(),[a,l]=y.useState(!1),{data:c,isError:u}=Gs({...Hp(n),refetchInterval:ye=>!a&&Oy(ye.state.data)?fhe:!1}),{data:d}=Gs($6),f=z4(ude(n,i)),[g,h]=y.useState(null),[p,v]=y.useState(null),m=p??((Be=c==null?void 0:c.find(um))==null?void 0:Be.identityConsent)??!0,[S,b]=y.useState(null),[w,A]=y.useState(!1),[C,E]=y.useState(""),[x,R]=y.useState(!1),[T,P]=y.useState(!1),[I,U]=y.useState(null),L=K9("wizard-blocker-survey"),z=L===!0,[O,j]=y.useState(null),[N,V]=y.useState(!1),k=(c??[]).find(ye=>um(ye)&&ye.revokedAt===null),$=dm(c),M=Oy(c),B=u?{message:Che,alarming:!0}:M&&a?{message:_.jsxs(_.Fragment,{children:[whe," ",_.jsx("code",{className:"font-mono",children:Ehe}),Ahe]}),alarming:!0}:M?{message:_he,alarming:!1}:null,H=g??lhe,X=[{id:"helm_repo",label:"1. Add the Helm repository",cmd:dp.command.helmRepo},{id:"helm_install",label:"2. Install the operator with your API key",cmd:`helm install --set cloud.apiKey.key=${H} mirrord-operator metalbear/mirrord-operator`},{id:"kubectl_verify",label:"3. Verify it is running",cmd:dp.command.verify}],te=y.useCallback((ye,we,Ot)=>{navigator.clipboard.writeText(ye),o.capture("wizard_code_block_copied",{step:3,step_name:"install_operator",command:Ot}),b(we),setTimeout(()=>{b(null)},dhe)},[o]),Y=y.useCallback(()=>{o.capture("wizard_generate_api_key_clicked",{step:3}),f.mutate({identityConsent:m},{onSuccess:ye=>{h(ye.key)}})},[f,o,m]),ae=y.useCallback(ye=>{j(we=>N||!z?we:we??ye)},[N,z]),Ae=y.useCallback(async()=>{A(!0),o.capture("wizard_verify_operator_clicked",{step:3});try{await i.invalidateQueries({queryKey:Hp(n).queryKey});const ye=await i.fetchQuery(Hp(n)),we=dm(ye);o.capture("wizard_operator_verified",{step:3,success:we}),we||ae("verify_failed")}catch{ae("verify_failed")}finally{A(!1)}},[n,i,o,ae]),oe=y.useCallback(async()=>{const ye=C.trim();if(!(!ye||!d)){R(!0),U(null),o.capture("wizard_invite_colleague_clicked",{step:3});try{const we=await fetch(`${d.baseUrl}/identity/resources/users/v1`,{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json","frontegg-tenant-id":r},body:JSON.stringify({email:ye,skipInviteEmail:!1})});if(!we.ok){const Ot=await we.text();throw new Error(Ot||`Invite failed (${we.status})`)}P(!0)}catch(we){U(we instanceof Error?we.message:"Failed to invite colleague")}finally{R(!1)}}},[C,d,n,r,o]),K=k==null?void 0:k.id;y.useEffect(()=>{if(l(!1),!M)return;const ye=setTimeout(()=>{l(!0)},hhe);return()=>{clearTimeout(ye)}},[M,K]);const G=y.useRef(!1);y.useEffect(()=>{G.current||c===void 0||L===void 0||(G.current=!0,Oy(c)&&g===null&&ae("returned_stuck"))},[c,g,L,ae]);const Q=y.useRef(null);y.useEffect(()=>{O!==null&&(Q.current=O,o.capture("wizard_step3_blocker_shown",{step:3,step_name:"install_operator",trigger:O}))},[O,o]);const Z=y.useCallback(()=>{const ye=Q.current;ye!==null&&(Q.current=null,o.capture("wizard_step3_blocker_skipped",{step:3,step_name:"install_operator",trigger:ye}))},[o]);y.useEffect(()=>{$&&Z()},[$,Z]),y.useEffect(()=>()=>{Z()},[Z]);const ee=y.useCallback(ye=>{Q.current=null,V(!0),j(null),ye==="leaving"&&t()},[t]),ge=y.useCallback((ye,we,Ot)=>{o.capture("wizard_step3_blocker",{step:3,step_name:"install_operator",trigger:ye,reason:we,detail:Ot===""?void 0:Ot}),ee(ye)},[o,ee]),pe=y.useCallback((ye,we)=>{o.capture("wizard_step3_schedule_requested",{step:3,step_name:"install_operator",trigger:ye,preferred_datetime:we}),ee(ye)},[o,ee]),xe=y.useCallback(()=>{o.capture("wizard_continue_blocked_clicked",{step:3,step_name:"install_operator"}),!N&&z&&j(ye=>ye??"continue_blocked")},[o,N,z]),Le=y.useCallback(()=>{if(z&&!$&&!N&&O===null){j("leaving");return}Z(),t()},[z,$,N,O,Z,t]);return _.jsxs("div",{className:"flex flex-col gap-5 min-w-0",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:phe}),_.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:ghe})]}),_.jsx($o,{}),$?_.jsxs("div",{className:"flex items-center gap-2 p-3 bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900 rounded-md",children:[_.jsx(Jl,{className:"w-5 h-5 text-green-600 dark:text-green-400"}),_.jsx("span",{className:"text-sm text-green-700 dark:text-green-300 font-medium",children:mhe})]}):_.jsxs(_.Fragment,{children:[s?g!==null?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"rounded-md border border-primary/20 bg-primary/10 p-3 flex flex-col gap-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(yY,{className:"w-4 h-4 text-primary"}),_.jsx("span",{className:"text-sm font-medium text-foreground",children:vhe})]}),_.jsxs("div",{className:"flex items-center bg-gray-900 rounded-md overflow-hidden min-w-0",children:[_.jsx("code",{className:"flex-1 min-w-0 text-sm text-green-400 px-3 py-2.5 overflow-x-auto whitespace-nowrap scrollbar-hide",children:g}),_.jsx("button",{onClick:()=>{te(g,-1,"api_key")},className:"px-3 py-2.5 text-gray-400 hover:text-white transition-colors",title:"Copy to clipboard",children:S===-1?_.jsx(Jl,{className:"w-4 h-4 text-green-400"}):_.jsx(Gg,{className:"w-4 h-4"})})]})]}),_.jsxs("div",{className:"flex flex-col gap-3",children:[X.map((ye,we)=>_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:ye.label}),_.jsxs("div",{className:"flex items-center bg-gray-900 rounded-md overflow-hidden min-w-0",children:[_.jsx("code",{className:"flex-1 min-w-0 text-sm text-green-400 px-3 py-2.5 overflow-x-auto whitespace-nowrap scrollbar-hide",children:ye.cmd}),_.jsx("button",{onClick:()=>{te(ye.cmd,we,ye.id)},className:"px-3 py-2.5 text-gray-400 hover:text-white transition-colors",title:"Copy to clipboard",children:S===we?_.jsx(Jl,{className:"w-4 h-4 text-green-400"}):_.jsx(Gg,{className:"w-4 h-4"})})]})]},ye.label)),_.jsxs("p",{className:"text-xs text-muted-foreground",children:[yhe," ",_.jsx("code",{className:"font-mono",children:She})," ",bhe]})]})]}):_.jsxs("div",{className:"flex flex-col items-center gap-3 py-2",children:[_.jsx("p",{className:"text-sm text-muted-foreground text-center",children:k?"Your organization already has an API key, but it's only shown once. Regenerate to get a fresh one to install with.":"First, generate the API key the operator uses to authenticate."}),_.jsxs("label",{className:"flex max-w-md items-start gap-2 text-left",children:[_.jsx(b4,{className:"mt-0.5",checked:m,onCheckedChange:ye=>{v(ye===!0)}}),_.jsxs("span",{className:"text-xs text-muted-foreground",children:[_.jsx("span",{className:"font-medium text-foreground",children:che}),_.jsx("br",{}),uhe]})]}),_.jsxs(Rt,{size:"lg",onClick:Y,disabled:f.isPending,children:[f.isPending&&_.jsx(Qh,{className:"w-4 h-4 mr-2 animate-spin"}),k?"Regenerate API Key":"Generate API Key"]}),f.error&&_.jsx("p",{className:"text-xs text-destructive",children:f.error.message.replace(/^\d+:\s*/,"")})]}):_.jsxs("div",{className:"flex items-center gap-2 p-3 bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900 rounded-md",children:[_.jsx(py,{className:"w-5 h-5 text-amber-600 dar
483k:text-amber-400 shrink-0"}),_.jsx("span",{className:"text-sm text-amber-700 dark:text-amber-300",children:Vhe})]}),(g!==null||k!==void 0)&&_.jsxs("div",{className:"flex flex-col gap-2",children:[B&&_.jsxs("div",{className:`flex items-center gap-2 p-3 rounded-md ${B.alarming?"bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900":"bg-muted"}`,role:"status",children:[B.alarming?_.jsx(py,{className:"w-5 h-5 shrink-0 text-amber-600 dark:text-amber-400"}):_.jsx(Qh,{className:"w-4 h-4 shrink-0 animate-spin text-muted-foreground"}),_.jsx("span",{className:`text-sm ${B.alarming?"text-amber-700 dark:text-amber-300":"text-muted-foreground"}`,children:B.message})]}),_.jsxs(Rt,{variant:"outline",size:"lg",className:"w-full",onClick:()=>{Ae()},disabled:w,children:[w&&_.jsx(Qh,{className:"w-4 h-4 mr-2 animate-spin"}),xhe]})]})]}),O!==null&&!$&&_.jsx(ahe,{trigger:O,onSubmit:(ye,we)=>{ge(O,ye,we)},onScheduleRequest:ye=>{pe(O,ye)}}),_.jsx($o,{}),_.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted rounded-md",children:[_.jsx(py,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),_.jsxs("p",{className:"text-xs text-muted-foreground",children:[The," ",_.jsx("code",{className:"font-mono",children:Phe})," ",Rhe," ",_.jsx("code",{className:"font-mono",children:khe}),Ohe," ",_.jsxs("a",{href:dp.command.bookDemoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:[dp.bookDemo," ",_.jsx(D2,{className:"w-3 h-3"})]})," ",Ihe]})]}),s&&_.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-primary/10 border border-primary/20 rounded-md",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(EY,{className:"w-4 h-4 text-primary"}),_.jsx("span",{className:"text-sm font-medium text-foreground",children:Nhe})]}),_.jsx("p",{className:"text-xs text-muted-foreground",children:Lhe}),T?_.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300",children:[Dhe," ",C,MT]}):_.jsxs("div",{className:"flex gap-2",children:[_.jsx("input",{type:"email",value:C,onChange:ye=>{E(ye.target.value)},placeholder:"[email protected]",className:"flex-1 min-w-0 rounded-md border border-input bg-background px-3 py-2 text-sm"}),_.jsxs(Rt,{variant:"outline",size:"default",onClick:()=>{oe()},disabled:x||!C.trim(),children:[x&&_.jsx(Qh,{className:"w-4 h-4 mr-2 animate-spin"}),Mhe]})]}),I&&_.jsx("p",{className:"text-xs text-destructive",children:I})]}),_.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted rounded-md",children:[_.jsx(bv,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),_.jsxs("p",{className:"text-xs text-muted-foreground",children:[Uhe," ",_.jsx("a",{href:"https://metalbearcommunity.slack.com/ssb/redirect",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:Fhe}),MT]})]}),_.jsxs("div",{className:"flex gap-3",children:[_.jsx(Rt,{variant:"outline",size:"lg",className:"flex-1",onClick:Le,children:$he}),_.jsx(Rt,{variant:"default",size:"lg",className:`flex-1 ${$?"":"opacity-50 cursor-not-allowed"}`,"aria-disabled":!$,onClick:()=>{$?e():xe()},children:jhe})]})]})},zhe="/assets/favicon-SbX4jvUi.svg",Ghe="/assets/mirrord-for-teams-logo-dark-DjROFiQn.svg",Hhe="Welcome to mirrord for Teams",Whe="Let's get you set up in just a few steps.",Khe="Email",qhe="Name",Iy="*",Yhe="I'm using mirrord for",Qhe="Organization",Xhe="Continue",Jhe=[{value:"work",label:"Work",icon:_.jsx(Zq,{className:"w-5 h-5"})},{value:"hobby",label:"Hobby",icon:_.jsx(mY,{className:"w-5 h-5"})}],Zhe=({formState:e,onUpdate:t,onNext:n})=>{const r=e.userName.trim()!==""&&e.useCase!==void 0&&(e.useCase==="hobby"||e.organizationName.trim()!=="");return _.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"text-center",children:[_.jsx("img",{src:zhe,alt:"mirrord for Teams",className:"h-16 mx-auto mb-3 dark:hidden"}),_.jsx("img",{src:Ghe,alt:"mirrord for Teams",className:"hidden h-16 mx-auto mb-3 dark:block"}),_.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:Hhe}),_.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:Whe})]}),_.jsx($o,{}),_.jsxs("div",{className:"flex flex-col gap-4",children:[_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsx(zs,{htmlFor:"email",children:Khe}),_.jsx(Da,{id:"email",type:"email",value:e.email,disabled:!0,className:"bg-muted"})]}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsxs(zs,{htmlFor:"name",children:[qhe," ",_.jsx("span",{className:"text-destructive",children:Iy})]}),_.jsx(Da,{id:"name",type:"text",value:e.userName,onChange:s=>{t({userName:s.target.value})},placeholder:"Your full name"})]}),_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsxs(zs,{children:[Yhe," ",_.jsx("span",{className:"text-destructive",children:Iy})]}),_.jsx("div",{className:"flex gap-2",children:Jhe.map(s=>_.jsxs("button",{type:"button",onClick:()=>{t({useCase:s.value})},className:` 484 flex-1 flex flex-col items-center gap-1.5 px-3 py-3 rounded-md border transition-all 485 ${e.useCase===s.value?"border-primary bg-primary/15 text-primary font-medium":"border-border hover:border-muted-foreground text-muted-foreground"} 486 `,children:[s.icon,_.jsx("span",{className:"text-sm",children:s.label})]},s.value))})]}),e.useCase==="work"&&_.jsxs("div",{className:"flex flex-col gap-1.5",children:[_.jsxs(zs,{htmlFor:"org",children:[Qhe," ",_.jsx("span",{className:"text-destructive",children:Iy})]}),_.jsx(Da,{id:"org",type:"text",value:e.organizationName,onChange:s=>{t({organizationName:s.target.value})},placeholder:"Your company or team name"})]})]}),_.jsx(Rt,{size:"lg",className:"w-full",disabled:!r,onClick:n,children:Xhe})]})},epe={currentStep:1,completedSteps:[],orgCreated:!1,skippedInstall:!1,onboardingEventFired:!1}
486,tpe=["Welcome","About You","Install Operator","Install CLI","First Session"],npe=({currentStep:e,completedSteps:t,totalSteps:n})=>_.jsx("div",{className:"flex items-center justify-center w-full px-4 py-3",children:Array.from({length:n},(r,s)=>s+1).map(r=>{const s=t.includes(r),i=r===e,o=!s&&!i;return _.jsxs(me.Fragment,{children:[_.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[_.jsx("div",{className:` 487 flex items-center justify-center w-9 h-9 rounded-full text-sm font-semibold 488 transition-all duration-200 489 ${s?"bg-primary text-primary-foreground":""} 490 ${i?"bg-primary text-primary-foreground ring-2 ring-primary ring-offset-2 ring-offset-background":""} 491 ${o?"bg-muted text-muted-foreground":""} 492 `,children:s?_.jsx(Jl,{className:"w-4 h-4"}):r}),_.jsx("span",{className:`text-xs whitespace-nowrap ${i?"text-primary font-medium":"text-muted-foreground"}`,children:tpe[r-1]})]}),r<n&&_.jsx("div",{className:`flex-1 h-0.5 mx-2 mb-5 ${s?"bg-primary":"bg-muted"}`})]},r)})}),ua=3,fp=4,UT=5,rpe={1:"welcome",2:"about_you",3:"install_operator",4:"install_cli",5:"first_session"},FT=({onComplete:e,forcePreview:t,initialStep:n})=>{const{accessToken:r,name:s,email:i,tenantId:o}=oi(),a=tl(),l=tu(),c=n??1,[u,d]=y.useState(()=>({...epe,currentStep:c,completedSteps:Array.from({length:c-1},(E,x)=>x+1),orgCreated:c>=ua})),[f,g]=y.useState(()=>({userName:s,email:i,organizationName:""})),h=z4(gde(r,l));y.useEffect(()=>{a.capture("onboarding_viewed",{source:"wizard"})},[a]),y.useEffect(()=>{a.capture("wizard_step_viewed",{step:u.currentStep,step_name:rpe[u.currentStep]})},[u.currentStep,a]);const p=y.useCallback(E=>{g(x=>({...x,...E}))},[]),v=y.useCallback(E=>{d(x=>(E<x.currentStep&&a.capture("wizard_step_back",{from_step:x.currentStep,to_step:E}),{...x,currentStep:E}))},[a]),m=y.useCallback(E=>{d(x=>({...x,completedSteps:x.completedSteps.includes(E)?x.completedSteps:[...x.completedSteps,E]}))},[]),S=y.useCallback(()=>{m(1),a.capture("wizard_step_completed",{step:1,step_name:"welcome",use_case:f.useCase,organization_name:f.organizationName}),v(2)},[m,v,a,f.organizationName,f.useCase]),b=y.useCallback(async()=>{if(t){m(2),d(x=>({...x,orgCreated:!0})),v(ua);return}if(u.orgCreated){v(ua);return}const E={organizationName:f.useCase==="hobby"?`${f.userName.trim()}'s org`:f.organizationName.trim(),userName:f.userName.trim(),userFunction:f.userFunction,userFunctionOther:f.userFunctionOther===""?void 0:f.userFunctionOther,userHeardFrom:f.userHeardFrom,userHeardFromOther:f.userHeardFromOther===""?void 0:f.userHeardFromOther};try{await h.mutateAsync(E),Zde(i,f.userName.trim(),E.organizationName),a.group("organization",o,{name:f.organizationName}),f.phoneNumber&&a.setPersonProperties({phone_number:f.phoneNumber}),a.capture("wizard_step_completed",{step:2,step_name:"about_you",user_function:f.userFunction,heard_from:f.userHeardFrom,team_size:f.teamSize,ide_preference:f.idePreference,phone_number:f.phoneNumber}),u.onboardingEventFired||a.capture("onboarding_completed",{organization:f.organizationName,user_function:f.userFunction,heard_from:f.userHeardFrom,team_size:f.teamSize,ide_preference:f.idePreference,phone_number:f.phoneNumber,source:"wizard"}),m(2),d(x=>({...x,orgCreated:!0,onboardingEventFired:!0})),v(ua)}catch(x){const R=x instanceof Error?x.message:"Unknown error";ht.error(`Failed to create organization: ${R}`),a.capture("wizard_error",{step:2,step_name:"about_you",error:R})}},[t,f,h,a,o,i,m,v,u.orgCreated,u.onboardingEventFired]),w=y.useCallback(()=>{m(ua),a.capture("wizard_step_completed",{step:3,step_name:"install_operator",operator_installed:!0}),v(fp)},[m,v,a]),A=y.useCallback(()=>{m(fp),a.capture("wizard_step_completed",{step:4,step_name:"install_cli"}),v(UT)},[m,v,a]),C=y.useCallback(()=>{a.capture("wizard_completed",{ide_preference:f.idePreference,team_size:f.teamSize}),e()},[f.idePreference,f.teamSize,a,e]);return _.jsx(YK,{open:!0,children:_.jsx(x4,{className:"bg-background w-screen h-screen max-w-none max-h-screen p-0 sm:rounded-none [&>button:last-child]:hidden",onEscapeKeyDown:E=>
492E.preventDefault(),onPointerDownOutside:E=>E.preventDefault(),onInteractOutside:E=>E.preventDefault(),children:_.jsx("div",{className:"w-full h-full overflow-y-auto overflow-x-hidden",children:_.jsxs("div",{className:"w-full max-w-lg mx-auto min-w-0 px-6 py-10",children:[_.jsx(npe,{currentStep:u.currentStep,completedSteps:u.completedSteps,totalSteps:5}),_.jsxs("div",{className:"mt-4",children:[u.currentStep===1&&_.jsx(Zhe,{formState:f,onUpdate:p,onNext:S}),u.currentStep===2&&_.jsx(vfe,{formState:f,onUpdate:p,onNext:()=>{b()},onBack:()=>{v(1)},isSubmitting:h.isPending}),u.currentStep===ua&&_.jsx(Bhe,{onNext:w,onBack:()=>{v(2)}}),u.currentStep===fp&&_.jsx(Kfe,{onNext:A,onBack:()=>{v(ua)}}),u.currentStep===UT&&_.jsx(Mfe,{idePreference:f.idePreference,onFinish:C,onBack:()=>{v(fp)}})]})]})})})})},spe=3,ipe=4,ope="Couldn't load your account",ape="We could not reach the mirrord cloud to load your organization. This is usually temporary.",lpe="Try again",H6=me.createContext(void 0),cpe=({onRetry:e,retrying:t})=>_.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-background p-6",children:_.jsxs("div",{className:"flex max-w-md flex-col items-center gap-4 text-center",children:[_.jsx("span",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-destructive/10 text-destructive",children:_.jsx(hy,{className:"h-5 w-5"})}),_.jsxs("div",{className:"flex flex-col gap-1",children:[_.jsx("h1",{className:"text-lg font-semibold text-foreground",children:ope}),_.jsx("p",{className:"text-sm text-muted-foreground",children:ape})]}),_.jsxs(Rt,{size:"sm",onClick:e,disabled:t,className:"gap-1.5",children:[t?_.jsx(hy,{className:"h-4 w-4 animate-spin"}):_.jsx(hy,{className:"h-4 w-4"}),lpe]})]})}),W6=()=>{const e=y.useContext(H6);if(e===void 0)throw new Error("outside organization context");return e},upe=e=>{var R;const{accessToken:t}=oi(),n=tu(),[r,s]=y.useState(!1),i=Gs(xT(t)),{error:o,data:a}=i,l=a!=null,c=Gs({...Hp(t),enabled:l}),{data:u}=c,d=Gs({...U6(t),enabled:l}),{data:f}=d,g=((R=f==null?void 0:f[0])==null?void 0:R.fingerprint)??null,h=Gs({...hde(t,g??""),enabled:g!==null}),{data:p}=h,v=[i,c,d,h],m=v.some(T=>T.isError),[S,b]=y.useState(!1),w=()=>{b(!0),Promise.allSettled(v.filter(T=>T.isError).map(T=>T.refetch())).finally(()=>{b(!1)})};y.useEffect(()=>{o!==null&&ht.error(`Failed to fetch organization: ${o.message}`)},[o]),y.useEffect(()=>{a===null&&pde(t)},[a,t]);const A=()=>{s(!0),n.invalidateQueries({queryKey:xT(t).queryKey})};if(m)return _.jsx(cpe,{onRetry:w,retrying:S});if(a===void 0)return _.jsx(ds,{fixed:!0});if(!l)return r?_.jsx(ds,{fixed:!0}):_.jsx(FT,{onComplete:A,initialStep:1});if(u===void 0||f===void 0)return _.jsx(ds,{fixed:!0});if(g!==null&&p===void 0)return _.jsx(ds,{fixed:!0});const C=dm(u),E=(p==null?void 0:p.first_session_recorded)??!1;if(!r&&!E){const T=C?ipe:spe;return _.jsx(FT,{onComplete:A,initialStep:T})}return _.jsx(H6.Provider,{value:a.name,children:e.children})},dpe=Object.freeze(Object.defineProperty({__proto__:null,default:upe,useOrganizationName:W6},Symbol.toStringTag,{value:"Module"})),K6="theme",fpe="dark",q6=y.createContext(void 0);function hpe(){try{const e=localStorage.getItem(K6);return e==="dark"||e==="light"?e:null}catch{return null}}function ppe(){return hpe()??(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}const gpe=({children:e})=>{const[t,n]=y.useState(ppe);y.useEffect(()=>{document.documentElement.classList.toggle(fpe,t==="dark")},[t]);const r=y.useCallback(()=>{n(i=>{const o=i==="dark"?"light":"dark";try{localStorage.setItem(K6,o)}catch{}return o})},[]),s=y.useMemo(()=>({isDark:t==="dark",toggle:r}),[t,r]);return _.jsx(q6.Provider,{value:s,children:e})},Y6=()=>{const e=y.useContext(q6);if(e===void 0)throw new Error("outside theme context");return e},mpe="Docs",vpe="Book a Demo",$T="Switch to light mode",jT="Switch to dark mode",ype=()=>{const{isDark:e,toggle:t}=Y6();return _.jsx(Rt,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,"aria-label":e?$T:jT,title:e?$T:jT,children:e?_.jsx(UY,{size:16}):_.jsx(RY,{size:16})})},Q6=y.createContext(!1),Spe=({children:e})=>{const[t,n]=y.useState(!1);return y.useEffect(()=>{const r=window.matchMedia("(max-width: 1024px)");return n(r.matches),r.onchange=()=>{n(r.matches)},()=>{r.onchange=null}},[]),_.jsx(Q6.Provider,{value:t,children:e})},aE=()=>y.useContext(Q6),bpe=[{label:"Slack",url:"https://metalbearcommunity.slack.com/ssb/redirect",newCard:!0},{label:"GitHub",url:"https://github.com/metalbear-co/mirrord",newCard:!0}
492],_pe=({items:e})=>_.jsx("div",{className:"bg-popover text-popover-foreground rounded-lg border border-border shadow-lg py-1 min-w-[180px]",children:e.map(t=>"onClick"in t?_.jsx("button",{onClick:t.onClick,className:"flex w-full items-center px-4 py-2 text-sm hover:bg-accent transition-colors cursor-pointer",children:t.label},t.label):_.jsx("a",{href:t.url,target:t.newCard?"_blank":"_self",rel:"noreferrer",className:"flex items-center px-4 py-2 text-sm hover:bg-accent transition-colors cursor-pointer",children:t.label},t.label))}),VT=({icon:e,label:t,dropdownItems:n,isSmallScreen:r})=>{const[s,i]=y.useState(!1),o=y.useCallback(()=>{r&&i(!s)},[s,i,r]),a=y.useCallback(()=>{r||i(!0)},[r,i]),l=y.useCallback(()=>{r||i(!1)},[i,r]);return _.jsxs("div",{className:"relative",onMouseEnter:a,onMouseLeave:l,children:[_.jsxs(Rt,{variant:"ghost",size:"sm",className:"gap-2",onClick:o,children:[e,_.jsx("span",{className:"hidden sm:inline text-sm",children:t})]}),s&&_.jsx("div",{className:"absolute right-0 sm:right-auto pt-1 z-20",children:_.jsx(_pe,{items:n})})]})},X6=e=>e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2),wpe=()=>{const e=W6();return _.jsxs("div",{className:"flex items-center gap-2.5",children:[_.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-accent text-xs font-semibold text-accent-foreground",children:X6(e)}),_.jsx("span",{className:"text-sm font-semibold text-foreground",children:e})]})},Epe=({isNavBarOpen:e,handleNavbarToggle:t})=>{const n=aE(),{name:r,profilePicture:s}=oi(),i=()=>{Bo.AdminPortal.show()},{logoutUrl:o}=Bo.useAuthRoutes(),a=()=>{fm(),window.location.assign(o)},l=X6(r);return _.jsx("header",{className:"sticky top-0 z-10 flex h-14 items-center border-b border-border bg-card/90 px-4 backdrop-blur lg:px-8",children:_.jsxs("div",{className:"flex w-full items-center justify-between",children:[n&&_.jsx("button",{onClick:t,className:"text-foreground hover:text-foreground/70 transition-colors",children:_.jsx(CY,{size:24})}),!n&&_.jsx(wpe,{}),_.jsx("div",{className:"flex items-center gap-1",children:(n&&!e||!n)&&_.jsxs(_.Fragment,{children:[_.jsx(Rt,{variant:"ghost",size:"sm",asChild:!0,children:_.jsxs("a",{href:"https://metalbear.com/mirrord/docs/overview/introduction/",target:"_blank",rel:"noreferrer",className:"gap-2",children:[_.jsx(Xq,{size:16}),_.jsx("span",{className:"hidden md:inline text-sm",children:mpe})]})}),_.jsx(Rt,{variant:"ghost",size:"sm",asChild:!0,children:_.jsxs("a",{href:"https://meetings-eu1.hubspot.com/mirrord/mirrord-demo",target:"_blank",rel:"noreferrer",className:"gap-2",children:[_.jsx(rY,{size:16}),_.jsx("span",{className:"hidden md:inline text-sm",children:vpe})]})}),_.jsx(VT,{icon:_.jsx(W4,{size:16}),label:"Community",dropdownItems:bpe,isSmallScreen:n}),_.jsx(ype,{}),_.jsx($o,{orientation:"vertical",className:"h-6 mx-2"}),_.jsx(VT,{icon:s?_.jsx("img",{src:s,className:"h-7 w-7 rounded-full",alt:""}):_.jsx("div",{className:"h-7 w-7 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-medium",children:l}),label:r,dropdownItems:[{label:"My Account",onClick:i},{label:"Logout",onClick:a}],isSmallScreen:n})]})})]})})},Ape=e=>e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Cpe=1e3,xpe=60,Tpe=60,Ppe=24,Rpe=Cpe*xpe*Tpe*Ppe,kpe=" trial",Ope=" / ",Ipe="â",Fme=e=>`${e.usedSeats}${Ope}${e.maxSeats??Ipe}`,Npe=e=>e.validTo?Number(e.validTo)<=Date.now():!1,Lpe=e=>Math.max(0,Math.ceil((Number(e)-Date.now())/Rpe)),BT=e=>`${lde[e.licenseType]}${e.isTrial?kpe:""}`,Dpe=e=>(e.isTrial||e.licenseType==="free")&&e.billing===void 0,Mpe=/ trial$/,Upe=e=>`Your ${e} trial ends today.`,Fpe=(e,t)=>`Your ${e} trial ends in ${t===1?"1 day":`${t} days`}.`,$pe=(e,t)=>`Your ${e} license expired on ${t}.`,jpe="Your trial has ended, you are on the Free plan. Team features need a paid plan.",zT="Buy a license",Vpe="Upgrade",Bpe="Talk to us",zpe={honey:"border-brand-purple-dark/20 bg-brand-yellow text-brand-purple-dark",lavender:"border-brand-purple-dark/20 bg-brand-purple-medium text-brand-purple-dark",destructive:"border-destructive/30 bg-destructive/10 text-foreground"};function Gpe(e){if(e.licenseType==="free")return{tone:"lavender",message:jpe,action:Vpe};if(e.validTo===void 0)return null;const t=BT(e).replace(Mpe,"");if(Npe(e))return{tone:"destructive",message:$pe(BT(e),Ape(e.validTo)),action:zT};if(!e.isTrial)return null;const n=Lpe(e.validTo);return{tone:"honey",message:n===0?Upe(t):Fpe(t,n),action:zT}}const Hpe=()=>{const{accessToken:e,canManageOrganization:t}=oi(),{data:n}=Gs(U6(e)),r=n==null?void 0:n[0];if(r===void 0)return null;const s=Gpe(r);return s===null?null:_.jsxs("div",{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1 border-b px-6 py-2 text-sm font-medium ${zpe[s.tone]}`,children:[_.jsx("span",{children:s.message}),t&&Dpe(r)?_.jsx(qg,{to:`/billing/edit/${r.fingerprint}`,className:"underline underline-offset-2",children:s.action}):_.jsx(qg,{to:"/contact",className:"underline underline-offset-2",children:Bpe})]})},Wpe="Home",Kpe="Billing",qpe="Settings",Ype="Contact",Qpe="Oops, something went wrong...",Xpe="Try refreshing the page.",Jpe="If you see this again, you can report it to us on",Zpe="Slack",ege=me.lazy(()=>ni(()=>import("./General-kKRG0ThU.js"),__vite__mapDeps([0,1,2,3,4]))),tge=me.lazy(()=>ni(()=>import("./Settings-4DL0eS7Q.js"),__vite__mapDeps([5,3,4]))),nge=me.lazy(()=>ni(()=>import("./Contact-zSCXsox-.js"),__vite__mapDeps([6,3]))),rge=me.lazy(()=>ni(()=>import("./Billing-B-0T8ShJ.js"),__vite__mapDeps([7,8,1,3,2,9]))),sge=me.lazy(()=>ni(()=>import("./Invoices-BCZezDVN.js"),__vite__mapDeps([10,3,9,11]))),ige=me.lazy(()=>ni(()=>import("./Edit-DSSWWxx_.js"),__vite__mapDeps([12,8,1,3,11]))),oge=()=>{const{fingerprint:e}=gL(),{canManageOrganization:t}=oi();return!t||e===void 0?_.jsx(Kf,{to:"/billing"}):_.jsx(ige,{fingerprint:e})},age=me.lazy(()=>ni(()=>import("./CheckoutView-FLJoiwsM.js"),[])),lge=()=>{const[e]=aw(),t=e.get("_ptxn"),{canManageOrganization:n}=oi();return!n||t===null?_.jsx(Kf,{to:"/billing"}):_.jsx(age,{tx:t})},cge=me.lazy(()=>ni(()=>import("./UpdatePayment-BBsBs_e6.js"),[])),uge=()=>{const[e]=aw(),t=e.get("fingerprint"),{canManageOrganization:n}=oi();return!n||t===null?_.jsx(Kf,{to:"/billing"}):_.jsx(cge,{fingerprint:t})},dge=[{path:"/general",element:_.jsx(ege,{})},{path:"/billing",element:_.jsx(Tv,{}),children:[{path:"",element:_.jsx(rge,{})},{path:"/billing/invoices",element:_.jsx(sge,{})},{path:"/billing/edit/:fingerprint",element:_.jsx(oge,{})},{path:"/billing/checkout",element:_.jsx(lge,{})},{path:"/billing/update-payment",element:_.jsx(uge,{})}]},{path:"/settings",element:_.jsx(tge,{})},{path:"/contact",element:_.jsx(nge,{})},{path:"/*",element:_.jsx(Kf,{to:"/general"})}],fge={path:"/general",label:Wpe,icon:bY},hge=[{path:"/billing",label:Kpe,icon:hY},{path:"/settings",label:qpe,icon:IY}],pge=[{path:"/contact",label:Ype,icon:bv}],GT=({item:e,onNavigate:t})=>{const n=e.icon;return _.jsx("li",{children:_.jsxs(PL,{to:e.path,end:e.end??!1,onClick:t,className:({isActive:r})=>`flex h-9 items-center gap-2.5 rounded-lg px-3 text-sm font-medium transition-colors ${r?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/40 hover:text-foreground"}`,children:[_.jsx(n,{size:16,strokeWidth:1.75}),e.label]})})},gge=({isNavBarOpen:e,handleNavbarToggle:t})=>{const n=aE(),r=n?t:void 0,s=[fge,...hge];return _.jsx("aside",{className:`${e?"min-h-screen":"hidden"} fixed z-20 w-full bg-card lg:sticky lg:top-0 lg:h-screen lg:w-60`,children:_.jsxs("div",{className:"flex h-full w-full flex-col border-r border-border bg-card lg:w-60",children:[n&&_.jsx("div",{className:"flex justify-end p-4",children:_.jsx("button",{onClick:t,className:"text-muted-foreground transition-colors hover:text-foreground",children:_.jsx(zY,{size:24})})}),_.jsxs("div",{className:"flex h-14 items-center px-6",children:[_.jsx("img",{src:iJ,alt:"mirrord Logo",className:"h-7 dark:hidden"}),_.jsx("img",{src:sJ,alt:"mirrord Logo",className:"hidden h-7 dark:block"})]}),_.jsxs("nav",{className:"flex-1 px-3 pt-3",children:[_.jsx("ul",{className:"flex flex-col gap-0.5",children:s.map(i=>_.jsx(GT,{item:i,onNavigate:r},i.path))}),_.jsx("ul",{className:"mt-3 flex flex-col gap-0.5 border-t border-border pt-3",children:pge.map(i=>_.jsx(GT,{item:i,onNavigate:r},i.path))})]})]})})},mge=me.lazy(()=>ni(()=>Promise.resolve().then(()=>dpe),void 0)),vge=me.lazy(()=>ni(()=>import("./Claim-D3i6Kys8.js"),[])),yge=()=>_.jsx(xge,{children:_.jsx(kde,{children:_.jsxs(Rde,{children:[_.jsx(Gde,{}),_.jsx(Tv,{})]})})}),Sge=()=>_.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-6",children:_.jsx(y.Suspense,{fallback:_.jsx(ds,{fixed:!0}),children:_.jsx(vge,{})})}),bge=()=>{const e=aE(),{isDark:t}=Y6(),[n,r]=y.useState();y.useEffect(()=>{r(void 0)},[e]);const s=()=>{r(!n)};return _.jsx(mge,{children:_.jsx(zde,{children:_.jsxs("div",{className:"flex min-h-screen flex-row",children:[_.jsx(gge,{isNavBarOpen:n??!e,handleNavbarToggle:s}),_.jsxs("main",{className:"main flex min-h-screen min-w-0 flex-grow flex-col bg-background",children:[_.jsx(Epe,{isNavBarOpen:n??!e,handleNavbarToggle:s}),_.jsx(Hpe,{}),_.jsx("div",{className:"main-content mx-auto flex w-full max-w-7xl flex-grow flex-col px-6 py-6 lg:px-8 lg:py-8",children:_.jsx(y.Suspense,{fallback:_.jsx(ds,{fixed:!0}),children:_.jsx(Tv,{})})}),_.jsx(Kde,{})]}),_.jsx(rJ,{position:"top-center",autoClose:5e3,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!1,pauseOnHover:!0,theme:t?"dark":"light",transition:tJ})]})})})},J6=()=>_.jsxs("div",{className:"fixed top-0 left-0 w-screen h-screen flex flex-col gap-y-3 items-center justify-center text-xl font-semibold",children:[_.jsx("img",{src:dq,alt:"mirrord Logo",className:"h-80 w-80"}),_.jsx("p",{children:Qpe}),_.jsx("p",{children:Xpe}),_.jsxs("p",{children:[Jpe," ",_.jsx(Rt,{asChild:!0,children:_.jsx("a",{href:"https://metalbearcommunity.slack.com/ssb/redirect",target:"#blank",children:Zpe})})]})]}),_ge=()=>{const e=tw();return y.useEffect(()=>{jr.captureException(e instanceof Error?e:new Error(String(e)),{source:"router"})},[e]),_.jsx(J6,{})},wge=CL([{element:_.jsx(yge,{}),errorElement:_.jsx(_ge,{}),children:[{path:"/claim",element:_.jsx(Sge,{})},{element:_.jsx(bge,{}),children:dge}]}]),Ege=/^5\d\d:/,Age=new Cq({queryCache:new M4({onError:e=>{Ege.test(e.message)&&jr.captureException(e,{source:"query"})}}),mutationCache:new F4({onError:e=>{jr.captureException(e,{source:"mutation"})}}),defaultOptions:{queries:{staleTime:1/0}}}),Cge=()=>_.jsx(kq,{client:Age,children:_.jsx(Spe,{children:_.jsx(gpe,{children:_.jsx(TL,{router:wge})})})});class xge extends me.Component{constructor(t){super(t),this.state={error:null,errorInfo:null}}componentDidCatch(t,n){this.setState({error:t,errorInfo:n}),jr.captureException(t,{componentStack:n.componentStack}),console.error(`error=(${t.message}), stack=(${n.componentStack})`)}render(){return this.state.errorInfo?_.jsx(J6,{}):this.props.children}}const Tge=/([?&#]code=)[^&#]+/g,Pge=e=>typeof e=="string"?e.replace(Tge,"$1[redacted]"):e,Rge={api_host:"https://hog.metalbear.com",ui_host:"https://us.posthog.com",person_profiles:"identified_only",capture_exceptions:!0,sanitize_properties:e=>Object.fromEntries(Object.entries(e).map(([t,n])=>
492[t,Pge(n)])),loaded:e=>{e.register({app_commit:"f47f42933b0b39a3ae899f6188a58d1e6845cca5"})}};jr.init("phc_wIZh92nyk4vu6HidiLFUzjW6piZlZszuWZZFBS7yHHe",Rge);if(window.location.pathname===T1){const e=new URLSearchParams(window.location.search).get(bde);e!==null&&e!==""&&_de(e)}const Z6=document.getElementById("root");if(!Z6)throw Error("no element with id 'root' was found!");oS.createRoot(Z6).render(_.jsx(me.StrictMode,{children:_.jsx(H9,{client:jr,children:_.jsx(Cge,{})})}));export{lme as $,ome as A,UW as B,oY as C,FW as D,jW as E,b4 as F,ude as G,pme as H,mme as I,hme as J,yY as K,qg as L,WW as M,Mme as N,gme as O,ame as P,aw as Q,Rt as R,Dme as S,_v as T,YK as U,D2 as V,EY as W,zY as X,cme as Y,QW as Z,x4 as _,Gs as a,ume as a0,nq as a1,bv as a2,Da as a3,Npe as a4,ht as a5,zs as a6,Tme as a7,xme as a8,Xr as a9,hY as aA,wme as aB,je as aC,Go as aD,Cme as aE,bde as aF,Ime as aG,_de as aH,T1 as aI,Ede as aJ,jr as aK,Ume as aL,ofe as aM,Sme as aN,fm as aO,ji as aP,ti as aQ,me as aR,Dm as aS,Dpe as aa,Qh as ab,XK as ac,ZK as ad,JK as ae,BT as af,Fme as ag,Lpe as ah,al as ai,Eme as aj,Ame as ak,Pme as al,Rme as am,kme as an,fK as ao,hK as ap,mK as aq,vK as ar,pK as as,yK as at,Kf as au,Lme as av,Nme as aw,bme as ax,_me as ay,Ome as az,Hp as b,ct as c,Jl as d,Bo as e,W4 as f,hde as g,ni as h,W6 as i,_ as j,Y6 as k,yme as l,U6 as m,vme as n,dm as o,Gg as p,ds as q,y as r,tu as s,dme as t,oi as u,um as v,z4 as w,dp as x,$o as y,Ape as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.