dccxx-s3-explorer 1.0.96 → 1.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- (function(Or,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],d):(Or=typeof globalThis<"u"?globalThis:Or||self,d(Or.S3Explorer={},Or.jsxRuntime,Or.React,Or.ReactDOM))})(this,function(Or,d,M,iy){"use strict";function ay(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const x=ay(M),$s=ay(iy);/*! @azure/msal-common v15.13.0 2025-09-24 */const ge={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},ei={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},Oi={GET:"GET",POST:"POST"},Aa=[ge.OPENID_SCOPE,ge.PROFILE_SCOPE,ge.OFFLINE_ACCESS_SCOPE],sy=[...Aa,ge.EMAIL_SCOPE],In={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},cy={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},ti={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Al={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},fn={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},Xf={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},Il={QUERY:"query",FRAGMENT:"fragment"},uI={QUERY:"query"},ly={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},kl={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},Hs={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},hn={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Zf="appmetadata",fI="client_info",Nl="1",Pl={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},ir={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},pn={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},_t={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Bs={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},dy={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},Ia={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},eh={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Mi={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},hI={Pop:"pop"},uy=300;/*! @azure/msal-common v15.13.0 2025-09-24 */const Ol="unexpected_error",pI="post_request_failed";/*! @azure/msal-common v15.13.0 2025-09-24 */const fy={[Ol]:"Unexpected error in authentication.",[pI]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class At extends Error{constructor(e,n,r){const o=n?`${e}: ${n}`:e;super(o),Object.setPrototypeOf(this,At.prototype),this.errorCode=e||ge.EMPTY_STRING,this.errorMessage=n||ge.EMPTY_STRING,this.subError=r||ge.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function th(t,e){return new At(t,e?`${fy[t]} ${e}`:fy[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */const nh="client_info_decoding_error",hy="client_info_empty_error",rh="token_parsing_error",py="null_or_empty_token",So="endpoints_resolution_error",gy="network_error",my="openid_config_error",vy="hash_not_deserialized",ka="invalid_state",yy="state_mismatch",oh="state_not_found",wy="nonce_mismatch",ih="auth_time_not_found",by="max_age_transpired",gI="multiple_matching_tokens",mI="multiple_matching_accounts",Cy="multiple_matching_appMetadata",xy="request_cannot_be_made",_y="cannot_remove_empty_scope",Sy="cannot_append_scopeset",ah="empty_input_scopeset",vI="device_code_polling_cancelled",yI="device_code_expired",wI="device_code_unknown_error",sh="no_account_in_silent_request",Ty="invalid_cache_record",ch="invalid_cache_environment",lh="no_account_found",dh="no_crypto_object",bI="unexpected_credential_type",CI="invalid_assertion",xI="invalid_client_credential",ni="token_refresh_required",_I="user_timeout_reached",Ey="token_claims_cnf_required_for_signedjwt",Ay="authorization_code_missing_from_server_response",Iy="binding_key_not_removed",ky="end_session_endpoint_not_supported",uh="key_id_missing",SI="no_network_connectivity",TI="user_canceled",EI="missing_tenant_id_error",st="method_not_implemented",AI="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.13.0 2025-09-24 */const Ny={[nh]:"The client info could not be parsed/decoded correctly",[hy]:"The client info was empty",[rh]:"Token cannot be parsed",[py]:"The token is null or empty",[So]:"Endpoints cannot be resolved",[gy]:"Network request failed",[my]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[vy]:"The hash parameters could not be deserialized",[ka]:"State was not the expected format",[yy]:"State mismatch error",[oh]:"State not found",[wy]:"Nonce mismatch error",[ih]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[by]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[gI]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[mI]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Cy]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[xy]:"Token request cannot be made without authorization code or refresh token.",[_y]:"Cannot remove null or empty scope from ScopeSet",[Sy]:"Cannot append ScopeSet",[ah]:"Empty input ScopeSet cannot be processed",[vI]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[yI]:"Device code is expired.",[wI]:"Device code stopped polling for unknown reasons.",[sh]:"Please pass an account object, silent flow is not supported without account information",[Ty]:"Cache record object was null or undefined.",[ch]:"Invalid environment when attempting to create cache entry",[lh]:"No account found in cache for given key.",[dh]:"No crypto object detected.",[bI]:"Unexpected credential type.",[CI]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[xI]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[ni]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[_I]:"User defined timeout for device code polling reached",[Ey]:"Cannot generate a POP jwt if the token_claims are not populated",[Ay]:"Server response does not contain an authorization code to proceed",[Iy]:"Could not remove the credential's binding key from storage.",[ky]:"The provided authority does not support logout",[uh]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[SI]:"No network connectivity. Check your internet connection.",[TI]:"User cancelled the flow.",[EI]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[st]:"This method has not been implemented",[AI]:"The nested app auth bridge is disabled"};class fh extends At{constructor(e,n){super(e,n?`${Ny[e]}: ${n}`:Ny[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,fh.prototype)}}function _e(t,e){return new fh(t,e)}/*! @azure/msal-common v15.13.0 2025-09-24 */const Ml={createNewGuid:()=>{throw _e(st)},base64Decode:()=>{throw _e(st)},base64Encode:()=>{throw _e(st)},base64UrlEncode:()=>{throw _e(st)},encodeKid:()=>{throw _e(st)},async getPublicKeyThumbprint(){throw _e(st)},async removeTokenBindingKey(){throw _e(st)},async clearKeystore(){throw _e(st)},async signJwt(){throw _e(st)},async hashString(){throw _e(st)}};/*! @azure/msal-common v15.13.0 2025-09-24 */var Ut;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(Ut||(Ut={}));class ri{constructor(e,n,r){this.level=Ut.Info;const o=()=>{},a=e||ri.createDefaultLoggerOptions();this.localCallback=a.loggerCallback||o,this.piiLoggingEnabled=a.piiLoggingEnabled||!1,this.level=typeof a.logLevel=="number"?a.logLevel:Ut.Info,this.correlationId=a.correlationId||ge.EMPTY_STRING,this.packageName=n||ge.EMPTY_STRING,this.packageVersion=r||ge.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ut.Info}}clone(e,n,r){return new ri({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const a=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Ut[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,a,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:Ut.Error,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:Ut.Error,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:Ut.Warning,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:Ut.Warning,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:Ut.Info,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:Ut.Info,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:Ut.Verbose,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:Ut.Verbose,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:Ut.Trace,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:Ut.Trace,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Py="@azure/msal-common",hh="15.13.0";/*! @azure/msal-common v15.13.0 2025-09-24 */const ph={None:"none"};/*! @azure/msal-common v15.13.0 2025-09-24 */const Oy="redirect_uri_empty",II="claims_request_parsing_error",My="authority_uri_insecure",zs="url_parse_error",Dy="empty_url_error",Ry="empty_input_scopes_error",gh="invalid_claims",Ly="token_request_empty",Fy="logout_request_empty",kI="invalid_code_challenge_method",mh="pkce_params_missing",vh="invalid_cloud_discovery_metadata",Uy="invalid_authority_metadata",$y="untrusted_authority",Dl="missing_ssh_jwk",Hy="missing_ssh_kid",NI="missing_nonce_authentication_header",PI="invalid_authentication_header",By="cannot_set_OIDCOptions",zy="cannot_allow_platform_broker",Vy="authority_mismatch",Ky="invalid_request_method_for_EAR",Gy="invalid_authorize_post_body_parameters";/*! @azure/msal-common v15.13.0 2025-09-24 */const OI={[Oy]:"A redirect URI is required for all calls, and none has been set.",[II]:"Could not parse the given claims request object.",[My]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[zs]:"URL could not be parsed into appropriate segments.",[Dy]:"URL was empty or null.",[Ry]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[gh]:"Given claims parameter must be a stringified JSON object.",[Ly]:"Token request was empty and not found in cache.",[Fy]:"The logout request was null or undefined.",[kI]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[mh]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[vh]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Uy]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[$y]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Dl]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Hy]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[NI]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[PI]:"Invalid authentication header provided",[By]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[zy]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Vy]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[Gy]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[Ky]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST."};class yh extends At{constructor(e){super(e,OI[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,yh.prototype)}}function Nt(t){return new yh(t)}/*! @azure/msal-common v15.13.0 2025-09-24 */class ar{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),o=a=>decodeURIComponent(a.replace(/\+/g," "));return r.forEach(a=>{if(a.trim()){const[s,l]=a.split(/=(.+)/g,2);s&&l&&(n[o(s)]=o(l))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Xt{constructor(e){const n=e?ar.trimArrayEntries([...e]):[],r=n?ar.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw Nt(Ry);this.scopes=new Set,r.forEach(o=>this.scopes.add(o))}static fromString(e){const r=(e||ge.EMPTY_STRING).split(" ");return new Xt(r)}static createSearchScopes(e){const n=e&&e.length>0?e:[...Aa],r=new Xt(n);return r.containsOnlyOIDCScopes()?r.removeScope(ge.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new Xt(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return sy.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw _e(Sy)}}removeScope(e){if(!e)throw _e(_y);this.scopes.delete(e.trim())}removeOIDCScopes(){sy.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw _e(ah);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw _e(ah);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),o=this.getScopeCount();return n.size<o+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):ge.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.13.0 2025-09-24 */function jy(t,e){return!!t&&!!e&&t===e.split(".")[1]}function wh(t,e,n,r){if(r){const{oid:o,sub:a,tid:s,name:l,tfp:u,acr:h,preferred_username:p,upn:g,login_hint:w}=r,y=s||u||h||"";return{tenantId:y,localAccountId:o||a||"",name:l,username:p||g||"",loginHint:w,isHomeTenant:jy(y,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:jy(n,t)}}function bh(t,e,n,r){let o=t;if(e){const{isHomeTenant:a,...s}=e;o={...t,...s}}if(n){const{isHomeTenant:a,...s}=wh(t.homeAccountId,t.localAccountId,t.tenantId,n);return o={...o,...s,idTokenClaims:n,idToken:r},o}return o}/*! @azure/msal-common v15.13.0 2025-09-24 */function Na(t,e){const n=MI(t);try{const r=e(n);return JSON.parse(r)}catch{throw _e(rh)}}function MI(t){if(!t)throw _e(py);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw _e(rh);return n[2]}function Wy(t,e){if(e===0||Date.now()-3e5>t+e)throw _e(by)}/*! @azure/msal-common v15.13.0 2025-09-24 */function qy(t){if(!t)return t;let e=t.toLowerCase();return ar.endsWith(e,"?")?e=e.slice(0,-1):ar.endsWith(e,"?/")&&(e=e.slice(0,-2)),ar.endsWith(e,"/")||(e+="/"),e}function Yy(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function Rl(t){if(!t||t.indexOf("=")<0)return null;try{const e=Yy(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw _e(vy)}return null}function Vs(t,e=!0,n){const r=new Array;return t.forEach((o,a)=>{!e&&n&&a in n?r.push(`${a}=${o}`):r.push(`${a}=${encodeURIComponent(o)}`)}),r.join("&")}function Jy(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),r=n.origin+n.pathname+n.search;return qy(r)}catch{return qy(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class pt{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Nt(Dy);e.includes("#")||(this._urlString=pt.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return ar.endsWith(n,"?")?n=n.slice(0,-1):ar.endsWith(n,"?/")&&(n=n.slice(0,-2)),ar.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Nt(zs)}if(!e.HostNameAndPort||!e.PathSegments)throw Nt(zs);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Nt(My)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return pt.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===ti.COMMON||r[0]===ti.ORGANIZATIONS)&&(r[0]=e),pt.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw Nt(zs);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let o=r.AbsolutePath.split("/");return o=o.filter(a=>a&&a.length>0),r.PathSegments=o,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw Nt(zs);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===ge.FORWARD_SLASH){const o=new pt(n).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new pt(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!Rl(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Qy={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},Xy=Qy.endpointMetadata,Ch=Qy.instanceDiscoveryMetadata,Zy=new Set;Ch.metadata.forEach(t=>{t.aliases.forEach(e=>{Zy.add(e)})});function DI(t,e){var o;let n;const r=t.canonicalAuthority;if(r){const a=new pt(r).getUrlComponents().HostNameAndPort;n=ew(a,(o=t.cloudDiscoveryMetadata)==null?void 0:o.metadata,ir.CONFIG,e)||ew(a,Ch.metadata,ir.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function ew(t,e,n,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){const o=Ll(e,t);if(o)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),o.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function RI(t){return Ll(Ch.metadata,t)}function Ll(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v15.13.0 2025-09-24 */const Fl="cache_quota_exceeded",xh="cache_error_unknown";/*! @azure/msal-common v15.13.0 2025-09-24 */const _h={[Fl]:"Exceeded cache storage capacity.",[xh]:"Unexpected error occurred when using cache storage."};class Pa extends At{constructor(e,n){const r=n||(_h[e]?_h[e]:_h[xh]);super(`${e}: ${r}`),Object.setPrototypeOf(this,Pa.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Sh(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Pa(Fl):new Pa(t.name,t.message):new Pa(xh)}/*! @azure/msal-common v15.13.0 2025-09-24 */class Th{constructor(e,n,r,o,a){this.clientId=e,this.cryptoImpl=n,this.commonLogger=r.clone(Py,hh),this.staticAuthorityOptions=a,this.performanceClient=o}getAllAccounts(e,n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(o=>!o))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null"),null;const r=this.getAllAccounts(e,n);return r.length>1?r.sort(a=>a.idTokenClaims?-1:1)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?r[0].getAccountInfo():null}buildTenantProfiles(e,n,r){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,o,a){let s=null,l;if(a&&!this.tenantProfileMatchesFilter(r,a))return null;const u=this.getIdToken(e,o,n,r.tenantId);return u&&(l=Na(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,a))?null:(s=bh(e,r,l,u==null?void 0:u.secret),s)}getTenantProfilesFromAccountEntity(e,n,r,o){const a=e.getAccountInfo();let s=a.tenantProfiles||new Map;const l=this.getTokenKeys();if(r){const h=s.get(r);if(h)s=new Map([[r,h]]);else return[]}const u=[];return s.forEach(h=>{const p=this.getTenantedAccountInfoByFilter(a,l,h,n,o);p&&u.push(p)}),u}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r){var o;if(!e)throw _e(Ty);try{e.account&&await this.setAccount(e.account,n),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(a){throw(o=this.commonLogger)==null||o.error("CacheManager.saveCacheRecord: failed"),a instanceof At?a:Sh(a)}}async saveAccessToken(e,n){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),a=Xt.fromString(e.target);o.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,r,!1))return;const l=this.getAccessTokenCredential(s,n);l&&this.credentialMatchesFilter(l,r)&&Xt.fromString(l.target).intersectingScopeSets(a)&&this.removeAccessToken(s,n)}),await this.setAccessTokenCredential(e,n)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),o=[];return r.forEach(a=>{var h;const s=this.getAccount(a,n);if(!s||e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId)||e.username&&!this.matchUsername(s.username,e.username)||e.environment&&!this.matchEnvironment(s,e.environment)||e.realm&&!this.matchRealm(s,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;const l={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},u=(h=s.tenantProfiles)==null?void 0:h.filter(p=>this.tenantProfileMatchesFilter(p,l));u&&u.length===0||o.push(s)}),o}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===hn.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===_t.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){const n=this.getKeys(),r={};return n.forEach(o=>{if(!this.isAppMetadata(o))return;const a=this.getAppMetadata(o);a&&(e.environment&&!this.matchEnvironment(a,e.environment)||e.clientId&&!this.matchClientId(a,e.clientId)||(r[o]=a))}),r}getAuthorityMetadataByAlias(e){const n=this.getAuthorityMetadataKeys();let r=null;return n.forEach(o=>{if(!this.isAuthorityMetadata(o)||o.indexOf(this.clientId)===-1)return;const a=this.getAuthorityMetadata(o);a&&a.aliases.indexOf(e)!==-1&&(r=a)}),r}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),o=a=>a.includes(e.homeAccountId)&&a.includes(e.environment);r.filter(o).forEach(a=>{this.removeItem(a,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),o=a=>a.includes(e.homeAccountId)&&a.includes(e.environment);r.idToken.filter(o).forEach(a=>{this.removeIdToken(a,n)}),r.accessToken.filter(o).forEach(a=>{this.removeAccessToken(a,n)}),r.refreshToken.filter(o).forEach(a=>{this.removeRefreshToken(a,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!r||r.credentialType.toLowerCase()!==hn.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||r.tokenType!==_t.POP)return;const o=r.keyId;o&&this.cryptoImpl.removeTokenBindingKey(o).catch(()=>{var a;this.commonLogger.error(`Failed to remove token binding key ${o}`,n),(a=this.performanceClient)==null||a.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,o,a){this.commonLogger.trace("CacheManager - getIdToken called");const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hn.ID_TOKEN,clientId:this.clientId,realm:o},l=this.getIdTokensByFilter(s,n,r),u=l.size;if(u<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(u>1){let h=l;if(!o){const p=new Map;l.forEach((w,y)=>{w.realm===e.tenantId&&p.set(y,w)});const g=p.size;if(g<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),l.values().next().value;if(g===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),p.values().next().value;h=p}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),h.forEach((p,g)=>{this.removeIdToken(g,n)}),a&&n&&a.addFields({multiMatchedID:l.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),l.values().next().value}getIdTokensByFilter(e,n,r){const o=r&&r.idToken||this.getTokenKeys().idToken,a=new Map;return o.forEach(s=>{if(!this.idTokenKeyMatchesFilter(s,{clientId:this.clientId,...e}))return;const l=this.getIdTokenCredential(s,n);l&&this.credentialMatchesFilter(l,e)&&a.set(s,l)}),a}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,o){const a=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",a);const s=Xt.createSearchScopes(n.scopes),l=n.authenticationScheme||_t.BEARER,u=l.toLowerCase()!==_t.BEARER.toLowerCase()?hn.ACCESS_TOKEN_WITH_AUTH_SCHEME:hn.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:s,tokenType:l,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},p=r&&r.accessToken||this.getTokenKeys().accessToken,g=[];p.forEach(y=>{if(this.accessTokenKeyMatchesFilter(y,h,!0)){const C=this.getAccessTokenCredential(y,a);C&&this.credentialMatchesFilter(C,h)&&g.push(C)}});const w=g.length;return w<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",a),null):w>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",a),g.forEach(y=>{this.removeAccessToken(this.generateCredentialKey(y),a)}),this.performanceClient.addFields({multiMatchedAT:g.length},a),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",a),g[0])}accessTokenKeyMatchesFilter(e,n,r){const o=e.toLowerCase();if(n.clientId&&o.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&o.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&o.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&o.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){const a=n.target.asArray();for(let s=0;s<a.length;s++){if(r&&!o.includes(a[s].toLowerCase()))return!1;if(!r&&o.includes(a[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){const r=this.getTokenKeys(),o=[];return r.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,e,!0))return;const s=this.getAccessTokenCredential(a,n);s&&this.credentialMatchesFilter(s,e)&&o.push(s)}),o}getRefreshToken(e,n,r,o,a){this.commonLogger.trace("CacheManager - getRefreshToken called");const s=n?Nl:void 0,l={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hn.REFRESH_TOKEN,clientId:this.clientId,familyId:s},u=o&&o.refreshToken||this.getTokenKeys().refreshToken,h=[];u.forEach(g=>{if(this.refreshTokenKeyMatchesFilter(g,l)){const w=this.getRefreshTokenCredential(g,r);w&&this.credentialMatchesFilter(w,l)&&h.push(w)}});const p=h.length;return p<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(p>1&&a&&r&&a.addFields({multiMatchedRT:p},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),h[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const n={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(n),o=Object.keys(r).map(s=>r[s]),a=o.length;if(a<1)return null;if(a>1)throw _e(Cy);return o[0]}isAppMetadataFOCI(e){const n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===Nl)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){const o=DI(this.staticAuthorityOptions,this.commonLogger);if(o.includes(n)&&o.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(n);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==hn.ACCESS_TOKEN&&e.credentialType!==hn.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Xt.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(Zf)!==-1}isAuthorityMetadata(e){return e.indexOf(Pl.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Pl.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class LI extends Th{async setAccount(){throw _e(st)}getAccount(){throw _e(st)}async setIdTokenCredential(){throw _e(st)}getIdTokenCredential(){throw _e(st)}async setAccessTokenCredential(){throw _e(st)}getAccessTokenCredential(){throw _e(st)}async setRefreshTokenCredential(){throw _e(st)}getRefreshTokenCredential(){throw _e(st)}setAppMetadata(){throw _e(st)}getAppMetadata(){throw _e(st)}setServerTelemetry(){throw _e(st)}getServerTelemetry(){throw _e(st)}setAuthorityMetadata(){throw _e(st)}getAuthorityMetadata(){throw _e(st)}getAuthorityMetadataKeys(){throw _e(st)}setThrottlingCache(){throw _e(st)}getThrottlingCache(){throw _e(st)}removeItem(){throw _e(st)}getKeys(){throw _e(st)}getAccountKeys(){throw _e(st)}getTokenKeys(){throw _e(st)}generateCredentialKey(){throw _e(st)}generateAccountKey(){throw _e(st)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Bn={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.13.0 2025-09-24 */const $={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},FI={InProgress:1};/*! @azure/msal-common v15.13.0 2025-09-24 */class tw{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class nw{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:FI.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new tw}}startPerformanceMeasurement(){return new tw}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v15.13.0 2025-09-24 */const rw={tokenRenewalOffsetSeconds:uy,preventCorsPreflight:!1},UI={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ut.Info,correlationId:ge.EMPTY_STRING},$I={claimsBasedCachingEnabled:!1},HI={async sendGetRequestAsync(){throw _e(st)},async sendPostRequestAsync(){throw _e(st)}},BI={sku:ge.SKU,version:hh,cpu:ge.EMPTY_STRING,os:ge.EMPTY_STRING},zI={clientSecret:ge.EMPTY_STRING,clientAssertion:void 0},VI={azureCloudInstance:ph.None,tenant:`${ge.DEFAULT_COMMON_TENANT}`},KI={application:{appName:"",appVersion:""}};function GI({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:r,storageInterface:o,networkInterface:a,cryptoInterface:s,clientCredentials:l,libraryInfo:u,telemetry:h,serverTelemetryManager:p,persistencePlugin:g,serializableCache:w}){const y={...UI,...n};return{authOptions:jI(t),systemOptions:{...rw,...e},loggerOptions:y,cacheOptions:{...$I,...r},storageInterface:o||new LI(t.clientId,Ml,new ri(y),new nw),networkInterface:a||HI,cryptoInterface:s||Ml,clientCredentials:l||zI,libraryInfo:{...BI,...u},telemetry:{...KI,...h},serverTelemetryManager:p||null,persistencePlugin:g||null,serializableCache:w||null}}function jI(t){return{clientCapabilities:[],azureCloudOptions:VI,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function ow(t){return t.authOptions.authority.options.protocolMode===Bn.OIDC}/*! @azure/msal-common v15.13.0 2025-09-24 */const Mr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.13.0 2025-09-24 */function Ul(t,e){if(!t)throw _e(hy);try{const n=e(t);return JSON.parse(n)}catch{throw _e(nh)}}function Oa(t){if(!t)throw _e(nh);const e=t.split(Hs.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?ge.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Di="client_id",iw="redirect_uri",WI="response_type",qI="response_mode",YI="grant_type",JI="claims",QI="scope",XI="refresh_token",ZI="state",ek="nonce",tk="prompt",nk="code",rk="code_challenge",ok="code_challenge_method",ik="code_verifier",ak="client-request-id",sk="x-client-SKU",ck="x-client-VER",lk="x-client-OS",dk="x-client-CPU",uk="x-client-current-telemetry",fk="x-client-last-telemetry",hk="x-ms-lib-capability",pk="x-app-name",gk="x-app-ver",mk="post_logout_redirect_uri",vk="id_token_hint",yk="client_secret",wk="client_assertion",bk="client_assertion_type",aw="token_type",sw="req_cnf",cw="return_spa_code",Ck="nativebroker",xk="logout_hint",_k="sid",Sk="login_hint",Tk="domain_hint",Ek="x-client-xtra-sku",$l="brk_client_id",Hl="brk_redirect_uri",Eh="instance_aware",Ak="ear_jwk",Ik="ear_jwe_crypto";/*! @azure/msal-common v15.13.0 2025-09-24 */function Bl(t,e,n){if(!e)return;const r=t.get(Di);r&&t.has($l)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(iw)},e))}function Ah(t,e){t.set(WI,e)}function kk(t,e){t.set(qI,e||uI.QUERY)}function Nk(t){t.set(Ck,"1")}function Ih(t,e,n=!0,r=Aa){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const o=n?[...e||[],...r]:e||[],a=new Xt(o);t.set(QI,a.printScopes())}function kh(t,e){t.set(Di,e)}function Nh(t,e){t.set(iw,e)}function Pk(t,e){t.set(mk,e)}function Ok(t,e){t.set(vk,e)}function Mk(t,e){t.set(Tk,e)}function zl(t,e){t.set(Sk,e)}function Vl(t,e){t.set(In.CCS_HEADER,`UPN:${e}`)}function Ks(t,e){t.set(In.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function lw(t,e){t.set(_k,e)}function Ph(t,e,n){const r=$k(e,n);try{JSON.parse(r)}catch{throw Nt(gh)}t.set(JI,r)}function Oh(t,e){t.set(ak,e)}function Mh(t,e){t.set(sk,e.sku),t.set(ck,e.version),e.os&&t.set(lk,e.os),e.cpu&&t.set(dk,e.cpu)}function Dh(t,e){e!=null&&e.appName&&t.set(pk,e.appName),e!=null&&e.appVersion&&t.set(gk,e.appVersion)}function Dk(t,e){t.set(tk,e)}function dw(t,e){e&&t.set(ZI,e)}function Rk(t,e){t.set(ek,e)}function uw(t,e,n){if(e&&n)t.set(rk,e),t.set(ok,n);else throw Nt(mh)}function Lk(t,e){t.set(nk,e)}function Fk(t,e){t.set(XI,e)}function Uk(t,e){t.set(ik,e)}function fw(t,e){t.set(yk,e)}function hw(t,e){e&&t.set(wk,e)}function pw(t,e){e&&t.set(bk,e)}function gw(t,e){t.set(YI,e)}function Rh(t){t.set(fI,"1")}function mw(t){t.has(Eh)||t.set(Eh,"true")}function oi(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function $k(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw Nt(gh)}return e&&e.length>0&&(n.hasOwnProperty(Al.ACCESS_TOKEN)||(n[Al.ACCESS_TOKEN]={}),n[Al.ACCESS_TOKEN][Al.XMS_CC]={values:e}),JSON.stringify(n)}function Lh(t,e){e&&(t.set(aw,_t.POP),t.set(sw,e))}function vw(t,e){e&&(t.set(aw,_t.SSH),t.set(sw,e))}function yw(t,e){t.set(uk,e.generateCurrentRequestHeaderValue()),t.set(fk,e.generateLastRequestHeaderValue())}function ww(t){t.set(hk,Bs.X_MS_LIB_CAPABILITY_VALUE)}function Hk(t,e){t.set(xk,e)}function Kl(t,e,n){t.has($l)||t.set($l,e),t.has(Hl)||t.set(Hl,n)}function Bk(t,e){t.set(Ak,encodeURIComponent(e)),t.set(Ik,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function zk(t,e){Object.entries(e).forEach(([n,r])=>{r&&t.set(n,r)})}/*! @azure/msal-common v15.13.0 2025-09-24 */const Dr={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.13.0 2025-09-24 */function Vk(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.13.0 2025-09-24 */function Kk(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v15.13.0 2025-09-24 */function Gk(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v15.13.0 2025-09-24 */const sr=(t,e,n,r,o)=>(...a)=>{n.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const l=e+"CallCount";r==null||r.incrementFields({[l]:1},o)}try{const l=t(...a);return s==null||s.end({success:!0}),n.trace(`Returning result from ${e}`),l}catch(l){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(l))}catch{n.trace("Unable to print error message.")}throw s==null||s.end({success:!1},l),l}},he=(t,e,n,r,o)=>(...a)=>{n.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const l=e+"CallCount";r==null||r.incrementFields({[l]:1},o)}return r==null||r.setPreQueueTime(e,o),t(...a).then(l=>(n.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),l)).catch(l=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(l))}catch{n.trace("Unable to print error message.")}throw s==null||s.end({success:!1},l),l})};/*! @azure/msal-common v15.13.0 2025-09-24 */class Gl{constructor(e,n,r,o){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=o}async detectRegion(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)n.region_source=Ia.ENVIRONMENT_VARIABLE;else{const a=Gl.IMDS_OPTIONS;try{const s=await he(this.getRegionFromIMDS.bind(this),$.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(ge.IMDS_VERSION,a);if(s.status===ei.SUCCESS&&(r=s.body,n.region_source=Ia.IMDS),s.status===ei.BAD_REQUEST){const l=await he(this.getCurrentVersion.bind(this),$.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(a);if(!l)return n.region_source=Ia.FAILED_AUTO_DETECTION,null;const u=await he(this.getRegionFromIMDS.bind(this),$.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(l,a);u.status===ei.SUCCESS&&(r=u.body,n.region_source=Ia.IMDS)}}catch{return n.region_source=Ia.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=Ia.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${ge.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,ge.IMDS_TIMEOUT)}async getCurrentVersion(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement($.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${ge.IMDS_ENDPOINT}?format=json`,e);return r.status===ei.BAD_REQUEST&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}Gl.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.13.0 2025-09-24 */function zn(){return Math.round(new Date().getTime()/1e3)}function bw(t){return t.getTime()/1e3}function Ma(t){return t?new Date(Number(t)*1e3):new Date}function jl(t,e){const n=Number(t)||0;return zn()+e>n}function jk(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function Wk(t){return Number(t)>zn()}/*! @azure/msal-common v15.13.0 2025-09-24 */function Wl(t,e,n,r,o){return{credentialType:hn.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:o,lastUpdatedAt:Date.now().toString()}}function ql(t,e,n,r,o,a,s,l,u,h,p,g,w,y,C){var b,k;const v={homeAccountId:t,credentialType:hn.ACCESS_TOKEN,secret:n,cachedAt:zn().toString(),expiresOn:s.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:r,realm:o,target:a,tokenType:p||_t.BEARER,lastUpdatedAt:Date.now().toString()};if(g&&(v.userAssertionHash=g),h&&(v.refreshOn=h.toString()),y&&(v.requestedClaims=y,v.requestedClaimsHash=C),((b=v.tokenType)==null?void 0:b.toLowerCase())!==_t.BEARER.toLowerCase())switch(v.credentialType=hn.ACCESS_TOKEN_WITH_AUTH_SCHEME,v.tokenType){case _t.POP:const A=Na(n,u);if(!((k=A==null?void 0:A.cnf)!=null&&k.kid))throw _e(Ey);v.keyId=A.cnf.kid;break;case _t.SSH:v.keyId=w}return v}function Cw(t,e,n,r,o,a,s){const l={credentialType:hn.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return a&&(l.userAssertionHash=a),o&&(l.familyId=o),s&&(l.expiresOn=s.toString()),l}function Fh(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function xw(t){return t?Fh(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===hn.ACCESS_TOKEN||t.credentialType===hn.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function qk(t){return t?Fh(t)&&t.hasOwnProperty("realm")&&t.credentialType===hn.ID_TOKEN:!1}function _w(t){return t?Fh(t)&&t.credentialType===hn.REFRESH_TOKEN:!1}function Yk(t,e){const n=t.indexOf(pn.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function Jk(t,e){let n=!1;t&&(n=t.indexOf(Bs.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function Qk({environment:t,clientId:e}){return[Zf,t,e].join(Hs.CACHE_KEY_SEPARATOR).toLowerCase()}function Xk(t,e){return e?t.indexOf(Zf)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function Zk(t,e){return e?t.indexOf(Pl.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function Sw(){return zn()+Pl.REFRESH_TIME_SECONDS}function Yl(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function Uh(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function Tw(t){return t.expiresAt<=zn()}/*! @azure/msal-common v15.13.0 2025-09-24 */class bn{constructor(e,n,r,o,a,s,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=a,this.performanceClient=l,this.correlationId=s,this.managedIdentity=u||!1,this.regionDiscovery=new Gl(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(ge.CIAM_AUTH_URL))return Dr.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case ge.ADFS:return Dr.Adfs;case ge.DSTS:return Dr.Dsts}return Dr.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new pt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw _e(So)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw _e(So)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw _e(So)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw _e(ky);return this.replacePath(this.metadata.end_session_endpoint)}else throw _e(So)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw _e(So)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw _e(So)}canReplaceTenant(e){return e.PathSegments.length===1&&!bn.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Dr.Default&&this.protocolMode!==Bn.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const o=new pt(this.metadata.canonical_authority).getUrlComponents(),a=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let h=a[u];if(u===0&&this.canReplaceTenant(o)){const p=new pt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];h!==p&&(this.logger.verbose(`Replacing tenant domain name ${h} with id ${p}`),h=p)}l!==h&&(n=n.replace(`/${h}/`,`/${l}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Dr.Adfs||this.protocolMode===Bn.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),n=await he(this.updateCloudDiscoveryMetadata.bind(this),$.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await he(this.updateEndpointMetadata.bind(this),$.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(a=this.performanceClient)==null||a.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Sw(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==ir.CACHE&&(r==null?void 0:r.source)!==ir.CACHE&&(e.expiresAt=Sw(),e.canonical_authority=this.canonicalAuthority);const o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(o,e),this.metadata=e}async updateEndpointMetadata(e){var o,a,s;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityUpdateEndpointMetadata,this.correlationId);const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===ir.HARDCODED_VALUES&&(a=this.authorityOptions.azureRegionConfiguration)!=null&&a.azureRegion&&n.metadata){const l=await he(this.updateMetadataWithRegionalInformation.bind(this),$.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);Yl(e,l,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await he(this.getEndpointMetadataFromNetwork.bind(this),$.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await he(this.updateMetadataWithRegionalInformation.bind(this),$.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),Yl(e,r,!0),ir.NETWORK;throw _e(my,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),Yl(e,n,!1),{source:ir.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const o=this.getEndpointMetadataFromHardcodedValues();if(o)return Yl(e,o,!1),{source:ir.HARDCODED_VALUES,metadata:o};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=Tw(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:ir.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new pt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Nt(Uy)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{const o=await this.networkInterface.sendGetRequestAsync(n,e);return Vk(o.body)?o.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(o){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${o}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Xy?Xy[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,o,a;(r=this.performanceClient)==null||r.addQueueMeasurement($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const n=(o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.azureRegion;if(n){if(n!==ge.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=eh.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,bn.replaceWithRegionalInformation(e,n);const s=await he(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),$.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((a=this.authorityOptions.azureRegionConfiguration)==null?void 0:a.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=eh.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,bn.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=eh.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await he(this.getCloudDiscoveryMetadataFromNetwork.bind(this),$.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return Uh(e,r,!0),ir.NETWORK;throw Nt($y)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||ge.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||ge.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||ge.NOT_APPLICABLE}`);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Uh(e,n,!1),ir.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const o=RI(this.hostnameAndPort);if(o)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Uh(e,o,!1),ir.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=Tw(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),ir.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Dr.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=Ll(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Nt(vh)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${ge.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const a=await this.networkInterface.sendGetRequestAsync(e,n);let s,l;if(Kk(a.body))s=a.body,l=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(Gk(a.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${a.status}`),s=a.body,s.error===ge.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),l=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=Ll(l,this.hostnameAndPort)}catch(a){if(a instanceof At)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
1
+ (function(Or,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],d):(Or=typeof globalThis<"u"?globalThis:Or||self,d(Or.S3Explorer={},Or.jsxRuntime,Or.React,Or.ReactDOM))})(this,function(Or,d,M,iy){"use strict";function ay(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const x=ay(M),$s=ay(iy);/*! @azure/msal-common v15.13.0 2025-09-24 */const ge={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},ei={SUCCESS:200,SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR:400,CLIENT_ERROR_RANGE_START:400,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,REQUEST_TIMEOUT:408,GONE:410,TOO_MANY_REQUESTS:429,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR:500,SERVER_ERROR_RANGE_START:500,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,SERVER_ERROR_RANGE_END:599,MULTI_SIDED_ERROR:600},Oi={GET:"GET",POST:"POST"},Aa=[ge.OPENID_SCOPE,ge.PROFILE_SCOPE,ge.OFFLINE_ACCESS_SCOPE],sy=[...Aa,ge.EMAIL_SCOPE],In={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},cy={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},ti={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Al={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},fn={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},Xf={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},Il={QUERY:"query",FRAGMENT:"fragment"},uI={QUERY:"query"},ly={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},kl={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},Hs={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},hn={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Zf="appmetadata",fI="client_info",Nl="1",Pl={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},ir={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},pn={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},_t={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Bs={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},dy={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},Ia={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},eh={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Mi={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},hI={Pop:"pop"},uy=300;/*! @azure/msal-common v15.13.0 2025-09-24 */const Ol="unexpected_error",pI="post_request_failed";/*! @azure/msal-common v15.13.0 2025-09-24 */const fy={[Ol]:"Unexpected error in authentication.",[pI]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class At extends Error{constructor(e,n,r){const o=n?`${e}: ${n}`:e;super(o),Object.setPrototypeOf(this,At.prototype),this.errorCode=e||ge.EMPTY_STRING,this.errorMessage=n||ge.EMPTY_STRING,this.subError=r||ge.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function th(t,e){return new At(t,e?`${fy[t]} ${e}`:fy[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */const nh="client_info_decoding_error",hy="client_info_empty_error",rh="token_parsing_error",py="null_or_empty_token",So="endpoints_resolution_error",gy="network_error",my="openid_config_error",vy="hash_not_deserialized",ka="invalid_state",yy="state_mismatch",oh="state_not_found",wy="nonce_mismatch",ih="auth_time_not_found",by="max_age_transpired",gI="multiple_matching_tokens",mI="multiple_matching_accounts",Cy="multiple_matching_appMetadata",xy="request_cannot_be_made",_y="cannot_remove_empty_scope",Sy="cannot_append_scopeset",ah="empty_input_scopeset",vI="device_code_polling_cancelled",yI="device_code_expired",wI="device_code_unknown_error",sh="no_account_in_silent_request",Ty="invalid_cache_record",ch="invalid_cache_environment",lh="no_account_found",dh="no_crypto_object",bI="unexpected_credential_type",CI="invalid_assertion",xI="invalid_client_credential",ni="token_refresh_required",_I="user_timeout_reached",Ey="token_claims_cnf_required_for_signedjwt",Ay="authorization_code_missing_from_server_response",Iy="binding_key_not_removed",ky="end_session_endpoint_not_supported",uh="key_id_missing",SI="no_network_connectivity",TI="user_canceled",EI="missing_tenant_id_error",st="method_not_implemented",AI="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.13.0 2025-09-24 */const Ny={[nh]:"The client info could not be parsed/decoded correctly",[hy]:"The client info was empty",[rh]:"Token cannot be parsed",[py]:"The token is null or empty",[So]:"Endpoints cannot be resolved",[gy]:"Network request failed",[my]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[vy]:"The hash parameters could not be deserialized",[ka]:"State was not the expected format",[yy]:"State mismatch error",[oh]:"State not found",[wy]:"Nonce mismatch error",[ih]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[by]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[gI]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[mI]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Cy]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[xy]:"Token request cannot be made without authorization code or refresh token.",[_y]:"Cannot remove null or empty scope from ScopeSet",[Sy]:"Cannot append ScopeSet",[ah]:"Empty input ScopeSet cannot be processed",[vI]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[yI]:"Device code is expired.",[wI]:"Device code stopped polling for unknown reasons.",[sh]:"Please pass an account object, silent flow is not supported without account information",[Ty]:"Cache record object was null or undefined.",[ch]:"Invalid environment when attempting to create cache entry",[lh]:"No account found in cache for given key.",[dh]:"No crypto object detected.",[bI]:"Unexpected credential type.",[CI]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[xI]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[ni]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[_I]:"User defined timeout for device code polling reached",[Ey]:"Cannot generate a POP jwt if the token_claims are not populated",[Ay]:"Server response does not contain an authorization code to proceed",[Iy]:"Could not remove the credential's binding key from storage.",[ky]:"The provided authority does not support logout",[uh]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[SI]:"No network connectivity. Check your internet connection.",[TI]:"User cancelled the flow.",[EI]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[st]:"This method has not been implemented",[AI]:"The nested app auth bridge is disabled"};class fh extends At{constructor(e,n){super(e,n?`${Ny[e]}: ${n}`:Ny[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,fh.prototype)}}function _e(t,e){return new fh(t,e)}/*! @azure/msal-common v15.13.0 2025-09-24 */const Ml={createNewGuid:()=>{throw _e(st)},base64Decode:()=>{throw _e(st)},base64Encode:()=>{throw _e(st)},base64UrlEncode:()=>{throw _e(st)},encodeKid:()=>{throw _e(st)},async getPublicKeyThumbprint(){throw _e(st)},async removeTokenBindingKey(){throw _e(st)},async clearKeystore(){throw _e(st)},async signJwt(){throw _e(st)},async hashString(){throw _e(st)}};/*! @azure/msal-common v15.13.0 2025-09-24 */var Ut;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(Ut||(Ut={}));class ri{constructor(e,n,r){this.level=Ut.Info;const o=()=>{},a=e||ri.createDefaultLoggerOptions();this.localCallback=a.loggerCallback||o,this.piiLoggingEnabled=a.piiLoggingEnabled||!1,this.level=typeof a.logLevel=="number"?a.logLevel:Ut.Info,this.correlationId=a.correlationId||ge.EMPTY_STRING,this.packageName=n||ge.EMPTY_STRING,this.packageVersion=r||ge.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ut.Info}}clone(e,n,r){return new ri({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,n)}logMessage(e,n){if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const a=`${`[${new Date().toUTCString()}] : [${n.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Ut[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,a,n.containsPii||!1)}executeCallback(e,n,r){this.localCallback&&this.localCallback(e,n,r)}error(e,n){this.logMessage(e,{logLevel:Ut.Error,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}errorPii(e,n){this.logMessage(e,{logLevel:Ut.Error,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}warning(e,n){this.logMessage(e,{logLevel:Ut.Warning,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}warningPii(e,n){this.logMessage(e,{logLevel:Ut.Warning,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}info(e,n){this.logMessage(e,{logLevel:Ut.Info,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}infoPii(e,n){this.logMessage(e,{logLevel:Ut.Info,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}verbose(e,n){this.logMessage(e,{logLevel:Ut.Verbose,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}verbosePii(e,n){this.logMessage(e,{logLevel:Ut.Verbose,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}trace(e,n){this.logMessage(e,{logLevel:Ut.Trace,containsPii:!1,correlationId:n||ge.EMPTY_STRING})}tracePii(e,n){this.logMessage(e,{logLevel:Ut.Trace,containsPii:!0,correlationId:n||ge.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Py="@azure/msal-common",hh="15.13.0";/*! @azure/msal-common v15.13.0 2025-09-24 */const ph={None:"none"};/*! @azure/msal-common v15.13.0 2025-09-24 */const Oy="redirect_uri_empty",II="claims_request_parsing_error",My="authority_uri_insecure",zs="url_parse_error",Dy="empty_url_error",Ry="empty_input_scopes_error",gh="invalid_claims",Ly="token_request_empty",Fy="logout_request_empty",kI="invalid_code_challenge_method",mh="pkce_params_missing",vh="invalid_cloud_discovery_metadata",Uy="invalid_authority_metadata",$y="untrusted_authority",Dl="missing_ssh_jwk",Hy="missing_ssh_kid",NI="missing_nonce_authentication_header",PI="invalid_authentication_header",By="cannot_set_OIDCOptions",zy="cannot_allow_platform_broker",Vy="authority_mismatch",Ky="invalid_request_method_for_EAR",Gy="invalid_authorize_post_body_parameters";/*! @azure/msal-common v15.13.0 2025-09-24 */const OI={[Oy]:"A redirect URI is required for all calls, and none has been set.",[II]:"Could not parse the given claims request object.",[My]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[zs]:"URL could not be parsed into appropriate segments.",[Dy]:"URL was empty or null.",[Ry]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[gh]:"Given claims parameter must be a stringified JSON object.",[Ly]:"Token request was empty and not found in cache.",[Fy]:"The logout request was null or undefined.",[kI]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[mh]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[vh]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Uy]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[$y]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Dl]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[Hy]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[NI]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[PI]:"Invalid authentication header provided",[By]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[zy]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Vy]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",[Gy]:"Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",[Ky]:"Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST."};class yh extends At{constructor(e){super(e,OI[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,yh.prototype)}}function Nt(t){return new yh(t)}/*! @azure/msal-common v15.13.0 2025-09-24 */class ar{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},r=e.split("&"),o=a=>decodeURIComponent(a.replace(/\+/g," "));return r.forEach(a=>{if(a.trim()){const[s,l]=a.split(/=(.+)/g,2);s&&l&&(n[o(s)]=o(l))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Xt{constructor(e){const n=e?ar.trimArrayEntries([...e]):[],r=n?ar.removeEmptyStringsFromArray(n):[];if(!r||!r.length)throw Nt(Ry);this.scopes=new Set,r.forEach(o=>this.scopes.add(o))}static fromString(e){const r=(e||ge.EMPTY_STRING).split(" ");return new Xt(r)}static createSearchScopes(e){const n=e&&e.length>0?e:[...Aa],r=new Xt(n);return r.containsOnlyOIDCScopes()?r.removeScope(ge.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r}containsScope(e){const n=this.printScopesLowerCase().split(" "),r=new Xt(n);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return sy.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw _e(Sy)}}removeScope(e){if(!e)throw _e(_y);this.scopes.delete(e.trim())}removeOIDCScopes(){sy.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw _e(ah);const n=new Set;return e.scopes.forEach(r=>n.add(r.toLowerCase())),this.scopes.forEach(r=>n.add(r.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw _e(ah);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),r=e.getScopeCount(),o=this.getScopeCount();return n.size<o+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(n=>e.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):ge.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.13.0 2025-09-24 */function jy(t,e){return!!t&&!!e&&t===e.split(".")[1]}function wh(t,e,n,r){if(r){const{oid:o,sub:a,tid:s,name:l,tfp:u,acr:h,preferred_username:p,upn:g,login_hint:w}=r,y=s||u||h||"";return{tenantId:y,localAccountId:o||a||"",name:l,username:p||g||"",loginHint:w,isHomeTenant:jy(y,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:jy(n,t)}}function bh(t,e,n,r){let o=t;if(e){const{isHomeTenant:a,...s}=e;o={...t,...s}}if(n){const{isHomeTenant:a,...s}=wh(t.homeAccountId,t.localAccountId,t.tenantId,n);return o={...o,...s,idTokenClaims:n,idToken:r},o}return o}/*! @azure/msal-common v15.13.0 2025-09-24 */function Na(t,e){const n=MI(t);try{const r=e(n);return JSON.parse(r)}catch{throw _e(rh)}}function MI(t){if(!t)throw _e(py);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw _e(rh);return n[2]}function Wy(t,e){if(e===0||Date.now()-3e5>t+e)throw _e(by)}/*! @azure/msal-common v15.13.0 2025-09-24 */function qy(t){if(!t)return t;let e=t.toLowerCase();return ar.endsWith(e,"?")?e=e.slice(0,-1):ar.endsWith(e,"?/")&&(e=e.slice(0,-2)),ar.endsWith(e,"/")||(e+="/"),e}function Yy(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function Rl(t){if(!t||t.indexOf("=")<0)return null;try{const e=Yy(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw _e(vy)}return null}function Vs(t,e=!0,n){const r=new Array;return t.forEach((o,a)=>{!e&&n&&a in n?r.push(`${a}=${o}`):r.push(`${a}=${encodeURIComponent(o)}`)}),r.join("&")}function Jy(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),r=n.origin+n.pathname+n.search;return qy(r)}catch{return qy(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class pt{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Nt(Dy);e.includes("#")||(this._urlString=pt.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return ar.endsWith(n,"?")?n=n.slice(0,-1):ar.endsWith(n,"?/")&&(n=n.slice(0,-2)),ar.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Nt(zs)}if(!e.HostNameAndPort||!e.PathSegments)throw Nt(zs);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Nt(My)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return pt.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),r=n.PathSegments;return e&&r.length!==0&&(r[0]===ti.COMMON||r[0]===ti.ORGANIZATIONS)&&(r[0]=e),pt.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw Nt(zs);const r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let o=r.AbsolutePath.split("/");return o=o.filter(a=>a&&a.length>0),r.PathSegments=o,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(n);if(!r)throw Nt(zs);return r[2]}static getAbsoluteUrl(e,n){if(e[0]===ge.FORWARD_SLASH){const o=new pt(n).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new pt(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!Rl(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Qy={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},Xy=Qy.endpointMetadata,Ch=Qy.instanceDiscoveryMetadata,Zy=new Set;Ch.metadata.forEach(t=>{t.aliases.forEach(e=>{Zy.add(e)})});function DI(t,e){var o;let n;const r=t.canonicalAuthority;if(r){const a=new pt(r).getUrlComponents().HostNameAndPort;n=ew(a,(o=t.cloudDiscoveryMetadata)==null?void 0:o.metadata,ir.CONFIG,e)||ew(a,Ch.metadata,ir.HARDCODED_VALUES,e)||t.knownAuthorities}return n||[]}function ew(t,e,n,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${n}`),t&&e){const o=Ll(e,t);if(o)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${n}, returning aliases`),o.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${n}`)}return null}function RI(t){return Ll(Ch.metadata,t)}function Ll(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v15.13.0 2025-09-24 */const Fl="cache_quota_exceeded",xh="cache_error_unknown";/*! @azure/msal-common v15.13.0 2025-09-24 */const _h={[Fl]:"Exceeded cache storage capacity.",[xh]:"Unexpected error occurred when using cache storage."};class Pa extends At{constructor(e,n){const r=n||(_h[e]?_h[e]:_h[xh]);super(`${e}: ${r}`),Object.setPrototypeOf(this,Pa.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Sh(t){return t instanceof Error?t.name==="QuotaExceededError"||t.name==="NS_ERROR_DOM_QUOTA_REACHED"||t.message.includes("exceeded the quota")?new Pa(Fl):new Pa(t.name,t.message):new Pa(xh)}/*! @azure/msal-common v15.13.0 2025-09-24 */class Th{constructor(e,n,r,o,a){this.clientId=e,this.cryptoImpl=n,this.commonLogger=r.clone(Py,hh),this.staticAuthorityOptions=a,this.performanceClient=o}getAllAccounts(e,n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){if(Object.keys(e).length===0||Object.values(e).every(o=>!o))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null"),null;const r=this.getAllAccounts(e,n);return r.length>1?r.sort(a=>a.idTokenClaims?-1:1)[0]:r.length===1?r[0]:null}getBaseAccountInfo(e,n){const r=this.getAccountsFilteredBy(e,n);return r.length>0?r[0].getAccountInfo():null}buildTenantProfiles(e,n,r){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,n,r==null?void 0:r.tenantId,r))}getTenantedAccountInfoByFilter(e,n,r,o,a){let s=null,l;if(a&&!this.tenantProfileMatchesFilter(r,a))return null;const u=this.getIdToken(e,o,n,r.tenantId);return u&&(l=Na(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,a))?null:(s=bh(e,r,l,u==null?void 0:u.secret),s)}getTenantProfilesFromAccountEntity(e,n,r,o){const a=e.getAccountInfo();let s=a.tenantProfiles||new Map;const l=this.getTokenKeys();if(r){const h=s.get(r);if(h)s=new Map([[r,h]]);else return[]}const u=[];return s.forEach(h=>{const p=this.getTenantedAccountInfoByFilter(a,l,h,n,o);p&&u.push(p)}),u}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,r){var o;if(!e)throw _e(Ty);try{e.account&&await this.setAccount(e.account,n),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,n),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,n),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(a){throw(o=this.commonLogger)==null||o.error("CacheManager.saveCacheRecord: failed"),a instanceof At?a:Sh(a)}}async saveAccessToken(e,n){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),a=Xt.fromString(e.target);o.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,r,!1))return;const l=this.getAccessTokenCredential(s,n);l&&this.credentialMatchesFilter(l,r)&&Xt.fromString(l.target).intersectingScopeSets(a)&&this.removeAccessToken(s,n)}),await this.setAccessTokenCredential(e,n)}getAccountsFilteredBy(e,n){const r=this.getAccountKeys(),o=[];return r.forEach(a=>{var h;const s=this.getAccount(a,n);if(!s||e.homeAccountId&&!this.matchHomeAccountId(s,e.homeAccountId)||e.username&&!this.matchUsername(s.username,e.username)||e.environment&&!this.matchEnvironment(s,e.environment)||e.realm&&!this.matchRealm(s,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(s,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(s,e.authorityType))return;const l={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},u=(h=s.tenantProfiles)==null?void 0:h.filter(p=>this.tenantProfileMatchesFilter(p,l));u&&u.length===0||o.push(s)}),o}credentialMatchesFilter(e,n){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||(n.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==n.requestedClaimsHash||e.credentialType===hn.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===_t.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e){const n=this.getKeys(),r={};return n.forEach(o=>{if(!this.isAppMetadata(o))return;const a=this.getAppMetadata(o);a&&(e.environment&&!this.matchEnvironment(a,e.environment)||e.clientId&&!this.matchClientId(a,e.clientId)||(r[o]=a))}),r}getAuthorityMetadataByAlias(e){const n=this.getAuthorityMetadataKeys();let r=null;return n.forEach(o=>{if(!this.isAuthorityMetadata(o)||o.indexOf(this.clientId)===-1)return;const a=this.getAuthorityMetadata(o);a&&a.aliases.indexOf(e)!==-1&&(r=a)}),r}removeAllAccounts(e){this.getAllAccounts({},e).forEach(r=>{this.removeAccount(r,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const r=this.getAccountKeys(),o=a=>a.includes(e.homeAccountId)&&a.includes(e.environment);r.filter(o).forEach(a=>{this.removeItem(a,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const r=this.getTokenKeys(),o=a=>a.includes(e.homeAccountId)&&a.includes(e.environment);r.idToken.filter(o).forEach(a=>{this.removeIdToken(a,n)}),r.accessToken.filter(o).forEach(a=>{this.removeAccessToken(a,n)}),r.refreshToken.filter(o).forEach(a=>{this.removeRefreshToken(a,n)})}removeAccessToken(e,n){const r=this.getAccessTokenCredential(e,n);if(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),!r||r.credentialType.toLowerCase()!==hn.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()||r.tokenType!==_t.POP)return;const o=r.keyId;o&&this.cryptoImpl.removeTokenBindingKey(o).catch(()=>{var a;this.commonLogger.error(`Failed to remove token binding key ${o}`,n),(a=this.performanceClient)==null||a.incrementFields({removeTokenBindingKeyFailure:1},n)})}removeAppMetadata(e){return this.getKeys().forEach(r=>{this.isAppMetadata(r)&&this.removeItem(r,e)}),!0}getIdToken(e,n,r,o,a){this.commonLogger.trace("CacheManager - getIdToken called");const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hn.ID_TOKEN,clientId:this.clientId,realm:o},l=this.getIdTokensByFilter(s,n,r),u=l.size;if(u<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(u>1){let h=l;if(!o){const p=new Map;l.forEach((w,y)=>{w.realm===e.tenantId&&p.set(y,w)});const g=p.size;if(g<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),l.values().next().value;if(g===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),p.values().next().value;h=p}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),h.forEach((p,g)=>{this.removeIdToken(g,n)}),a&&n&&a.addFields({multiMatchedID:l.size},n),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),l.values().next().value}getIdTokensByFilter(e,n,r){const o=r&&r.idToken||this.getTokenKeys().idToken,a=new Map;return o.forEach(s=>{if(!this.idTokenKeyMatchesFilter(s,{clientId:this.clientId,...e}))return;const l=this.getIdTokenCredential(s,n);l&&this.credentialMatchesFilter(l,e)&&a.set(s,l)}),a}idTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,r,o){const a=n.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",a);const s=Xt.createSearchScopes(n.scopes),l=n.authenticationScheme||_t.BEARER,u=l.toLowerCase()!==_t.BEARER.toLowerCase()?hn.ACCESS_TOKEN_WITH_AUTH_SCHEME:hn.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:s,tokenType:l,keyId:n.sshKid,requestedClaimsHash:n.requestedClaimsHash},p=r&&r.accessToken||this.getTokenKeys().accessToken,g=[];p.forEach(y=>{if(this.accessTokenKeyMatchesFilter(y,h,!0)){const C=this.getAccessTokenCredential(y,a);C&&this.credentialMatchesFilter(C,h)&&g.push(C)}});const w=g.length;return w<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",a),null):w>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",a),g.forEach(y=>{this.removeAccessToken(this.generateCredentialKey(y),a)}),this.performanceClient.addFields({multiMatchedAT:g.length},a),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",a),g[0])}accessTokenKeyMatchesFilter(e,n,r){const o=e.toLowerCase();if(n.clientId&&o.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&o.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&o.indexOf(n.realm.toLowerCase())===-1||n.requestedClaimsHash&&o.indexOf(n.requestedClaimsHash.toLowerCase())===-1)return!1;if(n.target){const a=n.target.asArray();for(let s=0;s<a.length;s++){if(r&&!o.includes(a[s].toLowerCase()))return!1;if(!r&&o.includes(a[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,n){const r=this.getTokenKeys(),o=[];return r.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,e,!0))return;const s=this.getAccessTokenCredential(a,n);s&&this.credentialMatchesFilter(s,e)&&o.push(s)}),o}getRefreshToken(e,n,r,o,a){this.commonLogger.trace("CacheManager - getRefreshToken called");const s=n?Nl:void 0,l={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:hn.REFRESH_TOKEN,clientId:this.clientId,familyId:s},u=o&&o.refreshToken||this.getTokenKeys().refreshToken,h=[];u.forEach(g=>{if(this.refreshTokenKeyMatchesFilter(g,l)){const w=this.getRefreshTokenCredential(g,r);w&&this.credentialMatchesFilter(w,l)&&h.push(w)}});const p=h.length;return p<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(p>1&&a&&r&&a.addFields({multiMatchedRT:p},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),h[0])}refreshTokenKeyMatchesFilter(e,n){const r=e.toLowerCase();return!(n.familyId&&r.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&r.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&r.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const n={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(n),o=Object.keys(r).map(s=>r[s]),a=o.length;if(a<1)return null;if(a>1)throw _e(Cy);return o[0]}isAppMetadataFOCI(e){const n=this.readAppMetadataFromCache(e);return!!(n&&n.familyId===Nl)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const r=e.oid||e.sub;return n===r}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){var r;return n.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,n){return!!(e&&typeof e=="string"&&(n==null?void 0:n.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n){if(this.staticAuthorityOptions){const o=DI(this.staticAuthorityOptions,this.commonLogger);if(o.includes(n)&&o.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(n);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==hn.ACCESS_TOKEN&&e.credentialType!==hn.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Xt.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(Zf)!==-1}isAuthorityMetadata(e){return e.indexOf(Pl.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Pl.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,n){for(const r in n)e[r]=n[r];return e}}class LI extends Th{async setAccount(){throw _e(st)}getAccount(){throw _e(st)}async setIdTokenCredential(){throw _e(st)}getIdTokenCredential(){throw _e(st)}async setAccessTokenCredential(){throw _e(st)}getAccessTokenCredential(){throw _e(st)}async setRefreshTokenCredential(){throw _e(st)}getRefreshTokenCredential(){throw _e(st)}setAppMetadata(){throw _e(st)}getAppMetadata(){throw _e(st)}setServerTelemetry(){throw _e(st)}getServerTelemetry(){throw _e(st)}setAuthorityMetadata(){throw _e(st)}getAuthorityMetadata(){throw _e(st)}getAuthorityMetadataKeys(){throw _e(st)}setThrottlingCache(){throw _e(st)}getThrottlingCache(){throw _e(st)}removeItem(){throw _e(st)}getKeys(){throw _e(st)}getAccountKeys(){throw _e(st)}getTokenKeys(){throw _e(st)}generateCredentialKey(){throw _e(st)}generateAccountKey(){throw _e(st)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Hn={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.13.0 2025-09-24 */const $={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},FI={InProgress:1};/*! @azure/msal-common v15.13.0 2025-09-24 */class tw{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class nw{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:FI.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""},measurement:new tw}}startPerformanceMeasurement(){return new tw}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-common v15.13.0 2025-09-24 */const rw={tokenRenewalOffsetSeconds:uy,preventCorsPreflight:!1},UI={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ut.Info,correlationId:ge.EMPTY_STRING},$I={claimsBasedCachingEnabled:!1},HI={async sendGetRequestAsync(){throw _e(st)},async sendPostRequestAsync(){throw _e(st)}},BI={sku:ge.SKU,version:hh,cpu:ge.EMPTY_STRING,os:ge.EMPTY_STRING},zI={clientSecret:ge.EMPTY_STRING,clientAssertion:void 0},VI={azureCloudInstance:ph.None,tenant:`${ge.DEFAULT_COMMON_TENANT}`},KI={application:{appName:"",appVersion:""}};function GI({authOptions:t,systemOptions:e,loggerOptions:n,cacheOptions:r,storageInterface:o,networkInterface:a,cryptoInterface:s,clientCredentials:l,libraryInfo:u,telemetry:h,serverTelemetryManager:p,persistencePlugin:g,serializableCache:w}){const y={...UI,...n};return{authOptions:jI(t),systemOptions:{...rw,...e},loggerOptions:y,cacheOptions:{...$I,...r},storageInterface:o||new LI(t.clientId,Ml,new ri(y),new nw),networkInterface:a||HI,cryptoInterface:s||Ml,clientCredentials:l||zI,libraryInfo:{...BI,...u},telemetry:{...KI,...h},serverTelemetryManager:p||null,persistencePlugin:g||null,serializableCache:w||null}}function jI(t){return{clientCapabilities:[],azureCloudOptions:VI,skipAuthorityMetadataCache:!1,instanceAware:!1,encodeExtraQueryParams:!1,...t}}function ow(t){return t.authOptions.authority.options.protocolMode===Hn.OIDC}/*! @azure/msal-common v15.13.0 2025-09-24 */const Mr={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.13.0 2025-09-24 */function Ul(t,e){if(!t)throw _e(hy);try{const n=e(t);return JSON.parse(n)}catch{throw _e(nh)}}function Oa(t){if(!t)throw _e(nh);const e=t.split(Hs.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?ge.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Di="client_id",iw="redirect_uri",WI="response_type",qI="response_mode",YI="grant_type",JI="claims",QI="scope",XI="refresh_token",ZI="state",ek="nonce",tk="prompt",nk="code",rk="code_challenge",ok="code_challenge_method",ik="code_verifier",ak="client-request-id",sk="x-client-SKU",ck="x-client-VER",lk="x-client-OS",dk="x-client-CPU",uk="x-client-current-telemetry",fk="x-client-last-telemetry",hk="x-ms-lib-capability",pk="x-app-name",gk="x-app-ver",mk="post_logout_redirect_uri",vk="id_token_hint",yk="client_secret",wk="client_assertion",bk="client_assertion_type",aw="token_type",sw="req_cnf",cw="return_spa_code",Ck="nativebroker",xk="logout_hint",_k="sid",Sk="login_hint",Tk="domain_hint",Ek="x-client-xtra-sku",$l="brk_client_id",Hl="brk_redirect_uri",Eh="instance_aware",Ak="ear_jwk",Ik="ear_jwe_crypto";/*! @azure/msal-common v15.13.0 2025-09-24 */function Bl(t,e,n){if(!e)return;const r=t.get(Di);r&&t.has($l)&&(n==null||n.addFields({embeddedClientId:r,embeddedRedirectUri:t.get(iw)},e))}function Ah(t,e){t.set(WI,e)}function kk(t,e){t.set(qI,e||uI.QUERY)}function Nk(t){t.set(Ck,"1")}function Ih(t,e,n=!0,r=Aa){n&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const o=n?[...e||[],...r]:e||[],a=new Xt(o);t.set(QI,a.printScopes())}function kh(t,e){t.set(Di,e)}function Nh(t,e){t.set(iw,e)}function Pk(t,e){t.set(mk,e)}function Ok(t,e){t.set(vk,e)}function Mk(t,e){t.set(Tk,e)}function zl(t,e){t.set(Sk,e)}function Vl(t,e){t.set(In.CCS_HEADER,`UPN:${e}`)}function Ks(t,e){t.set(In.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function lw(t,e){t.set(_k,e)}function Ph(t,e,n){const r=$k(e,n);try{JSON.parse(r)}catch{throw Nt(gh)}t.set(JI,r)}function Oh(t,e){t.set(ak,e)}function Mh(t,e){t.set(sk,e.sku),t.set(ck,e.version),e.os&&t.set(lk,e.os),e.cpu&&t.set(dk,e.cpu)}function Dh(t,e){e!=null&&e.appName&&t.set(pk,e.appName),e!=null&&e.appVersion&&t.set(gk,e.appVersion)}function Dk(t,e){t.set(tk,e)}function dw(t,e){e&&t.set(ZI,e)}function Rk(t,e){t.set(ek,e)}function uw(t,e,n){if(e&&n)t.set(rk,e),t.set(ok,n);else throw Nt(mh)}function Lk(t,e){t.set(nk,e)}function Fk(t,e){t.set(XI,e)}function Uk(t,e){t.set(ik,e)}function fw(t,e){t.set(yk,e)}function hw(t,e){e&&t.set(wk,e)}function pw(t,e){e&&t.set(bk,e)}function gw(t,e){t.set(YI,e)}function Rh(t){t.set(fI,"1")}function mw(t){t.has(Eh)||t.set(Eh,"true")}function oi(t,e){Object.entries(e).forEach(([n,r])=>{!t.has(n)&&r&&t.set(n,r)})}function $k(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw Nt(gh)}return e&&e.length>0&&(n.hasOwnProperty(Al.ACCESS_TOKEN)||(n[Al.ACCESS_TOKEN]={}),n[Al.ACCESS_TOKEN][Al.XMS_CC]={values:e}),JSON.stringify(n)}function Lh(t,e){e&&(t.set(aw,_t.POP),t.set(sw,e))}function vw(t,e){e&&(t.set(aw,_t.SSH),t.set(sw,e))}function yw(t,e){t.set(uk,e.generateCurrentRequestHeaderValue()),t.set(fk,e.generateLastRequestHeaderValue())}function ww(t){t.set(hk,Bs.X_MS_LIB_CAPABILITY_VALUE)}function Hk(t,e){t.set(xk,e)}function Kl(t,e,n){t.has($l)||t.set($l,e),t.has(Hl)||t.set(Hl,n)}function Bk(t,e){t.set(Ak,encodeURIComponent(e)),t.set(Ik,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function zk(t,e){Object.entries(e).forEach(([n,r])=>{r&&t.set(n,r)})}/*! @azure/msal-common v15.13.0 2025-09-24 */const Dr={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.13.0 2025-09-24 */function Vk(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.13.0 2025-09-24 */function Kk(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}/*! @azure/msal-common v15.13.0 2025-09-24 */function Gk(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}/*! @azure/msal-common v15.13.0 2025-09-24 */const sr=(t,e,n,r,o)=>(...a)=>{n.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const l=e+"CallCount";r==null||r.incrementFields({[l]:1},o)}try{const l=t(...a);return s==null||s.end({success:!0}),n.trace(`Returning result from ${e}`),l}catch(l){n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(l))}catch{n.trace("Unable to print error message.")}throw s==null||s.end({success:!1},l),l}},he=(t,e,n,r,o)=>(...a)=>{n.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const l=e+"CallCount";r==null||r.incrementFields({[l]:1},o)}return r==null||r.setPreQueueTime(e,o),t(...a).then(l=>(n.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),l)).catch(l=>{n.trace(`Error occurred in ${e}`);try{n.trace(JSON.stringify(l))}catch{n.trace("Unable to print error message.")}throw s==null||s.end({success:!1},l),l})};/*! @azure/msal-common v15.13.0 2025-09-24 */class Gl{constructor(e,n,r,o){this.networkInterface=e,this.logger=n,this.performanceClient=r,this.correlationId=o}async detectRegion(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)n.region_source=Ia.ENVIRONMENT_VARIABLE;else{const a=Gl.IMDS_OPTIONS;try{const s=await he(this.getRegionFromIMDS.bind(this),$.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(ge.IMDS_VERSION,a);if(s.status===ei.SUCCESS&&(r=s.body,n.region_source=Ia.IMDS),s.status===ei.BAD_REQUEST){const l=await he(this.getCurrentVersion.bind(this),$.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(a);if(!l)return n.region_source=Ia.FAILED_AUTO_DETECTION,null;const u=await he(this.getRegionFromIMDS.bind(this),$.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(l,a);u.status===ei.SUCCESS&&(r=u.body,n.region_source=Ia.IMDS)}}catch{return n.region_source=Ia.FAILED_AUTO_DETECTION,null}}return r||(n.region_source=Ia.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,n){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement($.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${ge.IMDS_ENDPOINT}?api-version=${e}&format=text`,n,ge.IMDS_TIMEOUT)}async getCurrentVersion(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement($.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${ge.IMDS_ENDPOINT}?format=json`,e);return r.status===ei.BAD_REQUEST&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}Gl.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.13.0 2025-09-24 */function Bn(){return Math.round(new Date().getTime()/1e3)}function bw(t){return t.getTime()/1e3}function Ma(t){return t?new Date(Number(t)*1e3):new Date}function jl(t,e){const n=Number(t)||0;return Bn()+e>n}function jk(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function Wk(t){return Number(t)>Bn()}/*! @azure/msal-common v15.13.0 2025-09-24 */function Wl(t,e,n,r,o){return{credentialType:hn.ID_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,realm:o,lastUpdatedAt:Date.now().toString()}}function ql(t,e,n,r,o,a,s,l,u,h,p,g,w,y,C){var b,k;const v={homeAccountId:t,credentialType:hn.ACCESS_TOKEN,secret:n,cachedAt:Bn().toString(),expiresOn:s.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:r,realm:o,target:a,tokenType:p||_t.BEARER,lastUpdatedAt:Date.now().toString()};if(g&&(v.userAssertionHash=g),h&&(v.refreshOn=h.toString()),y&&(v.requestedClaims=y,v.requestedClaimsHash=C),((b=v.tokenType)==null?void 0:b.toLowerCase())!==_t.BEARER.toLowerCase())switch(v.credentialType=hn.ACCESS_TOKEN_WITH_AUTH_SCHEME,v.tokenType){case _t.POP:const A=Na(n,u);if(!((k=A==null?void 0:A.cnf)!=null&&k.kid))throw _e(Ey);v.keyId=A.cnf.kid;break;case _t.SSH:v.keyId=w}return v}function Cw(t,e,n,r,o,a,s){const l={credentialType:hn.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:r,secret:n,lastUpdatedAt:Date.now().toString()};return a&&(l.userAssertionHash=a),o&&(l.familyId=o),s&&(l.expiresOn=s.toString()),l}function Fh(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function xw(t){return t?Fh(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===hn.ACCESS_TOKEN||t.credentialType===hn.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function qk(t){return t?Fh(t)&&t.hasOwnProperty("realm")&&t.credentialType===hn.ID_TOKEN:!1}function _w(t){return t?Fh(t)&&t.credentialType===hn.REFRESH_TOKEN:!1}function Yk(t,e){const n=t.indexOf(pn.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&r}function Jk(t,e){let n=!1;t&&(n=t.indexOf(Bs.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),n&&r}function Qk({environment:t,clientId:e}){return[Zf,t,e].join(Hs.CACHE_KEY_SEPARATOR).toLowerCase()}function Xk(t,e){return e?t.indexOf(Zf)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function Zk(t,e){return e?t.indexOf(Pl.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function Sw(){return Bn()+Pl.REFRESH_TIME_SECONDS}function Yl(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function Uh(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function Tw(t){return t.expiresAt<=Bn()}/*! @azure/msal-common v15.13.0 2025-09-24 */class bn{constructor(e,n,r,o,a,s,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=r,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=a,this.performanceClient=l,this.correlationId=s,this.managedIdentity=u||!1,this.regionDiscovery=new Gl(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(ge.CIAM_AUTH_URL))return Dr.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case ge.ADFS:return Dr.Adfs;case ge.DSTS:return Dr.Dsts}return Dr.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new pt(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw _e(So)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw _e(So)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw _e(So)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw _e(ky);return this.replacePath(this.metadata.end_session_endpoint)}else throw _e(So)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw _e(So)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw _e(So)}canReplaceTenant(e){return e.PathSegments.length===1&&!bn.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Dr.Default&&this.protocolMode!==Hn.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const o=new pt(this.metadata.canonical_authority).getUrlComponents(),a=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let h=a[u];if(u===0&&this.canReplaceTenant(o)){const p=new pt(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];h!==p&&(this.logger.verbose(`Replacing tenant domain name ${h} with id ${p}`),h=p)}l!==h&&(n=n.replace(`/${h}/`,`/${l}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Dr.Adfs||this.protocolMode===Hn.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),n=await he(this.updateCloudDiscoveryMetadata.bind(this),$.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await he(this.updateEndpointMetadata.bind(this),$.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:r}),(a=this.performanceClient)==null||a.addFields({cloudDiscoverySource:n,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Sw(),jwks_uri:""}),e}updateCachedMetadata(e,n,r){n!==ir.CACHE&&(r==null?void 0:r.source)!==ir.CACHE&&(e.expiresAt=Sw(),e.canonical_authority=this.canonicalAuthority);const o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(o,e),this.metadata=e}async updateEndpointMetadata(e){var o,a,s;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityUpdateEndpointMetadata,this.correlationId);const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===ir.HARDCODED_VALUES&&(a=this.authorityOptions.azureRegionConfiguration)!=null&&a.azureRegion&&n.metadata){const l=await he(this.updateMetadataWithRegionalInformation.bind(this),$.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(n.metadata);Yl(e,l,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let r=await he(this.getEndpointMetadataFromNetwork.bind(this),$.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await he(this.updateMetadataWithRegionalInformation.bind(this),$.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),Yl(e,r,!0),ir.NETWORK;throw _e(my,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("Found endpoint metadata in authority configuration"),Yl(e,n,!1),{source:ir.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const o=this.getEndpointMetadataFromHardcodedValues();if(o)return Yl(e,o,!1),{source:ir.HARDCODED_VALUES,metadata:o};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=Tw(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:ir.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new pt(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Nt(Uy)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement($.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${n}`);try{const o=await this.networkInterface.sendGetRequestAsync(n,e);return Vk(o.body)?o.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(o){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${o}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Xy?Xy[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,o,a;(r=this.performanceClient)==null||r.addQueueMeasurement($.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const n=(o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.azureRegion;if(n){if(n!==ge.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=eh.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,bn.replaceWithRegionalInformation(e,n);const s=await he(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),$.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((a=this.authorityOptions.azureRegionConfiguration)==null?void 0:a.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=eh.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,bn.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=eh.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const r=await he(this.getCloudDiscoveryMetadataFromNetwork.bind(this),$.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return Uh(e,r,!0),ir.NETWORK;throw Nt($y)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||ge.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||ge.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||ge.NOT_APPLICABLE}`);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Uh(e,n,!1),ir.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const o=RI(this.hostnameAndPort);if(o)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Uh(e,o,!1),ir.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=Tw(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),ir.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Dr.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=Ll(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),n)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),n;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Nt(vh)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${ge.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let r=null;try{const a=await this.networkInterface.sendGetRequestAsync(e,n);let s,l;if(Kk(a.body))s=a.body,l=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(Gk(a.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${a.status}`),s=a.body,s.error===ge.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),l=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=Ll(l,this.hostnameAndPort)}catch(a){if(a instanceof At)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
2
2
  Error: ${a.errorCode}
3
3
  Error Description: ${a.errorMessage}`);else{const s=a;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
4
4
  Error: ${s.name}
5
- Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&pt.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==ph.None){const o=n.tenant?n.tenant:ge.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return ge.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw _e(So)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Zy.has(e)}static isPublicCloudAuthority(e){return ge.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const o=new pt(e);o.validateAsUri();const a=o.getUrlComponents();let s=`${n}.${a.HostNameAndPort}`;this.isPublicCloudAuthority(a.HostNameAndPort)&&(s=`${n}.${ge.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const l=pt.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${l}?${r}`:l}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=bn.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=bn.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=bn.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const o=new pt(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(ge.CIAM_AUTH_URL)){const a=o.HostNameAndPort.split(".")[0];n=`${n}${a}${ge.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}bn.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ti.COMMON,ti.CONSUMERS,ti.ORGANIZATIONS]);function eN(t){var o;const r=(o=new pt(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case ti.COMMON:case ti.ORGANIZATIONS:case ti.CONSUMERS:return;default:return r}}function Ew(t){return t.endsWith(ge.FORWARD_SLASH)?t:`${t}${ge.FORWARD_SLASH}`}function tN(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw Nt(vh)}return{canonicalAuthority:t.authority?Ew(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v15.13.0 2025-09-24 */async function Aw(t,e,n,r,o,a,s){s==null||s.addQueueMeasurement($.AuthorityFactoryCreateDiscoveredInstance,a);const l=bn.transformCIAMAuthority(Ew(t)),u=new bn(l,e,n,r,o,a,s);try{return await he(u.resolveEndpointsAsync.bind(u),$.AuthorityResolveEndpointsAsync,o,s,a)(),u}catch{throw _e(So)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Ri extends At{constructor(e,n,r,o,a){super(e,n,r),this.name="ServerError",this.errorNo=o,this.status=a,Object.setPrototypeOf(this,Ri.prototype)}}/*! @azure/msal-common v15.13.0 2025-09-24 */function Jl(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class ro{static generateThrottlingStorageKey(e){return`${Bs.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var s;const o=ro.generateThrottlingStorageKey(n),a=e.getThrottlingCache(o);if(a){if(a.throttleTime<Date.now()){e.removeItem(o,r);return}throw new Ri(((s=a.errorCodes)==null?void 0:s.join(" "))||ge.EMPTY_STRING,a.errorMessage,a.subError)}}static postProcess(e,n,r,o){if(ro.checkResponseStatus(r)||ro.checkResponseForRetryAfter(r)){const a={throttleTime:ro.calculateThrottleTime(parseInt(r.headers[In.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(ro.generateThrottlingStorageKey(n),a,o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(In.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||Bs.DEFAULT_THROTTLE_TIME_SECONDS),r+Bs.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,o){const a=Jl(n,r,o),s=this.generateThrottlingStorageKey(a);e.removeItem(s,r.correlationId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Ql extends At{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,Ql.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Gs(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new Ql(t,e,n)}/*! @azure/msal-common v15.13.0 2025-09-24 */class $h{constructor(e,n){this.config=GI(e),this.logger=new ri(this.config.loggerOptions,Py,hh),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[In.CONTENT_TYPE]=ge.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Mr.HOME_ACCOUNT_ID:try{const r=Oa(e.credential);n[In.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Mr.UPN:n[In.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,o,a,s){var u;s&&((u=this.performanceClient)==null||u.addQueueMeasurement(s,a));const l=await this.sendPostRequest(o,e,{body:n,headers:r},a);return this.config.serverTelemetryManager&&l.status<500&&l.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),l}async sendPostRequest(e,n,r,o){var s,l,u;ro.preProcess(this.cacheManager,e,o);let a;try{a=await he(this.networkClient.sendPostRequestAsync.bind(this.networkClient),$.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(n,r);const h=a.headers||{};(l=this.performanceClient)==null||l.addFields({refreshTokenSize:((s=a.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:h[In.X_MS_HTTP_VERSION]||"",requestId:h[In.X_MS_REQUEST_ID]||""},o)}catch(h){if(h instanceof Ql){const p=h.responseHeaders;throw p&&((u=this.performanceClient)==null||u.addFields({httpVerToken:p[In.X_MS_HTTP_VERSION]||"",requestId:p[In.X_MS_REQUEST_ID]||"",contentTypeHeader:p[In.CONTENT_TYPE]||void 0,contentLengthHeader:p[In.CONTENT_LENGTH]||void 0,httpStatus:h.httpStatus},o)),h.error}throw h instanceof At?h:_e(gy)}return ro.postProcess(this.cacheManager,e,a,o),a}async updateAuthority(e,n){var a;(a=this.performanceClient)==null||a.addQueueMeasurement($.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,o=await Aw(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const n=new Map;return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&oi(n,e.tokenQueryParameters),Oh(n,e.correlationId),Bl(n,e.correlationId,this.performanceClient),Vs(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */function Iw(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v15.13.0 2025-09-24 */class Rr{getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,loginHint:this.loginHint,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e])),dataBoundary:this.dataBoundary}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,r){var h,p,g,w,y,C,v;const o=new Rr;n.authorityType===Dr.Adfs?o.authorityType=kl.ADFS_ACCOUNT_TYPE:n.protocolMode===Bn.OIDC?o.authorityType=kl.GENERIC_ACCOUNT_TYPE:o.authorityType=kl.MSSTS_ACCOUNT_TYPE;let a;e.clientInfo&&r&&(a=Ul(e.clientInfo,r),a.xms_tdbr&&(o.dataBoundary=a.xms_tdbr==="EU"?"EU":"None")),o.clientInfo=e.clientInfo,o.homeAccountId=e.homeAccountId,o.nativeAccountId=e.nativeAccountId;const s=e.environment||n&&n.getPreferredCache();if(!s)throw _e(ch);o.environment=s,o.realm=(a==null?void 0:a.utid)||Iw(e.idTokenClaims)||"",o.localAccountId=(a==null?void 0:a.uid)||((h=e.idTokenClaims)==null?void 0:h.oid)||((p=e.idTokenClaims)==null?void 0:p.sub)||"";const l=((g=e.idTokenClaims)==null?void 0:g.preferred_username)||((w=e.idTokenClaims)==null?void 0:w.upn),u=(y=e.idTokenClaims)!=null&&y.emails?e.idTokenClaims.emails[0]:null;if(o.username=l||u||"",o.loginHint=(C=e.idTokenClaims)==null?void 0:C.login_hint,o.name=((v=e.idTokenClaims)==null?void 0:v.name)||"",o.cloudGraphHostName=e.cloudGraphHostName,o.msGraphHost=e.msGraphHost,e.tenantProfiles)o.tenantProfiles=e.tenantProfiles;else{const b=wh(e.homeAccountId,o.localAccountId,o.realm,e.idTokenClaims);o.tenantProfiles=[b]}return o}static createFromAccountInfo(e,n,r){var a;const o=new Rr;return o.authorityType=e.authorityType||kl.GENERIC_ACCOUNT_TYPE,o.homeAccountId=e.homeAccountId,o.localAccountId=e.localAccountId,o.nativeAccountId=e.nativeAccountId,o.realm=e.tenantId,o.environment=e.environment,o.username=e.username,o.name=e.name,o.loginHint=e.loginHint,o.cloudGraphHostName=n,o.msGraphHost=r,o.tenantProfiles=Array.from(((a=e.tenantProfiles)==null?void 0:a.values())||[]),o.dataBoundary=e.dataBoundary,o}static generateHomeAccountId(e,n,r,o,a){if(!(n===Dr.Adfs||n===Dr.Dsts)){if(e)try{const s=Ul(e,o.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}r.warning("No client info in response")}return(a==null?void 0:a.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,r){if(!e||!n)return!1;let o=!0;if(r){const a=e.idTokenClaims||{},s=n.idTokenClaims||{};o=a.iat===s.iat&&a.nonce===s.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&o}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Xl="no_tokens_found",kw="native_account_unavailable",Hh="refresh_token_expired",Bh="ux_not_allowed",nN="interaction_required",rN="consent_required",oN="login_required",Zl="bad_token";/*! @azure/msal-common v15.13.0 2025-09-24 */const Nw=[nN,rN,oN,Zl,Bh],iN=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],aN={[Xl]:"No refresh token found in the cache. Please sign-in.",[kw]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Hh]:"Refresh token has expired.",[Zl]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[Bh]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."};class Lr extends At{constructor(e,n,r,o,a,s,l,u){super(e,n,r),Object.setPrototypeOf(this,Lr.prototype),this.timestamp=o||ge.EMPTY_STRING,this.traceId=a||ge.EMPTY_STRING,this.correlationId=s||ge.EMPTY_STRING,this.claims=l||ge.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=u}}function Pw(t,e,n){const r=!!t&&Nw.indexOf(t)>-1,o=!!n&&iN.indexOf(n)>-1,a=!!e&&Nw.some(s=>e.indexOf(s)>-1);return r||a||o}function ed(t){return new Lr(t,aN[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */class Da{static setRequestState(e,n,r){const o=Da.generateLibraryState(e,r);return n?`${o}${ge.RESOURCE_DELIM}${n}`:o}static generateLibraryState(e,n){if(!e)throw _e(dh);const r={id:e.createNewGuid()};n&&(r.meta=n);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,n){if(!e)throw _e(dh);if(!n)throw _e(ka);try{const r=n.split(ge.RESOURCE_DELIM),o=r[0],a=r.length>1?r.slice(1).join(ge.RESOURCE_DELIM):ge.EMPTY_STRING,s=e.base64Decode(o),l=JSON.parse(s);return{userRequestState:a||ge.EMPTY_STRING,libraryState:l}}catch{throw _e(ka)}}}/*! @azure/msal-common v15.13.0 2025-09-24 */const sN={SW:"sw"};class Ra{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var a;(a=this.performanceClient)==null||a.addQueueMeasurement($.PopTokenGenerateCnf,e.correlationId);const r=await he(this.generateKid.bind(this),$.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement($.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:sN.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,o){const{resourceRequestMethod:a,resourceRequestUri:s,shrClaims:l,shrNonce:u,shrOptions:h}=r,p=s?new pt(s):void 0,g=p==null?void 0:p.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:zn(),m:a==null?void 0:a.toUpperCase(),u:g==null?void 0:g.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:g==null?void 0:g.AbsolutePath,q:g!=null&&g.QueryString?[[],g.QueryString]:void 0,client_claims:l||void 0,...o},n,h,r.correlationId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class cN{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Li{constructor(e,n,r,o,a,s,l){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=o,this.serializableCache=a,this.persistencePlugin=s,this.performanceClient=l}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||ge.NOT_AVAILABLE} - Timestamp: ${e.timestamp||ge.NOT_AVAILABLE} - Description: ${e.error_description||ge.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||ge.NOT_AVAILABLE} - Trace ID: ${e.trace_id||ge.NOT_AVAILABLE}`,a=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new Ri(e.error,o,e.suberror,a,e.status);if(n&&e.status&&e.status>=ei.SERVER_ERROR_RANGE_START&&e.status<=ei.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
5
+ Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=bn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&pt.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let r;if(n&&n.azureCloudInstance!==ph.None){const o=n.tenant?n.tenant:ge.DEFAULT_COMMON_TENANT;r=`${n.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return ge.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw _e(So)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Zy.has(e)}static isPublicCloudAuthority(e){return ge.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,r){const o=new pt(e);o.validateAsUri();const a=o.getUrlComponents();let s=`${n}.${a.HostNameAndPort}`;this.isPublicCloudAuthority(a.HostNameAndPort)&&(s=`${n}.${ge.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const l=pt.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${l}?${r}`:l}static replaceWithRegionalInformation(e,n){const r={...e};return r.authorization_endpoint=bn.buildRegionalAuthorityString(r.authorization_endpoint,n),r.token_endpoint=bn.buildRegionalAuthorityString(r.token_endpoint,n),r.end_session_endpoint&&(r.end_session_endpoint=bn.buildRegionalAuthorityString(r.end_session_endpoint,n)),r}static transformCIAMAuthority(e){let n=e;const o=new pt(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(ge.CIAM_AUTH_URL)){const a=o.HostNameAndPort.split(".")[0];n=`${n}${a}${ge.AAD_TENANT_DOMAIN_SUFFIX}`}return n}}bn.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ti.COMMON,ti.CONSUMERS,ti.ORGANIZATIONS]);function eN(t){var o;const r=(o=new pt(t).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case ti.COMMON:case ti.ORGANIZATIONS:case ti.CONSUMERS:return;default:return r}}function Ew(t){return t.endsWith(ge.FORWARD_SLASH)?t:`${t}${ge.FORWARD_SLASH}`}function tN(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw Nt(vh)}return{canonicalAuthority:t.authority?Ew(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}/*! @azure/msal-common v15.13.0 2025-09-24 */async function Aw(t,e,n,r,o,a,s){s==null||s.addQueueMeasurement($.AuthorityFactoryCreateDiscoveredInstance,a);const l=bn.transformCIAMAuthority(Ew(t)),u=new bn(l,e,n,r,o,a,s);try{return await he(u.resolveEndpointsAsync.bind(u),$.AuthorityResolveEndpointsAsync,o,s,a)(),u}catch{throw _e(So)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Ri extends At{constructor(e,n,r,o,a){super(e,n,r),this.name="ServerError",this.errorNo=o,this.status=a,Object.setPrototypeOf(this,Ri.prototype)}}/*! @azure/msal-common v15.13.0 2025-09-24 */function Jl(t,e,n){var r;return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class ro{static generateThrottlingStorageKey(e){return`${Bs.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,n,r){var s;const o=ro.generateThrottlingStorageKey(n),a=e.getThrottlingCache(o);if(a){if(a.throttleTime<Date.now()){e.removeItem(o,r);return}throw new Ri(((s=a.errorCodes)==null?void 0:s.join(" "))||ge.EMPTY_STRING,a.errorMessage,a.subError)}}static postProcess(e,n,r,o){if(ro.checkResponseStatus(r)||ro.checkResponseForRetryAfter(r)){const a={throttleTime:ro.calculateThrottleTime(parseInt(r.headers[In.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(ro.generateThrottlingStorageKey(n),a,o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(In.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(n||Bs.DEFAULT_THROTTLE_TIME_SECONDS),r+Bs.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,n,r,o){const a=Jl(n,r,o),s=this.generateThrottlingStorageKey(a);e.removeItem(s,r.correlationId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Ql extends At{constructor(e,n,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,Ql.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=r}}function Gs(t,e,n,r){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${r==null?void 0:r.name}, error.message:${r==null?void 0:r.message}`,new Ql(t,e,n)}/*! @azure/msal-common v15.13.0 2025-09-24 */class $h{constructor(e,n){this.config=GI(e),this.logger=new ri(this.config.loggerOptions,Py,hh),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}createTokenRequestHeaders(e){const n={};if(n[In.CONTENT_TYPE]=ge.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Mr.HOME_ACCOUNT_ID:try{const r=Oa(e.credential);n[In.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Mr.UPN:n[In.CCS_HEADER]=`UPN: ${e.credential}`;break}return n}async executePostToTokenEndpoint(e,n,r,o,a,s){var u;s&&((u=this.performanceClient)==null||u.addQueueMeasurement(s,a));const l=await this.sendPostRequest(o,e,{body:n,headers:r},a);return this.config.serverTelemetryManager&&l.status<500&&l.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),l}async sendPostRequest(e,n,r,o){var s,l,u;ro.preProcess(this.cacheManager,e,o);let a;try{a=await he(this.networkClient.sendPostRequestAsync.bind(this.networkClient),$.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(n,r);const h=a.headers||{};(l=this.performanceClient)==null||l.addFields({refreshTokenSize:((s=a.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:h[In.X_MS_HTTP_VERSION]||"",requestId:h[In.X_MS_REQUEST_ID]||""},o)}catch(h){if(h instanceof Ql){const p=h.responseHeaders;throw p&&((u=this.performanceClient)==null||u.addFields({httpVerToken:p[In.X_MS_HTTP_VERSION]||"",requestId:p[In.X_MS_REQUEST_ID]||"",contentTypeHeader:p[In.CONTENT_TYPE]||void 0,contentLengthHeader:p[In.CONTENT_LENGTH]||void 0,httpStatus:h.httpStatus},o)),h.error}throw h instanceof At?h:_e(gy)}return ro.postProcess(this.cacheManager,e,a,o),a}async updateAuthority(e,n){var a;(a=this.performanceClient)==null||a.addQueueMeasurement($.UpdateTokenEndpointAuthority,n);const r=`https://${e}/${this.authority.tenant}/`,o=await Aw(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const n=new Map;return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&oi(n,e.tokenQueryParameters),Oh(n,e.correlationId),Bl(n,e.correlationId,this.performanceClient),Vs(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */function Iw(t){return t&&(t.tid||t.tfp||t.acr)||null}/*! @azure/msal-common v15.13.0 2025-09-24 */class Rr{getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,loginHint:this.loginHint,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e])),dataBoundary:this.dataBoundary}}isSingleTenant(){return!this.tenantProfiles}static createAccount(e,n,r){var h,p,g,w,y,C,v;const o=new Rr;n.authorityType===Dr.Adfs?o.authorityType=kl.ADFS_ACCOUNT_TYPE:n.protocolMode===Hn.OIDC?o.authorityType=kl.GENERIC_ACCOUNT_TYPE:o.authorityType=kl.MSSTS_ACCOUNT_TYPE;let a;e.clientInfo&&r&&(a=Ul(e.clientInfo,r),a.xms_tdbr&&(o.dataBoundary=a.xms_tdbr==="EU"?"EU":"None")),o.clientInfo=e.clientInfo,o.homeAccountId=e.homeAccountId,o.nativeAccountId=e.nativeAccountId;const s=e.environment||n&&n.getPreferredCache();if(!s)throw _e(ch);o.environment=s,o.realm=(a==null?void 0:a.utid)||Iw(e.idTokenClaims)||"",o.localAccountId=(a==null?void 0:a.uid)||((h=e.idTokenClaims)==null?void 0:h.oid)||((p=e.idTokenClaims)==null?void 0:p.sub)||"";const l=((g=e.idTokenClaims)==null?void 0:g.preferred_username)||((w=e.idTokenClaims)==null?void 0:w.upn),u=(y=e.idTokenClaims)!=null&&y.emails?e.idTokenClaims.emails[0]:null;if(o.username=l||u||"",o.loginHint=(C=e.idTokenClaims)==null?void 0:C.login_hint,o.name=((v=e.idTokenClaims)==null?void 0:v.name)||"",o.cloudGraphHostName=e.cloudGraphHostName,o.msGraphHost=e.msGraphHost,e.tenantProfiles)o.tenantProfiles=e.tenantProfiles;else{const b=wh(e.homeAccountId,o.localAccountId,o.realm,e.idTokenClaims);o.tenantProfiles=[b]}return o}static createFromAccountInfo(e,n,r){var a;const o=new Rr;return o.authorityType=e.authorityType||kl.GENERIC_ACCOUNT_TYPE,o.homeAccountId=e.homeAccountId,o.localAccountId=e.localAccountId,o.nativeAccountId=e.nativeAccountId,o.realm=e.tenantId,o.environment=e.environment,o.username=e.username,o.name=e.name,o.loginHint=e.loginHint,o.cloudGraphHostName=n,o.msGraphHost=r,o.tenantProfiles=Array.from(((a=e.tenantProfiles)==null?void 0:a.values())||[]),o.dataBoundary=e.dataBoundary,o}static generateHomeAccountId(e,n,r,o,a){if(!(n===Dr.Adfs||n===Dr.Dsts)){if(e)try{const s=Ul(e,o.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}r.warning("No client info in response")}return(a==null?void 0:a.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,n,r){if(!e||!n)return!1;let o=!0;if(r){const a=e.idTokenClaims||{},s=n.idTokenClaims||{};o=a.iat===s.iat&&a.nonce===s.nonce}return e.homeAccountId===n.homeAccountId&&e.localAccountId===n.localAccountId&&e.username===n.username&&e.tenantId===n.tenantId&&e.loginHint===n.loginHint&&e.environment===n.environment&&e.nativeAccountId===n.nativeAccountId&&o}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Xl="no_tokens_found",kw="native_account_unavailable",Hh="refresh_token_expired",Bh="ux_not_allowed",nN="interaction_required",rN="consent_required",oN="login_required",Zl="bad_token";/*! @azure/msal-common v15.13.0 2025-09-24 */const Nw=[nN,rN,oN,Zl,Bh],iN=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],aN={[Xl]:"No refresh token found in the cache. Please sign-in.",[kw]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Hh]:"Refresh token has expired.",[Zl]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve.",[Bh]:"`canShowUI` flag in Edge was set to false. User interaction required on web page. Please invoke an interactive API to resolve."};class Lr extends At{constructor(e,n,r,o,a,s,l,u){super(e,n,r),Object.setPrototypeOf(this,Lr.prototype),this.timestamp=o||ge.EMPTY_STRING,this.traceId=a||ge.EMPTY_STRING,this.correlationId=s||ge.EMPTY_STRING,this.claims=l||ge.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=u}}function Pw(t,e,n){const r=!!t&&Nw.indexOf(t)>-1,o=!!n&&iN.indexOf(n)>-1,a=!!e&&Nw.some(s=>e.indexOf(s)>-1);return r||a||o}function ed(t){return new Lr(t,aN[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */class Da{static setRequestState(e,n,r){const o=Da.generateLibraryState(e,r);return n?`${o}${ge.RESOURCE_DELIM}${n}`:o}static generateLibraryState(e,n){if(!e)throw _e(dh);const r={id:e.createNewGuid()};n&&(r.meta=n);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,n){if(!e)throw _e(dh);if(!n)throw _e(ka);try{const r=n.split(ge.RESOURCE_DELIM),o=r[0],a=r.length>1?r.slice(1).join(ge.RESOURCE_DELIM):ge.EMPTY_STRING,s=e.base64Decode(o),l=JSON.parse(s);return{userRequestState:a||ge.EMPTY_STRING,libraryState:l}}catch{throw _e(ka)}}}/*! @azure/msal-common v15.13.0 2025-09-24 */const sN={SW:"sw"};class Ra{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){var a;(a=this.performanceClient)==null||a.addQueueMeasurement($.PopTokenGenerateCnf,e.correlationId);const r=await he(this.generateKid.bind(this),$.PopTokenGenerateCnf,n,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement($.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:sN.SW}}async signPopToken(e,n,r){return this.signPayload(e,n,r)}async signPayload(e,n,r,o){const{resourceRequestMethod:a,resourceRequestUri:s,shrClaims:l,shrNonce:u,shrOptions:h}=r,p=s?new pt(s):void 0,g=p==null?void 0:p.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Bn(),m:a==null?void 0:a.toUpperCase(),u:g==null?void 0:g.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:g==null?void 0:g.AbsolutePath,q:g!=null&&g.QueryString?[[],g.QueryString]:void 0,client_claims:l||void 0,...o},n,h,r.correlationId)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class cN{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.13.0 2025-09-24 */class Li{constructor(e,n,r,o,a,s,l){this.clientId=e,this.cacheStorage=n,this.cryptoObj=r,this.logger=o,this.serializableCache=a,this.persistencePlugin=s,this.performanceClient=l}validateTokenResponse(e,n){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||ge.NOT_AVAILABLE} - Timestamp: ${e.timestamp||ge.NOT_AVAILABLE} - Description: ${e.error_description||ge.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||ge.NOT_AVAILABLE} - Trace ID: ${e.trace_id||ge.NOT_AVAILABLE}`,a=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new Ri(e.error,o,e.suberror,a,e.status);if(n&&e.status&&e.status>=ei.SERVER_ERROR_RANGE_START&&e.status<=ei.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
6
6
  ${s}`);return}else if(n&&e.status&&e.status>=ei.CLIENT_ERROR_RANGE_START&&e.status<=ei.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
7
- ${s}`);return}throw Pw(e.error,e.error_description,e.suberror)?new Lr(e.error,e.error_description,e.suberror,e.timestamp||ge.EMPTY_STRING,e.trace_id||ge.EMPTY_STRING,e.correlation_id||ge.EMPTY_STRING,e.claims||ge.EMPTY_STRING,a):s}}async handleServerTokenResponse(e,n,r,o,a,s,l,u,h){var C;(C=this.performanceClient)==null||C.addQueueMeasurement($.HandleServerTokenResponse,e.correlation_id);let p;if(e.id_token){if(p=Na(e.id_token||ge.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&p.nonce!==a.nonce)throw _e(wy);if(o.maxAge||o.maxAge===0){const v=p.auth_time;if(!v)throw _e(ih);Wy(v,o.maxAge)}}this.homeAccountIdentifier=Rr.generateHomeAccountId(e.client_info||ge.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,p);let g;a&&a.state&&(g=Da.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const w=this.generateCacheRecord(e,n,r,o,p,s,a);let y;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),y=new cN(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(y)),l&&!u&&w.account){const v=this.cacheStorage.generateAccountKey(w.account.getAccountInfo());if(!this.cacheStorage.getAccount(v,o.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Li.generateAuthenticationResult(this.cryptoObj,n,w,!1,o,p,g,void 0,h)}await this.cacheStorage.saveCacheRecord(w,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&y&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(y))}return Li.generateAuthenticationResult(this.cryptoObj,n,w,!1,o,p,g,e,h)}generateCacheRecord(e,n,r,o,a,s,l){const u=n.getPreferredCache();if(!u)throw _e(ch);const h=Iw(a);let p,g;e.id_token&&a&&(p=Wl(this.homeAccountIdentifier,u,e.id_token,this.clientId,h||""),g=zh(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,a,e.client_info,u,h,l,void 0,this.logger));let w=null;if(e.access_token){const v=e.scope?Xt.fromString(e.scope):new Xt(o.scopes||[]),b=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,k=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,A=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,N=r+b,O=N+k,T=A&&A>0?r+A:void 0;w=ql(this.homeAccountIdentifier,u,e.access_token,this.clientId,h||n.tenant||"",v.printScopes(),N,O,this.cryptoObj.base64Decode,T,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let y=null;if(e.refresh_token){let v;if(e.refresh_token_expires_in){const b=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;v=r+b}y=Cw(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,s,v)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:u,familyId:e.foci}),{account:g,idToken:p,accessToken:w,refreshToken:y,appMetadata:C}}static async generateAuthenticationResult(e,n,r,o,a,s,l,u,h){var N,O,T,L,H;let p=ge.EMPTY_STRING,g=[],w=null,y,C,v=ge.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===_t.POP&&!a.popKid){const W=new Ra(e),{secret:ee,keyId:q}=r.accessToken;if(!q)throw _e(uh);p=await W.signPopToken(ee,q,a)}else p=r.accessToken.secret;g=Xt.fromString(r.accessToken.target).asArray(),w=Ma(r.accessToken.expiresOn),y=Ma(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(C=Ma(r.accessToken.refreshOn))}r.appMetadata&&(v=r.appMetadata.familyId===Nl?Nl:"");const b=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",k=(s==null?void 0:s.tid)||"";u!=null&&u.spa_accountid&&r.account&&(r.account.nativeAccountId=u==null?void 0:u.spa_accountid);const A=r.account?bh(r.account.getAccountInfo(),void 0,s,(N=r.idToken)==null?void 0:N.secret):null;return{authority:n.canonicalAuthority,uniqueId:b,tenantId:k,scopes:g,account:A,idToken:((O=r==null?void 0:r.idToken)==null?void 0:O.secret)||"",idTokenClaims:s||{},accessToken:p,fromCache:o,expiresOn:w,extExpiresOn:y,refreshOn:C,correlationId:a.correlationId,requestId:h||ge.EMPTY_STRING,familyId:v,tokenType:((T=r.accessToken)==null?void 0:T.tokenType)||ge.EMPTY_STRING,state:l?l.userRequestState:ge.EMPTY_STRING,cloudGraphHostName:((L=r.account)==null?void 0:L.cloudGraphHostName)||ge.EMPTY_STRING,msGraphHost:((H=r.account)==null?void 0:H.msGraphHost)||ge.EMPTY_STRING,code:u==null?void 0:u.spa_code,fromNativeBroker:!1}}}function zh(t,e,n,r,o,a,s,l,u,h,p,g){g==null||g.verbose("setCachedAccount called");const y=t.getAccountKeys().find(A=>A.startsWith(n));let C=null;y&&(C=t.getAccount(y,o));const v=C||Rr.createAccount({homeAccountId:n,idTokenClaims:a,clientInfo:s,environment:l,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:p},e,r),b=v.tenantProfiles||[],k=u||v.realm;if(k&&!b.find(A=>A.tenantId===k)){const A=wh(n,v.localAccountId,k,a);b.push(A)}return v.tenantProfiles=b,v}/*! @azure/msal-common v15.13.0 2025-09-24 */async function Ow(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v15.13.0 2025-09-24 */class Mw extends $h{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n){var l,u;if((l=this.performanceClient)==null||l.addQueueMeasurement($.AuthClientAcquireToken,e.correlationId),!e.code)throw _e(xy);const r=zn(),o=await he(this.executeTokenRequest.bind(this),$.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(u=o.headers)==null?void 0:u[In.X_MS_REQUEST_ID],s=new Li(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),he(s.handleServerTokenResponse.bind(s),$.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,n,void 0,void 0,void 0,a)}getLogoutUri(e){if(!e)throw Nt(Fy);const n=this.createLogoutUrlQueryString(e);return pt.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var h;(h=this.performanceClient)==null||h.addQueueMeasurement($.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),o=pt.appendQueryString(e.tokenEndpoint,r),a=await he(this.createTokenRequestBody.bind(this),$.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let s;if(n.clientInfo)try{const p=Ul(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${p.uid}${Hs.CLIENT_INFO_SEPARATOR}${p.utid}`,type:Mr.HOME_ACCOUNT_ID}}catch(p){this.logger.verbose("Could not parse client info for CCS Header: "+p)}const l=this.createTokenRequestHeaders(s||n.ccsCredential),u=Jl(this.config.authOptions.clientId,n);return he(this.executePostToTokenEndpoint.bind(this),$.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(o,a,l,u,n.correlationId,$.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(kh(n,e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Di])||this.config.authOptions.clientId),this.includeRedirectUri)Nh(n,e.redirectUri);else if(!e.redirectUri)throw Nt(Oy);if(Ih(n,e.scopes,!0,this.oidcDefaultScopes),Lk(n,e.code),Mh(n,this.config.libraryInfo),Dh(n,this.config.telemetry.application),ww(n),this.serverTelemetryManager&&!ow(this.config)&&yw(n,this.serverTelemetryManager),e.codeVerifier&&Uk(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&fw(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;hw(n,await Ow(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),pw(n,s.assertionType)}if(gw(n,ly.AUTHORIZATION_CODE_GRANT),Rh(n),e.authenticationScheme===_t.POP){const s=new Ra(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await he(s.generateCnf.bind(s),$.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Lh(n,l)}else if(e.authenticationScheme===_t.SSH)if(e.sshJwk)vw(n,e.sshJwk);else throw Nt(Dl);(!ar.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ph(n,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=Ul(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${Hs.CLIENT_INFO_SEPARATOR}${s.utid}`,type:Mr.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Mr.HOME_ACCOUNT_ID:try{const s=Oa(r.credential);Ks(n,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Mr.UPN:Vl(n,r.credential);break}return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&oi(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[cw])&&oi(n,{[cw]:"1"}),Bl(n,e.correlationId,this.performanceClient),Vs(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&Pk(n,e.postLogoutRedirectUri),e.correlationId&&Oh(n,e.correlationId),e.idTokenHint&&Ok(n,e.idTokenHint),e.state&&dw(n,e.state),e.logoutHint&&Hk(n,e.logoutHint),e.extraQueryParameters&&oi(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&mw(n),Vs(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const lN=300;class dN extends $h{constructor(e,n){super(e,n)}async acquireToken(e){var s,l;(s=this.performanceClient)==null||s.addQueueMeasurement($.RefreshTokenClientAcquireToken,e.correlationId);const n=zn(),r=await he(this.executeTokenRequest.bind(this),$.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(l=r.headers)==null?void 0:l[In.X_MS_REQUEST_ID],a=new Li(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),he(a.handleServerTokenResponse.bind(a),$.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Nt(Ly);if((r=this.performanceClient)==null||r.addQueueMeasurement($.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw _e(sh);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Lr&&o.errorCode===Xl,s=o instanceof Ri&&o.errorCode===dy.INVALID_GRANT_ERROR&&o.subError===dy.CLIENT_MISMATCH_ERROR;if(a||s)return he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var a,s,l;(a=this.performanceClient)==null||a.addQueueMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=sr(this.cacheManager.getRefreshToken.bind(this.cacheManager),$.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw ed(Xl);if(r.expiresOn&&jl(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||lN))throw(s=this.performanceClient)==null||s.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),ed(Hh);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||_t.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Mr.HOME_ACCOUNT_ID}};try{return await he(this.acquireToken.bind(this),$.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(u){if(u instanceof Lr&&((l=this.performanceClient)==null||l.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),u.subError===Zl)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const h=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(h,e.correlationId)}throw u}}async executeTokenRequest(e,n){var u;(u=this.performanceClient)==null||u.addQueueMeasurement($.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=pt.appendQueryString(n.tokenEndpoint,r),a=await he(this.createTokenRequestBody.bind(this),$.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),l=Jl(this.config.authOptions.clientId,e);return he(this.executePostToTokenEndpoint.bind(this),$.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,s,l,e.correlationId,$.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,a;(r=this.performanceClient)==null||r.addQueueMeasurement($.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(kh(n,e.embeddedClientId||((o=e.tokenBodyParameters)==null?void 0:o[Di])||this.config.authOptions.clientId),e.redirectUri&&Nh(n,e.redirectUri),Ih(n,e.scopes,!0,(a=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:a.defaultScopes),gw(n,ly.REFRESH_TOKEN_GRANT),Rh(n),Mh(n,this.config.libraryInfo),Dh(n,this.config.telemetry.application),ww(n),this.serverTelemetryManager&&!ow(this.config)&&yw(n,this.serverTelemetryManager),Fk(n,e.refreshToken),this.config.clientCredentials.clientSecret&&fw(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;hw(n,await Ow(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),pw(n,s.assertionType)}if(e.authenticationScheme===_t.POP){const s=new Ra(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await he(s.generateCnf.bind(s),$.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Lh(n,l)}else if(e.authenticationScheme===_t.SSH)if(e.sshJwk)vw(n,e.sshJwk);else throw Nt(Dl);if((!ar.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ph(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Mr.HOME_ACCOUNT_ID:try{const s=Oa(e.ccsCredential.credential);Ks(n,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Mr.UPN:Vl(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&oi(n,e.tokenBodyParameters),Bl(n,e.correlationId,this.performanceClient),Vs(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class uN extends $h{constructor(e,n){super(e,n)}async acquireCachedToken(e){var u;(u=this.performanceClient)==null||u.addQueueMeasurement($.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Mi.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!ar.isEmptyObj(e.claims))throw this.setCacheOutcome(Mi.FORCE_REFRESH_OR_CLAIMS,e.correlationId),_e(ni);if(!e.account)throw _e(sh);const r=e.account.tenantId||eN(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r);if(a){if(Wk(a.cachedAt)||jl(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mi.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),_e(ni);a.refreshOn&&jl(a.refreshOn,0)&&(n=Mi.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mi.NO_CACHED_ACCESS_TOKEN,e.correlationId),_e(ni);const s=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await he(this.generateResultFromCacheRecord.bind(this),$.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(l,e),n]}setCacheOutcome(e,n){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},n),e!==Mi.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=Na(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw _e(ih);Wy(a,n.maxAge)}return Li.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const fN={sendGetRequestAsync:()=>Promise.reject(_e(st)),sendPostRequestAsync:()=>Promise.reject(_e(st))};/*! @azure/msal-common v15.13.0 2025-09-24 */function hN(t,e,n,r){var l,u;const o=e.correlationId,a=new Map;kh(a,e.embeddedClientId||((l=e.extraQueryParameters)==null?void 0:l[Di])||t.clientId);const s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Ih(a,s,!0,(u=t.authority.options.OIDCOptions)==null?void 0:u.defaultScopes),Nh(a,e.redirectUri),Oh(a,o),kk(a,e.responseMode),Rh(a),e.prompt&&(Dk(a,e.prompt),r==null||r.addFields({prompt:e.prompt},o)),e.domainHint&&(Mk(a,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},o)),e.prompt!==fn.SELECT_ACCOUNT)if(e.sid&&e.prompt===fn.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),lw(a,e.sid),r==null||r.addFields({sidFromRequest:!0},o);else if(e.account){const h=mN(e.account);let p=vN(e.account);if(p&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),p=null),p){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),zl(a,p),r==null||r.addFields({loginHintFromClaim:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(h&&e.prompt===fn.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),lw(a,h),r==null||r.addFields({sidFromClaim:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),zl(a,e.loginHint),Vl(a,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),zl(a,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),zl(a,e.loginHint),Vl(a,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&Rk(a,e.nonce),e.state&&dw(a,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&Ph(a,e.claims,t.clientCapabilities),e.embeddedClientId&&Kl(a,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Eh))&&mw(a),a}function Vh(t,e,n,r){const o=Vs(e,n,r);return pt.appendQueryString(t.authorizationEndpoint,o)}function pN(t,e){if(Dw(t,e),!t.code)throw _e(Ay);return t}function Dw(t,e){if(!t.state||!e)throw t.state?_e(oh,"Cached State"):_e(oh,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw _e(ka,t.state)}try{r=decodeURIComponent(e)}catch{throw _e(ka,t.state)}if(n!==r)throw _e(yy);if(t.error||t.error_description||t.suberror){const o=gN(t);throw Pw(t.error,t.error_description,t.suberror)?new Lr(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new Ri(t.error||"",t.error_description,t.suberror,o)}}function gN(t){var r,o;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(o=t.error_uri)==null?void 0:o.substring(n+e.length):void 0}function mN(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function vN(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.13.0 2025-09-24 */const Rw=",",Lw="|";function yN(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:o,extensionVersion:a}=t,s=new Map([[0,[n,r]],[2,[o,a]]]);let l=[];if(e!=null&&e.length){if(l=e.split(Rw),l.length<4)return e}else l=Array.from({length:4},()=>Lw);return s.forEach((u,h)=>{var p,g;u.length===2&&((p=u[0])!=null&&p.length)&&((g=u[1])!=null&&g.length)&&wN({skuArr:l,index:h,skuName:u[0],skuVersion:u[1]})}),l.join(Rw)}function wN(t){const{skuArr:e,index:n,skuName:r,skuVersion:o}=t;n>=e.length||(e[n]=[r,o].join(Lw))}class js{constructor(e,n){this.cacheOutcome=Mi.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||ge.EMPTY_STRING,this.wrapperVer=e.wrapperVer||ge.EMPTY_STRING,this.telemetryCacheKey=pn.CACHE_KEY+Hs.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${pn.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const o=n.join(pn.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),s=[e,a].join(pn.VALUE_SEPARATOR);return[pn.SCHEMA_VERSION,s,o].join(pn.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=js.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(pn.VALUE_SEPARATOR),o=e.errors.slice(0,n).join(pn.VALUE_SEPARATOR),a=e.errors.length,s=n<a?pn.OVERFLOW_TRUE:pn.OVERFLOW_FALSE,l=[a,s].join(pn.VALUE_SEPARATOR);return[pn.SCHEMA_VERSION,e.cacheHits,r,o,l].join(pn.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const n=this.getLastRequests();n.errors.length>=pn.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof At?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(pn.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=js.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,o=0;const a=e.errors.length;for(n=0;n<a;n++){const s=e.failedRequests[2*n]||ge.EMPTY_STRING,l=e.failedRequests[2*n+1]||ge.EMPTY_STRING,u=e.errors[n]||ge.EMPTY_STRING;if(o+=s.toString().length+l.toString().length+u.length+3,o<pn.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||ge.EMPTY_STRING),e.push(this.regionSource||ge.EMPTY_STRING),e.push(this.regionOutcome||ge.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return yN(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Fw="missing_kid_error",Uw="missing_alg_error";/*! @azure/msal-common v15.13.0 2025-09-24 */const bN={[Fw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Uw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class Kh extends At{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,Kh.prototype)}}function $w(t){return new Kh(t,bN[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */class Gh{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw $w(Fw);if(!e.alg)throw $w(Uw);const n=new Gh({typ:e.typ||hI.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const jh="pkce_not_created",Wh="ear_jwk_empty",Hw="ear_jwe_empty",qh="crypto_nonexistent",td="empty_navigate_uri",Bw="hash_empty_error",Yh="no_state_in_hash",zw="hash_does_not_contain_known_properties",Vw="unable_to_parse_state",Kw="state_interaction_type_mismatch",Gw="interaction_in_progress",jw="popup_window_error",Ww="empty_window_error",Ws="user_cancelled",CN="monitor_popup_timeout",qw="monitor_window_timeout",Yw="redirect_in_iframe",Jw="block_iframe_reload",Qw="block_nested_popups",xN="iframe_closed_prematurely",nd="silent_logout_unsupported",Xw="no_account_error",_N="silent_prompt_value_error",Zw="no_token_request_cache_error",eb="unable_to_parse_token_request_cache_error",SN="auth_request_not_set_error",TN="invalid_cache_type",rd="non_browser_environment",La="database_not_open",od="no_network_connectivity",tb="post_request_failed",nb="get_request_failed",Jh="failed_to_parse_response",rb="unable_to_load_token",Qh="crypto_key_not_found",ob="auth_code_required",ib="auth_code_or_nativeAccountId_required",ab="spa_code_and_nativeAccountId_present",Xh="database_unavailable",sb="unable_to_acquire_token_from_native_platform",cb="native_handshake_timeout",lb="native_extension_not_installed",Zh="native_connection_not_established",qs="uninitialized_public_client_application",db="native_prompt_not_supported",ub="invalid_base64_string",fb="invalid_pop_token_request",hb="failed_to_build_headers",pb="failed_to_parse_headers",id="failed_to_decrypt_ear_response",ad="timed_out";/*! @azure/msal-browser v4.25.0 2025-10-09 */const To="For more visit: aka.ms/msaljs/browser-errors",EN={[jh]:"The PKCE code challenge and verifier could not be generated.",[Wh]:"No EAR encryption key provided. This is unexpected.",[Hw]:"Server response does not contain ear_jwe property. This is unexpected.",[qh]:"The crypto object or function is not available.",[td]:"Navigation URI is empty. Please check stack trace for more info.",[Bw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${To}`,[Yh]:"Hash does not contain state. Please verify that the request originated from msal.",[zw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${To}`,[Vw]:"Unable to parse state. Please verify that the request originated from msal.",[Kw]:"Hash contains state but the interaction type does not match the caller.",[Gw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${To}`,[jw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Ww]:"window.open returned null or undefined window object.",[Ws]:"User cancelled the flow.",[CN]:`Token acquisition in popup failed due to timeout. ${To}`,[qw]:`Token acquisition in iframe failed due to timeout. ${To}`,[Yw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Jw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${To}`,[Qw]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[xN]:"The iframe being monitored was closed prematurely.",[nd]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Xw]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[_N]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Zw]:"No token request found in cache.",[eb]:"The cached token request could not be parsed.",[SN]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[TN]:"Invalid cache type",[rd]:"Login and token requests are not supported in non-browser environments.",[La]:"Database is not open!",[od]:"No network connectivity. Check your internet connection.",[tb]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[nb]:"Network request failed. Please check the network trace to determine root cause.",[Jh]:"Failed to parse network response. Check network trace.",[rb]:"Error loading token to cache.",[Qh]:"Cryptographic Key or Keypair not found in browser storage.",[ob]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[ib]:"An authorization code or nativeAccountId must be provided to this flow.",[ab]:"Request cannot contain both spa code and native account id.",[Xh]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[sb]:`Unable to acquire token from native platform. ${To}`,[cb]:"Timed out while attempting to establish connection to browser extension",[lb]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Zh]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${To}`,[qs]:`You must call and await the initialize function before attempting to call any other MSAL API. ${To}`,[db]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[ub]:"Invalid base64 encoded string.",[fb]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[hb]:"Failed to build request headers object.",[pb]:"Failed to parse response headers",[id]:"Failed to decrypt ear response",[ad]:"The request timed out."};class Ys extends At{constructor(e,n){super(e,EN[e],n),Object.setPrototypeOf(this,Ys.prototype),this.name="BrowserAuthError"}}function Me(t,e){return new Ys(t,e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const Vn={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},Cr={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS",MICROSOFT_ENTRA_BROKERID:"MicrosoftEntra",DOM_API_NAME:"DOM API",PLATFORM_DOM_APIS:"get-token-and-sign-out",PLATFORM_DOM_PROVIDER:"PlatformAuthDOMHandler",PLATFORM_EXTENSION_PROVIDER:"PlatformAuthExtensionHandler"},Js={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Zt={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},gb={GET:"GET",POST:"POST"},ii={SIGNIN:"signin",SIGNOUT:"signout"},qt={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},sd={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},It={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var We;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(We||(We={}));const mb={scopes:Aa},vb="jwk",ep="msal.db",AN=1,IN=`${ep}.keys`,kn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},kN=[kn.Default,kn.Skip,kn.RefreshTokenAndNetwork];/*! @azure/msal-browser v4.25.0 2025-10-09 */function cd(t){return encodeURIComponent(Qs(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function ai(t){return yb(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qs(t){return yb(new TextEncoder().encode(t))}function yb(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Fr(t){return new TextDecoder().decode(si(t))}function si(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Me(ub)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const NN="RSASSA-PKCS1-v1_5",Fa="AES-GCM",wb="HKDF",tp="SHA-256",PN=2048,ON=new Uint8Array([1,0,1]),bb="0123456789abcdef",Cb=new Uint32Array(1),np="raw",xb="encrypt",rp="decrypt",MN="deriveKey",DN="crypto_subtle_undefined",op={name:NN,hash:tp,modulusLength:PN,publicExponent:ON};function RN(t){if(!window)throw Me(rd);if(!window.crypto)throw Me(qh);if(!t&&!window.crypto.subtle)throw Me(qh,DN)}async function _b(t,e,n){e==null||e.addQueueMeasurement($.Sha256Digest,n);const o=new TextEncoder().encode(t);return window.crypto.subtle.digest(tp,o)}function LN(t){return window.crypto.getRandomValues(t)}function ip(){return window.crypto.getRandomValues(Cb),Cb[0]}function Ur(){const t=Date.now(),e=ip()*1024+(ip()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=ip();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|o>>>24,n[9]=o>>>16,n[10]=o>>>8,n[11]=o,n[12]=a>>>24,n[13]=a>>>16,n[14]=a>>>8,n[15]=a;let s="";for(let l=0;l<n.length;l++)s+=bb.charAt(n[l]>>>4),s+=bb.charAt(n[l]&15),(l===3||l===5||l===7||l===9)&&(s+="-");return s}async function FN(t,e){return window.crypto.subtle.generateKey(op,t,e)}async function ap(t){return window.crypto.subtle.exportKey(vb,t)}async function UN(t,e,n){return window.crypto.subtle.importKey(vb,t,op,e,n)}async function $N(t,e){return window.crypto.subtle.sign(op,t,e)}async function sp(){const t=await Sb(),n={alg:"dir",kty:"oct",k:ai(new Uint8Array(t))};return Qs(JSON.stringify(n))}async function HN(t){const e=Fr(t),r=JSON.parse(e).k,o=si(r);return window.crypto.subtle.importKey(np,o,Fa,!1,[rp])}async function BN(t,e){const n=e.split(".");if(n.length!==5)throw Me(id,"jwe_length");const r=await HN(t).catch(()=>{throw Me(id,"import_key")});try{const o=new TextEncoder().encode(n[0]),a=si(n[2]),s=si(n[3]),l=si(n[4]),u=l.byteLength*8,h=new Uint8Array(s.length+l.length);h.set(s),h.set(l,s.length);const p=await window.crypto.subtle.decrypt({name:Fa,iv:a,tagLength:u,additionalData:o},r,h);return new TextDecoder().decode(p)}catch{throw Me(id,"decrypt")}}async function Sb(){const t=await window.crypto.subtle.generateKey({name:Fa,length:256},!0,[xb,rp]);return window.crypto.subtle.exportKey(np,t)}async function Tb(t){return window.crypto.subtle.importKey(np,t,wb,!1,[MN])}async function Eb(t,e,n){return window.crypto.subtle.deriveKey({name:wb,salt:e,hash:tp,info:new TextEncoder().encode(n)},t,{name:Fa,length:256},!1,[xb,rp])}async function zN(t,e,n){const r=new TextEncoder().encode(e),o=window.crypto.getRandomValues(new Uint8Array(16)),a=await Eb(t,o,n),s=await window.crypto.subtle.encrypt({name:Fa,iv:new Uint8Array(12)},a,r);return{data:ai(new Uint8Array(s)),nonce:ai(o)}}async function Ab(t,e,n,r){const o=si(r),a=await Eb(t,si(e),n),s=await window.crypto.subtle.decrypt({name:Fa,iv:new Uint8Array(12)},a,o);return new TextDecoder().decode(s)}async function Ib(t){const e=await _b(t),n=new Uint8Array(e);return ai(n)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const ld="storage_not_supported",kb="stubbed_public_client_application_called",cp="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.25.0 2025-10-09 */const dd={[ld]:"Given storage configuration option was not supported.",[kb]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[cp]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};dd[ld],dd[kb],dd[cp];class lp extends At{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,lp.prototype)}}function dp(t){return new lp(t,dd[t])}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Nb(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function VN(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function up(){return window.parent!==window}function KN(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Vn.POPUP_NAME_PREFIX}.`)===0}function Eo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function GN(){const e=new pt(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function jN(){if(pt.hashContainsKnownProperties(window.location.hash)&&up())throw Me(Jw)}function WN(t){if(up()&&!t)throw Me(Yw)}function qN(){if(KN())throw Me(Qw)}function Pb(){if(typeof window>"u")throw Me(rd)}function Ob(t){if(!t)throw Me(qs)}function fp(t){Pb(),jN(),qN(),Ob(t)}function Mb(t,e){if(fp(t),WN(e.system.allowRedirectInIframe),e.cache.cacheLocation===Zt.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw dp(cp)}function Db(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function YN(){return Ur()}/*! @azure/msal-browser v4.25.0 2025-10-09 */class ud{navigateInternal(e,n){return ud.defaultNavigateWindow(e,n)}navigateExternal(e,n){return ud.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,o)=>{setTimeout(()=>{o(Me(ad,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class JN{async sendGetRequestAsync(e,n){let r,o={},a=0;const s=Rb(n);try{r=await fetch(e,{method:gb.GET,headers:s})}catch(l){throw Gs(Me(window.navigator.onLine?nb:od),void 0,void 0,l)}o=Lb(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch(l){throw Gs(Me(Jh),a,o,l)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",o=Rb(n);let a,s=0,l={};try{a=await fetch(e,{method:gb.POST,headers:o,body:r})}catch(u){throw Gs(Me(window.navigator.onLine?tb:od),void 0,void 0,u)}l=Lb(a.headers);try{return s=a.status,{headers:l,body:await a.json(),status:s}}catch(u){throw Gs(Me(Jh),s,l,u)}}}function Rb(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,o])=>{e.append(r,o)}),e}catch(e){throw Gs(Me(hb),void 0,void 0,e)}}function Lb(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw Me(pb)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const QN=6e4,hp=1e4,XN=3e4,Fb=2e3;function ZN({auth:t,cache:e,system:n,telemetry:r},o){const a={clientId:ge.EMPTY_STRING,authority:`${ge.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:ge.EMPTY_STRING,authorityMetadata:ge.EMPTY_STRING,redirectUri:typeof window<"u"?Eo():"",postLogoutRedirectUri:ge.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Bn.AAD,OIDCOptions:{serverResponseType:Il.FRAGMENT,defaultScopes:[ge.OPENID_SCOPE,ge.PROFILE_SCOPE,ge.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:ph.None,tenant:ge.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1,encodeExtraQueryParams:!1},s={cacheLocation:Zt.SessionStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Zt.LocalStorage),claimsBasedCachingEnabled:!1},l={loggerCallback:()=>{},logLevel:Ut.Info,piiLoggingEnabled:!1},h={...{...rw,loggerOptions:l,networkClient:o?new JN:fN,navigationClient:new ud,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||QN,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||hp,navigateFrameWait:0,redirectNavigationTimeout:XN,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||Fb,pollIntervalMilliseconds:Vn.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||l},p={application:{appName:ge.EMPTY_STRING,appVersion:ge.EMPTY_STRING},client:new nw};if((t==null?void 0:t.protocolMode)!==Bn.OIDC&&(t!=null&&t.OIDCOptions)&&new ri(h.loggerOptions).warning(JSON.stringify(Nt(By))),t!=null&&t.protocolMode&&t.protocolMode===Bn.OIDC&&(h!=null&&h.allowPlatformBroker))throw Nt(zy);return{auth:{...a,...t,OIDCOptions:{...a.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...s,...e},system:h,telemetry:{...p,...r}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const eP="@azure/msal-browser",Fi="4.25.0";/*! @azure/msal-browser v4.25.0 2025-10-09 */const an="msal",pp="browser",gp="-",ci=1,mp=1,tP=`${an}.${pp}.log.level`,nP=`${an}.${pp}.log.pii`,rP=`${an}.${pp}.platform.auth.dom`,Ub=`${an}.version`,$b="account.keys",Hb="token.keys";function oo(t=mp){return t<1?`${an}.${$b}`:`${an}.${t}.${$b}`}function Ui(t,e=ci){return e<1?`${an}.${Hb}.${t}`:`${an}.${e}.${Hb}.${t}`}/*! @azure/msal-browser v4.25.0 2025-10-09 */class vp{static loggerCallback(e,n){switch(e){case Ut.Error:console.error(n);return;case Ut.Info:console.info(n);return;case Ut.Verbose:console.debug(n);return;case Ut.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var u;this.browserEnvironment=typeof window<"u",this.config=ZN(e,this.browserEnvironment);let n;try{n=window[Zt.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(tP),o=(u=n==null?void 0:n.getItem(nP))==null?void 0:u.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},l=r&&Object.keys(Ut).includes(r)?Ut[r]:void 0;l&&(s.loggerCallback=vp.loggerCallback,s.logLevel=l),a!==void 0&&(s.piiLoggingEnabled=a),this.logger=new ri(s,eP,Fi),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class $i extends vp{getModuleName(){return $i.MODULE_NAME}getId(){return $i.ID}async initialize(){return this.available=typeof window<"u",this.available}}$i.MODULE_NAME="",$i.ID="StandardOperatingContext";/*! @azure/msal-browser v4.25.0 2025-10-09 */class oP{constructor(){this.dbName=ep,this.version=AN,this.tableName=IN,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(Me(Xh)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",l=>{const u=l;this.closeConnection(),n(u.target.result)}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(Me(La));const l=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);l.addEventListener("success",()=>{this.closeConnection(),r()}),l.addEventListener("error",u=>{this.closeConnection(),o(u)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),n()}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(Me(La));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",s=>{const l=s;this.closeConnection(),e(l.target.result)}),a.addEventListener("error",s=>{this.closeConnection(),n(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",l=>{const u=l;this.closeConnection(),n(u.target.result===1)}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(ep),o=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),n(!1)))})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class fd{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class iP{constructor(e){this.inMemoryCache=new fd,this.indexedDBCache=new oP,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Ys&&e.errorCode===Xh)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ao{constructor(e,n,r){this.logger=e,RN(r??!1),this.cache=new iP(this.logger),this.performanceClient=n}createNewGuid(){return Ur()}base64Encode(e){return Qs(e)}base64Decode(e){return Fr(e)}base64UrlEncode(e){return cd(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var p;const n=(p=this.performanceClient)==null?void 0:p.startMeasurement($.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await FN(Ao.EXTRACTABLE,Ao.POP_KEY_USAGES),o=await ap(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},s=Bb(a),l=await this.hashString(s),u=await ap(r.privateKey),h=await UN(u,!1,["sign"]);return await this.cache.setItem(l,{privateKey:h,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),l}async removeTokenBindingKey(e){if(await this.cache.removeItem(e),await this.cache.containsKey(e))throw _e(Iy)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,o){var N;const a=(N=this.performanceClient)==null?void 0:N.startMeasurement($.CryptoOptsSignJwt,o),s=await this.cache.getItem(n);if(!s)throw Me(Qh);const l=await ap(s.publicKey),u=Bb(l),h=cd(JSON.stringify({kid:n})),p=Gh.getShrHeaderString({...r==null?void 0:r.header,alg:l.alg,kid:h}),g=cd(p);e.cnf={jwk:JSON.parse(u)};const w=cd(JSON.stringify(e)),y=`${g}.${w}`,v=new TextEncoder().encode(y),b=await $N(s.privateKey,v),k=ai(new Uint8Array(b)),A=`${y}.${k}`;return a&&a.end({success:!0}),A}async hashString(e){return Ib(e)}}Ao.POP_KEY_USAGES=["sign","verify"],Ao.EXTRACTABLE=!0;function Bb(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v4.25.0 2025-10-09 */const aP=24*60*60*1e3,yp={Lax:"Lax",None:"None"};class zb{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[s,...l]=decodeURIComponent(a).trim().split("="),u=l.join("=");if(s===n)return u}return""}getUserData(){throw _e(st)}setItem(e,n,r,o=!0,a=yp.Lax){let s=`${encodeURIComponent(e)}=${encodeURIComponent(n)};path=/;SameSite=${a};`;if(r){const l=sP(r);s+=`expires=${l};`}(o||a===yp.None)&&(s+="Secure;"),document.cookie=s}async setUserData(){return Promise.reject(_e(st))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),n=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");n.push(o[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function sP(t){const e=new Date;return new Date(e.getTime()+t*aP).toUTCString()}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Xs(t,e){const n=t.getItem(oo(e));return n?JSON.parse(n):[]}function Zs(t,e,n){const r=e.getItem(Ui(t,n));if(r){const o=JSON.parse(r);if(o&&o.hasOwnProperty("idToken")&&o.hasOwnProperty("accessToken")&&o.hasOwnProperty("refreshToken"))return o}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function wp(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v4.25.0 2025-10-09 */const Vb="msal.cache.encryption",cP="msal.broadcast.cache";class lP{constructor(e,n,r){if(!window.localStorage)throw dp(ld);this.memoryStorage=new fd,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(cP)}async initialize(e){const n=new zb,r=n.getItem(Vb);let o={key:"",id:""};if(r)try{o=JSON.parse(r)}catch{}if(o.key&&o.id){const a=sr(si,$.Base64Decode,this.logger,this.performanceClient,e)(o.key);this.encryptionCookie={id:o.id,key:await he(Tb,$.GenerateHKDF,this.logger,this.performanceClient,e)(a)}}else{const a=Ur(),s=await he(Sb,$.GenerateBaseKey,this.logger,this.performanceClient,e)(),l=sr(ai,$.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(s));this.encryptionCookie={id:a,key:await he(Tb,$.GenerateHKDF,this.logger,this.performanceClient,e)(s)};const u={id:a,key:l};n.setItem(Vb,JSON.stringify(u),0,!0,yp.None)}await he(this.importExistingCache.bind(this),$.ImportExistingCache,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",this.updateCache.bind(this)),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Me(qs);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw Me(qs);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const o=await he(Ab,$.Decrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!o)return null;try{return JSON.parse(o)}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,o){if(!this.initialized||!this.encryptionCookie)throw Me(qs);const{data:a,nonce:s}=await he(zN,$.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),l={id:this.encryptionCookie.id,nonce:s,data:a,lastUpdatedAt:o};this.memoryStorage.setItem(e,n),this.setItem(e,JSON.stringify(l)),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),Xs(this).forEach(r=>this.removeItem(r));const n=Zs(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(an)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=Xs(this);n=await this.importArray(n,e),n.length?this.setItem(oo(),JSON.stringify(n)):this.removeItem(oo());const r=Zs(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Ui(this.clientId),JSON.stringify(r)):this.removeItem(Ui(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let o;try{o=JSON.parse(r)}catch{return null}return wp(o)?o.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):he(Ab,$.Decrypt,this.logger,this.performanceClient,n)(this.encryptionCookie.key,o.nonce,this.getContext(e),o.data):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),o)}async importArray(e,n){const r=[],o=[];return e.forEach(a=>{const s=this.getItemFromEncryptedCache(a,n).then(l=>{l?(this.memoryStorage.setItem(a,l),r.push(a)):this.removeItem(a)});o.push(s)}),await Promise.all(o),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const n=this.performanceClient.startMeasurement($.LocalStorageUpdated);n.add({isBackground:!0});const{key:r,value:o,context:a}=e.data;if(!r){this.logger.error("Broadcast event missing key"),n.end({success:!1,errorCode:"noKey"});return}if(a&&a!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${a}`),n.end({success:!1,errorCode:"contextMismatch"});return}o?(this.memoryStorage.setItem(r,o),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),n.end({success:!0})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class dP{constructor(){if(!window.sessionStorage)throw dp(ld)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const Ve={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v4.25.0 2025-10-09 */function Kb(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class bp extends Th{constructor(e,n,r,o,a,s,l){super(e,r,o,a,l),this.cacheConfig=n,this.logger=o,this.internalStorage=new fd,this.browserStorage=Gb(e,n.cacheLocation,o,a),this.temporaryCacheStorage=Gb(e,n.temporaryCacheLocation,o,a),this.cookieStorage=new zb,this.eventHandler=s}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){const n=Xs(this.browserStorage,0),r=Zs(this.clientId,this.browserStorage,0);this.performanceClient.addFields({oldAccountCount:n.length,oldAccessCount:r.accessToken.length,oldIdCount:r.idToken.length,oldRefreshCount:r.refreshToken.length},e);const o=Xs(this.browserStorage,1),a=Zs(this.clientId,this.browserStorage,1);this.performanceClient.addFields({currAccountCount:o.length,currAccessCount:a.accessToken.length,currIdCount:a.idToken.length,currRefreshCount:a.refreshToken.length},e),await Promise.all([this.updateV0ToCurrent(mp,n,o,e),this.updateV0ToCurrent(ci,r.idToken,a.idToken,e),this.updateV0ToCurrent(ci,r.accessToken,a.accessToken,e),this.updateV0ToCurrent(ci,r.refreshToken,a.refreshToken,e)]),n.length>0?this.browserStorage.setItem(oo(0),JSON.stringify(n)):this.browserStorage.removeItem(oo(0)),o.length>0?this.browserStorage.setItem(oo(1),JSON.stringify(o)):this.browserStorage.removeItem(oo(1)),this.setTokenKeys(r,e,0),this.setTokenKeys(a,e,1)}async updateV0ToCurrent(e,n,r,o){const a=[];for(const s of[...n]){const l=this.browserStorage.getItem(s),u=this.validateAndParseJson(l||"");if(!u){Kb(n,s);continue}u.lastUpdatedAt||(u.lastUpdatedAt=Date.now().toString(),this.setItem(s,JSON.stringify(u),o));const h=wp(u)?await this.browserStorage.decryptData(s,u,o):u;let p;if(h&&(xw(h)||_w(h))&&(p=h.expiresOn),!h||jk(u.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)||p&&jl(p,uy)){this.browserStorage.removeItem(s),Kb(n,s),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},o);continue}if(this.cacheConfig.cacheLocation!==Zt.LocalStorage||wp(u)){const g=`${an}.${e}${gp}${s}`,w=this.browserStorage.getItem(g);if(w){const y=this.validateAndParseJson(w);if(Number(u.lastUpdatedAt)>Number(y.lastUpdatedAt)){a.push(this.setUserData(g,JSON.stringify(h),o,u.lastUpdatedAt).then(()=>{this.performanceClient.incrementFields({updatedCacheFromV0Count:1},o)}));continue}}else{a.push(this.setUserData(g,JSON.stringify(h),o,u.lastUpdatedAt).then(()=>{r.push(g),this.performanceClient.incrementFields({upgradedCacheCount:1},o)}));continue}}}return Promise.all(a)}trackVersionChanges(e){const n=this.browserStorage.getItem(Ub);n&&(this.logger.info(`MSAL.js was last initialized by version: ${n}`),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==Fi&&this.setItem(Ub,Fi,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){let o=0,a=[];const s=20;for(let l=0;l<=s;l++)try{this.browserStorage.setItem(e,n),l>0&&(l<=o?this.removeAccessTokenKeys(a.slice(0,l),r,0):(this.removeAccessTokenKeys(a.slice(0,o),r,0),this.removeAccessTokenKeys(a.slice(o,l),r)));break}catch(u){const h=Sh(u);if(h.errorCode===Fl&&l<s){if(!a.length){const p=e===Ui(this.clientId,0)?JSON.parse(n).accessToken:this.getTokenKeys(0).accessToken,g=e===Ui(this.clientId)?JSON.parse(n).accessToken:this.getTokenKeys().accessToken;a=[...p,...g],o=p.length}if(a.length<=l)throw h;this.removeAccessToken(a[l],r,!1)}else throw h}}async setUserData(e,n,r,o){let a=0,s=[];const l=20;for(let u=0;u<=l;u++)try{await he(this.browserStorage.setUserData.bind(this.browserStorage),$.SetUserData,this.logger,this.performanceClient)(e,n,r,o),u>0&&(u<=a?this.removeAccessTokenKeys(s.slice(0,u),r,0):(this.removeAccessTokenKeys(s.slice(0,a),r,0),this.removeAccessTokenKeys(s.slice(a,u),r)));break}catch(h){const p=Sh(h);if(p.errorCode===Fl&&u<l){if(!s.length){const g=this.getTokenKeys(0).accessToken,w=this.getTokenKeys().accessToken;s=[...g,...w],a=g.length}if(s.length<=u)throw p;this.removeAccessToken(s[u],r,!1)}else throw p}}getAccount(e,n){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const o=this.validateAndParseJson(r);return!o||!Rr.isAccountEntity(o)?null:Th.toObject(new Rr,o)}async setAccount(e,n){this.logger.trace("BrowserCacheManager.setAccount called");const r=this.generateAccountKey(e.getAccountInfo()),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.addAccountKeyToMap(r,n);this.cacheConfig.cacheLocation===Zt.LocalStorage&&a&&this.eventHandler.emitEvent(Ve.ACCOUNT_ADDED,void 0,e.getAccountInfo())}getAccountKeys(){return Xs(this.browserStorage)}addAccountKeyToMap(e,n){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();return r.indexOf(e)===-1?(r.push(e),this.setItem(oo(),JSON.stringify(r),n),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added"),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map"),!1)}removeAccountKeyFromMap(e,n){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(oo());return}else this.setItem(oo(),JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(o=>{o.includes(e.homeAccountId)&&o.includes(e.environment)&&this.browserStorage.removeItem(o)}),this.cacheConfig.cacheLocation===Zt.LocalStorage&&this.eventHandler.emitEvent(Ve.ACCOUNT_REMOVED,void 0,e)}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),o=r.idToken.indexOf(e);o>-1&&(this.logger.info("idToken removed from tokenKeys map"),r.idToken.splice(o,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=ci){this.logger.trace("removeAccessTokenKey called");const o=this.getTokenKeys(r);let a=0;if(e.forEach(s=>{const l=o.accessToken.indexOf(s);l>-1&&(o.accessToken.splice(l,1),a++)}),a>0){this.logger.info(`removed ${a} accessToken keys from tokenKeys map`),this.setTokenKeys(o,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),o=r.refreshToken.indexOf(e);o>-1&&(this.logger.info("refreshToken removed from tokenKeys map"),r.refreshToken.splice(o,1),this.setTokenKeys(r,n))}getTokenKeys(e=ci){return Zs(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=ci){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Ui(this.clientId,r));return}else this.setItem(Ui(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!qk(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}async setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys();a.idToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),a.idToken.push(r),this.setTokenKeys(a,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeAccessTokenKeys([e],n),null;const o=this.validateAndParseJson(r);return!o||!xw(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}async setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys(),s=a.accessToken.indexOf(r);s!==-1&&a.accessToken.splice(s,1),this.logger.trace(`access token ${s===-1?"added to":"updated in"} map`),a.accessToken.push(r),this.setTokenKeys(a,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeRefreshToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!_w(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}async setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys();a.refreshToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),a.refreshToken.push(r),this.setTokenKeys(a,n))}getAppMetadata(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Xk(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Qk(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Yk(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&Zk(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(sd.WRAPPER_SKU,e),this.internalStorage.setItem(sd.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(sd.WRAPPER_SKU)||ge.EMPTY_STRING,n=this.internalStorage.getItem(sd.WRAPPER_VER)||ge.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(cy.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(cy.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:zn().toString()};this.setItem(r,JSON.stringify(o),n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(Ve.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Jk(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Zt.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,n,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(an)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(an)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}clearTokensAndKeysWithClaims(e){this.performanceClient.addQueueMeasurement($.ClearTokensAndKeysWithClaims,e);const n=this.getTokenKeys();let r=0;n.accessToken.forEach(o=>{const a=this.getAccessTokenCredential(o,e);a!=null&&a.requestedClaimsHash&&o.includes(a.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(o,e),r++)}),r>0&&this.logger.warning(`${r} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return ar.startsWith(e,an)?e:`${an}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===hn.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==_t.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${an}.${ci}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",e.requestedClaimsHash||"",r].join(gp).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${an}.${mp}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(gp).toLowerCase()}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(qt.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(qt.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(qt.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(qt.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(qt.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,n){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=Qs(JSON.stringify(e));if(this.setTemporaryCache(qt.REQUEST_PARAMS,r,!0),n){const o=Qs(n);this.setTemporaryCache(qt.VERIFIER,o,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(qt.REQUEST_PARAMS,!0);if(!e)throw Me(Zw);const n=this.getTemporaryCache(qt.VERIFIER,!0);let r,o="";try{r=JSON.parse(Fr(e)),n&&(o=Fr(n))}catch(a){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${a}`),Me(eb)}return[r,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(qt.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${an}.${qt.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error"),this.removeTemporaryItem(e),this.resetRequestCache(),Nb(window),null}}setInteractionInProgress(e,n=ii.SIGNIN){var o;const r=`${an}.${qt.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Me(Gw);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((o=this.getInteractionInProgress())==null?void 0:o.clientId)===this.clientId&&this.removeTemporaryItem(r)}async hydrateCache(e,n){var l,u,h;const r=Wl((l=e.account)==null?void 0:l.homeAccountId,(u=e.account)==null?void 0:u.environment,e.idToken,this.clientId,e.tenantId);let o;n.claims&&(o=await this.cryptoImpl.hashString(n.claims));const a=ql((h=e.account)==null?void 0:h.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?bw(e.expiresOn):0,e.extExpiresOn?bw(e.extExpiresOn):0,Fr,void 0,e.tokenType,void 0,n.sshKid,n.claims,o),s={idToken:r,accessToken:a};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(o){if(o instanceof Pa&&this.performanceClient&&n)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},n)}catch{}throw o}}}function Gb(t,e,n,r){try{switch(e){case Zt.LocalStorage:return new lP(t,n,r);case Zt.SessionStorage:return new dP;case Zt.MemoryStorage:default:break}}catch(o){n.error(o)}return new fd}const uP=(t,e,n,r)=>{const o={cacheLocation:Zt.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new bp(t,o,Ml,e,n,r)};/*! @azure/msal-browser v4.25.0 2025-10-09 */function fP(t,e,n,r,o){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(o||{},r):[]}function hP(t,e,n,r){const o=n.getAccountInfoFilteredBy(t,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function pP(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const o=n.getAccountInfoFilteredBy({username:t},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function gP(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=n.getAccountInfoFilteredBy({homeAccountId:t},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function mP(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=n.getAccountInfoFilteredBy({localAccountId:t},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function vP(t,e,n){e.setActiveAccount(t,n)}function yP(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const wP="msal.broadcast.event";class bP{constructor(e){this.eventCallbacks=new Map,this.logger=e||new ri({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(wP)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const o=r||YN();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,o){var s;const a={eventType:e,interactionType:n||null,payload:r||null,error:o||null,timestamp:Date.now()};switch(e){case Ve.ACCOUNT_ADDED:case Ve.ACCOUNT_REMOVED:case Ve.ACTIVE_ACCOUNT_CHANGED:(s=this.broadcastChannel)==null||s.postMessage(a);break;default:this.invokeCallbacks(a);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],o)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${o}: ${e.eventType}`),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class jb{constructor(e,n,r,o,a,s,l,u,h){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=s,this.platformAuthProvider=u,this.correlationId=h||Ur(),this.logger=o.clone(Vn.MSAL_SKU,Fi,this.correlationId),this.performanceClient=l}async clearCacheOnLogout(e,n){if(n)try{this.browserStorage.removeAccount(n,e),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),this.browserStorage.clear(e),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return pt.getAbsoluteUrl(n,Eo())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new js(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,l=n&&s?this.config.auth.authority.replace(pt.getDomainFromUrl(a),n.environment):a,u=bn.generateAuthority(l,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),h=await he(Aw,$.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(u,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(n&&!h.isAlias(n.environment))throw Nt(Vy);return h}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function Cp(t,e,n,r){n.addQueueMeasurement($.InitializeBaseRequest,t.correlationId);const o=t.authority||e.auth.authority,a=[...t&&t.scopes||[]],s={...t,correlationId:t.correlationId,authority:o,scopes:a};if(!s.authenticationScheme)s.authenticationScheme=_t.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===_t.SSH){if(!t.sshJwk)throw Nt(Dl);if(!t.sshKid)throw Nt(Hy)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!ar.isEmptyObj(t.claims)&&(s.requestedClaimsHash=await Ib(t.claims)),s}async function CP(t,e,n,r,o){r.addQueueMeasurement($.InitializeSilentRequest,t.correlationId);const a=await he(Cp,$.InitializeBaseRequest,o,r,t.correlationId)(t,n,r,o);return{...t,...a,account:e,forceRefresh:t.forceRefresh||!1}}function Wb(t,e){let n;const r=t.httpMethod;if(e===Bn.EAR){if(n=r||Oi.POST,n!==Oi.POST)throw Nt(Ky)}else n=r||Oi.GET;if(t.authorizePostBodyParameters&&n!==Oi.POST)throw Nt(Gy);return n}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ua extends jb{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||Ur(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(e.postLogoutRedirectUri,Eo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Eo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(Eo(),Eo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement($.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Mw(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:s}=e;this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetClientConfiguration,this.correlationId);const l=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:s}),u=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:l,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:u.loggerCallback,piiLoggingEnabled:u.piiLoggingEnabled,logLevel:u.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Vn.MSAL_SKU,version:Fi,cpu:ge.EMPTY_STRING,os:ge.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:n},a=Da.setRequestState(this.browserCrypto,e&&e.state||ge.EMPTY_STRING,o),l={...await he(Cp,$.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||Ur(),responseMode:this.config.auth.OIDCOptions.serverResponseType},u={...l,httpMethod:Wb(l,this.config.auth.protocolMode)};if(e.loginHint||e.sid)return u;const h=e.account||this.browserStorage.getActiveAccount(this.correlationId);return h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),u.account=h),u}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function xP(t,e){if(!e)return null;try{return Da.parseRequestState(t,e).libraryState.meta}catch{throw _e(ka)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function ec(t,e,n){const r=Rl(t);if(!r)throw Yy(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),Me(zw)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Me(Bw));return r}function _P(t,e,n){if(!t.state)throw Me(Yh);const r=xP(e,t.state);if(!r)throw Me(Vw);if(r.interactionType!==n)throw Me(Kw)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class qb{constructor(e,n,r,o,a){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement($.HandleCodeResponse,n.correlationId);let r;try{r=pN(e,n.state)}catch(o){throw o instanceof Ri&&o.subError===Ws?Me(Ws):o}return he(this.handleCodeResponseFromServer.bind(this),$.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await he(this.authModule.updateAuthority.bind(this.authModule),$.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(n);a&&(this.authCodeRequest.ccsCredential=a)}return await he(this.authModule.acquireToken.bind(this.authModule),$.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Mr.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Mr.UPN}:null}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const SP="ContentError",TP="PageException",Yb="user_switch";/*! @azure/msal-browser v4.25.0 2025-10-09 */const EP="USER_INTERACTION_REQUIRED",AP="USER_CANCEL",IP="NO_NETWORK",kP="DISABLED",NP="ACCOUNT_UNAVAILABLE",PP="UX_NOT_ALLOWED";/*! @azure/msal-browser v4.25.0 2025-10-09 */const OP=-2147186943,MP={[Yb]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class io extends At{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,io.prototype),this.name="NativeAuthError",this.ext=r}}function $a(t){if(t.ext&&t.ext.status&&t.ext.status===kP||t.ext&&t.ext.error&&t.ext.error===OP)return!0;switch(t.errorCode){case SP:case TP:return!0;default:return!1}}function hd(t,e,n){if(n&&n.status)switch(n.status){case NP:return ed(kw);case EP:return new Lr(t,e);case AP:return Me(Ws);case IP:return Me(od);case PP:return ed(Bh)}return new io(t,MP[t]||e,n)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Jb extends Ua{async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(It.acquireTokenSilent_silentFlow),r=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new uN(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await he(o.acquireCachedToken.bind(o),$.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(a){throw a instanceof Ys&&a.errorCode===Qh&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n.correlationId,n==null?void 0:n.account)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class pd extends jb{constructor(e,n,r,o,a,s,l,u,h,p,g,w){super(e,n,r,o,a,s,u,h,w),this.apiId=l,this.accountId=p,this.platformAuthProvider=h,this.nativeStorageManager=g,this.silentCacheClient=new Jb(e,this.nativeStorageManager,r,o,a,s,u,h,w);const y=this.platformAuthProvider.getExtensionName();this.skus=js.makeExtraSkuString({libraryName:Vn.MSAL_SKU,libraryVersion:Fi,extensionName:y,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Ek]:this.skus}}async acquireToken(e,n){this.performanceClient.addQueueMeasurement($.NativeInteractionClientAcquireToken,this.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement($.NativeInteractionClientAcquireToken,this.correlationId),o=zn(),a=this.initializeServerTelemetryManager(this.apiId);try{const s=await this.initializeNativeRequest(e);try{const u=await this.acquireTokensFromCache(this.accountId,s);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),u}catch(u){if(n===kn.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),r.end({success:!1,brokerErrorCode:"cache_request_failed"}),u;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const l=await this.platformAuthProvider.sendMessage(s);return await this.handleNativeResponse(l,s,o).then(u=>(r.end({success:!0,isNativeBroker:!0,requestId:u.requestId}),a.clearNativeBrokerErrorCode(),u)).catch(u=>{throw r.end({success:!1,errorCode:u.errorCode,subErrorCode:u.subError}),u})}catch(s){throw s instanceof io&&a.setNativeBrokerErrorCode(s.errorCode),r.end({success:!1}),s}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:Xt.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),_e(lh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw _e(lh);try{const o=this.createSilentCacheRequest(n,r),a=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r);try{await this.platformAuthProvider.sendMessage(o)}catch(l){if(l instanceof io&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(l.errorCode),$a(l)))throw l}this.browserStorage.setTemporaryCache(qt.NATIVE_REQUEST,JSON.stringify(o),!0);const a={apiId:It.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(s,a)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(qt.NATIVE_REQUEST));const s=zn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const l=await this.platformAuthProvider.sendMessage(a),u=await this.handleNativeResponse(l,a,s);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),e&&this.correlationId&&this.performanceClient.addFields({isNativeBroker:!0},this.correlationId),u}catch(l){throw l}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var p,g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Na(e.id_token,Fr),a=this.createHomeAccountIdentifier(e,o),s=(p=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:p.homeAccountId;if((g=n.extraParameters)!=null&&g.child_client_id&&e.account.id!==n.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(a!==s&&e.account.id!==n.accountId)throw hd(Yb);const l=await this.getDiscoveredAuthority({requestAuthority:n.authority}),u=zh(this.browserStorage,l,a,Fr,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const h=await this.generateAuthenticationResult(e,n,o,u,l.canonicalAuthority,r);return await this.cacheAccount(u,this.correlationId),await this.cacheNativeTokens(e,n,a,o,e.access_token,h.tenantId,r),h}createHomeAccountIdentifier(e,n){return Rr.generateHomeAccountId(e.client_info||ge.EMPTY_STRING,Dr.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return n?Xt.fromString(n):Xt.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===_t.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Ra(this.browserCrypto),o={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw _e(uh);return r.signPopToken(e.access_token,n.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,n,r,o,a,s){const l=this.addTelemetryFromNativeResponse(e.properties.MATS),u=this.generateScopes(n.scope,e.scope),h=e.account.properties||{},p=h.UID||r.oid||r.sub||ge.EMPTY_STRING,g=h.TenantId||r.tid||ge.EMPTY_STRING,w=bh(o.getAccountInfo(),void 0,r,e.id_token);w.nativeAccountId!==e.account.id&&(w.nativeAccountId=e.account.id);const y=await this.generatePopAccessToken(e,n),C=n.tokenType===_t.POP?_t.POP:_t.BEARER;return{authority:a,uniqueId:p,tenantId:g,scopes:u.asArray(),account:w,idToken:e.id_token,idTokenClaims:r,accessToken:y,fromCache:l?this.isResponseFromCache(l):!1,expiresOn:Ma(s+e.expires_in),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e.getAccountInfo(),n)}cacheNativeTokens(e,n,r,o,a,s,l){const u=Wl(r,n.authority,e.id_token||"",n.clientId,o.tid||""),h=n.tokenType===_t.POP?ge.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,p=l+h,g=this.generateScopes(e.scope,n.scope),w=ql(r,n.authority,a,n.clientId,o.tid||s,g.printScopes(),p,0,Fr,void 0,n.tokenType,void 0,n.keyId),y={idToken:u,accessToken:w};return this.nativeStorageManager.saveCacheRecord(y,this.correlationId,n.storeInCache)}getExpiresInValue(e,n){return e===_t.POP?ge.SHR_NONCE_VALIDITY:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=await this.getCanonicalAuthority(e),{scopes:r,...o}=e,a=new Xt(r||[]);a.appendScopes(Aa);const s={...o,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(s.signPopToken&&e.popKid)throw Me(fb);if(this.handleExtraBrokerParams(s),s.extraParameters=s.extraParameters||{},s.extraParameters.telemetry=Cr.MATS_TELEMETRY,e.authenticationScheme===_t.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new Ra(this.browserCrypto);let h;if(s.keyId)h=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:s.keyId})),s.signPopToken=!1;else{const p=await he(u.generateCnf.bind(u),$.PopTokenGenerateCnf,this.logger,this.performanceClient,this.correlationId)(l,this.logger);h=p.reqCnfString,s.keyId=p.kid,s.signPopToken=!0}s.reqCnf=h}return this.addRequestSKUs(s),s}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new pt(n);return r.validateAsUri(),r}getPrompt(e){switch(this.apiId){case It.ssoSilent:case It.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),fn.NONE}if(!e){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e){case fn.NONE:case fn.CONSENT:case fn.LOGIN:case fn.SELECT_ACCOUNT:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e} is not compatible with native flow`),Me(db)}}handleExtraBrokerParams(e){var a;const n=e.extraParameters&&e.extraParameters.hasOwnProperty($l)&&e.extraParameters.hasOwnProperty(Hl)&&e.extraParameters.hasOwnProperty(Di);if(!e.embeddedClientId&&!n)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Hl],r=e.extraParameters[Di]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},this.correlationId)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function xp(t,e,n,r,o){const a=hN({...t.auth,authority:e},n,r,o);if(Mh(a,{sku:Vn.MSAL_SKU,version:Fi,os:"",cpu:""}),t.auth.protocolMode!==Bn.OIDC&&Dh(a,t.telemetry.application),n.platformBroker&&(Nk(a),o.addFields({isPlatformAuthorizeRequest:!0},n.correlationId),n.authenticationScheme===_t.POP)){const s=new Ao(r,o),l=new Ra(s);let u;n.popKid?u=s.encodeKid(n.popKid):u=(await he(l.generateCnf.bind(l),$.PopTokenGenerateCnf,r,o,n.correlationId)(n,r)).reqCnfString,Lh(a,u)}return Bl(a,n.correlationId,o),a}async function _p(t,e,n,r,o){if(!n.codeChallenge)throw Nt(mh);const a=await he(xp,$.GetStandardParams,r,o,n.correlationId)(t,e,n,r,o);return Ah(a,Xf.CODE),uw(a,n.codeChallenge,ge.S256_CODE_CHALLENGE_METHOD),oi(a,n.extraQueryParameters||{}),Vh(e,a,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}async function Sp(t,e,n,r,o,a){if(!r.earJwk)throw Me(Wh);const s=await xp(e,n,r,o,a);Ah(s,Xf.IDTOKEN_TOKEN_REFRESHTOKEN),Bk(s,r.earJwk);const l=new Map;oi(l,r.extraQueryParameters||{});const u=Vh(n,l,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qb(t,u,s)}async function Tp(t,e,n,r,o,a){const s=await xp(e,n,r,o,a);Ah(s,Xf.CODE),uw(s,r.codeChallenge,r.codeChallengeMethod||ge.S256_CODE_CHALLENGE_METHOD),zk(s,r.authorizePostBodyParameters||{});const l=new Map;oi(l,r.extraQueryParameters||{});const u=Vh(n,l,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qb(t,u,s)}function Qb(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((o,a)=>{const s=t.createElement("input");s.hidden=!0,s.name=a,s.value=o,r.appendChild(s)}),t.body.appendChild(r),r}async function Xb(t,e,n,r,o,a,s,l,u,h){if(l.verbose("Account id found, calling WAM for token"),!h)throw Me(Zh);const p=new Ao(l,u),g=new pd(r,o,p,l,s,r.system.navigationClient,n,u,h,e,a,t.correlationId),{userRequestState:w}=Da.parseRequestState(p,t.state);return he(g.acquireToken.bind(g),$.NativeInteractionClientAcquireToken,l,u,t.correlationId)({...t,state:w,prompt:void 0})}async function gd(t,e,n,r,o,a,s,l,u,h,p,g){if(ro.removeThrottle(s,o.auth.clientId,t),e.accountId)return he(Xb,$.HandleResponsePlatformBroker,h,p,t.correlationId)(t,e.accountId,r,o,s,l,u,h,p,g);const w={...t,code:e.code||"",codeVerifier:n},y=new qb(a,s,w,h,p);return await he(y.handleCodeResponse.bind(y),$.HandleCodeResponse,h,p,t.correlationId)(e,t)}async function Ep(t,e,n,r,o,a,s,l,u,h,p){if(ro.removeThrottle(a,r.auth.clientId,t),Dw(e,t.state),!e.ear_jwe)throw Me(Hw);if(!t.earJwk)throw Me(Wh);const g=JSON.parse(await he(BN,$.DecryptEarResponse,u,h,t.correlationId)(t.earJwk,e.ear_jwe));if(g.accountId)return he(Xb,$.HandleResponsePlatformBroker,u,h,t.correlationId)(t,g.accountId,n,r,a,s,l,u,h,p);const w=new Li(r.auth.clientId,a,new Ao(u,h),u,null,null,h);w.validateTokenResponse(g);const y={code:"",state:t.state,nonce:t.nonce,client_info:g.client_info,cloud_graph_host_name:g.cloud_graph_host_name,cloud_instance_host_name:g.cloud_instance_host_name,cloud_instance_name:g.cloud_instance_name,msgraph_host:g.msgraph_host};return await he(w.handleServerTokenResponse.bind(w),$.HandleServerTokenResponse,u,h,t.correlationId)(g,o,zn(),t,y,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const DP=32;async function md(t,e,n){t.addQueueMeasurement($.GeneratePkceCodes,n);const r=sr(RP,$.GenerateCodeVerifier,e,t,n)(t,e,n),o=await he(LP,$.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:o}}function RP(t,e,n){try{const r=new Uint8Array(DP);return sr(LN,$.GetRandomValues,e,t,n)(r),ai(r)}catch{throw Me(jh)}}async function LP(t,e,n,r){e.addQueueMeasurement($.GenerateCodeChallengeFromVerifier,r);try{const o=await he(_b,$.Sha256Digest,n,e,r)(t,e,r);return ai(new Uint8Array(o))}catch{throw Me(jh)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class vd{constructor(e,n,r,o){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement($.NativeMessageHandlerHandshake),this.platformAuthType=Cr.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace(this.platformAuthType+" - sendMessage called.");const n={method:Js.GetToken,request:e},r={channel:Cr.CHANNEL_ID,extensionId:this.extensionId,responseId:Ur(),body:n};this.logger.trace(this.platformAuthType+" - Sending request to browser extension"),this.logger.tracePii(this.platformAuthType+` - Sending request to browser extension: ${JSON.stringify(r)}`),this.messageChannel.port1.postMessage(r);const o=await new Promise((s,l)=>{this.resolvers.set(r.responseId,{resolve:s,reject:l})});return this.validatePlatformBrokerResponse(o)}static async createProvider(e,n,r){e.trace("PlatformAuthExtensionHandler - createProvider called.");try{const o=new vd(e,n,r,Cr.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new vd(e,n,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace(this.platformAuthType+" - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Cr.CHANNEL_ID,extensionId:this.extensionId,responseId:Ur(),body:{method:Js.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Me(cb)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace(this.platformAuthType+" - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==Cr.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===Js.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(this.platformAuthType+`.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Me(lb))}}onChannelMessage(e){this.logger.trace(this.platformAuthType+" - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),o=this.handshakeResolvers.get(n.responseId);try{const a=n.body.method;if(a===Js.Response){if(!r)return;const s=n.body.response;if(this.logger.trace(this.platformAuthType+" - Received response from browser extension"),this.logger.tracePii(this.platformAuthType+` - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(hd(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(hd(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw th(Ol,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(a===Js.HandshakeResponse){if(!o){this.logger.trace(this.platformAuthType+`.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(this.platformAuthType+` - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw th(Ol,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===Cr.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ap{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=Cr.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var o;if(e.trace("PlatformAuthDOMHandler: createProvider called"),(o=window.navigator)!=null&&o.platformAuthentication){const a=await window.navigator.platformAuthentication.getSupportedContracts(Cr.MICROSOFT_ENTRA_BROKERID);if(a!=null&&a.includes(Cr.PLATFORM_DOM_APIS))return e.trace("Platform auth api available in DOM"),new Ap(e,n,r)}}getExtensionId(){return Cr.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return Cr.DOM_API_NAME}async sendMessage(e){this.logger.trace(this.platformAuthType+" - Sending request to browser DOM API");try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r)}catch(n){throw this.logger.error(this.platformAuthType+" - executeGetToken DOM API error"),n}}initializePlatformDOMRequest(e){this.logger.trace(this.platformAuthType+" - initializeNativeDOMRequest called");const{accountId:n,clientId:r,authority:o,scope:a,redirectUri:s,correlationId:l,state:u,storeInCache:h,embeddedClientId:p,extraParameters:g,...w}=e,y=this.getDOMExtraParams(w);return{accountId:n,brokerId:this.getExtensionId(),authority:o,clientId:r,correlationId:l||this.correlationId,extraParameters:{...g,...y},isSecurityTokenService:!1,redirectUri:s,scope:a,state:u,storeInCache:h,embeddedClientId:p}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(this.platformAuthType+" - platform broker returned successful and valid response"),this.convertToPlatformBrokerResponse(e);if(e.hasOwnProperty("error")){const n=e;if(n.isSuccess===!1&&n.error&&n.error.code)throw this.logger.trace(this.platformAuthType+" - platform broker returned error response"),hd(n.error.code,n.error.description,{error:parseInt(n.error.errorCode),protocol_error:n.error.protocolError,status:n.error.status,properties:n.error.properties})}}throw th(Ol,"Response missing expected properties.")}convertToPlatformBrokerResponse(e){return this.logger.trace(this.platformAuthType+" - convertToNativeResponse called"),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce((o,[a,s])=>(o[a]=String(s),o),{})}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function FP(t,e,n,r){t.trace("getPlatformAuthProvider called",n);const o=UP();t.trace("Has client allowed platform auth via DOM API: "+o);let a;try{o&&(a=await Ap.createProvider(t,e,n)),a||(t.trace("Platform auth via DOM API not available, checking for extension"),a=await vd.createProvider(t,r||Fb,e))}catch(s){t.trace("Platform auth not available",s)}return a}function UP(){let t;try{return t=window[Zt.SessionStorage],(t==null?void 0:t.getItem(rP))==="true"}catch{return!1}}function tc(t,e,n,r){if(e.trace("isPlatformAuthAllowed called"),!t.system.allowPlatformBroker)return e.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false"),!1;if(!n)return e.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false"),!1;if(r)switch(r){case _t.BEARER:case _t.POP:return e.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true"),!0;default:return e.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false"),!1}return!0}/*! @azure/msal-browser v4.25.0 2025-10-09 */class $P extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,l,h,p),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=u,this.eventHandler=a}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||Aa,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r,n);{const a={...e,httpMethod:Wb(e,this.config.auth.protocolMode)};return this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(a,r,n)}}catch(o){return Promise.reject(o)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,o,a))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("acquireTokenPopupAsync called");const o=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,We.Popup);n.popup&&Db(o.authority);const a=tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);return o.platformBroker=a,this.config.auth.protocolMode===Bn.EAR?this.executeEarFlow(o,n):this.executeCodeFlow(o,n,r)}async executeCodeFlow(e,n,r){var u;const o=e.correlationId,a=this.initializeServerTelemetryManager(It.acquireTokenPopup),s=r||await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),l={...e,codeChallenge:s.challenge};try{const h=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:a,requestAuthority:l.authority,requestAzureCloudOptions:l.azureCloudOptions,requestExtraQueryParameters:l.extraQueryParameters,account:l.account});if(l.httpMethod===Oi.POST)return await this.executeCodeFlowWithPost(l,n,h,s.verifier);{const p=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,o)(this.config,h.authority,l,this.logger,this.performanceClient),g=this.initiateAuthRequest(p,n);this.eventHandler.emitEvent(Ve.POPUP_OPENED,We.Popup,{popupWindow:g},null);const w=await this.monitorPopupForHash(g,n.popupWindowParent),y=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await he(gd,$.HandleResponseCode,this.logger,this.performanceClient,o)(e,y,s.verifier,It.acquireTokenPopup,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(h){throw(u=n.popup)==null||u.close(),h instanceof At&&(h.setCorrelationId(this.correlationId),a.cacheFailedRequest(h)),h}}async executeEarFlow(e,n){const r=e.correlationId,o=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),a=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,r)(),s={...e,earJwk:a},l=n.popup||this.openPopup("about:blank",n);(await Sp(l.document,this.config,o,s,this.logger,this.performanceClient)).submit();const h=await he(this.monitorPopupForHash.bind(this),$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(l,n.popupWindowParent),p=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,r)(s,p,It.acquireTokenPopup,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,o){const a=e.correlationId,s=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,a)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),l=n.popup||this.openPopup("about:blank",n);(await Tp(l.document,this.config,s,e,this.logger,this.performanceClient)).submit();const h=await he(this.monitorPopupForHash.bind(this),$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,a)(l,n.popupWindowParent),p=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,a)(e,p,o,It.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,o){var s,l,u;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Ve.LOGOUT_START,We.Popup,e);const a=this.initializeServerTelemetryManager(It.logoutPopup);try{await this.clearCacheOnLogout(this.correlationId,e.account);const h=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{h.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&h.authority.protocolMode===Bn.OIDC){if(this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Popup,e),o){const w={apiId:It.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},y=pt.getAbsoluteUrl(o,Eo());await this.navigationClient.navigateInternal(y,w)}(l=n.popup)==null||l.close();return}}const p=h.getLogoutUri(e);this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Popup,e);const g=this.openPopup(p,n);if(this.eventHandler.emitEvent(Ve.POPUP_OPENED,We.Popup,{popupWindow:g},null),await this.monitorPopupForHash(g,n.popupWindowParent).catch(()=>{}),o){const w={apiId:It.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},y=pt.getAbsoluteUrl(o,Eo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${y}`),await this.navigationClient.navigateInternal(y,w)}else this.logger.verbose("No main window navigation requested")}catch(h){throw(u=n.popup)==null||u.close(),h instanceof At&&(h.setCorrelationId(this.correlationId),a.cacheFailedRequest(h)),this.eventHandler.emitEvent(Ve.LOGOUT_FAILURE,We.Popup,null,h),this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Popup),h}this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),Me(td)}monitorPopupForHash(e,n){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(Me(Ws));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(a);let l="";const u=this.config.auth.OIDCOptions.serverResponseType;e&&(u===Il.QUERY?l=e.location.search:l=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(l)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw Me(Ww);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),Me(jw)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:o}){var y,C,v,b;const a=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,l=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let h=(y=r.popupSize)==null?void 0:y.width,p=(C=r.popupSize)==null?void 0:C.height,g=(v=r.popupPosition)==null?void 0:v.top,w=(b=r.popupPosition)==null?void 0:b.left;return(!h||h<0||h>l)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),h=Vn.POPUP_WIDTH),(!p||p<0||p>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),p=Vn.POPUP_HEIGHT),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,u/2-Vn.POPUP_HEIGHT/2+s)),(!w||w<0||w>l)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),w=Math.max(0,l/2-Vn.POPUP_WIDTH/2+a)),o.open(e,n,`width=${h}, height=${p}, top=${g}, left=${w}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,n){return`${Vn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Vn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function HP(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class BP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,l,h,p),this.nativeStorage=u}async acquireToken(e){const n=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,We.Redirect);n.platformBroker=tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);const r=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(Ve.RESTORE_FROM_BFCACHE,We.Redirect))},o=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${o}`),this.browserStorage.setTemporaryCache(qt.ORIGIN_URI,o,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===Bn.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n,e.onRedirectNavigate)}catch(a){throw a instanceof At&&a.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),a}}async executeCodeFlow(e,n){const r=e.correlationId,o=this.initializeServerTelemetryManager(It.acquireTokenRedirect),a=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...e,codeChallenge:a.challenge};this.browserStorage.cacheAuthorizeRequest(s,a.verifier);try{if(s.httpMethod===Oi.POST)return await this.executeCodeFlowWithPost(s);{const l=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),u=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,l.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(u,n)}}catch(l){throw l instanceof At&&(l.setCorrelationId(this.correlationId),o.cacheFailedRequest(l)),l}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,n)(),a={...e,earJwk:o};return this.browserStorage.cacheAuthorizeRequest(a),(await Sp(document,this.config,r,a,this.logger,this.performanceClient)).submit(),new Promise((l,u)=>{setTimeout(()=>{u(Me(ad,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return this.browserStorage.cacheAuthorizeRequest(e),(await Tp(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((a,s)=>{setTimeout(()=>{s(Me(ad,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e="",n,r,o){const a=this.initializeServerTelemetryManager(It.handleRedirectPromise);try{const[s,l]=this.getRedirectResponse(e||"");if(!s)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),HP()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const u=this.browserStorage.getTemporaryCache(qt.ORIGIN_URI,!0)||ge.EMPTY_STRING,h=Jy(u),p=Jy(window.location.href);if(h===p&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),u.indexOf("#")>-1&&VN(u),await this.handleResponse(s,n,r,a);if(this.config.auth.navigateToLoginRequestUrl){if(!up()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(qt.URL_HASH,l,!0);const g={apiId:It.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let w=!0;if(!u||u==="null"){const y=GN();this.browserStorage.setTemporaryCache(qt.ORIGIN_URI,y,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),w=await this.navigationClient.navigateInternal(y,g)}else this.logger.verbose(`Navigating to loginRequestUrl: ${u}`),w=await this.navigationClient.navigateInternal(u,g);if(!w)return await this.handleResponse(s,n,r,a)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(s,n,r,a);return null}catch(s){throw s instanceof At&&(s.setCorrelationId(this.correlationId),a.cacheFailedRequest(s)),s}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===Il.QUERY?n=window.location.search:n=window.location.hash);let r=Rl(n);if(r){try{_P(r,this.browserCrypto,We.Redirect)}catch(a){return a instanceof At&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return Nb(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const o=this.browserStorage.getTemporaryCache(qt.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(qt.URL_HASH)),o&&(r=Rl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,n,r,o){if(!e.state)throw Me(Yh);if(e.ear_jwe){const l=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n.correlationId)({requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account});return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,n.correlationId)(n,e,It.acquireTokenRedirect,this.config,l,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const s=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority});return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,n.correlationId)(n,e,r,It.acquireTokenRedirect,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:It.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=n||this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Me(td)}async logout(e){var o;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(It.logout);try{this.eventHandler.emitEvent(Ve.LOGOUT_START,We.Redirect,e),await this.clearCacheOnLogout(this.correlationId,n.account);const a={apiId:It.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(s.authority.protocolMode===Bn.OIDC)try{s.authority.endSessionEndpoint}catch{if((o=n.account)!=null&&o.homeAccountId){this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Redirect,n);return}}const l=s.getLogoutUri(n);if(this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(l)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),await this.navigationClient.navigateExternal(l,a);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),await this.navigationClient.navigateExternal(l,a);return}}catch(a){throw a instanceof At&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),this.eventHandler.emitEvent(Ve.LOGOUT_FAILURE,We.Redirect,null,a),this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Redirect),a}this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return pt.getAbsoluteUrl(n,Eo())}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function zP(t,e,n,r,o){if(e.addQueueMeasurement($.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),Me(td);return o?he(GP,$.SilentHandlerLoadFrame,n,e,r)(t,o,e,r):sr(jP,$.SilentHandlerLoadFrameSync,n,e,r)(t)}async function VP(t,e,n,r,o){const a=yd();if(!a.contentDocument)throw"No document associated with iframe!";return(await Tp(a.contentDocument,t,e,n,r,o)).submit(),a}async function KP(t,e,n,r,o){const a=yd();if(!a.contentDocument)throw"No document associated with iframe!";return(await Sp(a.contentDocument,t,e,n,r,o)).submit(),a}async function Zb(t,e,n,r,o,a,s){return r.addQueueMeasurement($.SilentHandlerMonitorIframeForHash,a),new Promise((l,u)=>{e<hp&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${hp}ms). This may result in timeouts.`);const h=window.setTimeout(()=>{window.clearInterval(p),u(Me(qw))},e),p=window.setInterval(()=>{let g="";const w=t.contentWindow;try{g=w?w.location.href:""}catch{}if(!g||g==="about:blank")return;let y="";w&&(s===Il.QUERY?y=w.location.search:y=w.location.hash),window.clearTimeout(h),window.clearInterval(p),l(y)},n)}).finally(()=>{sr(WP,$.RemoveHiddenIframe,o,r,a)(t)})}function GP(t,e,n,r){return n.addQueueMeasurement($.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const s=yd();window.setTimeout(()=>{if(!s){a("Unable to load iframe");return}s.src=t,o(s)},e)})}function jP(t){const e=yd();return e.src=t,e}function yd(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function WP(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class qP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p,g){super(e,n,r,o,a,s,u,p,g),this.apiId=l,this.nativeStorage=h}async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==fn.NONE&&n.prompt!==fn.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${fn.NONE}`),n.prompt=fn.NONE):n.prompt=fn.NONE;const r=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,We.Silent);return r.platformBroker=tc(this.config,this.logger,this.platformAuthProvider,r.authenticationScheme),Db(r.authority),this.config.auth.protocolMode===Bn.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=this.initializeServerTelemetryManager(this.apiId);try{return n=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await he(this.silentTokenHelper.bind(this),$.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(o){if(o instanceof At&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!n||!(o instanceof At)||o.errorCode!==Vn.INVALID_GRANT_ERROR)throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await he(this.silentTokenHelper.bind(this),$.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,n)(),a={...e,earJwk:o},s=await he(KP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(this.config,r,a,this.logger,this.performanceClient),l=this.config.auth.OIDCOptions.serverResponseType,u=await he(Zb,$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,l),h=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,n)(u,l,this.logger);return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,n)(a,h,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(Me(nd))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement($.SilentIframeClientTokenHelper,r);const o=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),a={...n,codeChallenge:o.challenge};let s;if(n.httpMethod===Oi.POST)s=await he(VP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(this.config,e.authority,a,this.logger,this.performanceClient);else{const p=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,a,this.logger,this.performanceClient);s=await he(zP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(p,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait)}const l=this.config.auth.OIDCOptions.serverResponseType,u=await he(Zb,$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,l),h=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,r)(u,l,this.logger);return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,r)(n,h,o.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class YP extends Ua{async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentRefreshClientAcquireToken,e.correlationId);const n=await he(Cp,$.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(It.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return he(a.acquireTokenByRefreshToken.bind(a),$.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(Me(nd))}async createRefreshTokenClient(e){const n=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new dN(n,this.performanceClient)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class JP{constructor(e,n,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=o}async loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw Me(rd);const o=e.correlationId||Ur(),a=n.id_token?Na(n.id_token,Fr):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},l=e.authority?new bn(bn.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Ur()):void 0,u=await this.loadAccount(e,r.clientInfo||n.client_info||"",o,a,l),h=await this.loadIdToken(n,u.homeAccountId,u.environment,u.realm,o),p=await this.loadAccessToken(e,n,u.homeAccountId,u.environment,u.realm,r,o),g=await this.loadRefreshToken(n,u.homeAccountId,u.environment,o);return this.generateAuthenticationResult(e,{account:u,idToken:h,accessToken:p,refreshToken:g},a,l)}async loadAccount(e,n,r,o,a){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Rr.createFromAccountInfo(e.account);return await this.storage.setAccount(h,r),h}else if(!a||!n&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),Me(rb);const s=Rr.generateHomeAccountId(n,a.authorityType,this.logger,this.cryptoObj,o),l=o==null?void 0:o.tid,u=zh(this.storage,a,s,Fr,r,o,n,a.hostnameAndPort,l,void 0,void 0,this.logger);return await this.storage.setAccount(u,r),u}async loadIdToken(e,n,r,o,a){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Wl(n,r,e.id_token,this.config.auth.clientId,o);return await this.storage.setIdTokenCredential(s,a),s}async loadAccessToken(e,n,r,o,a,s,l){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const u=n.scope?Xt.fromString(n.scope):new Xt(e.scopes),h=s.expiresOn||n.expires_in+zn(),p=s.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+zn(),g=ql(r,o,n.access_token,this.config.auth.clientId,a,u.printScopes(),h,p,Fr);return await this.storage.setAccessTokenCredential(g,l),g}async loadRefreshToken(e,n,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const a=Cw(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(a,o),a}generateAuthenticationResult(e,n,r,o){var p,g,w;let a="",s=[],l=null,u;n!=null&&n.accessToken&&(a=n.accessToken.secret,s=Xt.fromString(n.accessToken.target).asArray(),l=Ma(n.accessToken.expiresOn),u=Ma(n.accessToken.extendedExpiresOn));const h=n.account;return{authority:o?o.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:s,account:h.getAccountInfo(),idToken:((p=n.idToken)==null?void 0:p.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:l,correlationId:e.correlationId||"",requestId:"",extExpiresOn:u,familyId:((g=n.refreshToken)==null?void 0:g.familyId)||"",tokenType:((w=n==null?void 0:n.accessToken)==null?void 0:w.tokenType)||"",state:e.state||"",cloudGraphHostName:h.cloudGraphHostName||"",msGraphHost:h.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class QP extends Mw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class XP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,u,h,p),this.apiId=l}async acquireToken(e){if(!e.code)throw Me(ob);const n=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,We.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...n,code:e.code},a=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),s=new QP(a);this.logger.verbose("Auth code client created");const l=new qb(s,this.browserStorage,o,this.logger,this.performanceClient);return await he(l.handleCodeResponseFromServer.bind(l),$.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(o){throw o instanceof At&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(Me(nd))}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function ZP(t,e,n){var s;const r=((s=window.msal)==null?void 0:s.clientIds)||[],o=r.length,a=r.filter(l=>l===t).length;a>1&&n.warning("There is already an instance of MSAL.js in the window with the same client id."),e.add({msalInstanceCount:o,sameClientIdInstanceCount:a})}/*! @azure/msal-browser v4.25.0 2025-10-09 */function wd(t,e,n){try{fp(t)}catch(r){throw e.end({success:!1},r,n),r}}class bd{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ao(this.logger,this.performanceClient):Ml,this.eventHandler=new bP(this.logger),this.browserStorage=this.isBrowserEnvironment?new bp(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,tN(this.config.auth)):uP(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Zt.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new bp(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new JP(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,n){const r=new bd(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e,n){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(Ve.INITIALIZE_END);return}const r=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),o=this.config.system.allowPlatformBroker,a=this.performanceClient.startMeasurement($.InitializeClientApplication,r);if(this.eventHandler.emitEvent(Ve.INITIALIZE_START),!n)try{this.logMultipleInstances(a)}catch{}if(await he(this.browserStorage.initialize.bind(this.browserStorage),$.InitializeCache,this.logger,this.performanceClient,r)(r),o)try{this.platformAuthProvider=await FP(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout)}catch(s){this.logger.verbose(s)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),sr(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),$.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,r)(r)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(Ve.INITIALIZE_END),a.end({allowPlatformBroker:o,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Ob(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){var u;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;if(((u=this.browserStorage.getInteractionInProgress())==null?void 0:u.type)===ii.SIGNOUT)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out"),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),o=this.browserStorage.getCachedNativeRequest(),a=o&&this.platformAuthProvider&&!e;let s;this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_START,We.Redirect);let l;try{if(a&&this.platformAuthProvider){s=this.performanceClient.startMeasurement($.AcquireTokenRedirect,(o==null?void 0:o.correlationId)||""),this.logger.trace("handleRedirectPromise - acquiring token from native platform"),s.add({isPlatformBrokerRequest:!0});const h=new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,o.accountId,this.nativeInternalStorage,o.correlationId);l=he(h.handleRedirectPromise.bind(h),$.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{const[h,p]=this.browserStorage.getCachedRequest(),g=h.correlationId;s=this.performanceClient.startMeasurement($.AcquireTokenRedirect,g),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const w=this.createRedirectClient(g);l=he(w.handleRedirectPromise.bind(w),$.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,h,p,s)}}catch(h){throw this.browserStorage.resetRequestCache(),h}return l.then(h=>(h?(this.browserStorage.resetRequestCache(),r.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(Ve.LOGIN_SUCCESS,We.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),s.end({success:!0},void 0,h.account)):s.event.errorCode?s.end({success:!1},void 0):s.discard(),this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_END,We.Redirect),h)).catch(h=>{this.browserStorage.resetRequestCache();const p=h;throw r.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Redirect,null,p):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Redirect,null,p),this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_END,We.Redirect),s.end({success:!1},p),h})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement($.AcquireTokenPreRedirect,n);r.add({scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const l=typeof o=="function"?o(s):void 0;return r.add({navigateCallbackResult:l!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,l};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=l=>{const u=typeof s=="function"?s(l):void 0;return r.add({navigateCallbackResult:u!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,u}}const a=this.getAllAccounts().length>0;try{Mb(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ii.SIGNIN),a?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Redirect,e):this.eventHandler.emitEvent(Ve.LOGIN_START,We.Redirect,e);let s;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?s=new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(u=>{if(r.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof io&&$a(u))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(u instanceof Lr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw u}):s=this.createRedirectClient(n).acquireToken(e),await s}catch(s){throw this.browserStorage.resetRequestCache(),r.event.status===2?this.performanceClient.startMeasurement($.AcquireTokenRedirect,n).end({success:!1},s,e.account):r.end({success:!1},s,e.account),a?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Redirect,null,s):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement($.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId});try{this.logger.verbose("acquireTokenPopup called",n),wd(this.initialized,r,e.account),this.browserStorage.setInteractionInProgress(!0,ii.SIGNIN)}catch(l){return Promise.reject(l)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Popup,e):this.eventHandler.emitEvent(Ve.LOGIN_START,We.Popup,e);let a;const s=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?(r.add({isPlatformBrokerRequest:!0}),a=this.acquireTokenNative({...e,correlationId:n},It.acquireTokenPopup).then(l=>(r.end({success:!0},void 0,l.account),l)).catch(l=>{if(r.add({brokerErrorName:l.name,brokerErrorCode:l.errorCode}),l instanceof io&&$a(l))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,s);if(l instanceof Lr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e,s);throw l})):a=this.createPopupClient(n).acquireToken(e,s),a.then(l=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(Ve.LOGIN_SUCCESS,We.Popup,l):this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Popup,l),r.end({success:!0,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length},void 0,l.account),l)).catch(l=>(o.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Popup,null,l):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Popup,null,l),r.end({success:!1},l,e.account),Promise.reject(l))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(n)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,s,l;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement($.SsoSilent,n),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId}),wd(this.initialized,this.ssoSilentMeasurement,e.account),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(Ve.SSO_SILENT_START,We.Silent,r);let o;return this.canUsePlatformBroker(r)?((l=this.ssoSilentMeasurement)==null||l.add({isPlatformBrokerRequest:!0}),o=this.acquireTokenNative(r,It.ssoSilent).catch(u=>{var h;if((h=this.ssoSilentMeasurement)==null||h.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof io&&$a(u))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw u})):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(u=>{var h;return this.eventHandler.emitEvent(Ve.SSO_SILENT_SUCCESS,We.Silent,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length},void 0,u.account),u}).catch(u=>{var h;throw this.eventHandler.emitEvent(Ve.SSO_SILENT_FAILURE,We.Silent,null,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},u,e.account),u}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement($.AcquireTokenByCode,n);wd(this.initialized,r),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_START,We.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Me(ab);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),a=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(s=>(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_SUCCESS,We.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length},void 0,s.account),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_FAILURE,We.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){r.add({isPlatformBrokerRequest:!0});const o=await this.acquireTokenNative({...e,correlationId:n},It.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof io&&$a(a)&&(this.platformAuthProvider=void 0),r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a});return r.end({success:!0},void 0,o.account),o}else throw Me(sb);else throw Me(ib)}catch(o){throw this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_FAILURE,We.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:a.fromCache}),a}).catch(a=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenFromCache,e.correlationId),n){case kn.Default:case kn.AccessToken:case kn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return he(r.acquireToken.bind(r),$.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(ni)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenByRefreshToken,e.correlationId),n){case kn.Default:case kn.AccessTokenAndRefreshToken:case kn.RefreshToken:case kn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return he(r.acquireToken.bind(r),$.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(ni)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement($.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return he(n.acquireToken.bind(n),$.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return Mb(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return fp(this.initialized),this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return fP(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return hP(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return pP(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return gP(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return mP(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();vP(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return yP(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=Rr.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,o){if(this.logger.trace("acquireTokenNative called"),!this.platformAuthProvider)throw Me(Zh);return new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,o)}canUsePlatformBroker(e,n){if(this.logger.trace("canUsePlatformBroker called"),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false"),!1;if(!tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case fn.NONE:case fn.CONSENT:case fn.LOGIN:case fn.SELECT_ACCOUNT:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new $P(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createRedirectClient(e){return new BP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentIframeClient(e){return new qP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentCacheClient(e){return new Jb(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentRefreshClient(e){return new YP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentAuthCodeClient(e){return new XP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.acquireTokenByCode,this.performanceClient,this.platformAuthProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return Pb(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Zt.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Zt.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Ur():ge.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||mb})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||mb})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement($.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),wd(this.initialized,r,e.account),this.logger.verbose("acquireTokenSilent called",n);const o=e.account||this.getActiveAccount();if(!o)throw Me(Xw);return this.acquireTokenSilentDeduped(e,o,n).then(a=>(r.end({success:!0,fromCache:a.fromCache,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length},void 0,a.account),{...a,state:e.state,correlationId:n})).catch(a=>{throw a instanceof At&&a.setCorrelationId(n),r.end({success:!1},a,o),a})}async acquireTokenSilentDeduped(e,n,r){const o=Jl(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),a=JSON.stringify(o),s=this.activeSilentTokenRequests.get(a);if(typeof s>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const l=he(this.acquireTokenSilentAsync.bind(this),$.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(a,l),l.finally(()=>{this.activeSilentTokenRequests.delete(a)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),s}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement($.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await he(CP,$.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||kn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async l=>{if(eO(l,a))if(this.activeIframeRequest)if(a!==kn.Skip){const[h,p]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${p}`,o.correlationId);const g=this.performanceClient.startMeasurement($.AwaitConcurrentIframe,o.correlationId);g.add({awaitIframeCorrelationId:p});const w=await h;if(g.end({success:w}),w)return this.logger.verbose(`Parallel iframe request with correlationId: ${p} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${p} failed. Interaction is required.`),l}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),$.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let h;return this.activeIframeRequest=[new Promise(p=>{h=p}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),$.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(p=>(h(!0),p)).catch(p=>{throw h(!1),p}).finally(()=>{this.activeIframeRequest=void 0})}else throw l}).then(l=>(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Silent,l),this.performanceClient.addFields({fromCache:l.fromCache},e.correlationId),l)).catch(l=>{throw this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Silent,null,l),l}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.performanceClient.addFields({isPlatformBrokerRequest:!0},e.correlationId),this.acquireTokenNative(e,It.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw this.performanceClient.addFields({brokerErrorName:r.name,brokerErrorCode:r.errorCode},e.correlationId),r instanceof io&&$a(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.platformAuthProvider=void 0,_e(ni)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),n===kn.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),he(this.acquireTokenFromCache.bind(this),$.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===kn.AccessToken)throw r;return this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_NETWORK_START,We.Silent,e),he(this.acquireTokenByRefreshToken.bind(this),$.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${n?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e){const n=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window."),window.msal.clientIds.push(n),ZP(n,e,this.logger)}}function eO(t,e){const n=!(t instanceof Lr&&t.subError!==Zl),r=t.errorCode===Vn.INVALID_GRANT_ERROR||t.errorCode===ni,o=n&&r||t.errorCode===Xl||t.errorCode===Hh,a=kN.includes(e);return o&&a}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function tO(t,e){const n=new $i(t);return await n.initialize(),bd.createController(n,e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ip{static async createPublicClientApplication(e){const n=await tO(e);return new Ip(e,n)}constructor(e,n){this.isBroker=!1,this.controller=n||new bd(new $i(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}function nO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const rO=x.forwardRef(nO);function oO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const kp=x.forwardRef(oO);function iO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Np=x.forwardRef(iO);function aO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const sO=x.forwardRef(aO);function cO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const lO=x.forwardRef(cO);function dO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const nc=x.forwardRef(dO);function uO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const fO=x.forwardRef(uO);function hO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const pO=x.forwardRef(hO);function gO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const mO=x.forwardRef(gO);function vO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const eC=x.forwardRef(vO);function yO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const wO=x.forwardRef(yO);function bO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const tC=x.forwardRef(bO);function Ke(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function nC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function rC(...t){return e=>{let n=!1;const r=t.map(o=>{const a=nC(o,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():nC(t[o],null)}}}}function kt(...t){return x.useCallback(rC(...t),t)}function CO(t,e){const n=x.createContext(e),r=a=>{const{children:s,...l}=a,u=x.useMemo(()=>l,Object.values(l));return d.jsx(n.Provider,{value:u,children:s})};r.displayName=t+"Provider";function o(a){const s=x.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[r,o]}function Io(t,e=[]){let n=[];function r(a,s){const l=x.createContext(s),u=n.length;n=[...n,s];const h=g=>{var k;const{scope:w,children:y,...C}=g,v=((k=w==null?void 0:w[t])==null?void 0:k[u])||l,b=x.useMemo(()=>C,Object.values(C));return d.jsx(v.Provider,{value:b,children:y})};h.displayName=a+"Provider";function p(g,w){var v;const y=((v=w==null?void 0:w[t])==null?void 0:v[u])||l,C=x.useContext(y);if(C)return C;if(s!==void 0)return s;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[h,p]}const o=()=>{const a=n.map(s=>x.createContext(s));return function(l){const u=(l==null?void 0:l[t])||a;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return o.scopeName=t,[r,xO(o,...e)]}function xO(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((l,{useScope:u,scopeName:h})=>{const g=u(a)[`__scope${h}`];return{...l,...g}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}var gn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_O=x[" useId ".trim().toString()]||(()=>{}),SO=0;function ko(t){const[e,n]=x.useState(_O());return gn(()=>{n(r=>r??String(SO++))},[t]),e?`radix-${e}`:""}var TO=x[" useInsertionEffect ".trim().toString()]||gn;function li({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,a,s]=EO({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:o;{const p=x.useRef(t!==void 0);x.useEffect(()=>{const g=p.current;g!==l&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${l?"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.`),p.current=l},[l,r])}const h=x.useCallback(p=>{var g;if(l){const w=AO(p)?p(t):p;w!==t&&((g=s.current)==null||g.call(s,w))}else a(p)},[l,t,a,s]);return[u,h]}function EO({defaultProp:t,onChange:e}){const[n,r]=x.useState(t),o=x.useRef(n),a=x.useRef(e);return TO(()=>{a.current=e},[e]),x.useEffect(()=>{var s;o.current!==n&&((s=a.current)==null||s.call(a,n),o.current=n)},[n,o]),[n,r,a]}function AO(t){return typeof t=="function"}function Ha(t){const e=IO(t),n=x.forwardRef((r,o)=>{const{children:a,...s}=r,l=x.Children.toArray(a),u=l.find(NO);if(u){const h=u.props.children,p=l.map(g=>g===u?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}var oC=Ha("Slot");function IO(t){const e=x.forwardRef((n,r)=>{const{children:o,...a}=n;if(x.isValidElement(o)){const s=OO(o),l=PO(a,o.props);return o.type!==x.Fragment&&(l.ref=r?rC(r,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var iC=Symbol("radix.slottable");function kO(t){const e=({children:n})=>d.jsx(d.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=iC,e}function NO(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===iC}function PO(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function OO(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var MO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=MO.reduce((t,e)=>{const n=Ha(`Primitive.${e}`),r=x.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function aC(t,e){t&&$s.flushSync(()=>t.dispatchEvent(e))}function xr(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function DO(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var RO="DismissableLayer",Pp="dismissableLayer.update",LO="dismissableLayer.pointerDownOutside",FO="dismissableLayer.focusOutside",sC,cC=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rc=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=t,h=x.useContext(cC),[p,g]=x.useState(null),w=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),C=kt(e,H=>g(H)),v=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),k=v.indexOf(b),A=p?v.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,O=A>=k,T=$O(H=>{const W=H.target,ee=[...h.branches].some(q=>q.contains(W));!O||ee||(o==null||o(H),s==null||s(H),H.defaultPrevented||l==null||l())},w),L=HO(H=>{const W=H.target;[...h.branches].some(q=>q.contains(W))||(a==null||a(H),s==null||s(H),H.defaultPrevented||l==null||l())},w);return DO(H=>{A===h.layers.size-1&&(r==null||r(H),!H.defaultPrevented&&l&&(H.preventDefault(),l()))},w),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(sC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),dC(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=sC)}},[p,w,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),dC())},[p,h]),x.useEffect(()=>{const H=()=>y({});return document.addEventListener(Pp,H),()=>document.removeEventListener(Pp,H)},[]),d.jsx(tt.div,{...u,ref:C,style:{pointerEvents:N?O?"auto":"none":void 0,...t.style},onFocusCapture:Ke(t.onFocusCapture,L.onFocusCapture),onBlurCapture:Ke(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ke(t.onPointerDownCapture,T.onPointerDownCapture)})});rc.displayName=RO;var UO="DismissableLayerBranch",lC=x.forwardRef((t,e)=>{const n=x.useContext(cC),r=x.useRef(null),o=kt(e,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(tt.div,{...t,ref:o})});lC.displayName=UO;function $O(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){uC(LO,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function HO(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t),r=x.useRef(!1);return x.useEffect(()=>{const o=a=>{a.target&&!r.current&&uC(FO,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dC(){const t=new CustomEvent(Pp);document.dispatchEvent(t)}function uC(t,e,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?aC(o,a):o.dispatchEvent(a)}var BO=rc,zO=lC,Op="focusScope.autoFocusOnMount",Mp="focusScope.autoFocusOnUnmount",fC={bubbles:!1,cancelable:!0},VO="FocusScope",Dp=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=t,[l,u]=x.useState(null),h=xr(o),p=xr(a),g=x.useRef(null),w=kt(e,v=>u(v)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let v=function(N){if(y.paused||!l)return;const O=N.target;l.contains(O)?g.current=O:di(g.current,{select:!0})},b=function(N){if(y.paused||!l)return;const O=N.relatedTarget;O!==null&&(l.contains(O)||di(g.current,{select:!0}))},k=function(N){if(document.activeElement===document.body)for(const T of N)T.removedNodes.length>0&&di(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const A=new MutationObserver(k);return l&&A.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),A.disconnect()}}},[r,l,y.paused]),x.useEffect(()=>{if(l){gC.add(y);const v=document.activeElement;if(!l.contains(v)){const k=new CustomEvent(Op,fC);l.addEventListener(Op,h),l.dispatchEvent(k),k.defaultPrevented||(KO(YO(hC(l)),{select:!0}),document.activeElement===v&&di(l))}return()=>{l.removeEventListener(Op,h),setTimeout(()=>{const k=new CustomEvent(Mp,fC);l.addEventListener(Mp,p),l.dispatchEvent(k),k.defaultPrevented||di(v??document.body,{select:!0}),l.removeEventListener(Mp,p),gC.remove(y)},0)}}},[l,h,p,y]);const C=x.useCallback(v=>{if(!n&&!r||y.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,k=document.activeElement;if(b&&k){const A=v.currentTarget,[N,O]=GO(A);N&&O?!v.shiftKey&&k===O?(v.preventDefault(),n&&di(N,{select:!0})):v.shiftKey&&k===N&&(v.preventDefault(),n&&di(O,{select:!0})):k===A&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(tt.div,{tabIndex:-1,...s,ref:w,onKeyDown:C})});Dp.displayName=VO;function KO(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(di(r,{select:e}),document.activeElement!==n)return}function GO(t){const e=hC(t),n=pC(e,t),r=pC(e.reverse(),t);return[n,r]}function hC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function pC(t,e){for(const n of t)if(!jO(n,{upTo:e}))return n}function jO(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function WO(t){return t instanceof HTMLInputElement&&"select"in t}function di(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&WO(t)&&e&&t.select()}}var gC=qO();function qO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=mC(t,e),t.unshift(e)},remove(e){var n;t=mC(t,e),(n=t[0])==null||n.resume()}}}function mC(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function YO(t){return t.filter(e=>e.tagName!=="A")}var JO="Portal",oc=x.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,a]=x.useState(!1);gn(()=>a(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?iy.createPortal(d.jsx(tt.div,{...r,ref:e}),s):null});oc.displayName=JO;function QO(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var No=t=>{const{present:e,children:n}=t,r=XO(e),o=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=kt(r.ref,ZO(o));return typeof n=="function"||r.isPresent?x.cloneElement(o,{ref:a}):null};No.displayName="Presence";function XO(t){const[e,n]=x.useState(),r=x.useRef(null),o=x.useRef(t),a=x.useRef("none"),s=t?"mounted":"unmounted",[l,u]=QO(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Cd(r.current);a.current=l==="mounted"?h:"none"},[l]),gn(()=>{const h=r.current,p=o.current;if(p!==t){const w=a.current,y=Cd(h);t?u("MOUNT"):y==="none"||(h==null?void 0:h.display)==="none"?u("UNMOUNT"):u(p&&w!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),gn(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=y=>{const v=Cd(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&v&&(u("ANIMATION_END"),!o.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},w=y=>{y.target===e&&(a.current=Cd(r.current))};return e.addEventListener("animationstart",w),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",w),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Cd(t){return(t==null?void 0:t.animationName)||"none"}function ZO(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Rp=0;function vC(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yC()),document.body.insertAdjacentElement("beforeend",t[1]??yC()),Rp++,()=>{Rp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Rp--}},[])}function yC(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ao=function(){return ao=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ao.apply(this,arguments)};function wC(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function Hi(t,e,n,r){function o(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(p){try{h(r.next(p))}catch(g){s(g)}}function u(p){try{h(r.throw(p))}catch(g){s(g)}}function h(p){p.done?a(p.value):o(p.value).then(l,u)}h((r=r.apply(t,e||[])).next())})}function bC(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,a=[],s;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(l){s={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function CC(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,a;r<o;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var xd="right-scroll-bar-position",_d="width-before-scroll-bar",e1="with-scroll-bars-hidden",t1="--removed-body-scroll-bar-size";function Lp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function n1(t,e){var n=M.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var r1=typeof window<"u"?x.useLayoutEffect:x.useEffect,xC=new WeakMap;function o1(t,e){var n=n1(null,function(r){return t.forEach(function(o){return Lp(o,r)})});return r1(function(){var r=xC.get(n);if(r){var o=new Set(r),a=new Set(t),s=n.current;o.forEach(function(l){a.has(l)||Lp(l,null)}),a.forEach(function(l){o.has(l)||Lp(l,s)})}xC.set(n,t)},[t]),n}function i1(t){return t}function a1(t,e){e===void 0&&(e=i1);var n=[],r=!1,o={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]:t},useMedium:function(a){var s=e(a,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(a),s=n}var u=function(){var p=s;s=[],p.forEach(a)},h=function(){return Promise.resolve().then(u)};h(),n={push:function(p){s.push(p),h()},filter:function(p){return s=s.filter(p),n}}}};return o}function s1(t){t===void 0&&(t={});var e=a1(null);return e.options=ao({async:!0,ssr:!1},t),e}var _C=function(t){var e=t.sideCar,n=wC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ao({},n))};_C.isSideCarExport=!0;function c1(t,e){return t.useMedium(e),_C}var SC=s1(),Fp=function(){},Sd=x.forwardRef(function(t,e){var n=x.useRef(null),r=x.useState({onScrollCapture:Fp,onWheelCapture:Fp,onTouchMoveCapture:Fp}),o=r[0],a=r[1],s=t.forwardProps,l=t.children,u=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,w=t.sideCar,y=t.noRelative,C=t.noIsolation,v=t.inert,b=t.allowPinchZoom,k=t.as,A=k===void 0?"div":k,N=t.gapMode,O=wC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=w,L=o1([n,e]),H=ao(ao({},O),o);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:SC,removeScrollBar:h,shards:g,noRelative:y,noIsolation:C,inert:v,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),s?x.cloneElement(x.Children.only(l),ao(ao({},H),{ref:L})):x.createElement(A,ao({},H,{className:u,ref:L}),l))});Sd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Sd.classNames={fullWidth:_d,zeroRight:xd};var l1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d1(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=l1();return e&&t.setAttribute("nonce",e),t}function u1(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function f1(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var h1=function(){var t=0,e=null;return{add:function(n){t==0&&(e=d1())&&(u1(e,n),f1(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},p1=function(){var t=h1();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},TC=function(){var t=p1(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},g1={left:0,top:0,right:0,gap:0},Up=function(t){return parseInt(t||"",10)||0},m1=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Up(n),Up(r),Up(o)]},v1=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return g1;var e=m1(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},y1=TC(),Ba="data-scroll-locked",w1=function(t,e,n,r){var o=t.left,a=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
7
+ ${s}`);return}throw Pw(e.error,e.error_description,e.suberror)?new Lr(e.error,e.error_description,e.suberror,e.timestamp||ge.EMPTY_STRING,e.trace_id||ge.EMPTY_STRING,e.correlation_id||ge.EMPTY_STRING,e.claims||ge.EMPTY_STRING,a):s}}async handleServerTokenResponse(e,n,r,o,a,s,l,u,h){var C;(C=this.performanceClient)==null||C.addQueueMeasurement($.HandleServerTokenResponse,e.correlation_id);let p;if(e.id_token){if(p=Na(e.id_token||ge.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&p.nonce!==a.nonce)throw _e(wy);if(o.maxAge||o.maxAge===0){const v=p.auth_time;if(!v)throw _e(ih);Wy(v,o.maxAge)}}this.homeAccountIdentifier=Rr.generateHomeAccountId(e.client_info||ge.EMPTY_STRING,n.authorityType,this.logger,this.cryptoObj,p);let g;a&&a.state&&(g=Da.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const w=this.generateCacheRecord(e,n,r,o,p,s,a);let y;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),y=new cN(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(y)),l&&!u&&w.account){const v=this.cacheStorage.generateAccountKey(w.account.getAccountInfo());if(!this.cacheStorage.getAccount(v,o.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Li.generateAuthenticationResult(this.cryptoObj,n,w,!1,o,p,g,void 0,h)}await this.cacheStorage.saveCacheRecord(w,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&y&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(y))}return Li.generateAuthenticationResult(this.cryptoObj,n,w,!1,o,p,g,e,h)}generateCacheRecord(e,n,r,o,a,s,l){const u=n.getPreferredCache();if(!u)throw _e(ch);const h=Iw(a);let p,g;e.id_token&&a&&(p=Wl(this.homeAccountIdentifier,u,e.id_token,this.clientId,h||""),g=zh(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,a,e.client_info,u,h,l,void 0,this.logger));let w=null;if(e.access_token){const v=e.scope?Xt.fromString(e.scope):new Xt(o.scopes||[]),b=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,k=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,A=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,N=r+b,O=N+k,T=A&&A>0?r+A:void 0;w=ql(this.homeAccountIdentifier,u,e.access_token,this.clientId,h||n.tenant||"",v.printScopes(),N,O,this.cryptoObj.base64Decode,T,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let y=null;if(e.refresh_token){let v;if(e.refresh_token_expires_in){const b=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;v=r+b}y=Cw(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,s,v)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:u,familyId:e.foci}),{account:g,idToken:p,accessToken:w,refreshToken:y,appMetadata:C}}static async generateAuthenticationResult(e,n,r,o,a,s,l,u,h){var N,O,T,L,H;let p=ge.EMPTY_STRING,g=[],w=null,y,C,v=ge.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===_t.POP&&!a.popKid){const W=new Ra(e),{secret:ee,keyId:q}=r.accessToken;if(!q)throw _e(uh);p=await W.signPopToken(ee,q,a)}else p=r.accessToken.secret;g=Xt.fromString(r.accessToken.target).asArray(),w=Ma(r.accessToken.expiresOn),y=Ma(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(C=Ma(r.accessToken.refreshOn))}r.appMetadata&&(v=r.appMetadata.familyId===Nl?Nl:"");const b=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",k=(s==null?void 0:s.tid)||"";u!=null&&u.spa_accountid&&r.account&&(r.account.nativeAccountId=u==null?void 0:u.spa_accountid);const A=r.account?bh(r.account.getAccountInfo(),void 0,s,(N=r.idToken)==null?void 0:N.secret):null;return{authority:n.canonicalAuthority,uniqueId:b,tenantId:k,scopes:g,account:A,idToken:((O=r==null?void 0:r.idToken)==null?void 0:O.secret)||"",idTokenClaims:s||{},accessToken:p,fromCache:o,expiresOn:w,extExpiresOn:y,refreshOn:C,correlationId:a.correlationId,requestId:h||ge.EMPTY_STRING,familyId:v,tokenType:((T=r.accessToken)==null?void 0:T.tokenType)||ge.EMPTY_STRING,state:l?l.userRequestState:ge.EMPTY_STRING,cloudGraphHostName:((L=r.account)==null?void 0:L.cloudGraphHostName)||ge.EMPTY_STRING,msGraphHost:((H=r.account)==null?void 0:H.msGraphHost)||ge.EMPTY_STRING,code:u==null?void 0:u.spa_code,fromNativeBroker:!1}}}function zh(t,e,n,r,o,a,s,l,u,h,p,g){g==null||g.verbose("setCachedAccount called");const y=t.getAccountKeys().find(A=>A.startsWith(n));let C=null;y&&(C=t.getAccount(y,o));const v=C||Rr.createAccount({homeAccountId:n,idTokenClaims:a,clientInfo:s,environment:l,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:p},e,r),b=v.tenantProfiles||[],k=u||v.realm;if(k&&!b.find(A=>A.tenantId===k)){const A=wh(n,v.localAccountId,k,a);b.push(A)}return v.tenantProfiles=b,v}/*! @azure/msal-common v15.13.0 2025-09-24 */async function Ow(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}/*! @azure/msal-common v15.13.0 2025-09-24 */class Mw extends $h{constructor(e,n){var r;super(e,n),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,n){var l,u;if((l=this.performanceClient)==null||l.addQueueMeasurement($.AuthClientAcquireToken,e.correlationId),!e.code)throw _e(xy);const r=Bn(),o=await he(this.executeTokenRequest.bind(this),$.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(u=o.headers)==null?void 0:u[In.X_MS_REQUEST_ID],s=new Li(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),he(s.handleServerTokenResponse.bind(s),$.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,n,void 0,void 0,void 0,a)}getLogoutUri(e){if(!e)throw Nt(Fy);const n=this.createLogoutUrlQueryString(e);return pt.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n){var h;(h=this.performanceClient)==null||h.addQueueMeasurement($.AuthClientExecuteTokenRequest,n.correlationId);const r=this.createTokenQueryParameters(n),o=pt.appendQueryString(e.tokenEndpoint,r),a=await he(this.createTokenRequestBody.bind(this),$.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,n.correlationId)(n);let s;if(n.clientInfo)try{const p=Ul(n.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${p.uid}${Hs.CLIENT_INFO_SEPARATOR}${p.utid}`,type:Mr.HOME_ACCOUNT_ID}}catch(p){this.logger.verbose("Could not parse client info for CCS Header: "+p)}const l=this.createTokenRequestHeaders(s||n.ccsCredential),u=Jl(this.config.authOptions.clientId,n);return he(this.executePostToTokenEndpoint.bind(this),$.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,n.correlationId)(o,a,l,u,n.correlationId,$.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement($.AuthClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(kh(n,e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[Di])||this.config.authOptions.clientId),this.includeRedirectUri)Nh(n,e.redirectUri);else if(!e.redirectUri)throw Nt(Oy);if(Ih(n,e.scopes,!0,this.oidcDefaultScopes),Lk(n,e.code),Mh(n,this.config.libraryInfo),Dh(n,this.config.telemetry.application),ww(n),this.serverTelemetryManager&&!ow(this.config)&&yw(n,this.serverTelemetryManager),e.codeVerifier&&Uk(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&fw(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;hw(n,await Ow(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),pw(n,s.assertionType)}if(gw(n,ly.AUTHORIZATION_CODE_GRANT),Rh(n),e.authenticationScheme===_t.POP){const s=new Ra(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await he(s.generateCnf.bind(s),$.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Lh(n,l)}else if(e.authenticationScheme===_t.SSH)if(e.sshJwk)vw(n,e.sshJwk);else throw Nt(Dl);(!ar.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ph(n,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=Ul(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${Hs.CLIENT_INFO_SEPARATOR}${s.utid}`,type:Mr.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Mr.HOME_ACCOUNT_ID:try{const s=Oa(r.credential);Ks(n,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Mr.UPN:Vl(n,r.credential);break}return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&oi(n,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[cw])&&oi(n,{[cw]:"1"}),Bl(n,e.correlationId,this.performanceClient),Vs(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&Pk(n,e.postLogoutRedirectUri),e.correlationId&&Oh(n,e.correlationId),e.idTokenHint&&Ok(n,e.idTokenHint),e.state&&dw(n,e.state),e.logoutHint&&Hk(n,e.logoutHint),e.extraQueryParameters&&oi(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&mw(n),Vs(n,this.config.authOptions.encodeExtraQueryParams,e.extraQueryParameters)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const lN=300;class dN extends $h{constructor(e,n){super(e,n)}async acquireToken(e){var s,l;(s=this.performanceClient)==null||s.addQueueMeasurement($.RefreshTokenClientAcquireToken,e.correlationId);const n=Bn(),r=await he(this.executeTokenRequest.bind(this),$.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(l=r.headers)==null?void 0:l[In.X_MS_REQUEST_ID],a=new Li(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),he(a.handleServerTokenResponse.bind(a),$.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,n,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Nt(Ly);if((r=this.performanceClient)==null||r.addQueueMeasurement($.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw _e(sh);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Lr&&o.errorCode===Xl,s=o instanceof Ri&&o.errorCode===dy.INVALID_GRANT_ERROR&&o.subError===dy.CLIENT_MISMATCH_ERROR;if(a||s)return he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return he(this.acquireTokenWithCachedRefreshToken.bind(this),$.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,n){var a,s,l;(a=this.performanceClient)==null||a.addQueueMeasurement($.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=sr(this.cacheManager.getRefreshToken.bind(this.cacheManager),$.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0,this.performanceClient);if(!r)throw ed(Xl);if(r.expiresOn&&jl(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||lN))throw(s=this.performanceClient)==null||s.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),ed(Hh);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||_t.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Mr.HOME_ACCOUNT_ID}};try{return await he(this.acquireToken.bind(this),$.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(u){if(u instanceof Lr&&((l=this.performanceClient)==null||l.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),u.subError===Zl)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const h=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(h,e.correlationId)}throw u}}async executeTokenRequest(e,n){var u;(u=this.performanceClient)==null||u.addQueueMeasurement($.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=pt.appendQueryString(n.tokenEndpoint,r),a=await he(this.createTokenRequestBody.bind(this),$.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),l=Jl(this.config.authOptions.clientId,e);return he(this.executePostToTokenEndpoint.bind(this),$.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,s,l,e.correlationId,$.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,a;(r=this.performanceClient)==null||r.addQueueMeasurement($.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const n=new Map;if(kh(n,e.embeddedClientId||((o=e.tokenBodyParameters)==null?void 0:o[Di])||this.config.authOptions.clientId),e.redirectUri&&Nh(n,e.redirectUri),Ih(n,e.scopes,!0,(a=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:a.defaultScopes),gw(n,ly.REFRESH_TOKEN_GRANT),Rh(n),Mh(n,this.config.libraryInfo),Dh(n,this.config.telemetry.application),ww(n),this.serverTelemetryManager&&!ow(this.config)&&yw(n,this.serverTelemetryManager),Fk(n,e.refreshToken),this.config.clientCredentials.clientSecret&&fw(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;hw(n,await Ow(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),pw(n,s.assertionType)}if(e.authenticationScheme===_t.POP){const s=new Ra(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await he(s.generateCnf.bind(s),$.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Lh(n,l)}else if(e.authenticationScheme===_t.SSH)if(e.sshJwk)vw(n,e.sshJwk);else throw Nt(Dl);if((!ar.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Ph(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Mr.HOME_ACCOUNT_ID:try{const s=Oa(e.ccsCredential.credential);Ks(n,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case Mr.UPN:Vl(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Kl(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&oi(n,e.tokenBodyParameters),Bl(n,e.correlationId,this.performanceClient),Vs(n)}}/*! @azure/msal-common v15.13.0 2025-09-24 */class uN extends $h{constructor(e,n){super(e,n)}async acquireCachedToken(e){var u;(u=this.performanceClient)==null||u.addQueueMeasurement($.SilentFlowClientAcquireCachedToken,e.correlationId);let n=Mi.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!ar.isEmptyObj(e.claims))throw this.setCacheOutcome(Mi.FORCE_REFRESH_OR_CLAIMS,e.correlationId),_e(ni);if(!e.account)throw _e(sh);const r=e.account.tenantId||eN(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r);if(a){if(Wk(a.cachedAt)||jl(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mi.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),_e(ni);a.refreshOn&&jl(a.refreshOn,0)&&(n=Mi.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mi.NO_CACHED_ACCESS_TOKEN,e.correlationId),_e(ni);const s=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,r,this.performanceClient),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await he(this.generateResultFromCacheRecord.bind(this),$.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(l,e),n]}setCacheOutcome(e,n){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},n),e!==Mi.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,n){var o;(o=this.performanceClient)==null||o.addQueueMeasurement($.SilentFlowClientGenerateResultFromCacheRecord,n.correlationId);let r;if(e.idToken&&(r=Na(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw _e(ih);Wy(a,n.maxAge)}return Li.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,r)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const fN={sendGetRequestAsync:()=>Promise.reject(_e(st)),sendPostRequestAsync:()=>Promise.reject(_e(st))};/*! @azure/msal-common v15.13.0 2025-09-24 */function hN(t,e,n,r){var l,u;const o=e.correlationId,a=new Map;kh(a,e.embeddedClientId||((l=e.extraQueryParameters)==null?void 0:l[Di])||t.clientId);const s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Ih(a,s,!0,(u=t.authority.options.OIDCOptions)==null?void 0:u.defaultScopes),Nh(a,e.redirectUri),Oh(a,o),kk(a,e.responseMode),Rh(a),e.prompt&&(Dk(a,e.prompt),r==null||r.addFields({prompt:e.prompt},o)),e.domainHint&&(Mk(a,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},o)),e.prompt!==fn.SELECT_ACCOUNT)if(e.sid&&e.prompt===fn.NONE)n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),lw(a,e.sid),r==null||r.addFields({sidFromRequest:!0},o);else if(e.account){const h=mN(e.account);let p=vN(e.account);if(p&&e.domainHint&&(n.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),p=null),p){n.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),zl(a,p),r==null||r.addFields({loginHintFromClaim:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(h&&e.prompt===fn.NONE){n.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),lw(a,h),r==null||r.addFields({sidFromClaim:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)n.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),zl(a,e.loginHint),Vl(a,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o);else if(e.account.username){n.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),zl(a,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},o);try{const g=Oa(e.account.homeAccountId);Ks(a,g)}catch{n.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(n.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),zl(a,e.loginHint),Vl(a,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o));else n.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&Rk(a,e.nonce),e.state&&dw(a,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&Ph(a,e.claims,t.clientCapabilities),e.embeddedClientId&&Kl(a,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Eh))&&mw(a),a}function Vh(t,e,n,r){const o=Vs(e,n,r);return pt.appendQueryString(t.authorizationEndpoint,o)}function pN(t,e){if(Dw(t,e),!t.code)throw _e(Ay);return t}function Dw(t,e){if(!t.state||!e)throw t.state?_e(oh,"Cached State"):_e(oh,"Server State");let n,r;try{n=decodeURIComponent(t.state)}catch{throw _e(ka,t.state)}try{r=decodeURIComponent(e)}catch{throw _e(ka,t.state)}if(n!==r)throw _e(yy);if(t.error||t.error_description||t.suberror){const o=gN(t);throw Pw(t.error,t.error_description,t.suberror)?new Lr(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new Ri(t.error||"",t.error_description,t.suberror,o)}}function gN(t){var r,o;const e="code=",n=(r=t.error_uri)==null?void 0:r.lastIndexOf(e);return n&&n>=0?(o=t.error_uri)==null?void 0:o.substring(n+e.length):void 0}function mN(t){var e;return((e=t.idTokenClaims)==null?void 0:e.sid)||null}function vN(t){var e;return t.loginHint||((e=t.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.13.0 2025-09-24 */const Rw=",",Lw="|";function yN(t){const{skus:e,libraryName:n,libraryVersion:r,extensionName:o,extensionVersion:a}=t,s=new Map([[0,[n,r]],[2,[o,a]]]);let l=[];if(e!=null&&e.length){if(l=e.split(Rw),l.length<4)return e}else l=Array.from({length:4},()=>Lw);return s.forEach((u,h)=>{var p,g;u.length===2&&((p=u[0])!=null&&p.length)&&((g=u[1])!=null&&g.length)&&wN({skuArr:l,index:h,skuName:u[0],skuVersion:u[1]})}),l.join(Rw)}function wN(t){const{skuArr:e,index:n,skuName:r,skuVersion:o}=t;n>=e.length||(e[n]=[r,o].join(Lw))}class js{constructor(e,n){this.cacheOutcome=Mi.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||ge.EMPTY_STRING,this.wrapperVer=e.wrapperVer||ge.EMPTY_STRING,this.telemetryCacheKey=pn.CACHE_KEY+Hs.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${pn.VALUE_SEPARATOR}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&n.push(`broker_error=${r}`);const o=n.join(pn.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),s=[e,a].join(pn.VALUE_SEPARATOR);return[pn.SCHEMA_VERSION,s,o].join(pn.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=js.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*n).join(pn.VALUE_SEPARATOR),o=e.errors.slice(0,n).join(pn.VALUE_SEPARATOR),a=e.errors.length,s=n<a?pn.OVERFLOW_TRUE:pn.OVERFLOW_FALSE,l=[a,s].join(pn.VALUE_SEPARATOR);return[pn.SCHEMA_VERSION,e.cacheHits,r,o,l].join(pn.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const n=this.getLastRequests();n.errors.length>=pn.MAX_CACHED_ERRORS&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof At?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(pn.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=js.maxErrorsToSend(e),r=e.errors.length;if(n===r)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const o={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let n,r=0,o=0;const a=e.errors.length;for(n=0;n<a;n++){const s=e.failedRequests[2*n]||ge.EMPTY_STRING,l=e.failedRequests[2*n+1]||ge.EMPTY_STRING,u=e.errors[n]||ge.EMPTY_STRING;if(o+=s.toString().length+l.toString().length+u.length+3,o<pn.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||ge.EMPTY_STRING),e.push(this.regionSource||ge.EMPTY_STRING),e.push(this.regionOutcome||ge.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const n=this.getLastRequests();n.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return yN(e)}}/*! @azure/msal-common v15.13.0 2025-09-24 */const Fw="missing_kid_error",Uw="missing_alg_error";/*! @azure/msal-common v15.13.0 2025-09-24 */const bN={[Fw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Uw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class Kh extends At{constructor(e,n){super(e,n),this.name="JoseHeaderError",Object.setPrototypeOf(this,Kh.prototype)}}function $w(t){return new Kh(t,bN[t])}/*! @azure/msal-common v15.13.0 2025-09-24 */class Gh{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw $w(Fw);if(!e.alg)throw $w(Uw);const n=new Gh({typ:e.typ||hI.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(n)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const jh="pkce_not_created",Wh="ear_jwk_empty",Hw="ear_jwe_empty",qh="crypto_nonexistent",td="empty_navigate_uri",Bw="hash_empty_error",Yh="no_state_in_hash",zw="hash_does_not_contain_known_properties",Vw="unable_to_parse_state",Kw="state_interaction_type_mismatch",Gw="interaction_in_progress",jw="popup_window_error",Ww="empty_window_error",Ws="user_cancelled",CN="monitor_popup_timeout",qw="monitor_window_timeout",Yw="redirect_in_iframe",Jw="block_iframe_reload",Qw="block_nested_popups",xN="iframe_closed_prematurely",nd="silent_logout_unsupported",Xw="no_account_error",_N="silent_prompt_value_error",Zw="no_token_request_cache_error",eb="unable_to_parse_token_request_cache_error",SN="auth_request_not_set_error",TN="invalid_cache_type",rd="non_browser_environment",La="database_not_open",od="no_network_connectivity",tb="post_request_failed",nb="get_request_failed",Jh="failed_to_parse_response",rb="unable_to_load_token",Qh="crypto_key_not_found",ob="auth_code_required",ib="auth_code_or_nativeAccountId_required",ab="spa_code_and_nativeAccountId_present",Xh="database_unavailable",sb="unable_to_acquire_token_from_native_platform",cb="native_handshake_timeout",lb="native_extension_not_installed",Zh="native_connection_not_established",qs="uninitialized_public_client_application",db="native_prompt_not_supported",ub="invalid_base64_string",fb="invalid_pop_token_request",hb="failed_to_build_headers",pb="failed_to_parse_headers",id="failed_to_decrypt_ear_response",ad="timed_out";/*! @azure/msal-browser v4.25.0 2025-10-09 */const To="For more visit: aka.ms/msaljs/browser-errors",EN={[jh]:"The PKCE code challenge and verifier could not be generated.",[Wh]:"No EAR encryption key provided. This is unexpected.",[Hw]:"Server response does not contain ear_jwe property. This is unexpected.",[qh]:"The crypto object or function is not available.",[td]:"Navigation URI is empty. Please check stack trace for more info.",[Bw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${To}`,[Yh]:"Hash does not contain state. Please verify that the request originated from msal.",[zw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${To}`,[Vw]:"Unable to parse state. Please verify that the request originated from msal.",[Kw]:"Hash contains state but the interaction type does not match the caller.",[Gw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${To}`,[jw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Ww]:"window.open returned null or undefined window object.",[Ws]:"User cancelled the flow.",[CN]:`Token acquisition in popup failed due to timeout. ${To}`,[qw]:`Token acquisition in iframe failed due to timeout. ${To}`,[Yw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Jw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${To}`,[Qw]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[xN]:"The iframe being monitored was closed prematurely.",[nd]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Xw]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[_N]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Zw]:"No token request found in cache.",[eb]:"The cached token request could not be parsed.",[SN]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[TN]:"Invalid cache type",[rd]:"Login and token requests are not supported in non-browser environments.",[La]:"Database is not open!",[od]:"No network connectivity. Check your internet connection.",[tb]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[nb]:"Network request failed. Please check the network trace to determine root cause.",[Jh]:"Failed to parse network response. Check network trace.",[rb]:"Error loading token to cache.",[Qh]:"Cryptographic Key or Keypair not found in browser storage.",[ob]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[ib]:"An authorization code or nativeAccountId must be provided to this flow.",[ab]:"Request cannot contain both spa code and native account id.",[Xh]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[sb]:`Unable to acquire token from native platform. ${To}`,[cb]:"Timed out while attempting to establish connection to browser extension",[lb]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Zh]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${To}`,[qs]:`You must call and await the initialize function before attempting to call any other MSAL API. ${To}`,[db]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[ub]:"Invalid base64 encoded string.",[fb]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[hb]:"Failed to build request headers object.",[pb]:"Failed to parse response headers",[id]:"Failed to decrypt ear response",[ad]:"The request timed out."};class Ys extends At{constructor(e,n){super(e,EN[e],n),Object.setPrototypeOf(this,Ys.prototype),this.name="BrowserAuthError"}}function Me(t,e){return new Ys(t,e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const zn={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},Cr={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS",MICROSOFT_ENTRA_BROKERID:"MicrosoftEntra",DOM_API_NAME:"DOM API",PLATFORM_DOM_APIS:"get-token-and-sign-out",PLATFORM_DOM_PROVIDER:"PlatformAuthDOMHandler",PLATFORM_EXTENSION_PROVIDER:"PlatformAuthExtensionHandler"},Js={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Zt={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},gb={GET:"GET",POST:"POST"},ii={SIGNIN:"signin",SIGNOUT:"signout"},Yt={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},sd={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},It={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var We;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(We||(We={}));const mb={scopes:Aa},vb="jwk",ep="msal.db",AN=1,IN=`${ep}.keys`,kn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},kN=[kn.Default,kn.Skip,kn.RefreshTokenAndNetwork];/*! @azure/msal-browser v4.25.0 2025-10-09 */function cd(t){return encodeURIComponent(Qs(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function ai(t){return yb(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qs(t){return yb(new TextEncoder().encode(t))}function yb(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Fr(t){return new TextDecoder().decode(si(t))}function si(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Me(ub)}const n=atob(e);return Uint8Array.from(n,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const NN="RSASSA-PKCS1-v1_5",Fa="AES-GCM",wb="HKDF",tp="SHA-256",PN=2048,ON=new Uint8Array([1,0,1]),bb="0123456789abcdef",Cb=new Uint32Array(1),np="raw",xb="encrypt",rp="decrypt",MN="deriveKey",DN="crypto_subtle_undefined",op={name:NN,hash:tp,modulusLength:PN,publicExponent:ON};function RN(t){if(!window)throw Me(rd);if(!window.crypto)throw Me(qh);if(!t&&!window.crypto.subtle)throw Me(qh,DN)}async function _b(t,e,n){e==null||e.addQueueMeasurement($.Sha256Digest,n);const o=new TextEncoder().encode(t);return window.crypto.subtle.digest(tp,o)}function LN(t){return window.crypto.getRandomValues(t)}function ip(){return window.crypto.getRandomValues(Cb),Cb[0]}function Ur(){const t=Date.now(),e=ip()*1024+(ip()&1023),n=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=ip();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|r>>>8,n[7]=r,n[8]=128|o>>>24,n[9]=o>>>16,n[10]=o>>>8,n[11]=o,n[12]=a>>>24,n[13]=a>>>16,n[14]=a>>>8,n[15]=a;let s="";for(let l=0;l<n.length;l++)s+=bb.charAt(n[l]>>>4),s+=bb.charAt(n[l]&15),(l===3||l===5||l===7||l===9)&&(s+="-");return s}async function FN(t,e){return window.crypto.subtle.generateKey(op,t,e)}async function ap(t){return window.crypto.subtle.exportKey(vb,t)}async function UN(t,e,n){return window.crypto.subtle.importKey(vb,t,op,e,n)}async function $N(t,e){return window.crypto.subtle.sign(op,t,e)}async function sp(){const t=await Sb(),n={alg:"dir",kty:"oct",k:ai(new Uint8Array(t))};return Qs(JSON.stringify(n))}async function HN(t){const e=Fr(t),r=JSON.parse(e).k,o=si(r);return window.crypto.subtle.importKey(np,o,Fa,!1,[rp])}async function BN(t,e){const n=e.split(".");if(n.length!==5)throw Me(id,"jwe_length");const r=await HN(t).catch(()=>{throw Me(id,"import_key")});try{const o=new TextEncoder().encode(n[0]),a=si(n[2]),s=si(n[3]),l=si(n[4]),u=l.byteLength*8,h=new Uint8Array(s.length+l.length);h.set(s),h.set(l,s.length);const p=await window.crypto.subtle.decrypt({name:Fa,iv:a,tagLength:u,additionalData:o},r,h);return new TextDecoder().decode(p)}catch{throw Me(id,"decrypt")}}async function Sb(){const t=await window.crypto.subtle.generateKey({name:Fa,length:256},!0,[xb,rp]);return window.crypto.subtle.exportKey(np,t)}async function Tb(t){return window.crypto.subtle.importKey(np,t,wb,!1,[MN])}async function Eb(t,e,n){return window.crypto.subtle.deriveKey({name:wb,salt:e,hash:tp,info:new TextEncoder().encode(n)},t,{name:Fa,length:256},!1,[xb,rp])}async function zN(t,e,n){const r=new TextEncoder().encode(e),o=window.crypto.getRandomValues(new Uint8Array(16)),a=await Eb(t,o,n),s=await window.crypto.subtle.encrypt({name:Fa,iv:new Uint8Array(12)},a,r);return{data:ai(new Uint8Array(s)),nonce:ai(o)}}async function Ab(t,e,n,r){const o=si(r),a=await Eb(t,si(e),n),s=await window.crypto.subtle.decrypt({name:Fa,iv:new Uint8Array(12)},a,o);return new TextDecoder().decode(s)}async function Ib(t){const e=await _b(t),n=new Uint8Array(e);return ai(n)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const ld="storage_not_supported",kb="stubbed_public_client_application_called",cp="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.25.0 2025-10-09 */const dd={[ld]:"Given storage configuration option was not supported.",[kb]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[cp]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};dd[ld],dd[kb],dd[cp];class lp extends At{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,lp.prototype)}}function dp(t){return new lp(t,dd[t])}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Nb(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function VN(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function up(){return window.parent!==window}function KN(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${zn.POPUP_NAME_PREFIX}.`)===0}function Eo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function GN(){const e=new pt(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function jN(){if(pt.hashContainsKnownProperties(window.location.hash)&&up())throw Me(Jw)}function WN(t){if(up()&&!t)throw Me(Yw)}function qN(){if(KN())throw Me(Qw)}function Pb(){if(typeof window>"u")throw Me(rd)}function Ob(t){if(!t)throw Me(qs)}function fp(t){Pb(),jN(),qN(),Ob(t)}function Mb(t,e){if(fp(t),WN(e.system.allowRedirectInIframe),e.cache.cacheLocation===Zt.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw dp(cp)}function Db(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function YN(){return Ur()}/*! @azure/msal-browser v4.25.0 2025-10-09 */class ud{navigateInternal(e,n){return ud.defaultNavigateWindow(e,n)}navigateExternal(e,n){return ud.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((r,o)=>{setTimeout(()=>{o(Me(ad,"failed_to_redirect"))},n.timeout)})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class JN{async sendGetRequestAsync(e,n){let r,o={},a=0;const s=Rb(n);try{r=await fetch(e,{method:gb.GET,headers:s})}catch(l){throw Gs(Me(window.navigator.onLine?nb:od),void 0,void 0,l)}o=Lb(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch(l){throw Gs(Me(Jh),a,o,l)}}async sendPostRequestAsync(e,n){const r=n&&n.body||"",o=Rb(n);let a,s=0,l={};try{a=await fetch(e,{method:gb.POST,headers:o,body:r})}catch(u){throw Gs(Me(window.navigator.onLine?tb:od),void 0,void 0,u)}l=Lb(a.headers);try{return s=a.status,{headers:l,body:await a.json(),status:s}}catch(u){throw Gs(Me(Jh),s,l,u)}}}function Rb(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([r,o])=>{e.append(r,o)}),e}catch(e){throw Gs(Me(hb),void 0,void 0,e)}}function Lb(t){try{const e={};return t.forEach((n,r)=>{e[r]=n}),e}catch{throw Me(pb)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const QN=6e4,hp=1e4,XN=3e4,Fb=2e3;function ZN({auth:t,cache:e,system:n,telemetry:r},o){const a={clientId:ge.EMPTY_STRING,authority:`${ge.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:ge.EMPTY_STRING,authorityMetadata:ge.EMPTY_STRING,redirectUri:typeof window<"u"?Eo():"",postLogoutRedirectUri:ge.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Hn.AAD,OIDCOptions:{serverResponseType:Il.FRAGMENT,defaultScopes:[ge.OPENID_SCOPE,ge.PROFILE_SCOPE,ge.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:ph.None,tenant:ge.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1,encodeExtraQueryParams:!1},s={cacheLocation:Zt.SessionStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Zt.LocalStorage),claimsBasedCachingEnabled:!1},l={loggerCallback:()=>{},logLevel:Ut.Info,piiLoggingEnabled:!1},h={...{...rw,loggerOptions:l,networkClient:o?new JN:fN,navigationClient:new ud,loadFrameTimeout:0,windowHashTimeout:(n==null?void 0:n.loadFrameTimeout)||QN,iframeHashTimeout:(n==null?void 0:n.loadFrameTimeout)||hp,navigateFrameWait:0,redirectNavigationTimeout:XN,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(n==null?void 0:n.nativeBrokerHandshakeTimeout)||Fb,pollIntervalMilliseconds:zn.DEFAULT_POLL_INTERVAL_MS},...n,loggerOptions:(n==null?void 0:n.loggerOptions)||l},p={application:{appName:ge.EMPTY_STRING,appVersion:ge.EMPTY_STRING},client:new nw};if((t==null?void 0:t.protocolMode)!==Hn.OIDC&&(t!=null&&t.OIDCOptions)&&new ri(h.loggerOptions).warning(JSON.stringify(Nt(By))),t!=null&&t.protocolMode&&t.protocolMode===Hn.OIDC&&(h!=null&&h.allowPlatformBroker))throw Nt(zy);return{auth:{...a,...t,OIDCOptions:{...a.OIDCOptions,...t==null?void 0:t.OIDCOptions}},cache:{...s,...e},system:h,telemetry:{...p,...r}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const eP="@azure/msal-browser",Fi="4.25.0";/*! @azure/msal-browser v4.25.0 2025-10-09 */const an="msal",pp="browser",gp="-",ci=1,mp=1,tP=`${an}.${pp}.log.level`,nP=`${an}.${pp}.log.pii`,rP=`${an}.${pp}.platform.auth.dom`,Ub=`${an}.version`,$b="account.keys",Hb="token.keys";function oo(t=mp){return t<1?`${an}.${$b}`:`${an}.${t}.${$b}`}function Ui(t,e=ci){return e<1?`${an}.${Hb}.${t}`:`${an}.${e}.${Hb}.${t}`}/*! @azure/msal-browser v4.25.0 2025-10-09 */class vp{static loggerCallback(e,n){switch(e){case Ut.Error:console.error(n);return;case Ut.Info:console.info(n);return;case Ut.Verbose:console.debug(n);return;case Ut.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){var u;this.browserEnvironment=typeof window<"u",this.config=ZN(e,this.browserEnvironment);let n;try{n=window[Zt.SessionStorage]}catch{}const r=n==null?void 0:n.getItem(tP),o=(u=n==null?void 0:n.getItem(nP))==null?void 0:u.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},l=r&&Object.keys(Ut).includes(r)?Ut[r]:void 0;l&&(s.loggerCallback=vp.loggerCallback,s.logLevel=l),a!==void 0&&(s.piiLoggingEnabled=a),this.logger=new ri(s,eP,Fi),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class $i extends vp{getModuleName(){return $i.MODULE_NAME}getId(){return $i.ID}async initialize(){return this.available=typeof window<"u",this.available}}$i.MODULE_NAME="",$i.ID="StandardOperatingContext";/*! @azure/msal-browser v4.25.0 2025-10-09 */class oP{constructor(){this.dbName=ep,this.version=AN,this.tableName=IN,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>n(Me(Xh)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",l=>{const u=l;this.closeConnection(),n(u.target.result)}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(Me(La));const l=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);l.addEventListener("success",()=>{this.closeConnection(),r()}),l.addEventListener("error",u=>{this.closeConnection(),o(u)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),n()}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(Me(La));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",s=>{const l=s;this.closeConnection(),e(l.target.result)}),a.addEventListener("error",s=>{this.closeConnection(),n(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,r)=>{if(!this.db)return r(Me(La));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",l=>{const u=l;this.closeConnection(),n(u.target.result===1)}),s.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const r=window.indexedDB.deleteDatabase(ep),o=setTimeout(()=>n(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),n(!1)))})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class fd{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class iP{constructor(e){this.inMemoryCache=new fd,this.indexedDBCache=new oP,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Ys&&e.errorCode===Xh)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const n=this.inMemoryCache.getItem(e);if(!n)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return n}async setItem(e,n){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(n){this.handleDatabaseAccessError(n)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(n){this.handleDatabaseAccessError(n)}return e}async containsKey(e){const n=this.inMemoryCache.containsKey(e);if(!n)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return n}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ao{constructor(e,n,r){this.logger=e,RN(r??!1),this.cache=new iP(this.logger),this.performanceClient=n}createNewGuid(){return Ur()}base64Encode(e){return Qs(e)}base64Decode(e){return Fr(e)}base64UrlEncode(e){return cd(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var p;const n=(p=this.performanceClient)==null?void 0:p.startMeasurement($.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await FN(Ao.EXTRACTABLE,Ao.POP_KEY_USAGES),o=await ap(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},s=Bb(a),l=await this.hashString(s),u=await ap(r.privateKey),h=await UN(u,!1,["sign"]);return await this.cache.setItem(l,{privateKey:h,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),n&&n.end({success:!0}),l}async removeTokenBindingKey(e){if(await this.cache.removeItem(e),await this.cache.containsKey(e))throw _e(Iy)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,n,r,o){var N;const a=(N=this.performanceClient)==null?void 0:N.startMeasurement($.CryptoOptsSignJwt,o),s=await this.cache.getItem(n);if(!s)throw Me(Qh);const l=await ap(s.publicKey),u=Bb(l),h=cd(JSON.stringify({kid:n})),p=Gh.getShrHeaderString({...r==null?void 0:r.header,alg:l.alg,kid:h}),g=cd(p);e.cnf={jwk:JSON.parse(u)};const w=cd(JSON.stringify(e)),y=`${g}.${w}`,v=new TextEncoder().encode(y),b=await $N(s.privateKey,v),k=ai(new Uint8Array(b)),A=`${y}.${k}`;return a&&a.end({success:!0}),A}async hashString(e){return Ib(e)}}Ao.POP_KEY_USAGES=["sign","verify"],Ao.EXTRACTABLE=!0;function Bb(t){return JSON.stringify(t,Object.keys(t).sort())}/*! @azure/msal-browser v4.25.0 2025-10-09 */const aP=24*60*60*1e3,yp={Lax:"Lax",None:"None"};class zb{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[s,...l]=decodeURIComponent(a).trim().split("="),u=l.join("=");if(s===n)return u}return""}getUserData(){throw _e(st)}setItem(e,n,r,o=!0,a=yp.Lax){let s=`${encodeURIComponent(e)}=${encodeURIComponent(n)};path=/;SameSite=${a};`;if(r){const l=sP(r);s+=`expires=${l};`}(o||a===yp.None)&&(s+="Secure;"),document.cookie=s}async setUserData(){return Promise.reject(_e(st))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),n=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");n.push(o[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function sP(t){const e=new Date;return new Date(e.getTime()+t*aP).toUTCString()}/*! @azure/msal-browser v4.25.0 2025-10-09 */function Xs(t,e){const n=t.getItem(oo(e));return n?JSON.parse(n):[]}function Zs(t,e,n){const r=e.getItem(Ui(t,n));if(r){const o=JSON.parse(r);if(o&&o.hasOwnProperty("idToken")&&o.hasOwnProperty("accessToken")&&o.hasOwnProperty("refreshToken"))return o}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function wp(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}/*! @azure/msal-browser v4.25.0 2025-10-09 */const Vb="msal.cache.encryption",cP="msal.broadcast.cache";class lP{constructor(e,n,r){if(!window.localStorage)throw dp(ld);this.memoryStorage=new fd,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=r,this.broadcast=new BroadcastChannel(cP)}async initialize(e){const n=new zb,r=n.getItem(Vb);let o={key:"",id:""};if(r)try{o=JSON.parse(r)}catch{}if(o.key&&o.id){const a=sr(si,$.Base64Decode,this.logger,this.performanceClient,e)(o.key);this.encryptionCookie={id:o.id,key:await he(Tb,$.GenerateHKDF,this.logger,this.performanceClient,e)(a)}}else{const a=Ur(),s=await he(Sb,$.GenerateBaseKey,this.logger,this.performanceClient,e)(),l=sr(ai,$.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(s));this.encryptionCookie={id:a,key:await he(Tb,$.GenerateHKDF,this.logger,this.performanceClient,e)(s)};const u={id:a,key:l};n.setItem(Vb,JSON.stringify(u),0,!0,yp.None)}await he(this.importExistingCache.bind(this),$.ImportExistingCache,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",this.updateCache.bind(this)),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Me(qs);return this.memoryStorage.getItem(e)}async decryptData(e,n,r){if(!this.initialized||!this.encryptionCookie)throw Me(qs);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const o=await he(Ab,$.Decrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!o)return null;try{return JSON.parse(o)}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,r,o){if(!this.initialized||!this.encryptionCookie)throw Me(qs);const{data:a,nonce:s}=await he(zN,$.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,n,this.getContext(e)),l={id:this.encryptionCookie.id,nonce:s,data:a,lastUpdatedAt:o};this.memoryStorage.setItem(e,n),this.setItem(e,JSON.stringify(l)),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),Xs(this).forEach(r=>this.removeItem(r));const n=Zs(this.clientId,this);n.idToken.forEach(r=>this.removeItem(r)),n.accessToken.forEach(r=>this.removeItem(r)),n.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(an)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=Xs(this);n=await this.importArray(n,e),n.length?this.setItem(oo(),JSON.stringify(n)):this.removeItem(oo());const r=Zs(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(Ui(this.clientId),JSON.stringify(r)):this.removeItem(Ui(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let o;try{o=JSON.parse(r)}catch{return null}return wp(o)?o.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):he(Ab,$.Decrypt,this.logger,this.performanceClient,n)(this.encryptionCookie.key,o.nonce,this.getContext(e),o.data):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),o)}async importArray(e,n){const r=[],o=[];return e.forEach(a=>{const s=this.getItemFromEncryptedCache(a,n).then(l=>{l?(this.memoryStorage.setItem(a,l),r.push(a)):this.removeItem(a)});o.push(s)}),await Promise.all(o),r}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const n=this.performanceClient.startMeasurement($.LocalStorageUpdated);n.add({isBackground:!0});const{key:r,value:o,context:a}=e.data;if(!r){this.logger.error("Broadcast event missing key"),n.end({success:!1,errorCode:"noKey"});return}if(a&&a!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${a}`),n.end({success:!1,errorCode:"contextMismatch"});return}o?(this.memoryStorage.setItem(r,o),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),n.end({success:!0})}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class dP{constructor(){if(!window.sessionStorage)throw dp(ld)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const Ve={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};/*! @azure/msal-browser v4.25.0 2025-10-09 */function Kb(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class bp extends Th{constructor(e,n,r,o,a,s,l){super(e,r,o,a,l),this.cacheConfig=n,this.logger=o,this.internalStorage=new fd,this.browserStorage=Gb(e,n.cacheLocation,o,a),this.temporaryCacheStorage=Gb(e,n.temporaryCacheLocation,o,a),this.cookieStorage=new zb,this.eventHandler=s}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){const n=Xs(this.browserStorage,0),r=Zs(this.clientId,this.browserStorage,0);this.performanceClient.addFields({oldAccountCount:n.length,oldAccessCount:r.accessToken.length,oldIdCount:r.idToken.length,oldRefreshCount:r.refreshToken.length},e);const o=Xs(this.browserStorage,1),a=Zs(this.clientId,this.browserStorage,1);this.performanceClient.addFields({currAccountCount:o.length,currAccessCount:a.accessToken.length,currIdCount:a.idToken.length,currRefreshCount:a.refreshToken.length},e),await Promise.all([this.updateV0ToCurrent(mp,n,o,e),this.updateV0ToCurrent(ci,r.idToken,a.idToken,e),this.updateV0ToCurrent(ci,r.accessToken,a.accessToken,e),this.updateV0ToCurrent(ci,r.refreshToken,a.refreshToken,e)]),n.length>0?this.browserStorage.setItem(oo(0),JSON.stringify(n)):this.browserStorage.removeItem(oo(0)),o.length>0?this.browserStorage.setItem(oo(1),JSON.stringify(o)):this.browserStorage.removeItem(oo(1)),this.setTokenKeys(r,e,0),this.setTokenKeys(a,e,1)}async updateV0ToCurrent(e,n,r,o){const a=[];for(const s of[...n]){const l=this.browserStorage.getItem(s),u=this.validateAndParseJson(l||"");if(!u){Kb(n,s);continue}u.lastUpdatedAt||(u.lastUpdatedAt=Date.now().toString(),this.setItem(s,JSON.stringify(u),o));const h=wp(u)?await this.browserStorage.decryptData(s,u,o):u;let p;if(h&&(xw(h)||_w(h))&&(p=h.expiresOn),!h||jk(u.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)||p&&jl(p,uy)){this.browserStorage.removeItem(s),Kb(n,s),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},o);continue}if(this.cacheConfig.cacheLocation!==Zt.LocalStorage||wp(u)){const g=`${an}.${e}${gp}${s}`,w=this.browserStorage.getItem(g);if(w){const y=this.validateAndParseJson(w);if(Number(u.lastUpdatedAt)>Number(y.lastUpdatedAt)){a.push(this.setUserData(g,JSON.stringify(h),o,u.lastUpdatedAt).then(()=>{this.performanceClient.incrementFields({updatedCacheFromV0Count:1},o)}));continue}}else{a.push(this.setUserData(g,JSON.stringify(h),o,u.lastUpdatedAt).then(()=>{r.push(g),this.performanceClient.incrementFields({upgradedCacheCount:1},o)}));continue}}}return Promise.all(a)}trackVersionChanges(e){const n=this.browserStorage.getItem(Ub);n&&(this.logger.info(`MSAL.js was last initialized by version: ${n}`),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==Fi&&this.setItem(Ub,Fi,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,r){let o=0,a=[];const s=20;for(let l=0;l<=s;l++)try{this.browserStorage.setItem(e,n),l>0&&(l<=o?this.removeAccessTokenKeys(a.slice(0,l),r,0):(this.removeAccessTokenKeys(a.slice(0,o),r,0),this.removeAccessTokenKeys(a.slice(o,l),r)));break}catch(u){const h=Sh(u);if(h.errorCode===Fl&&l<s){if(!a.length){const p=e===Ui(this.clientId,0)?JSON.parse(n).accessToken:this.getTokenKeys(0).accessToken,g=e===Ui(this.clientId)?JSON.parse(n).accessToken:this.getTokenKeys().accessToken;a=[...p,...g],o=p.length}if(a.length<=l)throw h;this.removeAccessToken(a[l],r,!1)}else throw h}}async setUserData(e,n,r,o){let a=0,s=[];const l=20;for(let u=0;u<=l;u++)try{await he(this.browserStorage.setUserData.bind(this.browserStorage),$.SetUserData,this.logger,this.performanceClient)(e,n,r,o),u>0&&(u<=a?this.removeAccessTokenKeys(s.slice(0,u),r,0):(this.removeAccessTokenKeys(s.slice(0,a),r,0),this.removeAccessTokenKeys(s.slice(a,u),r)));break}catch(h){const p=Sh(h);if(p.errorCode===Fl&&u<l){if(!s.length){const g=this.getTokenKeys(0).accessToken,w=this.getTokenKeys().accessToken;s=[...g,...w],a=g.length}if(s.length<=u)throw p;this.removeAccessToken(s[u],r,!1)}else throw p}}getAccount(e,n){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,n),null;const o=this.validateAndParseJson(r);return!o||!Rr.isAccountEntity(o)?null:Th.toObject(new Rr,o)}async setAccount(e,n){this.logger.trace("BrowserCacheManager.setAccount called");const r=this.generateAccountKey(e.getAccountInfo()),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.addAccountKeyToMap(r,n);this.cacheConfig.cacheLocation===Zt.LocalStorage&&a&&this.eventHandler.emitEvent(Ve.ACCOUNT_ADDED,void 0,e.getAccountInfo())}getAccountKeys(){return Xs(this.browserStorage)}addAccountKeyToMap(e,n){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const r=this.getAccountKeys();return r.indexOf(e)===-1?(r.push(e),this.setItem(oo(),JSON.stringify(r),n),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added"),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map"),!1)}removeAccountKeyFromMap(e,n){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const r=this.getAccountKeys(),o=r.indexOf(e);if(o>-1){if(r.splice(o,1),r.length===0){this.removeItem(oo());return}else this.setItem(oo(),JSON.stringify(r),n);this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}removeAccount(e,n){const r=this.getActiveAccount(n);(r==null?void 0:r.homeAccountId)===e.homeAccountId&&(r==null?void 0:r.environment)===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(o=>{o.includes(e.homeAccountId)&&o.includes(e.environment)&&this.browserStorage.removeItem(o)}),this.cacheConfig.cacheLocation===Zt.LocalStorage&&this.eventHandler.emitEvent(Ve.ACCOUNT_REMOVED,void 0,e)}removeIdToken(e,n){super.removeIdToken(e,n);const r=this.getTokenKeys(),o=r.idToken.indexOf(e);o>-1&&(this.logger.info("idToken removed from tokenKeys map"),r.idToken.splice(o,1),this.setTokenKeys(r,n))}removeAccessToken(e,n,r=!0){super.removeAccessToken(e,n),r&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,r=ci){this.logger.trace("removeAccessTokenKey called");const o=this.getTokenKeys(r);let a=0;if(e.forEach(s=>{const l=o.accessToken.indexOf(s);l>-1&&(o.accessToken.splice(l,1),a++)}),a>0){this.logger.info(`removed ${a} accessToken keys from tokenKeys map`),this.setTokenKeys(o,n,r);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const r=this.getTokenKeys(),o=r.refreshToken.indexOf(e);o>-1&&(this.logger.info("refreshToken removed from tokenKeys map"),r.refreshToken.splice(o,1),this.setTokenKeys(r,n))}getTokenKeys(e=ci){return Zs(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,r=ci){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(Ui(this.clientId,r));return}else this.setItem(Ui(this.clientId,r),JSON.stringify(e),n)}getIdTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeIdToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!qk(o)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),o)}async setIdTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys();a.idToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),a.idToken.push(r),this.setTokenKeys(a,n))}getAccessTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeAccessTokenKeys([e],n),null;const o=this.validateAndParseJson(r);return!o||!xw(o)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),o)}async setAccessTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys(),s=a.accessToken.indexOf(r);s!==-1&&a.accessToken.splice(s,1),this.logger.trace(`access token ${s===-1?"added to":"updated in"} map`),a.accessToken.push(r),this.setTokenKeys(a,n)}getRefreshTokenCredential(e,n){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeRefreshToken(e,n),null;const o=this.validateAndParseJson(r);return!o||!_w(o)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),o)}async setRefreshTokenCredential(e,n){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(r,JSON.stringify(e),n,o);const a=this.getTokenKeys();a.refreshToken.indexOf(r)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),a.refreshToken.push(r),this.setTokenKeys(a,n))}getAppMetadata(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Xk(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e,n){this.logger.trace("BrowserCacheManager.setAppMetadata called");const r=Qk(e);this.setItem(r,JSON.stringify(e),n)}getServerTelemetry(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Yk(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,n,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(n),r)}getAuthorityMetadata(e){const n=this.internalStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(n);return r&&Zk(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(sd.WRAPPER_SKU,e),this.internalStorage.setItem(sd.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(sd.WRAPPER_SKU)||ge.EMPTY_STRING,n=this.internalStorage.getItem(sd.WRAPPER_VER)||ge.EMPTY_STRING;return[e,n]}setAuthorityMetadata(e,n){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(cy.ACTIVE_ACCOUNT_FILTERS),r=this.browserStorage.getItem(n);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const o=this.validateAndParseJson(r);return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:o.homeAccountId,localAccountId:o.localAccountId,tenantId:o.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e,n){const r=this.generateCacheKey(cy.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId,lastUpdatedAt:Bn().toString()};this.setItem(r,JSON.stringify(o),n)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(Ve.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const n=this.browserStorage.getItem(e);if(!n)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(n);return!r||!Jk(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,n,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(n),r)}getTemporaryCache(e,n){const r=n?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Zt.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,n,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,n),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,n,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(an)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(an)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}clearTokensAndKeysWithClaims(e){this.performanceClient.addQueueMeasurement($.ClearTokensAndKeysWithClaims,e);const n=this.getTokenKeys();let r=0;n.accessToken.forEach(o=>{const a=this.getAccessTokenCredential(o,e);a!=null&&a.requestedClaimsHash&&o.includes(a.requestedClaimsHash.toLowerCase())&&(this.removeAccessToken(o,e),r++)}),r>0&&this.logger.warning(`${r} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return ar.startsWith(e,an)?e:`${an}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===hn.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==_t.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${an}.${ci}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",e.requestedClaimsHash||"",r].join(gp).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${an}.${mp}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(gp).toLowerCase()}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(Yt.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Yt.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(Yt.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Yt.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Yt.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,n){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=Qs(JSON.stringify(e));if(this.setTemporaryCache(Yt.REQUEST_PARAMS,r,!0),n){const o=Qs(n);this.setTemporaryCache(Yt.VERIFIER,o,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(Yt.REQUEST_PARAMS,!0);if(!e)throw Me(Zw);const n=this.getTemporaryCache(Yt.VERIFIER,!0);let r,o="";try{r=JSON.parse(Fr(e)),n&&(o=Fr(n))}catch(a){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${a}`),Me(eb)}return[r,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Yt.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){var r;const n=(r=this.getInteractionInProgress())==null?void 0:r.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${an}.${Yt.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error"),this.removeTemporaryItem(e),this.resetRequestCache(),Nb(window),null}}setInteractionInProgress(e,n=ii.SIGNIN){var o;const r=`${an}.${Yt.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw Me(Gw);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&((o=this.getInteractionInProgress())==null?void 0:o.clientId)===this.clientId&&this.removeTemporaryItem(r)}async hydrateCache(e,n){var l,u,h;const r=Wl((l=e.account)==null?void 0:l.homeAccountId,(u=e.account)==null?void 0:u.environment,e.idToken,this.clientId,e.tenantId);let o;n.claims&&(o=await this.cryptoImpl.hashString(n.claims));const a=ql((h=e.account)==null?void 0:h.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?bw(e.expiresOn):0,e.extExpiresOn?bw(e.extExpiresOn):0,Fr,void 0,e.tokenType,void 0,n.sshKid,n.claims,o),s={idToken:r,accessToken:a};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,n,r){try{await super.saveCacheRecord(e,n,r)}catch(o){if(o instanceof Pa&&this.performanceClient&&n)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},n)}catch{}throw o}}}function Gb(t,e,n,r){try{switch(e){case Zt.LocalStorage:return new lP(t,n,r);case Zt.SessionStorage:return new dP;case Zt.MemoryStorage:default:break}}catch(o){n.error(o)}return new fd}const uP=(t,e,n,r)=>{const o={cacheLocation:Zt.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new bp(t,o,Ml,e,n,r)};/*! @azure/msal-browser v4.25.0 2025-10-09 */function fP(t,e,n,r,o){return t.verbose("getAllAccounts called"),n?e.getAllAccounts(o||{},r):[]}function hP(t,e,n,r){const o=n.getAccountInfoFilteredBy(t,r);return o?(e.verbose("getAccount: Account matching provided filter found, returning"),o):(e.verbose("getAccount: No matching account found, returning null"),null)}function pP(t,e,n,r){if(e.trace("getAccountByUsername called"),!t)return e.warning("getAccountByUsername: No username provided"),null;const o=n.getAccountInfoFilteredBy({username:t},r);return o?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${t}`),o):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function gP(t,e,n,r){if(e.trace("getAccountByHomeId called"),!t)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const o=n.getAccountInfoFilteredBy({homeAccountId:t},r);return o?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${t}`),o):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function mP(t,e,n,r){if(e.trace("getAccountByLocalId called"),!t)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const o=n.getAccountInfoFilteredBy({localAccountId:t},r);return o?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${t}`),o):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function vP(t,e,n){e.setActiveAccount(t,n)}function yP(t,e){return t.getActiveAccount(e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const wP="msal.broadcast.event";class bP{constructor(e){this.eventCallbacks=new Map,this.logger=e||new ri({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(wP)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,r){if(typeof window<"u"){const o=r||YN();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,n||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,n,r,o){var s;const a={eventType:e,interactionType:n||null,payload:r||null,error:o||null,timestamp:Date.now()};switch(e){case Ve.ACCOUNT_ADDED:case Ve.ACCOUNT_REMOVED:case Ve.ACTIVE_ACCOUNT_CHANGED:(s=this.broadcastChannel)==null||s.postMessage(a);break;default:this.invokeCallbacks(a);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([n,r],o)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${o}: ${e.eventType}`),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class jb{constructor(e,n,r,o,a,s,l,u,h){this.config=e,this.browserStorage=n,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=s,this.platformAuthProvider=u,this.correlationId=h||Ur(),this.logger=o.clone(zn.MSAL_SKU,Fi,this.correlationId),this.performanceClient=l}async clearCacheOnLogout(e,n){if(n)try{this.browserStorage.removeAccount(n,e),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),this.browserStorage.clear(e),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const n=e||this.config.auth.redirectUri;return pt.getAbsoluteUrl(n,Eo())}initializeServerTelemetryManager(e,n){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:n||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new js(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:n}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,l=n&&s?this.config.auth.authority.replace(pt.getDomainFromUrl(a),n.environment):a,u=bn.generateAuthority(l,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),h=await he(Aw,$.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(u,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(n&&!h.isAlias(n.environment))throw Nt(Vy);return h}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function Cp(t,e,n,r){n.addQueueMeasurement($.InitializeBaseRequest,t.correlationId);const o=t.authority||e.auth.authority,a=[...t&&t.scopes||[]],s={...t,correlationId:t.correlationId,authority:o,scopes:a};if(!s.authenticationScheme)s.authenticationScheme=_t.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===_t.SSH){if(!t.sshJwk)throw Nt(Dl);if(!t.sshKid)throw Nt(Hy)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&t.claims&&!ar.isEmptyObj(t.claims)&&(s.requestedClaimsHash=await Ib(t.claims)),s}async function CP(t,e,n,r,o){r.addQueueMeasurement($.InitializeSilentRequest,t.correlationId);const a=await he(Cp,$.InitializeBaseRequest,o,r,t.correlationId)(t,n,r,o);return{...t,...a,account:e,forceRefresh:t.forceRefresh||!1}}function Wb(t,e){let n;const r=t.httpMethod;if(e===Hn.EAR){if(n=r||Oi.POST,n!==Oi.POST)throw Nt(Ky)}else n=r||Oi.GET;if(t.authorizePostBodyParameters&&n!==Oi.POST)throw Nt(Gy);return n}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ua extends jb{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const n={correlationId:this.correlationId||Ur(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),n.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(e.postLogoutRedirectUri,Eo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Eo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",n.correlationId),n.postLogoutRedirectUri=pt.getAbsoluteUrl(Eo(),Eo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement($.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const n=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Mw(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:s}=e;this.performanceClient.addQueueMeasurement($.StandardInteractionClientGetClientConfiguration,this.correlationId);const l=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:s}),u=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:l,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:u.loggerCallback,piiLoggingEnabled:u.piiLoggingEnabled,logLevel:u.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:zn.MSAL_SKU,version:Fi,cpu:ge.EMPTY_STRING,os:ge.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,n){this.performanceClient.addQueueMeasurement($.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:n},a=Da.setRequestState(this.browserCrypto,e&&e.state||ge.EMPTY_STRING,o),l={...await he(Cp,$.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||Ur(),responseMode:this.config.auth.OIDCOptions.serverResponseType},u={...l,httpMethod:Wb(l,this.config.auth.protocolMode)};if(e.loginHint||e.sid)return u;const h=e.account||this.browserStorage.getActiveAccount(this.correlationId);return h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),u.account=h),u}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function xP(t,e){if(!e)return null;try{return Da.parseRequestState(t,e).libraryState.meta}catch{throw _e(ka)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function ec(t,e,n){const r=Rl(t);if(!r)throw Yy(t)?(n.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),n.errorPii(`The ${e} detected is: ${t}`),Me(zw)):(n.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),Me(Bw));return r}function _P(t,e,n){if(!t.state)throw Me(Yh);const r=xP(e,t.state);if(!r)throw Me(Vw);if(r.interactionType!==n)throw Me(Kw)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class qb{constructor(e,n,r,o,a){this.authModule=e,this.browserStorage=n,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,n){this.performanceClient.addQueueMeasurement($.HandleCodeResponse,n.correlationId);let r;try{r=pN(e,n.state)}catch(o){throw o instanceof Ri&&o.subError===Ws?Me(Ws):o}return he(this.handleCodeResponseFromServer.bind(this),$.HandleCodeResponseFromServer,this.logger,this.performanceClient,n.correlationId)(r,n)}async handleCodeResponseFromServer(e,n,r=!0){if(this.performanceClient.addQueueMeasurement($.HandleCodeResponseFromServer,n.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await he(this.authModule.updateAuthority.bind(this.authModule),$.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,n.correlationId)(e.cloud_instance_host_name,n.correlationId),r&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(n);a&&(this.authCodeRequest.ccsCredential=a)}return await he(this.authModule.acquireToken.bind(this.authModule),$.AuthClientAcquireToken,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Mr.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Mr.UPN}:null}}/*! @azure/msal-browser v4.25.0 2025-10-09 */const SP="ContentError",TP="PageException",Yb="user_switch";/*! @azure/msal-browser v4.25.0 2025-10-09 */const EP="USER_INTERACTION_REQUIRED",AP="USER_CANCEL",IP="NO_NETWORK",kP="DISABLED",NP="ACCOUNT_UNAVAILABLE",PP="UX_NOT_ALLOWED";/*! @azure/msal-browser v4.25.0 2025-10-09 */const OP=-2147186943,MP={[Yb]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class io extends At{constructor(e,n,r){super(e,n),Object.setPrototypeOf(this,io.prototype),this.name="NativeAuthError",this.ext=r}}function $a(t){if(t.ext&&t.ext.status&&t.ext.status===kP||t.ext&&t.ext.error&&t.ext.error===OP)return!0;switch(t.errorCode){case SP:case TP:return!0;default:return!1}}function hd(t,e,n){if(n&&n.status)switch(n.status){case NP:return ed(kw);case EP:return new Lr(t,e);case AP:return Me(Ws);case IP:return Me(od);case PP:return ed(Bh)}return new io(t,MP[t]||e,n)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Jb extends Ua{async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentCacheClientAcquireToken,e.correlationId);const n=this.initializeServerTelemetryManager(It.acquireTokenSilent_silentFlow),r=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new uN(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await he(o.acquireCachedToken.bind(o),$.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(a){throw a instanceof Ys&&a.errorCode===Qh&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(n.correlationId,n==null?void 0:n.account)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class pd extends jb{constructor(e,n,r,o,a,s,l,u,h,p,g,w){super(e,n,r,o,a,s,u,h,w),this.apiId=l,this.accountId=p,this.platformAuthProvider=h,this.nativeStorageManager=g,this.silentCacheClient=new Jb(e,this.nativeStorageManager,r,o,a,s,u,h,w);const y=this.platformAuthProvider.getExtensionName();this.skus=js.makeExtraSkuString({libraryName:zn.MSAL_SKU,libraryVersion:Fi,extensionName:y,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Ek]:this.skus}}async acquireToken(e,n){this.performanceClient.addQueueMeasurement($.NativeInteractionClientAcquireToken,this.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement($.NativeInteractionClientAcquireToken,this.correlationId),o=Bn(),a=this.initializeServerTelemetryManager(this.apiId);try{const s=await this.initializeNativeRequest(e);try{const u=await this.acquireTokensFromCache(this.accountId,s);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),u}catch(u){if(n===kn.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),r.end({success:!1,brokerErrorCode:"cache_request_failed"}),u;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const l=await this.platformAuthProvider.sendMessage(s);return await this.handleNativeResponse(l,s,o).then(u=>(r.end({success:!0,isNativeBroker:!0,requestId:u.requestId}),a.clearNativeBrokerErrorCode(),u)).catch(u=>{throw r.end({success:!1,errorCode:u.errorCode,subErrorCode:u.subError}),u})}catch(s){throw s instanceof io&&a.setNativeBrokerErrorCode(s.errorCode),r.end({success:!1}),s}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:Xt.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),_e(lh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},this.correlationId);if(!r)throw _e(lh);try{const o=this.createSilentCacheRequest(n,r),a=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,n){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r);try{await this.platformAuthProvider.sendMessage(o)}catch(l){if(l instanceof io&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(l.errorCode),$a(l)))throw l}this.browserStorage.setTemporaryCache(Yt.NATIVE_REQUEST,JSON.stringify(o),!0);const a={apiId:It.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);n.end({success:!0}),await this.navigationClient.navigateExternal(s,a)}async handleRedirectPromise(e,n){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&n&&(e==null||e.addFields({errorCode:"no_cached_request"},n)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Yt.NATIVE_REQUEST));const s=Bn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const l=await this.platformAuthProvider.sendMessage(a),u=await this.handleNativeResponse(l,a,s);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),e&&this.correlationId&&this.performanceClient.addFields({isNativeBroker:!0},this.correlationId),u}catch(l){throw l}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,r){var p,g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Na(e.id_token,Fr),a=this.createHomeAccountIdentifier(e,o),s=(p=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId))==null?void 0:p.homeAccountId;if((g=n.extraParameters)!=null&&g.child_client_id&&e.account.id!==n.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(a!==s&&e.account.id!==n.accountId)throw hd(Yb);const l=await this.getDiscoveredAuthority({requestAuthority:n.authority}),u=zh(this.browserStorage,l,a,Fr,this.correlationId,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const h=await this.generateAuthenticationResult(e,n,o,u,l.canonicalAuthority,r);return await this.cacheAccount(u,this.correlationId),await this.cacheNativeTokens(e,n,a,o,e.access_token,h.tenantId,r),h}createHomeAccountIdentifier(e,n){return Rr.generateHomeAccountId(e.client_info||ge.EMPTY_STRING,Dr.Default,this.logger,this.browserCrypto,n)}generateScopes(e,n){return n?Xt.fromString(n):Xt.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===_t.POP&&n.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Ra(this.browserCrypto),o={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce};if(!n.keyId)throw _e(uh);return r.signPopToken(e.access_token,n.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,n,r,o,a,s){const l=this.addTelemetryFromNativeResponse(e.properties.MATS),u=this.generateScopes(n.scope,e.scope),h=e.account.properties||{},p=h.UID||r.oid||r.sub||ge.EMPTY_STRING,g=h.TenantId||r.tid||ge.EMPTY_STRING,w=bh(o.getAccountInfo(),void 0,r,e.id_token);w.nativeAccountId!==e.account.id&&(w.nativeAccountId=e.account.id);const y=await this.generatePopAccessToken(e,n),C=n.tokenType===_t.POP?_t.POP:_t.BEARER;return{authority:a,uniqueId:p,tenantId:g,scopes:u.asArray(),account:w,idToken:e.id_token,idTokenClaims:r,accessToken:y,fromCache:l?this.isResponseFromCache(l):!1,expiresOn:Ma(s+e.expires_in),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e.getAccountInfo(),n)}cacheNativeTokens(e,n,r,o,a,s,l){const u=Wl(r,n.authority,e.id_token||"",n.clientId,o.tid||""),h=n.tokenType===_t.POP?ge.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,p=l+h,g=this.generateScopes(e.scope,n.scope),w=ql(r,n.authority,a,n.clientId,o.tid||s,g.printScopes(),p,0,Fr,void 0,n.tokenType,void 0,n.keyId),y={idToken:u,accessToken:w};return this.nativeStorageManager.saveCacheRecord(y,this.correlationId,n.storeInCache)}getExpiresInValue(e,n){return e===_t.POP?ge.SHR_NONCE_VALIDITY:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const n=await this.getCanonicalAuthority(e),{scopes:r,...o}=e,a=new Xt(r||[]);a.appendScopes(Aa);const s={...o,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(s.signPopToken&&e.popKid)throw Me(fb);if(this.handleExtraBrokerParams(s),s.extraParameters=s.extraParameters||{},s.extraParameters.telemetry=Cr.MATS_TELEMETRY,e.authenticationScheme===_t.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new Ra(this.browserCrypto);let h;if(s.keyId)h=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:s.keyId})),s.signPopToken=!1;else{const p=await he(u.generateCnf.bind(u),$.PopTokenGenerateCnf,this.logger,this.performanceClient,this.correlationId)(l,this.logger);h=p.reqCnfString,s.keyId=p.kid,s.signPopToken=!0}s.reqCnf=h}return this.addRequestSKUs(s),s}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:n,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new pt(n);return r.validateAsUri(),r}getPrompt(e){switch(this.apiId){case It.ssoSilent:case It.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),fn.NONE}if(!e){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e){case fn.NONE:case fn.CONSENT:case fn.LOGIN:case fn.SELECT_ACCOUNT:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e} is not compatible with native flow`),Me(db)}}handleExtraBrokerParams(e){var a;const n=e.extraParameters&&e.extraParameters.hasOwnProperty($l)&&e.extraParameters.hasOwnProperty(Hl)&&e.extraParameters.hasOwnProperty(Di);if(!e.embeddedClientId&&!n)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Hl],r=e.extraParameters[Di]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},this.correlationId)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function xp(t,e,n,r,o){const a=hN({...t.auth,authority:e},n,r,o);if(Mh(a,{sku:zn.MSAL_SKU,version:Fi,os:"",cpu:""}),t.auth.protocolMode!==Hn.OIDC&&Dh(a,t.telemetry.application),n.platformBroker&&(Nk(a),o.addFields({isPlatformAuthorizeRequest:!0},n.correlationId),n.authenticationScheme===_t.POP)){const s=new Ao(r,o),l=new Ra(s);let u;n.popKid?u=s.encodeKid(n.popKid):u=(await he(l.generateCnf.bind(l),$.PopTokenGenerateCnf,r,o,n.correlationId)(n,r)).reqCnfString,Lh(a,u)}return Bl(a,n.correlationId,o),a}async function _p(t,e,n,r,o){if(!n.codeChallenge)throw Nt(mh);const a=await he(xp,$.GetStandardParams,r,o,n.correlationId)(t,e,n,r,o);return Ah(a,Xf.CODE),uw(a,n.codeChallenge,ge.S256_CODE_CHALLENGE_METHOD),oi(a,n.extraQueryParameters||{}),Vh(e,a,t.auth.encodeExtraQueryParams,n.extraQueryParameters)}async function Sp(t,e,n,r,o,a){if(!r.earJwk)throw Me(Wh);const s=await xp(e,n,r,o,a);Ah(s,Xf.IDTOKEN_TOKEN_REFRESHTOKEN),Bk(s,r.earJwk);const l=new Map;oi(l,r.extraQueryParameters||{});const u=Vh(n,l,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qb(t,u,s)}async function Tp(t,e,n,r,o,a){const s=await xp(e,n,r,o,a);Ah(s,Xf.CODE),uw(s,r.codeChallenge,r.codeChallengeMethod||ge.S256_CODE_CHALLENGE_METHOD),zk(s,r.authorizePostBodyParameters||{});const l=new Map;oi(l,r.extraQueryParameters||{});const u=Vh(n,l,e.auth.encodeExtraQueryParams,r.extraQueryParameters);return Qb(t,u,s)}function Qb(t,e,n){const r=t.createElement("form");return r.method="post",r.action=e,n.forEach((o,a)=>{const s=t.createElement("input");s.hidden=!0,s.name=a,s.value=o,r.appendChild(s)}),t.body.appendChild(r),r}async function Xb(t,e,n,r,o,a,s,l,u,h){if(l.verbose("Account id found, calling WAM for token"),!h)throw Me(Zh);const p=new Ao(l,u),g=new pd(r,o,p,l,s,r.system.navigationClient,n,u,h,e,a,t.correlationId),{userRequestState:w}=Da.parseRequestState(p,t.state);return he(g.acquireToken.bind(g),$.NativeInteractionClientAcquireToken,l,u,t.correlationId)({...t,state:w,prompt:void 0})}async function gd(t,e,n,r,o,a,s,l,u,h,p,g){if(ro.removeThrottle(s,o.auth.clientId,t),e.accountId)return he(Xb,$.HandleResponsePlatformBroker,h,p,t.correlationId)(t,e.accountId,r,o,s,l,u,h,p,g);const w={...t,code:e.code||"",codeVerifier:n},y=new qb(a,s,w,h,p);return await he(y.handleCodeResponse.bind(y),$.HandleCodeResponse,h,p,t.correlationId)(e,t)}async function Ep(t,e,n,r,o,a,s,l,u,h,p){if(ro.removeThrottle(a,r.auth.clientId,t),Dw(e,t.state),!e.ear_jwe)throw Me(Hw);if(!t.earJwk)throw Me(Wh);const g=JSON.parse(await he(BN,$.DecryptEarResponse,u,h,t.correlationId)(t.earJwk,e.ear_jwe));if(g.accountId)return he(Xb,$.HandleResponsePlatformBroker,u,h,t.correlationId)(t,g.accountId,n,r,a,s,l,u,h,p);const w=new Li(r.auth.clientId,a,new Ao(u,h),u,null,null,h);w.validateTokenResponse(g);const y={code:"",state:t.state,nonce:t.nonce,client_info:g.client_info,cloud_graph_host_name:g.cloud_graph_host_name,cloud_instance_host_name:g.cloud_instance_host_name,cloud_instance_name:g.cloud_instance_name,msgraph_host:g.msgraph_host};return await he(w.handleServerTokenResponse.bind(w),$.HandleServerTokenResponse,u,h,t.correlationId)(g,o,Bn(),t,y,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.25.0 2025-10-09 */const DP=32;async function md(t,e,n){t.addQueueMeasurement($.GeneratePkceCodes,n);const r=sr(RP,$.GenerateCodeVerifier,e,t,n)(t,e,n),o=await he(LP,$.GenerateCodeChallengeFromVerifier,e,t,n)(r,t,e,n);return{verifier:r,challenge:o}}function RP(t,e,n){try{const r=new Uint8Array(DP);return sr(LN,$.GetRandomValues,e,t,n)(r),ai(r)}catch{throw Me(jh)}}async function LP(t,e,n,r){e.addQueueMeasurement($.GenerateCodeChallengeFromVerifier,r);try{const o=await he(_b,$.Sha256Digest,n,e,r)(t,e,r);return ai(new Uint8Array(o))}catch{throw Me(jh)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class vd{constructor(e,n,r,o){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement($.NativeMessageHandlerHandshake),this.platformAuthType=Cr.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace(this.platformAuthType+" - sendMessage called.");const n={method:Js.GetToken,request:e},r={channel:Cr.CHANNEL_ID,extensionId:this.extensionId,responseId:Ur(),body:n};this.logger.trace(this.platformAuthType+" - Sending request to browser extension"),this.logger.tracePii(this.platformAuthType+` - Sending request to browser extension: ${JSON.stringify(r)}`),this.messageChannel.port1.postMessage(r);const o=await new Promise((s,l)=>{this.resolvers.set(r.responseId,{resolve:s,reject:l})});return this.validatePlatformBrokerResponse(o)}static async createProvider(e,n,r){e.trace("PlatformAuthExtensionHandler - createProvider called.");try{const o=new vd(e,n,r,Cr.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new vd(e,n,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace(this.platformAuthType+" - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Cr.CHANNEL_ID,extensionId:this.extensionId,responseId:Ur(),body:{method:Js.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=n=>{this.onChannelMessage(n)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((n,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:n,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Me(cb)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace(this.platformAuthType+" - onWindowMessage called"),e.source!==window)return;const n=e.data;if(!(!n.channel||n.channel!==Cr.CHANNEL_ID)&&!(n.extensionId&&n.extensionId!==this.extensionId)&&n.body.method===Js.HandshakeRequest){const r=this.handshakeResolvers.get(n.responseId);if(!r){this.logger.trace(this.platformAuthType+`.onWindowMessage - resolver can't be found for request ${n.responseId}`);return}this.logger.verbose(n.extensionId?`Extension with id: ${n.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(Me(lb))}}onChannelMessage(e){this.logger.trace(this.platformAuthType+" - onChannelMessage called.");const n=e.data,r=this.resolvers.get(n.responseId),o=this.handshakeResolvers.get(n.responseId);try{const a=n.body.method;if(a===Js.Response){if(!r)return;const s=n.body.response;if(this.logger.trace(this.platformAuthType+" - Received response from browser extension"),this.logger.tracePii(this.platformAuthType+` - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(hd(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(hd(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw th(Ol,"Event does not contain result.");this.resolvers.delete(n.responseId)}else if(a===Js.HandshakeResponse){if(!o){this.logger.trace(this.platformAuthType+`.onChannelMessage - resolver can't be found for request ${n.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=n.extensionId,this.extensionVersion=n.body.version,this.logger.verbose(this.platformAuthType+` - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(n.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw th(Ol,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){var e;return this.getExtensionId()===Cr.PREFERRED_EXTENSION_ID?"chrome":(e=this.getExtensionId())!=null&&e.length?"unknown":void 0}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ap{constructor(e,n,r){this.logger=e,this.performanceClient=n,this.correlationId=r,this.platformAuthType=Cr.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,r){var o;if(e.trace("PlatformAuthDOMHandler: createProvider called"),(o=window.navigator)!=null&&o.platformAuthentication){const a=await window.navigator.platformAuthentication.getSupportedContracts(Cr.MICROSOFT_ENTRA_BROKERID);if(a!=null&&a.includes(Cr.PLATFORM_DOM_APIS))return e.trace("Platform auth api available in DOM"),new Ap(e,n,r)}}getExtensionId(){return Cr.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return Cr.DOM_API_NAME}async sendMessage(e){this.logger.trace(this.platformAuthType+" - Sending request to browser DOM API");try{const n=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(r)}catch(n){throw this.logger.error(this.platformAuthType+" - executeGetToken DOM API error"),n}}initializePlatformDOMRequest(e){this.logger.trace(this.platformAuthType+" - initializeNativeDOMRequest called");const{accountId:n,clientId:r,authority:o,scope:a,redirectUri:s,correlationId:l,state:u,storeInCache:h,embeddedClientId:p,extraParameters:g,...w}=e,y=this.getDOMExtraParams(w);return{accountId:n,brokerId:this.getExtensionId(),authority:o,clientId:r,correlationId:l||this.correlationId,extraParameters:{...g,...y},isSecurityTokenService:!1,redirectUri:s,scope:a,state:u,storeInCache:h,embeddedClientId:p}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(this.platformAuthType+" - platform broker returned successful and valid response"),this.convertToPlatformBrokerResponse(e);if(e.hasOwnProperty("error")){const n=e;if(n.isSuccess===!1&&n.error&&n.error.code)throw this.logger.trace(this.platformAuthType+" - platform broker returned error response"),hd(n.error.code,n.error.description,{error:parseInt(n.error.errorCode),protocol_error:n.error.protocolError,status:n.error.status,properties:n.error.properties})}}throw th(Ol,"Response missing expected properties.")}convertToPlatformBrokerResponse(e){return this.logger.trace(this.platformAuthType+" - convertToNativeResponse called"),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce((o,[a,s])=>(o[a]=String(s),o),{})}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function FP(t,e,n,r){t.trace("getPlatformAuthProvider called",n);const o=UP();t.trace("Has client allowed platform auth via DOM API: "+o);let a;try{o&&(a=await Ap.createProvider(t,e,n)),a||(t.trace("Platform auth via DOM API not available, checking for extension"),a=await vd.createProvider(t,r||Fb,e))}catch(s){t.trace("Platform auth not available",s)}return a}function UP(){let t;try{return t=window[Zt.SessionStorage],(t==null?void 0:t.getItem(rP))==="true"}catch{return!1}}function tc(t,e,n,r){if(e.trace("isPlatformAuthAllowed called"),!t.system.allowPlatformBroker)return e.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false"),!1;if(!n)return e.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false"),!1;if(r)switch(r){case _t.BEARER:case _t.POP:return e.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true"),!0;default:return e.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false"),!1}return!0}/*! @azure/msal-browser v4.25.0 2025-10-09 */class $P extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,l,h,p),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=u,this.eventHandler=a}acquireToken(e,n){let r;try{if(r={popupName:this.generatePopupName(e.scopes||Aa,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r,n);{const a={...e,httpMethod:Wb(e,this.config.auth.protocolMode)};return this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(a,r,n)}}catch(o){return Promise.reject(o)}}logout(e){try{this.logger.verbose("logoutPopup called");const n=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(n,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(n,r,o,a))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,r){this.logger.verbose("acquireTokenPopupAsync called");const o=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,We.Popup);n.popup&&Db(o.authority);const a=tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);return o.platformBroker=a,this.config.auth.protocolMode===Hn.EAR?this.executeEarFlow(o,n):this.executeCodeFlow(o,n,r)}async executeCodeFlow(e,n,r){var u;const o=e.correlationId,a=this.initializeServerTelemetryManager(It.acquireTokenPopup),s=r||await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),l={...e,codeChallenge:s.challenge};try{const h=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:a,requestAuthority:l.authority,requestAzureCloudOptions:l.azureCloudOptions,requestExtraQueryParameters:l.extraQueryParameters,account:l.account});if(l.httpMethod===Oi.POST)return await this.executeCodeFlowWithPost(l,n,h,s.verifier);{const p=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,o)(this.config,h.authority,l,this.logger,this.performanceClient),g=this.initiateAuthRequest(p,n);this.eventHandler.emitEvent(Ve.POPUP_OPENED,We.Popup,{popupWindow:g},null);const w=await this.monitorPopupForHash(g,n.popupWindowParent),y=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await he(gd,$.HandleResponseCode,this.logger,this.performanceClient,o)(e,y,s.verifier,It.acquireTokenPopup,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(h){throw(u=n.popup)==null||u.close(),h instanceof At&&(h.setCorrelationId(this.correlationId),a.cacheFailedRequest(h)),h}}async executeEarFlow(e,n){const r=e.correlationId,o=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),a=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,r)(),s={...e,earJwk:a},l=n.popup||this.openPopup("about:blank",n);(await Sp(l.document,this.config,o,s,this.logger,this.performanceClient)).submit();const h=await he(this.monitorPopupForHash.bind(this),$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(l,n.popupWindowParent),p=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,r)(s,p,It.acquireTokenPopup,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,r,o){const a=e.correlationId,s=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,a)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),l=n.popup||this.openPopup("about:blank",n);(await Tp(l.document,this.config,s,e,this.logger,this.performanceClient)).submit();const h=await he(this.monitorPopupForHash.bind(this),$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,a)(l,n.popupWindowParent),p=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,a)(e,p,o,It.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,r,o){var s,l,u;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(Ve.LOGOUT_START,We.Popup,e);const a=this.initializeServerTelemetryManager(It.logoutPopup);try{await this.clearCacheOnLogout(this.correlationId,e.account);const h=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{h.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&h.authority.protocolMode===Hn.OIDC){if(this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Popup,e),o){const w={apiId:It.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},y=pt.getAbsoluteUrl(o,Eo());await this.navigationClient.navigateInternal(y,w)}(l=n.popup)==null||l.close();return}}const p=h.getLogoutUri(e);this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Popup,e);const g=this.openPopup(p,n);if(this.eventHandler.emitEvent(Ve.POPUP_OPENED,We.Popup,{popupWindow:g},null),await this.monitorPopupForHash(g,n.popupWindowParent).catch(()=>{}),o){const w={apiId:It.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},y=pt.getAbsoluteUrl(o,Eo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${y}`),await this.navigationClient.navigateInternal(y,w)}else this.logger.verbose("No main window navigation requested")}catch(h){throw(u=n.popup)==null||u.close(),h instanceof At&&(h.setCorrelationId(this.correlationId),a.cacheFailedRequest(h)),this.eventHandler.emitEvent(Ve.LOGOUT_FAILURE,We.Popup,null,h),this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Popup),h}this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,n);throw this.logger.error("Navigate url is empty"),Me(td)}monitorPopupForHash(e,n){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(Me(Ws));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(a);let l="";const u=this.config.auth.OIDCOptions.serverResponseType;e&&(u===Il.QUERY?l=e.location.search:l=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(l)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,n)})}openPopup(e,n){try{let r;if(n.popup?(r=n.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,n)),!r)throw Me(Ww);return r.focus&&r.focus(),this.currentWindow=r,n.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),Me(jw)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:r,popupWindowParent:o}){var y,C,v,b;const a=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,l=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,u=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let h=(y=r.popupSize)==null?void 0:y.width,p=(C=r.popupSize)==null?void 0:C.height,g=(v=r.popupPosition)==null?void 0:v.top,w=(b=r.popupPosition)==null?void 0:b.left;return(!h||h<0||h>l)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),h=zn.POPUP_WIDTH),(!p||p<0||p>u)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),p=zn.POPUP_HEIGHT),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,u/2-zn.POPUP_HEIGHT/2+s)),(!w||w<0||w>l)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),w=Math.max(0,l/2-zn.POPUP_WIDTH/2+a)),o.open(e,n,`width=${h}, height=${p}, top=${g}, left=${w}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,n){e.close(),n.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,n){return`${zn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${zn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function HP(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation"),e=t.length?t[0]:void 0;return e==null?void 0:e.type}class BP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,l,h,p),this.nativeStorage=u}async acquireToken(e){const n=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,We.Redirect);n.platformBroker=tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme);const r=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(Ve.RESTORE_FROM_BFCACHE,We.Redirect))},o=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${o}`),this.browserStorage.setTemporaryCache(Yt.ORIGIN_URI,o,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===Hn.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n,e.onRedirectNavigate)}catch(a){throw a instanceof At&&a.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),a}}async executeCodeFlow(e,n){const r=e.correlationId,o=this.initializeServerTelemetryManager(It.acquireTokenRedirect),a=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...e,codeChallenge:a.challenge};this.browserStorage.cacheAuthorizeRequest(s,a.verifier);try{if(s.httpMethod===Oi.POST)return await this.executeCodeFlowWithPost(s);{const l=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),u=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,l.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(u,n)}}catch(l){throw l instanceof At&&(l.setCorrelationId(this.correlationId),o.cacheFailedRequest(l)),l}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,n)(),a={...e,earJwk:o};return this.browserStorage.cacheAuthorizeRequest(a),(await Sp(document,this.config,r,a,this.logger,this.performanceClient)).submit(),new Promise((l,u)=>{setTimeout(()=>{u(Me(ad,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return this.browserStorage.cacheAuthorizeRequest(e),(await Tp(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise((a,s)=>{setTimeout(()=>{s(Me(ad,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e="",n,r,o){const a=this.initializeServerTelemetryManager(It.handleRedirectPromise);try{const[s,l]=this.getRedirectResponse(e||"");if(!s)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),HP()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const u=this.browserStorage.getTemporaryCache(Yt.ORIGIN_URI,!0)||ge.EMPTY_STRING,h=Jy(u),p=Jy(window.location.href);if(h===p&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),u.indexOf("#")>-1&&VN(u),await this.handleResponse(s,n,r,a);if(this.config.auth.navigateToLoginRequestUrl){if(!up()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Yt.URL_HASH,l,!0);const g={apiId:It.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let w=!0;if(!u||u==="null"){const y=GN();this.browserStorage.setTemporaryCache(Yt.ORIGIN_URI,y,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),w=await this.navigationClient.navigateInternal(y,g)}else this.logger.verbose(`Navigating to loginRequestUrl: ${u}`),w=await this.navigationClient.navigateInternal(u,g);if(!w)return await this.handleResponse(s,n,r,a)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(s,n,r,a);return null}catch(s){throw s instanceof At&&(s.setCorrelationId(this.correlationId),a.cacheFailedRequest(s)),s}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let n=e;n||(this.config.auth.OIDCOptions.serverResponseType===Il.QUERY?n=window.location.search:n=window.location.hash);let r=Rl(n);if(r){try{_P(r,this.browserCrypto,We.Redirect)}catch(a){return a instanceof At&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return Nb(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,n]}const o=this.browserStorage.getTemporaryCache(Yt.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Yt.URL_HASH)),o&&(r=Rl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,n,r,o){if(!e.state)throw Me(Yh);if(e.ear_jwe){const l=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n.correlationId)({requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account});return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,n.correlationId)(n,e,It.acquireTokenRedirect,this.config,l,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const s=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority});return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,n.correlationId)(n,e,r,It.acquireTokenRedirect,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e,n){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:It.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=n||this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Me(td)}async logout(e){var o;this.logger.verbose("logoutRedirect called");const n=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(It.logout);try{this.eventHandler.emitEvent(Ve.LOGOUT_START,We.Redirect,e),await this.clearCacheOnLogout(this.correlationId,n.account);const a={apiId:It.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(s.authority.protocolMode===Hn.OIDC)try{s.authority.endSessionEndpoint}catch{if((o=n.account)!=null&&o.homeAccountId){this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Redirect,n);return}}const l=s.getLogoutUri(n);if(this.eventHandler.emitEvent(Ve.LOGOUT_SUCCESS,We.Redirect,n),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(l)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),await this.navigationClient.navigateExternal(l,a);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),await this.navigationClient.navigateExternal(l,a);return}}catch(a){throw a instanceof At&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),this.eventHandler.emitEvent(Ve.LOGOUT_FAILURE,We.Redirect,null,a),this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Redirect),a}this.eventHandler.emitEvent(Ve.LOGOUT_END,We.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return pt.getAbsoluteUrl(n,Eo())}}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function zP(t,e,n,r,o){if(e.addQueueMeasurement($.SilentHandlerInitiateAuthRequest,r),!t)throw n.info("Navigate url is empty"),Me(td);return o?he(GP,$.SilentHandlerLoadFrame,n,e,r)(t,o,e,r):sr(jP,$.SilentHandlerLoadFrameSync,n,e,r)(t)}async function VP(t,e,n,r,o){const a=yd();if(!a.contentDocument)throw"No document associated with iframe!";return(await Tp(a.contentDocument,t,e,n,r,o)).submit(),a}async function KP(t,e,n,r,o){const a=yd();if(!a.contentDocument)throw"No document associated with iframe!";return(await Sp(a.contentDocument,t,e,n,r,o)).submit(),a}async function Zb(t,e,n,r,o,a,s){return r.addQueueMeasurement($.SilentHandlerMonitorIframeForHash,a),new Promise((l,u)=>{e<hp&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${hp}ms). This may result in timeouts.`);const h=window.setTimeout(()=>{window.clearInterval(p),u(Me(qw))},e),p=window.setInterval(()=>{let g="";const w=t.contentWindow;try{g=w?w.location.href:""}catch{}if(!g||g==="about:blank")return;let y="";w&&(s===Il.QUERY?y=w.location.search:y=w.location.hash),window.clearTimeout(h),window.clearInterval(p),l(y)},n)}).finally(()=>{sr(WP,$.RemoveHiddenIframe,o,r,a)(t)})}function GP(t,e,n,r){return n.addQueueMeasurement($.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const s=yd();window.setTimeout(()=>{if(!s){a("Unable to load iframe");return}s.src=t,o(s)},e)})}function jP(t){const e=yd();return e.src=t,e}function yd(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(t),t}function WP(t){document.body===t.parentNode&&document.body.removeChild(t)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class qP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p,g){super(e,n,r,o,a,s,u,p,g),this.apiId=l,this.nativeStorage=h}async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const n={...e};n.prompt?n.prompt!==fn.NONE&&n.prompt!==fn.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${n.prompt} with ${fn.NONE}`),n.prompt=fn.NONE):n.prompt=fn.NONE;const r=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(n,We.Silent);return r.platformBroker=tc(this.config,this.logger,this.platformAuthProvider,r.authenticationScheme),Db(r.authority),this.config.auth.protocolMode===Hn.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let n;const r=this.initializeServerTelemetryManager(this.apiId);try{return n=await he(this.createAuthCodeClient.bind(this),$.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await he(this.silentTokenHelper.bind(this),$.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(o){if(o instanceof At&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!n||!(o instanceof At)||o.errorCode!==zn.INVALID_GRANT_ERROR)throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await he(this.silentTokenHelper.bind(this),$.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const n=e.correlationId,r=await he(this.getDiscoveredAuthority.bind(this),$.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,n)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await he(sp,$.GenerateEarKey,this.logger,this.performanceClient,n)(),a={...e,earJwk:o},s=await he(KP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(this.config,r,a,this.logger,this.performanceClient),l=this.config.auth.OIDCOptions.serverResponseType,u=await he(Zb,$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,l),h=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,n)(u,l,this.logger);return he(Ep,$.HandleResponseEar,this.logger,this.performanceClient,n)(a,h,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(Me(nd))}async silentTokenHelper(e,n){const r=n.correlationId;this.performanceClient.addQueueMeasurement($.SilentIframeClientTokenHelper,r);const o=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),a={...n,codeChallenge:o.challenge};let s;if(n.httpMethod===Oi.POST)s=await he(VP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(this.config,e.authority,a,this.logger,this.performanceClient);else{const p=await he(_p,$.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,a,this.logger,this.performanceClient);s=await he(zP,$.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(p,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait)}const l=this.config.auth.OIDCOptions.serverResponseType,u=await he(Zb,$.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,l),h=sr(ec,$.DeserializeResponse,this.logger,this.performanceClient,r)(u,l,this.logger);return he(gd,$.HandleResponseCode,this.logger,this.performanceClient,r)(n,h,o.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class YP extends Ua{async acquireToken(e){this.performanceClient.addQueueMeasurement($.SilentRefreshClientAcquireToken,e.correlationId);const n=await he(Cp,$.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...n};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(It.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return he(a.acquireTokenByRefreshToken.bind(a),$.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(Me(nd))}async createRefreshTokenClient(e){const n=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new dN(n,this.performanceClient)}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class JP{constructor(e,n,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=n,this.logger=r,this.cryptoObj=o}async loadExternalTokens(e,n,r){if(!this.isBrowserEnvironment)throw Me(rd);const o=e.correlationId||Ur(),a=n.id_token?Na(n.id_token,Fr):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},l=e.authority?new bn(bn.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Ur()):void 0,u=await this.loadAccount(e,r.clientInfo||n.client_info||"",o,a,l),h=await this.loadIdToken(n,u.homeAccountId,u.environment,u.realm,o),p=await this.loadAccessToken(e,n,u.homeAccountId,u.environment,u.realm,r,o),g=await this.loadRefreshToken(n,u.homeAccountId,u.environment,o);return this.generateAuthenticationResult(e,{account:u,idToken:h,accessToken:p,refreshToken:g},a,l)}async loadAccount(e,n,r,o,a){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Rr.createFromAccountInfo(e.account);return await this.storage.setAccount(h,r),h}else if(!a||!n&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),Me(rb);const s=Rr.generateHomeAccountId(n,a.authorityType,this.logger,this.cryptoObj,o),l=o==null?void 0:o.tid,u=zh(this.storage,a,s,Fr,r,o,n,a.hostnameAndPort,l,void 0,void 0,this.logger);return await this.storage.setAccount(u,r),u}async loadIdToken(e,n,r,o,a){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Wl(n,r,e.id_token,this.config.auth.clientId,o);return await this.storage.setIdTokenCredential(s,a),s}async loadAccessToken(e,n,r,o,a,s,l){if(n.access_token)if(n.expires_in){if(!n.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const u=n.scope?Xt.fromString(n.scope):new Xt(e.scopes),h=s.expiresOn||n.expires_in+Bn(),p=s.extendedExpiresOn||(n.ext_expires_in||n.expires_in)+Bn(),g=ql(r,o,n.access_token,this.config.auth.clientId,a,u.printScopes(),h,p,Fr);return await this.storage.setAccessTokenCredential(g,l),g}async loadRefreshToken(e,n,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const a=Cw(n,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(a,o),a}generateAuthenticationResult(e,n,r,o){var p,g,w;let a="",s=[],l=null,u;n!=null&&n.accessToken&&(a=n.accessToken.secret,s=Xt.fromString(n.accessToken.target).asArray(),l=Ma(n.accessToken.expiresOn),u=Ma(n.accessToken.extendedExpiresOn));const h=n.account;return{authority:o?o.canonicalAuthority:"",uniqueId:n.account.localAccountId,tenantId:n.account.realm,scopes:s,account:h.getAccountInfo(),idToken:((p=n.idToken)==null?void 0:p.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:l,correlationId:e.correlationId||"",requestId:"",extExpiresOn:u,familyId:((g=n.refreshToken)==null?void 0:g.familyId)||"",tokenType:((w=n==null?void 0:n.accessToken)==null?void 0:w.tokenType)||"",state:e.state||"",cloudGraphHostName:h.cloudGraphHostName||"",msGraphHost:h.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class QP extends Mw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.25.0 2025-10-09 */class XP extends Ua{constructor(e,n,r,o,a,s,l,u,h,p){super(e,n,r,o,a,s,u,h,p),this.apiId=l}async acquireToken(e){if(!e.code)throw Me(ob);const n=await he(this.initializeAuthorizationRequest.bind(this),$.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,We.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...n,code:e.code},a=await he(this.getClientConfiguration.bind(this),$.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),s=new QP(a);this.logger.verbose("Auth code client created");const l=new qb(s,this.browserStorage,o,this.logger,this.performanceClient);return await he(l.handleCodeResponseFromServer.bind(l),$.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,!1)}catch(o){throw o instanceof At&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(Me(nd))}}/*! @azure/msal-browser v4.25.0 2025-10-09 */function ZP(t,e,n){var s;const r=((s=window.msal)==null?void 0:s.clientIds)||[],o=r.length,a=r.filter(l=>l===t).length;a>1&&n.warning("There is already an instance of MSAL.js in the window with the same client id."),e.add({msalInstanceCount:o,sameClientIdInstanceCount:a})}/*! @azure/msal-browser v4.25.0 2025-10-09 */function wd(t,e,n){try{fp(t)}catch(r){throw e.end({success:!1},r,n),r}}class bd{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ao(this.logger,this.performanceClient):Ml,this.eventHandler=new bP(this.logger),this.browserStorage=this.isBrowserEnvironment?new bp(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,tN(this.config.auth)):uP(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Zt.MemoryStorage,cacheRetentionDays:5,temporaryCacheLocation:Zt.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new bp(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new JP(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,n){const r=new bd(e);return await r.initialize(n),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e,n){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(Ve.INITIALIZE_END);return}const r=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),o=this.config.system.allowPlatformBroker,a=this.performanceClient.startMeasurement($.InitializeClientApplication,r);if(this.eventHandler.emitEvent(Ve.INITIALIZE_START),!n)try{this.logMultipleInstances(a)}catch{}if(await he(this.browserStorage.initialize.bind(this.browserStorage),$.InitializeCache,this.logger,this.performanceClient,r)(r),o)try{this.platformAuthProvider=await FP(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout)}catch(s){this.logger.verbose(s)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),sr(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),$.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,r)(r)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(Ve.INITIALIZE_END),a.end({allowPlatformBroker:o,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Ob(this.initialized),this.isBrowserEnvironment){const n=e||"";let r=this.redirectResponse.get(n);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){var u;if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;if(((u=this.browserStorage.getInteractionInProgress())==null?void 0:u.type)===ii.SIGNOUT)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out"),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const r=this.getAllAccounts(),o=this.browserStorage.getCachedNativeRequest(),a=o&&this.platformAuthProvider&&!e;let s;this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_START,We.Redirect);let l;try{if(a&&this.platformAuthProvider){s=this.performanceClient.startMeasurement($.AcquireTokenRedirect,(o==null?void 0:o.correlationId)||""),this.logger.trace("handleRedirectPromise - acquiring token from native platform"),s.add({isPlatformBrokerRequest:!0});const h=new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,o.accountId,this.nativeInternalStorage,o.correlationId);l=he(h.handleRedirectPromise.bind(h),$.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{const[h,p]=this.browserStorage.getCachedRequest(),g=h.correlationId;s=this.performanceClient.startMeasurement($.AcquireTokenRedirect,g),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const w=this.createRedirectClient(g);l=he(w.handleRedirectPromise.bind(w),$.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,s.event.correlationId)(e,h,p,s)}}catch(h){throw this.browserStorage.resetRequestCache(),h}return l.then(h=>(h?(this.browserStorage.resetRequestCache(),r.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(Ve.LOGIN_SUCCESS,We.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),s.end({success:!0},void 0,h.account)):s.event.errorCode?s.end({success:!1},void 0):s.discard(),this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_END,We.Redirect),h)).catch(h=>{this.browserStorage.resetRequestCache();const p=h;throw r.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Redirect,null,p):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Redirect,null,p),this.eventHandler.emitEvent(Ve.HANDLE_REDIRECT_END,We.Redirect),s.end({success:!1},p),h})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",n);const r=this.performanceClient.startMeasurement($.AcquireTokenPreRedirect,n);r.add({scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const l=typeof o=="function"?o(s):void 0;return r.add({navigateCallbackResult:l!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,l};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=l=>{const u=typeof s=="function"?s(l):void 0;return r.add({navigateCallbackResult:u!==!1}),r.event=r.end({success:!0},void 0,e.account)||r.event,u}}const a=this.getAllAccounts().length>0;try{Mb(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ii.SIGNIN),a?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Redirect,e):this.eventHandler.emitEvent(Ve.LOGIN_START,We.Redirect,e);let s;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?s=new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,r).catch(u=>{if(r.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof io&&$a(u))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(u instanceof Lr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(n).acquireToken(e);throw u}):s=this.createRedirectClient(n).acquireToken(e),await s}catch(s){throw this.browserStorage.resetRequestCache(),r.event.status===2?this.performanceClient.startMeasurement($.AcquireTokenRedirect,n).end({success:!1},s,e.account):r.end({success:!1},s,e.account),a?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Redirect,null,s):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Redirect,null,s),s}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement($.AcquireTokenPopup,n);r.add({scenarioId:e.scenarioId});try{this.logger.verbose("acquireTokenPopup called",n),wd(this.initialized,r,e.account),this.browserStorage.setInteractionInProgress(!0,ii.SIGNIN)}catch(l){return Promise.reject(l)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Popup,e):this.eventHandler.emitEvent(Ve.LOGIN_START,We.Popup,e);let a;const s=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?(r.add({isPlatformBrokerRequest:!0}),a=this.acquireTokenNative({...e,correlationId:n},It.acquireTokenPopup).then(l=>(r.end({success:!0},void 0,l.account),l)).catch(l=>{if(r.add({brokerErrorName:l.name,brokerErrorCode:l.errorCode}),l instanceof io&&$a(l))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,s);if(l instanceof Lr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(n).acquireToken(e,s);throw l})):a=this.createPopupClient(n).acquireToken(e,s),a.then(l=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(Ve.LOGIN_SUCCESS,We.Popup,l):this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Popup,l),r.end({success:!0,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length},void 0,l.account),l)).catch(l=>(o.length>0?this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Popup,null,l):this.eventHandler.emitEvent(Ve.LOGIN_FAILURE,We.Popup,null,l),r.end({success:!1},l,e.account),Promise.reject(l))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(n)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,s,l;const n=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement($.SsoSilent,n),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId}),wd(this.initialized,this.ssoSilentMeasurement,e.account),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(Ve.SSO_SILENT_START,We.Silent,r);let o;return this.canUsePlatformBroker(r)?((l=this.ssoSilentMeasurement)==null||l.add({isPlatformBrokerRequest:!0}),o=this.acquireTokenNative(r,It.ssoSilent).catch(u=>{var h;if((h=this.ssoSilentMeasurement)==null||h.add({brokerErrorName:u.name,brokerErrorCode:u.errorCode}),u instanceof io&&$a(u))return this.platformAuthProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw u})):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(u=>{var h;return this.eventHandler.emitEvent(Ve.SSO_SILENT_SUCCESS,We.Silent,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,accessTokenSize:u.accessToken.length,idTokenSize:u.idToken.length},void 0,u.account),u}).catch(u=>{var h;throw this.eventHandler.emitEvent(Ve.SSO_SILENT_FAILURE,We.Silent,null,u),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},u,e.account),u}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",n);const r=this.performanceClient.startMeasurement($.AcquireTokenByCode,n);wd(this.initialized,r),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_START,We.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Me(ab);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",n),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",n),a=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(s=>(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_SUCCESS,We.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length},void 0,s.account),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_FAILURE,We.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){r.add({isPlatformBrokerRequest:!0});const o=await this.acquireTokenNative({...e,correlationId:n},It.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof io&&$a(a)&&(this.platformAuthProvider=void 0),r.add({brokerErrorName:a.name,brokerErrorCode:a.errorCode}),a});return r.end({success:!0},void 0,o.account),o}else throw Me(sb);else throw Me(ib)}catch(o){throw this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_BY_CODE_FAILURE,We.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement($.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:a.fromCache}),a}).catch(a=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenFromCache,e.correlationId),n){case kn.Default:case kn.AccessToken:case kn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return he(r.acquireToken.bind(r),$.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(ni)}}async acquireTokenByRefreshToken(e,n){switch(this.performanceClient.addQueueMeasurement($.AcquireTokenByRefreshToken,e.correlationId),n){case kn.Default:case kn.AccessTokenAndRefreshToken:case kn.RefreshToken:case kn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return he(r.acquireToken.bind(r),$.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw _e(ni)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement($.AcquireTokenBySilentIframe,e.correlationId);const n=this.createSilentIframeClient(e.correlationId);return he(n.acquireToken.bind(n),$.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const n=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",n),this.logoutRedirect({correlationId:n,...e})}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return Mb(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return fp(this.initialized),this.browserStorage.setInteractionInProgress(!0,ii.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){const n=this.getRequestCorrelationId();return fP(this.logger,this.browserStorage,this.isBrowserEnvironment,n,e)}getAccount(e){const n=this.getRequestCorrelationId();return hP(e,this.logger,this.browserStorage,n)}getAccountByUsername(e){const n=this.getRequestCorrelationId();return pP(e,this.logger,this.browserStorage,n)}getAccountByHomeId(e){const n=this.getRequestCorrelationId();return gP(e,this.logger,this.browserStorage,n)}getAccountByLocalId(e){const n=this.getRequestCorrelationId();return mP(e,this.logger,this.browserStorage,n)}setActiveAccount(e){const n=this.getRequestCorrelationId();vP(e,this.browserStorage,n)}getActiveAccount(){const e=this.getRequestCorrelationId();return yP(this.browserStorage,e)}async hydrateCache(e,n){this.logger.verbose("hydrateCache called");const r=Rr.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,r,o){if(this.logger.trace("acquireTokenNative called"),!this.platformAuthProvider)throw Me(Zh);return new pd(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,o)}canUsePlatformBroker(e,n){if(this.logger.trace("canUsePlatformBroker called"),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false"),!1;if(!tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case fn.NONE:case fn.CONSENT:case fn.LOGIN:case fn.SELECT_ACCOUNT:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new $P(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createRedirectClient(e){return new BP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentIframeClient(e){return new qP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.platformAuthProvider,e)}createSilentCacheClient(e){return new Jb(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentRefreshClient(e){return new YP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.platformAuthProvider,e)}createSilentAuthCodeClient(e){return new XP(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,It.acquireTokenByCode,this.performanceClient,this.platformAuthProvider,e)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return Pb(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Zt.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Zt.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Ur():ge.EMPTY_STRING}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",n),this.acquireTokenRedirect({correlationId:n,...e||mb})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",n),this.acquireTokenPopup({correlationId:n,...e||mb})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement($.AcquireTokenSilent,n);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),wd(this.initialized,r,e.account),this.logger.verbose("acquireTokenSilent called",n);const o=e.account||this.getActiveAccount();if(!o)throw Me(Xw);return this.acquireTokenSilentDeduped(e,o,n).then(a=>(r.end({success:!0,fromCache:a.fromCache,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length},void 0,a.account),{...a,state:e.state,correlationId:n})).catch(a=>{throw a instanceof At&&a.setCorrelationId(n),r.end({success:!1},a,o),a})}async acquireTokenSilentDeduped(e,n,r){const o=Jl(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),a=JSON.stringify(o),s=this.activeSilentTokenRequests.get(a);if(typeof s>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const l=he(this.acquireTokenSilentAsync.bind(this),$.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},n);return this.activeSilentTokenRequests.set(a,l),l.finally(()=>{this.activeSilentTokenRequests.delete(a)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),s}async acquireTokenSilentAsync(e,n){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement($.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_START,We.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await he(CP,$.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||kn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async l=>{if(eO(l,a))if(this.activeIframeRequest)if(a!==kn.Skip){const[h,p]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${p}`,o.correlationId);const g=this.performanceClient.startMeasurement($.AwaitConcurrentIframe,o.correlationId);g.add({awaitIframeCorrelationId:p});const w=await h;if(g.end({success:w}),w)return this.logger.verbose(`Parallel iframe request with correlationId: ${p} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${p} failed. Interaction is required.`),l}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),$.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let h;return this.activeIframeRequest=[new Promise(p=>{h=p}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),he(this.acquireTokenBySilentIframe.bind(this),$.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(p=>(h(!0),p)).catch(p=>{throw h(!1),p}).finally(()=>{this.activeIframeRequest=void 0})}else throw l}).then(l=>(this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_SUCCESS,We.Silent,l),this.performanceClient.addFields({fromCache:l.fromCache},e.correlationId),l)).catch(l=>{throw this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_FAILURE,We.Silent,null,l),l}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,n){return tc(this.config,this.logger,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.performanceClient.addFields({isPlatformBrokerRequest:!0},e.correlationId),this.acquireTokenNative(e,It.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async r=>{throw this.performanceClient.addFields({brokerErrorName:r.name,brokerErrorCode:r.errorCode},e.correlationId),r instanceof io&&$a(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.platformAuthProvider=void 0,_e(ni)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),n===kn.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),he(this.acquireTokenFromCache.bind(this),$.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,n).catch(r=>{if(n===kn.AccessToken)throw r;return this.eventHandler.emitEvent(Ve.ACQUIRE_TOKEN_NETWORK_START,We.Silent,e),he(this.acquireTokenByRefreshToken.bind(this),$.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await he(md,$.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${n?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e){const n=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window."),window.msal.clientIds.push(n),ZP(n,e,this.logger)}}function eO(t,e){const n=!(t instanceof Lr&&t.subError!==Zl),r=t.errorCode===zn.INVALID_GRANT_ERROR||t.errorCode===ni,o=n&&r||t.errorCode===Xl||t.errorCode===Hh,a=kN.includes(e);return o&&a}/*! @azure/msal-browser v4.25.0 2025-10-09 */async function tO(t,e){const n=new $i(t);return await n.initialize(),bd.createController(n,e)}/*! @azure/msal-browser v4.25.0 2025-10-09 */class Ip{static async createPublicClientApplication(e){const n=await tO(e);return new Ip(e,n)}constructor(e,n){this.isBroker=!1,this.controller=n||new bd(new $i(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}function nO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const rO=x.forwardRef(nO);function oO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const kp=x.forwardRef(oO);function iO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const Np=x.forwardRef(iO);function aO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const sO=x.forwardRef(aO);function cO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const lO=x.forwardRef(cO);function dO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))}const nc=x.forwardRef(dO);function uO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const fO=x.forwardRef(uO);function hO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const pO=x.forwardRef(hO);function gO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const mO=x.forwardRef(gO);function vO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const eC=x.forwardRef(vO);function yO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"}))}const wO=x.forwardRef(yO);function bO({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const tC=x.forwardRef(bO);function Ke(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function nC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function rC(...t){return e=>{let n=!1;const r=t.map(o=>{const a=nC(o,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():nC(t[o],null)}}}}function kt(...t){return x.useCallback(rC(...t),t)}function CO(t,e){const n=x.createContext(e),r=a=>{const{children:s,...l}=a,u=x.useMemo(()=>l,Object.values(l));return d.jsx(n.Provider,{value:u,children:s})};r.displayName=t+"Provider";function o(a){const s=x.useContext(n);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[r,o]}function Io(t,e=[]){let n=[];function r(a,s){const l=x.createContext(s),u=n.length;n=[...n,s];const h=g=>{var k;const{scope:w,children:y,...C}=g,v=((k=w==null?void 0:w[t])==null?void 0:k[u])||l,b=x.useMemo(()=>C,Object.values(C));return d.jsx(v.Provider,{value:b,children:y})};h.displayName=a+"Provider";function p(g,w){var v;const y=((v=w==null?void 0:w[t])==null?void 0:v[u])||l,C=x.useContext(y);if(C)return C;if(s!==void 0)return s;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[h,p]}const o=()=>{const a=n.map(s=>x.createContext(s));return function(l){const u=(l==null?void 0:l[t])||a;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return o.scopeName=t,[r,xO(o,...e)]}function xO(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=r.reduce((l,{useScope:u,scopeName:h})=>{const g=u(a)[`__scope${h}`];return{...l,...g}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}var gn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_O=x[" useId ".trim().toString()]||(()=>{}),SO=0;function ko(t){const[e,n]=x.useState(_O());return gn(()=>{n(r=>r??String(SO++))},[t]),e?`radix-${e}`:""}var TO=x[" useInsertionEffect ".trim().toString()]||gn;function li({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,a,s]=EO({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:o;{const p=x.useRef(t!==void 0);x.useEffect(()=>{const g=p.current;g!==l&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${l?"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.`),p.current=l},[l,r])}const h=x.useCallback(p=>{var g;if(l){const w=AO(p)?p(t):p;w!==t&&((g=s.current)==null||g.call(s,w))}else a(p)},[l,t,a,s]);return[u,h]}function EO({defaultProp:t,onChange:e}){const[n,r]=x.useState(t),o=x.useRef(n),a=x.useRef(e);return TO(()=>{a.current=e},[e]),x.useEffect(()=>{var s;o.current!==n&&((s=a.current)==null||s.call(a,n),o.current=n)},[n,o]),[n,r,a]}function AO(t){return typeof t=="function"}function Ha(t){const e=IO(t),n=x.forwardRef((r,o)=>{const{children:a,...s}=r,l=x.Children.toArray(a),u=l.find(NO);if(u){const h=u.props.children,p=l.map(g=>g===u?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return d.jsx(e,{...s,ref:o,children:x.isValidElement(h)?x.cloneElement(h,void 0,p):null})}return d.jsx(e,{...s,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}var oC=Ha("Slot");function IO(t){const e=x.forwardRef((n,r)=>{const{children:o,...a}=n;if(x.isValidElement(o)){const s=OO(o),l=PO(a,o.props);return o.type!==x.Fragment&&(l.ref=r?rC(r,s):s),x.cloneElement(o,l)}return x.Children.count(o)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var iC=Symbol("radix.slottable");function kO(t){const e=({children:n})=>d.jsx(d.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=iC,e}function NO(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===iC}function PO(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function OO(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var MO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=MO.reduce((t,e)=>{const n=Ha(`Primitive.${e}`),r=x.forwardRef((o,a)=>{const{asChild:s,...l}=o,u=s?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function aC(t,e){t&&$s.flushSync(()=>t.dispatchEvent(e))}function xr(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function DO(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var RO="DismissableLayer",Pp="dismissableLayer.update",LO="dismissableLayer.pointerDownOutside",FO="dismissableLayer.focusOutside",sC,cC=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rc=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=t,h=x.useContext(cC),[p,g]=x.useState(null),w=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=x.useState({}),C=kt(e,H=>g(H)),v=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),k=v.indexOf(b),A=p?v.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,O=A>=k,T=$O(H=>{const W=H.target,ee=[...h.branches].some(q=>q.contains(W));!O||ee||(o==null||o(H),s==null||s(H),H.defaultPrevented||l==null||l())},w),L=HO(H=>{const W=H.target;[...h.branches].some(q=>q.contains(W))||(a==null||a(H),s==null||s(H),H.defaultPrevented||l==null||l())},w);return DO(H=>{A===h.layers.size-1&&(r==null||r(H),!H.defaultPrevented&&l&&(H.preventDefault(),l()))},w),x.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(sC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),dC(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=sC)}},[p,w,n,h]),x.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),dC())},[p,h]),x.useEffect(()=>{const H=()=>y({});return document.addEventListener(Pp,H),()=>document.removeEventListener(Pp,H)},[]),d.jsx(tt.div,{...u,ref:C,style:{pointerEvents:N?O?"auto":"none":void 0,...t.style},onFocusCapture:Ke(t.onFocusCapture,L.onFocusCapture),onBlurCapture:Ke(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ke(t.onPointerDownCapture,T.onPointerDownCapture)})});rc.displayName=RO;var UO="DismissableLayerBranch",lC=x.forwardRef((t,e)=>{const n=x.useContext(cC),r=x.useRef(null),o=kt(e,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(tt.div,{...t,ref:o})});lC.displayName=UO;function $O(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){uC(LO,n,h,{discrete:!0})};const h={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",a),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function HO(t,e=globalThis==null?void 0:globalThis.document){const n=xr(t),r=x.useRef(!1);return x.useEffect(()=>{const o=a=>{a.target&&!r.current&&uC(FO,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dC(){const t=new CustomEvent(Pp);document.dispatchEvent(t)}function uC(t,e,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?aC(o,a):o.dispatchEvent(a)}var BO=rc,zO=lC,Op="focusScope.autoFocusOnMount",Mp="focusScope.autoFocusOnUnmount",fC={bubbles:!1,cancelable:!0},VO="FocusScope",Dp=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=t,[l,u]=x.useState(null),h=xr(o),p=xr(a),g=x.useRef(null),w=kt(e,v=>u(v)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let v=function(N){if(y.paused||!l)return;const O=N.target;l.contains(O)?g.current=O:di(g.current,{select:!0})},b=function(N){if(y.paused||!l)return;const O=N.relatedTarget;O!==null&&(l.contains(O)||di(g.current,{select:!0}))},k=function(N){if(document.activeElement===document.body)for(const T of N)T.removedNodes.length>0&&di(l)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const A=new MutationObserver(k);return l&&A.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),A.disconnect()}}},[r,l,y.paused]),x.useEffect(()=>{if(l){gC.add(y);const v=document.activeElement;if(!l.contains(v)){const k=new CustomEvent(Op,fC);l.addEventListener(Op,h),l.dispatchEvent(k),k.defaultPrevented||(KO(YO(hC(l)),{select:!0}),document.activeElement===v&&di(l))}return()=>{l.removeEventListener(Op,h),setTimeout(()=>{const k=new CustomEvent(Mp,fC);l.addEventListener(Mp,p),l.dispatchEvent(k),k.defaultPrevented||di(v??document.body,{select:!0}),l.removeEventListener(Mp,p),gC.remove(y)},0)}}},[l,h,p,y]);const C=x.useCallback(v=>{if(!n&&!r||y.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,k=document.activeElement;if(b&&k){const A=v.currentTarget,[N,O]=GO(A);N&&O?!v.shiftKey&&k===O?(v.preventDefault(),n&&di(N,{select:!0})):v.shiftKey&&k===N&&(v.preventDefault(),n&&di(O,{select:!0})):k===A&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(tt.div,{tabIndex:-1,...s,ref:w,onKeyDown:C})});Dp.displayName=VO;function KO(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(di(r,{select:e}),document.activeElement!==n)return}function GO(t){const e=hC(t),n=pC(e,t),r=pC(e.reverse(),t);return[n,r]}function hC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function pC(t,e){for(const n of t)if(!jO(n,{upTo:e}))return n}function jO(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function WO(t){return t instanceof HTMLInputElement&&"select"in t}function di(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&WO(t)&&e&&t.select()}}var gC=qO();function qO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=mC(t,e),t.unshift(e)},remove(e){var n;t=mC(t,e),(n=t[0])==null||n.resume()}}}function mC(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function YO(t){return t.filter(e=>e.tagName!=="A")}var JO="Portal",oc=x.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,a]=x.useState(!1);gn(()=>a(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?iy.createPortal(d.jsx(tt.div,{...r,ref:e}),s):null});oc.displayName=JO;function QO(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var No=t=>{const{present:e,children:n}=t,r=XO(e),o=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=kt(r.ref,ZO(o));return typeof n=="function"||r.isPresent?x.cloneElement(o,{ref:a}):null};No.displayName="Presence";function XO(t){const[e,n]=x.useState(),r=x.useRef(null),o=x.useRef(t),a=x.useRef("none"),s=t?"mounted":"unmounted",[l,u]=QO(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Cd(r.current);a.current=l==="mounted"?h:"none"},[l]),gn(()=>{const h=r.current,p=o.current;if(p!==t){const w=a.current,y=Cd(h);t?u("MOUNT"):y==="none"||(h==null?void 0:h.display)==="none"?u("UNMOUNT"):u(p&&w!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),gn(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=y=>{const v=Cd(r.current).includes(CSS.escape(y.animationName));if(y.target===e&&v&&(u("ANIMATION_END"),!o.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},w=y=>{y.target===e&&(a.current=Cd(r.current))};return e.addEventListener("animationstart",w),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",w),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Cd(t){return(t==null?void 0:t.animationName)||"none"}function ZO(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Rp=0;function vC(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yC()),document.body.insertAdjacentElement("beforeend",t[1]??yC()),Rp++,()=>{Rp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Rp--}},[])}function yC(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var ao=function(){return ao=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ao.apply(this,arguments)};function wC(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function Hi(t,e,n,r){function o(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(p){try{h(r.next(p))}catch(g){s(g)}}function u(p){try{h(r.throw(p))}catch(g){s(g)}}function h(p){p.done?a(p.value):o(p.value).then(l,u)}h((r=r.apply(t,e||[])).next())})}function bC(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,a=[],s;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(l){s={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function CC(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,a;r<o;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var xd="right-scroll-bar-position",_d="width-before-scroll-bar",e1="with-scroll-bars-hidden",t1="--removed-body-scroll-bar-size";function Lp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function n1(t,e){var n=M.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var r1=typeof window<"u"?x.useLayoutEffect:x.useEffect,xC=new WeakMap;function o1(t,e){var n=n1(null,function(r){return t.forEach(function(o){return Lp(o,r)})});return r1(function(){var r=xC.get(n);if(r){var o=new Set(r),a=new Set(t),s=n.current;o.forEach(function(l){a.has(l)||Lp(l,null)}),a.forEach(function(l){o.has(l)||Lp(l,s)})}xC.set(n,t)},[t]),n}function i1(t){return t}function a1(t,e){e===void 0&&(e=i1);var n=[],r=!1,o={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]:t},useMedium:function(a){var s=e(a,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(a),s=n}var u=function(){var p=s;s=[],p.forEach(a)},h=function(){return Promise.resolve().then(u)};h(),n={push:function(p){s.push(p),h()},filter:function(p){return s=s.filter(p),n}}}};return o}function s1(t){t===void 0&&(t={});var e=a1(null);return e.options=ao({async:!0,ssr:!1},t),e}var _C=function(t){var e=t.sideCar,n=wC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,ao({},n))};_C.isSideCarExport=!0;function c1(t,e){return t.useMedium(e),_C}var SC=s1(),Fp=function(){},Sd=x.forwardRef(function(t,e){var n=x.useRef(null),r=x.useState({onScrollCapture:Fp,onWheelCapture:Fp,onTouchMoveCapture:Fp}),o=r[0],a=r[1],s=t.forwardProps,l=t.children,u=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,w=t.sideCar,y=t.noRelative,C=t.noIsolation,v=t.inert,b=t.allowPinchZoom,k=t.as,A=k===void 0?"div":k,N=t.gapMode,O=wC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=w,L=o1([n,e]),H=ao(ao({},O),o);return x.createElement(x.Fragment,null,p&&x.createElement(T,{sideCar:SC,removeScrollBar:h,shards:g,noRelative:y,noIsolation:C,inert:v,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:N}),s?x.cloneElement(x.Children.only(l),ao(ao({},H),{ref:L})):x.createElement(A,ao({},H,{className:u,ref:L}),l))});Sd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Sd.classNames={fullWidth:_d,zeroRight:xd};var l1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d1(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=l1();return e&&t.setAttribute("nonce",e),t}function u1(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function f1(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var h1=function(){var t=0,e=null;return{add:function(n){t==0&&(e=d1())&&(u1(e,n),f1(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},p1=function(){var t=h1();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},TC=function(){var t=p1(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},g1={left:0,top:0,right:0,gap:0},Up=function(t){return parseInt(t||"",10)||0},m1=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Up(n),Up(r),Up(o)]},v1=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return g1;var e=m1(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},y1=TC(),Ba="data-scroll-locked",w1=function(t,e,n,r){var o=t.left,a=t.top,s=t.right,l=t.gap;return n===void 0&&(n="margin"),`
8
8
  .`.concat(e1,` {
9
9
  overflow: hidden `).concat(r,`;
10
10
  padding-right: `).concat(l,"px ").concat(r,`;
@@ -76,13 +76,13 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
76
76
  * Released under MIT license <https://lodash.com/license>
77
77
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
78
78
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
79
- */Fd.exports,function(t,e){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",g=1,w=2,y=4,C=1,v=2,b=1,k=2,A=4,N=8,O=16,T=32,L=64,H=128,W=256,ee=512,q=30,de="...",ce=800,ve=16,K=1,Z=2,G=3,re=1/0,J=9007199254740991,X=17976931348623157e292,U=NaN,te=4294967295,be=te-1,Ee=te>>>1,Ce=[["ary",H],["bind",b],["bindKey",k],["curry",N],["curryRight",O],["flip",ee],["partial",T],["partialRight",L],["rearg",W]],Ne="[object Arguments]",Te="[object Array]",z="[object AsyncFunction]",ue="[object Boolean]",Ae="[object Date]",xe="[object DOMException]",Pe="[object Error]",ae="[object Function]",Ze="[object GeneratorFunction]",nt="[object Map]",Tt="[object Number]",ln="[object Null]",Ot="[object Object]",mn="[object Promise]",en="[object Proxy]",R="[object RegExp]",Y="[object Set]",se="[object String]",Ie="[object Symbol]",Q="[object Undefined]",ne="[object WeakMap]",ke="[object WeakSet]",$e="[object ArrayBuffer]",Be="[object DataView]",Mt="[object Float32Array]",tn="[object Float64Array]",zt="[object Int8Array]",yo="[object Int16Array]",Gt="[object Int32Array]",vn="[object Uint8Array]",Jr="[object Uint8ClampedArray]",Vt="[object Uint16Array]",pr="[object Uint32Array]",Qr=/\b__p \+= '';/g,ea=/\b(__p \+=) '' \+/g,Xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,Uc=/[&<>"']/g,wo=RegExp($o.source),ta=RegExp(Uc.source),na=/<%-([\s\S]+?)%>/g,ls=/<%([\s\S]+?)%>/g,Gu=/<%=([\s\S]+?)%>/g,ra=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ds=/^\w*$/,ju=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$c=/[\\^$.*+?()[\]{}|]/g,Wu=RegExp($c.source),Hc=/^\s+/,qu=/\s/,us=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yu=/\{\n\/\* \[wrapped with (.+)\] \*/,oa=/,? & /,Ju=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fs=/[()=,{}\[\]\/\s]/,Wm=/\\(\\)?/g,Ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bc=/\w*$/,zc=/^[-+]0x[0-9a-f]+$/i,ia=/^0b[01]+$/i,hs=/^\[object .+?Constructor\]$/,qm=/^0o[0-7]+$/i,Dt=/^(?:0|[1-9]\d*)$/,Vc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kc=/($^)/,Ym=/['\n\r\u2028\u2029\\]/g,Gc="\\ud800-\\udfff",jc="\\u0300-\\u036f",Qu="\\ufe20-\\ufe2f",ps="\\u20d0-\\u20ff",Wc=jc+Qu+ps,qc="\\u2700-\\u27bf",Yc="a-z\\xdf-\\xf6\\xf8-\\xff",Xu="\\xac\\xb1\\xd7\\xf7",gs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Jc="\\u2000-\\u206f",Jm=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aa="A-Z\\xc0-\\xd6\\xd8-\\xde",sa="\\ufe0e\\ufe0f",Qc=Xu+gs+Jc+Jm,Xc="['’]",xi="["+Gc+"]",Zc="["+Qc+"]",_i="["+Wc+"]",el="\\d+",Qm="["+qc+"]",ms="["+Yc+"]",tl="[^"+Gc+Qc+el+qc+Yc+aa+"]",vs="\\ud83c[\\udffb-\\udfff]",ys="(?:"+_i+"|"+vs+")",Bo="[^"+Gc+"]",zo="(?:\\ud83c[\\udde6-\\uddff]){2}",ws="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="["+aa+"]",gt="\\u200d",ca="(?:"+ms+"|"+tl+")",Xm="(?:"+Si+"|"+tl+")",bs="(?:"+Xc+"(?:d|ll|m|re|s|t|ve))?",Zu="(?:"+Xc+"(?:D|LL|M|RE|S|T|VE))?",la=ys+"?",Sr="["+sa+"]?",nl="(?:"+gt+"(?:"+[Bo,zo,ws].join("|")+")"+Sr+la+")*",y0="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",w0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ef=Sr+la+nl,b0="(?:"+[Qm,zo,ws].join("|")+")"+ef,Zm="(?:"+[Bo+_i+"?",_i,zo,ws,xi].join("|")+")",gr=RegExp(Xc,"g"),Cs=RegExp(_i,"g"),rl=RegExp(vs+"(?="+vs+")|"+Zm+ef,"g"),da=RegExp([Si+"?"+ms+"+"+bs+"(?="+[Zc,Si,"$"].join("|")+")",Xm+"+"+Zu+"(?="+[Zc,Si+ca,"$"].join("|")+")",Si+"?"+ca+"+"+bs,Si+"+"+Zu,w0,y0,el,b0].join("|"),"g"),dn=RegExp("["+gt+Gc+Wc+sa+"]"),ol=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],il=-1,mt={};mt[Mt]=mt[tn]=mt[zt]=mt[yo]=mt[Gt]=mt[vn]=mt[Jr]=mt[Vt]=mt[pr]=!0,mt[Ne]=mt[Te]=mt[$e]=mt[ue]=mt[Be]=mt[Ae]=mt[Pe]=mt[ae]=mt[nt]=mt[Tt]=mt[Ot]=mt[R]=mt[Y]=mt[se]=mt[ne]=!1;var ze={};ze[Ne]=ze[Te]=ze[$e]=ze[Be]=ze[ue]=ze[Ae]=ze[Mt]=ze[tn]=ze[zt]=ze[yo]=ze[Gt]=ze[nt]=ze[Tt]=ze[Ot]=ze[R]=ze[Y]=ze[se]=ze[Ie]=ze[vn]=ze[Jr]=ze[Vt]=ze[pr]=!0,ze[Pe]=ze[ae]=ze[ne]=!1;var ev={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},nv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rv=parseFloat,xs=parseInt,nf=typeof so=="object"&&so&&so.Object===Object&&so,ov=typeof self=="object"&&self&&self.Object===Object&&self,nn=nf||ov||Function("return this")(),_s=e&&!e.nodeType&&e,Vo=_s&&!0&&t&&!t.nodeType&&t,al=Vo&&Vo.exports===_s,ua=al&&nf.process,Jn=function(){try{var V=Vo&&Vo.require&&Vo.require("util").types;return V||ua&&ua.binding&&ua.binding("util")}catch{}}(),rf=Jn&&Jn.isArrayBuffer,of=Jn&&Jn.isDate,af=Jn&&Jn.isMap,fa=Jn&&Jn.isRegExp,sf=Jn&&Jn.isSet,cf=Jn&&Jn.isTypedArray;function Sn(V,le,ie){switch(ie.length){case 0:return V.call(le);case 1:return V.call(le,ie[0]);case 2:return V.call(le,ie[0],ie[1]);case 3:return V.call(le,ie[0],ie[1],ie[2])}return V.apply(le,ie)}function iv(V,le,ie,Re){for(var et=-1,yt=V==null?0:V.length;++et<yt;){var rn=V[et];le(Re,rn,ie(rn),V)}return Re}function Qn(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re&&le(V[ie],ie,V)!==!1;);return V}function av(V,le){for(var ie=V==null?0:V.length;ie--&&le(V[ie],ie,V)!==!1;);return V}function lf(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re;)if(!le(V[ie],ie,V))return!1;return!0}function Xr(V,le){for(var ie=-1,Re=V==null?0:V.length,et=0,yt=[];++ie<Re;){var rn=V[ie];le(rn,ie,V)&&(yt[et++]=rn)}return yt}function mr(V,le){var ie=V==null?0:V.length;return!!ie&&Ti(V,le,0)>-1}function Ko(V,le,ie){for(var Re=-1,et=V==null?0:V.length;++Re<et;)if(ie(le,V[Re]))return!0;return!1}function Lt(V,le){for(var ie=-1,Re=V==null?0:V.length,et=Array(Re);++ie<Re;)et[ie]=le(V[ie],ie,V);return et}function Tn(V,le){for(var ie=-1,Re=le.length,et=V.length;++ie<Re;)V[et+ie]=le[ie];return V}function sl(V,le,ie,Re){var et=-1,yt=V==null?0:V.length;for(Re&&yt&&(ie=V[++et]);++et<yt;)ie=le(ie,V[et],et,V);return ie}function sv(V,le,ie,Re){var et=V==null?0:V.length;for(Re&&et&&(ie=V[--et]);et--;)ie=le(ie,V[et],et,V);return ie}function ha(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re;)if(le(V[ie],ie,V))return!0;return!1}var cv=Es("length");function df(V){return V.split("")}function Ss(V){return V.match(Ju)||[]}function uf(V,le,ie){var Re;return ie(V,function(et,yt,rn){if(le(et,yt,rn))return Re=yt,!1}),Re}function Ts(V,le,ie,Re){for(var et=V.length,yt=ie+(Re?1:-1);Re?yt--:++yt<et;)if(le(V[yt],yt,V))return yt;return-1}function Ti(V,le,ie){return le===le?va(V,le,ie):Ts(V,ll,ie)}function cl(V,le,ie,Re){for(var et=ie-1,yt=V.length;++et<yt;)if(Re(V[et],le))return et;return-1}function ll(V){return V!==V}function ff(V,le){var ie=V==null?0:V.length;return ie?ul(V,le)/ie:U}function Es(V){return function(le){return le==null?n:le[V]}}function pa(V){return function(le){return V==null?n:V[le]}}function dl(V,le,ie,Re,et){return et(V,function(yt,rn,Rt){ie=Re?(Re=!1,yt):le(ie,yt,rn,Rt)}),ie}function lv(V,le){var ie=V.length;for(V.sort(le);ie--;)V[ie]=V[ie].value;return V}function ul(V,le){for(var ie,Re=-1,et=V.length;++Re<et;){var yt=le(V[Re]);yt!==n&&(ie=ie===n?yt:ie+yt)}return ie}function As(V,le){for(var ie=-1,Re=Array(V);++ie<V;)Re[ie]=le(ie);return Re}function dv(V,le){return Lt(le,function(ie){return[ie,V[ie]]})}function fl(V){return V&&V.slice(0,yn(V)+1).replace(Hc,"")}function Fn(V){return function(le){return V(le)}}function Zr(V,le){return Lt(le,function(ie){return V[ie]})}function Xn(V,le){return V.has(le)}function ga(V,le){for(var ie=-1,Re=V.length;++ie<Re&&Ti(le,V[ie],0)>-1;);return ie}function hf(V,le){for(var ie=V.length;ie--&&Ti(le,V[ie],0)>-1;);return ie}function pf(V,le){for(var ie=V.length,Re=0;ie--;)V[ie]===le&&++Re;return Re}var S=pa(ev),P=pa(tv);function B(V){return"\\"+nv[V]}function fe(V,le){return V==null?n:V[le]}function ye(V){return dn.test(V)}function Se(V){return ol.test(V)}function De(V){for(var le,ie=[];!(le=V.next()).done;)ie.push(le.value);return ie}function Ct(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re,et){ie[++le]=[et,Re]}),ie}function Tr(V,le){return function(ie){return V(le(ie))}}function Zn(V,le){for(var ie=-1,Re=V.length,et=0,yt=[];++ie<Re;){var rn=V[ie];(rn===le||rn===p)&&(V[ie]=p,yt[et++]=ie)}return yt}function ma(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re){ie[++le]=Re}),ie}function gf(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re){ie[++le]=[Re,Re]}),ie}function va(V,le,ie){for(var Re=ie-1,et=V.length;++Re<et;)if(V[Re]===le)return Re;return-1}function Is(V,le,ie){for(var Re=ie+1;Re--;)if(V[Re]===le)return Re;return Re}function er(V){return ye(V)?V3(V):cv(V)}function vt(V){return ye(V)?K3(V):df(V)}function yn(V){for(var le=V.length;le--&&qu.test(V.charAt(le)););return le}var ya=pa(tf);function V3(V){for(var le=rl.lastIndex=0;rl.test(V);)++le;return le}function K3(V){return V.match(rl)||[]}function G3(V){return V.match(da)||[]}var j3=function V(le){le=le==null?nn:ks.defaults(nn.Object(),le,ks.pick(nn,bo));var ie=le.Array,Re=le.Date,et=le.Error,yt=le.Function,rn=le.Math,Rt=le.Object,uv=le.RegExp,W3=le.String,Er=le.TypeError,mf=ie.prototype,q3=yt.prototype,Ns=Rt.prototype,vf=le["__core-js_shared__"],yf=q3.toString,Et=Ns.hasOwnProperty,Y3=0,C0=function(){var i=/[^.]+$/.exec(vf&&vf.keys&&vf.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),wf=Ns.toString,J3=yf.call(Rt),Q3=nn._,X3=uv("^"+yf.call(Et).replace($c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bf=al?le.Buffer:n,Ei=le.Symbol,Cf=le.Uint8Array,x0=bf?bf.allocUnsafe:n,xf=Tr(Rt.getPrototypeOf,Rt),_0=Rt.create,S0=Ns.propertyIsEnumerable,_f=mf.splice,T0=Ei?Ei.isConcatSpreadable:n,hl=Ei?Ei.iterator:n,wa=Ei?Ei.toStringTag:n,Sf=function(){try{var i=Sa(Rt,"defineProperty");return i({},"",{}),i}catch{}}(),Z3=le.clearTimeout!==nn.clearTimeout&&le.clearTimeout,eB=Re&&Re.now!==nn.Date.now&&Re.now,tB=le.setTimeout!==nn.setTimeout&&le.setTimeout,Tf=rn.ceil,Ef=rn.floor,fv=Rt.getOwnPropertySymbols,nB=bf?bf.isBuffer:n,E0=le.isFinite,rB=mf.join,oB=Tr(Rt.keys,Rt),on=rn.max,En=rn.min,iB=Re.now,aB=le.parseInt,A0=rn.random,sB=mf.reverse,hv=Sa(le,"DataView"),pl=Sa(le,"Map"),pv=Sa(le,"Promise"),Ps=Sa(le,"Set"),gl=Sa(le,"WeakMap"),ml=Sa(Rt,"create"),Af=gl&&new gl,Os={},cB=Ta(hv),lB=Ta(pl),dB=Ta(pv),uB=Ta(Ps),fB=Ta(gl),If=Ei?Ei.prototype:n,vl=If?If.valueOf:n,I0=If?If.toString:n;function E(i){if(Kt(i)&&!rt(i)&&!(i instanceof ft)){if(i instanceof Ar)return i;if(Et.call(i,"__wrapped__"))return kA(i)}return new Ar(i)}var Ms=function(){function i(){}return function(c){if(!Bt(c))return{};if(_0)return _0(c);i.prototype=c;var f=new i;return i.prototype=n,f}}();function kf(){}function Ar(i,c){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}E.templateSettings={escape:na,evaluate:ls,interpolate:Gu,variable:"",imports:{_:E}},E.prototype=kf.prototype,E.prototype.constructor=E,Ar.prototype=Ms(kf.prototype),Ar.prototype.constructor=Ar;function ft(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=te,this.__views__=[]}function hB(){var i=new ft(this.__wrapped__);return i.__actions__=tr(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=tr(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=tr(this.__views__),i}function pB(){if(this.__filtered__){var i=new ft(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function gB(){var i=this.__wrapped__.value(),c=this.__dir__,f=rt(i),m=c<0,_=f?i.length:0,I=A5(0,_,this.__views__),D=I.start,F=I.end,j=F-D,pe=m?F:D-1,me=this.__iteratees__,we=me.length,Oe=0,He=En(j,this.__takeCount__);if(!f||!m&&_==j&&He==j)return X0(i,this.__actions__);var qe=[];e:for(;j--&&Oe<He;){pe+=c;for(var ct=-1,Ye=i[pe];++ct<we;){var ut=me[ct],ht=ut.iteratee,wr=ut.type,Hn=ht(Ye);if(wr==Z)Ye=Hn;else if(!Hn){if(wr==K)continue e;break e}}qe[Oe++]=Ye}return qe}ft.prototype=Ms(kf.prototype),ft.prototype.constructor=ft;function ba(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function mB(){this.__data__=ml?ml(null):{},this.size=0}function vB(i){var c=this.has(i)&&delete this.__data__[i];return this.size-=c?1:0,c}function yB(i){var c=this.__data__;if(ml){var f=c[i];return f===u?n:f}return Et.call(c,i)?c[i]:n}function wB(i){var c=this.__data__;return ml?c[i]!==n:Et.call(c,i)}function bB(i,c){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=ml&&c===n?u:c,this}ba.prototype.clear=mB,ba.prototype.delete=vB,ba.prototype.get=yB,ba.prototype.has=wB,ba.prototype.set=bB;function Go(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function CB(){this.__data__=[],this.size=0}function xB(i){var c=this.__data__,f=Nf(c,i);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():_f.call(c,f,1),--this.size,!0}function _B(i){var c=this.__data__,f=Nf(c,i);return f<0?n:c[f][1]}function SB(i){return Nf(this.__data__,i)>-1}function TB(i,c){var f=this.__data__,m=Nf(f,i);return m<0?(++this.size,f.push([i,c])):f[m][1]=c,this}Go.prototype.clear=CB,Go.prototype.delete=xB,Go.prototype.get=_B,Go.prototype.has=SB,Go.prototype.set=TB;function jo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function EB(){this.size=0,this.__data__={hash:new ba,map:new(pl||Go),string:new ba}}function AB(i){var c=zf(this,i).delete(i);return this.size-=c?1:0,c}function IB(i){return zf(this,i).get(i)}function kB(i){return zf(this,i).has(i)}function NB(i,c){var f=zf(this,i),m=f.size;return f.set(i,c),this.size+=f.size==m?0:1,this}jo.prototype.clear=EB,jo.prototype.delete=AB,jo.prototype.get=IB,jo.prototype.has=kB,jo.prototype.set=NB;function Ca(i){var c=-1,f=i==null?0:i.length;for(this.__data__=new jo;++c<f;)this.add(i[c])}function PB(i){return this.__data__.set(i,u),this}function OB(i){return this.__data__.has(i)}Ca.prototype.add=Ca.prototype.push=PB,Ca.prototype.has=OB;function eo(i){var c=this.__data__=new Go(i);this.size=c.size}function MB(){this.__data__=new Go,this.size=0}function DB(i){var c=this.__data__,f=c.delete(i);return this.size=c.size,f}function RB(i){return this.__data__.get(i)}function LB(i){return this.__data__.has(i)}function FB(i,c){var f=this.__data__;if(f instanceof Go){var m=f.__data__;if(!pl||m.length<o-1)return m.push([i,c]),this.size=++f.size,this;f=this.__data__=new jo(m)}return f.set(i,c),this.size=f.size,this}eo.prototype.clear=MB,eo.prototype.delete=DB,eo.prototype.get=RB,eo.prototype.has=LB,eo.prototype.set=FB;function k0(i,c){var f=rt(i),m=!f&&Ea(i),_=!f&&!m&&Pi(i),I=!f&&!m&&!_&&Fs(i),D=f||m||_||I,F=D?As(i.length,W3):[],j=F.length;for(var pe in i)(c||Et.call(i,pe))&&!(D&&(pe=="length"||_&&(pe=="offset"||pe=="parent")||I&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||Jo(pe,j)))&&F.push(pe);return F}function N0(i){var c=i.length;return c?i[Tv(0,c-1)]:n}function UB(i,c){return Vf(tr(i),xa(c,0,i.length))}function $B(i){return Vf(tr(i))}function gv(i,c,f){(f!==n&&!to(i[c],f)||f===n&&!(c in i))&&Wo(i,c,f)}function yl(i,c,f){var m=i[c];(!(Et.call(i,c)&&to(m,f))||f===n&&!(c in i))&&Wo(i,c,f)}function Nf(i,c){for(var f=i.length;f--;)if(to(i[f][0],c))return f;return-1}function HB(i,c,f,m){return Ai(i,function(_,I,D){c(m,_,f(_),D)}),m}function P0(i,c){return i&&xo(c,un(c),i)}function BB(i,c){return i&&xo(c,rr(c),i)}function Wo(i,c,f){c=="__proto__"&&Sf?Sf(i,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[c]=f}function mv(i,c){for(var f=-1,m=c.length,_=ie(m),I=i==null;++f<m;)_[f]=I?n:Jv(i,c[f]);return _}function xa(i,c,f){return i===i&&(f!==n&&(i=i<=f?i:f),c!==n&&(i=i>=c?i:c)),i}function Ir(i,c,f,m,_,I){var D,F=c&g,j=c&w,pe=c&y;if(f&&(D=_?f(i,m,_,I):f(i)),D!==n)return D;if(!Bt(i))return i;var me=rt(i);if(me){if(D=k5(i),!F)return tr(i,D)}else{var we=An(i),Oe=we==ae||we==Ze;if(Pi(i))return tA(i,F);if(we==Ot||we==Ne||Oe&&!_){if(D=j||Oe?{}:bA(i),!F)return j?y5(i,BB(D,i)):v5(i,P0(D,i))}else{if(!ze[we])return _?i:{};D=N5(i,we,F)}}I||(I=new eo);var He=I.get(i);if(He)return He;I.set(i,D),YA(i)?i.forEach(function(Ye){D.add(Ir(Ye,c,f,Ye,i,I))}):WA(i)&&i.forEach(function(Ye,ut){D.set(ut,Ir(Ye,c,f,ut,i,I))});var qe=pe?j?Lv:Rv:j?rr:un,ct=me?n:qe(i);return Qn(ct||i,function(Ye,ut){ct&&(ut=Ye,Ye=i[ut]),yl(D,ut,Ir(Ye,c,f,ut,i,I))}),D}function zB(i){var c=un(i);return function(f){return O0(f,i,c)}}function O0(i,c,f){var m=f.length;if(i==null)return!m;for(i=Rt(i);m--;){var _=f[m],I=c[_],D=i[_];if(D===n&&!(_ in i)||!I(D))return!1}return!0}function M0(i,c,f){if(typeof i!="function")throw new Er(s);return Tl(function(){i.apply(n,f)},c)}function wl(i,c,f,m){var _=-1,I=mr,D=!0,F=i.length,j=[],pe=c.length;if(!F)return j;f&&(c=Lt(c,Fn(f))),m?(I=Ko,D=!1):c.length>=o&&(I=Xn,D=!1,c=new Ca(c));e:for(;++_<F;){var me=i[_],we=f==null?me:f(me);if(me=m||me!==0?me:0,D&&we===we){for(var Oe=pe;Oe--;)if(c[Oe]===we)continue e;j.push(me)}else I(c,we,m)||j.push(me)}return j}var Ai=aA(Co),D0=aA(yv,!0);function VB(i,c){var f=!0;return Ai(i,function(m,_,I){return f=!!c(m,_,I),f}),f}function Pf(i,c,f){for(var m=-1,_=i.length;++m<_;){var I=i[m],D=c(I);if(D!=null&&(F===n?D===D&&!yr(D):f(D,F)))var F=D,j=I}return j}function KB(i,c,f,m){var _=i.length;for(f=at(f),f<0&&(f=-f>_?0:_+f),m=m===n||m>_?_:at(m),m<0&&(m+=_),m=f>m?0:QA(m);f<m;)i[f++]=c;return i}function R0(i,c){var f=[];return Ai(i,function(m,_,I){c(m,_,I)&&f.push(m)}),f}function wn(i,c,f,m,_){var I=-1,D=i.length;for(f||(f=O5),_||(_=[]);++I<D;){var F=i[I];c>0&&f(F)?c>1?wn(F,c-1,f,m,_):Tn(_,F):m||(_[_.length]=F)}return _}var vv=sA(),L0=sA(!0);function Co(i,c){return i&&vv(i,c,un)}function yv(i,c){return i&&L0(i,c,un)}function Of(i,c){return Xr(c,function(f){return Qo(i[f])})}function _a(i,c){c=ki(c,i);for(var f=0,m=c.length;i!=null&&f<m;)i=i[_o(c[f++])];return f&&f==m?i:n}function F0(i,c,f){var m=c(i);return rt(i)?m:Tn(m,f(i))}function Un(i){return i==null?i===n?Q:ln:wa&&wa in Rt(i)?E5(i):$5(i)}function wv(i,c){return i>c}function GB(i,c){return i!=null&&Et.call(i,c)}function jB(i,c){return i!=null&&c in Rt(i)}function WB(i,c,f){return i>=En(c,f)&&i<on(c,f)}function bv(i,c,f){for(var m=f?Ko:mr,_=i[0].length,I=i.length,D=I,F=ie(I),j=1/0,pe=[];D--;){var me=i[D];D&&c&&(me=Lt(me,Fn(c))),j=En(me.length,j),F[D]=!f&&(c||_>=120&&me.length>=120)?new Ca(D&&me):n}me=i[0];var we=-1,Oe=F[0];e:for(;++we<_&&pe.length<j;){var He=me[we],qe=c?c(He):He;if(He=f||He!==0?He:0,!(Oe?Xn(Oe,qe):m(pe,qe,f))){for(D=I;--D;){var ct=F[D];if(!(ct?Xn(ct,qe):m(i[D],qe,f)))continue e}Oe&&Oe.push(qe),pe.push(He)}}return pe}function qB(i,c,f,m){return Co(i,function(_,I,D){c(m,f(_),I,D)}),m}function bl(i,c,f){c=ki(c,i),i=SA(i,c);var m=i==null?i:i[_o(Nr(c))];return m==null?n:Sn(m,i,f)}function U0(i){return Kt(i)&&Un(i)==Ne}function YB(i){return Kt(i)&&Un(i)==$e}function JB(i){return Kt(i)&&Un(i)==Ae}function Cl(i,c,f,m,_){return i===c?!0:i==null||c==null||!Kt(i)&&!Kt(c)?i!==i&&c!==c:QB(i,c,f,m,Cl,_)}function QB(i,c,f,m,_,I){var D=rt(i),F=rt(c),j=D?Te:An(i),pe=F?Te:An(c);j=j==Ne?Ot:j,pe=pe==Ne?Ot:pe;var me=j==Ot,we=pe==Ot,Oe=j==pe;if(Oe&&Pi(i)){if(!Pi(c))return!1;D=!0,me=!1}if(Oe&&!me)return I||(I=new eo),D||Fs(i)?vA(i,c,f,m,_,I):S5(i,c,j,f,m,_,I);if(!(f&C)){var He=me&&Et.call(i,"__wrapped__"),qe=we&&Et.call(c,"__wrapped__");if(He||qe){var ct=He?i.value():i,Ye=qe?c.value():c;return I||(I=new eo),_(ct,Ye,f,m,I)}}return Oe?(I||(I=new eo),T5(i,c,f,m,_,I)):!1}function XB(i){return Kt(i)&&An(i)==nt}function Cv(i,c,f,m){var _=f.length,I=_,D=!m;if(i==null)return!I;for(i=Rt(i);_--;){var F=f[_];if(D&&F[2]?F[1]!==i[F[0]]:!(F[0]in i))return!1}for(;++_<I;){F=f[_];var j=F[0],pe=i[j],me=F[1];if(D&&F[2]){if(pe===n&&!(j in i))return!1}else{var we=new eo;if(m)var Oe=m(pe,me,j,i,c,we);if(!(Oe===n?Cl(me,pe,C|v,m,we):Oe))return!1}}return!0}function $0(i){if(!Bt(i)||D5(i))return!1;var c=Qo(i)?X3:hs;return c.test(Ta(i))}function ZB(i){return Kt(i)&&Un(i)==R}function e5(i){return Kt(i)&&An(i)==Y}function t5(i){return Kt(i)&&Yf(i.length)&&!!mt[Un(i)]}function H0(i){return typeof i=="function"?i:i==null?or:typeof i=="object"?rt(i)?V0(i[0],i[1]):z0(i):cI(i)}function xv(i){if(!Sl(i))return oB(i);var c=[];for(var f in Rt(i))Et.call(i,f)&&f!="constructor"&&c.push(f);return c}function n5(i){if(!Bt(i))return U5(i);var c=Sl(i),f=[];for(var m in i)m=="constructor"&&(c||!Et.call(i,m))||f.push(m);return f}function _v(i,c){return i<c}function B0(i,c){var f=-1,m=nr(i)?ie(i.length):[];return Ai(i,function(_,I,D){m[++f]=c(_,I,D)}),m}function z0(i){var c=Uv(i);return c.length==1&&c[0][2]?xA(c[0][0],c[0][1]):function(f){return f===i||Cv(f,i,c)}}function V0(i,c){return Hv(i)&&CA(c)?xA(_o(i),c):function(f){var m=Jv(f,i);return m===n&&m===c?Qv(f,i):Cl(c,m,C|v)}}function Mf(i,c,f,m,_){i!==c&&vv(c,function(I,D){if(_||(_=new eo),Bt(I))r5(i,c,D,f,Mf,m,_);else{var F=m?m(zv(i,D),I,D+"",i,c,_):n;F===n&&(F=I),gv(i,D,F)}},rr)}function r5(i,c,f,m,_,I,D){var F=zv(i,f),j=zv(c,f),pe=D.get(j);if(pe){gv(i,f,pe);return}var me=I?I(F,j,f+"",i,c,D):n,we=me===n;if(we){var Oe=rt(j),He=!Oe&&Pi(j),qe=!Oe&&!He&&Fs(j);me=j,Oe||He||qe?rt(F)?me=F:jt(F)?me=tr(F):He?(we=!1,me=tA(j,!0)):qe?(we=!1,me=nA(j,!0)):me=[]:El(j)||Ea(j)?(me=F,Ea(F)?me=XA(F):(!Bt(F)||Qo(F))&&(me=bA(j))):we=!1}we&&(D.set(j,me),_(me,j,m,I,D),D.delete(j)),gv(i,f,me)}function K0(i,c){var f=i.length;if(f)return c+=c<0?f:0,Jo(c,f)?i[c]:n}function G0(i,c,f){c.length?c=Lt(c,function(I){return rt(I)?function(D){return _a(D,I.length===1?I[0]:I)}:I}):c=[or];var m=-1;c=Lt(c,Fn(je()));var _=B0(i,function(I,D,F){var j=Lt(c,function(pe){return pe(I)});return{criteria:j,index:++m,value:I}});return lv(_,function(I,D){return m5(I,D,f)})}function o5(i,c){return j0(i,c,function(f,m){return Qv(i,m)})}function j0(i,c,f){for(var m=-1,_=c.length,I={};++m<_;){var D=c[m],F=_a(i,D);f(F,D)&&xl(I,ki(D,i),F)}return I}function i5(i){return function(c){return _a(c,i)}}function Sv(i,c,f,m){var _=m?cl:Ti,I=-1,D=c.length,F=i;for(i===c&&(c=tr(c)),f&&(F=Lt(i,Fn(f)));++I<D;)for(var j=0,pe=c[I],me=f?f(pe):pe;(j=_(F,me,j,m))>-1;)F!==i&&_f.call(F,j,1),_f.call(i,j,1);return i}function W0(i,c){for(var f=i?c.length:0,m=f-1;f--;){var _=c[f];if(f==m||_!==I){var I=_;Jo(_)?_f.call(i,_,1):Iv(i,_)}}return i}function Tv(i,c){return i+Ef(A0()*(c-i+1))}function a5(i,c,f,m){for(var _=-1,I=on(Tf((c-i)/(f||1)),0),D=ie(I);I--;)D[m?I:++_]=i,i+=f;return D}function Ev(i,c){var f="";if(!i||c<1||c>J)return f;do c%2&&(f+=i),c=Ef(c/2),c&&(i+=i);while(c);return f}function dt(i,c){return Vv(_A(i,c,or),i+"")}function s5(i){return N0(Us(i))}function c5(i,c){var f=Us(i);return Vf(f,xa(c,0,f.length))}function xl(i,c,f,m){if(!Bt(i))return i;c=ki(c,i);for(var _=-1,I=c.length,D=I-1,F=i;F!=null&&++_<I;){var j=_o(c[_]),pe=f;if(j==="__proto__"||j==="constructor"||j==="prototype")return i;if(_!=D){var me=F[j];pe=m?m(me,j,F):n,pe===n&&(pe=Bt(me)?me:Jo(c[_+1])?[]:{})}yl(F,j,pe),F=F[j]}return i}var q0=Af?function(i,c){return Af.set(i,c),i}:or,l5=Sf?function(i,c){return Sf(i,"toString",{configurable:!0,enumerable:!1,value:Zv(c),writable:!0})}:or;function d5(i){return Vf(Us(i))}function kr(i,c,f){var m=-1,_=i.length;c<0&&(c=-c>_?0:_+c),f=f>_?_:f,f<0&&(f+=_),_=c>f?0:f-c>>>0,c>>>=0;for(var I=ie(_);++m<_;)I[m]=i[m+c];return I}function u5(i,c){var f;return Ai(i,function(m,_,I){return f=c(m,_,I),!f}),!!f}function Df(i,c,f){var m=0,_=i==null?m:i.length;if(typeof c=="number"&&c===c&&_<=Ee){for(;m<_;){var I=m+_>>>1,D=i[I];D!==null&&!yr(D)&&(f?D<=c:D<c)?m=I+1:_=I}return _}return Av(i,c,or,f)}function Av(i,c,f,m){var _=0,I=i==null?0:i.length;if(I===0)return 0;c=f(c);for(var D=c!==c,F=c===null,j=yr(c),pe=c===n;_<I;){var me=Ef((_+I)/2),we=f(i[me]),Oe=we!==n,He=we===null,qe=we===we,ct=yr(we);if(D)var Ye=m||qe;else pe?Ye=qe&&(m||Oe):F?Ye=qe&&Oe&&(m||!He):j?Ye=qe&&Oe&&!He&&(m||!ct):He||ct?Ye=!1:Ye=m?we<=c:we<c;Ye?_=me+1:I=me}return En(I,be)}function Y0(i,c){for(var f=-1,m=i.length,_=0,I=[];++f<m;){var D=i[f],F=c?c(D):D;if(!f||!to(F,j)){var j=F;I[_++]=D===0?0:D}}return I}function J0(i){return typeof i=="number"?i:yr(i)?U:+i}function vr(i){if(typeof i=="string")return i;if(rt(i))return Lt(i,vr)+"";if(yr(i))return I0?I0.call(i):"";var c=i+"";return c=="0"&&1/i==-re?"-0":c}function Ii(i,c,f){var m=-1,_=mr,I=i.length,D=!0,F=[],j=F;if(f)D=!1,_=Ko;else if(I>=o){var pe=c?null:x5(i);if(pe)return ma(pe);D=!1,_=Xn,j=new Ca}else j=c?[]:F;e:for(;++m<I;){var me=i[m],we=c?c(me):me;if(me=f||me!==0?me:0,D&&we===we){for(var Oe=j.length;Oe--;)if(j[Oe]===we)continue e;c&&j.push(we),F.push(me)}else _(j,we,f)||(j!==F&&j.push(we),F.push(me))}return F}function Iv(i,c){return c=ki(c,i),i=SA(i,c),i==null||delete i[_o(Nr(c))]}function Q0(i,c,f,m){return xl(i,c,f(_a(i,c)),m)}function Rf(i,c,f,m){for(var _=i.length,I=m?_:-1;(m?I--:++I<_)&&c(i[I],I,i););return f?kr(i,m?0:I,m?I+1:_):kr(i,m?I+1:0,m?_:I)}function X0(i,c){var f=i;return f instanceof ft&&(f=f.value()),sl(c,function(m,_){return _.func.apply(_.thisArg,Tn([m],_.args))},f)}function kv(i,c,f){var m=i.length;if(m<2)return m?Ii(i[0]):[];for(var _=-1,I=ie(m);++_<m;)for(var D=i[_],F=-1;++F<m;)F!=_&&(I[_]=wl(I[_]||D,i[F],c,f));return Ii(wn(I,1),c,f)}function Z0(i,c,f){for(var m=-1,_=i.length,I=c.length,D={};++m<_;){var F=m<I?c[m]:n;f(D,i[m],F)}return D}function Nv(i){return jt(i)?i:[]}function Pv(i){return typeof i=="function"?i:or}function ki(i,c){return rt(i)?i:Hv(i,c)?[i]:IA(xt(i))}var f5=dt;function Ni(i,c,f){var m=i.length;return f=f===n?m:f,!c&&f>=m?i:kr(i,c,f)}var eA=Z3||function(i){return nn.clearTimeout(i)};function tA(i,c){if(c)return i.slice();var f=i.length,m=x0?x0(f):new i.constructor(f);return i.copy(m),m}function Ov(i){var c=new i.constructor(i.byteLength);return new Cf(c).set(new Cf(i)),c}function h5(i,c){var f=c?Ov(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function p5(i){var c=new i.constructor(i.source,Bc.exec(i));return c.lastIndex=i.lastIndex,c}function g5(i){return vl?Rt(vl.call(i)):{}}function nA(i,c){var f=c?Ov(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function rA(i,c){if(i!==c){var f=i!==n,m=i===null,_=i===i,I=yr(i),D=c!==n,F=c===null,j=c===c,pe=yr(c);if(!F&&!pe&&!I&&i>c||I&&D&&j&&!F&&!pe||m&&D&&j||!f&&j||!_)return 1;if(!m&&!I&&!pe&&i<c||pe&&f&&_&&!m&&!I||F&&f&&_||!D&&_||!j)return-1}return 0}function m5(i,c,f){for(var m=-1,_=i.criteria,I=c.criteria,D=_.length,F=f.length;++m<D;){var j=rA(_[m],I[m]);if(j){if(m>=F)return j;var pe=f[m];return j*(pe=="desc"?-1:1)}}return i.index-c.index}function oA(i,c,f,m){for(var _=-1,I=i.length,D=f.length,F=-1,j=c.length,pe=on(I-D,0),me=ie(j+pe),we=!m;++F<j;)me[F]=c[F];for(;++_<D;)(we||_<I)&&(me[f[_]]=i[_]);for(;pe--;)me[F++]=i[_++];return me}function iA(i,c,f,m){for(var _=-1,I=i.length,D=-1,F=f.length,j=-1,pe=c.length,me=on(I-F,0),we=ie(me+pe),Oe=!m;++_<me;)we[_]=i[_];for(var He=_;++j<pe;)we[He+j]=c[j];for(;++D<F;)(Oe||_<I)&&(we[He+f[D]]=i[_++]);return we}function tr(i,c){var f=-1,m=i.length;for(c||(c=ie(m));++f<m;)c[f]=i[f];return c}function xo(i,c,f,m){var _=!f;f||(f={});for(var I=-1,D=c.length;++I<D;){var F=c[I],j=m?m(f[F],i[F],F,f,i):n;j===n&&(j=i[F]),_?Wo(f,F,j):yl(f,F,j)}return f}function v5(i,c){return xo(i,$v(i),c)}function y5(i,c){return xo(i,yA(i),c)}function Lf(i,c){return function(f,m){var _=rt(f)?iv:HB,I=c?c():{};return _(f,i,je(m,2),I)}}function Ds(i){return dt(function(c,f){var m=-1,_=f.length,I=_>1?f[_-1]:n,D=_>2?f[2]:n;for(I=i.length>3&&typeof I=="function"?(_--,I):n,D&&$n(f[0],f[1],D)&&(I=_<3?n:I,_=1),c=Rt(c);++m<_;){var F=f[m];F&&i(c,F,m,I)}return c})}function aA(i,c){return function(f,m){if(f==null)return f;if(!nr(f))return i(f,m);for(var _=f.length,I=c?_:-1,D=Rt(f);(c?I--:++I<_)&&m(D[I],I,D)!==!1;);return f}}function sA(i){return function(c,f,m){for(var _=-1,I=Rt(c),D=m(c),F=D.length;F--;){var j=D[i?F:++_];if(f(I[j],j,I)===!1)break}return c}}function w5(i,c,f){var m=c&b,_=_l(i);function I(){var D=this&&this!==nn&&this instanceof I?_:i;return D.apply(m?f:this,arguments)}return I}function cA(i){return function(c){c=xt(c);var f=ye(c)?vt(c):n,m=f?f[0]:c.charAt(0),_=f?Ni(f,1).join(""):c.slice(1);return m[i]()+_}}function Rs(i){return function(c){return sl(aI(iI(c).replace(gr,"")),i,"")}}function _l(i){return function(){var c=arguments;switch(c.length){case 0:return new i;case 1:return new i(c[0]);case 2:return new i(c[0],c[1]);case 3:return new i(c[0],c[1],c[2]);case 4:return new i(c[0],c[1],c[2],c[3]);case 5:return new i(c[0],c[1],c[2],c[3],c[4]);case 6:return new i(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new i(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=Ms(i.prototype),m=i.apply(f,c);return Bt(m)?m:f}}function b5(i,c,f){var m=_l(i);function _(){for(var I=arguments.length,D=ie(I),F=I,j=Ls(_);F--;)D[F]=arguments[F];var pe=I<3&&D[0]!==j&&D[I-1]!==j?[]:Zn(D,j);if(I-=pe.length,I<f)return hA(i,c,Ff,_.placeholder,n,D,pe,n,n,f-I);var me=this&&this!==nn&&this instanceof _?m:i;return Sn(me,this,D)}return _}function lA(i){return function(c,f,m){var _=Rt(c);if(!nr(c)){var I=je(f,3);c=un(c),f=function(F){return I(_[F],F,_)}}var D=i(c,f,m);return D>-1?_[I?c[D]:D]:n}}function dA(i){return Yo(function(c){var f=c.length,m=f,_=Ar.prototype.thru;for(i&&c.reverse();m--;){var I=c[m];if(typeof I!="function")throw new Er(s);if(_&&!D&&Bf(I)=="wrapper")var D=new Ar([],!0)}for(m=D?m:f;++m<f;){I=c[m];var F=Bf(I),j=F=="wrapper"?Fv(I):n;j&&Bv(j[0])&&j[1]==(H|N|T|W)&&!j[4].length&&j[9]==1?D=D[Bf(j[0])].apply(D,j[3]):D=I.length==1&&Bv(I)?D[F]():D.thru(I)}return function(){var pe=arguments,me=pe[0];if(D&&pe.length==1&&rt(me))return D.plant(me).value();for(var we=0,Oe=f?c[we].apply(this,pe):me;++we<f;)Oe=c[we].call(this,Oe);return Oe}})}function Ff(i,c,f,m,_,I,D,F,j,pe){var me=c&H,we=c&b,Oe=c&k,He=c&(N|O),qe=c&ee,ct=Oe?n:_l(i);function Ye(){for(var ut=arguments.length,ht=ie(ut),wr=ut;wr--;)ht[wr]=arguments[wr];if(He)var Hn=Ls(Ye),br=pf(ht,Hn);if(m&&(ht=oA(ht,m,_,He)),I&&(ht=iA(ht,I,D,He)),ut-=br,He&&ut<pe){var Wt=Zn(ht,Hn);return hA(i,c,Ff,Ye.placeholder,f,ht,Wt,F,j,pe-ut)}var no=we?f:this,Zo=Oe?no[i]:i;return ut=ht.length,F?ht=H5(ht,F):qe&&ut>1&&ht.reverse(),me&&j<ut&&(ht.length=j),this&&this!==nn&&this instanceof Ye&&(Zo=ct||_l(Zo)),Zo.apply(no,ht)}return Ye}function uA(i,c){return function(f,m){return qB(f,i,c(m),{})}}function Uf(i,c){return function(f,m){var _;if(f===n&&m===n)return c;if(f!==n&&(_=f),m!==n){if(_===n)return m;typeof f=="string"||typeof m=="string"?(f=vr(f),m=vr(m)):(f=J0(f),m=J0(m)),_=i(f,m)}return _}}function Mv(i){return Yo(function(c){return c=Lt(c,Fn(je())),dt(function(f){var m=this;return i(c,function(_){return Sn(_,m,f)})})})}function $f(i,c){c=c===n?" ":vr(c);var f=c.length;if(f<2)return f?Ev(c,i):c;var m=Ev(c,Tf(i/er(c)));return ye(c)?Ni(vt(m),0,i).join(""):m.slice(0,i)}function C5(i,c,f,m){var _=c&b,I=_l(i);function D(){for(var F=-1,j=arguments.length,pe=-1,me=m.length,we=ie(me+j),Oe=this&&this!==nn&&this instanceof D?I:i;++pe<me;)we[pe]=m[pe];for(;j--;)we[pe++]=arguments[++F];return Sn(Oe,_?f:this,we)}return D}function fA(i){return function(c,f,m){return m&&typeof m!="number"&&$n(c,f,m)&&(f=m=n),c=Xo(c),f===n?(f=c,c=0):f=Xo(f),m=m===n?c<f?1:-1:Xo(m),a5(c,f,m,i)}}function Hf(i){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pr(c),f=Pr(f)),i(c,f)}}function hA(i,c,f,m,_,I,D,F,j,pe){var me=c&N,we=me?D:n,Oe=me?n:D,He=me?I:n,qe=me?n:I;c|=me?T:L,c&=~(me?L:T),c&A||(c&=-4);var ct=[i,c,_,He,we,qe,Oe,F,j,pe],Ye=f.apply(n,ct);return Bv(i)&&TA(Ye,ct),Ye.placeholder=m,EA(Ye,i,c)}function Dv(i){var c=rn[i];return function(f,m){if(f=Pr(f),m=m==null?0:En(at(m),292),m&&E0(f)){var _=(xt(f)+"e").split("e"),I=c(_[0]+"e"+(+_[1]+m));return _=(xt(I)+"e").split("e"),+(_[0]+"e"+(+_[1]-m))}return c(f)}}var x5=Ps&&1/ma(new Ps([,-0]))[1]==re?function(i){return new Ps(i)}:ny;function pA(i){return function(c){var f=An(c);return f==nt?Ct(c):f==Y?gf(c):dv(c,i(c))}}function qo(i,c,f,m,_,I,D,F){var j=c&k;if(!j&&typeof i!="function")throw new Er(s);var pe=m?m.length:0;if(pe||(c&=-97,m=_=n),D=D===n?D:on(at(D),0),F=F===n?F:at(F),pe-=_?_.length:0,c&L){var me=m,we=_;m=_=n}var Oe=j?n:Fv(i),He=[i,c,f,m,_,me,we,I,D,F];if(Oe&&F5(He,Oe),i=He[0],c=He[1],f=He[2],m=He[3],_=He[4],F=He[9]=He[9]===n?j?0:i.length:on(He[9]-pe,0),!F&&c&(N|O)&&(c&=-25),!c||c==b)var qe=w5(i,c,f);else c==N||c==O?qe=b5(i,c,F):(c==T||c==(b|T))&&!_.length?qe=C5(i,c,f,m):qe=Ff.apply(n,He);var ct=Oe?q0:TA;return EA(ct(qe,He),i,c)}function gA(i,c,f,m){return i===n||to(i,Ns[f])&&!Et.call(m,f)?c:i}function mA(i,c,f,m,_,I){return Bt(i)&&Bt(c)&&(I.set(c,i),Mf(i,c,n,mA,I),I.delete(c)),i}function _5(i){return El(i)?n:i}function vA(i,c,f,m,_,I){var D=f&C,F=i.length,j=c.length;if(F!=j&&!(D&&j>F))return!1;var pe=I.get(i),me=I.get(c);if(pe&&me)return pe==c&&me==i;var we=-1,Oe=!0,He=f&v?new Ca:n;for(I.set(i,c),I.set(c,i);++we<F;){var qe=i[we],ct=c[we];if(m)var Ye=D?m(ct,qe,we,c,i,I):m(qe,ct,we,i,c,I);if(Ye!==n){if(Ye)continue;Oe=!1;break}if(He){if(!ha(c,function(ut,ht){if(!Xn(He,ht)&&(qe===ut||_(qe,ut,f,m,I)))return He.push(ht)})){Oe=!1;break}}else if(!(qe===ct||_(qe,ct,f,m,I))){Oe=!1;break}}return I.delete(i),I.delete(c),Oe}function S5(i,c,f,m,_,I,D){switch(f){case Be:if(i.byteLength!=c.byteLength||i.byteOffset!=c.byteOffset)return!1;i=i.buffer,c=c.buffer;case $e:return!(i.byteLength!=c.byteLength||!I(new Cf(i),new Cf(c)));case ue:case Ae:case Tt:return to(+i,+c);case Pe:return i.name==c.name&&i.message==c.message;case R:case se:return i==c+"";case nt:var F=Ct;case Y:var j=m&C;if(F||(F=ma),i.size!=c.size&&!j)return!1;var pe=D.get(i);if(pe)return pe==c;m|=v,D.set(i,c);var me=vA(F(i),F(c),m,_,I,D);return D.delete(i),me;case Ie:if(vl)return vl.call(i)==vl.call(c)}return!1}function T5(i,c,f,m,_,I){var D=f&C,F=Rv(i),j=F.length,pe=Rv(c),me=pe.length;if(j!=me&&!D)return!1;for(var we=j;we--;){var Oe=F[we];if(!(D?Oe in c:Et.call(c,Oe)))return!1}var He=I.get(i),qe=I.get(c);if(He&&qe)return He==c&&qe==i;var ct=!0;I.set(i,c),I.set(c,i);for(var Ye=D;++we<j;){Oe=F[we];var ut=i[Oe],ht=c[Oe];if(m)var wr=D?m(ht,ut,Oe,c,i,I):m(ut,ht,Oe,i,c,I);if(!(wr===n?ut===ht||_(ut,ht,f,m,I):wr)){ct=!1;break}Ye||(Ye=Oe=="constructor")}if(ct&&!Ye){var Hn=i.constructor,br=c.constructor;Hn!=br&&"constructor"in i&&"constructor"in c&&!(typeof Hn=="function"&&Hn instanceof Hn&&typeof br=="function"&&br instanceof br)&&(ct=!1)}return I.delete(i),I.delete(c),ct}function Yo(i){return Vv(_A(i,n,OA),i+"")}function Rv(i){return F0(i,un,$v)}function Lv(i){return F0(i,rr,yA)}var Fv=Af?function(i){return Af.get(i)}:ny;function Bf(i){for(var c=i.name+"",f=Os[c],m=Et.call(Os,c)?f.length:0;m--;){var _=f[m],I=_.func;if(I==null||I==i)return _.name}return c}function Ls(i){var c=Et.call(E,"placeholder")?E:i;return c.placeholder}function je(){var i=E.iteratee||ey;return i=i===ey?H0:i,arguments.length?i(arguments[0],arguments[1]):i}function zf(i,c){var f=i.__data__;return M5(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Uv(i){for(var c=un(i),f=c.length;f--;){var m=c[f],_=i[m];c[f]=[m,_,CA(_)]}return c}function Sa(i,c){var f=fe(i,c);return $0(f)?f:n}function E5(i){var c=Et.call(i,wa),f=i[wa];try{i[wa]=n;var m=!0}catch{}var _=wf.call(i);return m&&(c?i[wa]=f:delete i[wa]),_}var $v=fv?function(i){return i==null?[]:(i=Rt(i),Xr(fv(i),function(c){return S0.call(i,c)}))}:ry,yA=fv?function(i){for(var c=[];i;)Tn(c,$v(i)),i=xf(i);return c}:ry,An=Un;(hv&&An(new hv(new ArrayBuffer(1)))!=Be||pl&&An(new pl)!=nt||pv&&An(pv.resolve())!=mn||Ps&&An(new Ps)!=Y||gl&&An(new gl)!=ne)&&(An=function(i){var c=Un(i),f=c==Ot?i.constructor:n,m=f?Ta(f):"";if(m)switch(m){case cB:return Be;case lB:return nt;case dB:return mn;case uB:return Y;case fB:return ne}return c});function A5(i,c,f){for(var m=-1,_=f.length;++m<_;){var I=f[m],D=I.size;switch(I.type){case"drop":i+=D;break;case"dropRight":c-=D;break;case"take":c=En(c,i+D);break;case"takeRight":i=on(i,c-D);break}}return{start:i,end:c}}function I5(i){var c=i.match(Yu);return c?c[1].split(oa):[]}function wA(i,c,f){c=ki(c,i);for(var m=-1,_=c.length,I=!1;++m<_;){var D=_o(c[m]);if(!(I=i!=null&&f(i,D)))break;i=i[D]}return I||++m!=_?I:(_=i==null?0:i.length,!!_&&Yf(_)&&Jo(D,_)&&(rt(i)||Ea(i)))}function k5(i){var c=i.length,f=new i.constructor(c);return c&&typeof i[0]=="string"&&Et.call(i,"index")&&(f.index=i.index,f.input=i.input),f}function bA(i){return typeof i.constructor=="function"&&!Sl(i)?Ms(xf(i)):{}}function N5(i,c,f){var m=i.constructor;switch(c){case $e:return Ov(i);case ue:case Ae:return new m(+i);case Be:return h5(i,f);case Mt:case tn:case zt:case yo:case Gt:case vn:case Jr:case Vt:case pr:return nA(i,f);case nt:return new m;case Tt:case se:return new m(i);case R:return p5(i);case Y:return new m;case Ie:return g5(i)}}function P5(i,c){var f=c.length;if(!f)return i;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),i.replace(us,`{
79
+ */Fd.exports,function(t,e){(function(){var n,r="4.17.21",o=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",g=1,w=2,y=4,C=1,v=2,b=1,k=2,A=4,N=8,O=16,T=32,L=64,H=128,W=256,ee=512,q=30,de="...",ce=800,ve=16,K=1,Z=2,G=3,re=1/0,J=9007199254740991,X=17976931348623157e292,U=NaN,te=4294967295,be=te-1,Ee=te>>>1,Ce=[["ary",H],["bind",b],["bindKey",k],["curry",N],["curryRight",O],["flip",ee],["partial",T],["partialRight",L],["rearg",W]],Ne="[object Arguments]",Te="[object Array]",z="[object AsyncFunction]",ue="[object Boolean]",Ae="[object Date]",xe="[object DOMException]",Pe="[object Error]",ae="[object Function]",Ze="[object GeneratorFunction]",nt="[object Map]",Tt="[object Number]",ln="[object Null]",Ot="[object Object]",mn="[object Promise]",en="[object Proxy]",R="[object RegExp]",Y="[object Set]",se="[object String]",Ie="[object Symbol]",Q="[object Undefined]",ne="[object WeakMap]",ke="[object WeakSet]",$e="[object ArrayBuffer]",Be="[object DataView]",Mt="[object Float32Array]",tn="[object Float64Array]",zt="[object Int8Array]",yo="[object Int16Array]",jt="[object Int32Array]",vn="[object Uint8Array]",Jr="[object Uint8ClampedArray]",Vt="[object Uint16Array]",pr="[object Uint32Array]",Qr=/\b__p \+= '';/g,ea=/\b(__p \+=) '' \+/g,Xe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$o=/&(?:amp|lt|gt|quot|#39);/g,Uc=/[&<>"']/g,wo=RegExp($o.source),ta=RegExp(Uc.source),na=/<%-([\s\S]+?)%>/g,ls=/<%([\s\S]+?)%>/g,Gu=/<%=([\s\S]+?)%>/g,ra=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ds=/^\w*$/,ju=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$c=/[\\^$.*+?()[\]{}|]/g,Wu=RegExp($c.source),Hc=/^\s+/,qu=/\s/,us=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yu=/\{\n\/\* \[wrapped with (.+)\] \*/,oa=/,? & /,Ju=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fs=/[()=,{}\[\]\/\s]/,Wm=/\\(\\)?/g,Ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bc=/\w*$/,zc=/^[-+]0x[0-9a-f]+$/i,ia=/^0b[01]+$/i,hs=/^\[object .+?Constructor\]$/,qm=/^0o[0-7]+$/i,Dt=/^(?:0|[1-9]\d*)$/,Vc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kc=/($^)/,Ym=/['\n\r\u2028\u2029\\]/g,Gc="\\ud800-\\udfff",jc="\\u0300-\\u036f",Qu="\\ufe20-\\ufe2f",ps="\\u20d0-\\u20ff",Wc=jc+Qu+ps,qc="\\u2700-\\u27bf",Yc="a-z\\xdf-\\xf6\\xf8-\\xff",Xu="\\xac\\xb1\\xd7\\xf7",gs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Jc="\\u2000-\\u206f",Jm=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aa="A-Z\\xc0-\\xd6\\xd8-\\xde",sa="\\ufe0e\\ufe0f",Qc=Xu+gs+Jc+Jm,Xc="['’]",xi="["+Gc+"]",Zc="["+Qc+"]",_i="["+Wc+"]",el="\\d+",Qm="["+qc+"]",ms="["+Yc+"]",tl="[^"+Gc+Qc+el+qc+Yc+aa+"]",vs="\\ud83c[\\udffb-\\udfff]",ys="(?:"+_i+"|"+vs+")",Bo="[^"+Gc+"]",zo="(?:\\ud83c[\\udde6-\\uddff]){2}",ws="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="["+aa+"]",gt="\\u200d",ca="(?:"+ms+"|"+tl+")",Xm="(?:"+Si+"|"+tl+")",bs="(?:"+Xc+"(?:d|ll|m|re|s|t|ve))?",Zu="(?:"+Xc+"(?:D|LL|M|RE|S|T|VE))?",la=ys+"?",Sr="["+sa+"]?",nl="(?:"+gt+"(?:"+[Bo,zo,ws].join("|")+")"+Sr+la+")*",y0="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",w0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ef=Sr+la+nl,b0="(?:"+[Qm,zo,ws].join("|")+")"+ef,Zm="(?:"+[Bo+_i+"?",_i,zo,ws,xi].join("|")+")",gr=RegExp(Xc,"g"),Cs=RegExp(_i,"g"),rl=RegExp(vs+"(?="+vs+")|"+Zm+ef,"g"),da=RegExp([Si+"?"+ms+"+"+bs+"(?="+[Zc,Si,"$"].join("|")+")",Xm+"+"+Zu+"(?="+[Zc,Si+ca,"$"].join("|")+")",Si+"?"+ca+"+"+bs,Si+"+"+Zu,w0,y0,el,b0].join("|"),"g"),dn=RegExp("["+gt+Gc+Wc+sa+"]"),ol=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,bo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],il=-1,mt={};mt[Mt]=mt[tn]=mt[zt]=mt[yo]=mt[jt]=mt[vn]=mt[Jr]=mt[Vt]=mt[pr]=!0,mt[Ne]=mt[Te]=mt[$e]=mt[ue]=mt[Be]=mt[Ae]=mt[Pe]=mt[ae]=mt[nt]=mt[Tt]=mt[Ot]=mt[R]=mt[Y]=mt[se]=mt[ne]=!1;var ze={};ze[Ne]=ze[Te]=ze[$e]=ze[Be]=ze[ue]=ze[Ae]=ze[Mt]=ze[tn]=ze[zt]=ze[yo]=ze[jt]=ze[nt]=ze[Tt]=ze[Ot]=ze[R]=ze[Y]=ze[se]=ze[Ie]=ze[vn]=ze[Jr]=ze[Vt]=ze[pr]=!0,ze[Pe]=ze[ae]=ze[ne]=!1;var ev={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},nv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},rv=parseFloat,xs=parseInt,nf=typeof so=="object"&&so&&so.Object===Object&&so,ov=typeof self=="object"&&self&&self.Object===Object&&self,nn=nf||ov||Function("return this")(),_s=e&&!e.nodeType&&e,Vo=_s&&!0&&t&&!t.nodeType&&t,al=Vo&&Vo.exports===_s,ua=al&&nf.process,Jn=function(){try{var V=Vo&&Vo.require&&Vo.require("util").types;return V||ua&&ua.binding&&ua.binding("util")}catch{}}(),rf=Jn&&Jn.isArrayBuffer,of=Jn&&Jn.isDate,af=Jn&&Jn.isMap,fa=Jn&&Jn.isRegExp,sf=Jn&&Jn.isSet,cf=Jn&&Jn.isTypedArray;function Sn(V,le,ie){switch(ie.length){case 0:return V.call(le);case 1:return V.call(le,ie[0]);case 2:return V.call(le,ie[0],ie[1]);case 3:return V.call(le,ie[0],ie[1],ie[2])}return V.apply(le,ie)}function iv(V,le,ie,Re){for(var et=-1,yt=V==null?0:V.length;++et<yt;){var rn=V[et];le(Re,rn,ie(rn),V)}return Re}function Qn(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re&&le(V[ie],ie,V)!==!1;);return V}function av(V,le){for(var ie=V==null?0:V.length;ie--&&le(V[ie],ie,V)!==!1;);return V}function lf(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re;)if(!le(V[ie],ie,V))return!1;return!0}function Xr(V,le){for(var ie=-1,Re=V==null?0:V.length,et=0,yt=[];++ie<Re;){var rn=V[ie];le(rn,ie,V)&&(yt[et++]=rn)}return yt}function mr(V,le){var ie=V==null?0:V.length;return!!ie&&Ti(V,le,0)>-1}function Ko(V,le,ie){for(var Re=-1,et=V==null?0:V.length;++Re<et;)if(ie(le,V[Re]))return!0;return!1}function Lt(V,le){for(var ie=-1,Re=V==null?0:V.length,et=Array(Re);++ie<Re;)et[ie]=le(V[ie],ie,V);return et}function Tn(V,le){for(var ie=-1,Re=le.length,et=V.length;++ie<Re;)V[et+ie]=le[ie];return V}function sl(V,le,ie,Re){var et=-1,yt=V==null?0:V.length;for(Re&&yt&&(ie=V[++et]);++et<yt;)ie=le(ie,V[et],et,V);return ie}function sv(V,le,ie,Re){var et=V==null?0:V.length;for(Re&&et&&(ie=V[--et]);et--;)ie=le(ie,V[et],et,V);return ie}function ha(V,le){for(var ie=-1,Re=V==null?0:V.length;++ie<Re;)if(le(V[ie],ie,V))return!0;return!1}var cv=Es("length");function df(V){return V.split("")}function Ss(V){return V.match(Ju)||[]}function uf(V,le,ie){var Re;return ie(V,function(et,yt,rn){if(le(et,yt,rn))return Re=yt,!1}),Re}function Ts(V,le,ie,Re){for(var et=V.length,yt=ie+(Re?1:-1);Re?yt--:++yt<et;)if(le(V[yt],yt,V))return yt;return-1}function Ti(V,le,ie){return le===le?va(V,le,ie):Ts(V,ll,ie)}function cl(V,le,ie,Re){for(var et=ie-1,yt=V.length;++et<yt;)if(Re(V[et],le))return et;return-1}function ll(V){return V!==V}function ff(V,le){var ie=V==null?0:V.length;return ie?ul(V,le)/ie:U}function Es(V){return function(le){return le==null?n:le[V]}}function pa(V){return function(le){return V==null?n:V[le]}}function dl(V,le,ie,Re,et){return et(V,function(yt,rn,Rt){ie=Re?(Re=!1,yt):le(ie,yt,rn,Rt)}),ie}function lv(V,le){var ie=V.length;for(V.sort(le);ie--;)V[ie]=V[ie].value;return V}function ul(V,le){for(var ie,Re=-1,et=V.length;++Re<et;){var yt=le(V[Re]);yt!==n&&(ie=ie===n?yt:ie+yt)}return ie}function As(V,le){for(var ie=-1,Re=Array(V);++ie<V;)Re[ie]=le(ie);return Re}function dv(V,le){return Lt(le,function(ie){return[ie,V[ie]]})}function fl(V){return V&&V.slice(0,yn(V)+1).replace(Hc,"")}function Ln(V){return function(le){return V(le)}}function Zr(V,le){return Lt(le,function(ie){return V[ie]})}function Xn(V,le){return V.has(le)}function ga(V,le){for(var ie=-1,Re=V.length;++ie<Re&&Ti(le,V[ie],0)>-1;);return ie}function hf(V,le){for(var ie=V.length;ie--&&Ti(le,V[ie],0)>-1;);return ie}function pf(V,le){for(var ie=V.length,Re=0;ie--;)V[ie]===le&&++Re;return Re}var S=pa(ev),P=pa(tv);function B(V){return"\\"+nv[V]}function fe(V,le){return V==null?n:V[le]}function ye(V){return dn.test(V)}function Se(V){return ol.test(V)}function De(V){for(var le,ie=[];!(le=V.next()).done;)ie.push(le.value);return ie}function Ct(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re,et){ie[++le]=[et,Re]}),ie}function Tr(V,le){return function(ie){return V(le(ie))}}function Zn(V,le){for(var ie=-1,Re=V.length,et=0,yt=[];++ie<Re;){var rn=V[ie];(rn===le||rn===p)&&(V[ie]=p,yt[et++]=ie)}return yt}function ma(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re){ie[++le]=Re}),ie}function gf(V){var le=-1,ie=Array(V.size);return V.forEach(function(Re){ie[++le]=[Re,Re]}),ie}function va(V,le,ie){for(var Re=ie-1,et=V.length;++Re<et;)if(V[Re]===le)return Re;return-1}function Is(V,le,ie){for(var Re=ie+1;Re--;)if(V[Re]===le)return Re;return Re}function er(V){return ye(V)?V3(V):cv(V)}function vt(V){return ye(V)?K3(V):df(V)}function yn(V){for(var le=V.length;le--&&qu.test(V.charAt(le)););return le}var ya=pa(tf);function V3(V){for(var le=rl.lastIndex=0;rl.test(V);)++le;return le}function K3(V){return V.match(rl)||[]}function G3(V){return V.match(da)||[]}var j3=function V(le){le=le==null?nn:ks.defaults(nn.Object(),le,ks.pick(nn,bo));var ie=le.Array,Re=le.Date,et=le.Error,yt=le.Function,rn=le.Math,Rt=le.Object,uv=le.RegExp,W3=le.String,Er=le.TypeError,mf=ie.prototype,q3=yt.prototype,Ns=Rt.prototype,vf=le["__core-js_shared__"],yf=q3.toString,Et=Ns.hasOwnProperty,Y3=0,C0=function(){var i=/[^.]+$/.exec(vf&&vf.keys&&vf.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),wf=Ns.toString,J3=yf.call(Rt),Q3=nn._,X3=uv("^"+yf.call(Et).replace($c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bf=al?le.Buffer:n,Ei=le.Symbol,Cf=le.Uint8Array,x0=bf?bf.allocUnsafe:n,xf=Tr(Rt.getPrototypeOf,Rt),_0=Rt.create,S0=Ns.propertyIsEnumerable,_f=mf.splice,T0=Ei?Ei.isConcatSpreadable:n,hl=Ei?Ei.iterator:n,wa=Ei?Ei.toStringTag:n,Sf=function(){try{var i=Sa(Rt,"defineProperty");return i({},"",{}),i}catch{}}(),Z3=le.clearTimeout!==nn.clearTimeout&&le.clearTimeout,eB=Re&&Re.now!==nn.Date.now&&Re.now,tB=le.setTimeout!==nn.setTimeout&&le.setTimeout,Tf=rn.ceil,Ef=rn.floor,fv=Rt.getOwnPropertySymbols,nB=bf?bf.isBuffer:n,E0=le.isFinite,rB=mf.join,oB=Tr(Rt.keys,Rt),on=rn.max,En=rn.min,iB=Re.now,aB=le.parseInt,A0=rn.random,sB=mf.reverse,hv=Sa(le,"DataView"),pl=Sa(le,"Map"),pv=Sa(le,"Promise"),Ps=Sa(le,"Set"),gl=Sa(le,"WeakMap"),ml=Sa(Rt,"create"),Af=gl&&new gl,Os={},cB=Ta(hv),lB=Ta(pl),dB=Ta(pv),uB=Ta(Ps),fB=Ta(gl),If=Ei?Ei.prototype:n,vl=If?If.valueOf:n,I0=If?If.toString:n;function E(i){if(Kt(i)&&!rt(i)&&!(i instanceof ft)){if(i instanceof Ar)return i;if(Et.call(i,"__wrapped__"))return kA(i)}return new Ar(i)}var Ms=function(){function i(){}return function(c){if(!Bt(c))return{};if(_0)return _0(c);i.prototype=c;var f=new i;return i.prototype=n,f}}();function kf(){}function Ar(i,c){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}E.templateSettings={escape:na,evaluate:ls,interpolate:Gu,variable:"",imports:{_:E}},E.prototype=kf.prototype,E.prototype.constructor=E,Ar.prototype=Ms(kf.prototype),Ar.prototype.constructor=Ar;function ft(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=te,this.__views__=[]}function hB(){var i=new ft(this.__wrapped__);return i.__actions__=tr(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=tr(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=tr(this.__views__),i}function pB(){if(this.__filtered__){var i=new ft(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function gB(){var i=this.__wrapped__.value(),c=this.__dir__,f=rt(i),m=c<0,_=f?i.length:0,I=A5(0,_,this.__views__),D=I.start,F=I.end,j=F-D,pe=m?F:D-1,me=this.__iteratees__,we=me.length,Oe=0,He=En(j,this.__takeCount__);if(!f||!m&&_==j&&He==j)return X0(i,this.__actions__);var qe=[];e:for(;j--&&Oe<He;){pe+=c;for(var ct=-1,Ye=i[pe];++ct<we;){var ut=me[ct],ht=ut.iteratee,wr=ut.type,$n=ht(Ye);if(wr==Z)Ye=$n;else if(!$n){if(wr==K)continue e;break e}}qe[Oe++]=Ye}return qe}ft.prototype=Ms(kf.prototype),ft.prototype.constructor=ft;function ba(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function mB(){this.__data__=ml?ml(null):{},this.size=0}function vB(i){var c=this.has(i)&&delete this.__data__[i];return this.size-=c?1:0,c}function yB(i){var c=this.__data__;if(ml){var f=c[i];return f===u?n:f}return Et.call(c,i)?c[i]:n}function wB(i){var c=this.__data__;return ml?c[i]!==n:Et.call(c,i)}function bB(i,c){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=ml&&c===n?u:c,this}ba.prototype.clear=mB,ba.prototype.delete=vB,ba.prototype.get=yB,ba.prototype.has=wB,ba.prototype.set=bB;function Go(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function CB(){this.__data__=[],this.size=0}function xB(i){var c=this.__data__,f=Nf(c,i);if(f<0)return!1;var m=c.length-1;return f==m?c.pop():_f.call(c,f,1),--this.size,!0}function _B(i){var c=this.__data__,f=Nf(c,i);return f<0?n:c[f][1]}function SB(i){return Nf(this.__data__,i)>-1}function TB(i,c){var f=this.__data__,m=Nf(f,i);return m<0?(++this.size,f.push([i,c])):f[m][1]=c,this}Go.prototype.clear=CB,Go.prototype.delete=xB,Go.prototype.get=_B,Go.prototype.has=SB,Go.prototype.set=TB;function jo(i){var c=-1,f=i==null?0:i.length;for(this.clear();++c<f;){var m=i[c];this.set(m[0],m[1])}}function EB(){this.size=0,this.__data__={hash:new ba,map:new(pl||Go),string:new ba}}function AB(i){var c=zf(this,i).delete(i);return this.size-=c?1:0,c}function IB(i){return zf(this,i).get(i)}function kB(i){return zf(this,i).has(i)}function NB(i,c){var f=zf(this,i),m=f.size;return f.set(i,c),this.size+=f.size==m?0:1,this}jo.prototype.clear=EB,jo.prototype.delete=AB,jo.prototype.get=IB,jo.prototype.has=kB,jo.prototype.set=NB;function Ca(i){var c=-1,f=i==null?0:i.length;for(this.__data__=new jo;++c<f;)this.add(i[c])}function PB(i){return this.__data__.set(i,u),this}function OB(i){return this.__data__.has(i)}Ca.prototype.add=Ca.prototype.push=PB,Ca.prototype.has=OB;function eo(i){var c=this.__data__=new Go(i);this.size=c.size}function MB(){this.__data__=new Go,this.size=0}function DB(i){var c=this.__data__,f=c.delete(i);return this.size=c.size,f}function RB(i){return this.__data__.get(i)}function LB(i){return this.__data__.has(i)}function FB(i,c){var f=this.__data__;if(f instanceof Go){var m=f.__data__;if(!pl||m.length<o-1)return m.push([i,c]),this.size=++f.size,this;f=this.__data__=new jo(m)}return f.set(i,c),this.size=f.size,this}eo.prototype.clear=MB,eo.prototype.delete=DB,eo.prototype.get=RB,eo.prototype.has=LB,eo.prototype.set=FB;function k0(i,c){var f=rt(i),m=!f&&Ea(i),_=!f&&!m&&Pi(i),I=!f&&!m&&!_&&Fs(i),D=f||m||_||I,F=D?As(i.length,W3):[],j=F.length;for(var pe in i)(c||Et.call(i,pe))&&!(D&&(pe=="length"||_&&(pe=="offset"||pe=="parent")||I&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||Jo(pe,j)))&&F.push(pe);return F}function N0(i){var c=i.length;return c?i[Tv(0,c-1)]:n}function UB(i,c){return Vf(tr(i),xa(c,0,i.length))}function $B(i){return Vf(tr(i))}function gv(i,c,f){(f!==n&&!to(i[c],f)||f===n&&!(c in i))&&Wo(i,c,f)}function yl(i,c,f){var m=i[c];(!(Et.call(i,c)&&to(m,f))||f===n&&!(c in i))&&Wo(i,c,f)}function Nf(i,c){for(var f=i.length;f--;)if(to(i[f][0],c))return f;return-1}function HB(i,c,f,m){return Ai(i,function(_,I,D){c(m,_,f(_),D)}),m}function P0(i,c){return i&&xo(c,un(c),i)}function BB(i,c){return i&&xo(c,rr(c),i)}function Wo(i,c,f){c=="__proto__"&&Sf?Sf(i,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[c]=f}function mv(i,c){for(var f=-1,m=c.length,_=ie(m),I=i==null;++f<m;)_[f]=I?n:Jv(i,c[f]);return _}function xa(i,c,f){return i===i&&(f!==n&&(i=i<=f?i:f),c!==n&&(i=i>=c?i:c)),i}function Ir(i,c,f,m,_,I){var D,F=c&g,j=c&w,pe=c&y;if(f&&(D=_?f(i,m,_,I):f(i)),D!==n)return D;if(!Bt(i))return i;var me=rt(i);if(me){if(D=k5(i),!F)return tr(i,D)}else{var we=An(i),Oe=we==ae||we==Ze;if(Pi(i))return tA(i,F);if(we==Ot||we==Ne||Oe&&!_){if(D=j||Oe?{}:bA(i),!F)return j?y5(i,BB(D,i)):v5(i,P0(D,i))}else{if(!ze[we])return _?i:{};D=N5(i,we,F)}}I||(I=new eo);var He=I.get(i);if(He)return He;I.set(i,D),YA(i)?i.forEach(function(Ye){D.add(Ir(Ye,c,f,Ye,i,I))}):WA(i)&&i.forEach(function(Ye,ut){D.set(ut,Ir(Ye,c,f,ut,i,I))});var qe=pe?j?Lv:Rv:j?rr:un,ct=me?n:qe(i);return Qn(ct||i,function(Ye,ut){ct&&(ut=Ye,Ye=i[ut]),yl(D,ut,Ir(Ye,c,f,ut,i,I))}),D}function zB(i){var c=un(i);return function(f){return O0(f,i,c)}}function O0(i,c,f){var m=f.length;if(i==null)return!m;for(i=Rt(i);m--;){var _=f[m],I=c[_],D=i[_];if(D===n&&!(_ in i)||!I(D))return!1}return!0}function M0(i,c,f){if(typeof i!="function")throw new Er(s);return Tl(function(){i.apply(n,f)},c)}function wl(i,c,f,m){var _=-1,I=mr,D=!0,F=i.length,j=[],pe=c.length;if(!F)return j;f&&(c=Lt(c,Ln(f))),m?(I=Ko,D=!1):c.length>=o&&(I=Xn,D=!1,c=new Ca(c));e:for(;++_<F;){var me=i[_],we=f==null?me:f(me);if(me=m||me!==0?me:0,D&&we===we){for(var Oe=pe;Oe--;)if(c[Oe]===we)continue e;j.push(me)}else I(c,we,m)||j.push(me)}return j}var Ai=aA(Co),D0=aA(yv,!0);function VB(i,c){var f=!0;return Ai(i,function(m,_,I){return f=!!c(m,_,I),f}),f}function Pf(i,c,f){for(var m=-1,_=i.length;++m<_;){var I=i[m],D=c(I);if(D!=null&&(F===n?D===D&&!yr(D):f(D,F)))var F=D,j=I}return j}function KB(i,c,f,m){var _=i.length;for(f=at(f),f<0&&(f=-f>_?0:_+f),m=m===n||m>_?_:at(m),m<0&&(m+=_),m=f>m?0:QA(m);f<m;)i[f++]=c;return i}function R0(i,c){var f=[];return Ai(i,function(m,_,I){c(m,_,I)&&f.push(m)}),f}function wn(i,c,f,m,_){var I=-1,D=i.length;for(f||(f=O5),_||(_=[]);++I<D;){var F=i[I];c>0&&f(F)?c>1?wn(F,c-1,f,m,_):Tn(_,F):m||(_[_.length]=F)}return _}var vv=sA(),L0=sA(!0);function Co(i,c){return i&&vv(i,c,un)}function yv(i,c){return i&&L0(i,c,un)}function Of(i,c){return Xr(c,function(f){return Qo(i[f])})}function _a(i,c){c=ki(c,i);for(var f=0,m=c.length;i!=null&&f<m;)i=i[_o(c[f++])];return f&&f==m?i:n}function F0(i,c,f){var m=c(i);return rt(i)?m:Tn(m,f(i))}function Fn(i){return i==null?i===n?Q:ln:wa&&wa in Rt(i)?E5(i):$5(i)}function wv(i,c){return i>c}function GB(i,c){return i!=null&&Et.call(i,c)}function jB(i,c){return i!=null&&c in Rt(i)}function WB(i,c,f){return i>=En(c,f)&&i<on(c,f)}function bv(i,c,f){for(var m=f?Ko:mr,_=i[0].length,I=i.length,D=I,F=ie(I),j=1/0,pe=[];D--;){var me=i[D];D&&c&&(me=Lt(me,Ln(c))),j=En(me.length,j),F[D]=!f&&(c||_>=120&&me.length>=120)?new Ca(D&&me):n}me=i[0];var we=-1,Oe=F[0];e:for(;++we<_&&pe.length<j;){var He=me[we],qe=c?c(He):He;if(He=f||He!==0?He:0,!(Oe?Xn(Oe,qe):m(pe,qe,f))){for(D=I;--D;){var ct=F[D];if(!(ct?Xn(ct,qe):m(i[D],qe,f)))continue e}Oe&&Oe.push(qe),pe.push(He)}}return pe}function qB(i,c,f,m){return Co(i,function(_,I,D){c(m,f(_),I,D)}),m}function bl(i,c,f){c=ki(c,i),i=SA(i,c);var m=i==null?i:i[_o(Nr(c))];return m==null?n:Sn(m,i,f)}function U0(i){return Kt(i)&&Fn(i)==Ne}function YB(i){return Kt(i)&&Fn(i)==$e}function JB(i){return Kt(i)&&Fn(i)==Ae}function Cl(i,c,f,m,_){return i===c?!0:i==null||c==null||!Kt(i)&&!Kt(c)?i!==i&&c!==c:QB(i,c,f,m,Cl,_)}function QB(i,c,f,m,_,I){var D=rt(i),F=rt(c),j=D?Te:An(i),pe=F?Te:An(c);j=j==Ne?Ot:j,pe=pe==Ne?Ot:pe;var me=j==Ot,we=pe==Ot,Oe=j==pe;if(Oe&&Pi(i)){if(!Pi(c))return!1;D=!0,me=!1}if(Oe&&!me)return I||(I=new eo),D||Fs(i)?vA(i,c,f,m,_,I):S5(i,c,j,f,m,_,I);if(!(f&C)){var He=me&&Et.call(i,"__wrapped__"),qe=we&&Et.call(c,"__wrapped__");if(He||qe){var ct=He?i.value():i,Ye=qe?c.value():c;return I||(I=new eo),_(ct,Ye,f,m,I)}}return Oe?(I||(I=new eo),T5(i,c,f,m,_,I)):!1}function XB(i){return Kt(i)&&An(i)==nt}function Cv(i,c,f,m){var _=f.length,I=_,D=!m;if(i==null)return!I;for(i=Rt(i);_--;){var F=f[_];if(D&&F[2]?F[1]!==i[F[0]]:!(F[0]in i))return!1}for(;++_<I;){F=f[_];var j=F[0],pe=i[j],me=F[1];if(D&&F[2]){if(pe===n&&!(j in i))return!1}else{var we=new eo;if(m)var Oe=m(pe,me,j,i,c,we);if(!(Oe===n?Cl(me,pe,C|v,m,we):Oe))return!1}}return!0}function $0(i){if(!Bt(i)||D5(i))return!1;var c=Qo(i)?X3:hs;return c.test(Ta(i))}function ZB(i){return Kt(i)&&Fn(i)==R}function e5(i){return Kt(i)&&An(i)==Y}function t5(i){return Kt(i)&&Yf(i.length)&&!!mt[Fn(i)]}function H0(i){return typeof i=="function"?i:i==null?or:typeof i=="object"?rt(i)?V0(i[0],i[1]):z0(i):cI(i)}function xv(i){if(!Sl(i))return oB(i);var c=[];for(var f in Rt(i))Et.call(i,f)&&f!="constructor"&&c.push(f);return c}function n5(i){if(!Bt(i))return U5(i);var c=Sl(i),f=[];for(var m in i)m=="constructor"&&(c||!Et.call(i,m))||f.push(m);return f}function _v(i,c){return i<c}function B0(i,c){var f=-1,m=nr(i)?ie(i.length):[];return Ai(i,function(_,I,D){m[++f]=c(_,I,D)}),m}function z0(i){var c=Uv(i);return c.length==1&&c[0][2]?xA(c[0][0],c[0][1]):function(f){return f===i||Cv(f,i,c)}}function V0(i,c){return Hv(i)&&CA(c)?xA(_o(i),c):function(f){var m=Jv(f,i);return m===n&&m===c?Qv(f,i):Cl(c,m,C|v)}}function Mf(i,c,f,m,_){i!==c&&vv(c,function(I,D){if(_||(_=new eo),Bt(I))r5(i,c,D,f,Mf,m,_);else{var F=m?m(zv(i,D),I,D+"",i,c,_):n;F===n&&(F=I),gv(i,D,F)}},rr)}function r5(i,c,f,m,_,I,D){var F=zv(i,f),j=zv(c,f),pe=D.get(j);if(pe){gv(i,f,pe);return}var me=I?I(F,j,f+"",i,c,D):n,we=me===n;if(we){var Oe=rt(j),He=!Oe&&Pi(j),qe=!Oe&&!He&&Fs(j);me=j,Oe||He||qe?rt(F)?me=F:Wt(F)?me=tr(F):He?(we=!1,me=tA(j,!0)):qe?(we=!1,me=nA(j,!0)):me=[]:El(j)||Ea(j)?(me=F,Ea(F)?me=XA(F):(!Bt(F)||Qo(F))&&(me=bA(j))):we=!1}we&&(D.set(j,me),_(me,j,m,I,D),D.delete(j)),gv(i,f,me)}function K0(i,c){var f=i.length;if(f)return c+=c<0?f:0,Jo(c,f)?i[c]:n}function G0(i,c,f){c.length?c=Lt(c,function(I){return rt(I)?function(D){return _a(D,I.length===1?I[0]:I)}:I}):c=[or];var m=-1;c=Lt(c,Ln(je()));var _=B0(i,function(I,D,F){var j=Lt(c,function(pe){return pe(I)});return{criteria:j,index:++m,value:I}});return lv(_,function(I,D){return m5(I,D,f)})}function o5(i,c){return j0(i,c,function(f,m){return Qv(i,m)})}function j0(i,c,f){for(var m=-1,_=c.length,I={};++m<_;){var D=c[m],F=_a(i,D);f(F,D)&&xl(I,ki(D,i),F)}return I}function i5(i){return function(c){return _a(c,i)}}function Sv(i,c,f,m){var _=m?cl:Ti,I=-1,D=c.length,F=i;for(i===c&&(c=tr(c)),f&&(F=Lt(i,Ln(f)));++I<D;)for(var j=0,pe=c[I],me=f?f(pe):pe;(j=_(F,me,j,m))>-1;)F!==i&&_f.call(F,j,1),_f.call(i,j,1);return i}function W0(i,c){for(var f=i?c.length:0,m=f-1;f--;){var _=c[f];if(f==m||_!==I){var I=_;Jo(_)?_f.call(i,_,1):Iv(i,_)}}return i}function Tv(i,c){return i+Ef(A0()*(c-i+1))}function a5(i,c,f,m){for(var _=-1,I=on(Tf((c-i)/(f||1)),0),D=ie(I);I--;)D[m?I:++_]=i,i+=f;return D}function Ev(i,c){var f="";if(!i||c<1||c>J)return f;do c%2&&(f+=i),c=Ef(c/2),c&&(i+=i);while(c);return f}function dt(i,c){return Vv(_A(i,c,or),i+"")}function s5(i){return N0(Us(i))}function c5(i,c){var f=Us(i);return Vf(f,xa(c,0,f.length))}function xl(i,c,f,m){if(!Bt(i))return i;c=ki(c,i);for(var _=-1,I=c.length,D=I-1,F=i;F!=null&&++_<I;){var j=_o(c[_]),pe=f;if(j==="__proto__"||j==="constructor"||j==="prototype")return i;if(_!=D){var me=F[j];pe=m?m(me,j,F):n,pe===n&&(pe=Bt(me)?me:Jo(c[_+1])?[]:{})}yl(F,j,pe),F=F[j]}return i}var q0=Af?function(i,c){return Af.set(i,c),i}:or,l5=Sf?function(i,c){return Sf(i,"toString",{configurable:!0,enumerable:!1,value:Zv(c),writable:!0})}:or;function d5(i){return Vf(Us(i))}function kr(i,c,f){var m=-1,_=i.length;c<0&&(c=-c>_?0:_+c),f=f>_?_:f,f<0&&(f+=_),_=c>f?0:f-c>>>0,c>>>=0;for(var I=ie(_);++m<_;)I[m]=i[m+c];return I}function u5(i,c){var f;return Ai(i,function(m,_,I){return f=c(m,_,I),!f}),!!f}function Df(i,c,f){var m=0,_=i==null?m:i.length;if(typeof c=="number"&&c===c&&_<=Ee){for(;m<_;){var I=m+_>>>1,D=i[I];D!==null&&!yr(D)&&(f?D<=c:D<c)?m=I+1:_=I}return _}return Av(i,c,or,f)}function Av(i,c,f,m){var _=0,I=i==null?0:i.length;if(I===0)return 0;c=f(c);for(var D=c!==c,F=c===null,j=yr(c),pe=c===n;_<I;){var me=Ef((_+I)/2),we=f(i[me]),Oe=we!==n,He=we===null,qe=we===we,ct=yr(we);if(D)var Ye=m||qe;else pe?Ye=qe&&(m||Oe):F?Ye=qe&&Oe&&(m||!He):j?Ye=qe&&Oe&&!He&&(m||!ct):He||ct?Ye=!1:Ye=m?we<=c:we<c;Ye?_=me+1:I=me}return En(I,be)}function Y0(i,c){for(var f=-1,m=i.length,_=0,I=[];++f<m;){var D=i[f],F=c?c(D):D;if(!f||!to(F,j)){var j=F;I[_++]=D===0?0:D}}return I}function J0(i){return typeof i=="number"?i:yr(i)?U:+i}function vr(i){if(typeof i=="string")return i;if(rt(i))return Lt(i,vr)+"";if(yr(i))return I0?I0.call(i):"";var c=i+"";return c=="0"&&1/i==-re?"-0":c}function Ii(i,c,f){var m=-1,_=mr,I=i.length,D=!0,F=[],j=F;if(f)D=!1,_=Ko;else if(I>=o){var pe=c?null:x5(i);if(pe)return ma(pe);D=!1,_=Xn,j=new Ca}else j=c?[]:F;e:for(;++m<I;){var me=i[m],we=c?c(me):me;if(me=f||me!==0?me:0,D&&we===we){for(var Oe=j.length;Oe--;)if(j[Oe]===we)continue e;c&&j.push(we),F.push(me)}else _(j,we,f)||(j!==F&&j.push(we),F.push(me))}return F}function Iv(i,c){return c=ki(c,i),i=SA(i,c),i==null||delete i[_o(Nr(c))]}function Q0(i,c,f,m){return xl(i,c,f(_a(i,c)),m)}function Rf(i,c,f,m){for(var _=i.length,I=m?_:-1;(m?I--:++I<_)&&c(i[I],I,i););return f?kr(i,m?0:I,m?I+1:_):kr(i,m?I+1:0,m?_:I)}function X0(i,c){var f=i;return f instanceof ft&&(f=f.value()),sl(c,function(m,_){return _.func.apply(_.thisArg,Tn([m],_.args))},f)}function kv(i,c,f){var m=i.length;if(m<2)return m?Ii(i[0]):[];for(var _=-1,I=ie(m);++_<m;)for(var D=i[_],F=-1;++F<m;)F!=_&&(I[_]=wl(I[_]||D,i[F],c,f));return Ii(wn(I,1),c,f)}function Z0(i,c,f){for(var m=-1,_=i.length,I=c.length,D={};++m<_;){var F=m<I?c[m]:n;f(D,i[m],F)}return D}function Nv(i){return Wt(i)?i:[]}function Pv(i){return typeof i=="function"?i:or}function ki(i,c){return rt(i)?i:Hv(i,c)?[i]:IA(xt(i))}var f5=dt;function Ni(i,c,f){var m=i.length;return f=f===n?m:f,!c&&f>=m?i:kr(i,c,f)}var eA=Z3||function(i){return nn.clearTimeout(i)};function tA(i,c){if(c)return i.slice();var f=i.length,m=x0?x0(f):new i.constructor(f);return i.copy(m),m}function Ov(i){var c=new i.constructor(i.byteLength);return new Cf(c).set(new Cf(i)),c}function h5(i,c){var f=c?Ov(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function p5(i){var c=new i.constructor(i.source,Bc.exec(i));return c.lastIndex=i.lastIndex,c}function g5(i){return vl?Rt(vl.call(i)):{}}function nA(i,c){var f=c?Ov(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function rA(i,c){if(i!==c){var f=i!==n,m=i===null,_=i===i,I=yr(i),D=c!==n,F=c===null,j=c===c,pe=yr(c);if(!F&&!pe&&!I&&i>c||I&&D&&j&&!F&&!pe||m&&D&&j||!f&&j||!_)return 1;if(!m&&!I&&!pe&&i<c||pe&&f&&_&&!m&&!I||F&&f&&_||!D&&_||!j)return-1}return 0}function m5(i,c,f){for(var m=-1,_=i.criteria,I=c.criteria,D=_.length,F=f.length;++m<D;){var j=rA(_[m],I[m]);if(j){if(m>=F)return j;var pe=f[m];return j*(pe=="desc"?-1:1)}}return i.index-c.index}function oA(i,c,f,m){for(var _=-1,I=i.length,D=f.length,F=-1,j=c.length,pe=on(I-D,0),me=ie(j+pe),we=!m;++F<j;)me[F]=c[F];for(;++_<D;)(we||_<I)&&(me[f[_]]=i[_]);for(;pe--;)me[F++]=i[_++];return me}function iA(i,c,f,m){for(var _=-1,I=i.length,D=-1,F=f.length,j=-1,pe=c.length,me=on(I-F,0),we=ie(me+pe),Oe=!m;++_<me;)we[_]=i[_];for(var He=_;++j<pe;)we[He+j]=c[j];for(;++D<F;)(Oe||_<I)&&(we[He+f[D]]=i[_++]);return we}function tr(i,c){var f=-1,m=i.length;for(c||(c=ie(m));++f<m;)c[f]=i[f];return c}function xo(i,c,f,m){var _=!f;f||(f={});for(var I=-1,D=c.length;++I<D;){var F=c[I],j=m?m(f[F],i[F],F,f,i):n;j===n&&(j=i[F]),_?Wo(f,F,j):yl(f,F,j)}return f}function v5(i,c){return xo(i,$v(i),c)}function y5(i,c){return xo(i,yA(i),c)}function Lf(i,c){return function(f,m){var _=rt(f)?iv:HB,I=c?c():{};return _(f,i,je(m,2),I)}}function Ds(i){return dt(function(c,f){var m=-1,_=f.length,I=_>1?f[_-1]:n,D=_>2?f[2]:n;for(I=i.length>3&&typeof I=="function"?(_--,I):n,D&&Un(f[0],f[1],D)&&(I=_<3?n:I,_=1),c=Rt(c);++m<_;){var F=f[m];F&&i(c,F,m,I)}return c})}function aA(i,c){return function(f,m){if(f==null)return f;if(!nr(f))return i(f,m);for(var _=f.length,I=c?_:-1,D=Rt(f);(c?I--:++I<_)&&m(D[I],I,D)!==!1;);return f}}function sA(i){return function(c,f,m){for(var _=-1,I=Rt(c),D=m(c),F=D.length;F--;){var j=D[i?F:++_];if(f(I[j],j,I)===!1)break}return c}}function w5(i,c,f){var m=c&b,_=_l(i);function I(){var D=this&&this!==nn&&this instanceof I?_:i;return D.apply(m?f:this,arguments)}return I}function cA(i){return function(c){c=xt(c);var f=ye(c)?vt(c):n,m=f?f[0]:c.charAt(0),_=f?Ni(f,1).join(""):c.slice(1);return m[i]()+_}}function Rs(i){return function(c){return sl(aI(iI(c).replace(gr,"")),i,"")}}function _l(i){return function(){var c=arguments;switch(c.length){case 0:return new i;case 1:return new i(c[0]);case 2:return new i(c[0],c[1]);case 3:return new i(c[0],c[1],c[2]);case 4:return new i(c[0],c[1],c[2],c[3]);case 5:return new i(c[0],c[1],c[2],c[3],c[4]);case 6:return new i(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new i(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=Ms(i.prototype),m=i.apply(f,c);return Bt(m)?m:f}}function b5(i,c,f){var m=_l(i);function _(){for(var I=arguments.length,D=ie(I),F=I,j=Ls(_);F--;)D[F]=arguments[F];var pe=I<3&&D[0]!==j&&D[I-1]!==j?[]:Zn(D,j);if(I-=pe.length,I<f)return hA(i,c,Ff,_.placeholder,n,D,pe,n,n,f-I);var me=this&&this!==nn&&this instanceof _?m:i;return Sn(me,this,D)}return _}function lA(i){return function(c,f,m){var _=Rt(c);if(!nr(c)){var I=je(f,3);c=un(c),f=function(F){return I(_[F],F,_)}}var D=i(c,f,m);return D>-1?_[I?c[D]:D]:n}}function dA(i){return Yo(function(c){var f=c.length,m=f,_=Ar.prototype.thru;for(i&&c.reverse();m--;){var I=c[m];if(typeof I!="function")throw new Er(s);if(_&&!D&&Bf(I)=="wrapper")var D=new Ar([],!0)}for(m=D?m:f;++m<f;){I=c[m];var F=Bf(I),j=F=="wrapper"?Fv(I):n;j&&Bv(j[0])&&j[1]==(H|N|T|W)&&!j[4].length&&j[9]==1?D=D[Bf(j[0])].apply(D,j[3]):D=I.length==1&&Bv(I)?D[F]():D.thru(I)}return function(){var pe=arguments,me=pe[0];if(D&&pe.length==1&&rt(me))return D.plant(me).value();for(var we=0,Oe=f?c[we].apply(this,pe):me;++we<f;)Oe=c[we].call(this,Oe);return Oe}})}function Ff(i,c,f,m,_,I,D,F,j,pe){var me=c&H,we=c&b,Oe=c&k,He=c&(N|O),qe=c&ee,ct=Oe?n:_l(i);function Ye(){for(var ut=arguments.length,ht=ie(ut),wr=ut;wr--;)ht[wr]=arguments[wr];if(He)var $n=Ls(Ye),br=pf(ht,$n);if(m&&(ht=oA(ht,m,_,He)),I&&(ht=iA(ht,I,D,He)),ut-=br,He&&ut<pe){var qt=Zn(ht,$n);return hA(i,c,Ff,Ye.placeholder,f,ht,qt,F,j,pe-ut)}var no=we?f:this,Zo=Oe?no[i]:i;return ut=ht.length,F?ht=H5(ht,F):qe&&ut>1&&ht.reverse(),me&&j<ut&&(ht.length=j),this&&this!==nn&&this instanceof Ye&&(Zo=ct||_l(Zo)),Zo.apply(no,ht)}return Ye}function uA(i,c){return function(f,m){return qB(f,i,c(m),{})}}function Uf(i,c){return function(f,m){var _;if(f===n&&m===n)return c;if(f!==n&&(_=f),m!==n){if(_===n)return m;typeof f=="string"||typeof m=="string"?(f=vr(f),m=vr(m)):(f=J0(f),m=J0(m)),_=i(f,m)}return _}}function Mv(i){return Yo(function(c){return c=Lt(c,Ln(je())),dt(function(f){var m=this;return i(c,function(_){return Sn(_,m,f)})})})}function $f(i,c){c=c===n?" ":vr(c);var f=c.length;if(f<2)return f?Ev(c,i):c;var m=Ev(c,Tf(i/er(c)));return ye(c)?Ni(vt(m),0,i).join(""):m.slice(0,i)}function C5(i,c,f,m){var _=c&b,I=_l(i);function D(){for(var F=-1,j=arguments.length,pe=-1,me=m.length,we=ie(me+j),Oe=this&&this!==nn&&this instanceof D?I:i;++pe<me;)we[pe]=m[pe];for(;j--;)we[pe++]=arguments[++F];return Sn(Oe,_?f:this,we)}return D}function fA(i){return function(c,f,m){return m&&typeof m!="number"&&Un(c,f,m)&&(f=m=n),c=Xo(c),f===n?(f=c,c=0):f=Xo(f),m=m===n?c<f?1:-1:Xo(m),a5(c,f,m,i)}}function Hf(i){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=Pr(c),f=Pr(f)),i(c,f)}}function hA(i,c,f,m,_,I,D,F,j,pe){var me=c&N,we=me?D:n,Oe=me?n:D,He=me?I:n,qe=me?n:I;c|=me?T:L,c&=~(me?L:T),c&A||(c&=-4);var ct=[i,c,_,He,we,qe,Oe,F,j,pe],Ye=f.apply(n,ct);return Bv(i)&&TA(Ye,ct),Ye.placeholder=m,EA(Ye,i,c)}function Dv(i){var c=rn[i];return function(f,m){if(f=Pr(f),m=m==null?0:En(at(m),292),m&&E0(f)){var _=(xt(f)+"e").split("e"),I=c(_[0]+"e"+(+_[1]+m));return _=(xt(I)+"e").split("e"),+(_[0]+"e"+(+_[1]-m))}return c(f)}}var x5=Ps&&1/ma(new Ps([,-0]))[1]==re?function(i){return new Ps(i)}:ny;function pA(i){return function(c){var f=An(c);return f==nt?Ct(c):f==Y?gf(c):dv(c,i(c))}}function qo(i,c,f,m,_,I,D,F){var j=c&k;if(!j&&typeof i!="function")throw new Er(s);var pe=m?m.length:0;if(pe||(c&=-97,m=_=n),D=D===n?D:on(at(D),0),F=F===n?F:at(F),pe-=_?_.length:0,c&L){var me=m,we=_;m=_=n}var Oe=j?n:Fv(i),He=[i,c,f,m,_,me,we,I,D,F];if(Oe&&F5(He,Oe),i=He[0],c=He[1],f=He[2],m=He[3],_=He[4],F=He[9]=He[9]===n?j?0:i.length:on(He[9]-pe,0),!F&&c&(N|O)&&(c&=-25),!c||c==b)var qe=w5(i,c,f);else c==N||c==O?qe=b5(i,c,F):(c==T||c==(b|T))&&!_.length?qe=C5(i,c,f,m):qe=Ff.apply(n,He);var ct=Oe?q0:TA;return EA(ct(qe,He),i,c)}function gA(i,c,f,m){return i===n||to(i,Ns[f])&&!Et.call(m,f)?c:i}function mA(i,c,f,m,_,I){return Bt(i)&&Bt(c)&&(I.set(c,i),Mf(i,c,n,mA,I),I.delete(c)),i}function _5(i){return El(i)?n:i}function vA(i,c,f,m,_,I){var D=f&C,F=i.length,j=c.length;if(F!=j&&!(D&&j>F))return!1;var pe=I.get(i),me=I.get(c);if(pe&&me)return pe==c&&me==i;var we=-1,Oe=!0,He=f&v?new Ca:n;for(I.set(i,c),I.set(c,i);++we<F;){var qe=i[we],ct=c[we];if(m)var Ye=D?m(ct,qe,we,c,i,I):m(qe,ct,we,i,c,I);if(Ye!==n){if(Ye)continue;Oe=!1;break}if(He){if(!ha(c,function(ut,ht){if(!Xn(He,ht)&&(qe===ut||_(qe,ut,f,m,I)))return He.push(ht)})){Oe=!1;break}}else if(!(qe===ct||_(qe,ct,f,m,I))){Oe=!1;break}}return I.delete(i),I.delete(c),Oe}function S5(i,c,f,m,_,I,D){switch(f){case Be:if(i.byteLength!=c.byteLength||i.byteOffset!=c.byteOffset)return!1;i=i.buffer,c=c.buffer;case $e:return!(i.byteLength!=c.byteLength||!I(new Cf(i),new Cf(c)));case ue:case Ae:case Tt:return to(+i,+c);case Pe:return i.name==c.name&&i.message==c.message;case R:case se:return i==c+"";case nt:var F=Ct;case Y:var j=m&C;if(F||(F=ma),i.size!=c.size&&!j)return!1;var pe=D.get(i);if(pe)return pe==c;m|=v,D.set(i,c);var me=vA(F(i),F(c),m,_,I,D);return D.delete(i),me;case Ie:if(vl)return vl.call(i)==vl.call(c)}return!1}function T5(i,c,f,m,_,I){var D=f&C,F=Rv(i),j=F.length,pe=Rv(c),me=pe.length;if(j!=me&&!D)return!1;for(var we=j;we--;){var Oe=F[we];if(!(D?Oe in c:Et.call(c,Oe)))return!1}var He=I.get(i),qe=I.get(c);if(He&&qe)return He==c&&qe==i;var ct=!0;I.set(i,c),I.set(c,i);for(var Ye=D;++we<j;){Oe=F[we];var ut=i[Oe],ht=c[Oe];if(m)var wr=D?m(ht,ut,Oe,c,i,I):m(ut,ht,Oe,i,c,I);if(!(wr===n?ut===ht||_(ut,ht,f,m,I):wr)){ct=!1;break}Ye||(Ye=Oe=="constructor")}if(ct&&!Ye){var $n=i.constructor,br=c.constructor;$n!=br&&"constructor"in i&&"constructor"in c&&!(typeof $n=="function"&&$n instanceof $n&&typeof br=="function"&&br instanceof br)&&(ct=!1)}return I.delete(i),I.delete(c),ct}function Yo(i){return Vv(_A(i,n,OA),i+"")}function Rv(i){return F0(i,un,$v)}function Lv(i){return F0(i,rr,yA)}var Fv=Af?function(i){return Af.get(i)}:ny;function Bf(i){for(var c=i.name+"",f=Os[c],m=Et.call(Os,c)?f.length:0;m--;){var _=f[m],I=_.func;if(I==null||I==i)return _.name}return c}function Ls(i){var c=Et.call(E,"placeholder")?E:i;return c.placeholder}function je(){var i=E.iteratee||ey;return i=i===ey?H0:i,arguments.length?i(arguments[0],arguments[1]):i}function zf(i,c){var f=i.__data__;return M5(c)?f[typeof c=="string"?"string":"hash"]:f.map}function Uv(i){for(var c=un(i),f=c.length;f--;){var m=c[f],_=i[m];c[f]=[m,_,CA(_)]}return c}function Sa(i,c){var f=fe(i,c);return $0(f)?f:n}function E5(i){var c=Et.call(i,wa),f=i[wa];try{i[wa]=n;var m=!0}catch{}var _=wf.call(i);return m&&(c?i[wa]=f:delete i[wa]),_}var $v=fv?function(i){return i==null?[]:(i=Rt(i),Xr(fv(i),function(c){return S0.call(i,c)}))}:ry,yA=fv?function(i){for(var c=[];i;)Tn(c,$v(i)),i=xf(i);return c}:ry,An=Fn;(hv&&An(new hv(new ArrayBuffer(1)))!=Be||pl&&An(new pl)!=nt||pv&&An(pv.resolve())!=mn||Ps&&An(new Ps)!=Y||gl&&An(new gl)!=ne)&&(An=function(i){var c=Fn(i),f=c==Ot?i.constructor:n,m=f?Ta(f):"";if(m)switch(m){case cB:return Be;case lB:return nt;case dB:return mn;case uB:return Y;case fB:return ne}return c});function A5(i,c,f){for(var m=-1,_=f.length;++m<_;){var I=f[m],D=I.size;switch(I.type){case"drop":i+=D;break;case"dropRight":c-=D;break;case"take":c=En(c,i+D);break;case"takeRight":i=on(i,c-D);break}}return{start:i,end:c}}function I5(i){var c=i.match(Yu);return c?c[1].split(oa):[]}function wA(i,c,f){c=ki(c,i);for(var m=-1,_=c.length,I=!1;++m<_;){var D=_o(c[m]);if(!(I=i!=null&&f(i,D)))break;i=i[D]}return I||++m!=_?I:(_=i==null?0:i.length,!!_&&Yf(_)&&Jo(D,_)&&(rt(i)||Ea(i)))}function k5(i){var c=i.length,f=new i.constructor(c);return c&&typeof i[0]=="string"&&Et.call(i,"index")&&(f.index=i.index,f.input=i.input),f}function bA(i){return typeof i.constructor=="function"&&!Sl(i)?Ms(xf(i)):{}}function N5(i,c,f){var m=i.constructor;switch(c){case $e:return Ov(i);case ue:case Ae:return new m(+i);case Be:return h5(i,f);case Mt:case tn:case zt:case yo:case jt:case vn:case Jr:case Vt:case pr:return nA(i,f);case nt:return new m;case Tt:case se:return new m(i);case R:return p5(i);case Y:return new m;case Ie:return g5(i)}}function P5(i,c){var f=c.length;if(!f)return i;var m=f-1;return c[m]=(f>1?"& ":"")+c[m],c=c.join(f>2?", ":" "),i.replace(us,`{
80
80
  /* [wrapped with `+c+`] */
81
- `)}function O5(i){return rt(i)||Ea(i)||!!(T0&&i&&i[T0])}function Jo(i,c){var f=typeof i;return c=c??J,!!c&&(f=="number"||f!="symbol"&&Dt.test(i))&&i>-1&&i%1==0&&i<c}function $n(i,c,f){if(!Bt(f))return!1;var m=typeof c;return(m=="number"?nr(f)&&Jo(c,f.length):m=="string"&&c in f)?to(f[c],i):!1}function Hv(i,c){if(rt(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||yr(i)?!0:ds.test(i)||!ra.test(i)||c!=null&&i in Rt(c)}function M5(i){var c=typeof i;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?i!=="__proto__":i===null}function Bv(i){var c=Bf(i),f=E[c];if(typeof f!="function"||!(c in ft.prototype))return!1;if(i===f)return!0;var m=Fv(f);return!!m&&i===m[0]}function D5(i){return!!C0&&C0 in i}var R5=vf?Qo:oy;function Sl(i){var c=i&&i.constructor,f=typeof c=="function"&&c.prototype||Ns;return i===f}function CA(i){return i===i&&!Bt(i)}function xA(i,c){return function(f){return f==null?!1:f[i]===c&&(c!==n||i in Rt(f))}}function L5(i){var c=Wf(i,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function F5(i,c){var f=i[1],m=c[1],_=f|m,I=_<(b|k|H),D=m==H&&f==N||m==H&&f==W&&i[7].length<=c[8]||m==(H|W)&&c[7].length<=c[8]&&f==N;if(!(I||D))return i;m&b&&(i[2]=c[2],_|=f&b?0:A);var F=c[3];if(F){var j=i[3];i[3]=j?oA(j,F,c[4]):F,i[4]=j?Zn(i[3],p):c[4]}return F=c[5],F&&(j=i[5],i[5]=j?iA(j,F,c[6]):F,i[6]=j?Zn(i[5],p):c[6]),F=c[7],F&&(i[7]=F),m&H&&(i[8]=i[8]==null?c[8]:En(i[8],c[8])),i[9]==null&&(i[9]=c[9]),i[0]=c[0],i[1]=_,i}function U5(i){var c=[];if(i!=null)for(var f in Rt(i))c.push(f);return c}function $5(i){return wf.call(i)}function _A(i,c,f){return c=on(c===n?i.length-1:c,0),function(){for(var m=arguments,_=-1,I=on(m.length-c,0),D=ie(I);++_<I;)D[_]=m[c+_];_=-1;for(var F=ie(c+1);++_<c;)F[_]=m[_];return F[c]=f(D),Sn(i,this,F)}}function SA(i,c){return c.length<2?i:_a(i,kr(c,0,-1))}function H5(i,c){for(var f=i.length,m=En(c.length,f),_=tr(i);m--;){var I=c[m];i[m]=Jo(I,f)?_[I]:n}return i}function zv(i,c){if(!(c==="constructor"&&typeof i[c]=="function")&&c!="__proto__")return i[c]}var TA=AA(q0),Tl=tB||function(i,c){return nn.setTimeout(i,c)},Vv=AA(l5);function EA(i,c,f){var m=c+"";return Vv(i,P5(m,B5(I5(m),f)))}function AA(i){var c=0,f=0;return function(){var m=iB(),_=ve-(m-f);if(f=m,_>0){if(++c>=ce)return arguments[0]}else c=0;return i.apply(n,arguments)}}function Vf(i,c){var f=-1,m=i.length,_=m-1;for(c=c===n?m:c;++f<c;){var I=Tv(f,_),D=i[I];i[I]=i[f],i[f]=D}return i.length=c,i}var IA=L5(function(i){var c=[];return i.charCodeAt(0)===46&&c.push(""),i.replace(ju,function(f,m,_,I){c.push(_?I.replace(Wm,"$1"):m||f)}),c});function _o(i){if(typeof i=="string"||yr(i))return i;var c=i+"";return c=="0"&&1/i==-re?"-0":c}function Ta(i){if(i!=null){try{return yf.call(i)}catch{}try{return i+""}catch{}}return""}function B5(i,c){return Qn(Ce,function(f){var m="_."+f[0];c&f[1]&&!mr(i,m)&&i.push(m)}),i.sort()}function kA(i){if(i instanceof ft)return i.clone();var c=new Ar(i.__wrapped__,i.__chain__);return c.__actions__=tr(i.__actions__),c.__index__=i.__index__,c.__values__=i.__values__,c}function z5(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=on(at(c),0);var m=i==null?0:i.length;if(!m||c<1)return[];for(var _=0,I=0,D=ie(Tf(m/c));_<m;)D[I++]=kr(i,_,_+=c);return D}function V5(i){for(var c=-1,f=i==null?0:i.length,m=0,_=[];++c<f;){var I=i[c];I&&(_[m++]=I)}return _}function K5(){var i=arguments.length;if(!i)return[];for(var c=ie(i-1),f=arguments[0],m=i;m--;)c[m-1]=arguments[m];return Tn(rt(f)?tr(f):[f],wn(c,1))}var G5=dt(function(i,c){return jt(i)?wl(i,wn(c,1,jt,!0)):[]}),j5=dt(function(i,c){var f=Nr(c);return jt(f)&&(f=n),jt(i)?wl(i,wn(c,1,jt,!0),je(f,2)):[]}),W5=dt(function(i,c){var f=Nr(c);return jt(f)&&(f=n),jt(i)?wl(i,wn(c,1,jt,!0),n,f):[]});function q5(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),kr(i,c<0?0:c,m)):[]}function Y5(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),c=m-c,kr(i,0,c<0?0:c)):[]}function J5(i,c){return i&&i.length?Rf(i,je(c,3),!0,!0):[]}function Q5(i,c){return i&&i.length?Rf(i,je(c,3),!0):[]}function X5(i,c,f,m){var _=i==null?0:i.length;return _?(f&&typeof f!="number"&&$n(i,c,f)&&(f=0,m=_),KB(i,c,f,m)):[]}function NA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=f==null?0:at(f);return _<0&&(_=on(m+_,0)),Ts(i,je(c,3),_)}function PA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=m-1;return f!==n&&(_=at(f),_=f<0?on(m+_,0):En(_,m-1)),Ts(i,je(c,3),_,!0)}function OA(i){var c=i==null?0:i.length;return c?wn(i,1):[]}function Z5(i){var c=i==null?0:i.length;return c?wn(i,re):[]}function ez(i,c){var f=i==null?0:i.length;return f?(c=c===n?1:at(c),wn(i,c)):[]}function tz(i){for(var c=-1,f=i==null?0:i.length,m={};++c<f;){var _=i[c];m[_[0]]=_[1]}return m}function MA(i){return i&&i.length?i[0]:n}function nz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=f==null?0:at(f);return _<0&&(_=on(m+_,0)),Ti(i,c,_)}function rz(i){var c=i==null?0:i.length;return c?kr(i,0,-1):[]}var oz=dt(function(i){var c=Lt(i,Nv);return c.length&&c[0]===i[0]?bv(c):[]}),iz=dt(function(i){var c=Nr(i),f=Lt(i,Nv);return c===Nr(f)?c=n:f.pop(),f.length&&f[0]===i[0]?bv(f,je(c,2)):[]}),az=dt(function(i){var c=Nr(i),f=Lt(i,Nv);return c=typeof c=="function"?c:n,c&&f.pop(),f.length&&f[0]===i[0]?bv(f,n,c):[]});function sz(i,c){return i==null?"":rB.call(i,c)}function Nr(i){var c=i==null?0:i.length;return c?i[c-1]:n}function cz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=m;return f!==n&&(_=at(f),_=_<0?on(m+_,0):En(_,m-1)),c===c?Is(i,c,_):Ts(i,ll,_,!0)}function lz(i,c){return i&&i.length?K0(i,at(c)):n}var dz=dt(DA);function DA(i,c){return i&&i.length&&c&&c.length?Sv(i,c):i}function uz(i,c,f){return i&&i.length&&c&&c.length?Sv(i,c,je(f,2)):i}function fz(i,c,f){return i&&i.length&&c&&c.length?Sv(i,c,n,f):i}var hz=Yo(function(i,c){var f=i==null?0:i.length,m=mv(i,c);return W0(i,Lt(c,function(_){return Jo(_,f)?+_:_}).sort(rA)),m});function pz(i,c){var f=[];if(!(i&&i.length))return f;var m=-1,_=[],I=i.length;for(c=je(c,3);++m<I;){var D=i[m];c(D,m,i)&&(f.push(D),_.push(m))}return W0(i,_),f}function Kv(i){return i==null?i:sB.call(i)}function gz(i,c,f){var m=i==null?0:i.length;return m?(f&&typeof f!="number"&&$n(i,c,f)?(c=0,f=m):(c=c==null?0:at(c),f=f===n?m:at(f)),kr(i,c,f)):[]}function mz(i,c){return Df(i,c)}function vz(i,c,f){return Av(i,c,je(f,2))}function yz(i,c){var f=i==null?0:i.length;if(f){var m=Df(i,c);if(m<f&&to(i[m],c))return m}return-1}function wz(i,c){return Df(i,c,!0)}function bz(i,c,f){return Av(i,c,je(f,2),!0)}function Cz(i,c){var f=i==null?0:i.length;if(f){var m=Df(i,c,!0)-1;if(to(i[m],c))return m}return-1}function xz(i){return i&&i.length?Y0(i):[]}function _z(i,c){return i&&i.length?Y0(i,je(c,2)):[]}function Sz(i){var c=i==null?0:i.length;return c?kr(i,1,c):[]}function Tz(i,c,f){return i&&i.length?(c=f||c===n?1:at(c),kr(i,0,c<0?0:c)):[]}function Ez(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),c=m-c,kr(i,c<0?0:c,m)):[]}function Az(i,c){return i&&i.length?Rf(i,je(c,3),!1,!0):[]}function Iz(i,c){return i&&i.length?Rf(i,je(c,3)):[]}var kz=dt(function(i){return Ii(wn(i,1,jt,!0))}),Nz=dt(function(i){var c=Nr(i);return jt(c)&&(c=n),Ii(wn(i,1,jt,!0),je(c,2))}),Pz=dt(function(i){var c=Nr(i);return c=typeof c=="function"?c:n,Ii(wn(i,1,jt,!0),n,c)});function Oz(i){return i&&i.length?Ii(i):[]}function Mz(i,c){return i&&i.length?Ii(i,je(c,2)):[]}function Dz(i,c){return c=typeof c=="function"?c:n,i&&i.length?Ii(i,n,c):[]}function Gv(i){if(!(i&&i.length))return[];var c=0;return i=Xr(i,function(f){if(jt(f))return c=on(f.length,c),!0}),As(c,function(f){return Lt(i,Es(f))})}function RA(i,c){if(!(i&&i.length))return[];var f=Gv(i);return c==null?f:Lt(f,function(m){return Sn(c,n,m)})}var Rz=dt(function(i,c){return jt(i)?wl(i,c):[]}),Lz=dt(function(i){return kv(Xr(i,jt))}),Fz=dt(function(i){var c=Nr(i);return jt(c)&&(c=n),kv(Xr(i,jt),je(c,2))}),Uz=dt(function(i){var c=Nr(i);return c=typeof c=="function"?c:n,kv(Xr(i,jt),n,c)}),$z=dt(Gv);function Hz(i,c){return Z0(i||[],c||[],yl)}function Bz(i,c){return Z0(i||[],c||[],xl)}var zz=dt(function(i){var c=i.length,f=c>1?i[c-1]:n;return f=typeof f=="function"?(i.pop(),f):n,RA(i,f)});function LA(i){var c=E(i);return c.__chain__=!0,c}function Vz(i,c){return c(i),i}function Kf(i,c){return c(i)}var Kz=Yo(function(i){var c=i.length,f=c?i[0]:0,m=this.__wrapped__,_=function(I){return mv(I,i)};return c>1||this.__actions__.length||!(m instanceof ft)||!Jo(f)?this.thru(_):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:Kf,args:[_],thisArg:n}),new Ar(m,this.__chain__).thru(function(I){return c&&!I.length&&I.push(n),I}))});function Gz(){return LA(this)}function jz(){return new Ar(this.value(),this.__chain__)}function Wz(){this.__values__===n&&(this.__values__=JA(this.value()));var i=this.__index__>=this.__values__.length,c=i?n:this.__values__[this.__index__++];return{done:i,value:c}}function qz(){return this}function Yz(i){for(var c,f=this;f instanceof kf;){var m=kA(f);m.__index__=0,m.__values__=n,c?_.__wrapped__=m:c=m;var _=m;f=f.__wrapped__}return _.__wrapped__=i,c}function Jz(){var i=this.__wrapped__;if(i instanceof ft){var c=i;return this.__actions__.length&&(c=new ft(this)),c=c.reverse(),c.__actions__.push({func:Kf,args:[Kv],thisArg:n}),new Ar(c,this.__chain__)}return this.thru(Kv)}function Qz(){return X0(this.__wrapped__,this.__actions__)}var Xz=Lf(function(i,c,f){Et.call(i,f)?++i[f]:Wo(i,f,1)});function Zz(i,c,f){var m=rt(i)?lf:VB;return f&&$n(i,c,f)&&(c=n),m(i,je(c,3))}function e4(i,c){var f=rt(i)?Xr:R0;return f(i,je(c,3))}var t4=lA(NA),n4=lA(PA);function r4(i,c){return wn(Gf(i,c),1)}function o4(i,c){return wn(Gf(i,c),re)}function i4(i,c,f){return f=f===n?1:at(f),wn(Gf(i,c),f)}function FA(i,c){var f=rt(i)?Qn:Ai;return f(i,je(c,3))}function UA(i,c){var f=rt(i)?av:D0;return f(i,je(c,3))}var a4=Lf(function(i,c,f){Et.call(i,f)?i[f].push(c):Wo(i,f,[c])});function s4(i,c,f,m){i=nr(i)?i:Us(i),f=f&&!m?at(f):0;var _=i.length;return f<0&&(f=on(_+f,0)),Jf(i)?f<=_&&i.indexOf(c,f)>-1:!!_&&Ti(i,c,f)>-1}var c4=dt(function(i,c,f){var m=-1,_=typeof c=="function",I=nr(i)?ie(i.length):[];return Ai(i,function(D){I[++m]=_?Sn(c,D,f):bl(D,c,f)}),I}),l4=Lf(function(i,c,f){Wo(i,f,c)});function Gf(i,c){var f=rt(i)?Lt:B0;return f(i,je(c,3))}function d4(i,c,f,m){return i==null?[]:(rt(c)||(c=c==null?[]:[c]),f=m?n:f,rt(f)||(f=f==null?[]:[f]),G0(i,c,f))}var u4=Lf(function(i,c,f){i[f?0:1].push(c)},function(){return[[],[]]});function f4(i,c,f){var m=rt(i)?sl:dl,_=arguments.length<3;return m(i,je(c,4),f,_,Ai)}function h4(i,c,f){var m=rt(i)?sv:dl,_=arguments.length<3;return m(i,je(c,4),f,_,D0)}function p4(i,c){var f=rt(i)?Xr:R0;return f(i,qf(je(c,3)))}function g4(i){var c=rt(i)?N0:s5;return c(i)}function m4(i,c,f){(f?$n(i,c,f):c===n)?c=1:c=at(c);var m=rt(i)?UB:c5;return m(i,c)}function v4(i){var c=rt(i)?$B:d5;return c(i)}function y4(i){if(i==null)return 0;if(nr(i))return Jf(i)?er(i):i.length;var c=An(i);return c==nt||c==Y?i.size:xv(i).length}function w4(i,c,f){var m=rt(i)?ha:u5;return f&&$n(i,c,f)&&(c=n),m(i,je(c,3))}var b4=dt(function(i,c){if(i==null)return[];var f=c.length;return f>1&&$n(i,c[0],c[1])?c=[]:f>2&&$n(c[0],c[1],c[2])&&(c=[c[0]]),G0(i,wn(c,1),[])}),jf=eB||function(){return nn.Date.now()};function C4(i,c){if(typeof c!="function")throw new Er(s);return i=at(i),function(){if(--i<1)return c.apply(this,arguments)}}function $A(i,c,f){return c=f?n:c,c=i&&c==null?i.length:c,qo(i,H,n,n,n,n,c)}function HA(i,c){var f;if(typeof c!="function")throw new Er(s);return i=at(i),function(){return--i>0&&(f=c.apply(this,arguments)),i<=1&&(c=n),f}}var jv=dt(function(i,c,f){var m=b;if(f.length){var _=Zn(f,Ls(jv));m|=T}return qo(i,m,c,f,_)}),BA=dt(function(i,c,f){var m=b|k;if(f.length){var _=Zn(f,Ls(BA));m|=T}return qo(c,m,i,f,_)});function zA(i,c,f){c=f?n:c;var m=qo(i,N,n,n,n,n,n,c);return m.placeholder=zA.placeholder,m}function VA(i,c,f){c=f?n:c;var m=qo(i,O,n,n,n,n,n,c);return m.placeholder=VA.placeholder,m}function KA(i,c,f){var m,_,I,D,F,j,pe=0,me=!1,we=!1,Oe=!0;if(typeof i!="function")throw new Er(s);c=Pr(c)||0,Bt(f)&&(me=!!f.leading,we="maxWait"in f,I=we?on(Pr(f.maxWait)||0,c):I,Oe="trailing"in f?!!f.trailing:Oe);function He(Wt){var no=m,Zo=_;return m=_=n,pe=Wt,D=i.apply(Zo,no),D}function qe(Wt){return pe=Wt,F=Tl(ut,c),me?He(Wt):D}function ct(Wt){var no=Wt-j,Zo=Wt-pe,lI=c-no;return we?En(lI,I-Zo):lI}function Ye(Wt){var no=Wt-j,Zo=Wt-pe;return j===n||no>=c||no<0||we&&Zo>=I}function ut(){var Wt=jf();if(Ye(Wt))return ht(Wt);F=Tl(ut,ct(Wt))}function ht(Wt){return F=n,Oe&&m?He(Wt):(m=_=n,D)}function wr(){F!==n&&eA(F),pe=0,m=j=_=F=n}function Hn(){return F===n?D:ht(jf())}function br(){var Wt=jf(),no=Ye(Wt);if(m=arguments,_=this,j=Wt,no){if(F===n)return qe(j);if(we)return eA(F),F=Tl(ut,c),He(j)}return F===n&&(F=Tl(ut,c)),D}return br.cancel=wr,br.flush=Hn,br}var x4=dt(function(i,c){return M0(i,1,c)}),_4=dt(function(i,c,f){return M0(i,Pr(c)||0,f)});function S4(i){return qo(i,ee)}function Wf(i,c){if(typeof i!="function"||c!=null&&typeof c!="function")throw new Er(s);var f=function(){var m=arguments,_=c?c.apply(this,m):m[0],I=f.cache;if(I.has(_))return I.get(_);var D=i.apply(this,m);return f.cache=I.set(_,D)||I,D};return f.cache=new(Wf.Cache||jo),f}Wf.Cache=jo;function qf(i){if(typeof i!="function")throw new Er(s);return function(){var c=arguments;switch(c.length){case 0:return!i.call(this);case 1:return!i.call(this,c[0]);case 2:return!i.call(this,c[0],c[1]);case 3:return!i.call(this,c[0],c[1],c[2])}return!i.apply(this,c)}}function T4(i){return HA(2,i)}var E4=f5(function(i,c){c=c.length==1&&rt(c[0])?Lt(c[0],Fn(je())):Lt(wn(c,1),Fn(je()));var f=c.length;return dt(function(m){for(var _=-1,I=En(m.length,f);++_<I;)m[_]=c[_].call(this,m[_]);return Sn(i,this,m)})}),Wv=dt(function(i,c){var f=Zn(c,Ls(Wv));return qo(i,T,n,c,f)}),GA=dt(function(i,c){var f=Zn(c,Ls(GA));return qo(i,L,n,c,f)}),A4=Yo(function(i,c){return qo(i,W,n,n,n,c)});function I4(i,c){if(typeof i!="function")throw new Er(s);return c=c===n?c:at(c),dt(i,c)}function k4(i,c){if(typeof i!="function")throw new Er(s);return c=c==null?0:on(at(c),0),dt(function(f){var m=f[c],_=Ni(f,0,c);return m&&Tn(_,m),Sn(i,this,_)})}function N4(i,c,f){var m=!0,_=!0;if(typeof i!="function")throw new Er(s);return Bt(f)&&(m="leading"in f?!!f.leading:m,_="trailing"in f?!!f.trailing:_),KA(i,c,{leading:m,maxWait:c,trailing:_})}function P4(i){return $A(i,1)}function O4(i,c){return Wv(Pv(c),i)}function M4(){if(!arguments.length)return[];var i=arguments[0];return rt(i)?i:[i]}function D4(i){return Ir(i,y)}function R4(i,c){return c=typeof c=="function"?c:n,Ir(i,y,c)}function L4(i){return Ir(i,g|y)}function F4(i,c){return c=typeof c=="function"?c:n,Ir(i,g|y,c)}function U4(i,c){return c==null||O0(i,c,un(c))}function to(i,c){return i===c||i!==i&&c!==c}var $4=Hf(wv),H4=Hf(function(i,c){return i>=c}),Ea=U0(function(){return arguments}())?U0:function(i){return Kt(i)&&Et.call(i,"callee")&&!S0.call(i,"callee")},rt=ie.isArray,B4=rf?Fn(rf):YB;function nr(i){return i!=null&&Yf(i.length)&&!Qo(i)}function jt(i){return Kt(i)&&nr(i)}function z4(i){return i===!0||i===!1||Kt(i)&&Un(i)==ue}var Pi=nB||oy,V4=of?Fn(of):JB;function K4(i){return Kt(i)&&i.nodeType===1&&!El(i)}function G4(i){if(i==null)return!0;if(nr(i)&&(rt(i)||typeof i=="string"||typeof i.splice=="function"||Pi(i)||Fs(i)||Ea(i)))return!i.length;var c=An(i);if(c==nt||c==Y)return!i.size;if(Sl(i))return!xv(i).length;for(var f in i)if(Et.call(i,f))return!1;return!0}function j4(i,c){return Cl(i,c)}function W4(i,c,f){f=typeof f=="function"?f:n;var m=f?f(i,c):n;return m===n?Cl(i,c,n,f):!!m}function qv(i){if(!Kt(i))return!1;var c=Un(i);return c==Pe||c==xe||typeof i.message=="string"&&typeof i.name=="string"&&!El(i)}function q4(i){return typeof i=="number"&&E0(i)}function Qo(i){if(!Bt(i))return!1;var c=Un(i);return c==ae||c==Ze||c==z||c==en}function jA(i){return typeof i=="number"&&i==at(i)}function Yf(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=J}function Bt(i){var c=typeof i;return i!=null&&(c=="object"||c=="function")}function Kt(i){return i!=null&&typeof i=="object"}var WA=af?Fn(af):XB;function Y4(i,c){return i===c||Cv(i,c,Uv(c))}function J4(i,c,f){return f=typeof f=="function"?f:n,Cv(i,c,Uv(c),f)}function Q4(i){return qA(i)&&i!=+i}function X4(i){if(R5(i))throw new et(a);return $0(i)}function Z4(i){return i===null}function eV(i){return i==null}function qA(i){return typeof i=="number"||Kt(i)&&Un(i)==Tt}function El(i){if(!Kt(i)||Un(i)!=Ot)return!1;var c=xf(i);if(c===null)return!0;var f=Et.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&yf.call(f)==J3}var Yv=fa?Fn(fa):ZB;function tV(i){return jA(i)&&i>=-J&&i<=J}var YA=sf?Fn(sf):e5;function Jf(i){return typeof i=="string"||!rt(i)&&Kt(i)&&Un(i)==se}function yr(i){return typeof i=="symbol"||Kt(i)&&Un(i)==Ie}var Fs=cf?Fn(cf):t5;function nV(i){return i===n}function rV(i){return Kt(i)&&An(i)==ne}function oV(i){return Kt(i)&&Un(i)==ke}var iV=Hf(_v),aV=Hf(function(i,c){return i<=c});function JA(i){if(!i)return[];if(nr(i))return Jf(i)?vt(i):tr(i);if(hl&&i[hl])return De(i[hl]());var c=An(i),f=c==nt?Ct:c==Y?ma:Us;return f(i)}function Xo(i){if(!i)return i===0?i:0;if(i=Pr(i),i===re||i===-re){var c=i<0?-1:1;return c*X}return i===i?i:0}function at(i){var c=Xo(i),f=c%1;return c===c?f?c-f:c:0}function QA(i){return i?xa(at(i),0,te):0}function Pr(i){if(typeof i=="number")return i;if(yr(i))return U;if(Bt(i)){var c=typeof i.valueOf=="function"?i.valueOf():i;i=Bt(c)?c+"":c}if(typeof i!="string")return i===0?i:+i;i=fl(i);var f=ia.test(i);return f||qm.test(i)?xs(i.slice(2),f?2:8):zc.test(i)?U:+i}function XA(i){return xo(i,rr(i))}function sV(i){return i?xa(at(i),-J,J):i===0?i:0}function xt(i){return i==null?"":vr(i)}var cV=Ds(function(i,c){if(Sl(c)||nr(c)){xo(c,un(c),i);return}for(var f in c)Et.call(c,f)&&yl(i,f,c[f])}),ZA=Ds(function(i,c){xo(c,rr(c),i)}),Qf=Ds(function(i,c,f,m){xo(c,rr(c),i,m)}),lV=Ds(function(i,c,f,m){xo(c,un(c),i,m)}),dV=Yo(mv);function uV(i,c){var f=Ms(i);return c==null?f:P0(f,c)}var fV=dt(function(i,c){i=Rt(i);var f=-1,m=c.length,_=m>2?c[2]:n;for(_&&$n(c[0],c[1],_)&&(m=1);++f<m;)for(var I=c[f],D=rr(I),F=-1,j=D.length;++F<j;){var pe=D[F],me=i[pe];(me===n||to(me,Ns[pe])&&!Et.call(i,pe))&&(i[pe]=I[pe])}return i}),hV=dt(function(i){return i.push(n,mA),Sn(eI,n,i)});function pV(i,c){return uf(i,je(c,3),Co)}function gV(i,c){return uf(i,je(c,3),yv)}function mV(i,c){return i==null?i:vv(i,je(c,3),rr)}function vV(i,c){return i==null?i:L0(i,je(c,3),rr)}function yV(i,c){return i&&Co(i,je(c,3))}function wV(i,c){return i&&yv(i,je(c,3))}function bV(i){return i==null?[]:Of(i,un(i))}function CV(i){return i==null?[]:Of(i,rr(i))}function Jv(i,c,f){var m=i==null?n:_a(i,c);return m===n?f:m}function xV(i,c){return i!=null&&wA(i,c,GB)}function Qv(i,c){return i!=null&&wA(i,c,jB)}var _V=uA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=wf.call(c)),i[c]=f},Zv(or)),SV=uA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=wf.call(c)),Et.call(i,c)?i[c].push(f):i[c]=[f]},je),TV=dt(bl);function un(i){return nr(i)?k0(i):xv(i)}function rr(i){return nr(i)?k0(i,!0):n5(i)}function EV(i,c){var f={};return c=je(c,3),Co(i,function(m,_,I){Wo(f,c(m,_,I),m)}),f}function AV(i,c){var f={};return c=je(c,3),Co(i,function(m,_,I){Wo(f,_,c(m,_,I))}),f}var IV=Ds(function(i,c,f){Mf(i,c,f)}),eI=Ds(function(i,c,f,m){Mf(i,c,f,m)}),kV=Yo(function(i,c){var f={};if(i==null)return f;var m=!1;c=Lt(c,function(I){return I=ki(I,i),m||(m=I.length>1),I}),xo(i,Lv(i),f),m&&(f=Ir(f,g|w|y,_5));for(var _=c.length;_--;)Iv(f,c[_]);return f});function NV(i,c){return tI(i,qf(je(c)))}var PV=Yo(function(i,c){return i==null?{}:o5(i,c)});function tI(i,c){if(i==null)return{};var f=Lt(Lv(i),function(m){return[m]});return c=je(c),j0(i,f,function(m,_){return c(m,_[0])})}function OV(i,c,f){c=ki(c,i);var m=-1,_=c.length;for(_||(_=1,i=n);++m<_;){var I=i==null?n:i[_o(c[m])];I===n&&(m=_,I=f),i=Qo(I)?I.call(i):I}return i}function MV(i,c,f){return i==null?i:xl(i,c,f)}function DV(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:xl(i,c,f,m)}var nI=pA(un),rI=pA(rr);function RV(i,c,f){var m=rt(i),_=m||Pi(i)||Fs(i);if(c=je(c,4),f==null){var I=i&&i.constructor;_?f=m?new I:[]:Bt(i)?f=Qo(I)?Ms(xf(i)):{}:f={}}return(_?Qn:Co)(i,function(D,F,j){return c(f,D,F,j)}),f}function LV(i,c){return i==null?!0:Iv(i,c)}function FV(i,c,f){return i==null?i:Q0(i,c,Pv(f))}function UV(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:Q0(i,c,Pv(f),m)}function Us(i){return i==null?[]:Zr(i,un(i))}function $V(i){return i==null?[]:Zr(i,rr(i))}function HV(i,c,f){return f===n&&(f=c,c=n),f!==n&&(f=Pr(f),f=f===f?f:0),c!==n&&(c=Pr(c),c=c===c?c:0),xa(Pr(i),c,f)}function BV(i,c,f){return c=Xo(c),f===n?(f=c,c=0):f=Xo(f),i=Pr(i),WB(i,c,f)}function zV(i,c,f){if(f&&typeof f!="boolean"&&$n(i,c,f)&&(c=f=n),f===n&&(typeof c=="boolean"?(f=c,c=n):typeof i=="boolean"&&(f=i,i=n)),i===n&&c===n?(i=0,c=1):(i=Xo(i),c===n?(c=i,i=0):c=Xo(c)),i>c){var m=i;i=c,c=m}if(f||i%1||c%1){var _=A0();return En(i+_*(c-i+rv("1e-"+((_+"").length-1))),c)}return Tv(i,c)}var VV=Rs(function(i,c,f){return c=c.toLowerCase(),i+(f?oI(c):c)});function oI(i){return Xv(xt(i).toLowerCase())}function iI(i){return i=xt(i),i&&i.replace(Vc,S).replace(Cs,"")}function KV(i,c,f){i=xt(i),c=vr(c);var m=i.length;f=f===n?m:xa(at(f),0,m);var _=f;return f-=c.length,f>=0&&i.slice(f,_)==c}function GV(i){return i=xt(i),i&&ta.test(i)?i.replace(Uc,P):i}function jV(i){return i=xt(i),i&&Wu.test(i)?i.replace($c,"\\$&"):i}var WV=Rs(function(i,c,f){return i+(f?"-":"")+c.toLowerCase()}),qV=Rs(function(i,c,f){return i+(f?" ":"")+c.toLowerCase()}),YV=cA("toLowerCase");function JV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;if(!c||m>=c)return i;var _=(c-m)/2;return $f(Ef(_),f)+i+$f(Tf(_),f)}function QV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;return c&&m<c?i+$f(c-m,f):i}function XV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;return c&&m<c?$f(c-m,f)+i:i}function ZV(i,c,f){return f||c==null?c=0:c&&(c=+c),aB(xt(i).replace(Hc,""),c||0)}function eK(i,c,f){return(f?$n(i,c,f):c===n)?c=1:c=at(c),Ev(xt(i),c)}function tK(){var i=arguments,c=xt(i[0]);return i.length<3?c:c.replace(i[1],i[2])}var nK=Rs(function(i,c,f){return i+(f?"_":"")+c.toLowerCase()});function rK(i,c,f){return f&&typeof f!="number"&&$n(i,c,f)&&(c=f=n),f=f===n?te:f>>>0,f?(i=xt(i),i&&(typeof c=="string"||c!=null&&!Yv(c))&&(c=vr(c),!c&&ye(i))?Ni(vt(i),0,f):i.split(c,f)):[]}var oK=Rs(function(i,c,f){return i+(f?" ":"")+Xv(c)});function iK(i,c,f){return i=xt(i),f=f==null?0:xa(at(f),0,i.length),c=vr(c),i.slice(f,f+c.length)==c}function aK(i,c,f){var m=E.templateSettings;f&&$n(i,c,f)&&(c=n),i=xt(i),c=Qf({},c,m,gA);var _=Qf({},c.imports,m.imports,gA),I=un(_),D=Zr(_,I),F,j,pe=0,me=c.interpolate||Kc,we="__p += '",Oe=uv((c.escape||Kc).source+"|"+me.source+"|"+(me===Gu?Ho:Kc).source+"|"+(c.evaluate||Kc).source+"|$","g"),He="//# sourceURL="+(Et.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++il+"]")+`
82
- `;i.replace(Oe,function(Ye,ut,ht,wr,Hn,br){return ht||(ht=wr),we+=i.slice(pe,br).replace(Ym,B),ut&&(F=!0,we+=`' +
81
+ `)}function O5(i){return rt(i)||Ea(i)||!!(T0&&i&&i[T0])}function Jo(i,c){var f=typeof i;return c=c??J,!!c&&(f=="number"||f!="symbol"&&Dt.test(i))&&i>-1&&i%1==0&&i<c}function Un(i,c,f){if(!Bt(f))return!1;var m=typeof c;return(m=="number"?nr(f)&&Jo(c,f.length):m=="string"&&c in f)?to(f[c],i):!1}function Hv(i,c){if(rt(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||yr(i)?!0:ds.test(i)||!ra.test(i)||c!=null&&i in Rt(c)}function M5(i){var c=typeof i;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?i!=="__proto__":i===null}function Bv(i){var c=Bf(i),f=E[c];if(typeof f!="function"||!(c in ft.prototype))return!1;if(i===f)return!0;var m=Fv(f);return!!m&&i===m[0]}function D5(i){return!!C0&&C0 in i}var R5=vf?Qo:oy;function Sl(i){var c=i&&i.constructor,f=typeof c=="function"&&c.prototype||Ns;return i===f}function CA(i){return i===i&&!Bt(i)}function xA(i,c){return function(f){return f==null?!1:f[i]===c&&(c!==n||i in Rt(f))}}function L5(i){var c=Wf(i,function(m){return f.size===h&&f.clear(),m}),f=c.cache;return c}function F5(i,c){var f=i[1],m=c[1],_=f|m,I=_<(b|k|H),D=m==H&&f==N||m==H&&f==W&&i[7].length<=c[8]||m==(H|W)&&c[7].length<=c[8]&&f==N;if(!(I||D))return i;m&b&&(i[2]=c[2],_|=f&b?0:A);var F=c[3];if(F){var j=i[3];i[3]=j?oA(j,F,c[4]):F,i[4]=j?Zn(i[3],p):c[4]}return F=c[5],F&&(j=i[5],i[5]=j?iA(j,F,c[6]):F,i[6]=j?Zn(i[5],p):c[6]),F=c[7],F&&(i[7]=F),m&H&&(i[8]=i[8]==null?c[8]:En(i[8],c[8])),i[9]==null&&(i[9]=c[9]),i[0]=c[0],i[1]=_,i}function U5(i){var c=[];if(i!=null)for(var f in Rt(i))c.push(f);return c}function $5(i){return wf.call(i)}function _A(i,c,f){return c=on(c===n?i.length-1:c,0),function(){for(var m=arguments,_=-1,I=on(m.length-c,0),D=ie(I);++_<I;)D[_]=m[c+_];_=-1;for(var F=ie(c+1);++_<c;)F[_]=m[_];return F[c]=f(D),Sn(i,this,F)}}function SA(i,c){return c.length<2?i:_a(i,kr(c,0,-1))}function H5(i,c){for(var f=i.length,m=En(c.length,f),_=tr(i);m--;){var I=c[m];i[m]=Jo(I,f)?_[I]:n}return i}function zv(i,c){if(!(c==="constructor"&&typeof i[c]=="function")&&c!="__proto__")return i[c]}var TA=AA(q0),Tl=tB||function(i,c){return nn.setTimeout(i,c)},Vv=AA(l5);function EA(i,c,f){var m=c+"";return Vv(i,P5(m,B5(I5(m),f)))}function AA(i){var c=0,f=0;return function(){var m=iB(),_=ve-(m-f);if(f=m,_>0){if(++c>=ce)return arguments[0]}else c=0;return i.apply(n,arguments)}}function Vf(i,c){var f=-1,m=i.length,_=m-1;for(c=c===n?m:c;++f<c;){var I=Tv(f,_),D=i[I];i[I]=i[f],i[f]=D}return i.length=c,i}var IA=L5(function(i){var c=[];return i.charCodeAt(0)===46&&c.push(""),i.replace(ju,function(f,m,_,I){c.push(_?I.replace(Wm,"$1"):m||f)}),c});function _o(i){if(typeof i=="string"||yr(i))return i;var c=i+"";return c=="0"&&1/i==-re?"-0":c}function Ta(i){if(i!=null){try{return yf.call(i)}catch{}try{return i+""}catch{}}return""}function B5(i,c){return Qn(Ce,function(f){var m="_."+f[0];c&f[1]&&!mr(i,m)&&i.push(m)}),i.sort()}function kA(i){if(i instanceof ft)return i.clone();var c=new Ar(i.__wrapped__,i.__chain__);return c.__actions__=tr(i.__actions__),c.__index__=i.__index__,c.__values__=i.__values__,c}function z5(i,c,f){(f?Un(i,c,f):c===n)?c=1:c=on(at(c),0);var m=i==null?0:i.length;if(!m||c<1)return[];for(var _=0,I=0,D=ie(Tf(m/c));_<m;)D[I++]=kr(i,_,_+=c);return D}function V5(i){for(var c=-1,f=i==null?0:i.length,m=0,_=[];++c<f;){var I=i[c];I&&(_[m++]=I)}return _}function K5(){var i=arguments.length;if(!i)return[];for(var c=ie(i-1),f=arguments[0],m=i;m--;)c[m-1]=arguments[m];return Tn(rt(f)?tr(f):[f],wn(c,1))}var G5=dt(function(i,c){return Wt(i)?wl(i,wn(c,1,Wt,!0)):[]}),j5=dt(function(i,c){var f=Nr(c);return Wt(f)&&(f=n),Wt(i)?wl(i,wn(c,1,Wt,!0),je(f,2)):[]}),W5=dt(function(i,c){var f=Nr(c);return Wt(f)&&(f=n),Wt(i)?wl(i,wn(c,1,Wt,!0),n,f):[]});function q5(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),kr(i,c<0?0:c,m)):[]}function Y5(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),c=m-c,kr(i,0,c<0?0:c)):[]}function J5(i,c){return i&&i.length?Rf(i,je(c,3),!0,!0):[]}function Q5(i,c){return i&&i.length?Rf(i,je(c,3),!0):[]}function X5(i,c,f,m){var _=i==null?0:i.length;return _?(f&&typeof f!="number"&&Un(i,c,f)&&(f=0,m=_),KB(i,c,f,m)):[]}function NA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=f==null?0:at(f);return _<0&&(_=on(m+_,0)),Ts(i,je(c,3),_)}function PA(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=m-1;return f!==n&&(_=at(f),_=f<0?on(m+_,0):En(_,m-1)),Ts(i,je(c,3),_,!0)}function OA(i){var c=i==null?0:i.length;return c?wn(i,1):[]}function Z5(i){var c=i==null?0:i.length;return c?wn(i,re):[]}function ez(i,c){var f=i==null?0:i.length;return f?(c=c===n?1:at(c),wn(i,c)):[]}function tz(i){for(var c=-1,f=i==null?0:i.length,m={};++c<f;){var _=i[c];m[_[0]]=_[1]}return m}function MA(i){return i&&i.length?i[0]:n}function nz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=f==null?0:at(f);return _<0&&(_=on(m+_,0)),Ti(i,c,_)}function rz(i){var c=i==null?0:i.length;return c?kr(i,0,-1):[]}var oz=dt(function(i){var c=Lt(i,Nv);return c.length&&c[0]===i[0]?bv(c):[]}),iz=dt(function(i){var c=Nr(i),f=Lt(i,Nv);return c===Nr(f)?c=n:f.pop(),f.length&&f[0]===i[0]?bv(f,je(c,2)):[]}),az=dt(function(i){var c=Nr(i),f=Lt(i,Nv);return c=typeof c=="function"?c:n,c&&f.pop(),f.length&&f[0]===i[0]?bv(f,n,c):[]});function sz(i,c){return i==null?"":rB.call(i,c)}function Nr(i){var c=i==null?0:i.length;return c?i[c-1]:n}function cz(i,c,f){var m=i==null?0:i.length;if(!m)return-1;var _=m;return f!==n&&(_=at(f),_=_<0?on(m+_,0):En(_,m-1)),c===c?Is(i,c,_):Ts(i,ll,_,!0)}function lz(i,c){return i&&i.length?K0(i,at(c)):n}var dz=dt(DA);function DA(i,c){return i&&i.length&&c&&c.length?Sv(i,c):i}function uz(i,c,f){return i&&i.length&&c&&c.length?Sv(i,c,je(f,2)):i}function fz(i,c,f){return i&&i.length&&c&&c.length?Sv(i,c,n,f):i}var hz=Yo(function(i,c){var f=i==null?0:i.length,m=mv(i,c);return W0(i,Lt(c,function(_){return Jo(_,f)?+_:_}).sort(rA)),m});function pz(i,c){var f=[];if(!(i&&i.length))return f;var m=-1,_=[],I=i.length;for(c=je(c,3);++m<I;){var D=i[m];c(D,m,i)&&(f.push(D),_.push(m))}return W0(i,_),f}function Kv(i){return i==null?i:sB.call(i)}function gz(i,c,f){var m=i==null?0:i.length;return m?(f&&typeof f!="number"&&Un(i,c,f)?(c=0,f=m):(c=c==null?0:at(c),f=f===n?m:at(f)),kr(i,c,f)):[]}function mz(i,c){return Df(i,c)}function vz(i,c,f){return Av(i,c,je(f,2))}function yz(i,c){var f=i==null?0:i.length;if(f){var m=Df(i,c);if(m<f&&to(i[m],c))return m}return-1}function wz(i,c){return Df(i,c,!0)}function bz(i,c,f){return Av(i,c,je(f,2),!0)}function Cz(i,c){var f=i==null?0:i.length;if(f){var m=Df(i,c,!0)-1;if(to(i[m],c))return m}return-1}function xz(i){return i&&i.length?Y0(i):[]}function _z(i,c){return i&&i.length?Y0(i,je(c,2)):[]}function Sz(i){var c=i==null?0:i.length;return c?kr(i,1,c):[]}function Tz(i,c,f){return i&&i.length?(c=f||c===n?1:at(c),kr(i,0,c<0?0:c)):[]}function Ez(i,c,f){var m=i==null?0:i.length;return m?(c=f||c===n?1:at(c),c=m-c,kr(i,c<0?0:c,m)):[]}function Az(i,c){return i&&i.length?Rf(i,je(c,3),!1,!0):[]}function Iz(i,c){return i&&i.length?Rf(i,je(c,3)):[]}var kz=dt(function(i){return Ii(wn(i,1,Wt,!0))}),Nz=dt(function(i){var c=Nr(i);return Wt(c)&&(c=n),Ii(wn(i,1,Wt,!0),je(c,2))}),Pz=dt(function(i){var c=Nr(i);return c=typeof c=="function"?c:n,Ii(wn(i,1,Wt,!0),n,c)});function Oz(i){return i&&i.length?Ii(i):[]}function Mz(i,c){return i&&i.length?Ii(i,je(c,2)):[]}function Dz(i,c){return c=typeof c=="function"?c:n,i&&i.length?Ii(i,n,c):[]}function Gv(i){if(!(i&&i.length))return[];var c=0;return i=Xr(i,function(f){if(Wt(f))return c=on(f.length,c),!0}),As(c,function(f){return Lt(i,Es(f))})}function RA(i,c){if(!(i&&i.length))return[];var f=Gv(i);return c==null?f:Lt(f,function(m){return Sn(c,n,m)})}var Rz=dt(function(i,c){return Wt(i)?wl(i,c):[]}),Lz=dt(function(i){return kv(Xr(i,Wt))}),Fz=dt(function(i){var c=Nr(i);return Wt(c)&&(c=n),kv(Xr(i,Wt),je(c,2))}),Uz=dt(function(i){var c=Nr(i);return c=typeof c=="function"?c:n,kv(Xr(i,Wt),n,c)}),$z=dt(Gv);function Hz(i,c){return Z0(i||[],c||[],yl)}function Bz(i,c){return Z0(i||[],c||[],xl)}var zz=dt(function(i){var c=i.length,f=c>1?i[c-1]:n;return f=typeof f=="function"?(i.pop(),f):n,RA(i,f)});function LA(i){var c=E(i);return c.__chain__=!0,c}function Vz(i,c){return c(i),i}function Kf(i,c){return c(i)}var Kz=Yo(function(i){var c=i.length,f=c?i[0]:0,m=this.__wrapped__,_=function(I){return mv(I,i)};return c>1||this.__actions__.length||!(m instanceof ft)||!Jo(f)?this.thru(_):(m=m.slice(f,+f+(c?1:0)),m.__actions__.push({func:Kf,args:[_],thisArg:n}),new Ar(m,this.__chain__).thru(function(I){return c&&!I.length&&I.push(n),I}))});function Gz(){return LA(this)}function jz(){return new Ar(this.value(),this.__chain__)}function Wz(){this.__values__===n&&(this.__values__=JA(this.value()));var i=this.__index__>=this.__values__.length,c=i?n:this.__values__[this.__index__++];return{done:i,value:c}}function qz(){return this}function Yz(i){for(var c,f=this;f instanceof kf;){var m=kA(f);m.__index__=0,m.__values__=n,c?_.__wrapped__=m:c=m;var _=m;f=f.__wrapped__}return _.__wrapped__=i,c}function Jz(){var i=this.__wrapped__;if(i instanceof ft){var c=i;return this.__actions__.length&&(c=new ft(this)),c=c.reverse(),c.__actions__.push({func:Kf,args:[Kv],thisArg:n}),new Ar(c,this.__chain__)}return this.thru(Kv)}function Qz(){return X0(this.__wrapped__,this.__actions__)}var Xz=Lf(function(i,c,f){Et.call(i,f)?++i[f]:Wo(i,f,1)});function Zz(i,c,f){var m=rt(i)?lf:VB;return f&&Un(i,c,f)&&(c=n),m(i,je(c,3))}function e4(i,c){var f=rt(i)?Xr:R0;return f(i,je(c,3))}var t4=lA(NA),n4=lA(PA);function r4(i,c){return wn(Gf(i,c),1)}function o4(i,c){return wn(Gf(i,c),re)}function i4(i,c,f){return f=f===n?1:at(f),wn(Gf(i,c),f)}function FA(i,c){var f=rt(i)?Qn:Ai;return f(i,je(c,3))}function UA(i,c){var f=rt(i)?av:D0;return f(i,je(c,3))}var a4=Lf(function(i,c,f){Et.call(i,f)?i[f].push(c):Wo(i,f,[c])});function s4(i,c,f,m){i=nr(i)?i:Us(i),f=f&&!m?at(f):0;var _=i.length;return f<0&&(f=on(_+f,0)),Jf(i)?f<=_&&i.indexOf(c,f)>-1:!!_&&Ti(i,c,f)>-1}var c4=dt(function(i,c,f){var m=-1,_=typeof c=="function",I=nr(i)?ie(i.length):[];return Ai(i,function(D){I[++m]=_?Sn(c,D,f):bl(D,c,f)}),I}),l4=Lf(function(i,c,f){Wo(i,f,c)});function Gf(i,c){var f=rt(i)?Lt:B0;return f(i,je(c,3))}function d4(i,c,f,m){return i==null?[]:(rt(c)||(c=c==null?[]:[c]),f=m?n:f,rt(f)||(f=f==null?[]:[f]),G0(i,c,f))}var u4=Lf(function(i,c,f){i[f?0:1].push(c)},function(){return[[],[]]});function f4(i,c,f){var m=rt(i)?sl:dl,_=arguments.length<3;return m(i,je(c,4),f,_,Ai)}function h4(i,c,f){var m=rt(i)?sv:dl,_=arguments.length<3;return m(i,je(c,4),f,_,D0)}function p4(i,c){var f=rt(i)?Xr:R0;return f(i,qf(je(c,3)))}function g4(i){var c=rt(i)?N0:s5;return c(i)}function m4(i,c,f){(f?Un(i,c,f):c===n)?c=1:c=at(c);var m=rt(i)?UB:c5;return m(i,c)}function v4(i){var c=rt(i)?$B:d5;return c(i)}function y4(i){if(i==null)return 0;if(nr(i))return Jf(i)?er(i):i.length;var c=An(i);return c==nt||c==Y?i.size:xv(i).length}function w4(i,c,f){var m=rt(i)?ha:u5;return f&&Un(i,c,f)&&(c=n),m(i,je(c,3))}var b4=dt(function(i,c){if(i==null)return[];var f=c.length;return f>1&&Un(i,c[0],c[1])?c=[]:f>2&&Un(c[0],c[1],c[2])&&(c=[c[0]]),G0(i,wn(c,1),[])}),jf=eB||function(){return nn.Date.now()};function C4(i,c){if(typeof c!="function")throw new Er(s);return i=at(i),function(){if(--i<1)return c.apply(this,arguments)}}function $A(i,c,f){return c=f?n:c,c=i&&c==null?i.length:c,qo(i,H,n,n,n,n,c)}function HA(i,c){var f;if(typeof c!="function")throw new Er(s);return i=at(i),function(){return--i>0&&(f=c.apply(this,arguments)),i<=1&&(c=n),f}}var jv=dt(function(i,c,f){var m=b;if(f.length){var _=Zn(f,Ls(jv));m|=T}return qo(i,m,c,f,_)}),BA=dt(function(i,c,f){var m=b|k;if(f.length){var _=Zn(f,Ls(BA));m|=T}return qo(c,m,i,f,_)});function zA(i,c,f){c=f?n:c;var m=qo(i,N,n,n,n,n,n,c);return m.placeholder=zA.placeholder,m}function VA(i,c,f){c=f?n:c;var m=qo(i,O,n,n,n,n,n,c);return m.placeholder=VA.placeholder,m}function KA(i,c,f){var m,_,I,D,F,j,pe=0,me=!1,we=!1,Oe=!0;if(typeof i!="function")throw new Er(s);c=Pr(c)||0,Bt(f)&&(me=!!f.leading,we="maxWait"in f,I=we?on(Pr(f.maxWait)||0,c):I,Oe="trailing"in f?!!f.trailing:Oe);function He(qt){var no=m,Zo=_;return m=_=n,pe=qt,D=i.apply(Zo,no),D}function qe(qt){return pe=qt,F=Tl(ut,c),me?He(qt):D}function ct(qt){var no=qt-j,Zo=qt-pe,lI=c-no;return we?En(lI,I-Zo):lI}function Ye(qt){var no=qt-j,Zo=qt-pe;return j===n||no>=c||no<0||we&&Zo>=I}function ut(){var qt=jf();if(Ye(qt))return ht(qt);F=Tl(ut,ct(qt))}function ht(qt){return F=n,Oe&&m?He(qt):(m=_=n,D)}function wr(){F!==n&&eA(F),pe=0,m=j=_=F=n}function $n(){return F===n?D:ht(jf())}function br(){var qt=jf(),no=Ye(qt);if(m=arguments,_=this,j=qt,no){if(F===n)return qe(j);if(we)return eA(F),F=Tl(ut,c),He(j)}return F===n&&(F=Tl(ut,c)),D}return br.cancel=wr,br.flush=$n,br}var x4=dt(function(i,c){return M0(i,1,c)}),_4=dt(function(i,c,f){return M0(i,Pr(c)||0,f)});function S4(i){return qo(i,ee)}function Wf(i,c){if(typeof i!="function"||c!=null&&typeof c!="function")throw new Er(s);var f=function(){var m=arguments,_=c?c.apply(this,m):m[0],I=f.cache;if(I.has(_))return I.get(_);var D=i.apply(this,m);return f.cache=I.set(_,D)||I,D};return f.cache=new(Wf.Cache||jo),f}Wf.Cache=jo;function qf(i){if(typeof i!="function")throw new Er(s);return function(){var c=arguments;switch(c.length){case 0:return!i.call(this);case 1:return!i.call(this,c[0]);case 2:return!i.call(this,c[0],c[1]);case 3:return!i.call(this,c[0],c[1],c[2])}return!i.apply(this,c)}}function T4(i){return HA(2,i)}var E4=f5(function(i,c){c=c.length==1&&rt(c[0])?Lt(c[0],Ln(je())):Lt(wn(c,1),Ln(je()));var f=c.length;return dt(function(m){for(var _=-1,I=En(m.length,f);++_<I;)m[_]=c[_].call(this,m[_]);return Sn(i,this,m)})}),Wv=dt(function(i,c){var f=Zn(c,Ls(Wv));return qo(i,T,n,c,f)}),GA=dt(function(i,c){var f=Zn(c,Ls(GA));return qo(i,L,n,c,f)}),A4=Yo(function(i,c){return qo(i,W,n,n,n,c)});function I4(i,c){if(typeof i!="function")throw new Er(s);return c=c===n?c:at(c),dt(i,c)}function k4(i,c){if(typeof i!="function")throw new Er(s);return c=c==null?0:on(at(c),0),dt(function(f){var m=f[c],_=Ni(f,0,c);return m&&Tn(_,m),Sn(i,this,_)})}function N4(i,c,f){var m=!0,_=!0;if(typeof i!="function")throw new Er(s);return Bt(f)&&(m="leading"in f?!!f.leading:m,_="trailing"in f?!!f.trailing:_),KA(i,c,{leading:m,maxWait:c,trailing:_})}function P4(i){return $A(i,1)}function O4(i,c){return Wv(Pv(c),i)}function M4(){if(!arguments.length)return[];var i=arguments[0];return rt(i)?i:[i]}function D4(i){return Ir(i,y)}function R4(i,c){return c=typeof c=="function"?c:n,Ir(i,y,c)}function L4(i){return Ir(i,g|y)}function F4(i,c){return c=typeof c=="function"?c:n,Ir(i,g|y,c)}function U4(i,c){return c==null||O0(i,c,un(c))}function to(i,c){return i===c||i!==i&&c!==c}var $4=Hf(wv),H4=Hf(function(i,c){return i>=c}),Ea=U0(function(){return arguments}())?U0:function(i){return Kt(i)&&Et.call(i,"callee")&&!S0.call(i,"callee")},rt=ie.isArray,B4=rf?Ln(rf):YB;function nr(i){return i!=null&&Yf(i.length)&&!Qo(i)}function Wt(i){return Kt(i)&&nr(i)}function z4(i){return i===!0||i===!1||Kt(i)&&Fn(i)==ue}var Pi=nB||oy,V4=of?Ln(of):JB;function K4(i){return Kt(i)&&i.nodeType===1&&!El(i)}function G4(i){if(i==null)return!0;if(nr(i)&&(rt(i)||typeof i=="string"||typeof i.splice=="function"||Pi(i)||Fs(i)||Ea(i)))return!i.length;var c=An(i);if(c==nt||c==Y)return!i.size;if(Sl(i))return!xv(i).length;for(var f in i)if(Et.call(i,f))return!1;return!0}function j4(i,c){return Cl(i,c)}function W4(i,c,f){f=typeof f=="function"?f:n;var m=f?f(i,c):n;return m===n?Cl(i,c,n,f):!!m}function qv(i){if(!Kt(i))return!1;var c=Fn(i);return c==Pe||c==xe||typeof i.message=="string"&&typeof i.name=="string"&&!El(i)}function q4(i){return typeof i=="number"&&E0(i)}function Qo(i){if(!Bt(i))return!1;var c=Fn(i);return c==ae||c==Ze||c==z||c==en}function jA(i){return typeof i=="number"&&i==at(i)}function Yf(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=J}function Bt(i){var c=typeof i;return i!=null&&(c=="object"||c=="function")}function Kt(i){return i!=null&&typeof i=="object"}var WA=af?Ln(af):XB;function Y4(i,c){return i===c||Cv(i,c,Uv(c))}function J4(i,c,f){return f=typeof f=="function"?f:n,Cv(i,c,Uv(c),f)}function Q4(i){return qA(i)&&i!=+i}function X4(i){if(R5(i))throw new et(a);return $0(i)}function Z4(i){return i===null}function eV(i){return i==null}function qA(i){return typeof i=="number"||Kt(i)&&Fn(i)==Tt}function El(i){if(!Kt(i)||Fn(i)!=Ot)return!1;var c=xf(i);if(c===null)return!0;var f=Et.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&yf.call(f)==J3}var Yv=fa?Ln(fa):ZB;function tV(i){return jA(i)&&i>=-J&&i<=J}var YA=sf?Ln(sf):e5;function Jf(i){return typeof i=="string"||!rt(i)&&Kt(i)&&Fn(i)==se}function yr(i){return typeof i=="symbol"||Kt(i)&&Fn(i)==Ie}var Fs=cf?Ln(cf):t5;function nV(i){return i===n}function rV(i){return Kt(i)&&An(i)==ne}function oV(i){return Kt(i)&&Fn(i)==ke}var iV=Hf(_v),aV=Hf(function(i,c){return i<=c});function JA(i){if(!i)return[];if(nr(i))return Jf(i)?vt(i):tr(i);if(hl&&i[hl])return De(i[hl]());var c=An(i),f=c==nt?Ct:c==Y?ma:Us;return f(i)}function Xo(i){if(!i)return i===0?i:0;if(i=Pr(i),i===re||i===-re){var c=i<0?-1:1;return c*X}return i===i?i:0}function at(i){var c=Xo(i),f=c%1;return c===c?f?c-f:c:0}function QA(i){return i?xa(at(i),0,te):0}function Pr(i){if(typeof i=="number")return i;if(yr(i))return U;if(Bt(i)){var c=typeof i.valueOf=="function"?i.valueOf():i;i=Bt(c)?c+"":c}if(typeof i!="string")return i===0?i:+i;i=fl(i);var f=ia.test(i);return f||qm.test(i)?xs(i.slice(2),f?2:8):zc.test(i)?U:+i}function XA(i){return xo(i,rr(i))}function sV(i){return i?xa(at(i),-J,J):i===0?i:0}function xt(i){return i==null?"":vr(i)}var cV=Ds(function(i,c){if(Sl(c)||nr(c)){xo(c,un(c),i);return}for(var f in c)Et.call(c,f)&&yl(i,f,c[f])}),ZA=Ds(function(i,c){xo(c,rr(c),i)}),Qf=Ds(function(i,c,f,m){xo(c,rr(c),i,m)}),lV=Ds(function(i,c,f,m){xo(c,un(c),i,m)}),dV=Yo(mv);function uV(i,c){var f=Ms(i);return c==null?f:P0(f,c)}var fV=dt(function(i,c){i=Rt(i);var f=-1,m=c.length,_=m>2?c[2]:n;for(_&&Un(c[0],c[1],_)&&(m=1);++f<m;)for(var I=c[f],D=rr(I),F=-1,j=D.length;++F<j;){var pe=D[F],me=i[pe];(me===n||to(me,Ns[pe])&&!Et.call(i,pe))&&(i[pe]=I[pe])}return i}),hV=dt(function(i){return i.push(n,mA),Sn(eI,n,i)});function pV(i,c){return uf(i,je(c,3),Co)}function gV(i,c){return uf(i,je(c,3),yv)}function mV(i,c){return i==null?i:vv(i,je(c,3),rr)}function vV(i,c){return i==null?i:L0(i,je(c,3),rr)}function yV(i,c){return i&&Co(i,je(c,3))}function wV(i,c){return i&&yv(i,je(c,3))}function bV(i){return i==null?[]:Of(i,un(i))}function CV(i){return i==null?[]:Of(i,rr(i))}function Jv(i,c,f){var m=i==null?n:_a(i,c);return m===n?f:m}function xV(i,c){return i!=null&&wA(i,c,GB)}function Qv(i,c){return i!=null&&wA(i,c,jB)}var _V=uA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=wf.call(c)),i[c]=f},Zv(or)),SV=uA(function(i,c,f){c!=null&&typeof c.toString!="function"&&(c=wf.call(c)),Et.call(i,c)?i[c].push(f):i[c]=[f]},je),TV=dt(bl);function un(i){return nr(i)?k0(i):xv(i)}function rr(i){return nr(i)?k0(i,!0):n5(i)}function EV(i,c){var f={};return c=je(c,3),Co(i,function(m,_,I){Wo(f,c(m,_,I),m)}),f}function AV(i,c){var f={};return c=je(c,3),Co(i,function(m,_,I){Wo(f,_,c(m,_,I))}),f}var IV=Ds(function(i,c,f){Mf(i,c,f)}),eI=Ds(function(i,c,f,m){Mf(i,c,f,m)}),kV=Yo(function(i,c){var f={};if(i==null)return f;var m=!1;c=Lt(c,function(I){return I=ki(I,i),m||(m=I.length>1),I}),xo(i,Lv(i),f),m&&(f=Ir(f,g|w|y,_5));for(var _=c.length;_--;)Iv(f,c[_]);return f});function NV(i,c){return tI(i,qf(je(c)))}var PV=Yo(function(i,c){return i==null?{}:o5(i,c)});function tI(i,c){if(i==null)return{};var f=Lt(Lv(i),function(m){return[m]});return c=je(c),j0(i,f,function(m,_){return c(m,_[0])})}function OV(i,c,f){c=ki(c,i);var m=-1,_=c.length;for(_||(_=1,i=n);++m<_;){var I=i==null?n:i[_o(c[m])];I===n&&(m=_,I=f),i=Qo(I)?I.call(i):I}return i}function MV(i,c,f){return i==null?i:xl(i,c,f)}function DV(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:xl(i,c,f,m)}var nI=pA(un),rI=pA(rr);function RV(i,c,f){var m=rt(i),_=m||Pi(i)||Fs(i);if(c=je(c,4),f==null){var I=i&&i.constructor;_?f=m?new I:[]:Bt(i)?f=Qo(I)?Ms(xf(i)):{}:f={}}return(_?Qn:Co)(i,function(D,F,j){return c(f,D,F,j)}),f}function LV(i,c){return i==null?!0:Iv(i,c)}function FV(i,c,f){return i==null?i:Q0(i,c,Pv(f))}function UV(i,c,f,m){return m=typeof m=="function"?m:n,i==null?i:Q0(i,c,Pv(f),m)}function Us(i){return i==null?[]:Zr(i,un(i))}function $V(i){return i==null?[]:Zr(i,rr(i))}function HV(i,c,f){return f===n&&(f=c,c=n),f!==n&&(f=Pr(f),f=f===f?f:0),c!==n&&(c=Pr(c),c=c===c?c:0),xa(Pr(i),c,f)}function BV(i,c,f){return c=Xo(c),f===n?(f=c,c=0):f=Xo(f),i=Pr(i),WB(i,c,f)}function zV(i,c,f){if(f&&typeof f!="boolean"&&Un(i,c,f)&&(c=f=n),f===n&&(typeof c=="boolean"?(f=c,c=n):typeof i=="boolean"&&(f=i,i=n)),i===n&&c===n?(i=0,c=1):(i=Xo(i),c===n?(c=i,i=0):c=Xo(c)),i>c){var m=i;i=c,c=m}if(f||i%1||c%1){var _=A0();return En(i+_*(c-i+rv("1e-"+((_+"").length-1))),c)}return Tv(i,c)}var VV=Rs(function(i,c,f){return c=c.toLowerCase(),i+(f?oI(c):c)});function oI(i){return Xv(xt(i).toLowerCase())}function iI(i){return i=xt(i),i&&i.replace(Vc,S).replace(Cs,"")}function KV(i,c,f){i=xt(i),c=vr(c);var m=i.length;f=f===n?m:xa(at(f),0,m);var _=f;return f-=c.length,f>=0&&i.slice(f,_)==c}function GV(i){return i=xt(i),i&&ta.test(i)?i.replace(Uc,P):i}function jV(i){return i=xt(i),i&&Wu.test(i)?i.replace($c,"\\$&"):i}var WV=Rs(function(i,c,f){return i+(f?"-":"")+c.toLowerCase()}),qV=Rs(function(i,c,f){return i+(f?" ":"")+c.toLowerCase()}),YV=cA("toLowerCase");function JV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;if(!c||m>=c)return i;var _=(c-m)/2;return $f(Ef(_),f)+i+$f(Tf(_),f)}function QV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;return c&&m<c?i+$f(c-m,f):i}function XV(i,c,f){i=xt(i),c=at(c);var m=c?er(i):0;return c&&m<c?$f(c-m,f)+i:i}function ZV(i,c,f){return f||c==null?c=0:c&&(c=+c),aB(xt(i).replace(Hc,""),c||0)}function eK(i,c,f){return(f?Un(i,c,f):c===n)?c=1:c=at(c),Ev(xt(i),c)}function tK(){var i=arguments,c=xt(i[0]);return i.length<3?c:c.replace(i[1],i[2])}var nK=Rs(function(i,c,f){return i+(f?"_":"")+c.toLowerCase()});function rK(i,c,f){return f&&typeof f!="number"&&Un(i,c,f)&&(c=f=n),f=f===n?te:f>>>0,f?(i=xt(i),i&&(typeof c=="string"||c!=null&&!Yv(c))&&(c=vr(c),!c&&ye(i))?Ni(vt(i),0,f):i.split(c,f)):[]}var oK=Rs(function(i,c,f){return i+(f?" ":"")+Xv(c)});function iK(i,c,f){return i=xt(i),f=f==null?0:xa(at(f),0,i.length),c=vr(c),i.slice(f,f+c.length)==c}function aK(i,c,f){var m=E.templateSettings;f&&Un(i,c,f)&&(c=n),i=xt(i),c=Qf({},c,m,gA);var _=Qf({},c.imports,m.imports,gA),I=un(_),D=Zr(_,I),F,j,pe=0,me=c.interpolate||Kc,we="__p += '",Oe=uv((c.escape||Kc).source+"|"+me.source+"|"+(me===Gu?Ho:Kc).source+"|"+(c.evaluate||Kc).source+"|$","g"),He="//# sourceURL="+(Et.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++il+"]")+`
82
+ `;i.replace(Oe,function(Ye,ut,ht,wr,$n,br){return ht||(ht=wr),we+=i.slice(pe,br).replace(Ym,B),ut&&(F=!0,we+=`' +
83
83
  __e(`+ut+`) +
84
- '`),Hn&&(j=!0,we+=`';
85
- `+Hn+`;
84
+ '`),$n&&(j=!0,we+=`';
85
+ `+$n+`;
86
86
  __p += '`),ht&&(we+=`' +
87
87
  ((__t = (`+ht+`)) == null ? '' : __t) +
88
88
  '`),pe=br+Ye.length,Ye}),we+=`';
@@ -95,7 +95,7 @@ __p += '`),ht&&(we+=`' +
95
95
  function print() { __p += __j.call(arguments, '') }
96
96
  `:`;
97
97
  `)+we+`return __p
98
- }`;var ct=sI(function(){return yt(I,He+"return "+we).apply(n,D)});if(ct.source=we,qv(ct))throw ct;return ct}function sK(i){return xt(i).toLowerCase()}function cK(i){return xt(i).toUpperCase()}function lK(i,c,f){if(i=xt(i),i&&(f||c===n))return fl(i);if(!i||!(c=vr(c)))return i;var m=vt(i),_=vt(c),I=ga(m,_),D=hf(m,_)+1;return Ni(m,I,D).join("")}function dK(i,c,f){if(i=xt(i),i&&(f||c===n))return i.slice(0,yn(i)+1);if(!i||!(c=vr(c)))return i;var m=vt(i),_=hf(m,vt(c))+1;return Ni(m,0,_).join("")}function uK(i,c,f){if(i=xt(i),i&&(f||c===n))return i.replace(Hc,"");if(!i||!(c=vr(c)))return i;var m=vt(i),_=ga(m,vt(c));return Ni(m,_).join("")}function fK(i,c){var f=q,m=de;if(Bt(c)){var _="separator"in c?c.separator:_;f="length"in c?at(c.length):f,m="omission"in c?vr(c.omission):m}i=xt(i);var I=i.length;if(ye(i)){var D=vt(i);I=D.length}if(f>=I)return i;var F=f-er(m);if(F<1)return m;var j=D?Ni(D,0,F).join(""):i.slice(0,F);if(_===n)return j+m;if(D&&(F+=j.length-F),Yv(_)){if(i.slice(F).search(_)){var pe,me=j;for(_.global||(_=uv(_.source,xt(Bc.exec(_))+"g")),_.lastIndex=0;pe=_.exec(me);)var we=pe.index;j=j.slice(0,we===n?F:we)}}else if(i.indexOf(vr(_),F)!=F){var Oe=j.lastIndexOf(_);Oe>-1&&(j=j.slice(0,Oe))}return j+m}function hK(i){return i=xt(i),i&&wo.test(i)?i.replace($o,ya):i}var pK=Rs(function(i,c,f){return i+(f?" ":"")+c.toUpperCase()}),Xv=cA("toUpperCase");function aI(i,c,f){return i=xt(i),c=f?n:c,c===n?Se(i)?G3(i):Ss(i):i.match(c)||[]}var sI=dt(function(i,c){try{return Sn(i,n,c)}catch(f){return qv(f)?f:new et(f)}}),gK=Yo(function(i,c){return Qn(c,function(f){f=_o(f),Wo(i,f,jv(i[f],i))}),i});function mK(i){var c=i==null?0:i.length,f=je();return i=c?Lt(i,function(m){if(typeof m[1]!="function")throw new Er(s);return[f(m[0]),m[1]]}):[],dt(function(m){for(var _=-1;++_<c;){var I=i[_];if(Sn(I[0],this,m))return Sn(I[1],this,m)}})}function vK(i){return zB(Ir(i,g))}function Zv(i){return function(){return i}}function yK(i,c){return i==null||i!==i?c:i}var wK=dA(),bK=dA(!0);function or(i){return i}function ey(i){return H0(typeof i=="function"?i:Ir(i,g))}function CK(i){return z0(Ir(i,g))}function xK(i,c){return V0(i,Ir(c,g))}var _K=dt(function(i,c){return function(f){return bl(f,i,c)}}),SK=dt(function(i,c){return function(f){return bl(i,f,c)}});function ty(i,c,f){var m=un(c),_=Of(c,m);f==null&&!(Bt(c)&&(_.length||!m.length))&&(f=c,c=i,i=this,_=Of(c,un(c)));var I=!(Bt(f)&&"chain"in f)||!!f.chain,D=Qo(i);return Qn(_,function(F){var j=c[F];i[F]=j,D&&(i.prototype[F]=function(){var pe=this.__chain__;if(I||pe){var me=i(this.__wrapped__),we=me.__actions__=tr(this.__actions__);return we.push({func:j,args:arguments,thisArg:i}),me.__chain__=pe,me}return j.apply(i,Tn([this.value()],arguments))})}),i}function TK(){return nn._===this&&(nn._=Q3),this}function ny(){}function EK(i){return i=at(i),dt(function(c){return K0(c,i)})}var AK=Mv(Lt),IK=Mv(lf),kK=Mv(ha);function cI(i){return Hv(i)?Es(_o(i)):i5(i)}function NK(i){return function(c){return i==null?n:_a(i,c)}}var PK=fA(),OK=fA(!0);function ry(){return[]}function oy(){return!1}function MK(){return{}}function DK(){return""}function RK(){return!0}function LK(i,c){if(i=at(i),i<1||i>J)return[];var f=te,m=En(i,te);c=je(c),i-=te;for(var _=As(m,c);++f<i;)c(f);return _}function FK(i){return rt(i)?Lt(i,_o):yr(i)?[i]:tr(IA(xt(i)))}function UK(i){var c=++Y3;return xt(i)+c}var $K=Uf(function(i,c){return i+c},0),HK=Dv("ceil"),BK=Uf(function(i,c){return i/c},1),zK=Dv("floor");function VK(i){return i&&i.length?Pf(i,or,wv):n}function KK(i,c){return i&&i.length?Pf(i,je(c,2),wv):n}function GK(i){return ff(i,or)}function jK(i,c){return ff(i,je(c,2))}function WK(i){return i&&i.length?Pf(i,or,_v):n}function qK(i,c){return i&&i.length?Pf(i,je(c,2),_v):n}var YK=Uf(function(i,c){return i*c},1),JK=Dv("round"),QK=Uf(function(i,c){return i-c},0);function XK(i){return i&&i.length?ul(i,or):0}function ZK(i,c){return i&&i.length?ul(i,je(c,2)):0}return E.after=C4,E.ary=$A,E.assign=cV,E.assignIn=ZA,E.assignInWith=Qf,E.assignWith=lV,E.at=dV,E.before=HA,E.bind=jv,E.bindAll=gK,E.bindKey=BA,E.castArray=M4,E.chain=LA,E.chunk=z5,E.compact=V5,E.concat=K5,E.cond=mK,E.conforms=vK,E.constant=Zv,E.countBy=Xz,E.create=uV,E.curry=zA,E.curryRight=VA,E.debounce=KA,E.defaults=fV,E.defaultsDeep=hV,E.defer=x4,E.delay=_4,E.difference=G5,E.differenceBy=j5,E.differenceWith=W5,E.drop=q5,E.dropRight=Y5,E.dropRightWhile=J5,E.dropWhile=Q5,E.fill=X5,E.filter=e4,E.flatMap=r4,E.flatMapDeep=o4,E.flatMapDepth=i4,E.flatten=OA,E.flattenDeep=Z5,E.flattenDepth=ez,E.flip=S4,E.flow=wK,E.flowRight=bK,E.fromPairs=tz,E.functions=bV,E.functionsIn=CV,E.groupBy=a4,E.initial=rz,E.intersection=oz,E.intersectionBy=iz,E.intersectionWith=az,E.invert=_V,E.invertBy=SV,E.invokeMap=c4,E.iteratee=ey,E.keyBy=l4,E.keys=un,E.keysIn=rr,E.map=Gf,E.mapKeys=EV,E.mapValues=AV,E.matches=CK,E.matchesProperty=xK,E.memoize=Wf,E.merge=IV,E.mergeWith=eI,E.method=_K,E.methodOf=SK,E.mixin=ty,E.negate=qf,E.nthArg=EK,E.omit=kV,E.omitBy=NV,E.once=T4,E.orderBy=d4,E.over=AK,E.overArgs=E4,E.overEvery=IK,E.overSome=kK,E.partial=Wv,E.partialRight=GA,E.partition=u4,E.pick=PV,E.pickBy=tI,E.property=cI,E.propertyOf=NK,E.pull=dz,E.pullAll=DA,E.pullAllBy=uz,E.pullAllWith=fz,E.pullAt=hz,E.range=PK,E.rangeRight=OK,E.rearg=A4,E.reject=p4,E.remove=pz,E.rest=I4,E.reverse=Kv,E.sampleSize=m4,E.set=MV,E.setWith=DV,E.shuffle=v4,E.slice=gz,E.sortBy=b4,E.sortedUniq=xz,E.sortedUniqBy=_z,E.split=rK,E.spread=k4,E.tail=Sz,E.take=Tz,E.takeRight=Ez,E.takeRightWhile=Az,E.takeWhile=Iz,E.tap=Vz,E.throttle=N4,E.thru=Kf,E.toArray=JA,E.toPairs=nI,E.toPairsIn=rI,E.toPath=FK,E.toPlainObject=XA,E.transform=RV,E.unary=P4,E.union=kz,E.unionBy=Nz,E.unionWith=Pz,E.uniq=Oz,E.uniqBy=Mz,E.uniqWith=Dz,E.unset=LV,E.unzip=Gv,E.unzipWith=RA,E.update=FV,E.updateWith=UV,E.values=Us,E.valuesIn=$V,E.without=Rz,E.words=aI,E.wrap=O4,E.xor=Lz,E.xorBy=Fz,E.xorWith=Uz,E.zip=$z,E.zipObject=Hz,E.zipObjectDeep=Bz,E.zipWith=zz,E.entries=nI,E.entriesIn=rI,E.extend=ZA,E.extendWith=Qf,ty(E,E),E.add=$K,E.attempt=sI,E.camelCase=VV,E.capitalize=oI,E.ceil=HK,E.clamp=HV,E.clone=D4,E.cloneDeep=L4,E.cloneDeepWith=F4,E.cloneWith=R4,E.conformsTo=U4,E.deburr=iI,E.defaultTo=yK,E.divide=BK,E.endsWith=KV,E.eq=to,E.escape=GV,E.escapeRegExp=jV,E.every=Zz,E.find=t4,E.findIndex=NA,E.findKey=pV,E.findLast=n4,E.findLastIndex=PA,E.findLastKey=gV,E.floor=zK,E.forEach=FA,E.forEachRight=UA,E.forIn=mV,E.forInRight=vV,E.forOwn=yV,E.forOwnRight=wV,E.get=Jv,E.gt=$4,E.gte=H4,E.has=xV,E.hasIn=Qv,E.head=MA,E.identity=or,E.includes=s4,E.indexOf=nz,E.inRange=BV,E.invoke=TV,E.isArguments=Ea,E.isArray=rt,E.isArrayBuffer=B4,E.isArrayLike=nr,E.isArrayLikeObject=jt,E.isBoolean=z4,E.isBuffer=Pi,E.isDate=V4,E.isElement=K4,E.isEmpty=G4,E.isEqual=j4,E.isEqualWith=W4,E.isError=qv,E.isFinite=q4,E.isFunction=Qo,E.isInteger=jA,E.isLength=Yf,E.isMap=WA,E.isMatch=Y4,E.isMatchWith=J4,E.isNaN=Q4,E.isNative=X4,E.isNil=eV,E.isNull=Z4,E.isNumber=qA,E.isObject=Bt,E.isObjectLike=Kt,E.isPlainObject=El,E.isRegExp=Yv,E.isSafeInteger=tV,E.isSet=YA,E.isString=Jf,E.isSymbol=yr,E.isTypedArray=Fs,E.isUndefined=nV,E.isWeakMap=rV,E.isWeakSet=oV,E.join=sz,E.kebabCase=WV,E.last=Nr,E.lastIndexOf=cz,E.lowerCase=qV,E.lowerFirst=YV,E.lt=iV,E.lte=aV,E.max=VK,E.maxBy=KK,E.mean=GK,E.meanBy=jK,E.min=WK,E.minBy=qK,E.stubArray=ry,E.stubFalse=oy,E.stubObject=MK,E.stubString=DK,E.stubTrue=RK,E.multiply=YK,E.nth=lz,E.noConflict=TK,E.noop=ny,E.now=jf,E.pad=JV,E.padEnd=QV,E.padStart=XV,E.parseInt=ZV,E.random=zV,E.reduce=f4,E.reduceRight=h4,E.repeat=eK,E.replace=tK,E.result=OV,E.round=JK,E.runInContext=V,E.sample=g4,E.size=y4,E.snakeCase=nK,E.some=w4,E.sortedIndex=mz,E.sortedIndexBy=vz,E.sortedIndexOf=yz,E.sortedLastIndex=wz,E.sortedLastIndexBy=bz,E.sortedLastIndexOf=Cz,E.startCase=oK,E.startsWith=iK,E.subtract=QK,E.sum=XK,E.sumBy=ZK,E.template=aK,E.times=LK,E.toFinite=Xo,E.toInteger=at,E.toLength=QA,E.toLower=sK,E.toNumber=Pr,E.toSafeInteger=sV,E.toString=xt,E.toUpper=cK,E.trim=lK,E.trimEnd=dK,E.trimStart=uK,E.truncate=fK,E.unescape=hK,E.uniqueId=UK,E.upperCase=pK,E.upperFirst=Xv,E.each=FA,E.eachRight=UA,E.first=MA,ty(E,function(){var i={};return Co(E,function(c,f){Et.call(E.prototype,f)||(i[f]=c)}),i}(),{chain:!1}),E.VERSION=r,Qn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){E[i].placeholder=E}),Qn(["drop","take"],function(i,c){ft.prototype[i]=function(f){f=f===n?1:on(at(f),0);var m=this.__filtered__&&!c?new ft(this):this.clone();return m.__filtered__?m.__takeCount__=En(f,m.__takeCount__):m.__views__.push({size:En(f,te),type:i+(m.__dir__<0?"Right":"")}),m},ft.prototype[i+"Right"]=function(f){return this.reverse()[i](f).reverse()}}),Qn(["filter","map","takeWhile"],function(i,c){var f=c+1,m=f==K||f==G;ft.prototype[i]=function(_){var I=this.clone();return I.__iteratees__.push({iteratee:je(_,3),type:f}),I.__filtered__=I.__filtered__||m,I}}),Qn(["head","last"],function(i,c){var f="take"+(c?"Right":"");ft.prototype[i]=function(){return this[f](1).value()[0]}}),Qn(["initial","tail"],function(i,c){var f="drop"+(c?"":"Right");ft.prototype[i]=function(){return this.__filtered__?new ft(this):this[f](1)}}),ft.prototype.compact=function(){return this.filter(or)},ft.prototype.find=function(i){return this.filter(i).head()},ft.prototype.findLast=function(i){return this.reverse().find(i)},ft.prototype.invokeMap=dt(function(i,c){return typeof i=="function"?new ft(this):this.map(function(f){return bl(f,i,c)})}),ft.prototype.reject=function(i){return this.filter(qf(je(i)))},ft.prototype.slice=function(i,c){i=at(i);var f=this;return f.__filtered__&&(i>0||c<0)?new ft(f):(i<0?f=f.takeRight(-i):i&&(f=f.drop(i)),c!==n&&(c=at(c),f=c<0?f.dropRight(-c):f.take(c-i)),f)},ft.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},ft.prototype.toArray=function(){return this.take(te)},Co(ft.prototype,function(i,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),m=/^(?:head|last)$/.test(c),_=E[m?"take"+(c=="last"?"Right":""):c],I=m||/^find/.test(c);_&&(E.prototype[c]=function(){var D=this.__wrapped__,F=m?[1]:arguments,j=D instanceof ft,pe=F[0],me=j||rt(D),we=function(ut){var ht=_.apply(E,Tn([ut],F));return m&&Oe?ht[0]:ht};me&&f&&typeof pe=="function"&&pe.length!=1&&(j=me=!1);var Oe=this.__chain__,He=!!this.__actions__.length,qe=I&&!Oe,ct=j&&!He;if(!I&&me){D=ct?D:new ft(this);var Ye=i.apply(D,F);return Ye.__actions__.push({func:Kf,args:[we],thisArg:n}),new Ar(Ye,Oe)}return qe&&ct?i.apply(this,F):(Ye=this.thru(we),qe?m?Ye.value()[0]:Ye.value():Ye)})}),Qn(["pop","push","shift","sort","splice","unshift"],function(i){var c=mf[i],f=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",m=/^(?:pop|shift)$/.test(i);E.prototype[i]=function(){var _=arguments;if(m&&!this.__chain__){var I=this.value();return c.apply(rt(I)?I:[],_)}return this[f](function(D){return c.apply(rt(D)?D:[],_)})}}),Co(ft.prototype,function(i,c){var f=E[c];if(f){var m=f.name+"";Et.call(Os,m)||(Os[m]=[]),Os[m].push({name:c,func:f})}}),Os[Ff(n,k).name]=[{name:"wrapper",func:n}],ft.prototype.clone=hB,ft.prototype.reverse=pB,ft.prototype.value=gB,E.prototype.at=Kz,E.prototype.chain=Gz,E.prototype.commit=jz,E.prototype.next=Wz,E.prototype.plant=Yz,E.prototype.reverse=Jz,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=Qz,E.prototype.first=E.prototype.head,hl&&(E.prototype[hl]=qz),E},ks=j3();Vo?((Vo.exports=ks)._=ks,_s._=ks):nn._=ks}).call(so)}(Fd,Fd.exports);var Ud=Fd.exports;/**
98
+ }`;var ct=sI(function(){return yt(I,He+"return "+we).apply(n,D)});if(ct.source=we,qv(ct))throw ct;return ct}function sK(i){return xt(i).toLowerCase()}function cK(i){return xt(i).toUpperCase()}function lK(i,c,f){if(i=xt(i),i&&(f||c===n))return fl(i);if(!i||!(c=vr(c)))return i;var m=vt(i),_=vt(c),I=ga(m,_),D=hf(m,_)+1;return Ni(m,I,D).join("")}function dK(i,c,f){if(i=xt(i),i&&(f||c===n))return i.slice(0,yn(i)+1);if(!i||!(c=vr(c)))return i;var m=vt(i),_=hf(m,vt(c))+1;return Ni(m,0,_).join("")}function uK(i,c,f){if(i=xt(i),i&&(f||c===n))return i.replace(Hc,"");if(!i||!(c=vr(c)))return i;var m=vt(i),_=ga(m,vt(c));return Ni(m,_).join("")}function fK(i,c){var f=q,m=de;if(Bt(c)){var _="separator"in c?c.separator:_;f="length"in c?at(c.length):f,m="omission"in c?vr(c.omission):m}i=xt(i);var I=i.length;if(ye(i)){var D=vt(i);I=D.length}if(f>=I)return i;var F=f-er(m);if(F<1)return m;var j=D?Ni(D,0,F).join(""):i.slice(0,F);if(_===n)return j+m;if(D&&(F+=j.length-F),Yv(_)){if(i.slice(F).search(_)){var pe,me=j;for(_.global||(_=uv(_.source,xt(Bc.exec(_))+"g")),_.lastIndex=0;pe=_.exec(me);)var we=pe.index;j=j.slice(0,we===n?F:we)}}else if(i.indexOf(vr(_),F)!=F){var Oe=j.lastIndexOf(_);Oe>-1&&(j=j.slice(0,Oe))}return j+m}function hK(i){return i=xt(i),i&&wo.test(i)?i.replace($o,ya):i}var pK=Rs(function(i,c,f){return i+(f?" ":"")+c.toUpperCase()}),Xv=cA("toUpperCase");function aI(i,c,f){return i=xt(i),c=f?n:c,c===n?Se(i)?G3(i):Ss(i):i.match(c)||[]}var sI=dt(function(i,c){try{return Sn(i,n,c)}catch(f){return qv(f)?f:new et(f)}}),gK=Yo(function(i,c){return Qn(c,function(f){f=_o(f),Wo(i,f,jv(i[f],i))}),i});function mK(i){var c=i==null?0:i.length,f=je();return i=c?Lt(i,function(m){if(typeof m[1]!="function")throw new Er(s);return[f(m[0]),m[1]]}):[],dt(function(m){for(var _=-1;++_<c;){var I=i[_];if(Sn(I[0],this,m))return Sn(I[1],this,m)}})}function vK(i){return zB(Ir(i,g))}function Zv(i){return function(){return i}}function yK(i,c){return i==null||i!==i?c:i}var wK=dA(),bK=dA(!0);function or(i){return i}function ey(i){return H0(typeof i=="function"?i:Ir(i,g))}function CK(i){return z0(Ir(i,g))}function xK(i,c){return V0(i,Ir(c,g))}var _K=dt(function(i,c){return function(f){return bl(f,i,c)}}),SK=dt(function(i,c){return function(f){return bl(i,f,c)}});function ty(i,c,f){var m=un(c),_=Of(c,m);f==null&&!(Bt(c)&&(_.length||!m.length))&&(f=c,c=i,i=this,_=Of(c,un(c)));var I=!(Bt(f)&&"chain"in f)||!!f.chain,D=Qo(i);return Qn(_,function(F){var j=c[F];i[F]=j,D&&(i.prototype[F]=function(){var pe=this.__chain__;if(I||pe){var me=i(this.__wrapped__),we=me.__actions__=tr(this.__actions__);return we.push({func:j,args:arguments,thisArg:i}),me.__chain__=pe,me}return j.apply(i,Tn([this.value()],arguments))})}),i}function TK(){return nn._===this&&(nn._=Q3),this}function ny(){}function EK(i){return i=at(i),dt(function(c){return K0(c,i)})}var AK=Mv(Lt),IK=Mv(lf),kK=Mv(ha);function cI(i){return Hv(i)?Es(_o(i)):i5(i)}function NK(i){return function(c){return i==null?n:_a(i,c)}}var PK=fA(),OK=fA(!0);function ry(){return[]}function oy(){return!1}function MK(){return{}}function DK(){return""}function RK(){return!0}function LK(i,c){if(i=at(i),i<1||i>J)return[];var f=te,m=En(i,te);c=je(c),i-=te;for(var _=As(m,c);++f<i;)c(f);return _}function FK(i){return rt(i)?Lt(i,_o):yr(i)?[i]:tr(IA(xt(i)))}function UK(i){var c=++Y3;return xt(i)+c}var $K=Uf(function(i,c){return i+c},0),HK=Dv("ceil"),BK=Uf(function(i,c){return i/c},1),zK=Dv("floor");function VK(i){return i&&i.length?Pf(i,or,wv):n}function KK(i,c){return i&&i.length?Pf(i,je(c,2),wv):n}function GK(i){return ff(i,or)}function jK(i,c){return ff(i,je(c,2))}function WK(i){return i&&i.length?Pf(i,or,_v):n}function qK(i,c){return i&&i.length?Pf(i,je(c,2),_v):n}var YK=Uf(function(i,c){return i*c},1),JK=Dv("round"),QK=Uf(function(i,c){return i-c},0);function XK(i){return i&&i.length?ul(i,or):0}function ZK(i,c){return i&&i.length?ul(i,je(c,2)):0}return E.after=C4,E.ary=$A,E.assign=cV,E.assignIn=ZA,E.assignInWith=Qf,E.assignWith=lV,E.at=dV,E.before=HA,E.bind=jv,E.bindAll=gK,E.bindKey=BA,E.castArray=M4,E.chain=LA,E.chunk=z5,E.compact=V5,E.concat=K5,E.cond=mK,E.conforms=vK,E.constant=Zv,E.countBy=Xz,E.create=uV,E.curry=zA,E.curryRight=VA,E.debounce=KA,E.defaults=fV,E.defaultsDeep=hV,E.defer=x4,E.delay=_4,E.difference=G5,E.differenceBy=j5,E.differenceWith=W5,E.drop=q5,E.dropRight=Y5,E.dropRightWhile=J5,E.dropWhile=Q5,E.fill=X5,E.filter=e4,E.flatMap=r4,E.flatMapDeep=o4,E.flatMapDepth=i4,E.flatten=OA,E.flattenDeep=Z5,E.flattenDepth=ez,E.flip=S4,E.flow=wK,E.flowRight=bK,E.fromPairs=tz,E.functions=bV,E.functionsIn=CV,E.groupBy=a4,E.initial=rz,E.intersection=oz,E.intersectionBy=iz,E.intersectionWith=az,E.invert=_V,E.invertBy=SV,E.invokeMap=c4,E.iteratee=ey,E.keyBy=l4,E.keys=un,E.keysIn=rr,E.map=Gf,E.mapKeys=EV,E.mapValues=AV,E.matches=CK,E.matchesProperty=xK,E.memoize=Wf,E.merge=IV,E.mergeWith=eI,E.method=_K,E.methodOf=SK,E.mixin=ty,E.negate=qf,E.nthArg=EK,E.omit=kV,E.omitBy=NV,E.once=T4,E.orderBy=d4,E.over=AK,E.overArgs=E4,E.overEvery=IK,E.overSome=kK,E.partial=Wv,E.partialRight=GA,E.partition=u4,E.pick=PV,E.pickBy=tI,E.property=cI,E.propertyOf=NK,E.pull=dz,E.pullAll=DA,E.pullAllBy=uz,E.pullAllWith=fz,E.pullAt=hz,E.range=PK,E.rangeRight=OK,E.rearg=A4,E.reject=p4,E.remove=pz,E.rest=I4,E.reverse=Kv,E.sampleSize=m4,E.set=MV,E.setWith=DV,E.shuffle=v4,E.slice=gz,E.sortBy=b4,E.sortedUniq=xz,E.sortedUniqBy=_z,E.split=rK,E.spread=k4,E.tail=Sz,E.take=Tz,E.takeRight=Ez,E.takeRightWhile=Az,E.takeWhile=Iz,E.tap=Vz,E.throttle=N4,E.thru=Kf,E.toArray=JA,E.toPairs=nI,E.toPairsIn=rI,E.toPath=FK,E.toPlainObject=XA,E.transform=RV,E.unary=P4,E.union=kz,E.unionBy=Nz,E.unionWith=Pz,E.uniq=Oz,E.uniqBy=Mz,E.uniqWith=Dz,E.unset=LV,E.unzip=Gv,E.unzipWith=RA,E.update=FV,E.updateWith=UV,E.values=Us,E.valuesIn=$V,E.without=Rz,E.words=aI,E.wrap=O4,E.xor=Lz,E.xorBy=Fz,E.xorWith=Uz,E.zip=$z,E.zipObject=Hz,E.zipObjectDeep=Bz,E.zipWith=zz,E.entries=nI,E.entriesIn=rI,E.extend=ZA,E.extendWith=Qf,ty(E,E),E.add=$K,E.attempt=sI,E.camelCase=VV,E.capitalize=oI,E.ceil=HK,E.clamp=HV,E.clone=D4,E.cloneDeep=L4,E.cloneDeepWith=F4,E.cloneWith=R4,E.conformsTo=U4,E.deburr=iI,E.defaultTo=yK,E.divide=BK,E.endsWith=KV,E.eq=to,E.escape=GV,E.escapeRegExp=jV,E.every=Zz,E.find=t4,E.findIndex=NA,E.findKey=pV,E.findLast=n4,E.findLastIndex=PA,E.findLastKey=gV,E.floor=zK,E.forEach=FA,E.forEachRight=UA,E.forIn=mV,E.forInRight=vV,E.forOwn=yV,E.forOwnRight=wV,E.get=Jv,E.gt=$4,E.gte=H4,E.has=xV,E.hasIn=Qv,E.head=MA,E.identity=or,E.includes=s4,E.indexOf=nz,E.inRange=BV,E.invoke=TV,E.isArguments=Ea,E.isArray=rt,E.isArrayBuffer=B4,E.isArrayLike=nr,E.isArrayLikeObject=Wt,E.isBoolean=z4,E.isBuffer=Pi,E.isDate=V4,E.isElement=K4,E.isEmpty=G4,E.isEqual=j4,E.isEqualWith=W4,E.isError=qv,E.isFinite=q4,E.isFunction=Qo,E.isInteger=jA,E.isLength=Yf,E.isMap=WA,E.isMatch=Y4,E.isMatchWith=J4,E.isNaN=Q4,E.isNative=X4,E.isNil=eV,E.isNull=Z4,E.isNumber=qA,E.isObject=Bt,E.isObjectLike=Kt,E.isPlainObject=El,E.isRegExp=Yv,E.isSafeInteger=tV,E.isSet=YA,E.isString=Jf,E.isSymbol=yr,E.isTypedArray=Fs,E.isUndefined=nV,E.isWeakMap=rV,E.isWeakSet=oV,E.join=sz,E.kebabCase=WV,E.last=Nr,E.lastIndexOf=cz,E.lowerCase=qV,E.lowerFirst=YV,E.lt=iV,E.lte=aV,E.max=VK,E.maxBy=KK,E.mean=GK,E.meanBy=jK,E.min=WK,E.minBy=qK,E.stubArray=ry,E.stubFalse=oy,E.stubObject=MK,E.stubString=DK,E.stubTrue=RK,E.multiply=YK,E.nth=lz,E.noConflict=TK,E.noop=ny,E.now=jf,E.pad=JV,E.padEnd=QV,E.padStart=XV,E.parseInt=ZV,E.random=zV,E.reduce=f4,E.reduceRight=h4,E.repeat=eK,E.replace=tK,E.result=OV,E.round=JK,E.runInContext=V,E.sample=g4,E.size=y4,E.snakeCase=nK,E.some=w4,E.sortedIndex=mz,E.sortedIndexBy=vz,E.sortedIndexOf=yz,E.sortedLastIndex=wz,E.sortedLastIndexBy=bz,E.sortedLastIndexOf=Cz,E.startCase=oK,E.startsWith=iK,E.subtract=QK,E.sum=XK,E.sumBy=ZK,E.template=aK,E.times=LK,E.toFinite=Xo,E.toInteger=at,E.toLength=QA,E.toLower=sK,E.toNumber=Pr,E.toSafeInteger=sV,E.toString=xt,E.toUpper=cK,E.trim=lK,E.trimEnd=dK,E.trimStart=uK,E.truncate=fK,E.unescape=hK,E.uniqueId=UK,E.upperCase=pK,E.upperFirst=Xv,E.each=FA,E.eachRight=UA,E.first=MA,ty(E,function(){var i={};return Co(E,function(c,f){Et.call(E.prototype,f)||(i[f]=c)}),i}(),{chain:!1}),E.VERSION=r,Qn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){E[i].placeholder=E}),Qn(["drop","take"],function(i,c){ft.prototype[i]=function(f){f=f===n?1:on(at(f),0);var m=this.__filtered__&&!c?new ft(this):this.clone();return m.__filtered__?m.__takeCount__=En(f,m.__takeCount__):m.__views__.push({size:En(f,te),type:i+(m.__dir__<0?"Right":"")}),m},ft.prototype[i+"Right"]=function(f){return this.reverse()[i](f).reverse()}}),Qn(["filter","map","takeWhile"],function(i,c){var f=c+1,m=f==K||f==G;ft.prototype[i]=function(_){var I=this.clone();return I.__iteratees__.push({iteratee:je(_,3),type:f}),I.__filtered__=I.__filtered__||m,I}}),Qn(["head","last"],function(i,c){var f="take"+(c?"Right":"");ft.prototype[i]=function(){return this[f](1).value()[0]}}),Qn(["initial","tail"],function(i,c){var f="drop"+(c?"":"Right");ft.prototype[i]=function(){return this.__filtered__?new ft(this):this[f](1)}}),ft.prototype.compact=function(){return this.filter(or)},ft.prototype.find=function(i){return this.filter(i).head()},ft.prototype.findLast=function(i){return this.reverse().find(i)},ft.prototype.invokeMap=dt(function(i,c){return typeof i=="function"?new ft(this):this.map(function(f){return bl(f,i,c)})}),ft.prototype.reject=function(i){return this.filter(qf(je(i)))},ft.prototype.slice=function(i,c){i=at(i);var f=this;return f.__filtered__&&(i>0||c<0)?new ft(f):(i<0?f=f.takeRight(-i):i&&(f=f.drop(i)),c!==n&&(c=at(c),f=c<0?f.dropRight(-c):f.take(c-i)),f)},ft.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},ft.prototype.toArray=function(){return this.take(te)},Co(ft.prototype,function(i,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),m=/^(?:head|last)$/.test(c),_=E[m?"take"+(c=="last"?"Right":""):c],I=m||/^find/.test(c);_&&(E.prototype[c]=function(){var D=this.__wrapped__,F=m?[1]:arguments,j=D instanceof ft,pe=F[0],me=j||rt(D),we=function(ut){var ht=_.apply(E,Tn([ut],F));return m&&Oe?ht[0]:ht};me&&f&&typeof pe=="function"&&pe.length!=1&&(j=me=!1);var Oe=this.__chain__,He=!!this.__actions__.length,qe=I&&!Oe,ct=j&&!He;if(!I&&me){D=ct?D:new ft(this);var Ye=i.apply(D,F);return Ye.__actions__.push({func:Kf,args:[we],thisArg:n}),new Ar(Ye,Oe)}return qe&&ct?i.apply(this,F):(Ye=this.thru(we),qe?m?Ye.value()[0]:Ye.value():Ye)})}),Qn(["pop","push","shift","sort","splice","unshift"],function(i){var c=mf[i],f=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",m=/^(?:pop|shift)$/.test(i);E.prototype[i]=function(){var _=arguments;if(m&&!this.__chain__){var I=this.value();return c.apply(rt(I)?I:[],_)}return this[f](function(D){return c.apply(rt(D)?D:[],_)})}}),Co(ft.prototype,function(i,c){var f=E[c];if(f){var m=f.name+"";Et.call(Os,m)||(Os[m]=[]),Os[m].push({name:c,func:f})}}),Os[Ff(n,k).name]=[{name:"wrapper",func:n}],ft.prototype.clone=hB,ft.prototype.reverse=pB,ft.prototype.value=gB,E.prototype.at=Kz,E.prototype.chain=Gz,E.prototype.commit=jz,E.prototype.next=Wz,E.prototype.plant=Yz,E.prototype.reverse=Jz,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=Qz,E.prototype.first=E.prototype.head,hl&&(E.prototype[hl]=qz),E},ks=j3();Vo?((Vo.exports=ks)._=ks,_s._=ks):nn._=ks}).call(so)}(Fd,Fd.exports);var Ud=Fd.exports;/**
99
99
  * @license lucide-react v0.468.0 - ISC
100
100
  *
101
101
  * This source code is licensed under the ISC license.
@@ -206,12 +206,12 @@ function print() { __p += __j.call(arguments, '') }
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */const dg=sn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function wx(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=wx(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function bx(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=wx(t))&&(r&&(r+=" "),r+=e);return r}function JM(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}JM(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
209
- `);var ug=t=>typeof t=="number"&&!isNaN(t),cc=t=>typeof t=="string",Cx=t=>typeof t=="function",QM=t=>cc(t)||ug(t),XM=t=>M.isValidElement(t)||cc(t)||Cx(t)||ug(t),ZM=1,xx=()=>`${ZM++}`,co=new Map,fg=[],_x=new Set,Sx=()=>co.size>0,eD=(t,{containerId:e})=>{var n;return(n=co.get(e||1))==null?void 0:n.toasts.get(t)};function tD(t,e){var n;if(e)return!!((n=co.get(e))!=null&&n.isToastActive(t));let r=!1;return co.forEach(o=>{o.isToastActive(t)&&(r=!0)}),r}function nD(t){if(!Sx()){fg=fg.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||QM(t))co.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=co.get(t.containerId);e?e.removeToast(t.id):co.forEach(n=>{n.removeToast(t.id)})}}var rD=(t={})=>{co.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function oD(t,e){XM(t)&&(Sx()||fg.push({content:t,options:e}),co.forEach(n=>{n.buildToast(t,e)}))}function Tx(t,e){co.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function iD(t){return _x.add(t),()=>{_x.delete(t)}}function aD(t){return t&&(cc(t.toastId)||ug(t.toastId))?t.toastId:xx()}function lc(t,e){return oD(t,e),e.toastId}function $d(t,e){return{...e,type:e&&e.type||t,toastId:aD(e)}}function Hd(t){return(e,n)=>lc(e,$d(t,n))}function lt(t,e){return lc(t,$d("default",e))}lt.loading=(t,e)=>lc(t,$d("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function sD(t,{pending:e,error:n,success:r},o){let a;e&&(a=cc(e)?lt.loading(e,o):lt.loading(e.render,{...o,...e}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,p,g)=>{if(p==null){lt.dismiss(a);return}let w={type:h,...s,...o,data:g},y=cc(p)?{render:p}:p;return a?lt.update(a,{...w,...y}):lt(y.render,{...w,...y}),g},u=Cx(t)?t():t;return u.then(h=>l("success",r,h)).catch(h=>l("error",n,h)),u}lt.promise=sD,lt.success=Hd("success"),lt.info=Hd("info"),lt.error=Hd("error"),lt.warning=Hd("warning"),lt.warn=lt.warning,lt.dark=(t,e)=>lc(t,$d("default",{theme:"dark",...e}));function cD(t){nD(t)}lt.dismiss=cD,lt.clearWaitingQueue=rD,lt.isActive=tD,lt.update=(t,e={})=>{let n=eD(t,e);if(n){let{props:r,content:o}=n,a={delay:100,...r,...e,toastId:e.toastId||t,updateId:xx()};a.toastId!==t&&(a.staleId=t);let s=a.render||o;delete a.render,lc(s,a)}},lt.done=t=>{lt.update(t,{progress:1})},lt.onChange=iD,lt.play=t=>Tx(!0,t),lt.pause=t=>Tx(!1,t);const lD={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},dD=t=>t==="SummaryOfSuggestedAI"||t==="KeywordAISuggestion"||t==="SuggestedAICategories",hg=t=>t==="fullPath"||t==="createAt"||t==="creator"||t==="creatorId"||t==="DataSource"||t==="AccessLevel"||t==="category"||t==="fileName",uD={STARTING:"Đang bắt đầu",IN_PROGRESS:"Đang đồng bộ",COMPLETE:"Đồng bộ thành công",FAILED:"Đồng bộ thất bại",STOPPING:"Đang dừng",STOPPED:"Đã dừng"},fD=t=>uD[t]||t,pg="-",hD=t=>{const e=gD(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(pg);return l[0]===""&&l.length!==1&&l.shift(),Ex(l,e)||pD(s)},getConflictingClassGroupIds:(s,l)=>{const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}}},Ex=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?Ex(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const a=t.join(pg);return(s=e.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},Ax=/^\[(.+)\]$/,pD=t=>{if(Ax.test(t)){const e=Ax.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},gD=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return vD(Object.entries(t.classGroups),n).forEach(([a,s])=>{gg(s,r,a,e)}),r},gg=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const a=o===""?e:Ix(e,o);a.classGroupId=n;return}if(typeof o=="function"){if(mD(o)){gg(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{gg(s,Ix(e,a),n,r)})})},Ix=(t,e)=>{let n=t;return e.split(pg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mD=t=>t.isThemeGetter,vD=(t,e)=>e?t.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[e+s,l])):a);return[n,o]}):t,yD=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},kx="!",wD=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],a=e.length,s=l=>{const u=[];let h=0,p=0,g;for(let b=0;b<l.length;b++){let k=l[b];if(h===0){if(k===o&&(r||l.slice(b,b+a)===e)){u.push(l.slice(p,b)),p=b+a;continue}if(k==="/"){g=b;continue}}k==="["?h++:k==="]"&&h--}const w=u.length===0?l:l.substring(p),y=w.startsWith(kx),C=y?w.substring(1):w,v=g&&g>p?g-p:void 0;return{modifiers:u,hasImportantModifier:y,baseClassName:C,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:s}):s},bD=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},CD=t=>({cache:yD(t.cacheSize),parseClassName:wD(t),...hD(t)}),xD=/\s+/,_D=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,a=[],s=t.trim().split(xD);let l="";for(let u=s.length-1;u>=0;u-=1){const h=s[u],{modifiers:p,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:y}=n(h);let C=!!y,v=r(C?w.substring(0,y):w);if(!v){if(!C){l=h+(l.length>0?" "+l:l);continue}if(v=r(w),!v){l=h+(l.length>0?" "+l:l);continue}C=!1}const b=bD(p).join(":"),k=g?b+kx:b,A=k+v;if(a.includes(A))continue;a.push(A);const N=o(v,C);for(let O=0;O<N.length;++O){const T=N[O];a.push(k+T)}l=h+(l.length>0?" "+l:l)}return l};function SD(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Nx(e))&&(r&&(r+=" "),r+=n);return r}const Nx=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Nx(t[r]))&&(n&&(n+=" "),n+=e);return n};function TD(t,...e){let n,r,o,a=s;function s(u){const h=e.reduce((p,g)=>g(p),t());return n=CD(h),r=n.cache.get,o=n.cache.set,a=l,l(u)}function l(u){const h=r(u);if(h)return h;const p=_D(u,n);return o(u,p),p}return function(){return a(SD.apply(null,arguments))}}const Ft=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Px=/^\[(?:([a-z-]+):)?(.+)\]$/i,ED=/^\d+\/\d+$/,AD=new Set(["px","full","screen"]),ID=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kD=/\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$/,ND=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,PD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oo=t=>Wa(t)||AD.has(t)||ED.test(t),pi=t=>qa(t,"length",HD),Wa=t=>!!t&&!Number.isNaN(Number(t)),mg=t=>qa(t,"number",Wa),dc=t=>!!t&&Number.isInteger(Number(t)),MD=t=>t.endsWith("%")&&Wa(t.slice(0,-1)),it=t=>Px.test(t),gi=t=>ID.test(t),DD=new Set(["length","size","percentage"]),RD=t=>qa(t,DD,Ox),LD=t=>qa(t,"position",Ox),FD=new Set(["image","url"]),UD=t=>qa(t,FD,zD),$D=t=>qa(t,"",BD),uc=()=>!0,qa=(t,e,n)=>{const r=Px.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},HD=t=>kD.test(t)&&!ND.test(t),Ox=()=>!1,BD=t=>PD.test(t),zD=t=>OD.test(t),VD=TD(()=>{const t=Ft("colors"),e=Ft("spacing"),n=Ft("blur"),r=Ft("brightness"),o=Ft("borderColor"),a=Ft("borderRadius"),s=Ft("borderSpacing"),l=Ft("borderWidth"),u=Ft("contrast"),h=Ft("grayscale"),p=Ft("hueRotate"),g=Ft("invert"),w=Ft("gap"),y=Ft("gradientColorStops"),C=Ft("gradientColorStopPositions"),v=Ft("inset"),b=Ft("margin"),k=Ft("opacity"),A=Ft("padding"),N=Ft("saturate"),O=Ft("scale"),T=Ft("sepia"),L=Ft("skew"),H=Ft("space"),W=Ft("translate"),ee=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",it,e],ce=()=>[it,e],ve=()=>["",Oo,pi],K=()=>["auto",Wa,it],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",it],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[Wa,it];return{cacheSize:500,separator:":",theme:{colors:[uc],spacing:[Oo,pi],blur:["none","",gi,it],brightness:te(),borderColor:[t],borderRadius:["none","","full",gi,it],borderSpacing:ce(),borderWidth:ve(),contrast:te(),grayscale:X(),hueRotate:te(),invert:X(),gap:ce(),gradientColorStops:[t],gradientColorStopPositions:[MD,pi],inset:de(),margin:de(),opacity:te(),padding:ce(),saturate:te(),scale:te(),sepia:X(),skew:te(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",it]}],container:["container"],columns:[{columns:[gi]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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(),it]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dc,it]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",it]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",dc,it]}],"grid-cols":[{"grid-cols":[uc]}],"col-start-end":[{col:["auto",{span:["full",dc,it]},it]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[uc]}],"row-start-end":[{row:["auto",{span:[dc,it]},it]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",it]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",it]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...J()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...J(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...J(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",it,e]}],"min-w":[{"min-w":[it,e,"min","max","fit"]}],"max-w":[{"max-w":[it,e,"none","full","min","max","fit","prose",{screen:[gi]},gi]}],h:[{h:[it,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[it,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[it,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[it,e,"auto","min","max","fit"]}],"font-size":[{text:["base",gi,pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mg]}],"font-family":[{font:[uc]}],"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",it]}],"line-clamp":[{"line-clamp":["none",Wa,mg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Oo,it]}],"list-image":[{"list-image":["none",it]}],"list-style-type":[{list:["none","disc","decimal",it]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Oo,pi]}],"underline-offset":[{"underline-offset":["auto",Oo,it]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",it]}],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",it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),LD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",RD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UD]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:G()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Oo,it]}],"outline-w":[{outline:[Oo,pi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Oo,pi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",gi,$D]}],"shadow-color":[{shadow:[uc]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",gi,it]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",it]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",it]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",it]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[dc,it]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",it]}],accent:[{accent:["auto",t]}],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",it]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"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"]}],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",it]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Oo,pi,mg]}],stroke:[{stroke:[t,"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"]}}});function Ge(...t){return VD(bx(t))}function Mo(){let t=localStorage.getItem("dataLogin"),e;try{t&&(t=JSON.parse(t),e=t.user)}catch(n){console.error("Error parsing dataLogin from localStorage:",n),t=null}return e}const Bd=x.forwardRef(({className:t,...e},n)=>d.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Ge("s3-explr-ui-breadcrumb",t),...e}));Bd.displayName="Breadcrumb";const zd=x.forwardRef(({className:t,...e},n)=>d.jsx("ol",{ref:n,className:Ge("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",t),...e}));zd.displayName="BreadcrumbList";const fc=x.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Ge("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",t),...e}));fc.displayName="BreadcrumbItem";const hc=x.forwardRef(({asChild:t,className:e,...n},r)=>{const o=t?oC:"a";return d.jsx(o,{ref:r,className:Ge("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",e),...n})});hc.displayName="BreadcrumbLink";const KD=x.forwardRef(({className:t,...e},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Ge("font-normal text-foreground","s3-explr-ui-breadcrumb-page",t),...e}));KD.displayName="BreadcrumbPage";const Vd=({children:t,className:e,...n})=>d.jsx("li",{role:"presentation","aria-hidden":"true",className:Ge("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",e),...n,children:t??d.jsx(vx,{})});Vd.displayName="BreadcrumbSeparator";const Mx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Dx=bx,vg=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Dx(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=e,s=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],g=a==null?void 0:a[h];if(p===null)return null;const w=Mx(p)||Mx(g);return o[h][w]}),l=n&&Object.entries(n).reduce((h,p)=>{let[g,w]=p;return w===void 0||(h[g]=w),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:w,...y}=p;return Object.entries(y).every(C=>{let[v,b]=C;return Array.isArray(b)?b.includes({...a,...l}[v]):{...a,...l}[v]===b})?[...h,g,w]:h},[]);return Dx(t,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Rx=vg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),Fe=x.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},a)=>{const s=r?oC:"button";return d.jsx(s,{className:Ge(Rx({variant:e,size:n,className:t})),ref:a,...o})});Fe.displayName="Button";function Lx(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function Fx(t){const[e,n]=x.useState(void 0);return gn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;s=h.inlineSize,l=h.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Kd="Checkbox",[GD]=Io(Kd),[jD,yg]=GD(Kd);function WD(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:a,form:s,name:l,onCheckedChange:u,required:h,value:p="on",internal_do_not_use_render:g}=t,[w,y]=li({prop:n,defaultProp:o??!1,onChange:u,caller:Kd}),[C,v]=x.useState(null),[b,k]=x.useState(null),A=x.useRef(!1),N=C?!!s||!!C.closest("form"):!0,O={checked:w,disabled:a,setChecked:y,control:C,setControl:v,name:l,form:s,value:p,hasConsumerStoppedPropagationRef:A,required:h,defaultChecked:mi(o)?!1:o,isFormControl:N,bubbleInput:b,setBubbleInput:k};return d.jsx(jD,{scope:e,...O,children:qD(g)?g(O):r})}var Ux="CheckboxTrigger",$x=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:a,value:s,disabled:l,checked:u,required:h,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:w,isFormControl:y,bubbleInput:C}=yg(Ux,t),v=kt(o,p),b=x.useRef(u);return x.useEffect(()=>{const k=a==null?void 0:a.form;if(k){const A=()=>g(b.current);return k.addEventListener("reset",A),()=>k.removeEventListener("reset",A)}},[a,g]),d.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":mi(u)?"mixed":u,"aria-required":h,"data-state":Kx(u),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:Ke(e,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Ke(n,k=>{g(A=>mi(A)?!0:!A),C&&y&&(w.current=k.isPropagationStopped(),w.current||k.stopPropagation())})})});$x.displayName=Ux;var wg=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:s,disabled:l,value:u,onCheckedChange:h,form:p,...g}=t;return d.jsx(WD,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:l,required:s,onCheckedChange:h,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:w})=>d.jsxs(d.Fragment,{children:[d.jsx($x,{...g,ref:e,__scopeCheckbox:n}),w&&d.jsx(Vx,{__scopeCheckbox:n})]})})});wg.displayName=Kd;var Hx="CheckboxIndicator",Bx=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,a=yg(Hx,n);return d.jsx(No,{present:r||mi(a.checked)||a.checked===!0,children:d.jsx(tt.span,{"data-state":Kx(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});Bx.displayName=Hx;var zx="CheckboxBubbleInput",Vx=x.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:l,disabled:u,name:h,value:p,form:g,bubbleInput:w,setBubbleInput:y}=yg(zx,t),C=kt(n,y),v=Lx(a),b=Fx(r);x.useEffect(()=>{const A=w;if(!A)return;const N=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(N,"checked").set,L=!o.current;if(v!==a&&T){const H=new Event("click",{bubbles:L});A.indeterminate=mi(a),T.call(A,mi(a)?!1:a),A.dispatchEvent(H)}},[w,v,a,o]);const k=x.useRef(mi(a)?!1:a);return d.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??k.current,required:l,disabled:u,name:h,value:p,form:g,...e,tabIndex:-1,ref:C,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vx.displayName=zx;function qD(t){return typeof t=="function"}function mi(t){return t==="indeterminate"}function Kx(t){return mi(t)?"indeterminate":t?"checked":"unchecked"}const pc=x.forwardRef(({className:t,...e},n)=>d.jsx(wg,{ref:n,className:Ge("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:d.jsx(Bx,{className:Ge("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:d.jsx(mx,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));pc.displayName=wg.displayName;const Kn=ic,gc=W1,YD=q1,Gx=x.forwardRef(({className:t,...e},n)=>d.jsx(Ga,{ref:n,className:Ge("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));Gx.displayName=Ga.displayName;const Nn=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(YD,{children:[d.jsx(Gx,{}),d.jsxs(ja,{ref:r,className:Ge("s3-explr-ui-dialog-content 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 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%] sm:rounded-lg",t),...n,children:[e,d.jsxs(Gp,{className:Ge("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-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:[d.jsx(dg,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),d.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Nn.displayName=ja.displayName;const Pn=({className:t,...e})=>d.jsx("div",{className:Ge("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Pn.displayName="DialogHeader";const _r=({className:t,...e})=>d.jsx("div",{className:Ge("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});_r.displayName="DialogFooter";const On=x.forwardRef(({className:t,...e},n)=>d.jsx(QC,{ref:n,className:Ge("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",t),...e}));On.displayName=QC.displayName;const Do=x.forwardRef(({className:t,...e},n)=>d.jsx(XC,{ref:n,className:Ge("s3-explr-ui-dialog-description text-sm text-muted-foreground",t),...e}));Do.displayName=XC.displayName;const Gn=x.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:Ge("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Gn.displayName="Input";var JD="Label",jx=x.forwardRef((t,e)=>d.jsx(tt.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));jx.displayName=JD;var Wx=jx;const QD=vg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),lr=x.forwardRef(({className:t,variant:e,size:n,...r},o)=>d.jsx(Wx,{ref:o,className:Ge(QD({variant:e,size:n}),t),...r}));lr.displayName=Wx.displayName;const Gd=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:Ge("mx-auto flex w-full justify-center",t),...e});Gd.displayName="Pagination";const jd=x.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:Ge("flex flex-row items-center gap-1",t),...e}));jd.displayName="PaginationContent";const Br=x.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Ge("",t),...e}));Br.displayName="PaginationItem";const Ya=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:Ge(Rx({variant:e?"outline":"ghost",size:n}),t),...r});Ya.displayName="PaginationLink";const Wd=({className:t,...e})=>d.jsxs(Ya,{"aria-label":"Go to previous page",size:"default",className:Ge("gap-1 pl-2.5",t),...e,children:[d.jsx(zM,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Wd.displayName="PaginationPrevious";const qd=({className:t,...e})=>d.jsxs(Ya,{"aria-label":"Go to next page",size:"default",className:Ge("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(vx,{className:"h-4 w-4"})]});qd.displayName="PaginationNext";const Yd=({className:t,...e})=>d.jsxs("span",{"aria-hidden":!0,className:Ge("flex h-9 w-9 items-center justify-center",t),...e,children:[d.jsx(VM,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"More pages"})]});Yd.displayName="PaginationEllipsis";const Jd=x.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:Ge("relative w-full overflow-auto","s3-explr-ui-table-container"),children:d.jsx("table",{ref:n,className:Ge("w-full caption-bottom text-sm","s3-explr-ui-table",t),...e})}));Jd.displayName="Table";const Qd=x.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:Ge("[&_tr]:border-b","s3-explr-ui-table-header",t),...e}));Qd.displayName="TableHeader";const Xd=x.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:Ge("[&_tr:last-child]:border-0","s3-explr-ui-table-body",t),...e}));Xd.displayName="TableBody";const XD=x.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:Ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",t),...e}));XD.displayName="TableFooter";const zr=x.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:Ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",t),...e}));zr.displayName="TableRow";const lo=x.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:Ge("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",t),...e}));lo.displayName="TableHead";const jn=x.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:Ge("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",t),...e}));jn.displayName="TableCell";const ZD=x.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:Ge("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",t),...e}));ZD.displayName="TableCaption";function bg(t){const e=t+"CollectionProvider",[n,r]=Io(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:k}=v,A=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:A,children:k})};s.displayName=e;const l=t+"CollectionSlot",u=Ha(l),h=M.forwardRef((v,b)=>{const{scope:k,children:A}=v,N=a(l,k),O=kt(b,N.collectionRef);return d.jsx(u,{ref:O,children:A})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=Ha(p),y=M.forwardRef((v,b)=>{const{scope:k,children:A,...N}=v,O=M.useRef(null),T=kt(b,O),L=a(p,k);return M.useEffect(()=>(L.itemMap.set(O,{ref:O,...N}),()=>void L.itemMap.delete(O))),d.jsx(w,{[g]:"",ref:T,children:A})});y.displayName=p;function C(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const A=b.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((L,H)=>N.indexOf(L.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},C,r]}var eR=x.createContext(void 0);function Cg(t){const e=x.useContext(eR);return t||e||"ltr"}var xg="rovingFocusGroup.onEntryFocus",tR={bubbles:!1,cancelable:!0},mc="RovingFocusGroup",[_g,qx,nR]=bg(mc),[rR,Yx]=Io(mc,[nR]),[oR,iR]=rR(mc),Jx=x.forwardRef((t,e)=>d.jsx(_g.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(_g.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(aR,{...t,ref:e})})}));Jx.displayName=mc;var aR=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,w=x.useRef(null),y=kt(e,w),C=Cg(a),[v,b]=li({prop:s,defaultProp:l??null,onChange:u,caller:mc}),[k,A]=x.useState(!1),N=xr(h),O=qx(n),T=x.useRef(!1),[L,H]=x.useState(0);return x.useEffect(()=>{const W=w.current;if(W)return W.addEventListener(xg,N),()=>W.removeEventListener(xg,N)},[N]),d.jsx(oR,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:v,onItemFocus:x.useCallback(W=>b(W),[b]),onItemShiftTab:x.useCallback(()=>A(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(W=>W+1),[]),onFocusableItemRemove:x.useCallback(()=>H(W=>W-1),[]),children:d.jsx(tt.div,{tabIndex:k||L===0?-1:0,"data-orientation":r,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:Ke(t.onMouseDown,()=>{T.current=!0}),onFocus:Ke(t.onFocus,W=>{const ee=!T.current;if(W.target===W.currentTarget&&ee&&!k){const q=new CustomEvent(xg,tR);if(W.currentTarget.dispatchEvent(q),!q.defaultPrevented){const de=O().filter(G=>G.focusable),ce=de.find(G=>G.active),ve=de.find(G=>G.id===v),Z=[ce,ve,...de].filter(Boolean).map(G=>G.ref.current);Zx(Z,p)}}T.current=!1}),onBlur:Ke(t.onBlur,()=>A(!1))})})}),Qx="RovingFocusGroupItem",Xx=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...l}=t,u=ko(),h=a||u,p=iR(Qx,n),g=p.currentTabStopId===h,w=qx(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:v}=p;return x.useEffect(()=>{if(r)return y(),()=>C()},[r,y,C]),d.jsx(_g.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:d.jsx(tt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...l,ref:e,onMouseDown:Ke(t.onMouseDown,b=>{r?p.onItemFocus(h):b.preventDefault()}),onFocus:Ke(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ke(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){p.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const k=lR(b,p.orientation,p.dir);if(k!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=w().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const O=N.indexOf(b.currentTarget);N=p.loop?dR(N,O+1):N.slice(O+1)}setTimeout(()=>Zx(N))}}),children:typeof s=="function"?s({isCurrentTabStop:g,hasTabStop:v!=null}):s})})});Xx.displayName=Qx;var sR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cR(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function lR(t,e,n){const r=cR(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sR[r]}function Zx(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function dR(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var uR=Jx,fR=Xx,Zd="Tabs",[hR]=Io(Zd,[Yx]),e_=Yx(),[pR,Sg]=hR(Zd),t_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:u="automatic",...h}=t,p=Cg(l),[g,w]=li({prop:r,onChange:o,defaultProp:a??"",caller:Zd});return d.jsx(pR,{scope:n,baseId:ko(),value:g,onValueChange:w,orientation:s,dir:p,activationMode:u,children:d.jsx(tt.div,{dir:p,"data-orientation":s,...h,ref:e})})});t_.displayName=Zd;var n_="TabsList",r_=x.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,a=Sg(n_,n),s=e_(n);return d.jsx(uR,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:d.jsx(tt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:e})})});r_.displayName=n_;var o_="TabsTrigger",i_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=t,s=Sg(o_,n),l=e_(n),u=c_(s.baseId,r),h=l_(s.baseId,r),p=r===s.value;return d.jsx(fR,{asChild:!0,...l,focusable:!o,active:p,children:d.jsx(tt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...a,ref:e,onMouseDown:Ke(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ke(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ke(t.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!o&&g&&s.onValueChange(r)})})})});i_.displayName=o_;var a_="TabsContent",s_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=t,l=Sg(a_,n),u=c_(l.baseId,r),h=l_(l.baseId,r),p=r===l.value,g=x.useRef(p);return x.useEffect(()=>{const w=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(w)},[]),d.jsx(No,{present:o||p,children:({present:w})=>d.jsx(tt.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!w,id:h,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:g.current?"0s":void 0},children:w&&a})})});s_.displayName=a_;function c_(t,e){return`${t}-trigger-${e}`}function l_(t,e){return`${t}-content-${e}`}var gR=t_,d_=r_,u_=i_,f_=s_;const Tg=gR,eu=x.forwardRef(({className:t,...e},n)=>d.jsx(d_,{ref:n,className:Ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));eu.displayName=d_.displayName;const zi=x.forwardRef(({className:t,...e},n)=>d.jsx(u_,{ref:n,className:Ge("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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",t),...e}));zi.displayName=u_.displayName;const Vi=x.forwardRef(({className:t,...e},n)=>d.jsx(f_,{ref:n,className:Ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Vi.displayName=f_.displayName;const vc=x.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:Ge("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...e}));vc.displayName="Textarea";var h_=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"}),mR="VisuallyHidden",tu=x.forwardRef((t,e)=>d.jsx(tt.span,{...t,ref:e,style:{...h_,...t.style}}));tu.displayName=mR;var vR=tu,Eg="ToastProvider",[Ag,yR,wR]=bg("Toast"),[p_]=Io("Toast",[wR]),[bR,nu]=p_(Eg),g_=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=t,[l,u]=x.useState(null),[h,p]=x.useState(0),g=x.useRef(!1),w=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Eg}\`. Expected non-empty \`string\`.`),d.jsx(Ag.Provider,{scope:e,children:d.jsx(bR,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:a,toastCount:h,viewport:l,onViewportChange:u,onToastAdd:x.useCallback(()=>p(y=>y+1),[]),onToastRemove:x.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:w,children:s})})};g_.displayName=Eg;var m_="ToastViewport",CR=["F8"],Ig="toast.viewportPause",kg="toast.viewportResume",v_=x.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=CR,label:o="Notifications ({hotkey})",...a}=t,s=nu(m_,n),l=yR(n),u=x.useRef(null),h=x.useRef(null),p=x.useRef(null),g=x.useRef(null),w=kt(e,g,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=s.toastCount>0;x.useEffect(()=>{const b=k=>{var N;r.length!==0&&r.every(O=>k[O]||k.code===O)&&((N=g.current)==null||N.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),x.useEffect(()=>{const b=u.current,k=g.current;if(C&&b&&k){const A=()=>{if(!s.isClosePausedRef.current){const L=new CustomEvent(Ig);k.dispatchEvent(L),s.isClosePausedRef.current=!0}},N=()=>{if(s.isClosePausedRef.current){const L=new CustomEvent(kg);k.dispatchEvent(L),s.isClosePausedRef.current=!1}},O=L=>{!b.contains(L.relatedTarget)&&N()},T=()=>{b.contains(document.activeElement)||N()};return b.addEventListener("focusin",A),b.addEventListener("focusout",O),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",T),window.addEventListener("blur",A),window.addEventListener("focus",N),()=>{b.removeEventListener("focusin",A),b.removeEventListener("focusout",O),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",T),window.removeEventListener("blur",A),window.removeEventListener("focus",N)}}},[C,s.isClosePausedRef]);const v=x.useCallback(({tabbingDirection:b})=>{const A=l().map(N=>{const O=N.ref.current,T=[O,...DR(O)];return b==="forwards"?T:T.reverse()});return(b==="forwards"?A.reverse():A).flat()},[l]);return x.useEffect(()=>{const b=g.current;if(b){const k=A=>{var T,L,H;const N=A.altKey||A.ctrlKey||A.metaKey;if(A.key==="Tab"&&!N){const W=document.activeElement,ee=A.shiftKey;if(A.target===b&&ee){(T=h.current)==null||T.focus();return}const ce=v({tabbingDirection:ee?"backwards":"forwards"}),ve=ce.findIndex(K=>K===W);Og(ce.slice(ve+1))?A.preventDefault():ee?(L=h.current)==null||L.focus():(H=p.current)==null||H.focus()}};return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)}},[l,v]),d.jsxs(zO,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:C?void 0:"none"},children:[C&&d.jsx(Ng,{ref:h,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});Og(b)}}),d.jsx(Ag.Slot,{scope:n,children:d.jsx(tt.ol,{tabIndex:-1,...a,ref:w})}),C&&d.jsx(Ng,{ref:p,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});Og(b)}})]})});v_.displayName=m_;var y_="ToastFocusProxy",Ng=x.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,a=nu(y_,n);return d.jsx(tu,{tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var h;const l=s.relatedTarget;!((h=a.viewport)!=null&&h.contains(l))&&r()}})});Ng.displayName=y_;var yc="Toast",xR="toast.swipeStart",_R="toast.swipeMove",SR="toast.swipeCancel",TR="toast.swipeEnd",w_=x.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...s}=t,[l,u]=li({prop:r,defaultProp:o??!0,onChange:a,caller:yc});return d.jsx(No,{present:n||l,children:d.jsx(IR,{open:l,...s,ref:e,onClose:()=>u(!1),onPause:xr(t.onPause),onResume:xr(t.onResume),onSwipeStart:Ke(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ke(t.onSwipeMove,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ke(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ke(t.onSwipeEnd,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});w_.displayName=yc;var[ER,AR]=p_(yc,{onClose(){}}),IR=x.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:h,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:w,onSwipeEnd:y,...C}=t,v=nu(yc,n),[b,k]=x.useState(null),A=kt(e,K=>k(K)),N=x.useRef(null),O=x.useRef(null),T=o||v.duration,L=x.useRef(0),H=x.useRef(T),W=x.useRef(0),{onToastAdd:ee,onToastRemove:q}=v,de=xr(()=>{var Z;(b==null?void 0:b.contains(document.activeElement))&&((Z=v.viewport)==null||Z.focus()),s()}),ce=x.useCallback(K=>{!K||K===1/0||(window.clearTimeout(W.current),L.current=new Date().getTime(),W.current=window.setTimeout(de,K))},[de]);x.useEffect(()=>{const K=v.viewport;if(K){const Z=()=>{ce(H.current),h==null||h()},G=()=>{const re=new Date().getTime()-L.current;H.current=H.current-re,window.clearTimeout(W.current),u==null||u()};return K.addEventListener(Ig,G),K.addEventListener(kg,Z),()=>{K.removeEventListener(Ig,G),K.removeEventListener(kg,Z)}}},[v.viewport,T,u,h,ce]),x.useEffect(()=>{a&&!v.isClosePausedRef.current&&ce(T)},[a,T,v.isClosePausedRef,ce]),x.useEffect(()=>(ee(),()=>q()),[ee,q]);const ve=x.useMemo(()=>b?E_(b):null,[b]);return v.viewport?d.jsxs(d.Fragment,{children:[ve&&d.jsx(kR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ve}),d.jsx(ER,{scope:n,onClose:de,children:$s.createPortal(d.jsx(Ag.ItemSlot,{scope:n,children:d.jsx(BO,{asChild:!0,onEscapeKeyDown:Ke(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||de(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(tt.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...C,ref:A,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ke(t.onKeyDown,K=>{K.key==="Escape"&&(l==null||l(K.nativeEvent),K.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,de()))}),onPointerDown:Ke(t.onPointerDown,K=>{K.button===0&&(N.current={x:K.clientX,y:K.clientY})}),onPointerMove:Ke(t.onPointerMove,K=>{if(!N.current)return;const Z=K.clientX-N.current.x,G=K.clientY-N.current.y,re=!!O.current,J=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,U=J?X(0,Z):0,te=J?0:X(0,G),be=K.pointerType==="touch"?10:2,Ee={x:U,y:te},Ce={originalEvent:K,delta:Ee};re?(O.current=Ee,ru(_R,g,Ce,{discrete:!1})):A_(Ee,v.swipeDirection,be)?(O.current=Ee,ru(xR,p,Ce,{discrete:!1}),K.target.setPointerCapture(K.pointerId)):(Math.abs(Z)>be||Math.abs(G)>be)&&(N.current=null)}),onPointerUp:Ke(t.onPointerUp,K=>{const Z=O.current,G=K.target;if(G.hasPointerCapture(K.pointerId)&&G.releasePointerCapture(K.pointerId),O.current=null,N.current=null,Z){const re=K.currentTarget,J={originalEvent:K,delta:Z};A_(Z,v.swipeDirection,v.swipeThreshold)?ru(TR,y,J,{discrete:!0}):ru(SR,w,J,{discrete:!0}),re.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),kR=t=>{const{__scopeToast:e,children:n,...r}=t,o=nu(yc,e),[a,s]=x.useState(!1),[l,u]=x.useState(!1);return OR(()=>s(!0)),x.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),l?null:d.jsx(oc,{asChild:!0,children:d.jsx(tu,{...r,children:a&&d.jsxs(d.Fragment,{children:[o.label," ",n]})})})},NR="ToastTitle",b_=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(tt.div,{...r,ref:e})});b_.displayName=NR;var PR="ToastDescription",C_=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(tt.div,{...r,ref:e})});C_.displayName=PR;var x_="ToastAction",__=x.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?d.jsx(T_,{altText:n,asChild:!0,children:d.jsx(Pg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${x_}\`. Expected non-empty \`string\`.`),null)});__.displayName=x_;var S_="ToastClose",Pg=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=AR(S_,n);return d.jsx(T_,{asChild:!0,children:d.jsx(tt.button,{type:"button",...r,ref:e,onClick:Ke(t.onClick,o.onClose)})})});Pg.displayName=S_;var T_=x.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return d.jsx(tt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function E_(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),MR(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...E_(r))}}),e}function ru(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?aC(o,a):o.dispatchEvent(a)}var A_=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),a=r>o;return e==="left"||e==="right"?a&&r>n:!a&&o>n};function OR(t=()=>{}){const e=xr(t);gn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function MR(t){return t.nodeType===t.ELEMENT_NODE}function DR(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Og(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var RR=g_,I_=v_,k_=w_,N_=b_,P_=C_,O_=__,M_=Pg;const LR=RR,D_=x.forwardRef(({className:t,...e},n)=>d.jsx(I_,{ref:n,className:Ge("s3-explr-ui-toast-viewport fixed top-0 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px] z-[10000]",t),...e}));D_.displayName=I_.displayName;const FR=vg("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 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-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),R_=x.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(k_,{ref:r,className:Ge(FR({variant:e}),t),...n}));R_.displayName=k_.displayName;const UR=x.forwardRef(({className:t,...e},n)=>d.jsx(O_,{ref:n,className:Ge("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring 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",t),...e}));UR.displayName=O_.displayName;const L_=x.forwardRef(({className:t,...e},n)=>d.jsx(M_,{ref:n,className:Ge("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 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 font-bold",t),"toast-close":"",...e,children:d.jsx(dg,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));L_.displayName=M_.displayName;const F_=x.forwardRef(({className:t,...e},n)=>d.jsx(N_,{ref:n,className:Ge("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",t),...e}));F_.displayName=N_.displayName;const U_=x.forwardRef(({className:t,...e},n)=>d.jsx(P_,{ref:n,className:Ge("text-sm opacity-90 font-bold",t),...e}));U_.displayName=P_.displayName;const $R=1,HR=1e6;let Mg=0;function BR(){return Mg=(Mg+1)%Number.MAX_SAFE_INTEGER,Mg.toString()}const Dg=new Map,$_=t=>{if(Dg.has(t))return;const e=setTimeout(()=>{Dg.delete(t),wc({type:"REMOVE_TOAST",toastId:t})},HR);Dg.set(t,e)},zR=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,$R)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?$_(n):t.toasts.forEach(r=>{$_(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},ou=[];let iu={toasts:[]};function wc(t){iu=zR(iu,t),ou.forEach(e=>{e(iu)})}function VR({...t}){const e=BR(),n=o=>wc({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>wc({type:"DISMISS_TOAST",toastId:e});return wc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function bc(){const[t,e]=x.useState(iu);return x.useEffect(()=>(ou.push(e),()=>{const n=ou.indexOf(e);n>-1&&ou.splice(n,1)}),[t]),{...t,toast:VR,dismiss:n=>wc({type:"DISMISS_TOAST",toastId:n})}}function H_(){const{toasts:t}=bc();return d.jsxs(LR,{children:[t.map(function({id:e,title:n,description:r,action:o,...a}){return d.jsxs(R_,{...a,className:`s3-explr-ui-toast ${a.className||""}`,children:[d.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&d.jsx(F_,{className:"s3-explr-ui-toast-title",children:n}),r&&d.jsx(U_,{className:"s3-explr-ui-toast-description",style:{wordBreak:"break-all",whiteSpace:"pre-line",maxWidth:400,overflowWrap:"break-word"},children:r})]}),o&&d.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),d.jsx(L_,{className:"s3-explr-ui-toast-close"})]},e)}),d.jsx(D_,{className:"s3-explr-ui-toast-viewport"})]})}const KR=["top","right","bottom","left"],vi=Math.min,dr=Math.max,au=Math.round,su=Math.floor,uo=t=>({x:t,y:t}),GR={left:"right",right:"left",bottom:"top",top:"bottom"},jR={start:"end",end:"start"};function Rg(t,e,n){return dr(t,vi(e,n))}function Ro(t,e){return typeof t=="function"?t(e):t}function Lo(t){return t.split("-")[0]}function Ja(t){return t.split("-")[1]}function Lg(t){return t==="x"?"y":"x"}function Fg(t){return t==="y"?"height":"width"}const WR=new Set(["top","bottom"]);function fo(t){return WR.has(Lo(t))?"y":"x"}function Ug(t){return Lg(fo(t))}function qR(t,e,n){n===void 0&&(n=!1);const r=Ja(t),o=Ug(t),a=Fg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=cu(s)),[s,cu(s)]}function YR(t){const e=cu(t);return[$g(t),e,$g(e)]}function $g(t){return t.replace(/start|end/g,e=>jR[e])}const B_=["left","right"],z_=["right","left"],JR=["top","bottom"],QR=["bottom","top"];function XR(t,e,n){switch(t){case"top":case"bottom":return n?e?z_:B_:e?B_:z_;case"left":case"right":return e?JR:QR;default:return[]}}function ZR(t,e,n,r){const o=Ja(t);let a=XR(Lo(t),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),e&&(a=a.concat(a.map($g)))),a}function cu(t){return t.replace(/left|right|bottom|top/g,e=>GR[e])}function eL(t){return{top:0,right:0,bottom:0,left:0,...t}}function V_(t){return typeof t!="number"?eL(t):{top:t,right:t,bottom:t,left:t}}function lu(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function K_(t,e,n){let{reference:r,floating:o}=t;const a=fo(e),s=Ug(e),l=Fg(s),u=Lo(e),h=a==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,w=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-o.width,y:g};break;default:y={x:r.x,y:r.y}}switch(Ja(e)){case"start":y[s]-=w*(n&&h?-1:1);break;case"end":y[s]+=w*(n&&h?-1:1);break}return y}const tL=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,l=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e));let h=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=K_(h,r,u),w=r,y={},C=0;for(let v=0;v<l.length;v++){const{name:b,fn:k}=l[v],{x:A,y:N,data:O,reset:T}=await k({x:p,y:g,initialPlacement:r,placement:w,strategy:o,middlewareData:y,rects:h,platform:s,elements:{reference:t,floating:e}});p=A??p,g=N??g,y={...y,[b]:{...y[b],...O}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(w=T.placement),T.rects&&(h=T.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):T.rects),{x:p,y:g}=K_(h,w,u)),v=-1)}return{x:p,y:g,placement:w,strategy:o,middlewareData:y}};async function Cc(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:a,rects:s,elements:l,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:w=!1,padding:y=0}=Ro(e,t),C=V_(y),b=l[w?g==="floating"?"reference":"floating":g],k=lu(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:h,rootBoundary:p,strategy:u})),A=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),O=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},T=lu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:N,strategy:u}):A);return{top:(k.top-T.top+C.top)/O.y,bottom:(T.bottom-k.bottom+C.bottom)/O.y,left:(k.left-T.left+C.left)/O.x,right:(T.right-k.right+C.right)/O.x}}const nL=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:s,elements:l,middlewareData:u}=e,{element:h,padding:p=0}=Ro(t,e)||{};if(h==null)return{};const g=V_(p),w={x:n,y:r},y=Ug(o),C=Fg(y),v=await s.getDimensions(h),b=y==="y",k=b?"top":"left",A=b?"bottom":"right",N=b?"clientHeight":"clientWidth",O=a.reference[C]+a.reference[y]-w[y]-a.floating[C],T=w[y]-a.reference[y],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let H=L?L[N]:0;(!H||!await(s.isElement==null?void 0:s.isElement(L)))&&(H=l.floating[N]||a.floating[C]);const W=O/2-T/2,ee=H/2-v[C]/2-1,q=vi(g[k],ee),de=vi(g[A],ee),ce=q,ve=H-v[C]-de,K=H/2-v[C]/2+W,Z=Rg(ce,K,ve),G=!u.arrow&&Ja(o)!=null&&K!==Z&&a.reference[C]/2-(K<ce?q:de)-v[C]/2<0,re=G?K<ce?K-ce:K-ve:0;return{[y]:w[y]+re,data:{[y]:Z,centerOffset:K-Z-re,...G&&{alignmentOffset:re}},reset:G}}}),rL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:l,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:v=!0,...b}=Ro(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=Lo(o),A=fo(l),N=Lo(l)===l,O=await(u.isRTL==null?void 0:u.isRTL(h.floating)),T=w||(N||!v?[cu(l)]:YR(l)),L=C!=="none";!w&&L&&T.push(...ZR(l,v,C,O));const H=[l,...T],W=await Cc(e,b),ee=[];let q=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(W[k]),g){const K=qR(o,s,O);ee.push(W[K[0]],W[K[1]])}if(q=[...q,{placement:o,overflows:ee}],!ee.every(K=>K<=0)){var de,ce;const K=(((de=a.flip)==null?void 0:de.index)||0)+1,Z=H[K];if(Z&&(!(g==="alignment"?A!==fo(Z):!1)||q.every(J=>fo(J.placement)===A?J.overflows[0]>0:!0)))return{data:{index:K,overflows:q},reset:{placement:Z}};let G=(ce=q.filter(re=>re.overflows[0]<=0).sort((re,J)=>re.overflows[1]-J.overflows[1])[0])==null?void 0:ce.placement;if(!G)switch(y){case"bestFit":{var ve;const re=(ve=q.filter(J=>{if(L){const X=fo(J.placement);return X===A||X==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(X=>X>0).reduce((X,U)=>X+U,0)]).sort((J,X)=>J[1]-X[1])[0])==null?void 0:ve[0];re&&(G=re);break}case"initialPlacement":G=l;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function G_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j_(t){return KR.some(e=>t[e]>=0)}const oL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=Ro(t,e);switch(r){case"referenceHidden":{const a=await Cc(e,{...o,elementContext:"reference"}),s=G_(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:j_(s)}}}case"escaped":{const a=await Cc(e,{...o,altBoundary:!0}),s=G_(a,n.floating);return{data:{escapedOffsets:s,escaped:j_(s)}}}default:return{}}}}},W_=new Set(["left","top"]);async function iL(t,e){const{placement:n,platform:r,elements:o}=t,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lo(n),l=Ja(n),u=fo(n)==="y",h=W_.has(s)?-1:1,p=a&&u?-1:1,g=Ro(e,t);let{mainAxis:w,crossAxis:y,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof C=="number"&&(y=l==="end"?C*-1:C),u?{x:y*p,y:w*h}:{x:w*h,y:y*p}}const aL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:a,placement:s,middlewareData:l}=e,u=await iL(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},sL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:k,y:A}=b;return{x:k,y:A}}},...u}=Ro(t,e),h={x:n,y:r},p=await Cc(e,u),g=fo(Lo(o)),w=Lg(g);let y=h[w],C=h[g];if(a){const b=w==="y"?"top":"left",k=w==="y"?"bottom":"right",A=y+p[b],N=y-p[k];y=Rg(A,y,N)}if(s){const b=g==="y"?"top":"left",k=g==="y"?"bottom":"right",A=C+p[b],N=C-p[k];C=Rg(A,C,N)}const v=l.fn({...e,[w]:y,[g]:C});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[w]:a,[g]:s}}}}}},cL=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=e,{offset:l=0,mainAxis:u=!0,crossAxis:h=!0}=Ro(t,e),p={x:n,y:r},g=fo(o),w=Lg(g);let y=p[w],C=p[g];const v=Ro(l,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const N=w==="y"?"height":"width",O=a.reference[w]-a.floating[N]+b.mainAxis,T=a.reference[w]+a.reference[N]-b.mainAxis;y<O?y=O:y>T&&(y=T)}if(h){var k,A;const N=w==="y"?"width":"height",O=W_.has(Lo(o)),T=a.reference[g]-a.floating[N]+(O&&((k=s.offset)==null?void 0:k[g])||0)+(O?0:b.crossAxis),L=a.reference[g]+a.reference[N]+(O?0:((A=s.offset)==null?void 0:A[g])||0)-(O?b.crossAxis:0);C<T?C=T:C>L&&(C=L)}return{[w]:y,[g]:C}}}},lL=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:a,platform:s,elements:l}=e,{apply:u=()=>{},...h}=Ro(t,e),p=await Cc(e,h),g=Lo(o),w=Ja(o),y=fo(o)==="y",{width:C,height:v}=a.floating;let b,k;g==="top"||g==="bottom"?(b=g,k=w===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(k=g,b=w==="end"?"top":"bottom");const A=v-p.top-p.bottom,N=C-p.left-p.right,O=vi(v-p[b],A),T=vi(C-p[k],N),L=!e.middlewareData.shift;let H=O,W=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(W=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(H=A),L&&!w){const q=dr(p.left,0),de=dr(p.right,0),ce=dr(p.top,0),ve=dr(p.bottom,0);y?W=C-2*(q!==0||de!==0?q+de:dr(p.left,p.right)):H=v-2*(ce!==0||ve!==0?ce+ve:dr(p.top,p.bottom))}await u({...e,availableWidth:W,availableHeight:H});const ee=await s.getDimensions(l.floating);return C!==ee.width||v!==ee.height?{reset:{rects:!0}}:{}}}};function du(){return typeof window<"u"}function Qa(t){return q_(t)?(t.nodeName||"").toLowerCase():"#document"}function ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ho(t){var e;return(e=(q_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function q_(t){return du()?t instanceof Node||t instanceof ur(t).Node:!1}function Vr(t){return du()?t instanceof Element||t instanceof ur(t).Element:!1}function po(t){return du()?t instanceof HTMLElement||t instanceof ur(t).HTMLElement:!1}function Y_(t){return!du()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ur(t).ShadowRoot}const dL=new Set(["inline","contents"]);function xc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!dL.has(o)}const uL=new Set(["table","td","th"]);function fL(t){return uL.has(Qa(t))}const hL=[":popover-open",":modal"];function uu(t){return hL.some(e=>{try{return t.matches(e)}catch{return!1}})}const pL=["transform","translate","scale","rotate","perspective"],gL=["transform","translate","scale","rotate","perspective","filter"],mL=["paint","layout","strict","content"];function Hg(t){const e=Bg(),n=Vr(t)?Kr(t):t;return pL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||gL.some(r=>(n.willChange||"").includes(r))||mL.some(r=>(n.contain||"").includes(r))}function vL(t){let e=yi(t);for(;po(e)&&!Xa(e);){if(Hg(e))return e;if(uu(e))return null;e=yi(e)}return null}function Bg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yL=new Set(["html","body","#document"]);function Xa(t){return yL.has(Qa(t))}function Kr(t){return ur(t).getComputedStyle(t)}function fu(t){return Vr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if(Qa(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Y_(t)&&t.host||ho(t);return Y_(e)?e.host:e}function J_(t){const e=yi(t);return Xa(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&xc(e)?e:J_(e)}function _c(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=J_(t),a=o===((r=t.ownerDocument)==null?void 0:r.body),s=ur(o);if(a){const l=zg(s);return e.concat(s,s.visualViewport||[],xc(o)?o:[],l&&n?_c(l):[])}return e.concat(o,_c(o,[],n))}function zg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Q_(t){const e=Kr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=po(t),a=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=au(n)!==a||au(r)!==s;return l&&(n=a,r=s),{width:n,height:r,$:l}}function Vg(t){return Vr(t)?t:t.contextElement}function Za(t){const e=Vg(t);if(!po(e))return uo(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:a}=Q_(e);let s=(a?au(n.width):n.width)/r,l=(a?au(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const wL=uo(0);function X_(t){const e=ur(t);return!Bg()||!e.visualViewport?wL:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bL(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ur(t)?!1:e}function Ki(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=Vg(t);let s=uo(1);e&&(r?Vr(r)&&(s=Za(r)):s=Za(t));const l=bL(a,n,r)?X_(a):uo(0);let u=(o.left+l.x)/s.x,h=(o.top+l.y)/s.y,p=o.width/s.x,g=o.height/s.y;if(a){const w=ur(a),y=r&&Vr(r)?ur(r):r;let C=w,v=zg(C);for(;v&&r&&y!==C;){const b=Za(v),k=v.getBoundingClientRect(),A=Kr(v),N=k.left+(v.clientLeft+parseFloat(A.paddingLeft))*b.x,O=k.top+(v.clientTop+parseFloat(A.paddingTop))*b.y;u*=b.x,h*=b.y,p*=b.x,g*=b.y,u+=N,h+=O,C=ur(v),v=zg(C)}}return lu({width:p,height:g,x:u,y:h})}function hu(t,e){const n=fu(t).scrollLeft;return e?e.left+n:Ki(ho(t)).left+n}function Z_(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-hu(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function CL(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const a=o==="fixed",s=ho(r),l=e?uu(e.floating):!1;if(r===s||l&&a)return n;let u={scrollLeft:0,scrollTop:0},h=uo(1);const p=uo(0),g=po(r);if((g||!g&&!a)&&((Qa(r)!=="body"||xc(s))&&(u=fu(r)),po(r))){const y=Ki(r);h=Za(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const w=s&&!g&&!a?Z_(s,u):uo(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+p.x+w.x,y:n.y*h.y-u.scrollTop*h.y+p.y+w.y}}function xL(t){return Array.from(t.getClientRects())}function _L(t){const e=ho(t),n=fu(t),r=t.ownerDocument.body,o=dr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=dr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hu(t);const l=-n.scrollTop;return Kr(r).direction==="rtl"&&(s+=dr(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:l}}const eS=25;function SL(t,e){const n=ur(t),r=ho(t),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){a=o.width,s=o.height;const p=Bg();(!p||p&&e==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const h=hu(r);if(h<=0){const p=r.ownerDocument,g=p.body,w=getComputedStyle(g),y=p.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-y);C<=eS&&(a-=C)}else h<=eS&&(a+=h);return{width:a,height:s,x:l,y:u}}const TL=new Set(["absolute","fixed"]);function EL(t,e){const n=Ki(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,a=po(t)?Za(t):uo(1),s=t.clientWidth*a.x,l=t.clientHeight*a.y,u=o*a.x,h=r*a.y;return{width:s,height:l,x:u,y:h}}function tS(t,e,n){let r;if(e==="viewport")r=SL(t,n);else if(e==="document")r=_L(ho(t));else if(Vr(e))r=EL(e,n);else{const o=X_(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return lu(r)}function nS(t,e){const n=yi(t);return n===e||!Vr(n)||Xa(n)?!1:Kr(n).position==="fixed"||nS(n,e)}function AL(t,e){const n=e.get(t);if(n)return n;let r=_c(t,[],!1).filter(l=>Vr(l)&&Qa(l)!=="body"),o=null;const a=Kr(t).position==="fixed";let s=a?yi(t):t;for(;Vr(s)&&!Xa(s);){const l=Kr(s),u=Hg(s);!u&&l.position==="fixed"&&(o=null),(a?!u&&!o:!u&&l.position==="static"&&!!o&&TL.has(o.position)||xc(s)&&!u&&nS(t,s))?r=r.filter(p=>p!==s):o=l,s=yi(s)}return e.set(t,r),r}function IL(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?uu(e)?[]:AL(e,this._c):[].concat(n),r],l=s[0],u=s.reduce((h,p)=>{const g=tS(e,p,o);return h.top=dr(g.top,h.top),h.right=vi(g.right,h.right),h.bottom=vi(g.bottom,h.bottom),h.left=dr(g.left,h.left),h},tS(e,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function kL(t){const{width:e,height:n}=Q_(t);return{width:e,height:n}}function NL(t,e,n){const r=po(e),o=ho(e),a=n==="fixed",s=Ki(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const u=uo(0);function h(){u.x=hu(o)}if(r||!r&&!a)if((Qa(e)!=="body"||xc(o))&&(l=fu(e)),r){const y=Ki(e,!0,a,e);u.x=y.x+e.clientLeft,u.y=y.y+e.clientTop}else o&&h();a&&!r&&o&&h();const p=o&&!r&&!a?Z_(o,l):uo(0),g=s.left+l.scrollLeft-u.x-p.x,w=s.top+l.scrollTop-u.y-p.y;return{x:g,y:w,width:s.width,height:s.height}}function Kg(t){return Kr(t).position==="static"}function rS(t,e){if(!po(t)||Kr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ho(t)===n&&(n=n.ownerDocument.body),n}function oS(t,e){const n=ur(t);if(uu(t))return n;if(!po(t)){let o=yi(t);for(;o&&!Xa(o);){if(Vr(o)&&!Kg(o))return o;o=yi(o)}return n}let r=rS(t,e);for(;r&&fL(r)&&Kg(r);)r=rS(r,e);return r&&Xa(r)&&Kg(r)&&!Hg(r)?n:r||vL(t)||n}const PL=async function(t){const e=this.getOffsetParent||oS,n=this.getDimensions,r=await n(t.floating);return{reference:NL(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OL(t){return Kr(t).direction==="rtl"}const ML={convertOffsetParentRelativeRectToViewportRelativeRect:CL,getDocumentElement:ho,getClippingRect:IL,getOffsetParent:oS,getElementRects:PL,getClientRects:xL,getDimensions:kL,getScale:Za,isElement:Vr,isRTL:OL};function iS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function DL(t,e){let n=null,r;const o=ho(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const h=t.getBoundingClientRect(),{left:p,top:g,width:w,height:y}=h;if(l||e(),!w||!y)return;const C=su(g),v=su(o.clientWidth-(p+w)),b=su(o.clientHeight-(g+y)),k=su(p),N={rootMargin:-C+"px "+-v+"px "+-b+"px "+-k+"px",threshold:dr(0,vi(1,u))||1};let O=!0;function T(L){const H=L[0].intersectionRatio;if(H!==u){if(!O)return s();H?s(!1,H):r=setTimeout(()=>{s(!1,1e-7)},1e3)}H===1&&!iS(h,t.getBoundingClientRect())&&s(),O=!1}try{n=new IntersectionObserver(T,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,N)}n.observe(t)}return s(!0),a}function RL(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=Vg(t),p=o||a?[...h?_c(h):[],..._c(e)]:[];p.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const g=h&&l?DL(h,n):null;let w=-1,y=null;s&&(y=new ResizeObserver(k=>{let[A]=k;A&&A.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(e)})),n()}),h&&!u&&y.observe(h),y.observe(e));let C,v=u?Ki(t):null;u&&b();function b(){const k=Ki(t);v&&!iS(v,k)&&n(),v=k,C=requestAnimationFrame(b)}return n(),()=>{var k;p.forEach(A=>{o&&A.removeEventListener("scroll",n),a&&A.removeEventListener("resize",n)}),g==null||g(),(k=y)==null||k.disconnect(),y=null,u&&cancelAnimationFrame(C)}}const LL=aL,FL=sL,UL=rL,$L=lL,HL=oL,aS=nL,BL=cL,zL=(t,e,n)=>{const r=new Map,o={platform:ML,...n},a={...o.platform,_c:r};return tL(t,e,{...o,platform:a})};var VL=typeof document<"u",KL=function(){},pu=VL?M.useLayoutEffect:KL;function gu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!gu(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&t.$$typeof)&&!gu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function sS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cS(t,e){const n=sS(t);return Math.round(e*n)/n}function Gg(t){const e=x.useRef(t);return pu(()=>{e.current=t}),e}function GL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:h}=t,[p,g]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[w,y]=x.useState(r);gu(w,r)||y(r);const[C,v]=x.useState(null),[b,k]=x.useState(null),A=x.useCallback(J=>{J!==L.current&&(L.current=J,v(J))},[]),N=x.useCallback(J=>{J!==H.current&&(H.current=J,k(J))},[]),O=a||C,T=s||b,L=x.useRef(null),H=x.useRef(null),W=x.useRef(p),ee=u!=null,q=Gg(u),de=Gg(o),ce=Gg(h),ve=x.useCallback(()=>{if(!L.current||!H.current)return;const J={placement:e,strategy:n,middleware:w};de.current&&(J.platform=de.current),zL(L.current,H.current,J).then(X=>{const U={...X,isPositioned:ce.current!==!1};K.current&&!gu(W.current,U)&&(W.current=U,$s.flushSync(()=>{g(U)}))})},[w,e,n,de,ce]);pu(()=>{h===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[h]);const K=x.useRef(!1);pu(()=>(K.current=!0,()=>{K.current=!1}),[]),pu(()=>{if(O&&(L.current=O),T&&(H.current=T),O&&T){if(q.current)return q.current(O,T,ve);ve()}},[O,T,ve,q,ee]);const Z=x.useMemo(()=>({reference:L,floating:H,setReference:A,setFloating:N}),[A,N]),G=x.useMemo(()=>({reference:O,floating:T}),[O,T]),re=x.useMemo(()=>{const J={position:n,left:0,top:0};if(!G.floating)return J;const X=cS(G.floating,p.x),U=cS(G.floating,p.y);return l?{...J,transform:"translate("+X+"px, "+U+"px)",...sS(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:U}},[n,l,G.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:ve,refs:Z,elements:G,floatingStyles:re}),[p,ve,Z,G,re])}const jL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?aS({element:r.current,padding:o}).fn(n):{}:r?aS({element:r,padding:o}).fn(n):{}}}},WL=(t,e)=>({...LL(t),options:[t,e]}),qL=(t,e)=>({...FL(t),options:[t,e]}),YL=(t,e)=>({...BL(t),options:[t,e]}),JL=(t,e)=>({...UL(t),options:[t,e]}),QL=(t,e)=>({...$L(t),options:[t,e]}),XL=(t,e)=>({...HL(t),options:[t,e]}),ZL=(t,e)=>({...jL(t),options:[t,e]});var eF="Arrow",lS=x.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(tt.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});lS.displayName=eF;var tF=lS,jg="Popper",[dS,mu]=Io(jg),[nF,uS]=dS(jg),fS=t=>{const{__scopePopper:e,children:n}=t,[r,o]=x.useState(null);return d.jsx(nF,{scope:e,anchor:r,onAnchorChange:o,children:n})};fS.displayName=jg;var hS="PopperAnchor",pS=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=uS(hS,n),s=x.useRef(null),l=kt(e,s),u=x.useRef(null);return x.useEffect(()=>{const h=u.current;u.current=(r==null?void 0:r.current)||s.current,h!==u.current&&a.onAnchorChange(u.current)}),r?null:d.jsx(tt.div,{...o,ref:l})});pS.displayName=hS;var Wg="PopperContent",[rF,oF]=dS(Wg),gS=x.forwardRef((t,e)=>{var z,ue,Ae,xe,Pe,ae;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:C,...v}=t,b=uS(Wg,n),[k,A]=x.useState(null),N=kt(e,Ze=>A(Ze)),[O,T]=x.useState(null),L=Fx(O),H=(L==null?void 0:L.width)??0,W=(L==null?void 0:L.height)??0,ee=r+(a!=="center"?"-"+a:""),q=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],ce=de.length>0,ve={padding:q,boundary:de.filter(aF),altBoundary:ce},{refs:K,floatingStyles:Z,placement:G,isPositioned:re,middlewareData:J}=GL({strategy:"fixed",placement:ee,whileElementsMounted:(...Ze)=>RL(...Ze,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[WL({mainAxis:o+W,alignmentAxis:s}),u&&qL({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?YL():void 0,...ve}),u&&JL({...ve}),QL({...ve,apply:({elements:Ze,rects:nt,availableWidth:Tt,availableHeight:ln})=>{const{width:Ot,height:mn}=nt.reference,en=Ze.floating.style;en.setProperty("--radix-popper-available-width",`${Tt}px`),en.setProperty("--radix-popper-available-height",`${ln}px`),en.setProperty("--radix-popper-anchor-width",`${Ot}px`),en.setProperty("--radix-popper-anchor-height",`${mn}px`)}}),O&&ZL({element:O,padding:l}),sF({arrowWidth:H,arrowHeight:W}),w&&XL({strategy:"referenceHidden",...ve})]}),[X,U]=yS(G),te=xr(C);gn(()=>{re&&(te==null||te())},[re,te]);const be=(z=J.arrow)==null?void 0:z.x,Ee=(ue=J.arrow)==null?void 0:ue.y,Ce=((Ae=J.arrow)==null?void 0:Ae.centerOffset)!==0,[Ne,Te]=x.useState();return gn(()=>{k&&Te(window.getComputedStyle(k).zIndex)},[k]),d.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[(xe=J.transformOrigin)==null?void 0:xe.x,(Pe=J.transformOrigin)==null?void 0:Pe.y].join(" "),...((ae=J.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(rF,{scope:n,placedSide:X,onArrowChange:T,arrowX:be,arrowY:Ee,shouldHideArrow:Ce,children:d.jsx(tt.div,{"data-side":X,"data-align":U,...v,ref:N,style:{...v.style,animation:re?void 0:"none"}})})})});gS.displayName=Wg;var mS="PopperArrow",iF={top:"bottom",right:"left",bottom:"top",left:"right"},vS=x.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=oF(mS,r),s=iF[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(tF,{...o,ref:n,style:{...o.style,display:"block"}})})});vS.displayName=mS;function aF(t){return t!==null}var sF=t=>({name:"transformOrigin",options:t,fn(e){var b,k,A;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=yS(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((k=o.arrow)==null?void 0:k.x)??0)+l/2,y=(((A=o.arrow)==null?void 0:A.y)??0)+u/2;let C="",v="";return h==="bottom"?(C=s?g:`${w}px`,v=`${-u}px`):h==="top"?(C=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(C=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(C=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x:C,y:v}}}});function yS(t){const[e,n="center"]=t.split("-");return[e,n]}var wS=fS,bS=pS,CS=gS,xS=vS,[vu]=Io("Tooltip",[mu]),yu=mu(),_S="TooltipProvider",cF=700,qg="tooltip.open",[lF,Yg]=vu(_S),SS=t=>{const{__scopeTooltip:e,delayDuration:n=cF,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=t,s=x.useRef(!0),l=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),d.jsx(lF,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(h=>{l.current=h},[]),disableHoverableContent:o,children:a})};SS.displayName=_S;var Sc="Tooltip",[dF,Tc]=vu(Sc),TS=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=t,u=Yg(Sc,t.__scopeTooltip),h=yu(e),[p,g]=x.useState(null),w=ko(),y=x.useRef(0),C=s??u.disableHoverableContent,v=l??u.delayDuration,b=x.useRef(!1),[k,A]=li({prop:r,defaultProp:o??!1,onChange:H=>{H?(u.onOpen(),document.dispatchEvent(new CustomEvent(qg))):u.onClose(),a==null||a(H)},caller:Sc}),N=x.useMemo(()=>k?b.current?"delayed-open":"instant-open":"closed",[k]),O=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,A(!0)},[A]),T=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,A(!1)},[A]),L=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,A(!0),y.current=0},v)},[v,A]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),d.jsx(wS,{...h,children:d.jsx(dF,{scope:e,contentId:w,open:k,stateAttribute:N,trigger:p,onTriggerChange:g,onTriggerEnter:x.useCallback(()=>{u.isOpenDelayedRef.current?L():O()},[u.isOpenDelayedRef,L,O]),onTriggerLeave:x.useCallback(()=>{C?T():(window.clearTimeout(y.current),y.current=0)},[T,C]),onOpen:O,onClose:T,disableHoverableContent:C,children:n})})};TS.displayName=Sc;var Jg="TooltipTrigger",ES=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Tc(Jg,n),a=Yg(Jg,n),s=yu(n),l=x.useRef(null),u=kt(e,l,o.onTriggerChange),h=x.useRef(!1),p=x.useRef(!1),g=x.useCallback(()=>h.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),d.jsx(bS,{asChild:!0,...s,children:d.jsx(tt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ke(t.onPointerMove,w=>{w.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ke(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ke(t.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ke(t.onFocus,()=>{h.current||o.onOpen()}),onBlur:Ke(t.onBlur,o.onClose),onClick:Ke(t.onClick,o.onClose)})})});ES.displayName=Jg;var Qg="TooltipPortal",[uF,fF]=vu(Qg,{forceMount:void 0}),AS=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,a=Tc(Qg,e);return d.jsx(uF,{scope:e,forceMount:n,children:d.jsx(No,{present:n||a.open,children:d.jsx(oc,{asChild:!0,container:o,children:r})})})};AS.displayName=Qg;var es="TooltipContent",IS=x.forwardRef((t,e)=>{const n=fF(es,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=t,s=Tc(es,t.__scopeTooltip);return d.jsx(No,{present:r||s.open,children:s.disableHoverableContent?d.jsx(kS,{side:o,...a,ref:e}):d.jsx(hF,{side:o,...a,ref:e})})}),hF=x.forwardRef((t,e)=>{const n=Tc(es,t.__scopeTooltip),r=Yg(es,t.__scopeTooltip),o=x.useRef(null),a=kt(e,o),[s,l]=x.useState(null),{trigger:u,onClose:h}=n,p=o.current,{onPointerInTransitChange:g}=r,w=x.useCallback(()=>{l(null),g(!1)},[g]),y=x.useCallback((C,v)=>{const b=C.currentTarget,k={x:C.clientX,y:C.clientY},A=yF(k,b.getBoundingClientRect()),N=wF(k,A),O=bF(v.getBoundingClientRect()),T=xF([...N,...O]);l(T),g(!0)},[g]);return x.useEffect(()=>()=>w(),[w]),x.useEffect(()=>{if(u&&p){const C=b=>y(b,p),v=b=>y(b,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",v)}}},[u,p,y,w]),x.useEffect(()=>{if(s){const C=v=>{const b=v.target,k={x:v.clientX,y:v.clientY},A=(u==null?void 0:u.contains(b))||(p==null?void 0:p.contains(b)),N=!CF(k,s);A?w():N&&(w(),h())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,s,h,w]),d.jsx(kS,{...t,ref:a})}),[pF,gF]=vu(Sc,{isInside:!1}),mF=kO("TooltipContent"),kS=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=t,u=Tc(es,n),h=yu(n),{onClose:p}=u;return x.useEffect(()=>(document.addEventListener(qg,p),()=>document.removeEventListener(qg,p)),[p]),x.useEffect(()=>{if(u.trigger){const g=w=>{const y=w.target;y!=null&&y.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),d.jsx(rc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:d.jsxs(CS,{"data-state":u.stateAttribute,...h,...l,ref:e,style:{...l.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:[d.jsx(mF,{children:r}),d.jsx(pF,{scope:n,isInside:!0,children:d.jsx(vR,{id:u.contentId,role:"tooltip",children:o||r})})]})})});IS.displayName=es;var NS="TooltipArrow",vF=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=yu(n);return gF(NS,n).isInside?null:d.jsx(xS,{...o,...r,ref:e})});vF.displayName=NS;function yF(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wF(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function bF(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function CF(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const l=e[a],u=e[s],h=l.x,p=l.y,g=u.x,w=u.y;p>r!=w>r&&n<(g-h)*(r-p)/(w-p)+h&&(o=!o)}return o}function xF(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),_F(e)}function _F(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var SF=SS,TF=TS,EF=ES,AF=AS,PS=IS;const Mn=SF,Dn=TF,Rn=EF,xn=x.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(AF,{children:d.jsx(PS,{ref:r,sideOffset:e,className:Ge("z-[100001] overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",t),...n})}));xn.displayName=PS.displayName;function IF({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const kF=x.forwardRef(IF);var NF=function(t){return function(e,n){var r=M.useRef(!1);t(function(){return function(){r.current=!1}},[]),t(function(){if(!r.current)r.current=!0;else return e()},n)}},OS=function(t){return typeof t=="function"},MS=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const PF=NF(M.useEffect);function DS(t){var e=M.useRef(t);return e.current=t,e}var OF=function(t){MS&&(OS(t)||console.error("useUnmount expected parameter is a function, got ".concat(typeof t)));var e=DS(t);M.useEffect(function(){return function(){e.current()}},[])};function MF(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var RS=MF,DF=typeof so=="object"&&so&&so.Object===Object&&so,RF=DF,LF=RF,FF=typeof self=="object"&&self&&self.Object===Object&&self,UF=LF||FF||Function("return this")(),LS=UF,$F=LS,HF=function(){return $F.Date.now()},BF=HF,zF=/\s/;function VF(t){for(var e=t.length;e--&&zF.test(t.charAt(e)););return e}var KF=VF,GF=KF,jF=/^\s+/;function WF(t){return t&&t.slice(0,GF(t)+1).replace(jF,"")}var qF=WF,YF=LS,JF=YF.Symbol,FS=JF,US=FS,$S=Object.prototype,QF=$S.hasOwnProperty,XF=$S.toString,Ec=US?US.toStringTag:void 0;function ZF(t){var e=QF.call(t,Ec),n=t[Ec];try{t[Ec]=void 0;var r=!0}catch{}var o=XF.call(t);return r&&(e?t[Ec]=n:delete t[Ec]),o}var e2=ZF,t2=Object.prototype,n2=t2.toString;function r2(t){return n2.call(t)}var o2=r2,HS=FS,i2=e2,a2=o2,s2="[object Null]",c2="[object Undefined]",BS=HS?HS.toStringTag:void 0;function l2(t){return t==null?t===void 0?c2:s2:BS&&BS in Object(t)?i2(t):a2(t)}var d2=l2;function u2(t){return t!=null&&typeof t=="object"}var f2=u2,h2=d2,p2=f2,g2="[object Symbol]";function m2(t){return typeof t=="symbol"||p2(t)&&h2(t)==g2}var v2=m2,y2=qF,zS=RS,w2=v2,VS=NaN,b2=/^[-+]0x[0-9a-f]+$/i,C2=/^0b[01]+$/i,x2=/^0o[0-7]+$/i,_2=parseInt;function S2(t){if(typeof t=="number")return t;if(w2(t))return VS;if(zS(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=zS(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=y2(t);var n=C2.test(t);return n||x2.test(t)?_2(t.slice(2),n?2:8):b2.test(t)?VS:+t}var T2=S2,E2=RS,Xg=BF,KS=T2,A2="Expected a function",I2=Math.max,k2=Math.min;function N2(t,e,n){var r,o,a,s,l,u,h=0,p=!1,g=!1,w=!0;if(typeof t!="function")throw new TypeError(A2);e=KS(e)||0,E2(n)&&(p=!!n.leading,g="maxWait"in n,a=g?I2(KS(n.maxWait)||0,e):a,w="trailing"in n?!!n.trailing:w);function y(L){var H=r,W=o;return r=o=void 0,h=L,s=t.apply(W,H),s}function C(L){return h=L,l=setTimeout(k,e),p?y(L):s}function v(L){var H=L-u,W=L-h,ee=e-H;return g?k2(ee,a-W):ee}function b(L){var H=L-u,W=L-h;return u===void 0||H>=e||H<0||g&&W>=a}function k(){var L=Xg();if(b(L))return A(L);l=setTimeout(k,v(L))}function A(L){return l=void 0,w&&r?y(L):(r=o=void 0,s)}function N(){l!==void 0&&clearTimeout(l),h=0,r=u=o=l=void 0}function O(){return l===void 0?s:A(Xg())}function T(){var L=Xg(),H=b(L);if(r=arguments,o=this,u=L,H){if(l===void 0)return C(u);if(g)return clearTimeout(l),l=setTimeout(k,e),y(u)}return l===void 0&&(l=setTimeout(k,e)),s}return T.cancel=N,T.flush=O,T}var P2=N2;const O2=Ld(P2);function M2(){var t=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,e=typeof self=="object"&&self&&self.Object===Object&&self;return t||e}M2()||(global.Date=Date);function D2(t,e){var n;MS&&(OS(t)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof t)));var r=DS(t),o=(n=e==null?void 0:e.wait)!==null&&n!==void 0?n:1e3,a=M.useMemo(function(){return O2(function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return r.current.apply(r,CC([],bC(s),!1))},o,e)},[]);return OF(function(){a.cancel()}),{run:a,cancel:a.cancel,flush:a.flush}}function R2(t,e,n){var r=bC(M.useState({}),2),o=r[0],a=r[1],s=D2(function(){a({})},n).run;M.useEffect(function(){return s()},e),PF(t,[o])}const L2=M.forwardRef(({onChange:t},e)=>{const n=M.useRef(null),[r,o]=M.useState("");return M.useImperativeHandle(e,()=>({setValue:a=>{var s;o(a),(s=n.current)==null||s.focus()}})),R2(()=>{t==null||t(r)},[r],{wait:300}),d.jsxs(d.Fragment,{children:[d.jsx(Gn,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:a=>o(a.target.value),className:"pr-8"}),r&&d.jsx("button",{onClick:()=>{var a;o(""),(a=n.current)==null||a.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:d.jsx(kF,{className:"h-5 w-5"})})]})});function GS(t,e){return function(){return t.apply(e,arguments)}}const{toString:F2}=Object.prototype,{getPrototypeOf:Zg}=Object,{iterator:wu,toStringTag:jS}=Symbol,bu=(t=>e=>{const n=F2.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gr=t=>(t=t.toLowerCase(),e=>bu(e)===t),Cu=t=>e=>typeof e===t,{isArray:ts}=Array,ns=Cu("undefined");function Ac(t){return t!==null&&!ns(t)&&t.constructor!==null&&!ns(t.constructor)&&Wn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const WS=Gr("ArrayBuffer");function U2(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&WS(t.buffer),e}const $2=Cu("string"),Wn=Cu("function"),qS=Cu("number"),Ic=t=>t!==null&&typeof t=="object",H2=t=>t===!0||t===!1,xu=t=>{if(bu(t)!=="object")return!1;const e=Zg(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jS in t)&&!(wu in t)},B2=t=>{if(!Ic(t)||Ac(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},z2=Gr("Date"),V2=Gr("File"),K2=Gr("Blob"),G2=Gr("FileList"),j2=t=>Ic(t)&&Wn(t.pipe),W2=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Wn(t.append)&&((e=bu(t))==="formdata"||e==="object"&&Wn(t.toString)&&t.toString()==="[object FormData]"))},q2=Gr("URLSearchParams"),[Y2,J2,Q2,X2]=["ReadableStream","Request","Response","Headers"].map(Gr),Z2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kc(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),ts(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(Ac(t))return;const a=n?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;let l;for(r=0;r<s;r++)l=a[r],e.call(null,t[l],l,t)}}function YS(t,e){if(Ac(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const Gi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JS=t=>!ns(t)&&t!==Gi;function em(){const{caseless:t,skipUndefined:e}=JS(this)&&this||{},n={},r=(o,a)=>{const s=t&&YS(n,a)||a;xu(n[s])&&xu(o)?n[s]=em(n[s],o):xu(o)?n[s]=em({},o):ts(o)?n[s]=o.slice():(!e||!ns(o))&&(n[s]=o)};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&kc(arguments[o],r);return n}const eU=(t,e,n,{allOwnKeys:r}={})=>(kc(e,(o,a)=>{n&&Wn(o)?t[a]=GS(o,n):t[a]=o},{allOwnKeys:r}),t),tU=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nU=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},rU=(t,e,n,r)=>{let o,a,s;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)s=o[a],(!r||r(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=n!==!1&&Zg(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},oU=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},iU=t=>{if(!t)return null;if(ts(t))return t;let e=t.length;if(!qS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},aU=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Zg(Uint8Array)),sU=(t,e)=>{const r=(t&&t[wu]).call(t);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(t,a[0],a[1])}},cU=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},lU=Gr("HTMLFormElement"),dU=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),QS=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),uU=Gr("RegExp"),XS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};kc(n,(o,a)=>{let s;(s=e(o,a,t))!==!1&&(r[a]=s||o)}),Object.defineProperties(t,r)},fU=t=>{XS(t,(e,n)=>{if(Wn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Wn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},hU=(t,e)=>{const n={},r=o=>{o.forEach(a=>{n[a]=!0})};return ts(t)?r(t):r(String(t).split(e)),n},pU=()=>{},gU=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function mU(t){return!!(t&&Wn(t.append)&&t[jS]==="FormData"&&t[wu])}const vU=t=>{const e=new Array(10),n=(r,o)=>{if(Ic(r)){if(e.indexOf(r)>=0)return;if(Ac(r))return r;if(!("toJSON"in r)){e[o]=r;const a=ts(r)?[]:{};return kc(r,(s,l)=>{const u=n(s,o+1);!ns(u)&&(a[l]=u)}),e[o]=void 0,a}}return r};return n(t,0)},yU=Gr("AsyncFunction"),wU=t=>t&&(Ic(t)||Wn(t))&&Wn(t.then)&&Wn(t.catch),ZS=((t,e)=>t?setImmediate:e?((n,r)=>(Gi.addEventListener("message",({source:o,data:a})=>{o===Gi&&a===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Gi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wn(Gi.postMessage)),bU=typeof queueMicrotask<"u"?queueMicrotask.bind(Gi):typeof process<"u"&&process.nextTick||ZS,oe={isArray:ts,isArrayBuffer:WS,isBuffer:Ac,isFormData:W2,isArrayBufferView:U2,isString:$2,isNumber:qS,isBoolean:H2,isObject:Ic,isPlainObject:xu,isEmptyObject:B2,isReadableStream:Y2,isRequest:J2,isResponse:Q2,isHeaders:X2,isUndefined:ns,isDate:z2,isFile:V2,isBlob:K2,isRegExp:uU,isFunction:Wn,isStream:j2,isURLSearchParams:q2,isTypedArray:aU,isFileList:G2,forEach:kc,merge:em,extend:eU,trim:Z2,stripBOM:tU,inherits:nU,toFlatObject:rU,kindOf:bu,kindOfTest:Gr,endsWith:oU,toArray:iU,forEachEntry:sU,matchAll:cU,isHTMLForm:lU,hasOwnProperty:QS,hasOwnProp:QS,reduceDescriptors:XS,freezeMethods:fU,toObjectSet:hU,toCamelCase:dU,noop:pU,toFiniteNumber:gU,findKey:YS,global:Gi,isContextDefined:JS,isSpecCompliantForm:mU,toJSONObject:vU,isAsyncFn:yU,isThenable:wU,setImmediate:ZS,asap:bU,isIterable:t=>t!=null&&Wn(t[wu])};function ot(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}oe.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const eT=ot.prototype,tT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{tT[t]={value:t}}),Object.defineProperties(ot,tT),Object.defineProperty(eT,"isAxiosError",{value:!0}),ot.from=(t,e,n,r,o,a)=>{const s=Object.create(eT);oe.toFlatObject(t,s,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return ot.call(s,l,u,n,r,o),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",a&&Object.assign(s,a),s};const CU=null;function tm(t){return oe.isPlainObject(t)||oe.isArray(t)}function nT(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function rT(t,e,n){return t?t.concat(e).map(function(o,a){return o=nT(o),!n&&a?"["+o+"]":o}).join(n?".":""):e}function xU(t){return oe.isArray(t)&&!t.some(tm)}const _U=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function _u(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!oe.isUndefined(b[v])});const r=n.metaTokens,o=n.visitor||p,a=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function h(C){if(C===null)return"";if(oe.isDate(C))return C.toISOString();if(oe.isBoolean(C))return C.toString();if(!u&&oe.isBlob(C))throw new ot("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(C)||oe.isTypedArray(C)?u&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function p(C,v,b){let k=C;if(C&&!b&&typeof C=="object"){if(oe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),C=JSON.stringify(C);else if(oe.isArray(C)&&xU(C)||(oe.isFileList(C)||oe.endsWith(v,"[]"))&&(k=oe.toArray(C)))return v=nT(v),k.forEach(function(N,O){!(oe.isUndefined(N)||N===null)&&e.append(s===!0?rT([v],O,a):s===null?v:v+"[]",h(N))}),!1}return tm(C)?!0:(e.append(rT(b,v,a),h(C)),!1)}const g=[],w=Object.assign(_U,{defaultVisitor:p,convertValue:h,isVisitable:tm});function y(C,v){if(!oe.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(C),oe.forEach(C,function(k,A){(!(oe.isUndefined(k)||k===null)&&o.call(e,k,oe.isString(A)?A.trim():A,v,w))===!0&&y(k,v?v.concat(A):[A])}),g.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return y(t),e}function oT(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function nm(t,e){this._pairs=[],t&&_u(t,this,e)}const iT=nm.prototype;iT.append=function(e,n){this._pairs.push([e,n])},iT.toString=function(e){const n=e?function(r){return e.call(this,r,oT)}:oT;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function SU(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aT(t,e,n){if(!e)return t;const r=n&&n.encode||SU;oe.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(o?a=o(e,n):a=oe.isURLSearchParams(e)?e.toString():new nm(e,n).toString(r),a){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class sT{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const cT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},TU={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:nm,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},rm=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,EU=rm&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),AU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",IU=rm&&window.location.href||"http://localhost",_n={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rm,hasStandardBrowserEnv:EU,hasStandardBrowserWebWorkerEnv:AU,navigator:om,origin:IU},Symbol.toStringTag,{value:"Module"})),...TU};function kU(t,e){return _u(t,new _n.classes.URLSearchParams,{visitor:function(n,r,o,a){return _n.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}function NU(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function PU(t){const e={},n=Object.keys(t);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],e[a]=t[a];return e}function lT(t){function e(n,r,o,a){let s=n[a++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),u=a>=n.length;return s=!s&&oe.isArray(o)?o.length:s,u?(oe.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!l):((!o[s]||!oe.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],a)&&oe.isArray(o[s])&&(o[s]=PU(o[s])),!l)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,o)=>{e(NU(r),o,n,0)}),n}return null}function OU(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Nc={transitional:cT,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=oe.isObject(e);if(a&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return o?JSON.stringify(lT(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kU(e,this.formSerializer).toString();if((l=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return _u(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||o?(n.setContentType("application/json",!1),OU(e)):e}],transformResponse:[function(e){const n=this.transitional||Nc.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?ot.from(l,ot.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_n.classes.FormData,Blob:_n.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{Nc.headers[t]={}});const MU=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),DU=t=>{const e={};let n,r,o;return t&&t.split(`
210
- `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&MU[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},dT=Symbol("internals");function Pc(t){return t&&String(t).trim().toLowerCase()}function Su(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Su):String(t)}function RU(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const LU=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function im(t,e,n,r,o){if(oe.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function FU(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function UU(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,a,s){return this[r].call(this,e,o,a,s)},configurable:!0})})}let qn=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function a(l,u,h){const p=Pc(u);if(!p)throw new Error("header name must be a non-empty string");const g=oe.findKey(o,p);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||u]=Su(l))}const s=(l,u)=>oe.forEach(l,(h,p)=>a(h,p,u));if(oe.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(oe.isString(e)&&(e=e.trim())&&!LU(e))s(DU(e),n);else if(oe.isObject(e)&&oe.isIterable(e)){let l={},u,h;for(const p of e){if(!oe.isArray(p))throw TypeError("Object iterator must return a key-value pair");l[h=p[0]]=(u=l[h])?oe.isArray(u)?[...u,p[1]]:[u,p[1]]:p[1]}s(l,n)}else e!=null&&a(n,e,r);return this}get(e,n){if(e=Pc(e),e){const r=oe.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return RU(o);if(oe.isFunction(n))return n.call(this,o,r);if(oe.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Pc(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||im(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function a(s){if(s=Pc(s),s){const l=oe.findKey(r,s);l&&(!n||im(r,r[l],l,n))&&(delete r[l],o=!0)}}return oe.isArray(e)?e.forEach(a):a(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const a=n[r];(!e||im(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const n=this,r={};return oe.forEach(this,(o,a)=>{const s=oe.findKey(r,a);if(s){n[s]=Su(o),delete n[a];return}const l=e?FU(a):String(a).trim();l!==a&&delete n[a],n[l]=Su(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
211
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[dT]=this[dT]={accessors:{}}).accessors,o=this.prototype;function a(s){const l=Pc(s);r[l]||(UU(o,s),r[l]=!0)}return oe.isArray(e)?e.forEach(a):a(e),this}};qn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(qn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),oe.freezeMethods(qn);function am(t,e){const n=this||Nc,r=e||n,o=qn.from(r.headers);let a=r.data;return oe.forEach(t,function(l){a=l.call(n,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function uT(t){return!!(t&&t.__CANCEL__)}function rs(t,e,n){ot.call(this,t??"canceled",ot.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(rs,ot,{__CANCEL__:!0});function fT(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ot("Request failed with status code "+n.status,[ot.ERR_BAD_REQUEST,ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $U(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function HU(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,a=0,s;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),p=r[a];s||(s=h),n[o]=u,r[o]=h;let g=a,w=0;for(;g!==o;)w+=n[g++],g=g%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),h-s<e)return;const y=p&&h-p;return y?Math.round(w*1e3/y):void 0}}function BU(t,e){let n=0,r=1e3/e,o,a;const s=(h,p=Date.now())=>{n=p,o=null,a&&(clearTimeout(a),a=null),t(...h)};return[(...h)=>{const p=Date.now(),g=p-n;g>=r?s(h,p):(o=h,a||(a=setTimeout(()=>{a=null,s(o)},r-g)))},()=>o&&s(o)]}const Tu=(t,e,n=3)=>{let r=0;const o=HU(50,250);return BU(a=>{const s=a.loaded,l=a.lengthComputable?a.total:void 0,u=s-r,h=o(u),p=s<=l;r=s;const g={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&p?(l-s)/h:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(g)},n)},hT=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},pT=t=>(...e)=>oe.asap(()=>t(...e)),zU=_n.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,_n.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(_n.origin),_n.navigator&&/(msie|trident)/i.test(_n.navigator.userAgent)):()=>!0,VU=_n.hasStandardBrowserEnv?{write(t,e,n,r,o,a){const s=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&s.push("path="+r),oe.isString(o)&&s.push("domain="+o),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function KU(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function GU(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gT(t,e,n){let r=!KU(e);return t&&(r||n==!1)?GU(t,e):e}const mT=t=>t instanceof qn?{...t}:t;function ji(t,e){e=e||{};const n={};function r(h,p,g,w){return oe.isPlainObject(h)&&oe.isPlainObject(p)?oe.merge.call({caseless:w},h,p):oe.isPlainObject(p)?oe.merge({},p):oe.isArray(p)?p.slice():p}function o(h,p,g,w){if(oe.isUndefined(p)){if(!oe.isUndefined(h))return r(void 0,h,g,w)}else return r(h,p,g,w)}function a(h,p){if(!oe.isUndefined(p))return r(void 0,p)}function s(h,p){if(oe.isUndefined(p)){if(!oe.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function l(h,p,g){if(g in e)return r(h,p);if(g in t)return r(void 0,h)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(h,p,g)=>o(mT(h),mT(p),g,!0)};return oe.forEach(Object.keys({...t,...e}),function(p){const g=u[p]||o,w=g(t[p],e[p],p);oe.isUndefined(w)&&g!==l||(n[p]=w)}),n}const vT=t=>{const e=ji({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=e;if(e.headers=s=qn.from(s),e.url=aT(gT(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),oe.isFormData(n)){if(_n.hasStandardBrowserEnv||_n.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(oe.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([p,g])=>{h.includes(p.toLowerCase())&&s.set(p,g)})}}if(_n.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(e)),r||r!==!1&&zU(e.url))){const u=o&&a&&VU.read(a);u&&s.set(o,u)}return e},jU=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=vT(t);let a=o.data;const s=qn.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=o,p,g,w,y,C;function v(){y&&y(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function k(){if(!b)return;const N=qn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:N,config:t,request:b};fT(function(H){n(H),v()},function(H){r(H),v()},T),b=null}"onloadend"in b?b.onloadend=k:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(k)},b.onabort=function(){b&&(r(new ot("Request aborted",ot.ECONNABORTED,t,b)),b=null)},b.onerror=function(O){const T=O&&O.message?O.message:"Network Error",L=new ot(T,ot.ERR_NETWORK,t,b);L.event=O||null,r(L),b=null},b.ontimeout=function(){let O=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||cT;o.timeoutErrorMessage&&(O=o.timeoutErrorMessage),r(new ot(O,T.clarifyTimeoutError?ot.ETIMEDOUT:ot.ECONNABORTED,t,b)),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&oe.forEach(s.toJSON(),function(O,T){b.setRequestHeader(T,O)}),oe.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),h&&([w,C]=Tu(h,!0),b.addEventListener("progress",w)),u&&b.upload&&([g,y]=Tu(u),b.upload.addEventListener("progress",g),b.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(p=N=>{b&&(r(!N||N.type?new rs(null,t,b):N),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const A=$U(o.url);if(A&&_n.protocols.indexOf(A)===-1){r(new ot("Unsupported protocol "+A+":",ot.ERR_BAD_REQUEST,t));return}b.send(a||null)})},WU=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const a=function(h){if(!o){o=!0,l();const p=h instanceof Error?h:this.reason;r.abort(p instanceof ot?p:new rs(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{s=null,a(new ot(`timeout ${e} of ms exceeded`,ot.ETIMEDOUT))},e);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(a):h.removeEventListener("abort",a)}),t=null)};t.forEach(h=>h.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>oe.asap(l),u}},qU=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},YU=async function*(t,e){for await(const n of JU(t))yield*qU(n,e)},JU=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},yT=(t,e,n,r)=>{const o=YU(t,e);let a=0,s,l=u=>{s||(s=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:h,value:p}=await o.next();if(h){l(),u.close();return}let g=p.byteLength;if(n){let w=a+=g;n(w)}u.enqueue(new Uint8Array(p))}catch(h){throw l(h),h}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},wT=64*1024,{isFunction:Eu}=oe,QU=(({Request:t,Response:e})=>({Request:t,Response:e}))(oe.global),{ReadableStream:bT,TextEncoder:CT}=oe.global,xT=(t,...e)=>{try{return!!t(...e)}catch{return!1}},XU=t=>{t=oe.merge.call({skipUndefined:!0},QU,t);const{fetch:e,Request:n,Response:r}=t,o=e?Eu(e):typeof fetch=="function",a=Eu(n),s=Eu(r);if(!o)return!1;const l=o&&Eu(bT),u=o&&(typeof CT=="function"?(C=>v=>C.encode(v))(new CT):async C=>new Uint8Array(await new n(C).arrayBuffer())),h=a&&l&&xT(()=>{let C=!1;const v=new n(_n.origin,{body:new bT,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!v}),p=s&&l&&xT(()=>oe.isReadableStream(new r("").body)),g={stream:p&&(C=>C.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(v,b)=>{let k=v&&v[C];if(k)return k.call(v);throw new ot(`Response type '${C}' is not supported`,ot.ERR_NOT_SUPPORT,b)})});const w=async C=>{if(C==null)return 0;if(oe.isBlob(C))return C.size;if(oe.isSpecCompliantForm(C))return(await new n(_n.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(C)||oe.isArrayBuffer(C))return C.byteLength;if(oe.isURLSearchParams(C)&&(C=C+""),oe.isString(C))return(await u(C)).byteLength},y=async(C,v)=>{const b=oe.toFiniteNumber(C.getContentLength());return b??w(v)};return async C=>{let{url:v,method:b,data:k,signal:A,cancelToken:N,timeout:O,onDownloadProgress:T,onUploadProgress:L,responseType:H,headers:W,withCredentials:ee="same-origin",fetchOptions:q}=vT(C),de=e||fetch;H=H?(H+"").toLowerCase():"text";let ce=WU([A,N&&N.toAbortSignal()],O),ve=null;const K=ce&&ce.unsubscribe&&(()=>{ce.unsubscribe()});let Z;try{if(L&&h&&b!=="get"&&b!=="head"&&(Z=await y(W,k))!==0){let te=new n(v,{method:"POST",body:k,duplex:"half"}),be;if(oe.isFormData(k)&&(be=te.headers.get("content-type"))&&W.setContentType(be),te.body){const[Ee,Ce]=hT(Z,Tu(pT(L)));k=yT(te.body,wT,Ee,Ce)}}oe.isString(ee)||(ee=ee?"include":"omit");const G=a&&"credentials"in n.prototype,re={...q,signal:ce,method:b.toUpperCase(),headers:W.normalize().toJSON(),body:k,duplex:"half",credentials:G?ee:void 0};ve=a&&new n(v,re);let J=await(a?de(ve,q):de(v,re));const X=p&&(H==="stream"||H==="response");if(p&&(T||X&&K)){const te={};["status","statusText","headers"].forEach(Ne=>{te[Ne]=J[Ne]});const be=oe.toFiniteNumber(J.headers.get("content-length")),[Ee,Ce]=T&&hT(be,Tu(pT(T),!0))||[];J=new r(yT(J.body,wT,Ee,()=>{Ce&&Ce(),K&&K()}),te)}H=H||"text";let U=await g[oe.findKey(g,H)||"text"](J,C);return!X&&K&&K(),await new Promise((te,be)=>{fT(te,be,{data:U,headers:qn.from(J.headers),status:J.status,statusText:J.statusText,config:C,request:ve})})}catch(G){throw K&&K(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new ot("Network Error",ot.ERR_NETWORK,C,ve),{cause:G.cause||G}):ot.from(G,G&&G.code,C,ve)}}},ZU=new Map,_T=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:o}=e,a=[r,o,n];let s=a.length,l=s,u,h,p=ZU;for(;l--;)u=a[l],h=p.get(u),h===void 0&&p.set(u,h=l?new Map:XU(e)),p=h;return h};_T();const sm={http:CU,xhr:jU,fetch:{get:_T}};oe.forEach(sm,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ST=t=>`- ${t}`,e$=t=>oe.isFunction(t)||t===null||t===!1,TT={getAdapter:(t,e)=>{t=oe.isArray(t)?t:[t];const{length:n}=t;let r,o;const a={};for(let s=0;s<n;s++){r=t[s];let l;if(o=r,!e$(r)&&(o=sm[(l=String(r)).toLowerCase()],o===void 0))throw new ot(`Unknown adapter '${l}'`);if(o&&(oe.isFunction(o)||(o=o.get(e))))break;a[l||"#"+s]=o}if(!o){const s=Object.entries(a).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=n?s.length>1?`since :
209
+ `);var ug=t=>typeof t=="number"&&!isNaN(t),cc=t=>typeof t=="string",Cx=t=>typeof t=="function",QM=t=>cc(t)||ug(t),XM=t=>M.isValidElement(t)||cc(t)||Cx(t)||ug(t),ZM=1,xx=()=>`${ZM++}`,co=new Map,fg=[],_x=new Set,Sx=()=>co.size>0,eD=(t,{containerId:e})=>{var n;return(n=co.get(e||1))==null?void 0:n.toasts.get(t)};function tD(t,e){var n;if(e)return!!((n=co.get(e))!=null&&n.isToastActive(t));let r=!1;return co.forEach(o=>{o.isToastActive(t)&&(r=!0)}),r}function nD(t){if(!Sx()){fg=fg.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||QM(t))co.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=co.get(t.containerId);e?e.removeToast(t.id):co.forEach(n=>{n.removeToast(t.id)})}}var rD=(t={})=>{co.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function oD(t,e){XM(t)&&(Sx()||fg.push({content:t,options:e}),co.forEach(n=>{n.buildToast(t,e)}))}function Tx(t,e){co.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function iD(t){return _x.add(t),()=>{_x.delete(t)}}function aD(t){return t&&(cc(t.toastId)||ug(t.toastId))?t.toastId:xx()}function lc(t,e){return oD(t,e),e.toastId}function $d(t,e){return{...e,type:e&&e.type||t,toastId:aD(e)}}function Hd(t){return(e,n)=>lc(e,$d(t,n))}function lt(t,e){return lc(t,$d("default",e))}lt.loading=(t,e)=>lc(t,$d("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function sD(t,{pending:e,error:n,success:r},o){let a;e&&(a=cc(e)?lt.loading(e,o):lt.loading(e.render,{...o,...e}));let s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(h,p,g)=>{if(p==null){lt.dismiss(a);return}let w={type:h,...s,...o,data:g},y=cc(p)?{render:p}:p;return a?lt.update(a,{...w,...y}):lt(y.render,{...w,...y}),g},u=Cx(t)?t():t;return u.then(h=>l("success",r,h)).catch(h=>l("error",n,h)),u}lt.promise=sD,lt.success=Hd("success"),lt.info=Hd("info"),lt.error=Hd("error"),lt.warning=Hd("warning"),lt.warn=lt.warning,lt.dark=(t,e)=>lc(t,$d("default",{theme:"dark",...e}));function cD(t){nD(t)}lt.dismiss=cD,lt.clearWaitingQueue=rD,lt.isActive=tD,lt.update=(t,e={})=>{let n=eD(t,e);if(n){let{props:r,content:o}=n,a={delay:100,...r,...e,toastId:e.toastId||t,updateId:xx()};a.toastId!==t&&(a.staleId=t);let s=a.render||o;delete a.render,lc(s,a)}},lt.done=t=>{lt.update(t,{progress:1})},lt.onChange=iD,lt.play=t=>Tx(!0,t),lt.pause=t=>Tx(!1,t);const lD={category:"Thư mục gốc",fileName:"Tên tệp",fullPath:"Đường dẫn đầy đủ",createAt:"Ngày tạo",creator:"Người tạo",creatorId:"ID người tạo",DataSource:"Nguồn dữ liệu",SuggestedAICategories:"Danh mục AI gợi ý",KeywordAISuggestion:"Từ khóa AI gợi ý",SummaryOfSuggestedAI:"Tóm tắt AI gợi ý",AccessLevel:"Cấp độ truy cập"},dD=t=>t==="SummaryOfSuggestedAI"||t==="KeywordAISuggestion"||t==="SuggestedAICategories",hg=t=>t==="fullPath"||t==="createAt"||t==="creator"||t==="creatorId"||t==="DataSource"||t==="AccessLevel"||t==="category"||t==="fileName",uD={STARTING:"Đang bắt đầu",IN_PROGRESS:"Đang đồng bộ",COMPLETE:"Đồng bộ thành công",FAILED:"Đồng bộ thất bại",STOPPING:"Đang dừng",STOPPED:"Đã dừng"},fD=t=>uD[t]||t,pg="-",hD=t=>{const e=gD(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{const l=s.split(pg);return l[0]===""&&l.length!==1&&l.shift(),Ex(l,e)||pD(s)},getConflictingClassGroupIds:(s,l)=>{const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}}},Ex=(t,e)=>{var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?Ex(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const a=t.join(pg);return(s=e.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},Ax=/^\[(.+)\]$/,pD=t=>{if(Ax.test(t)){const e=Ax.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},gD=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return vD(Object.entries(t.classGroups),n).forEach(([a,s])=>{gg(s,r,a,e)}),r},gg=(t,e,n,r)=>{t.forEach(o=>{if(typeof o=="string"){const a=o===""?e:Ix(e,o);a.classGroupId=n;return}if(typeof o=="function"){if(mD(o)){gg(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([a,s])=>{gg(s,Ix(e,a),n,r)})})},Ix=(t,e)=>{let n=t;return e.split(pg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mD=t=>t.isThemeGetter,vD=(t,e)=>e?t.map(([n,r])=>{const o=r.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[e+s,l])):a);return[n,o]}):t,yD=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const o=(a,s)=>{n.set(a,s),e++,e>t&&(e=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return o(a,s),s},set(a,s){n.has(a)?n.set(a,s):o(a,s)}}},kx="!",wD=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,o=e[0],a=e.length,s=l=>{const u=[];let h=0,p=0,g;for(let b=0;b<l.length;b++){let k=l[b];if(h===0){if(k===o&&(r||l.slice(b,b+a)===e)){u.push(l.slice(p,b)),p=b+a;continue}if(k==="/"){g=b;continue}}k==="["?h++:k==="]"&&h--}const w=u.length===0?l:l.substring(p),y=w.startsWith(kx),C=y?w.substring(1):w,v=g&&g>p?g-p:void 0;return{modifiers:u,hasImportantModifier:y,baseClassName:C,maybePostfixModifierPosition:v}};return n?l=>n({className:l,parseClassName:s}):s},bD=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},CD=t=>({cache:yD(t.cacheSize),parseClassName:wD(t),...hD(t)}),xD=/\s+/,_D=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,a=[],s=t.trim().split(xD);let l="";for(let u=s.length-1;u>=0;u-=1){const h=s[u],{modifiers:p,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:y}=n(h);let C=!!y,v=r(C?w.substring(0,y):w);if(!v){if(!C){l=h+(l.length>0?" "+l:l);continue}if(v=r(w),!v){l=h+(l.length>0?" "+l:l);continue}C=!1}const b=bD(p).join(":"),k=g?b+kx:b,A=k+v;if(a.includes(A))continue;a.push(A);const N=o(v,C);for(let O=0;O<N.length;++O){const T=N[O];a.push(k+T)}l=h+(l.length>0?" "+l:l)}return l};function SD(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=Nx(e))&&(r&&(r+=" "),r+=n);return r}const Nx=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=Nx(t[r]))&&(n&&(n+=" "),n+=e);return n};function TD(t,...e){let n,r,o,a=s;function s(u){const h=e.reduce((p,g)=>g(p),t());return n=CD(h),r=n.cache.get,o=n.cache.set,a=l,l(u)}function l(u){const h=r(u);if(h)return h;const p=_D(u,n);return o(u,p),p}return function(){return a(SD.apply(null,arguments))}}const Ft=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Px=/^\[(?:([a-z-]+):)?(.+)\]$/i,ED=/^\d+\/\d+$/,AD=new Set(["px","full","screen"]),ID=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,kD=/\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$/,ND=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,PD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oo=t=>Wa(t)||AD.has(t)||ED.test(t),pi=t=>qa(t,"length",HD),Wa=t=>!!t&&!Number.isNaN(Number(t)),mg=t=>qa(t,"number",Wa),dc=t=>!!t&&Number.isInteger(Number(t)),MD=t=>t.endsWith("%")&&Wa(t.slice(0,-1)),it=t=>Px.test(t),gi=t=>ID.test(t),DD=new Set(["length","size","percentage"]),RD=t=>qa(t,DD,Ox),LD=t=>qa(t,"position",Ox),FD=new Set(["image","url"]),UD=t=>qa(t,FD,zD),$D=t=>qa(t,"",BD),uc=()=>!0,qa=(t,e,n)=>{const r=Px.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},HD=t=>kD.test(t)&&!ND.test(t),Ox=()=>!1,BD=t=>PD.test(t),zD=t=>OD.test(t),VD=TD(()=>{const t=Ft("colors"),e=Ft("spacing"),n=Ft("blur"),r=Ft("brightness"),o=Ft("borderColor"),a=Ft("borderRadius"),s=Ft("borderSpacing"),l=Ft("borderWidth"),u=Ft("contrast"),h=Ft("grayscale"),p=Ft("hueRotate"),g=Ft("invert"),w=Ft("gap"),y=Ft("gradientColorStops"),C=Ft("gradientColorStopPositions"),v=Ft("inset"),b=Ft("margin"),k=Ft("opacity"),A=Ft("padding"),N=Ft("saturate"),O=Ft("scale"),T=Ft("sepia"),L=Ft("skew"),H=Ft("space"),W=Ft("translate"),ee=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",it,e],ce=()=>[it,e],ve=()=>["",Oo,pi],K=()=>["auto",Wa,it],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",it],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[Wa,it];return{cacheSize:500,separator:":",theme:{colors:[uc],spacing:[Oo,pi],blur:["none","",gi,it],brightness:te(),borderColor:[t],borderRadius:["none","","full",gi,it],borderSpacing:ce(),borderWidth:ve(),contrast:te(),grayscale:X(),hueRotate:te(),invert:X(),gap:ce(),gradientColorStops:[t],gradientColorStopPositions:[MD,pi],inset:de(),margin:de(),opacity:te(),padding:ce(),saturate:te(),scale:te(),sepia:X(),skew:te(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",it]}],container:["container"],columns:[{columns:[gi]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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(),it]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:ee()}],"overscroll-x":[{"overscroll-x":ee()}],"overscroll-y":[{"overscroll-y":ee()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",dc,it]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",it]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",dc,it]}],"grid-cols":[{"grid-cols":[uc]}],"col-start-end":[{col:["auto",{span:["full",dc,it]},it]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[uc]}],"row-start-end":[{row:["auto",{span:[dc,it]},it]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",it]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",it]}],gap:[{gap:[w]}],"gap-x":[{"gap-x":[w]}],"gap-y":[{"gap-y":[w]}],"justify-content":[{justify:["normal",...J()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...J(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...J(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",it,e]}],"min-w":[{"min-w":[it,e,"min","max","fit"]}],"max-w":[{"max-w":[it,e,"none","full","min","max","fit","prose",{screen:[gi]},gi]}],h:[{h:[it,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[it,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[it,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[it,e,"auto","min","max","fit"]}],"font-size":[{text:["base",gi,pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mg]}],"font-family":[{font:[uc]}],"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",it]}],"line-clamp":[{"line-clamp":["none",Wa,mg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Oo,it]}],"list-image":[{"list-image":["none",it]}],"list-style-type":[{list:["none","disc","decimal",it]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Oo,pi]}],"underline-offset":[{"underline-offset":["auto",Oo,it]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",it]}],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",it]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),LD]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",RD]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UD]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:G()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Oo,it]}],"outline-w":[{outline:[Oo,pi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Oo,pi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",gi,$D]}],"shadow-color":[{shadow:[uc]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",gi,it]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",it]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",it]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",it]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[dc,it]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",it]}],accent:[{accent:["auto",t]}],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",it]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"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"]}],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",it]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Oo,pi,mg]}],stroke:[{stroke:[t,"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"]}}});function Ge(...t){return VD(bx(t))}function Mo(){let t=localStorage.getItem("dataLogin"),e;try{t&&(t=JSON.parse(t),e=t.user)}catch(n){console.error("Error parsing dataLogin from localStorage:",n),t=null}return e}const Bd=x.forwardRef(({className:t,...e},n)=>d.jsx("nav",{ref:n,"aria-label":"breadcrumb",className:Ge("s3-explr-ui-breadcrumb",t),...e}));Bd.displayName="Breadcrumb";const zd=x.forwardRef(({className:t,...e},n)=>d.jsx("ol",{ref:n,className:Ge("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5","s3-explr-ui-breadcrumb-list",t),...e}));zd.displayName="BreadcrumbList";const fc=x.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Ge("inline-flex items-center gap-1.5","s3-explr-ui-breadcrumb-item",t),...e}));fc.displayName="BreadcrumbItem";const hc=x.forwardRef(({asChild:t,className:e,...n},r)=>{const o=t?oC:"a";return d.jsx(o,{ref:r,className:Ge("transition-colors hover:text-foreground","s3-explr-ui-breadcrumb-link",e),...n})});hc.displayName="BreadcrumbLink";const KD=x.forwardRef(({className:t,...e},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Ge("font-normal text-foreground","s3-explr-ui-breadcrumb-page",t),...e}));KD.displayName="BreadcrumbPage";const Vd=({children:t,className:e,...n})=>d.jsx("li",{role:"presentation","aria-hidden":"true",className:Ge("[&>svg]:w-3.5 [&>svg]:h-3.5","s3-explr-ui-breadcrumb-separator",e),...n,children:t??d.jsx(vx,{})});Vd.displayName="BreadcrumbSeparator";const Mx=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Dx=bx,vg=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Dx(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=e,s=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],g=a==null?void 0:a[h];if(p===null)return null;const w=Mx(p)||Mx(g);return o[h][w]}),l=n&&Object.entries(n).reduce((h,p)=>{let[g,w]=p;return w===void 0||(h[g]=w),h},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:w,...y}=p;return Object.entries(y).every(C=>{let[v,b]=C;return Array.isArray(b)?b.includes({...a,...l}[v]):{...a,...l}[v]===b})?[...h,g,w]:h},[]);return Dx(t,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},Rx=vg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 s3-explr-ui-button",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90 s3-explr-ui-button-default",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90 s3-explr-ui-button-destructive",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-outline",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 s3-explr-ui-button-secondary",ghost:"hover:bg-accent hover:text-accent-foreground s3-explr-ui-button-ghost",link:"text-primary underline-offset-4 hover:underline s3-explr-ui-button-link"},size:{default:"h-9 px-4 py-2 s3-explr-ui-button-size-default",sm:"h-8 rounded-md px-3 text-xs s3-explr-ui-button-size-sm",lg:"h-10 rounded-md px-8 s3-explr-ui-button-size-lg",icon:"h-9 w-9 s3-explr-ui-button-size-icon"}},defaultVariants:{variant:"default",size:"default"}}),Fe=x.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},a)=>{const s=r?oC:"button";return d.jsx(s,{className:Ge(Rx({variant:e,size:n,className:t})),ref:a,...o})});Fe.displayName="Button";function Lx(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function Fx(t){const[e,n]=x.useState(void 0);return gn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;s=h.inlineSize,l=h.blockSize}else s=t.offsetWidth,l=t.offsetHeight;n({width:s,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var Kd="Checkbox",[GD]=Io(Kd),[jD,yg]=GD(Kd);function WD(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:o,disabled:a,form:s,name:l,onCheckedChange:u,required:h,value:p="on",internal_do_not_use_render:g}=t,[w,y]=li({prop:n,defaultProp:o??!1,onChange:u,caller:Kd}),[C,v]=x.useState(null),[b,k]=x.useState(null),A=x.useRef(!1),N=C?!!s||!!C.closest("form"):!0,O={checked:w,disabled:a,setChecked:y,control:C,setControl:v,name:l,form:s,value:p,hasConsumerStoppedPropagationRef:A,required:h,defaultChecked:mi(o)?!1:o,isFormControl:N,bubbleInput:b,setBubbleInput:k};return d.jsx(jD,{scope:e,...O,children:qD(g)?g(O):r})}var Ux="CheckboxTrigger",$x=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},o)=>{const{control:a,value:s,disabled:l,checked:u,required:h,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:w,isFormControl:y,bubbleInput:C}=yg(Ux,t),v=kt(o,p),b=x.useRef(u);return x.useEffect(()=>{const k=a==null?void 0:a.form;if(k){const A=()=>g(b.current);return k.addEventListener("reset",A),()=>k.removeEventListener("reset",A)}},[a,g]),d.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":mi(u)?"mixed":u,"aria-required":h,"data-state":Kx(u),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:v,onKeyDown:Ke(e,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Ke(n,k=>{g(A=>mi(A)?!0:!A),C&&y&&(w.current=k.isPropagationStopped(),w.current||k.stopPropagation())})})});$x.displayName=Ux;var wg=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:s,disabled:l,value:u,onCheckedChange:h,form:p,...g}=t;return d.jsx(WD,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:l,required:s,onCheckedChange:h,name:r,form:p,value:u,internal_do_not_use_render:({isFormControl:w})=>d.jsxs(d.Fragment,{children:[d.jsx($x,{...g,ref:e,__scopeCheckbox:n}),w&&d.jsx(Vx,{__scopeCheckbox:n})]})})});wg.displayName=Kd;var Hx="CheckboxIndicator",Bx=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...o}=t,a=yg(Hx,n);return d.jsx(No,{present:r||mi(a.checked)||a.checked===!0,children:d.jsx(tt.span,{"data-state":Kx(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:e,style:{pointerEvents:"none",...t.style}})})});Bx.displayName=Hx;var zx="CheckboxBubbleInput",Vx=x.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:s,required:l,disabled:u,name:h,value:p,form:g,bubbleInput:w,setBubbleInput:y}=yg(zx,t),C=kt(n,y),v=Lx(a),b=Fx(r);x.useEffect(()=>{const A=w;if(!A)return;const N=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(N,"checked").set,L=!o.current;if(v!==a&&T){const H=new Event("click",{bubbles:L});A.indeterminate=mi(a),T.call(A,mi(a)?!1:a),A.dispatchEvent(H)}},[w,v,a,o]);const k=x.useRef(mi(a)?!1:a);return d.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??k.current,required:l,disabled:u,name:h,value:p,form:g,...e,tabIndex:-1,ref:C,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Vx.displayName=zx;function qD(t){return typeof t=="function"}function mi(t){return t==="indeterminate"}function Kx(t){return mi(t)?"indeterminate":t?"checked":"unchecked"}const pc=x.forwardRef(({className:t,...e},n)=>d.jsx(wg,{ref:n,className:Ge("s3-explr-ui-checkbox peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:d.jsx(Bx,{className:Ge("s3-explr-ui-checkbox-indicator flex items-center justify-center text-current"),children:d.jsx(mx,{className:"s3-explr-ui-checkbox-check h-4 w-4"})})}));pc.displayName=wg.displayName;const Vn=ic,gc=W1,YD=q1,Gx=x.forwardRef(({className:t,...e},n)=>d.jsx(Ga,{ref:n,className:Ge("s3-explr-ui-dialog-overlay fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));Gx.displayName=Ga.displayName;const Nn=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(YD,{children:[d.jsx(Gx,{}),d.jsxs(ja,{ref:r,className:Ge("s3-explr-ui-dialog-content 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 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%] sm:rounded-lg",t),...n,children:[e,d.jsxs(Gp,{className:Ge("s3-explr-ui-dialog-close absolute right-4 top-4 rounded-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:[d.jsx(dg,{className:"s3-explr-ui-dialog-close-icon h-4 w-4"}),d.jsx("span",{className:"s3-explr-ui-dialog-close-text sr-only",children:"Close"})]})]})]}));Nn.displayName=ja.displayName;const Pn=({className:t,...e})=>d.jsx("div",{className:Ge("s3-explr-ui-dialog-header flex flex-col space-y-1.5 text-center sm:text-left",t),...e});Pn.displayName="DialogHeader";const _r=({className:t,...e})=>d.jsx("div",{className:Ge("s3-explr-ui-dialog-footer flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});_r.displayName="DialogFooter";const On=x.forwardRef(({className:t,...e},n)=>d.jsx(QC,{ref:n,className:Ge("s3-explr-ui-dialog-title text-lg font-semibold leading-none tracking-tight",t),...e}));On.displayName=QC.displayName;const Do=x.forwardRef(({className:t,...e},n)=>d.jsx(XC,{ref:n,className:Ge("s3-explr-ui-dialog-description text-sm text-muted-foreground",t),...e}));Do.displayName=XC.displayName;const Kn=x.forwardRef(({className:t,type:e,...n},r)=>d.jsx("input",{type:e,className:Ge("s3-explr-ui-input","flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));Kn.displayName="Input";var JD="Label",jx=x.forwardRef((t,e)=>d.jsx(tt.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));jx.displayName=JD;var Wx=jx;const QD=vg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 s3-explr-ui-label",{variants:{variant:{default:"s3-explr-ui-label-default",required:"s3-explr-ui-label-required",disabled:"s3-explr-ui-label-disabled"},size:{default:"s3-explr-ui-label-size-default",sm:"s3-explr-ui-label-size-sm",lg:"s3-explr-ui-label-size-lg"}},defaultVariants:{variant:"default",size:"default"}}),lr=x.forwardRef(({className:t,variant:e,size:n,...r},o)=>d.jsx(Wx,{ref:o,className:Ge(QD({variant:e,size:n}),t),...r}));lr.displayName=Wx.displayName;const Gd=({className:t,...e})=>d.jsx("nav",{role:"navigation","aria-label":"pagination",className:Ge("mx-auto flex w-full justify-center",t),...e});Gd.displayName="Pagination";const jd=x.forwardRef(({className:t,...e},n)=>d.jsx("ul",{ref:n,className:Ge("flex flex-row items-center gap-1",t),...e}));jd.displayName="PaginationContent";const Br=x.forwardRef(({className:t,...e},n)=>d.jsx("li",{ref:n,className:Ge("",t),...e}));Br.displayName="PaginationItem";const Ya=({className:t,isActive:e,size:n="icon",...r})=>d.jsx("a",{"aria-current":e?"page":void 0,className:Ge(Rx({variant:e?"outline":"ghost",size:n}),t),...r});Ya.displayName="PaginationLink";const Wd=({className:t,...e})=>d.jsxs(Ya,{"aria-label":"Go to previous page",size:"default",className:Ge("gap-1 pl-2.5",t),...e,children:[d.jsx(zM,{className:"h-4 w-4"}),d.jsx("span",{children:"Previous"})]});Wd.displayName="PaginationPrevious";const qd=({className:t,...e})=>d.jsxs(Ya,{"aria-label":"Go to next page",size:"default",className:Ge("gap-1 pr-2.5",t),...e,children:[d.jsx("span",{children:"Next"}),d.jsx(vx,{className:"h-4 w-4"})]});qd.displayName="PaginationNext";const Yd=({className:t,...e})=>d.jsxs("span",{"aria-hidden":!0,className:Ge("flex h-9 w-9 items-center justify-center",t),...e,children:[d.jsx(VM,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"More pages"})]});Yd.displayName="PaginationEllipsis";const Jd=x.forwardRef(({className:t,...e},n)=>d.jsx("div",{className:Ge("relative w-full overflow-auto","s3-explr-ui-table-container"),children:d.jsx("table",{ref:n,className:Ge("w-full caption-bottom text-sm","s3-explr-ui-table",t),...e})}));Jd.displayName="Table";const Qd=x.forwardRef(({className:t,...e},n)=>d.jsx("thead",{ref:n,className:Ge("[&_tr]:border-b","s3-explr-ui-table-header",t),...e}));Qd.displayName="TableHeader";const Xd=x.forwardRef(({className:t,...e},n)=>d.jsx("tbody",{ref:n,className:Ge("[&_tr:last-child]:border-0","s3-explr-ui-table-body",t),...e}));Xd.displayName="TableBody";const XD=x.forwardRef(({className:t,...e},n)=>d.jsx("tfoot",{ref:n,className:Ge("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0","s3-explr-ui-table-footer",t),...e}));XD.displayName="TableFooter";const zr=x.forwardRef(({className:t,...e},n)=>d.jsx("tr",{ref:n,className:Ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted","s3-explr-ui-table-row",t),...e}));zr.displayName="TableRow";const lo=x.forwardRef(({className:t,...e},n)=>d.jsx("th",{ref:n,className:Ge("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-head",t),...e}));lo.displayName="TableHead";const Gn=x.forwardRef(({className:t,...e},n)=>d.jsx("td",{ref:n,className:Ge("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]","s3-explr-ui-table-cell",t),...e}));Gn.displayName="TableCell";const ZD=x.forwardRef(({className:t,...e},n)=>d.jsx("caption",{ref:n,className:Ge("mt-4 text-sm text-muted-foreground","s3-explr-ui-table-caption",t),...e}));ZD.displayName="TableCaption";function bg(t){const e=t+"CollectionProvider",[n,r]=Io(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=v=>{const{scope:b,children:k}=v,A=M.useRef(null),N=M.useRef(new Map).current;return d.jsx(o,{scope:b,itemMap:N,collectionRef:A,children:k})};s.displayName=e;const l=t+"CollectionSlot",u=Ha(l),h=M.forwardRef((v,b)=>{const{scope:k,children:A}=v,N=a(l,k),O=kt(b,N.collectionRef);return d.jsx(u,{ref:O,children:A})});h.displayName=l;const p=t+"CollectionItemSlot",g="data-radix-collection-item",w=Ha(p),y=M.forwardRef((v,b)=>{const{scope:k,children:A,...N}=v,O=M.useRef(null),T=kt(b,O),L=a(p,k);return M.useEffect(()=>(L.itemMap.set(O,{ref:O,...N}),()=>void L.itemMap.delete(O))),d.jsx(w,{[g]:"",ref:T,children:A})});y.displayName=p;function C(v){const b=a(t+"CollectionConsumer",v);return M.useCallback(()=>{const A=b.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((L,H)=>N.indexOf(L.ref.current)-N.indexOf(H.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:h,ItemSlot:y},C,r]}var eR=x.createContext(void 0);function Cg(t){const e=x.useContext(eR);return t||e||"ltr"}var xg="rovingFocusGroup.onEntryFocus",tR={bubbles:!1,cancelable:!0},mc="RovingFocusGroup",[_g,qx,nR]=bg(mc),[rR,Yx]=Io(mc,[nR]),[oR,iR]=rR(mc),Jx=x.forwardRef((t,e)=>d.jsx(_g.Provider,{scope:t.__scopeRovingFocusGroup,children:d.jsx(_g.Slot,{scope:t.__scopeRovingFocusGroup,children:d.jsx(aR,{...t,ref:e})})}));Jx.displayName=mc;var aR=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,w=x.useRef(null),y=kt(e,w),C=Cg(a),[v,b]=li({prop:s,defaultProp:l??null,onChange:u,caller:mc}),[k,A]=x.useState(!1),N=xr(h),O=qx(n),T=x.useRef(!1),[L,H]=x.useState(0);return x.useEffect(()=>{const W=w.current;if(W)return W.addEventListener(xg,N),()=>W.removeEventListener(xg,N)},[N]),d.jsx(oR,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:v,onItemFocus:x.useCallback(W=>b(W),[b]),onItemShiftTab:x.useCallback(()=>A(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(W=>W+1),[]),onFocusableItemRemove:x.useCallback(()=>H(W=>W-1),[]),children:d.jsx(tt.div,{tabIndex:k||L===0?-1:0,"data-orientation":r,...g,ref:y,style:{outline:"none",...t.style},onMouseDown:Ke(t.onMouseDown,()=>{T.current=!0}),onFocus:Ke(t.onFocus,W=>{const ee=!T.current;if(W.target===W.currentTarget&&ee&&!k){const q=new CustomEvent(xg,tR);if(W.currentTarget.dispatchEvent(q),!q.defaultPrevented){const de=O().filter(G=>G.focusable),ce=de.find(G=>G.active),ve=de.find(G=>G.id===v),Z=[ce,ve,...de].filter(Boolean).map(G=>G.ref.current);Zx(Z,p)}}T.current=!1}),onBlur:Ke(t.onBlur,()=>A(!1))})})}),Qx="RovingFocusGroupItem",Xx=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:s,...l}=t,u=ko(),h=a||u,p=iR(Qx,n),g=p.currentTabStopId===h,w=qx(n),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:v}=p;return x.useEffect(()=>{if(r)return y(),()=>C()},[r,y,C]),d.jsx(_g.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:d.jsx(tt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...l,ref:e,onMouseDown:Ke(t.onMouseDown,b=>{r?p.onItemFocus(h):b.preventDefault()}),onFocus:Ke(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:Ke(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){p.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const k=lR(b,p.orientation,p.dir);if(k!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=w().filter(O=>O.focusable).map(O=>O.ref.current);if(k==="last")N.reverse();else if(k==="prev"||k==="next"){k==="prev"&&N.reverse();const O=N.indexOf(b.currentTarget);N=p.loop?dR(N,O+1):N.slice(O+1)}setTimeout(()=>Zx(N))}}),children:typeof s=="function"?s({isCurrentTabStop:g,hasTabStop:v!=null}):s})})});Xx.displayName=Qx;var sR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cR(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function lR(t,e,n){const r=cR(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sR[r]}function Zx(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function dR(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var uR=Jx,fR=Xx,Zd="Tabs",[hR]=Io(Zd,[Yx]),e_=Yx(),[pR,Sg]=hR(Zd),t_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:u="automatic",...h}=t,p=Cg(l),[g,w]=li({prop:r,onChange:o,defaultProp:a??"",caller:Zd});return d.jsx(pR,{scope:n,baseId:ko(),value:g,onValueChange:w,orientation:s,dir:p,activationMode:u,children:d.jsx(tt.div,{dir:p,"data-orientation":s,...h,ref:e})})});t_.displayName=Zd;var n_="TabsList",r_=x.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,a=Sg(n_,n),s=e_(n);return d.jsx(uR,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:d.jsx(tt.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:e})})});r_.displayName=n_;var o_="TabsTrigger",i_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=t,s=Sg(o_,n),l=e_(n),u=c_(s.baseId,r),h=l_(s.baseId,r),p=r===s.value;return d.jsx(fR,{asChild:!0,...l,focusable:!o,active:p,children:d.jsx(tt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...a,ref:e,onMouseDown:Ke(t.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?s.onValueChange(r):g.preventDefault()}),onKeyDown:Ke(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&s.onValueChange(r)}),onFocus:Ke(t.onFocus,()=>{const g=s.activationMode!=="manual";!p&&!o&&g&&s.onValueChange(r)})})})});i_.displayName=o_;var a_="TabsContent",s_=x.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...s}=t,l=Sg(a_,n),u=c_(l.baseId,r),h=l_(l.baseId,r),p=r===l.value,g=x.useRef(p);return x.useEffect(()=>{const w=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(w)},[]),d.jsx(No,{present:o||p,children:({present:w})=>d.jsx(tt.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!w,id:h,tabIndex:0,...s,ref:e,style:{...t.style,animationDuration:g.current?"0s":void 0},children:w&&a})})});s_.displayName=a_;function c_(t,e){return`${t}-trigger-${e}`}function l_(t,e){return`${t}-content-${e}`}var gR=t_,d_=r_,u_=i_,f_=s_;const Tg=gR,eu=x.forwardRef(({className:t,...e},n)=>d.jsx(d_,{ref:n,className:Ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));eu.displayName=d_.displayName;const zi=x.forwardRef(({className:t,...e},n)=>d.jsx(u_,{ref:n,className:Ge("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 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",t),...e}));zi.displayName=u_.displayName;const Vi=x.forwardRef(({className:t,...e},n)=>d.jsx(f_,{ref:n,className:Ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Vi.displayName=f_.displayName;const vc=x.forwardRef(({className:t,...e},n)=>d.jsx("textarea",{className:Ge("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:n,...e}));vc.displayName="Textarea";var h_=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"}),mR="VisuallyHidden",tu=x.forwardRef((t,e)=>d.jsx(tt.span,{...t,ref:e,style:{...h_,...t.style}}));tu.displayName=mR;var vR=tu,Eg="ToastProvider",[Ag,yR,wR]=bg("Toast"),[p_]=Io("Toast",[wR]),[bR,nu]=p_(Eg),g_=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=t,[l,u]=x.useState(null),[h,p]=x.useState(0),g=x.useRef(!1),w=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Eg}\`. Expected non-empty \`string\`.`),d.jsx(Ag.Provider,{scope:e,children:d.jsx(bR,{scope:e,label:n,duration:r,swipeDirection:o,swipeThreshold:a,toastCount:h,viewport:l,onViewportChange:u,onToastAdd:x.useCallback(()=>p(y=>y+1),[]),onToastRemove:x.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:g,isClosePausedRef:w,children:s})})};g_.displayName=Eg;var m_="ToastViewport",CR=["F8"],Ig="toast.viewportPause",kg="toast.viewportResume",v_=x.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=CR,label:o="Notifications ({hotkey})",...a}=t,s=nu(m_,n),l=yR(n),u=x.useRef(null),h=x.useRef(null),p=x.useRef(null),g=x.useRef(null),w=kt(e,g,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=s.toastCount>0;x.useEffect(()=>{const b=k=>{var N;r.length!==0&&r.every(O=>k[O]||k.code===O)&&((N=g.current)==null||N.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),x.useEffect(()=>{const b=u.current,k=g.current;if(C&&b&&k){const A=()=>{if(!s.isClosePausedRef.current){const L=new CustomEvent(Ig);k.dispatchEvent(L),s.isClosePausedRef.current=!0}},N=()=>{if(s.isClosePausedRef.current){const L=new CustomEvent(kg);k.dispatchEvent(L),s.isClosePausedRef.current=!1}},O=L=>{!b.contains(L.relatedTarget)&&N()},T=()=>{b.contains(document.activeElement)||N()};return b.addEventListener("focusin",A),b.addEventListener("focusout",O),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",T),window.addEventListener("blur",A),window.addEventListener("focus",N),()=>{b.removeEventListener("focusin",A),b.removeEventListener("focusout",O),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",T),window.removeEventListener("blur",A),window.removeEventListener("focus",N)}}},[C,s.isClosePausedRef]);const v=x.useCallback(({tabbingDirection:b})=>{const A=l().map(N=>{const O=N.ref.current,T=[O,...DR(O)];return b==="forwards"?T:T.reverse()});return(b==="forwards"?A.reverse():A).flat()},[l]);return x.useEffect(()=>{const b=g.current;if(b){const k=A=>{var T,L,H;const N=A.altKey||A.ctrlKey||A.metaKey;if(A.key==="Tab"&&!N){const W=document.activeElement,ee=A.shiftKey;if(A.target===b&&ee){(T=h.current)==null||T.focus();return}const ce=v({tabbingDirection:ee?"backwards":"forwards"}),ve=ce.findIndex(K=>K===W);Og(ce.slice(ve+1))?A.preventDefault():ee?(L=h.current)==null||L.focus():(H=p.current)==null||H.focus()}};return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)}},[l,v]),d.jsxs(zO,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:C?void 0:"none"},children:[C&&d.jsx(Ng,{ref:h,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"forwards"});Og(b)}}),d.jsx(Ag.Slot,{scope:n,children:d.jsx(tt.ol,{tabIndex:-1,...a,ref:w})}),C&&d.jsx(Ng,{ref:p,onFocusFromOutsideViewport:()=>{const b=v({tabbingDirection:"backwards"});Og(b)}})]})});v_.displayName=m_;var y_="ToastFocusProxy",Ng=x.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=t,a=nu(y_,n);return d.jsx(tu,{tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{var h;const l=s.relatedTarget;!((h=a.viewport)!=null&&h.contains(l))&&r()}})});Ng.displayName=y_;var yc="Toast",xR="toast.swipeStart",_R="toast.swipeMove",SR="toast.swipeCancel",TR="toast.swipeEnd",w_=x.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:a,...s}=t,[l,u]=li({prop:r,defaultProp:o??!0,onChange:a,caller:yc});return d.jsx(No,{present:n||l,children:d.jsx(IR,{open:l,...s,ref:e,onClose:()=>u(!1),onPause:xr(t.onPause),onResume:xr(t.onResume),onSwipeStart:Ke(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ke(t.onSwipeMove,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${g}px`)}),onSwipeCancel:Ke(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ke(t.onSwipeEnd,h=>{const{x:p,y:g}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${g}px`),u(!1)})})})});w_.displayName=yc;var[ER,AR]=p_(yc,{onClose(){}}),IR=x.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:h,onSwipeStart:p,onSwipeMove:g,onSwipeCancel:w,onSwipeEnd:y,...C}=t,v=nu(yc,n),[b,k]=x.useState(null),A=kt(e,K=>k(K)),N=x.useRef(null),O=x.useRef(null),T=o||v.duration,L=x.useRef(0),H=x.useRef(T),W=x.useRef(0),{onToastAdd:ee,onToastRemove:q}=v,de=xr(()=>{var Z;(b==null?void 0:b.contains(document.activeElement))&&((Z=v.viewport)==null||Z.focus()),s()}),ce=x.useCallback(K=>{!K||K===1/0||(window.clearTimeout(W.current),L.current=new Date().getTime(),W.current=window.setTimeout(de,K))},[de]);x.useEffect(()=>{const K=v.viewport;if(K){const Z=()=>{ce(H.current),h==null||h()},G=()=>{const re=new Date().getTime()-L.current;H.current=H.current-re,window.clearTimeout(W.current),u==null||u()};return K.addEventListener(Ig,G),K.addEventListener(kg,Z),()=>{K.removeEventListener(Ig,G),K.removeEventListener(kg,Z)}}},[v.viewport,T,u,h,ce]),x.useEffect(()=>{a&&!v.isClosePausedRef.current&&ce(T)},[a,T,v.isClosePausedRef,ce]),x.useEffect(()=>(ee(),()=>q()),[ee,q]);const ve=x.useMemo(()=>b?E_(b):null,[b]);return v.viewport?d.jsxs(d.Fragment,{children:[ve&&d.jsx(kR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ve}),d.jsx(ER,{scope:n,onClose:de,children:$s.createPortal(d.jsx(Ag.ItemSlot,{scope:n,children:d.jsx(BO,{asChild:!0,onEscapeKeyDown:Ke(l,()=>{v.isFocusedToastEscapeKeyDownRef.current||de(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(tt.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...C,ref:A,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ke(t.onKeyDown,K=>{K.key==="Escape"&&(l==null||l(K.nativeEvent),K.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,de()))}),onPointerDown:Ke(t.onPointerDown,K=>{K.button===0&&(N.current={x:K.clientX,y:K.clientY})}),onPointerMove:Ke(t.onPointerMove,K=>{if(!N.current)return;const Z=K.clientX-N.current.x,G=K.clientY-N.current.y,re=!!O.current,J=["left","right"].includes(v.swipeDirection),X=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,U=J?X(0,Z):0,te=J?0:X(0,G),be=K.pointerType==="touch"?10:2,Ee={x:U,y:te},Ce={originalEvent:K,delta:Ee};re?(O.current=Ee,ru(_R,g,Ce,{discrete:!1})):A_(Ee,v.swipeDirection,be)?(O.current=Ee,ru(xR,p,Ce,{discrete:!1}),K.target.setPointerCapture(K.pointerId)):(Math.abs(Z)>be||Math.abs(G)>be)&&(N.current=null)}),onPointerUp:Ke(t.onPointerUp,K=>{const Z=O.current,G=K.target;if(G.hasPointerCapture(K.pointerId)&&G.releasePointerCapture(K.pointerId),O.current=null,N.current=null,Z){const re=K.currentTarget,J={originalEvent:K,delta:Z};A_(Z,v.swipeDirection,v.swipeThreshold)?ru(TR,y,J,{discrete:!0}):ru(SR,w,J,{discrete:!0}),re.addEventListener("click",X=>X.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),kR=t=>{const{__scopeToast:e,children:n,...r}=t,o=nu(yc,e),[a,s]=x.useState(!1),[l,u]=x.useState(!1);return OR(()=>s(!0)),x.useEffect(()=>{const h=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(h)},[]),l?null:d.jsx(oc,{asChild:!0,children:d.jsx(tu,{...r,children:a&&d.jsxs(d.Fragment,{children:[o.label," ",n]})})})},NR="ToastTitle",b_=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(tt.div,{...r,ref:e})});b_.displayName=NR;var PR="ToastDescription",C_=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return d.jsx(tt.div,{...r,ref:e})});C_.displayName=PR;var x_="ToastAction",__=x.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?d.jsx(T_,{altText:n,asChild:!0,children:d.jsx(Pg,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${x_}\`. Expected non-empty \`string\`.`),null)});__.displayName=x_;var S_="ToastClose",Pg=x.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,o=AR(S_,n);return d.jsx(T_,{asChild:!0,children:d.jsx(tt.button,{type:"button",...r,ref:e,onClick:Ke(t.onClick,o.onClose)})})});Pg.displayName=S_;var T_=x.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...o}=t;return d.jsx(tt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:e})});function E_(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),MR(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&e.push(s)}else e.push(...E_(r))}}),e}function ru(t,e,n,{discrete:r}){const o=n.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?aC(o,a):o.dispatchEvent(a)}var A_=(t,e,n=0)=>{const r=Math.abs(t.x),o=Math.abs(t.y),a=r>o;return e==="left"||e==="right"?a&&r>n:!a&&o>n};function OR(t=()=>{}){const e=xr(t);gn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function MR(t){return t.nodeType===t.ELEMENT_NODE}function DR(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Og(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var RR=g_,I_=v_,k_=w_,N_=b_,P_=C_,O_=__,M_=Pg;const LR=RR,D_=x.forwardRef(({className:t,...e},n)=>d.jsx(I_,{ref:n,className:Ge("s3-explr-ui-toast-viewport fixed top-0 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px] z-[10000]",t),...e}));D_.displayName=I_.displayName;const FR=vg("s3-explr-ui-toast group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 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-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"s3-explr-ui-toast-default border bg-background text-foreground",destructive:"s3-explr-ui-toast-destructive destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),R_=x.forwardRef(({className:t,variant:e,...n},r)=>d.jsx(k_,{ref:r,className:Ge(FR({variant:e}),t),...n}));R_.displayName=k_.displayName;const UR=x.forwardRef(({className:t,...e},n)=>d.jsx(O_,{ref:n,className:Ge("s3-explr-ui-toast-action inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring 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",t),...e}));UR.displayName=O_.displayName;const L_=x.forwardRef(({className:t,...e},n)=>d.jsx(M_,{ref:n,className:Ge("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity duration-200 ease-in-out hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 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 font-bold",t),"toast-close":"",...e,children:d.jsx(dg,{className:"s3-explr-ui-toast-close-icon h-4 w-4"})}));L_.displayName=M_.displayName;const F_=x.forwardRef(({className:t,...e},n)=>d.jsx(N_,{ref:n,className:Ge("s3-explr-ui-toast-title text-sm font-semibold [&+div]:text-xs",t),...e}));F_.displayName=N_.displayName;const U_=x.forwardRef(({className:t,...e},n)=>d.jsx(P_,{ref:n,className:Ge("text-sm opacity-90 font-bold",t),...e}));U_.displayName=P_.displayName;const $R=1,HR=1e6;let Mg=0;function BR(){return Mg=(Mg+1)%Number.MAX_SAFE_INTEGER,Mg.toString()}const Dg=new Map,$_=t=>{if(Dg.has(t))return;const e=setTimeout(()=>{Dg.delete(t),wc({type:"REMOVE_TOAST",toastId:t})},HR);Dg.set(t,e)},zR=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,$R)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?$_(n):t.toasts.forEach(r=>{$_(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},ou=[];let iu={toasts:[]};function wc(t){iu=zR(iu,t),ou.forEach(e=>{e(iu)})}function VR({...t}){const e=BR(),n=o=>wc({type:"UPDATE_TOAST",toast:{...o,id:e}}),r=()=>wc({type:"DISMISS_TOAST",toastId:e});return wc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}function bc(){const[t,e]=x.useState(iu);return x.useEffect(()=>(ou.push(e),()=>{const n=ou.indexOf(e);n>-1&&ou.splice(n,1)}),[t]),{...t,toast:VR,dismiss:n=>wc({type:"DISMISS_TOAST",toastId:n})}}function H_(){const{toasts:t}=bc();return d.jsxs(LR,{children:[t.map(function({id:e,title:n,description:r,action:o,...a}){return d.jsxs(R_,{...a,className:`s3-explr-ui-toast ${a.className||""}`,children:[d.jsxs("div",{className:"s3-explr-ui-toast-content grid gap-1",children:[n&&d.jsx(F_,{className:"s3-explr-ui-toast-title",children:n}),r&&d.jsx(U_,{className:"s3-explr-ui-toast-description",style:{wordBreak:"break-all",whiteSpace:"pre-line",maxWidth:400,overflowWrap:"break-word"},children:r})]}),o&&d.jsx("div",{className:"s3-explr-ui-toast-action",children:o}),d.jsx(L_,{className:"s3-explr-ui-toast-close"})]},e)}),d.jsx(D_,{className:"s3-explr-ui-toast-viewport"})]})}const KR=["top","right","bottom","left"],vi=Math.min,dr=Math.max,au=Math.round,su=Math.floor,uo=t=>({x:t,y:t}),GR={left:"right",right:"left",bottom:"top",top:"bottom"},jR={start:"end",end:"start"};function Rg(t,e,n){return dr(t,vi(e,n))}function Ro(t,e){return typeof t=="function"?t(e):t}function Lo(t){return t.split("-")[0]}function Ja(t){return t.split("-")[1]}function Lg(t){return t==="x"?"y":"x"}function Fg(t){return t==="y"?"height":"width"}const WR=new Set(["top","bottom"]);function fo(t){return WR.has(Lo(t))?"y":"x"}function Ug(t){return Lg(fo(t))}function qR(t,e,n){n===void 0&&(n=!1);const r=Ja(t),o=Ug(t),a=Fg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=cu(s)),[s,cu(s)]}function YR(t){const e=cu(t);return[$g(t),e,$g(e)]}function $g(t){return t.replace(/start|end/g,e=>jR[e])}const B_=["left","right"],z_=["right","left"],JR=["top","bottom"],QR=["bottom","top"];function XR(t,e,n){switch(t){case"top":case"bottom":return n?e?z_:B_:e?B_:z_;case"left":case"right":return e?JR:QR;default:return[]}}function ZR(t,e,n,r){const o=Ja(t);let a=XR(Lo(t),n==="start",r);return o&&(a=a.map(s=>s+"-"+o),e&&(a=a.concat(a.map($g)))),a}function cu(t){return t.replace(/left|right|bottom|top/g,e=>GR[e])}function eL(t){return{top:0,right:0,bottom:0,left:0,...t}}function V_(t){return typeof t!="number"?eL(t):{top:t,right:t,bottom:t,left:t}}function lu(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function K_(t,e,n){let{reference:r,floating:o}=t;const a=fo(e),s=Ug(e),l=Fg(s),u=Lo(e),h=a==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,w=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:g};break;case"left":y={x:r.x-o.width,y:g};break;default:y={x:r.x,y:r.y}}switch(Ja(e)){case"start":y[s]-=w*(n&&h?-1:1);break;case"end":y[s]+=w*(n&&h?-1:1);break}return y}const tL=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,l=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(e));let h=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=K_(h,r,u),w=r,y={},C=0;for(let v=0;v<l.length;v++){const{name:b,fn:k}=l[v],{x:A,y:N,data:O,reset:T}=await k({x:p,y:g,initialPlacement:r,placement:w,strategy:o,middlewareData:y,rects:h,platform:s,elements:{reference:t,floating:e}});p=A??p,g=N??g,y={...y,[b]:{...y[b],...O}},T&&C<=50&&(C++,typeof T=="object"&&(T.placement&&(w=T.placement),T.rects&&(h=T.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):T.rects),{x:p,y:g}=K_(h,w,u)),v=-1)}return{x:p,y:g,placement:w,strategy:o,middlewareData:y}};async function Cc(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:a,rects:s,elements:l,strategy:u}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:w=!1,padding:y=0}=Ro(e,t),C=V_(y),b=l[w?g==="floating"?"reference":"floating":g],k=lu(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:h,rootBoundary:p,strategy:u})),A=g==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),O=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},T=lu(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:N,strategy:u}):A);return{top:(k.top-T.top+C.top)/O.y,bottom:(T.bottom-k.bottom+C.bottom)/O.y,left:(k.left-T.left+C.left)/O.x,right:(T.right-k.right+C.right)/O.x}}const nL=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:s,elements:l,middlewareData:u}=e,{element:h,padding:p=0}=Ro(t,e)||{};if(h==null)return{};const g=V_(p),w={x:n,y:r},y=Ug(o),C=Fg(y),v=await s.getDimensions(h),b=y==="y",k=b?"top":"left",A=b?"bottom":"right",N=b?"clientHeight":"clientWidth",O=a.reference[C]+a.reference[y]-w[y]-a.floating[C],T=w[y]-a.reference[y],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(h));let H=L?L[N]:0;(!H||!await(s.isElement==null?void 0:s.isElement(L)))&&(H=l.floating[N]||a.floating[C]);const W=O/2-T/2,ee=H/2-v[C]/2-1,q=vi(g[k],ee),de=vi(g[A],ee),ce=q,ve=H-v[C]-de,K=H/2-v[C]/2+W,Z=Rg(ce,K,ve),G=!u.arrow&&Ja(o)!=null&&K!==Z&&a.reference[C]/2-(K<ce?q:de)-v[C]/2<0,re=G?K<ce?K-ce:K-ve:0;return{[y]:w[y]+re,data:{[y]:Z,centerOffset:K-Z-re,...G&&{alignmentOffset:re}},reset:G}}}),rL=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:a,rects:s,initialPlacement:l,platform:u,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:w,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:v=!0,...b}=Ro(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=Lo(o),A=fo(l),N=Lo(l)===l,O=await(u.isRTL==null?void 0:u.isRTL(h.floating)),T=w||(N||!v?[cu(l)]:YR(l)),L=C!=="none";!w&&L&&T.push(...ZR(l,v,C,O));const H=[l,...T],W=await Cc(e,b),ee=[];let q=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(W[k]),g){const K=qR(o,s,O);ee.push(W[K[0]],W[K[1]])}if(q=[...q,{placement:o,overflows:ee}],!ee.every(K=>K<=0)){var de,ce;const K=(((de=a.flip)==null?void 0:de.index)||0)+1,Z=H[K];if(Z&&(!(g==="alignment"?A!==fo(Z):!1)||q.every(J=>fo(J.placement)===A?J.overflows[0]>0:!0)))return{data:{index:K,overflows:q},reset:{placement:Z}};let G=(ce=q.filter(re=>re.overflows[0]<=0).sort((re,J)=>re.overflows[1]-J.overflows[1])[0])==null?void 0:ce.placement;if(!G)switch(y){case"bestFit":{var ve;const re=(ve=q.filter(J=>{if(L){const X=fo(J.placement);return X===A||X==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(X=>X>0).reduce((X,U)=>X+U,0)]).sort((J,X)=>J[1]-X[1])[0])==null?void 0:ve[0];re&&(G=re);break}case"initialPlacement":G=l;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function G_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function j_(t){return KR.some(e=>t[e]>=0)}const oL=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=Ro(t,e);switch(r){case"referenceHidden":{const a=await Cc(e,{...o,elementContext:"reference"}),s=G_(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:j_(s)}}}case"escaped":{const a=await Cc(e,{...o,altBoundary:!0}),s=G_(a,n.floating);return{data:{escapedOffsets:s,escaped:j_(s)}}}default:return{}}}}},W_=new Set(["left","top"]);async function iL(t,e){const{placement:n,platform:r,elements:o}=t,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lo(n),l=Ja(n),u=fo(n)==="y",h=W_.has(s)?-1:1,p=a&&u?-1:1,g=Ro(e,t);let{mainAxis:w,crossAxis:y,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof C=="number"&&(y=l==="end"?C*-1:C),u?{x:y*p,y:w*h}:{x:w*h,y:y*p}}const aL=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:a,placement:s,middlewareData:l}=e,u=await iL(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},sL=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x:k,y:A}=b;return{x:k,y:A}}},...u}=Ro(t,e),h={x:n,y:r},p=await Cc(e,u),g=fo(Lo(o)),w=Lg(g);let y=h[w],C=h[g];if(a){const b=w==="y"?"top":"left",k=w==="y"?"bottom":"right",A=y+p[b],N=y-p[k];y=Rg(A,y,N)}if(s){const b=g==="y"?"top":"left",k=g==="y"?"bottom":"right",A=C+p[b],N=C-p[k];C=Rg(A,C,N)}const v=l.fn({...e,[w]:y,[g]:C});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[w]:a,[g]:s}}}}}},cL=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:a,middlewareData:s}=e,{offset:l=0,mainAxis:u=!0,crossAxis:h=!0}=Ro(t,e),p={x:n,y:r},g=fo(o),w=Lg(g);let y=p[w],C=p[g];const v=Ro(l,e),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const N=w==="y"?"height":"width",O=a.reference[w]-a.floating[N]+b.mainAxis,T=a.reference[w]+a.reference[N]-b.mainAxis;y<O?y=O:y>T&&(y=T)}if(h){var k,A;const N=w==="y"?"width":"height",O=W_.has(Lo(o)),T=a.reference[g]-a.floating[N]+(O&&((k=s.offset)==null?void 0:k[g])||0)+(O?0:b.crossAxis),L=a.reference[g]+a.reference[N]+(O?0:((A=s.offset)==null?void 0:A[g])||0)-(O?b.crossAxis:0);C<T?C=T:C>L&&(C=L)}return{[w]:y,[g]:C}}}},lL=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:a,platform:s,elements:l}=e,{apply:u=()=>{},...h}=Ro(t,e),p=await Cc(e,h),g=Lo(o),w=Ja(o),y=fo(o)==="y",{width:C,height:v}=a.floating;let b,k;g==="top"||g==="bottom"?(b=g,k=w===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(k=g,b=w==="end"?"top":"bottom");const A=v-p.top-p.bottom,N=C-p.left-p.right,O=vi(v-p[b],A),T=vi(C-p[k],N),L=!e.middlewareData.shift;let H=O,W=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(W=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(H=A),L&&!w){const q=dr(p.left,0),de=dr(p.right,0),ce=dr(p.top,0),ve=dr(p.bottom,0);y?W=C-2*(q!==0||de!==0?q+de:dr(p.left,p.right)):H=v-2*(ce!==0||ve!==0?ce+ve:dr(p.top,p.bottom))}await u({...e,availableWidth:W,availableHeight:H});const ee=await s.getDimensions(l.floating);return C!==ee.width||v!==ee.height?{reset:{rects:!0}}:{}}}};function du(){return typeof window<"u"}function Qa(t){return q_(t)?(t.nodeName||"").toLowerCase():"#document"}function ur(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ho(t){var e;return(e=(q_(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function q_(t){return du()?t instanceof Node||t instanceof ur(t).Node:!1}function Vr(t){return du()?t instanceof Element||t instanceof ur(t).Element:!1}function po(t){return du()?t instanceof HTMLElement||t instanceof ur(t).HTMLElement:!1}function Y_(t){return!du()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ur(t).ShadowRoot}const dL=new Set(["inline","contents"]);function xc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!dL.has(o)}const uL=new Set(["table","td","th"]);function fL(t){return uL.has(Qa(t))}const hL=[":popover-open",":modal"];function uu(t){return hL.some(e=>{try{return t.matches(e)}catch{return!1}})}const pL=["transform","translate","scale","rotate","perspective"],gL=["transform","translate","scale","rotate","perspective","filter"],mL=["paint","layout","strict","content"];function Hg(t){const e=Bg(),n=Vr(t)?Kr(t):t;return pL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||gL.some(r=>(n.willChange||"").includes(r))||mL.some(r=>(n.contain||"").includes(r))}function vL(t){let e=yi(t);for(;po(e)&&!Xa(e);){if(Hg(e))return e;if(uu(e))return null;e=yi(e)}return null}function Bg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yL=new Set(["html","body","#document"]);function Xa(t){return yL.has(Qa(t))}function Kr(t){return ur(t).getComputedStyle(t)}function fu(t){return Vr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if(Qa(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Y_(t)&&t.host||ho(t);return Y_(e)?e.host:e}function J_(t){const e=yi(t);return Xa(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&xc(e)?e:J_(e)}function _c(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=J_(t),a=o===((r=t.ownerDocument)==null?void 0:r.body),s=ur(o);if(a){const l=zg(s);return e.concat(s,s.visualViewport||[],xc(o)?o:[],l&&n?_c(l):[])}return e.concat(o,_c(o,[],n))}function zg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Q_(t){const e=Kr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=po(t),a=o?t.offsetWidth:n,s=o?t.offsetHeight:r,l=au(n)!==a||au(r)!==s;return l&&(n=a,r=s),{width:n,height:r,$:l}}function Vg(t){return Vr(t)?t:t.contextElement}function Za(t){const e=Vg(t);if(!po(e))return uo(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:a}=Q_(e);let s=(a?au(n.width):n.width)/r,l=(a?au(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const wL=uo(0);function X_(t){const e=ur(t);return!Bg()||!e.visualViewport?wL:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function bL(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ur(t)?!1:e}function Ki(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=Vg(t);let s=uo(1);e&&(r?Vr(r)&&(s=Za(r)):s=Za(t));const l=bL(a,n,r)?X_(a):uo(0);let u=(o.left+l.x)/s.x,h=(o.top+l.y)/s.y,p=o.width/s.x,g=o.height/s.y;if(a){const w=ur(a),y=r&&Vr(r)?ur(r):r;let C=w,v=zg(C);for(;v&&r&&y!==C;){const b=Za(v),k=v.getBoundingClientRect(),A=Kr(v),N=k.left+(v.clientLeft+parseFloat(A.paddingLeft))*b.x,O=k.top+(v.clientTop+parseFloat(A.paddingTop))*b.y;u*=b.x,h*=b.y,p*=b.x,g*=b.y,u+=N,h+=O,C=ur(v),v=zg(C)}}return lu({width:p,height:g,x:u,y:h})}function hu(t,e){const n=fu(t).scrollLeft;return e?e.left+n:Ki(ho(t)).left+n}function Z_(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-hu(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function CL(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const a=o==="fixed",s=ho(r),l=e?uu(e.floating):!1;if(r===s||l&&a)return n;let u={scrollLeft:0,scrollTop:0},h=uo(1);const p=uo(0),g=po(r);if((g||!g&&!a)&&((Qa(r)!=="body"||xc(s))&&(u=fu(r)),po(r))){const y=Ki(r);h=Za(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const w=s&&!g&&!a?Z_(s,u):uo(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-u.scrollLeft*h.x+p.x+w.x,y:n.y*h.y-u.scrollTop*h.y+p.y+w.y}}function xL(t){return Array.from(t.getClientRects())}function _L(t){const e=ho(t),n=fu(t),r=t.ownerDocument.body,o=dr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=dr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hu(t);const l=-n.scrollTop;return Kr(r).direction==="rtl"&&(s+=dr(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:s,y:l}}const eS=25;function SL(t,e){const n=ur(t),r=ho(t),o=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){a=o.width,s=o.height;const p=Bg();(!p||p&&e==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const h=hu(r);if(h<=0){const p=r.ownerDocument,g=p.body,w=getComputedStyle(g),y=p.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-y);C<=eS&&(a-=C)}else h<=eS&&(a+=h);return{width:a,height:s,x:l,y:u}}const TL=new Set(["absolute","fixed"]);function EL(t,e){const n=Ki(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,a=po(t)?Za(t):uo(1),s=t.clientWidth*a.x,l=t.clientHeight*a.y,u=o*a.x,h=r*a.y;return{width:s,height:l,x:u,y:h}}function tS(t,e,n){let r;if(e==="viewport")r=SL(t,n);else if(e==="document")r=_L(ho(t));else if(Vr(e))r=EL(e,n);else{const o=X_(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return lu(r)}function nS(t,e){const n=yi(t);return n===e||!Vr(n)||Xa(n)?!1:Kr(n).position==="fixed"||nS(n,e)}function AL(t,e){const n=e.get(t);if(n)return n;let r=_c(t,[],!1).filter(l=>Vr(l)&&Qa(l)!=="body"),o=null;const a=Kr(t).position==="fixed";let s=a?yi(t):t;for(;Vr(s)&&!Xa(s);){const l=Kr(s),u=Hg(s);!u&&l.position==="fixed"&&(o=null),(a?!u&&!o:!u&&l.position==="static"&&!!o&&TL.has(o.position)||xc(s)&&!u&&nS(t,s))?r=r.filter(p=>p!==s):o=l,s=yi(s)}return e.set(t,r),r}function IL(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?uu(e)?[]:AL(e,this._c):[].concat(n),r],l=s[0],u=s.reduce((h,p)=>{const g=tS(e,p,o);return h.top=dr(g.top,h.top),h.right=vi(g.right,h.right),h.bottom=vi(g.bottom,h.bottom),h.left=dr(g.left,h.left),h},tS(e,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function kL(t){const{width:e,height:n}=Q_(t);return{width:e,height:n}}function NL(t,e,n){const r=po(e),o=ho(e),a=n==="fixed",s=Ki(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const u=uo(0);function h(){u.x=hu(o)}if(r||!r&&!a)if((Qa(e)!=="body"||xc(o))&&(l=fu(e)),r){const y=Ki(e,!0,a,e);u.x=y.x+e.clientLeft,u.y=y.y+e.clientTop}else o&&h();a&&!r&&o&&h();const p=o&&!r&&!a?Z_(o,l):uo(0),g=s.left+l.scrollLeft-u.x-p.x,w=s.top+l.scrollTop-u.y-p.y;return{x:g,y:w,width:s.width,height:s.height}}function Kg(t){return Kr(t).position==="static"}function rS(t,e){if(!po(t)||Kr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ho(t)===n&&(n=n.ownerDocument.body),n}function oS(t,e){const n=ur(t);if(uu(t))return n;if(!po(t)){let o=yi(t);for(;o&&!Xa(o);){if(Vr(o)&&!Kg(o))return o;o=yi(o)}return n}let r=rS(t,e);for(;r&&fL(r)&&Kg(r);)r=rS(r,e);return r&&Xa(r)&&Kg(r)&&!Hg(r)?n:r||vL(t)||n}const PL=async function(t){const e=this.getOffsetParent||oS,n=this.getDimensions,r=await n(t.floating);return{reference:NL(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OL(t){return Kr(t).direction==="rtl"}const ML={convertOffsetParentRelativeRectToViewportRelativeRect:CL,getDocumentElement:ho,getClippingRect:IL,getOffsetParent:oS,getElementRects:PL,getClientRects:xL,getDimensions:kL,getScale:Za,isElement:Vr,isRTL:OL};function iS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function DL(t,e){let n=null,r;const o=ho(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const h=t.getBoundingClientRect(),{left:p,top:g,width:w,height:y}=h;if(l||e(),!w||!y)return;const C=su(g),v=su(o.clientWidth-(p+w)),b=su(o.clientHeight-(g+y)),k=su(p),N={rootMargin:-C+"px "+-v+"px "+-b+"px "+-k+"px",threshold:dr(0,vi(1,u))||1};let O=!0;function T(L){const H=L[0].intersectionRatio;if(H!==u){if(!O)return s();H?s(!1,H):r=setTimeout(()=>{s(!1,1e-7)},1e3)}H===1&&!iS(h,t.getBoundingClientRect())&&s(),O=!1}try{n=new IntersectionObserver(T,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,N)}n.observe(t)}return s(!0),a}function RL(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,h=Vg(t),p=o||a?[...h?_c(h):[],..._c(e)]:[];p.forEach(k=>{o&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const g=h&&l?DL(h,n):null;let w=-1,y=null;s&&(y=new ResizeObserver(k=>{let[A]=k;A&&A.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(e)})),n()}),h&&!u&&y.observe(h),y.observe(e));let C,v=u?Ki(t):null;u&&b();function b(){const k=Ki(t);v&&!iS(v,k)&&n(),v=k,C=requestAnimationFrame(b)}return n(),()=>{var k;p.forEach(A=>{o&&A.removeEventListener("scroll",n),a&&A.removeEventListener("resize",n)}),g==null||g(),(k=y)==null||k.disconnect(),y=null,u&&cancelAnimationFrame(C)}}const LL=aL,FL=sL,UL=rL,$L=lL,HL=oL,aS=nL,BL=cL,zL=(t,e,n)=>{const r=new Map,o={platform:ML,...n},a={...o.platform,_c:r};return tL(t,e,{...o,platform:a})};var VL=typeof document<"u",KL=function(){},pu=VL?M.useLayoutEffect:KL;function gu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!gu(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&t.$$typeof)&&!gu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function sS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cS(t,e){const n=sS(t);return Math.round(e*n)/n}function Gg(t){const e=x.useRef(t);return pu(()=>{e.current=t}),e}function GL(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:h}=t,[p,g]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[w,y]=x.useState(r);gu(w,r)||y(r);const[C,v]=x.useState(null),[b,k]=x.useState(null),A=x.useCallback(J=>{J!==L.current&&(L.current=J,v(J))},[]),N=x.useCallback(J=>{J!==H.current&&(H.current=J,k(J))},[]),O=a||C,T=s||b,L=x.useRef(null),H=x.useRef(null),W=x.useRef(p),ee=u!=null,q=Gg(u),de=Gg(o),ce=Gg(h),ve=x.useCallback(()=>{if(!L.current||!H.current)return;const J={placement:e,strategy:n,middleware:w};de.current&&(J.platform=de.current),zL(L.current,H.current,J).then(X=>{const U={...X,isPositioned:ce.current!==!1};K.current&&!gu(W.current,U)&&(W.current=U,$s.flushSync(()=>{g(U)}))})},[w,e,n,de,ce]);pu(()=>{h===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[h]);const K=x.useRef(!1);pu(()=>(K.current=!0,()=>{K.current=!1}),[]),pu(()=>{if(O&&(L.current=O),T&&(H.current=T),O&&T){if(q.current)return q.current(O,T,ve);ve()}},[O,T,ve,q,ee]);const Z=x.useMemo(()=>({reference:L,floating:H,setReference:A,setFloating:N}),[A,N]),G=x.useMemo(()=>({reference:O,floating:T}),[O,T]),re=x.useMemo(()=>{const J={position:n,left:0,top:0};if(!G.floating)return J;const X=cS(G.floating,p.x),U=cS(G.floating,p.y);return l?{...J,transform:"translate("+X+"px, "+U+"px)",...sS(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:U}},[n,l,G.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:ve,refs:Z,elements:G,floatingStyles:re}),[p,ve,Z,G,re])}const jL=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?aS({element:r.current,padding:o}).fn(n):{}:r?aS({element:r,padding:o}).fn(n):{}}}},WL=(t,e)=>({...LL(t),options:[t,e]}),qL=(t,e)=>({...FL(t),options:[t,e]}),YL=(t,e)=>({...BL(t),options:[t,e]}),JL=(t,e)=>({...UL(t),options:[t,e]}),QL=(t,e)=>({...$L(t),options:[t,e]}),XL=(t,e)=>({...HL(t),options:[t,e]}),ZL=(t,e)=>({...jL(t),options:[t,e]});var eF="Arrow",lS=x.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return d.jsx(tt.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});lS.displayName=eF;var tF=lS,jg="Popper",[dS,mu]=Io(jg),[nF,uS]=dS(jg),fS=t=>{const{__scopePopper:e,children:n}=t,[r,o]=x.useState(null);return d.jsx(nF,{scope:e,anchor:r,onAnchorChange:o,children:n})};fS.displayName=jg;var hS="PopperAnchor",pS=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=uS(hS,n),s=x.useRef(null),l=kt(e,s),u=x.useRef(null);return x.useEffect(()=>{const h=u.current;u.current=(r==null?void 0:r.current)||s.current,h!==u.current&&a.onAnchorChange(u.current)}),r?null:d.jsx(tt.div,{...o,ref:l})});pS.displayName=hS;var Wg="PopperContent",[rF,oF]=dS(Wg),gS=x.forwardRef((t,e)=>{var z,ue,Ae,xe,Pe,ae;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:w=!1,updatePositionStrategy:y="optimized",onPlaced:C,...v}=t,b=uS(Wg,n),[k,A]=x.useState(null),N=kt(e,Ze=>A(Ze)),[O,T]=x.useState(null),L=Fx(O),H=(L==null?void 0:L.width)??0,W=(L==null?void 0:L.height)??0,ee=r+(a!=="center"?"-"+a:""),q=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},de=Array.isArray(h)?h:[h],ce=de.length>0,ve={padding:q,boundary:de.filter(aF),altBoundary:ce},{refs:K,floatingStyles:Z,placement:G,isPositioned:re,middlewareData:J}=GL({strategy:"fixed",placement:ee,whileElementsMounted:(...Ze)=>RL(...Ze,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[WL({mainAxis:o+W,alignmentAxis:s}),u&&qL({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?YL():void 0,...ve}),u&&JL({...ve}),QL({...ve,apply:({elements:Ze,rects:nt,availableWidth:Tt,availableHeight:ln})=>{const{width:Ot,height:mn}=nt.reference,en=Ze.floating.style;en.setProperty("--radix-popper-available-width",`${Tt}px`),en.setProperty("--radix-popper-available-height",`${ln}px`),en.setProperty("--radix-popper-anchor-width",`${Ot}px`),en.setProperty("--radix-popper-anchor-height",`${mn}px`)}}),O&&ZL({element:O,padding:l}),sF({arrowWidth:H,arrowHeight:W}),w&&XL({strategy:"referenceHidden",...ve})]}),[X,U]=yS(G),te=xr(C);gn(()=>{re&&(te==null||te())},[re,te]);const be=(z=J.arrow)==null?void 0:z.x,Ee=(ue=J.arrow)==null?void 0:ue.y,Ce=((Ae=J.arrow)==null?void 0:Ae.centerOffset)!==0,[Ne,Te]=x.useState();return gn(()=>{k&&Te(window.getComputedStyle(k).zIndex)},[k]),d.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:re?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[(xe=J.transformOrigin)==null?void 0:xe.x,(Pe=J.transformOrigin)==null?void 0:Pe.y].join(" "),...((ae=J.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(rF,{scope:n,placedSide:X,onArrowChange:T,arrowX:be,arrowY:Ee,shouldHideArrow:Ce,children:d.jsx(tt.div,{"data-side":X,"data-align":U,...v,ref:N,style:{...v.style,animation:re?void 0:"none"}})})})});gS.displayName=Wg;var mS="PopperArrow",iF={top:"bottom",right:"left",bottom:"top",left:"right"},vS=x.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=oF(mS,r),s=iF[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(tF,{...o,ref:n,style:{...o.style,display:"block"}})})});vS.displayName=mS;function aF(t){return t!==null}var sF=t=>({name:"transformOrigin",options:t,fn(e){var b,k,A;const{placement:n,rects:r,middlewareData:o}=e,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,l=s?0:t.arrowWidth,u=s?0:t.arrowHeight,[h,p]=yS(n),g={start:"0%",center:"50%",end:"100%"}[p],w=(((k=o.arrow)==null?void 0:k.x)??0)+l/2,y=(((A=o.arrow)==null?void 0:A.y)??0)+u/2;let C="",v="";return h==="bottom"?(C=s?g:`${w}px`,v=`${-u}px`):h==="top"?(C=s?g:`${w}px`,v=`${r.floating.height+u}px`):h==="right"?(C=`${-u}px`,v=s?g:`${y}px`):h==="left"&&(C=`${r.floating.width+u}px`,v=s?g:`${y}px`),{data:{x:C,y:v}}}});function yS(t){const[e,n="center"]=t.split("-");return[e,n]}var wS=fS,bS=pS,CS=gS,xS=vS,[vu]=Io("Tooltip",[mu]),yu=mu(),_S="TooltipProvider",cF=700,qg="tooltip.open",[lF,Yg]=vu(_S),SS=t=>{const{__scopeTooltip:e,delayDuration:n=cF,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=t,s=x.useRef(!0),l=x.useRef(!1),u=x.useRef(0);return x.useEffect(()=>{const h=u.current;return()=>window.clearTimeout(h)},[]),d.jsx(lF,{scope:e,isOpenDelayedRef:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(h=>{l.current=h},[]),disableHoverableContent:o,children:a})};SS.displayName=_S;var Sc="Tooltip",[dF,Tc]=vu(Sc),TS=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=t,u=Yg(Sc,t.__scopeTooltip),h=yu(e),[p,g]=x.useState(null),w=ko(),y=x.useRef(0),C=s??u.disableHoverableContent,v=l??u.delayDuration,b=x.useRef(!1),[k,A]=li({prop:r,defaultProp:o??!1,onChange:H=>{H?(u.onOpen(),document.dispatchEvent(new CustomEvent(qg))):u.onClose(),a==null||a(H)},caller:Sc}),N=x.useMemo(()=>k?b.current?"delayed-open":"instant-open":"closed",[k]),O=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,A(!0)},[A]),T=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,A(!1)},[A]),L=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,A(!0),y.current=0},v)},[v,A]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),d.jsx(wS,{...h,children:d.jsx(dF,{scope:e,contentId:w,open:k,stateAttribute:N,trigger:p,onTriggerChange:g,onTriggerEnter:x.useCallback(()=>{u.isOpenDelayedRef.current?L():O()},[u.isOpenDelayedRef,L,O]),onTriggerLeave:x.useCallback(()=>{C?T():(window.clearTimeout(y.current),y.current=0)},[T,C]),onOpen:O,onClose:T,disableHoverableContent:C,children:n})})};TS.displayName=Sc;var Jg="TooltipTrigger",ES=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Tc(Jg,n),a=Yg(Jg,n),s=yu(n),l=x.useRef(null),u=kt(e,l,o.onTriggerChange),h=x.useRef(!1),p=x.useRef(!1),g=x.useCallback(()=>h.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),d.jsx(bS,{asChild:!0,...s,children:d.jsx(tt.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ke(t.onPointerMove,w=>{w.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ke(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ke(t.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ke(t.onFocus,()=>{h.current||o.onOpen()}),onBlur:Ke(t.onBlur,o.onClose),onClick:Ke(t.onClick,o.onClose)})})});ES.displayName=Jg;var Qg="TooltipPortal",[uF,fF]=vu(Qg,{forceMount:void 0}),AS=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,a=Tc(Qg,e);return d.jsx(uF,{scope:e,forceMount:n,children:d.jsx(No,{present:n||a.open,children:d.jsx(oc,{asChild:!0,container:o,children:r})})})};AS.displayName=Qg;var es="TooltipContent",IS=x.forwardRef((t,e)=>{const n=fF(es,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=t,s=Tc(es,t.__scopeTooltip);return d.jsx(No,{present:r||s.open,children:s.disableHoverableContent?d.jsx(kS,{side:o,...a,ref:e}):d.jsx(hF,{side:o,...a,ref:e})})}),hF=x.forwardRef((t,e)=>{const n=Tc(es,t.__scopeTooltip),r=Yg(es,t.__scopeTooltip),o=x.useRef(null),a=kt(e,o),[s,l]=x.useState(null),{trigger:u,onClose:h}=n,p=o.current,{onPointerInTransitChange:g}=r,w=x.useCallback(()=>{l(null),g(!1)},[g]),y=x.useCallback((C,v)=>{const b=C.currentTarget,k={x:C.clientX,y:C.clientY},A=yF(k,b.getBoundingClientRect()),N=wF(k,A),O=bF(v.getBoundingClientRect()),T=xF([...N,...O]);l(T),g(!0)},[g]);return x.useEffect(()=>()=>w(),[w]),x.useEffect(()=>{if(u&&p){const C=b=>y(b,p),v=b=>y(b,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",v)}}},[u,p,y,w]),x.useEffect(()=>{if(s){const C=v=>{const b=v.target,k={x:v.clientX,y:v.clientY},A=(u==null?void 0:u.contains(b))||(p==null?void 0:p.contains(b)),N=!CF(k,s);A?w():N&&(w(),h())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,s,h,w]),d.jsx(kS,{...t,ref:a})}),[pF,gF]=vu(Sc,{isInside:!1}),mF=kO("TooltipContent"),kS=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=t,u=Tc(es,n),h=yu(n),{onClose:p}=u;return x.useEffect(()=>(document.addEventListener(qg,p),()=>document.removeEventListener(qg,p)),[p]),x.useEffect(()=>{if(u.trigger){const g=w=>{const y=w.target;y!=null&&y.contains(u.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,p]),d.jsx(rc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:d.jsxs(CS,{"data-state":u.stateAttribute,...h,...l,ref:e,style:{...l.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:[d.jsx(mF,{children:r}),d.jsx(pF,{scope:n,isInside:!0,children:d.jsx(vR,{id:u.contentId,role:"tooltip",children:o||r})})]})})});IS.displayName=es;var NS="TooltipArrow",vF=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=yu(n);return gF(NS,n).isInside?null:d.jsx(xS,{...o,...r,ref:e})});vF.displayName=NS;function yF(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function wF(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function bF(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function CF(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,s=e.length-1;a<e.length;s=a++){const l=e[a],u=e[s],h=l.x,p=l.y,g=u.x,w=u.y;p>r!=w>r&&n<(g-h)*(r-p)/(w-p)+h&&(o=!o)}return o}function xF(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),_F(e)}function _F(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const a=e[e.length-1],s=e[e.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var SF=SS,TF=TS,EF=ES,AF=AS,PS=IS;const Mn=SF,Dn=TF,Rn=EF,xn=x.forwardRef(({className:t,sideOffset:e=4,...n},r)=>d.jsx(AF,{children:d.jsx(PS,{ref:r,sideOffset:e,className:Ge("z-[100001] overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",t),...n})}));xn.displayName=PS.displayName;function IF({title:t,titleId:e,...n},r){return x.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":e},n),t?x.createElement("title",{id:e},t):null,x.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const kF=x.forwardRef(IF);var NF=function(t){return function(e,n){var r=M.useRef(!1);t(function(){return function(){r.current=!1}},[]),t(function(){if(!r.current)r.current=!0;else return e()},n)}},OS=function(t){return typeof t=="function"},MS=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";const PF=NF(M.useEffect);function DS(t){var e=M.useRef(t);return e.current=t,e}var OF=function(t){MS&&(OS(t)||console.error("useUnmount expected parameter is a function, got ".concat(typeof t)));var e=DS(t);M.useEffect(function(){return function(){e.current()}},[])};function MF(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var RS=MF,DF=typeof so=="object"&&so&&so.Object===Object&&so,RF=DF,LF=RF,FF=typeof self=="object"&&self&&self.Object===Object&&self,UF=LF||FF||Function("return this")(),LS=UF,$F=LS,HF=function(){return $F.Date.now()},BF=HF,zF=/\s/;function VF(t){for(var e=t.length;e--&&zF.test(t.charAt(e)););return e}var KF=VF,GF=KF,jF=/^\s+/;function WF(t){return t&&t.slice(0,GF(t)+1).replace(jF,"")}var qF=WF,YF=LS,JF=YF.Symbol,FS=JF,US=FS,$S=Object.prototype,QF=$S.hasOwnProperty,XF=$S.toString,Ec=US?US.toStringTag:void 0;function ZF(t){var e=QF.call(t,Ec),n=t[Ec];try{t[Ec]=void 0;var r=!0}catch{}var o=XF.call(t);return r&&(e?t[Ec]=n:delete t[Ec]),o}var e2=ZF,t2=Object.prototype,n2=t2.toString;function r2(t){return n2.call(t)}var o2=r2,HS=FS,i2=e2,a2=o2,s2="[object Null]",c2="[object Undefined]",BS=HS?HS.toStringTag:void 0;function l2(t){return t==null?t===void 0?c2:s2:BS&&BS in Object(t)?i2(t):a2(t)}var d2=l2;function u2(t){return t!=null&&typeof t=="object"}var f2=u2,h2=d2,p2=f2,g2="[object Symbol]";function m2(t){return typeof t=="symbol"||p2(t)&&h2(t)==g2}var v2=m2,y2=qF,zS=RS,w2=v2,VS=NaN,b2=/^[-+]0x[0-9a-f]+$/i,C2=/^0b[01]+$/i,x2=/^0o[0-7]+$/i,_2=parseInt;function S2(t){if(typeof t=="number")return t;if(w2(t))return VS;if(zS(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=zS(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=y2(t);var n=C2.test(t);return n||x2.test(t)?_2(t.slice(2),n?2:8):b2.test(t)?VS:+t}var T2=S2,E2=RS,Xg=BF,KS=T2,A2="Expected a function",I2=Math.max,k2=Math.min;function N2(t,e,n){var r,o,a,s,l,u,h=0,p=!1,g=!1,w=!0;if(typeof t!="function")throw new TypeError(A2);e=KS(e)||0,E2(n)&&(p=!!n.leading,g="maxWait"in n,a=g?I2(KS(n.maxWait)||0,e):a,w="trailing"in n?!!n.trailing:w);function y(L){var H=r,W=o;return r=o=void 0,h=L,s=t.apply(W,H),s}function C(L){return h=L,l=setTimeout(k,e),p?y(L):s}function v(L){var H=L-u,W=L-h,ee=e-H;return g?k2(ee,a-W):ee}function b(L){var H=L-u,W=L-h;return u===void 0||H>=e||H<0||g&&W>=a}function k(){var L=Xg();if(b(L))return A(L);l=setTimeout(k,v(L))}function A(L){return l=void 0,w&&r?y(L):(r=o=void 0,s)}function N(){l!==void 0&&clearTimeout(l),h=0,r=u=o=l=void 0}function O(){return l===void 0?s:A(Xg())}function T(){var L=Xg(),H=b(L);if(r=arguments,o=this,u=L,H){if(l===void 0)return C(u);if(g)return clearTimeout(l),l=setTimeout(k,e),y(u)}return l===void 0&&(l=setTimeout(k,e)),s}return T.cancel=N,T.flush=O,T}var P2=N2;const O2=Ld(P2);function M2(){var t=(typeof global>"u"?"undefined":typeof global)=="object"&&global&&global.Object===Object&&global,e=typeof self=="object"&&self&&self.Object===Object&&self;return t||e}M2()||(global.Date=Date);function D2(t,e){var n;MS&&(OS(t)||console.error("useDebounceFn expected parameter is a function, got ".concat(typeof t)));var r=DS(t),o=(n=e==null?void 0:e.wait)!==null&&n!==void 0?n:1e3,a=M.useMemo(function(){return O2(function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return r.current.apply(r,CC([],bC(s),!1))},o,e)},[]);return OF(function(){a.cancel()}),{run:a,cancel:a.cancel,flush:a.flush}}function R2(t,e,n){var r=bC(M.useState({}),2),o=r[0],a=r[1],s=D2(function(){a({})},n).run;M.useEffect(function(){return s()},e),PF(t,[o])}const L2=M.forwardRef(({onChange:t},e)=>{const n=M.useRef(null),[r,o]=M.useState("");return M.useImperativeHandle(e,()=>({setValue:a=>{var s;o(a),(s=n.current)==null||s.focus()}})),R2(()=>{t==null||t(r)},[r],{wait:300}),d.jsxs(d.Fragment,{children:[d.jsx(Kn,{ref:n,type:"text",placeholder:"Search files...",value:r,onChange:a=>o(a.target.value),className:"pr-8"}),r&&d.jsx("button",{onClick:()=>{var a;o(""),(a=n.current)==null||a.focus()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:d.jsx(kF,{className:"h-5 w-5"})})]})});function GS(t,e){return function(){return t.apply(e,arguments)}}const{toString:F2}=Object.prototype,{getPrototypeOf:Zg}=Object,{iterator:wu,toStringTag:jS}=Symbol,bu=(t=>e=>{const n=F2.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gr=t=>(t=t.toLowerCase(),e=>bu(e)===t),Cu=t=>e=>typeof e===t,{isArray:ts}=Array,ns=Cu("undefined");function Ac(t){return t!==null&&!ns(t)&&t.constructor!==null&&!ns(t.constructor)&&jn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const WS=Gr("ArrayBuffer");function U2(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&WS(t.buffer),e}const $2=Cu("string"),jn=Cu("function"),qS=Cu("number"),Ic=t=>t!==null&&typeof t=="object",H2=t=>t===!0||t===!1,xu=t=>{if(bu(t)!=="object")return!1;const e=Zg(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jS in t)&&!(wu in t)},B2=t=>{if(!Ic(t)||Ac(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},z2=Gr("Date"),V2=Gr("File"),K2=Gr("Blob"),G2=Gr("FileList"),j2=t=>Ic(t)&&jn(t.pipe),W2=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||jn(t.append)&&((e=bu(t))==="formdata"||e==="object"&&jn(t.toString)&&t.toString()==="[object FormData]"))},q2=Gr("URLSearchParams"),[Y2,J2,Q2,X2]=["ReadableStream","Request","Response","Headers"].map(Gr),Z2=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kc(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),ts(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{if(Ac(t))return;const a=n?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;let l;for(r=0;r<s;r++)l=a[r],e.call(null,t[l],l,t)}}function YS(t,e){if(Ac(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const Gi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,JS=t=>!ns(t)&&t!==Gi;function em(){const{caseless:t,skipUndefined:e}=JS(this)&&this||{},n={},r=(o,a)=>{const s=t&&YS(n,a)||a;xu(n[s])&&xu(o)?n[s]=em(n[s],o):xu(o)?n[s]=em({},o):ts(o)?n[s]=o.slice():(!e||!ns(o))&&(n[s]=o)};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&kc(arguments[o],r);return n}const eU=(t,e,n,{allOwnKeys:r}={})=>(kc(e,(o,a)=>{n&&jn(o)?t[a]=GS(o,n):t[a]=o},{allOwnKeys:r}),t),tU=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nU=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},rU=(t,e,n,r)=>{let o,a,s;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)s=o[a],(!r||r(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=n!==!1&&Zg(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},oU=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},iU=t=>{if(!t)return null;if(ts(t))return t;let e=t.length;if(!qS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},aU=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Zg(Uint8Array)),sU=(t,e)=>{const r=(t&&t[wu]).call(t);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(t,a[0],a[1])}},cU=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},lU=Gr("HTMLFormElement"),dU=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),QS=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),uU=Gr("RegExp"),XS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};kc(n,(o,a)=>{let s;(s=e(o,a,t))!==!1&&(r[a]=s||o)}),Object.defineProperties(t,r)},fU=t=>{XS(t,(e,n)=>{if(jn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(jn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},hU=(t,e)=>{const n={},r=o=>{o.forEach(a=>{n[a]=!0})};return ts(t)?r(t):r(String(t).split(e)),n},pU=()=>{},gU=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function mU(t){return!!(t&&jn(t.append)&&t[jS]==="FormData"&&t[wu])}const vU=t=>{const e=new Array(10),n=(r,o)=>{if(Ic(r)){if(e.indexOf(r)>=0)return;if(Ac(r))return r;if(!("toJSON"in r)){e[o]=r;const a=ts(r)?[]:{};return kc(r,(s,l)=>{const u=n(s,o+1);!ns(u)&&(a[l]=u)}),e[o]=void 0,a}}return r};return n(t,0)},yU=Gr("AsyncFunction"),wU=t=>t&&(Ic(t)||jn(t))&&jn(t.then)&&jn(t.catch),ZS=((t,e)=>t?setImmediate:e?((n,r)=>(Gi.addEventListener("message",({source:o,data:a})=>{o===Gi&&a===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Gi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",jn(Gi.postMessage)),bU=typeof queueMicrotask<"u"?queueMicrotask.bind(Gi):typeof process<"u"&&process.nextTick||ZS,oe={isArray:ts,isArrayBuffer:WS,isBuffer:Ac,isFormData:W2,isArrayBufferView:U2,isString:$2,isNumber:qS,isBoolean:H2,isObject:Ic,isPlainObject:xu,isEmptyObject:B2,isReadableStream:Y2,isRequest:J2,isResponse:Q2,isHeaders:X2,isUndefined:ns,isDate:z2,isFile:V2,isBlob:K2,isRegExp:uU,isFunction:jn,isStream:j2,isURLSearchParams:q2,isTypedArray:aU,isFileList:G2,forEach:kc,merge:em,extend:eU,trim:Z2,stripBOM:tU,inherits:nU,toFlatObject:rU,kindOf:bu,kindOfTest:Gr,endsWith:oU,toArray:iU,forEachEntry:sU,matchAll:cU,isHTMLForm:lU,hasOwnProperty:QS,hasOwnProp:QS,reduceDescriptors:XS,freezeMethods:fU,toObjectSet:hU,toCamelCase:dU,noop:pU,toFiniteNumber:gU,findKey:YS,global:Gi,isContextDefined:JS,isSpecCompliantForm:mU,toJSONObject:vU,isAsyncFn:yU,isThenable:wU,setImmediate:ZS,asap:bU,isIterable:t=>t!=null&&jn(t[wu])};function ot(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}oe.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const eT=ot.prototype,tT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{tT[t]={value:t}}),Object.defineProperties(ot,tT),Object.defineProperty(eT,"isAxiosError",{value:!0}),ot.from=(t,e,n,r,o,a)=>{const s=Object.create(eT);oe.toFlatObject(t,s,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return ot.call(s,l,u,n,r,o),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",a&&Object.assign(s,a),s};const CU=null;function tm(t){return oe.isPlainObject(t)||oe.isArray(t)}function nT(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function rT(t,e,n){return t?t.concat(e).map(function(o,a){return o=nT(o),!n&&a?"["+o+"]":o}).join(n?".":""):e}function xU(t){return oe.isArray(t)&&!t.some(tm)}const _U=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function _u(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!oe.isUndefined(b[v])});const r=n.metaTokens,o=n.visitor||p,a=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function h(C){if(C===null)return"";if(oe.isDate(C))return C.toISOString();if(oe.isBoolean(C))return C.toString();if(!u&&oe.isBlob(C))throw new ot("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(C)||oe.isTypedArray(C)?u&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function p(C,v,b){let k=C;if(C&&!b&&typeof C=="object"){if(oe.endsWith(v,"{}"))v=r?v:v.slice(0,-2),C=JSON.stringify(C);else if(oe.isArray(C)&&xU(C)||(oe.isFileList(C)||oe.endsWith(v,"[]"))&&(k=oe.toArray(C)))return v=nT(v),k.forEach(function(N,O){!(oe.isUndefined(N)||N===null)&&e.append(s===!0?rT([v],O,a):s===null?v:v+"[]",h(N))}),!1}return tm(C)?!0:(e.append(rT(b,v,a),h(C)),!1)}const g=[],w=Object.assign(_U,{defaultVisitor:p,convertValue:h,isVisitable:tm});function y(C,v){if(!oe.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+v.join("."));g.push(C),oe.forEach(C,function(k,A){(!(oe.isUndefined(k)||k===null)&&o.call(e,k,oe.isString(A)?A.trim():A,v,w))===!0&&y(k,v?v.concat(A):[A])}),g.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return y(t),e}function oT(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function nm(t,e){this._pairs=[],t&&_u(t,this,e)}const iT=nm.prototype;iT.append=function(e,n){this._pairs.push([e,n])},iT.toString=function(e){const n=e?function(r){return e.call(this,r,oT)}:oT;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function SU(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aT(t,e,n){if(!e)return t;const r=n&&n.encode||SU;oe.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(o?a=o(e,n):a=oe.isURLSearchParams(e)?e.toString():new nm(e,n).toString(r),a){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class sT{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const cT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},TU={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:nm,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},rm=typeof window<"u"&&typeof document<"u",om=typeof navigator=="object"&&navigator||void 0,EU=rm&&(!om||["ReactNative","NativeScript","NS"].indexOf(om.product)<0),AU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",IU=rm&&window.location.href||"http://localhost",_n={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:rm,hasStandardBrowserEnv:EU,hasStandardBrowserWebWorkerEnv:AU,navigator:om,origin:IU},Symbol.toStringTag,{value:"Module"})),...TU};function kU(t,e){return _u(t,new _n.classes.URLSearchParams,{visitor:function(n,r,o,a){return _n.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}function NU(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function PU(t){const e={},n=Object.keys(t);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],e[a]=t[a];return e}function lT(t){function e(n,r,o,a){let s=n[a++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),u=a>=n.length;return s=!s&&oe.isArray(o)?o.length:s,u?(oe.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!l):((!o[s]||!oe.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],a)&&oe.isArray(o[s])&&(o[s]=PU(o[s])),!l)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,o)=>{e(NU(r),o,n,0)}),n}return null}function OU(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Nc={transitional:cT,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=oe.isObject(e);if(a&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return o?JSON.stringify(lT(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return kU(e,this.formSerializer).toString();if((l=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return _u(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||o?(n.setContentType("application/json",!1),OU(e)):e}],transformResponse:[function(e){const n=this.transitional||Nc.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?ot.from(l,ot.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_n.classes.FormData,Blob:_n.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{Nc.headers[t]={}});const MU=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),DU=t=>{const e={};let n,r,o;return t&&t.split(`
210
+ `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&MU[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},dT=Symbol("internals");function Pc(t){return t&&String(t).trim().toLowerCase()}function Su(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Su):String(t)}function RU(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const LU=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function im(t,e,n,r,o){if(oe.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function FU(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function UU(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,a,s){return this[r].call(this,e,o,a,s)},configurable:!0})})}let Wn=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function a(l,u,h){const p=Pc(u);if(!p)throw new Error("header name must be a non-empty string");const g=oe.findKey(o,p);(!g||o[g]===void 0||h===!0||h===void 0&&o[g]!==!1)&&(o[g||u]=Su(l))}const s=(l,u)=>oe.forEach(l,(h,p)=>a(h,p,u));if(oe.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(oe.isString(e)&&(e=e.trim())&&!LU(e))s(DU(e),n);else if(oe.isObject(e)&&oe.isIterable(e)){let l={},u,h;for(const p of e){if(!oe.isArray(p))throw TypeError("Object iterator must return a key-value pair");l[h=p[0]]=(u=l[h])?oe.isArray(u)?[...u,p[1]]:[u,p[1]]:p[1]}s(l,n)}else e!=null&&a(n,e,r);return this}get(e,n){if(e=Pc(e),e){const r=oe.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return RU(o);if(oe.isFunction(n))return n.call(this,o,r);if(oe.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Pc(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||im(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function a(s){if(s=Pc(s),s){const l=oe.findKey(r,s);l&&(!n||im(r,r[l],l,n))&&(delete r[l],o=!0)}}return oe.isArray(e)?e.forEach(a):a(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const a=n[r];(!e||im(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const n=this,r={};return oe.forEach(this,(o,a)=>{const s=oe.findKey(r,a);if(s){n[s]=Su(o),delete n[a];return}const l=e?FU(a):String(a).trim();l!==a&&delete n[a],n[l]=Su(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
211
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[dT]=this[dT]={accessors:{}}).accessors,o=this.prototype;function a(s){const l=Pc(s);r[l]||(UU(o,s),r[l]=!0)}return oe.isArray(e)?e.forEach(a):a(e),this}};Wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(Wn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),oe.freezeMethods(Wn);function am(t,e){const n=this||Nc,r=e||n,o=Wn.from(r.headers);let a=r.data;return oe.forEach(t,function(l){a=l.call(n,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function uT(t){return!!(t&&t.__CANCEL__)}function rs(t,e,n){ot.call(this,t??"canceled",ot.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(rs,ot,{__CANCEL__:!0});function fT(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ot("Request failed with status code "+n.status,[ot.ERR_BAD_REQUEST,ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $U(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function HU(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,a=0,s;return e=e!==void 0?e:1e3,function(u){const h=Date.now(),p=r[a];s||(s=h),n[o]=u,r[o]=h;let g=a,w=0;for(;g!==o;)w+=n[g++],g=g%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),h-s<e)return;const y=p&&h-p;return y?Math.round(w*1e3/y):void 0}}function BU(t,e){let n=0,r=1e3/e,o,a;const s=(h,p=Date.now())=>{n=p,o=null,a&&(clearTimeout(a),a=null),t(...h)};return[(...h)=>{const p=Date.now(),g=p-n;g>=r?s(h,p):(o=h,a||(a=setTimeout(()=>{a=null,s(o)},r-g)))},()=>o&&s(o)]}const Tu=(t,e,n=3)=>{let r=0;const o=HU(50,250);return BU(a=>{const s=a.loaded,l=a.lengthComputable?a.total:void 0,u=s-r,h=o(u),p=s<=l;r=s;const g={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&p?(l-s)/h:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(g)},n)},hT=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},pT=t=>(...e)=>oe.asap(()=>t(...e)),zU=_n.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,_n.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(_n.origin),_n.navigator&&/(msie|trident)/i.test(_n.navigator.userAgent)):()=>!0,VU=_n.hasStandardBrowserEnv?{write(t,e,n,r,o,a){const s=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&s.push("path="+r),oe.isString(o)&&s.push("domain="+o),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function KU(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function GU(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gT(t,e,n){let r=!KU(e);return t&&(r||n==!1)?GU(t,e):e}const mT=t=>t instanceof Wn?{...t}:t;function ji(t,e){e=e||{};const n={};function r(h,p,g,w){return oe.isPlainObject(h)&&oe.isPlainObject(p)?oe.merge.call({caseless:w},h,p):oe.isPlainObject(p)?oe.merge({},p):oe.isArray(p)?p.slice():p}function o(h,p,g,w){if(oe.isUndefined(p)){if(!oe.isUndefined(h))return r(void 0,h,g,w)}else return r(h,p,g,w)}function a(h,p){if(!oe.isUndefined(p))return r(void 0,p)}function s(h,p){if(oe.isUndefined(p)){if(!oe.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function l(h,p,g){if(g in e)return r(h,p);if(g in t)return r(void 0,h)}const u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(h,p,g)=>o(mT(h),mT(p),g,!0)};return oe.forEach(Object.keys({...t,...e}),function(p){const g=u[p]||o,w=g(t[p],e[p],p);oe.isUndefined(w)&&g!==l||(n[p]=w)}),n}const vT=t=>{const e=ji({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=e;if(e.headers=s=Wn.from(s),e.url=aT(gT(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),oe.isFormData(n)){if(_n.hasStandardBrowserEnv||_n.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(oe.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([p,g])=>{h.includes(p.toLowerCase())&&s.set(p,g)})}}if(_n.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(e)),r||r!==!1&&zU(e.url))){const u=o&&a&&VU.read(a);u&&s.set(o,u)}return e},jU=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=vT(t);let a=o.data;const s=Wn.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=o,p,g,w,y,C;function v(){y&&y(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function k(){if(!b)return;const N=Wn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),T={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:N,config:t,request:b};fT(function(H){n(H),v()},function(H){r(H),v()},T),b=null}"onloadend"in b?b.onloadend=k:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(k)},b.onabort=function(){b&&(r(new ot("Request aborted",ot.ECONNABORTED,t,b)),b=null)},b.onerror=function(O){const T=O&&O.message?O.message:"Network Error",L=new ot(T,ot.ERR_NETWORK,t,b);L.event=O||null,r(L),b=null},b.ontimeout=function(){let O=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const T=o.transitional||cT;o.timeoutErrorMessage&&(O=o.timeoutErrorMessage),r(new ot(O,T.clarifyTimeoutError?ot.ETIMEDOUT:ot.ECONNABORTED,t,b)),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&oe.forEach(s.toJSON(),function(O,T){b.setRequestHeader(T,O)}),oe.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),h&&([w,C]=Tu(h,!0),b.addEventListener("progress",w)),u&&b.upload&&([g,y]=Tu(u),b.upload.addEventListener("progress",g),b.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(p=N=>{b&&(r(!N||N.type?new rs(null,t,b):N),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const A=$U(o.url);if(A&&_n.protocols.indexOf(A)===-1){r(new ot("Unsupported protocol "+A+":",ot.ERR_BAD_REQUEST,t));return}b.send(a||null)})},WU=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const a=function(h){if(!o){o=!0,l();const p=h instanceof Error?h:this.reason;r.abort(p instanceof ot?p:new rs(p instanceof Error?p.message:p))}};let s=e&&setTimeout(()=>{s=null,a(new ot(`timeout ${e} of ms exceeded`,ot.ETIMEDOUT))},e);const l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(a):h.removeEventListener("abort",a)}),t=null)};t.forEach(h=>h.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>oe.asap(l),u}},qU=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},YU=async function*(t,e){for await(const n of JU(t))yield*qU(n,e)},JU=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},yT=(t,e,n,r)=>{const o=YU(t,e);let a=0,s,l=u=>{s||(s=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:h,value:p}=await o.next();if(h){l(),u.close();return}let g=p.byteLength;if(n){let w=a+=g;n(w)}u.enqueue(new Uint8Array(p))}catch(h){throw l(h),h}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},wT=64*1024,{isFunction:Eu}=oe,QU=(({Request:t,Response:e})=>({Request:t,Response:e}))(oe.global),{ReadableStream:bT,TextEncoder:CT}=oe.global,xT=(t,...e)=>{try{return!!t(...e)}catch{return!1}},XU=t=>{t=oe.merge.call({skipUndefined:!0},QU,t);const{fetch:e,Request:n,Response:r}=t,o=e?Eu(e):typeof fetch=="function",a=Eu(n),s=Eu(r);if(!o)return!1;const l=o&&Eu(bT),u=o&&(typeof CT=="function"?(C=>v=>C.encode(v))(new CT):async C=>new Uint8Array(await new n(C).arrayBuffer())),h=a&&l&&xT(()=>{let C=!1;const v=new n(_n.origin,{body:new bT,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!v}),p=s&&l&&xT(()=>oe.isReadableStream(new r("").body)),g={stream:p&&(C=>C.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(v,b)=>{let k=v&&v[C];if(k)return k.call(v);throw new ot(`Response type '${C}' is not supported`,ot.ERR_NOT_SUPPORT,b)})});const w=async C=>{if(C==null)return 0;if(oe.isBlob(C))return C.size;if(oe.isSpecCompliantForm(C))return(await new n(_n.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(oe.isArrayBufferView(C)||oe.isArrayBuffer(C))return C.byteLength;if(oe.isURLSearchParams(C)&&(C=C+""),oe.isString(C))return(await u(C)).byteLength},y=async(C,v)=>{const b=oe.toFiniteNumber(C.getContentLength());return b??w(v)};return async C=>{let{url:v,method:b,data:k,signal:A,cancelToken:N,timeout:O,onDownloadProgress:T,onUploadProgress:L,responseType:H,headers:W,withCredentials:ee="same-origin",fetchOptions:q}=vT(C),de=e||fetch;H=H?(H+"").toLowerCase():"text";let ce=WU([A,N&&N.toAbortSignal()],O),ve=null;const K=ce&&ce.unsubscribe&&(()=>{ce.unsubscribe()});let Z;try{if(L&&h&&b!=="get"&&b!=="head"&&(Z=await y(W,k))!==0){let te=new n(v,{method:"POST",body:k,duplex:"half"}),be;if(oe.isFormData(k)&&(be=te.headers.get("content-type"))&&W.setContentType(be),te.body){const[Ee,Ce]=hT(Z,Tu(pT(L)));k=yT(te.body,wT,Ee,Ce)}}oe.isString(ee)||(ee=ee?"include":"omit");const G=a&&"credentials"in n.prototype,re={...q,signal:ce,method:b.toUpperCase(),headers:W.normalize().toJSON(),body:k,duplex:"half",credentials:G?ee:void 0};ve=a&&new n(v,re);let J=await(a?de(ve,q):de(v,re));const X=p&&(H==="stream"||H==="response");if(p&&(T||X&&K)){const te={};["status","statusText","headers"].forEach(Ne=>{te[Ne]=J[Ne]});const be=oe.toFiniteNumber(J.headers.get("content-length")),[Ee,Ce]=T&&hT(be,Tu(pT(T),!0))||[];J=new r(yT(J.body,wT,Ee,()=>{Ce&&Ce(),K&&K()}),te)}H=H||"text";let U=await g[oe.findKey(g,H)||"text"](J,C);return!X&&K&&K(),await new Promise((te,be)=>{fT(te,be,{data:U,headers:Wn.from(J.headers),status:J.status,statusText:J.statusText,config:C,request:ve})})}catch(G){throw K&&K(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new ot("Network Error",ot.ERR_NETWORK,C,ve),{cause:G.cause||G}):ot.from(G,G&&G.code,C,ve)}}},ZU=new Map,_T=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:o}=e,a=[r,o,n];let s=a.length,l=s,u,h,p=ZU;for(;l--;)u=a[l],h=p.get(u),h===void 0&&p.set(u,h=l?new Map:XU(e)),p=h;return h};_T();const sm={http:CU,xhr:jU,fetch:{get:_T}};oe.forEach(sm,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ST=t=>`- ${t}`,e$=t=>oe.isFunction(t)||t===null||t===!1,TT={getAdapter:(t,e)=>{t=oe.isArray(t)?t:[t];const{length:n}=t;let r,o;const a={};for(let s=0;s<n;s++){r=t[s];let l;if(o=r,!e$(r)&&(o=sm[(l=String(r)).toLowerCase()],o===void 0))throw new ot(`Unknown adapter '${l}'`);if(o&&(oe.isFunction(o)||(o=o.get(e))))break;a[l||"#"+s]=o}if(!o){const s=Object.entries(a).map(([u,h])=>`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=n?s.length>1?`since :
212
212
  `+s.map(ST).join(`
213
- `):" "+ST(s[0]):"as no adapter specified";throw new ot("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:sm};function cm(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new rs(null,t)}function ET(t){return cm(t),t.headers=qn.from(t.headers),t.data=am.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),TT.getAdapter(t.adapter||Nc.adapter,t)(t).then(function(r){return cm(t),r.data=am.call(t,t.transformResponse,r),r.headers=qn.from(r.headers),r},function(r){return uT(r)||(cm(t),r&&r.response&&(r.response.data=am.call(t,t.transformResponse,r.response),r.response.headers=qn.from(r.response.headers))),Promise.reject(r)})}const AT="1.12.2",Au={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Au[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const IT={};Au.transitional=function(e,n,r){function o(a,s){return"[Axios v"+AT+"] Transitional option '"+a+"'"+s+(r?". "+r:"")}return(a,s,l)=>{if(e===!1)throw new ot(o(s," has been removed"+(n?" in "+n:"")),ot.ERR_DEPRECATED);return n&&!IT[s]&&(IT[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,s,l):!0}},Au.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function t$(t,e,n){if(typeof t!="object")throw new ot("options must be an object",ot.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const a=r[o],s=e[a];if(s){const l=t[a],u=l===void 0||s(l,a,t);if(u!==!0)throw new ot("option "+a+" must be "+u,ot.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ot("Unknown option "+a,ot.ERR_BAD_OPTION)}}const Iu={assertOptions:t$,validators:Au},go=Iu.validators;let Wi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new sT,response:new sT}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
214
- `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ji(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&Iu.assertOptions(r,{silentJSONParsing:go.transitional(go.boolean),forcedJSONParsing:go.transitional(go.boolean),clarifyTimeoutError:go.transitional(go.boolean)},!1),o!=null&&(oe.isFunction(o)?n.paramsSerializer={serialize:o}:Iu.assertOptions(o,{encode:go.function,serialize:go.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Iu.assertOptions(n,{baseUrl:go.spelling("baseURL"),withXsrfToken:go.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&oe.merge(a.common,a[n.method]);a&&oe.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),n.headers=qn.concat(s,a);const l=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let p,g=0,w;if(!u){const C=[ET.bind(this),void 0];for(C.unshift(...l),C.push(...h),w=C.length,p=Promise.resolve(n);g<w;)p=p.then(C[g++],C[g++]);return p}w=l.length;let y=n;for(;g<w;){const C=l[g++],v=l[g++];try{y=C(y)}catch(b){v.call(this,b);break}}try{p=ET.call(this,y)}catch(C){return Promise.reject(C)}for(g=0,w=h.length;g<w;)p=p.then(h[g++],h[g++]);return p}getUri(e){e=ji(this.defaults,e);const n=gT(e.baseURL,e.url,e.allowAbsoluteUrls);return aT(n,e.params,e.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(e){Wi.prototype[e]=function(n,r){return this.request(ji(r||{},{method:e,url:n,data:(r||{}).data}))}}),oe.forEach(["post","put","patch"],function(e){function n(r){return function(a,s,l){return this.request(ji(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}Wi.prototype[e]=n(),Wi.prototype[e+"Form"]=n(!0)});let n$=class dI{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const s=new Promise(l=>{r.subscribe(l),a=l}).then(o);return s.cancel=function(){r.unsubscribe(a)},s},e(function(a,s,l){r.reason||(r.reason=new rs(a,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new dI(function(o){e=o}),cancel:e}}};function r$(t){return function(n){return t.apply(null,n)}}function o$(t){return oe.isObject(t)&&t.isAxiosError===!0}const lm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lm).forEach(([t,e])=>{lm[e]=t});function kT(t){const e=new Wi(t),n=GS(Wi.prototype.request,e);return oe.extend(n,Wi.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return kT(ji(t,o))},n}const Le=kT(Nc);Le.Axios=Wi,Le.CanceledError=rs,Le.CancelToken=n$,Le.isCancel=uT,Le.VERSION=AT,Le.toFormData=_u,Le.AxiosError=ot,Le.Cancel=Le.CanceledError,Le.all=function(e){return Promise.all(e)},Le.spread=r$,Le.isAxiosError=o$,Le.mergeConfig=ji,Le.AxiosHeaders=qn,Le.formToJSON=t=>lT(oe.isHTMLForm(t)?new FormData(t):t),Le.getAdapter=TT.getAdapter,Le.HttpStatusCode=lm,Le.default=Le;const{Axios:yG,AxiosError:wG,CanceledError:bG,isCancel:CG,CancelToken:xG,VERSION:_G,all:SG,Cancel:TG,isAxiosError:EG,spread:AG,toFormData:IG,AxiosHeaders:kG,HttpStatusCode:NG,formToJSON:PG,getAdapter:OG,mergeConfig:MG}=Le,i$=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var a$=t=>!i$.has(t&&t.code);const s$=Ld(a$),dm="axios-retry";function NT(t){const e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:s$(t)}const PT=["get","head","options"],c$=PT.concat(["put","delete"]);function um(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function l$(t){var e;return(e=t.config)!=null&&e.method?um(t)&&PT.indexOf(t.config.method)!==-1:!1}function OT(t){var e;return(e=t.config)!=null&&e.method?um(t)&&c$.indexOf(t.config.method)!==-1:!1}function MT(t){return NT(t)||OT(t)}function fm(t=void 0){var r;const e=(r=t==null?void 0:t.response)==null?void 0:r.headers["retry-after"];if(!e)return 0;let n=(Number(e)||0)*1e3;return n===0&&(n=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,n)}function d$(t=0,e=void 0){return Math.max(0,fm(e))}function u$(t=0,e=void 0,n=100){const r=2**t*n,o=Math.max(r,fm(e)),a=o*.2*Math.random();return o+a}function f$(t=100){return(e=0,n=void 0)=>{const r=e*t;return Math.max(r,fm(n))}}const h$={retries:3,retryCondition:MT,retryDelay:d$,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function p$(t,e){return{...h$,...e,...t[dm]}}function DT(t,e,n=!1){const r=p$(t,e||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),t[dm]=r,r}function g$(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}async function m$(t,e){const{retries:n,retryCondition:r}=t,o=(t.retryCount||0)<n&&r(e);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function v$(t,e,n,r){var u;e.retryCount+=1;const{retryDelay:o,shouldResetTimeout:a,onRetry:s}=e,l=o(e.retryCount,n);if(g$(t,r),!a&&r.timeout&&e.lastRequestTime){const h=Date.now()-e.lastRequestTime,p=r.timeout-h-l;if(p<=0)return Promise.reject(n);r.timeout=p}return r.transformRequest=[h=>h],await s(e.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(t(r)):new Promise(h=>{var w;const p=()=>{clearTimeout(g),h(t(r))},g=setTimeout(()=>{var y;h(t(r)),(y=r.signal)!=null&&y.removeEventListener&&r.signal.removeEventListener("abort",p)},l);(w=r.signal)!=null&&w.addEventListener&&r.signal.addEventListener("abort",p,{once:!0})})}async function y$(t,e){t.retryCount>=t.retries&&await t.onMaxRetryTimesExceeded(e,t.retryCount)}const Fo=(t,e)=>{const n=t.interceptors.request.use(o=>{var a;return DT(o,e,!0),(a=o[dm])!=null&&a.validateResponse&&(o.validateStatus=()=>!1),o}),r=t.interceptors.response.use(null,async o=>{var l;const{config:a}=o;if(!a)return Promise.reject(o);const s=DT(a,e);return o.response&&((l=s.validateResponse)!=null&&l.call(s,o.response))?o.response:await m$(s,o)?v$(t,s,o,a):(await y$(s,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Fo.isNetworkError=NT,Fo.isSafeRequestError=l$,Fo.isIdempotentRequestError=OT,Fo.isNetworkOrIdempotentRequestError=MT,Fo.exponentialDelay=u$,Fo.linearDelay=f$,Fo.isRetryableError=um,Fo(Le,{retries:3,shouldResetTimeout:!0,retryCondition:t=>Fo.isRetryableError(t)&&t.config.method==="get"}),Le.interceptors.request.use(t=>{try{const e=localStorage.getItem("dataLogin");if(e){let n;try{n=JSON.parse(e)}catch(o){console.log("🚀 ~ axios.ts:27 ~ error:",o)}const r=n==null?void 0:n.user;r&&(t.headers["x-username"]=r.username||"unknown",t.headers["x-user-id"]=r.id||"")}}catch(e){console.error("Error adding user info to request headers:",e)}return t},t=>Promise.reject(t));var jr=(t=>(t.VIEW_DOCUMENT="VIEW_DOCUMENT",t.DOWNLOAD_DOCUMENT="DOWNLOAD_DOCUMENT",t.EDIT_DOCUMENT="EDIT_DOCUMENT",t.OWNER_DOCUMENT="OWNER_DOCUMENT",t))(jr||{});const w$=(t,e)=>{const[n,r]=M.useState([]),[o,a]=M.useState([]),[s,l]=M.useState([]),[u,h]=M.useState([]),{toast:p}=bc(),[g,w]=M.useState(!1),[y,C]=M.useState(!1),v=M.useCallback(async(O,T,L)=>{if(!y){C(!0);try{const H=await Le.post(t+"/document-permission/grandted",{path:O,grandtedBy:T,data:L});return H.status===200&&(p({title:"Phân quyền tài liệu thành công."}),await N(O)),H}catch{return null}finally{C(!1)}}},[]),b=M.useCallback(async()=>{var O;try{return(O=(await Le.get(e+"admin/users/get-all",{params:{limit:1e4}})).data||[])==null?void 0:O.filter(W=>W.role!=="MASTER_ADMIN")}catch(T){return console.error("Error fetchAllUsers",T),[]}},[]),k=M.useCallback(async()=>{try{return(await Le.get(e+"admin/group-users")).data.filter(T=>`${T.groupname}`.toUpperCase()!=="MASTER_ADMIN").map(T=>{var L;return{...T,users:((L=T.users)==null?void 0:L.length)||0}})}catch(O){return console.error("Error fetchAllGroups",O),[]}},[]),A=M.useCallback(async O=>{try{const L=(await Le.get(t+"/document-permission/grandted",{params:{path:O}})).data;return{usersShared:(L==null?void 0:L.users)||[],groupsShared:(L==null?void 0:L.groups)||[]}}catch(T){return console.error("Error fetchShared",T),{usersShared:[],groupsShared:[]}}},[]),N=M.useCallback(async O=>{if(g)return;w(!0);let[T,L,{usersShared:H,groupsShared:W}]=await Promise.all([b(),k(),A(O)]);T=T==null?void 0:T.filter(ee=>!(H!=null&&H.find(q=>q.userId===ee.id))),L=L==null?void 0:L.filter(ee=>!(W!=null&&W.find(q=>q.groupname===ee.groupname))),Array.isArray(T)&&r(T),Array.isArray(L)&&a(L),Array.isArray(H)&&l(H),Array.isArray(W)&&h(W),w(!1)},[]);return{users:n,groups:o,sharedUsers:s,sharedGroups:u,setUsers:r,setGroups:a,setSharedUsers:l,setSharedGroups:h,fetchData:N,loading:g,postGranted:v,loadingGrandted:y}},b$=({failureReasons:t,onNavigateToFile:e})=>{const n=u=>{if(e){const h=u.replace("s3://cts-llm-docs-bucket/","");e(h)}},r=u=>{const h=[];return u.forEach(p=>{try{JSON.parse(p).forEach(w=>{const y=w.match(/\[Files: ([^\]]+)\]/),C=w.match(/^([^[]+)/);if(y&&C&&y[1]&&C[1]){const v=y[1].split(", ").map(A=>A.trim()),b=C[1].trim().replace("Encountered error: ","");let k="unknown";b.includes("invalid metadata attributes")||b.includes("metadata quota")?k="metadata":b.includes("No metadata was provided")||b.includes("metadata file")?k="missing_metadata":b.includes("file size")||b.includes("exceeds")||b.includes("50 MB")?k="file_size":b.includes("format not supported")||b.includes("unsupported format")||b.includes("file type")?k="file_format":b.includes("embedding failed")||b.includes("EMBEDDING_FAILED")?k="embedding_failed":b.includes("indexing failed")||b.includes("INDEXING_FAILED")?k="indexing_failed":b.includes("access denied")||b.includes("AccessDeniedException")||b.includes("permission")?k="access_denied":(b.includes("quota")||b.includes("limit")||b.includes("ServiceQuotaExceededException"))&&(k="quota_exceeded"),h.push({errorMessage:b,files:v,errorType:k})}})}catch{h.push({errorMessage:p,files:[],errorType:"unknown"})}}),h},o=u=>{switch(u){case"metadata":return d.jsx(hi,{className:"h-4 w-4 text-orange-500"});case"missing_metadata":return d.jsx(lg,{className:"h-4 w-4 text-red-500"});case"file_size":return d.jsx(hi,{className:"h-4 w-4 text-yellow-500"});case"file_format":return d.jsx(lg,{className:"h-4 w-4 text-purple-500"});case"embedding_failed":return d.jsx(hi,{className:"h-4 w-4 text-red-600"});case"indexing_failed":return d.jsx(hi,{className:"h-4 w-4 text-red-600"});case"access_denied":return d.jsx(hi,{className:"h-4 w-4 text-red-700"});case"quota_exceeded":return d.jsx(hi,{className:"h-4 w-4 text-orange-600"});default:return d.jsx(hi,{className:"h-4 w-4 text-red-500"})}},a=u=>{switch(u){case"metadata":return"border-orange-200 bg-orange-50";case"missing_metadata":return"border-red-200 bg-red-50";case"file_size":return"border-yellow-200 bg-yellow-50";case"file_format":return"border-purple-200 bg-purple-50";case"embedding_failed":return"border-red-300 bg-red-100";case"indexing_failed":return"border-red-300 bg-red-100";case"access_denied":return"border-red-400 bg-red-100";case"quota_exceeded":return"border-orange-300 bg-orange-100";default:return"border-red-200 bg-red-50"}},s=u=>{switch(u){case"metadata":return"text-orange-800";case"missing_metadata":return"text-red-800";case"file_size":return"text-yellow-800";case"file_format":return"text-purple-800";case"embedding_failed":return"text-red-900";case"indexing_failed":return"text-red-900";case"access_denied":return"text-red-900";case"quota_exceeded":return"text-orange-900";default:return"text-red-800"}},l=r(t);return l.length===0?null:d.jsxs("div",{className:"border-t pt-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(hi,{className:"h-4 w-4 text-red-500"}),d.jsxs("p",{className:"text-red-600 font-medium",children:["Các file lỗi (",l.reduce((u,h)=>u+h.files.length,0)," file)"]})]}),d.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto",children:l.map((u,h)=>d.jsxs("div",{className:`p-3 rounded-lg border ${a(u.errorType)}`,children:[d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[o(u.errorType),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:`font-medium text-sm ${s(u.errorType)}`,children:u.errorMessage}),u.files.length>0&&d.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:[u.files.length," file bị ảnh hưởng"]})]})]})}),u.files.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200",children:[d.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Danh sách file lỗi:"}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:u.files.map((p,g)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-white/50 rounded hover:bg-white/80 transition-colors",children:[d.jsx(lg,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),e?d.jsxs("button",{onClick:()=>n(p),className:"text-blue-600 hover:text-blue-800 underline break-all font-mono text-left flex-1 flex items-center gap-1",title:"Nhấp để điều hướng đến file",children:[d.jsx("span",{children:p.replace("s3://cts-llm-docs-bucket/","")}),d.jsx(KM,{className:"h-3 w-3 flex-shrink-0"})]}):d.jsx("span",{className:"text-gray-700 break-all font-mono",children:p.replace("s3://cts-llm-docs-bucket/","")})]},g))})]})]},h))})]})};var hm={exports:{}},ku={exports:{}},wt={};/** @license React v16.13.1
213
+ `):" "+ST(s[0]):"as no adapter specified";throw new ot("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:sm};function cm(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new rs(null,t)}function ET(t){return cm(t),t.headers=Wn.from(t.headers),t.data=am.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),TT.getAdapter(t.adapter||Nc.adapter,t)(t).then(function(r){return cm(t),r.data=am.call(t,t.transformResponse,r),r.headers=Wn.from(r.headers),r},function(r){return uT(r)||(cm(t),r&&r.response&&(r.response.data=am.call(t,t.transformResponse,r.response),r.response.headers=Wn.from(r.response.headers))),Promise.reject(r)})}const AT="1.12.2",Au={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Au[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const IT={};Au.transitional=function(e,n,r){function o(a,s){return"[Axios v"+AT+"] Transitional option '"+a+"'"+s+(r?". "+r:"")}return(a,s,l)=>{if(e===!1)throw new ot(o(s," has been removed"+(n?" in "+n:"")),ot.ERR_DEPRECATED);return n&&!IT[s]&&(IT[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,s,l):!0}},Au.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function t$(t,e,n){if(typeof t!="object")throw new ot("options must be an object",ot.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const a=r[o],s=e[a];if(s){const l=t[a],u=l===void 0||s(l,a,t);if(u!==!0)throw new ot("option "+a+" must be "+u,ot.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ot("Unknown option "+a,ot.ERR_BAD_OPTION)}}const Iu={assertOptions:t$,validators:Au},go=Iu.validators;let Wi=class{constructor(e){this.defaults=e||{},this.interceptors={request:new sT,response:new sT}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
214
+ `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ji(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&Iu.assertOptions(r,{silentJSONParsing:go.transitional(go.boolean),forcedJSONParsing:go.transitional(go.boolean),clarifyTimeoutError:go.transitional(go.boolean)},!1),o!=null&&(oe.isFunction(o)?n.paramsSerializer={serialize:o}:Iu.assertOptions(o,{encode:go.function,serialize:go.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Iu.assertOptions(n,{baseUrl:go.spelling("baseURL"),withXsrfToken:go.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=a&&oe.merge(a.common,a[n.method]);a&&oe.forEach(["delete","get","head","post","put","patch","common"],C=>{delete a[C]}),n.headers=Wn.concat(s,a);const l=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let p,g=0,w;if(!u){const C=[ET.bind(this),void 0];for(C.unshift(...l),C.push(...h),w=C.length,p=Promise.resolve(n);g<w;)p=p.then(C[g++],C[g++]);return p}w=l.length;let y=n;for(;g<w;){const C=l[g++],v=l[g++];try{y=C(y)}catch(b){v.call(this,b);break}}try{p=ET.call(this,y)}catch(C){return Promise.reject(C)}for(g=0,w=h.length;g<w;)p=p.then(h[g++],h[g++]);return p}getUri(e){e=ji(this.defaults,e);const n=gT(e.baseURL,e.url,e.allowAbsoluteUrls);return aT(n,e.params,e.paramsSerializer)}};oe.forEach(["delete","get","head","options"],function(e){Wi.prototype[e]=function(n,r){return this.request(ji(r||{},{method:e,url:n,data:(r||{}).data}))}}),oe.forEach(["post","put","patch"],function(e){function n(r){return function(a,s,l){return this.request(ji(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}Wi.prototype[e]=n(),Wi.prototype[e+"Form"]=n(!0)});let n$=class dI{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const s=new Promise(l=>{r.subscribe(l),a=l}).then(o);return s.cancel=function(){r.unsubscribe(a)},s},e(function(a,s,l){r.reason||(r.reason=new rs(a,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new dI(function(o){e=o}),cancel:e}}};function r$(t){return function(n){return t.apply(null,n)}}function o$(t){return oe.isObject(t)&&t.isAxiosError===!0}const lm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lm).forEach(([t,e])=>{lm[e]=t});function kT(t){const e=new Wi(t),n=GS(Wi.prototype.request,e);return oe.extend(n,Wi.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return kT(ji(t,o))},n}const Le=kT(Nc);Le.Axios=Wi,Le.CanceledError=rs,Le.CancelToken=n$,Le.isCancel=uT,Le.VERSION=AT,Le.toFormData=_u,Le.AxiosError=ot,Le.Cancel=Le.CanceledError,Le.all=function(e){return Promise.all(e)},Le.spread=r$,Le.isAxiosError=o$,Le.mergeConfig=ji,Le.AxiosHeaders=Wn,Le.formToJSON=t=>lT(oe.isHTMLForm(t)?new FormData(t):t),Le.getAdapter=TT.getAdapter,Le.HttpStatusCode=lm,Le.default=Le;const{Axios:yG,AxiosError:wG,CanceledError:bG,isCancel:CG,CancelToken:xG,VERSION:_G,all:SG,Cancel:TG,isAxiosError:EG,spread:AG,toFormData:IG,AxiosHeaders:kG,HttpStatusCode:NG,formToJSON:PG,getAdapter:OG,mergeConfig:MG}=Le,i$=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var a$=t=>!i$.has(t&&t.code);const s$=Ld(a$),dm="axios-retry";function NT(t){const e=["ERR_CANCELED","ECONNABORTED"];return t.response||!t.code||e.includes(t.code)?!1:s$(t)}const PT=["get","head","options"],c$=PT.concat(["put","delete"]);function um(t){return t.code!=="ECONNABORTED"&&(!t.response||t.response.status===429||t.response.status>=500&&t.response.status<=599)}function l$(t){var e;return(e=t.config)!=null&&e.method?um(t)&&PT.indexOf(t.config.method)!==-1:!1}function OT(t){var e;return(e=t.config)!=null&&e.method?um(t)&&c$.indexOf(t.config.method)!==-1:!1}function MT(t){return NT(t)||OT(t)}function fm(t=void 0){var r;const e=(r=t==null?void 0:t.response)==null?void 0:r.headers["retry-after"];if(!e)return 0;let n=(Number(e)||0)*1e3;return n===0&&(n=(new Date(e).valueOf()||0)-Date.now()),Math.max(0,n)}function d$(t=0,e=void 0){return Math.max(0,fm(e))}function u$(t=0,e=void 0,n=100){const r=2**t*n,o=Math.max(r,fm(e)),a=o*.2*Math.random();return o+a}function f$(t=100){return(e=0,n=void 0)=>{const r=e*t;return Math.max(r,fm(n))}}const h$={retries:3,retryCondition:MT,retryDelay:d$,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function p$(t,e){return{...h$,...e,...t[dm]}}function DT(t,e,n=!1){const r=p$(t,e||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),t[dm]=r,r}function g$(t,e){t.defaults.agent===e.agent&&delete e.agent,t.defaults.httpAgent===e.httpAgent&&delete e.httpAgent,t.defaults.httpsAgent===e.httpsAgent&&delete e.httpsAgent}async function m$(t,e){const{retries:n,retryCondition:r}=t,o=(t.retryCount||0)<n&&r(e);if(typeof o=="object")try{return await o!==!1}catch{return!1}return o}async function v$(t,e,n,r){var u;e.retryCount+=1;const{retryDelay:o,shouldResetTimeout:a,onRetry:s}=e,l=o(e.retryCount,n);if(g$(t,r),!a&&r.timeout&&e.lastRequestTime){const h=Date.now()-e.lastRequestTime,p=r.timeout-h-l;if(p<=0)return Promise.reject(n);r.timeout=p}return r.transformRequest=[h=>h],await s(e.retryCount,n,r),(u=r.signal)!=null&&u.aborted?Promise.resolve(t(r)):new Promise(h=>{var w;const p=()=>{clearTimeout(g),h(t(r))},g=setTimeout(()=>{var y;h(t(r)),(y=r.signal)!=null&&y.removeEventListener&&r.signal.removeEventListener("abort",p)},l);(w=r.signal)!=null&&w.addEventListener&&r.signal.addEventListener("abort",p,{once:!0})})}async function y$(t,e){t.retryCount>=t.retries&&await t.onMaxRetryTimesExceeded(e,t.retryCount)}const Fo=(t,e)=>{const n=t.interceptors.request.use(o=>{var a;return DT(o,e,!0),(a=o[dm])!=null&&a.validateResponse&&(o.validateStatus=()=>!1),o}),r=t.interceptors.response.use(null,async o=>{var l;const{config:a}=o;if(!a)return Promise.reject(o);const s=DT(a,e);return o.response&&((l=s.validateResponse)!=null&&l.call(s,o.response))?o.response:await m$(s,o)?v$(t,s,o,a):(await y$(s,o),Promise.reject(o))});return{requestInterceptorId:n,responseInterceptorId:r}};Fo.isNetworkError=NT,Fo.isSafeRequestError=l$,Fo.isIdempotentRequestError=OT,Fo.isNetworkOrIdempotentRequestError=MT,Fo.exponentialDelay=u$,Fo.linearDelay=f$,Fo.isRetryableError=um,Fo(Le,{retries:3,shouldResetTimeout:!0,retryCondition:t=>Fo.isRetryableError(t)&&t.config.method==="get"}),Le.interceptors.request.use(t=>{try{const e=localStorage.getItem("dataLogin");if(e){let n;try{n=JSON.parse(e)}catch(o){console.log("🚀 ~ axios.ts:27 ~ error:",o)}const r=n==null?void 0:n.user;r&&(t.headers["x-username"]=r.username||"unknown",t.headers["x-user-id"]=r.id||"")}}catch(e){console.error("Error adding user info to request headers:",e)}return t},t=>Promise.reject(t));var jr=(t=>(t.VIEW_DOCUMENT="VIEW_DOCUMENT",t.DOWNLOAD_DOCUMENT="DOWNLOAD_DOCUMENT",t.EDIT_DOCUMENT="EDIT_DOCUMENT",t.OWNER_DOCUMENT="OWNER_DOCUMENT",t))(jr||{});const w$=(t,e)=>{const[n,r]=M.useState([]),[o,a]=M.useState([]),[s,l]=M.useState([]),[u,h]=M.useState([]),{toast:p}=bc(),[g,w]=M.useState(!1),[y,C]=M.useState(!1),v=M.useCallback(async(O,T,L)=>{if(!y){C(!0);try{const H=await Le.post(t+"/document-permission/grandted",{path:O,grandtedBy:T,data:L});return H.status===200&&(p({title:"Phân quyền tài liệu thành công."}),await N(O)),H}catch{return null}finally{C(!1)}}},[]),b=M.useCallback(async()=>{var O;try{return(O=(await Le.get(e+"admin/users/get-all",{params:{limit:1e4}})).data||[])==null?void 0:O.filter(W=>W.role!=="MASTER_ADMIN")}catch(T){return console.error("Error fetchAllUsers",T),[]}},[]),k=M.useCallback(async()=>{try{return(await Le.get(e+"admin/group-users")).data.filter(T=>`${T.groupname}`.toUpperCase()!=="MASTER_ADMIN").map(T=>{var L;return{...T,users:((L=T.users)==null?void 0:L.length)||0}})}catch(O){return console.error("Error fetchAllGroups",O),[]}},[]),A=M.useCallback(async O=>{try{const L=(await Le.get(t+"/document-permission/grandted",{params:{path:O}})).data;return{usersShared:(L==null?void 0:L.users)||[],groupsShared:(L==null?void 0:L.groups)||[]}}catch(T){return console.error("Error fetchShared",T),{usersShared:[],groupsShared:[]}}},[]),N=M.useCallback(async O=>{if(g)return;w(!0);let[T,L,{usersShared:H,groupsShared:W}]=await Promise.all([b(),k(),A(O)]);T=T==null?void 0:T.filter(ee=>!(H!=null&&H.find(q=>q.userId===ee.id))),L=L==null?void 0:L.filter(ee=>!(W!=null&&W.find(q=>q.groupname===ee.groupname))),Array.isArray(T)&&r(T),Array.isArray(L)&&a(L),Array.isArray(H)&&l(H),Array.isArray(W)&&h(W),w(!1)},[]);return{users:n,groups:o,sharedUsers:s,sharedGroups:u,setUsers:r,setGroups:a,setSharedUsers:l,setSharedGroups:h,fetchData:N,loading:g,postGranted:v,loadingGrandted:y}},b$=({failureReasons:t,onNavigateToFile:e})=>{const n=u=>{if(e){const h=u.replace("s3://cts-llm-docs-bucket/","");e(h)}},r=u=>{const h=[];return u.forEach(p=>{try{JSON.parse(p).forEach(w=>{const y=w.match(/\[Files: ([^\]]+)\]/),C=w.match(/^([^[]+)/);if(y&&C&&y[1]&&C[1]){const v=y[1].split(", ").map(A=>A.trim()),b=C[1].trim().replace("Encountered error: ","");let k="unknown";b.includes("invalid metadata attributes")||b.includes("metadata quota")?k="metadata":b.includes("No metadata was provided")||b.includes("metadata file")?k="missing_metadata":b.includes("file size")||b.includes("exceeds")||b.includes("50 MB")?k="file_size":b.includes("format not supported")||b.includes("unsupported format")||b.includes("file type")?k="file_format":b.includes("embedding failed")||b.includes("EMBEDDING_FAILED")?k="embedding_failed":b.includes("indexing failed")||b.includes("INDEXING_FAILED")?k="indexing_failed":b.includes("access denied")||b.includes("AccessDeniedException")||b.includes("permission")?k="access_denied":(b.includes("quota")||b.includes("limit")||b.includes("ServiceQuotaExceededException"))&&(k="quota_exceeded"),h.push({errorMessage:b,files:v,errorType:k})}})}catch{h.push({errorMessage:p,files:[],errorType:"unknown"})}}),h},o=u=>{switch(u){case"metadata":return d.jsx(hi,{className:"h-4 w-4 text-orange-500"});case"missing_metadata":return d.jsx(lg,{className:"h-4 w-4 text-red-500"});case"file_size":return d.jsx(hi,{className:"h-4 w-4 text-yellow-500"});case"file_format":return d.jsx(lg,{className:"h-4 w-4 text-purple-500"});case"embedding_failed":return d.jsx(hi,{className:"h-4 w-4 text-red-600"});case"indexing_failed":return d.jsx(hi,{className:"h-4 w-4 text-red-600"});case"access_denied":return d.jsx(hi,{className:"h-4 w-4 text-red-700"});case"quota_exceeded":return d.jsx(hi,{className:"h-4 w-4 text-orange-600"});default:return d.jsx(hi,{className:"h-4 w-4 text-red-500"})}},a=u=>{switch(u){case"metadata":return"border-orange-200 bg-orange-50";case"missing_metadata":return"border-red-200 bg-red-50";case"file_size":return"border-yellow-200 bg-yellow-50";case"file_format":return"border-purple-200 bg-purple-50";case"embedding_failed":return"border-red-300 bg-red-100";case"indexing_failed":return"border-red-300 bg-red-100";case"access_denied":return"border-red-400 bg-red-100";case"quota_exceeded":return"border-orange-300 bg-orange-100";default:return"border-red-200 bg-red-50"}},s=u=>{switch(u){case"metadata":return"text-orange-800";case"missing_metadata":return"text-red-800";case"file_size":return"text-yellow-800";case"file_format":return"text-purple-800";case"embedding_failed":return"text-red-900";case"indexing_failed":return"text-red-900";case"access_denied":return"text-red-900";case"quota_exceeded":return"text-orange-900";default:return"text-red-800"}},l=r(t);return l.length===0?null:d.jsxs("div",{className:"border-t pt-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(hi,{className:"h-4 w-4 text-red-500"}),d.jsxs("p",{className:"text-red-600 font-medium",children:["Các file lỗi (",l.reduce((u,h)=>u+h.files.length,0)," file)"]})]}),d.jsx("div",{className:"space-y-3 max-h-80 overflow-y-auto",children:l.map((u,h)=>d.jsxs("div",{className:`p-3 rounded-lg border ${a(u.errorType)}`,children:[d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex items-start gap-2 flex-1",children:[o(u.errorType),d.jsxs("div",{className:"flex-1",children:[d.jsx("p",{className:`font-medium text-sm ${s(u.errorType)}`,children:u.errorMessage}),u.files.length>0&&d.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:[u.files.length," file bị ảnh hưởng"]})]})]})}),u.files.length>0&&d.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200",children:[d.jsx("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Danh sách file lỗi:"}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-1",children:u.files.map((p,g)=>d.jsxs("div",{className:"flex items-center gap-2 text-xs p-2 bg-white/50 rounded hover:bg-white/80 transition-colors",children:[d.jsx(lg,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),e?d.jsxs("button",{onClick:()=>n(p),className:"text-blue-600 hover:text-blue-800 underline break-all font-mono text-left flex-1 flex items-center gap-1",title:"Nhấp để điều hướng đến file",children:[d.jsx("span",{children:p.replace("s3://cts-llm-docs-bucket/","")}),d.jsx(KM,{className:"h-3 w-3 flex-shrink-0"})]}):d.jsx("span",{className:"text-gray-700 break-all font-mono",children:p.replace("s3://cts-llm-docs-bucket/","")})]},g))})]})]},h))})]})};var hm={exports:{}},ku={exports:{}},wt={};/** @license React v16.13.1
215
215
  * react-is.production.min.js
216
216
  *
217
217
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -234,7 +234,7 @@ Valid keys: `+JSON.stringify(Object.keys(U),null," "));var ae=Pe(z,xe,Ce,Ne,Te+
234
234
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V$(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function K$(t){if(Array.isArray(t))return _m(t)}function XT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function ZT(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XT(Object(n),!0).forEach(function(r){eE(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XT(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function eE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oc(t,e){return W$(t)||j$(t,e)||tE(t,e)||G$()}function G$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
235
235
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tE(t,e){if(t){if(typeof t=="string")return _m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _m(t,e)}}function _m(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function j$(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function W$(t){if(Array.isArray(t))return t}var q$=typeof xm=="function"?xm:xm.default,Y$="file-invalid-type",J$="file-too-large",Q$="file-too-small",X$="too-many-files",Z$=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=e.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:Y$,message:"File type must be ".concat(r)}},nE=function(e){return{code:J$,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},rE=function(e){return{code:Q$,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},eH={code:X$,message:"Too many files"};function oE(t,e){var n=t.type==="application/x-moz-file"||q$(t,e);return[n,n?null:Z$(e)]}function iE(t,e,n){if(qi(t.size))if(qi(e)&&qi(n)){if(t.size>n)return[!1,nE(n)];if(t.size<e)return[!1,rE(e)]}else{if(qi(e)&&t.size<e)return[!1,rE(e)];if(qi(n)&&t.size>n)return[!1,nE(n)]}return[!0,null]}function qi(t){return t!=null}function tH(t){var e=t.files,n=t.accept,r=t.minSize,o=t.maxSize,a=t.multiple,s=t.maxFiles,l=t.validator;return!a&&e.length>1||a&&s>=1&&e.length>s?!1:e.every(function(u){var h=oE(u,n),p=Oc(h,1),g=p[0],w=iE(u,r,o),y=Oc(w,1),C=y[0],v=l?l(u):null;return g&&C&&!v})}function Pu(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function Ou(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function aE(t){t.preventDefault()}function nH(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function rH(t){return t.indexOf("Edge/")!==-1}function oH(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return nH(t)||rH(t)}function mo(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return e.some(function(l){return!Pu(r)&&l&&l.apply(void 0,[r].concat(a)),Pu(r)})}}function iH(){return"showOpenFilePicker"in window}function aH(t){if(qi(t)){var e=Object.entries(t).filter(function(n){var r=Oc(n,2),o=r[0],a=r[1],s=!0;return sE(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(a)||!a.every(cE))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var o=Oc(r,2),a=o[0],s=o[1];return ZT(ZT({},n),{},eE({},a,s))},{});return[{description:"Files",accept:e}]}return t}function sH(t){if(qi(t))return Object.entries(t).reduce(function(e,n){var r=Oc(n,2),o=r[0],a=r[1];return[].concat(QT(e),[o],QT(a))},[]).filter(function(e){return sE(e)||cE(e)}).join(",")}function cH(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function lH(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function sE(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||t==="application/*"||/\w+\/[-+.\w]+/g.test(t)}function cE(t){return/^.*\.[\w]+$/.test(t)}var dH=["children"],uH=["open"],fH=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],hH=["refKey","onChange","onClick"];function pH(t){return vH(t)||mH(t)||lE(t)||gH()}function gH(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
236
236
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mH(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vH(t){if(Array.isArray(t))return Tm(t)}function Sm(t,e){return bH(t)||wH(t,e)||lE(t,e)||yH()}function yH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
237
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lE(t,e){if(t){if(typeof t=="string")return Tm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tm(t,e)}}function Tm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wH(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function bH(t){if(Array.isArray(t))return t}function dE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ht(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?dE(Object(n),!0).forEach(function(r){Em(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Em(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mu(t,e){if(t==null)return{};var n=CH(t,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function CH(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var Am=M.forwardRef(function(t,e){var n=t.children,r=Mu(t,dH),o=fE(r),a=o.open,s=Mu(o,uH);return M.useImperativeHandle(e,function(){return{open:a}},[a]),M.createElement(M.Fragment,null,n(Ht(Ht({},s),{},{open:a})))});Am.displayName="Dropzone";var uE={disabled:!1,getFilesFromEvent:M$,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Am.defaultProps=uE,Am.propTypes={children:Pt.func,accept:Pt.objectOf(Pt.arrayOf(Pt.string)),multiple:Pt.bool,preventDropOnDocument:Pt.bool,noClick:Pt.bool,noKeyboard:Pt.bool,noDrag:Pt.bool,noDragEventsBubbling:Pt.bool,minSize:Pt.number,maxSize:Pt.number,maxFiles:Pt.number,disabled:Pt.bool,getFilesFromEvent:Pt.func,onFileDialogCancel:Pt.func,onFileDialogOpen:Pt.func,useFsAccessApi:Pt.bool,autoFocus:Pt.bool,onDragEnter:Pt.func,onDragLeave:Pt.func,onDragOver:Pt.func,onDrop:Pt.func,onDropAccepted:Pt.func,onDropRejected:Pt.func,onError:Pt.func,validator:Pt.func};var Im={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Ht(Ht({},uE),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,l=e.multiple,u=e.maxFiles,h=e.onDragEnter,p=e.onDragLeave,g=e.onDragOver,w=e.onDrop,y=e.onDropAccepted,C=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,k=e.useFsAccessApi,A=e.autoFocus,N=e.preventDropOnDocument,O=e.noClick,T=e.noKeyboard,L=e.noDrag,H=e.noDragEventsBubbling,W=e.onError,ee=e.validator,q=M.useMemo(function(){return sH(n)},[n]),de=M.useMemo(function(){return aH(n)},[n]),ce=M.useMemo(function(){return typeof b=="function"?b:hE},[b]),ve=M.useMemo(function(){return typeof v=="function"?v:hE},[v]),K=M.useRef(null),Z=M.useRef(null),G=M.useReducer(xH,Im),re=Sm(G,2),J=re[0],X=re[1],U=J.isFocused,te=J.isFileDialogActive,be=M.useRef(typeof window<"u"&&window.isSecureContext&&k&&iH()),Ee=function(){!be.current&&te&&setTimeout(function(){if(Z.current){var ne=Z.current.files;ne.length||(X({type:"closeDialog"}),ve())}},300)};M.useEffect(function(){return window.addEventListener("focus",Ee,!1),function(){window.removeEventListener("focus",Ee,!1)}},[Z,te,ve,be]);var Ce=M.useRef([]),Ne=function(ne){K.current&&K.current.contains(ne.target)||(ne.preventDefault(),Ce.current=[])};M.useEffect(function(){return N&&(document.addEventListener("dragover",aE,!1),document.addEventListener("drop",Ne,!1)),function(){N&&(document.removeEventListener("dragover",aE),document.removeEventListener("drop",Ne))}},[K,N]),M.useEffect(function(){return!r&&A&&K.current&&K.current.focus(),function(){}},[K,A,r]);var Te=M.useCallback(function(Q){W?W(Q):console.error(Q)},[W]),z=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q),Ce.current=[].concat(pH(Ce.current),[Q.target]),Ou(Q)&&Promise.resolve(o(Q)).then(function(ne){if(!(Pu(Q)&&!H)){var ke=ne.length,$e=ke>0&&tH({files:ne,accept:q,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:ee}),Be=ke>0&&!$e;X({isDragAccept:$e,isDragReject:Be,isDragActive:!0,type:"setDraggedFiles"}),h&&h(Q)}}).catch(function(ne){return Te(ne)})},[o,h,Te,H,q,s,a,l,u,ee]),ue=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q);var ne=Ou(Q);if(ne&&Q.dataTransfer)try{Q.dataTransfer.dropEffect="copy"}catch{}return ne&&g&&g(Q),!1},[g,H]),Ae=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q);var ne=Ce.current.filter(function($e){return K.current&&K.current.contains($e)}),ke=ne.indexOf(Q.target);ke!==-1&&ne.splice(ke,1),Ce.current=ne,!(ne.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ou(Q)&&p&&p(Q))},[K,p,H]),xe=M.useCallback(function(Q,ne){var ke=[],$e=[];Q.forEach(function(Be){var Mt=oE(Be,q),tn=Sm(Mt,2),zt=tn[0],yo=tn[1],Gt=iE(Be,s,a),vn=Sm(Gt,2),Jr=vn[0],Vt=vn[1],pr=ee?ee(Be):null;if(zt&&Jr&&!pr)ke.push(Be);else{var Qr=[yo,Vt];pr&&(Qr=Qr.concat(pr)),$e.push({file:Be,errors:Qr.filter(function(ea){return ea})})}}),(!l&&ke.length>1||l&&u>=1&&ke.length>u)&&(ke.forEach(function(Be){$e.push({file:Be,errors:[eH]})}),ke.splice(0)),X({acceptedFiles:ke,fileRejections:$e,isDragReject:$e.length>0,type:"setFiles"}),w&&w(ke,$e,ne),$e.length>0&&C&&C($e,ne),ke.length>0&&y&&y(ke,ne)},[X,l,q,s,a,u,w,y,C,ee]),Pe=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q),Ce.current=[],Ou(Q)&&Promise.resolve(o(Q)).then(function(ne){Pu(Q)&&!H||xe(ne,Q)}).catch(function(ne){return Te(ne)}),X({type:"reset"})},[o,xe,Te,H]),ae=M.useCallback(function(){if(be.current){X({type:"openDialog"}),ce();var Q={multiple:l,types:de};window.showOpenFilePicker(Q).then(function(ne){return o(ne)}).then(function(ne){xe(ne,null),X({type:"closeDialog"})}).catch(function(ne){cH(ne)?(ve(ne),X({type:"closeDialog"})):lH(ne)?(be.current=!1,Z.current?(Z.current.value=null,Z.current.click()):Te(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Te(ne)});return}Z.current&&(X({type:"openDialog"}),ce(),Z.current.value=null,Z.current.click())},[X,ce,ve,k,xe,Te,de,l]),Ze=M.useCallback(function(Q){!K.current||!K.current.isEqualNode(Q.target)||(Q.key===" "||Q.key==="Enter"||Q.keyCode===32||Q.keyCode===13)&&(Q.preventDefault(),ae())},[K,ae]),nt=M.useCallback(function(){X({type:"focus"})},[]),Tt=M.useCallback(function(){X({type:"blur"})},[]),ln=M.useCallback(function(){O||(oH()?setTimeout(ae,0):ae())},[O,ae]),Ot=function(ne){return r?null:ne},mn=function(ne){return T?null:Ot(ne)},en=function(ne){return L?null:Ot(ne)},R=function(ne){H&&ne.stopPropagation()},Y=M.useMemo(function(){return function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=Q.refKey,ke=ne===void 0?"ref":ne,$e=Q.role,Be=Q.onKeyDown,Mt=Q.onFocus,tn=Q.onBlur,zt=Q.onClick,yo=Q.onDragEnter,Gt=Q.onDragOver,vn=Q.onDragLeave,Jr=Q.onDrop,Vt=Mu(Q,fH);return Ht(Ht(Em({onKeyDown:mn(mo(Be,Ze)),onFocus:mn(mo(Mt,nt)),onBlur:mn(mo(tn,Tt)),onClick:Ot(mo(zt,ln)),onDragEnter:en(mo(yo,z)),onDragOver:en(mo(Gt,ue)),onDragLeave:en(mo(vn,Ae)),onDrop:en(mo(Jr,Pe)),role:typeof $e=="string"&&$e!==""?$e:"presentation"},ke,K),!r&&!T?{tabIndex:0}:{}),Vt)}},[K,Ze,nt,Tt,ln,z,ue,Ae,Pe,T,L,r]),se=M.useCallback(function(Q){Q.stopPropagation()},[]),Ie=M.useMemo(function(){return function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=Q.refKey,ke=ne===void 0?"ref":ne,$e=Q.onChange,Be=Q.onClick,Mt=Mu(Q,hH),tn=Em({accept:q,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Ot(mo($e,Pe)),onClick:Ot(mo(Be,se)),tabIndex:-1},ke,Z);return Ht(Ht({},tn),Mt)}},[Z,n,l,Pe,r]);return Ht(Ht({},J),{},{isFocused:U&&!r,getRootProps:Y,getInputProps:Ie,rootRef:K,inputRef:Z,open:Ot(ae)})}function xH(t,e){switch(e.type){case"focus":return Ht(Ht({},t),{},{isFocused:!0});case"blur":return Ht(Ht({},t),{},{isFocused:!1});case"openDialog":return Ht(Ht({},Im),{},{isFileDialogActive:!0});case"closeDialog":return Ht(Ht({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ht(Ht({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Ht(Ht({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return Ht({},Im);default:return t}}function hE(){}const _H=({onFilesSelected:t,children:e})=>{const[n,r]=M.useState(!1),{getRootProps:o,getInputProps:a}=fE({noClick:!0,onDrop:s=>{if(s&&s.length>0)if(s[0].path.split("/").length>2){const u=s.map(h=>{const g=(h.path||h.relativePath||"").split("/").slice(1).join("/");return(!h.webkitRelativePath||h.webkitRelativePath==="")&&Object.defineProperty(h,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),h});t(u,"folder")}else t(s,"files");r(!1)},onDragOver:s=>{s.preventDefault(),n||r(!0)},multiple:!0});return M.useEffect(()=>{const s=l=>{l.clientX===0&&l.clientY===0&&r(!1)};return document.addEventListener("dragleave",s),()=>{document.removeEventListener("dragleave",s)}},[]),d.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?d.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):e,d.jsx("input",{...a()})]})},SH=({openDialogRename:t,setOpenDialogRename:e,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:a,ignoreCache:s,autoSyncAfterFileOperation:l})=>{var N;const[u,h]=M.useState({}),[p,g]=M.useState(!1),[w,y]=M.useState(!1),[C,v]=M.useState(""),{toast:b}=bc();M.useEffect(()=>{t&&k(C)},[C,t]);const k=async O=>{try{y(!0);const T=await Le.get(`${n}/api/list-s3-folders?prefix=${O}`);h(T==null?void 0:T.data)}catch{b({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{y(!1)}},A=async()=>{g(!0);try{const O=o.key,T=O.endsWith("/")?O:`${O}/`,L=C.endsWith("/")?C:`${C}/`;if(T===L||O===C){b({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),g(!1);return}await Le.post(`${n}/api/move`,{oldPath:O,newPath:C}),s.current=!0,await a(),b({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${C}"`}),e(!1),r(null),v(""),l&&await l("move")}catch(O){console.error("Error renaming item:",O),b({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{g(!1)}};return d.jsx(Kn,{open:t,onOpenChange:O=>{O||(e(!1),r(null),v(""))},children:d.jsxs(Nn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[d.jsxs(Pn,{className:"mb-4 w-full h-full",children:[d.jsx("nav",{className:"mb-4",children:d.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),C.split("/").map((O,T,L)=>d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(O==="Root"?"":L.slice(0,T+1).join("/")+"/"),children:O},T))]})}),d.jsxs(On,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",d.jsxs("span",{className:"text-sm text-gray-500",children:["( file hoặc folder sẽ được di chuyển đến thư mục"," ",C===""?"Root":C," )"]})]}),d.jsx(Do,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:w?d.jsx("div",{className:"flex justify-center items-center py-4",children:d.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):d.jsx("ul",{className:"space-y-2",children:(N=Object.keys(u))==null?void 0:N.map(O=>d.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(O),children:O},O))})})]}),d.jsxs(_r,{className:"flex justify-end space-x-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>e(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),d.jsx(Fe,{onClick:A,disabled:p,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};function pE(t,[e,n]){return Math.min(n,Math.max(e,t))}var TH=[" ","Enter","ArrowUp","ArrowDown"],EH=[" ","Enter"],Yi="Select",[Du,Ru,AH]=bg(Yi),[is]=Io(Yi,[AH,mu]),Lu=mu(),[IH,wi]=is(Yi),[kH,NH]=is(Yi),gE=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:l,onValueChange:u,dir:h,name:p,autoComplete:g,disabled:w,required:y,form:C}=t,v=Lu(e),[b,k]=x.useState(null),[A,N]=x.useState(null),[O,T]=x.useState(!1),L=Cg(h),[H,W]=li({prop:r,defaultProp:o??!1,onChange:a,caller:Yi}),[ee,q]=li({prop:s,defaultProp:l,onChange:u,caller:Yi}),de=x.useRef(null),ce=b?C||!!b.closest("form"):!0,[ve,K]=x.useState(new Set),Z=Array.from(ve).map(G=>G.props.value).join(";");return d.jsx(wS,{...v,children:d.jsxs(IH,{required:y,scope:e,trigger:b,onTriggerChange:k,valueNode:A,onValueNodeChange:N,valueNodeHasChildren:O,onValueNodeHasChildrenChange:T,contentId:ko(),value:ee,onValueChange:q,open:H,onOpenChange:W,dir:L,triggerPointerDownPosRef:de,disabled:w,children:[d.jsx(Du.Provider,{scope:e,children:d.jsx(kH,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(G=>{K(re=>new Set(re).add(G))},[]),onNativeOptionRemove:x.useCallback(G=>{K(re=>{const J=new Set(re);return J.delete(G),J})},[]),children:n})}),ce?d.jsxs(FE,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:ee,onChange:G=>q(G.target.value),disabled:w,form:C,children:[ee===void 0?d.jsx("option",{value:""}):null,Array.from(ve)]},Z):null]})})};gE.displayName=Yi;var mE="SelectTrigger",vE=x.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,a=Lu(n),s=wi(mE,n),l=s.disabled||r,u=kt(e,s.onTriggerChange),h=Ru(n),p=x.useRef("touch"),[g,w,y]=$E(v=>{const b=h().filter(N=>!N.disabled),k=b.find(N=>N.value===s.value),A=HE(b,v,k);A!==void 0&&s.onValueChange(A.value)}),C=v=>{l||(s.onOpenChange(!0),y()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(bS,{asChild:!0,...a,children:d.jsx(tt.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":UE(s.value)?"":void 0,...o,ref:u,onClick:Ke(o.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&C(v)}),onPointerDown:Ke(o.onPointerDown,v=>{p.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(C(v),v.preventDefault())}),onKeyDown:Ke(o.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&w(v.key),!(b&&v.key===" ")&&TH.includes(v.key)&&(C(),v.preventDefault())})})})});vE.displayName=mE;var yE="SelectValue",wE=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...l}=t,u=wi(yE,n),{onValueNodeHasChildrenChange:h}=u,p=a!==void 0,g=kt(e,u.onValueNodeChange);return gn(()=>{h(p)},[h,p]),d.jsx(tt.span,{...l,ref:g,style:{pointerEvents:"none"},children:UE(u.value)?d.jsx(d.Fragment,{children:s}):a})});wE.displayName=yE;var PH="SelectIcon",bE=x.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return d.jsx(tt.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});bE.displayName=PH;var OH="SelectPortal",CE=t=>d.jsx(oc,{asChild:!0,...t});CE.displayName=OH;var Ji="SelectContent",xE=x.forwardRef((t,e)=>{const n=wi(Ji,t.__scopeSelect),[r,o]=x.useState();if(gn(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?$s.createPortal(d.jsx(_E,{scope:t.__scopeSelect,children:d.jsx(Du.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),a):null}return d.jsx(SE,{...t,ref:e})});xE.displayName=Ji;var Wr=10,[_E,bi]=is(Ji),MH="SelectContentImpl",DH=Ha("SelectContent.RemoveScroll"),SE=x.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:v,avoidCollisions:b,...k}=t,A=wi(Ji,n),[N,O]=x.useState(null),[T,L]=x.useState(null),H=kt(e,z=>O(z)),[W,ee]=x.useState(null),[q,de]=x.useState(null),ce=Ru(n),[ve,K]=x.useState(!1),Z=x.useRef(!1);x.useEffect(()=>{if(N)return DC(N)},[N]),vC();const G=x.useCallback(z=>{const[ue,...Ae]=ce().map(ae=>ae.ref.current),[xe]=Ae.slice(-1),Pe=document.activeElement;for(const ae of z)if(ae===Pe||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===ue&&T&&(T.scrollTop=0),ae===xe&&T&&(T.scrollTop=T.scrollHeight),ae==null||ae.focus(),document.activeElement!==Pe))return},[ce,T]),re=x.useCallback(()=>G([W,N]),[G,W,N]);x.useEffect(()=>{ve&&re()},[ve,re]);const{onOpenChange:J,triggerPointerDownPosRef:X}=A;x.useEffect(()=>{if(N){let z={x:0,y:0};const ue=xe=>{var Pe,ae;z={x:Math.abs(Math.round(xe.pageX)-(((Pe=X.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((ae=X.current)==null?void 0:ae.y)??0))}},Ae=xe=>{z.x<=10&&z.y<=10?xe.preventDefault():N.contains(xe.target)||J(!1),document.removeEventListener("pointermove",ue),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[N,J,X]),x.useEffect(()=>{const z=()=>J(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[J]);const[U,te]=$E(z=>{const ue=ce().filter(Pe=>!Pe.disabled),Ae=ue.find(Pe=>Pe.ref.current===document.activeElement),xe=HE(ue,z,Ae);xe&&setTimeout(()=>xe.ref.current.focus())}),be=x.useCallback((z,ue,Ae)=>{const xe=!Z.current&&!Ae;(A.value!==void 0&&A.value===ue||xe)&&(ee(z),xe&&(Z.current=!0))},[A.value]),Ee=x.useCallback(()=>N==null?void 0:N.focus(),[N]),Ce=x.useCallback((z,ue,Ae)=>{const xe=!Z.current&&!Ae;(A.value!==void 0&&A.value===ue||xe)&&de(z)},[A.value]),Ne=r==="popper"?km:TE,Te=Ne===km?{side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:v,avoidCollisions:b}:{};return d.jsx(_E,{scope:n,content:N,viewport:T,onViewportChange:L,itemRefCallback:be,selectedItem:W,onItemLeave:Ee,itemTextRefCallback:Ce,focusSelectedItem:re,selectedItemText:q,position:r,isPositioned:ve,searchRef:U,children:d.jsx(Hp,{as:DH,allowPinchZoom:!0,children:d.jsx(Dp,{asChild:!0,trapped:A.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:Ke(o,z=>{var ue;(ue=A.trigger)==null||ue.focus({preventScroll:!0}),z.preventDefault()}),children:d.jsx(rc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:d.jsx(Ne,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:z=>z.preventDefault(),...k,...Te,onPlaced:()=>K(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ke(k.onKeyDown,z=>{const ue=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!ue&&z.key.length===1&&te(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let xe=ce().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(z.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const Pe=z.target,ae=xe.indexOf(Pe);xe=xe.slice(ae+1)}setTimeout(()=>G(xe)),z.preventDefault()}})})})})})})});SE.displayName=MH;var RH="SelectItemAlignedPosition",TE=x.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,a=wi(Ji,n),s=bi(Ji,n),[l,u]=x.useState(null),[h,p]=x.useState(null),g=kt(e,H=>p(H)),w=Ru(n),y=x.useRef(!1),C=x.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:k,focusSelectedItem:A}=s,N=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&h&&v&&b&&k){const H=a.trigger.getBoundingClientRect(),W=h.getBoundingClientRect(),ee=a.valueNode.getBoundingClientRect(),q=k.getBoundingClientRect();if(a.dir!=="rtl"){const Pe=q.left-W.left,ae=ee.left-Pe,Ze=H.left-ae,nt=H.width+Ze,Tt=Math.max(nt,W.width),ln=window.innerWidth-Wr,Ot=pE(ae,[Wr,Math.max(Wr,ln-Tt)]);l.style.minWidth=nt+"px",l.style.left=Ot+"px"}else{const Pe=W.right-q.right,ae=window.innerWidth-ee.right-Pe,Ze=window.innerWidth-H.right-ae,nt=H.width+Ze,Tt=Math.max(nt,W.width),ln=window.innerWidth-Wr,Ot=pE(ae,[Wr,Math.max(Wr,ln-Tt)]);l.style.minWidth=nt+"px",l.style.right=Ot+"px"}const de=w(),ce=window.innerHeight-Wr*2,ve=v.scrollHeight,K=window.getComputedStyle(h),Z=parseInt(K.borderTopWidth,10),G=parseInt(K.paddingTop,10),re=parseInt(K.borderBottomWidth,10),J=parseInt(K.paddingBottom,10),X=Z+G+ve+J+re,U=Math.min(b.offsetHeight*5,X),te=window.getComputedStyle(v),be=parseInt(te.paddingTop,10),Ee=parseInt(te.paddingBottom,10),Ce=H.top+H.height/2-Wr,Ne=ce-Ce,Te=b.offsetHeight/2,z=b.offsetTop+Te,ue=Z+G+z,Ae=X-ue;if(ue<=Ce){const Pe=de.length>0&&b===de[de.length-1].ref.current;l.style.bottom="0px";const ae=h.clientHeight-v.offsetTop-v.offsetHeight,Ze=Math.max(Ne,Te+(Pe?Ee:0)+ae+re),nt=ue+Ze;l.style.height=nt+"px"}else{const Pe=de.length>0&&b===de[0].ref.current;l.style.top="0px";const Ze=Math.max(Ce,Z+v.offsetTop+(Pe?be:0)+Te)+Ae;l.style.height=Ze+"px",v.scrollTop=ue-Ce+v.offsetTop}l.style.margin=`${Wr}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=ce+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,h,v,b,k,a.dir,r]);gn(()=>N(),[N]);const[O,T]=x.useState();gn(()=>{h&&T(window.getComputedStyle(h).zIndex)},[h]);const L=x.useCallback(H=>{H&&C.current===!0&&(N(),A==null||A(),C.current=!1)},[N,A]);return d.jsx(FH,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:L,children:d.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:d.jsx(tt.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});TE.displayName=RH;var LH="SelectPopperPosition",km=x.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Wr,...a}=t,s=Lu(n);return d.jsx(CS,{...s,...a,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.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)"}})});km.displayName=LH;var[FH,Nm]=is(Ji,{}),Pm="SelectViewport",EE=x.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,a=bi(Pm,n),s=Nm(Pm,n),l=kt(e,a.onViewportChange),u=x.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Du.Slot,{scope:n,children:d.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ke(o.onScroll,h=>{const p=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w!=null&&w.current&&g){const y=Math.abs(u.current-p.scrollTop);if(y>0){const C=window.innerHeight-Wr*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),k=Math.max(v,b);if(k<C){const A=k+y,N=Math.min(C,A),O=A-N;g.style.height=N+"px",g.style.bottom==="0px"&&(p.scrollTop=O>0?O:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});EE.displayName=Pm;var AE="SelectGroup",[UH,$H]=is(AE),HH=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=ko();return d.jsx(UH,{scope:n,id:o,children:d.jsx(tt.div,{role:"group","aria-labelledby":o,...r,ref:e})})});HH.displayName=AE;var IE="SelectLabel",kE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=$H(IE,n);return d.jsx(tt.div,{id:o.id,...r,ref:e})});kE.displayName=IE;var Fu="SelectItem",[BH,NE]=is(Fu),PE=x.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=t,l=wi(Fu,n),u=bi(Fu,n),h=l.value===r,[p,g]=x.useState(a??""),[w,y]=x.useState(!1),C=kt(e,A=>{var N;return(N=u.itemRefCallback)==null?void 0:N.call(u,A,r,o)}),v=ko(),b=x.useRef("touch"),k=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(BH,{scope:n,value:r,disabled:o,textId:v,isSelected:h,onItemTextChange:x.useCallback(A=>{g(N=>N||((A==null?void 0:A.textContent)??"").trim())},[]),children:d.jsx(Du.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:d.jsx(tt.div,{role:"option","aria-labelledby":v,"data-highlighted":w?"":void 0,"aria-selected":h&&w,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:C,onFocus:Ke(s.onFocus,()=>y(!0)),onBlur:Ke(s.onBlur,()=>y(!1)),onClick:Ke(s.onClick,()=>{b.current!=="mouse"&&k()}),onPointerUp:Ke(s.onPointerUp,()=>{b.current==="mouse"&&k()}),onPointerDown:Ke(s.onPointerDown,A=>{b.current=A.pointerType}),onPointerMove:Ke(s.onPointerMove,A=>{var N;b.current=A.pointerType,o?(N=u.onItemLeave)==null||N.call(u):b.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(s.onPointerLeave,A=>{var N;A.currentTarget===document.activeElement&&((N=u.onItemLeave)==null||N.call(u))}),onKeyDown:Ke(s.onKeyDown,A=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&A.key===" "||(EH.includes(A.key)&&k(),A.key===" "&&A.preventDefault())})})})})});PE.displayName=Fu;var Mc="SelectItemText",OE=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...a}=t,s=wi(Mc,n),l=bi(Mc,n),u=NE(Mc,n),h=NH(Mc,n),[p,g]=x.useState(null),w=kt(e,k=>g(k),u.onItemTextChange,k=>{var A;return(A=l.itemTextRefCallback)==null?void 0:A.call(l,k,u.value,u.disabled)}),y=p==null?void 0:p.textContent,C=x.useMemo(()=>d.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=h;return gn(()=>(v(C),()=>b(C)),[v,b,C]),d.jsxs(d.Fragment,{children:[d.jsx(tt.span,{id:u.textId,...a,ref:w}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?$s.createPortal(a.children,s.valueNode):null]})});OE.displayName=Mc;var ME="SelectItemIndicator",DE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return NE(ME,n).isSelected?d.jsx(tt.span,{"aria-hidden":!0,...r,ref:e}):null});DE.displayName=ME;var Om="SelectScrollUpButton",zH=x.forwardRef((t,e)=>{const n=bi(Om,t.__scopeSelect),r=Nm(Om,t.__scopeSelect),[o,a]=x.useState(!1),s=kt(e,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollTop>0;a(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(RE,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});zH.displayName=Om;var Mm="SelectScrollDownButton",VH=x.forwardRef((t,e)=>{const n=bi(Mm,t.__scopeSelect),r=Nm(Mm,t.__scopeSelect),[o,a]=x.useState(!1),s=kt(e,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<h;a(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(RE,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});VH.displayName=Mm;var RE=x.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,a=bi("SelectScrollButton",n),s=x.useRef(null),l=Ru(n),u=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>u(),[u]),gn(()=>{var p;const h=l().find(g=>g.ref.current===document.activeElement);(p=h==null?void 0:h.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),d.jsx(tt.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ke(o.onPointerMove,()=>{var h;(h=a.onItemLeave)==null||h.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ke(o.onPointerLeave,()=>{u()})})}),KH="SelectSeparator",LE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return d.jsx(tt.div,{"aria-hidden":!0,...r,ref:e})});LE.displayName=KH;var Dm="SelectArrow",GH=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Lu(n),a=wi(Dm,n),s=bi(Dm,n);return a.open&&s.position==="popper"?d.jsx(xS,{...o,...r,ref:e}):null});GH.displayName=Dm;var jH="SelectBubbleInput",FE=x.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=x.useRef(null),a=kt(r,o),s=Lx(e);return x.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==e&&p){const g=new Event("change",{bubbles:!0});p.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(tt.select,{...n,style:{...h_,...n.style},ref:a,defaultValue:e})});FE.displayName=jH;function UE(t){return t===""||t===void 0}function $E(t){const e=xr(t),n=x.useRef(""),r=x.useRef(0),o=x.useCallback(s=>{const l=n.current+s;e(l),function u(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[e]),a=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function HE(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=WH(t,Math.max(a,0));o.length===1&&(s=s.filter(h=>h!==n));const u=s.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function WH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var qH=gE,BE=vE,YH=wE,JH=bE,QH=CE,zE=xE,XH=EE,VE=kE,KE=PE,ZH=OE,e3=DE,GE=LE;const Rm=qH,Lm=YH,Uu=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(BE,{ref:r,className:Ge("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,d.jsx(JH,{asChild:!0,children:d.jsx(BM,{className:"h-4 w-4 opacity-50"})})]}));Uu.displayName=BE.displayName;const $u=x.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>d.jsx(QH,{children:d.jsx(zE,{ref:o,className:Ge("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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",t),position:n,...r,children:d.jsx(XH,{className:Ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));$u.displayName=zE.displayName;const t3=x.forwardRef(({className:t,...e},n)=>d.jsx(VE,{ref:n,className:Ge("px-2 py-1.5 text-sm font-semibold",t),...e}));t3.displayName=VE.displayName;const Qi=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(KE,{ref:r,className:Ge("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(e3,{children:d.jsx(mx,{className:"h-4 w-4"})})}),d.jsx(ZH,{children:e})]}));Qi.displayName=KE.displayName;const n3=x.forwardRef(({className:t,...e},n)=>d.jsx(GE,{ref:n,className:Ge("-mx-1 my-1 h-px bg-muted",t),...e}));n3.displayName=GE.displayName;const Fm=[{value:"EDIT_DOCUMENT",label:"Chỉnh sửa"}];function r3({onClose:t,open:e,file:n,apiBaseUrl:r,rootUrlHostApi:o}){const[a,s]=M.useState("users"),[l,u]=M.useState(""),[h,p]=M.useState(""),[g,w]=M.useState(""),[y,C]=M.useState(""),[v,b]=M.useState(jr.VIEW_DOCUMENT),[k,A]=M.useState([]),{users:N,groups:O,sharedUsers:T,sharedGroups:L,fetchData:H,loading:W,postGranted:ee,loadingGrandted:q,setSharedGroups:de,setSharedUsers:ce}=w$(r,o),ve=Mo(),K=n?n.key:"",Z=N.filter(z=>{var ue;return(ve==null?void 0:ve.id)!==z.id&&(z.username.toLowerCase().includes(l.toLowerCase())||((ue=z.email)==null?void 0:ue.toLowerCase().includes(l.toLowerCase())))}),G=O.filter(z=>z.groupname.toLowerCase().includes(h.toLowerCase())),re=T.filter(z=>{var ue,Ae;return((ue=z.username)==null?void 0:ue.toLowerCase().includes(g.toLowerCase()))||((Ae=z.email)==null?void 0:Ae.toLowerCase().includes(g.toLowerCase()))}),J=L.filter(z=>{var ue;return(ue=z.groupname)==null?void 0:ue.toLowerCase().includes(y.toLowerCase())}),X=z=>{b(z),A(ue=>ue.map(Ae=>({...Ae,permissions:z})))},U=()=>{a==="users"?(u(""),w("")):(p(""),C(""),s("users")),A([]),b(jr.EDIT_DOCUMENT)};M.useEffect(()=>{e?H(K):U()},[e,K]);const te=z=>{z!==a&&(a==="users"?(u(""),w("")):(p(""),C(""))),s(z)},be=z=>{n&&A(ue=>{if(ue.find(ae=>ae.userId===z))return ue.filter(ae=>ae.userId!==z);const Pe={path:n.key+n.name,permissions:v,userId:z,grandtedBy:ve==null?void 0:ve.id};return[...ue,Pe]})},Ee=z=>{if(!n)return;const ue=z.groupname;A(Ae=>{if(Ae.find(Ze=>Ze.groupname===ue))return Ae.filter(Ze=>Ze.groupname!==ue);const ae={path:n.key+n.name,permissions:v,groupname:ue,groupId:z.id,grandtedBy:ve==null?void 0:ve.id,users:z.users};return[...Ae,ae]})},Ce=async(z,ue,Ae)=>{const xe={...z,permissions:ue};A(Pe=>{const ae=Pe.map(nt=>nt.id===xe.id?xe:nt);return Pe.some(nt=>nt.id===xe.id)||ae.push(xe),ae}),Ae==="users"?ce(Pe=>Pe.map(ae=>ae.id===z.id?xe:ae)):de(Pe=>Pe.map(ae=>ae.id===z.id?xe:ae))},Ne=async()=>{if(n){const z=(n==null?void 0:n.key)||""+(n==null?void 0:n.name),ue=await ee(z,ve==null?void 0:ve.id,k);(ue==null?void 0:ue.status)==200&&A([])}},Te="flex-1 min-h-0 overflow-y-auto border rounded-lg px-3 py-2 bg-background shadow-sm";return n?d.jsx(Kn,{open:e,onOpenChange:t,children:d.jsxs(Nn,{className:"max-w-5xl h-[80vh] flex flex-col overflow-hidden",children:[d.jsx(Pn,{children:d.jsxs(On,{className:"text-lg font-semibold",children:["Chia sẻ tài liệu: ",n.name]})}),d.jsxs(Tg,{defaultValue:"users",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(eu,{className:"grid grid-cols-2 w-1/2 mx-auto mb-4 bg-muted rounded-lg",children:[d.jsx(zi,{value:"users",className:"py-2",onClick:()=>te("users"),children:"Người dùng"}),d.jsx(zi,{value:"groups",className:"py-2",onClick:()=>te("groups"),children:"Nhóm"})]}),d.jsx(Vi,{value:"users",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với người dùng:"}),d.jsx(Gn,{placeholder:"Tìm người dùng...",className:"mb-3 border-input bg-background shadow-sm",value:l,onChange:z=>u(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Z.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy người dùng."}):d.jsx("ul",{className:"space-y-2",children:Z.map(z=>d.jsx("li",{onClick:()=>be(z.id),className:"flex flex-col space-y-1 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(pc,{id:`user-${z.id}`,checked:!!k.find(ue=>ue.userId===z.id)}),d.jsxs(lr,{className:"flex-1",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]})]})},z.id))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với người dùng:"}),d.jsx(Gn,{placeholder:"Tìm người dùng đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:g,onChange:z=>w(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):re.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với người dùng nào."}):d.jsx("ul",{className:"space-y-2",children:re.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]}),d.jsxs(Rm,{value:z.permissions,onValueChange:ue=>Ce(z,ue,"users"),disabled:z.permissions===jr.OWNER_DOCUMENT,children:[d.jsx(Uu,{className:"w-[120px]",children:d.jsx(Lm,{placeholder:"Chọn quyền"})}),d.jsxs($u,{children:[Fm.map(ue=>d.jsx(Qi,{value:ue.value,children:ue.label},ue.value)),z.permissions===jr.OWNER_DOCUMENT&&d.jsx(Qi,{value:jr.OWNER_DOCUMENT,children:"Chủ sở hữu"},jr.OWNER_DOCUMENT),d.jsx(Qi,{value:"None",children:"Thu hồi"},"None")]})]})]},z.id))})})]})]})}),d.jsx(Vi,{value:"groups",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với nhóm:"}),d.jsx(Gn,{placeholder:"Tìm nhóm...",className:"mb-3 border-input bg-background shadow-sm",value:h,onChange:z=>p(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):G.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy nhóm."}):d.jsx("ul",{className:"space-y-2",children:G.map(z=>d.jsxs("li",{onClick:()=>Ee(z),className:"flex items-center space-x-3 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsx(pc,{id:`group-${z.groupname}`,checked:!!k.find(ue=>ue.groupname===z.groupname)}),d.jsxs(lr,{className:"font-medium",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]})]},z.groupname))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với nhóm:"}),d.jsx(Gn,{placeholder:"Tìm nhóm đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:y,onChange:z=>C(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):J.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với nhóm nào."}):d.jsx("ul",{className:"space-y-2",children:J.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]}),d.jsxs(Rm,{value:z.permissions,onValueChange:ue=>Ce(z,ue,"groups"),children:[d.jsx(Uu,{className:"w-[120px]",children:d.jsx(Lm,{placeholder:"Chọn quyền"})}),d.jsxs($u,{children:[Fm.map(ue=>d.jsx(Qi,{value:ue.value,children:ue.label},ue.value)),d.jsx(Qi,{value:"None",children:"Thu hồi"},"None")]})]})]},z.groupname))})})]})]})})]}),d.jsxs("div",{className:"mt-4 bg-muted/50 p-4 rounded-lg",children:[d.jsx(lr,{className:"font-medium mb-2 block",children:"Phân quyền:"}),d.jsxs(Rm,{value:v,onValueChange:X,children:[d.jsx(Uu,{className:"w-1/2 border border-input bg-background shadow-sm hover:bg-accent",children:d.jsx(Lm,{placeholder:"Chọn quyền truy cập"})}),d.jsx($u,{children:Fm.map(z=>d.jsx(Qi,{value:z.value,className:"flex items-center gap-2",children:z.label}))})]})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:t,children:"Huỷ"}),d.jsx(Fe,{variant:"default",onClick:Ne,disabled:k.length===0||q,className:"w-[120px] justify-center",children:q?d.jsx(St,{className:"h-4 w-4 animate-spin"}):"Lưu thay đổi"})]})]})}):null}function jE({enabled:t,onChange:e}){const[n,r]=M.useState(t),o=async()=>{e(),r(a=>!a)};return d.jsx("button",{type:"button",onClick:o,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-300 ${n?"bg-green-500":"bg-gray-300 dark:bg-gray-600"}`,children:d.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform duration-300 ${n?"translate-x-5":"translate-x-1"}`})})}function WE({open:t,onClose:e,isPublic:n,onSave:r,file:o}){const[a,s]=M.useState(n);M.useEffect(()=>{s(n)},[n]);const l=()=>{r(a),e()};return o?d.jsx(Kn,{open:t,onOpenChange:e,children:d.jsxs(Nn,{className:"sm:max-w-[400px]",children:[d.jsx(Pn,{children:d.jsx(On,{children:"Chỉnh sửa quyền riêng tư"})}),d.jsxs(Do,{children:["Tài liệu: ",o.key]}),d.jsxs("div",{className:"flex items-center justify-between py-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[a?d.jsx(GM,{className:"text-green-500",size:20}):d.jsx(jM,{className:"text-gray-500",size:20}),d.jsx(lr,{children:a?"Công khai":"Riêng tư"})]}),d.jsx(jE,{enabled:a,onChange:()=>s(u=>!u)})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:e,children:"Hủy"}),d.jsx(Fe,{onClick:l,children:"Lưu thay đổi"})]})]})}):null}const o3="AIzaSyBI8KiTWudkw8iR5cjH7ZsA4JBN1NqJw8A",i3="726815747852-5deq413t8kd8j3mgj48d46eatjauapq5.apps.googleusercontent.com",a3="https://www.googleapis.com/auth/drive",fr={current:!1},qE="crawl:jobs",as="crawl:current_job",s3=t=>{const[e,n]=M.useState(null),[r,o]=M.useState(0);return M.useEffect(()=>{const a=localStorage.getItem(as);if(a){const s=JSON.parse(a);n(s),s!=null&&s.startTime&&o(Math.floor((Date.now()-s.startTime)/1e3))}},[]),M.useEffect(()=>{if(!(e!=null&&e.startTime))return;const a=setInterval(()=>{o(Math.floor((Date.now()-e.startTime)/1e3))},1e3);return()=>clearInterval(a)},[e==null?void 0:e.startTime]),M.useEffect(()=>{if(!(e!=null&&e.id))return;const a=async()=>{try{const u=(await Le.get(`${t}/api/crawl/${e.id}?taskId=${e.taskId}`)).data;n(h=>{if(!h)return null;const p={...h,status:u};return localStorage.setItem(as,JSON.stringify(p)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(as)},100),p})}catch(l){console.error("Error polling job status:",l)}},s=setInterval(a,3e3);return a(),()=>clearInterval(s)},[e==null?void 0:e.id,t]),{currentJob:e,elapsedTime:r,setCurrentJob:a=>{a&&!a.startTime&&(a.startTime=Date.now()),n(a),a?localStorage.setItem(as,JSON.stringify(a)):localStorage.removeItem(as)}}},Hu=(t,e)=>{const n=[],r=o=>{(t[o]||[]).forEach(s=>{n.push(s.key),s.isFolder&&r(s.key)})};return r(e),n},c3=(t,e)=>{const n=[];return(t[e]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Hu(t,o.key))}),n},l3=(t,e,n=[],r,o,a,s,l,u,h)=>{const[p,g]=M.useState({}),[w,y]=M.useState(!1),[C,v]=M.useState(null),[b,k]=M.useState(0),A=M.useRef(e);M.useEffect(()=>{A.current=e},[e]);const N=async()=>{var T;y(!0);try{const L=Mo(),H=await Le.get(`${t}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:A.current,userId:(L==null?void 0:L.id)||"",groupId:((T=L==null?void 0:L.group)==null?void 0:T.id)||"",groupname:(L==null?void 0:L.groupname)||""},timeout:3e5}),W=[];Ud.forEach(H.data,(ee,q)=>{l!=null&&l.has(q)&&Ud.forEach(ee,de=>{(u==null?void 0:u.current[de.key])!==!1&&W.push(de.key)})}),W.length&&(h==null||h(ee=>{const q=new Set(ee);return W.forEach(de=>q.add(de)),q})),g(H.data),v(null)}catch(L){v(L instanceof Error?L:new Error("Failed to fetch files"))}finally{y(!1),k(0),a("")}},O=async T=>{var L,H;try{if(!T)return;y(!0);const W=await Le.get(`${t}/api/search-db?query=${T}&rootPrefix=${e}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return g({[e]:((L=W==null?void 0:W.data)==null?void 0:L.result)||[]}),k(((H=W==null?void 0:W.data)==null?void 0:H.estimatedTotalHits)||0),W}catch(W){v(W instanceof Error?W:new Error("Failed to fetch files"))}finally{y(!1)}};return M.useEffect(()=>{!r&&!w&&N(),r&&!w&&O(r)},[r,o]),{data:p,isLoading:w,error:C,estimatedTotalHits:b,refetch:N}},Xi=t=>{var r,o,a;const e=((a=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:a.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(e||"")},d3={auth:{clientId:"584d5fa9-5123-4602-a1a5-a3746a83745f",authority:"https://login.microsoftonline.com/consumers",redirectUri:"https://s3-explorer.cmcts1.studio.ai.vn/sharepoint/redirect"}},u3=new Ip(d3),Um={[jr.VIEW_DOCUMENT]:1,[jr.DOWNLOAD_DOCUMENT]:2,[jr.EDIT_DOCUMENT]:10,[jr.OWNER_DOCUMENT]:100},YE=()=>{const t=Mo();return`${t==null?void 0:t.groupname}`.toUpperCase()==="MASTER_ADMIN"},JE=()=>{const t=Mo();return`${t==null?void 0:t.groupname}`.toUpperCase()==="MASTER_ADMIN"||`${t==null?void 0:t.role}`.toUpperCase()==="ADMIN"||`${t==null?void 0:t.role}`.toUpperCase()==="SITE_ADMIN"},Bu=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=10:!1},f3=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=2:!1},h3=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=1:!1},p3=M.memo(({homeLabel:t="Kho tài liệu",apiBaseUrl:e="http://localhost:3000",rootPrefix:n="",rootUrlHostApi:r="http://localhost:3003/api/v1/",asSelector:o=!1,onSelected:a=h=>console.log("Đã chọn:",h),displayPrefixes:s,preSelectedFiles:l,idCreator:u})=>{var pf;const[h,p]=M.useState([]),[g,w]=M.useState(""),[y,C]=M.useState(new Set(l)),[v,b]=M.useState(n),[k,A]=M.useState(""),[N,O]=M.useState(!1),[T,L]=M.useState(""),[H,W]=M.useState(!1),[ee,q]=M.useState(null),[de,ce]=M.useState(null),[ve,K]=M.useState(!1),[Z,G]=M.useState(!1),[,re]=M.useState(null),J=M.useRef(null),{toast:X}=bc(),[U,te]=M.useState(null),[be,Ee]=M.useState(null),[Ce,Ne]=M.useState(null),[Te,z]=M.useState(""),[ue,Ae]=M.useState(!1),[xe,Pe]=M.useState(!1),[ae,Ze]=M.useState(new Set),[nt,Tt]=M.useState(""),[ln,Ot]=M.useState(!1),[mn,en]=M.useState(!1),[R,Y]=M.useState("rename"),[se,Ie]=M.useState(!1),[Q,ne]=M.useState(""),[ke,$e]=M.useState("1"),[Be,Mt]=M.useState(!1),[tn,zt]=M.useState(!1),[yo,Gt]=M.useState(!1),[vn,Jr]=M.useState(!1),[Vt,pr]=M.useState(1),[Qr,ea]=M.useState(!1),{currentJob:Xe,elapsedTime:$o,setCurrentJob:Uc}=s3(e),[wo,ta]=M.useState(null),[na,ls]=M.useState(""),[Gu,ra]=M.useState(!1),[ds,ju]=M.useState(""),[$c,Wu]=M.useState(!1),[Hc,qu]=M.useState(!1),[us,Yu]=M.useState([]),[oa,Ju]=M.useState(!1),[fs,Wm]=M.useState(""),Ho=M.useRef({}),[Bc,zc]=M.useState(null),[ia,hs]=M.useState(null),qm=async S=>{qu(!0);try{const P=await Le.get(`${r}get-knowledge-base/knowledge-base-name/${S}`,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAyOTliMmIwLTk4MGEtNGQ1Yy04NjkyLWJjNjllM2I1NzZlMiIsInVzZXJuYW1lIjoiY21jX3RzX2FkbWluIiwiaWF0IjoxNzQ3MTk0MTg3fQ.7LB2rgd0fQnhZP_cFgTTCPMSYl0_apwffcNEd7oqjeM"}});P.status===200&&Yu(P.data.knowledgeBase.chatflows.map(B=>({...B,KnowledgeBaseId:P.data.knowledgeBase.knowledge_base_id})))}catch{}finally{qu(!1)}};M.useEffect(()=>{ds&&r&&qm(ds)},[ds]),M.useEffect(()=>{console.log("pre selected files",l)},[l]);const[Dt,Vc]=M.useState(null),[Kc,Ym]=M.useState(!1),[Gc,jc]=M.useState(!1),[Qu,ps]=M.useState(!1),[Wc,qc]=M.useState([]),[Yc,Xu]=M.useState([]),[gs,Jc]=M.useState([{id:"root",name:"OneDrive"}]),[Jm,aa]=M.useState(!1),[sa,Qc]=M.useState([]),[Xc,xi]=M.useState(!1),[Zc,_i]=M.useState([]),[el,Qm]=M.useState([]),[ms,tl]=M.useState([]),[vs,ys]=M.useState([{id:"root",name:"SharePoint"}]),[Bo,zo]=M.useState(!1),[ws,Si]=M.useState([]),[gt,ca]=M.useState(null),[Xm,bs]=M.useState(!1),[Zu,la]=M.useState(!1),[Sr,nl]=M.useState(!1),ef=new URL(window.location.href).searchParams.get("prefix")||""||k||n,[b0,Zm]=M.useState(null),{data:gr,isLoading:Cs,error:rl,estimatedTotalHits:da,refetch:dn}=l3(e,ef,s,g,Vt,w,u,y,Ho,C),[ol,bo]=M.useState(!1),il=M.useRef(null),mt=Mo(),ze=(()=>{const S=localStorage.getItem("dataLogin");try{if(S){const P=JSON.parse(S);return(P==null?void 0:P.user)??null}}catch{return null}return null})();M.useEffect(()=>{if(!ol)return;function S(P){il.current&&!il.current.contains(P.target)&&bo(!1)}return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[ol]);const ev=async()=>{try{const S=await Le.get(`${e}/api/login-sharepoint`),{loginUrl:P}=S.data,B=window.open(P,"SharePoint Login","width=600,height=600");if(!B)throw new Error("Không thể mở cửa sổ pop-up");B.focus();const fe=setInterval(()=>{try{if(B.closed){clearInterval(fe);return}const ye=B.location.href;if(ye.includes("code=")){const Se=new URL(ye).searchParams.get("code");Se&&(tf(Se),B.close(),clearInterval(fe))}}catch(ye){ye instanceof Error&&!ye.message.includes("cross-origin")&&console.error("SharePoint login error:",ye)}},1e3)}catch(S){lt.error("Lỗi khi đăng nhập SharePoint: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},tv=async()=>{try{_i([]),ys([{id:"root",name:"SharePoint"}]),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin),X({title:"Success",description:"Logged out from SharePoint"})}catch(S){console.error("Error logging out from SharePoint:",S),X({title:"Error",description:"Failed to logout from SharePoint",variant:"destructive"})}},tf=async S=>{try{const P=await Le.post(`${e}/api/get-sharepoint-access-token`,{code:S,userId:"1"}),{accessToken:B,refreshToken:fe}=P.data;localStorage.setItem("sharepoint_access_token",B),localStorage.setItem("refresh_sharepoint_access_token",fe),jc(!0),zo(!0)}catch(P){console.error("❌ Error fetching SharePoint access token:",P),X({title:"Error",description:"Failed to connect to SharePoint",variant:"destructive"})}},nv=async()=>{try{xi(!0);const P=(await Le.post(`${e}/api/list-site-sharepoint`,{userId:"1"})).data.sites.map(B=>{const fe=new URL(B.webUrl);return{id:B.id,name:B.name,description:B.description,hostname:B.hostname||fe.hostname,sitePath:B.sitePath||fe.pathname.replace(/^\/+/,"")}});console.log("data",P),Si(P),xi(!1)}catch(S){console.error("❌ Error fetching SharePoint sites:",S),X({title:"Error",description:"Failed to fetch SharePoint sites",variant:"destructive"}),xi(!1)}},rv=async S=>{ca(S),console.log(S),await xs("root",S.name,S.hostname||"",S.sitePath||"")},xs=async(S,P,B,fe)=>{try{xi(!0);const Se=(await Le.post(`${e}/api/list-file-sharepoint`,{folderId:S,userId:"1",hostname:B,sitePath:fe})).data.files.map(De=>({id:De.id,name:De.name,size:De.size??0,lastModified:De.lastModifiedDateTime?new Date(De.lastModifiedDateTime):new Date,contentType:De.mimeType??void 0,isFolder:De.type==="folder",parentId:De.parentId??""}));Qm(Se.filter(De=>De.isFolder)),_i(Se.filter(De=>!De.isFolder)),zo(!0),ys(De=>De.some(Ct=>Ct.id===S)?De:[...De,{id:S,name:P==="root"?"SharePoint":P}]),xi(!1)}catch(ye){console.error("❌ Error fetching SharePoint files:",ye),X({title:"Error",description:"Failed to fetch SharePoint files",variant:"destructive"}),xi(!1)}},nf=S=>{tl(P=>P.some(fe=>fe.id===S.id)?P.filter(fe=>fe.id!==S.id):[...P,{id:S.id,name:S.name,size:S.size,lastModified:S.lastModified,contentType:S.contentType,isFolder:S.isFolder,parentId:S.parentId}])},ov=S=>{var B;ys(fe=>fe.slice(0,S+1));const P=(B=vs[S])==null?void 0:B.id;P&&xs(P,"SharePoint",(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},nn=async(S,P)=>{const B=localStorage.getItem("sharepoint_access_token");if(!B){lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const fe=lt.loading("Đang đồng bộ SharePoint...",{position:"bottom-right",autoClose:!1});try{const ye={prefix:P,folders:[],files:[],hostname:(gt==null?void 0:gt.hostname)||"",sitePath:(gt==null?void 0:gt.sitePath)||"",isAutoUpdateKB:Sr,refreshAccessToken:localStorage.getItem("refresh_sharepoint_access_token")||""};S.forEach(De=>{De.isFolder?ye.folders.push({id:De.id,name:De.name}):ye.files.push({id:De.id,name:De.name})});const Se=await Le.post(`${e}/api/sync-sharepoint-to-s3`,ye,{headers:{Authorization:`Bearer ${B}`}});dn(),lt.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Se.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),zo(!1)}catch(ye){console.error("Lỗi khi đồng bộ file từ SharePoint:",ye),lt.update(fe,{render:"Không thể đồng bộ file từ SharePoint.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},_s=()=>{zo(!1),_i([]),tl([]),ys([{id:"root",name:"SharePoint"}])};M.useEffect(()=>{if(Bo){const P=new URLSearchParams(window.location.search).get("code");P&&(tf(P),window.history.replaceState({},document.title,window.location.pathname))}},[Bo]),M.useEffect(()=>{u3.initialize().then(()=>{Ym(!0)}).catch(S=>console.error("❌ Lỗi khởi tạo MSAL:",S))},[]),M.useEffect(()=>{Vo()},[]);async function Vo(){localStorage.getItem("onedrive_access_token")&&jc(!0)}const al=S=>{Qc(P=>P.some(fe=>fe.id===S.id)?P.filter(fe=>fe.id!==S.id):[...P,{id:S.id,name:S.name,size:S.size,lastModified:S.lastModified,contentType:S.contentType,isFolder:S.isFolder,parentId:S.parentId}])};function ua(S){if(S===0)return"0 B";const P=1024,B=["B","KB","MB","GB","TB"],fe=Math.floor(Math.log(S)/Math.log(P));return parseFloat((S/Math.pow(P,fe)).toFixed(1))+" "+B[fe]}function Jn(S){const P=new Date(S);return P.toLocaleDateString()+" "+P.toLocaleTimeString()}const rf=async()=>{try{const S=await Le.get(`${e}/api/login-one-drive`),{loginUrl:P}=S.data,B=window.open(P,"OneDrive Login","width=600,height=600");if(!B)throw new Error("Không thể mở cửa sổ pop-up");B.focus();const fe=setInterval(()=>{try{if(B.closed){clearInterval(fe);return}const ye=B.location.href;if(ye.includes("code=")){const Se=new URL(ye).searchParams.get("code");Se&&(af(Se),B.close(),clearInterval(fe))}}catch(ye){ye instanceof Error&&!ye.message.includes("cross-origin")&&console.error("OneDrive login error:",ye)}},1e3)}catch(S){lt.error("Lỗi khi đăng nhập OneDrive: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},of=async()=>{try{await Le.post(`${e}/api/logout-one-drive`),localStorage.removeItem("onedrive_access_token"),localStorage.removeItem("onedrive_refresh_access_token"),lt.success("Đã đăng xuất khỏi OneDrive"),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin)}catch(S){lt.error("Lỗi khi đăng xuất OneDrive: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},af=async S=>{try{const P=ze==null?void 0:ze.id,B=await Le.post(`${e}/api/get-one-drive-access-token`,{authorizationCode:S,userId:P}),{accessToken:fe,refreshToken:ye}=B.data;localStorage.setItem("onedrive_access_token",fe),localStorage.setItem("onedrive_refresh_access_token",ye),jc(!0),ps(!0),await fa("root","One Drive")}catch(P){console.error("❌ Lỗi khi lấy Access Token:",P)}},fa=async(S,P)=>{try{aa(!0);const B=ze==null?void 0:ze.id,ye=(await Le.post(`${e}/api/list-file-one-drive`,{folderId:S,userId:B})).data.map(Se=>({id:Se.id,name:Se.name,size:Se.size??0,lastModified:Se.lastModifiedDateTime?new Date(Se.lastModifiedDateTime):new Date,contentType:Se.mimeType??void 0,isFolder:Se.type==="folder",parentId:Se.parentId??""}));qc(ye.filter(Se=>Se.isFolder)),Xu(ye.filter(Se=>!Se.isFolder)),ps(!0),Jc(Se=>Se.some(De=>De.id===S)?Se:[...Se,{id:S,name:P==="root"?"OneDrive":P}]),aa(!1)}catch(B){console.error("Lỗi lấy danh sách file:",B),aa(!1)}},sf=S=>{if(S===gs.length-1)return;const P=gs[S];P&&(Jc(gs.slice(0,S+1)),fa(P.id,P.name))},cf=async(S,P)=>{const B=localStorage.getItem("onedrive_access_token"),fe=localStorage.getItem("onedrive_refresh_access_token");if(!B){lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const ye=lt.loading("Đang đồng bộ OneDrive...",{position:"bottom-right",autoClose:!1});try{const Se={prefix:P,folders:[],files:[],isAutoUpdateKB:Sr,refreshAccessToken:fe};S.forEach(Ct=>{Ct.isFolder?Se.folders.push({id:Ct.id,name:Ct.name}):Se.files.push({id:Ct.id,name:Ct.name})});const De=await Le.post(`${e}/api/sync-one-drive-to-s3`,Se,{headers:{Authorization:`Bearer ${B}`}});dn(),lt.update(ye,{render:`Đồng bộ thành công! Đã tải lên ${De.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(Se){console.error("Lỗi khi đồng bộ file từ OneDrive:",Se),lt.update(ye,{render:"Không thể đồng bộ file từ OneDrive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Sn=()=>{ps(!1),Jc([{id:"root",name:"OneDrive"}]),qc([]),Xu([]),Qc([]),aa(!1)},iv=X1({onSuccess:S=>{Zm(S.access_token),localStorage.setItem("google_access_token",S.access_token),Qn(S.access_token)},onError:()=>{console.log("Đăng nhập thất bại!")},scope:a3}),Qn=S=>{const P=document.createElement("script");P.src="https://apis.google.com/js/api.js",P.onload=()=>{window.gapi.load("picker",()=>av(S))},document.body.appendChild(P)},av=S=>{const P=new window.google.picker.DocsView(window.google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!0).setOwnedByMe(!1),B=new window.google.picker.DocsView(window.google.picker.ViewId.DRIVE).setIncludeFolders(!0).setSelectFolderEnabled(!0);new window.google.picker.PickerBuilder().setDeveloperKey(o3).setOAuthToken(S).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).setLocale("vi").addView(P).addView(B).setCallback(async ye=>{if(ye.action===window.google.picker.Action.PICKED){const Se=ye.docs.map(De=>({id:De.id,name:De.name,mimeType:De.mimeType}));await lf(Se,v)}}).build().setVisible(!0)},lf=async(S,P="")=>{const B=localStorage.getItem("google_access_token");if(!B){console.error("❌ Không tìm thấy access token. Vui lòng đăng nhập lại."),lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.",{position:"bottom-right"});return}const fe=lt.loading("Đang đồng bộ...",{position:"bottom-right",autoClose:!1});try{const ye={prefix:P,folders:[],files:[]};S.forEach(De=>{De.mimeType==="application/vnd.google-apps.folder"?ye.folders.push({id:De.id,name:De.name}):ye.files.push({id:De.id,name:De.name})});const Se=await Le.post(`${e}/api/sync-drive-to-s3`,ye,{headers:{Authorization:`Bearer ${B}`}});fr.current=!0,dn(),lt.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Se.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(ye){console.error("❌ Lỗi khi đồng bộ file từ Google Drive:",ye),lt.update(fe,{render:"Không thể đồng bộ file từ Google Drive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}};M.useEffect(()=>{const S=P=>{if(P.data.action==="logout"){const B=document.createElement("iframe");B.style.display="none",B.src="https://accounts.google.com/Logout",document.body.appendChild(B),setTimeout(()=>document.body.removeChild(B),2e3)}};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[]),M.useEffect(()=>{const S=new Set(l);C(S)},[]),M.useEffect(()=>{Xe!=null&&Xe.status&&(Xe.status.status==="completed"?(X({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Xe.url} với ${Xe.status.completed} trang`}),fr.current=!0,dn()):Xe.status.status==="failed"&&X({title:"Thu thập website thất bại",description:`Không thể thu thập ${Xe.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(pf=Xe==null?void 0:Xe.status)==null?void 0:pf.status]);const Xr=M.useMemo(()=>gr[v]||[],[gr,v]),mr=M.useMemo(()=>Xr.filter(S=>h3(S.permission)),[Xr,v,gr]),Ko=M.useMemo(()=>{const S={};return mr.forEach((P,B)=>{y.has(P.key)&&(S[B]=!0)}),S},[y,mr]),Lt=S=>{const P=Hu(gr,S);if(P.length===0)return y.has(S)?"all":"none";const B=P.filter(fe=>y.has(fe)).length;return B===0?"none":B===P.length?"all":"partial"},Tn=(S,P=!0)=>{if(v!==S){if(u&&!v)ea(!0),A(S+u),b(S+u);else if(ea(!0),A(S),b(S),P&&!o){const B=window.location.pathname==="/"?"":window.location.pathname,fe=S?`${window.location.origin}${B}?prefix=${encodeURIComponent(S)}`:`${window.location.origin}${B}`;window.history.pushState({path:fe},"",fe)}}},sl=S=>{const P=S.lastIndexOf("/"),B=P>0?S.substring(0,P+1):"";B?(Tn(B),setTimeout(()=>{C(new Set([S]))},500)):C(new Set([S]))};M.useEffect(()=>{Qr&&(fr.current=!0,dn().finally(()=>ea(!1)))},[Qr]);const sv=async(S,P)=>{var B,fe;W(!0);try{if(mr.some(Ct=>Ct.isFolder&&Ct.name.toLowerCase()===S.toLowerCase())){X({title:"Lỗi",description:`Thư mục "${S}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),W(!1);return}const Se=`${P}${S}/`;if((await Le.post(`${e}/api/create-folder`,{prefix:Se,userId:(mt==null?void 0:mt.id)||""})).status!==200){X({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}fr.current=!0,await dn(),X({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${S}"`}),L(""),O(!1)}catch(ye){console.error("Error creating folder:",ye);const Se=((fe=(B=ye==null?void 0:ye.response)==null?void 0:B.data)==null?void 0:fe.error)||"Không thể tạo thư mục";X({title:"Lỗi",description:Se,variant:"destructive"})}finally{W(!1)}},ha=async(S,P,B)=>{var fe,ye,Se,De,Ct,Tr,Zn,ma,gf;re(B),Gt(!0);try{if(Array.from(S).reduce((yn,ya)=>yn+ya.size,0)>=100*1024*1024){X({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),re(null),Gt(!1);return}const Is=Array.from(S).filter(yn=>yn.size===0);if(Is.length>0){const yn=Is.map(ya=>ya.name).join(", ");X({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${yn}`,variant:"destructive"}),Gt(!1),re(null);return}const er=new FormData;if(ze!=null&&ze.id&&er.append("metadata",JSON.stringify({creator:ze.username,creatorId:ze.id,DataSource:"Tệp tải lên"})),B==="folder"&&S[0]){const yn=S[0].webkitRelativePath.split("/")[0];yn&&er.append("folderName",yn)}er.append("prefix",P),Array.from(S).forEach(yn=>B==="folder"?er.append("files",yn,yn.webkitRelativePath):er.append("files",yn)),fr.current=!0;const vt=await Le.post(`${e}/api/check-files-existed`,er,{headers:{"Content-Type":"multipart/form-data"}});if(((fe=vt==null?void 0:vt.data)==null?void 0:fe.status)===200)await Le.post(`${e}/api/upload`,er,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),A(P),setTimeout(async()=>{re(null),await dn(),Gt(!1),await Zr("upload")},500);else{if(((Se=(ye=vt==null?void 0:vt.data)==null?void 0:ye.names)==null?void 0:Se.length)>0&&!((De=vt==null?void 0:vt.data)!=null&&De.isFolder)){const yn=Array.from(S).filter(ya=>vt.data.names.includes(ya.name));ta(yn),ra(!0)}(Ct=vt==null?void 0:vt.data)!=null&&Ct.isFolder&&((Tr=vt==null?void 0:vt.data)!=null&&Tr.name)&&(ls((Zn=vt==null?void 0:vt.data)==null?void 0:Zn.name),ta(S),ra(!0))}}catch(va){console.error("Lỗi tải lên:",va);const Is=((gf=(ma=va==null?void 0:va.response)==null?void 0:ma.data)==null?void 0:gf.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:Is,variant:"destructive"}),re(null),Gt(!1)}},cv=async()=>{var S,P;try{Gt(!0);const B=new FormData;if(wo){re(na?"folder":"files"),ra(!1);let fe=localStorage.getItem("dataLogin"),ye;try{fe&&(fe=JSON.parse(fe),ye=fe.user)}catch{fe=null}if(na&&wo[0]){const Se=wo[0].webkitRelativePath.split("/")[0];Se&&B.append("folderName",Se)}B.append("prefix",v),Array.from(wo).forEach(Se=>na&&wo[0]?B.append("files",Se,Se.webkitRelativePath):B.append("files",Se)),ye!=null&&ye.id&&B.append("metadata",JSON.stringify({creator:ye.username,creatorId:ye.id,DataSource:"Tệp tải lên"})),await Le.post(`${e}/api/upload`,B,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),A(v),fr.current=!0}}catch(B){console.error("Lỗi tải lên:",B);const fe=((P=(S=B==null?void 0:B.response)==null?void 0:S.data)==null?void 0:P.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:fe,variant:"destructive"})}finally{setTimeout(async()=>{re(null),await dn(),Gt(!1),ls(""),ta(null),await Zr("overwrite")},500)}},df=async S=>{var P;try{if(await Le.delete(`${e}/api/files`,{data:{paths:[S.key]}}),y.has(S.key)){const fe=new Set(y);fe.delete(S.key),C(fe)}const B=((P=S.key)==null?void 0:P.replace(/^(.*?)(\/.*)?$/,(fe,ye,Se)=>!Se||Se==="/"?"":ye+"/"))||"";A(B),fr.current=!0,X({title:"Đã xóa tập tin",description:`Đã xóa thành công "${S.name}"`}),q(null),await Zr("delete")}catch(B){console.error("Error deleting file:",B),X({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{Jr(!1),await dn()}},Ss=S=>{const P=new Set(y),B=typeof S=="function"?S(Ko):S;new Set(Object.keys(Ko).map(Number)).forEach(ye=>{const Se=mr[ye];Se&&(B[ye]||(P.delete(Se.key),Se.isFolder&&Hu(gr,Se.key).forEach(De=>P.delete(De))))}),Object.entries(B).forEach(([ye,Se])=>{const De=parseInt(ye),Ct=mr[De];Ct&&Se&&(P.add(Ct.key),Ct.isFolder&&Hu(gr,Ct.key).forEach(Tr=>P.add(Tr)))}),C(P)},uf=async()=>{var S;K(!0);try{const P=Array.from(y),B=P.map(ye=>Object.values(gr).flat().find(Se=>Se.key===ye)).filter(ye=>ye!==void 0);if(B.length===0){X({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await Le.delete(`${e}/api/files`,{data:{paths:P}});const fe=((S=B[0])==null?void 0:S.key.replace(/^(.*?)(\/.*)?$/,(ye,Se,De)=>!De||De==="/"?"":Se+"/"))||"";A(fe),fr.current=!0,dn(),X({title:"Đã xóa tập tin",description:`Đã xóa thành công ${B.length} mục`}),G(!1),C(new Set),await Zr("bulk-delete")}catch(P){console.error("Error deleting files:",P),X({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{K(!1)}},Ts=async(S,P)=>{if(!v.trim()){X({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}Pe(!0);try{const B=S.key;let fe;S.isFolder?fe=B.split("/").slice(0,-2).join("/")+"/":fe=B.substring(0,B.lastIndexOf("/")+1);const ye=fe+P+(S.isFolder?"/":"");await Le.post(`${e}/api/rename`,{oldPath:B,newPath:ye}),fr.current=!0,await dn(),X({title:"Đã đổi tên",description:`Đã đổi tên thành công "${S.name}" thành "${P}"`}),te(null),z(""),Ne(null),await Zr("rename")}catch(B){console.error("Error renaming item:",B),X({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Pe(!1)}},Ti=async S=>{Ze(P=>new Set([...P,...S]));try{const P=await Le.post(`${e}/api/download`,{paths:S},{responseType:"blob"}),B=window.URL.createObjectURL(P.data),fe=document.createElement("a");fe.href=B;const ye=P.headers["Content-Disposition"]||P.headers["content-disposition"],Se=ye==null?void 0:ye.match(/filename="(.+)"/),De=Se?decodeURIComponent(Se[1]):"download.zip";fe.setAttribute("download",De),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),window.URL.revokeObjectURL(B),X({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${S.length} mục${S.length>1,""}`})}catch(P){console.error("Error downloading files:",P),X({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ze(P=>{const B=new Set(P);return S.forEach(fe=>B.delete(fe)),B})}},cl=async(S,P)=>{var B;try{const fe=await Le.post(`${e}/document-permission/public`,{path:S,isPublic:P,grandtedBy:mt==null?void 0:mt.id});X({title:"Chỉnh sửa quyền riêng tư thành công",description:`Trạng thái ${S} đã được chuyển thành ${(B=fe.data)!=null&&B.isPublic?"công khai":"riêng tư"}.`}),await dn()}catch(fe){console.log("error",fe)}finally{}},ll=v?v.replace(n,"").split("/").filter(Boolean):[],ff=()=>{let S=Array.from(y).map(B=>({key:B}));S.length>1&&(S=S.filter(B=>B.key!==n));const P=B=>Ud.findIndex(S,fe=>!fe.key.endsWith("/")&&fe.key.startsWith(B))!==-1;return S=S.filter(B=>B.key.endsWith("/")?!P(B.key):!0),S},Es=M.useMemo(()=>{const S=[...(ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/")?[]:[{id:"select",header:()=>{const P=c3(gr,v),B=P.length>0&&P.every(ye=>y.has(ye)),fe=P.some(ye=>y.has(ye));return d.jsx(pc,{checked:B?!0:fe?"indeterminate":!1,onCheckedChange:ye=>{if(ye){const Se=mr.reduce((De,Ct,Tr)=>(De[Tr]=!0,De),{});Ss(Se)}else{for(const Se of Array.from(y))Se.startsWith(v)&&(y.delete(Se),Ho.current[Se]=!1);Ud.forEach(Ho.current,(Se,De)=>{De.startsWith(v)&&(Ho.current[De]=!1)}),Ss({})}},"aria-label":"Chọn tất cả"})},cell:({row:P})=>{const B=P.original;let ye=B.isFolder?Lt(B.key):y.has(B.key)?"all":"none";if(ye==="none"&&B.key.endsWith("/")){for(const Se of Array.from(y))if(Se.startsWith(B.key)){ye="all";break}}return d.jsx("div",{className:"flex items-center",children:d.jsx(pc,{checked:ye==="partial"?"indeterminate":ye==="all",onCheckedChange:Se=>{var Ct,Tr;const De={...Ko};if(Se?De[P.index]=!0:delete De[P.index],Ho.current[((Ct=P.original)==null?void 0:Ct.key)||"_"]=!!Se,(Tr=P.original)!=null&&Tr.key.endsWith("/"))for(const Zn of Array.from(y))Zn.startsWith(P.original.key)&&(Ho.current[P.original.key]=!1,y.delete(Zn));Ss(De)},"aria-label":"Chọn dòng"})})},enableSorting:!1}],{id:"fileName",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),children:["Tên tập tin",d.jsx(cg,{})]}),accessorKey:"name",cell:({row:P})=>{const B=P.original,fe=B.key.substring(0,B.key.lastIndexOf("/"))||"/",ye=g.trim()!==""&&fe!==v,Se=fe.split("/").filter(Boolean);return d.jsxs("div",{className:"flex flex-col group",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsxs("div",{className:`flex items-center gap-2 ${B.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{B.isFolder&&Tn(B.key)},children:[B.isFolder?d.jsx(nc,{className:"h-5 w-5 text-blue-500"}):null,B.name]}),d.jsx("button",{className:"ml-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:De=>{De.stopPropagation(),navigator.clipboard.writeText(B.key),X({title:"Copied to clipboard",description:`Path: ${B.key}`,duration:2e3})},title:"Copy path to clipboard",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),ye&&d.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[d.jsx(nc,{className:"h-4 w-4 text-gray-500 my-auto"}),d.jsxs("span",{className:"flex items-center ml-1",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Tn("")},children:"/"}),Se.map((De,Ct)=>d.jsxs("span",{className:"flex items-center",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Tn(Se.slice(0,Ct+1).join("/")+"/")},children:De}),Ct<Se.length-1&&d.jsx("span",{children:"/"})]},Ct))]})]})]})}}];return o?S.push({id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:P})=>d.jsxs("div",{className:"flex items-center gap-2",children:[YE()&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>zc(P.original),className:"h-8 w-8 p-0",children:d.jsx(eC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Chia sẻ"})]})}),JE()&&Bu(P.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx(jE,{enabled:!!P.original.isPublic,onChange:()=>cl(P.original.key,!P.original.isPublic)}),d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full ${P.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"} px-3 py-1 text-sm font-medium cursor-pointer`,onClick:()=>hs(P.original),children:P.original.isPublic?"Công khai":"Riêng tư"}),d.jsx(WE,{file:ia,open:!!ia,onClose:()=>hs(null),isPublic:!!P.original.isPublic,onSave:B=>cl(P.original.key,B)})]})]})}):S.push({id:"size",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),children:["Kích thước",d.jsx(cg,{})]}),accessorKey:"size",cell:({getValue:P,row:B})=>{const fe=P();return d.jsx("span",{children:B.original.isFolder?"-":ua(fe)})}},{id:"lastModified",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",d.jsx(cg,{})]}),accessorKey:"lastModified",cell:({row:P})=>{const B=P.original.lastModified;return d.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:d.jsx("span",{children:B&&px(B).isValid()?px(B).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:P})=>d.jsxs("div",{className:"flex items-center gap-2",children:[v===""&&r&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{ju(P.original.key),Wu(!0)},className:"h-8 w-8 p-0",children:ae.has(P.original.key)?d.jsx(St,{className:"h-4 w-4 animate-spin"}):d.jsx(sO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Những Flow sử dụng Folder này làm Data"})]})}),d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:!P.original.isFolder&&d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>Ti([P.original.key]),className:"h-8 w-8 p-0",disabled:!f3(P.original.permission)||ae.has(P.original.key),children:ae.has(P.original.key)?d.jsx(St,{className:"h-4 w-4 animate-spin"}):d.jsx(rO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Tải xuống"})]})}),v.trim()!==""&&(Bu(P.original.permission)?d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{te(P.original),z(P.original.name)},className:"h-8 w-8 p-0",children:d.jsx(pO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Đổi tên"})]})}):d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{console.log("call"),Ee(P.original)},className:"h-8 w-8 p-0",disabled:P.original.isFolder,children:d.jsx(yx,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Xem"})]})})),d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{Ae(!0),ce(P.original)},className:"h-8 w-8 p-0",children:d.jsx(WM,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Di chuyển"})]})}),!((ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/"))&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>q(P.original),className:"h-8 w-8 p-0",children:d.jsx(tC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Xóa"})]})}),YE()&&(v===""||v==="/")&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>zc(P.original),className:"h-8 w-8 p-0",children:d.jsx(eC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Chia sẻ"})]})}),v!==""&&v!=="/"&&JE()&&Bu(P.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full ${P.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"} px-3 py-1 text-sm font-medium cursor-pointer`,onClick:()=>{console.log("calll"),console.log(P.original),hs(P.original)},children:P.original.isPublic?"Công khai":"Riêng tư"}),d.jsx(WE,{file:ia,open:!!ia,onClose:()=>hs(null),isPublic:!!P.original.isPublic,onSave:B=>cl(P.original.key,B)})]})]})}),S},[y,mr,Ko,ae,o,ia]),pa=fx({data:mr,columns:Es,state:{rowSelection:Ko,sorting:h},onSortingChange:p,enableRowSelection:!0,onRowSelectionChange:Ss,getCoreRowModel:ux(),getSortedRowModel:OM()}),dl=async S=>{var P,B;Ot(!0);try{if(Xi(S)){const fe=await Le.get(`${e}/api/read-text`,{params:{path:S.key}});Tt(fe.data.content)}try{const fe=await Le.get(`${e}/api/read-json`,{params:{path:S.key+".metadata.json"}}),ye=((B=(P=fe==null?void 0:fe.data)==null?void 0:P.content)==null?void 0:B.metadataAttributes)||null;return Ne({fullPath:U==null?void 0:U.key,...ye})}catch{return Ne("Lỗi phân tích siêu dữ liệu")}}catch(fe){console.error("Error loading file content:",fe),X({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Ot(!1)}},lv=async(S,P)=>{en(!0);try{await Le.post(`${e}/api/modify-text`,{path:S.key,content:P}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await dn(),te(null),Tt(""),Y("rename"),await Zr("edit-content")}catch(B){console.error("Error saving file content:",B),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}},ul=async S=>{en(!0);try{await Le.post(`${e}/api/modify-json`,{path:S.key+".metadata.json",content:{metadataAttributes:Ce}}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await dn(),te(null),Tt(""),Y("rename")}catch(P){console.error("Error saving file content:",P),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}};M.useEffect(()=>{U&&(U.isFolder||dl(U),Y("rename"))},[U]),M.useEffect(()=>{be&&!be.isFolder&&dl(be)},[be]);const As=async(S,P)=>{var B;if(Xe){X({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Mt(!0);try{if((await Le.get(S)).status!==200){X({title:"Lỗi",description:"Không thể lấy dữ liệu. Vui lòng kiểm tra lại đường dẫn.",variant:"destructive"}),Mt(!1);return}}catch{X({title:"Lỗi",description:"Đường dẫn không hợp lệ. Vui lòng kiểm tra lại.",variant:"destructive"}),Mt(!1);return}try{const{data:fe}=await Le.post(`${e}/api/crawl`,{url:S,limit:P,prefix:v,isAutoUpdateKB:Sr});if(fe.id){Uc({id:fe.id,url:S,limit:P,prefix:v,taskId:((B=fe.task)==null?void 0:B.id)||""});const ye=localStorage.getItem(qE),Se=ye?JSON.parse(ye):[];Se.some(De=>De.id===fe.id)||(Se.unshift({url:S,id:fe.id,limit:P,prefix:v,timestamp:Date.now()}),Se.length>20&&(Se.length=20),localStorage.setItem(qE,JSON.stringify(Se))),X({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${S} với giới hạn ${P}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),Ie(!1),ne(""),$e("1")}}catch(fe){console.error("Error crawling website:",fe),X({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Mt(!1)}},dv=async()=>{try{if(!(Xe!=null&&Xe.id))return;Uc(null),localStorage.removeItem(as),X({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Xe.url}`})}catch(S){console.error("Error stopping job:",S),X({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};M.useEffect(()=>{if(o)return;const S=(P=!0)=>{const fe=new URL(window.location.href).searchParams.get("prefix")||"";fe?Tn(fe,!1):(P&&!l&&C(new Set),A(n),b(n),fr.current=!0,setTimeout(()=>{dn()},0))};return S(!1),window.addEventListener("popstate",()=>S(!0)),()=>{window.removeEventListener("popstate",()=>S(!0))}},[]);const fl=async()=>{Ju(!0);try{await Le.post(`${e}/api/prediction-report`),X({title:"Xuất báo cáo thành công",description:"Báo cáo dự đoán đã được xuất"})}catch(S){console.error("Error exporting report:",S),X({title:"Lỗi",description:"Không thể xuất báo cáo dự đoán",variant:"destructive"})}finally{Ju(!1)}},Fn=async()=>{try{const S=Mo();S&&(await Le.post(`${e}/api/start-ingestion-job`,{prefix:v,user_id:S.id,userName:S.username})).status===200&&await ga()}catch(S){zt(!1),console.log(S)}},Zr=async S=>{try{fs&&v.includes(fs)&&(console.log(`Auto syncing knowledge base after ${S} operation`),await ga())}catch(P){console.log(`Error auto syncing after ${S}:`,P)}},Xn=M.useRef(),ga=async()=>{try{zt(!0);const S=await Le.post(`${e}/api/get-ingestion-job-status`,{prefix:v}),{status:P}=S==null?void 0:S.data;P==="FAILED"||P==="COMPLETE"||P==="STOPPED"||P==="STOPPING"||!P?(zt(!1),Xn.current&&(clearInterval(Xn.current),Xn.current=null),Vc(S==null?void 0:S.data)):(Xn.current||(Xn.current=setInterval(()=>ga(),5e3)),Vc(S==null?void 0:S.data))}catch(S){console.log(S)}},hf=()=>{const S=Array.from(y);let P;return v?P=S.filter(B=>B.startsWith(v)&&B!==v).length:P=new Set(S.filter(B=>B.split("/").shift())).size,`Đang chọn: ${P}`};return M.useEffect(()=>{const S=v==null?void 0:v.split("/")[0];return S!==fs&&(zt(!1),Xn.current&&(clearInterval(Xn.current),Xn.current=null),Wm(S||""),Vc(null),S&&ga()),()=>{}},[fs,v]),M.useEffect(()=>{Bo&&ws.length===0&&(nv(),ca(null))},[Bo]),M.useEffect(()=>{if(l)for(const S of Array.from(l))Ho.current[S]=!0},[]),d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx(H_,{}),d.jsx(Kn,{open:Gu,onOpenChange:S=>{ra(S),S||(ls(""),ta(null),Gt(!1),re(null))},children:d.jsxs(Nn,{children:[d.jsxs(Pn,{children:[d.jsx(On,{children:"Cảnh báo trùng lặp"}),d.jsxs(Do,{children:[na&&d.jsxs(d.Fragment,{children:["Folder $",na," đã có."]}),wo&&wo.length>0&&d.jsxs(d.Fragment,{children:["Những tệp sau bị lặp:",d.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(wo).map((S,P)=>d.jsx("li",{children:S.name},P))})]})]})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:()=>{ra(!1),ls(""),ta(null),Gt(!1),re(null)},children:"Bỏ qua"}),d.jsx(Fe,{variant:"destructive",onClick:()=>cv(),children:"Ghi đè"})]})]})}),d.jsx(Bd,{className:"s3-explr-breadcrumb",children:d.jsxs(zd,{className:"s3-explr-breadcrumb-list",children:[d.jsx(fc,{className:"s3-explr-breadcrumb-item",children:d.jsx(hc,{onClick:()=>Tn(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:t})}),!u&&ll.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(Vd,{className:"s3-explr-breadcrumb-separator"},`sep-${P}`),d.jsx(fc,{className:"s3-explr-breadcrumb-item",children:d.jsx(hc,{onClick:()=>Tn(n+ll.slice(0,P+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:S})},`item-${S}`)]},P))]})}),d.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[d.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:d.jsx(L2,{ref:J,onChange:S=>w(S)})}),v&&v!=="/"&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>{Cs||tn||(zt(!0),Fn())},"aria-disabled":Cs||tn,className:"flex items-center gap-2 s3-explr-refresh-btn aria-disabled:opacity-50",children:[d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${Cs||tn?"animate-spin":""}`}),"Đồng bộ KB"]})}),Dt&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-2 p-3 max-w-md",children:[d.jsx("p",{className:"font-semibold text-lg border-b pb-1",children:"Thông tin đồng bộ"}),d.jsx("div",{className:"space-y-1",children:d.jsxs("p",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:"Trạng thái:"}),d.jsxs("span",{className:`flex items-center gap-1 font-semibold ${Dt.status==="COMPLETE"?"text-green-600":Dt.status==="FAILED"?"text-red-600":"text-yellow-600"}`,children:[Dt.status==="COMPLETE"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Dt.status==="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),Dt.status!=="COMPLETE"&&Dt.status!=="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),fD(Dt.status)]})]})}),Dt.statistics&&d.jsxs("div",{className:"space-y-1 border-t pt-2",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Thống kê xử lý:"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu quét:"}),d.jsx("span",{className:"font-medium",children:Dt.statistics.numberOfDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata quét:"}),d.jsx("span",{className:"font-medium",children:Dt.statistics.numberOfMetadataDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu mới:"}),d.jsx("span",{className:"font-medium text-green-600",children:Dt.statistics.numberOfNewDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Dt.statistics.numberOfModifiedDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Dt.statistics.numberOfMetadataDocumentsModified})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu xóa:"}),d.jsx("span",{className:"font-medium text-orange-600",children:Dt.statistics.numberOfDocumentsDeleted})]}),d.jsxs("div",{className:"flex justify-between col-span-2",children:[d.jsx("span",{children:"Tài liệu lỗi:"}),d.jsx("span",{className:"font-medium text-red-600",children:Dt.statistics.numberOfDocumentsFailed})]})]})]}),d.jsxs("div",{className:"space-y-1 border-t pt-2 text-sm text-gray-200",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Chi tiết Job:"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"DataSource ID:"})," ",Dt.dataSourceId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ingestion Job ID:"})," ",Dt.ingestionJobId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Knowledge Base ID:"})," ",Dt.knowledgeBaseId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Job trong queue:"})," ",Dt.is_still_in_stock?"Còn":"Không"]})]}),Dt.errorMessage&&d.jsxs("div",{className:"border-t pt-2",children:[d.jsx("p",{className:"text-red-600 font-medium",children:"Lỗi:"}),d.jsx("p",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:Dt.errorMessage})]}),Dt.failureReasons&&Dt.failureReasons.length>0&&d.jsx(b$,{failureReasons:Dt.failureReasons,onNavigateToFile:sl})]})})]})}),Bu(gr==null?void 0:gr.prefixPermission)&&d.jsxs("div",{className:"relative",ref:il,children:[d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>bo(S=>!S),"aria-disabled":(ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/"),children:[d.jsx(mO,{className:"w-4 h-4"}),"Add file"]}),ol&&d.jsxs("div",{className:"absolute z-50 mt-2 right-0 w-56 bg-white border rounded-lg shadow-lg py-2 flex flex-col",children:[d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1);const S=document.createElement("input");S.type="file",S.multiple=!0,S.onchange=P=>{const B=P.target.files;B&&ha(B,v,"files")},S.click()},children:[d.jsx(Np,{className:"h-4 w-4 mr-2"})," Tải tệp tin"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1);const S=document.createElement("input");S.type="file",S.multiple=!0,S.webkitdirectory=!0,S.onchange=P=>{const B=P.target.files;B&&ha(B,v,"folder")},S.click()},children:[d.jsx(nc,{className:"h-4 w-4 mr-2"})," Tải lên thư mục"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",disabled:!!s&&!v,onClick:()=>O(!0),children:[d.jsx(lO,{className:"h-4 w-4 mr-2 s3-explr-folder-plus-icon"}),"Thư mục mới"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),Ie(!0)},children:[d.jsx(fO,{className:"h-4 w-4 mr-2"})," Thêm Website"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),iv()},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]})," ","Đồng bộ Google Drive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),rf()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#094ab2",d:"M47.3 28.2C45.3 18.6 37.1 12 28 12c-8.5 0-15.9 5.6-18.4 13.5C4.2 27.2 0 32.2 0 38c0 6.6 5.4 12 12 12h36c8.3 0 16-6.6 16-15.5 0-6.8-4.9-12.4-11.7-13.3z"}),d.jsx("path",{fill:"#0067c5",d:"M44.9 30.1c-.2 0-.4-.1-.6-.1H26c-3.3 0-6 2.7-6 6 0 .9.2 1.8.6 2.6-1.7-.7-3.5-1.1-5.5-1.1C7.6 37.5 4 41.5 4 46s3.6 8.5 8.1 8.5h34.3c6.8 0 12.6-5.4 12.6-12s-5.5-11.6-11.1-12.4z"})]})," ","Đồng bộ OneDrive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),ev()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#036C70",d:"M19 14.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#17828F",d:"M16 17.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#4DB6AC",d:"M13 20.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#fff",d:"M4.5 15.5v-3c0-.28.22-.5.5-.5h3c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H5c-.28 0-.5-.22-.5-.5z"})]})," ","Đồng bộ SharePoint"]})]})]}),!o&&d.jsxs(d.Fragment,{children:[y.size>0&&d.jsx(d.Fragment,{children:d.jsxs(Kn,{open:Z,onOpenChange:G,children:[d.jsx(gc,{asChild:!0,children:d.jsxs(Fe,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[d.jsx(tC,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",y.size,")"]})}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),d.jsxs(Do,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",y.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>G(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:uf,disabled:ve,className:"s3-explr-confirm-delete-btn",children:ve?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})}),!u&&d.jsxs(Kn,{open:N,onOpenChange:O,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),d.jsx(Gn,{disabled:H,id:"name",value:T,onChange:S=>L(S.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),d.jsxs(Fe,{onClick:()=>{T.trim()&&sv(T,v)},disabled:H,className:"s3-explr-create-btn",children:[H&&d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),H?"Đang tạo...":"Tạo"]})]})]})]}),u&&!v?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[d.jsx(St,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Xe.status?d.jsxs(d.Fragment,{children:[Xe.status.isProcessing?"Đang thu thập ":"Đang quét sitemap ","(",Xe.status.completed,"/",Xe.status.total,") -"," ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}):"Đang thu thập..."]}),d.jsxs(Fe,{variant:"destructive",size:"sm",onClick:()=>void dv(),className:"flex items-center gap-2",children:[d.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),d.jsx(wO,{className:"h-4 w-4"})]})]})}),Xe.status&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2 max-w-md break-words",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Xe==null?void 0:Xe.url]}),d.jsxs("p",{children:["Tiến độ: ",Xe==null?void 0:Xe.status.completed,"/",Xe==null?void 0:Xe.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",(Xe==null?void 0:Xe.status.status)==="scraping"?"Đang thu thập":(Xe==null?void 0:Xe.status.status)==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):!u&&d.jsxs(Kn,{open:se,onOpenChange:Ie,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Do,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(Gn,{id:"websiteUrl",value:Q,onChange:S=>ne(S.target.value),placeholder:"https://example.com",type:"url",disabled:Be,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(Gn,{id:"crawlLimit",value:ke,onChange:S=>{const P=S.target.value;/^\d*$/.test(P)&&$e(P)},placeholder:"1",type:"text",disabled:Be,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>{Ie(!1),ne(""),$e("1")},disabled:Be,className:"s3-explr-cancel-btn",children:"Hủy"}),Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(Fe,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(xn,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(Fe,{onClick:()=>{Q.trim()&&As(Q.trim(),parseInt(ke)||1)},disabled:Be||!Q.trim(),className:"s3-explr-crawl-btn",children:Be?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:fl,children:[oa&&d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${oa?"animate-spin":""}`}),"Xuất báo cáo"]})}),(Xe==null?void 0:Xe.status)&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Xe.url]}),d.jsxs("p",{children:["Tiến độ: ",Xe.status.completed,"/",Xe.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",Xe.status.status==="scraping"?"Đang thu thập":Xe.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}),d.jsxs(Kn,{open:se,onOpenChange:Ie,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Do,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(Gn,{id:"websiteUrl",value:Q,onChange:S=>ne(S.target.value),placeholder:"https://example.com",type:"url",disabled:Be,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(Gn,{id:"crawlLimit",value:ke,onChange:S=>{const P=S.target.value;/^\d*$/.test(P)&&$e(P)},placeholder:"1",type:"text",disabled:Be,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsxs(Fe,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>nl(S=>!S),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]}),d.jsx(Fe,{variant:"outline",onClick:()=>{Ie(!1),ne(""),$e("1")},disabled:Be,className:"s3-explr-cancel-btn",children:"Hủy"}),Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(Fe,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(xn,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(Fe,{onClick:()=>{Q.trim()&&As(Q.trim(),parseInt(ke)||1)},disabled:Be||!Q.trim(),className:"s3-explr-crawl-btn",children:Be?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:fl,children:[oa&&d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${oa?"animate-spin":""}`}),"Xuất báo cáo"]})}),oa&&d.jsx(xn,{sideOffset:5,children:"Đang xuất báo cáo"})]})}),d.jsxs("div",{className:"flex items-center gap-4",children:[Qu&&d.jsxs(ic,{open:Qu,onOpenChange:ps,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Gp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Sn,children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My OneDrive"}),d.jsx(Bd,{className:"onedrive-breadcrumb",children:d.jsx(zd,{className:"onedrive-breadcrumb-list",children:gs.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[P>0&&d.jsx(Vd,{className:"onedrive-breadcrumb-separator"}),d.jsx(fc,{className:"onedrive-breadcrumb-item",children:d.jsx(hc,{onClick:()=>sf(P),className:"cursor-pointer onedrive-breadcrumb-link",children:S.name})})]},P))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Jm?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):d.jsx(d.Fragment,{children:[...Wc,...Yc].length>0?[...Wc,...Yc].map(S=>d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${sa.some(P=>P.id===S.id)?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:sa.some(P=>P.id===S.id),onChange:P=>{P.stopPropagation(),al(S)},className:"cursor-pointer"}),S.isFolder?d.jsx(nc,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>fa(S.id,S.name)}):d.jsx(Np,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${S.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{S.isFolder?fa(S.id,S.name):al(S)},children:S.name}),!S.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[ua(S.size)," •"," ",Jn(S.lastModified.toISOString())]})]})]},S.id)):d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."})})}),d.jsxs("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:[d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{onClick:()=>la(!0),className:"bottom-4 left-4 text-gray-600 hover:text-gray-800",title:"Đăng xuất OneDrive",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),d.jsx("polyline",{points:"16 17 21 12 16 7"}),d.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}),d.jsxs(Fe,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>nl(S=>!S),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]}),d.jsx(Fe,{onClick:()=>{cf(sa,v),Sn()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:sa.length===0,children:"Đồng bộ"})]})]})]}),d.jsxs(ic,{open:Zu,onOpenChange:la,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi OneDrive?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>la(!1),children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>{of(),la(!1)},children:"Đăng xuất"})]})]})]}),Bo&&d.jsxs(ic,{open:Bo,onOpenChange:zo,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Gp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:_s,children:"✖"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[gt&&d.jsx("button",{onClick:()=>ca(null),className:"text-gray-600 hover:text-gray-800",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My SharePoint"})]}),gt&&d.jsx(Bd,{className:"sharepoint-breadcrumb",children:d.jsx(zd,{className:"sharepoint-breadcrumb-list",children:vs.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[P>0&&d.jsx(Vd,{className:"sharepoint-breadcrumb-separator"}),d.jsx(fc,{className:"sharepoint-breadcrumb-item",children:d.jsx(hc,{onClick:()=>ov(P),className:"cursor-pointer sharepoint-breadcrumb-link",children:S.name})})]},P))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Xc?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):gt?[...el,...Zc].length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."}):[...el,...Zc].map(S=>{const P=ms.some(B=>B.id===S.id);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${P?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:P,onChange:B=>{B.stopPropagation(),nf(S)},className:"cursor-pointer"}),S.isFolder?d.jsx(nc,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>xs(S.id,S.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")}):d.jsx(Np,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${S.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{S.isFolder&&xs(S.id,S.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},children:S.name}),!S.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[ua(S.size)," •"," ",S.lastModified.toLocaleString()]})]})]},S.id)}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:ws.map(S=>d.jsxs("div",{className:"cursor-pointer bg-white shadow-md rounded-xl p-5 flex flex-col justify-center items-start transition-shadow duration-200 hover:shadow-lg border border-gray-100 min-h-[120px]",style:{overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis",whiteSpace:"normal"},onClick:()=>rv(S),children:[d.jsx("div",{className:"font-bold text-lg mb-1 truncate w-full",title:S.name,children:S.name}),d.jsx("div",{className:"text-sm text-gray-500 truncate w-full",title:S.description,children:S.description})]},S.id))})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:gt&&d.jsxs(d.Fragment,{children:[d.jsx(Fe,{onClick:()=>{nn(ms,v),_s()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:ms.length===0,children:"Đồng bộ"}),d.jsx(Fe,{onClick:()=>ca(null),children:"Quay lại"})]})}),gt&&d.jsxs("button",{onClick:()=>nl(S=>!S),className:`absolute bottom-4 left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,title:"Bật/tắt tự động cập nhật KB",children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]})]}),d.jsxs(ic,{open:Xm,onOpenChange:bs,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi SharePoint?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>bs(!1),children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>{tv(),bs(!1)},children:"Đăng xuất"})]})]})]})]}),d.jsx(Kn,{open:!!$c,onOpenChange:S=>{S||(Wu(!1),Yu([]),ju(""))},children:d.jsxs(Nn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:d.jsxs("h3",{className:"font-medium mb-2",children:["Danh sách flows đang sử dụng dữ liệu từ folder(",d.jsx("span",{className:"font-bold",children:ds}),"):"," "]})}),d.jsx(Do,{className:"s3-explr-dialog-description",children:Hc?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx(St,{className:"h-6 w-6 animate-spin"}),d.jsx("span",{className:"ml-2",children:"Đang tải thông tin flows..."})]}):d.jsx("div",{children:us&&Array.isArray(us)&&us.length>0?d.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:d.jsxs("table",{className:"w-full border-collapse",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-gray-100",children:[d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Tên Flow"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"KnowledgeBase Id"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Loại"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Ngày tạo"})]})}),d.jsx("tbody",{children:us.map((S,P)=>d.jsxs("tr",{className:P%2===0?"bg-white":"bg-gray-50",children:[d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.name}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.KnowledgeBaseId}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.type==="MULTIAGENT"?"Agent Flow":"Chat Flow"}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.createdDate?new Date(S.createdDate).toLocaleString("vi-VN"):"N/A"})]},P))})]})}):d.jsx("div",{className:"text-gray-500 italic py-2",children:"Không có flow nào sử dụng dữ liệu từ folder này"})})})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>q(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>df(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(Kn,{open:!!ee,onOpenChange:S=>!S&&q(null),children:d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),d.jsxs(Do,{className:"s3-explr-dialog-description break-words whitespace-pre-wrap",children:["Bạn có chắc chắn muốn xóa"," ",d.jsx("span",{className:"font-medium break-all",children:ee==null?void 0:ee.name}),"? Hành động này không thể hoàn tác."]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>q(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>df(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(Kn,{open:!!U,onOpenChange:S=>{S||(te(null),Ne(null),z(""),Tt(""),Y("rename"))},children:d.jsxs(Nn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:U!=null&&U.isFolder?"Đổi tên thư mục":Xi(U)?"Quản lý tập tin":"Đổi tên tập tin"})}),U&&d.jsxs(Tg,{value:R,onValueChange:S=>Y(S),children:[d.jsxs(eu,{"aria-checked":!Xi(U),"aria-disabled":U.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[d.jsx(zi,{value:"rename",children:"Đổi tên"}),!U.isFolder&&d.jsxs(d.Fragment,{children:[Xi(U)&&d.jsx(zi,{value:"edit",children:"Sửa nội dung"}),d.jsx(zi,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),d.jsx(Vi,{value:"rename",children:d.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:d.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),d.jsx(Gn,{id:"newName",value:Te,onChange:S=>z(S.target.value),placeholder:"Nhập tên mới",disabled:xe,className:"s3-explr-input"})]})})}),!U.isFolder&&d.jsxs(d.Fragment,{children:[Xi(U)&&d.jsx(Vi,{value:"edit",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(St,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.jsxs("div",{className:"max-h-[70dvh] overflow-auto rounded-md border px-4 py-3 bg-muted/30",children:[d.jsx(lr,{htmlFor:"content",className:"block text-sm font-medium mb-2 text-muted-foreground",children:"Nội dung tập tin"}),d.jsx(vc,{id:"content",value:nt,onChange:S=>Tt(S.target.value),placeholder:"Nhập nội dung tập tin",className:"font-mono text-sm resize-none min-h-[200px] w-full",disabled:mn,style:{height:"auto",maxHeight:"60vh"},rows:Math.max(10,nt.split(`
238
- `).length+1)})]})})}),d.jsx(Vi,{value:"edit-metadata",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(St,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:Ce&&typeof Ce=="object"&&Object.entries(Ce).map(([S,P],B)=>d.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[d.jsxs(lr,{htmlFor:S,className:"s3-explr-label flex items-center gap-1",children:[lD[S]||S,hg(S)&&d.jsx(qM,{className:"h-[12px] w-[12px] text-red-500"})]}),dD(S)?d.jsx(vc,{id:S,value:typeof P=="string"?P:JSON.stringify(P),onChange:fe=>{const ye={...Ce,[S]:fe.target.value};Ne(ye)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:mn||hg(S)}):d.jsx(Gn,{id:S,value:typeof P=="string"?P:JSON.stringify(P),onChange:fe=>{const ye={...Ce,[S]:fe.target.value};Ne(ye)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:mn||hg(S)})]},B))})})})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>{te(null),Ne(null),z(""),Tt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),R==="edit"?d.jsx(Fe,{onClick:()=>U&&lv(U,nt),disabled:mn||ln,className:"s3-explr-save-btn",children:mn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):R==="edit-metadata"?d.jsx(Fe,{onClick:()=>Ce&&typeof Ce=="object"&&U&&ul(U),disabled:mn||ln,className:"s3-explr-save-btn",children:mn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):d.jsx(Fe,{onClick:()=>{Te.trim()&&U&&Ts(U,Te.trim())},disabled:xe||!Te.trim()||Te.trim()===(U==null?void 0:U.name),className:"s3-explr-rename-btn",children:xe?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),d.jsx(Kn,{open:!!be,onOpenChange:S=>{S||(Ee(null),Tt(""))},children:d.jsxs(Nn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:"Xem tập tin"})}),be&&d.jsxs(Tg,{value:"view",children:[d.jsx(eu,{className:"grid w-full grid-cols-1 ",children:!be.isFolder&&Xi(be)&&d.jsx(zi,{value:"view",children:"Nội dung"})}),!be.isFolder&&Xi(be)&&d.jsx(Vi,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(St,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:nt})})})})})]}),d.jsx(_r,{className:"s3-explr-dialog-footer",children:d.jsx(Fe,{variant:"outline",onClick:()=>{Ee(null),Tt("")},className:"s3-explr-cancel-btn",children:"Đóng"})})]})}),de&&ue&&d.jsx(SH,{openDialogRename:ue,setOpenDialogRename:Ae,apiBaseUrl:e,setFileToMove:ce,fileToMove:de,refreshFiles:dn,ignoreCache:fr,autoSyncAfterFileOperation:Zr})]})]}),rl&&d.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),d.jsx(_H,{onFilesSelected:(S,P)=>ha(S,v,P),children:d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Jd,{className:"s3-explr-table",children:[d.jsx(Qd,{className:"s3-explr-table-header",children:pa.getHeaderGroups().map(S=>d.jsx(zr,{className:"hover:bg-transparent s3-explr-header-row",children:S.headers.map(P=>d.jsx(lo,{className:"s3-explr-header-cell",children:P.isPlaceholder?null:Rd(P.column.columnDef.header,P.getContext())},P.id))},S.id))}),d.jsx(Xd,{className:"s3-explr-table-body",children:pa.getRowModel().rows.length===0?d.jsx(zr,{className:"s3-explr-empty-row",children:d.jsx(jn,{colSpan:Es.length,className:"h-24 text-center s3-explr-empty-cell",children:g?d.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',g,'"']}):d.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:Cs?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):pa.getRowModel().rows.map(S=>d.jsx(zr,{className:"h-12 s3-explr-row",children:S.getVisibleCells().map(P=>d.jsx(jn,{className:"align-middle s3-explr-cell",children:Rd(P.column.columnDef.cell,P.getContext())},P.id))},S.id))})]})})}),g&&da!==0&&d.jsx(d.Fragment,{children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Wd,{onClick:()=>pr(S=>Math.max(S-1,1)),"aria-disabled":Vt===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(da/20)},(S,P)=>{const B=P+1,fe=Math.ceil(da/20);return fe>7&&!(B===1||B===fe||B>=Vt-1&&B<=Vt+1)?B===Vt-2&&Vt>4||B===Vt+2&&Vt<fe-3?d.jsx(Yd,{className:"pointer-events-none",children:"..."},P):null:d.jsx(Br,{className:"cursor-pointer",children:d.jsx(Ya,{isActive:Vt===B,onClick:()=>pr(B),className:`${Vt===B?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:B})},P)}),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>pr(S=>Math.min(S+1,Math.ceil(da/20))),"aria-disabled":Vt===Math.ceil(da/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),o&&a&&d.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[d.jsx("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:hf()}),d.jsx(Fe,{variant:"default",onClick:()=>a(ff()),disabled:y.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),d.jsx(r3,{open:!!Bc,onClose:()=>zc(null),file:Bc,apiBaseUrl:e,rootUrlHostApi:r})]})}),g3=t=>d.jsx(J1,{clientId:i3,children:d.jsx(p3,{...t})});var Dc=t=>t.type==="checkbox",Zi=t=>t instanceof Date,Ln=t=>t==null;const QE=t=>typeof t=="object";var Yt=t=>!Ln(t)&&!Array.isArray(t)&&QE(t)&&!Zi(t),m3=t=>Yt(t)&&t.target?Dc(t.target)?t.target.checked:t.target.value:t,v3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,y3=(t,e)=>t.has(v3(e)),w3=t=>{const e=t.constructor&&t.constructor.prototype;return Yt(e)&&e.hasOwnProperty("isPrototypeOf")},$m=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cn(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!($m&&(t instanceof Blob||r))&&(n||Yt(t)))if(e=n?[]:Object.create(Object.getPrototypeOf(t)),!n&&!w3(t))e=t;else for(const o in t)t.hasOwnProperty(o)&&(e[o]=cn(t[o]));else return t;return e}var zu=t=>/^\w*$/.test(t),Jt=t=>t===void 0,Hm=t=>Array.isArray(t)?t.filter(Boolean):[],Bm=t=>Hm(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Ue=(t,e,n)=>{if(!e||!Yt(t))return n;const r=(zu(e)?[e]:Bm(e)).reduce((o,a)=>Ln(o)?o:o[a],t);return Jt(r)||r===t?Jt(t[e])?n:t[e]:r},vo=t=>typeof t=="boolean",$t=(t,e,n)=>{let r=-1;const o=zu(e)?[e]:Bm(e),a=o.length,s=a-1;for(;++r<a;){const l=o[r];let u=n;if(r!==s){const h=t[l];u=Yt(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=u,t=t[l]}};const XE={BLUR:"blur",FOCUS_OUT:"focusout"},qr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Uo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},b3=M.createContext(null);b3.displayName="HookFormContext";var C3=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(o,a,{get:()=>{const s=a;return e._proxyFormState[s]!==qr.all&&(e._proxyFormState[s]=!r||qr.all),t[s]}});return o};const x3=typeof window<"u"?M.useLayoutEffect:M.useEffect;var hr=t=>typeof t=="string",_3=(t,e,n,r,o)=>hr(t)?(r&&e.watch.add(t),Ue(n,t,o)):Array.isArray(t)?t.map(a=>(r&&e.watch.add(a),Ue(n,a))):(r&&(e.watchAll=!0),n),zm=t=>Ln(t)||!QE(t);function Ci(t,e,n=new WeakSet){if(zm(t)||zm(e))return t===e;if(Zi(t)&&Zi(e))return t.getTime()===e.getTime();const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const a of r){const s=t[a];if(!o.includes(a))return!1;if(a!=="ref"){const l=e[a];if(Zi(s)&&Zi(l)||Yt(s)&&Yt(l)||Array.isArray(s)&&Array.isArray(l)?!Ci(s,l,n):s!==l)return!1}}return!0}var S3=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},Rc=t=>Array.isArray(t)?t:[t],ZE=()=>{let t=[];return{get observers(){return t},next:o=>{for(const a of t)a.next&&a.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(a=>a!==o)}}),unsubscribe:()=>{t=[]}}};function e0(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],a=e[r];if(o&&Yt(o)&&a){const s=e0(o,a);Yt(s)&&(n[r]=s)}else t[r]&&(n[r]=a)}return n}var Yn=t=>Yt(t)&&!Object.keys(t).length,Vm=t=>t.type==="file",Yr=t=>typeof t=="function",Vu=t=>{if(!$m)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},t0=t=>t.type==="select-multiple",Km=t=>t.type==="radio",T3=t=>Km(t)||Dc(t),Gm=t=>Vu(t)&&t.isConnected;function E3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Jt(t)?r++:t[e[r++]];return t}function A3(t){for(const e in t)if(t.hasOwnProperty(e)&&!Jt(t[e]))return!1;return!0}function Qt(t,e){const n=Array.isArray(e)?e:zu(e)?[e]:Bm(e),r=n.length===1?t:E3(t,n),o=n.length-1,a=n[o];return r&&delete r[a],o!==0&&(Yt(r)&&Yn(r)||Array.isArray(r)&&A3(r))&&Qt(t,n.slice(0,-1)),t}var I3=t=>{for(const e in t)if(Yr(t[e]))return!0;return!1};function n0(t){return Array.isArray(t)||Yt(t)&&!I3(t)}function jm(t,e={}){for(const n in t)n0(t[n])?(e[n]=Array.isArray(t[n])?[]:{},jm(t[n],e[n])):Ln(t[n])||(e[n]=!0);return e}function ss(t,e,n){n||(n=jm(e));for(const r in t)n0(t[r])?Jt(e)||zm(n[r])?n[r]=jm(t[r],Array.isArray(t[r])?[]:{}):ss(t[r],Ln(e)?{}:e[r],n[r]):n[r]=!Ci(t[r],e[r]);return n}const r0={value:!1,isValid:!1},o0={value:!0,isValid:!0};var i0=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Jt(t[0].attributes.value)?Jt(t[0].value)||t[0].value===""?o0:{value:t[0].value,isValid:!0}:o0:r0}return r0},a0=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Jt(t)?t:e?t===""?NaN:t&&+t:n&&hr(t)?new Date(t):r?r(t):t;const s0={isValid:!1,value:null};var c0=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,s0):s0;function l0(t){const e=t.ref;return Vm(e)?e.files:Km(e)?c0(t.refs).value:t0(e)?[...e.selectedOptions].map(({value:n})=>n):Dc(e)?i0(t.refs).value:a0(Jt(e.value)?t.ref.value:e.value,t)}var k3=(t,e,n,r)=>{const o={};for(const a of t){const s=Ue(e,a);s&&$t(o,a,s._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:r}},Ku=t=>t instanceof RegExp,Lc=t=>Jt(t)?t:Ku(t)?t.source:Yt(t)?Ku(t.value)?t.value.source:t.value:t,d0=t=>({isOnSubmit:!t||t===qr.onSubmit,isOnBlur:t===qr.onBlur,isOnChange:t===qr.onChange,isOnAll:t===qr.all,isOnTouch:t===qr.onTouched});const u0="AsyncFunction";var N3=t=>!!t&&!!t.validate&&!!(Yr(t.validate)&&t.validate.constructor.name===u0||Yt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===u0)),P3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),f0=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Fc=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const a=Ue(t,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],o)&&!r)return!0;if(s.ref&&e(s.ref,s.name)&&!r)return!0;if(Fc(l,e))break}else if(Yt(l)&&Fc(l,e))break}}};function h0(t,e,n){const r=Ue(t,n);if(r||zu(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const a=o.join("."),s=Ue(e,a),l=Ue(t,a);if(s&&!Array.isArray(s)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};o.pop()}return{name:n}}var O3=(t,e,n,r)=>{n(t);const{name:o,...a}=t;return Yn(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(s=>e[s]===(!r||qr.all))},M3=(t,e,n)=>!t||!e||t===e||Rc(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),D3=(t,e,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?r.isOnBlur:o.isOnBlur)?!t:(n?r.isOnChange:o.isOnChange)?t:!0,R3=(t,e)=>!Hm(Ue(t,e)).length&&Qt(t,e),L3=(t,e,n)=>{const r=Rc(Ue(t,n));return $t(r,"root",e[n]),$t(t,n,r),t};function p0(t,e,n="validate"){if(hr(t)||Array.isArray(t)&&t.every(hr)||vo(t)&&!t)return{type:n,message:hr(t)?t:"",ref:e}}var cs=t=>Yt(t)&&!Ku(t)?t:{value:t,message:""},g0=async(t,e,n,r,o,a)=>{const{ref:s,refs:l,required:u,maxLength:h,minLength:p,min:g,max:w,pattern:y,validate:C,name:v,valueAsNumber:b,mount:k}=t._f,A=Ue(n,v);if(!k||e.has(v))return{};const N=l?l[0]:s,O=ce=>{o&&N.reportValidity&&(N.setCustomValidity(vo(ce)?"":ce||""),N.reportValidity())},T={},L=Km(s),H=Dc(s),W=L||H,ee=(b||Vm(s))&&Jt(s.value)&&Jt(A)||Vu(s)&&s.value===""||A===""||Array.isArray(A)&&!A.length,q=S3.bind(null,v,r,T),de=(ce,ve,K,Z=Uo.maxLength,G=Uo.minLength)=>{const re=ce?ve:K;T[v]={type:ce?Z:G,message:re,ref:s,...q(ce?Z:G,re)}};if(a?!Array.isArray(A)||!A.length:u&&(!W&&(ee||Ln(A))||vo(A)&&!A||H&&!i0(l).isValid||L&&!c0(l).isValid)){const{value:ce,message:ve}=hr(u)?{value:!!u,message:u}:cs(u);if(ce&&(T[v]={type:Uo.required,message:ve,ref:N,...q(Uo.required,ve)},!r))return O(ve),T}if(!ee&&(!Ln(g)||!Ln(w))){let ce,ve;const K=cs(w),Z=cs(g);if(!Ln(A)&&!isNaN(A)){const G=s.valueAsNumber||A&&+A;Ln(K.value)||(ce=G>K.value),Ln(Z.value)||(ve=G<Z.value)}else{const G=s.valueAsDate||new Date(A),re=U=>new Date(new Date().toDateString()+" "+U),J=s.type=="time",X=s.type=="week";hr(K.value)&&A&&(ce=J?re(A)>re(K.value):X?A>K.value:G>new Date(K.value)),hr(Z.value)&&A&&(ve=J?re(A)<re(Z.value):X?A<Z.value:G<new Date(Z.value))}if((ce||ve)&&(de(!!ce,K.message,Z.message,Uo.max,Uo.min),!r))return O(T[v].message),T}if((h||p)&&!ee&&(hr(A)||a&&Array.isArray(A))){const ce=cs(h),ve=cs(p),K=!Ln(ce.value)&&A.length>+ce.value,Z=!Ln(ve.value)&&A.length<+ve.value;if((K||Z)&&(de(K,ce.message,ve.message),!r))return O(T[v].message),T}if(y&&!ee&&hr(A)){const{value:ce,message:ve}=cs(y);if(Ku(ce)&&!A.match(ce)&&(T[v]={type:Uo.pattern,message:ve,ref:s,...q(Uo.pattern,ve)},!r))return O(ve),T}if(C){if(Yr(C)){const ce=await C(A,n),ve=p0(ce,N);if(ve&&(T[v]={...ve,...q(Uo.validate,ve.message)},!r))return O(ve.message),T}else if(Yt(C)){let ce={};for(const ve in C){if(!Yn(ce)&&!r)break;const K=p0(await C[ve](A,n),N,ve);K&&(ce={...K,...q(ve,K.message)},O(K.message),r&&(T[v]=ce))}if(!Yn(ce)&&(T[v]={ref:N,...ce},!r))return T}}return O(!0),T};const F3={mode:qr.onSubmit,reValidateMode:qr.onChange,shouldFocusError:!0};function U3(t={}){let e={...F3,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Yr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},o=Yt(e.defaultValues)||Yt(e.values)?cn(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:cn(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const w={array:ZE(),state:ZE()},y=e.criteriaMode===qr.all,C=R=>Y=>{clearTimeout(h),h=setTimeout(R,Y)},v=async R=>{if(!e.disabled&&(p.isValid||g.isValid||R)){const Y=e.resolver?Yn((await H()).errors):await ee(r,!0);Y!==n.isValid&&w.state.next({isValid:Y})}},b=(R,Y)=>{!e.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((R||Array.from(l.mount)).forEach(se=>{se&&(Y?$t(n.validatingFields,se,Y):Qt(n.validatingFields,se))}),w.state.next({validatingFields:n.validatingFields,isValidating:!Yn(n.validatingFields)}))},k=(R,Y=[],se,Ie,Q=!0,ne=!0)=>{if(Ie&&se&&!e.disabled){if(s.action=!0,ne&&Array.isArray(Ue(r,R))){const ke=se(Ue(r,R),Ie.argA,Ie.argB);Q&&$t(r,R,ke)}if(ne&&Array.isArray(Ue(n.errors,R))){const ke=se(Ue(n.errors,R),Ie.argA,Ie.argB);Q&&$t(n.errors,R,ke),R3(n.errors,R)}if((p.touchedFields||g.touchedFields)&&ne&&Array.isArray(Ue(n.touchedFields,R))){const ke=se(Ue(n.touchedFields,R),Ie.argA,Ie.argB);Q&&$t(n.touchedFields,R,ke)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=ss(o,a)),w.state.next({name:R,isDirty:de(R,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $t(a,R,Y)},A=(R,Y)=>{$t(n.errors,R,Y),w.state.next({errors:n.errors})},N=R=>{n.errors=R,w.state.next({errors:n.errors,isValid:!1})},O=(R,Y,se,Ie)=>{const Q=Ue(r,R);if(Q){const ne=Ue(a,R,Jt(se)?Ue(o,R):se);Jt(ne)||Ie&&Ie.defaultChecked||Y?$t(a,R,Y?ne:l0(Q._f)):K(R,ne),s.mount&&v()}},T=(R,Y,se,Ie,Q)=>{let ne=!1,ke=!1;const $e={name:R};if(!e.disabled){if(!se||Ie){(p.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=$e.isDirty=de(),ne=ke!==$e.isDirty);const Be=Ci(Ue(o,R),Y);ke=!!Ue(n.dirtyFields,R),Be?Qt(n.dirtyFields,R):$t(n.dirtyFields,R,!0),$e.dirtyFields=n.dirtyFields,ne=ne||(p.dirtyFields||g.dirtyFields)&&ke!==!Be}if(se){const Be=Ue(n.touchedFields,R);Be||($t(n.touchedFields,R,se),$e.touchedFields=n.touchedFields,ne=ne||(p.touchedFields||g.touchedFields)&&Be!==se)}ne&&Q&&w.state.next($e)}return ne?$e:{}},L=(R,Y,se,Ie)=>{const Q=Ue(n.errors,R),ne=(p.isValid||g.isValid)&&vo(Y)&&n.isValid!==Y;if(e.delayError&&se?(u=C(()=>A(R,se)),u(e.delayError)):(clearTimeout(h),u=null,se?$t(n.errors,R,se):Qt(n.errors,R)),(se?!Ci(Q,se):Q)||!Yn(Ie)||ne){const ke={...Ie,...ne&&vo(Y)?{isValid:Y}:{},errors:n.errors,name:R};n={...n,...ke},w.state.next(ke)}},H=async R=>{b(R,!0);const Y=await e.resolver(a,e.context,k3(R||l.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return b(R),Y},W=async R=>{const{errors:Y}=await H(R);if(R)for(const se of R){const Ie=Ue(Y,se);Ie?$t(n.errors,se,Ie):Qt(n.errors,se)}else n.errors=Y;return Y},ee=async(R,Y,se={valid:!0})=>{for(const Ie in R){const Q=R[Ie];if(Q){const{_f:ne,...ke}=Q;if(ne){const $e=l.array.has(ne.name),Be=Q._f&&N3(Q._f);Be&&p.validatingFields&&b([ne.name],!0);const Mt=await g0(Q,l.disabled,a,y,e.shouldUseNativeValidation&&!Y,$e);if(Be&&p.validatingFields&&b([ne.name]),Mt[ne.name]&&(se.valid=!1,Y))break;!Y&&(Ue(Mt,ne.name)?$e?L3(n.errors,Mt,ne.name):$t(n.errors,ne.name,Mt[ne.name]):Qt(n.errors,ne.name))}!Yn(ke)&&await ee(ke,Y,se)}}return se.valid},q=()=>{for(const R of l.unMount){const Y=Ue(r,R);Y&&(Y._f.refs?Y._f.refs.every(se=>!Gm(se)):!Gm(Y._f.ref))&&z(R)}l.unMount=new Set},de=(R,Y)=>!e.disabled&&(R&&Y&&$t(a,R,Y),!Ci(U(),o)),ce=(R,Y,se)=>_3(R,l,{...s.mount?a:Jt(Y)?o:hr(R)?{[R]:Y}:Y},se,Y),ve=R=>Hm(Ue(s.mount?a:o,R,e.shouldUnregister?Ue(o,R,[]):[])),K=(R,Y,se={})=>{const Ie=Ue(r,R);let Q=Y;if(Ie){const ne=Ie._f;ne&&(!ne.disabled&&$t(a,R,a0(Y,ne)),Q=Vu(ne.ref)&&Ln(Y)?"":Y,t0(ne.ref)?[...ne.ref.options].forEach(ke=>ke.selected=Q.includes(ke.value)):ne.refs?Dc(ne.ref)?ne.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Q)?ke.checked=!!Q.find($e=>$e===ke.value):ke.checked=Q===ke.value||!!Q)}):ne.refs.forEach(ke=>ke.checked=ke.value===Q):Vm(ne.ref)?ne.ref.value="":(ne.ref.value=Q,ne.ref.type||w.state.next({name:R,values:cn(a)})))}(se.shouldDirty||se.shouldTouch)&&T(R,Q,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&X(R)},Z=(R,Y,se)=>{for(const Ie in Y){if(!Y.hasOwnProperty(Ie))return;const Q=Y[Ie],ne=R+"."+Ie,ke=Ue(r,ne);(l.array.has(R)||Yt(Q)||ke&&!ke._f)&&!Zi(Q)?Z(ne,Q,se):K(ne,Q,se)}},G=(R,Y,se={})=>{const Ie=Ue(r,R),Q=l.array.has(R),ne=cn(Y);$t(a,R,ne),Q?(w.array.next({name:R,values:cn(a)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&se.shouldDirty&&w.state.next({name:R,dirtyFields:ss(o,a),isDirty:de(R,ne)})):Ie&&!Ie._f&&!Ln(ne)?Z(R,ne,se):K(R,ne,se),f0(R,l)&&w.state.next({...n,name:R}),w.state.next({name:s.mount?R:void 0,values:cn(a)})},re=async R=>{s.mount=!0;const Y=R.target;let se=Y.name,Ie=!0;const Q=Ue(r,se),ne=Be=>{Ie=Number.isNaN(Be)||Zi(Be)&&isNaN(Be.getTime())||Ci(Be,Ue(a,se,Be))},ke=d0(e.mode),$e=d0(e.reValidateMode);if(Q){let Be,Mt;const tn=Y.type?l0(Q._f):m3(R),zt=R.type===XE.BLUR||R.type===XE.FOCUS_OUT,yo=!P3(Q._f)&&!e.resolver&&!Ue(n.errors,se)&&!Q._f.deps||D3(zt,Ue(n.touchedFields,se),n.isSubmitted,$e,ke),Gt=f0(se,l,zt);$t(a,se,tn),zt?(!Y||!Y.readOnly)&&(Q._f.onBlur&&Q._f.onBlur(R),u&&u(0)):Q._f.onChange&&Q._f.onChange(R);const vn=T(se,tn,zt),Jr=!Yn(vn)||Gt;if(!zt&&w.state.next({name:se,type:R.type,values:cn(a)}),yo)return(p.isValid||g.isValid)&&(e.mode==="onBlur"?zt&&v():zt||v()),Jr&&w.state.next({name:se,...Gt?{}:vn});if(!zt&&Gt&&w.state.next({...n}),e.resolver){const{errors:Vt}=await H([se]);if(ne(tn),Ie){const pr=h0(n.errors,r,se),Qr=h0(Vt,r,pr.name||se);Be=Qr.error,se=Qr.name,Mt=Yn(Vt)}}else b([se],!0),Be=(await g0(Q,l.disabled,a,y,e.shouldUseNativeValidation))[se],b([se]),ne(tn),Ie&&(Be?Mt=!1:(p.isValid||g.isValid)&&(Mt=await ee(r,!0)));Ie&&(Q._f.deps&&(!Array.isArray(Q._f.deps)||Q._f.deps.length>0)&&X(Q._f.deps),L(se,Mt,Be,vn))}},J=(R,Y)=>{if(Ue(n.errors,Y)&&R.focus)return R.focus(),1},X=async(R,Y={})=>{let se,Ie;const Q=Rc(R);if(e.resolver){const ne=await W(Jt(R)?R:Q);se=Yn(ne),Ie=R?!Q.some(ke=>Ue(ne,ke)):se}else R?(Ie=(await Promise.all(Q.map(async ne=>{const ke=Ue(r,ne);return await ee(ke&&ke._f?{[ne]:ke}:ke)}))).every(Boolean),!(!Ie&&!n.isValid)&&v()):Ie=se=await ee(r);return w.state.next({...!hr(R)||(p.isValid||g.isValid)&&se!==n.isValid?{}:{name:R},...e.resolver||!R?{isValid:se}:{},errors:n.errors}),Y.shouldFocus&&!Ie&&Fc(r,J,R?Q:l.mount),Ie},U=(R,Y)=>{let se={...s.mount?a:o};return Y&&(se=e0(Y.dirtyFields?n.dirtyFields:n.touchedFields,se)),Jt(R)?se:hr(R)?Ue(se,R):R.map(Ie=>Ue(se,Ie))},te=(R,Y)=>({invalid:!!Ue((Y||n).errors,R),isDirty:!!Ue((Y||n).dirtyFields,R),error:Ue((Y||n).errors,R),isValidating:!!Ue(n.validatingFields,R),isTouched:!!Ue((Y||n).touchedFields,R)}),be=R=>{R&&Rc(R).forEach(Y=>Qt(n.errors,Y)),w.state.next({errors:R?n.errors:{}})},Ee=(R,Y,se)=>{const Ie=(Ue(r,R,{_f:{}})._f||{}).ref,Q=Ue(n.errors,R)||{},{ref:ne,message:ke,type:$e,...Be}=Q;$t(n.errors,R,{...Be,...Y,ref:Ie}),w.state.next({name:R,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&Ie&&Ie.focus&&Ie.focus()},Ce=(R,Y)=>Yr(R)?w.state.subscribe({next:se=>"values"in se&&R(ce(void 0,Y),se)}):ce(R,Y,!0),Ne=R=>w.state.subscribe({next:Y=>{M3(R.name,Y.name,R.exact)&&O3(Y,R.formState||p,Ot,R.reRenderRoot)&&R.callback({values:{...a},...n,...Y,defaultValues:o})}}).unsubscribe,Te=R=>(s.mount=!0,g={...g,...R.formState},Ne({...R,formState:g})),z=(R,Y={})=>{for(const se of R?Rc(R):l.mount)l.mount.delete(se),l.array.delete(se),Y.keepValue||(Qt(r,se),Qt(a,se)),!Y.keepError&&Qt(n.errors,se),!Y.keepDirty&&Qt(n.dirtyFields,se),!Y.keepTouched&&Qt(n.touchedFields,se),!Y.keepIsValidating&&Qt(n.validatingFields,se),!e.shouldUnregister&&!Y.keepDefaultValue&&Qt(o,se);w.state.next({values:cn(a)}),w.state.next({...n,...Y.keepDirty?{isDirty:de()}:{}}),!Y.keepIsValid&&v()},ue=({disabled:R,name:Y})=>{(vo(R)&&s.mount||R||l.disabled.has(Y))&&(R?l.disabled.add(Y):l.disabled.delete(Y))},Ae=(R,Y={})=>{let se=Ue(r,R);const Ie=vo(Y.disabled)||vo(e.disabled);return $t(r,R,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:R}},name:R,mount:!0,...Y}}),l.mount.add(R),se?ue({disabled:vo(Y.disabled)?Y.disabled:e.disabled,name:R}):O(R,!0,Y.value),{...Ie?{disabled:Y.disabled||e.disabled}:{},...e.progressive?{required:!!Y.required,min:Lc(Y.min),max:Lc(Y.max),minLength:Lc(Y.minLength),maxLength:Lc(Y.maxLength),pattern:Lc(Y.pattern)}:{},name:R,onChange:re,onBlur:re,ref:Q=>{if(Q){Ae(R,Y),se=Ue(r,R);const ne=Jt(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ke=T3(ne),$e=se._f.refs||[];if(ke?$e.find(Be=>Be===ne):ne===se._f.ref)return;$t(r,R,{_f:{...se._f,...ke?{refs:[...$e.filter(Gm),ne,...Array.isArray(Ue(o,R))?[{}]:[]],ref:{type:ne.type,name:R}}:{ref:ne}}}),O(R,!1,void 0,ne)}else se=Ue(r,R,{}),se._f&&(se._f.mount=!1),(e.shouldUnregister||Y.shouldUnregister)&&!(y3(l.array,R)&&s.action)&&l.unMount.add(R)}}},xe=()=>e.shouldFocusError&&Fc(r,J,l.mount),Pe=R=>{vo(R)&&(w.state.next({disabled:R}),Fc(r,(Y,se)=>{const Ie=Ue(r,se);Ie&&(Y.disabled=Ie._f.disabled||R,Array.isArray(Ie._f.refs)&&Ie._f.refs.forEach(Q=>{Q.disabled=Ie._f.disabled||R}))},0,!1))},ae=(R,Y)=>async se=>{let Ie;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let Q=cn(a);if(w.state.next({isSubmitting:!0}),e.resolver){const{errors:ne,values:ke}=await H();n.errors=ne,Q=cn(ke)}else await ee(r);if(l.disabled.size)for(const ne of l.disabled)Qt(Q,ne);if(Qt(n.errors,"root"),Yn(n.errors)){w.state.next({errors:{}});try{await R(Q,se)}catch(ne){Ie=ne}}else Y&&await Y({...n.errors},se),xe(),setTimeout(xe);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Yn(n.errors)&&!Ie,submitCount:n.submitCount+1,errors:n.errors}),Ie)throw Ie},Ze=(R,Y={})=>{Ue(r,R)&&(Jt(Y.defaultValue)?G(R,cn(Ue(o,R))):(G(R,Y.defaultValue),$t(o,R,cn(Y.defaultValue))),Y.keepTouched||Qt(n.touchedFields,R),Y.keepDirty||(Qt(n.dirtyFields,R),n.isDirty=Y.defaultValue?de(R,cn(Ue(o,R))):de()),Y.keepError||(Qt(n.errors,R),p.isValid&&v()),w.state.next({...n}))},nt=(R,Y={})=>{const se=R?cn(R):o,Ie=cn(se),Q=Yn(R),ne=Q?o:Ie;if(Y.keepDefaultValues||(o=se),!Y.keepValues){if(Y.keepDirtyValues){const ke=new Set([...l.mount,...Object.keys(ss(o,a))]);for(const $e of Array.from(ke))Ue(n.dirtyFields,$e)?$t(ne,$e,Ue(a,$e)):G($e,Ue(ne,$e))}else{if($m&&Jt(R))for(const ke of l.mount){const $e=Ue(r,ke);if($e&&$e._f){const Be=Array.isArray($e._f.refs)?$e._f.refs[0]:$e._f.ref;if(Vu(Be)){const Mt=Be.closest("form");if(Mt){Mt.reset();break}}}}if(Y.keepFieldsRef)for(const ke of l.mount)G(ke,Ue(ne,ke));else r={}}a=e.shouldUnregister?Y.keepDefaultValues?cn(o):{}:cn(ne),w.array.next({values:{...ne}}),w.state.next({values:{...ne}})}l={mount:Y.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!Y.keepIsValid||!!Y.keepDirtyValues,s.watch=!!e.shouldUnregister,w.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Ci(R,o)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:Y.keepDirtyValues?Y.keepDefaultValues&&a?ss(o,a):n.dirtyFields:Y.keepDefaultValues&&R?ss(o,R):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Tt=(R,Y)=>nt(Yr(R)?R(a):R,Y),ln=(R,Y={})=>{const se=Ue(r,R),Ie=se&&se._f;if(Ie){const Q=Ie.refs?Ie.refs[0]:Ie.ref;Q.focus&&(Q.focus(),Y.shouldSelect&&Yr(Q.select)&&Q.select())}},Ot=R=>{n={...n,...R}},en={control:{register:Ae,unregister:z,getFieldState:te,handleSubmit:ae,setError:Ee,_subscribe:Ne,_runSchema:H,_focusError:xe,_getWatch:ce,_getDirty:de,_setValid:v,_setFieldArray:k,_setDisabledField:ue,_setErrors:N,_getFieldArray:ve,_reset:nt,_resetDefaultValues:()=>Yr(e.defaultValues)&&e.defaultValues().then(R=>{Tt(R,e.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:q,_disableForm:Pe,_subjects:w,_proxyFormState:p,get _fields(){return r},get _formValues(){return a},get _state(){return s},set _state(R){s=R},get _defaultValues(){return o},get _names(){return l},set _names(R){l=R},get _formState(){return n},get _options(){return e},set _options(R){e={...e,...R}}},subscribe:Te,trigger:X,register:Ae,handleSubmit:ae,watch:Ce,setValue:G,getValues:U,reset:Tt,resetField:Ze,clearErrors:be,unregister:z,setError:Ee,setFocus:ln,getFieldState:te};return{...en,formControl:en}}function $3(t={}){const e=M.useRef(void 0),n=M.useRef(void 0),[r,o]=M.useState({isDirty:!1,isValidating:!1,isLoading:Yr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Yr(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!Yr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:s,...l}=U3(t);e.current={...l,formState:r}}const a=e.current.control;return a._options=t,x3(()=>{const s=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),a._formState.isReady=!0,s},[a]),M.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),M.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),M.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),M.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),M.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==r.isDirty&&a._subjects.state.next({isDirty:s})}},[a,r.isDirty]),M.useEffect(()=>{t.values&&!Ci(t.values,n.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),n.current=t.values,o(s=>({...s}))):a._resetDefaultValues()},[a,t.values]),M.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=C3(r,a),e.current}const m0=({className:t,children:e,content:n,side:r})=>{const[o,a]=M.useState(!1);return d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{open:o,children:[d.jsx(Rn,{asChild:!0,children:d.jsx("button",{type:"button",className:Ge("cursor-pointer",t),onClick:()=>a(!o),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onTouchStart:()=>a(!o),onKeyDown:s=>{s.preventDefault(),s.key==="Enter"&&a(!o)},children:e})}),d.jsx(xn,{side:r,className:n?"":"hidden",children:d.jsx("span",{className:"inline-block",children:n})})]})})},H3=(t,e)=>{const[n,r]=M.useState(t);return M.useEffect(()=>{const o=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(o)}},[t,e]),n},B3=({apiBaseUrl:t="http://localhost:3000"})=>{var L,H;const[e,n]=M.useState([]),[r,o]=M.useState(!1),[a,s]=M.useState([]),[l,u]=M.useState(1),[h,p]=M.useState(1),[g,w]=M.useState(null),[y,C]=M.useState(""),v=H3(y,500),b=W=>{const ee=W.match(/\d{6}/);if(!ee)return{month:"",year:""};const q=ee[0],de=q.substring(0,2),ce=q.substring(2);return{month:de,year:ce}},k=W=>W.map(q=>{let de=(q==null?void 0:q.month)||"",ce=(q==null?void 0:q.year)||"";if((!de||!ce)&&(q!=null&&q.file_name)){const ve=b(q.file_name);de=de||ve.month,ce=ce||ve.year}return{id:q==null?void 0:q.id,prefix:(q==null?void 0:q.prefix)||"",model:(q==null?void 0:q.model)||"",fileName:(q==null?void 0:q.file_name)||"",code:(q==null?void 0:q.stock_id)||"",month:de,year:ce,content:(q==null?void 0:q.text_summary)||"",status:(q==null?void 0:q.status)||"",note:(q==null?void 0:q.note)||"",lastUpdate:q==null?void 0:q.updated_at,stock_id:q==null?void 0:q.stock_id}}),A=W=>{if(!(W!=null&&W.data))return[];const ee=k(W==null?void 0:W.data);n(ee),p(W.pagination.totalPages)},N=async(W=1,ee=15)=>{w(W),o(!0);try{const q=await Le.get(`${t}/api/latest-summaries`,{params:{page:W,limit:ee,search:y}});(q==null?void 0:q.status)===200?A(q.data):console.error(q)}catch(q){console.error("Error fetching data:",q)}finally{w(null),o(!1)}};M.useEffect(()=>{v&&u(1),N(l)},[l,v]);const O=M.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:ee})=>d.jsx("span",{className:"flex flex-col",children:ee.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:ee})=>{const q=ee.original.month,de=ee.original.year;return d.jsx("span",{className:"flex flex-col",children:`${q.toString().padStart(2,"0")}/${de}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:ee})=>{const q=ee.getValue("content");return d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:q})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:ee})=>{const de=ee.original.status!=="unpublish";return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${de?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:de?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:ee})=>d.jsx(m0,{content:d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:ee.original.note}),children:d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:ee.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:ee})=>{const q=new Date(ee.original.lastUpdate),de=q.getDate(),ce=q.getMonth()+1,ve=`ngày ${de} tháng ${ce}`;return d.jsx("span",{className:"flex flex-col",children:ve})}},{accessorKey:"actions",header:()=>d.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:ee})=>{const[q,de]=M.useState(!1),[ce,ve]=M.useState(!1),[K,Z]=M.useState(!1),{handleSubmit:G,register:re,reset:J}=$3(),X=ee.original.id,U=ee.getValue("status"),te=ee.getValue("content"),[be,Ee]=M.useState(!1),Ce=async()=>{try{Ee(!0);const Te=U==="unpublish"?"published":"unpublish",z=await Le.patch(`${t}/api/toggle-publish/${X}`,{id:X,typeAction:"update",status:U,idInput:X,stock_id:ee.original.stock_id,prefix:ee.original.prefix,model:ee.original.model,summary_result:ee.original.content,note:ee.original.note});z.status===200?n(ue=>ue.map(Ae=>Ae.id===X?{...Ae,status:Te}:Ae)):console.error("Failed to toggle publish status:",z)}catch(Te){console.error("Error toggling publish status:",Te)}finally{Ee(!1)}},Ne=async Te=>{de(!0);try{const z=await Le.patch(`${t}/api/update-summary`,{note:Te.note,text_summary:Te.content,id:X});z.status===200?(await N(l),ve(!1)):console.error("Failed to update summary:",z)}catch(z){console.error("Error updating summary:",z)}return de(!1)};return d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:d.jsx(yx,{className:"h-4 w-4"})}),d.jsx(Kn,{open:K,onOpenChange:Z,children:d.jsxs(Nn,{className:"max-w-3xl max-h-[80vh]",children:[d.jsx(Pn,{children:d.jsx(On,{children:"Nội dung chi tiết"})}),d.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:d.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:te})})]})}),d.jsxs(Kn,{open:ce,onOpenChange:Te=>{ve(Te),Te?J({content:ee.original.content,note:ee.original.note}):J()},children:[d.jsx(gc,{asChild:!0,children:d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>ve(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),d.jsx(Nn,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:d.jsxs(Pn,{className:"flex flex-col gap-3",children:[d.jsx(On,{className:"max-sm:hidden text-center",children:"Sửa summary"}),d.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:G(Ne),children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Nội dung:"}),d.jsx(vc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.answer||"",rows:10,...re("content")})]}),d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Ghi chú:"}),d.jsx(vc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.note||"",rows:1,...re("note")})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Fe,{disabled:q,type:"submit",variant:"default",children:q?d.jsx(St,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),d.jsx(Fe,{variant:"outline",size:"sm",onClick:Ce,disabled:be,className:"w-[70px] px-2 py-0.5 h-7",children:be?d.jsx(St,{className:"h-4 w-4 animate-spin"}):U==="unpublish"?"Publish":"Unpublish"})]})}}],[]),T=fx({data:e,columns:O,state:{columnFilters:a},enableRowSelection:!0,onColumnFiltersChange:s,getFilteredRowModel:PM(),getCoreRowModel:ux()});return d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:d.jsxs("div",{className:"relative max-w-sm",children:[d.jsx(Gn,{placeholder:"Tìm kiếm theo mã...",value:y,onChange:W=>C(W.target.value),className:"pr-8"}),y&&d.jsx(Fe,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>C(""),children:d.jsx(dg,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Jd,{className:"s3-explr-table",children:[d.jsx(Qd,{className:"s3-explr-table-header",children:T.getHeaderGroups().map(W=>d.jsx(zr,{className:"hover:bg-transparent s3-explr-header-row",children:W.headers.map(ee=>d.jsx(lo,{className:"s3-explr-header-cell",children:ee.isPlaceholder?null:Rd(ee.column.columnDef.header,ee.getContext())},ee.id))},W.id))}),d.jsx(Xd,{className:"s3-explr-table-body",children:r?d.jsx(zr,{children:d.jsx(jn,{colSpan:O.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(L=T.getRowModel().rows)!=null&&L.length?(H=T.getRowModel().rows)==null?void 0:H.map(W=>d.jsx(zr,{className:"h-12 s3-explr-row",children:W.getVisibleCells().map(ee=>d.jsx(jn,{className:"align-middle s3-explr-cell",children:Rd(ee.column.columnDef.cell,ee.getContext())},ee.id))},W.id)):d.jsx(zr,{children:d.jsx(jn,{colSpan:O.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Br,{children:d.jsx(Wd,{onClick:()=>u(W=>Math.max(1,W-1)),className:l===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:h},(W,ee)=>ee+1).filter(W=>W===1||W===h||Math.abs(W-l)<=1).map((W,ee,q)=>d.jsxs(d.Fragment,{children:[ee>0&&q[ee-1]!==W-1&&d.jsx(Br,{children:d.jsx(Yd,{})},W+"..."),d.jsx(Br,{children:d.jsx(Ya,{onClick:()=>u(W),isActive:l===W,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===W?d.jsx(St,{className:"h-4 w-4 animate-spin"}):W})},W)]})),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>u(W=>Math.min(h,W+1)),className:l===h||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},v0=10,z3=M.memo(({apiBaseUrl:t="http://localhost:3000"})=>{const[e,n]=M.useState(1),[r,o]=M.useState([]),[a,s]=M.useState({total:0,page:1,limit:v0,totalPages:1}),[l,u]=M.useState(!0),[h,p]=M.useState(null),[g,w]=M.useState(new Set),{toast:y}=bc(),[C,v]=M.useState(!1),b=async T=>{try{p(T);const L=await Le.get(`${t}/api/jobs`,{params:{page:T.toString(),limit:v0.toString()}});o(L.data.data),s(L.data.pagination)}catch{y({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{p(null),u(!1)}};M.useEffect(()=>{b(e)},[e,t]);const k=async T=>{w(L=>new Set(L).add(T.toString()));try{await Le.post(`${t}/api/retry-job`,{jobId:T}),y({title:"Job Restarted",description:`Job ${T} has been successfully restarted.`}),b(e)}catch{y({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${T}. Please try again.`})}finally{w(L=>{const H=new Set(L);return H.delete(T.toString()),H})}},A=async()=>{v(!0),n(1),await b(1),v(!1)},N=T=>new Date(T).toLocaleString(),O=T=>{if(T=parseFloat(T),T<60)return`${T.toFixed(2)}s`;const L=Math.floor(T/60),H=(T%60).toFixed(0);return`${L}m ${H}s`};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[d.jsx(HM,{className:"w-8 h-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),d.jsx(Fe,{variant:"outline",size:"icon",onClick:A,disabled:C||l,className:"ml-2",children:d.jsx(YM,{className:`h-4 w-4 ${C?"animate-spin":""}`})})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Jd,{children:[d.jsx(Qd,{children:d.jsxs(zr,{children:[d.jsx(lo,{children:"ID"}),d.jsx(lo,{children:"Tên Công Việc"}),d.jsx(lo,{children:"Thời Gian Bắt Đầu"}),d.jsx(lo,{children:"Thời Gian Cập Nhật"}),d.jsx(lo,{children:"Thời Gian Thực Thi"}),d.jsx(lo,{children:"Trạng Thái"}),d.jsx(lo,{children:"Thao Tác"})]})}),d.jsx(Xd,{children:l&&r.length===0?d.jsx(zr,{children:d.jsx(jn,{colSpan:7,className:"text-center py-4",children:d.jsx(St,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(T=>{var L,H;return d.jsxs(zr,{children:[d.jsx(jn,{className:"!w-[100px]",children:T.id}),d.jsx(jn,{className:"font-medium",children:(L=T.job_name)==null?void 0:L.replace("Upload file","Summary")}),d.jsx(jn,{className:"!w-[200px]",children:N(T.created_at)}),d.jsx(jn,{className:"!w-[200px]",children:N(T.updated_at)}),d.jsx(jn,{className:"!w-[150px]",children:O(T.execution_time_seconds)}),d.jsx(jn,{className:"!w-[200px]",children:d.jsx(m0,{content:T.status==="fail"&&T.error?d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:T.error}):null,children:d.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
239
- ${T.status==="done"?"bg-green-100 text-green-800":T.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:T.status==="fail"?"FAILED":(H=T.status)==null?void 0:H.toUpperCase()})})}),d.jsx(jn,{className:"!w-[200px]",children:T.status==="fail"?d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>k(T.id),disabled:g.has(T.id.toString()),className:"h-[32px]",children:g.has(T.id.toString())?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):d.jsx("div",{className:"h-[32px]"})})]},T.id)})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Br,{children:d.jsx(Wd,{onClick:()=>n(T=>Math.max(1,T-1)),className:e===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:a.totalPages},(T,L)=>L+1).filter(T=>T===1||T===a.totalPages||Math.abs(T-e)<=1).map((T,L,H)=>d.jsxs(d.Fragment,{children:[L>0&&H[L-1]!==T-1&&d.jsx(Br,{children:d.jsx(Yd,{})},T+"..."),d.jsx(Br,{children:d.jsx(Ya,{onClick:()=>n(T),isActive:e===T,className:`cursor-pointer ${h!==null?"pointer-events-none":""}`,children:h===T?d.jsx(St,{className:"h-4 w-4 animate-spin"}):T})},T)]})),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>n(T=>Math.min(a.totalPages,T+1)),className:e===a.totalPages||h!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),d.jsx(H_,{})]})});Or.Job=z3,Or.S3Explorer=g3,Or.Summary=B3,Object.defineProperty(Or,Symbol.toStringTag,{value:"Module"})});
237
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lE(t,e){if(t){if(typeof t=="string")return Tm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tm(t,e)}}function Tm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wH(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,a=!1,s,l;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(u){a=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw l}}return r}}function bH(t){if(Array.isArray(t))return t}function dE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ht(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?dE(Object(n),!0).forEach(function(r){Em(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dE(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Em(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mu(t,e){if(t==null)return{};var n=CH(t,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function CH(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var Am=M.forwardRef(function(t,e){var n=t.children,r=Mu(t,dH),o=fE(r),a=o.open,s=Mu(o,uH);return M.useImperativeHandle(e,function(){return{open:a}},[a]),M.createElement(M.Fragment,null,n(Ht(Ht({},s),{},{open:a})))});Am.displayName="Dropzone";var uE={disabled:!1,getFilesFromEvent:M$,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Am.defaultProps=uE,Am.propTypes={children:Pt.func,accept:Pt.objectOf(Pt.arrayOf(Pt.string)),multiple:Pt.bool,preventDropOnDocument:Pt.bool,noClick:Pt.bool,noKeyboard:Pt.bool,noDrag:Pt.bool,noDragEventsBubbling:Pt.bool,minSize:Pt.number,maxSize:Pt.number,maxFiles:Pt.number,disabled:Pt.bool,getFilesFromEvent:Pt.func,onFileDialogCancel:Pt.func,onFileDialogOpen:Pt.func,useFsAccessApi:Pt.bool,autoFocus:Pt.bool,onDragEnter:Pt.func,onDragLeave:Pt.func,onDragOver:Pt.func,onDrop:Pt.func,onDropAccepted:Pt.func,onDropRejected:Pt.func,onError:Pt.func,validator:Pt.func};var Im={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Ht(Ht({},uE),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,a=e.maxSize,s=e.minSize,l=e.multiple,u=e.maxFiles,h=e.onDragEnter,p=e.onDragLeave,g=e.onDragOver,w=e.onDrop,y=e.onDropAccepted,C=e.onDropRejected,v=e.onFileDialogCancel,b=e.onFileDialogOpen,k=e.useFsAccessApi,A=e.autoFocus,N=e.preventDropOnDocument,O=e.noClick,T=e.noKeyboard,L=e.noDrag,H=e.noDragEventsBubbling,W=e.onError,ee=e.validator,q=M.useMemo(function(){return sH(n)},[n]),de=M.useMemo(function(){return aH(n)},[n]),ce=M.useMemo(function(){return typeof b=="function"?b:hE},[b]),ve=M.useMemo(function(){return typeof v=="function"?v:hE},[v]),K=M.useRef(null),Z=M.useRef(null),G=M.useReducer(xH,Im),re=Sm(G,2),J=re[0],X=re[1],U=J.isFocused,te=J.isFileDialogActive,be=M.useRef(typeof window<"u"&&window.isSecureContext&&k&&iH()),Ee=function(){!be.current&&te&&setTimeout(function(){if(Z.current){var ne=Z.current.files;ne.length||(X({type:"closeDialog"}),ve())}},300)};M.useEffect(function(){return window.addEventListener("focus",Ee,!1),function(){window.removeEventListener("focus",Ee,!1)}},[Z,te,ve,be]);var Ce=M.useRef([]),Ne=function(ne){K.current&&K.current.contains(ne.target)||(ne.preventDefault(),Ce.current=[])};M.useEffect(function(){return N&&(document.addEventListener("dragover",aE,!1),document.addEventListener("drop",Ne,!1)),function(){N&&(document.removeEventListener("dragover",aE),document.removeEventListener("drop",Ne))}},[K,N]),M.useEffect(function(){return!r&&A&&K.current&&K.current.focus(),function(){}},[K,A,r]);var Te=M.useCallback(function(Q){W?W(Q):console.error(Q)},[W]),z=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q),Ce.current=[].concat(pH(Ce.current),[Q.target]),Ou(Q)&&Promise.resolve(o(Q)).then(function(ne){if(!(Pu(Q)&&!H)){var ke=ne.length,$e=ke>0&&tH({files:ne,accept:q,minSize:s,maxSize:a,multiple:l,maxFiles:u,validator:ee}),Be=ke>0&&!$e;X({isDragAccept:$e,isDragReject:Be,isDragActive:!0,type:"setDraggedFiles"}),h&&h(Q)}}).catch(function(ne){return Te(ne)})},[o,h,Te,H,q,s,a,l,u,ee]),ue=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q);var ne=Ou(Q);if(ne&&Q.dataTransfer)try{Q.dataTransfer.dropEffect="copy"}catch{}return ne&&g&&g(Q),!1},[g,H]),Ae=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q);var ne=Ce.current.filter(function($e){return K.current&&K.current.contains($e)}),ke=ne.indexOf(Q.target);ke!==-1&&ne.splice(ke,1),Ce.current=ne,!(ne.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ou(Q)&&p&&p(Q))},[K,p,H]),xe=M.useCallback(function(Q,ne){var ke=[],$e=[];Q.forEach(function(Be){var Mt=oE(Be,q),tn=Sm(Mt,2),zt=tn[0],yo=tn[1],jt=iE(Be,s,a),vn=Sm(jt,2),Jr=vn[0],Vt=vn[1],pr=ee?ee(Be):null;if(zt&&Jr&&!pr)ke.push(Be);else{var Qr=[yo,Vt];pr&&(Qr=Qr.concat(pr)),$e.push({file:Be,errors:Qr.filter(function(ea){return ea})})}}),(!l&&ke.length>1||l&&u>=1&&ke.length>u)&&(ke.forEach(function(Be){$e.push({file:Be,errors:[eH]})}),ke.splice(0)),X({acceptedFiles:ke,fileRejections:$e,isDragReject:$e.length>0,type:"setFiles"}),w&&w(ke,$e,ne),$e.length>0&&C&&C($e,ne),ke.length>0&&y&&y(ke,ne)},[X,l,q,s,a,u,w,y,C,ee]),Pe=M.useCallback(function(Q){Q.preventDefault(),Q.persist(),R(Q),Ce.current=[],Ou(Q)&&Promise.resolve(o(Q)).then(function(ne){Pu(Q)&&!H||xe(ne,Q)}).catch(function(ne){return Te(ne)}),X({type:"reset"})},[o,xe,Te,H]),ae=M.useCallback(function(){if(be.current){X({type:"openDialog"}),ce();var Q={multiple:l,types:de};window.showOpenFilePicker(Q).then(function(ne){return o(ne)}).then(function(ne){xe(ne,null),X({type:"closeDialog"})}).catch(function(ne){cH(ne)?(ve(ne),X({type:"closeDialog"})):lH(ne)?(be.current=!1,Z.current?(Z.current.value=null,Z.current.click()):Te(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Te(ne)});return}Z.current&&(X({type:"openDialog"}),ce(),Z.current.value=null,Z.current.click())},[X,ce,ve,k,xe,Te,de,l]),Ze=M.useCallback(function(Q){!K.current||!K.current.isEqualNode(Q.target)||(Q.key===" "||Q.key==="Enter"||Q.keyCode===32||Q.keyCode===13)&&(Q.preventDefault(),ae())},[K,ae]),nt=M.useCallback(function(){X({type:"focus"})},[]),Tt=M.useCallback(function(){X({type:"blur"})},[]),ln=M.useCallback(function(){O||(oH()?setTimeout(ae,0):ae())},[O,ae]),Ot=function(ne){return r?null:ne},mn=function(ne){return T?null:Ot(ne)},en=function(ne){return L?null:Ot(ne)},R=function(ne){H&&ne.stopPropagation()},Y=M.useMemo(function(){return function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=Q.refKey,ke=ne===void 0?"ref":ne,$e=Q.role,Be=Q.onKeyDown,Mt=Q.onFocus,tn=Q.onBlur,zt=Q.onClick,yo=Q.onDragEnter,jt=Q.onDragOver,vn=Q.onDragLeave,Jr=Q.onDrop,Vt=Mu(Q,fH);return Ht(Ht(Em({onKeyDown:mn(mo(Be,Ze)),onFocus:mn(mo(Mt,nt)),onBlur:mn(mo(tn,Tt)),onClick:Ot(mo(zt,ln)),onDragEnter:en(mo(yo,z)),onDragOver:en(mo(jt,ue)),onDragLeave:en(mo(vn,Ae)),onDrop:en(mo(Jr,Pe)),role:typeof $e=="string"&&$e!==""?$e:"presentation"},ke,K),!r&&!T?{tabIndex:0}:{}),Vt)}},[K,Ze,nt,Tt,ln,z,ue,Ae,Pe,T,L,r]),se=M.useCallback(function(Q){Q.stopPropagation()},[]),Ie=M.useMemo(function(){return function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=Q.refKey,ke=ne===void 0?"ref":ne,$e=Q.onChange,Be=Q.onClick,Mt=Mu(Q,hH),tn=Em({accept:q,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Ot(mo($e,Pe)),onClick:Ot(mo(Be,se)),tabIndex:-1},ke,Z);return Ht(Ht({},tn),Mt)}},[Z,n,l,Pe,r]);return Ht(Ht({},J),{},{isFocused:U&&!r,getRootProps:Y,getInputProps:Ie,rootRef:K,inputRef:Z,open:Ot(ae)})}function xH(t,e){switch(e.type){case"focus":return Ht(Ht({},t),{},{isFocused:!0});case"blur":return Ht(Ht({},t),{},{isFocused:!1});case"openDialog":return Ht(Ht({},Im),{},{isFileDialogActive:!0});case"closeDialog":return Ht(Ht({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ht(Ht({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Ht(Ht({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections,isDragReject:e.isDragReject});case"reset":return Ht({},Im);default:return t}}function hE(){}const _H=({onFilesSelected:t,children:e})=>{const[n,r]=M.useState(!1),{getRootProps:o,getInputProps:a}=fE({noClick:!0,onDrop:s=>{if(s&&s.length>0)if(s[0].path.split("/").length>2){const u=s.map(h=>{const g=(h.path||h.relativePath||"").split("/").slice(1).join("/");return(!h.webkitRelativePath||h.webkitRelativePath==="")&&Object.defineProperty(h,"webkitRelativePath",{writable:!0,value:g,enumerable:!0,configurable:!0}),h});t(u,"folder")}else t(s,"files");r(!1)},onDragOver:s=>{s.preventDefault(),n||r(!0)},multiple:!0});return M.useEffect(()=>{const s=l=>{l.clientX===0&&l.clientY===0&&r(!1)};return document.addEventListener("dragleave",s),()=>{document.removeEventListener("dragleave",s)}},[]),d.jsxs("div",{...o(),className:"transition-opacity min-h-[600px]",children:[n?d.jsx("div",{className:"flex flex-col items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg bg-gray-50 h-screen"}):e,d.jsx("input",{...a()})]})},SH=({openDialogRename:t,setOpenDialogRename:e,apiBaseUrl:n,setFileToMove:r,fileToMove:o,refreshFiles:a,ignoreCache:s,autoSyncAfterFileOperation:l})=>{var N;const[u,h]=M.useState({}),[p,g]=M.useState(!1),[w,y]=M.useState(!1),[C,v]=M.useState(""),{toast:b}=bc();M.useEffect(()=>{t&&k(C)},[C,t]);const k=async O=>{try{y(!0);const T=await Le.get(`${n}/api/list-s3-folders?prefix=${O}`);h(T==null?void 0:T.data)}catch{b({title:"Error",description:"Unable to load S3 folder list",variant:"destructive"})}finally{y(!1)}},A=async()=>{g(!0);try{const O=o.key,T=O.endsWith("/")?O:`${O}/`,L=C.endsWith("/")?C:`${C}/`;if(T===L||O===C){b({title:"Lỗi",description:"Không thể di chuyển file đến cùng vị trí",variant:"destructive"}),g(!1);return}await Le.post(`${n}/api/move`,{oldPath:O,newPath:C}),s.current=!0,await a(),b({title:"Đã di chuyển",description:`Đã di chuyển thành công "${o.name}" đến "${C}"`}),e(!1),r(null),v(""),l&&await l("move")}catch(O){console.error("Error renaming item:",O),b({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{g(!1)}};return d.jsx(Vn,{open:t,onOpenChange:O=>{O||(e(!1),r(null),v(""))},children:d.jsxs(Nn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[d.jsxs(Pn,{className:"mb-4 w-full h-full",children:[d.jsx("nav",{className:"mb-4",children:d.jsxs("ul",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(""),children:"Root"}),C.split("/").map((O,T,L)=>d.jsx("li",{className:"cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>v(O==="Root"?"":L.slice(0,T+1).join("/")+"/"),children:O},T))]})}),d.jsxs(On,{className:"text-xl font-semibold text-gray-800",children:["Di chuyển"," ",d.jsxs("span",{className:"text-sm text-gray-500",children:["( file hoặc folder sẽ được di chuyển đến thư mục"," ",C===""?"Root":C," )"]})]}),d.jsx(Do,{className:"text-gray-600 w-full h-[50dvh] max-h-[500px] overflow-hidden overflow-y-auto",children:w?d.jsx("div",{className:"flex justify-center items-center py-4",children:d.jsx("div",{className:"loader ease-linear rounded-full border-4 border-t-4 border-gray-200 h-12 w-12"})}):d.jsx("ul",{className:"space-y-2",children:(N=Object.keys(u))==null?void 0:N.map(O=>d.jsx("li",{className:"cursor-pointer hover:bg-gray-100 p-2 rounded transition-colors",onClick:()=>v(O),children:O},O))})})]}),d.jsxs(_r,{className:"flex justify-end space-x-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>e(!1),className:"px-4 py-2 rounded border border-gray-300 text-gray-700 hover:bg-gray-100 transition-colors",children:"Cancel"}),d.jsx(Fe,{onClick:A,disabled:p,className:"s3-explr-crawl-btn",children:"Move"})]})]})})};function pE(t,[e,n]){return Math.min(n,Math.max(e,t))}var TH=[" ","Enter","ArrowUp","ArrowDown"],EH=[" ","Enter"],Yi="Select",[Du,Ru,AH]=bg(Yi),[is]=Io(Yi,[AH,mu]),Lu=mu(),[IH,wi]=is(Yi),[kH,NH]=is(Yi),gE=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:a,value:s,defaultValue:l,onValueChange:u,dir:h,name:p,autoComplete:g,disabled:w,required:y,form:C}=t,v=Lu(e),[b,k]=x.useState(null),[A,N]=x.useState(null),[O,T]=x.useState(!1),L=Cg(h),[H,W]=li({prop:r,defaultProp:o??!1,onChange:a,caller:Yi}),[ee,q]=li({prop:s,defaultProp:l,onChange:u,caller:Yi}),de=x.useRef(null),ce=b?C||!!b.closest("form"):!0,[ve,K]=x.useState(new Set),Z=Array.from(ve).map(G=>G.props.value).join(";");return d.jsx(wS,{...v,children:d.jsxs(IH,{required:y,scope:e,trigger:b,onTriggerChange:k,valueNode:A,onValueNodeChange:N,valueNodeHasChildren:O,onValueNodeHasChildrenChange:T,contentId:ko(),value:ee,onValueChange:q,open:H,onOpenChange:W,dir:L,triggerPointerDownPosRef:de,disabled:w,children:[d.jsx(Du.Provider,{scope:e,children:d.jsx(kH,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(G=>{K(re=>new Set(re).add(G))},[]),onNativeOptionRemove:x.useCallback(G=>{K(re=>{const J=new Set(re);return J.delete(G),J})},[]),children:n})}),ce?d.jsxs(FE,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:ee,onChange:G=>q(G.target.value),disabled:w,form:C,children:[ee===void 0?d.jsx("option",{value:""}):null,Array.from(ve)]},Z):null]})})};gE.displayName=Yi;var mE="SelectTrigger",vE=x.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,a=Lu(n),s=wi(mE,n),l=s.disabled||r,u=kt(e,s.onTriggerChange),h=Ru(n),p=x.useRef("touch"),[g,w,y]=$E(v=>{const b=h().filter(N=>!N.disabled),k=b.find(N=>N.value===s.value),A=HE(b,v,k);A!==void 0&&s.onValueChange(A.value)}),C=v=>{l||(s.onOpenChange(!0),y()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return d.jsx(bS,{asChild:!0,...a,children:d.jsx(tt.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":UE(s.value)?"":void 0,...o,ref:u,onClick:Ke(o.onClick,v=>{v.currentTarget.focus(),p.current!=="mouse"&&C(v)}),onPointerDown:Ke(o.onPointerDown,v=>{p.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(C(v),v.preventDefault())}),onKeyDown:Ke(o.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&w(v.key),!(b&&v.key===" ")&&TH.includes(v.key)&&(C(),v.preventDefault())})})})});vE.displayName=mE;var yE="SelectValue",wE=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:s="",...l}=t,u=wi(yE,n),{onValueNodeHasChildrenChange:h}=u,p=a!==void 0,g=kt(e,u.onValueNodeChange);return gn(()=>{h(p)},[h,p]),d.jsx(tt.span,{...l,ref:g,style:{pointerEvents:"none"},children:UE(u.value)?d.jsx(d.Fragment,{children:s}):a})});wE.displayName=yE;var PH="SelectIcon",bE=x.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return d.jsx(tt.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});bE.displayName=PH;var OH="SelectPortal",CE=t=>d.jsx(oc,{asChild:!0,...t});CE.displayName=OH;var Ji="SelectContent",xE=x.forwardRef((t,e)=>{const n=wi(Ji,t.__scopeSelect),[r,o]=x.useState();if(gn(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?$s.createPortal(d.jsx(_E,{scope:t.__scopeSelect,children:d.jsx(Du.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),a):null}return d.jsx(SE,{...t,ref:e})});xE.displayName=Ji;var Wr=10,[_E,bi]=is(Ji),MH="SelectContentImpl",DH=Ha("SelectContent.RemoveScroll"),SE=x.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:v,avoidCollisions:b,...k}=t,A=wi(Ji,n),[N,O]=x.useState(null),[T,L]=x.useState(null),H=kt(e,z=>O(z)),[W,ee]=x.useState(null),[q,de]=x.useState(null),ce=Ru(n),[ve,K]=x.useState(!1),Z=x.useRef(!1);x.useEffect(()=>{if(N)return DC(N)},[N]),vC();const G=x.useCallback(z=>{const[ue,...Ae]=ce().map(ae=>ae.ref.current),[xe]=Ae.slice(-1),Pe=document.activeElement;for(const ae of z)if(ae===Pe||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===ue&&T&&(T.scrollTop=0),ae===xe&&T&&(T.scrollTop=T.scrollHeight),ae==null||ae.focus(),document.activeElement!==Pe))return},[ce,T]),re=x.useCallback(()=>G([W,N]),[G,W,N]);x.useEffect(()=>{ve&&re()},[ve,re]);const{onOpenChange:J,triggerPointerDownPosRef:X}=A;x.useEffect(()=>{if(N){let z={x:0,y:0};const ue=xe=>{var Pe,ae;z={x:Math.abs(Math.round(xe.pageX)-(((Pe=X.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((ae=X.current)==null?void 0:ae.y)??0))}},Ae=xe=>{z.x<=10&&z.y<=10?xe.preventDefault():N.contains(xe.target)||J(!1),document.removeEventListener("pointermove",ue),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[N,J,X]),x.useEffect(()=>{const z=()=>J(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[J]);const[U,te]=$E(z=>{const ue=ce().filter(Pe=>!Pe.disabled),Ae=ue.find(Pe=>Pe.ref.current===document.activeElement),xe=HE(ue,z,Ae);xe&&setTimeout(()=>xe.ref.current.focus())}),be=x.useCallback((z,ue,Ae)=>{const xe=!Z.current&&!Ae;(A.value!==void 0&&A.value===ue||xe)&&(ee(z),xe&&(Z.current=!0))},[A.value]),Ee=x.useCallback(()=>N==null?void 0:N.focus(),[N]),Ce=x.useCallback((z,ue,Ae)=>{const xe=!Z.current&&!Ae;(A.value!==void 0&&A.value===ue||xe)&&de(z)},[A.value]),Ne=r==="popper"?km:TE,Te=Ne===km?{side:l,sideOffset:u,align:h,alignOffset:p,arrowPadding:g,collisionBoundary:w,collisionPadding:y,sticky:C,hideWhenDetached:v,avoidCollisions:b}:{};return d.jsx(_E,{scope:n,content:N,viewport:T,onViewportChange:L,itemRefCallback:be,selectedItem:W,onItemLeave:Ee,itemTextRefCallback:Ce,focusSelectedItem:re,selectedItemText:q,position:r,isPositioned:ve,searchRef:U,children:d.jsx(Hp,{as:DH,allowPinchZoom:!0,children:d.jsx(Dp,{asChild:!0,trapped:A.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:Ke(o,z=>{var ue;(ue=A.trigger)==null||ue.focus({preventScroll:!0}),z.preventDefault()}),children:d.jsx(rc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:d.jsx(Ne,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:z=>z.preventDefault(),...k,...Te,onPlaced:()=>K(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ke(k.onKeyDown,z=>{const ue=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!ue&&z.key.length===1&&te(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let xe=ce().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(z.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const Pe=z.target,ae=xe.indexOf(Pe);xe=xe.slice(ae+1)}setTimeout(()=>G(xe)),z.preventDefault()}})})})})})})});SE.displayName=MH;var RH="SelectItemAlignedPosition",TE=x.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,a=wi(Ji,n),s=bi(Ji,n),[l,u]=x.useState(null),[h,p]=x.useState(null),g=kt(e,H=>p(H)),w=Ru(n),y=x.useRef(!1),C=x.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:k,focusSelectedItem:A}=s,N=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&h&&v&&b&&k){const H=a.trigger.getBoundingClientRect(),W=h.getBoundingClientRect(),ee=a.valueNode.getBoundingClientRect(),q=k.getBoundingClientRect();if(a.dir!=="rtl"){const Pe=q.left-W.left,ae=ee.left-Pe,Ze=H.left-ae,nt=H.width+Ze,Tt=Math.max(nt,W.width),ln=window.innerWidth-Wr,Ot=pE(ae,[Wr,Math.max(Wr,ln-Tt)]);l.style.minWidth=nt+"px",l.style.left=Ot+"px"}else{const Pe=W.right-q.right,ae=window.innerWidth-ee.right-Pe,Ze=window.innerWidth-H.right-ae,nt=H.width+Ze,Tt=Math.max(nt,W.width),ln=window.innerWidth-Wr,Ot=pE(ae,[Wr,Math.max(Wr,ln-Tt)]);l.style.minWidth=nt+"px",l.style.right=Ot+"px"}const de=w(),ce=window.innerHeight-Wr*2,ve=v.scrollHeight,K=window.getComputedStyle(h),Z=parseInt(K.borderTopWidth,10),G=parseInt(K.paddingTop,10),re=parseInt(K.borderBottomWidth,10),J=parseInt(K.paddingBottom,10),X=Z+G+ve+J+re,U=Math.min(b.offsetHeight*5,X),te=window.getComputedStyle(v),be=parseInt(te.paddingTop,10),Ee=parseInt(te.paddingBottom,10),Ce=H.top+H.height/2-Wr,Ne=ce-Ce,Te=b.offsetHeight/2,z=b.offsetTop+Te,ue=Z+G+z,Ae=X-ue;if(ue<=Ce){const Pe=de.length>0&&b===de[de.length-1].ref.current;l.style.bottom="0px";const ae=h.clientHeight-v.offsetTop-v.offsetHeight,Ze=Math.max(Ne,Te+(Pe?Ee:0)+ae+re),nt=ue+Ze;l.style.height=nt+"px"}else{const Pe=de.length>0&&b===de[0].ref.current;l.style.top="0px";const Ze=Math.max(Ce,Z+v.offsetTop+(Pe?be:0)+Te)+Ae;l.style.height=Ze+"px",v.scrollTop=ue-Ce+v.offsetTop}l.style.margin=`${Wr}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=ce+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[w,a.trigger,a.valueNode,l,h,v,b,k,a.dir,r]);gn(()=>N(),[N]);const[O,T]=x.useState();gn(()=>{h&&T(window.getComputedStyle(h).zIndex)},[h]);const L=x.useCallback(H=>{H&&C.current===!0&&(N(),A==null||A(),C.current=!1)},[N,A]);return d.jsx(FH,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:L,children:d.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:d.jsx(tt.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});TE.displayName=RH;var LH="SelectPopperPosition",km=x.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Wr,...a}=t,s=Lu(n);return d.jsx(CS,{...s,...a,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.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)"}})});km.displayName=LH;var[FH,Nm]=is(Ji,{}),Pm="SelectViewport",EE=x.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,a=bi(Pm,n),s=Nm(Pm,n),l=kt(e,a.onViewportChange),u=x.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Du.Slot,{scope:n,children:d.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ke(o.onScroll,h=>{const p=h.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:w}=s;if(w!=null&&w.current&&g){const y=Math.abs(u.current-p.scrollTop);if(y>0){const C=window.innerHeight-Wr*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),k=Math.max(v,b);if(k<C){const A=k+y,N=Math.min(C,A),O=A-N;g.style.height=N+"px",g.style.bottom==="0px"&&(p.scrollTop=O>0?O:0,g.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});EE.displayName=Pm;var AE="SelectGroup",[UH,$H]=is(AE),HH=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=ko();return d.jsx(UH,{scope:n,id:o,children:d.jsx(tt.div,{role:"group","aria-labelledby":o,...r,ref:e})})});HH.displayName=AE;var IE="SelectLabel",kE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=$H(IE,n);return d.jsx(tt.div,{id:o.id,...r,ref:e})});kE.displayName=IE;var Fu="SelectItem",[BH,NE]=is(Fu),PE=x.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...s}=t,l=wi(Fu,n),u=bi(Fu,n),h=l.value===r,[p,g]=x.useState(a??""),[w,y]=x.useState(!1),C=kt(e,A=>{var N;return(N=u.itemRefCallback)==null?void 0:N.call(u,A,r,o)}),v=ko(),b=x.useRef("touch"),k=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(BH,{scope:n,value:r,disabled:o,textId:v,isSelected:h,onItemTextChange:x.useCallback(A=>{g(N=>N||((A==null?void 0:A.textContent)??"").trim())},[]),children:d.jsx(Du.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:d.jsx(tt.div,{role:"option","aria-labelledby":v,"data-highlighted":w?"":void 0,"aria-selected":h&&w,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:C,onFocus:Ke(s.onFocus,()=>y(!0)),onBlur:Ke(s.onBlur,()=>y(!1)),onClick:Ke(s.onClick,()=>{b.current!=="mouse"&&k()}),onPointerUp:Ke(s.onPointerUp,()=>{b.current==="mouse"&&k()}),onPointerDown:Ke(s.onPointerDown,A=>{b.current=A.pointerType}),onPointerMove:Ke(s.onPointerMove,A=>{var N;b.current=A.pointerType,o?(N=u.onItemLeave)==null||N.call(u):b.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(s.onPointerLeave,A=>{var N;A.currentTarget===document.activeElement&&((N=u.onItemLeave)==null||N.call(u))}),onKeyDown:Ke(s.onKeyDown,A=>{var O;((O=u.searchRef)==null?void 0:O.current)!==""&&A.key===" "||(EH.includes(A.key)&&k(),A.key===" "&&A.preventDefault())})})})})});PE.displayName=Fu;var Mc="SelectItemText",OE=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...a}=t,s=wi(Mc,n),l=bi(Mc,n),u=NE(Mc,n),h=NH(Mc,n),[p,g]=x.useState(null),w=kt(e,k=>g(k),u.onItemTextChange,k=>{var A;return(A=l.itemTextRefCallback)==null?void 0:A.call(l,k,u.value,u.disabled)}),y=p==null?void 0:p.textContent,C=x.useMemo(()=>d.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=h;return gn(()=>(v(C),()=>b(C)),[v,b,C]),d.jsxs(d.Fragment,{children:[d.jsx(tt.span,{id:u.textId,...a,ref:w}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?$s.createPortal(a.children,s.valueNode):null]})});OE.displayName=Mc;var ME="SelectItemIndicator",DE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return NE(ME,n).isSelected?d.jsx(tt.span,{"aria-hidden":!0,...r,ref:e}):null});DE.displayName=ME;var Om="SelectScrollUpButton",zH=x.forwardRef((t,e)=>{const n=bi(Om,t.__scopeSelect),r=Nm(Om,t.__scopeSelect),[o,a]=x.useState(!1),s=kt(e,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollTop>0;a(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(RE,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});zH.displayName=Om;var Mm="SelectScrollDownButton",VH=x.forwardRef((t,e)=>{const n=bi(Mm,t.__scopeSelect),r=Nm(Mm,t.__scopeSelect),[o,a]=x.useState(!1),s=kt(e,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const h=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<h;a(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?d.jsx(RE,{...t,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});VH.displayName=Mm;var RE=x.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,a=bi("SelectScrollButton",n),s=x.useRef(null),l=Ru(n),u=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>u(),[u]),gn(()=>{var p;const h=l().find(g=>g.ref.current===document.activeElement);(p=h==null?void 0:h.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),d.jsx(tt.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ke(o.onPointerMove,()=>{var h;(h=a.onItemLeave)==null||h.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ke(o.onPointerLeave,()=>{u()})})}),KH="SelectSeparator",LE=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return d.jsx(tt.div,{"aria-hidden":!0,...r,ref:e})});LE.displayName=KH;var Dm="SelectArrow",GH=x.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Lu(n),a=wi(Dm,n),s=bi(Dm,n);return a.open&&s.position==="popper"?d.jsx(xS,{...o,...r,ref:e}):null});GH.displayName=Dm;var jH="SelectBubbleInput",FE=x.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=x.useRef(null),a=kt(r,o),s=Lx(e);return x.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==e&&p){const g=new Event("change",{bubbles:!0});p.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(tt.select,{...n,style:{...h_,...n.style},ref:a,defaultValue:e})});FE.displayName=jH;function UE(t){return t===""||t===void 0}function $E(t){const e=xr(t),n=x.useRef(""),r=x.useRef(0),o=x.useCallback(s=>{const l=n.current+s;e(l),function u(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[e]),a=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function HE(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let s=WH(t,Math.max(a,0));o.length===1&&(s=s.filter(h=>h!==n));const u=s.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function WH(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var qH=gE,BE=vE,YH=wE,JH=bE,QH=CE,zE=xE,XH=EE,VE=kE,KE=PE,ZH=OE,e3=DE,GE=LE;const Rm=qH,Lm=YH,Uu=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(BE,{ref:r,className:Ge("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,d.jsx(JH,{asChild:!0,children:d.jsx(BM,{className:"h-4 w-4 opacity-50"})})]}));Uu.displayName=BE.displayName;const $u=x.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>d.jsx(QH,{children:d.jsx(zE,{ref:o,className:Ge("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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",t),position:n,...r,children:d.jsx(XH,{className:Ge("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));$u.displayName=zE.displayName;const t3=x.forwardRef(({className:t,...e},n)=>d.jsx(VE,{ref:n,className:Ge("px-2 py-1.5 text-sm font-semibold",t),...e}));t3.displayName=VE.displayName;const Qi=x.forwardRef(({className:t,children:e,...n},r)=>d.jsxs(KE,{ref:r,className:Ge("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(e3,{children:d.jsx(mx,{className:"h-4 w-4"})})}),d.jsx(ZH,{children:e})]}));Qi.displayName=KE.displayName;const n3=x.forwardRef(({className:t,...e},n)=>d.jsx(GE,{ref:n,className:Ge("-mx-1 my-1 h-px bg-muted",t),...e}));n3.displayName=GE.displayName;const Fm=[{value:"EDIT_DOCUMENT",label:"Chỉnh sửa"}];function r3({onClose:t,open:e,file:n,apiBaseUrl:r,rootUrlHostApi:o}){const[a,s]=M.useState("users"),[l,u]=M.useState(""),[h,p]=M.useState(""),[g,w]=M.useState(""),[y,C]=M.useState(""),[v,b]=M.useState(jr.VIEW_DOCUMENT),[k,A]=M.useState([]),{users:N,groups:O,sharedUsers:T,sharedGroups:L,fetchData:H,loading:W,postGranted:ee,loadingGrandted:q,setSharedGroups:de,setSharedUsers:ce}=w$(r,o),ve=Mo(),K=n?n.key:"",Z=N.filter(z=>{var ue;return(ve==null?void 0:ve.id)!==z.id&&(z.username.toLowerCase().includes(l.toLowerCase())||((ue=z.email)==null?void 0:ue.toLowerCase().includes(l.toLowerCase())))}),G=O.filter(z=>z.groupname.toLowerCase().includes(h.toLowerCase())),re=T.filter(z=>{var ue,Ae;return((ue=z.username)==null?void 0:ue.toLowerCase().includes(g.toLowerCase()))||((Ae=z.email)==null?void 0:Ae.toLowerCase().includes(g.toLowerCase()))}),J=L.filter(z=>{var ue;return(ue=z.groupname)==null?void 0:ue.toLowerCase().includes(y.toLowerCase())}),X=z=>{b(z),A(ue=>ue.map(Ae=>({...Ae,permissions:z})))},U=()=>{a==="users"?(u(""),w("")):(p(""),C(""),s("users")),A([]),b(jr.EDIT_DOCUMENT)};M.useEffect(()=>{e?H(K):U()},[e,K]);const te=z=>{z!==a&&(a==="users"?(u(""),w("")):(p(""),C(""))),s(z)},be=z=>{n&&A(ue=>{if(ue.find(ae=>ae.userId===z))return ue.filter(ae=>ae.userId!==z);const Pe={path:n.key+n.name,permissions:v,userId:z,grandtedBy:ve==null?void 0:ve.id};return[...ue,Pe]})},Ee=z=>{if(!n)return;const ue=z.groupname;A(Ae=>{if(Ae.find(Ze=>Ze.groupname===ue))return Ae.filter(Ze=>Ze.groupname!==ue);const ae={path:n.key+n.name,permissions:v,groupname:ue,groupId:z.id,grandtedBy:ve==null?void 0:ve.id,users:z.users};return[...Ae,ae]})},Ce=async(z,ue,Ae)=>{const xe={...z,permissions:ue};A(Pe=>{const ae=Pe.map(nt=>nt.id===xe.id?xe:nt);return Pe.some(nt=>nt.id===xe.id)||ae.push(xe),ae}),Ae==="users"?ce(Pe=>Pe.map(ae=>ae.id===z.id?xe:ae)):de(Pe=>Pe.map(ae=>ae.id===z.id?xe:ae))},Ne=async()=>{if(n){const z=(n==null?void 0:n.key)||""+(n==null?void 0:n.name),ue=await ee(z,ve==null?void 0:ve.id,k);(ue==null?void 0:ue.status)==200&&A([])}},Te="flex-1 min-h-0 overflow-y-auto border rounded-lg px-3 py-2 bg-background shadow-sm";return n?d.jsx(Vn,{open:e,onOpenChange:t,children:d.jsxs(Nn,{className:"max-w-5xl h-[80vh] flex flex-col overflow-hidden",children:[d.jsx(Pn,{children:d.jsxs(On,{className:"text-lg font-semibold",children:["Chia sẻ tài liệu: ",n.name]})}),d.jsxs(Tg,{defaultValue:"users",className:"flex-1 flex flex-col overflow-hidden",children:[d.jsxs(eu,{className:"grid grid-cols-2 w-1/2 mx-auto mb-4 bg-muted rounded-lg",children:[d.jsx(zi,{value:"users",className:"py-2",onClick:()=>te("users"),children:"Người dùng"}),d.jsx(zi,{value:"groups",className:"py-2",onClick:()=>te("groups"),children:"Nhóm"})]}),d.jsx(Vi,{value:"users",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với người dùng:"}),d.jsx(Kn,{placeholder:"Tìm người dùng...",className:"mb-3 border-input bg-background shadow-sm",value:l,onChange:z=>u(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):Z.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy người dùng."}):d.jsx("ul",{className:"space-y-2",children:Z.map(z=>d.jsx("li",{onClick:()=>be(z.id),className:"flex flex-col space-y-1 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsx(pc,{id:`user-${z.id}`,checked:!!k.find(ue=>ue.userId===z.id)}),d.jsxs(lr,{className:"flex-1",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]})]})},z.id))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với người dùng:"}),d.jsx(Kn,{placeholder:"Tìm người dùng đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:g,onChange:z=>w(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):re.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với người dùng nào."}):d.jsx("ul",{className:"space-y-2",children:re.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.username}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.email}),d.jsx("p",{className:"text-xs text-muted-foreground",children:z.groupname})]}),d.jsxs(Rm,{value:z.permissions,onValueChange:ue=>Ce(z,ue,"users"),disabled:z.permissions===jr.OWNER_DOCUMENT,children:[d.jsx(Uu,{className:"w-[120px]",children:d.jsx(Lm,{placeholder:"Chọn quyền"})}),d.jsxs($u,{children:[Fm.map(ue=>d.jsx(Qi,{value:ue.value,children:ue.label},ue.value)),z.permissions===jr.OWNER_DOCUMENT&&d.jsx(Qi,{value:jr.OWNER_DOCUMENT,children:"Chủ sở hữu"},jr.OWNER_DOCUMENT),d.jsx(Qi,{value:"None",children:"Thu hồi"},"None")]})]})]},z.id))})})]})]})}),d.jsx(Vi,{value:"groups",className:"flex-1 h-full min-h-0 overflow-hidden",children:d.jsxs("div",{className:"grid grid-cols-2 gap-6 h-full",children:[d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Chia sẻ với nhóm:"}),d.jsx(Kn,{placeholder:"Tìm nhóm...",className:"mb-3 border-input bg-background shadow-sm",value:h,onChange:z=>p(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):G.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Không tìm thấy nhóm."}):d.jsx("ul",{className:"space-y-2",children:G.map(z=>d.jsxs("li",{onClick:()=>Ee(z),className:"flex items-center space-x-3 cursor-pointer hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsx(pc,{id:`group-${z.groupname}`,checked:!!k.find(ue=>ue.groupname===z.groupname)}),d.jsxs(lr,{className:"font-medium",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]})]},z.groupname))})})]}),d.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[d.jsx("p",{className:"text-sm font-semibold mb-2",children:"Đã chia sẻ với nhóm:"}),d.jsx(Kn,{placeholder:"Tìm nhóm đã chia sẻ...",className:"mb-3 border-input bg-background shadow-sm",value:y,onChange:z=>C(z.target.value)}),d.jsx("div",{className:Te,children:W?d.jsx("div",{className:"flex items-center justify-center h-full",children:d.jsx(St,{className:"h-10 w-10 animate-spin text-muted-foreground"})}):J.length===0?d.jsx("p",{className:"text-muted-foreground italic text-center h-full flex items-center justify-center",children:"Chưa chia sẻ với nhóm nào."}):d.jsx("ul",{className:"space-y-2",children:J.map(z=>d.jsxs("li",{className:"flex items-center justify-between gap-4 hover:bg-accent p-2 rounded-md transition-colors",children:[d.jsxs("div",{className:"flex flex-col",children:[d.jsx("p",{className:"font-medium",children:z.groupname}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["Số lượng: ",z.users||0]})]}),d.jsxs(Rm,{value:z.permissions,onValueChange:ue=>Ce(z,ue,"groups"),children:[d.jsx(Uu,{className:"w-[120px]",children:d.jsx(Lm,{placeholder:"Chọn quyền"})}),d.jsxs($u,{children:[Fm.map(ue=>d.jsx(Qi,{value:ue.value,children:ue.label},ue.value)),d.jsx(Qi,{value:"None",children:"Thu hồi"},"None")]})]})]},z.groupname))})})]})]})})]}),d.jsxs("div",{className:"mt-4 bg-muted/50 p-4 rounded-lg",children:[d.jsx(lr,{className:"font-medium mb-2 block",children:"Phân quyền:"}),d.jsxs(Rm,{value:v,onValueChange:X,children:[d.jsx(Uu,{className:"w-1/2 border border-input bg-background shadow-sm hover:bg-accent",children:d.jsx(Lm,{placeholder:"Chọn quyền truy cập"})}),d.jsx($u,{children:Fm.map(z=>d.jsx(Qi,{value:z.value,className:"flex items-center gap-2",children:z.label}))})]})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:t,children:"Huỷ"}),d.jsx(Fe,{variant:"default",onClick:Ne,disabled:k.length===0||q,className:"w-[120px] justify-center",children:q?d.jsx(St,{className:"h-4 w-4 animate-spin"}):"Lưu thay đổi"})]})]})}):null}function jE({enabled:t,onChange:e}){const[n,r]=M.useState(t),o=async()=>{e(),r(a=>!a)};return d.jsx("button",{type:"button",onClick:o,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-300 ${n?"bg-green-500":"bg-gray-300 dark:bg-gray-600"}`,children:d.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform duration-300 ${n?"translate-x-5":"translate-x-1"}`})})}function WE({open:t,onClose:e,isPublic:n,onSave:r,file:o}){const[a,s]=M.useState(n);M.useEffect(()=>{s(n)},[n]);const l=()=>{r(a),e()};return o?d.jsx(Vn,{open:t,onOpenChange:e,children:d.jsxs(Nn,{className:"sm:max-w-[400px]",children:[d.jsx(Pn,{children:d.jsx(On,{children:"Chỉnh sửa quyền riêng tư"})}),d.jsxs(Do,{children:["Tài liệu: ",o.key]}),d.jsxs("div",{className:"flex items-center justify-between py-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[a?d.jsx(GM,{className:"text-green-500",size:20}):d.jsx(jM,{className:"text-gray-500",size:20}),d.jsx(lr,{children:a?"Công khai":"Riêng tư"})]}),d.jsx(jE,{enabled:a,onChange:()=>s(u=>!u)})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:e,children:"Hủy"}),d.jsx(Fe,{onClick:l,children:"Lưu thay đổi"})]})]})}):null}const o3="AIzaSyBI8KiTWudkw8iR5cjH7ZsA4JBN1NqJw8A",i3="726815747852-5deq413t8kd8j3mgj48d46eatjauapq5.apps.googleusercontent.com",a3="https://www.googleapis.com/auth/drive",fr={current:!1},qE="crawl:jobs",as="crawl:current_job",s3=t=>{const[e,n]=M.useState(null),[r,o]=M.useState(0);return M.useEffect(()=>{const a=localStorage.getItem(as);if(a){const s=JSON.parse(a);n(s),s!=null&&s.startTime&&o(Math.floor((Date.now()-s.startTime)/1e3))}},[]),M.useEffect(()=>{if(!(e!=null&&e.startTime))return;const a=setInterval(()=>{o(Math.floor((Date.now()-e.startTime)/1e3))},1e3);return()=>clearInterval(a)},[e==null?void 0:e.startTime]),M.useEffect(()=>{if(!(e!=null&&e.id))return;const a=async()=>{try{const u=(await Le.get(`${t}/api/crawl/${e.id}?taskId=${e.taskId}`)).data;n(h=>{if(!h)return null;const p={...h,status:u};return localStorage.setItem(as,JSON.stringify(p)),(u.status==="completed"||u.status==="failed")&&setTimeout(()=>{n(null),localStorage.removeItem(as)},100),p})}catch(l){console.error("Error polling job status:",l)}},s=setInterval(a,3e3);return a(),()=>clearInterval(s)},[e==null?void 0:e.id,t]),{currentJob:e,elapsedTime:r,setCurrentJob:a=>{a&&!a.startTime&&(a.startTime=Date.now()),n(a),a?localStorage.setItem(as,JSON.stringify(a)):localStorage.removeItem(as)}}},Hu=(t,e)=>{const n=[],r=o=>{(t[o]||[]).forEach(s=>{n.push(s.key),s.isFolder&&r(s.key)})};return r(e),n},c3=(t,e)=>{const n=[];return(t[e]||[]).forEach(o=>{n.push(o.key),o.isFolder&&n.push(...Hu(t,o.key))}),n},l3=(t,e,n=[],r,o,a,s,l,u,h)=>{const[p,g]=M.useState({}),[w,y]=M.useState(!1),[C,v]=M.useState(null),[b,k]=M.useState(0),A=M.useRef(e);M.useEffect(()=>{A.current=e},[e]);const N=async()=>{var T;y(!0);try{const L=Mo(),H=await Le.get(`${t}/api/files`,{params:{cache:!1,displayPrefixes:JSON.stringify(n),prefix:A.current,userId:(L==null?void 0:L.id)||"",groupId:((T=L==null?void 0:L.group)==null?void 0:T.id)||"",groupname:(L==null?void 0:L.groupname)||""},timeout:3e5}),W=[];Ud.forEach(H.data,(ee,q)=>{l!=null&&l.has(q)&&Ud.forEach(ee,de=>{(u==null?void 0:u.current[de.key])!==!1&&W.push(de.key)})}),W.length&&(h==null||h(ee=>{const q=new Set(ee);return W.forEach(de=>q.add(de)),q})),g(H.data),v(null)}catch(L){v(L instanceof Error?L:new Error("Failed to fetch files"))}finally{y(!1),k(0),a("")}},O=async T=>{var L,H;try{if(!T)return;y(!0);const W=await Le.get(`${t}/api/search-db?query=${T}&rootPrefix=${e}&offset=${(o-1)*20}&limit=20`,{timeout:3e5});return g({[e]:((L=W==null?void 0:W.data)==null?void 0:L.result)||[]}),k(((H=W==null?void 0:W.data)==null?void 0:H.estimatedTotalHits)||0),W}catch(W){v(W instanceof Error?W:new Error("Failed to fetch files"))}finally{y(!1)}};return M.useEffect(()=>{!r&&!w&&N(),r&&!w&&O(r)},[r,o]),{data:p,isLoading:w,error:C,estimatedTotalHits:b,refetch:N}},Xi=t=>{var r,o,a;const e=((a=(o=(r=t==null?void 0:t.name)==null?void 0:r.split("."))==null?void 0:o.pop())==null?void 0:a.toLowerCase())??"";return["txt","md","json","js","ts","jsx","tsx","css","html","xml","yaml","yml"].includes(e||"")},d3={auth:{clientId:"584d5fa9-5123-4602-a1a5-a3746a83745f",authority:"https://login.microsoftonline.com/consumers",redirectUri:"https://s3-explorer.cmcts1.studio.ai.vn/sharepoint/redirect"}},u3=new Ip(d3),Um={[jr.VIEW_DOCUMENT]:1,[jr.DOWNLOAD_DOCUMENT]:2,[jr.EDIT_DOCUMENT]:10,[jr.OWNER_DOCUMENT]:100},YE=()=>{const t=Mo();return`${t==null?void 0:t.groupname}`.toUpperCase()==="MASTER_ADMIN"},JE=()=>{const t=Mo();return`${t==null?void 0:t.groupname}`.toUpperCase()==="MASTER_ADMIN"||`${t==null?void 0:t.role}`.toUpperCase()==="ADMIN"||`${t==null?void 0:t.role}`.toUpperCase()==="SITE_ADMIN"},Bu=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=10:!1},f3=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=2:!1},h3=t=>{const e=Mo();return`${e==null?void 0:e.groupname}`.toUpperCase()==="MASTER_ADMIN"?!0:t?Um[t]>=1:!1},p3=M.memo(({homeLabel:t="Kho tài liệu",apiBaseUrl:e="http://localhost:3000",rootPrefix:n="",rootUrlHostApi:r="http://localhost:3003/api/v1/",asSelector:o=!1,onSelected:a=h=>console.log("Đã chọn:",h),displayPrefixes:s,preSelectedFiles:l,idCreator:u})=>{var pf;const[h,p]=M.useState([]),[g,w]=M.useState(""),[y,C]=M.useState(new Set(l)),[v,b]=M.useState(n),[k,A]=M.useState(""),[N,O]=M.useState(!1),[T,L]=M.useState(""),[H,W]=M.useState(!1),[ee,q]=M.useState(null),[de,ce]=M.useState(null),[ve,K]=M.useState(!1),[Z,G]=M.useState(!1),[,re]=M.useState(null),J=M.useRef(null),{toast:X}=bc(),[U,te]=M.useState(null),[be,Ee]=M.useState(null),[Ce,Ne]=M.useState(null),[Te,z]=M.useState(""),[ue,Ae]=M.useState(!1),[xe,Pe]=M.useState(!1),[ae,Ze]=M.useState(new Set),[nt,Tt]=M.useState(""),[ln,Ot]=M.useState(!1),[mn,en]=M.useState(!1),[R,Y]=M.useState("rename"),[se,Ie]=M.useState(!1),[Q,ne]=M.useState(""),[ke,$e]=M.useState("1"),[Be,Mt]=M.useState(!1),[tn,zt]=M.useState(!1),[yo,jt]=M.useState(!1),[vn,Jr]=M.useState(!1),[Vt,pr]=M.useState(1),[Qr,ea]=M.useState(!1),{currentJob:Xe,elapsedTime:$o,setCurrentJob:Uc}=s3(e),[wo,ta]=M.useState(null),[na,ls]=M.useState(""),[Gu,ra]=M.useState(!1),[ds,ju]=M.useState(""),[$c,Wu]=M.useState(!1),[Hc,qu]=M.useState(!1),[us,Yu]=M.useState([]),[oa,Ju]=M.useState(!1),[fs,Wm]=M.useState(""),Ho=M.useRef({}),[Bc,zc]=M.useState(null),[ia,hs]=M.useState(null),qm=async S=>{qu(!0);try{const P=await Le.get(`${r}get-knowledge-base/knowledge-base-name/${S}`,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjAyOTliMmIwLTk4MGEtNGQ1Yy04NjkyLWJjNjllM2I1NzZlMiIsInVzZXJuYW1lIjoiY21jX3RzX2FkbWluIiwiaWF0IjoxNzQ3MTk0MTg3fQ.7LB2rgd0fQnhZP_cFgTTCPMSYl0_apwffcNEd7oqjeM"}});P.status===200&&Yu(P.data.knowledgeBase.chatflows.map(B=>({...B,KnowledgeBaseId:P.data.knowledgeBase.knowledge_base_id})))}catch{}finally{qu(!1)}};M.useEffect(()=>{ds&&r&&qm(ds)},[ds]),M.useEffect(()=>{console.log("pre selected files",l)},[l]);const[Dt,Vc]=M.useState(null),[Kc,Ym]=M.useState(!1),[Gc,jc]=M.useState(!1),[Qu,ps]=M.useState(!1),[Wc,qc]=M.useState([]),[Yc,Xu]=M.useState([]),[gs,Jc]=M.useState([{id:"root",name:"OneDrive"}]),[Jm,aa]=M.useState(!1),[sa,Qc]=M.useState([]),[Xc,xi]=M.useState(!1),[Zc,_i]=M.useState([]),[el,Qm]=M.useState([]),[ms,tl]=M.useState([]),[vs,ys]=M.useState([{id:"root",name:"SharePoint"}]),[Bo,zo]=M.useState(!1),[ws,Si]=M.useState([]),[gt,ca]=M.useState(null),[Xm,bs]=M.useState(!1),[Zu,la]=M.useState(!1),[Sr,nl]=M.useState(!1),ef=new URL(window.location.href).searchParams.get("prefix")||""||k||n,[b0,Zm]=M.useState(null),{data:gr,isLoading:Cs,error:rl,estimatedTotalHits:da,refetch:dn}=l3(e,ef,s,g,Vt,w,u,y,Ho,C),[ol,bo]=M.useState(!1),il=M.useRef(null),mt=Mo(),ze=(()=>{const S=localStorage.getItem("dataLogin");try{if(S){const P=JSON.parse(S);return(P==null?void 0:P.user)??null}}catch{return null}return null})();M.useEffect(()=>{if(!ol)return;function S(P){il.current&&!il.current.contains(P.target)&&bo(!1)}return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[ol]);const ev=async()=>{try{const S=await Le.get(`${e}/api/login-sharepoint`),{loginUrl:P}=S.data,B=window.open(P,"SharePoint Login","width=600,height=600");if(!B)throw new Error("Không thể mở cửa sổ pop-up");B.focus();const fe=setInterval(()=>{try{if(B.closed){clearInterval(fe);return}const ye=B.location.href;if(ye.includes("code=")){const Se=new URL(ye).searchParams.get("code");Se&&(tf(Se),B.close(),clearInterval(fe))}}catch(ye){ye instanceof Error&&!ye.message.includes("cross-origin")&&console.error("SharePoint login error:",ye)}},1e3)}catch(S){lt.error("Lỗi khi đăng nhập SharePoint: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},tv=async()=>{try{_i([]),ys([{id:"root",name:"SharePoint"}]),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin),X({title:"Success",description:"Logged out from SharePoint"})}catch(S){console.error("Error logging out from SharePoint:",S),X({title:"Error",description:"Failed to logout from SharePoint",variant:"destructive"})}},tf=async S=>{try{const P=await Le.post(`${e}/api/get-sharepoint-access-token`,{code:S,userId:"1"}),{accessToken:B,refreshToken:fe}=P.data;localStorage.setItem("sharepoint_access_token",B),localStorage.setItem("refresh_sharepoint_access_token",fe),jc(!0),zo(!0)}catch(P){console.error("❌ Error fetching SharePoint access token:",P),X({title:"Error",description:"Failed to connect to SharePoint",variant:"destructive"})}},nv=async()=>{try{xi(!0);const P=(await Le.post(`${e}/api/list-site-sharepoint`,{userId:"1"})).data.sites.map(B=>{const fe=new URL(B.webUrl);return{id:B.id,name:B.name,description:B.description,hostname:B.hostname||fe.hostname,sitePath:B.sitePath||fe.pathname.replace(/^\/+/,"")}});console.log("data",P),Si(P),xi(!1)}catch(S){console.error("❌ Error fetching SharePoint sites:",S),X({title:"Error",description:"Failed to fetch SharePoint sites",variant:"destructive"}),xi(!1)}},rv=async S=>{ca(S),console.log(S),await xs("root",S.name,S.hostname||"",S.sitePath||"")},xs=async(S,P,B,fe)=>{try{xi(!0);const Se=(await Le.post(`${e}/api/list-file-sharepoint`,{folderId:S,userId:"1",hostname:B,sitePath:fe})).data.files.map(De=>({id:De.id,name:De.name,size:De.size??0,lastModified:De.lastModifiedDateTime?new Date(De.lastModifiedDateTime):new Date,contentType:De.mimeType??void 0,isFolder:De.type==="folder",parentId:De.parentId??""}));Qm(Se.filter(De=>De.isFolder)),_i(Se.filter(De=>!De.isFolder)),zo(!0),ys(De=>De.some(Ct=>Ct.id===S)?De:[...De,{id:S,name:P==="root"?"SharePoint":P}]),xi(!1)}catch(ye){console.error("❌ Error fetching SharePoint files:",ye),X({title:"Error",description:"Failed to fetch SharePoint files",variant:"destructive"}),xi(!1)}},nf=S=>{tl(P=>P.some(fe=>fe.id===S.id)?P.filter(fe=>fe.id!==S.id):[...P,{id:S.id,name:S.name,size:S.size,lastModified:S.lastModified,contentType:S.contentType,isFolder:S.isFolder,parentId:S.parentId}])},ov=S=>{var B;ys(fe=>fe.slice(0,S+1));const P=(B=vs[S])==null?void 0:B.id;P&&xs(P,"SharePoint",(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},nn=async(S,P)=>{const B=localStorage.getItem("sharepoint_access_token");if(!B){lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const fe=lt.loading("Đang đồng bộ SharePoint...",{position:"bottom-right",autoClose:!1});try{const ye={prefix:P,folders:[],files:[],hostname:(gt==null?void 0:gt.hostname)||"",sitePath:(gt==null?void 0:gt.sitePath)||"",isAutoUpdateKB:Sr,refreshAccessToken:localStorage.getItem("refresh_sharepoint_access_token")||""};S.forEach(De=>{De.isFolder?ye.folders.push({id:De.id,name:De.name}):ye.files.push({id:De.id,name:De.name})});const Se=await Le.post(`${e}/api/sync-sharepoint-to-s3`,ye,{headers:{Authorization:`Bearer ${B}`}});dn(),lt.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Se.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"}),zo(!1)}catch(ye){console.error("Lỗi khi đồng bộ file từ SharePoint:",ye),lt.update(fe,{render:"Không thể đồng bộ file từ SharePoint.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},_s=()=>{zo(!1),_i([]),tl([]),ys([{id:"root",name:"SharePoint"}])};M.useEffect(()=>{if(Bo){const P=new URLSearchParams(window.location.search).get("code");P&&(tf(P),window.history.replaceState({},document.title,window.location.pathname))}},[Bo]),M.useEffect(()=>{u3.initialize().then(()=>{Ym(!0)}).catch(S=>console.error("❌ Lỗi khởi tạo MSAL:",S))},[]),M.useEffect(()=>{Vo()},[]);async function Vo(){localStorage.getItem("onedrive_access_token")&&jc(!0)}const al=S=>{Qc(P=>P.some(fe=>fe.id===S.id)?P.filter(fe=>fe.id!==S.id):[...P,{id:S.id,name:S.name,size:S.size,lastModified:S.lastModified,contentType:S.contentType,isFolder:S.isFolder,parentId:S.parentId}])};function ua(S){if(S===0)return"0 B";const P=1024,B=["B","KB","MB","GB","TB"],fe=Math.floor(Math.log(S)/Math.log(P));return parseFloat((S/Math.pow(P,fe)).toFixed(1))+" "+B[fe]}function Jn(S){const P=new Date(S);return P.toLocaleDateString()+" "+P.toLocaleTimeString()}const rf=async()=>{try{const S=await Le.get(`${e}/api/login-one-drive`),{loginUrl:P}=S.data,B=window.open(P,"OneDrive Login","width=600,height=600");if(!B)throw new Error("Không thể mở cửa sổ pop-up");B.focus();const fe=setInterval(()=>{try{if(B.closed){clearInterval(fe);return}const ye=B.location.href;if(ye.includes("code=")){const Se=new URL(ye).searchParams.get("code");Se&&(af(Se),B.close(),clearInterval(fe))}}catch(ye){ye instanceof Error&&!ye.message.includes("cross-origin")&&console.error("OneDrive login error:",ye)}},1e3)}catch(S){lt.error("Lỗi khi đăng nhập OneDrive: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},of=async()=>{try{await Le.post(`${e}/api/logout-one-drive`),localStorage.removeItem("onedrive_access_token"),localStorage.removeItem("onedrive_refresh_access_token"),lt.success("Đã đăng xuất khỏi OneDrive"),window.location.href="https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri="+encodeURIComponent(window.location.origin)}catch(S){lt.error("Lỗi khi đăng xuất OneDrive: "+(S instanceof Error?S.message:"Lỗi không xác định"))}},af=async S=>{try{const P=ze==null?void 0:ze.id,B=await Le.post(`${e}/api/get-one-drive-access-token`,{authorizationCode:S,userId:P}),{accessToken:fe,refreshToken:ye}=B.data;localStorage.setItem("onedrive_access_token",fe),localStorage.setItem("onedrive_refresh_access_token",ye),jc(!0),ps(!0),await fa("root","One Drive")}catch(P){console.error("❌ Lỗi khi lấy Access Token:",P)}},fa=async(S,P)=>{try{aa(!0);const B=ze==null?void 0:ze.id,ye=(await Le.post(`${e}/api/list-file-one-drive`,{folderId:S,userId:B})).data.map(Se=>({id:Se.id,name:Se.name,size:Se.size??0,lastModified:Se.lastModifiedDateTime?new Date(Se.lastModifiedDateTime):new Date,contentType:Se.mimeType??void 0,isFolder:Se.type==="folder",parentId:Se.parentId??""}));qc(ye.filter(Se=>Se.isFolder)),Xu(ye.filter(Se=>!Se.isFolder)),ps(!0),Jc(Se=>Se.some(De=>De.id===S)?Se:[...Se,{id:S,name:P==="root"?"OneDrive":P}]),aa(!1)}catch(B){console.error("Lỗi lấy danh sách file:",B),aa(!1)}},sf=S=>{if(S===gs.length-1)return;const P=gs[S];P&&(Jc(gs.slice(0,S+1)),fa(P.id,P.name))},cf=async(S,P)=>{const B=localStorage.getItem("onedrive_access_token"),fe=localStorage.getItem("onedrive_refresh_access_token");if(!B){lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.");return}const ye=lt.loading("Đang đồng bộ OneDrive...",{position:"bottom-right",autoClose:!1});try{const Se={prefix:P,folders:[],files:[],isAutoUpdateKB:Sr,refreshAccessToken:fe};S.forEach(Ct=>{Ct.isFolder?Se.folders.push({id:Ct.id,name:Ct.name}):Se.files.push({id:Ct.id,name:Ct.name})});const De=await Le.post(`${e}/api/sync-one-drive-to-s3`,Se,{headers:{Authorization:`Bearer ${B}`}});dn(),lt.update(ye,{render:`Đồng bộ thành công! Đã tải lên ${De.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(Se){console.error("Lỗi khi đồng bộ file từ OneDrive:",Se),lt.update(ye,{render:"Không thể đồng bộ file từ OneDrive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}},Sn=()=>{ps(!1),Jc([{id:"root",name:"OneDrive"}]),qc([]),Xu([]),Qc([]),aa(!1)},iv=X1({onSuccess:S=>{Zm(S.access_token),localStorage.setItem("google_access_token",S.access_token),Qn(S.access_token)},onError:()=>{console.log("Đăng nhập thất bại!")},scope:a3}),Qn=S=>{const P=document.createElement("script");P.src="https://apis.google.com/js/api.js",P.onload=()=>{window.gapi.load("picker",()=>av(S))},document.body.appendChild(P)},av=S=>{const P=new window.google.picker.DocsView(window.google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!0).setOwnedByMe(!1),B=new window.google.picker.DocsView(window.google.picker.ViewId.DRIVE).setIncludeFolders(!0).setSelectFolderEnabled(!0);new window.google.picker.PickerBuilder().setDeveloperKey(o3).setOAuthToken(S).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).setLocale("vi").addView(P).addView(B).setCallback(async ye=>{if(ye.action===window.google.picker.Action.PICKED){const Se=ye.docs.map(De=>({id:De.id,name:De.name,mimeType:De.mimeType}));await lf(Se,v)}}).build().setVisible(!0)},lf=async(S,P="")=>{const B=localStorage.getItem("google_access_token");if(!B){console.error("❌ Không tìm thấy access token. Vui lòng đăng nhập lại."),lt.error("Không tìm thấy access token. Vui lòng đăng nhập lại.",{position:"bottom-right"});return}const fe=lt.loading("Đang đồng bộ...",{position:"bottom-right",autoClose:!1});try{const ye={prefix:P,folders:[],files:[]};S.forEach(De=>{De.mimeType==="application/vnd.google-apps.folder"?ye.folders.push({id:De.id,name:De.name}):ye.files.push({id:De.id,name:De.name})});const Se=await Le.post(`${e}/api/sync-drive-to-s3`,ye,{headers:{Authorization:`Bearer ${B}`}});fr.current=!0,dn(),lt.update(fe,{render:`Đồng bộ thành công! Đã tải lên ${Se.data.uploadedKeys.length} file.`,type:"success",isLoading:!1,autoClose:3e3,position:"bottom-right"})}catch(ye){console.error("❌ Lỗi khi đồng bộ file từ Google Drive:",ye),lt.update(fe,{render:"Không thể đồng bộ file từ Google Drive.",type:"error",isLoading:!1,autoClose:3e3,position:"bottom-right"})}};M.useEffect(()=>{const S=P=>{if(P.data.action==="logout"){const B=document.createElement("iframe");B.style.display="none",B.src="https://accounts.google.com/Logout",document.body.appendChild(B),setTimeout(()=>document.body.removeChild(B),2e3)}};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[]),M.useEffect(()=>{const S=new Set(l);C(S)},[]),M.useEffect(()=>{Xe!=null&&Xe.status&&(Xe.status.status==="completed"?(X({title:"Thu thập website hoàn tất",description:`Đã thu thập thành công ${Xe.url} với ${Xe.status.completed} trang`}),fr.current=!0,dn()):Xe.status.status==="failed"&&X({title:"Thu thập website thất bại",description:`Không thể thu thập ${Xe.url}. Vui lòng thử lại.`,variant:"destructive"}))},[(pf=Xe==null?void 0:Xe.status)==null?void 0:pf.status]);const Xr=M.useMemo(()=>gr[v]||[],[gr,v]),mr=M.useMemo(()=>Xr.filter(S=>h3(S.permission)),[Xr,v,gr]),Ko=M.useMemo(()=>{const S={};return mr.forEach((P,B)=>{y.has(P.key)&&(S[B]=!0)}),S},[y,mr]),Lt=S=>{const P=Hu(gr,S);if(P.length===0)return y.has(S)?"all":"none";const B=P.filter(fe=>y.has(fe)).length;return B===0?"none":B===P.length?"all":"partial"},Tn=(S,P=!0)=>{if(v!==S){if(u&&!v)ea(!0),A(S+u),b(S+u);else if(ea(!0),A(S),b(S),P&&!o){const B=window.location.pathname==="/"?"":window.location.pathname,fe=S?`${window.location.origin}${B}?prefix=${encodeURIComponent(S)}`:`${window.location.origin}${B}`;window.history.pushState({path:fe},"",fe)}}},sl=S=>{const P=S.lastIndexOf("/"),B=P>0?S.substring(0,P+1):"";B?(Tn(B),setTimeout(()=>{C(new Set([S]))},500)):C(new Set([S]))};M.useEffect(()=>{Qr&&(fr.current=!0,dn().finally(()=>ea(!1)))},[Qr]);const sv=async(S,P)=>{var B,fe;W(!0);try{if(mr.some(Ct=>Ct.isFolder&&Ct.name.toLowerCase()===S.toLowerCase())){X({title:"Lỗi",description:`Thư mục "${S}" đã tồn tại trong thư mục hiện tại.`,variant:"destructive"}),W(!1);return}const Se=`${P}${S}/`;if((await Le.post(`${e}/api/create-folder`,{prefix:Se,userId:(mt==null?void 0:mt.id)||""})).status!==200){X({title:"Lỗi",description:"Không thể tạo thư mục",variant:"destructive"});return}fr.current=!0,await dn(),X({title:"Đã tạo thư mục",description:`Đã tạo thành công thư mục "${S}"`}),L(""),O(!1)}catch(ye){console.error("Error creating folder:",ye);const Se=((fe=(B=ye==null?void 0:ye.response)==null?void 0:B.data)==null?void 0:fe.error)||"Không thể tạo thư mục";X({title:"Lỗi",description:Se,variant:"destructive"})}finally{W(!1)}},ha=async(S,P,B)=>{var fe,ye,Se,De,Ct,Tr,Zn,ma,gf;re(B),jt(!0);try{if(Array.from(S).reduce((yn,ya)=>yn+ya.size,0)>=100*1024*1024){X({title:"Lỗi",description:"Tổng kích thước các tập tin vượt quá 100 MB",variant:"destructive"}),re(null),jt(!1);return}const Is=Array.from(S).filter(yn=>yn.size===0);if(Is.length>0){const yn=Is.map(ya=>ya.name).join(", ");X({title:"Lỗi tải lên",description:`Không thể tải lên tập tin rỗng: ${yn}`,variant:"destructive"}),jt(!1),re(null);return}const er=new FormData;if(ze!=null&&ze.id&&er.append("metadata",JSON.stringify({creator:ze.username,creatorId:ze.id,DataSource:"Tệp tải lên"})),B==="folder"&&S[0]){const yn=S[0].webkitRelativePath.split("/")[0];yn&&er.append("folderName",yn)}er.append("prefix",P),Array.from(S).forEach(yn=>B==="folder"?er.append("files",yn,yn.webkitRelativePath):er.append("files",yn)),fr.current=!0;const vt=await Le.post(`${e}/api/check-files-existed`,er,{headers:{"Content-Type":"multipart/form-data"}});if(((fe=vt==null?void 0:vt.data)==null?void 0:fe.status)===200)await Le.post(`${e}/api/upload`,er,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),A(P),setTimeout(async()=>{re(null),await dn(),jt(!1),await Zr("upload")},500);else{if(((Se=(ye=vt==null?void 0:vt.data)==null?void 0:ye.names)==null?void 0:Se.length)>0&&!((De=vt==null?void 0:vt.data)!=null&&De.isFolder)){const yn=Array.from(S).filter(ya=>vt.data.names.includes(ya.name));ta(yn),ra(!0)}(Ct=vt==null?void 0:vt.data)!=null&&Ct.isFolder&&((Tr=vt==null?void 0:vt.data)!=null&&Tr.name)&&(ls((Zn=vt==null?void 0:vt.data)==null?void 0:Zn.name),ta(S),ra(!0))}}catch(va){console.error("Lỗi tải lên:",va);const Is=((gf=(ma=va==null?void 0:va.response)==null?void 0:ma.data)==null?void 0:gf.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:Is,variant:"destructive"}),re(null),jt(!1)}},cv=async()=>{var S,P;try{jt(!0);const B=new FormData;if(wo){re(na?"folder":"files"),ra(!1);let fe=localStorage.getItem("dataLogin"),ye;try{fe&&(fe=JSON.parse(fe),ye=fe.user)}catch{fe=null}if(na&&wo[0]){const Se=wo[0].webkitRelativePath.split("/")[0];Se&&B.append("folderName",Se)}B.append("prefix",v),Array.from(wo).forEach(Se=>na&&wo[0]?B.append("files",Se,Se.webkitRelativePath):B.append("files",Se)),ye!=null&&ye.id&&B.append("metadata",JSON.stringify({creator:ye.username,creatorId:ye.id,DataSource:"Tệp tải lên"})),await Le.post(`${e}/api/upload`,B,{headers:{"Content-Type":"multipart/form-data"},timeout:0}),w(""),A(v),fr.current=!0}}catch(B){console.error("Lỗi tải lên:",B);const fe=((P=(S=B==null?void 0:B.response)==null?void 0:S.data)==null?void 0:P.error)||"Không thể tải lên tập tin";X({title:"Lỗi",description:fe,variant:"destructive"})}finally{setTimeout(async()=>{re(null),await dn(),jt(!1),ls(""),ta(null),await Zr("overwrite")},500)}},df=async S=>{var P;try{if(await Le.delete(`${e}/api/files`,{data:{paths:[S.key]}}),y.has(S.key)){const fe=new Set(y);fe.delete(S.key),C(fe)}const B=((P=S.key)==null?void 0:P.replace(/^(.*?)(\/.*)?$/,(fe,ye,Se)=>!Se||Se==="/"?"":ye+"/"))||"";A(B),fr.current=!0,X({title:"Đã xóa tập tin",description:`Đã xóa thành công "${S.name}"`}),q(null),await Zr("delete")}catch(B){console.error("Error deleting file:",B),X({title:"Lỗi",description:"Không thể xóa tập tin",variant:"destructive"})}finally{Jr(!1),await dn()}},Ss=S=>{const P=new Set(y),B=typeof S=="function"?S(Ko):S;new Set(Object.keys(Ko).map(Number)).forEach(ye=>{const Se=mr[ye];Se&&(B[ye]||(P.delete(Se.key),Se.isFolder&&Hu(gr,Se.key).forEach(De=>P.delete(De))))}),Object.entries(B).forEach(([ye,Se])=>{const De=parseInt(ye),Ct=mr[De];Ct&&Se&&(P.add(Ct.key),Ct.isFolder&&Hu(gr,Ct.key).forEach(Tr=>P.add(Tr)))}),C(P)},uf=async()=>{var S;K(!0);try{const P=Array.from(y),B=P.map(ye=>Object.values(gr).flat().find(Se=>Se.key===ye)).filter(ye=>ye!==void 0);if(B.length===0){X({title:"Lỗi",description:"Không có tập tin nào được chọn để xóa",variant:"destructive"});return}await Le.delete(`${e}/api/files`,{data:{paths:P}});const fe=((S=B[0])==null?void 0:S.key.replace(/^(.*?)(\/.*)?$/,(ye,Se,De)=>!De||De==="/"?"":Se+"/"))||"";A(fe),fr.current=!0,dn(),X({title:"Đã xóa tập tin",description:`Đã xóa thành công ${B.length} mục`}),G(!1),C(new Set),await Zr("bulk-delete")}catch(P){console.error("Error deleting files:",P),X({title:"Lỗi",description:"Không thể xóa các tập tin đã chọn",variant:"destructive"})}finally{K(!1)}},Ts=async(S,P)=>{if(!v.trim()){X({title:"Lỗi",description:"Không thể đổi tên tập tin hoặc thư mục ở thư mục gốc. Chỉ có thể xóa.",variant:"destructive"});return}Pe(!0);try{const B=S.key;let fe;S.isFolder?fe=B.split("/").slice(0,-2).join("/")+"/":fe=B.substring(0,B.lastIndexOf("/")+1);const ye=fe+P+(S.isFolder?"/":"");await Le.post(`${e}/api/rename`,{oldPath:B,newPath:ye}),fr.current=!0,await dn(),X({title:"Đã đổi tên",description:`Đã đổi tên thành công "${S.name}" thành "${P}"`}),te(null),z(""),Ne(null),await Zr("rename")}catch(B){console.error("Error renaming item:",B),X({title:"Lỗi",description:"Không thể đổi tên",variant:"destructive"})}finally{Pe(!1)}},Ti=async S=>{Ze(P=>new Set([...P,...S]));try{const P=await Le.post(`${e}/api/download`,{paths:S},{responseType:"blob"}),B=window.URL.createObjectURL(P.data),fe=document.createElement("a");fe.href=B;const ye=P.headers["Content-Disposition"]||P.headers["content-disposition"],Se=ye==null?void 0:ye.match(/filename="(.+)"/),De=Se?decodeURIComponent(Se[1]):"download.zip";fe.setAttribute("download",De),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),window.URL.revokeObjectURL(B),X({title:"Bắt đầu tải xuống",description:`Đã bắt đầu tải xuống ${S.length} mục${S.length>1,""}`})}catch(P){console.error("Error downloading files:",P),X({title:"Lỗi",description:"Không thể tải xuống tập tin",variant:"destructive"})}finally{Ze(P=>{const B=new Set(P);return S.forEach(fe=>B.delete(fe)),B})}},cl=async(S,P)=>{var B;try{const fe=await Le.post(`${e}/document-permission/public`,{path:S,isPublic:P,grandtedBy:mt==null?void 0:mt.id});X({title:"Chỉnh sửa quyền riêng tư thành công",description:`Trạng thái ${S} đã được chuyển thành ${(B=fe.data)!=null&&B.isPublic?"công khai":"riêng tư"}.`}),await dn()}catch(fe){console.log("error",fe)}finally{}},ll=v?v.replace(n,"").split("/").filter(Boolean):[],ff=()=>{let S=Array.from(y).map(B=>({key:B}));S.length>1&&(S=S.filter(B=>B.key!==n));const P=B=>Ud.findIndex(S,fe=>!fe.key.endsWith("/")&&fe.key.startsWith(B))!==-1;return S=S.filter(B=>B.key.endsWith("/")?!P(B.key):!0),S},Es=M.useMemo(()=>{const S=[...(ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/")?[]:[{id:"select",header:()=>{const P=c3(gr,v),B=P.length>0&&P.every(ye=>y.has(ye)),fe=P.some(ye=>y.has(ye));return d.jsx(pc,{checked:B?!0:fe?"indeterminate":!1,onCheckedChange:ye=>{if(ye){const Se=mr.reduce((De,Ct,Tr)=>(De[Tr]=!0,De),{});Ss(Se)}else{for(const Se of Array.from(y))Se.startsWith(v)&&(y.delete(Se),Ho.current[Se]=!1);Ud.forEach(Ho.current,(Se,De)=>{De.startsWith(v)&&(Ho.current[De]=!1)}),Ss({})}},"aria-label":"Chọn tất cả"})},cell:({row:P})=>{const B=P.original;let ye=B.isFolder?Lt(B.key):y.has(B.key)?"all":"none";if(ye==="none"&&B.key.endsWith("/")){for(const Se of Array.from(y))if(Se.startsWith(B.key)){ye="all";break}}return d.jsx("div",{className:"flex items-center",children:d.jsx(pc,{checked:ye==="partial"?"indeterminate":ye==="all",onCheckedChange:Se=>{var Ct,Tr;const De={...Ko};if(Se?De[P.index]=!0:delete De[P.index],Ho.current[((Ct=P.original)==null?void 0:Ct.key)||"_"]=!!Se,(Tr=P.original)!=null&&Tr.key.endsWith("/"))for(const Zn of Array.from(y))Zn.startsWith(P.original.key)&&(Ho.current[P.original.key]=!1,y.delete(Zn));Ss(De)},"aria-label":"Chọn dòng"})})},enableSorting:!1}],{id:"fileName",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),children:["Tên tập tin",d.jsx(cg,{})]}),accessorKey:"name",cell:({row:P})=>{const B=P.original,fe=B.key.substring(0,B.key.lastIndexOf("/"))||"/",ye=g.trim()!==""&&fe!==v,Se=fe.split("/").filter(Boolean);return d.jsxs("div",{className:"flex flex-col group",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsxs("div",{className:`flex items-center gap-2 ${B.isFolder?"cursor-pointer hover:text-blue-600":""}`,onClick:()=>{B.isFolder&&Tn(B.key)},children:[B.isFolder?d.jsx(nc,{className:"h-5 w-5 text-blue-500"}):null,B.name]}),d.jsx("button",{className:"ml-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:De=>{De.stopPropagation(),navigator.clipboard.writeText(B.key),X({title:"Copied to clipboard",description:`Path: ${B.key}`,duration:2e3})},title:"Copy path to clipboard",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),d.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),ye&&d.jsxs("div",{className:"text-sm text-gray-500 flex items-center",children:[d.jsx(nc,{className:"h-4 w-4 text-gray-500 my-auto"}),d.jsxs("span",{className:"flex items-center ml-1",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Tn("")},children:"/"}),Se.map((De,Ct)=>d.jsxs("span",{className:"flex items-center",children:[d.jsx("span",{className:"cursor-pointer hover:text-blue-600",onClick:()=>{Tn(Se.slice(0,Ct+1).join("/")+"/")},children:De}),Ct<Se.length-1&&d.jsx("span",{children:"/"})]},Ct))]})]})]})}}];return o?S.push({id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:P})=>d.jsxs("div",{className:"flex items-center gap-2",children:[YE()&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>zc(P.original),className:"h-8 w-8 p-0",children:d.jsx(eC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Chia sẻ"})]})}),JE()&&Bu(P.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx(jE,{enabled:!!P.original.isPublic,onChange:()=>cl(P.original.key,!P.original.isPublic)}),d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full ${P.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"} px-3 py-1 text-sm font-medium cursor-pointer`,onClick:()=>hs(P.original),children:P.original.isPublic?"Công khai":"Riêng tư"}),d.jsx(WE,{file:ia,open:!!ia,onClose:()=>hs(null),isPublic:!!P.original.isPublic,onSave:B=>cl(P.original.key,B)})]})]})}):S.push({id:"size",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),children:["Kích thước",d.jsx(cg,{})]}),accessorKey:"size",cell:({getValue:P,row:B})=>{const fe=P();return d.jsx("span",{children:B.original.isFolder?"-":ua(fe)})}},{id:"lastModified",header:({column:P})=>d.jsxs(Fe,{variant:"ghost",onClick:()=>P.toggleSorting(P.getIsSorted()==="asc"),className:"px-0 w-full flex-row justify-end",children:["Sửa đổi lần cuối",d.jsx(cg,{})]}),accessorKey:"lastModified",cell:({row:P})=>{const B=P.original.lastModified;return d.jsx("div",{className:"w-full flex-row justify-end items-center text-right",children:d.jsx("span",{children:B&&px(B).isValid()?px(B).format("DD/MM/YYYY HH:mm"):"-"})})},size:200},{id:"actions",header:()=>d.jsx("span",{children:"Hành động"}),accessorKey:"key",cell:({row:P})=>d.jsxs("div",{className:"flex items-center gap-2",children:[v===""&&r&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{ju(P.original.key),Wu(!0)},className:"h-8 w-8 p-0",children:ae.has(P.original.key)?d.jsx(St,{className:"h-4 w-4 animate-spin"}):d.jsx(sO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Những Flow sử dụng Folder này làm Data"})]})}),d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:!P.original.isFolder&&d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>Ti([P.original.key]),className:"h-8 w-8 p-0",disabled:!f3(P.original.permission)||ae.has(P.original.key),children:ae.has(P.original.key)?d.jsx(St,{className:"h-4 w-4 animate-spin"}):d.jsx(rO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Tải xuống"})]})}),v.trim()!==""&&(Bu(P.original.permission)?d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{te(P.original),z(P.original.name)},className:"h-8 w-8 p-0",children:d.jsx(pO,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Đổi tên"})]})}):d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{console.log("call"),Ee(P.original)},className:"h-8 w-8 p-0",disabled:P.original.isFolder,children:d.jsx(yx,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Xem"})]})})),d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>{Ae(!0),ce(P.original)},className:"h-8 w-8 p-0",children:d.jsx(WM,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Di chuyển"})]})}),!((ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/"))&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>q(P.original),className:"h-8 w-8 p-0",children:d.jsx(tC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Xóa"})]})}),YE()&&(v===""||v==="/")&&d.jsx(Mn,{children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>zc(P.original),className:"h-8 w-8 p-0",children:d.jsx(eC,{className:"h-4 w-4"})})}),d.jsx(xn,{children:"Chia sẻ"})]})}),v!==""&&v!=="/"&&JE()&&Bu(P.original.permission)&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:`inline-flex items-center gap-1 rounded-full ${P.original.isPublic?"bg-green-100 text-green-700":"bg-red-100 text-red-700"} px-3 py-1 text-sm font-medium cursor-pointer`,onClick:()=>{console.log("calll"),console.log(P.original),hs(P.original)},children:P.original.isPublic?"Công khai":"Riêng tư"}),d.jsx(WE,{file:ia,open:!!ia,onClose:()=>hs(null),isPublic:!!P.original.isPublic,onSave:B=>cl(P.original.key,B)})]})]})}),S},[y,mr,Ko,ae,o,ia]),pa=fx({data:mr,columns:Es,state:{rowSelection:Ko,sorting:h},onSortingChange:p,enableRowSelection:!0,onRowSelectionChange:Ss,getCoreRowModel:ux(),getSortedRowModel:OM()}),dl=async S=>{var P,B;Ot(!0);try{if(Xi(S)){const fe=await Le.get(`${e}/api/read-text`,{params:{path:S.key}});Tt(fe.data.content)}try{const fe=await Le.get(`${e}/api/read-json`,{params:{path:S.key+".metadata.json"}}),ye=((B=(P=fe==null?void 0:fe.data)==null?void 0:P.content)==null?void 0:B.metadataAttributes)||null;return Ne({fullPath:U==null?void 0:U.key,...ye})}catch{return Ne("Lỗi phân tích siêu dữ liệu")}}catch(fe){console.error("Error loading file content:",fe),X({title:"Lỗi",description:"Không thể tải nội dung tập tin",variant:"destructive"})}finally{Ot(!1)}},lv=async(S,P)=>{en(!0);try{await Le.post(`${e}/api/modify-text`,{path:S.key,content:P}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await dn(),te(null),Tt(""),Y("rename"),await Zr("edit-content")}catch(B){console.error("Error saving file content:",B),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}},ul=async S=>{en(!0);try{await Le.post(`${e}/api/modify-json`,{path:S.key+".metadata.json",content:{metadataAttributes:Ce}}),X({title:"Đã lưu tập tin",description:"Nội dung tập tin đã được cập nhật thành công"}),fr.current=!0,await dn(),te(null),Tt(""),Y("rename")}catch(P){console.error("Error saving file content:",P),X({title:"Lỗi",description:"Không thể lưu nội dung tập tin",variant:"destructive"})}finally{en(!1)}};M.useEffect(()=>{U&&(U.isFolder||dl(U),Y("rename"))},[U]),M.useEffect(()=>{be&&!be.isFolder&&dl(be)},[be]);const As=async(S,P)=>{var B;if(Xe){X({title:"Đang thu thập website",description:"Vui lòng đợi cho công việc thu thập hiện tại hoàn thành.",variant:"destructive"});return}Mt(!0);try{if((await Le.get(S)).status!==200){X({title:"Lỗi",description:"Không thể lấy dữ liệu. Vui lòng kiểm tra lại đường dẫn.",variant:"destructive"}),Mt(!1);return}}catch{X({title:"Lỗi",description:"Đường dẫn không hợp lệ. Vui lòng kiểm tra lại.",variant:"destructive"}),Mt(!1);return}try{const{data:fe}=await Le.post(`${e}/api/crawl`,{url:S,limit:P,prefix:v,isAutoUpdateKB:Sr});if(fe.id){Uc({id:fe.id,url:S,limit:P,prefix:v,taskId:((B=fe.task)==null?void 0:B.id)||""});const ye=localStorage.getItem(qE),Se=ye?JSON.parse(ye):[];Se.some(De=>De.id===fe.id)||(Se.unshift({url:S,id:fe.id,limit:P,prefix:v,timestamp:Date.now()}),Se.length>20&&(Se.length=20),localStorage.setItem(qE,JSON.stringify(Se))),X({title:"Bắt đầu thu thập website",description:`Đã thêm nhiệm vụ thu thập ${S} với giới hạn ${P}. Dữ liệu sẽ có sẵn sau khi thu thập hoàn tất.`}),Ie(!1),ne(""),$e("1")}}catch(fe){console.error("Error crawling website:",fe),X({title:"Lỗi",description:"Không thể bắt đầu thu thập website",variant:"destructive"})}finally{Mt(!1)}},dv=async()=>{try{if(!(Xe!=null&&Xe.id))return;Uc(null),localStorage.removeItem(as),X({title:"Đã dừng thu thập",description:`Đã dừng thu thập website ${Xe.url}`})}catch(S){console.error("Error stopping job:",S),X({title:"Lỗi",description:"Không thể dừng thu thập website",variant:"destructive"})}};M.useEffect(()=>{if(o)return;const S=(P=!0)=>{const fe=new URL(window.location.href).searchParams.get("prefix")||"";fe?Tn(fe,!1):(P&&!l&&C(new Set),A(n),b(n),fr.current=!0,setTimeout(()=>{dn()},0))};return S(!1),window.addEventListener("popstate",()=>S(!0)),()=>{window.removeEventListener("popstate",()=>S(!0))}},[]);const fl=async()=>{Ju(!0);try{await Le.post(`${e}/api/prediction-report`),X({title:"Xuất báo cáo thành công",description:"Báo cáo dự đoán đã được xuất"})}catch(S){console.error("Error exporting report:",S),X({title:"Lỗi",description:"Không thể xuất báo cáo dự đoán",variant:"destructive"})}finally{Ju(!1)}},Ln=async()=>{try{const S=Mo();S&&(await Le.post(`${e}/api/start-ingestion-job`,{prefix:v,user_id:S.id,userName:S.username})).status===200&&await ga()}catch(S){zt(!1),console.log(S)}},Zr=async S=>{try{fs&&v.includes(fs)&&(console.log(`Auto syncing knowledge base after ${S} operation`),await ga())}catch(P){console.log(`Error auto syncing after ${S}:`,P)}},Xn=M.useRef(),ga=async()=>{try{zt(!0);const S=await Le.post(`${e}/api/get-ingestion-job-status`,{prefix:v}),{status:P}=S==null?void 0:S.data;P==="FAILED"||P==="COMPLETE"||P==="STOPPED"||P==="STOPPING"||!P?(zt(!1),Xn.current&&(clearInterval(Xn.current),Xn.current=null),Vc(S==null?void 0:S.data)):(Xn.current||(Xn.current=setInterval(()=>ga(),5e3)),Vc(S==null?void 0:S.data))}catch(S){console.log(S)}},hf=()=>{const S=Array.from(y);let P;return v?P=S.filter(B=>B.startsWith(v)&&B!==v).length:P=new Set(S.filter(B=>B.split("/").shift())).size,`Đang chọn: ${P}`};return M.useEffect(()=>{const S=v==null?void 0:v.split("/")[0];return S!==fs&&(zt(!1),Xn.current&&(clearInterval(Xn.current),Xn.current=null),Wm(S||""),Vc(null),S&&ga()),()=>{}},[fs,v]),M.useEffect(()=>{Bo&&ws.length===0&&(nv(),ca(null))},[Bo]),M.useEffect(()=>{if(l)for(const S of Array.from(l))Ho.current[S]=!0},[]),d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx(H_,{}),d.jsx(Vn,{open:Gu,onOpenChange:S=>{ra(S),S||(ls(""),ta(null),jt(!1),re(null))},children:d.jsxs(Nn,{children:[d.jsxs(Pn,{children:[d.jsx(On,{children:"Cảnh báo trùng lặp"}),d.jsxs(Do,{children:[na&&d.jsxs(d.Fragment,{children:["Folder $",na," đã có."]}),wo&&wo.length>0&&d.jsxs(d.Fragment,{children:["Những tệp sau bị lặp:",d.jsx("ul",{className:"mt-2 list-disc pl-5 text-sm text-red-600",children:Array.from(wo).map((S,P)=>d.jsx("li",{children:S.name},P))})]})]})]}),d.jsxs(_r,{children:[d.jsx(Fe,{variant:"outline",onClick:()=>{ra(!1),ls(""),ta(null),jt(!1),re(null)},children:"Bỏ qua"}),d.jsx(Fe,{variant:"destructive",onClick:()=>cv(),children:"Ghi đè"})]})]})}),d.jsx(Bd,{className:"s3-explr-breadcrumb",children:d.jsxs(zd,{className:"s3-explr-breadcrumb-list",children:[d.jsx(fc,{className:"s3-explr-breadcrumb-item",children:d.jsx(hc,{onClick:()=>Tn(n),className:"flex items-center gap-1 cursor-pointer s3-explr-breadcrumb-home",children:t})}),!u&&ll.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[d.jsx(Vd,{className:"s3-explr-breadcrumb-separator"},`sep-${P}`),d.jsx(fc,{className:"s3-explr-breadcrumb-item",children:d.jsx(hc,{onClick:()=>Tn(n+ll.slice(0,P+1).join("/")+"/"),className:"cursor-pointer s3-explr-breadcrumb-link",children:S})},`item-${S}`)]},P))]})}),d.jsxs("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:[d.jsx("div",{className:"relative max-w-sm w-full s3-explr-search-container",children:d.jsx(L2,{ref:J,onChange:S=>w(S)})}),v&&v!=="/"&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>{Cs||tn||(zt(!0),Ln())},"aria-disabled":Cs||tn,className:"flex items-center gap-2 s3-explr-refresh-btn aria-disabled:opacity-50",children:[d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${Cs||tn?"animate-spin":""}`}),"Đồng bộ KB"]})}),Dt&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-2 p-3 max-w-md",children:[d.jsx("p",{className:"font-semibold text-lg border-b pb-1",children:"Thông tin đồng bộ"}),d.jsx("div",{className:"space-y-1",children:d.jsxs("p",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-medium",children:"Trạng thái:"}),d.jsxs("span",{className:`flex items-center gap-1 font-semibold ${Dt.status==="COMPLETE"?"text-green-600":Dt.status==="FAILED"?"text-red-600":"text-yellow-600"}`,children:[Dt.status==="COMPLETE"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Dt.status==="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),Dt.status!=="COMPLETE"&&Dt.status!=="FAILED"&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),fD(Dt.status)]})]})}),Dt.statistics&&d.jsxs("div",{className:"space-y-1 border-t pt-2",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Thống kê xử lý:"}),d.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu quét:"}),d.jsx("span",{className:"font-medium",children:Dt.statistics.numberOfDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata quét:"}),d.jsx("span",{className:"font-medium",children:Dt.statistics.numberOfMetadataDocumentsScanned})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu mới:"}),d.jsx("span",{className:"font-medium text-green-600",children:Dt.statistics.numberOfNewDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Dt.statistics.numberOfModifiedDocumentsIndexed})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Metadata sửa:"}),d.jsx("span",{className:"font-medium text-blue-600",children:Dt.statistics.numberOfMetadataDocumentsModified})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{children:"Tài liệu xóa:"}),d.jsx("span",{className:"font-medium text-orange-600",children:Dt.statistics.numberOfDocumentsDeleted})]}),d.jsxs("div",{className:"flex justify-between col-span-2",children:[d.jsx("span",{children:"Tài liệu lỗi:"}),d.jsx("span",{className:"font-medium text-red-600",children:Dt.statistics.numberOfDocumentsFailed})]})]})]}),d.jsxs("div",{className:"space-y-1 border-t pt-2 text-sm text-gray-200",children:[d.jsx("p",{className:"font-medium text-gray-50",children:"Chi tiết Job:"}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"DataSource ID:"})," ",Dt.dataSourceId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Ingestion Job ID:"})," ",Dt.ingestionJobId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Knowledge Base ID:"})," ",Dt.knowledgeBaseId]}),d.jsxs("p",{children:[d.jsx("span",{className:"font-medium",children:"Job trong queue:"})," ",Dt.is_still_in_stock?"Còn":"Không"]})]}),Dt.errorMessage&&d.jsxs("div",{className:"border-t pt-2",children:[d.jsx("p",{className:"text-red-600 font-medium",children:"Lỗi:"}),d.jsx("p",{className:"text-red-600 text-sm bg-red-50 p-2 rounded",children:Dt.errorMessage})]}),Dt.failureReasons&&Dt.failureReasons.length>0&&d.jsx(b$,{failureReasons:Dt.failureReasons,onNavigateToFile:sl})]})})]})}),Bu(gr==null?void 0:gr.prefixPermission)&&d.jsxs("div",{className:"relative",ref:il,children:[d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-file-btn bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors aria-disabled:hidden",onClick:()=>bo(S=>!S),"aria-disabled":(ze==null?void 0:ze.role)!=="MASTER_ADMIN"&&(ze==null?void 0:ze.role)!=="SITE_ADMIN"&&(v===""||v==="/"),children:[d.jsx(mO,{className:"w-4 h-4"}),"Add file"]}),ol&&d.jsxs("div",{className:"absolute z-50 mt-2 right-0 w-56 bg-white border rounded-lg shadow-lg py-2 flex flex-col",children:[d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1);const S=document.createElement("input");S.type="file",S.multiple=!0,S.onchange=P=>{const B=P.target.files;B&&ha(B,v,"files")},S.click()},children:[d.jsx(Np,{className:"h-4 w-4 mr-2"})," Tải tệp tin"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1);const S=document.createElement("input");S.type="file",S.multiple=!0,S.webkitdirectory=!0,S.onchange=P=>{const B=P.target.files;B&&ha(B,v,"folder")},S.click()},children:[d.jsx(nc,{className:"h-4 w-4 mr-2"})," Tải lên thư mục"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",disabled:!!s&&!v,onClick:()=>O(!0),children:[d.jsx(lO,{className:"h-4 w-4 mr-2 s3-explr-folder-plus-icon"}),"Thư mục mới"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),Ie(!0)},children:[d.jsx(fO,{className:"h-4 w-4 mr-2"})," Thêm Website"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),iv()},children:[d.jsxs("svg",{viewBox:"0 0 87.3 78",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",children:[d.jsx("path",{d:"m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8h-27.5c0 1.55.4 3.1 1.2 4.5z",fill:"#0066da"}),d.jsx("path",{d:"m43.65 25-13.75-23.8c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44a9.06 9.06 0 0 0 -1.2 4.5h27.5z",fill:"#00ac47"}),d.jsx("path",{d:"m73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5h-27.502l5.852 11.5z",fill:"#ea4335"}),d.jsx("path",{d:"m43.65 25 13.75-23.8c-1.35-.8-2.9-1.2-4.5-1.2h-18.5c-1.6 0-3.15.45-4.5 1.2z",fill:"#00832d"}),d.jsx("path",{d:"m59.8 53h-32.3l-13.75 23.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z",fill:"#2684fc"}),d.jsx("path",{d:"m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3l-13.75 23.8 16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z",fill:"#ffba00"})]})," ","Đồng bộ Google Drive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),rf()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#094ab2",d:"M47.3 28.2C45.3 18.6 37.1 12 28 12c-8.5 0-15.9 5.6-18.4 13.5C4.2 27.2 0 32.2 0 38c0 6.6 5.4 12 12 12h36c8.3 0 16-6.6 16-15.5 0-6.8-4.9-12.4-11.7-13.3z"}),d.jsx("path",{fill:"#0067c5",d:"M44.9 30.1c-.2 0-.4-.1-.6-.1H26c-3.3 0-6 2.7-6 6 0 .9.2 1.8.6 2.6-1.7-.7-3.5-1.1-5.5-1.1C7.6 37.5 4 41.5 4 46s3.6 8.5 8.1 8.5h34.3c6.8 0 12.6-5.4 12.6-12s-5.5-11.6-11.1-12.4z"})]})," ","Đồng bộ OneDrive"]}),d.jsxs("button",{className:"flex items-center px-4 py-2 text-sm hover:bg-gray-100 text-left",onClick:()=>{bo(!1),ev()},children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"h-4 w-4 mr-2",children:[d.jsx("path",{fill:"#036C70",d:"M19 14.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#17828F",d:"M16 17.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#4DB6AC",d:"M13 20.5v-9c0-.28-.22-.5-.5-.5h-13c-.28 0-.5.22-.5.5v9c0 .28.22.5.5.5h13c.28 0 .5-.22.5-.5z"}),d.jsx("path",{fill:"#fff",d:"M4.5 15.5v-3c0-.28.22-.5.5-.5h3c.28 0 .5.22.5.5v3c0 .28-.22.5-.5.5H5c-.28 0-.5-.22-.5-.5z"})]})," ","Đồng bộ SharePoint"]})]})]}),!o&&d.jsxs(d.Fragment,{children:[y.size>0&&d.jsx(d.Fragment,{children:d.jsxs(Vn,{open:Z,onOpenChange:G,children:[d.jsx(gc,{asChild:!0,children:d.jsxs(Fe,{variant:"destructive",size:"sm",className:"flex items-center gap-2 s3-explr-bulk-delete-btn",children:[d.jsx(tC,{className:"h-4 w-4 s3-explr-trash-icon"}),"Xóa đã chọn (",y.size,")"]})}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Xác nhận xóa hàng loạt"}),d.jsxs(Do,{className:"s3-explr-dialog-description",children:["Bạn có chắc chắn muốn xóa ",y.size," mục đã chọn? Hành động này không thể hoàn tác."]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>G(!1),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:uf,disabled:ve,className:"s3-explr-confirm-delete-btn",children:ve?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa đã chọn"})]})]})]})}),!u&&d.jsxs(Vn,{open:N,onOpenChange:O,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:"Tạo thư mục mới"})}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"name",className:"s3-explr-label",children:"Tên thư mục"}),d.jsx(Kn,{disabled:H,id:"name",value:T,onChange:S=>L(S.target.value),placeholder:"Nhập tên thư mục",className:"s3-explr-input"})]}),d.jsxs(Fe,{onClick:()=>{T.trim()&&sv(T,v)},disabled:H,className:"s3-explr-create-btn",children:[H&&d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),H?"Đang tạo...":"Tạo"]})]})]})]}),u&&!v?d.jsx(d.Fragment,{}):d.jsxs("div",{className:"flex items-center gap-2 s3-explr-upload-group",children:[Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!0,children:[d.jsx(St,{className:"h-4 w-4 animate-spin s3-explr-loader"}),Xe.status?d.jsxs(d.Fragment,{children:[Xe.status.isProcessing?"Đang thu thập ":"Đang quét sitemap ","(",Xe.status.completed,"/",Xe.status.total,") -"," ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}):"Đang thu thập..."]}),d.jsxs(Fe,{variant:"destructive",size:"sm",onClick:()=>void dv(),className:"flex items-center gap-2",children:[d.jsx("span",{className:"sr-only",children:"Dừng thu thập"}),d.jsx(wO,{className:"h-4 w-4"})]})]})}),Xe.status&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2 max-w-md break-words",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Xe==null?void 0:Xe.url]}),d.jsxs("p",{children:["Tiến độ: ",Xe==null?void 0:Xe.status.completed,"/",Xe==null?void 0:Xe.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",(Xe==null?void 0:Xe.status.status)==="scraping"?"Đang thu thập":(Xe==null?void 0:Xe.status.status)==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}):!u&&d.jsxs(Vn,{open:se,onOpenChange:Ie,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Do,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(Kn,{id:"websiteUrl",value:Q,onChange:S=>ne(S.target.value),placeholder:"https://example.com",type:"url",disabled:Be,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(Kn,{id:"crawlLimit",value:ke,onChange:S=>{const P=S.target.value;/^\d*$/.test(P)&&$e(P)},placeholder:"1",type:"text",disabled:Be,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>{Ie(!1),ne(""),$e("1")},disabled:Be,className:"s3-explr-cancel-btn",children:"Hủy"}),Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(Fe,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(xn,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(Fe,{onClick:()=>{Q.trim()&&As(Q.trim(),parseInt(ke)||1)},disabled:Be||!Q.trim(),className:"s3-explr-crawl-btn",children:Be?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:fl,children:[oa&&d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${oa?"animate-spin":""}`}),"Xuất báo cáo"]})}),(Xe==null?void 0:Xe.status)&&d.jsx(xn,{side:"right",sideOffset:5,children:d.jsxs("div",{className:"space-y-1 p-2",children:[d.jsxs("p",{className:"font-semibold",children:["Đang thu thập ",Xe.url]}),d.jsxs("p",{children:["Tiến độ: ",Xe.status.completed,"/",Xe.status.total," ","trang"]}),d.jsxs("p",{children:["Thời gian: ",Math.floor($o/60),":",String($o%60).padStart(2,"0")]}),d.jsxs("p",{children:["Trạng thái:"," ",Xe.status.status==="scraping"?"Đang thu thập":Xe.status.status==="completed"?"Hoàn thành":"Thất bại"]})]})})]})}),d.jsxs(Vn,{open:se,onOpenChange:Ie,children:[d.jsx(gc,{asChild:!0}),d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Thêm website"}),d.jsx(Do,{className:"s3-explr-dialog-description",children:"Nhập URL website để thu thập và thêm vào S3."})]}),d.jsxs("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:[d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"websiteUrl",className:"s3-explr-label",children:"URL Website"}),d.jsx(Kn,{id:"websiteUrl",value:Q,onChange:S=>ne(S.target.value),placeholder:"https://example.com",type:"url",disabled:Be,className:"s3-explr-input"})]}),d.jsxs("div",{className:"space-y-2 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"crawlLimit",className:"s3-explr-label",children:"Giới hạn thu thập"}),d.jsx(Kn,{id:"crawlLimit",value:ke,onChange:S=>{const P=S.target.value;/^\d*$/.test(P)&&$e(P)},placeholder:"1",type:"text",disabled:Be,className:"s3-explr-input"}),d.jsx("p",{className:"text-sm text-gray-500",children:"Số lượng liên kết cần thu thập (mặc định: 1)"})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsxs(Fe,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>nl(S=>!S),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]}),d.jsx(Fe,{variant:"outline",onClick:()=>{Ie(!1),ne(""),$e("1")},disabled:Be,className:"s3-explr-cancel-btn",children:"Hủy"}),Xe?d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsx("span",{children:d.jsxs(Fe,{disabled:!0,className:"s3-explr-crawl-btn",children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]})})}),d.jsx(xn,{side:"top",sideOffset:5,children:"Đang có một tiến trình thu thập đang chạy. Vui lòng chờ hoàn thành trước khi bắt đầu mới."})]})}):d.jsx(Fe,{onClick:()=>{Q.trim()&&As(Q.trim(),parseInt(ke)||1)},disabled:Be||!Q.trim(),className:"s3-explr-crawl-btn",children:Be?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang thu thập..."]}):"Bắt đầu thu thập"})]})]})]})]}),v.startsWith("BKTTW/")&&d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{children:[d.jsx(Rn,{asChild:!0,children:d.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2 s3-explr-add-website-btn",disabled:!!s&&!v,onClick:fl,children:[oa&&d.jsx(kp,{className:`h-4 w-4 s3-explr-refresh-icon ${oa?"animate-spin":""}`}),"Xuất báo cáo"]})}),oa&&d.jsx(xn,{sideOffset:5,children:"Đang xuất báo cáo"})]})}),d.jsxs("div",{className:"flex items-center gap-4",children:[Qu&&d.jsxs(ic,{open:Qu,onOpenChange:ps,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Gp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:Sn,children:"✖"})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My OneDrive"}),d.jsx(Bd,{className:"onedrive-breadcrumb",children:d.jsx(zd,{className:"onedrive-breadcrumb-list",children:gs.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[P>0&&d.jsx(Vd,{className:"onedrive-breadcrumb-separator"}),d.jsx(fc,{className:"onedrive-breadcrumb-item",children:d.jsx(hc,{onClick:()=>sf(P),className:"cursor-pointer onedrive-breadcrumb-link",children:S.name})})]},P))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Jm?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):d.jsx(d.Fragment,{children:[...Wc,...Yc].length>0?[...Wc,...Yc].map(S=>d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${sa.some(P=>P.id===S.id)?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:sa.some(P=>P.id===S.id),onChange:P=>{P.stopPropagation(),al(S)},className:"cursor-pointer"}),S.isFolder?d.jsx(nc,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>fa(S.id,S.name)}):d.jsx(Np,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${S.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{S.isFolder?fa(S.id,S.name):al(S)},children:S.name}),!S.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[ua(S.size)," •"," ",Jn(S.lastModified.toISOString())]})]})]},S.id)):d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."})})}),d.jsxs("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:[d.jsxs("div",{className:"flex justify-end",children:[d.jsx("button",{onClick:()=>la(!0),className:"bottom-4 left-4 text-gray-600 hover:text-gray-800",title:"Đăng xuất OneDrive",children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),d.jsx("polyline",{points:"16 17 21 12 16 7"}),d.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}),d.jsxs(Fe,{className:`absolute left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,onClick:()=>nl(S=>!S),children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]}),d.jsx(Fe,{onClick:()=>{cf(sa,v),Sn()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:sa.length===0,children:"Đồng bộ"})]})]})]}),d.jsxs(ic,{open:Zu,onOpenChange:la,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi OneDrive?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>la(!1),children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>{of(),la(!1)},children:"Đăng xuất"})]})]})]}),Bo&&d.jsxs(ic,{open:Bo,onOpenChange:zo,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-50"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[700px] max-w-[90vw] max-h-[80vh] z-50 flex flex-col",children:[d.jsxs("div",{className:"relative",children:[d.jsx(Gp,{asChild:!0,children:d.jsx("button",{className:"absolute top-2 right-2 text-gray-600",onClick:_s,children:"✖"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[gt&&d.jsx("button",{onClick:()=>ca(null),className:"text-gray-600 hover:text-gray-800",children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),d.jsx("h2",{className:"text-lg font-semibold",children:"My SharePoint"})]}),gt&&d.jsx(Bd,{className:"sharepoint-breadcrumb",children:d.jsx(zd,{className:"sharepoint-breadcrumb-list",children:vs.map((S,P)=>d.jsxs("div",{className:"flex items-center",children:[P>0&&d.jsx(Vd,{className:"sharepoint-breadcrumb-separator"}),d.jsx(fc,{className:"sharepoint-breadcrumb-item",children:d.jsx(hc,{onClick:()=>ov(P),className:"cursor-pointer sharepoint-breadcrumb-link",children:S.name})})]},P))})})]}),d.jsx("div",{className:"space-y-2 mt-4 flex-1 overflow-y-auto",children:Xc?d.jsx("div",{className:"text-sm text-gray-500",children:"Đang tải nội dung thư mục... Vui lòng đợi."}):gt?[...el,...Zc].length===0?d.jsx("div",{className:"text-sm text-gray-500",children:"Không có thư mục hoặc tệp nào."}):[...el,...Zc].map(S=>{const P=ms.some(B=>B.id===S.id);return d.jsxs("div",{className:`flex items-center gap-3 p-2 rounded-lg hover:bg-gray-100 ${P?"bg-blue-100":""}`,children:[d.jsx("input",{type:"checkbox",checked:P,onChange:B=>{B.stopPropagation(),nf(S)},className:"cursor-pointer"}),S.isFolder?d.jsx(nc,{className:"text-blue-500 w-5 h-5 cursor-pointer",onClick:()=>xs(S.id,S.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")}):d.jsx(Np,{className:"text-gray-500 w-5 h-5"}),d.jsxs("div",{className:"flex-1",children:[d.jsx("div",{className:`font-medium ${S.isFolder?"cursor-pointer text-blue-600":""}`,onClick:()=>{S.isFolder&&xs(S.id,S.name,(gt==null?void 0:gt.hostname)||"",(gt==null?void 0:gt.sitePath)||"")},children:S.name}),!S.isFolder&&d.jsxs("div",{className:"text-xs text-gray-500",children:[ua(S.size)," •"," ",S.lastModified.toLocaleString()]})]})]},S.id)}):d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:ws.map(S=>d.jsxs("div",{className:"cursor-pointer bg-white shadow-md rounded-xl p-5 flex flex-col justify-center items-start transition-shadow duration-200 hover:shadow-lg border border-gray-100 min-h-[120px]",style:{overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis",whiteSpace:"normal"},onClick:()=>rv(S),children:[d.jsx("div",{className:"font-bold text-lg mb-1 truncate w-full",title:S.name,children:S.name}),d.jsx("div",{className:"text-sm text-gray-500 truncate w-full",title:S.description,children:S.description})]},S.id))})}),d.jsx("div",{className:"mt-4 flex flex-wrap justify-end gap-2",children:gt&&d.jsxs(d.Fragment,{children:[d.jsx(Fe,{onClick:()=>{nn(ms,v),_s()},className:"bg-[#1682fe] hover:bg-[#0f6cd4] text-white rounded-md px-4 py-2 transition-colors",disabled:ms.length===0,children:"Đồng bộ"}),d.jsx(Fe,{onClick:()=>ca(null),children:"Quay lại"})]})}),gt&&d.jsxs("button",{onClick:()=>nl(S=>!S),className:`absolute bottom-4 left-4 flex items-center gap-2 px-3 py-2 rounded-md text-white transition-colors ${Sr?"bg-green-500 hover:bg-green-600":"bg-gray-400 hover:bg-gray-500"}`,title:"Bật/tắt tự động cập nhật KB",children:[d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{x:"2",y:"6",width:"20",height:"12",rx:"6",ry:"6"}),d.jsx("circle",{cx:Sr?"16":"8",cy:"12",r:"2",fill:"currentColor"})]}),d.jsx("span",{className:"text-sm",children:"Tự động cập nhật KB"})]})]})]}),d.jsxs(ic,{open:Xm,onOpenChange:bs,children:[d.jsx(Ga,{className:"fixed inset-0 bg-black bg-opacity-50 z-[60]"}),d.jsxs(ja,{className:"fixed top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 bg-white p-6 rounded-lg shadow-lg w-[400px] max-w-[90vw] z-[60]",children:[d.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Xác nhận đăng xuất"}),d.jsx("p",{className:"text-gray-600 mb-6",children:"Bạn có chắc chắn muốn đăng xuất khỏi SharePoint?"}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",onClick:()=>bs(!1),children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>{tv(),bs(!1)},children:"Đăng xuất"})]})]})]})]}),d.jsx(Vn,{open:!!$c,onOpenChange:S=>{S||(Wu(!1),Yu([]),ju(""))},children:d.jsxs(Nn,{className:"max-h-[700px] pb-3 px-1 s3-explr-input-group max-w-5xl w-[90%] p-6 bg-white rounded-lg shadow-lg",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:d.jsxs("h3",{className:"font-medium mb-2",children:["Danh sách flows đang sử dụng dữ liệu từ folder(",d.jsx("span",{className:"font-bold",children:ds}),"):"," "]})}),d.jsx(Do,{className:"s3-explr-dialog-description",children:Hc?d.jsxs("div",{className:"flex items-center justify-center py-4",children:[d.jsx(St,{className:"h-6 w-6 animate-spin"}),d.jsx("span",{className:"ml-2",children:"Đang tải thông tin flows..."})]}):d.jsx("div",{children:us&&Array.isArray(us)&&us.length>0?d.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:d.jsxs("table",{className:"w-full border-collapse",children:[d.jsx("thead",{children:d.jsxs("tr",{className:"bg-gray-100",children:[d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Tên Flow"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"KnowledgeBase Id"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Loại"}),d.jsx("th",{className:"border border-gray-300 px-4 py-2 text-left",children:"Ngày tạo"})]})}),d.jsx("tbody",{children:us.map((S,P)=>d.jsxs("tr",{className:P%2===0?"bg-white":"bg-gray-50",children:[d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.name}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.KnowledgeBaseId}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.type==="MULTIAGENT"?"Agent Flow":"Chat Flow"}),d.jsx("td",{className:"border border-gray-300 px-4 py-2",children:S.createdDate?new Date(S.createdDate).toLocaleString("vi-VN"):"N/A"})]},P))})]})}):d.jsx("div",{className:"text-gray-500 italic py-2",children:"Không có flow nào sử dụng dữ liệu từ folder này"})})})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>q(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>df(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(Vn,{open:!!ee,onOpenChange:S=>!S&&q(null),children:d.jsxs(Nn,{className:"s3-explr-dialog-content",children:[d.jsxs(Pn,{className:"s3-explr-dialog-header",children:[d.jsx(On,{className:"s3-explr-dialog-title",children:"Xác nhận xóa"}),d.jsxs(Do,{className:"s3-explr-dialog-description break-words whitespace-pre-wrap",children:["Bạn có chắc chắn muốn xóa"," ",d.jsx("span",{className:"font-medium break-all",children:ee==null?void 0:ee.name}),"? Hành động này không thể hoàn tác."]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>q(null),className:"s3-explr-cancel-btn",children:"Hủy"}),d.jsx(Fe,{variant:"destructive",onClick:()=>df(ee),disabled:vn,className:"s3-explr-confirm-delete-btn",children:vn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang xóa..."]}):"Xóa"})]})]})}),d.jsx(Vn,{open:!!U,onOpenChange:S=>{S||(te(null),Ne(null),z(""),Tt(""),Y("rename"))},children:d.jsxs(Nn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:U!=null&&U.isFolder?"Đổi tên thư mục":Xi(U)?"Quản lý tập tin":"Đổi tên tập tin"})}),U&&d.jsxs(Tg,{value:R,onValueChange:S=>Y(S),children:[d.jsxs(eu,{"aria-checked":!Xi(U),"aria-disabled":U.isFolder,className:"grid w-full grid-cols-3 aria-checked:grid-cols-2 aria-disabled:grid-cols-1",children:[d.jsx(zi,{value:"rename",children:"Đổi tên"}),!U.isFolder&&d.jsxs(d.Fragment,{children:[Xi(U)&&d.jsx(zi,{value:"edit",children:"Sửa nội dung"}),d.jsx(zi,{value:"edit-metadata",children:"Sửa metadata file"})]})]}),d.jsx(Vi,{value:"rename",children:d.jsx("div",{className:"space-y-4 py-4 s3-explr-dialog-body",children:d.jsxs("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1 s3-explr-input-group",children:[d.jsx(lr,{htmlFor:"newName",className:"s3-explr-label",children:"Tên mới"}),d.jsx(Kn,{id:"newName",value:Te,onChange:S=>z(S.target.value),placeholder:"Nhập tên mới",disabled:xe,className:"s3-explr-input"})]})})}),!U.isFolder&&d.jsxs(d.Fragment,{children:[Xi(U)&&d.jsx(Vi,{value:"edit",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(St,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):d.jsxs("div",{className:"max-h-[70dvh] overflow-auto rounded-md border px-4 py-3 bg-muted/30",children:[d.jsx(lr,{htmlFor:"content",className:"block text-sm font-medium mb-2 text-muted-foreground",children:"Nội dung tập tin"}),d.jsx(vc,{id:"content",value:nt,onChange:S=>Tt(S.target.value),placeholder:"Nhập nội dung tập tin",className:"font-mono text-sm resize-none min-h-[200px] w-full",disabled:mn,style:{height:"auto",maxHeight:"60vh"},rows:Math.max(10,nt.split(`
238
+ `).length+1)})]})})}),d.jsx(Vi,{value:"edit-metadata",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(St,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"h-[70dvh] min-h-[500px] overflow-hidden overflow-y-auto pb-3 px-1",children:Ce&&typeof Ce=="object"&&Object.entries(Ce).map(([S,P],B)=>d.jsxs("div",{className:"pb-3 flex flex-col gap-2",children:[d.jsxs(lr,{htmlFor:S,className:"s3-explr-label flex items-center gap-1",children:[lD[S]||S,hg(S)&&d.jsx(qM,{className:"h-[12px] w-[12px] text-red-500"})]}),dD(S)?d.jsx(vc,{id:S,value:typeof P=="string"?P:JSON.stringify(P),onChange:fe=>{const ye={...Ce,[S]:fe.target.value};Ne(ye)},placeholder:"Nhập nội dung tập tin",className:"min-h-[200px] font-mono",disabled:mn||hg(S)}):d.jsx(Kn,{id:S,value:typeof P=="string"?P:JSON.stringify(P),onChange:fe=>{const ye={...Ce,[S]:fe.target.value};Ne(ye)},placeholder:"Nhập nội dung",className:"s3-explr-input",disabled:mn||hg(S)})]},B))})})})]})]}),d.jsxs(_r,{className:"s3-explr-dialog-footer",children:[d.jsx(Fe,{variant:"outline",onClick:()=>{te(null),Ne(null),z(""),Tt("")},className:"s3-explr-cancel-btn",children:"Hủy"}),R==="edit"?d.jsx(Fe,{onClick:()=>U&&lv(U,nt),disabled:mn||ln,className:"s3-explr-save-btn",children:mn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):R==="edit-metadata"?d.jsx(Fe,{onClick:()=>Ce&&typeof Ce=="object"&&U&&ul(U),disabled:mn||ln,className:"s3-explr-save-btn",children:mn?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang lưu..."]}):"Lưu thay đổi"}):d.jsx(Fe,{onClick:()=>{Te.trim()&&U&&Ts(U,Te.trim())},disabled:xe||!Te.trim()||Te.trim()===(U==null?void 0:U.name),className:"s3-explr-rename-btn",children:xe?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin s3-explr-loader"}),"Đang đổi tên..."]}):"Đổi tên"})]})]})}),d.jsx(Vn,{open:!!be,onOpenChange:S=>{S||(Ee(null),Tt(""))},children:d.jsxs(Nn,{className:"s3-explr-dialog-content max-w-5xl w-[90%]",children:[d.jsx(Pn,{className:"s3-explr-dialog-header",children:d.jsx(On,{className:"s3-explr-dialog-title",children:"Xem tập tin"})}),be&&d.jsxs(Tg,{value:"view",children:[d.jsx(eu,{className:"grid w-full grid-cols-1 ",children:!be.isFolder&&Xi(be)&&d.jsx(zi,{value:"view",children:"Nội dung"})}),!be.isFolder&&Xi(be)&&d.jsx(Vi,{value:"view",children:d.jsx("div",{className:"space-y-4 py-4",children:ln?d.jsx("div",{className:"flex items-center justify-center py-4",children:d.jsx(St,{className:"h-6 w-6 animate-spin"})}):d.jsx("div",{className:"overflow-hidden overflow-y-auto pb-3 px-1",children:d.jsx("div",{className:"rounded-md bg-muted p-4 font-mono text-sm overflow-auto max-h-[60vh] border",children:d.jsx("pre",{className:"whitespace-pre-wrap break-words",children:nt})})})})})]}),d.jsx(_r,{className:"s3-explr-dialog-footer",children:d.jsx(Fe,{variant:"outline",onClick:()=>{Ee(null),Tt("")},className:"s3-explr-cancel-btn",children:"Đóng"})})]})}),de&&ue&&d.jsx(SH,{openDialogRename:ue,setOpenDialogRename:Ae,apiBaseUrl:e,setFileToMove:ce,fileToMove:de,refreshFiles:dn,ignoreCache:fr,autoSyncAfterFileOperation:Zr})]})]}),rl&&d.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative s3-explr-error",children:"Đã xảy ra lỗi khi tải danh sách tập tin"}),d.jsx(_H,{onFilesSelected:(S,P)=>ha(S,v,P),children:d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Jd,{className:"s3-explr-table",children:[d.jsx(Qd,{className:"s3-explr-table-header",children:pa.getHeaderGroups().map(S=>d.jsx(zr,{className:"hover:bg-transparent s3-explr-header-row",children:S.headers.map(P=>d.jsx(lo,{className:"s3-explr-header-cell",children:P.isPlaceholder?null:Rd(P.column.columnDef.header,P.getContext())},P.id))},S.id))}),d.jsx(Xd,{className:"s3-explr-table-body",children:pa.getRowModel().rows.length===0?d.jsx(zr,{className:"s3-explr-empty-row",children:d.jsx(Gn,{colSpan:Es.length,className:"h-24 text-center s3-explr-empty-cell",children:g?d.jsxs("div",{className:"text-gray-500 s3-explr-no-results",children:['Không tìm thấy tập tin hoặc thư mục nào khớp với "',g,'"']}):d.jsx("div",{className:"text-gray-500 s3-explr-empty-message",children:Cs?"Đang tải nội dung thư mục... Vui lòng đợi":"Thư mục này không chứa tập tin hoặc thư mục con nào"})})}):pa.getRowModel().rows.map(S=>d.jsx(zr,{className:"h-12 s3-explr-row",children:S.getVisibleCells().map(P=>d.jsx(Gn,{className:"align-middle s3-explr-cell",children:Rd(P.column.columnDef.cell,P.getContext())},P.id))},S.id))})]})})}),g&&da!==0&&d.jsx(d.Fragment,{children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Wd,{onClick:()=>pr(S=>Math.max(S-1,1)),"aria-disabled":Vt===1,className:"cursor-pointer aria-disabled:pointer-events-none"}),Array.from({length:Math.ceil(da/20)},(S,P)=>{const B=P+1,fe=Math.ceil(da/20);return fe>7&&!(B===1||B===fe||B>=Vt-1&&B<=Vt+1)?B===Vt-2&&Vt>4||B===Vt+2&&Vt<fe-3?d.jsx(Yd,{className:"pointer-events-none",children:"..."},P):null:d.jsx(Br,{className:"cursor-pointer",children:d.jsx(Ya,{isActive:Vt===B,onClick:()=>pr(B),className:`${Vt===B?"bg-blue-500 text-white":"bg-white text-black"} hover:bg-blue-100`,children:B})},P)}),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>pr(S=>Math.min(S+1,Math.ceil(da/20))),"aria-disabled":Vt===Math.ceil(da/20),className:"cursor-pointer aria-disabled:pointer-events-none"})})]})})}),o&&a&&d.jsxs("div",{className:"flex justify-between items-center mt-4 s3-explr-selector-footer",children:[d.jsx("div",{className:"text-sm text-gray-500 s3-explr-selection-count",children:hf()}),d.jsx(Fe,{variant:"default",onClick:()=>a(ff()),disabled:y.size===0,className:"s3-explr-ok-btn",children:"OK"})]}),d.jsx(r3,{open:!!Bc,onClose:()=>zc(null),file:Bc,apiBaseUrl:e,rootUrlHostApi:r})]})}),g3=t=>d.jsx(J1,{clientId:i3,children:d.jsx(p3,{...t})});var Dc=t=>t.type==="checkbox",Zi=t=>t instanceof Date,qn=t=>t==null;const QE=t=>typeof t=="object";var Jt=t=>!qn(t)&&!Array.isArray(t)&&QE(t)&&!Zi(t),m3=t=>Jt(t)&&t.target?Dc(t.target)?t.target.checked:t.target.value:t,v3=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,y3=(t,e)=>t.has(v3(e)),w3=t=>{const e=t.constructor&&t.constructor.prototype;return Jt(e)&&e.hasOwnProperty("isPrototypeOf")},$m=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cn(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!($m&&(t instanceof Blob||r))&&(n||Jt(t)))if(e=n?[]:Object.create(Object.getPrototypeOf(t)),!n&&!w3(t))e=t;else for(const o in t)t.hasOwnProperty(o)&&(e[o]=cn(t[o]));else return t;return e}var zu=t=>/^\w*$/.test(t),Gt=t=>t===void 0,Hm=t=>Array.isArray(t)?t.filter(Boolean):[],Bm=t=>Hm(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Ue=(t,e,n)=>{if(!e||!Jt(t))return n;const r=(zu(e)?[e]:Bm(e)).reduce((o,a)=>qn(o)?o:o[a],t);return Gt(r)||r===t?Gt(t[e])?n:t[e]:r},vo=t=>typeof t=="boolean",$t=(t,e,n)=>{let r=-1;const o=zu(e)?[e]:Bm(e),a=o.length,s=a-1;for(;++r<a;){const l=o[r];let u=n;if(r!==s){const h=t[l];u=Jt(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=u,t=t[l]}};const XE={BLUR:"blur",FOCUS_OUT:"focusout"},qr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Uo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},b3=M.createContext(null);b3.displayName="HookFormContext";var C3=(t,e,n,r=!0)=>{const o={defaultValues:e._defaultValues};for(const a in t)Object.defineProperty(o,a,{get:()=>{const s=a;return e._proxyFormState[s]!==qr.all&&(e._proxyFormState[s]=!r||qr.all),t[s]}});return o};const x3=typeof window<"u"?M.useLayoutEffect:M.useEffect;var hr=t=>typeof t=="string",_3=(t,e,n,r,o)=>hr(t)?(r&&e.watch.add(t),Ue(n,t,o)):Array.isArray(t)?t.map(a=>(r&&e.watch.add(a),Ue(n,a))):(r&&(e.watchAll=!0),n),zm=t=>qn(t)||!QE(t);function Ci(t,e,n=new WeakSet){if(zm(t)||zm(e))return t===e;if(Zi(t)&&Zi(e))return t.getTime()===e.getTime();const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;if(n.has(t)||n.has(e))return!0;n.add(t),n.add(e);for(const a of r){const s=t[a];if(!o.includes(a))return!1;if(a!=="ref"){const l=e[a];if(Zi(s)&&Zi(l)||Jt(s)&&Jt(l)||Array.isArray(s)&&Array.isArray(l)?!Ci(s,l,n):s!==l)return!1}}return!0}var S3=(t,e,n,r,o)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:o||!0}}:{},Rc=t=>Array.isArray(t)?t:[t],ZE=()=>{let t=[];return{get observers(){return t},next:o=>{for(const a of t)a.next&&a.next(o)},subscribe:o=>(t.push(o),{unsubscribe:()=>{t=t.filter(a=>a!==o)}}),unsubscribe:()=>{t=[]}}};function e0(t,e){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],a=e[r];if(o&&Jt(o)&&a){const s=e0(o,a);Jt(s)&&(n[r]=s)}else t[r]&&(n[r]=a)}return n}var Yn=t=>Jt(t)&&!Object.keys(t).length,Vm=t=>t.type==="file",Yr=t=>typeof t=="function",Vu=t=>{if(!$m)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},t0=t=>t.type==="select-multiple",Km=t=>t.type==="radio",T3=t=>Km(t)||Dc(t),Gm=t=>Vu(t)&&t.isConnected;function E3(t,e){const n=e.slice(0,-1).length;let r=0;for(;r<n;)t=Gt(t)?r++:t[e[r++]];return t}function A3(t){for(const e in t)if(t.hasOwnProperty(e)&&!Gt(t[e]))return!1;return!0}function Qt(t,e){const n=Array.isArray(e)?e:zu(e)?[e]:Bm(e),r=n.length===1?t:E3(t,n),o=n.length-1,a=n[o];return r&&delete r[a],o!==0&&(Jt(r)&&Yn(r)||Array.isArray(r)&&A3(r))&&Qt(t,n.slice(0,-1)),t}var I3=t=>{for(const e in t)if(Yr(t[e]))return!0;return!1};function n0(t){return Array.isArray(t)||Jt(t)&&!I3(t)}function jm(t,e={}){for(const n in t)n0(t[n])?(e[n]=Array.isArray(t[n])?[]:{},jm(t[n],e[n])):Gt(t[n])||(e[n]=!0);return e}function ss(t,e,n){n||(n=jm(e));for(const r in t)n0(t[r])?Gt(e)||zm(n[r])?n[r]=jm(t[r],Array.isArray(t[r])?[]:{}):ss(t[r],qn(e)?{}:e[r],n[r]):n[r]=!Ci(t[r],e[r]);return n}const r0={value:!1,isValid:!1},o0={value:!0,isValid:!0};var i0=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Gt(t[0].attributes.value)?Gt(t[0].value)||t[0].value===""?o0:{value:t[0].value,isValid:!0}:o0:r0}return r0},a0=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>Gt(t)?t:e?t===""?NaN:t&&+t:n&&hr(t)?new Date(t):r?r(t):t;const s0={isValid:!1,value:null};var c0=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,s0):s0;function l0(t){const e=t.ref;return Vm(e)?e.files:Km(e)?c0(t.refs).value:t0(e)?[...e.selectedOptions].map(({value:n})=>n):Dc(e)?i0(t.refs).value:a0(Gt(e.value)?t.ref.value:e.value,t)}var k3=(t,e,n,r)=>{const o={};for(const a of t){const s=Ue(e,a);s&&$t(o,a,s._f)}return{criteriaMode:n,names:[...t],fields:o,shouldUseNativeValidation:r}},Ku=t=>t instanceof RegExp,Lc=t=>Gt(t)?t:Ku(t)?t.source:Jt(t)?Ku(t.value)?t.value.source:t.value:t,d0=t=>({isOnSubmit:!t||t===qr.onSubmit,isOnBlur:t===qr.onBlur,isOnChange:t===qr.onChange,isOnAll:t===qr.all,isOnTouch:t===qr.onTouched});const u0="AsyncFunction";var N3=t=>!!t&&!!t.validate&&!!(Yr(t.validate)&&t.validate.constructor.name===u0||Jt(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===u0)),P3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),f0=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const Fc=(t,e,n,r)=>{for(const o of n||Object.keys(t)){const a=Ue(t,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],o)&&!r)return!0;if(s.ref&&e(s.ref,s.name)&&!r)return!0;if(Fc(l,e))break}else if(Jt(l)&&Fc(l,e))break}}};function h0(t,e,n){const r=Ue(t,n);if(r||zu(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const a=o.join("."),s=Ue(e,a),l=Ue(t,a);if(s&&!Array.isArray(s)&&n!==a)return{name:n};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};o.pop()}return{name:n}}var O3=(t,e,n,r)=>{n(t);const{name:o,...a}=t;return Yn(a)||Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(s=>e[s]===(!r||qr.all))},M3=(t,e,n)=>!t||!e||t===e||Rc(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),D3=(t,e,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(e||t):(n?r.isOnBlur:o.isOnBlur)?!t:(n?r.isOnChange:o.isOnChange)?t:!0,R3=(t,e)=>!Hm(Ue(t,e)).length&&Qt(t,e),L3=(t,e,n)=>{const r=Rc(Ue(t,n));return $t(r,"root",e[n]),$t(t,n,r),t};function p0(t,e,n="validate"){if(hr(t)||Array.isArray(t)&&t.every(hr)||vo(t)&&!t)return{type:n,message:hr(t)?t:"",ref:e}}var cs=t=>Jt(t)&&!Ku(t)?t:{value:t,message:""},g0=async(t,e,n,r,o,a)=>{const{ref:s,refs:l,required:u,maxLength:h,minLength:p,min:g,max:w,pattern:y,validate:C,name:v,valueAsNumber:b,mount:k}=t._f,A=Ue(n,v);if(!k||e.has(v))return{};const N=l?l[0]:s,O=ce=>{o&&N.reportValidity&&(N.setCustomValidity(vo(ce)?"":ce||""),N.reportValidity())},T={},L=Km(s),H=Dc(s),W=L||H,ee=(b||Vm(s))&&Gt(s.value)&&Gt(A)||Vu(s)&&s.value===""||A===""||Array.isArray(A)&&!A.length,q=S3.bind(null,v,r,T),de=(ce,ve,K,Z=Uo.maxLength,G=Uo.minLength)=>{const re=ce?ve:K;T[v]={type:ce?Z:G,message:re,ref:s,...q(ce?Z:G,re)}};if(a?!Array.isArray(A)||!A.length:u&&(!W&&(ee||qn(A))||vo(A)&&!A||H&&!i0(l).isValid||L&&!c0(l).isValid)){const{value:ce,message:ve}=hr(u)?{value:!!u,message:u}:cs(u);if(ce&&(T[v]={type:Uo.required,message:ve,ref:N,...q(Uo.required,ve)},!r))return O(ve),T}if(!ee&&(!qn(g)||!qn(w))){let ce,ve;const K=cs(w),Z=cs(g);if(!qn(A)&&!isNaN(A)){const G=s.valueAsNumber||A&&+A;qn(K.value)||(ce=G>K.value),qn(Z.value)||(ve=G<Z.value)}else{const G=s.valueAsDate||new Date(A),re=U=>new Date(new Date().toDateString()+" "+U),J=s.type=="time",X=s.type=="week";hr(K.value)&&A&&(ce=J?re(A)>re(K.value):X?A>K.value:G>new Date(K.value)),hr(Z.value)&&A&&(ve=J?re(A)<re(Z.value):X?A<Z.value:G<new Date(Z.value))}if((ce||ve)&&(de(!!ce,K.message,Z.message,Uo.max,Uo.min),!r))return O(T[v].message),T}if((h||p)&&!ee&&(hr(A)||a&&Array.isArray(A))){const ce=cs(h),ve=cs(p),K=!qn(ce.value)&&A.length>+ce.value,Z=!qn(ve.value)&&A.length<+ve.value;if((K||Z)&&(de(K,ce.message,ve.message),!r))return O(T[v].message),T}if(y&&!ee&&hr(A)){const{value:ce,message:ve}=cs(y);if(Ku(ce)&&!A.match(ce)&&(T[v]={type:Uo.pattern,message:ve,ref:s,...q(Uo.pattern,ve)},!r))return O(ve),T}if(C){if(Yr(C)){const ce=await C(A,n),ve=p0(ce,N);if(ve&&(T[v]={...ve,...q(Uo.validate,ve.message)},!r))return O(ve.message),T}else if(Jt(C)){let ce={};for(const ve in C){if(!Yn(ce)&&!r)break;const K=p0(await C[ve](A,n),N,ve);K&&(ce={...K,...q(ve,K.message)},O(K.message),r&&(T[v]=ce))}if(!Yn(ce)&&(T[v]={ref:N,...ce},!r))return T}}return O(!0),T};const F3={mode:qr.onSubmit,reValidateMode:qr.onChange,shouldFocusError:!0};function U3(t={}){let e={...F3,...t},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Yr(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},o=Jt(e.defaultValues)||Jt(e.values)?cn(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:cn(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,h=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const w={array:ZE(),state:ZE()},y=e.criteriaMode===qr.all,C=R=>Y=>{clearTimeout(h),h=setTimeout(R,Y)},v=async R=>{if(!e.disabled&&(p.isValid||g.isValid||R)){const Y=e.resolver?Yn((await H()).errors):await ee(r,!0);Y!==n.isValid&&w.state.next({isValid:Y})}},b=(R,Y)=>{!e.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((R||Array.from(l.mount)).forEach(se=>{se&&(Y?$t(n.validatingFields,se,Y):Qt(n.validatingFields,se))}),w.state.next({validatingFields:n.validatingFields,isValidating:!Yn(n.validatingFields)}))},k=(R,Y=[],se,Ie,Q=!0,ne=!0)=>{if(Ie&&se&&!e.disabled){if(s.action=!0,ne&&Array.isArray(Ue(r,R))){const ke=se(Ue(r,R),Ie.argA,Ie.argB);Q&&$t(r,R,ke)}if(ne&&Array.isArray(Ue(n.errors,R))){const ke=se(Ue(n.errors,R),Ie.argA,Ie.argB);Q&&$t(n.errors,R,ke),R3(n.errors,R)}if((p.touchedFields||g.touchedFields)&&ne&&Array.isArray(Ue(n.touchedFields,R))){const ke=se(Ue(n.touchedFields,R),Ie.argA,Ie.argB);Q&&$t(n.touchedFields,R,ke)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=ss(o,a)),w.state.next({name:R,isDirty:de(R,Y),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else $t(a,R,Y)},A=(R,Y)=>{$t(n.errors,R,Y),w.state.next({errors:n.errors})},N=R=>{n.errors=R,w.state.next({errors:n.errors,isValid:!1})},O=(R,Y,se,Ie)=>{const Q=Ue(r,R);if(Q){const ne=Ue(a,R,Gt(se)?Ue(o,R):se);Gt(ne)||Ie&&Ie.defaultChecked||Y?$t(a,R,Y?ne:l0(Q._f)):K(R,ne),s.mount&&v()}},T=(R,Y,se,Ie,Q)=>{let ne=!1,ke=!1;const $e={name:R};if(!e.disabled){if(!se||Ie){(p.isDirty||g.isDirty)&&(ke=n.isDirty,n.isDirty=$e.isDirty=de(),ne=ke!==$e.isDirty);const Be=Ci(Ue(o,R),Y);ke=!!Ue(n.dirtyFields,R),Be?Qt(n.dirtyFields,R):$t(n.dirtyFields,R,!0),$e.dirtyFields=n.dirtyFields,ne=ne||(p.dirtyFields||g.dirtyFields)&&ke!==!Be}if(se){const Be=Ue(n.touchedFields,R);Be||($t(n.touchedFields,R,se),$e.touchedFields=n.touchedFields,ne=ne||(p.touchedFields||g.touchedFields)&&Be!==se)}ne&&Q&&w.state.next($e)}return ne?$e:{}},L=(R,Y,se,Ie)=>{const Q=Ue(n.errors,R),ne=(p.isValid||g.isValid)&&vo(Y)&&n.isValid!==Y;if(e.delayError&&se?(u=C(()=>A(R,se)),u(e.delayError)):(clearTimeout(h),u=null,se?$t(n.errors,R,se):Qt(n.errors,R)),(se?!Ci(Q,se):Q)||!Yn(Ie)||ne){const ke={...Ie,...ne&&vo(Y)?{isValid:Y}:{},errors:n.errors,name:R};n={...n,...ke},w.state.next(ke)}},H=async R=>{b(R,!0);const Y=await e.resolver(a,e.context,k3(R||l.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return b(R),Y},W=async R=>{const{errors:Y}=await H(R);if(R)for(const se of R){const Ie=Ue(Y,se);Ie?$t(n.errors,se,Ie):Qt(n.errors,se)}else n.errors=Y;return Y},ee=async(R,Y,se={valid:!0})=>{for(const Ie in R){const Q=R[Ie];if(Q){const{_f:ne,...ke}=Q;if(ne){const $e=l.array.has(ne.name),Be=Q._f&&N3(Q._f);Be&&p.validatingFields&&b([ne.name],!0);const Mt=await g0(Q,l.disabled,a,y,e.shouldUseNativeValidation&&!Y,$e);if(Be&&p.validatingFields&&b([ne.name]),Mt[ne.name]&&(se.valid=!1,Y))break;!Y&&(Ue(Mt,ne.name)?$e?L3(n.errors,Mt,ne.name):$t(n.errors,ne.name,Mt[ne.name]):Qt(n.errors,ne.name))}!Yn(ke)&&await ee(ke,Y,se)}}return se.valid},q=()=>{for(const R of l.unMount){const Y=Ue(r,R);Y&&(Y._f.refs?Y._f.refs.every(se=>!Gm(se)):!Gm(Y._f.ref))&&z(R)}l.unMount=new Set},de=(R,Y)=>!e.disabled&&(R&&Y&&$t(a,R,Y),!Ci(U(),o)),ce=(R,Y,se)=>_3(R,l,{...s.mount?a:Gt(Y)?o:hr(R)?{[R]:Y}:Y},se,Y),ve=R=>Hm(Ue(s.mount?a:o,R,e.shouldUnregister?Ue(o,R,[]):[])),K=(R,Y,se={})=>{const Ie=Ue(r,R);let Q=Y;if(Ie){const ne=Ie._f;ne&&(!ne.disabled&&$t(a,R,a0(Y,ne)),Q=Vu(ne.ref)&&qn(Y)?"":Y,t0(ne.ref)?[...ne.ref.options].forEach(ke=>ke.selected=Q.includes(ke.value)):ne.refs?Dc(ne.ref)?ne.refs.forEach(ke=>{(!ke.defaultChecked||!ke.disabled)&&(Array.isArray(Q)?ke.checked=!!Q.find($e=>$e===ke.value):ke.checked=Q===ke.value||!!Q)}):ne.refs.forEach(ke=>ke.checked=ke.value===Q):Vm(ne.ref)?ne.ref.value="":(ne.ref.value=Q,ne.ref.type||w.state.next({name:R,values:cn(a)})))}(se.shouldDirty||se.shouldTouch)&&T(R,Q,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&X(R)},Z=(R,Y,se)=>{for(const Ie in Y){if(!Y.hasOwnProperty(Ie))return;const Q=Y[Ie],ne=R+"."+Ie,ke=Ue(r,ne);(l.array.has(R)||Jt(Q)||ke&&!ke._f)&&!Zi(Q)?Z(ne,Q,se):K(ne,Q,se)}},G=(R,Y,se={})=>{const Ie=Ue(r,R),Q=l.array.has(R),ne=cn(Y);$t(a,R,ne),Q?(w.array.next({name:R,values:cn(a)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&se.shouldDirty&&w.state.next({name:R,dirtyFields:ss(o,a),isDirty:de(R,ne)})):Ie&&!Ie._f&&!qn(ne)?Z(R,ne,se):K(R,ne,se),f0(R,l)&&w.state.next({...n,name:R}),w.state.next({name:s.mount?R:void 0,values:cn(a)})},re=async R=>{s.mount=!0;const Y=R.target;let se=Y.name,Ie=!0;const Q=Ue(r,se),ne=Be=>{Ie=Number.isNaN(Be)||Zi(Be)&&isNaN(Be.getTime())||Ci(Be,Ue(a,se,Be))},ke=d0(e.mode),$e=d0(e.reValidateMode);if(Q){let Be,Mt;const tn=Y.type?l0(Q._f):m3(R),zt=R.type===XE.BLUR||R.type===XE.FOCUS_OUT,yo=!P3(Q._f)&&!e.resolver&&!Ue(n.errors,se)&&!Q._f.deps||D3(zt,Ue(n.touchedFields,se),n.isSubmitted,$e,ke),jt=f0(se,l,zt);$t(a,se,tn),zt?(!Y||!Y.readOnly)&&(Q._f.onBlur&&Q._f.onBlur(R),u&&u(0)):Q._f.onChange&&Q._f.onChange(R);const vn=T(se,tn,zt),Jr=!Yn(vn)||jt;if(!zt&&w.state.next({name:se,type:R.type,values:cn(a)}),yo)return(p.isValid||g.isValid)&&(e.mode==="onBlur"?zt&&v():zt||v()),Jr&&w.state.next({name:se,...jt?{}:vn});if(!zt&&jt&&w.state.next({...n}),e.resolver){const{errors:Vt}=await H([se]);if(ne(tn),Ie){const pr=h0(n.errors,r,se),Qr=h0(Vt,r,pr.name||se);Be=Qr.error,se=Qr.name,Mt=Yn(Vt)}}else b([se],!0),Be=(await g0(Q,l.disabled,a,y,e.shouldUseNativeValidation))[se],b([se]),ne(tn),Ie&&(Be?Mt=!1:(p.isValid||g.isValid)&&(Mt=await ee(r,!0)));Ie&&(Q._f.deps&&(!Array.isArray(Q._f.deps)||Q._f.deps.length>0)&&X(Q._f.deps),L(se,Mt,Be,vn))}},J=(R,Y)=>{if(Ue(n.errors,Y)&&R.focus)return R.focus(),1},X=async(R,Y={})=>{let se,Ie;const Q=Rc(R);if(e.resolver){const ne=await W(Gt(R)?R:Q);se=Yn(ne),Ie=R?!Q.some(ke=>Ue(ne,ke)):se}else R?(Ie=(await Promise.all(Q.map(async ne=>{const ke=Ue(r,ne);return await ee(ke&&ke._f?{[ne]:ke}:ke)}))).every(Boolean),!(!Ie&&!n.isValid)&&v()):Ie=se=await ee(r);return w.state.next({...!hr(R)||(p.isValid||g.isValid)&&se!==n.isValid?{}:{name:R},...e.resolver||!R?{isValid:se}:{},errors:n.errors}),Y.shouldFocus&&!Ie&&Fc(r,J,R?Q:l.mount),Ie},U=(R,Y)=>{let se={...s.mount?a:o};return Y&&(se=e0(Y.dirtyFields?n.dirtyFields:n.touchedFields,se)),Gt(R)?se:hr(R)?Ue(se,R):R.map(Ie=>Ue(se,Ie))},te=(R,Y)=>({invalid:!!Ue((Y||n).errors,R),isDirty:!!Ue((Y||n).dirtyFields,R),error:Ue((Y||n).errors,R),isValidating:!!Ue(n.validatingFields,R),isTouched:!!Ue((Y||n).touchedFields,R)}),be=R=>{R&&Rc(R).forEach(Y=>Qt(n.errors,Y)),w.state.next({errors:R?n.errors:{}})},Ee=(R,Y,se)=>{const Ie=(Ue(r,R,{_f:{}})._f||{}).ref,Q=Ue(n.errors,R)||{},{ref:ne,message:ke,type:$e,...Be}=Q;$t(n.errors,R,{...Be,...Y,ref:Ie}),w.state.next({name:R,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&Ie&&Ie.focus&&Ie.focus()},Ce=(R,Y)=>Yr(R)?w.state.subscribe({next:se=>"values"in se&&R(ce(void 0,Y),se)}):ce(R,Y,!0),Ne=R=>w.state.subscribe({next:Y=>{M3(R.name,Y.name,R.exact)&&O3(Y,R.formState||p,Ot,R.reRenderRoot)&&R.callback({values:{...a},...n,...Y,defaultValues:o})}}).unsubscribe,Te=R=>(s.mount=!0,g={...g,...R.formState},Ne({...R,formState:g})),z=(R,Y={})=>{for(const se of R?Rc(R):l.mount)l.mount.delete(se),l.array.delete(se),Y.keepValue||(Qt(r,se),Qt(a,se)),!Y.keepError&&Qt(n.errors,se),!Y.keepDirty&&Qt(n.dirtyFields,se),!Y.keepTouched&&Qt(n.touchedFields,se),!Y.keepIsValidating&&Qt(n.validatingFields,se),!e.shouldUnregister&&!Y.keepDefaultValue&&Qt(o,se);w.state.next({values:cn(a)}),w.state.next({...n,...Y.keepDirty?{isDirty:de()}:{}}),!Y.keepIsValid&&v()},ue=({disabled:R,name:Y})=>{(vo(R)&&s.mount||R||l.disabled.has(Y))&&(R?l.disabled.add(Y):l.disabled.delete(Y))},Ae=(R,Y={})=>{let se=Ue(r,R);const Ie=vo(Y.disabled)||vo(e.disabled);return $t(r,R,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:R}},name:R,mount:!0,...Y}}),l.mount.add(R),se?ue({disabled:vo(Y.disabled)?Y.disabled:e.disabled,name:R}):O(R,!0,Y.value),{...Ie?{disabled:Y.disabled||e.disabled}:{},...e.progressive?{required:!!Y.required,min:Lc(Y.min),max:Lc(Y.max),minLength:Lc(Y.minLength),maxLength:Lc(Y.maxLength),pattern:Lc(Y.pattern)}:{},name:R,onChange:re,onBlur:re,ref:Q=>{if(Q){Ae(R,Y),se=Ue(r,R);const ne=Gt(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,ke=T3(ne),$e=se._f.refs||[];if(ke?$e.find(Be=>Be===ne):ne===se._f.ref)return;$t(r,R,{_f:{...se._f,...ke?{refs:[...$e.filter(Gm),ne,...Array.isArray(Ue(o,R))?[{}]:[]],ref:{type:ne.type,name:R}}:{ref:ne}}}),O(R,!1,void 0,ne)}else se=Ue(r,R,{}),se._f&&(se._f.mount=!1),(e.shouldUnregister||Y.shouldUnregister)&&!(y3(l.array,R)&&s.action)&&l.unMount.add(R)}}},xe=()=>e.shouldFocusError&&Fc(r,J,l.mount),Pe=R=>{vo(R)&&(w.state.next({disabled:R}),Fc(r,(Y,se)=>{const Ie=Ue(r,se);Ie&&(Y.disabled=Ie._f.disabled||R,Array.isArray(Ie._f.refs)&&Ie._f.refs.forEach(Q=>{Q.disabled=Ie._f.disabled||R}))},0,!1))},ae=(R,Y)=>async se=>{let Ie;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let Q=cn(a);if(w.state.next({isSubmitting:!0}),e.resolver){const{errors:ne,values:ke}=await H();n.errors=ne,Q=cn(ke)}else await ee(r);if(l.disabled.size)for(const ne of l.disabled)Qt(Q,ne);if(Qt(n.errors,"root"),Yn(n.errors)){w.state.next({errors:{}});try{await R(Q,se)}catch(ne){Ie=ne}}else Y&&await Y({...n.errors},se),xe(),setTimeout(xe);if(w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Yn(n.errors)&&!Ie,submitCount:n.submitCount+1,errors:n.errors}),Ie)throw Ie},Ze=(R,Y={})=>{Ue(r,R)&&(Gt(Y.defaultValue)?G(R,cn(Ue(o,R))):(G(R,Y.defaultValue),$t(o,R,cn(Y.defaultValue))),Y.keepTouched||Qt(n.touchedFields,R),Y.keepDirty||(Qt(n.dirtyFields,R),n.isDirty=Y.defaultValue?de(R,cn(Ue(o,R))):de()),Y.keepError||(Qt(n.errors,R),p.isValid&&v()),w.state.next({...n}))},nt=(R,Y={})=>{const se=R?cn(R):o,Ie=cn(se),Q=Yn(R),ne=Q?o:Ie;if(Y.keepDefaultValues||(o=se),!Y.keepValues){if(Y.keepDirtyValues){const ke=new Set([...l.mount,...Object.keys(ss(o,a))]);for(const $e of Array.from(ke))Ue(n.dirtyFields,$e)?$t(ne,$e,Ue(a,$e)):G($e,Ue(ne,$e))}else{if($m&&Gt(R))for(const ke of l.mount){const $e=Ue(r,ke);if($e&&$e._f){const Be=Array.isArray($e._f.refs)?$e._f.refs[0]:$e._f.ref;if(Vu(Be)){const Mt=Be.closest("form");if(Mt){Mt.reset();break}}}}if(Y.keepFieldsRef)for(const ke of l.mount)G(ke,Ue(ne,ke));else r={}}a=e.shouldUnregister?Y.keepDefaultValues?cn(o):{}:cn(ne),w.array.next({values:{...ne}}),w.state.next({values:{...ne}})}l={mount:Y.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!Y.keepIsValid||!!Y.keepDirtyValues,s.watch=!!e.shouldUnregister,w.state.next({submitCount:Y.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:Y.keepDirty?n.isDirty:!!(Y.keepDefaultValues&&!Ci(R,o)),isSubmitted:Y.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:Y.keepDirtyValues?Y.keepDefaultValues&&a?ss(o,a):n.dirtyFields:Y.keepDefaultValues&&R?ss(o,R):Y.keepDirty?n.dirtyFields:{},touchedFields:Y.keepTouched?n.touchedFields:{},errors:Y.keepErrors?n.errors:{},isSubmitSuccessful:Y.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Tt=(R,Y)=>nt(Yr(R)?R(a):R,Y),ln=(R,Y={})=>{const se=Ue(r,R),Ie=se&&se._f;if(Ie){const Q=Ie.refs?Ie.refs[0]:Ie.ref;Q.focus&&(Q.focus(),Y.shouldSelect&&Yr(Q.select)&&Q.select())}},Ot=R=>{n={...n,...R}},en={control:{register:Ae,unregister:z,getFieldState:te,handleSubmit:ae,setError:Ee,_subscribe:Ne,_runSchema:H,_focusError:xe,_getWatch:ce,_getDirty:de,_setValid:v,_setFieldArray:k,_setDisabledField:ue,_setErrors:N,_getFieldArray:ve,_reset:nt,_resetDefaultValues:()=>Yr(e.defaultValues)&&e.defaultValues().then(R=>{Tt(R,e.resetOptions),w.state.next({isLoading:!1})}),_removeUnmounted:q,_disableForm:Pe,_subjects:w,_proxyFormState:p,get _fields(){return r},get _formValues(){return a},get _state(){return s},set _state(R){s=R},get _defaultValues(){return o},get _names(){return l},set _names(R){l=R},get _formState(){return n},get _options(){return e},set _options(R){e={...e,...R}}},subscribe:Te,trigger:X,register:Ae,handleSubmit:ae,watch:Ce,setValue:G,getValues:U,reset:Tt,resetField:Ze,clearErrors:be,unregister:z,setError:Ee,setFocus:ln,getFieldState:te};return{...en,formControl:en}}function $3(t={}){const e=M.useRef(void 0),n=M.useRef(void 0),[r,o]=M.useState({isDirty:!1,isValidating:!1,isLoading:Yr(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Yr(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:r},t.defaultValues&&!Yr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:s,...l}=U3(t);e.current={...l,formState:r}}const a=e.current.control;return a._options=t,x3(()=>{const s=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),a._formState.isReady=!0,s},[a]),M.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),M.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),M.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),M.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),M.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==r.isDirty&&a._subjects.state.next({isDirty:s})}},[a,r.isDirty]),M.useEffect(()=>{t.values&&!Ci(t.values,n.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),n.current=t.values,o(s=>({...s}))):a._resetDefaultValues()},[a,t.values]),M.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=C3(r,a),e.current}const m0=({className:t,children:e,content:n,side:r})=>{const[o,a]=M.useState(!1);return d.jsx(Mn,{delayDuration:0,children:d.jsxs(Dn,{open:o,children:[d.jsx(Rn,{asChild:!0,children:d.jsx("button",{type:"button",className:Ge("cursor-pointer",t),onClick:()=>a(!o),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onTouchStart:()=>a(!o),onKeyDown:s=>{s.preventDefault(),s.key==="Enter"&&a(!o)},children:e})}),d.jsx(xn,{side:r,className:n?"":"hidden",children:d.jsx("span",{className:"inline-block",children:n})})]})})},H3=(t,e)=>{const[n,r]=M.useState(t);return M.useEffect(()=>{const o=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(o)}},[t,e]),n},B3=({apiBaseUrl:t="http://localhost:3000"})=>{var L,H;const[e,n]=M.useState([]),[r,o]=M.useState(!1),[a,s]=M.useState([]),[l,u]=M.useState(1),[h,p]=M.useState(1),[g,w]=M.useState(null),[y,C]=M.useState(""),v=H3(y,500),b=W=>{const ee=W.match(/\d{6}/);if(!ee)return{month:"",year:""};const q=ee[0],de=q.substring(0,2),ce=q.substring(2);return{month:de,year:ce}},k=W=>W.map(q=>{let de=(q==null?void 0:q.month)||"",ce=(q==null?void 0:q.year)||"";if((!de||!ce)&&(q!=null&&q.file_name)){const ve=b(q.file_name);de=de||ve.month,ce=ce||ve.year}return{id:q==null?void 0:q.id,prefix:(q==null?void 0:q.prefix)||"",model:(q==null?void 0:q.model)||"",fileName:(q==null?void 0:q.file_name)||"",code:(q==null?void 0:q.stock_id)||"",month:de,year:ce,content:(q==null?void 0:q.text_summary)||"",status:(q==null?void 0:q.status)||"",note:(q==null?void 0:q.note)||"",lastUpdate:q==null?void 0:q.updated_at,stock_id:q==null?void 0:q.stock_id}}),A=W=>{if(!(W!=null&&W.data))return[];const ee=k(W==null?void 0:W.data);n(ee),p(W.pagination.totalPages)},N=async(W=1,ee=15)=>{w(W),o(!0);try{const q=await Le.get(`${t}/api/latest-summaries`,{params:{page:W,limit:ee,search:y}});(q==null?void 0:q.status)===200?A(q.data):console.error(q)}catch(q){console.error("Error fetching data:",q)}finally{w(null),o(!1)}};M.useEffect(()=>{v&&u(1),N(l)},[l,v]);const O=M.useMemo(()=>[{id:"code",header:"Mã",accessorKey:"code",cell:({row:ee})=>d.jsx("span",{className:"flex flex-col",children:ee.original.code})},{id:"month",header:"Tháng",accessorKey:"month",cell:({row:ee})=>{const q=ee.original.month,de=ee.original.year;return d.jsx("span",{className:"flex flex-col",children:`${q.toString().padStart(2,"0")}/${de}`})}},{id:"content",header:"Nội dung",accessorKey:"content",cell:({row:ee})=>{const q=ee.getValue("content");return d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]",children:q})}},{id:"status",header:"Trạng thái",accessorKey:"status",cell:({row:ee})=>{const de=ee.original.status!=="unpublish";return d.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0 text-[10px] font-bold ${de?"bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20":"bg-gray-50 text-gray-600 ring-1 ring-inset ring-gray-500/20"}`,children:de?"PUBLISHED":"UNPUBLISHED"})}},{id:"note",header:"Ghi chú",accessorKey:"note",cell:({row:ee})=>d.jsx(m0,{content:d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:ee.original.note}),children:d.jsx("div",{className:"text-start truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[20dvw]",children:ee.original.note})})},{id:"last-update",header:"Cập nhật",accessorKey:"last-update",cell:({row:ee})=>{const q=new Date(ee.original.lastUpdate),de=q.getDate(),ce=q.getMonth()+1,ve=`ngày ${de} tháng ${ce}`;return d.jsx("span",{className:"flex flex-col",children:ve})}},{accessorKey:"actions",header:()=>d.jsx("div",{className:"font-medium text-right",children:"Hành động"}),cell:({row:ee})=>{const[q,de]=M.useState(!1),[ce,ve]=M.useState(!1),[K,Z]=M.useState(!1),{handleSubmit:G,register:re,reset:J}=$3(),X=ee.original.id,U=ee.getValue("status"),te=ee.getValue("content"),[be,Ee]=M.useState(!1),Ce=async()=>{try{Ee(!0);const Te=U==="unpublish"?"published":"unpublish",z=await Le.patch(`${t}/api/toggle-publish/${X}`,{id:X,typeAction:"update",status:U,idInput:X,stock_id:ee.original.stock_id,prefix:ee.original.prefix,model:ee.original.model,summary_result:ee.original.content,note:ee.original.note});z.status===200?n(ue=>ue.map(Ae=>Ae.id===X?{...Ae,status:Te}:Ae)):console.error("Failed to toggle publish status:",z)}catch(Te){console.error("Error toggling publish status:",Te)}finally{Ee(!1)}},Ne=async Te=>{de(!0);try{const z=await Le.patch(`${t}/api/update-summary`,{note:Te.note,text_summary:Te.content,id:X});z.status===200?(await N(l),ve(!1)):console.error("Failed to update summary:",z)}catch(z){console.error("Error updating summary:",z)}return de(!1)};return d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>Z(!0),className:"px-2 py-0.5 h-7",children:d.jsx(yx,{className:"h-4 w-4"})}),d.jsx(Vn,{open:K,onOpenChange:Z,children:d.jsxs(Nn,{className:"max-w-3xl max-h-[80vh]",children:[d.jsx(Pn,{children:d.jsx(On,{children:"Nội dung chi tiết"})}),d.jsx("div",{className:"mt-4 overflow-y-auto max-h-[60vh]",children:d.jsx("div",{className:"whitespace-pre-wrap text-[16px] leading-relaxed",children:te})})]})}),d.jsxs(Vn,{open:ce,onOpenChange:Te=>{ve(Te),Te?J({content:ee.original.content,note:ee.original.note}):J()},children:[d.jsx(gc,{asChild:!0,children:d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>ve(!0),className:"px-2 py-0.5 h-7",children:"Sửa"})}),d.jsx(Nn,{className:"rounded-lg sm:px-3 h-[calc(100dvh-200px)] min-w-[calc(100dvw-112px)]",children:d.jsxs(Pn,{className:"flex flex-col gap-3",children:[d.jsx(On,{className:"max-sm:hidden text-center",children:"Sửa summary"}),d.jsxs("form",{className:"flex flex-col gap-3 h-full justify-between",onSubmit:G(Ne),children:[d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Nội dung:"}),d.jsx(vc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.answer||"",rows:10,...re("content")})]}),d.jsxs("div",{className:"flex flex-col items-start",children:[d.jsx("span",{children:"Ghi chú:"}),d.jsx(vc,{placeholder:"Nội dung",className:"w-full input-scroll-bar",defaultValue:ee.original.note||"",rows:1,...re("note")})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(Fe,{disabled:q,type:"submit",variant:"default",children:q?d.jsx(St,{className:"h-4 w-4 animate-spin"}):"Ok"})})]})]})})]}),d.jsx(Fe,{variant:"outline",size:"sm",onClick:Ce,disabled:be,className:"w-[70px] px-2 py-0.5 h-7",children:be?d.jsx(St,{className:"h-4 w-4 animate-spin"}):U==="unpublish"?"Publish":"Unpublish"})]})}}],[]),T=fx({data:e,columns:O,state:{columnFilters:a},enableRowSelection:!0,onColumnFiltersChange:s,getFilteredRowModel:PM(),getCoreRowModel:ux()});return d.jsxs("div",{className:"space-y-4 s3-explr-container",children:[d.jsx("div",{className:"flex items-center space-x-4 s3-explr-toolbar",children:d.jsxs("div",{className:"relative max-w-sm",children:[d.jsx(Kn,{placeholder:"Tìm kiếm theo mã...",value:y,onChange:W=>C(W.target.value),className:"pr-8"}),y&&d.jsx(Fe,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",onClick:()=>C(""),children:d.jsx(dg,{className:"h-4 w-4"})})]})}),d.jsx("div",{className:"rounded-md border s3-explr-table-container",children:d.jsxs(Jd,{className:"s3-explr-table",children:[d.jsx(Qd,{className:"s3-explr-table-header",children:T.getHeaderGroups().map(W=>d.jsx(zr,{className:"hover:bg-transparent s3-explr-header-row",children:W.headers.map(ee=>d.jsx(lo,{className:"s3-explr-header-cell",children:ee.isPlaceholder?null:Rd(ee.column.columnDef.header,ee.getContext())},ee.id))},W.id))}),d.jsx(Xd,{className:"s3-explr-table-body",children:r?d.jsx(zr,{children:d.jsx(Gn,{colSpan:O.length,className:"h-24 text-center",children:"Đang tải dữ liệu..."})}):(L=T.getRowModel().rows)!=null&&L.length?(H=T.getRowModel().rows)==null?void 0:H.map(W=>d.jsx(zr,{className:"h-12 s3-explr-row",children:W.getVisibleCells().map(ee=>d.jsx(Gn,{className:"align-middle s3-explr-cell",children:Rd(ee.column.columnDef.cell,ee.getContext())},ee.id))},W.id)):d.jsx(zr,{children:d.jsx(Gn,{colSpan:O.length,className:"h-24 text-center",children:"Không có kết quả."})})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Br,{children:d.jsx(Wd,{onClick:()=>u(W=>Math.max(1,W-1)),className:l===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:h},(W,ee)=>ee+1).filter(W=>W===1||W===h||Math.abs(W-l)<=1).map((W,ee,q)=>d.jsxs(d.Fragment,{children:[ee>0&&q[ee-1]!==W-1&&d.jsx(Br,{children:d.jsx(Yd,{})},W+"..."),d.jsx(Br,{children:d.jsx(Ya,{onClick:()=>u(W),isActive:l===W,className:`cursor-pointer ${r?"pointer-events-none":""}`,children:g===W?d.jsx(St,{className:"h-4 w-4 animate-spin"}):W})},W)]})),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>u(W=>Math.min(h,W+1)),className:l===h||g!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})},v0=10,z3=M.memo(({apiBaseUrl:t="http://localhost:3000"})=>{const[e,n]=M.useState(1),[r,o]=M.useState([]),[a,s]=M.useState({total:0,page:1,limit:v0,totalPages:1}),[l,u]=M.useState(!0),[h,p]=M.useState(null),[g,w]=M.useState(new Set),{toast:y}=bc(),[C,v]=M.useState(!1),b=async T=>{try{p(T);const L=await Le.get(`${t}/api/jobs`,{params:{page:T.toString(),limit:v0.toString()}});o(L.data.data),s(L.data.pagination)}catch{y({variant:"destructive",title:"Error",description:"Failed to fetch jobs. Please try again."})}finally{p(null),u(!1)}};M.useEffect(()=>{b(e)},[e,t]);const k=async T=>{w(L=>new Set(L).add(T.toString()));try{await Le.post(`${t}/api/retry-job`,{jobId:T}),y({title:"Job Restarted",description:`Job ${T} has been successfully restarted.`}),b(e)}catch{y({variant:"destructive",title:"Retry Failed",description:`Failed to restart job ${T}. Please try again.`})}finally{w(L=>{const H=new Set(L);return H.delete(T.toString()),H})}},A=async()=>{v(!0),n(1),await b(1),v(!1)},N=T=>new Date(T).toLocaleString(),O=T=>{if(T=parseFloat(T),T<60)return`${T.toFixed(2)}s`;const L=Math.floor(T/60),H=(T%60).toFixed(0);return`${L}m ${H}s`};return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[d.jsx(HM,{className:"w-8 h-8 text-primary"}),d.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:"Job Management"}),d.jsx(Fe,{variant:"outline",size:"icon",onClick:A,disabled:C||l,className:"ml-2",children:d.jsx(YM,{className:`h-4 w-4 ${C?"animate-spin":""}`})})]}),d.jsx("div",{className:"rounded-md border",children:d.jsxs(Jd,{children:[d.jsx(Qd,{children:d.jsxs(zr,{children:[d.jsx(lo,{children:"ID"}),d.jsx(lo,{children:"Tên Công Việc"}),d.jsx(lo,{children:"Thời Gian Bắt Đầu"}),d.jsx(lo,{children:"Thời Gian Cập Nhật"}),d.jsx(lo,{children:"Thời Gian Thực Thi"}),d.jsx(lo,{children:"Trạng Thái"}),d.jsx(lo,{children:"Thao Tác"})]})}),d.jsx(Xd,{children:l&&r.length===0?d.jsx(zr,{children:d.jsx(Gn,{colSpan:7,className:"text-center py-4",children:d.jsx(St,{className:"w-6 h-6 animate-spin mx-auto"})})}):r.map(T=>{var L,H;return d.jsxs(zr,{children:[d.jsx(Gn,{className:"!w-[100px]",children:T.id}),d.jsx(Gn,{className:"font-medium",children:(L=T.job_name)==null?void 0:L.replace("Upload file","Summary")}),d.jsx(Gn,{className:"!w-[200px]",children:N(T.created_at)}),d.jsx(Gn,{className:"!w-[200px]",children:N(T.updated_at)}),d.jsx(Gn,{className:"!w-[150px]",children:O(T.execution_time_seconds)}),d.jsx(Gn,{className:"!w-[200px]",children:d.jsx(m0,{content:T.status==="fail"&&T.error?d.jsx("div",{className:"font-medium text-[16px] max-w-[90dvw]",children:T.error}):null,children:d.jsx("div",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium truncate text-ellipsis overflow-hidden whitespace-nowrap max-w-[30dvw]
239
+ ${T.status==="done"?"bg-green-100 text-green-800":T.status==="fail"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:T.status==="fail"?"FAILED":(H=T.status)==null?void 0:H.toUpperCase()})})}),d.jsx(Gn,{className:"!w-[200px]",children:T.status==="fail"?d.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>k(T.id),disabled:g.has(T.id.toString()),className:"h-[32px]",children:g.has(T.id.toString())?d.jsxs(d.Fragment,{children:[d.jsx(St,{className:"mr-2 h-4 w-4 animate-spin"}),"Đang thử lại..."]}):"Thử Lại"}):d.jsx("div",{className:"h-[32px]"})})]},T.id)})})]})}),d.jsx("div",{className:"mt-4",children:d.jsx(Gd,{children:d.jsxs(jd,{children:[d.jsx(Br,{children:d.jsx(Wd,{onClick:()=>n(T=>Math.max(1,T-1)),className:e===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:a.totalPages},(T,L)=>L+1).filter(T=>T===1||T===a.totalPages||Math.abs(T-e)<=1).map((T,L,H)=>d.jsxs(d.Fragment,{children:[L>0&&H[L-1]!==T-1&&d.jsx(Br,{children:d.jsx(Yd,{})},T+"..."),d.jsx(Br,{children:d.jsx(Ya,{onClick:()=>n(T),isActive:e===T,className:`cursor-pointer ${h!==null?"pointer-events-none":""}`,children:h===T?d.jsx(St,{className:"h-4 w-4 animate-spin"}):T})},T)]})),d.jsx(Br,{children:d.jsx(qd,{onClick:()=>n(T=>Math.min(a.totalPages,T+1)),className:e===a.totalPages||h!==null?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),d.jsx(H_,{})]})});Or.Job=z3,Or.S3Explorer=g3,Or.Summary=B3,Object.defineProperty(Or,Symbol.toStringTag,{value:"Module"})});
240
240
  //# sourceMappingURL=s3-explorer.umd.cjs.map