diff --git a/build.gradle b/build.gradle index 516a54630..b9709513b 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { } group = 'com.sprint.mission' -version = '2.3-M11' +version = '3.0-M12' java { toolchain { @@ -26,6 +26,9 @@ repositories { dependencies { + //웹 소켓 + implementation 'org.springframework.boot:spring-boot-starter-websocket' + // Caffeine 캐시 implementation 'org.springframework.boot:spring-boot-starter-cache' implementation 'com.github.ben-manes.caffeine:caffeine' diff --git a/src/main/java/com/sprint/mission/discodeit/async/BinaryContentUploadExecutor.java b/src/main/java/com/sprint/mission/discodeit/async/BinaryContentUploadExecutor.java index d8818bc69..3c46a73c1 100644 --- a/src/main/java/com/sprint/mission/discodeit/async/BinaryContentUploadExecutor.java +++ b/src/main/java/com/sprint/mission/discodeit/async/BinaryContentUploadExecutor.java @@ -1,11 +1,14 @@ package com.sprint.mission.discodeit.async; +import com.sprint.mission.discodeit.dto.binaryContent.BinaryContentDto; import com.sprint.mission.discodeit.entity.BinaryContentUploadStatus; import com.sprint.mission.discodeit.entity.NotificationType; import com.sprint.mission.discodeit.exception.file.FileSaveFailedException; +import com.sprint.mission.discodeit.mapper.BinaryContentMapper; import com.sprint.mission.discodeit.notification.NotificationEvent; import com.sprint.mission.discodeit.notification.NotificationEventPublisher; import com.sprint.mission.discodeit.repository.jpa.BinaryContentRepository; +import com.sprint.mission.discodeit.service.basic.SseService; import com.sprint.mission.discodeit.storage.BinaryContentStorage; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -27,18 +30,28 @@ public class BinaryContentUploadExecutor { private final BinaryContentRepository binaryContentRepository; private final NotificationEventPublisher notificationEventPublisher; + private final BinaryContentMapper binaryContentMapper; + private final SseService sseService; + @Async @Retryable( value = FileSaveFailedException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000) ) - public void uploadAsync(UUID id, byte[] bytes, String requestId) { + public void uploadAsync(UUID id, byte[] bytes, UUID requestId) { try { MDC.put("requestId", requestId); storage.put(id, bytes); binaryContentRepository.updateUploadStatus(id, BinaryContentUploadStatus.SUCCESS); log.info("업로드 성공 - id: {}", id); + + //파일 업로드 상태 변경 이벤트 전송 + binaryContentRepository.findById(id).ifPresent(content -> { + BinaryContentDto dto = binaryContentMapper.toDto(content); + sseService.sendBinaryStatus(requestId, dto); + }); + } finally { MDC.clear(); } diff --git a/src/main/java/com/sprint/mission/discodeit/config/SchedulingConfig.java b/src/main/java/com/sprint/mission/discodeit/config/SchedulingConfig.java new file mode 100644 index 000000000..0362941db --- /dev/null +++ b/src/main/java/com/sprint/mission/discodeit/config/SchedulingConfig.java @@ -0,0 +1,9 @@ +package com.sprint.mission.discodeit.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; + +@Configuration +@EnableScheduling +public class SchedulingConfig { +} \ No newline at end of file diff --git a/src/main/java/com/sprint/mission/discodeit/config/WebSocketConfig.java b/src/main/java/com/sprint/mission/discodeit/config/WebSocketConfig.java new file mode 100644 index 000000000..ead43ecb6 --- /dev/null +++ b/src/main/java/com/sprint/mission/discodeit/config/WebSocketConfig.java @@ -0,0 +1,24 @@ +package com.sprint.mission.discodeit.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.messaging.simp.config.MessageBrokerRegistry; +import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; +import org.springframework.web.socket.config.annotation.StompEndpointRegistry; +import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer; + +@Configuration +@EnableWebSocketMessageBroker +public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { + + @Override + public void configureMessageBroker(MessageBrokerRegistry registry) { + registry.enableSimpleBroker("/sub"); + registry.setApplicationDestinationPrefixes("/pub"); // pub 메시지 -> @MessageMapping 라우팅됨 + } + + @Override + public void registerStompEndpoints(StompEndpointRegistry registry) { + //웹소켓 연결 endpoint /ws + registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS(); + } +} \ No newline at end of file diff --git a/src/main/java/com/sprint/mission/discodeit/controller/SseController.java b/src/main/java/com/sprint/mission/discodeit/controller/SseController.java new file mode 100644 index 000000000..493f5a669 --- /dev/null +++ b/src/main/java/com/sprint/mission/discodeit/controller/SseController.java @@ -0,0 +1,25 @@ +package com.sprint.mission.discodeit.controller; + +import com.sprint.mission.discodeit.dto.user.UserDto; +import com.sprint.mission.discodeit.service.basic.SseService; +import lombok.RequiredArgsConstructor; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +@RestController +@RequiredArgsConstructor +public class SseController { + + private final SseService sseService; + + @GetMapping("/api/sse") + public SseEmitter connect( + @AuthenticationPrincipal UserDto user, + @RequestHeader(value = "Last-Event-ID", required = false) String lastEventId) { + + return sseService.subscribe(user.getId(), lastEventId); + } +} \ No newline at end of file diff --git a/src/main/java/com/sprint/mission/discodeit/controller/WebSocketMessageController.java b/src/main/java/com/sprint/mission/discodeit/controller/WebSocketMessageController.java new file mode 100644 index 000000000..6050494b1 --- /dev/null +++ b/src/main/java/com/sprint/mission/discodeit/controller/WebSocketMessageController.java @@ -0,0 +1,29 @@ +package com.sprint.mission.discodeit.controller; + +import com.sprint.mission.discodeit.dto.message.MessageCreateDTO; +import com.sprint.mission.discodeit.dto.message.MessageDto; +import com.sprint.mission.discodeit.service.MessageService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.messaging.handler.annotation.MessageMapping; +import org.springframework.messaging.simp.SimpMessagingTemplate; +import org.springframework.stereotype.Controller; + +import java.util.List; + +@Slf4j +@RequiredArgsConstructor +@Controller +public class WebSocketMessageController { + + private final MessageService messageService; + private final SimpMessagingTemplate messagingTemplate; + + @MessageMapping("/messages") + public void handleTextMessage(MessageCreateDTO request) { + MessageDto saved = messageService.create(request, List.of()); + + String dest = "/sub/channels." + request.getChannelId() + ".messages"; + messagingTemplate.convertAndSend(dest, saved); + } +} \ No newline at end of file diff --git a/src/main/java/com/sprint/mission/discodeit/dto/notification/NotificationDto.java b/src/main/java/com/sprint/mission/discodeit/dto/notification/NotificationDto.java index 787b658b1..22b406ab9 100644 --- a/src/main/java/com/sprint/mission/discodeit/dto/notification/NotificationDto.java +++ b/src/main/java/com/sprint/mission/discodeit/dto/notification/NotificationDto.java @@ -6,6 +6,7 @@ import java.time.Instant; import java.util.UUID; + @Builder public record NotificationDto( UUID id, diff --git a/src/main/java/com/sprint/mission/discodeit/notification/NotificationEventListener.java b/src/main/java/com/sprint/mission/discodeit/notification/NotificationEventListener.java index 7deba41b2..4d3df032c 100644 --- a/src/main/java/com/sprint/mission/discodeit/notification/NotificationEventListener.java +++ b/src/main/java/com/sprint/mission/discodeit/notification/NotificationEventListener.java @@ -1,6 +1,9 @@ package com.sprint.mission.discodeit.notification; +import com.sprint.mission.discodeit.entity.Notification; +import com.sprint.mission.discodeit.mapper.NotificationMapper; import com.sprint.mission.discodeit.service.basic.BasicNotificationService; +import com.sprint.mission.discodeit.service.basic.SseService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; @@ -14,12 +17,17 @@ public class NotificationEventListener { private final BasicNotificationService notificationService; + private final NotificationMapper notificationMapper; + private final SseService sseService; @Async @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) public void handle(NotificationEvent event) { try { - notificationService.send(event); + Notification notification = notificationService.send(event); + + sseService.sendNotification(event.receiverId(), notificationMapper.toDto(notification)); + } catch (Exception e) { log.error("알림 저장 실패: {}", event, e); throw e; // @Retryable을 사용하면 자동 재시도 가능 diff --git a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicChannelService.java b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicChannelService.java index 7892bced9..fdf74762c 100644 --- a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicChannelService.java +++ b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicChannelService.java @@ -40,6 +40,8 @@ public class BasicChannelService implements ChannelService { private final ChannelMapper channelMapper; private final JwtSessionRepository jwtSessionRepository; + private final SseService sseService; + @CacheEvict(cacheNames = "channelsByUser", allEntries = true) @Override @@ -69,6 +71,10 @@ public ChannelDto create(ChannelCreatePrivateDTO dto) { }) .toList(); + //SSE 이벤트 전송 + dto.getParticipantIds().forEach(userId -> + sseService.sendChannelRefresh(userId, channel.getId())); + Instant lastMessageAt = findLastMessageAt(channel); log.info("private 채널 생성 완료 id: {}", channel.getId()); @@ -129,6 +135,13 @@ public ChannelDto update(UUID id, ChannelUpdateDTO dto) { } findChannel.setChannel(dto.getNewName(), dto.getNewDescription()); + //public 채널 수정이니 모든 사용자에게 채널 목록 갱신 알림 전송 + List allUserIds = userRepository.findAll().stream() + .map(User::getId) + .toList(); + allUserIds.forEach(userId -> + sseService.sendChannelRefresh(userId, findChannel.getId())); + Instant lastMessageAt = findLastMessageAt(findChannel); log.info("채널 수정 완료 id: {}", findChannel.getId()); return channelMapper.toDto(findChannel, List.of(), lastMessageAt); @@ -137,10 +150,23 @@ public ChannelDto update(UUID id, ChannelUpdateDTO dto) { @CacheEvict(cacheNames = "channelsByUser", allEntries = true) @Override public void delete(UUID id) { - if (!channelRepository.existsById(id)) { - throw new ChannelNotFoundException(id); - } + Channel channel = channelRepository.findById(id) + .orElseThrow(() -> new ChannelNotFoundException(id)); + channelRepository.deleteById(id); + + //채널 삭제시, 해당 채널이 private 면 참가자만, public이면 전체 사용자 + List targetUserIds = channel.getChannelType() == ChannelType.PRIVATE + ? readStatusRepository.findAllByChannel(channel).stream() + .map(rs -> rs.getUser().getId()) + .toList() + : userRepository.findAll().stream() + .map(User::getId) + .toList(); + + targetUserIds.forEach(userId -> + sseService.sendChannelRefresh(userId, channel.getId())); + log.info("채널 삭제 완료 id: {}", id); } diff --git a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicMessageService.java b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicMessageService.java index 6b211fbcf..c462febbe 100644 --- a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicMessageService.java +++ b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicMessageService.java @@ -80,7 +80,7 @@ public MessageDto create(MessageCreateDTO dto, @Override public void afterCommit() { String requestId = MDC.get("requestId"); - uploadExecutor.uploadAsync(savedBinaryContent.getId(), attachmentRequest.getBytes(), requestId); + uploadExecutor.uploadAsync(savedBinaryContent.getId(), attachmentRequest.getBytes(), dto.getAuthorId()); } } ); diff --git a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicNotificationService.java b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicNotificationService.java index cb915942b..531573064 100644 --- a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicNotificationService.java +++ b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicNotificationService.java @@ -59,7 +59,7 @@ public void delete(UUID notificationId, UUID currentUserId) { ) @CacheEvict(cacheNames = "notificationsByUser", key = "#event.receiverId") @Transactional - public void send(NotificationEvent event) { + public Notification send(NotificationEvent event) { Notification notification = Notification.builder() .receiver(User.withId(event.receiverId())) // User.withId()는 직접 만든 정적 팩토리 메서드 (프록시 생성용) .title(event.title()) @@ -68,6 +68,6 @@ public void send(NotificationEvent event) { .targetId(event.targetId()) .build(); - notificationRepository.save(notification); + return notificationRepository.save(notification); } } \ No newline at end of file diff --git a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicUserService.java b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicUserService.java index b245b44bb..65bf31c6f 100644 --- a/src/main/java/com/sprint/mission/discodeit/service/basic/BasicUserService.java +++ b/src/main/java/com/sprint/mission/discodeit/service/basic/BasicUserService.java @@ -53,6 +53,8 @@ public class BasicUserService implements UserService { private final NotificationEventPublisher notificationEventPublisher; + private final SseService sseService; + @CacheEvict(cacheNames = "allUsers", allEntries = true) @Override @@ -76,11 +78,40 @@ public UserDto create(UserCreateDTO dto, //cascade persist User saveUser = userRepository.save(user); + + // 유저가 생성되고 아이디를 받기 위해서 생성 이후 비동기 호출 + optionalProfileCreateRequest.ifPresent(request -> { + byte[] bytes = request.getBytes(); + registerUploadAfterCommit(saveUser.getId(), nullableProfile.getId(), bytes); + }); + + //사용자 목록 갱신 알림 + notifyAllUsersToRefreshUserList(); + log.info("사용자 생성 완료 id: {}", saveUser.getId()); return userMapper.toDto(saveUser, isUserOnline(saveUser)); } + private void registerUploadAfterCommit(UUID userId, UUID binaryContentId, byte[] bytes) { + TransactionSynchronizationManager.registerSynchronization( + new TransactionSynchronization() { + @Override + public void afterCommit() { + uploadExecutor.uploadAsync(binaryContentId, bytes, userId); + } + } + ); + } + + private void notifyAllUsersToRefreshUserList() { + List allUserIds = userRepository.findAll().stream() + .map(User::getId) + .toList(); + + sseService.sendUserRefreshToAll(allUserIds); + } + @Override @Transactional(readOnly = true) public UserDto find(UUID id) { @@ -121,6 +152,15 @@ public UserDto update(UUID id, UserUpdateDTO dto, log.info("사용자 수정 완료 id: {}", findUser.getId()); + //비동기 호출 + optionalProfileCreateRequest.ifPresent(request -> { + byte[] bytes = request.getBytes(); + registerUploadAfterCommit(findUser.getId(), nullableProfile.getId(), bytes); + }); + + //사용자 목록 갱신 알림 + notifyAllUsersToRefreshUserList(); + return userMapper.toDto(findUser, isUserOnline(findUser)); } @@ -132,6 +172,10 @@ public void delete(UUID id) { throw new UserNotFoundException(id); } userRepository.deleteById(id); + + //사용자 목록 갱신 알림 + notifyAllUsersToRefreshUserList(); + log.info("사용자 삭제 완료 id: {}", id); } @@ -167,7 +211,7 @@ public BinaryContent saveBinaryFile( binaryContent.updateUploadStatus(BinaryContentUploadStatus.WAITING); BinaryContent saved = binaryContentRepository.save(binaryContent); - //비동기 업로드 등록 -> 트랜잭션 커밋 이후 실행 +/* //비동기 업로드 등록 -> 트랜잭션 커밋 이후 실행 TransactionSynchronizationManager.registerSynchronization( new TransactionSynchronization() { @Override @@ -176,7 +220,7 @@ public void afterCommit() { uploadExecutor.uploadAsync(saved.getId(), bytes, requestId); } } - ); + );*/ return saved; }) diff --git a/src/main/java/com/sprint/mission/discodeit/service/basic/SseService.java b/src/main/java/com/sprint/mission/discodeit/service/basic/SseService.java new file mode 100644 index 000000000..b2847f508 --- /dev/null +++ b/src/main/java/com/sprint/mission/discodeit/service/basic/SseService.java @@ -0,0 +1,97 @@ +package com.sprint.mission.discodeit.service.basic; + +import com.sprint.mission.discodeit.dto.binaryContent.BinaryContentDto; +import com.sprint.mission.discodeit.dto.notification.NotificationDto; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import java.io.IOException; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CopyOnWriteArrayList; + +@Service +@RequiredArgsConstructor +public class SseService { + + // 사용자 ID → SseEmitter 리스트 (스레드 세이프) + private final Map> emitters = new ConcurrentHashMap<>(); + + public SseEmitter subscribe(UUID userId, String lastEventId) { + SseEmitter emitter = new SseEmitter(60_000L); // 60초 타임아웃 + + emitters.computeIfAbsent(userId, id -> new CopyOnWriteArrayList<>()).add(emitter); + + emitter.onCompletion(() -> removeEmitter(userId, emitter)); + emitter.onTimeout(() -> removeEmitter(userId, emitter)); + emitter.onError(e -> removeEmitter(userId, emitter)); + + try { + emitter.send(SseEmitter.event() + .id("init-" + System.currentTimeMillis()) + .name("sse-init") + .data("connected")); + } catch (IOException ignored) {} + + return emitter; + } + + private void removeEmitter(UUID userId, SseEmitter emitter) { + List list = emitters.get(userId); + if (list != null) { + list.remove(emitter); + } + } + + @Scheduled(fixedDelay = 30_000) + public void sendPing() { + emitters.forEach((userId, emitterList) -> { + for (SseEmitter emitter : emitterList) { + try { + emitter.send(SseEmitter.event() + .id("ping-" + System.currentTimeMillis()) + .name("ping") + .data("keep-alive")); + } catch (Exception e) { + removeEmitter(userId, emitter); + } + } + }); + } + + public void sendNotification(UUID userId, NotificationDto dto) { + send(userId, "notifications", dto, dto.id().toString()); + } + + public void sendBinaryStatus(UUID userId, BinaryContentDto dto) { + send(userId, "binaryContents.status", dto, dto.getId().toString()); + } + + public void sendChannelRefresh(UUID userId, UUID channelId) { + send(userId, "channels.refresh", Map.of("channelId", channelId), channelId.toString()); + } + + public void sendUserRefresh(UUID userId) { + send(userId, "users.refresh", Map.of("userId", userId), userId.toString()); + } + + public void sendUserRefreshToAll(Collection userIds) { + userIds.forEach(this::sendUserRefresh); + } + + private void send(UUID userId, String eventName, Object data, String id) { + List userEmitters = emitters.getOrDefault(userId, new CopyOnWriteArrayList<>()); + for (SseEmitter emitter : new ArrayList<>(userEmitters)) { + try { + emitter.send(SseEmitter.event() + .id(id) + .name(eventName) + .data(data)); + } catch (Exception e) { + removeEmitter(userId, emitter); + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/static/assets/index-BDMoC4ds.js b/src/main/resources/static/assets/index-BDMoC4ds.js deleted file mode 100644 index c05827b32..000000000 --- a/src/main/resources/static/assets/index-BDMoC4ds.js +++ /dev/null @@ -1,1423 +0,0 @@ -var gg=Object.defineProperty;var yg=(n,i,s)=>i in n?gg(n,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[i]=s;var of=(n,i,s)=>yg(n,typeof i!="symbol"?i+"":i,s);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).observe(document,{childList:!0,subtree:!0});function s(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(c){if(c.ep)return;c.ep=!0;const d=s(c);fetch(c.href,d)}})();function vg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ya={exports:{}},wo={},va={exports:{}},de={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var sf;function xg(){if(sf)return de;sf=1;var n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),R=Symbol.iterator;function T(C){return C===null||typeof C!="object"?null:(C=R&&C[R]||C["@@iterator"],typeof C=="function"?C:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function _(C,D,se){this.props=C,this.context=D,this.refs=A,this.updater=se||O}_.prototype.isReactComponent={},_.prototype.setState=function(C,D){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,D,"setState")},_.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function H(){}H.prototype=_.prototype;function b(C,D,se){this.props=C,this.context=D,this.refs=A,this.updater=se||O}var Q=b.prototype=new H;Q.constructor=b,E(Q,_.prototype),Q.isPureReactComponent=!0;var X=Array.isArray,B=Object.prototype.hasOwnProperty,L={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function oe(C,D,se){var ae,fe={},ce=null,ve=null;if(D!=null)for(ae in D.ref!==void 0&&(ve=D.ref),D.key!==void 0&&(ce=""+D.key),D)B.call(D,ae)&&!U.hasOwnProperty(ae)&&(fe[ae]=D[ae]);var pe=arguments.length-2;if(pe===1)fe.children=se;else if(1>>1,D=W[C];if(0>>1;Cc(fe,Y))cec(ve,fe)?(W[C]=ve,W[ce]=Y,C=ce):(W[C]=fe,W[ae]=Y,C=ae);else if(cec(ve,Y))W[C]=ve,W[ce]=Y,C=ce;else break e}}return ee}function c(W,ee){var Y=W.sortIndex-ee.sortIndex;return Y!==0?Y:W.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var p=Date,m=p.now();n.unstable_now=function(){return p.now()-m}}var S=[],w=[],v=1,R=null,T=3,O=!1,E=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Q(W){for(var ee=s(w);ee!==null;){if(ee.callback===null)l(w);else if(ee.startTime<=W)l(w),ee.sortIndex=ee.expirationTime,i(S,ee);else break;ee=s(w)}}function X(W){if(A=!1,Q(W),!E)if(s(S)!==null)E=!0,qe(B);else{var ee=s(w);ee!==null&&Se(X,ee.startTime-W)}}function B(W,ee){E=!1,A&&(A=!1,H(oe),oe=-1),O=!0;var Y=T;try{for(Q(ee),R=s(S);R!==null&&(!(R.expirationTime>ee)||W&&!ct());){var C=R.callback;if(typeof C=="function"){R.callback=null,T=R.priorityLevel;var D=C(R.expirationTime<=ee);ee=n.unstable_now(),typeof D=="function"?R.callback=D:R===s(S)&&l(S),Q(ee)}else l(S);R=s(S)}if(R!==null)var se=!0;else{var ae=s(w);ae!==null&&Se(X,ae.startTime-ee),se=!1}return se}finally{R=null,T=Y,O=!1}}var L=!1,U=null,oe=-1,ye=5,Oe=-1;function ct(){return!(n.unstable_now()-OeW||125C?(W.sortIndex=Y,i(w,W),s(S)===null&&W===s(w)&&(A?(H(oe),oe=-1):A=!0,Se(X,Y-C))):(W.sortIndex=D,i(S,W),E||O||(E=!0,qe(B))),W},n.unstable_shouldYield=ct,n.unstable_wrapCallback=function(W){var ee=T;return function(){var Y=T;T=ee;try{return W.apply(this,arguments)}finally{T=Y}}}}(Sa)),Sa}var df;function Cg(){return df||(df=1,wa.exports=kg()),wa.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ff;function Eg(){if(ff)return at;ff=1;var n=tu(),i=Cg();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),S=Object.prototype.hasOwnProperty,w=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},R={};function T(e){return S.call(R,e)?!0:S.call(v,e)?!1:w.test(e)?R[e]=!0:(v[e]=!0,!1)}function O(e,t,r,o){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,r,o){if(t===null||typeof t>"u"||O(e,t,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function A(e,t,r,o,a,u,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=f}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_[e]=new A(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_[t]=new A(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){_[e]=new A(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_[e]=new A(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_[e]=new A(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){_[e]=new A(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){_[e]=new A(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){_[e]=new A(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){_[e]=new A(e,5,!1,e.toLowerCase(),null,!1,!1)});var H=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(H,b);_[t]=new A(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(H,b);_[t]=new A(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(H,b);_[t]=new A(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){_[e]=new A(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new A("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){_[e]=new A(e,1,!1,e.toLowerCase(),null,!0,!0)});function Q(e,t,r,o){var a=_.hasOwnProperty(t)?_[t]:null;(a!==null?a.type!==0:o||!(2g||a[f]!==u[g]){var y=` -`+a[f].replace(" at new "," at ");return e.displayName&&y.includes("")&&(y=y.replace("",e.displayName)),y}while(1<=f&&0<=g);break}}}finally{se=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?D(e):""}function fe(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=ae(e.type,!1),e;case 11:return e=ae(e.type.render,!1),e;case 1:return e=ae(e.type,!0),e;default:return""}}function ce(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case L:return"Portal";case ye:return"Profiler";case oe:return"StrictMode";case et:return"Suspense";case dt:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ct:return(e.displayName||"Context")+".Consumer";case Oe:return(e._context.displayName||"Context")+".Provider";case wt:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case St:return t=e.displayName||null,t!==null?t:ce(e.type)||"Memo";case qe:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}function ve(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(t);case 8:return t===oe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ue(e){var t=me(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,u=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(f){o=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(f){o=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yt(e){e._valueTracker||(e._valueTracker=Ue(e))}function Tt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=me(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function Lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Es(e,t){var r=t.checked;return Y({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function du(e,t){var r=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;r=pe(t.value!=null?t.value:r),e._wrapperState={initialChecked:o,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fu(e,t){t=t.checked,t!=null&&Q(e,"checked",t,!1)}function js(e,t){fu(e,t);var r=pe(t.value),o=t.type;if(r!=null)o==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?As(e,t.type,r):t.hasOwnProperty("defaultValue")&&As(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pu(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function As(e,t,r){(t!=="number"||Lo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Lr=Array.isArray;function Kn(e,t,r,o){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=Do.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dr(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Mr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sh=["Webkit","ms","Moz","O"];Object.keys(Mr).forEach(function(e){Sh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mr[t]=Mr[e]})});function xu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Mr.hasOwnProperty(e)&&Mr[e]?(""+t).trim():t+"px"}function wu(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=r.indexOf("--")===0,a=xu(r,t[r],o);r==="float"&&(r="cssFloat"),o?e.setProperty(r,a):e[r]=a}}var kh=Y({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ts(e,t){if(t){if(kh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function Ns(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _s=null;function Is(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Os=null,Xn=null,Jn=null;function Su(e){if(e=oo(e)){if(typeof Os!="function")throw Error(s(280));var t=e.stateNode;t&&(t=oi(t),Os(e.stateNode,e.type,t))}}function ku(e){Xn?Jn?Jn.push(e):Jn=[e]:Xn=e}function Cu(){if(Xn){var e=Xn,t=Jn;if(Jn=Xn=null,Su(e),t)for(e=0;e>>=0,e===0?32:31-(Oh(e)/Lh|0)|0}var Fo=64,Bo=4194304;function Fr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Uo(e,t){var r=e.pendingLanes;if(r===0)return 0;var o=0,a=e.suspendedLanes,u=e.pingedLanes,f=r&268435455;if(f!==0){var g=f&~a;g!==0?o=Fr(g):(u&=f,u!==0&&(o=Fr(u)))}else f=r&~a,f!==0?o=Fr(f):u!==0&&(o=Fr(u));if(o===0)return 0;if(t!==0&&t!==o&&!(t&a)&&(a=o&-o,u=t&-t,a>=u||a===16&&(u&4194240)!==0))return t;if(o&4&&(o|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0r;r++)t.push(e);return t}function Br(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=r}function $h(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=Gr),Xu=" ",Ju=!1;function Zu(e,t){switch(e){case"keyup":return fm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ec(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tr=!1;function hm(e,t){switch(e){case"compositionend":return ec(t);case"keypress":return t.which!==32?null:(Ju=!0,Xu);case"textInput":return e=t.data,e===Xu&&Ju?null:e;default:return null}}function mm(e,t){if(tr)return e==="compositionend"||!Xs&&Zu(e,t)?(e=Vu(),qo=Vs=an=null,tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lc(r)}}function uc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cc(){for(var e=window,t=Lo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Lo(e.document)}return t}function el(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Em(e){var t=cc(),r=e.focusedElem,o=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&uc(r.ownerDocument.documentElement,r)){if(o!==null&&el(r)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,u=Math.min(o.start,a);o=o.end===void 0?u:Math.min(o.end,a),!e.extend&&u>o&&(a=o,o=u,u=a),a=ac(r,u);var f=ac(r,o);a&&f&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==f.node||e.focusOffset!==f.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),u>o?(e.addRange(t),e.extend(f.node,f.offset)):(t.setEnd(f.node,f.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,nr=null,tl=null,Zr=null,nl=!1;function dc(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nl||nr==null||nr!==Lo(o)||(o=nr,"selectionStart"in o&&el(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Zr&&Jr(Zr,o)||(Zr=o,o=ti(tl,"onSelect"),0lr||(e.current=hl[lr],hl[lr]=null,lr--)}function ke(e,t){lr++,hl[lr]=e.current,e.current=t}var fn={},Qe=dn(fn),rt=dn(!1),Pn=fn;function ar(e,t){var r=e.type.contextTypes;if(!r)return fn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var a={},u;for(u in r)a[u]=t[u];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ot(e){return e=e.childContextTypes,e!=null}function ii(){Ee(rt),Ee(Qe)}function Ac(e,t,r){if(Qe.current!==fn)throw Error(s(168));ke(Qe,t),ke(rt,r)}function Rc(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var a in o)if(!(a in t))throw Error(s(108,ve(e)||"Unknown",a));return Y({},r,o)}function si(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,Pn=Qe.current,ke(Qe,e),ke(rt,rt.current),!0}function Pc(e,t,r){var o=e.stateNode;if(!o)throw Error(s(169));r?(e=Rc(e,t,Pn),o.__reactInternalMemoizedMergedChildContext=e,Ee(rt),Ee(Qe),ke(Qe,e)):Ee(rt),ke(rt,r)}var Qt=null,li=!1,ml=!1;function Tc(e){Qt===null?Qt=[e]:Qt.push(e)}function Mm(e){li=!0,Tc(e)}function pn(){if(!ml&&Qt!==null){ml=!0;var e=0,t=we;try{var r=Qt;for(we=1;e>=f,a-=f,Gt=1<<32-Nt(t)+a|r<ie?(Fe=re,re=null):Fe=re.sibling;var ge=M(j,re,P[ie],F);if(ge===null){re===null&&(re=Fe);break}e&&re&&ge.alternate===null&&t(j,re),x=u(ge,x,ie),ne===null?Z=ge:ne.sibling=ge,ne=ge,re=Fe}if(ie===P.length)return r(j,re),Ae&&Nn(j,ie),Z;if(re===null){for(;ieie?(Fe=re,re=null):Fe=re.sibling;var kn=M(j,re,ge.value,F);if(kn===null){re===null&&(re=Fe);break}e&&re&&kn.alternate===null&&t(j,re),x=u(kn,x,ie),ne===null?Z=kn:ne.sibling=kn,ne=kn,re=Fe}if(ge.done)return r(j,re),Ae&&Nn(j,ie),Z;if(re===null){for(;!ge.done;ie++,ge=P.next())ge=$(j,ge.value,F),ge!==null&&(x=u(ge,x,ie),ne===null?Z=ge:ne.sibling=ge,ne=ge);return Ae&&Nn(j,ie),Z}for(re=o(j,re);!ge.done;ie++,ge=P.next())ge=q(re,j,ie,ge.value,F),ge!==null&&(e&&ge.alternate!==null&&re.delete(ge.key===null?ie:ge.key),x=u(ge,x,ie),ne===null?Z=ge:ne.sibling=ge,ne=ge);return e&&re.forEach(function(mg){return t(j,mg)}),Ae&&Nn(j,ie),Z}function Ie(j,x,P,F){if(typeof P=="object"&&P!==null&&P.type===U&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case B:e:{for(var Z=P.key,ne=x;ne!==null;){if(ne.key===Z){if(Z=P.type,Z===U){if(ne.tag===7){r(j,ne.sibling),x=a(ne,P.props.children),x.return=j,j=x;break e}}else if(ne.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===qe&&Dc(Z)===ne.type){r(j,ne.sibling),x=a(ne,P.props),x.ref=io(j,ne,P),x.return=j,j=x;break e}r(j,ne);break}else t(j,ne);ne=ne.sibling}P.type===U?(x=$n(P.props.children,j.mode,F,P.key),x.return=j,j=x):(F=Di(P.type,P.key,P.props,null,j.mode,F),F.ref=io(j,x,P),F.return=j,j=F)}return f(j);case L:e:{for(ne=P.key;x!==null;){if(x.key===ne)if(x.tag===4&&x.stateNode.containerInfo===P.containerInfo&&x.stateNode.implementation===P.implementation){r(j,x.sibling),x=a(x,P.children||[]),x.return=j,j=x;break e}else{r(j,x);break}else t(j,x);x=x.sibling}x=fa(P,j.mode,F),x.return=j,j=x}return f(j);case qe:return ne=P._init,Ie(j,x,ne(P._payload),F)}if(Lr(P))return K(j,x,P,F);if(ee(P))return J(j,x,P,F);di(j,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,x!==null&&x.tag===6?(r(j,x.sibling),x=a(x,P),x.return=j,j=x):(r(j,x),x=da(P,j.mode,F),x.return=j,j=x),f(j)):r(j,x)}return Ie}var fr=Mc(!0),zc=Mc(!1),fi=dn(null),pi=null,pr=null,Sl=null;function kl(){Sl=pr=pi=null}function Cl(e){var t=fi.current;Ee(fi),e._currentValue=t}function El(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function hr(e,t){pi=e,Sl=pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Sl!==e)if(e={context:e,memoizedValue:t,next:null},pr===null){if(pi===null)throw Error(s(308));pr=e,pi.dependencies={lanes:0,firstContext:e}}else pr=pr.next=e;return t}var _n=null;function jl(e){_n===null?_n=[e]:_n.push(e)}function $c(e,t,r,o){var a=t.interleaved;return a===null?(r.next=r,jl(t)):(r.next=a.next,a.next=r),t.interleaved=r,Xt(e,o)}function Xt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var hn=!1;function Al(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mn(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,he&2){var a=o.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),o.pending=t,Xt(e,r)}return a=o.interleaved,a===null?(t.next=t,jl(o)):(t.next=a.next,a.next=t),o.interleaved=t,Xt(e,r)}function hi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,Fs(e,r)}}function Fc(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var a=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var f={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};u===null?a=u=f:u=u.next=f,r=r.next}while(r!==null);u===null?a=u=t:u=u.next=t}else a=u=t;r={baseState:o.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:o.shared,effects:o.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function mi(e,t,r,o){var a=e.updateQueue;hn=!1;var u=a.firstBaseUpdate,f=a.lastBaseUpdate,g=a.shared.pending;if(g!==null){a.shared.pending=null;var y=g,N=y.next;y.next=null,f===null?u=N:f.next=N,f=y;var z=e.alternate;z!==null&&(z=z.updateQueue,g=z.lastBaseUpdate,g!==f&&(g===null?z.firstBaseUpdate=N:g.next=N,z.lastBaseUpdate=y))}if(u!==null){var $=a.baseState;f=0,z=N=y=null,g=u;do{var M=g.lane,q=g.eventTime;if((o&M)===M){z!==null&&(z=z.next={eventTime:q,lane:0,tag:g.tag,payload:g.payload,callback:g.callback,next:null});e:{var K=e,J=g;switch(M=t,q=r,J.tag){case 1:if(K=J.payload,typeof K=="function"){$=K.call(q,$,M);break e}$=K;break e;case 3:K.flags=K.flags&-65537|128;case 0:if(K=J.payload,M=typeof K=="function"?K.call(q,$,M):K,M==null)break e;$=Y({},$,M);break e;case 2:hn=!0}}g.callback!==null&&g.lane!==0&&(e.flags|=64,M=a.effects,M===null?a.effects=[g]:M.push(g))}else q={eventTime:q,lane:M,tag:g.tag,payload:g.payload,callback:g.callback,next:null},z===null?(N=z=q,y=$):z=z.next=q,f|=M;if(g=g.next,g===null){if(g=a.shared.pending,g===null)break;M=g,g=M.next,M.next=null,a.lastBaseUpdate=M,a.shared.pending=null}}while(!0);if(z===null&&(y=$),a.baseState=y,a.firstBaseUpdate=N,a.lastBaseUpdate=z,t=a.shared.interleaved,t!==null){a=t;do f|=a.lane,a=a.next;while(a!==t)}else u===null&&(a.shared.lanes=0);Ln|=f,e.lanes=f,e.memoizedState=$}}function Bc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var o=_l.transition;_l.transition={};try{e(!1),t()}finally{we=r,_l.transition=o}}function sd(){return jt().memoizedState}function Fm(e,t,r){var o=xn(e);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},ld(e))ad(t,r);else if(r=$c(e,t,r,o),r!==null){var a=nt();Mt(r,e,o,a),ud(r,t,o)}}function Bm(e,t,r){var o=xn(e),a={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(ld(e))ad(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,g=u(f,r);if(a.hasEagerState=!0,a.eagerState=g,_t(g,f)){var y=t.interleaved;y===null?(a.next=a,jl(t)):(a.next=y.next,y.next=a),t.interleaved=a;return}}catch{}finally{}r=$c(e,t,a,o),r!==null&&(a=nt(),Mt(r,e,o,a),ud(r,t,o))}}function ld(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function ad(e,t){uo=vi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ud(e,t,r){if(r&4194240){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,Fs(e,r)}}var Si={readContext:Et,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},Um={readContext:Et,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Jc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,xi(4194308,4,td.bind(null,t,e),r)},useLayoutEffect:function(e,t){return xi(4194308,4,e,t)},useInsertionEffect:function(e,t){return xi(4,2,e,t)},useMemo:function(e,t){var r=Ut();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var o=Ut();return t=r!==void 0?r(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Fm.bind(null,Pe,e),[o.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:Kc,useDebugValue:$l,useDeferredValue:function(e){return Ut().memoizedState=e},useTransition:function(){var e=Kc(!1),t=e[0];return e=bm.bind(null,e[1]),Ut().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=Pe,a=Ut();if(Ae){if(r===void 0)throw Error(s(407));r=r()}else{if(r=t(),be===null)throw Error(s(349));On&30||Vc(o,t,r)}a.memoizedState=r;var u={value:r,getSnapshot:t};return a.queue=u,Jc(qc.bind(null,o,u,e),[e]),o.flags|=2048,po(9,Yc.bind(null,o,u,r,t),void 0,null),r},useId:function(){var e=Ut(),t=be.identifierPrefix;if(Ae){var r=Kt,o=Gt;r=(o&~(1<<32-Nt(o)-1)).toString(32)+r,t=":"+t+"R"+r,r=co++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=f.createElement(r,{is:o.is}):(e=f.createElement(r),r==="select"&&(f=e,o.multiple?f.multiple=!0:o.size&&(f.size=o.size))):e=f.createElementNS(e,r),e[Ft]=t,e[ro]=o,Td(e,t,!1,!1),t.stateNode=e;e:{switch(f=Ns(r,o),r){case"dialog":Ce("cancel",e),Ce("close",e),a=o;break;case"iframe":case"object":case"embed":Ce("load",e),a=o;break;case"video":case"audio":for(a=0;axr&&(t.flags|=128,o=!0,ho(u,!1),t.lanes=4194304)}else{if(!o)if(e=gi(f),e!==null){if(t.flags|=128,o=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ho(u,!0),u.tail===null&&u.tailMode==="hidden"&&!f.alternate&&!Ae)return Ke(t),null}else 2*_e()-u.renderingStartTime>xr&&r!==1073741824&&(t.flags|=128,o=!0,ho(u,!1),t.lanes=4194304);u.isBackwards?(f.sibling=t.child,t.child=f):(r=u.last,r!==null?r.sibling=f:t.child=f,u.last=f)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=_e(),t.sibling=null,r=Re.current,ke(Re,o?r&1|2:r&1),t):(Ke(t),null);case 22:case 23:return aa(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?mt&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Km(e,t){switch(yl(t),t.tag){case 1:return ot(t.type)&&ii(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mr(),Ee(rt),Ee(Qe),Nl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pl(t),null;case 13:if(Ee(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Re),null;case 4:return mr(),null;case 10:return Cl(t.type._context),null;case 22:case 23:return aa(),null;case 24:return null;default:return null}}var ji=!1,Xe=!1,Xm=typeof WeakSet=="function"?WeakSet:Set,G=null;function yr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){Te(e,t,o)}else r.current=null}function Kl(e,t,r){try{r()}catch(o){Te(e,t,o)}}var Id=!1;function Jm(e,t){if(al=Vo,e=cc(),el(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var a=o.anchorOffset,u=o.focusNode;o=o.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var f=0,g=-1,y=-1,N=0,z=0,$=e,M=null;t:for(;;){for(var q;$!==r||a!==0&&$.nodeType!==3||(g=f+a),$!==u||o!==0&&$.nodeType!==3||(y=f+o),$.nodeType===3&&(f+=$.nodeValue.length),(q=$.firstChild)!==null;)M=$,$=q;for(;;){if($===e)break t;if(M===r&&++N===a&&(g=f),M===u&&++z===o&&(y=f),(q=$.nextSibling)!==null)break;$=M,M=$.parentNode}$=q}r=g===-1||y===-1?null:{start:g,end:y}}else r=null}r=r||{start:0,end:0}}else r=null;for(ul={focusedElem:e,selectionRange:r},Vo=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var K=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(K!==null){var J=K.memoizedProps,Ie=K.memoizedState,j=t.stateNode,x=j.getSnapshotBeforeUpdate(t.elementType===t.type?J:Ot(t.type,J),Ie);j.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(F){Te(t,t.return,F)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return K=Id,Id=!1,K}function mo(e,t,r){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var a=o=o.next;do{if((a.tag&e)===e){var u=a.destroy;a.destroy=void 0,u!==void 0&&Kl(t,r,u)}a=a.next}while(a!==o)}}function Ai(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var o=r.create;r.destroy=o()}r=r.next}while(r!==t)}}function Xl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Od(e){var t=e.alternate;t!==null&&(e.alternate=null,Od(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ft],delete t[ro],delete t[pl],delete t[Lm],delete t[Dm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ld(e){return e.tag===5||e.tag===3||e.tag===4}function Dd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ld(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jl(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ri));else if(o!==4&&(e=e.child,e!==null))for(Jl(e,t,r),e=e.sibling;e!==null;)Jl(e,t,r),e=e.sibling}function Zl(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Zl(e,t,r),e=e.sibling;e!==null;)Zl(e,t,r),e=e.sibling}var He=null,Lt=!1;function gn(e,t,r){for(r=r.child;r!==null;)Md(e,t,r),r=r.sibling}function Md(e,t,r){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(bo,r)}catch{}switch(r.tag){case 5:Xe||yr(r,t);case 6:var o=He,a=Lt;He=null,gn(e,t,r),He=o,Lt=a,He!==null&&(Lt?(e=He,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):He.removeChild(r.stateNode));break;case 18:He!==null&&(Lt?(e=He,r=r.stateNode,e.nodeType===8?fl(e.parentNode,r):e.nodeType===1&&fl(e,r),Yr(e)):fl(He,r.stateNode));break;case 4:o=He,a=Lt,He=r.stateNode.containerInfo,Lt=!0,gn(e,t,r),He=o,Lt=a;break;case 0:case 11:case 14:case 15:if(!Xe&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){a=o=o.next;do{var u=a,f=u.destroy;u=u.tag,f!==void 0&&(u&2||u&4)&&Kl(r,t,f),a=a.next}while(a!==o)}gn(e,t,r);break;case 1:if(!Xe&&(yr(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(g){Te(r,t,g)}gn(e,t,r);break;case 21:gn(e,t,r);break;case 22:r.mode&1?(Xe=(o=Xe)||r.memoizedState!==null,gn(e,t,r),Xe=o):gn(e,t,r);break;default:gn(e,t,r)}}function zd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Xm),t.forEach(function(o){var a=lg.bind(null,e,o);r.has(o)||(r.add(o),o.then(a,a))})}}function Dt(e,t){var r=t.deletions;if(r!==null)for(var o=0;oa&&(a=f),o&=~u}if(o=a,o=_e()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*eg(o/1960))-o,10e?16:e,vn===null)var o=!1;else{if(e=vn,vn=null,_i=0,he&6)throw Error(s(331));var a=he;for(he|=4,G=e.current;G!==null;){var u=G,f=u.child;if(G.flags&16){var g=u.deletions;if(g!==null){for(var y=0;y_e()-na?Mn(e,0):ta|=r),lt(e,t)}function Kd(e,t){t===0&&(e.mode&1?(t=Bo,Bo<<=1,!(Bo&130023424)&&(Bo=4194304)):t=1);var r=nt();e=Xt(e,t),e!==null&&(Br(e,t,r),lt(e,r))}function sg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Kd(e,r)}function lg(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(s(314))}o!==null&&o.delete(t),Kd(e,r)}var Xd;Xd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)it=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return it=!1,Qm(e,t,r);it=!!(e.flags&131072)}else it=!1,Ae&&t.flags&1048576&&Nc(t,ui,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Ei(e,t),e=t.pendingProps;var a=ar(t,Qe.current);hr(t,r),a=Ol(null,t,o,e,a,r);var u=Ll();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(o)?(u=!0,si(t)):u=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Al(t),a.updater=ki,t.stateNode=a,a._reactInternals=t,Fl(t,o,e,r),t=Wl(null,t,o,!0,u,r)):(t.tag=0,Ae&&u&&gl(t),tt(null,t,a,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Ei(e,t),e=t.pendingProps,a=o._init,o=a(o._payload),t.type=o,a=t.tag=ug(o),e=Ot(o,e),a){case 0:t=Hl(null,t,o,e,r);break e;case 1:t=Cd(null,t,o,e,r);break e;case 11:t=vd(null,t,o,e,r);break e;case 14:t=xd(null,t,o,Ot(o.type,e),r);break e}throw Error(s(306,o,""))}return t;case 0:return o=t.type,a=t.pendingProps,a=t.elementType===o?a:Ot(o,a),Hl(e,t,o,a,r);case 1:return o=t.type,a=t.pendingProps,a=t.elementType===o?a:Ot(o,a),Cd(e,t,o,a,r);case 3:e:{if(Ed(t),e===null)throw Error(s(387));o=t.pendingProps,u=t.memoizedState,a=u.element,bc(e,t),mi(t,o,null,r);var f=t.memoizedState;if(o=f.element,u.isDehydrated)if(u={element:o,isDehydrated:!1,cache:f.cache,pendingSuspenseBoundaries:f.pendingSuspenseBoundaries,transitions:f.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){a=gr(Error(s(423)),t),t=jd(e,t,o,r,a);break e}else if(o!==a){a=gr(Error(s(424)),t),t=jd(e,t,o,r,a);break e}else for(ht=cn(t.stateNode.containerInfo.firstChild),pt=t,Ae=!0,It=null,r=zc(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(dr(),o===a){t=Zt(e,t,r);break e}tt(e,t,o,r)}t=t.child}return t;case 5:return Uc(t),e===null&&xl(t),o=t.type,a=t.pendingProps,u=e!==null?e.memoizedProps:null,f=a.children,cl(o,a)?f=null:u!==null&&cl(o,u)&&(t.flags|=32),kd(e,t),tt(e,t,f,r),t.child;case 6:return e===null&&xl(t),null;case 13:return Ad(e,t,r);case 4:return Rl(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=fr(t,null,o,r):tt(e,t,o,r),t.child;case 11:return o=t.type,a=t.pendingProps,a=t.elementType===o?a:Ot(o,a),vd(e,t,o,a,r);case 7:return tt(e,t,t.pendingProps,r),t.child;case 8:return tt(e,t,t.pendingProps.children,r),t.child;case 12:return tt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,a=t.pendingProps,u=t.memoizedProps,f=a.value,ke(fi,o._currentValue),o._currentValue=f,u!==null)if(_t(u.value,f)){if(u.children===a.children&&!rt.current){t=Zt(e,t,r);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var g=u.dependencies;if(g!==null){f=u.child;for(var y=g.firstContext;y!==null;){if(y.context===o){if(u.tag===1){y=Jt(-1,r&-r),y.tag=2;var N=u.updateQueue;if(N!==null){N=N.shared;var z=N.pending;z===null?y.next=y:(y.next=z.next,z.next=y),N.pending=y}}u.lanes|=r,y=u.alternate,y!==null&&(y.lanes|=r),El(u.return,r,t),g.lanes|=r;break}y=y.next}}else if(u.tag===10)f=u.type===t.type?null:u.child;else if(u.tag===18){if(f=u.return,f===null)throw Error(s(341));f.lanes|=r,g=f.alternate,g!==null&&(g.lanes|=r),El(f,r,t),f=u.sibling}else f=u.child;if(f!==null)f.return=u;else for(f=u;f!==null;){if(f===t){f=null;break}if(u=f.sibling,u!==null){u.return=f.return,f=u;break}f=f.return}u=f}tt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,o=t.pendingProps.children,hr(t,r),a=Et(a),o=o(a),t.flags|=1,tt(e,t,o,r),t.child;case 14:return o=t.type,a=Ot(o,t.pendingProps),a=Ot(o.type,a),xd(e,t,o,a,r);case 15:return wd(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,a=t.pendingProps,a=t.elementType===o?a:Ot(o,a),Ei(e,t),t.tag=1,ot(o)?(e=!0,si(t)):e=!1,hr(t,r),dd(t,o,a),Fl(t,o,a,r),Wl(null,t,o,!0,e,r);case 19:return Pd(e,t,r);case 22:return Sd(e,t,r)}throw Error(s(156,t.tag))};function Jd(e,t){return _u(e,t)}function ag(e,t,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rt(e,t,r,o){return new ag(e,t,r,o)}function ca(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ug(e){if(typeof e=="function")return ca(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wt)return 11;if(e===St)return 14}return 2}function Sn(e,t){var r=e.alternate;return r===null?(r=Rt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Di(e,t,r,o,a,u){var f=2;if(o=e,typeof e=="function")ca(e)&&(f=1);else if(typeof e=="string")f=5;else e:switch(e){case U:return $n(r.children,a,u,t);case oe:f=8,a|=8;break;case ye:return e=Rt(12,r,t,a|2),e.elementType=ye,e.lanes=u,e;case et:return e=Rt(13,r,t,a),e.elementType=et,e.lanes=u,e;case dt:return e=Rt(19,r,t,a),e.elementType=dt,e.lanes=u,e;case Se:return Mi(r,a,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oe:f=10;break e;case ct:f=9;break e;case wt:f=11;break e;case St:f=14;break e;case qe:f=16,o=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Rt(f,r,t,a),t.elementType=e,t.type=o,t.lanes=u,t}function $n(e,t,r,o){return e=Rt(7,e,o,t),e.lanes=r,e}function Mi(e,t,r,o){return e=Rt(22,e,o,t),e.elementType=Se,e.lanes=r,e.stateNode={isHidden:!1},e}function da(e,t,r){return e=Rt(6,e,null,t),e.lanes=r,e}function fa(e,t,r){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function cg(e,t,r,o,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bs(0),this.expirationTimes=bs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bs(0),this.identifierPrefix=o,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function pa(e,t,r,o,a,u,f,g,y){return e=new cg(e,t,r,g,y),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Rt(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Al(u),e}function dg(e,t,r){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),xa.exports=Eg(),xa.exports}var hf;function Ag(){if(hf)return Hi;hf=1;var n=jg();return Hi.createRoot=n.createRoot,Hi.hydrateRoot=n.hydrateRoot,Hi}var Rg=Ag(),Ze=function(){return Ze=Object.assign||function(i){for(var s,l=1,c=arguments.length;l0?Be(Nr,--Pt):0,Ar--,De===10&&(Ar=1,ps--),De}function zt(){return De=Pt2||$a(De)>3?"":" "}function zg(n,i){for(;--i&&zt()&&!(De<48||De>102||De>57&&De<65||De>70&&De<97););return ms(n,Ji()+(i<6&&Bn()==32&&zt()==32))}function ba(n){for(;zt();)switch(De){case n:return Pt;case 34:case 39:n!==34&&n!==39&&ba(De);break;case 40:n===41&&ba(n);break;case 92:zt();break}return Pt}function $g(n,i){for(;zt()&&n+De!==57;)if(n+De===84&&Bn()===47)break;return"/*"+ms(i,Pt-1)+"*"+ru(n===47?n:zt())}function bg(n){for(;!$a(Bn());)zt();return ms(n,Pt)}function Fg(n){return Dg(Zi("",null,null,null,[""],n=Lg(n),0,[0],n))}function Zi(n,i,s,l,c,d,p,m,S){for(var w=0,v=0,R=p,T=0,O=0,E=0,A=1,_=1,H=1,b=0,Q="",X=c,B=d,L=l,U=Q;_;)switch(E=b,b=zt()){case 40:if(E!=108&&Be(U,R-1)==58){Xi(U+=ue(ka(b),"&","&\f"),"&\f",yp(w?m[w-1]:0))!=-1&&(H=-1);break}case 34:case 39:case 91:U+=ka(b);break;case 9:case 10:case 13:case 32:U+=Mg(E);break;case 92:U+=zg(Ji()-1,7);continue;case 47:switch(Bn()){case 42:case 47:jo(Bg($g(zt(),Ji()),i,s,S),S);break;default:U+="/"}break;case 123*A:m[w++]=Vt(U)*H;case 125*A:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+v:H==-1&&(U=ue(U,/\f/g,"")),O>0&&Vt(U)-R&&jo(O>32?yf(U+";",l,s,R-1,S):yf(ue(U," ","")+";",l,s,R-2,S),S);break;case 59:U+=";";default:if(jo(L=gf(U,i,s,w,v,c,m,Q,X=[],B=[],R,d),d),b===123)if(v===0)Zi(U,i,L,L,X,d,R,m,B);else switch(T===99&&Be(U,3)===110?100:T){case 100:case 108:case 109:case 115:Zi(n,L,L,l&&jo(gf(n,L,L,0,0,c,m,Q,c,X=[],R,B),B),c,B,R,m,l?X:B);break;default:Zi(U,L,L,L,[""],B,0,m,B)}}w=v=O=0,A=H=1,Q=U="",R=p;break;case 58:R=1+Vt(U),O=E;default:if(A<1){if(b==123)--A;else if(b==125&&A++==0&&Og()==125)continue}switch(U+=ru(b),b*A){case 38:H=v>0?1:(U+="\f",-1);break;case 44:m[w++]=(Vt(U)-1)*H,H=1;break;case 64:Bn()===45&&(U+=ka(zt())),T=Bn(),v=R=Vt(Q=U+=bg(Ji())),b++;break;case 45:E===45&&Vt(U)==2&&(A=0)}}return d}function gf(n,i,s,l,c,d,p,m,S,w,v,R){for(var T=c-1,O=c===0?d:[""],E=xp(O),A=0,_=0,H=0;A0?O[b]+" "+Q:ue(Q,/&\f/g,O[b])))&&(S[H++]=X);return hs(n,i,s,c===0?fs:m,S,w,v,R)}function Bg(n,i,s,l){return hs(n,i,s,mp,ru(Ig()),jr(n,2,-2),0,l)}function yf(n,i,s,l,c){return hs(n,i,s,nu,jr(n,0,l),jr(n,l+1,-1),l,c)}function Sp(n,i,s){switch(Ng(n,i)){case 5103:return xe+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return xe+n+n;case 4789:return Ao+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return xe+n+Ao+n+je+n+n;case 5936:switch(Be(n,i+11)){case 114:return xe+n+je+ue(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return xe+n+je+ue(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return xe+n+je+ue(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return xe+n+je+n+n;case 6165:return xe+n+je+"flex-"+n+n;case 5187:return xe+n+ue(n,/(\w+).+(:[^]+)/,xe+"box-$1$2"+je+"flex-$1$2")+n;case 5443:return xe+n+je+"flex-item-"+ue(n,/flex-|-self/g,"")+(tn(n,/flex-|baseline/)?"":je+"grid-row-"+ue(n,/flex-|-self/g,""))+n;case 4675:return xe+n+je+"flex-line-pack"+ue(n,/align-content|flex-|-self/g,"")+n;case 5548:return xe+n+je+ue(n,"shrink","negative")+n;case 5292:return xe+n+je+ue(n,"basis","preferred-size")+n;case 6060:return xe+"box-"+ue(n,"-grow","")+xe+n+je+ue(n,"grow","positive")+n;case 4554:return xe+ue(n,/([^-])(transform)/g,"$1"+xe+"$2")+n;case 6187:return ue(ue(ue(n,/(zoom-|grab)/,xe+"$1"),/(image-set)/,xe+"$1"),n,"")+n;case 5495:case 3959:return ue(n,/(image-set\([^]*)/,xe+"$1$`$1");case 4968:return ue(ue(n,/(.+:)(flex-)?(.*)/,xe+"box-pack:$3"+je+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xe+n+n;case 4200:if(!tn(n,/flex-|baseline/))return je+"grid-column-align"+jr(n,i)+n;break;case 2592:case 3360:return je+ue(n,"template-","")+n;case 4384:case 3616:return s&&s.some(function(l,c){return i=c,tn(l.props,/grid-\w+-end/)})?~Xi(n+(s=s[i].value),"span",0)?n:je+ue(n,"-start","")+n+je+"grid-row-span:"+(~Xi(s,"span",0)?tn(s,/\d+/):+tn(s,/\d+/)-+tn(n,/\d+/))+";":je+ue(n,"-start","")+n;case 4896:case 4128:return s&&s.some(function(l){return tn(l.props,/grid-\w+-start/)})?n:je+ue(ue(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return ue(n,/(.+)-inline(.+)/,xe+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vt(n)-1-i>6)switch(Be(n,i+1)){case 109:if(Be(n,i+4)!==45)break;case 102:return ue(n,/(.+:)(.+)-([^]+)/,"$1"+xe+"$2-$3$1"+Ao+(Be(n,i+3)==108?"$3":"$2-$3"))+n;case 115:return~Xi(n,"stretch",0)?Sp(ue(n,"stretch","fill-available"),i,s)+n:n}break;case 5152:case 5920:return ue(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(l,c,d,p,m,S,w){return je+c+":"+d+w+(p?je+c+"-span:"+(m?S:+S-+d)+w:"")+n});case 4949:if(Be(n,i+6)===121)return ue(n,":",":"+xe)+n;break;case 6444:switch(Be(n,Be(n,14)===45?18:11)){case 120:return ue(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xe+(Be(n,14)===45?"inline-":"")+"box$3$1"+xe+"$2$3$1"+je+"$2box$3")+n;case 100:return ue(n,":",":"+je)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return ue(n,"scroll-","scroll-snap-")+n}return n}function ss(n,i){for(var s="",l=0;l-1&&!n.return)switch(n.type){case nu:n.return=Sp(n.value,n.length,s);return;case gp:return ss([Cn(n,{value:ue(n.value,"@","@"+xe)})],l);case fs:if(n.length)return _g(s=n.props,function(c){switch(tn(c,l=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Sr(Cn(n,{props:[ue(c,/:(read-\w+)/,":"+Ao+"$1")]})),Sr(Cn(n,{props:[c]})),za(n,{props:mf(s,l)});break;case"::placeholder":Sr(Cn(n,{props:[ue(c,/:(plac\w+)/,":"+xe+"input-$1")]})),Sr(Cn(n,{props:[ue(c,/:(plac\w+)/,":"+Ao+"$1")]})),Sr(Cn(n,{props:[ue(c,/:(plac\w+)/,je+"input-$1")]})),Sr(Cn(n,{props:[c]})),za(n,{props:mf(s,l)});break}return""})}}var Yg={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gt={},Rr=typeof process<"u"&>!==void 0&&(gt.REACT_APP_SC_ATTR||gt.SC_ATTR)||"data-styled",kp="active",Cp="data-styled-version",gs="6.1.14",ou=`/*!sc*/ -`,ls=typeof window<"u"&&"HTMLElement"in window,qg=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&>!==void 0&>.REACT_APP_SC_DISABLE_SPEEDY!==void 0&>.REACT_APP_SC_DISABLE_SPEEDY!==""?gt.REACT_APP_SC_DISABLE_SPEEDY!=="false"&>.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&>!==void 0&>.SC_DISABLE_SPEEDY!==void 0&>.SC_DISABLE_SPEEDY!==""&>.SC_DISABLE_SPEEDY!=="false"&>.SC_DISABLE_SPEEDY),ys=Object.freeze([]),Pr=Object.freeze({});function Qg(n,i,s){return s===void 0&&(s=Pr),n.theme!==s.theme&&n.theme||i||s.theme}var Ep=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Gg=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Kg=/(^-|-$)/g;function vf(n){return n.replace(Gg,"-").replace(Kg,"")}var Xg=/(a)(d)/gi,Wi=52,xf=function(n){return String.fromCharCode(n+(n>25?39:97))};function Fa(n){var i,s="";for(i=Math.abs(n);i>Wi;i=i/Wi|0)s=xf(i%Wi)+s;return(xf(i%Wi)+s).replace(Xg,"$1-$2")}var Ca,jp=5381,Cr=function(n,i){for(var s=i.length;s;)n=33*n^i.charCodeAt(--s);return n},Ap=function(n){return Cr(jp,n)};function Jg(n){return Fa(Ap(n)>>>0)}function Zg(n){return n.displayName||n.name||"Component"}function Ea(n){return typeof n=="string"&&!0}var Rp=typeof Symbol=="function"&&Symbol.for,Pp=Rp?Symbol.for("react.memo"):60115,ey=Rp?Symbol.for("react.forward_ref"):60112,ty={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ny={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Tp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ry=((Ca={})[ey]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ca[Pp]=Tp,Ca);function wf(n){return("type"in(i=n)&&i.type.$$typeof)===Pp?Tp:"$$typeof"in n?ry[n.$$typeof]:ty;var i}var oy=Object.defineProperty,iy=Object.getOwnPropertyNames,Sf=Object.getOwnPropertySymbols,sy=Object.getOwnPropertyDescriptor,ly=Object.getPrototypeOf,kf=Object.prototype;function Np(n,i,s){if(typeof i!="string"){if(kf){var l=ly(i);l&&l!==kf&&Np(n,l,s)}var c=iy(i);Sf&&(c=c.concat(Sf(i)));for(var d=wf(n),p=wf(i),m=0;m0?" Args: ".concat(i.join(", ")):""))}var ay=function(){function n(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}return n.prototype.indexOfGroup=function(i){for(var s=0,l=0;l=this.groupSizes.length){for(var l=this.groupSizes,c=l.length,d=c;i>=d;)if((d<<=1)<0)throw Yn(16,"".concat(i));this.groupSizes=new Uint32Array(d),this.groupSizes.set(l),this.length=d;for(var p=c;p=this.length||this.groupSizes[i]===0)return s;for(var l=this.groupSizes[i],c=this.indexOfGroup(i),d=c+l,p=c;p=0){var l=document.createTextNode(s);return this.element.insertBefore(l,this.nodes[i]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},n.prototype.getRule=function(i){return i0&&(_+="".concat(H,","))}),S+="".concat(E).concat(A,'{content:"').concat(_,'"}').concat(ou)},v=0;v0?".".concat(i):T},v=S.slice();v.push(function(T){T.type===fs&&T.value.includes("&")&&(T.props[0]=T.props[0].replace(xy,s).replace(l,w))}),p.prefix&&v.push(Vg),v.push(Ug);var R=function(T,O,E,A){O===void 0&&(O=""),E===void 0&&(E=""),A===void 0&&(A="&"),i=A,s=O,l=new RegExp("\\".concat(s,"\\b"),"g");var _=T.replace(wy,""),H=Fg(E||O?"".concat(E," ").concat(O," { ").concat(_," }"):_);p.namespace&&(H=Op(H,p.namespace));var b=[];return ss(H,Hg(v.concat(Wg(function(Q){return b.push(Q)})))),b};return R.hash=S.length?S.reduce(function(T,O){return O.name||Yn(15),Cr(T,O.name)},jp).toString():"",R}var ky=new Ip,Ua=Sy(),Lp=yt.createContext({shouldForwardProp:void 0,styleSheet:ky,stylis:Ua});Lp.Consumer;yt.createContext(void 0);function Af(){return te.useContext(Lp)}var Cy=function(){function n(i,s){var l=this;this.inject=function(c,d){d===void 0&&(d=Ua);var p=l.name+d.hash;c.hasNameForId(l.id,p)||c.insertRules(l.id,p,d(l.rules,p,"@keyframes"))},this.name=i,this.id="sc-keyframes-".concat(i),this.rules=s,su(this,function(){throw Yn(12,String(l.name))})}return n.prototype.getName=function(i){return i===void 0&&(i=Ua),this.name+i.hash},n}(),Ey=function(n){return n>="A"&&n<="Z"};function Rf(n){for(var i="",s=0;s>>0);if(!s.hasNameForId(this.componentId,p)){var m=l(d,".".concat(p),void 0,this.componentId);s.insertRules(this.componentId,p,m)}c=bn(c,p),this.staticRulesId=p}else{for(var S=Cr(this.baseHash,l.hash),w="",v=0;v>>0);s.hasNameForId(this.componentId,O)||s.insertRules(this.componentId,O,l(w,".".concat(O),void 0,this.componentId)),c=bn(c,O)}}return c},n}(),us=yt.createContext(void 0);us.Consumer;function Pf(n){var i=yt.useContext(us),s=te.useMemo(function(){return function(l,c){if(!l)throw Yn(14);if(Vn(l)){var d=l(c);return d}if(Array.isArray(l)||typeof l!="object")throw Yn(8);return c?Ze(Ze({},c),l):l}(n.theme,i)},[n.theme,i]);return n.children?yt.createElement(us.Provider,{value:s},n.children):null}var ja={};function Py(n,i,s){var l=iu(n),c=n,d=!Ea(n),p=i.attrs,m=p===void 0?ys:p,S=i.componentId,w=S===void 0?function(X,B){var L=typeof X!="string"?"sc":vf(X);ja[L]=(ja[L]||0)+1;var U="".concat(L,"-").concat(Jg(gs+L+ja[L]));return B?"".concat(B,"-").concat(U):U}(i.displayName,i.parentComponentId):S,v=i.displayName,R=v===void 0?function(X){return Ea(X)?"styled.".concat(X):"Styled(".concat(Zg(X),")")}(n):v,T=i.displayName&&i.componentId?"".concat(vf(i.displayName),"-").concat(i.componentId):i.componentId||w,O=l&&c.attrs?c.attrs.concat(m).filter(Boolean):m,E=i.shouldForwardProp;if(l&&c.shouldForwardProp){var A=c.shouldForwardProp;if(i.shouldForwardProp){var _=i.shouldForwardProp;E=function(X,B){return A(X,B)&&_(X,B)}}else E=A}var H=new Ry(s,T,l?c.componentStyle:void 0);function b(X,B){return function(L,U,oe){var ye=L.attrs,Oe=L.componentStyle,ct=L.defaultProps,wt=L.foldedComponentIds,et=L.styledComponentId,dt=L.target,St=yt.useContext(us),qe=Af(),Se=L.shouldForwardProp||qe.shouldForwardProp,W=Qg(U,St,ct)||Pr,ee=function(fe,ce,ve){for(var pe,me=Ze(Ze({},ce),{className:void 0,theme:ve}),Ue=0;Ue{let i;const s=new Set,l=(w,v)=>{const R=typeof w=="function"?w(i):w;if(!Object.is(R,i)){const T=i;i=v??(typeof R!="object"||R===null)?R:Object.assign({},i,R),s.forEach(O=>O(i,T))}},c=()=>i,m={setState:l,getState:c,getInitialState:()=>S,subscribe:w=>(s.add(w),()=>s.delete(w))},S=i=n(l,c,m);return m},Ny=n=>n?_f(n):_f,_y=n=>n;function Iy(n,i=_y){const s=yt.useSyncExternalStore(n.subscribe,()=>i(n.getState()),()=>i(n.getInitialState()));return yt.useDebugValue(s),s}const If=n=>{const i=Ny(n),s=l=>Iy(i,l);return Object.assign(s,i),s},Qn=n=>n?If(n):If;function $p(n,i){return function(){return n.apply(i,arguments)}}const{toString:Oy}=Object.prototype,{getPrototypeOf:lu}=Object,vs=(n=>i=>{const s=Oy.call(i);return n[s]||(n[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),$t=n=>(n=n.toLowerCase(),i=>vs(i)===n),xs=n=>i=>typeof i===n,{isArray:_r}=Array,No=xs("undefined");function Ly(n){return n!==null&&!No(n)&&n.constructor!==null&&!No(n.constructor)&&vt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const bp=$t("ArrayBuffer");function Dy(n){let i;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?i=ArrayBuffer.isView(n):i=n&&n.buffer&&bp(n.buffer),i}const My=xs("string"),vt=xs("function"),Fp=xs("number"),ws=n=>n!==null&&typeof n=="object",zy=n=>n===!0||n===!1,ns=n=>{if(vs(n)!=="object")return!1;const i=lu(n);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},$y=$t("Date"),by=$t("File"),Fy=$t("Blob"),By=$t("FileList"),Uy=n=>ws(n)&&vt(n.pipe),Hy=n=>{let i;return n&&(typeof FormData=="function"&&n instanceof FormData||vt(n.append)&&((i=vs(n))==="formdata"||i==="object"&&vt(n.toString)&&n.toString()==="[object FormData]"))},Wy=$t("URLSearchParams"),[Vy,Yy,qy,Qy]=["ReadableStream","Request","Response","Headers"].map($t),Gy=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function _o(n,i,{allOwnKeys:s=!1}={}){if(n===null||typeof n>"u")return;let l,c;if(typeof n!="object"&&(n=[n]),_r(n))for(l=0,c=n.length;l0;)if(c=s[l],i===c.toLowerCase())return c;return null}const Fn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Up=n=>!No(n)&&n!==Fn;function Wa(){const{caseless:n}=Up(this)&&this||{},i={},s=(l,c)=>{const d=n&&Bp(i,c)||c;ns(i[d])&&ns(l)?i[d]=Wa(i[d],l):ns(l)?i[d]=Wa({},l):_r(l)?i[d]=l.slice():i[d]=l};for(let l=0,c=arguments.length;l(_o(i,(c,d)=>{s&&vt(c)?n[d]=$p(c,s):n[d]=c},{allOwnKeys:l}),n),Xy=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Jy=(n,i,s,l)=>{n.prototype=Object.create(i.prototype,l),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:i.prototype}),s&&Object.assign(n.prototype,s)},Zy=(n,i,s,l)=>{let c,d,p;const m={};if(i=i||{},n==null)return i;do{for(c=Object.getOwnPropertyNames(n),d=c.length;d-- >0;)p=c[d],(!l||l(p,n,i))&&!m[p]&&(i[p]=n[p],m[p]=!0);n=s!==!1&&lu(n)}while(n&&(!s||s(n,i))&&n!==Object.prototype);return i},e0=(n,i,s)=>{n=String(n),(s===void 0||s>n.length)&&(s=n.length),s-=i.length;const l=n.indexOf(i,s);return l!==-1&&l===s},t0=n=>{if(!n)return null;if(_r(n))return n;let i=n.length;if(!Fp(i))return null;const s=new Array(i);for(;i-- >0;)s[i]=n[i];return s},n0=(n=>i=>n&&i instanceof n)(typeof Uint8Array<"u"&&lu(Uint8Array)),r0=(n,i)=>{const l=(n&&n[Symbol.iterator]).call(n);let c;for(;(c=l.next())&&!c.done;){const d=c.value;i.call(n,d[0],d[1])}},o0=(n,i)=>{let s;const l=[];for(;(s=n.exec(i))!==null;)l.push(s);return l},i0=$t("HTMLFormElement"),s0=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,l,c){return l.toUpperCase()+c}),Of=(({hasOwnProperty:n})=>(i,s)=>n.call(i,s))(Object.prototype),l0=$t("RegExp"),Hp=(n,i)=>{const s=Object.getOwnPropertyDescriptors(n),l={};_o(s,(c,d)=>{let p;(p=i(c,d,n))!==!1&&(l[d]=p||c)}),Object.defineProperties(n,l)},a0=n=>{Hp(n,(i,s)=>{if(vt(n)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const l=n[s];if(vt(l)){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},u0=(n,i)=>{const s={},l=c=>{c.forEach(d=>{s[d]=!0})};return _r(n)?l(n):l(String(n).split(i)),s},c0=()=>{},d0=(n,i)=>n!=null&&Number.isFinite(n=+n)?n:i,Aa="abcdefghijklmnopqrstuvwxyz",Lf="0123456789",Wp={DIGIT:Lf,ALPHA:Aa,ALPHA_DIGIT:Aa+Aa.toUpperCase()+Lf},f0=(n=16,i=Wp.ALPHA_DIGIT)=>{let s="";const{length:l}=i;for(;n--;)s+=i[Math.random()*l|0];return s};function p0(n){return!!(n&&vt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const h0=n=>{const i=new Array(10),s=(l,c)=>{if(ws(l)){if(i.indexOf(l)>=0)return;if(!("toJSON"in l)){i[c]=l;const d=_r(l)?[]:{};return _o(l,(p,m)=>{const S=s(p,c+1);!No(S)&&(d[m]=S)}),i[c]=void 0,d}}return l};return s(n,0)},m0=$t("AsyncFunction"),g0=n=>n&&(ws(n)||vt(n))&&vt(n.then)&&vt(n.catch),Vp=((n,i)=>n?setImmediate:i?((s,l)=>(Fn.addEventListener("message",({source:c,data:d})=>{c===Fn&&d===s&&l.length&&l.shift()()},!1),c=>{l.push(c),Fn.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",vt(Fn.postMessage)),y0=typeof queueMicrotask<"u"?queueMicrotask.bind(Fn):typeof process<"u"&&process.nextTick||Vp,I={isArray:_r,isArrayBuffer:bp,isBuffer:Ly,isFormData:Hy,isArrayBufferView:Dy,isString:My,isNumber:Fp,isBoolean:zy,isObject:ws,isPlainObject:ns,isReadableStream:Vy,isRequest:Yy,isResponse:qy,isHeaders:Qy,isUndefined:No,isDate:$y,isFile:by,isBlob:Fy,isRegExp:l0,isFunction:vt,isStream:Uy,isURLSearchParams:Wy,isTypedArray:n0,isFileList:By,forEach:_o,merge:Wa,extend:Ky,trim:Gy,stripBOM:Xy,inherits:Jy,toFlatObject:Zy,kindOf:vs,kindOfTest:$t,endsWith:e0,toArray:t0,forEachEntry:r0,matchAll:o0,isHTMLForm:i0,hasOwnProperty:Of,hasOwnProp:Of,reduceDescriptors:Hp,freezeMethods:a0,toObjectSet:u0,toCamelCase:s0,noop:c0,toFiniteNumber:d0,findKey:Bp,global:Fn,isContextDefined:Up,ALPHABET:Wp,generateString:f0,isSpecCompliantForm:p0,toJSONObject:h0,isAsyncFn:m0,isThenable:g0,setImmediate:Vp,asap:y0};function le(n,i,s,l,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",i&&(this.code=i),s&&(this.config=s),l&&(this.request=l),c&&(this.response=c,this.status=c.status?c.status:null)}I.inherits(le,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:I.toJSONObject(this.config),code:this.code,status:this.status}}});const Yp=le.prototype,qp={};["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(n=>{qp[n]={value:n}});Object.defineProperties(le,qp);Object.defineProperty(Yp,"isAxiosError",{value:!0});le.from=(n,i,s,l,c,d)=>{const p=Object.create(Yp);return I.toFlatObject(n,p,function(S){return S!==Error.prototype},m=>m!=="isAxiosError"),le.call(p,n.message,i,s,l,c),p.cause=n,p.name=n.name,d&&Object.assign(p,d),p};const v0=null;function Va(n){return I.isPlainObject(n)||I.isArray(n)}function Qp(n){return I.endsWith(n,"[]")?n.slice(0,-2):n}function Df(n,i,s){return n?n.concat(i).map(function(c,d){return c=Qp(c),!s&&d?"["+c+"]":c}).join(s?".":""):i}function x0(n){return I.isArray(n)&&!n.some(Va)}const w0=I.toFlatObject(I,{},null,function(i){return/^is[A-Z]/.test(i)});function Ss(n,i,s){if(!I.isObject(n))throw new TypeError("target must be an object");i=i||new FormData,s=I.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(A,_){return!I.isUndefined(_[A])});const l=s.metaTokens,c=s.visitor||v,d=s.dots,p=s.indexes,S=(s.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(i);if(!I.isFunction(c))throw new TypeError("visitor must be a function");function w(E){if(E===null)return"";if(I.isDate(E))return E.toISOString();if(!S&&I.isBlob(E))throw new le("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(E)||I.isTypedArray(E)?S&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function v(E,A,_){let H=E;if(E&&!_&&typeof E=="object"){if(I.endsWith(A,"{}"))A=l?A:A.slice(0,-2),E=JSON.stringify(E);else if(I.isArray(E)&&x0(E)||(I.isFileList(E)||I.endsWith(A,"[]"))&&(H=I.toArray(E)))return A=Qp(A),H.forEach(function(Q,X){!(I.isUndefined(Q)||Q===null)&&i.append(p===!0?Df([A],X,d):p===null?A:A+"[]",w(Q))}),!1}return Va(E)?!0:(i.append(Df(_,A,d),w(E)),!1)}const R=[],T=Object.assign(w0,{defaultVisitor:v,convertValue:w,isVisitable:Va});function O(E,A){if(!I.isUndefined(E)){if(R.indexOf(E)!==-1)throw Error("Circular reference detected in "+A.join("."));R.push(E),I.forEach(E,function(H,b){(!(I.isUndefined(H)||H===null)&&c.call(i,H,I.isString(b)?b.trim():b,A,T))===!0&&O(H,A?A.concat(b):[b])}),R.pop()}}if(!I.isObject(n))throw new TypeError("data must be an object");return O(n),i}function Mf(n){const i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(l){return i[l]})}function au(n,i){this._pairs=[],n&&Ss(n,this,i)}const Gp=au.prototype;Gp.append=function(i,s){this._pairs.push([i,s])};Gp.toString=function(i){const s=i?function(l){return i.call(this,l,Mf)}:Mf;return this._pairs.map(function(c){return s(c[0])+"="+s(c[1])},"").join("&")};function S0(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Kp(n,i,s){if(!i)return n;const l=s&&s.encode||S0;I.isFunction(s)&&(s={serialize:s});const c=s&&s.serialize;let d;if(c?d=c(i,s):d=I.isURLSearchParams(i)?i.toString():new au(i,s).toString(l),d){const p=n.indexOf("#");p!==-1&&(n=n.slice(0,p)),n+=(n.indexOf("?")===-1?"?":"&")+d}return n}class zf{constructor(){this.handlers=[]}use(i,s,l){return this.handlers.push({fulfilled:i,rejected:s,synchronous:l?l.synchronous:!1,runWhen:l?l.runWhen:null}),this.handlers.length-1}eject(i){this.handlers[i]&&(this.handlers[i]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(i){I.forEach(this.handlers,function(l){l!==null&&i(l)})}}const Xp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},k0=typeof URLSearchParams<"u"?URLSearchParams:au,C0=typeof FormData<"u"?FormData:null,E0=typeof Blob<"u"?Blob:null,j0={isBrowser:!0,classes:{URLSearchParams:k0,FormData:C0,Blob:E0},protocols:["http","https","file","blob","url","data"]},uu=typeof window<"u"&&typeof document<"u",Ya=typeof navigator=="object"&&navigator||void 0,A0=uu&&(!Ya||["ReactNative","NativeScript","NS"].indexOf(Ya.product)<0),R0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",P0=uu&&window.location.href||"http://localhost",T0=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:uu,hasStandardBrowserEnv:A0,hasStandardBrowserWebWorkerEnv:R0,navigator:Ya,origin:P0},Symbol.toStringTag,{value:"Module"})),Je={...T0,...j0};function N0(n,i){return Ss(n,new Je.classes.URLSearchParams,Object.assign({visitor:function(s,l,c,d){return Je.isNode&&I.isBuffer(s)?(this.append(l,s.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},i))}function _0(n){return I.matchAll(/\w+|\[(\w*)]/g,n).map(i=>i[0]==="[]"?"":i[1]||i[0])}function I0(n){const i={},s=Object.keys(n);let l;const c=s.length;let d;for(l=0;l=s.length;return p=!p&&I.isArray(c)?c.length:p,S?(I.hasOwnProp(c,p)?c[p]=[c[p],l]:c[p]=l,!m):((!c[p]||!I.isObject(c[p]))&&(c[p]=[]),i(s,l,c[p],d)&&I.isArray(c[p])&&(c[p]=I0(c[p])),!m)}if(I.isFormData(n)&&I.isFunction(n.entries)){const s={};return I.forEachEntry(n,(l,c)=>{i(_0(l),c,s,0)}),s}return null}function O0(n,i,s){if(I.isString(n))try{return(i||JSON.parse)(n),I.trim(n)}catch(l){if(l.name!=="SyntaxError")throw l}return(0,JSON.stringify)(n)}const Io={transitional:Xp,adapter:["xhr","http","fetch"],transformRequest:[function(i,s){const l=s.getContentType()||"",c=l.indexOf("application/json")>-1,d=I.isObject(i);if(d&&I.isHTMLForm(i)&&(i=new FormData(i)),I.isFormData(i))return c?JSON.stringify(Jp(i)):i;if(I.isArrayBuffer(i)||I.isBuffer(i)||I.isStream(i)||I.isFile(i)||I.isBlob(i)||I.isReadableStream(i))return i;if(I.isArrayBufferView(i))return i.buffer;if(I.isURLSearchParams(i))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let m;if(d){if(l.indexOf("application/x-www-form-urlencoded")>-1)return N0(i,this.formSerializer).toString();if((m=I.isFileList(i))||l.indexOf("multipart/form-data")>-1){const S=this.env&&this.env.FormData;return Ss(m?{"files[]":i}:i,S&&new S,this.formSerializer)}}return d||c?(s.setContentType("application/json",!1),O0(i)):i}],transformResponse:[function(i){const s=this.transitional||Io.transitional,l=s&&s.forcedJSONParsing,c=this.responseType==="json";if(I.isResponse(i)||I.isReadableStream(i))return i;if(i&&I.isString(i)&&(l&&!this.responseType||c)){const p=!(s&&s.silentJSONParsing)&&c;try{return JSON.parse(i)}catch(m){if(p)throw m.name==="SyntaxError"?le.from(m,le.ERR_BAD_RESPONSE,this,null,this.response):m}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],n=>{Io.headers[n]={}});const L0=I.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"]),D0=n=>{const i={};let s,l,c;return n&&n.split(` -`).forEach(function(p){c=p.indexOf(":"),s=p.substring(0,c).trim().toLowerCase(),l=p.substring(c+1).trim(),!(!s||i[s]&&L0[s])&&(s==="set-cookie"?i[s]?i[s].push(l):i[s]=[l]:i[s]=i[s]?i[s]+", "+l:l)}),i},$f=Symbol("internals");function So(n){return n&&String(n).trim().toLowerCase()}function rs(n){return n===!1||n==null?n:I.isArray(n)?n.map(rs):String(n)}function M0(n){const i=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let l;for(;l=s.exec(n);)i[l[1]]=l[2];return i}const z0=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Ra(n,i,s,l,c){if(I.isFunction(l))return l.call(this,i,s);if(c&&(i=s),!!I.isString(i)){if(I.isString(l))return i.indexOf(l)!==-1;if(I.isRegExp(l))return l.test(i)}}function $0(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(i,s,l)=>s.toUpperCase()+l)}function b0(n,i){const s=I.toCamelCase(" "+i);["get","set","has"].forEach(l=>{Object.defineProperty(n,l+s,{value:function(c,d,p){return this[l].call(this,i,c,d,p)},configurable:!0})})}class ut{constructor(i){i&&this.set(i)}set(i,s,l){const c=this;function d(m,S,w){const v=So(S);if(!v)throw new Error("header name must be a non-empty string");const R=I.findKey(c,v);(!R||c[R]===void 0||w===!0||w===void 0&&c[R]!==!1)&&(c[R||S]=rs(m))}const p=(m,S)=>I.forEach(m,(w,v)=>d(w,v,S));if(I.isPlainObject(i)||i instanceof this.constructor)p(i,s);else if(I.isString(i)&&(i=i.trim())&&!z0(i))p(D0(i),s);else if(I.isHeaders(i))for(const[m,S]of i.entries())d(S,m,l);else i!=null&&d(s,i,l);return this}get(i,s){if(i=So(i),i){const l=I.findKey(this,i);if(l){const c=this[l];if(!s)return c;if(s===!0)return M0(c);if(I.isFunction(s))return s.call(this,c,l);if(I.isRegExp(s))return s.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(i,s){if(i=So(i),i){const l=I.findKey(this,i);return!!(l&&this[l]!==void 0&&(!s||Ra(this,this[l],l,s)))}return!1}delete(i,s){const l=this;let c=!1;function d(p){if(p=So(p),p){const m=I.findKey(l,p);m&&(!s||Ra(l,l[m],m,s))&&(delete l[m],c=!0)}}return I.isArray(i)?i.forEach(d):d(i),c}clear(i){const s=Object.keys(this);let l=s.length,c=!1;for(;l--;){const d=s[l];(!i||Ra(this,this[d],d,i,!0))&&(delete this[d],c=!0)}return c}normalize(i){const s=this,l={};return I.forEach(this,(c,d)=>{const p=I.findKey(l,d);if(p){s[p]=rs(c),delete s[d];return}const m=i?$0(d):String(d).trim();m!==d&&delete s[d],s[m]=rs(c),l[m]=!0}),this}concat(...i){return this.constructor.concat(this,...i)}toJSON(i){const s=Object.create(null);return I.forEach(this,(l,c)=>{l!=null&&l!==!1&&(s[c]=i&&I.isArray(l)?l.join(", "):l)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([i,s])=>i+": "+s).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...s){const l=new this(i);return s.forEach(c=>l.set(c)),l}static accessor(i){const l=(this[$f]=this[$f]={accessors:{}}).accessors,c=this.prototype;function d(p){const m=So(p);l[m]||(b0(c,p),l[m]=!0)}return I.isArray(i)?i.forEach(d):d(i),this}}ut.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(ut.prototype,({value:n},i)=>{let s=i[0].toUpperCase()+i.slice(1);return{get:()=>n,set(l){this[s]=l}}});I.freezeMethods(ut);function Pa(n,i){const s=this||Io,l=i||s,c=ut.from(l.headers);let d=l.data;return I.forEach(n,function(m){d=m.call(s,d,c.normalize(),i?i.status:void 0)}),c.normalize(),d}function Zp(n){return!!(n&&n.__CANCEL__)}function Ir(n,i,s){le.call(this,n??"canceled",le.ERR_CANCELED,i,s),this.name="CanceledError"}I.inherits(Ir,le,{__CANCEL__:!0});function eh(n,i,s){const l=s.config.validateStatus;!s.status||!l||l(s.status)?n(s):i(new le("Request failed with status code "+s.status,[le.ERR_BAD_REQUEST,le.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function F0(n){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return i&&i[1]||""}function B0(n,i){n=n||10;const s=new Array(n),l=new Array(n);let c=0,d=0,p;return i=i!==void 0?i:1e3,function(S){const w=Date.now(),v=l[d];p||(p=w),s[c]=S,l[c]=w;let R=d,T=0;for(;R!==c;)T+=s[R++],R=R%n;if(c=(c+1)%n,c===d&&(d=(d+1)%n),w-p{s=v,c=null,d&&(clearTimeout(d),d=null),n.apply(null,w)};return[(...w)=>{const v=Date.now(),R=v-s;R>=l?p(w,v):(c=w,d||(d=setTimeout(()=>{d=null,p(c)},l-R)))},()=>c&&p(c)]}const cs=(n,i,s=3)=>{let l=0;const c=B0(50,250);return U0(d=>{const p=d.loaded,m=d.lengthComputable?d.total:void 0,S=p-l,w=c(S),v=p<=m;l=p;const R={loaded:p,total:m,progress:m?p/m:void 0,bytes:S,rate:w||void 0,estimated:w&&m&&v?(m-p)/w:void 0,event:d,lengthComputable:m!=null,[i?"download":"upload"]:!0};n(R)},s)},bf=(n,i)=>{const s=n!=null;return[l=>i[0]({lengthComputable:s,total:n,loaded:l}),i[1]]},Ff=n=>(...i)=>I.asap(()=>n(...i)),H0=Je.hasStandardBrowserEnv?((n,i)=>s=>(s=new URL(s,Je.origin),n.protocol===s.protocol&&n.host===s.host&&(i||n.port===s.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,W0=Je.hasStandardBrowserEnv?{write(n,i,s,l,c,d){const p=[n+"="+encodeURIComponent(i)];I.isNumber(s)&&p.push("expires="+new Date(s).toGMTString()),I.isString(l)&&p.push("path="+l),I.isString(c)&&p.push("domain="+c),d===!0&&p.push("secure"),document.cookie=p.join("; ")},read(n){const i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function V0(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Y0(n,i){return i?n.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):n}function th(n,i){return n&&!V0(i)?Y0(n,i):i}const Bf=n=>n instanceof ut?{...n}:n;function qn(n,i){i=i||{};const s={};function l(w,v,R,T){return I.isPlainObject(w)&&I.isPlainObject(v)?I.merge.call({caseless:T},w,v):I.isPlainObject(v)?I.merge({},v):I.isArray(v)?v.slice():v}function c(w,v,R,T){if(I.isUndefined(v)){if(!I.isUndefined(w))return l(void 0,w,R,T)}else return l(w,v,R,T)}function d(w,v){if(!I.isUndefined(v))return l(void 0,v)}function p(w,v){if(I.isUndefined(v)){if(!I.isUndefined(w))return l(void 0,w)}else return l(void 0,v)}function m(w,v,R){if(R in i)return l(w,v);if(R in n)return l(void 0,w)}const S={url:d,method:d,data:d,baseURL:p,transformRequest:p,transformResponse:p,paramsSerializer:p,timeout:p,timeoutMessage:p,withCredentials:p,withXSRFToken:p,adapter:p,responseType:p,xsrfCookieName:p,xsrfHeaderName:p,onUploadProgress:p,onDownloadProgress:p,decompress:p,maxContentLength:p,maxBodyLength:p,beforeRedirect:p,transport:p,httpAgent:p,httpsAgent:p,cancelToken:p,socketPath:p,responseEncoding:p,validateStatus:m,headers:(w,v,R)=>c(Bf(w),Bf(v),R,!0)};return I.forEach(Object.keys(Object.assign({},n,i)),function(v){const R=S[v]||c,T=R(n[v],i[v],v);I.isUndefined(T)&&R!==m||(s[v]=T)}),s}const nh=n=>{const i=qn({},n);let{data:s,withXSRFToken:l,xsrfHeaderName:c,xsrfCookieName:d,headers:p,auth:m}=i;i.headers=p=ut.from(p),i.url=Kp(th(i.baseURL,i.url),n.params,n.paramsSerializer),m&&p.set("Authorization","Basic "+btoa((m.username||"")+":"+(m.password?unescape(encodeURIComponent(m.password)):"")));let S;if(I.isFormData(s)){if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)p.setContentType(void 0);else if((S=p.getContentType())!==!1){const[w,...v]=S?S.split(";").map(R=>R.trim()).filter(Boolean):[];p.setContentType([w||"multipart/form-data",...v].join("; "))}}if(Je.hasStandardBrowserEnv&&(l&&I.isFunction(l)&&(l=l(i)),l||l!==!1&&H0(i.url))){const w=c&&d&&W0.read(d);w&&p.set(c,w)}return i},q0=typeof XMLHttpRequest<"u",Q0=q0&&function(n){return new Promise(function(s,l){const c=nh(n);let d=c.data;const p=ut.from(c.headers).normalize();let{responseType:m,onUploadProgress:S,onDownloadProgress:w}=c,v,R,T,O,E;function A(){O&&O(),E&&E(),c.cancelToken&&c.cancelToken.unsubscribe(v),c.signal&&c.signal.removeEventListener("abort",v)}let _=new XMLHttpRequest;_.open(c.method.toUpperCase(),c.url,!0),_.timeout=c.timeout;function H(){if(!_)return;const Q=ut.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),B={data:!m||m==="text"||m==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:Q,config:n,request:_};eh(function(U){s(U),A()},function(U){l(U),A()},B),_=null}"onloadend"in _?_.onloadend=H:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(H)},_.onabort=function(){_&&(l(new le("Request aborted",le.ECONNABORTED,n,_)),_=null)},_.onerror=function(){l(new le("Network Error",le.ERR_NETWORK,n,_)),_=null},_.ontimeout=function(){let X=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const B=c.transitional||Xp;c.timeoutErrorMessage&&(X=c.timeoutErrorMessage),l(new le(X,B.clarifyTimeoutError?le.ETIMEDOUT:le.ECONNABORTED,n,_)),_=null},d===void 0&&p.setContentType(null),"setRequestHeader"in _&&I.forEach(p.toJSON(),function(X,B){_.setRequestHeader(B,X)}),I.isUndefined(c.withCredentials)||(_.withCredentials=!!c.withCredentials),m&&m!=="json"&&(_.responseType=c.responseType),w&&([T,E]=cs(w,!0),_.addEventListener("progress",T)),S&&_.upload&&([R,O]=cs(S),_.upload.addEventListener("progress",R),_.upload.addEventListener("loadend",O)),(c.cancelToken||c.signal)&&(v=Q=>{_&&(l(!Q||Q.type?new Ir(null,n,_):Q),_.abort(),_=null)},c.cancelToken&&c.cancelToken.subscribe(v),c.signal&&(c.signal.aborted?v():c.signal.addEventListener("abort",v)));const b=F0(c.url);if(b&&Je.protocols.indexOf(b)===-1){l(new le("Unsupported protocol "+b+":",le.ERR_BAD_REQUEST,n));return}_.send(d||null)})},G0=(n,i)=>{const{length:s}=n=n?n.filter(Boolean):[];if(i||s){let l=new AbortController,c;const d=function(w){if(!c){c=!0,m();const v=w instanceof Error?w:this.reason;l.abort(v instanceof le?v:new Ir(v instanceof Error?v.message:v))}};let p=i&&setTimeout(()=>{p=null,d(new le(`timeout ${i} of ms exceeded`,le.ETIMEDOUT))},i);const m=()=>{n&&(p&&clearTimeout(p),p=null,n.forEach(w=>{w.unsubscribe?w.unsubscribe(d):w.removeEventListener("abort",d)}),n=null)};n.forEach(w=>w.addEventListener("abort",d));const{signal:S}=l;return S.unsubscribe=()=>I.asap(m),S}},K0=function*(n,i){let s=n.byteLength;if(s{const c=X0(n,i);let d=0,p,m=S=>{p||(p=!0,l&&l(S))};return new ReadableStream({async pull(S){try{const{done:w,value:v}=await c.next();if(w){m(),S.close();return}let R=v.byteLength;if(s){let T=d+=R;s(T)}S.enqueue(new Uint8Array(v))}catch(w){throw m(w),w}},cancel(S){return m(S),c.return()}},{highWaterMark:2})},ks=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rh=ks&&typeof ReadableStream=="function",Z0=ks&&(typeof TextEncoder=="function"?(n=>i=>n.encode(i))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),oh=(n,...i)=>{try{return!!n(...i)}catch{return!1}},ev=rh&&oh(()=>{let n=!1;const i=new Request(Je.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!i}),Hf=64*1024,qa=rh&&oh(()=>I.isReadableStream(new Response("").body)),ds={stream:qa&&(n=>n.body)};ks&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(i=>{!ds[i]&&(ds[i]=I.isFunction(n[i])?s=>s[i]():(s,l)=>{throw new le(`Response type '${i}' is not supported`,le.ERR_NOT_SUPPORT,l)})})})(new Response);const tv=async n=>{if(n==null)return 0;if(I.isBlob(n))return n.size;if(I.isSpecCompliantForm(n))return(await new Request(Je.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(I.isArrayBufferView(n)||I.isArrayBuffer(n))return n.byteLength;if(I.isURLSearchParams(n)&&(n=n+""),I.isString(n))return(await Z0(n)).byteLength},nv=async(n,i)=>{const s=I.toFiniteNumber(n.getContentLength());return s??tv(i)},rv=ks&&(async n=>{let{url:i,method:s,data:l,signal:c,cancelToken:d,timeout:p,onDownloadProgress:m,onUploadProgress:S,responseType:w,headers:v,withCredentials:R="same-origin",fetchOptions:T}=nh(n);w=w?(w+"").toLowerCase():"text";let O=G0([c,d&&d.toAbortSignal()],p),E;const A=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let _;try{if(S&&ev&&s!=="get"&&s!=="head"&&(_=await nv(v,l))!==0){let B=new Request(i,{method:"POST",body:l,duplex:"half"}),L;if(I.isFormData(l)&&(L=B.headers.get("content-type"))&&v.setContentType(L),B.body){const[U,oe]=bf(_,cs(Ff(S)));l=Uf(B.body,Hf,U,oe)}}I.isString(R)||(R=R?"include":"omit");const H="credentials"in Request.prototype;E=new Request(i,{...T,signal:O,method:s.toUpperCase(),headers:v.normalize().toJSON(),body:l,duplex:"half",credentials:H?R:void 0});let b=await fetch(E);const Q=qa&&(w==="stream"||w==="response");if(qa&&(m||Q&&A)){const B={};["status","statusText","headers"].forEach(ye=>{B[ye]=b[ye]});const L=I.toFiniteNumber(b.headers.get("content-length")),[U,oe]=m&&bf(L,cs(Ff(m),!0))||[];b=new Response(Uf(b.body,Hf,U,()=>{oe&&oe(),A&&A()}),B)}w=w||"text";let X=await ds[I.findKey(ds,w)||"text"](b,n);return!Q&&A&&A(),await new Promise((B,L)=>{eh(B,L,{data:X,headers:ut.from(b.headers),status:b.status,statusText:b.statusText,config:n,request:E})})}catch(H){throw A&&A(),H&&H.name==="TypeError"&&/fetch/i.test(H.message)?Object.assign(new le("Network Error",le.ERR_NETWORK,n,E),{cause:H.cause||H}):le.from(H,H&&H.code,n,E)}}),Qa={http:v0,xhr:Q0,fetch:rv};I.forEach(Qa,(n,i)=>{if(n){try{Object.defineProperty(n,"name",{value:i})}catch{}Object.defineProperty(n,"adapterName",{value:i})}});const Wf=n=>`- ${n}`,ov=n=>I.isFunction(n)||n===null||n===!1,ih={getAdapter:n=>{n=I.isArray(n)?n:[n];const{length:i}=n;let s,l;const c={};for(let d=0;d`adapter ${m} `+(S===!1?"is not supported by the environment":"is not available in the build"));let p=i?d.length>1?`since : -`+d.map(Wf).join(` -`):" "+Wf(d[0]):"as no adapter specified";throw new le("There is no suitable adapter to dispatch the request "+p,"ERR_NOT_SUPPORT")}return l},adapters:Qa};function Ta(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ir(null,n)}function Vf(n){return Ta(n),n.headers=ut.from(n.headers),n.data=Pa.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),ih.getAdapter(n.adapter||Io.adapter)(n).then(function(l){return Ta(n),l.data=Pa.call(n,n.transformResponse,l),l.headers=ut.from(l.headers),l},function(l){return Zp(l)||(Ta(n),l&&l.response&&(l.response.data=Pa.call(n,n.transformResponse,l.response),l.response.headers=ut.from(l.response.headers))),Promise.reject(l)})}const sh="1.7.9",Cs={};["object","boolean","number","function","string","symbol"].forEach((n,i)=>{Cs[n]=function(l){return typeof l===n||"a"+(i<1?"n ":" ")+n}});const Yf={};Cs.transitional=function(i,s,l){function c(d,p){return"[Axios v"+sh+"] Transitional option '"+d+"'"+p+(l?". "+l:"")}return(d,p,m)=>{if(i===!1)throw new le(c(p," has been removed"+(s?" in "+s:"")),le.ERR_DEPRECATED);return s&&!Yf[p]&&(Yf[p]=!0,console.warn(c(p," has been deprecated since v"+s+" and will be removed in the near future"))),i?i(d,p,m):!0}};Cs.spelling=function(i){return(s,l)=>(console.warn(`${l} is likely a misspelling of ${i}`),!0)};function iv(n,i,s){if(typeof n!="object")throw new le("options must be an object",le.ERR_BAD_OPTION_VALUE);const l=Object.keys(n);let c=l.length;for(;c-- >0;){const d=l[c],p=i[d];if(p){const m=n[d],S=m===void 0||p(m,d,n);if(S!==!0)throw new le("option "+d+" must be "+S,le.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new le("Unknown option "+d,le.ERR_BAD_OPTION)}}const os={assertOptions:iv,validators:Cs},Wt=os.validators;class Hn{constructor(i){this.defaults=i,this.interceptors={request:new zf,response:new zf}}async request(i,s){try{return await this._request(i,s)}catch(l){if(l instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const d=c.stack?c.stack.replace(/^.+\n/,""):"";try{l.stack?d&&!String(l.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(l.stack+=` -`+d):l.stack=d}catch{}}throw l}}_request(i,s){typeof i=="string"?(s=s||{},s.url=i):s=i||{},s=qn(this.defaults,s);const{transitional:l,paramsSerializer:c,headers:d}=s;l!==void 0&&os.assertOptions(l,{silentJSONParsing:Wt.transitional(Wt.boolean),forcedJSONParsing:Wt.transitional(Wt.boolean),clarifyTimeoutError:Wt.transitional(Wt.boolean)},!1),c!=null&&(I.isFunction(c)?s.paramsSerializer={serialize:c}:os.assertOptions(c,{encode:Wt.function,serialize:Wt.function},!0)),os.assertOptions(s,{baseUrl:Wt.spelling("baseURL"),withXsrfToken:Wt.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let p=d&&I.merge(d.common,d[s.method]);d&&I.forEach(["delete","get","head","post","put","patch","common"],E=>{delete d[E]}),s.headers=ut.concat(p,d);const m=[];let S=!0;this.interceptors.request.forEach(function(A){typeof A.runWhen=="function"&&A.runWhen(s)===!1||(S=S&&A.synchronous,m.unshift(A.fulfilled,A.rejected))});const w=[];this.interceptors.response.forEach(function(A){w.push(A.fulfilled,A.rejected)});let v,R=0,T;if(!S){const E=[Vf.bind(this),void 0];for(E.unshift.apply(E,m),E.push.apply(E,w),T=E.length,v=Promise.resolve(s);R{if(!l._listeners)return;let d=l._listeners.length;for(;d-- >0;)l._listeners[d](c);l._listeners=null}),this.promise.then=c=>{let d;const p=new Promise(m=>{l.subscribe(m),d=m}).then(c);return p.cancel=function(){l.unsubscribe(d)},p},i(function(d,p,m){l.reason||(l.reason=new Ir(d,p,m),s(l.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const s=this._listeners.indexOf(i);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const i=new AbortController,s=l=>{i.abort(l)};return this.subscribe(s),i.signal.unsubscribe=()=>this.unsubscribe(s),i.signal}static source(){let i;return{token:new cu(function(c){i=c}),cancel:i}}}function sv(n){return function(s){return n.apply(null,s)}}function lv(n){return I.isObject(n)&&n.isAxiosError===!0}const Ga={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(Ga).forEach(([n,i])=>{Ga[i]=n});function lh(n){const i=new Hn(n),s=$p(Hn.prototype.request,i);return I.extend(s,Hn.prototype,i,{allOwnKeys:!0}),I.extend(s,i,null,{allOwnKeys:!0}),s.create=function(c){return lh(qn(n,c))},s}const Ne=lh(Io);Ne.Axios=Hn;Ne.CanceledError=Ir;Ne.CancelToken=cu;Ne.isCancel=Zp;Ne.VERSION=sh;Ne.toFormData=Ss;Ne.AxiosError=le;Ne.Cancel=Ne.CanceledError;Ne.all=function(i){return Promise.all(i)};Ne.spread=sv;Ne.isAxiosError=lv;Ne.mergeConfig=qn;Ne.AxiosHeaders=ut;Ne.formToJSON=n=>Jp(I.isHTMLForm(n)?new FormData(n):n);Ne.getAdapter=ih.getAdapter;Ne.HttpStatusCode=Ga;Ne.default=Ne;const ah={apiBaseUrl:"/api"};class av{constructor(){of(this,"events",{})}on(i,s){return this.events[i]||(this.events[i]=[]),this.events[i].push(s),()=>this.off(i,s)}off(i,s){this.events[i]&&(this.events[i]=this.events[i].filter(l=>l!==s))}emit(i,...s){this.events[i]&&this.events[i].forEach(l=>{l(...s)})}}const uh=new av;/*! js-cookie v3.0.5 | MIT */function Yi(n){for(var i=1;i"u")){p=Yi({},i,p),typeof p.expires=="number"&&(p.expires=new Date(Date.now()+p.expires*864e5)),p.expires&&(p.expires=p.expires.toUTCString()),c=encodeURIComponent(c).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var m="";for(var S in p)p[S]&&(m+="; "+S,p[S]!==!0&&(m+="="+p[S].split(";")[0]));return document.cookie=c+"="+n.write(d,c)+m}}function l(c){if(!(typeof document>"u"||arguments.length&&!c)){for(var d=document.cookie?document.cookie.split("; "):[],p={},m=0;m{const s={username:n,password:i};return(await Gn.post("/auth/login",s)).data},dv=async n=>(await Gn.post("/users",n,{headers:{"Content-Type":"multipart/form-data"}})).data,fv=async()=>{await Gn.get("/auth/csrf-token")},pv=async()=>(await Gn.get("/auth/me")).data,hv=async()=>(await Gn.post("/auth/refresh")).data,mv=async()=>{await Gn.post("/auth/logout")},gv=async(n,i)=>{const s={userId:n,newRole:i};return(await Ye.put("/auth/role",s)).data},Na=n=>{const s=n.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),l=decodeURIComponent(atob(s).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(l)},Ve=Qn((n,i)=>({currentUser:null,accessToken:null,login:async(s,l)=>{const c=await cv(s,l),{userDto:d}=Na(c);n({accessToken:c,currentUser:d}),await i().fetchCsrfToken()},logout:async()=>{await mv(),i().clear(),i().fetchCsrfToken()},fetchCsrfToken:async()=>{await fv()},fetchMe:async()=>{const s=await pv(),{userDto:l}=Na(s);n({accessToken:s,currentUser:l})},refreshToken:async()=>{const s=await hv(),{userDto:l}=Na(s);n({accessToken:s,currentUser:l})},clear:()=>{n({currentUser:null})},updateUserRole:async(s,l)=>{await gv(s,l)}})),Ye=Ne.create({baseURL:ah.apiBaseUrl,headers:{"Content-Type":"application/json"},withCredentials:!0}),Gn=Ne.create({baseURL:ah.apiBaseUrl,headers:{"Content-Type":"application/json"},withCredentials:!0});Ye.interceptors.request.use(n=>{const i=ch.get("XSRF-TOKEN");i&&(n.headers["X-XSRF-TOKEN"]=i);const s=Ve.getState().accessToken;return s&&(n.headers.Authorization=`Bearer ${s}`),n},n=>Promise.reject(n));Gn.interceptors.request.use(n=>{const i=ch.get("XSRF-TOKEN");return i&&(n.headers["X-XSRF-TOKEN"]=i),n},n=>Promise.reject(n));Ye.interceptors.response.use(n=>n,async n=>{var i,s,l,c,d,p;if(((i=n.response)==null?void 0:i.status)===401&&!((l=(s=n.config)==null?void 0:s.url)!=null&&l.endsWith("/api/auth/refresh")))try{return await Ve.getState().refreshToken(),Ne(n.config)}catch{console.log("// 토큰 재발급 실패 → 로그아웃"),await Ve.getState().logout()}else{const m=(c=n.response)==null?void 0:c.data;if(m){const S=(p=(d=n.response)==null?void 0:d.headers)==null?void 0:p["discodeit-request-id"];S&&(m.requestId=S),n.response.data=m}return uh.emit("api-error",n),Promise.reject(n)}});const yv=()=>Ye.defaults.baseURL,vv=async(n,i)=>(await Ye.patch(`/users/${n}`,i,{headers:{"Content-Type":"multipart/form-data"}})).data,xv=async()=>(await Ye.get("/users")).data,Tr=Qn(n=>({users:[],fetchUsers:async()=>{try{const i=await xv();n({users:i})}catch(i){console.error("사용자 목록 조회 실패:",i)}}})),V={colors:{brand:{primary:"#5865F2",hover:"#4752C4"},background:{primary:"#1a1a1a",secondary:"#2a2a2a",tertiary:"#333333",input:"#40444B",hover:"rgba(255, 255, 255, 0.1)"},text:{primary:"#ffffff",secondary:"#cccccc",muted:"#999999"},status:{online:"#43b581",idle:"#faa61a",dnd:"#f04747",offline:"#747f8d",error:"#ED4245"},border:{primary:"#404040"}}},dh=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -`,fh=k.div` - background: ${V.colors.background.primary}; - padding: 32px; - border-radius: 8px; - width: 440px; - - h2 { - color: ${V.colors.text.primary}; - margin-bottom: 24px; - font-size: 24px; - font-weight: bold; - } - - form { - display: flex; - flex-direction: column; - gap: 16px; - } -`,Ro=k.input` - width: 100%; - padding: 10px; - border-radius: 4px; - background: ${V.colors.background.input}; - border: none; - color: ${V.colors.text.primary}; - font-size: 16px; - - &::placeholder { - color: ${V.colors.text.muted}; - } - - &:focus { - outline: none; - } -`,wv=k.input.attrs({type:"checkbox"})` - width: 16px; - height: 16px; - padding: 0; - border-radius: 4px; - background: ${V.colors.background.input}; - border: none; - color: ${V.colors.text.primary}; - cursor: pointer; - - &:focus { - outline: none; - } - - &:checked { - background: ${V.colors.brand.primary}; - } -`,ph=k.button` - width: 100%; - padding: 12px; - border-radius: 4px; - background: ${V.colors.brand.primary}; - color: white; - font-size: 16px; - font-weight: 500; - border: none; - cursor: pointer; - transition: background-color 0.2s; - - &:hover { - background: ${V.colors.brand.hover}; - } -`,hh=k.div` - color: ${V.colors.status.error}; - font-size: 14px; - text-align: center; -`,Sv=k.p` - text-align: center; - margin-top: 16px; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 14px; -`,kv=k.span` - color: ${({theme:n})=>n.colors.brand.primary}; - cursor: pointer; - - &:hover { - text-decoration: underline; - } -`,qi=k.div` - margin-bottom: 20px; -`,Qi=k.label` - display: block; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 12px; - font-weight: 700; - margin-bottom: 8px; -`,_a=k.span` - color: ${({theme:n})=>n.colors.status.error}; -`,Cv=k.div` - display: flex; - flex-direction: column; - align-items: center; - margin: 10px 0; -`,Ev=k.img` - width: 80px; - height: 80px; - border-radius: 50%; - margin-bottom: 10px; - object-fit: cover; -`,jv=k.input` - display: none; -`,Av=k.label` - color: ${({theme:n})=>n.colors.brand.primary}; - cursor: pointer; - font-size: 14px; - - &:hover { - text-decoration: underline; - } -`,Rv=k.span` - color: ${({theme:n})=>n.colors.brand.primary}; - cursor: pointer; - - &:hover { - text-decoration: underline; - } -`,Pv=k(Rv)` - display: block; - text-align: center; - margin-top: 16px; -`,xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAw2SURBVHgB7d3PT1XpHcfxBy5g6hipSMolGViACThxJDbVRZ2FXejKlf9h/4GmC1fTRdkwC8fE0JgyJuICFkCjEA04GeZe6P0cPC0698I95zzPc57v5f1K6DSto3A8n/v9nufXGfrr338+dgBMGnYAzCLAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwbcTDvyuWh//33w1/1dexwMRBgYxTW5vVh9/vxYTcxPpR9jY0OffZrdt8fu82ttlvfbLv9j4R5kBHgxCmcE1eH3NfTDTc7PfxZte3lJNgjbmlxxK3+1HKrr1oOg4kAJ0pVdnG+4ZqTw7+psEUoxF91Qv/Di1+db/q+ZpvD7g+T6gb04XLyv6mF3//osuqvTmDn3RGdQCAEOCG6+W/ONdzNTnCrhPZLN2Yb2T99hVhdwOLcSOf37f7hknUN4yedgLoGeb3Rdv/qdAIE2S8CnIDzAuGDQrzXeTZee1OtndaHy9LCSOHvU3++vv693nLPX9LS+0KAa6QQLC2o4sb5a1A7rYGtMqPU+l7v3hpx85+qeVnfdH7W2c7z/Pcrh1RjD5gHromq2JOHY9HCK2Ojzk1dL1fhH90fqxzenDoO/X79DMjhbAQ4Mg1OPXl4KauGodrls6j6FaXKq+dZn/IQ13ENBgkBjiRvQR99V2/lmZos9lc+PxOuxdd1uL3gp6pfVDwDR6Ab9cG9Me9VLAZ1CiHpmXhz6yibakJxVODAZpoN9/iBzfCq+sboFkJ/SAwyrlxAujE1WJWSIiO/sYKlxSpTnbEBqnBxVOBA9LybWnjloM8An6ysitc1NCe5FcvgqgVw/85o1OmhItY32n39uqnJuC3/FAEuhavmmcLra77UN7XP2322qRNX494aqvgojqvmUcrhFa1+6tdXkae6tMiEhR3FEWBPNOCTcni1rZCli4OHAHuQ4mjzaewJHlxMI1Wked5Uw7v99ijbwqd/FnVQQ7WmQyiOAFegZ7a736ZzCU820h+7nbfHbnO7XSq4p3+vmHbfMwdcBgGuoO4dNQrZxtaR+08nqNueT73Y2D7qTIW5aLRXGcUR4JL03FtHeBXa9Y2jyhX2PHudiqg/K9ZuoY3t/uan8TkCXIKCG/u5V2Fae9N2a+vtKO2tjqfVnxfj5zw5O4sWugwCXIJa51hiB/e0tfVWdkZX6CrMCHl5BLigWDt0RCc6rrxo1XZQu6rw6qt2tq47FD0G9Lu8E79FgAvIWucIO3QU2B9ftpK4sVWFZ5rDQTYbqHUOcdztRcJCjgLUToauvrqpny4fJlWVlp/5P4BOH1IcbFcdAe6Tght6h5FeiaLwpnZTq5VW2HzN1eYfUoS3OgLcp9sL4cOrkKT6YrI8dFUHnDQYR3j94Rm4D9kLxQLuV009vKdpXbXae00vFdm8UWVZJ3ojwH3QcS+hnn1VifSMaemVoPqeVzqDT6rG2oivQS5dH33l70ZS262w7n04yhae8MrTMAhwH0KNPFsfyNH3vd+pxkwD1Ydn4HOodQ5VfTXHyrMgqiDA55ibCbNJX1VLc6xAFQT4HCEGr9Q6s3wQPhDgM4RqnzWVQusMHwjwGTS66puCS/WFLwT4DCHOKia88IkA96BjTkOcVbzDQgZ4RIB7CBFejTzz7AufCHAPWn3lGwse4BsB7uGa5wqcLS3k7XvwjAD3cOWy84pnX4RAgHvw/QzMLhyEQIC7CLF4Y4+DyxEAAe4iRIB3PzD6DP8IcBejnncPagCL/bAIgQB34fsc5P2PtM8IgwBHcMjJqQiEAHfBm+JhBQGO4IDlkwiEAHdx2PIbuFhv+MPFQ4C7ODx0Xo2OOiAIAhwBz9QIhQB34XvOlhYaoRDgLg5+dl7pcACqMEIgwF2EWDV1bZwAwz8C3IVOzfAd4omrXGr4x13Vg++jb6YmudTwj7uqh733fgOsM6YZzIJvBLiH3Q/+NyDMB3pNCy4u3k7Yw+57/wNZM9PDbu2NGwjqJiauDrmvpxufXiv6+f+v63fw8SjrZDgLLBwC3INO0NBAls+2V220jurZNXw6h8K6ODfibsye/UjQnNR/nnQcGk/IX/DNsbp+EeAetAVQVaQ56fe5dXGu4X54YTPASwsj7uZ8o/CHmkJ/Y7aRfb3eaBNkj3gGPsNOgNZPN7G1RR36fh8/uJS96LxqR6Kf/9H9MRa2eEKAz7C5FaZS3l6w0/goaArchMeFKPkHwrVxbr+quIJn0LNqiFZPVSjEmx98U7UNVS016PWXe6NU4ooI8DnWN8O8DuX+H0eTnxdeWgjb7uv3/vMd9lpWQYDPEep9Rrp5by+kOy+s7+/mfPhWXyPzFrqRVHHlzpFPgYTwTScg87NphjhmZdTgGMohwH1YexPupdx3b40mN5ij6tuMuHabKlweV60PGo0OdTB7ioM5WjEWW5PNHqVw1fq09ibcu33zqZpUQjzTjN/Ws1urHK5an9bWW0Ffj5JSiOv4HiaYEy6Fq9YnLa1cfRWuCku+wOHmXL2DOnUEmGOHyiHABagKh17Dqxv57rcj7k+3RpKfJ0b9CHBBKy/ivOhIU0yPH4xdqD3EV37HB1ZRBLignc6c8MZW2FY6p5ZSK7b0bNyMOM3CTiE7CHAJz1+2or7vV1Msj74by4IcoyKHOMygH4fhptsHFgEuQRXqx5fx7zYFWRX5ycNL2UqpUFV5512cDuNLvAS9ONawlaQ10jpSJsZ64S+d3iCvm3777XGntW9nx9fsfqh+JK5+Nq0Qi43WvTgCXMHqq5abma53g75Gqmen9fX/alz1CBtNmenfj7k6yvIxQ3Wiha5AN/r3K4fJtX55hVarvVTy8AB9OMV0GGdwf+AQ4IpU4f75LN27Tzt9HtwbKzynrNF2zXvHsvOWClwGAfZAN18dg1r9UnuthSFF6WeK1doS4HIIsCeqVrHbziLUUpdZornc6S5iDC5p8A3FEWCPVn9KO8RlTpVUeJ8u/xLsUAPR780UUjkE2LOUQ6x11jPN4n/l+WDdaqDznEOdO3YREOAAFOJUn4mrTA3p51KQNU/sM8g8/5bHPHAgeibWAND9O2mdtlF147yCm2/o0IeBXlyuAwDKfjDotBMWcJRHBQ5IlUUVa1Bv0O1squnkVSllvd5kAXQVBDiwfBAo5pyqFbo2od5+cVEQ4Ag0CKRnYrWedVfjlLqBlEfsrSDAEWnwJx8Eqsve+zQCrA+SOq/DoCDAkeWDQE+X63k23txKIzRUXz8IcE00Qv23f/wSta3Odim9q/+Zc6Pz3Ev19YNppJrpRtaXXrGinUMhp5zUvqfg+Uu2HvlCgBORB1nzqYtzDTc77ffoHC3CSGEAS4N5zPv6Q4ATo7lVfV253MoWXegMrKob6xWaFKax9PzNdJpfBDhRqlL7n6qy2mqFWeuY9QaDfttsfRCoXd1NYOS5rnPEBh0BNuB0mGVifOgk1Ncb2VJGbVLIdxnp12qqaHO7HXQHURH6ngZ5RVqdCLBBqqj62jCwiknbBJefEd5QCDCCUWgV3hRa+EFFgBEEbXMcBBjeabR55UWLUzYiIMDwRoHVK1iZKoqHAMMLqm49CDAqyxefID42MwCGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhv0XZkN9IbEGbp4AAAAASUVORK5CYII=",Tv=({isOpen:n,onClose:i})=>{const[s,l]=te.useState(""),[c,d]=te.useState(""),[p,m]=te.useState(""),[S,w]=te.useState(null),[v,R]=te.useState(null),[T,O]=te.useState(""),{fetchCsrfToken:E}=Ve(),A=H=>{var Q;const b=(Q=H.target.files)==null?void 0:Q[0];if(b){w(b);const X=new FileReader;X.onloadend=()=>{R(X.result)},X.readAsDataURL(b)}},_=async H=>{H.preventDefault(),O("");try{const b=new FormData;b.append("userCreateRequest",new Blob([JSON.stringify({email:s,username:c,password:p})],{type:"application/json"})),S&&b.append("profile",S),await dv(b),await E(),i()}catch{O("회원가입에 실패했습니다.")}};return n?h.jsx(dh,{children:h.jsxs(fh,{children:[h.jsx("h2",{children:"계정 만들기"}),h.jsxs("form",{onSubmit:_,children:[h.jsxs(qi,{children:[h.jsxs(Qi,{children:["이메일 ",h.jsx(_a,{children:"*"})]}),h.jsx(Ro,{type:"email",value:s,onChange:H=>l(H.target.value),required:!0})]}),h.jsxs(qi,{children:[h.jsxs(Qi,{children:["사용자명 ",h.jsx(_a,{children:"*"})]}),h.jsx(Ro,{type:"text",value:c,onChange:H=>d(H.target.value),required:!0})]}),h.jsxs(qi,{children:[h.jsxs(Qi,{children:["비밀번호 ",h.jsx(_a,{children:"*"})]}),h.jsx(Ro,{type:"password",value:p,onChange:H=>m(H.target.value),required:!0})]}),h.jsxs(qi,{children:[h.jsx(Qi,{children:"프로필 이미지"}),h.jsxs(Cv,{children:[h.jsx(Ev,{src:v||xt,alt:"profile"}),h.jsx(jv,{type:"file",accept:"image/*",onChange:A,id:"profile-image"}),h.jsx(Av,{htmlFor:"profile-image",children:"이미지 변경"})]})]}),T&&h.jsx(hh,{children:T}),h.jsx(ph,{type:"submit",children:"계속하기"}),h.jsx(Pv,{onClick:i,children:"이미 계정이 있으신가요?"})]})]})}):null},Nv=({isOpen:n,onClose:i})=>{const[s,l]=te.useState(""),[c,d]=te.useState(""),[p,m]=te.useState(""),[S,w]=te.useState(!1),[v,R]=te.useState(!1),{login:T}=Ve(),{fetchUsers:O}=Tr(),E=async()=>{var A;try{await T(s,c),await O(),m(""),i()}catch(_){console.error("로그인 에러:",_),((A=_.response)==null?void 0:A.status)===401?m("아이디 또는 비밀번호가 올바르지 않습니다."):m("로그인에 실패했습니다.")}};return n?h.jsxs(h.Fragment,{children:[h.jsx(dh,{children:h.jsxs(fh,{children:[h.jsx("h2",{children:"돌아오신 것을 환영해요!"}),h.jsxs("form",{onSubmit:A=>{A.preventDefault(),E()},children:[h.jsx(Ro,{type:"text",placeholder:"사용자 이름",value:s,onChange:A=>l(A.target.value)}),h.jsx(Ro,{type:"password",placeholder:"비밀번호",value:c,onChange:A=>d(A.target.value)}),h.jsxs(_v,{children:[h.jsx(wv,{id:"rememberMe",checked:v,onChange:A=>R(A.target.checked)}),h.jsx(Iv,{htmlFor:"rememberMe",children:"로그인 유지"})]}),p&&h.jsx(hh,{children:p}),h.jsx(ph,{type:"submit",children:"로그인"})]}),h.jsxs(Sv,{children:["계정이 필요한가요? ",h.jsx(kv,{onClick:()=>w(!0),children:"가입하기"})]})]})}),h.jsx(Tv,{isOpen:S,onClose:()=>w(!1)})]}):null},_v=k.div` - display: flex; - align-items: center; - margin: 10px 0; - justify-content: flex-start; -`,Iv=k.label` - margin-left: 8px; - font-size: 14px; - color: #666; - cursor: pointer; - text-align: left; -`,Ov=async n=>(await Ye.get(`/channels?userId=${n}`)).data,Lv=async n=>(await Ye.post("/channels/public",n)).data,Dv=async n=>{const i={participantIds:n};return(await Ye.post("/channels/private",i)).data},Mv=async n=>(await Ye.get("/readStatuses",{params:{userId:n}})).data,qf=async(n,{newLastReadAt:i,newNotificationEnabled:s})=>{const l={newLastReadAt:i,newNotificationEnabled:s};return(await Ye.patch(`/readStatuses/${n}`,l)).data},zv=async(n,i,s)=>{const l={userId:n,channelId:i,lastReadAt:s};return(await Ye.post("/readStatuses",l)).data},Wn=Qn((n,i)=>({readStatuses:{},fetchReadStatuses:async()=>{try{const{currentUser:s}=Ve.getState();if(!s)return;const c=(await Mv(s.id)).reduce((d,p)=>(d[p.channelId]={id:p.id,lastReadAt:p.lastReadAt,notificationEnabled:p.notificationEnabled},d),{});n({readStatuses:c})}catch(s){console.error("읽음 상태 조회 실패:",s)}},updateReadStatus:async s=>{try{const{currentUser:l}=Ve.getState();if(!l)return;const c=i().readStatuses[s];let d;c?d=await qf(c.id,{newLastReadAt:new Date().toISOString(),newNotificationEnabled:null}):d=await zv(l.id,s,new Date().toISOString()),n(p=>({readStatuses:{...p.readStatuses,[s]:{id:d.id,lastReadAt:d.lastReadAt,notificationEnabled:d.notificationEnabled}}}))}catch(l){console.error("읽음 상태 업데이트 실패:",l)}},updateNotificationEnabled:async(s,l)=>{try{const{currentUser:c}=Ve.getState();if(!c)return;const d=i().readStatuses[s];let p;if(d)p=await qf(d.id,{newLastReadAt:null,newNotificationEnabled:l});else return;n(m=>({readStatuses:{...m.readStatuses,[s]:{id:p.id,lastReadAt:p.lastReadAt,notificationEnabled:p.notificationEnabled}}}))}catch(c){console.error("알림 상태 업데이트 실패:",c)}},hasUnreadMessages:(s,l)=>{const c=i().readStatuses[s],d=c==null?void 0:c.lastReadAt;return!d||new Date(l)>new Date(d)}})),En=Qn((n,i)=>({activeChannel:null,channels:[],pollingInterval:null,loading:!1,error:null,setActiveChannel:s=>{n({activeChannel:i().channels.find(l=>l.id===s)||null})},fetchChannels:async s=>{n({loading:!0,error:null});try{const l=await Ov(s);n(d=>{const p=new Set(d.channels.map(v=>v.id)),m=l.filter(v=>!p.has(v.id));return{channels:[...d.channels.filter(v=>l.some(R=>R.id===v.id)),...m],loading:!1}});const{fetchReadStatuses:c}=Wn.getState();return c(),l}catch(l){return n({error:l,loading:!1}),[]}},startPolling:s=>{const l=i().pollingInterval;l&&clearInterval(l);const c=setInterval(()=>{i().fetchChannels(s)},3e3);n({pollingInterval:c})},stopPolling:()=>{const s=i().pollingInterval;s&&(clearInterval(s),n({pollingInterval:null}))},createPublicChannel:async s=>{try{const l=await Lv(s);return n(c=>c.channels.some(p=>p.id===l.id)?c:{channels:[...c.channels,{...l,participantIds:[],lastMessageAt:new Date().toISOString()}]}),l}catch(l){throw console.error("공개 채널 생성 실패:",l),l}},createPrivateChannel:async s=>{try{const l=await Dv(s);return n(c=>c.channels.some(p=>p.id===l.id)?c:{channels:[...c.channels,{...l,participantIds:s,lastMessageAt:new Date().toISOString()}]}),l}catch(l){throw console.error("비공개 채널 생성 실패:",l),l}}})),Qf=async n=>(await Ye.get(`/binaryContents/${n}`)).data,$v=n=>`${yv()}/binaryContents/${n}/download`,bv=1e3,jn=Qn((n,i)=>({binaryContents:{},pollingTimers:{},fetchBinaryContent:async s=>{if(i().binaryContents[s])return i().binaryContents[s];try{const l=await Qf(s),{contentType:c,fileName:d,size:p,uploadStatus:m}=l,w={url:$v(s),contentType:c,fileName:d,size:p,uploadStatus:m};return n(v=>({binaryContents:{...v.binaryContents,[s]:w}})),m==="WAITING"&&i().startPolling(s),w}catch(l){return console.error("첨부파일 정보 조회 실패:",l),null}},startPolling:s=>{if(i().pollingTimers[s])return;const l=setInterval(async()=>{var c;try{const d=await Qf(s),{uploadStatus:p}=d;((c=i().binaryContents[s])==null?void 0:c.uploadStatus)!==p&&(i().updateBinaryContentStatus(s,p),p!=="WAITING"&&i().stopPolling(s))}catch(d){console.error("첨부파일 상태 폴링 실패:",d),i().stopPolling(s)}},bv);n(c=>({pollingTimers:{...c.pollingTimers,[s]:l}}))},stopPolling:s=>{const l=i().pollingTimers[s];l&&(clearInterval(l),n(c=>{const{[s]:d,...p}=c.pollingTimers;return{pollingTimers:p}}))},updateBinaryContentStatus:(s,l)=>{n(c=>({binaryContents:{...c.binaryContents,[s]:{...c.binaryContents[s],uploadStatus:l}}}))}})),Oo=k.div` - position: absolute; - bottom: -3px; - right: -3px; - width: 16px; - height: 16px; - border-radius: 50%; - background: ${n=>n.$online?V.colors.status.online:V.colors.status.offline}; - border: 4px solid ${n=>n.$background||V.colors.background.secondary}; -`;k.div` - width: 8px; - height: 8px; - border-radius: 50%; - margin-right: 8px; - background: ${n=>V.colors.status[n.status||"offline"]||V.colors.status.offline}; -`;const Or=k.div` - position: relative; - width: ${n=>n.$size||"32px"}; - height: ${n=>n.$size||"32px"}; - flex-shrink: 0; - margin: ${n=>n.$margin||"0"}; -`,nn=k.img` - width: 100%; - height: 100%; - border-radius: 50%; - object-fit: cover; - border: ${n=>n.$border||"none"}; -`;function Fv({isOpen:n,onClose:i,user:s}){var L,U;const[l,c]=te.useState(s.username),[d,p]=te.useState(s.email),[m,S]=te.useState(""),[w,v]=te.useState(null),[R,T]=te.useState(""),[O,E]=te.useState(null),{binaryContents:A,fetchBinaryContent:_}=jn(),{logout:H,refreshToken:b}=Ve();te.useEffect(()=>{var oe;(oe=s.profile)!=null&&oe.id&&!A[s.profile.id]&&_(s.profile.id)},[s.profile,A,_]);const Q=()=>{c(s.username),p(s.email),S(""),v(null),E(null),T(""),i()},X=oe=>{var Oe;const ye=(Oe=oe.target.files)==null?void 0:Oe[0];if(ye){v(ye);const ct=new FileReader;ct.onloadend=()=>{E(ct.result)},ct.readAsDataURL(ye)}},B=async oe=>{oe.preventDefault(),T("");try{const ye=new FormData,Oe={};l!==s.username&&(Oe.newUsername=l),d!==s.email&&(Oe.newEmail=d),m&&(Oe.newPassword=m),(Object.keys(Oe).length>0||w)&&(ye.append("userUpdateRequest",new Blob([JSON.stringify(Oe)],{type:"application/json"})),w&&ye.append("profile",w),await vv(s.id,ye),await b()),i()}catch{T("사용자 정보 수정에 실패했습니다.")}};return n?h.jsx(Bv,{children:h.jsxs(Uv,{children:[h.jsx("h2",{children:"프로필 수정"}),h.jsxs("form",{onSubmit:B,children:[h.jsxs(Gi,{children:[h.jsx(Ki,{children:"프로필 이미지"}),h.jsxs(Wv,{children:[h.jsx(Vv,{src:O||((L=s.profile)!=null&&L.id?(U=A[s.profile.id])==null?void 0:U.url:void 0)||xt,alt:"profile"}),h.jsx(Yv,{type:"file",accept:"image/*",onChange:X,id:"profile-image"}),h.jsx(qv,{htmlFor:"profile-image",children:"이미지 변경"})]})]}),h.jsxs(Gi,{children:[h.jsxs(Ki,{children:["사용자명 ",h.jsx(Kf,{children:"*"})]}),h.jsx(Ia,{type:"text",value:l,onChange:oe=>c(oe.target.value),required:!0})]}),h.jsxs(Gi,{children:[h.jsxs(Ki,{children:["이메일 ",h.jsx(Kf,{children:"*"})]}),h.jsx(Ia,{type:"email",value:d,onChange:oe=>p(oe.target.value),required:!0})]}),h.jsxs(Gi,{children:[h.jsx(Ki,{children:"새 비밀번호"}),h.jsx(Ia,{type:"password",placeholder:"변경하지 않으려면 비워두세요",value:m,onChange:oe=>S(oe.target.value)})]}),R&&h.jsx(Hv,{children:R}),h.jsxs(Qv,{children:[h.jsx(Gf,{type:"button",onClick:Q,$secondary:!0,children:"취소"}),h.jsx(Gf,{type:"submit",children:"저장"})]})]}),h.jsx(Gv,{onClick:H,children:"로그아웃"})]})}):null}const Bv=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -`,Uv=k.div` - background: ${({theme:n})=>n.colors.background.secondary}; - padding: 32px; - border-radius: 5px; - width: 100%; - max-width: 480px; - - h2 { - color: ${({theme:n})=>n.colors.text.primary}; - margin-bottom: 24px; - text-align: center; - font-size: 24px; - } -`,Ia=k.input` - width: 100%; - padding: 10px; - margin-bottom: 10px; - border: none; - border-radius: 4px; - background: ${({theme:n})=>n.colors.background.input}; - color: ${({theme:n})=>n.colors.text.primary}; - - &::placeholder { - color: ${({theme:n})=>n.colors.text.muted}; - } - - &:focus { - outline: none; - box-shadow: 0 0 0 2px ${({theme:n})=>n.colors.brand.primary}; - } -`,Gf=k.button` - width: 100%; - padding: 10px; - border: none; - border-radius: 4px; - background: ${({$secondary:n,theme:i})=>n?"transparent":i.colors.brand.primary}; - color: ${({theme:n})=>n.colors.text.primary}; - cursor: pointer; - font-weight: 500; - - &:hover { - background: ${({$secondary:n,theme:i})=>n?i.colors.background.hover:i.colors.brand.hover}; - } -`,Hv=k.div` - color: ${({theme:n})=>n.colors.status.error}; - font-size: 14px; - margin-bottom: 10px; -`,Wv=k.div` - display: flex; - flex-direction: column; - align-items: center; - margin-bottom: 20px; -`,Vv=k.img` - width: 100px; - height: 100px; - border-radius: 50%; - margin-bottom: 10px; - object-fit: cover; -`,Yv=k.input` - display: none; -`,qv=k.label` - color: ${({theme:n})=>n.colors.brand.primary}; - cursor: pointer; - font-size: 14px; - - &:hover { - text-decoration: underline; - } -`,Qv=k.div` - display: flex; - gap: 10px; - margin-top: 20px; -`,Gv=k.button` - width: 100%; - padding: 10px; - margin-top: 16px; - border: none; - border-radius: 4px; - background: transparent; - color: ${({theme:n})=>n.colors.status.error}; - cursor: pointer; - font-weight: 500; - - &:hover { - background: ${({theme:n})=>n.colors.status.error}20; - } -`,Gi=k.div` - margin-bottom: 20px; -`,Ki=k.label` - display: block; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 12px; - font-weight: 700; - margin-bottom: 8px; -`,Kf=k.span` - color: ${({theme:n})=>n.colors.status.error}; -`,Kv=k.div` - display: flex; - align-items: center; - gap: 0.75rem; - padding: 0.5rem 0.75rem; - background-color: ${({theme:n})=>n.colors.background.tertiary}; - width: 100%; - height: 52px; -`,Xv=k(Or)``;k(nn)``;const Jv=k.div` - flex: 1; - min-width: 0; - display: flex; - flex-direction: column; - justify-content: center; -`,Zv=k.div` - font-weight: 500; - color: ${({theme:n})=>n.colors.text.primary}; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-size: 0.875rem; - line-height: 1.2; -`,ex=k.div` - font-size: 0.75rem; - color: ${({theme:n})=>n.colors.text.secondary}; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - line-height: 1.2; -`,tx=k.div` - display: flex; - align-items: center; - flex-shrink: 0; -`,nx=k.button` - background: none; - border: none; - padding: 0.25rem; - cursor: pointer; - color: ${({theme:n})=>n.colors.text.secondary}; - font-size: 18px; - - &:hover { - color: ${({theme:n})=>n.colors.text.primary}; - } -`;function rx({user:n}){var d,p;const[i,s]=te.useState(!1),{binaryContents:l,fetchBinaryContent:c}=jn();return te.useEffect(()=>{var m;(m=n.profile)!=null&&m.id&&!l[n.profile.id]&&c(n.profile.id)},[n.profile,l,c]),h.jsxs(h.Fragment,{children:[h.jsxs(Kv,{children:[h.jsxs(Xv,{children:[h.jsx(nn,{src:(d=n.profile)!=null&&d.id?(p=l[n.profile.id])==null?void 0:p.url:xt,alt:n.username}),h.jsx(Oo,{$online:!0})]}),h.jsxs(Jv,{children:[h.jsx(Zv,{children:n.username}),h.jsx(ex,{children:"온라인"})]}),h.jsx(tx,{children:h.jsx(nx,{onClick:()=>s(!0),children:"⚙️"})})]}),h.jsx(Fv,{isOpen:i,onClose:()=>s(!1),user:n})]})}const ox=k.div` - width: 240px; - background: ${V.colors.background.secondary}; - border-right: 1px solid ${V.colors.border.primary}; - display: flex; - flex-direction: column; -`,ix=k.div` - flex: 1; - overflow-y: auto; -`,sx=k.div` - padding: 16px; - font-size: 16px; - font-weight: bold; - color: ${V.colors.text.primary}; -`,mh=k.div` - height: 34px; - padding: 0 8px; - margin: 1px 8px; - display: flex; - align-items: center; - gap: 6px; - color: ${n=>n.$hasUnread?n.theme.colors.text.primary:n.theme.colors.text.muted}; - font-weight: ${n=>n.$hasUnread?"600":"normal"}; - cursor: pointer; - background: ${n=>n.$isActive?n.theme.colors.background.hover:"transparent"}; - border-radius: 4px; - - &:hover { - background: ${n=>n.theme.colors.background.hover}; - color: ${n=>n.theme.colors.text.primary}; - } -`,Xf=k.div` - margin-bottom: 8px; -`,Xa=k.div` - padding: 8px 16px; - display: flex; - align-items: center; - color: ${V.colors.text.muted}; - text-transform: uppercase; - font-size: 12px; - font-weight: 600; - cursor: pointer; - user-select: none; - - & > span:nth-child(2) { - flex: 1; - margin-right: auto; - } - - &:hover { - color: ${V.colors.text.primary}; - } -`,Jf=k.span` - margin-right: 4px; - font-size: 10px; - transition: transform 0.2s; - transform: rotate(${n=>n.$folded?"-90deg":"0deg"}); -`,Zf=k.div` - display: ${n=>n.$folded?"none":"block"}; -`,ep=k(mh)` - height: ${n=>n.hasSubtext?"42px":"34px"}; -`,lx=k(Or)` - width: 32px; - height: 32px; - margin: 0 8px; -`,tp=k.div` - font-size: 16px; - line-height: 18px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: ${n=>n.$isActive||n.$hasUnread?n.theme.colors.text.primary:n.theme.colors.text.muted}; - font-weight: ${n=>n.$hasUnread?"600":"normal"}; -`;k(Oo)` - border-color: ${V.colors.background.primary}; -`;const np=k.button` - background: none; - border: none; - color: ${V.colors.text.muted}; - font-size: 18px; - padding: 0; - cursor: pointer; - width: 16px; - height: 16px; - display: flex; - align-items: center; - justify-content: center; - opacity: 0; - transition: opacity 0.2s, color 0.2s; - - ${Xa}:hover & { - opacity: 1; - } - - &:hover { - color: ${V.colors.text.primary}; - } -`,ax=k(Or)` - width: 40px; - height: 24px; - margin: 0 8px; -`,ux=k.div` - font-size: 12px; - line-height: 13px; - color: ${V.colors.text.muted}; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -`,rp=k.div` - flex: 1; - min-width: 0; - display: flex; - flex-direction: column; - justify-content: center; - gap: 2px; -`,cx=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.85); - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -`,dx=k.div` - background: ${V.colors.background.primary}; - border-radius: 4px; - width: 440px; - max-width: 90%; -`,fx=k.div` - padding: 16px; - display: flex; - justify-content: space-between; - align-items: center; -`,px=k.h2` - color: ${V.colors.text.primary}; - font-size: 20px; - font-weight: 600; - margin: 0; -`,hx=k.div` - padding: 0 16px 16px; -`,mx=k.form` - display: flex; - flex-direction: column; - gap: 16px; -`,Oa=k.div` - display: flex; - flex-direction: column; - gap: 8px; -`,La=k.label` - color: ${V.colors.text.primary}; - font-size: 12px; - font-weight: 600; - text-transform: uppercase; -`,gx=k.p` - color: ${V.colors.text.muted}; - font-size: 14px; - margin: -4px 0 0; -`,Ja=k.input` - padding: 10px; - background: ${V.colors.background.tertiary}; - border: none; - border-radius: 3px; - color: ${V.colors.text.primary}; - font-size: 16px; - - &:focus { - outline: none; - box-shadow: 0 0 0 2px ${V.colors.status.online}; - } - - &::placeholder { - color: ${V.colors.text.muted}; - } -`,yx=k.button` - margin-top: 8px; - padding: 12px; - background: ${V.colors.status.online}; - color: white; - border: none; - border-radius: 3px; - font-size: 14px; - font-weight: 500; - cursor: pointer; - transition: background 0.2s; - - &:hover { - background: #3ca374; - } -`,vx=k.button` - background: none; - border: none; - color: ${V.colors.text.muted}; - font-size: 24px; - cursor: pointer; - padding: 4px; - line-height: 1; - - &:hover { - color: ${V.colors.text.primary}; - } -`,xx=k(Ja)` - margin-bottom: 8px; -`,wx=k.div` - max-height: 300px; - overflow-y: auto; - background: ${V.colors.background.tertiary}; - border-radius: 4px; -`,Sx=k.div` - display: flex; - align-items: center; - padding: 8px 12px; - cursor: pointer; - transition: background 0.2s; - - &:hover { - background: ${V.colors.background.hover}; - } - - & + & { - border-top: 1px solid ${V.colors.border.primary}; - } -`,kx=k.input` - margin-right: 12px; - width: 16px; - height: 16px; - cursor: pointer; -`,op=k.img` - width: 32px; - height: 32px; - border-radius: 50%; - margin-right: 12px; -`,Cx=k.div` - flex: 1; - min-width: 0; -`,Ex=k.div` - color: ${V.colors.text.primary}; - font-size: 14px; - font-weight: 500; -`,jx=k.div` - color: ${V.colors.text.muted}; - font-size: 12px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -`,Ax=k.div` - padding: 16px; - text-align: center; - color: ${V.colors.text.muted}; -`,Rx=k.div` - color: ${V.colors.status.error}; - font-size: 14px; - padding: 8px 0; - text-align: center; - background-color: ${({theme:n})=>n.colors.background.tertiary}; - border-radius: 4px; - margin-bottom: 8px; -`;function Px(){return h.jsx(sx,{children:"채널 목록"})}function ip({channel:n,isActive:i,onClick:s,hasUnread:l}){var S;const{currentUser:c}=Ve(),{binaryContents:d}=jn();if(n.type==="PUBLIC")return h.jsxs(mh,{$isActive:i,onClick:s,$hasUnread:l,children:["# ",n.name]});const p=n.participants;if(p.length>2){const w=p.filter(v=>v.id!==(c==null?void 0:c.id)).map(v=>v.username).join(", ");return h.jsxs(ep,{$isActive:i,onClick:s,children:[h.jsx(ax,{children:p.filter(v=>v.id!==(c==null?void 0:c.id)).slice(0,2).map((v,R)=>{var T;return h.jsx(nn,{src:v.profile?(T=d[v.profile.id])==null?void 0:T.url:xt,style:{position:"absolute",left:R*16,zIndex:2-R,width:"24px",height:"24px",border:"2px solid #2a2a2a"}},v.id)})}),h.jsxs(rp,{children:[h.jsx(tp,{$hasUnread:l,children:w}),h.jsxs(ux,{children:["멤버 ",p.length,"명"]})]})]})}const m=p.filter(w=>w.id!==(c==null?void 0:c.id))[0];return m&&h.jsxs(ep,{$isActive:i,onClick:s,children:[h.jsxs(lx,{children:[h.jsx(nn,{src:m.profile?(S=d[m.profile.id])==null?void 0:S.url:xt,alt:"profile"}),h.jsx(Oo,{$online:m.online})]}),h.jsx(rp,{children:h.jsx(tp,{$hasUnread:l,children:m.username})})]})}function Tx({isOpen:n,type:i,onClose:s,onCreateSuccess:l}){const[c,d]=te.useState({name:"",description:""}),[p,m]=te.useState(""),[S,w]=te.useState([]),[v,R]=te.useState(""),T=Tr(B=>B.users),O=jn(B=>B.binaryContents),{currentUser:E}=Ve(),A=te.useMemo(()=>T.filter(B=>B.id!==(E==null?void 0:E.id)).filter(B=>B.username.toLowerCase().includes(p.toLowerCase())||B.email.toLowerCase().includes(p.toLowerCase())),[p,T,E]),_=En(B=>B.createPublicChannel),H=En(B=>B.createPrivateChannel),b=B=>{const{name:L,value:U}=B.target;d(oe=>({...oe,[L]:U}))},Q=B=>{w(L=>L.includes(B)?L.filter(U=>U!==B):[...L,B])},X=async B=>{var L,U;B.preventDefault(),R("");try{let oe;if(i==="PUBLIC"){if(!c.name.trim()){R("채널 이름을 입력해주세요.");return}const ye={name:c.name,description:c.description};oe=await _(ye)}else{if(S.length===0){R("대화 상대를 선택해주세요.");return}const ye=(E==null?void 0:E.id)&&[...S,E.id]||S;oe=await H(ye)}l(oe)}catch(oe){console.error("채널 생성 실패:",oe),R(((U=(L=oe.response)==null?void 0:L.data)==null?void 0:U.message)||"채널 생성에 실패했습니다. 다시 시도해주세요.")}};return n?h.jsx(cx,{onClick:s,children:h.jsxs(dx,{onClick:B=>B.stopPropagation(),children:[h.jsxs(fx,{children:[h.jsx(px,{children:i==="PUBLIC"?"채널 만들기":"개인 메시지 시작하기"}),h.jsx(vx,{onClick:s,children:"×"})]}),h.jsx(hx,{children:h.jsxs(mx,{onSubmit:X,children:[v&&h.jsx(Rx,{children:v}),i==="PUBLIC"?h.jsxs(h.Fragment,{children:[h.jsxs(Oa,{children:[h.jsx(La,{children:"채널 이름"}),h.jsx(Ja,{name:"name",value:c.name,onChange:b,placeholder:"새로운-채널",required:!0})]}),h.jsxs(Oa,{children:[h.jsx(La,{children:"채널 설명"}),h.jsx(gx,{children:"이 채널의 주제를 설명해주세요."}),h.jsx(Ja,{name:"description",value:c.description,onChange:b,placeholder:"채널 설명을 입력하세요"})]})]}):h.jsxs(Oa,{children:[h.jsx(La,{children:"사용자 검색"}),h.jsx(xx,{type:"text",value:p,onChange:B=>m(B.target.value),placeholder:"사용자명 또는 이메일로 검색"}),h.jsx(wx,{children:A.length>0?A.map(B=>h.jsxs(Sx,{children:[h.jsx(kx,{type:"checkbox",checked:S.includes(B.id),onChange:()=>Q(B.id)}),B.profile?h.jsx(op,{src:O[B.profile.id].url}):h.jsx(op,{src:xt}),h.jsxs(Cx,{children:[h.jsx(Ex,{children:B.username}),h.jsx(jx,{children:B.email})]})]},B.id)):h.jsx(Ax,{children:"검색 결과가 없습니다."})})]}),h.jsx(yx,{type:"submit",children:i==="PUBLIC"?"채널 만들기":"대화 시작하기"})]})})]})}):null}function Nx({currentUser:n,activeChannel:i,onChannelSelect:s}){var X,B;const[l,c]=te.useState({PUBLIC:!1,PRIVATE:!1}),[d,p]=te.useState({isOpen:!1,type:null}),m=En(L=>L.channels),S=En(L=>L.fetchChannels),w=En(L=>L.startPolling),v=En(L=>L.stopPolling),R=Wn(L=>L.fetchReadStatuses),T=Wn(L=>L.updateReadStatus),O=Wn(L=>L.hasUnreadMessages);te.useEffect(()=>{if(n)return S(n.id),R(),w(n.id),()=>{v()}},[n,S,R,w,v]);const E=L=>{c(U=>({...U,[L]:!U[L]}))},A=(L,U)=>{U.stopPropagation(),p({isOpen:!0,type:L})},_=()=>{p({isOpen:!1,type:null})},H=async L=>{try{const oe=(await S(n.id)).find(ye=>ye.id===L.id);oe&&s(oe.id),_()}catch(U){console.error("채널 생성 실패:",U)}},b=L=>{s(L.id),T(L.id)},Q=m.reduce((L,U)=>(L[U.type]||(L[U.type]=[]),L[U.type].push(U),L),{});return h.jsxs(ox,{children:[h.jsx(Px,{}),h.jsxs(ix,{children:[h.jsxs(Xf,{children:[h.jsxs(Xa,{onClick:()=>E("PUBLIC"),children:[h.jsx(Jf,{$folded:l.PUBLIC,children:"▼"}),h.jsx("span",{children:"일반 채널"}),h.jsx(np,{onClick:L=>A("PUBLIC",L),children:"+"})]}),h.jsx(Zf,{$folded:l.PUBLIC,children:(X=Q.PUBLIC)==null?void 0:X.map(L=>h.jsx(ip,{channel:L,isActive:(i==null?void 0:i.id)===L.id,hasUnread:O(L.id,L.lastMessageAt),onClick:()=>b(L)},L.id))})]}),h.jsxs(Xf,{children:[h.jsxs(Xa,{onClick:()=>E("PRIVATE"),children:[h.jsx(Jf,{$folded:l.PRIVATE,children:"▼"}),h.jsx("span",{children:"개인 메시지"}),h.jsx(np,{onClick:L=>A("PRIVATE",L),children:"+"})]}),h.jsx(Zf,{$folded:l.PRIVATE,children:(B=Q.PRIVATE)==null?void 0:B.map(L=>h.jsx(ip,{channel:L,isActive:(i==null?void 0:i.id)===L.id,hasUnread:O(L.id,L.lastMessageAt),onClick:()=>b(L)},L.id))})]})]}),h.jsx(_x,{children:h.jsx(rx,{user:n})}),h.jsx(Tx,{isOpen:d.isOpen,type:d.type,onClose:_,onCreateSuccess:H})]})}const _x=k.div` - margin-top: auto; - border-top: 1px solid ${({theme:n})=>n.colors.border.primary}; - background-color: ${({theme:n})=>n.colors.background.tertiary}; -`,Ix=k.div` - flex: 1; - display: flex; - flex-direction: column; - background: ${({theme:n})=>n.colors.background.primary}; -`,Ox=k.div` - display: flex; - flex-direction: column; - height: 100%; - background: ${({theme:n})=>n.colors.background.primary}; -`,Lx=k(Ox)` - justify-content: center; - align-items: center; - flex: 1; - padding: 0 20px; -`,Dx=k.div` - text-align: center; - max-width: 400px; - padding: 20px; - margin-bottom: 80px; -`,Mx=k.div` - font-size: 48px; - margin-bottom: 16px; - animation: wave 2s infinite; - transform-origin: 70% 70%; - - @keyframes wave { - 0% { transform: rotate(0deg); } - 10% { transform: rotate(14deg); } - 20% { transform: rotate(-8deg); } - 30% { transform: rotate(14deg); } - 40% { transform: rotate(-4deg); } - 50% { transform: rotate(10deg); } - 60% { transform: rotate(0deg); } - 100% { transform: rotate(0deg); } - } -`,zx=k.h2` - color: ${({theme:n})=>n.colors.text.primary}; - font-size: 28px; - font-weight: 700; - margin-bottom: 16px; -`,$x=k.p` - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 16px; - line-height: 1.6; - word-break: keep-all; -`,sp=k.div` - height: 48px; - padding: 0 16px; - background: ${V.colors.background.primary}; - border-bottom: 1px solid ${V.colors.border.primary}; - display: flex; - align-items: center; -`,lp=k.div` - display: flex; - align-items: center; - gap: 8px; - height: 100%; -`;k.div` - display: flex; - align-items: center; - gap: 8px; - height: 100%; - margin-left: auto; - padding-right: 8px; -`;const bx=k.div` - display: flex; - align-items: center; - gap: 12px; - height: 100%; -`,Fx=k(Or)` - width: 24px; - height: 24px; -`;k.img` - width: 24px; - height: 24px; - border-radius: 50%; -`;const Bx=k.div` - position: relative; - width: 40px; - height: 24px; - flex-shrink: 0; -`,Ux=k(Oo)` - border-color: ${V.colors.background.primary}; - bottom: -3px; - right: -3px; -`,Hx=k.div` - font-size: 12px; - color: ${V.colors.text.muted}; - line-height: 13px; -`,ap=k.div` - font-weight: bold; - color: ${V.colors.text.primary}; - line-height: 20px; - font-size: 16px; -`,Wx=k.div` - flex: 1; - display: flex; - flex-direction: column-reverse; - overflow-y: auto; -`,Vx=k.div` - padding: 16px; - display: flex; - flex-direction: column; -`,Yx=k.div` - margin-bottom: 16px; - display: flex; - align-items: flex-start; -`,qx=k(Or)` - margin-right: 16px; - width: 40px; - height: 40px; -`;k.img` - width: 40px; - height: 40px; - border-radius: 50%; -`;const Qx=k.div` - display: flex; - align-items: center; - margin-bottom: 4px; -`,Gx=k.span` - font-weight: bold; - color: ${V.colors.text.primary}; - margin-right: 8px; -`,Kx=k.span` - font-size: 0.75rem; - color: ${V.colors.text.muted}; -`,Xx=k.div` - color: ${V.colors.text.secondary}; - margin-top: 4px; -`,Jx=k.form` - display: flex; - align-items: center; - gap: 8px; - padding: 16px; - background: ${({theme:n})=>n.colors.background.secondary}; -`,Zx=k.textarea` - flex: 1; - padding: 12px; - background: ${({theme:n})=>n.colors.background.tertiary}; - border: none; - border-radius: 4px; - color: ${({theme:n})=>n.colors.text.primary}; - font-size: 14px; - resize: none; - min-height: 44px; - max-height: 144px; - - &:focus { - outline: none; - } - - &::placeholder { - color: ${({theme:n})=>n.colors.text.muted}; - } -`,e1=k.button` - background: none; - border: none; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 24px; - cursor: pointer; - padding: 4px 8px; - display: flex; - align-items: center; - justify-content: center; - - &:hover { - color: ${({theme:n})=>n.colors.text.primary}; - } -`;k.div` - flex: 1; - display: flex; - align-items: center; - justify-content: center; - color: ${V.colors.text.muted}; - font-size: 16px; - font-weight: 500; - padding: 20px; - text-align: center; -`;const up=k.div` - display: flex; - flex-wrap: wrap; - gap: 8px; - margin-top: 8px; - width: 100%; -`,t1=k.a` - display: block; - border-radius: 4px; - overflow: hidden; - max-width: 300px; - - img { - width: 100%; - height: auto; - display: block; - } -`,n1=k.a` - display: flex; - align-items: center; - gap: 12px; - padding: 12px; - background: ${({theme:n})=>n.colors.background.tertiary}; - border-radius: 8px; - text-decoration: none; - width: fit-content; - - &:hover { - background: ${({theme:n})=>n.colors.background.hover}; - } -`,r1=k.div` - width: 40px; - height: 40px; - display: flex; - align-items: center; - justify-content: center; - font-size: 40px; - color: #0B93F6; -`,o1=k.div` - display: flex; - flex-direction: column; - gap: 2px; -`,i1=k.span` - font-size: 14px; - color: #0B93F6; - font-weight: 500; -`,s1=k.span` - font-size: 13px; - color: ${({theme:n})=>n.colors.text.muted}; -`,l1=k.div` - display: flex; - flex-wrap: wrap; - gap: 8px; - padding: 8px 0; -`,gh=k.div` - position: relative; - display: flex; - align-items: center; - gap: 8px; - padding: 8px 12px; - background: ${({theme:n})=>n.colors.background.tertiary}; - border-radius: 4px; - max-width: 300px; -`,a1=k(gh)` - padding: 0; - overflow: hidden; - width: 200px; - max-width: 200px; - height: 120px; - - img { - width: 100%; - height: 100%; - object-fit: cover; - } -`,u1=k.div` - color: #0B93F6; - font-size: 20px; -`,c1=k.div` - font-size: 13px; - color: ${({theme:n})=>n.colors.text.primary}; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -`,cp=k.button` - position: absolute; - top: -6px; - right: -6px; - width: 20px; - height: 20px; - border-radius: 50%; - background: ${({theme:n})=>n.colors.background.secondary}; - border: none; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 16px; - line-height: 1; - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - padding: 0; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - - &:hover { - color: ${({theme:n})=>n.colors.text.primary}; - } -`,Da=k.div` - display: flex; - align-items: flex-end; - gap: 4px; - font-size: 12px; - color: ${n=>{switch(n.$status){case"WAITING":return"#666";case"SUCCESS":return"#28a745";case"FAILED":return"#dc3545"}}}; -`,d1=k.div` - width: 12px; - height: 12px; - border: 2px solid #f3f3f3; - border-top: 2px solid #0B93F6; - border-radius: 50%; - animation: spin 1s linear infinite; - - @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } - } -`,dp=k.span` - font-size: 12px; -`,fp=k.button` - background: none; - border: none; - padding: 8px; - cursor: pointer; - color: ${({theme:n,$enabled:i})=>i?n.colors.brand.primary:n.colors.text.muted}; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.2s ease; - - &:hover { - background: ${({theme:n})=>n.colors.background.hover}; - color: ${({theme:n})=>n.colors.brand.primary}; - } -`;function f1({channel:n}){var O;const{currentUser:i}=Ve(),s=Tr(E=>E.users),l=jn(E=>E.binaryContents),{readStatuses:c,updateNotificationEnabled:d}=Wn(),[p,m]=te.useState(!1);te.useEffect(()=>{c[n==null?void 0:n.id]&&m(c[n.id].notificationEnabled)},[c,n]);const S=te.useCallback(async()=>{if(!i||!n)return;const E=!p;m(E);try{await d(n.id,E)}catch(A){console.error("알림 설정 업데이트 실패:",A),m(p)}},[i,n,p,d]);if(!n)return null;if(n.type==="PUBLIC")return h.jsxs(sp,{children:[h.jsx(lp,{children:h.jsxs(ap,{children:["# ",n.name]})}),h.jsx(fp,{onClick:S,$enabled:p,children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),h.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]});const w=n.participants.map(E=>s.find(A=>A.id===E.id)).filter(Boolean),v=w.filter(E=>E.id!==(i==null?void 0:i.id)),R=w.length>2,T=w.filter(E=>E.id!==(i==null?void 0:i.id)).map(E=>E.username).join(", ");return h.jsxs(sp,{children:[h.jsx(lp,{children:h.jsxs(bx,{children:[R?h.jsx(Bx,{children:v.slice(0,2).map((E,A)=>{var _;return h.jsx(nn,{src:E.profile?(_=l[E.profile.id])==null?void 0:_.url:xt,style:{position:"absolute",left:A*16,zIndex:2-A,width:"24px",height:"24px"}},E.id)})}):h.jsxs(Fx,{children:[h.jsx(nn,{src:v[0].profile?(O=l[v[0].profile.id])==null?void 0:O.url:xt}),h.jsx(Ux,{$online:v[0].online})]}),h.jsxs("div",{children:[h.jsx(ap,{children:T}),R&&h.jsxs(Hx,{children:["멤버 ",w.length,"명"]})]})]})}),h.jsx(fp,{onClick:S,$enabled:p,children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),h.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]})}const p1=async(n,i,s)=>{var c;return(await Ye.get("/messages",{params:{channelId:n,cursor:i,size:s.size,sort:(c=s.sort)==null?void 0:c.join(",")}})).data},h1=async(n,i)=>{const s=new FormData,l={content:n.content,channelId:n.channelId,authorId:n.authorId};return s.append("messageCreateRequest",new Blob([JSON.stringify(l)],{type:"application/json"})),i&&i.length>0&&i.forEach(d=>{s.append("attachments",d)}),(await Ye.post("/messages",s,{headers:{"Content-Type":"multipart/form-data"}})).data},Ma={size:50,sort:["createdAt,desc"]},yh=Qn((n,i)=>({messages:[],pollingIntervals:{},lastMessageId:null,pagination:{nextCursor:null,pageSize:50,hasNext:!1},fetchMessages:async(s,l,c=Ma)=>{try{const d=await p1(s,l,c),p=d.content,m=p.length>0?p[0]:null,S=(m==null?void 0:m.id)!==i().lastMessageId;return n(w=>{var A;const v=!l,R=s!==((A=w.messages[0])==null?void 0:A.channelId),T=v&&(w.messages.length===0||R);let O=[],E={...w.pagination};if(T)O=p,E={nextCursor:d.nextCursor,pageSize:d.size,hasNext:d.hasNext};else if(v){const _=new Set(w.messages.map(b=>b.id));O=[...p.filter(b=>!_.has(b.id)&&(w.messages.length===0||b.createdAt>w.messages[0].createdAt)),...w.messages]}else{const _=new Set(w.messages.map(b=>b.id)),H=p.filter(b=>!_.has(b.id));O=[...w.messages,...H],E={nextCursor:d.nextCursor,pageSize:d.size,hasNext:d.hasNext}}return{messages:O,lastMessageId:(m==null?void 0:m.id)||null,pagination:E}}),S}catch(d){return console.error("메시지 목록 조회 실패:",d),!1}},loadMoreMessages:async s=>{const{pagination:l}=i();l.hasNext&&await i().fetchMessages(s,l.nextCursor,{...Ma})},startPolling:s=>{const l=i();if(l.pollingIntervals[s]){const m=l.pollingIntervals[s];typeof m=="number"&&clearTimeout(m)}let c=300;const d=3e3;n(m=>({pollingIntervals:{...m.pollingIntervals,[s]:!0}}));const p=async()=>{const m=i();if(!m.pollingIntervals[s])return;if(await m.fetchMessages(s,null,Ma)?c=300:c=Math.min(c*1.5,d),i().pollingIntervals[s]){const w=setTimeout(p,c);n(v=>({pollingIntervals:{...v.pollingIntervals,[s]:w}}))}};p()},stopPolling:s=>{const{pollingIntervals:l}=i();if(l[s]){const c=l[s];typeof c=="number"&&clearTimeout(c),n(d=>{const p={...d.pollingIntervals};return delete p[s],{pollingIntervals:p}})}},createMessage:async(s,l)=>{try{const c=await h1(s,l),d=Wn.getState().updateReadStatus;return await d(s.channelId),n(p=>p.messages.some(S=>S.id===c.id)?p:{messages:[c,...p.messages],lastMessageId:c.id}),c}catch(c){throw console.error("메시지 생성 실패:",c),c}}}));function m1({channel:n}){const[i,s]=te.useState(""),[l,c]=te.useState([]),d=yh(T=>T.createMessage),{currentUser:p}=Ve(),m=async T=>{if(T.preventDefault(),!(!i.trim()&&l.length===0))try{await d({content:i.trim(),channelId:n.id,authorId:(p==null?void 0:p.id)??""},l),s(""),c([])}catch(O){console.error("메시지 전송 실패:",O)}},S=T=>{const O=Array.from(T.target.files||[]);c(E=>[...E,...O]),T.target.value=""},w=T=>{c(O=>O.filter((E,A)=>A!==T))},v=T=>{if(T.key==="Enter"&&!T.shiftKey){if(T.preventDefault(),T.nativeEvent.isComposing)return;m(T)}},R=(T,O)=>T.type.startsWith("image/")?h.jsxs(a1,{children:[h.jsx("img",{src:URL.createObjectURL(T),alt:T.name}),h.jsx(cp,{onClick:()=>w(O),children:"×"})]},O):h.jsxs(gh,{children:[h.jsx(u1,{children:"📎"}),h.jsx(c1,{children:T.name}),h.jsx(cp,{onClick:()=>w(O),children:"×"})]},O);return te.useEffect(()=>()=>{l.forEach(T=>{T.type.startsWith("image/")&&URL.revokeObjectURL(URL.createObjectURL(T))})},[l]),n?h.jsxs(h.Fragment,{children:[l.length>0&&h.jsx(l1,{children:l.map((T,O)=>R(T,O))}),h.jsxs(Jx,{onSubmit:m,children:[h.jsxs(e1,{as:"label",children:["+",h.jsx("input",{type:"file",multiple:!0,onChange:S,style:{display:"none"}})]}),h.jsx(Zx,{value:i,onChange:T=>s(T.target.value),onKeyDown:v,placeholder:n.type==="PUBLIC"?`#${n.name}에 메시지 보내기`:"메시지 보내기"})]})]}):null}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */var Za=function(n,i){return Za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var c in l)l.hasOwnProperty(c)&&(s[c]=l[c])},Za(n,i)};function g1(n,i){Za(n,i);function s(){this.constructor=n}n.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}var Po=function(){return Po=Object.assign||function(i){for(var s,l=1,c=arguments.length;ln?O():i!==!0&&(c=setTimeout(l?E:O,l===void 0?n-R:n))}return w.cancel=S,w}var Er={Pixel:"Pixel",Percent:"Percent"},pp={unit:Er.Percent,value:.8};function hp(n){return typeof n=="number"?{unit:Er.Percent,value:n*100}:typeof n=="string"?n.match(/^(\d*(\.\d+)?)px$/)?{unit:Er.Pixel,value:parseFloat(n)}:n.match(/^(\d*(\.\d+)?)%$/)?{unit:Er.Percent,value:parseFloat(n)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),pp):(console.warn("scrollThreshold should be string or number"),pp)}var v1=function(n){g1(i,n);function i(s){var l=n.call(this,s)||this;return l.lastScrollTop=0,l.actionTriggered=!1,l.startY=0,l.currentY=0,l.dragging=!1,l.maxPullDownDistance=0,l.getScrollableTarget=function(){return l.props.scrollableTarget instanceof HTMLElement?l.props.scrollableTarget:typeof l.props.scrollableTarget=="string"?document.getElementById(l.props.scrollableTarget):(l.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might - happen because the element may not have been added to DOM yet. - See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info. - `),null)},l.onStart=function(c){l.lastScrollTop||(l.dragging=!0,c instanceof MouseEvent?l.startY=c.pageY:c instanceof TouchEvent&&(l.startY=c.touches[0].pageY),l.currentY=l.startY,l._infScroll&&(l._infScroll.style.willChange="transform",l._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},l.onMove=function(c){l.dragging&&(c instanceof MouseEvent?l.currentY=c.pageY:c instanceof TouchEvent&&(l.currentY=c.touches[0].pageY),!(l.currentY=Number(l.props.pullDownToRefreshThreshold)&&l.setState({pullToRefreshThresholdBreached:!0}),!(l.currentY-l.startY>l.maxPullDownDistance*1.5)&&l._infScroll&&(l._infScroll.style.overflow="visible",l._infScroll.style.transform="translate3d(0px, "+(l.currentY-l.startY)+"px, 0px)")))},l.onEnd=function(){l.startY=0,l.currentY=0,l.dragging=!1,l.state.pullToRefreshThresholdBreached&&(l.props.refreshFunction&&l.props.refreshFunction(),l.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){l._infScroll&&(l._infScroll.style.overflow="auto",l._infScroll.style.transform="none",l._infScroll.style.willChange="unset")})},l.onScrollListener=function(c){typeof l.props.onScroll=="function"&&setTimeout(function(){return l.props.onScroll&&l.props.onScroll(c)},0);var d=l.props.height||l._scrollableNode?c.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!l.actionTriggered){var p=l.props.inverse?l.isElementAtTop(d,l.props.scrollThreshold):l.isElementAtBottom(d,l.props.scrollThreshold);p&&l.props.hasMore&&(l.actionTriggered=!0,l.setState({showLoader:!0}),l.props.next&&l.props.next()),l.lastScrollTop=d.scrollTop}},l.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:s.dataLength},l.throttledOnScrollListener=y1(150,l.onScrollListener).bind(l),l.onStart=l.onStart.bind(l),l.onMove=l.onMove.bind(l),l.onEnd=l.onEnd.bind(l),l}return i.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing. - Pull Down To Refresh functionality will not work - as expected. Check README.md for usage'`)},i.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},i.prototype.componentDidUpdate=function(s){this.props.dataLength!==s.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},i.getDerivedStateFromProps=function(s,l){var c=s.dataLength!==l.prevDataLength;return c?Po(Po({},l),{prevDataLength:s.dataLength}):null},i.prototype.isElementAtTop=function(s,l){l===void 0&&(l=.8);var c=s===document.body||s===document.documentElement?window.screen.availHeight:s.clientHeight,d=hp(l);return d.unit===Er.Pixel?s.scrollTop<=d.value+c-s.scrollHeight+1:s.scrollTop<=d.value/100+c-s.scrollHeight+1},i.prototype.isElementAtBottom=function(s,l){l===void 0&&(l=.8);var c=s===document.body||s===document.documentElement?window.screen.availHeight:s.clientHeight,d=hp(l);return d.unit===Er.Pixel?s.scrollTop+c>=s.scrollHeight-d.value:s.scrollTop+c>=d.value/100*s.scrollHeight},i.prototype.render=function(){var s=this,l=Po({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),c=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),d=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return yt.createElement("div",{style:d,className:"infinite-scroll-component__outerdiv"},yt.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(p){return s._infScroll=p},style:l},this.props.pullDownToRefresh&&yt.createElement("div",{style:{position:"relative"},ref:function(p){return s._pullDown=p}},yt.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!c&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},i}(te.Component);const x1=n=>n<1024?n+" B":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB";function w1({channel:n}){const{messages:i,fetchMessages:s,loadMoreMessages:l,pagination:c,startPolling:d,stopPolling:p}=yh(),{binaryContents:m,fetchBinaryContent:S}=jn();te.useEffect(()=>{if(n!=null&&n.id)return s(n.id,null),d(n.id),()=>{p(n.id)}},[n==null?void 0:n.id,s,d,p]),te.useEffect(()=>{i.forEach(O=>{var E;(E=O.attachments)==null||E.forEach(A=>{m[A.id]||S(A.id)})})},[i,m,S]);const w=async O=>{try{const{url:E,fileName:A}=O,_=document.createElement("a");_.href=E,_.download=A,_.style.display="none",document.body.appendChild(_);try{const b=await(await window.showSaveFilePicker({suggestedName:O.fileName,types:[{description:"Files",accept:{"*/*":[".txt",".pdf",".doc",".docx",".xls",".xlsx",".jpg",".jpeg",".png",".gif"]}}]})).createWritable(),X=await(await fetch(E)).blob();await b.write(X),await b.close()}catch(H){H.name!=="AbortError"&&_.click()}document.body.removeChild(_),window.URL.revokeObjectURL(E)}catch(E){console.error("파일 다운로드 실패:",E)}},v=O=>O!=null&&O.length?O.map(E=>{const A=m[E.id];if(!A)return null;const _=A.contentType.startsWith("image/"),H=b=>{switch(b){case"WAITING":return h.jsx(Da,{$status:b,children:h.jsx(d1,{})});case"SUCCESS":return h.jsx(Da,{$status:b,children:h.jsx(dp,{children:"✓"})});case"FAILED":return h.jsx(Da,{$status:b,children:h.jsx(dp,{children:"✕"})})}};return _?h.jsxs(up,{children:[h.jsx(t1,{href:"#",onClick:b=>{b.preventDefault(),A.uploadStatus==="SUCCESS"&&w(A)},style:{opacity:A.uploadStatus==="SUCCESS"?1:.5},children:h.jsx("img",{src:A.url,alt:A.fileName},`${A.url}-${A.uploadStatus}`)}),H(A.uploadStatus)]},A.url):h.jsxs(up,{children:[h.jsxs(n1,{href:"#",onClick:b=>{b.preventDefault(),A.uploadStatus==="SUCCESS"&&w(A)},style:{opacity:A.uploadStatus==="SUCCESS"?1:.5},children:[h.jsx(r1,{children:h.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:[h.jsx("path",{d:"M8 3C8 1.89543 8.89543 1 10 1H22L32 11V37C32 38.1046 31.1046 39 30 39H10C8.89543 39 8 38.1046 8 37V3Z",fill:"#0B93F6",fillOpacity:"0.1"}),h.jsx("path",{d:"M22 1L32 11H24C22.8954 11 22 10.1046 22 9V1Z",fill:"#0B93F6",fillOpacity:"0.3"}),h.jsx("path",{d:"M13 19H27M13 25H27M13 31H27",stroke:"#0B93F6",strokeWidth:"2",strokeLinecap:"round"})]})}),h.jsxs(o1,{children:[h.jsx(i1,{children:A.fileName}),h.jsx(s1,{children:x1(A.size)})]})]}),H(A.uploadStatus)]},A.url)}):null,R=O=>new Date(O).toLocaleTimeString(),T=()=>{n!=null&&n.id&&l(n.id)};return h.jsx(Wx,{children:h.jsx("div",{id:"scrollableDiv",style:{height:"100%",overflow:"auto",display:"flex",flexDirection:"column-reverse"},children:h.jsx(v1,{dataLength:i.length,next:T,hasMore:c.hasNext,loader:h.jsx("h4",{style:{textAlign:"center"},children:"메시지를 불러오는 중..."}),scrollableTarget:"scrollableDiv",style:{display:"flex",flexDirection:"column-reverse"},inverse:!0,endMessage:h.jsx("p",{style:{textAlign:"center"},children:h.jsx("b",{children:c.nextCursor!==null?"모든 메시지를 불러왔습니다":""})}),children:h.jsx(Vx,{children:[...i].reverse().map(O=>{var A;const E=O.author;return h.jsxs(Yx,{children:[h.jsx(qx,{children:h.jsx(nn,{src:E&&E.profile?(A=m[E.profile.id])==null?void 0:A.url:xt,alt:E&&E.username||"알 수 없음"})}),h.jsxs("div",{children:[h.jsxs(Qx,{children:[h.jsx(Gx,{children:E&&E.username||"알 수 없음"}),h.jsx(Kx,{children:R(O.createdAt)})]}),h.jsx(Xx,{children:O.content}),v(O.attachments)]})]},O.id)})})})})})}function S1({channel:n}){return n?h.jsxs(Ix,{children:[h.jsx(f1,{channel:n}),h.jsx(w1,{channel:n}),h.jsx(m1,{channel:n})]}):h.jsx(Lx,{children:h.jsxs(Dx,{children:[h.jsx(Mx,{children:"👋"}),h.jsx(zx,{children:"채널을 선택해주세요"}),h.jsxs($x,{children:["왼쪽의 채널 목록에서 채널을 선택하여",h.jsx("br",{}),"대화를 시작하세요."]})]})})}function k1(n,i="yyyy-MM-dd HH:mm:ss"){if(!n||!(n instanceof Date)||isNaN(n.getTime()))return"";const s=n.getFullYear(),l=String(n.getMonth()+1).padStart(2,"0"),c=String(n.getDate()).padStart(2,"0"),d=String(n.getHours()).padStart(2,"0"),p=String(n.getMinutes()).padStart(2,"0"),m=String(n.getSeconds()).padStart(2,"0");return i.replace("yyyy",s.toString()).replace("MM",l).replace("dd",c).replace("HH",d).replace("mm",p).replace("ss",m)}const C1=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.7); - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -`,E1=k.div` - background: ${({theme:n})=>n.colors.background.primary}; - border-radius: 8px; - width: 500px; - max-width: 90%; - padding: 24px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); -`,j1=k.div` - display: flex; - align-items: center; - margin-bottom: 16px; -`,A1=k.div` - color: ${({theme:n})=>n.colors.status.error}; - font-size: 24px; - margin-right: 12px; -`,R1=k.h3` - color: ${({theme:n})=>n.colors.text.primary}; - margin: 0; - font-size: 18px; -`,P1=k.div` - background: ${({theme:n})=>n.colors.background.tertiary}; - color: ${({theme:n})=>n.colors.text.muted}; - padding: 2px 8px; - border-radius: 4px; - font-size: 14px; - margin-left: auto; -`,T1=k.p` - color: ${({theme:n})=>n.colors.text.secondary}; - margin-bottom: 20px; - line-height: 1.5; - font-weight: 500; -`,N1=k.div` - margin-bottom: 20px; - background: ${({theme:n})=>n.colors.background.secondary}; - border-radius: 6px; - padding: 12px; -`,ko=k.div` - display: flex; - margin-bottom: 8px; - font-size: 14px; -`,Co=k.span` - color: ${({theme:n})=>n.colors.text.muted}; - min-width: 100px; -`,Eo=k.span` - color: ${({theme:n})=>n.colors.text.secondary}; - word-break: break-word; -`,_1=k.button` - background: ${({theme:n})=>n.colors.brand.primary}; - color: white; - border: none; - border-radius: 4px; - padding: 8px 16px; - font-size: 14px; - font-weight: 500; - cursor: pointer; - width: 100%; - - &:hover { - background: ${({theme:n})=>n.colors.brand.hover}; - } -`;function I1({isOpen:n,onClose:i,error:s}){var T,O;if(!n)return null;const l=(T=s==null?void 0:s.response)==null?void 0:T.data,c=(l==null?void 0:l.status)||((O=s==null?void 0:s.response)==null?void 0:O.status)||"오류",d=(l==null?void 0:l.code)||"",p=(l==null?void 0:l.message)||(s==null?void 0:s.message)||"알 수 없는 오류가 발생했습니다.",m=l!=null&&l.timestamp?new Date(l.timestamp):new Date,S=k1(m),w=(l==null?void 0:l.exceptionType)||"",v=(l==null?void 0:l.details)||{},R=(l==null?void 0:l.requestId)||"";return h.jsx(C1,{onClick:i,children:h.jsxs(E1,{onClick:E=>E.stopPropagation(),children:[h.jsxs(j1,{children:[h.jsx(A1,{children:"⚠️"}),h.jsx(R1,{children:"오류가 발생했습니다"}),h.jsxs(P1,{children:[c,d?` (${d})`:""]})]}),h.jsx(T1,{children:p}),h.jsxs(N1,{children:[h.jsxs(ko,{children:[h.jsx(Co,{children:"시간:"}),h.jsx(Eo,{children:S})]}),R&&h.jsxs(ko,{children:[h.jsx(Co,{children:"요청 ID:"}),h.jsx(Eo,{children:R})]}),d&&h.jsxs(ko,{children:[h.jsx(Co,{children:"에러 코드:"}),h.jsx(Eo,{children:d})]}),w&&h.jsxs(ko,{children:[h.jsx(Co,{children:"예외 유형:"}),h.jsx(Eo,{children:w})]}),Object.keys(v).length>0&&h.jsxs(ko,{children:[h.jsx(Co,{children:"상세 정보:"}),h.jsx(Eo,{children:Object.entries(v).map(([E,A])=>h.jsxs("div",{children:[E,": ",String(A)]},E))})]})]}),h.jsx(_1,{onClick:i,children:"확인"})]})})}const O1=k.div` - width: 240px; - background: ${V.colors.background.secondary}; - border-left: 1px solid ${V.colors.border.primary}; - display: flex; - flex-direction: column; - height: 100%; -`,L1=k.div` - padding: 0px 16px; - height: 48px; - font-size: 14px; - font-weight: bold; - color: ${V.colors.text.muted}; - text-transform: uppercase; - border-bottom: 1px solid ${V.colors.border.primary}; -`,D1=k.div` - display: flex; - justify-content: space-between; - align-items: center; -`,M1=k.div` - padding: 8px 16px; - display: flex; - align-items: center; - color: ${V.colors.text.muted}; - &:hover { - background: ${V.colors.background.primary}; - cursor: pointer; - } -`,z1=k(Or)` - margin-right: 12px; -`;k(nn)``;const $1=k.div` - display: flex; - align-items: center; -`;function b1({member:n}){var l,c,d;const{binaryContents:i,fetchBinaryContent:s}=jn();return te.useEffect(()=>{var p;(p=n.profile)!=null&&p.id&&!i[n.profile.id]&&s(n.profile.id)},[(l=n.profile)==null?void 0:l.id,i,s]),h.jsxs(M1,{children:[h.jsxs(z1,{children:[h.jsx(nn,{src:(c=n.profile)!=null&&c.id&&((d=i[n.profile.id])==null?void 0:d.url)||xt,alt:n.username}),h.jsx(Oo,{$online:n.online})]}),h.jsx($1,{children:n.username})]})}var kr=(n=>(n.USER="USER",n.CHANNEL_MANAGER="CHANNEL_MANAGER",n.ADMIN="ADMIN",n))(kr||{}),eu=(n=>(n.NEW_MESSAGE="NEW_MESSAGE",n.ROLE_CHANGED="ROLE_CHANGED",n.ASYNC_FAILED="ASYNC_FAILED",n))(eu||{});function F1({member:n,onClose:i}){var O,E,A;const{binaryContents:s,fetchBinaryContent:l}=jn(),{currentUser:c,updateUserRole:d}=Ve(),[p,m]=te.useState(n.role),[S,w]=te.useState(!1);te.useEffect(()=>{var _;(_=n.profile)!=null&&_.id&&!s[n.profile.id]&&l(n.profile.id)},[(O=n.profile)==null?void 0:O.id,s,l]);const v={[kr.USER]:{name:"사용자",color:"#2ed573"},[kr.CHANNEL_MANAGER]:{name:"채널 관리자",color:"#ff4757"},[kr.ADMIN]:{name:"어드민",color:"#0097e6"}},R=_=>{m(_),w(!0)},T=()=>{d(n.id,p),w(!1)};return h.jsx(H1,{onClick:i,children:h.jsxs(W1,{onClick:_=>_.stopPropagation(),children:[h.jsx("h2",{children:"사용자 정보"}),h.jsxs(V1,{children:[h.jsx(Y1,{src:(E=n.profile)!=null&&E.id&&((A=s[n.profile.id])==null?void 0:A.url)||xt,alt:n.username}),h.jsx(q1,{children:n.username}),h.jsx(Q1,{children:n.email}),h.jsx(G1,{$online:n.online,children:n.online?"온라인":"오프라인"}),(c==null?void 0:c.role)===kr.ADMIN?h.jsx(U1,{value:p,onChange:_=>R(_.target.value),children:Object.entries(v).map(([_,H])=>h.jsx("option",{value:_,style:{marginTop:"8px",textAlign:"center"},children:H.name},_))}):h.jsx(B1,{style:{backgroundColor:v[n.role].color},children:v[n.role].name})]}),h.jsx(K1,{children:(c==null?void 0:c.role)===kr.ADMIN&&S&&h.jsx(X1,{onClick:T,disabled:!S,$secondary:!S,children:"저장"})})]})})}const B1=k.div` - padding: 6px 16px; - border-radius: 20px; - font-size: 13px; - font-weight: 600; - color: white; - margin-top: 12px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - letter-spacing: 0.3px; -`,U1=k.select` - padding: 10px 16px; - border-radius: 8px; - border: 1.5px solid ${V.colors.border.primary}; - background: ${V.colors.background.primary}; - color: ${V.colors.text.primary}; - font-size: 14px; - width: 140px; - cursor: pointer; - transition: all 0.2s ease; - margin-top: 12px; - font-weight: 500; - - &:hover { - border-color: ${V.colors.brand.primary}; - } - - &:focus { - outline: none; - border-color: ${V.colors.brand.primary}; - box-shadow: 0 0 0 2px ${V.colors.brand.primary}20; - } - - option { - background: ${V.colors.background.primary}; - color: ${V.colors.text.primary}; - padding: 12px; - } -`,H1=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.6); - backdrop-filter: blur(4px); - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -`,W1=k.div` - background: ${V.colors.background.secondary}; - padding: 40px; - border-radius: 16px; - width: 100%; - max-width: 420px; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); - - h2 { - color: ${V.colors.text.primary}; - margin-bottom: 32px; - text-align: center; - font-size: 26px; - font-weight: 600; - letter-spacing: -0.5px; - } -`,V1=k.div` - display: flex; - flex-direction: column; - align-items: center; - margin-bottom: 32px; - padding: 24px; - background: ${V.colors.background.primary}; - border-radius: 12px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); -`,Y1=k.img` - width: 140px; - height: 140px; - border-radius: 50%; - margin-bottom: 20px; - object-fit: cover; - border: 4px solid ${V.colors.background.secondary}; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); -`,q1=k.div` - font-size: 22px; - font-weight: 600; - color: ${V.colors.text.primary}; - margin-bottom: 8px; - letter-spacing: -0.3px; -`,Q1=k.div` - font-size: 14px; - color: ${V.colors.text.muted}; - margin-bottom: 16px; - font-weight: 500; -`,G1=k.div` - padding: 6px 16px; - border-radius: 20px; - font-size: 13px; - font-weight: 600; - background-color: ${({$online:n,theme:i})=>n?i.colors.status.online:i.colors.status.offline}; - color: white; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - letter-spacing: 0.3px; -`,K1=k.div` - display: flex; - gap: 12px; - margin-top: 24px; -`,X1=k.button` - width: 100%; - padding: 12px; - border: none; - border-radius: 8px; - background: ${({$secondary:n,theme:i})=>n?"transparent":i.colors.brand.primary}; - color: ${({$secondary:n,theme:i})=>n?i.colors.text.primary:"white"}; - cursor: pointer; - font-weight: 600; - font-size: 15px; - transition: all 0.2s ease; - border: ${({$secondary:n,theme:i})=>n?`1.5px solid ${i.colors.border.primary}`:"none"}; - - &:hover { - background: ${({$secondary:n,theme:i})=>n?i.colors.background.hover:i.colors.brand.hover}; - transform: translateY(-1px); - } - - &:active { - transform: translateY(0); - } -`,J1=async()=>(await Ye.get("/notifications")).data,Z1=async n=>{await Ye.delete(`/notifications/${n}`)},vh=Qn(n=>({notifications:[],fetchNotifications:async()=>{const i=await J1();n({notifications:i})},readNotification:async i=>{await Z1(i),n(s=>({notifications:s.notifications.filter(l=>l.id!==i)}))}})),ew=k.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.5); - opacity: ${({$isOpen:n})=>n?1:0}; - visibility: ${({$isOpen:n})=>n?"visible":"hidden"}; - transition: all 0.3s ease; - z-index: 1000; -`,tw=k.div` - position: fixed; - top: 0; - right: 0; - width: 360px; - height: 100vh; - background: ${({theme:n})=>n.colors.background.primary}; - box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1); - transform: translateX(${({$isOpen:n})=>n?"0":"100%"}); - transition: transform 0.3s ease; - z-index: 1001; - display: flex; - flex-direction: column; -`,nw=k.div` - padding: 0px 16px; - height: 48px; - font-size: 14px; - font-weight: bold; - color: ${V.colors.text.muted}; - text-transform: uppercase; - border-bottom: 1px solid ${({theme:n})=>n.colors.border.primary}; - display: flex; - justify-content: space-between; - align-items: center; -`,rw=k.h2` - margin: 0; - font-size: 18px; - font-weight: 600; - color: ${({theme:n})=>n.colors.text.primary}; - text-transform: none; -`,ow=k.button` - background: none; - border: none; - padding: 8px; - cursor: pointer; - color: ${({theme:n})=>n.colors.text.muted}; - border-radius: 50%; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.2s ease; - - &:hover { - background: ${({theme:n})=>n.colors.background.hover}; - color: ${({theme:n})=>n.colors.text.primary}; - } -`,iw=k.div` - flex: 1; - overflow-y: auto; - padding: 16px; - display: flex; - flex-direction: column; - gap: 12px; - width: 100%; - box-sizing: border-box; - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-track { - background: ${({theme:n})=>n.colors.background.primary}; - } - - &::-webkit-scrollbar-thumb { - background: ${({theme:n})=>n.colors.border.primary}; - border-radius: 3px; - } - - &::-webkit-scrollbar-thumb:hover { - background: ${({theme:n})=>n.colors.text.muted}; - } -`,sw=k.div` - position: relative; - flex: 1; -`,xh=k.button` - position: absolute; - top: 0; - right: 0; - background: none; - border: none; - padding: 4px; - cursor: pointer; - color: ${({theme:n})=>n.colors.text.muted}; - border-radius: 4px; - display: flex; - align-items: center; - justify-content: center; - transition: all 0.2s ease; - opacity: 0; - - &:hover { - background: ${({theme:n})=>n.colors.background.hover}; - color: ${({theme:n})=>n.colors.text.primary}; - } -`,lw=k.div` - background: ${({theme:n})=>n.colors.background.primary}; - border-radius: 8px; - padding: 16px; - cursor: pointer; - transition: all 0.2s ease; - border-left: 4px solid ${({theme:n})=>n.colors.brand.primary}; - width: 100%; - box-sizing: border-box; - position: relative; - - &:hover { - transform: translateY(-2px); - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); - - ${xh} { - opacity: 1; - } - } -`,aw=k.h4` - color: ${({theme:n})=>n.colors.text.primary}; - margin: 0 0 8px 0; - font-size: 15px; - font-weight: 600; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - max-width: 300px; - text-transform: none; -`,uw=k.p` - color: ${({theme:n})=>n.colors.text.secondary}; - margin: 0 0 8px 0; - font-size: 14px; - line-height: 1.4; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - max-width: 300px; - word-break: break-word; - text-transform: none; -`,cw=k.span` - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 12px; -`,dw=k.div` - text-align: center; - padding: 32px 16px; - color: ${({theme:n})=>n.colors.text.muted}; - font-size: 14px; -`,fw=k.div` - position: absolute; - top: -30px; - right: 0; - background: ${({theme:n})=>n.colors.background.secondary}; - color: ${({theme:n})=>n.colors.text.primary}; - padding: 4px 8px; - border-radius: 4px; - font-size: 12px; - opacity: ${({$show:n})=>n?1:0}; - transition: opacity 0.2s ease; - pointer-events: none; - white-space: nowrap; -`,pw=({isOpen:n,onClose:i})=>{const{notifications:s,readNotification:l}=vh(),{updateReadStatus:c}=Wn(),{setActiveChannel:d}=En(),[p,m]=te.useState(null),S=async v=>{await l(v.id),v.type===eu.NEW_MESSAGE&&(d(v.targetId),c(v.targetId))},w=async(v,R,T)=>{v.stopPropagation();try{await navigator.clipboard.writeText(R),m(T),setTimeout(()=>m(null),2e3)}catch(O){console.error("클립보드 복사 실패:",O)}};return h.jsxs(h.Fragment,{children:[h.jsx(ew,{$isOpen:n,onClick:i}),h.jsxs(tw,{$isOpen:n,children:[h.jsxs(nw,{children:[h.jsxs(rw,{children:["알림 ",s.length>0&&`(${s.length})`]}),h.jsx(ow,{onClick:i,children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),h.jsx(iw,{children:s.length===0?h.jsx(dw,{children:"새로운 알림이 없습니다"}):s.map(v=>h.jsx(lw,{onClick:()=>S(v),children:h.jsxs(sw,{children:[h.jsx(aw,{children:v.title}),h.jsx(uw,{children:v.content}),h.jsx(cw,{children:new Date(v.createdAt).toLocaleString()}),v.type===eu.ASYNC_FAILED&&h.jsxs(h.Fragment,{children:[h.jsx(xh,{onClick:R=>w(R,v.content,v.id),title:"내용 복사",children:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),h.jsx(fw,{$show:p===v.id,children:"복사되었습니다"})]})]})},v.id))})]})]})},hw=k.div` - position: relative; - cursor: pointer; - padding: 8px; - border-radius: 50%; - transition: background-color 0.2s ease; - - &:hover { - background-color: ${({theme:n})=>n.colors.background.hover}; - } -`,mw=k.div` - position: absolute; - top: 5px; - right: 5px; - background-color: ${({theme:n})=>n.colors.status.error}; - color: white; - font-size: 12px; - font-weight: 600; - min-width: 18px; - height: 18px; - border-radius: 9px; - display: flex; - align-items: center; - justify-content: center; - padding: 0 4px; - transform: translate(25%, -25%); - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,gw=()=>{const{notifications:n,fetchNotifications:i}=vh(),[s,l]=te.useState(!1);te.useEffect(()=>{i();const d=setInterval(i,1e4);return()=>clearInterval(d)},[i]);const c=n.length;return h.jsxs(h.Fragment,{children:[h.jsxs(hw,{onClick:()=>l(!0),children:[h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),h.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),c>0&&h.jsx(mw,{children:c>99?"99+":c})]}),h.jsx(pw,{isOpen:s,onClose:()=>l(!1)})]})};function yw(){const n=Tr(p=>p.users),i=Tr(p=>p.fetchUsers),{currentUser:s}=Ve(),[l,c]=te.useState(null);te.useEffect(()=>{i()},[i]);const d=[...n].sort((p,m)=>p.id===(s==null?void 0:s.id)?-1:m.id===(s==null?void 0:s.id)?1:p.online&&!m.online?-1:!p.online&&m.online?1:p.username.localeCompare(m.username));return h.jsxs(O1,{children:[h.jsx(L1,{children:h.jsxs(D1,{children:["멤버 목록 - ",n.length,h.jsx(gw,{})]})}),d.map(p=>h.jsx("div",{onClick:()=>c(p),children:h.jsx(b1,{member:p},p.id)},p.id)),l&&h.jsx(F1,{member:l,onClose:()=>c(null)})]})}function vw(){const{logout:n,fetchCsrfToken:i,fetchMe:s}=Ve(),{fetchUsers:l}=Tr(),{activeChannel:c,setActiveChannel:d}=En(),[p,m]=te.useState(null),[S,w]=te.useState(!1),[v,R]=te.useState(!0),{currentUser:T}=Ve();te.useEffect(()=>{i(),s()},[]),te.useEffect(()=>{(async()=>{try{if(T)try{await l()}catch(A){console.warn("사용자 상태 업데이트 실패. 로그아웃합니다.",A),n()}}catch(A){console.error("초기화 오류:",A)}finally{R(!1)}})()},[T,l,n]),te.useEffect(()=>{const E=_=>{m(_)},A=uh.on("api-error",E);return()=>{A("api-error",E)}},[n]),te.useEffect(()=>{if(T){const E=setInterval(()=>{l()},6e4);return()=>{clearInterval(E)}}},[T,l]);const O=()=>{w(!1),m(null)};return v?h.jsx(Pf,{theme:V,children:h.jsx(ww,{children:h.jsx(Sw,{})})}):h.jsxs(Pf,{theme:V,children:[T?h.jsxs(xw,{children:[h.jsx(Nx,{currentUser:T,activeChannel:c,onChannelSelect:d}),h.jsx(S1,{channel:c}),h.jsx(yw,{})]}):h.jsx(Nv,{isOpen:!0,onClose:()=>{}}),h.jsx(I1,{isOpen:S,onClose:O,error:p})]})}const xw=k.div` - display: flex; - height: 100vh; - width: 100vw; - position: relative; -`,ww=k.div` - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - width: 100vw; - background-color: ${({theme:n})=>n.colors.background.primary}; -`,Sw=k.div` - width: 40px; - height: 40px; - border: 4px solid ${({theme:n})=>n.colors.background.tertiary}; - border-top: 4px solid ${({theme:n})=>n.colors.brand.primary}; - border-radius: 50%; - animation: spin 1s linear infinite; - - @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } - } -`,wh=document.getElementById("root");if(!wh)throw new Error("Root element not found");Rg.createRoot(wh).render(h.jsx(te.StrictMode,{children:h.jsx(vw,{})})); diff --git a/src/main/resources/static/assets/index-CEsbCts1.js b/src/main/resources/static/assets/index-CEsbCts1.js new file mode 100644 index 000000000..859c0a365 --- /dev/null +++ b/src/main/resources/static/assets/index-CEsbCts1.js @@ -0,0 +1,1437 @@ +var m0=Object.defineProperty;var g0=(n,o,i)=>o in n?m0(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i;var Bp=(n,o,i)=>g0(n,typeof o!="symbol"?o+"":o,i);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var J=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ig(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var cu={exports:{}},ci={},du={exports:{}},Te={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var $p;function y0(){if($p)return Te;$p=1;var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.iterator;function S(j){return j===null||typeof j!="object"?null:(j=x&&j[x]||j["@@iterator"],typeof j=="function"?j:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,T={};function D(j,z,ve){this.props=j,this.context=z,this.refs=T,this.updater=ve||N}D.prototype.isReactComponent={},D.prototype.setState=function(j,z){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,z,"setState")},D.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function q(){}q.prototype=D.prototype;function R(j,z,ve){this.props=j,this.context=z,this.refs=T,this.updater=ve||N}var M=R.prototype=new q;M.constructor=R,P(M,D.prototype),M.isPureReactComponent=!0;var k=Array.isArray,E=Object.prototype.hasOwnProperty,A={current:null},b={key:!0,ref:!0,__self:!0,__source:!0};function I(j,z,ve){var xe,_e={},Ce=null,Oe=null;if(z!=null)for(xe in z.ref!==void 0&&(Oe=z.ref),z.key!==void 0&&(Ce=""+z.key),z)E.call(z,xe)&&!b.hasOwnProperty(xe)&&(_e[xe]=z[xe]);var be=arguments.length-2;if(be===1)_e.children=ve;else if(1>>1,z=Y[j];if(0>>1;jl(_e,ne))Cel(Oe,_e)?(Y[j]=Oe,Y[Ce]=ne,j=Ce):(Y[j]=_e,Y[xe]=ne,j=xe);else if(Cel(Oe,ne))Y[j]=Oe,Y[Ce]=ne,j=Ce;else break e}}return ie}function l(Y,ie){var ne=Y.sortIndex-ie.sortIndex;return ne!==0?ne:Y.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],g=[],v=1,x=null,S=3,N=!1,P=!1,T=!1,D=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(Y){for(var ie=i(g);ie!==null;){if(ie.callback===null)s(g);else if(ie.startTime<=Y)s(g),ie.sortIndex=ie.expirationTime,o(m,ie);else break;ie=i(g)}}function k(Y){if(T=!1,M(Y),!P)if(i(m)!==null)P=!0,Ue(E);else{var ie=i(g);ie!==null&&Re(k,ie.startTime-Y)}}function E(Y,ie){P=!1,T&&(T=!1,q(I),I=-1),N=!0;var ne=S;try{for(M(ie),x=i(m);x!==null&&(!(x.expirationTime>ie)||Y&&!he());){var j=x.callback;if(typeof j=="function"){x.callback=null,S=x.priorityLevel;var z=j(x.expirationTime<=ie);ie=n.unstable_now(),typeof z=="function"?x.callback=z:x===i(m)&&s(m),M(ie)}else s(m);x=i(m)}if(x!==null)var ve=!0;else{var xe=i(g);xe!==null&&Re(k,xe.startTime-ie),ve=!1}return ve}finally{x=null,S=ne,N=!1}}var A=!1,b=null,I=-1,H=5,K=-1;function he(){return!(n.unstable_now()-KY||125j?(Y.sortIndex=ne,o(g,Y),i(m)===null&&Y===i(g)&&(T?(q(I),I=-1):T=!0,Re(k,ne-j))):(Y.sortIndex=z,o(m,Y),P||N||(P=!0,Ue(E))),Y},n.unstable_shouldYield=he,n.unstable_wrapCallback=function(Y){var ie=S;return function(){var ne=S;S=ie;try{return Y.apply(this,arguments)}finally{S=ne}}}}(hu)),hu}var qp;function S0(){return qp||(qp=1,pu.exports=w0()),pu.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wp;function E0(){if(Wp)return Ut;Wp=1;var n=Vc(),o=S0();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},x={};function S(e){return m.call(x,e)?!0:m.call(v,e)?!1:g.test(e)?x[e]=!0:(v[e]=!0,!1)}function N(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function P(e,t,r,a){if(t===null||typeof t>"u"||N(e,t,r,a))return!0;if(a)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function T(e,t,r,a,u,d,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=u,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=h}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){D[e]=new T(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];D[t]=new T(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){D[e]=new T(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){D[e]=new T(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){D[e]=new T(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){D[e]=new T(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){D[e]=new T(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){D[e]=new T(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){D[e]=new T(e,5,!1,e.toLowerCase(),null,!1,!1)});var q=/[\-:]([a-z])/g;function R(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(q,R);D[t]=new T(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(q,R);D[t]=new T(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(q,R);D[t]=new T(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){D[e]=new T(e,1,!1,e.toLowerCase(),null,!1,!1)}),D.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){D[e]=new T(e,1,!1,e.toLowerCase(),null,!0,!0)});function M(e,t,r,a){var u=D.hasOwnProperty(t)?D[t]:null;(u!==null?u.type!==0:a||!(2w||u[h]!==d[w]){var C=` +`+u[h].replace(" at new "," at ");return e.displayName&&C.includes("")&&(C=C.replace("",e.displayName)),C}while(1<=h&&0<=w);break}}}finally{ve=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?z(e):""}function _e(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=xe(e.type,!1),e;case 11:return e=xe(e.type.render,!1),e;case 1:return e=xe(e.type,!0),e;default:return""}}function Ce(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case A:return"Portal";case H:return"Profiler";case I:return"StrictMode";case X:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case he:return(e.displayName||"Context")+".Consumer";case K:return(e._context.displayName||"Context")+".Provider";case Ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ie:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case Ue:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}function Oe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(t);case 8:return t===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function be(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xe(e){var t=je(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(h){a=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(h){a=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tt(e){e._valueTracker||(e._valueTracker=Xe(e))}function Ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=je(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function Ur(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function To(e,t){var r=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ao(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=be(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function U(e,t){t=t.checked,t!=null&&M(e,"checked",t,!1)}function ee(e,t){U(e,t);var r=be(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Z(e,t.type,r):t.hasOwnProperty("defaultValue")&&Z(e,t.type,be(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function le(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Z(e,t,r){(t!=="number"||Ur(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var me=Array.isArray;function de(e,t,r,a){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=ze.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ut={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vt=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(e){vt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ut[t]=ut[e]})});function Lt(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ut.hasOwnProperty(e)&&ut[e]?(""+t).trim():t+"px"}function jn(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,u=Lt(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,u):e[r]=u}}var zr=ne({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qt(e,t){if(t){if(zr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function zn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ct=null;function gr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dn=null,Hn=null,qn=null;function jo(e){if(e=Qo(e)){if(typeof dn!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Zi(t),dn(e.stateNode,e.type,t))}}function Hr(e){Hn?qn?qn.push(e):qn=[e]:Hn=e}function Wn(){if(Hn){var e=Hn,t=qn;if(qn=Hn=null,jo(e),t)for(e=0;e>>=0,e===0?32:31-(Ny(e)/Iy|0)|0}var Li=64,Di=4194304;function Oo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Mi(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,u=e.suspendedLanes,d=e.pingedLanes,h=r&268435455;if(h!==0){var w=h&~u;w!==0?a=Oo(w):(d&=h,d!==0&&(a=Oo(d)))}else h=r&~u,h!==0?a=Oo(h):d!==0&&(a=Oo(d));if(a===0)return 0;if(t!==0&&t!==a&&!(t&u)&&(u=a&-a,d=t&-t,u>=d||u===16&&(d&4194240)!==0))return t;if(a&4&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0r;r++)t.push(e);return t}function No(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=r}function My(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=Fo),jd=" ",Od=!1;function Nd(e,t){switch(e){case"keyup":return dv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Id(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vr=!1;function pv(e,t){switch(e){case"compositionend":return Id(t);case"keypress":return t.which!==32?null:(Od=!0,jd);case"textInput":return e=t.data,e===jd&&Od?null:e;default:return null}}function hv(e,t){if(Vr)return e==="compositionend"||!qa&&Nd(e,t)?(e=kd(),zi=Ba=Yn=null,Vr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Fd(r)}}function zd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hd(){for(var e=window,t=Ur();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ur(e.document)}return t}function Ga(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cv(e){var t=Hd(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&zd(r.ownerDocument.documentElement,r)){if(a!==null&&Ga(r)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=r.textContent.length,d=Math.min(a.start,u);a=a.end===void 0?d:Math.min(a.end,u),!e.extend&&d>a&&(u=a,a=d,d=u),u=Ud(r,d);var h=Ud(r,a);u&&h&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),d>a?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Gr=null,Xa=null,qo=null,Qa=!1;function qd(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Qa||Gr==null||Gr!==Ur(a)||(a=Gr,"selectionStart"in a&&Ga(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),qo&&Ho(qo,a)||(qo=a,a=Yi(Xa,"onSelect"),0Jr||(e.current=al[Jr],al[Jr]=null,Jr--)}function qe(e,t){Jr++,al[Jr]=e.current,e.current=t}var er={},kt=Zn(er),Dt=Zn(!1),xr=er;function Zr(e,t){var r=e.type.contextTypes;if(!r)return er;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var u={},d;for(d in r)u[d]=t[d];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Mt(e){return e=e.childContextTypes,e!=null}function es(){Ve(Dt),Ve(kt)}function sf(e,t,r){if(kt.current!==er)throw Error(i(168));qe(kt,t),qe(Dt,r)}function af(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var u in a)if(!(u in t))throw Error(i(108,Oe(e)||"Unknown",u));return ne({},r,a)}function ts(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||er,xr=kt.current,qe(kt,e),qe(Dt,Dt.current),!0}function lf(e,t,r){var a=e.stateNode;if(!a)throw Error(i(169));r?(e=af(e,t,xr),a.__reactInternalMemoizedMergedChildContext=e,Ve(Dt),Ve(kt),qe(kt,e)):Ve(Dt),qe(Dt,r)}var Nn=null,ns=!1,ll=!1;function uf(e){Nn===null?Nn=[e]:Nn.push(e)}function Lv(e){ns=!0,uf(e)}function tr(){if(!ll&&Nn!==null){ll=!0;var e=0,t=$e;try{var r=Nn;for($e=1;e>=h,u-=h,In=1<<32-pn(t)+u|r<ye?(gt=pe,pe=null):gt=pe.sibling;var Le=W(L,pe,B[ye],Q);if(Le===null){pe===null&&(pe=gt);break}e&&pe&&Le.alternate===null&&t(L,pe),_=d(Le,_,ye),fe===null?ce=Le:fe.sibling=Le,fe=Le,pe=gt}if(ye===B.length)return r(L,pe),Qe&&Sr(L,ye),ce;if(pe===null){for(;yeye?(gt=pe,pe=null):gt=pe.sibling;var cr=W(L,pe,Le.value,Q);if(cr===null){pe===null&&(pe=gt);break}e&&pe&&cr.alternate===null&&t(L,pe),_=d(cr,_,ye),fe===null?ce=cr:fe.sibling=cr,fe=cr,pe=gt}if(Le.done)return r(L,pe),Qe&&Sr(L,ye),ce;if(pe===null){for(;!Le.done;ye++,Le=B.next())Le=G(L,Le.value,Q),Le!==null&&(_=d(Le,_,ye),fe===null?ce=Le:fe.sibling=Le,fe=Le);return Qe&&Sr(L,ye),ce}for(pe=a(L,pe);!Le.done;ye++,Le=B.next())Le=re(pe,L,ye,Le.value,Q),Le!==null&&(e&&Le.alternate!==null&&pe.delete(Le.key===null?ye:Le.key),_=d(Le,_,ye),fe===null?ce=Le:fe.sibling=Le,fe=Le);return e&&pe.forEach(function(h0){return t(L,h0)}),Qe&&Sr(L,ye),ce}function st(L,_,B,Q){if(typeof B=="object"&&B!==null&&B.type===b&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case E:e:{for(var ce=B.key,fe=_;fe!==null;){if(fe.key===ce){if(ce=B.type,ce===b){if(fe.tag===7){r(L,fe.sibling),_=u(fe,B.props.children),_.return=L,L=_;break e}}else if(fe.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===Ue&&mf(ce)===fe.type){r(L,fe.sibling),_=u(fe,B.props),_.ref=Yo(L,fe,B),_.return=L,L=_;break e}r(L,fe);break}else t(L,fe);fe=fe.sibling}B.type===b?(_=Ar(B.props.children,L.mode,Q,B.key),_.return=L,L=_):(Q=js(B.type,B.key,B.props,null,L.mode,Q),Q.ref=Yo(L,_,B),Q.return=L,L=Q)}return h(L);case A:e:{for(fe=B.key;_!==null;){if(_.key===fe)if(_.tag===4&&_.stateNode.containerInfo===B.containerInfo&&_.stateNode.implementation===B.implementation){r(L,_.sibling),_=u(_,B.children||[]),_.return=L,L=_;break e}else{r(L,_);break}else t(L,_);_=_.sibling}_=iu(B,L.mode,Q),_.return=L,L=_}return h(L);case Ue:return fe=B._init,st(L,_,fe(B._payload),Q)}if(me(B))return se(L,_,B,Q);if(ie(B))return ue(L,_,B,Q);ss(L,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,_!==null&&_.tag===6?(r(L,_.sibling),_=u(_,B),_.return=L,L=_):(r(L,_),_=ou(B,L.mode,Q),_.return=L,L=_),h(L)):r(L,_)}return st}var ro=gf(!0),yf=gf(!1),as=Zn(null),ls=null,oo=null,hl=null;function ml(){hl=oo=ls=null}function gl(e){var t=as.current;Ve(as),e._currentValue=t}function yl(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function io(e,t){ls=e,hl=oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bt=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if(hl!==e)if(e={context:e,memoizedValue:t,next:null},oo===null){if(ls===null)throw Error(i(308));oo=e,ls.dependencies={lanes:0,firstContext:e}}else oo=oo.next=e;return t}var Er=null;function vl(e){Er===null?Er=[e]:Er.push(e)}function vf(e,t,r,a){var u=t.interleaved;return u===null?(r.next=r,vl(t)):(r.next=u.next,u.next=r),t.interleaved=r,Ln(e,a)}function Ln(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var nr=!1;function xl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Ne&2){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,Ln(e,r)}return u=a.interleaved,u===null?(t.next=t,vl(a)):(t.next=u.next,u.next=t),a.interleaved=t,Ln(e,r)}function us(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Ia(e,r)}}function wf(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var u=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var h={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};d===null?u=d=h:d=d.next=h,r=r.next}while(r!==null);d===null?u=d=t:d=d.next=t}else u=d=t;r={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function cs(e,t,r,a){var u=e.updateQueue;nr=!1;var d=u.firstBaseUpdate,h=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var C=w,$=C.next;C.next=null,h===null?d=$:h.next=$,h=C;var V=e.alternate;V!==null&&(V=V.updateQueue,w=V.lastBaseUpdate,w!==h&&(w===null?V.firstBaseUpdate=$:w.next=$,V.lastBaseUpdate=C))}if(d!==null){var G=u.baseState;h=0,V=$=C=null,w=d;do{var W=w.lane,re=w.eventTime;if((a&W)===W){V!==null&&(V=V.next={eventTime:re,lane:0,tag:w.tag,payload:w.payload,callback:w.callback,next:null});e:{var se=e,ue=w;switch(W=t,re=r,ue.tag){case 1:if(se=ue.payload,typeof se=="function"){G=se.call(re,G,W);break e}G=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=ue.payload,W=typeof se=="function"?se.call(re,G,W):se,W==null)break e;G=ne({},G,W);break e;case 2:nr=!0}}w.callback!==null&&w.lane!==0&&(e.flags|=64,W=u.effects,W===null?u.effects=[w]:W.push(w))}else re={eventTime:re,lane:W,tag:w.tag,payload:w.payload,callback:w.callback,next:null},V===null?($=V=re,C=G):V=V.next=re,h|=W;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;W=w,w=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(!0);if(V===null&&(C=G),u.baseState=C,u.firstBaseUpdate=$,u.lastBaseUpdate=V,t=u.shared.interleaved,t!==null){u=t;do h|=u.lane,u=u.next;while(u!==t)}else d===null&&(u.shared.lanes=0);_r|=h,e.lanes=h,e.memoizedState=G}}function Sf(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var a=kl.transition;kl.transition={};try{e(!1),t()}finally{$e=r,kl.transition=a}}function Ff(){return on().memoizedState}function $v(e,t,r){var a=ar(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},Uf(e))zf(t,r);else if(r=vf(e,t,r,a),r!==null){var u=Nt();xn(r,e,a,u),Hf(r,t,a)}}function Fv(e,t,r){var a=ar(e),u={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(Uf(e))zf(t,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,w=d(h,r);if(u.hasEagerState=!0,u.eagerState=w,hn(w,h)){var C=t.interleaved;C===null?(u.next=u,vl(t)):(u.next=C.next,C.next=u),t.interleaved=u;return}}catch{}finally{}r=vf(e,t,u,a),r!==null&&(u=Nt(),xn(r,e,a,u),Hf(r,t,a))}}function Uf(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function zf(e,t){ei=ps=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Hf(e,t,r){if(r&4194240){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,Ia(e,r)}}var gs={readContext:rn,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useInsertionEffect:_t,useLayoutEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useMutableSource:_t,useSyncExternalStore:_t,useId:_t,unstable_isNewReconciler:!1},Uv={readContext:rn,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:Nf,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,hs(4194308,4,Lf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return hs(4194308,4,e,t)},useInsertionEffect:function(e,t){return hs(4,2,e,t)},useMemo:function(e,t){var r=bn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=bn();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=$v.bind(null,Ke,e),[a.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:jf,useDebugValue:Ol,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=jf(!1),t=e[0];return e=Bv.bind(null,e[1]),bn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Ke,u=bn();if(Qe){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),mt===null)throw Error(i(349));kr&30||_f(a,t,r)}u.memoizedState=r;var d={value:r,getSnapshot:t};return u.queue=d,Nf(Rf.bind(null,a,d,e),[e]),a.flags|=2048,ri(9,bf.bind(null,a,d,r,t),void 0,null),r},useId:function(){var e=bn(),t=mt.identifierPrefix;if(Qe){var r=Pn,a=In;r=(a&~(1<<32-pn(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=ti++,0<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=h.createElement(r,{is:a.is}):(e=h.createElement(r),r==="select"&&(h=e,a.multiple?h.multiple=!0:a.size&&(h.size=a.size))):e=h.createElementNS(e,r),e[kn]=t,e[Xo]=a,up(e,t,!1,!1),t.stateNode=e;e:{switch(h=zn(r,a),r){case"dialog":We("cancel",e),We("close",e),u=a;break;case"iframe":case"object":case"embed":We("load",e),u=a;break;case"video":case"audio":for(u=0;uco&&(t.flags|=128,a=!0,oi(d,!1),t.lanes=4194304)}else{if(!a)if(e=ds(h),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),oi(d,!0),d.tail===null&&d.tailMode==="hidden"&&!h.alternate&&!Qe)return bt(t),null}else 2*it()-d.renderingStartTime>co&&r!==1073741824&&(t.flags|=128,a=!0,oi(d,!1),t.lanes=4194304);d.isBackwards?(h.sibling=t.child,t.child=h):(r=d.last,r!==null?r.sibling=h:t.child=h,d.last=h)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=it(),t.sibling=null,r=Ye.current,qe(Ye,a?r&1|2:r&1),t):(bt(t),null);case 22:case 23:return tu(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&t.mode&1?Xt&1073741824&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Qv(e,t){switch(cl(t),t.tag){case 1:return Mt(t.type)&&es(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),Ve(Dt),Ve(kt),Cl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sl(t),null;case 13:if(Ve(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ye),null;case 4:return so(),null;case 10:return gl(t.type._context),null;case 22:case 23:return tu(),null;case 24:return null;default:return null}}var ws=!1,Rt=!1,Yv=typeof WeakSet=="function"?WeakSet:Set,oe=null;function lo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){Ze(e,t,a)}else r.current=null}function Hl(e,t,r){try{r()}catch(a){Ze(e,t,a)}}var fp=!1;function Kv(e,t){if(tl=Fi,e=Hd(),Ga(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var u=a.anchorOffset,d=a.focusNode;a=a.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var h=0,w=-1,C=-1,$=0,V=0,G=e,W=null;t:for(;;){for(var re;G!==r||u!==0&&G.nodeType!==3||(w=h+u),G!==d||a!==0&&G.nodeType!==3||(C=h+a),G.nodeType===3&&(h+=G.nodeValue.length),(re=G.firstChild)!==null;)W=G,G=re;for(;;){if(G===e)break t;if(W===r&&++$===u&&(w=h),W===d&&++V===a&&(C=h),(re=G.nextSibling)!==null)break;G=W,W=G.parentNode}G=re}r=w===-1||C===-1?null:{start:w,end:C}}else r=null}r=r||{start:0,end:0}}else r=null;for(nl={focusedElem:e,selectionRange:r},Fi=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;try{var se=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(se!==null){var ue=se.memoizedProps,st=se.memoizedState,L=t.stateNode,_=L.getSnapshotBeforeUpdate(t.elementType===t.type?ue:gn(t.type,ue),st);L.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var B=t.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Q){Ze(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,oe=e;break}oe=t.return}return se=fp,fp=!1,se}function ii(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&e)===e){var d=u.destroy;u.destroy=void 0,d!==void 0&&Hl(t,r,d)}u=u.next}while(u!==a)}}function Ss(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function ql(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function pp(e){var t=e.alternate;t!==null&&(e.alternate=null,pp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kn],delete t[Xo],delete t[sl],delete t[Iv],delete t[Pv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hp(e){return e.tag===5||e.tag===3||e.tag===4}function mp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wl(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ji));else if(a!==4&&(e=e.child,e!==null))for(Wl(e,t,r),e=e.sibling;e!==null;)Wl(e,t,r),e=e.sibling}function Vl(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Vl(e,t,r),e=e.sibling;e!==null;)Vl(e,t,r),e=e.sibling}var wt=null,yn=!1;function or(e,t,r){for(r=r.child;r!==null;)gp(e,t,r),r=r.sibling}function gp(e,t,r){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Pi,r)}catch{}switch(r.tag){case 5:Rt||lo(r,t);case 6:var a=wt,u=yn;wt=null,or(e,t,r),wt=a,yn=u,wt!==null&&(yn?(e=wt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):wt.removeChild(r.stateNode));break;case 18:wt!==null&&(yn?(e=wt,r=r.stateNode,e.nodeType===8?il(e.parentNode,r):e.nodeType===1&&il(e,r),Mo(e)):il(wt,r.stateNode));break;case 4:a=wt,u=yn,wt=r.stateNode.containerInfo,yn=!0,or(e,t,r),wt=a,yn=u;break;case 0:case 11:case 14:case 15:if(!Rt&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){u=a=a.next;do{var d=u,h=d.destroy;d=d.tag,h!==void 0&&(d&2||d&4)&&Hl(r,t,h),u=u.next}while(u!==a)}or(e,t,r);break;case 1:if(!Rt&&(lo(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(w){Ze(r,t,w)}or(e,t,r);break;case 21:or(e,t,r);break;case 22:r.mode&1?(Rt=(a=Rt)||r.memoizedState!==null,or(e,t,r),Rt=a):or(e,t,r);break;default:or(e,t,r)}}function yp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Yv),t.forEach(function(a){var u=s0.bind(null,e,a);r.has(a)||(r.add(a),a.then(u,u))})}}function vn(e,t){var r=t.deletions;if(r!==null)for(var a=0;au&&(u=h),a&=~d}if(a=u,a=it()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*Zv(a/1960))-a,10e?16:e,sr===null)var a=!1;else{if(e=sr,sr=null,bs=0,Ne&6)throw Error(i(331));var u=Ne;for(Ne|=4,oe=e.current;oe!==null;){var d=oe,h=d.child;if(oe.flags&16){var w=d.deletions;if(w!==null){for(var C=0;Cit()-Ql?Rr(e,0):Xl|=r),Ft(e,t)}function jp(e,t){t===0&&(e.mode&1?(t=Di,Di<<=1,!(Di&130023424)&&(Di=4194304)):t=1);var r=Nt();e=Ln(e,t),e!==null&&(No(e,t,r),Ft(e,r))}function i0(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),jp(e,r)}function s0(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(t),jp(e,r)}var Op;Op=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)Bt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Bt=!1,Gv(e,t,r);Bt=!!(e.flags&131072)}else Bt=!1,Qe&&t.flags&1048576&&cf(t,os,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;xs(e,t),e=t.pendingProps;var u=Zr(t,kt.current);io(t,r),u=bl(null,t,a,e,u,r);var d=Rl();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Mt(a)?(d=!0,ts(t)):d=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,xl(t),u.updater=ys,t.stateNode=u,u._reactInternals=t,Il(t,a,e,r),t=Ml(null,t,a,!0,d,r)):(t.tag=0,Qe&&d&&ul(t),Ot(null,t,u,r),t=t.child),t;case 16:a=t.elementType;e:{switch(xs(e,t),e=t.pendingProps,u=a._init,a=u(a._payload),t.type=a,u=t.tag=l0(a),e=gn(a,e),u){case 0:t=Dl(null,t,a,e,r);break e;case 1:t=rp(null,t,a,e,r);break e;case 11:t=Jf(null,t,a,e,r);break e;case 14:t=Zf(null,t,a,gn(a.type,e),r);break e}throw Error(i(306,a,""))}return t;case 0:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:gn(a,u),Dl(e,t,a,u,r);case 1:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:gn(a,u),rp(e,t,a,u,r);case 3:e:{if(op(t),e===null)throw Error(i(387));a=t.pendingProps,d=t.memoizedState,u=d.element,xf(e,t),cs(t,a,null,r);var h=t.memoizedState;if(a=h.element,d.isDehydrated)if(d={element:a,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){u=ao(Error(i(423)),t),t=ip(e,t,a,r,u);break e}else if(a!==u){u=ao(Error(i(424)),t),t=ip(e,t,a,r,u);break e}else for(Gt=Jn(t.stateNode.containerInfo.firstChild),Vt=t,Qe=!0,mn=null,r=yf(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(no(),a===u){t=Mn(e,t,r);break e}Ot(e,t,a,r)}t=t.child}return t;case 5:return Ef(t),e===null&&fl(t),a=t.type,u=t.pendingProps,d=e!==null?e.memoizedProps:null,h=u.children,rl(a,u)?h=null:d!==null&&rl(a,d)&&(t.flags|=32),np(e,t),Ot(e,t,h,r),t.child;case 6:return e===null&&fl(t),null;case 13:return sp(e,t,r);case 4:return wl(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ro(t,null,a,r):Ot(e,t,a,r),t.child;case 11:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:gn(a,u),Jf(e,t,a,u,r);case 7:return Ot(e,t,t.pendingProps,r),t.child;case 8:return Ot(e,t,t.pendingProps.children,r),t.child;case 12:return Ot(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,u=t.pendingProps,d=t.memoizedProps,h=u.value,qe(as,a._currentValue),a._currentValue=h,d!==null)if(hn(d.value,h)){if(d.children===u.children&&!Dt.current){t=Mn(e,t,r);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var w=d.dependencies;if(w!==null){h=d.child;for(var C=w.firstContext;C!==null;){if(C.context===a){if(d.tag===1){C=Dn(-1,r&-r),C.tag=2;var $=d.updateQueue;if($!==null){$=$.shared;var V=$.pending;V===null?C.next=C:(C.next=V.next,V.next=C),$.pending=C}}d.lanes|=r,C=d.alternate,C!==null&&(C.lanes|=r),yl(d.return,r,t),w.lanes|=r;break}C=C.next}}else if(d.tag===10)h=d.type===t.type?null:d.child;else if(d.tag===18){if(h=d.return,h===null)throw Error(i(341));h.lanes|=r,w=h.alternate,w!==null&&(w.lanes|=r),yl(h,r,t),h=d.sibling}else h=d.child;if(h!==null)h.return=d;else for(h=d;h!==null;){if(h===t){h=null;break}if(d=h.sibling,d!==null){d.return=h.return,h=d;break}h=h.return}d=h}Ot(e,t,u.children,r),t=t.child}return t;case 9:return u=t.type,a=t.pendingProps.children,io(t,r),u=rn(u),a=a(u),t.flags|=1,Ot(e,t,a,r),t.child;case 14:return a=t.type,u=gn(a,t.pendingProps),u=gn(a.type,u),Zf(e,t,a,u,r);case 15:return ep(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,u=t.pendingProps,u=t.elementType===a?u:gn(a,u),xs(e,t),t.tag=1,Mt(a)?(e=!0,ts(t)):e=!1,io(t,r),Wf(t,a,u),Il(t,a,u,r),Ml(null,t,a,!0,e,r);case 19:return lp(e,t,r);case 22:return tp(e,t,r)}throw Error(i(156,t.tag))};function Np(e,t){return cd(e,t)}function a0(e,t,r,a){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,t,r,a){return new a0(e,t,r,a)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function l0(e){if(typeof e=="function")return ru(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ee)return 11;if(e===Ie)return 14}return 2}function ur(e,t){var r=e.alternate;return r===null?(r=an(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function js(e,t,r,a,u,d){var h=2;if(a=e,typeof e=="function")ru(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case b:return Ar(r.children,u,d,t);case I:h=8,u|=8;break;case H:return e=an(12,r,t,u|2),e.elementType=H,e.lanes=d,e;case X:return e=an(13,r,t,u),e.elementType=X,e.lanes=d,e;case Fe:return e=an(19,r,t,u),e.elementType=Fe,e.lanes=d,e;case Re:return Os(r,u,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:h=10;break e;case he:h=9;break e;case Ee:h=11;break e;case Ie:h=14;break e;case Ue:h=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=an(h,r,t,u),t.elementType=e,t.type=a,t.lanes=d,t}function Ar(e,t,r,a){return e=an(7,e,a,t),e.lanes=r,e}function Os(e,t,r,a){return e=an(22,e,a,t),e.elementType=Re,e.lanes=r,e.stateNode={isHidden:!1},e}function ou(e,t,r){return e=an(6,e,null,t),e.lanes=r,e}function iu(e,t,r){return t=an(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function u0(e,t,r,a,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Na(0),this.expirationTimes=Na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Na(0),this.identifierPrefix=a,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function su(e,t,r,a,u,d,h,w,C){return e=new u0(e,t,r,w,C),t===1?(t=1,d===!0&&(t|=8)):t=0,d=an(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},xl(d),e}function c0(e,t,r){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),fu.exports=E0(),fu.exports}var Gp;function k0(){if(Gp)return Bs;Gp=1;var n=C0();return Bs.createRoot=n.createRoot,Bs.hydrateRoot=n.hydrateRoot,Bs}var _0=k0(),At=function(){return At=Object.assign||function(o){for(var i,s=1,l=arguments.length;s0?yt(Eo,--ln):0,vo--,lt===10&&(vo=1,ma--),lt}function Sn(){return lt=ln2||Ac(lt)>3?"":" "}function L0(n,o){for(;--o&&Sn()&&!(lt<48||lt>102||lt>57&<<65||lt>70&<<97););return ya(n,Zs()+(o<6&&Nr()==32&&Sn()==32))}function jc(n){for(;Sn();)switch(lt){case n:return ln;case 34:case 39:n!==34&&n!==39&&jc(lt);break;case 40:n===41&&jc(n);break;case 92:Sn();break}return ln}function D0(n,o){for(;Sn()&&n+lt!==57;)if(n+lt===84&&Nr()===47)break;return"/*"+ya(o,ln-1)+"*"+Xc(n===47?n:Sn())}function M0(n){for(;!Ac(Nr());)Sn();return ya(n,ln)}function B0(n){return I0(ea("",null,null,null,[""],n=N0(n),0,[0],n))}function ea(n,o,i,s,l,c,f,p,m){for(var g=0,v=0,x=f,S=0,N=0,P=0,T=1,D=1,q=1,R=0,M="",k=l,E=c,A=s,b=M;D;)switch(P=R,R=Sn()){case 40:if(P!=108&&yt(b,x-1)==58){Js(b+=ke(mu(R),"&","&\f"),"&\f",lg(g?p[g-1]:0))!=-1&&(q=-1);break}case 34:case 39:case 91:b+=mu(R);break;case 9:case 10:case 13:case 32:b+=P0(P);break;case 92:b+=L0(Zs()-1,7);continue;case 47:switch(Nr()){case 42:case 47:mi($0(D0(Sn(),Zs()),o,i,m),m);break;default:b+="/"}break;case 123*T:p[g++]=An(b)*q;case 125*T:case 59:case 0:switch(R){case 0:case 125:D=0;case 59+v:q==-1&&(b=ke(b,/\f/g,"")),N>0&&An(b)-x&&mi(N>32?Yp(b+";",s,i,x-1,m):Yp(ke(b," ","")+";",s,i,x-2,m),m);break;case 59:b+=";";default:if(mi(A=Qp(b,o,i,g,v,l,p,M,k=[],E=[],x,c),c),R===123)if(v===0)ea(b,o,A,A,k,c,x,p,E);else switch(S===99&&yt(b,3)===110?100:S){case 100:case 108:case 109:case 115:ea(n,A,A,s&&mi(Qp(n,A,A,0,0,l,p,M,l,k=[],x,E),E),l,E,x,p,s?k:E);break;default:ea(b,A,A,A,[""],E,0,p,E)}}g=v=N=0,T=q=1,M=b="",x=f;break;case 58:x=1+An(b),N=P;default:if(T<1){if(R==123)--T;else if(R==125&&T++==0&&O0()==125)continue}switch(b+=Xc(R),R*T){case 38:q=v>0?1:(b+="\f",-1);break;case 44:p[g++]=(An(b)-1)*q,q=1;break;case 64:Nr()===45&&(b+=mu(Sn())),S=Nr(),v=x=An(M=b+=M0(Zs())),R++;break;case 45:P===45&&An(b)==2&&(T=0)}}return c}function Qp(n,o,i,s,l,c,f,p,m,g,v,x){for(var S=l-1,N=l===0?c:[""],P=cg(N),T=0,D=0,q=0;T0?N[R]+" "+M:ke(M,/&\f/g,N[R])))&&(m[q++]=k);return ga(n,o,i,l===0?ha:p,m,g,v,x)}function $0(n,o,i,s){return ga(n,o,i,sg,Xc(j0()),yo(n,2,-2),0,s)}function Yp(n,o,i,s,l){return ga(n,o,i,Gc,yo(n,0,s),yo(n,s+1,-1),s,l)}function fg(n,o,i){switch(T0(n,o)){case 5103:return Me+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Me+n+n;case 4789:return vi+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return Me+n+vi+n+Ge+n+n;case 5936:switch(yt(n,o+11)){case 114:return Me+n+Ge+ke(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Me+n+Ge+ke(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Me+n+Ge+ke(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return Me+n+Ge+n+n;case 6165:return Me+n+Ge+"flex-"+n+n;case 5187:return Me+n+ke(n,/(\w+).+(:[^]+)/,Me+"box-$1$2"+Ge+"flex-$1$2")+n;case 5443:return Me+n+Ge+"flex-item-"+ke(n,/flex-|-self/g,"")+($n(n,/flex-|baseline/)?"":Ge+"grid-row-"+ke(n,/flex-|-self/g,""))+n;case 4675:return Me+n+Ge+"flex-line-pack"+ke(n,/align-content|flex-|-self/g,"")+n;case 5548:return Me+n+Ge+ke(n,"shrink","negative")+n;case 5292:return Me+n+Ge+ke(n,"basis","preferred-size")+n;case 6060:return Me+"box-"+ke(n,"-grow","")+Me+n+Ge+ke(n,"grow","positive")+n;case 4554:return Me+ke(n,/([^-])(transform)/g,"$1"+Me+"$2")+n;case 6187:return ke(ke(ke(n,/(zoom-|grab)/,Me+"$1"),/(image-set)/,Me+"$1"),n,"")+n;case 5495:case 3959:return ke(n,/(image-set\([^]*)/,Me+"$1$`$1");case 4968:return ke(ke(n,/(.+:)(flex-)?(.*)/,Me+"box-pack:$3"+Ge+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Me+n+n;case 4200:if(!$n(n,/flex-|baseline/))return Ge+"grid-column-align"+yo(n,o)+n;break;case 2592:case 3360:return Ge+ke(n,"template-","")+n;case 4384:case 3616:return i&&i.some(function(s,l){return o=l,$n(s.props,/grid-\w+-end/)})?~Js(n+(i=i[o].value),"span",0)?n:Ge+ke(n,"-start","")+n+Ge+"grid-row-span:"+(~Js(i,"span",0)?$n(i,/\d+/):+$n(i,/\d+/)-+$n(n,/\d+/))+";":Ge+ke(n,"-start","")+n;case 4896:case 4128:return i&&i.some(function(s){return $n(s.props,/grid-\w+-start/)})?n:Ge+ke(ke(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return ke(n,/(.+)-inline(.+)/,Me+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(An(n)-1-o>6)switch(yt(n,o+1)){case 109:if(yt(n,o+4)!==45)break;case 102:return ke(n,/(.+:)(.+)-([^]+)/,"$1"+Me+"$2-$3$1"+vi+(yt(n,o+3)==108?"$3":"$2-$3"))+n;case 115:return~Js(n,"stretch",0)?fg(ke(n,"stretch","fill-available"),o,i)+n:n}break;case 5152:case 5920:return ke(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(s,l,c,f,p,m,g){return Ge+l+":"+c+g+(f?Ge+l+"-span:"+(p?m:+m-+c)+g:"")+n});case 4949:if(yt(n,o+6)===121)return ke(n,":",":"+Me)+n;break;case 6444:switch(yt(n,yt(n,14)===45?18:11)){case 120:return ke(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Me+(yt(n,14)===45?"inline-":"")+"box$3$1"+Me+"$2$3$1"+Ge+"$2box$3")+n;case 100:return ke(n,":",":"+Ge)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return ke(n,"scroll-","scroll-snap-")+n}return n}function aa(n,o){for(var i="",s=0;s-1&&!n.return)switch(n.type){case Gc:n.return=fg(n.value,n.length,i);return;case ag:return aa([dr(n,{value:ke(n.value,"@","@"+Me)})],s);case ha:if(n.length)return A0(i=n.props,function(l){switch($n(l,s=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":po(dr(n,{props:[ke(l,/:(read-\w+)/,":"+vi+"$1")]})),po(dr(n,{props:[l]})),Tc(n,{props:Xp(i,s)});break;case"::placeholder":po(dr(n,{props:[ke(l,/:(plac\w+)/,":"+Me+"input-$1")]})),po(dr(n,{props:[ke(l,/:(plac\w+)/,":"+vi+"$1")]})),po(dr(n,{props:[ke(l,/:(plac\w+)/,Ge+"input-$1")]})),po(dr(n,{props:[l]})),Tc(n,{props:Xp(i,s)});break}return""})}}var q0={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Qt={},xo=typeof process<"u"&&Qt!==void 0&&(Qt.REACT_APP_SC_ATTR||Qt.SC_ATTR)||"data-styled",pg="active",hg="data-styled-version",va="6.1.14",Qc=`/*!sc*/ +`,la=typeof window<"u"&&"HTMLElement"in window,W0=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Qt!==void 0&&Qt.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Qt.REACT_APP_SC_DISABLE_SPEEDY!==""?Qt.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Qt.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Qt!==void 0&&Qt.SC_DISABLE_SPEEDY!==void 0&&Qt.SC_DISABLE_SPEEDY!==""&&Qt.SC_DISABLE_SPEEDY!=="false"&&Qt.SC_DISABLE_SPEEDY),xa=Object.freeze([]),wo=Object.freeze({});function V0(n,o,i){return i===void 0&&(i=wo),n.theme!==i.theme&&n.theme||o||i.theme}var mg=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),G0=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,X0=/(^-|-$)/g;function Kp(n){return n.replace(G0,"-").replace(X0,"")}var Q0=/(a)(d)/gi,$s=52,Jp=function(n){return String.fromCharCode(n+(n>25?39:97))};function Oc(n){var o,i="";for(o=Math.abs(n);o>$s;o=o/$s|0)i=Jp(o%$s)+i;return(Jp(o%$s)+i).replace(Q0,"$1-$2")}var gu,gg=5381,mo=function(n,o){for(var i=o.length;i;)n=33*n^o.charCodeAt(--i);return n},yg=function(n){return mo(gg,n)};function Y0(n){return Oc(yg(n)>>>0)}function K0(n){return n.displayName||n.name||"Component"}function yu(n){return typeof n=="string"&&!0}var vg=typeof Symbol=="function"&&Symbol.for,xg=vg?Symbol.for("react.memo"):60115,J0=vg?Symbol.for("react.forward_ref"):60112,Z0={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},ex={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wg={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tx=((gu={})[J0]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},gu[xg]=wg,gu);function Zp(n){return("type"in(o=n)&&o.type.$$typeof)===xg?wg:"$$typeof"in n?tx[n.$$typeof]:Z0;var o}var nx=Object.defineProperty,rx=Object.getOwnPropertyNames,eh=Object.getOwnPropertySymbols,ox=Object.getOwnPropertyDescriptor,ix=Object.getPrototypeOf,th=Object.prototype;function Sg(n,o,i){if(typeof o!="string"){if(th){var s=ix(o);s&&s!==th&&Sg(n,s,i)}var l=rx(o);eh&&(l=l.concat(eh(o)));for(var c=Zp(n),f=Zp(o),p=0;p0?" Args: ".concat(o.join(", ")):""))}var sx=function(){function n(o){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=o}return n.prototype.indexOfGroup=function(o){for(var i=0,s=0;s=this.groupSizes.length){for(var s=this.groupSizes,l=s.length,c=l;o>=c;)if((c<<=1)<0)throw Mr(16,"".concat(o));this.groupSizes=new Uint32Array(c),this.groupSizes.set(s),this.length=c;for(var f=l;f=this.length||this.groupSizes[o]===0)return i;for(var s=this.groupSizes[o],l=this.indexOfGroup(o),c=l+s,f=l;f=0){var s=document.createTextNode(i);return this.element.insertBefore(s,this.nodes[o]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(o){this.element.removeChild(this.nodes[o]),this.length--},n.prototype.getRule=function(o){return o0&&(D+="".concat(q,","))}),m+="".concat(P).concat(T,'{content:"').concat(D,'"}').concat(Qc)},v=0;v0?".".concat(o):S},v=m.slice();v.push(function(S){S.type===ha&&S.value.includes("&")&&(S.props[0]=S.props[0].replace(yx,i).replace(s,g))}),f.prefix&&v.push(H0),v.push(F0);var x=function(S,N,P,T){N===void 0&&(N=""),P===void 0&&(P=""),T===void 0&&(T="&"),o=T,i=N,s=new RegExp("\\".concat(i,"\\b"),"g");var D=S.replace(vx,""),q=B0(P||N?"".concat(P," ").concat(N," { ").concat(D," }"):D);f.namespace&&(q=kg(q,f.namespace));var R=[];return aa(q,U0(v.concat(z0(function(M){return R.push(M)})))),R};return x.hash=m.length?m.reduce(function(S,N){return N.name||Mr(15),mo(S,N.name)},gg).toString():"",x}var wx=new Cg,Ic=xx(),_g=Yt.createContext({shouldForwardProp:void 0,styleSheet:wx,stylis:Ic});_g.Consumer;Yt.createContext(void 0);function ih(){return ae.useContext(_g)}var Sx=function(){function n(o,i){var s=this;this.inject=function(l,c){c===void 0&&(c=Ic);var f=s.name+c.hash;l.hasNameForId(s.id,f)||l.insertRules(s.id,f,c(s.rules,f,"@keyframes"))},this.name=o,this.id="sc-keyframes-".concat(o),this.rules=i,Kc(this,function(){throw Mr(12,String(s.name))})}return n.prototype.getName=function(o){return o===void 0&&(o=Ic),this.name+o.hash},n}(),Ex=function(n){return n>="A"&&n<="Z"};function sh(n){for(var o="",i=0;i>>0);if(!i.hasNameForId(this.componentId,f)){var p=s(c,".".concat(f),void 0,this.componentId);i.insertRules(this.componentId,f,p)}l=jr(l,f),this.staticRulesId=f}else{for(var m=mo(this.baseHash,s.hash),g="",v=0;v>>0);i.hasNameForId(this.componentId,N)||i.insertRules(this.componentId,N,s(g,".".concat(N),void 0,this.componentId)),l=jr(l,N)}}return l},n}(),ca=Yt.createContext(void 0);ca.Consumer;function ah(n){var o=Yt.useContext(ca),i=ae.useMemo(function(){return function(s,l){if(!s)throw Mr(14);if(Dr(s)){var c=s(l);return c}if(Array.isArray(s)||typeof s!="object")throw Mr(8);return l?At(At({},l),s):s}(n.theme,o)},[n.theme,o]);return n.children?Yt.createElement(ca.Provider,{value:i},n.children):null}var vu={};function bx(n,o,i){var s=Yc(n),l=n,c=!yu(n),f=o.attrs,p=f===void 0?xa:f,m=o.componentId,g=m===void 0?function(k,E){var A=typeof k!="string"?"sc":Kp(k);vu[A]=(vu[A]||0)+1;var b="".concat(A,"-").concat(Y0(va+A+vu[A]));return E?"".concat(E,"-").concat(b):b}(o.displayName,o.parentComponentId):m,v=o.displayName,x=v===void 0?function(k){return yu(k)?"styled.".concat(k):"Styled(".concat(K0(k),")")}(n):v,S=o.displayName&&o.componentId?"".concat(Kp(o.displayName),"-").concat(o.componentId):o.componentId||g,N=s&&l.attrs?l.attrs.concat(p).filter(Boolean):p,P=o.shouldForwardProp;if(s&&l.shouldForwardProp){var T=l.shouldForwardProp;if(o.shouldForwardProp){var D=o.shouldForwardProp;P=function(k,E){return T(k,E)&&D(k,E)}}else P=T}var q=new _x(i,S,s?l.componentStyle:void 0);function R(k,E){return function(A,b,I){var H=A.attrs,K=A.componentStyle,he=A.defaultProps,Ee=A.foldedComponentIds,X=A.styledComponentId,Fe=A.target,Ie=Yt.useContext(ca),Ue=ih(),Re=A.shouldForwardProp||Ue.shouldForwardProp,Y=V0(b,Ie,he)||wo,ie=function(_e,Ce,Oe){for(var be,je=At(At({},Ce),{className:void 0,theme:Oe}),Xe=0;Xe<_e.length;Xe+=1){var tt=Dr(be=_e[Xe])?be(je):be;for(var Ht in tt)je[Ht]=Ht==="className"?jr(je[Ht],tt[Ht]):Ht==="style"?At(At({},je[Ht]),tt[Ht]):tt[Ht]}return Ce.className&&(je.className=jr(je.className,Ce.className)),je}(H,b,Y),ne=ie.as||Fe,j={};for(var z in ie)ie[z]===void 0||z[0]==="$"||z==="as"||z==="theme"&&ie.theme===Y||(z==="forwardedAs"?j.as=ie.forwardedAs:Re&&!Re(z,ne)||(j[z]=ie[z]));var ve=function(_e,Ce){var Oe=ih(),be=_e.generateAndInjectStyles(Ce,Oe.styleSheet,Oe.stylis);return be}(K,ie),xe=jr(Ee,X);return ve&&(xe+=" "+ve),ie.className&&(xe+=" "+ie.className),j[yu(ne)&&!mg.has(ne)?"class":"className"]=xe,I&&(j.ref=I),ae.createElement(ne,j)}(M,k,E)}R.displayName=x;var M=Yt.forwardRef(R);return M.attrs=N,M.componentStyle=q,M.displayName=x,M.shouldForwardProp=P,M.foldedComponentIds=s?jr(l.foldedComponentIds,l.styledComponentId):"",M.styledComponentId=S,M.target=s?l.target:n,Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(k){this._foldedDefaultProps=s?function(E){for(var A=[],b=1;b{let o;const i=new Set,s=(g,v)=>{const x=typeof g=="function"?g(o):g;if(!Object.is(x,o)){const S=o;o=v??(typeof x!="object"||x===null)?x:Object.assign({},o,x),i.forEach(N=>N(o,S))}},l=()=>o,p={setState:s,getState:l,getInitialState:()=>m,subscribe:g=>(i.add(g),()=>i.delete(g))},m=o=n(s,l,p);return p},Tx=n=>n?ch(n):ch,Ax=n=>n;function jx(n,o=Ax){const i=Yt.useSyncExternalStore(n.subscribe,()=>o(n.getState()),()=>o(n.getInitialState()));return Yt.useDebugValue(i),i}const dh=n=>{const o=Tx(n),i=s=>jx(o,s);return Object.assign(i,o),i},Un=n=>n?dh(n):dh;function Ag(n,o){return function(){return n.apply(o,arguments)}}const{toString:Ox}=Object.prototype,{getPrototypeOf:Jc}=Object,wa=(n=>o=>{const i=Ox.call(o);return n[i]||(n[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),En=n=>(n=n.toLowerCase(),o=>wa(o)===n),Sa=n=>o=>typeof o===n,{isArray:Co}=Array,Ei=Sa("undefined");function Nx(n){return n!==null&&!Ei(n)&&n.constructor!==null&&!Ei(n.constructor)&&Kt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const jg=En("ArrayBuffer");function Ix(n){let o;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?o=ArrayBuffer.isView(n):o=n&&n.buffer&&jg(n.buffer),o}const Px=Sa("string"),Kt=Sa("function"),Og=Sa("number"),Ea=n=>n!==null&&typeof n=="object",Lx=n=>n===!0||n===!1,ra=n=>{if(wa(n)!=="object")return!1;const o=Jc(n);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Dx=En("Date"),Mx=En("File"),Bx=En("Blob"),$x=En("FileList"),Fx=n=>Ea(n)&&Kt(n.pipe),Ux=n=>{let o;return n&&(typeof FormData=="function"&&n instanceof FormData||Kt(n.append)&&((o=wa(n))==="formdata"||o==="object"&&Kt(n.toString)&&n.toString()==="[object FormData]"))},zx=En("URLSearchParams"),[Hx,qx,Wx,Vx]=["ReadableStream","Request","Response","Headers"].map(En),Gx=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ki(n,o,{allOwnKeys:i=!1}={}){if(n===null||typeof n>"u")return;let s,l;if(typeof n!="object"&&(n=[n]),Co(n))for(s=0,l=n.length;s0;)if(l=i[s],o===l.toLowerCase())return l;return null}const Or=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ig=n=>!Ei(n)&&n!==Or;function Lc(){const{caseless:n}=Ig(this)&&this||{},o={},i=(s,l)=>{const c=n&&Ng(o,l)||l;ra(o[c])&&ra(s)?o[c]=Lc(o[c],s):ra(s)?o[c]=Lc({},s):Co(s)?o[c]=s.slice():o[c]=s};for(let s=0,l=arguments.length;s(ki(o,(l,c)=>{i&&Kt(l)?n[c]=Ag(l,i):n[c]=l},{allOwnKeys:s}),n),Qx=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Yx=(n,o,i,s)=>{n.prototype=Object.create(o.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:o.prototype}),i&&Object.assign(n.prototype,i)},Kx=(n,o,i,s)=>{let l,c,f;const p={};if(o=o||{},n==null)return o;do{for(l=Object.getOwnPropertyNames(n),c=l.length;c-- >0;)f=l[c],(!s||s(f,n,o))&&!p[f]&&(o[f]=n[f],p[f]=!0);n=i!==!1&&Jc(n)}while(n&&(!i||i(n,o))&&n!==Object.prototype);return o},Jx=(n,o,i)=>{n=String(n),(i===void 0||i>n.length)&&(i=n.length),i-=o.length;const s=n.indexOf(o,i);return s!==-1&&s===i},Zx=n=>{if(!n)return null;if(Co(n))return n;let o=n.length;if(!Og(o))return null;const i=new Array(o);for(;o-- >0;)i[o]=n[o];return i},ew=(n=>o=>n&&o instanceof n)(typeof Uint8Array<"u"&&Jc(Uint8Array)),tw=(n,o)=>{const s=(n&&n[Symbol.iterator]).call(n);let l;for(;(l=s.next())&&!l.done;){const c=l.value;o.call(n,c[0],c[1])}},nw=(n,o)=>{let i;const s=[];for(;(i=n.exec(o))!==null;)s.push(i);return s},rw=En("HTMLFormElement"),ow=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,s,l){return s.toUpperCase()+l}),fh=(({hasOwnProperty:n})=>(o,i)=>n.call(o,i))(Object.prototype),iw=En("RegExp"),Pg=(n,o)=>{const i=Object.getOwnPropertyDescriptors(n),s={};ki(i,(l,c)=>{let f;(f=o(l,c,n))!==!1&&(s[c]=f||l)}),Object.defineProperties(n,s)},sw=n=>{Pg(n,(o,i)=>{if(Kt(n)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=n[i];if(Kt(s)){if(o.enumerable=!1,"writable"in o){o.writable=!1;return}o.set||(o.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},aw=(n,o)=>{const i={},s=l=>{l.forEach(c=>{i[c]=!0})};return Co(n)?s(n):s(String(n).split(o)),i},lw=()=>{},uw=(n,o)=>n!=null&&Number.isFinite(n=+n)?n:o,xu="abcdefghijklmnopqrstuvwxyz",ph="0123456789",Lg={DIGIT:ph,ALPHA:xu,ALPHA_DIGIT:xu+xu.toUpperCase()+ph},cw=(n=16,o=Lg.ALPHA_DIGIT)=>{let i="";const{length:s}=o;for(;n--;)i+=o[Math.random()*s|0];return i};function dw(n){return!!(n&&Kt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const fw=n=>{const o=new Array(10),i=(s,l)=>{if(Ea(s)){if(o.indexOf(s)>=0)return;if(!("toJSON"in s)){o[l]=s;const c=Co(s)?[]:{};return ki(s,(f,p)=>{const m=i(f,l+1);!Ei(m)&&(c[p]=m)}),o[l]=void 0,c}}return s};return i(n,0)},pw=En("AsyncFunction"),hw=n=>n&&(Ea(n)||Kt(n))&&Kt(n.then)&&Kt(n.catch),Dg=((n,o)=>n?setImmediate:o?((i,s)=>(Or.addEventListener("message",({source:l,data:c})=>{l===Or&&c===i&&s.length&&s.shift()()},!1),l=>{s.push(l),Or.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Kt(Or.postMessage)),mw=typeof queueMicrotask<"u"?queueMicrotask.bind(Or):typeof process<"u"&&process.nextTick||Dg,F={isArray:Co,isArrayBuffer:jg,isBuffer:Nx,isFormData:Ux,isArrayBufferView:Ix,isString:Px,isNumber:Og,isBoolean:Lx,isObject:Ea,isPlainObject:ra,isReadableStream:Hx,isRequest:qx,isResponse:Wx,isHeaders:Vx,isUndefined:Ei,isDate:Dx,isFile:Mx,isBlob:Bx,isRegExp:iw,isFunction:Kt,isStream:Fx,isURLSearchParams:zx,isTypedArray:ew,isFileList:$x,forEach:ki,merge:Lc,extend:Xx,trim:Gx,stripBOM:Qx,inherits:Yx,toFlatObject:Kx,kindOf:wa,kindOfTest:En,endsWith:Jx,toArray:Zx,forEachEntry:tw,matchAll:nw,isHTMLForm:rw,hasOwnProperty:fh,hasOwnProp:fh,reduceDescriptors:Pg,freezeMethods:sw,toObjectSet:aw,toCamelCase:ow,noop:lw,toFiniteNumber:uw,findKey:Ng,global:Or,isContextDefined:Ig,ALPHABET:Lg,generateString:cw,isSpecCompliantForm:dw,toJSONObject:fw,isAsyncFn:pw,isThenable:hw,setImmediate:Dg,asap:mw};function we(n,o,i,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",o&&(this.code=o),i&&(this.config=i),s&&(this.request=s),l&&(this.response=l,this.status=l.status?l.status:null)}F.inherits(we,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:F.toJSONObject(this.config),code:this.code,status:this.status}}});const Mg=we.prototype,Bg={};["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(n=>{Bg[n]={value:n}});Object.defineProperties(we,Bg);Object.defineProperty(Mg,"isAxiosError",{value:!0});we.from=(n,o,i,s,l,c)=>{const f=Object.create(Mg);return F.toFlatObject(n,f,function(m){return m!==Error.prototype},p=>p!=="isAxiosError"),we.call(f,n.message,o,i,s,l),f.cause=n,f.name=n.name,c&&Object.assign(f,c),f};const gw=null;function Dc(n){return F.isPlainObject(n)||F.isArray(n)}function $g(n){return F.endsWith(n,"[]")?n.slice(0,-2):n}function hh(n,o,i){return n?n.concat(o).map(function(l,c){return l=$g(l),!i&&c?"["+l+"]":l}).join(i?".":""):o}function yw(n){return F.isArray(n)&&!n.some(Dc)}const vw=F.toFlatObject(F,{},null,function(o){return/^is[A-Z]/.test(o)});function Ca(n,o,i){if(!F.isObject(n))throw new TypeError("target must be an object");o=o||new FormData,i=F.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,D){return!F.isUndefined(D[T])});const s=i.metaTokens,l=i.visitor||v,c=i.dots,f=i.indexes,m=(i.Blob||typeof Blob<"u"&&Blob)&&F.isSpecCompliantForm(o);if(!F.isFunction(l))throw new TypeError("visitor must be a function");function g(P){if(P===null)return"";if(F.isDate(P))return P.toISOString();if(!m&&F.isBlob(P))throw new we("Blob is not supported. Use a Buffer instead.");return F.isArrayBuffer(P)||F.isTypedArray(P)?m&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function v(P,T,D){let q=P;if(P&&!D&&typeof P=="object"){if(F.endsWith(T,"{}"))T=s?T:T.slice(0,-2),P=JSON.stringify(P);else if(F.isArray(P)&&yw(P)||(F.isFileList(P)||F.endsWith(T,"[]"))&&(q=F.toArray(P)))return T=$g(T),q.forEach(function(M,k){!(F.isUndefined(M)||M===null)&&o.append(f===!0?hh([T],k,c):f===null?T:T+"[]",g(M))}),!1}return Dc(P)?!0:(o.append(hh(D,T,c),g(P)),!1)}const x=[],S=Object.assign(vw,{defaultVisitor:v,convertValue:g,isVisitable:Dc});function N(P,T){if(!F.isUndefined(P)){if(x.indexOf(P)!==-1)throw Error("Circular reference detected in "+T.join("."));x.push(P),F.forEach(P,function(q,R){(!(F.isUndefined(q)||q===null)&&l.call(o,q,F.isString(R)?R.trim():R,T,S))===!0&&N(q,T?T.concat(R):[R])}),x.pop()}}if(!F.isObject(n))throw new TypeError("data must be an object");return N(n),o}function mh(n){const o={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return o[s]})}function Zc(n,o){this._pairs=[],n&&Ca(n,this,o)}const Fg=Zc.prototype;Fg.append=function(o,i){this._pairs.push([o,i])};Fg.toString=function(o){const i=o?function(s){return o.call(this,s,mh)}:mh;return this._pairs.map(function(l){return i(l[0])+"="+i(l[1])},"").join("&")};function xw(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ug(n,o,i){if(!o)return n;const s=i&&i.encode||xw;F.isFunction(i)&&(i={serialize:i});const l=i&&i.serialize;let c;if(l?c=l(o,i):c=F.isURLSearchParams(o)?o.toString():new Zc(o,i).toString(s),c){const f=n.indexOf("#");f!==-1&&(n=n.slice(0,f)),n+=(n.indexOf("?")===-1?"?":"&")+c}return n}class gh{constructor(){this.handlers=[]}use(o,i,s){return this.handlers.push({fulfilled:o,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(o){this.handlers[o]&&(this.handlers[o]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(o){F.forEach(this.handlers,function(s){s!==null&&o(s)})}}const zg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ww=typeof URLSearchParams<"u"?URLSearchParams:Zc,Sw=typeof FormData<"u"?FormData:null,Ew=typeof Blob<"u"?Blob:null,Cw={isBrowser:!0,classes:{URLSearchParams:ww,FormData:Sw,Blob:Ew},protocols:["http","https","file","blob","url","data"]},ed=typeof window<"u"&&typeof document<"u",Mc=typeof navigator=="object"&&navigator||void 0,kw=ed&&(!Mc||["ReactNative","NativeScript","NS"].indexOf(Mc.product)<0),_w=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bw=ed&&window.location.href||"http://localhost",Rw=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ed,hasStandardBrowserEnv:kw,hasStandardBrowserWebWorkerEnv:_w,navigator:Mc,origin:bw},Symbol.toStringTag,{value:"Module"})),Tt={...Rw,...Cw};function Tw(n,o){return Ca(n,new Tt.classes.URLSearchParams,Object.assign({visitor:function(i,s,l,c){return Tt.isNode&&F.isBuffer(i)?(this.append(s,i.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)}},o))}function Aw(n){return F.matchAll(/\w+|\[(\w*)]/g,n).map(o=>o[0]==="[]"?"":o[1]||o[0])}function jw(n){const o={},i=Object.keys(n);let s;const l=i.length;let c;for(s=0;s=i.length;return f=!f&&F.isArray(l)?l.length:f,m?(F.hasOwnProp(l,f)?l[f]=[l[f],s]:l[f]=s,!p):((!l[f]||!F.isObject(l[f]))&&(l[f]=[]),o(i,s,l[f],c)&&F.isArray(l[f])&&(l[f]=jw(l[f])),!p)}if(F.isFormData(n)&&F.isFunction(n.entries)){const i={};return F.forEachEntry(n,(s,l)=>{o(Aw(s),l,i,0)}),i}return null}function Ow(n,o,i){if(F.isString(n))try{return(o||JSON.parse)(n),F.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(0,JSON.stringify)(n)}const _i={transitional:zg,adapter:["xhr","http","fetch"],transformRequest:[function(o,i){const s=i.getContentType()||"",l=s.indexOf("application/json")>-1,c=F.isObject(o);if(c&&F.isHTMLForm(o)&&(o=new FormData(o)),F.isFormData(o))return l?JSON.stringify(Hg(o)):o;if(F.isArrayBuffer(o)||F.isBuffer(o)||F.isStream(o)||F.isFile(o)||F.isBlob(o)||F.isReadableStream(o))return o;if(F.isArrayBufferView(o))return o.buffer;if(F.isURLSearchParams(o))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),o.toString();let p;if(c){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Tw(o,this.formSerializer).toString();if((p=F.isFileList(o))||s.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return Ca(p?{"files[]":o}:o,m&&new m,this.formSerializer)}}return c||l?(i.setContentType("application/json",!1),Ow(o)):o}],transformResponse:[function(o){const i=this.transitional||_i.transitional,s=i&&i.forcedJSONParsing,l=this.responseType==="json";if(F.isResponse(o)||F.isReadableStream(o))return o;if(o&&F.isString(o)&&(s&&!this.responseType||l)){const f=!(i&&i.silentJSONParsing)&&l;try{return JSON.parse(o)}catch(p){if(f)throw p.name==="SyntaxError"?we.from(p,we.ERR_BAD_RESPONSE,this,null,this.response):p}}return o}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tt.classes.FormData,Blob:Tt.classes.Blob},validateStatus:function(o){return o>=200&&o<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};F.forEach(["delete","get","head","post","put","patch"],n=>{_i.headers[n]={}});const Nw=F.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"]),Iw=n=>{const o={};let i,s,l;return n&&n.split(` +`).forEach(function(f){l=f.indexOf(":"),i=f.substring(0,l).trim().toLowerCase(),s=f.substring(l+1).trim(),!(!i||o[i]&&Nw[i])&&(i==="set-cookie"?o[i]?o[i].push(s):o[i]=[s]:o[i]=o[i]?o[i]+", "+s:s)}),o},yh=Symbol("internals");function di(n){return n&&String(n).trim().toLowerCase()}function oa(n){return n===!1||n==null?n:F.isArray(n)?n.map(oa):String(n)}function Pw(n){const o=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(n);)o[s[1]]=s[2];return o}const Lw=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function wu(n,o,i,s,l){if(F.isFunction(s))return s.call(this,o,i);if(l&&(o=i),!!F.isString(o)){if(F.isString(s))return o.indexOf(s)!==-1;if(F.isRegExp(s))return s.test(o)}}function Dw(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(o,i,s)=>i.toUpperCase()+s)}function Mw(n,o){const i=F.toCamelCase(" "+o);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+i,{value:function(l,c,f){return this[s].call(this,o,l,c,f)},configurable:!0})})}class zt{constructor(o){o&&this.set(o)}set(o,i,s){const l=this;function c(p,m,g){const v=di(m);if(!v)throw new Error("header name must be a non-empty string");const x=F.findKey(l,v);(!x||l[x]===void 0||g===!0||g===void 0&&l[x]!==!1)&&(l[x||m]=oa(p))}const f=(p,m)=>F.forEach(p,(g,v)=>c(g,v,m));if(F.isPlainObject(o)||o instanceof this.constructor)f(o,i);else if(F.isString(o)&&(o=o.trim())&&!Lw(o))f(Iw(o),i);else if(F.isHeaders(o))for(const[p,m]of o.entries())c(m,p,s);else o!=null&&c(i,o,s);return this}get(o,i){if(o=di(o),o){const s=F.findKey(this,o);if(s){const l=this[s];if(!i)return l;if(i===!0)return Pw(l);if(F.isFunction(i))return i.call(this,l,s);if(F.isRegExp(i))return i.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(o,i){if(o=di(o),o){const s=F.findKey(this,o);return!!(s&&this[s]!==void 0&&(!i||wu(this,this[s],s,i)))}return!1}delete(o,i){const s=this;let l=!1;function c(f){if(f=di(f),f){const p=F.findKey(s,f);p&&(!i||wu(s,s[p],p,i))&&(delete s[p],l=!0)}}return F.isArray(o)?o.forEach(c):c(o),l}clear(o){const i=Object.keys(this);let s=i.length,l=!1;for(;s--;){const c=i[s];(!o||wu(this,this[c],c,o,!0))&&(delete this[c],l=!0)}return l}normalize(o){const i=this,s={};return F.forEach(this,(l,c)=>{const f=F.findKey(s,c);if(f){i[f]=oa(l),delete i[c];return}const p=o?Dw(c):String(c).trim();p!==c&&delete i[c],i[p]=oa(l),s[p]=!0}),this}concat(...o){return this.constructor.concat(this,...o)}toJSON(o){const i=Object.create(null);return F.forEach(this,(s,l)=>{s!=null&&s!==!1&&(i[l]=o&&F.isArray(s)?s.join(", "):s)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([o,i])=>o+": "+i).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(o){return o instanceof this?o:new this(o)}static concat(o,...i){const s=new this(o);return i.forEach(l=>s.set(l)),s}static accessor(o){const s=(this[yh]=this[yh]={accessors:{}}).accessors,l=this.prototype;function c(f){const p=di(f);s[p]||(Mw(l,f),s[p]=!0)}return F.isArray(o)?o.forEach(c):c(o),this}}zt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);F.reduceDescriptors(zt.prototype,({value:n},o)=>{let i=o[0].toUpperCase()+o.slice(1);return{get:()=>n,set(s){this[i]=s}}});F.freezeMethods(zt);function Su(n,o){const i=this||_i,s=o||i,l=zt.from(s.headers);let c=s.data;return F.forEach(n,function(p){c=p.call(i,c,l.normalize(),o?o.status:void 0)}),l.normalize(),c}function qg(n){return!!(n&&n.__CANCEL__)}function ko(n,o,i){we.call(this,n??"canceled",we.ERR_CANCELED,o,i),this.name="CanceledError"}F.inherits(ko,we,{__CANCEL__:!0});function Wg(n,o,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?n(i):o(new we("Request failed with status code "+i.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function Bw(n){const o=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return o&&o[1]||""}function $w(n,o){n=n||10;const i=new Array(n),s=new Array(n);let l=0,c=0,f;return o=o!==void 0?o:1e3,function(m){const g=Date.now(),v=s[c];f||(f=g),i[l]=m,s[l]=g;let x=c,S=0;for(;x!==l;)S+=i[x++],x=x%n;if(l=(l+1)%n,l===c&&(c=(c+1)%n),g-f{i=v,l=null,c&&(clearTimeout(c),c=null),n.apply(null,g)};return[(...g)=>{const v=Date.now(),x=v-i;x>=s?f(g,v):(l=g,c||(c=setTimeout(()=>{c=null,f(l)},s-x)))},()=>l&&f(l)]}const da=(n,o,i=3)=>{let s=0;const l=$w(50,250);return Fw(c=>{const f=c.loaded,p=c.lengthComputable?c.total:void 0,m=f-s,g=l(m),v=f<=p;s=f;const x={loaded:f,total:p,progress:p?f/p:void 0,bytes:m,rate:g||void 0,estimated:g&&p&&v?(p-f)/g:void 0,event:c,lengthComputable:p!=null,[o?"download":"upload"]:!0};n(x)},i)},vh=(n,o)=>{const i=n!=null;return[s=>o[0]({lengthComputable:i,total:n,loaded:s}),o[1]]},xh=n=>(...o)=>F.asap(()=>n(...o)),Uw=Tt.hasStandardBrowserEnv?((n,o)=>i=>(i=new URL(i,Tt.origin),n.protocol===i.protocol&&n.host===i.host&&(o||n.port===i.port)))(new URL(Tt.origin),Tt.navigator&&/(msie|trident)/i.test(Tt.navigator.userAgent)):()=>!0,zw=Tt.hasStandardBrowserEnv?{write(n,o,i,s,l,c){const f=[n+"="+encodeURIComponent(o)];F.isNumber(i)&&f.push("expires="+new Date(i).toGMTString()),F.isString(s)&&f.push("path="+s),F.isString(l)&&f.push("domain="+l),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read(n){const o=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hw(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function qw(n,o){return o?n.replace(/\/?\/$/,"")+"/"+o.replace(/^\/+/,""):n}function Vg(n,o){return n&&!Hw(o)?qw(n,o):o}const wh=n=>n instanceof zt?{...n}:n;function Br(n,o){o=o||{};const i={};function s(g,v,x,S){return F.isPlainObject(g)&&F.isPlainObject(v)?F.merge.call({caseless:S},g,v):F.isPlainObject(v)?F.merge({},v):F.isArray(v)?v.slice():v}function l(g,v,x,S){if(F.isUndefined(v)){if(!F.isUndefined(g))return s(void 0,g,x,S)}else return s(g,v,x,S)}function c(g,v){if(!F.isUndefined(v))return s(void 0,v)}function f(g,v){if(F.isUndefined(v)){if(!F.isUndefined(g))return s(void 0,g)}else return s(void 0,v)}function p(g,v,x){if(x in o)return s(g,v);if(x in n)return s(void 0,g)}const m={url:c,method:c,data:c,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:p,headers:(g,v,x)=>l(wh(g),wh(v),x,!0)};return F.forEach(Object.keys(Object.assign({},n,o)),function(v){const x=m[v]||l,S=x(n[v],o[v],v);F.isUndefined(S)&&x!==p||(i[v]=S)}),i}const Gg=n=>{const o=Br({},n);let{data:i,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:c,headers:f,auth:p}=o;o.headers=f=zt.from(f),o.url=Ug(Vg(o.baseURL,o.url),n.params,n.paramsSerializer),p&&f.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):"")));let m;if(F.isFormData(i)){if(Tt.hasStandardBrowserEnv||Tt.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((m=f.getContentType())!==!1){const[g,...v]=m?m.split(";").map(x=>x.trim()).filter(Boolean):[];f.setContentType([g||"multipart/form-data",...v].join("; "))}}if(Tt.hasStandardBrowserEnv&&(s&&F.isFunction(s)&&(s=s(o)),s||s!==!1&&Uw(o.url))){const g=l&&c&&zw.read(c);g&&f.set(l,g)}return o},Ww=typeof XMLHttpRequest<"u",Vw=Ww&&function(n){return new Promise(function(i,s){const l=Gg(n);let c=l.data;const f=zt.from(l.headers).normalize();let{responseType:p,onUploadProgress:m,onDownloadProgress:g}=l,v,x,S,N,P;function T(){N&&N(),P&&P(),l.cancelToken&&l.cancelToken.unsubscribe(v),l.signal&&l.signal.removeEventListener("abort",v)}let D=new XMLHttpRequest;D.open(l.method.toUpperCase(),l.url,!0),D.timeout=l.timeout;function q(){if(!D)return;const M=zt.from("getAllResponseHeaders"in D&&D.getAllResponseHeaders()),E={data:!p||p==="text"||p==="json"?D.responseText:D.response,status:D.status,statusText:D.statusText,headers:M,config:n,request:D};Wg(function(b){i(b),T()},function(b){s(b),T()},E),D=null}"onloadend"in D?D.onloadend=q:D.onreadystatechange=function(){!D||D.readyState!==4||D.status===0&&!(D.responseURL&&D.responseURL.indexOf("file:")===0)||setTimeout(q)},D.onabort=function(){D&&(s(new we("Request aborted",we.ECONNABORTED,n,D)),D=null)},D.onerror=function(){s(new we("Network Error",we.ERR_NETWORK,n,D)),D=null},D.ontimeout=function(){let k=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const E=l.transitional||zg;l.timeoutErrorMessage&&(k=l.timeoutErrorMessage),s(new we(k,E.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,n,D)),D=null},c===void 0&&f.setContentType(null),"setRequestHeader"in D&&F.forEach(f.toJSON(),function(k,E){D.setRequestHeader(E,k)}),F.isUndefined(l.withCredentials)||(D.withCredentials=!!l.withCredentials),p&&p!=="json"&&(D.responseType=l.responseType),g&&([S,P]=da(g,!0),D.addEventListener("progress",S)),m&&D.upload&&([x,N]=da(m),D.upload.addEventListener("progress",x),D.upload.addEventListener("loadend",N)),(l.cancelToken||l.signal)&&(v=M=>{D&&(s(!M||M.type?new ko(null,n,D):M),D.abort(),D=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const R=Bw(l.url);if(R&&Tt.protocols.indexOf(R)===-1){s(new we("Unsupported protocol "+R+":",we.ERR_BAD_REQUEST,n));return}D.send(c||null)})},Gw=(n,o)=>{const{length:i}=n=n?n.filter(Boolean):[];if(o||i){let s=new AbortController,l;const c=function(g){if(!l){l=!0,p();const v=g instanceof Error?g:this.reason;s.abort(v instanceof we?v:new ko(v instanceof Error?v.message:v))}};let f=o&&setTimeout(()=>{f=null,c(new we(`timeout ${o} of ms exceeded`,we.ETIMEDOUT))},o);const p=()=>{n&&(f&&clearTimeout(f),f=null,n.forEach(g=>{g.unsubscribe?g.unsubscribe(c):g.removeEventListener("abort",c)}),n=null)};n.forEach(g=>g.addEventListener("abort",c));const{signal:m}=s;return m.unsubscribe=()=>F.asap(p),m}},Xw=function*(n,o){let i=n.byteLength;if(i{const l=Qw(n,o);let c=0,f,p=m=>{f||(f=!0,s&&s(m))};return new ReadableStream({async pull(m){try{const{done:g,value:v}=await l.next();if(g){p(),m.close();return}let x=v.byteLength;if(i){let S=c+=x;i(S)}m.enqueue(new Uint8Array(v))}catch(g){throw p(g),g}},cancel(m){return p(m),l.return()}},{highWaterMark:2})},ka=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Xg=ka&&typeof ReadableStream=="function",Kw=ka&&(typeof TextEncoder=="function"?(n=>o=>n.encode(o))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Qg=(n,...o)=>{try{return!!n(...o)}catch{return!1}},Jw=Xg&&Qg(()=>{let n=!1;const o=new Request(Tt.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!o}),Eh=64*1024,Bc=Xg&&Qg(()=>F.isReadableStream(new Response("").body)),fa={stream:Bc&&(n=>n.body)};ka&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(o=>{!fa[o]&&(fa[o]=F.isFunction(n[o])?i=>i[o]():(i,s)=>{throw new we(`Response type '${o}' is not supported`,we.ERR_NOT_SUPPORT,s)})})})(new Response);const Zw=async n=>{if(n==null)return 0;if(F.isBlob(n))return n.size;if(F.isSpecCompliantForm(n))return(await new Request(Tt.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(F.isArrayBufferView(n)||F.isArrayBuffer(n))return n.byteLength;if(F.isURLSearchParams(n)&&(n=n+""),F.isString(n))return(await Kw(n)).byteLength},e1=async(n,o)=>{const i=F.toFiniteNumber(n.getContentLength());return i??Zw(o)},t1=ka&&(async n=>{let{url:o,method:i,data:s,signal:l,cancelToken:c,timeout:f,onDownloadProgress:p,onUploadProgress:m,responseType:g,headers:v,withCredentials:x="same-origin",fetchOptions:S}=Gg(n);g=g?(g+"").toLowerCase():"text";let N=Gw([l,c&&c.toAbortSignal()],f),P;const T=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let D;try{if(m&&Jw&&i!=="get"&&i!=="head"&&(D=await e1(v,s))!==0){let E=new Request(o,{method:"POST",body:s,duplex:"half"}),A;if(F.isFormData(s)&&(A=E.headers.get("content-type"))&&v.setContentType(A),E.body){const[b,I]=vh(D,da(xh(m)));s=Sh(E.body,Eh,b,I)}}F.isString(x)||(x=x?"include":"omit");const q="credentials"in Request.prototype;P=new Request(o,{...S,signal:N,method:i.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:q?x:void 0});let R=await fetch(P);const M=Bc&&(g==="stream"||g==="response");if(Bc&&(p||M&&T)){const E={};["status","statusText","headers"].forEach(H=>{E[H]=R[H]});const A=F.toFiniteNumber(R.headers.get("content-length")),[b,I]=p&&vh(A,da(xh(p),!0))||[];R=new Response(Sh(R.body,Eh,b,()=>{I&&I(),T&&T()}),E)}g=g||"text";let k=await fa[F.findKey(fa,g)||"text"](R,n);return!M&&T&&T(),await new Promise((E,A)=>{Wg(E,A,{data:k,headers:zt.from(R.headers),status:R.status,statusText:R.statusText,config:n,request:P})})}catch(q){throw T&&T(),q&&q.name==="TypeError"&&/fetch/i.test(q.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,n,P),{cause:q.cause||q}):we.from(q,q&&q.code,n,P)}}),$c={http:gw,xhr:Vw,fetch:t1};F.forEach($c,(n,o)=>{if(n){try{Object.defineProperty(n,"name",{value:o})}catch{}Object.defineProperty(n,"adapterName",{value:o})}});const Ch=n=>`- ${n}`,n1=n=>F.isFunction(n)||n===null||n===!1,Yg={getAdapter:n=>{n=F.isArray(n)?n:[n];const{length:o}=n;let i,s;const l={};for(let c=0;c`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let f=o?c.length>1?`since : +`+c.map(Ch).join(` +`):" "+Ch(c[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return s},adapters:$c};function Eu(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new ko(null,n)}function kh(n){return Eu(n),n.headers=zt.from(n.headers),n.data=Su.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Yg.getAdapter(n.adapter||_i.adapter)(n).then(function(s){return Eu(n),s.data=Su.call(n,n.transformResponse,s),s.headers=zt.from(s.headers),s},function(s){return qg(s)||(Eu(n),s&&s.response&&(s.response.data=Su.call(n,n.transformResponse,s.response),s.response.headers=zt.from(s.response.headers))),Promise.reject(s)})}const Kg="1.7.9",_a={};["object","boolean","number","function","string","symbol"].forEach((n,o)=>{_a[n]=function(s){return typeof s===n||"a"+(o<1?"n ":" ")+n}});const _h={};_a.transitional=function(o,i,s){function l(c,f){return"[Axios v"+Kg+"] Transitional option '"+c+"'"+f+(s?". "+s:"")}return(c,f,p)=>{if(o===!1)throw new we(l(f," has been removed"+(i?" in "+i:"")),we.ERR_DEPRECATED);return i&&!_h[f]&&(_h[f]=!0,console.warn(l(f," has been deprecated since v"+i+" and will be removed in the near future"))),o?o(c,f,p):!0}};_a.spelling=function(o){return(i,s)=>(console.warn(`${s} is likely a misspelling of ${o}`),!0)};function r1(n,o,i){if(typeof n!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let l=s.length;for(;l-- >0;){const c=s[l],f=o[c];if(f){const p=n[c],m=p===void 0||f(p,c,n);if(m!==!0)throw new we("option "+c+" must be "+m,we.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new we("Unknown option "+c,we.ERR_BAD_OPTION)}}const ia={assertOptions:r1,validators:_a},Tn=ia.validators;class Pr{constructor(o){this.defaults=o,this.interceptors={request:new gh,response:new gh}}async request(o,i){try{return await this._request(o,i)}catch(s){if(s instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const c=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=` +`+c):s.stack=c}catch{}}throw s}}_request(o,i){typeof o=="string"?(i=i||{},i.url=o):i=o||{},i=Br(this.defaults,i);const{transitional:s,paramsSerializer:l,headers:c}=i;s!==void 0&&ia.assertOptions(s,{silentJSONParsing:Tn.transitional(Tn.boolean),forcedJSONParsing:Tn.transitional(Tn.boolean),clarifyTimeoutError:Tn.transitional(Tn.boolean)},!1),l!=null&&(F.isFunction(l)?i.paramsSerializer={serialize:l}:ia.assertOptions(l,{encode:Tn.function,serialize:Tn.function},!0)),ia.assertOptions(i,{baseUrl:Tn.spelling("baseURL"),withXsrfToken:Tn.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let f=c&&F.merge(c.common,c[i.method]);c&&F.forEach(["delete","get","head","post","put","patch","common"],P=>{delete c[P]}),i.headers=zt.concat(f,c);const p=[];let m=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(i)===!1||(m=m&&T.synchronous,p.unshift(T.fulfilled,T.rejected))});const g=[];this.interceptors.response.forEach(function(T){g.push(T.fulfilled,T.rejected)});let v,x=0,S;if(!m){const P=[kh.bind(this),void 0];for(P.unshift.apply(P,p),P.push.apply(P,g),S=P.length,v=Promise.resolve(i);x{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](l);s._listeners=null}),this.promise.then=l=>{let c;const f=new Promise(p=>{s.subscribe(p),c=p}).then(l);return f.cancel=function(){s.unsubscribe(c)},f},o(function(c,f,p){s.reason||(s.reason=new ko(c,f,p),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]}unsubscribe(o){if(!this._listeners)return;const i=this._listeners.indexOf(o);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const o=new AbortController,i=s=>{o.abort(s)};return this.subscribe(i),o.signal.unsubscribe=()=>this.unsubscribe(i),o.signal}static source(){let o;return{token:new td(function(l){o=l}),cancel:o}}}function o1(n){return function(i){return n.apply(null,i)}}function i1(n){return F.isObject(n)&&n.isAxiosError===!0}const Fc={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(Fc).forEach(([n,o])=>{Fc[o]=n});function Jg(n){const o=new Pr(n),i=Ag(Pr.prototype.request,o);return F.extend(i,Pr.prototype,o,{allOwnKeys:!0}),F.extend(i,o,null,{allOwnKeys:!0}),i.create=function(l){return Jg(Br(n,l))},i}const et=Jg(_i);et.Axios=Pr;et.CanceledError=ko;et.CancelToken=td;et.isCancel=qg;et.VERSION=Kg;et.toFormData=Ca;et.AxiosError=we;et.Cancel=et.CanceledError;et.all=function(o){return Promise.all(o)};et.spread=o1;et.isAxiosError=i1;et.mergeConfig=Br;et.AxiosHeaders=zt;et.formToJSON=n=>Hg(F.isHTMLForm(n)?new FormData(n):n);et.getAdapter=Yg.getAdapter;et.HttpStatusCode=Fc;et.default=et;const ba={apiBaseUrl:"/api",wsBaseUrl:"/ws",sseBaseUrl:"/api/sse"};class s1{constructor(){Bp(this,"events",{})}on(o,i){return this.events[o]||(this.events[o]=[]),this.events[o].push(i),()=>this.off(o,i)}off(o,i){this.events[o]&&(this.events[o]=this.events[o].filter(s=>s!==i))}emit(o,...i){this.events[o]&&this.events[o].forEach(s=>{s(...i)})}}const Zg=new s1;/*! js-cookie v3.0.5 | MIT */function Us(n){for(var o=1;o"u")){f=Us({},o,f),typeof f.expires=="number"&&(f.expires=new Date(Date.now()+f.expires*864e5)),f.expires&&(f.expires=f.expires.toUTCString()),l=encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var p="";for(var m in f)f[m]&&(p+="; "+m,f[m]!==!0&&(p+="="+f[m].split(";")[0]));return document.cookie=l+"="+n.write(c,l)+p}}function s(l){if(!(typeof document>"u"||arguments.length&&!l)){for(var c=document.cookie?document.cookie.split("; "):[],f={},p=0;p{const i={username:n,password:o};return(await Fr.post("/auth/login",i)).data},u1=async n=>(await Fr.post("/users",n,{headers:{"Content-Type":"multipart/form-data"}})).data,c1=async()=>{await Fr.get("/auth/csrf-token")},d1=async()=>(await Fr.get("/auth/me")).data,f1=async()=>(await Fr.post("/auth/refresh")).data,p1=async()=>{await Fr.post("/auth/logout")},h1=async(n,o)=>{const i={userId:n,newRole:o};return(await Et.put("/auth/role",i)).data},Cu=n=>{const i=n.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(atob(i).split("").map(function(l){return"%"+("00"+l.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(s)},pt=Un((n,o)=>({currentUser:null,accessToken:null,login:async(i,s)=>{const l=await l1(i,s),{userDto:c}=Cu(l);n({accessToken:l,currentUser:c}),await o().fetchCsrfToken()},logout:async()=>{await p1(),o().clear(),o().fetchCsrfToken()},fetchCsrfToken:async()=>{await c1()},fetchMe:async()=>{const i=await d1(),{userDto:s}=Cu(i);n({accessToken:i,currentUser:s})},refreshToken:async()=>{const i=await f1(),{userDto:s}=Cu(i);n({accessToken:i,currentUser:s})},clear:()=>{n({currentUser:null})},updateUserRole:async(i,s)=>{await h1(i,s)}})),Et=et.create({baseURL:ba.apiBaseUrl,headers:{"Content-Type":"application/json"},withCredentials:!0}),Fr=et.create({baseURL:ba.apiBaseUrl,headers:{"Content-Type":"application/json"},withCredentials:!0});Et.interceptors.request.use(n=>{const o=ey.get("XSRF-TOKEN");o&&(n.headers["X-XSRF-TOKEN"]=o);const i=pt.getState().accessToken;return i&&(n.headers.Authorization=`Bearer ${i}`),n},n=>Promise.reject(n));Fr.interceptors.request.use(n=>{const o=ey.get("XSRF-TOKEN");return o&&(n.headers["X-XSRF-TOKEN"]=o),n},n=>Promise.reject(n));Et.interceptors.response.use(n=>n,async n=>{var o,i,s,l,c,f;if(((o=n.response)==null?void 0:o.status)===401&&!((s=(i=n.config)==null?void 0:i.url)!=null&&s.endsWith("/api/auth/refresh")))try{return await pt.getState().refreshToken(),et(n.config)}catch{console.log("// 토큰 재발급 실패 → 로그아웃"),await pt.getState().logout()}else{const p=(l=n.response)==null?void 0:l.data;if(p){const m=(f=(c=n.response)==null?void 0:c.headers)==null?void 0:f["discodeit-request-id"];m&&(p.requestId=m),n.response.data=p}return Zg.emit("api-error",n),Promise.reject(n)}});const m1=()=>Et.defaults.baseURL,g1=async(n,o)=>(await Et.patch(`/users/${n}`,o,{headers:{"Content-Type":"multipart/form-data"}})).data,y1=async()=>(await Et.get("/users")).data,$r=Un((n,o)=>({users:[],fetchUsers:async()=>{try{const i=await y1();n({users:i})}catch(i){console.error("사용자 목록 조회 실패:",i)}},isOnline:i=>{var l;const{users:s}=o();return((l=s.find(c=>c.id===i))==null?void 0:l.online)||!1}})),te={colors:{brand:{primary:"#5865F2",hover:"#4752C4"},background:{primary:"#1a1a1a",secondary:"#2a2a2a",tertiary:"#333333",input:"#40444B",hover:"rgba(255, 255, 255, 0.1)"},text:{primary:"#ffffff",secondary:"#cccccc",muted:"#999999"},status:{online:"#43b581",idle:"#faa61a",dnd:"#f04747",offline:"#747f8d",error:"#ED4245"},border:{primary:"#404040"}}},ty=O.div` + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +`,ny=O.div` + background: ${te.colors.background.primary}; + padding: 32px; + border-radius: 8px; + width: 440px; + + h2 { + color: ${te.colors.text.primary}; + margin-bottom: 24px; + font-size: 24px; + font-weight: bold; + } + + form { + display: flex; + flex-direction: column; + gap: 16px; + } +`,xi=O.input` + width: 100%; + padding: 10px; + border-radius: 4px; + background: ${te.colors.background.input}; + border: none; + color: ${te.colors.text.primary}; + font-size: 16px; + + &::placeholder { + color: ${te.colors.text.muted}; + } + + &:focus { + outline: none; + } +`,v1=O.input.attrs({type:"checkbox"})` + width: 16px; + height: 16px; + padding: 0; + border-radius: 4px; + background: ${te.colors.background.input}; + border: none; + color: ${te.colors.text.primary}; + cursor: pointer; + + &:focus { + outline: none; + } + + &:checked { + background: ${te.colors.brand.primary}; + } +`,ry=O.button` + width: 100%; + padding: 12px; + border-radius: 4px; + background: ${te.colors.brand.primary}; + color: white; + font-size: 16px; + font-weight: 500; + border: none; + cursor: pointer; + transition: background-color 0.2s; + + &:hover { + background: ${te.colors.brand.hover}; + } +`,oy=O.div` + color: ${te.colors.status.error}; + font-size: 14px; + text-align: center; +`,x1=O.p` + text-align: center; + margin-top: 16px; + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 14px; +`,w1=O.span` + color: ${({theme:n})=>n.colors.brand.primary}; + cursor: pointer; + + &:hover { + text-decoration: underline; + } +`,zs=O.div` + margin-bottom: 20px; +`,Hs=O.label` + display: block; + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 12px; + font-weight: 700; + margin-bottom: 8px; +`,ku=O.span` + color: ${({theme:n})=>n.colors.status.error}; +`,S1=O.div` + display: flex; + flex-direction: column; + align-items: center; + margin: 10px 0; +`,E1=O.img` + width: 80px; + height: 80px; + border-radius: 50%; + margin-bottom: 10px; + object-fit: cover; +`,C1=O.input` + display: none; +`,k1=O.label` + color: ${({theme:n})=>n.colors.brand.primary}; + cursor: pointer; + font-size: 14px; + + &:hover { + text-decoration: underline; + } +`,_1=O.span` + color: ${({theme:n})=>n.colors.brand.primary}; + cursor: pointer; + + &:hover { + text-decoration: underline; + } +`,b1=O(_1)` + display: block; + text-align: center; + margin-top: 16px; +`,Jt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAYAAAA+VemSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAw2SURBVHgB7d3PT1XpHcfxBy5g6hipSMolGViACThxJDbVRZ2FXejKlf9h/4GmC1fTRdkwC8fE0JgyJuICFkCjEA04GeZe6P0cPC0698I95zzPc57v5f1K6DSto3A8n/v9nufXGfrr338+dgBMGnYAzCLAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwbcTDvyuWh//33w1/1dexwMRBgYxTW5vVh9/vxYTcxPpR9jY0OffZrdt8fu82ttlvfbLv9j4R5kBHgxCmcE1eH3NfTDTc7PfxZte3lJNgjbmlxxK3+1HKrr1oOg4kAJ0pVdnG+4ZqTw7+psEUoxF91Qv/Di1+db/q+ZpvD7g+T6gb04XLyv6mF3//osuqvTmDn3RGdQCAEOCG6+W/ONdzNTnCrhPZLN2Yb2T99hVhdwOLcSOf37f7hknUN4yedgLoGeb3Rdv/qdAIE2S8CnIDzAuGDQrzXeTZee1OtndaHy9LCSOHvU3++vv693nLPX9LS+0KAa6QQLC2o4sb5a1A7rYGtMqPU+l7v3hpx85+qeVnfdH7W2c7z/Pcrh1RjD5gHromq2JOHY9HCK2Ojzk1dL1fhH90fqxzenDoO/X79DMjhbAQ4Mg1OPXl4KauGodrls6j6FaXKq+dZn/IQ13ENBgkBjiRvQR99V2/lmZos9lc+PxOuxdd1uL3gp6pfVDwDR6Ab9cG9Me9VLAZ1CiHpmXhz6yibakJxVODAZpoN9/iBzfCq+sboFkJ/SAwyrlxAujE1WJWSIiO/sYKlxSpTnbEBqnBxVOBA9LybWnjloM8An6ysitc1NCe5FcvgqgVw/85o1OmhItY32n39uqnJuC3/FAEuhavmmcLra77UN7XP2322qRNX494aqvgojqvmUcrhFa1+6tdXkae6tMiEhR3FEWBPNOCTcni1rZCli4OHAHuQ4mjzaewJHlxMI1Wked5Uw7v99ijbwqd/FnVQQ7WmQyiOAFegZ7a736ZzCU820h+7nbfHbnO7XSq4p3+vmHbfMwdcBgGuoO4dNQrZxtaR+08nqNueT73Y2D7qTIW5aLRXGcUR4JL03FtHeBXa9Y2jyhX2PHudiqg/K9ZuoY3t/uan8TkCXIKCG/u5V2Fae9N2a+vtKO2tjqfVnxfj5zw5O4sWugwCXIJa51hiB/e0tfVWdkZX6CrMCHl5BLigWDt0RCc6rrxo1XZQu6rw6qt2tq47FD0G9Lu8E79FgAvIWucIO3QU2B9ftpK4sVWFZ5rDQTYbqHUOcdztRcJCjgLUToauvrqpny4fJlWVlp/5P4BOH1IcbFcdAe6Tght6h5FeiaLwpnZTq5VW2HzN1eYfUoS3OgLcp9sL4cOrkKT6YrI8dFUHnDQYR3j94Rm4D9kLxQLuV009vKdpXbXae00vFdm8UWVZJ3ojwH3QcS+hnn1VifSMaemVoPqeVzqDT6rG2oivQS5dH33l70ZS262w7n04yhae8MrTMAhwH0KNPFsfyNH3vd+pxkwD1Ydn4HOodQ5VfTXHyrMgqiDA55ibCbNJX1VLc6xAFQT4HCEGr9Q6s3wQPhDgM4RqnzWVQusMHwjwGTS66puCS/WFLwT4DCHOKia88IkA96BjTkOcVbzDQgZ4RIB7CBFejTzz7AufCHAPWn3lGwse4BsB7uGa5wqcLS3k7XvwjAD3cOWy84pnX4RAgHvw/QzMLhyEQIC7CLF4Y4+DyxEAAe4iRIB3PzD6DP8IcBejnncPagCL/bAIgQB34fsc5P2PtM8IgwBHcMjJqQiEAHfBm+JhBQGO4IDlkwiEAHdx2PIbuFhv+MPFQ4C7ODx0Xo2OOiAIAhwBz9QIhQB34XvOlhYaoRDgLg5+dl7pcACqMEIgwF2EWDV1bZwAwz8C3IVOzfAd4omrXGr4x13Vg++jb6YmudTwj7uqh733fgOsM6YZzIJvBLiH3Q/+NyDMB3pNCy4u3k7Yw+57/wNZM9PDbu2NGwjqJiauDrmvpxufXiv6+f+v63fw8SjrZDgLLBwC3INO0NBAls+2V220jurZNXw6h8K6ODfibsye/UjQnNR/nnQcGk/IX/DNsbp+EeAetAVQVaQ56fe5dXGu4X54YTPASwsj7uZ8o/CHmkJ/Y7aRfb3eaBNkj3gGPsNOgNZPN7G1RR36fh8/uJS96LxqR6Kf/9H9MRa2eEKAz7C5FaZS3l6w0/goaArchMeFKPkHwrVxbr+quIJn0LNqiFZPVSjEmx98U7UNVS016PWXe6NU4ooI8DnWN8O8DuX+H0eTnxdeWgjb7uv3/vMd9lpWQYDPEep9Rrp5by+kOy+s7+/mfPhWXyPzFrqRVHHlzpFPgYTwTScg87NphjhmZdTgGMohwH1YexPupdx3b40mN5ij6tuMuHabKlweV60PGo0OdTB7ioM5WjEWW5PNHqVw1fq09ibcu33zqZpUQjzTjN/Ws1urHK5an9bWW0Ffj5JSiOv4HiaYEy6Fq9YnLa1cfRWuCku+wOHmXL2DOnUEmGOHyiHABagKh17Dqxv57rcj7k+3RpKfJ0b9CHBBKy/ivOhIU0yPH4xdqD3EV37HB1ZRBLignc6c8MZW2FY6p5ZSK7b0bNyMOM3CTiE7CHAJz1+2or7vV1Msj74by4IcoyKHOMygH4fhptsHFgEuQRXqx5fx7zYFWRX5ycNL2UqpUFV5512cDuNLvAS9ONawlaQ10jpSJsZ64S+d3iCvm3777XGntW9nx9fsfqh+JK5+Nq0Qi43WvTgCXMHqq5abma53g75Gqmen9fX/alz1CBtNmenfj7k6yvIxQ3Wiha5AN/r3K4fJtX55hVarvVTy8AB9OMV0GGdwf+AQ4IpU4f75LN27Tzt9HtwbKzynrNF2zXvHsvOWClwGAfZAN18dg1r9UnuthSFF6WeK1doS4HIIsCeqVrHbziLUUpdZornc6S5iDC5p8A3FEWCPVn9KO8RlTpVUeJ8u/xLsUAPR780UUjkE2LOUQ6x11jPN4n/l+WDdaqDznEOdO3YREOAAFOJUn4mrTA3p51KQNU/sM8g8/5bHPHAgeibWAND9O2mdtlF147yCm2/o0IeBXlyuAwDKfjDotBMWcJRHBQ5IlUUVa1Bv0O1squnkVSllvd5kAXQVBDiwfBAo5pyqFbo2od5+cVEQ4Ag0CKRnYrWedVfjlLqBlEfsrSDAEWnwJx8Eqsve+zQCrA+SOq/DoCDAkeWDQE+X63k23txKIzRUXz8IcE00Qv23f/wSta3Odim9q/+Zc6Pz3Ev19YNppJrpRtaXXrGinUMhp5zUvqfg+Uu2HvlCgBORB1nzqYtzDTc77ffoHC3CSGEAS4N5zPv6Q4ATo7lVfV253MoWXegMrKob6xWaFKax9PzNdJpfBDhRqlL7n6qy2mqFWeuY9QaDfttsfRCoXd1NYOS5rnPEBh0BNuB0mGVifOgk1Ncb2VJGbVLIdxnp12qqaHO7HXQHURH6ngZ5RVqdCLBBqqj62jCwiknbBJefEd5QCDCCUWgV3hRa+EFFgBEEbXMcBBjeabR55UWLUzYiIMDwRoHVK1iZKoqHAMMLqm49CDAqyxefID42MwCGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhhFgwDACDBhGgAHDCDBgGAEGDCPAgGEEGDCMAAOGEWDAMAIMGEaAAcMIMGAYAQYMI8CAYQQYMIwAA4YRYMAwAgwYRoABwwgwYBgBBgwjwIBhBBgwjAADhv0XZkN9IbEGbp4AAAAASUVORK5CYII=",R1=({isOpen:n,onClose:o})=>{const[i,s]=ae.useState(""),[l,c]=ae.useState(""),[f,p]=ae.useState(""),[m,g]=ae.useState(null),[v,x]=ae.useState(null),[S,N]=ae.useState(""),{fetchCsrfToken:P}=pt(),T=q=>{var M;const R=(M=q.target.files)==null?void 0:M[0];if(R){g(R);const k=new FileReader;k.onloadend=()=>{x(k.result)},k.readAsDataURL(R)}},D=async q=>{q.preventDefault(),N("");try{const R=new FormData;R.append("userCreateRequest",new Blob([JSON.stringify({email:i,username:l,password:f})],{type:"application/json"})),m&&R.append("profile",m),await u1(R),await P(),o()}catch{N("회원가입에 실패했습니다.")}};return n?y.jsx(ty,{children:y.jsxs(ny,{children:[y.jsx("h2",{children:"계정 만들기"}),y.jsxs("form",{onSubmit:D,children:[y.jsxs(zs,{children:[y.jsxs(Hs,{children:["이메일 ",y.jsx(ku,{children:"*"})]}),y.jsx(xi,{type:"email",value:i,onChange:q=>s(q.target.value),required:!0})]}),y.jsxs(zs,{children:[y.jsxs(Hs,{children:["사용자명 ",y.jsx(ku,{children:"*"})]}),y.jsx(xi,{type:"text",value:l,onChange:q=>c(q.target.value),required:!0})]}),y.jsxs(zs,{children:[y.jsxs(Hs,{children:["비밀번호 ",y.jsx(ku,{children:"*"})]}),y.jsx(xi,{type:"password",value:f,onChange:q=>p(q.target.value),required:!0})]}),y.jsxs(zs,{children:[y.jsx(Hs,{children:"프로필 이미지"}),y.jsxs(S1,{children:[y.jsx(E1,{src:v||Jt,alt:"profile"}),y.jsx(C1,{type:"file",accept:"image/*",onChange:T,id:"profile-image"}),y.jsx(k1,{htmlFor:"profile-image",children:"이미지 변경"})]})]}),S&&y.jsx(oy,{children:S}),y.jsx(ry,{type:"submit",children:"계속하기"}),y.jsx(b1,{onClick:o,children:"이미 계정이 있으신가요?"})]})]})}):null},T1=({isOpen:n,onClose:o})=>{const[i,s]=ae.useState(""),[l,c]=ae.useState(""),[f,p]=ae.useState(""),[m,g]=ae.useState(!1),[v,x]=ae.useState(!1),{login:S}=pt(),{fetchUsers:N}=$r(),P=async()=>{var T;try{await S(i,l),await N(),p(""),o()}catch(D){console.error("로그인 에러:",D),((T=D.response)==null?void 0:T.status)===401?p("아이디 또는 비밀번호가 올바르지 않습니다."):p("로그인에 실패했습니다.")}};return n?y.jsxs(y.Fragment,{children:[y.jsx(ty,{children:y.jsxs(ny,{children:[y.jsx("h2",{children:"돌아오신 것을 환영해요!"}),y.jsxs("form",{onSubmit:T=>{T.preventDefault(),P()},children:[y.jsx(xi,{type:"text",placeholder:"사용자 이름",value:i,onChange:T=>s(T.target.value)}),y.jsx(xi,{type:"password",placeholder:"비밀번호",value:l,onChange:T=>c(T.target.value)}),y.jsxs(A1,{children:[y.jsx(v1,{id:"rememberMe",checked:v,onChange:T=>x(T.target.checked)}),y.jsx(j1,{htmlFor:"rememberMe",children:"로그인 유지"})]}),f&&y.jsx(oy,{children:f}),y.jsx(ry,{type:"submit",children:"로그인"})]}),y.jsxs(x1,{children:["계정이 필요한가요? ",y.jsx(w1,{onClick:()=>g(!0),children:"가입하기"})]})]})}),y.jsx(R1,{isOpen:m,onClose:()=>g(!1)})]}):null},A1=O.div` + display: flex; + align-items: center; + margin: 10px 0; + justify-content: flex-start; +`,j1=O.label` + margin-left: 8px; + font-size: 14px; + color: #666; + cursor: pointer; + text-align: left; +`,O1=async n=>(await Et.get(`/channels?userId=${n}`)).data,N1=async n=>(await Et.post("/channels/public",n)).data,I1=async n=>{const o={participantIds:n};return(await Et.post("/channels/private",o)).data},P1=async n=>(await Et.get("/readStatuses",{params:{userId:n}})).data,bh=async(n,{newLastReadAt:o,newNotificationEnabled:i})=>{const s={newLastReadAt:o,newNotificationEnabled:i};return(await Et.patch(`/readStatuses/${n}`,s)).data},L1=async(n,o,i)=>{const s={userId:n,channelId:o,lastReadAt:i};return(await Et.post("/readStatuses",s)).data},Lr=Un((n,o)=>({readStatuses:{},fetchReadStatuses:async()=>{try{const{currentUser:i}=pt.getState();if(!i)return;const l=(await P1(i.id)).reduce((c,f)=>(c[f.channelId]={id:f.id,lastReadAt:f.lastReadAt,notificationEnabled:f.notificationEnabled},c),{});n({readStatuses:l})}catch(i){console.error("읽음 상태 조회 실패:",i)}},updateReadStatus:async i=>{try{const{currentUser:s}=pt.getState();if(!s)return;const l=o().readStatuses[i];let c;l?c=await bh(l.id,{newLastReadAt:new Date().toISOString(),newNotificationEnabled:null}):c=await L1(s.id,i,new Date().toISOString()),n(f=>({readStatuses:{...f.readStatuses,[i]:{id:c.id,lastReadAt:c.lastReadAt,notificationEnabled:c.notificationEnabled}}}))}catch(s){console.error("읽음 상태 업데이트 실패:",s)}},updateNotificationEnabled:async(i,s)=>{try{const{currentUser:l}=pt.getState();if(!l)return;const c=o().readStatuses[i];let f;if(c)f=await bh(c.id,{newLastReadAt:null,newNotificationEnabled:s});else return;n(p=>({readStatuses:{...p.readStatuses,[i]:{id:f.id,lastReadAt:f.lastReadAt,notificationEnabled:f.notificationEnabled}}}))}catch(l){console.error("알림 상태 업데이트 실패:",l)}},hasUnreadMessages:(i,s)=>{const l=o().readStatuses[i],c=l==null?void 0:l.lastReadAt;return!c||new Date(s)>new Date(c)}})),So=Un((n,o)=>({activeChannel:null,channels:[],loading:!1,error:null,setActiveChannel:i=>{n({activeChannel:o().channels.find(s=>s.id===i)||null})},fetchChannels:async i=>{n({loading:!0,error:null});try{const s=await O1(i);n(c=>{const f=new Set(c.channels.map(v=>v.id)),p=s.filter(v=>!f.has(v.id));return{channels:[...c.channels.filter(v=>s.some(x=>x.id===v.id)),...p],loading:!1}});const{fetchReadStatuses:l}=Lr.getState();return l(),s}catch(s){return n({error:s,loading:!1}),[]}},createPublicChannel:async i=>{try{const s=await N1(i);return n(l=>l.channels.some(f=>f.id===s.id)?l:{channels:[...l.channels,{...s,participantIds:[],lastMessageAt:new Date().toISOString()}]}),s}catch(s){throw console.error("공개 채널 생성 실패:",s),s}},createPrivateChannel:async i=>{try{const s=await I1(i);return n(l=>l.channels.some(f=>f.id===s.id)?l:{channels:[...l.channels,{...s,participantIds:i,lastMessageAt:new Date().toISOString()}]}),s}catch(s){throw console.error("비공개 채널 생성 실패:",s),s}}})),D1=async n=>(await Et.get(`/binaryContents/${n}`)).data,M1=n=>`${m1()}/binaryContents/${n}/download`,hr=Un((n,o)=>({binaryContents:{},fetchBinaryContent:async i=>{if(o().binaryContents[i])return o().binaryContents[i];try{const s=await D1(i),{contentType:l,fileName:c,size:f,uploadStatus:p}=s,g={url:M1(i),contentType:l,fileName:c,size:f,uploadStatus:p};return n(v=>({binaryContents:{...v.binaryContents,[i]:g}})),g}catch(s){return console.error("첨부파일 정보 조회 실패:",s),null}},updateBinaryContentStatus:(i,s)=>{const{binaryContents:l}=o();l[i]&&n(c=>({binaryContents:{...c.binaryContents,[i]:{...c.binaryContents[i],uploadStatus:s}}}))}})),bi=O.div` + position: absolute; + bottom: -3px; + right: -3px; + width: 16px; + height: 16px; + border-radius: 50%; + background: ${n=>n.$online?te.colors.status.online:te.colors.status.offline}; + border: 4px solid ${n=>n.$background||te.colors.background.secondary}; +`;O.div` + width: 8px; + height: 8px; + border-radius: 50%; + margin-right: 8px; + background: ${n=>te.colors.status[n.status||"offline"]||te.colors.status.offline}; +`;const _o=O.div` + position: relative; + width: ${n=>n.$size||"32px"}; + height: ${n=>n.$size||"32px"}; + flex-shrink: 0; + margin: ${n=>n.$margin||"0"}; +`,Fn=O.img` + width: 100%; + height: 100%; + border-radius: 50%; + object-fit: cover; + border: ${n=>n.$border||"none"}; +`;function B1({isOpen:n,onClose:o,user:i}){var A,b;const[s,l]=ae.useState(i.username),[c,f]=ae.useState(i.email),[p,m]=ae.useState(""),[g,v]=ae.useState(null),[x,S]=ae.useState(""),[N,P]=ae.useState(null),{binaryContents:T,fetchBinaryContent:D}=hr(),{logout:q,refreshToken:R}=pt();ae.useEffect(()=>{var I;(I=i.profile)!=null&&I.id&&!T[i.profile.id]&&D(i.profile.id)},[i.profile,T,D]);const M=()=>{l(i.username),f(i.email),m(""),v(null),P(null),S(""),o()},k=I=>{var K;const H=(K=I.target.files)==null?void 0:K[0];if(H){v(H);const he=new FileReader;he.onloadend=()=>{P(he.result)},he.readAsDataURL(H)}},E=async I=>{I.preventDefault(),S("");try{const H=new FormData,K={};s!==i.username&&(K.newUsername=s),c!==i.email&&(K.newEmail=c),p&&(K.newPassword=p),(Object.keys(K).length>0||g)&&(H.append("userUpdateRequest",new Blob([JSON.stringify(K)],{type:"application/json"})),g&&H.append("profile",g),await g1(i.id,H),await R()),o()}catch{S("사용자 정보 수정에 실패했습니다.")}};return n?y.jsx($1,{children:y.jsxs(F1,{children:[y.jsx("h2",{children:"프로필 수정"}),y.jsxs("form",{onSubmit:E,children:[y.jsxs(qs,{children:[y.jsx(Ws,{children:"프로필 이미지"}),y.jsxs(z1,{children:[y.jsx(H1,{src:N||((A=i.profile)!=null&&A.id?(b=T[i.profile.id])==null?void 0:b.url:void 0)||Jt,alt:"profile"}),y.jsx(q1,{type:"file",accept:"image/*",onChange:k,id:"profile-image"}),y.jsx(W1,{htmlFor:"profile-image",children:"이미지 변경"})]})]}),y.jsxs(qs,{children:[y.jsxs(Ws,{children:["사용자명 ",y.jsx(Th,{children:"*"})]}),y.jsx(_u,{type:"text",value:s,onChange:I=>l(I.target.value),required:!0})]}),y.jsxs(qs,{children:[y.jsxs(Ws,{children:["이메일 ",y.jsx(Th,{children:"*"})]}),y.jsx(_u,{type:"email",value:c,onChange:I=>f(I.target.value),required:!0})]}),y.jsxs(qs,{children:[y.jsx(Ws,{children:"새 비밀번호"}),y.jsx(_u,{type:"password",placeholder:"변경하지 않으려면 비워두세요",value:p,onChange:I=>m(I.target.value)})]}),x&&y.jsx(U1,{children:x}),y.jsxs(V1,{children:[y.jsx(Rh,{type:"button",onClick:M,$secondary:!0,children:"취소"}),y.jsx(Rh,{type:"submit",children:"저장"})]})]}),y.jsx(G1,{onClick:q,children:"로그아웃"})]})}):null}const $1=O.div` + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +`,F1=O.div` + background: ${({theme:n})=>n.colors.background.secondary}; + padding: 32px; + border-radius: 5px; + width: 100%; + max-width: 480px; + + h2 { + color: ${({theme:n})=>n.colors.text.primary}; + margin-bottom: 24px; + text-align: center; + font-size: 24px; + } +`,_u=O.input` + width: 100%; + padding: 10px; + margin-bottom: 10px; + border: none; + border-radius: 4px; + background: ${({theme:n})=>n.colors.background.input}; + color: ${({theme:n})=>n.colors.text.primary}; + + &::placeholder { + color: ${({theme:n})=>n.colors.text.muted}; + } + + &:focus { + outline: none; + box-shadow: 0 0 0 2px ${({theme:n})=>n.colors.brand.primary}; + } +`,Rh=O.button` + width: 100%; + padding: 10px; + border: none; + border-radius: 4px; + background: ${({$secondary:n,theme:o})=>n?"transparent":o.colors.brand.primary}; + color: ${({theme:n})=>n.colors.text.primary}; + cursor: pointer; + font-weight: 500; + + &:hover { + background: ${({$secondary:n,theme:o})=>n?o.colors.background.hover:o.colors.brand.hover}; + } +`,U1=O.div` + color: ${({theme:n})=>n.colors.status.error}; + font-size: 14px; + margin-bottom: 10px; +`,z1=O.div` + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +`,H1=O.img` + width: 100px; + height: 100px; + border-radius: 50%; + margin-bottom: 10px; + object-fit: cover; +`,q1=O.input` + display: none; +`,W1=O.label` + color: ${({theme:n})=>n.colors.brand.primary}; + cursor: pointer; + font-size: 14px; + + &:hover { + text-decoration: underline; + } +`,V1=O.div` + display: flex; + gap: 10px; + margin-top: 20px; +`,G1=O.button` + width: 100%; + padding: 10px; + margin-top: 16px; + border: none; + border-radius: 4px; + background: transparent; + color: ${({theme:n})=>n.colors.status.error}; + cursor: pointer; + font-weight: 500; + + &:hover { + background: ${({theme:n})=>n.colors.status.error}20; + } +`,qs=O.div` + margin-bottom: 20px; +`,Ws=O.label` + display: block; + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 12px; + font-weight: 700; + margin-bottom: 8px; +`,Th=O.span` + color: ${({theme:n})=>n.colors.status.error}; +`,X1=O.div` + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.5rem 0.75rem; + background-color: ${({theme:n})=>n.colors.background.tertiary}; + width: 100%; + height: 52px; +`,Q1=O(_o)``;O(Fn)``;const Y1=O.div` + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + justify-content: center; +`,K1=O.div` + font-weight: 500; + color: ${({theme:n})=>n.colors.text.primary}; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 0.875rem; + line-height: 1.2; +`,J1=O.div` + font-size: 0.75rem; + color: ${({theme:n})=>n.colors.text.secondary}; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + line-height: 1.2; +`,Z1=O.div` + display: flex; + align-items: center; + flex-shrink: 0; +`,eS=O.button` + background: none; + border: none; + padding: 0.25rem; + cursor: pointer; + color: ${({theme:n})=>n.colors.text.secondary}; + font-size: 18px; + + &:hover { + color: ${({theme:n})=>n.colors.text.primary}; + } +`;function tS({user:n}){var c,f;const[o,i]=ae.useState(!1),{binaryContents:s,fetchBinaryContent:l}=hr();return ae.useEffect(()=>{var p;(p=n.profile)!=null&&p.id&&!s[n.profile.id]&&l(n.profile.id)},[n.profile,s,l]),y.jsxs(y.Fragment,{children:[y.jsxs(X1,{children:[y.jsxs(Q1,{children:[y.jsx(Fn,{src:(c=n.profile)!=null&&c.id?(f=s[n.profile.id])==null?void 0:f.url:Jt,alt:n.username}),y.jsx(bi,{$online:!0})]}),y.jsxs(Y1,{children:[y.jsx(K1,{children:n.username}),y.jsx(J1,{children:"온라인"})]}),y.jsx(Z1,{children:y.jsx(eS,{onClick:()=>i(!0),children:"⚙️"})})]}),y.jsx(B1,{isOpen:o,onClose:()=>i(!1),user:n})]})}const nS=O.div` + width: 240px; + background: ${te.colors.background.secondary}; + border-right: 1px solid ${te.colors.border.primary}; + display: flex; + flex-direction: column; +`,rS=O.div` + flex: 1; + overflow-y: auto; +`,oS=O.div` + padding: 16px; + font-size: 16px; + font-weight: bold; + color: ${te.colors.text.primary}; +`,iy=O.div` + height: 34px; + padding: 0 8px; + margin: 1px 8px; + display: flex; + align-items: center; + gap: 6px; + color: ${n=>n.$hasUnread?n.theme.colors.text.primary:n.theme.colors.text.muted}; + font-weight: ${n=>n.$hasUnread?"600":"normal"}; + cursor: pointer; + background: ${n=>n.$isActive?n.theme.colors.background.hover:"transparent"}; + border-radius: 4px; + + &:hover { + background: ${n=>n.theme.colors.background.hover}; + color: ${n=>n.theme.colors.text.primary}; + } +`,Ah=O.div` + margin-bottom: 8px; +`,zc=O.div` + padding: 8px 16px; + display: flex; + align-items: center; + color: ${te.colors.text.muted}; + text-transform: uppercase; + font-size: 12px; + font-weight: 600; + cursor: pointer; + user-select: none; + + & > span:nth-child(2) { + flex: 1; + margin-right: auto; + } + + &:hover { + color: ${te.colors.text.primary}; + } +`,jh=O.span` + margin-right: 4px; + font-size: 10px; + transition: transform 0.2s; + transform: rotate(${n=>n.$folded?"-90deg":"0deg"}); +`,Oh=O.div` + display: ${n=>n.$folded?"none":"block"}; +`,Nh=O(iy)` + height: ${n=>n.hasSubtext?"42px":"34px"}; +`,iS=O(_o)` + width: 32px; + height: 32px; + margin: 0 8px; +`,Ih=O.div` + font-size: 16px; + line-height: 18px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: ${n=>n.$isActive||n.$hasUnread?n.theme.colors.text.primary:n.theme.colors.text.muted}; + font-weight: ${n=>n.$hasUnread?"600":"normal"}; +`;O(bi)` + border-color: ${te.colors.background.primary}; +`;const Ph=O.button` + background: none; + border: none; + color: ${te.colors.text.muted}; + font-size: 18px; + padding: 0; + cursor: pointer; + width: 16px; + height: 16px; + display: flex; + align-items: center; + justify-content: center; + opacity: 0; + transition: opacity 0.2s, color 0.2s; + + ${zc}:hover & { + opacity: 1; + } + + &:hover { + color: ${te.colors.text.primary}; + } +`,sS=O(_o)` + width: 40px; + height: 24px; + margin: 0 8px; +`,aS=O.div` + font-size: 12px; + line-height: 13px; + color: ${te.colors.text.muted}; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`,Lh=O.div` + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + justify-content: center; + gap: 2px; +`,lS=O.div` + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.85); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +`,uS=O.div` + background: ${te.colors.background.primary}; + border-radius: 4px; + width: 440px; + max-width: 90%; +`,cS=O.div` + padding: 16px; + display: flex; + justify-content: space-between; + align-items: center; +`,dS=O.h2` + color: ${te.colors.text.primary}; + font-size: 20px; + font-weight: 600; + margin: 0; +`,fS=O.div` + padding: 0 16px 16px; +`,pS=O.form` + display: flex; + flex-direction: column; + gap: 16px; +`,bu=O.div` + display: flex; + flex-direction: column; + gap: 8px; +`,Ru=O.label` + color: ${te.colors.text.primary}; + font-size: 12px; + font-weight: 600; + text-transform: uppercase; +`,hS=O.p` + color: ${te.colors.text.muted}; + font-size: 14px; + margin: -4px 0 0; +`,Hc=O.input` + padding: 10px; + background: ${te.colors.background.tertiary}; + border: none; + border-radius: 3px; + color: ${te.colors.text.primary}; + font-size: 16px; + + &:focus { + outline: none; + box-shadow: 0 0 0 2px ${te.colors.status.online}; + } + + &::placeholder { + color: ${te.colors.text.muted}; + } +`,mS=O.button` + margin-top: 8px; + padding: 12px; + background: ${te.colors.status.online}; + color: white; + border: none; + border-radius: 3px; + font-size: 14px; + font-weight: 500; + cursor: pointer; + transition: background 0.2s; + + &:hover { + background: #3ca374; + } +`,gS=O.button` + background: none; + border: none; + color: ${te.colors.text.muted}; + font-size: 24px; + cursor: pointer; + padding: 4px; + line-height: 1; + + &:hover { + color: ${te.colors.text.primary}; + } +`,yS=O(Hc)` + margin-bottom: 8px; +`,vS=O.div` + max-height: 300px; + overflow-y: auto; + background: ${te.colors.background.tertiary}; + border-radius: 4px; +`,xS=O.div` + display: flex; + align-items: center; + padding: 8px 12px; + cursor: pointer; + transition: background 0.2s; + + &:hover { + background: ${te.colors.background.hover}; + } + + & + & { + border-top: 1px solid ${te.colors.border.primary}; + } +`,wS=O.input` + margin-right: 12px; + width: 16px; + height: 16px; + cursor: pointer; +`,Dh=O.img` + width: 32px; + height: 32px; + border-radius: 50%; + margin-right: 12px; +`,SS=O.div` + flex: 1; + min-width: 0; +`,ES=O.div` + color: ${te.colors.text.primary}; + font-size: 14px; + font-weight: 500; +`,CS=O.div` + color: ${te.colors.text.muted}; + font-size: 12px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`,kS=O.div` + padding: 16px; + text-align: center; + color: ${te.colors.text.muted}; +`,_S=O.div` + color: ${te.colors.status.error}; + font-size: 14px; + padding: 8px 0; + text-align: center; + background-color: ${({theme:n})=>n.colors.background.tertiary}; + border-radius: 4px; + margin-bottom: 8px; +`;function bS(){return y.jsx(oS,{children:"채널 목록"})}function Mh({channel:n,isActive:o,onClick:i,hasUnread:s}){var g;const{currentUser:l}=pt(),{binaryContents:c}=hr(),{isOnline:f}=$r();if(n.type==="PUBLIC")return y.jsxs(iy,{$isActive:o,onClick:i,$hasUnread:s,children:["# ",n.name]});const p=n.participants;if(p.length>2){const v=p.filter(x=>x.id!==(l==null?void 0:l.id)).map(x=>x.username).join(", ");return y.jsxs(Nh,{$isActive:o,onClick:i,children:[y.jsx(sS,{children:p.filter(x=>x.id!==(l==null?void 0:l.id)).slice(0,2).map((x,S)=>{var N;return y.jsx(Fn,{src:x.profile?(N=c[x.profile.id])==null?void 0:N.url:Jt,style:{position:"absolute",left:S*16,zIndex:2-S,width:"24px",height:"24px",border:"2px solid #2a2a2a"}},x.id)})}),y.jsxs(Lh,{children:[y.jsx(Ih,{$hasUnread:s,children:v}),y.jsxs(aS,{children:["멤버 ",p.length,"명"]})]})]})}const m=p.filter(v=>v.id!==(l==null?void 0:l.id))[0];return m&&y.jsxs(Nh,{$isActive:o,onClick:i,children:[y.jsxs(iS,{children:[y.jsx(Fn,{src:m.profile?(g=c[m.profile.id])==null?void 0:g.url:Jt,alt:"profile"}),y.jsx(bi,{$online:f(m.id)})]}),y.jsx(Lh,{children:y.jsx(Ih,{$hasUnread:s,children:m.username})})]})}function RS({isOpen:n,type:o,onClose:i,onCreateSuccess:s}){const[l,c]=ae.useState({name:"",description:""}),[f,p]=ae.useState(""),[m,g]=ae.useState([]),[v,x]=ae.useState(""),S=$r(E=>E.users),N=hr(E=>E.binaryContents),{currentUser:P}=pt(),T=ae.useMemo(()=>S.filter(E=>E.id!==(P==null?void 0:P.id)).filter(E=>E.username.toLowerCase().includes(f.toLowerCase())||E.email.toLowerCase().includes(f.toLowerCase())),[f,S,P]),D=So(E=>E.createPublicChannel),q=So(E=>E.createPrivateChannel),R=E=>{const{name:A,value:b}=E.target;c(I=>({...I,[A]:b}))},M=E=>{g(A=>A.includes(E)?A.filter(b=>b!==E):[...A,E])},k=async E=>{var A,b;E.preventDefault(),x("");try{let I;if(o==="PUBLIC"){if(!l.name.trim()){x("채널 이름을 입력해주세요.");return}const H={name:l.name,description:l.description};I=await D(H)}else{if(m.length===0){x("대화 상대를 선택해주세요.");return}const H=(P==null?void 0:P.id)&&[...m,P.id]||m;I=await q(H)}s(I)}catch(I){console.error("채널 생성 실패:",I),x(((b=(A=I.response)==null?void 0:A.data)==null?void 0:b.message)||"채널 생성에 실패했습니다. 다시 시도해주세요.")}};return n?y.jsx(lS,{onClick:i,children:y.jsxs(uS,{onClick:E=>E.stopPropagation(),children:[y.jsxs(cS,{children:[y.jsx(dS,{children:o==="PUBLIC"?"채널 만들기":"개인 메시지 시작하기"}),y.jsx(gS,{onClick:i,children:"×"})]}),y.jsx(fS,{children:y.jsxs(pS,{onSubmit:k,children:[v&&y.jsx(_S,{children:v}),o==="PUBLIC"?y.jsxs(y.Fragment,{children:[y.jsxs(bu,{children:[y.jsx(Ru,{children:"채널 이름"}),y.jsx(Hc,{name:"name",value:l.name,onChange:R,placeholder:"새로운-채널",required:!0})]}),y.jsxs(bu,{children:[y.jsx(Ru,{children:"채널 설명"}),y.jsx(hS,{children:"이 채널의 주제를 설명해주세요."}),y.jsx(Hc,{name:"description",value:l.description,onChange:R,placeholder:"채널 설명을 입력하세요"})]})]}):y.jsxs(bu,{children:[y.jsx(Ru,{children:"사용자 검색"}),y.jsx(yS,{type:"text",value:f,onChange:E=>p(E.target.value),placeholder:"사용자명 또는 이메일로 검색"}),y.jsx(vS,{children:T.length>0?T.map(E=>y.jsxs(xS,{children:[y.jsx(wS,{type:"checkbox",checked:m.includes(E.id),onChange:()=>M(E.id)}),E.profile?y.jsx(Dh,{src:N[E.profile.id].url}):y.jsx(Dh,{src:Jt}),y.jsxs(SS,{children:[y.jsx(ES,{children:E.username}),y.jsx(CS,{children:E.email})]})]},E.id)):y.jsx(kS,{children:"검색 결과가 없습니다."})})]}),y.jsx(mS,{type:"submit",children:o==="PUBLIC"?"채널 만들기":"대화 시작하기"})]})})]})}):null}var gi={exports:{}};/** @license + * eventsource.js + * Available under MIT License (MIT) + * https://github.com/Yaffle/EventSource/ + */var TS=gi.exports,Bh;function AS(){return Bh||(Bh=1,function(n,o){(function(i){var s=i.setTimeout,l=i.clearTimeout,c=i.XMLHttpRequest,f=i.XDomainRequest,p=i.ActiveXObject,m=i.EventSource,g=i.document,v=i.Promise,x=i.fetch,S=i.Response,N=i.TextDecoder,P=i.TextEncoder,T=i.AbortController;if(typeof window<"u"&&typeof g<"u"&&!("readyState"in g)&&g.body==null&&(g.readyState="loading",window.addEventListener("load",function(U){g.readyState="complete"},!1)),c==null&&p!=null&&(c=function(){return new p("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(U){function ee(){}return ee.prototype=U,new ee}),Date.now||(Date.now=function(){return new Date().getTime()}),T==null){var D=x;x=function(U,ee){var le=ee.signal;return D(U,{headers:ee.headers,credentials:ee.credentials,cache:ee.cache}).then(function(Z){var me=Z.body.getReader();return le._reader=me,le._aborted&&le._reader.cancel(),{status:Z.status,statusText:Z.statusText,headers:Z.headers,body:{getReader:function(){return me}}}})},T=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function q(){this.bitsNeeded=0,this.codePoint=0}q.prototype.decode=function(U){function ee(Pe,Be,ge){if(ge===1)return Pe>=128>>Be&&Pe<=2048>>Be&&Pe<=57344>>Be&&Pe<=65536>>Be&&Pe<>6>15?3:Be>31?2:1;if(Pe===6*2)return Be>15?3:2;if(Pe===6*3)return 3;throw new Error}for(var Z=65533,me="",de=this.bitsNeeded,Se=this.codePoint,He=0;He191||!ee(Se<<6|Ae&63,de-6,le(de,Se)))&&(de=0,Se=Z,me+=String.fromCharCode(Se)),de===0?(Ae>=0&&Ae<=127?(de=0,Se=Ae):Ae>=192&&Ae<=223?(de=6*1,Se=Ae&31):Ae>=224&&Ae<=239?(de=6*2,Se=Ae&15):Ae>=240&&Ae<=247?(de=6*3,Se=Ae&7):(de=0,Se=Z),de!==0&&!ee(Se,de,le(de,Se))&&(de=0,Se=Z)):(de-=6,Se=Se<<6|Ae&63),de===0&&(Se<=65535?me+=String.fromCharCode(Se):(me+=String.fromCharCode(55296+(Se-65535-1>>10)),me+=String.fromCharCode(56320+(Se-65535-1&1023))))}return this.bitsNeeded=de,this.codePoint=Se,me};var R=function(){try{return new N().decode(new P().encode("test"),{stream:!0})==="test"}catch(U){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+U)}return!1};(N==null||P==null||!R())&&(N=q);var M=function(){};function k(U){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=M,this.onload=M,this.onerror=M,this.onreadystatechange=M,this._contentType="",this._xhr=U,this._sendTimeout=0,this._abort=M}k.prototype.open=function(U,ee){this._abort(!0);var le=this,Z=this._xhr,me=1,de=0;this._abort=function(ge){le._sendTimeout!==0&&(l(le._sendTimeout),le._sendTimeout=0),(me===1||me===2||me===3)&&(me=4,Z.onload=M,Z.onerror=M,Z.onabort=M,Z.onprogress=M,Z.onreadystatechange=M,Z.abort(),de!==0&&(l(de),de=0),ge||(le.readyState=4,le.onabort(null),le.onreadystatechange())),me=0};var Se=function(){if(me===1){var ge=0,ze="",Zt=void 0;if("contentType"in Z)ge=200,ze="OK",Zt=Z.contentType;else try{ge=Z.status,ze=Z.statusText,Zt=Z.getResponseHeader("Content-Type")}catch{ge=0,ze="",Zt=void 0}ge!==0&&(me=2,le.readyState=2,le.status=ge,le.statusText=ze,le._contentType=Zt,le.onreadystatechange())}},He=function(){if(Se(),me===2||me===3){me=3;var ge="";try{ge=Z.responseText}catch{}le.readyState=3,le.responseText=ge,le.onprogress()}},Ae=function(ge,ze){if((ze==null||ze.preventDefault==null)&&(ze={preventDefault:M}),He(),me===1||me===2||me===3){if(me=4,de!==0&&(l(de),de=0),le.readyState=4,ge==="load")le.onload(ze);else if(ge==="error")le.onerror(ze);else if(ge==="abort")le.onabort(ze);else throw new TypeError;le.onreadystatechange()}},Pe=function(ge){Z!=null&&(Z.readyState===4?(!("onload"in Z)||!("onerror"in Z)||!("onabort"in Z))&&Ae(Z.responseText===""?"error":"load",ge):Z.readyState===3?"onprogress"in Z||He():Z.readyState===2&&Se())},Be=function(){de=s(function(){Be()},500),Z.readyState===3&&He()};"onload"in Z&&(Z.onload=function(ge){Ae("load",ge)}),"onerror"in Z&&(Z.onerror=function(ge){Ae("error",ge)}),"onabort"in Z&&(Z.onabort=function(ge){Ae("abort",ge)}),"onprogress"in Z&&(Z.onprogress=He),"onreadystatechange"in Z&&(Z.onreadystatechange=function(ge){Pe(ge)}),("contentType"in Z||!("ontimeout"in c.prototype))&&(ee+=(ee.indexOf("?")===-1?"?":"&")+"padding=true"),Z.open(U,ee,!0),"readyState"in Z&&(de=s(function(){Be()},0))},k.prototype.abort=function(){this._abort(!1)},k.prototype.getResponseHeader=function(U){return this._contentType},k.prototype.setRequestHeader=function(U,ee){var le=this._xhr;"setRequestHeader"in le&&le.setRequestHeader(U,ee)},k.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},k.prototype.send=function(){if((!("ontimeout"in c.prototype)||!("sendAsBinary"in c.prototype)&&!("mozAnon"in c.prototype))&&g!=null&&g.readyState!=null&&g.readyState!=="complete"){var U=this;U._sendTimeout=s(function(){U._sendTimeout=0,U.send()},4);return}var ee=this._xhr;"withCredentials"in ee&&(ee.withCredentials=this.withCredentials);try{ee.send(void 0)}catch(le){throw le}};function E(U){return U.replace(/[A-Z]/g,function(ee){return String.fromCharCode(ee.charCodeAt(0)+32)})}function A(U){for(var ee=Object.create(null),le=U.split(`\r +`),Z=0;Z"u"?typeof window<"u"?window:typeof self<"u"?self:TS:globalThis)}(gi,gi.exports)),gi.exports}var $h=AS();const Ri=Un((n,o)=>({eventSource:null,isConnected:!1,isConnecting:!1,subscriptions:new Map,connect:async()=>{const{isConnected:i,isConnecting:s}=o();if(i||s)return;n({isConnecting:!0});const l=pt.getState().accessToken;if(!l){n({isConnected:!1,isConnecting:!1});return}try{const c=new $h.EventSourcePolyfill(`${ba.sseBaseUrl}`,{headers:{Authorization:`Bearer ${l}`},withCredentials:!0});c.onopen=()=>{n({eventSource:c,isConnected:!0,isConnecting:!1}),console.log("SSE 연결 성공")},c.onerror=f=>{console.error("SSE 에러:",{error:f,readyState:c.readyState}),n({isConnected:!1,isConnecting:c.readyState===$h.EventSourcePolyfill.CONNECTING,eventSource:null})}}catch(c){console.error("SSE 연결 시도 중 에러:",c),n({isConnected:!1,isConnecting:!1,eventSource:null})}},disconnect:()=>{const{eventSource:i,isConnected:s,subscriptions:l}=o();i&&s&&(l.forEach((c,f)=>{i.removeEventListener(f,c)}),i.close(),n({eventSource:null,isConnected:!1}))},subscribe:(i,s)=>{const{eventSource:l,isConnected:c,subscriptions:f}=o();if(f.has(i)){console.log("already subscribed",i);return}const p=m=>{try{const g=JSON.parse(m.data);s(g)}catch(g){console.error("SSE 메시지 파싱 에러:",g),s(m.data)}};l&&c&&(console.log("eventSource.subscribe",i),l.addEventListener(i,p),f.set(i,p),n({subscriptions:f}))},unsubscribe:i=>{const{eventSource:s,isConnected:l,subscriptions:c}=o();if(s&&l){const f=c.get(i);f&&s.removeEventListener(i,f)}c.delete(i),n({subscriptions:c})}}));function jS({currentUser:n,activeChannel:o,onChannelSelect:i}){var k,E;const[s,l]=ae.useState({PUBLIC:!1,PRIVATE:!1}),[c,f]=ae.useState({isOpen:!1,type:null}),p=So(A=>A.channels),m=So(A=>A.fetchChannels),g=Lr(A=>A.fetchReadStatuses),v=Lr(A=>A.updateReadStatus),x=Lr(A=>A.hasUnreadMessages);ae.useEffect(()=>{n&&(m(n.id),g())},[n,m,g]);const{subscribe:S,isConnected:N}=Ri();ae.useEffect(()=>{N&&S("channels.refresh",()=>{m(n.id)})},[S,N,m,n]);const P=A=>{l(b=>({...b,[A]:!b[A]}))},T=(A,b)=>{b.stopPropagation(),f({isOpen:!0,type:A})},D=()=>{f({isOpen:!1,type:null})},q=async A=>{try{const I=(await m(n.id)).find(H=>H.id===A.id);I&&i(I.id),D()}catch(b){console.error("채널 생성 실패:",b)}},R=A=>{i(A.id),v(A.id)},M=p.reduce((A,b)=>(A[b.type]||(A[b.type]=[]),A[b.type].push(b),A),{});return y.jsxs(nS,{children:[y.jsx(bS,{}),y.jsxs(rS,{children:[y.jsxs(Ah,{children:[y.jsxs(zc,{onClick:()=>P("PUBLIC"),children:[y.jsx(jh,{$folded:s.PUBLIC,children:"▼"}),y.jsx("span",{children:"일반 채널"}),y.jsx(Ph,{onClick:A=>T("PUBLIC",A),children:"+"})]}),y.jsx(Oh,{$folded:s.PUBLIC,children:(k=M.PUBLIC)==null?void 0:k.map(A=>y.jsx(Mh,{channel:A,isActive:(o==null?void 0:o.id)===A.id,hasUnread:x(A.id,A.lastMessageAt),onClick:()=>R(A)},A.id))})]}),y.jsxs(Ah,{children:[y.jsxs(zc,{onClick:()=>P("PRIVATE"),children:[y.jsx(jh,{$folded:s.PRIVATE,children:"▼"}),y.jsx("span",{children:"개인 메시지"}),y.jsx(Ph,{onClick:A=>T("PRIVATE",A),children:"+"})]}),y.jsx(Oh,{$folded:s.PRIVATE,children:(E=M.PRIVATE)==null?void 0:E.map(A=>y.jsx(Mh,{channel:A,isActive:(o==null?void 0:o.id)===A.id,hasUnread:x(A.id,A.lastMessageAt),onClick:()=>R(A)},A.id))})]})]}),y.jsx(OS,{children:y.jsx(tS,{user:n})}),y.jsx(RS,{isOpen:c.isOpen,type:c.type,onClose:D,onCreateSuccess:q})]})}const OS=O.div` + margin-top: auto; + border-top: 1px solid ${({theme:n})=>n.colors.border.primary}; + background-color: ${({theme:n})=>n.colors.background.tertiary}; +`,NS=O.div` + flex: 1; + display: flex; + flex-direction: column; + background: ${({theme:n})=>n.colors.background.primary}; +`,IS=O.div` + display: flex; + flex-direction: column; + height: 100%; + background: ${({theme:n})=>n.colors.background.primary}; +`,PS=O(IS)` + justify-content: center; + align-items: center; + flex: 1; + padding: 0 20px; +`,LS=O.div` + text-align: center; + max-width: 400px; + padding: 20px; + margin-bottom: 80px; +`,DS=O.div` + font-size: 48px; + margin-bottom: 16px; + animation: wave 2s infinite; + transform-origin: 70% 70%; + + @keyframes wave { + 0% { transform: rotate(0deg); } + 10% { transform: rotate(14deg); } + 20% { transform: rotate(-8deg); } + 30% { transform: rotate(14deg); } + 40% { transform: rotate(-4deg); } + 50% { transform: rotate(10deg); } + 60% { transform: rotate(0deg); } + 100% { transform: rotate(0deg); } + } +`,MS=O.h2` + color: ${({theme:n})=>n.colors.text.primary}; + font-size: 28px; + font-weight: 700; + margin-bottom: 16px; +`,BS=O.p` + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 16px; + line-height: 1.6; + word-break: keep-all; +`,Fh=O.div` + height: 48px; + padding: 0 16px; + background: ${te.colors.background.primary}; + border-bottom: 1px solid ${te.colors.border.primary}; + display: flex; + align-items: center; +`,Uh=O.div` + display: flex; + align-items: center; + gap: 8px; + height: 100%; +`;O.div` + display: flex; + align-items: center; + gap: 8px; + height: 100%; + margin-left: auto; + padding-right: 8px; +`;const $S=O.div` + display: flex; + align-items: center; + gap: 12px; + height: 100%; +`,FS=O(_o)` + width: 24px; + height: 24px; +`;O.img` + width: 24px; + height: 24px; + border-radius: 50%; +`;const US=O.div` + position: relative; + width: 40px; + height: 24px; + flex-shrink: 0; +`,zS=O(bi)` + border-color: ${te.colors.background.primary}; + bottom: -3px; + right: -3px; +`,HS=O.div` + font-size: 12px; + color: ${te.colors.text.muted}; + line-height: 13px; +`,zh=O.div` + font-weight: bold; + color: ${te.colors.text.primary}; + line-height: 20px; + font-size: 16px; +`,qS=O.div` + flex: 1; + display: flex; + flex-direction: column-reverse; + overflow-y: auto; +`,WS=O.div` + padding: 16px; + display: flex; + flex-direction: column; +`,VS=O.div` + margin-bottom: 16px; + display: flex; + align-items: flex-start; +`,GS=O(_o)` + margin-right: 16px; + width: 40px; + height: 40px; +`;O.img` + width: 40px; + height: 40px; + border-radius: 50%; +`;const XS=O.div` + display: flex; + align-items: center; + margin-bottom: 4px; +`,QS=O.span` + font-weight: bold; + color: ${te.colors.text.primary}; + margin-right: 8px; +`,YS=O.span` + font-size: 0.75rem; + color: ${te.colors.text.muted}; +`,KS=O.div` + color: ${te.colors.text.secondary}; + margin-top: 4px; +`,JS=O.form` + display: flex; + align-items: center; + gap: 8px; + padding: 16px; + background: ${({theme:n})=>n.colors.background.secondary}; +`,ZS=O.textarea` + flex: 1; + padding: 12px; + background: ${({theme:n})=>n.colors.background.tertiary}; + border: none; + border-radius: 4px; + color: ${({theme:n})=>n.colors.text.primary}; + font-size: 14px; + resize: none; + min-height: 44px; + max-height: 144px; + + &:focus { + outline: none; + } + + &::placeholder { + color: ${({theme:n})=>n.colors.text.muted}; + } +`,eE=O.button` + background: none; + border: none; + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 24px; + cursor: pointer; + padding: 4px 8px; + display: flex; + align-items: center; + justify-content: center; + + &:hover { + color: ${({theme:n})=>n.colors.text.primary}; + } +`;O.div` + flex: 1; + display: flex; + align-items: center; + justify-content: center; + color: ${te.colors.text.muted}; + font-size: 16px; + font-weight: 500; + padding: 20px; + text-align: center; +`;const Hh=O.div` + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 8px; + width: 100%; +`,tE=O.a` + display: block; + border-radius: 4px; + overflow: hidden; + max-width: 300px; + + img { + width: 100%; + height: auto; + display: block; + } +`,nE=O.a` + display: flex; + align-items: center; + gap: 12px; + padding: 12px; + background: ${({theme:n})=>n.colors.background.tertiary}; + border-radius: 8px; + text-decoration: none; + width: fit-content; + + &:hover { + background: ${({theme:n})=>n.colors.background.hover}; + } +`,rE=O.div` + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + font-size: 40px; + color: #0B93F6; +`,oE=O.div` + display: flex; + flex-direction: column; + gap: 2px; +`,iE=O.span` + font-size: 14px; + color: #0B93F6; + font-weight: 500; +`,sE=O.span` + font-size: 13px; + color: ${({theme:n})=>n.colors.text.muted}; +`,aE=O.div` + display: flex; + flex-wrap: wrap; + gap: 8px; + padding: 8px 0; +`,sy=O.div` + position: relative; + display: flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + background: ${({theme:n})=>n.colors.background.tertiary}; + border-radius: 4px; + max-width: 300px; +`,lE=O(sy)` + padding: 0; + overflow: hidden; + width: 200px; + max-width: 200px; + height: 120px; + + img { + width: 100%; + height: 100%; + object-fit: cover; + } +`,uE=O.div` + color: #0B93F6; + font-size: 20px; +`,cE=O.div` + font-size: 13px; + color: ${({theme:n})=>n.colors.text.primary}; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +`,qh=O.button` + position: absolute; + top: -6px; + right: -6px; + width: 20px; + height: 20px; + border-radius: 50%; + background: ${({theme:n})=>n.colors.background.secondary}; + border: none; + color: ${({theme:n})=>n.colors.text.muted}; + font-size: 16px; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + + &:hover { + color: ${({theme:n})=>n.colors.text.primary}; + } +`,Tu=O.div` + display: flex; + align-items: flex-end; + gap: 4px; + font-size: 12px; + color: ${n=>{switch(n.$status){case"WAITING":return"#666";case"SUCCESS":return"#28a745";case"FAILED":return"#dc3545"}}}; +`,dE=O.div` + width: 12px; + height: 12px; + border: 2px solid #f3f3f3; + border-top: 2px solid #0B93F6; + border-radius: 50%; + animation: spin 1s linear infinite; + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } +`,Wh=O.span` + font-size: 12px; +`,Vh=O.button` + background: none; + border: none; + padding: 8px; + cursor: pointer; + color: ${({theme:n,$enabled:o})=>o?n.colors.brand.primary:n.colors.text.muted}; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.2s ease; + + &:hover { + background: ${({theme:n})=>n.colors.background.hover}; + color: ${({theme:n})=>n.colors.brand.primary}; + } +`;function fE({channel:n}){var P;const{currentUser:o}=pt(),i=hr(T=>T.binaryContents),{readStatuses:s,updateNotificationEnabled:l}=Lr(),[c,f]=ae.useState(!1),{isOnline:p,users:m}=$r();ae.useEffect(()=>{s[n==null?void 0:n.id]&&f(s[n.id].notificationEnabled)},[s,n]);const g=ae.useCallback(async()=>{if(!o||!n)return;const T=!c;f(T);try{await l(n.id,T)}catch(D){console.error("알림 설정 업데이트 실패:",D),f(c)}},[o,n,c,l]);if(!n)return null;if(n.type==="PUBLIC")return y.jsxs(Fh,{children:[y.jsx(Uh,{children:y.jsxs(zh,{children:["# ",n.name]})}),y.jsx(Vh,{onClick:g,$enabled:c,children:y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),y.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]});const v=n.participants.map(T=>m.find(D=>D.id===T.id)).filter(Boolean),x=v.filter(T=>T.id!==(o==null?void 0:o.id)),S=v.length>2,N=v.filter(T=>T.id!==(o==null?void 0:o.id)).map(T=>T.username).join(", ");return y.jsxs(Fh,{children:[y.jsx(Uh,{children:y.jsxs($S,{children:[S?y.jsx(US,{children:x.slice(0,2).map((T,D)=>{var q;return y.jsx(Fn,{src:T.profile?(q=i[T.profile.id])==null?void 0:q.url:Jt,style:{position:"absolute",left:D*16,zIndex:2-D,width:"24px",height:"24px"}},T.id)})}):y.jsxs(FS,{children:[y.jsx(Fn,{src:x[0].profile?(P=i[x[0].profile.id])==null?void 0:P.url:Jt}),y.jsx(zS,{$online:p(x[0].id)})]}),y.jsxs("div",{children:[y.jsx(zh,{children:N}),S&&y.jsxs(HS,{children:["멤버 ",v.length,"명"]})]})]})}),y.jsx(Vh,{onClick:g,$enabled:c,children:y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),y.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]})}const pE=async(n,o,i)=>{var l;return(await Et.get("/messages",{params:{channelId:n,cursor:o,size:i.size,sort:(l=i.sort)==null?void 0:l.join(",")}})).data},hE=async(n,o)=>{const i=new FormData,s={content:n.content,channelId:n.channelId,authorId:n.authorId};return i.append("messageCreateRequest",new Blob([JSON.stringify(s)],{type:"application/json"})),o&&o.length>0&&o.forEach(c=>{i.append("attachments",c)}),(await Et.post("/messages",i,{headers:{"Content-Type":"multipart/form-data"}})).data},ay=20,Gh={size:ay,sort:["createdAt,desc"]},Xh={nextCursor:null,pageSize:ay,hasNext:!1},ly=Un((n,o)=>({messages:[],newMessages:[],pagination:Xh,loadMoreCount:0,fetchMessages:async(i,s,l=Gh)=>{try{const c=await pE(i,s,l),f=c.content;n(p=>{const m=new Set(p.messages.map(v=>v.id)),g=f.filter(v=>!m.has(v.id));return{messages:[...p.messages,...g],pagination:{nextCursor:c.nextCursor,pageSize:c.size,hasNext:c.hasNext}}})}catch(c){console.error("메시지 목록 조회 실패:",c)}},loadMoreMessages:async i=>{const{pagination:s,loadMoreCount:l}=o();s.hasNext&&(n({loadMoreCount:l+1}),await o().fetchMessages(i,s.nextCursor,{...Gh}))},addNewMessage:i=>{n(s=>({newMessages:[...s.newMessages,i]}))},createMessage:async(i,s)=>{try{const l=await hE(i,s),c=Lr.getState().updateReadStatus;return await c(i.channelId),n(f=>f.messages.some(m=>m.id===l.id)?f:{...f,lastMessageId:l.id}),l}catch(l){throw console.error("메시지 생성 실패:",l),l}},clear:()=>{n({messages:[],newMessages:[],pagination:Xh,loadMoreCount:0})}}));function mE(n,o){n.terminate=function(){const i=()=>{};this.onerror=i,this.onmessage=i,this.onopen=i;const s=new Date,l=Math.random().toString().substring(2,8),c=this.onclose;this.onclose=f=>{const p=new Date().getTime()-s.getTime();o(`Discarded socket (#${l}) closed after ${p}ms, with code/reason: ${f.code}/${f.reason}`)},this.close(),c==null||c.call(n,{code:4001,reason:`Quick discarding socket (#${l}) without waiting for the shutdown sequence.`,wasClean:!1})}}const yi={LF:` +`,NULL:"\0"};class fr{get body(){return!this._body&&this.isBinaryBody&&(this._body=new TextDecoder().decode(this._binaryBody)),this._body||""}get binaryBody(){return!this._binaryBody&&!this.isBinaryBody&&(this._binaryBody=new TextEncoder().encode(this._body)),this._binaryBody}constructor(o){const{command:i,headers:s,body:l,binaryBody:c,escapeHeaderValues:f,skipContentLengthHeader:p}=o;this.command=i,this.headers=Object.assign({},s||{}),c?(this._binaryBody=c,this.isBinaryBody=!0):(this._body=l||"",this.isBinaryBody=!1),this.escapeHeaderValues=f||!1,this.skipContentLengthHeader=p||!1}static fromRawFrame(o,i){const s={},l=c=>c.replace(/^\s+|\s+$/g,"");for(const c of o.headers.reverse()){c.indexOf(":");const f=l(c[0]);let p=l(c[1]);i&&o.command!=="CONNECT"&&o.command!=="CONNECTED"&&(p=fr.hdrValueUnEscape(p)),s[f]=p}return new fr({command:o.command,headers:s,binaryBody:o.binaryBody,escapeHeaderValues:i})}toString(){return this.serializeCmdAndHeaders()}serialize(){const o=this.serializeCmdAndHeaders();return this.isBinaryBody?fr.toUnit8Array(o,this._binaryBody).buffer:o+this._body+yi.NULL}serializeCmdAndHeaders(){const o=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const i of Object.keys(this.headers||{})){const s=this.headers[i];this.escapeHeaderValues&&this.command!=="CONNECT"&&this.command!=="CONNECTED"?o.push(`${i}:${fr.hdrValueEscape(`${s}`)}`):o.push(`${i}:${s}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&o.push(`content-length:${this.bodyLength()}`),o.join(yi.LF)+yi.LF+yi.LF}isBodyEmpty(){return this.bodyLength()===0}bodyLength(){const o=this.binaryBody;return o?o.length:0}static sizeOfUTF8(o){return o?new TextEncoder().encode(o).length:0}static toUnit8Array(o,i){const s=new TextEncoder().encode(o),l=new Uint8Array([0]),c=new Uint8Array(s.length+i.length+l.length);return c.set(s),c.set(i,s.length),c.set(l,s.length+i.length),c}static marshall(o){return new fr(o).serialize()}static hdrValueEscape(o){return o.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(o){return o.replace(/\\r/g,"\r").replace(/\\n/g,` +`).replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const Qh=0,Vs=10,Gs=13,gE=58;class yE{constructor(o,i){this.onFrame=o,this.onIncomingPing=i,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(o,i=!1){let s;if(typeof o=="string"?s=this._encoder.encode(o):s=new Uint8Array(o),i&&s[s.length-1]!==0){const l=new Uint8Array(s.length+1);l.set(s,0),l[s.length]=0,s=l}for(let l=0;li[0]==="content-length")[0];o?(this._bodyBytesRemaining=parseInt(o[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(o){if(o===Qh){this._retrievedBody();return}this._consumeByte(o)}_collectBodyFixedSize(o){if(this._bodyBytesRemaining--===0){this._retrievedBody();return}this._consumeByte(o)}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw();try{this.onFrame(this._results)}catch(o){console.log("Ignoring an exception thrown by a frame handler. Original exception: ",o)}this._initState()}_consumeByte(o){this._token.push(o)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const o=new Uint8Array(this._token);return this._token=[],o}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var pr;(function(n){n[n.CONNECTING=0]="CONNECTING",n[n.OPEN=1]="OPEN",n[n.CLOSING=2]="CLOSING",n[n.CLOSED=3]="CLOSED"})(pr||(pr={}));var wn;(function(n){n[n.ACTIVE=0]="ACTIVE",n[n.DEACTIVATING=1]="DEACTIVATING",n[n.INACTIVE=2]="INACTIVE"})(wn||(wn={}));var pa;(function(n){n[n.LINEAR=0]="LINEAR",n[n.EXPONENTIAL=1]="EXPONENTIAL"})(pa||(pa={}));var Ci;(function(n){n.Interval="interval",n.Worker="worker"})(Ci||(Ci={}));class vE{constructor(o,i=Ci.Interval,s){this._interval=o,this._strategy=i,this._debug=s,this._workerScript=` + var startTime = Date.now(); + setInterval(function() { + self.postMessage(Date.now() - startTime); + }, ${this._interval}); + `}start(o){this.stop(),this.shouldUseWorker()?this.runWorker(o):this.runInterval(o)}stop(){this.disposeWorker(),this.disposeInterval()}shouldUseWorker(){return typeof Worker<"u"&&this._strategy===Ci.Worker}runWorker(o){this._debug("Using runWorker for outgoing pings"),this._worker||(this._worker=new Worker(URL.createObjectURL(new Blob([this._workerScript],{type:"text/javascript"}))),this._worker.onmessage=i=>o(i.data))}runInterval(o){if(this._debug("Using runInterval for outgoing pings"),!this._timer){const i=Date.now();this._timer=setInterval(()=>{o(Date.now()-i)},this._interval)}}disposeWorker(){this._worker&&(this._worker.terminate(),delete this._worker,this._debug("Outgoing ping disposeWorker"))}disposeInterval(){this._timer&&(clearInterval(this._timer),delete this._timer,this._debug("Outgoing ping disposeInterval"))}}class It{constructor(o){this.versions=o}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(o=>`v${o.replace(".","")}.stomp`)}}It.V1_0="1.0";It.V1_1="1.1";It.V1_2="1.2";It.default=new It([It.V1_2,It.V1_1,It.V1_0]);class xE{get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}constructor(o,i,s){this._client=o,this._webSocket=i,this._connected=!1,this._serverFrameHandlers={CONNECTED:l=>{this.debug(`connected to server ${l.headers.server}`),this._connected=!0,this._connectedVersion=l.headers.version,this._connectedVersion===It.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(l.headers),this.onConnect(l)},MESSAGE:l=>{const c=l.headers.subscription,f=this._subscriptions[c]||this.onUnhandledMessage,p=l,m=this,g=this._connectedVersion===It.V1_2?p.headers.ack:p.headers["message-id"];p.ack=(v={})=>m.ack(g,c,v),p.nack=(v={})=>m.nack(g,c,v),f(p)},RECEIPT:l=>{const c=this._receiptWatchers[l.headers["receipt-id"]];c?(c(l),delete this._receiptWatchers[l.headers["receipt-id"]]):this.onUnhandledReceipt(l)},ERROR:l=>{this.onStompError(l)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.debug=s.debug,this.stompVersions=s.stompVersions,this.connectHeaders=s.connectHeaders,this.disconnectHeaders=s.disconnectHeaders,this.heartbeatIncoming=s.heartbeatIncoming,this.heartbeatOutgoing=s.heartbeatOutgoing,this.splitLargeFrames=s.splitLargeFrames,this.maxWebSocketChunkSize=s.maxWebSocketChunkSize,this.forceBinaryWSFrames=s.forceBinaryWSFrames,this.logRawCommunication=s.logRawCommunication,this.appendMissingNULLonIncoming=s.appendMissingNULLonIncoming,this.discardWebsocketOnCommFailure=s.discardWebsocketOnCommFailure,this.onConnect=s.onConnect,this.onDisconnect=s.onDisconnect,this.onStompError=s.onStompError,this.onWebSocketClose=s.onWebSocketClose,this.onWebSocketError=s.onWebSocketError,this.onUnhandledMessage=s.onUnhandledMessage,this.onUnhandledReceipt=s.onUnhandledReceipt,this.onUnhandledFrame=s.onUnhandledFrame}start(){const o=new yE(i=>{const s=fr.fromRawFrame(i,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${s}`),(this._serverFrameHandlers[s.command]||this.onUnhandledFrame)(s)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=i=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const s=i.data instanceof ArrayBuffer?new TextDecoder().decode(i.data):i.data;this.debug(`<<< ${s}`)}o.parseChunk(i.data,this.appendMissingNULLonIncoming)},this._webSocket.onclose=i=>{this.debug(`Connection closed to ${this._webSocket.url}`),this._cleanUp(),this.onWebSocketClose(i)},this._webSocket.onerror=i=>{this.onWebSocketError(i)},this._webSocket.onopen=()=>{const i=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),i["accept-version"]=this.stompVersions.supportedVersions(),i["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:i})}}_setupHeartbeat(o){if(o.version!==It.V1_1&&o.version!==It.V1_2||!o["heart-beat"])return;const[i,s]=o["heart-beat"].split(",").map(l=>parseInt(l,10));if(this.heartbeatOutgoing!==0&&s!==0){const l=Math.max(this.heartbeatOutgoing,s);this.debug(`send PING every ${l}ms`),this._pinger=new vE(l,this._client.heartbeatStrategy,this.debug),this._pinger.start(()=>{this._webSocket.readyState===pr.OPEN&&(this._webSocket.send(yi.LF),this.debug(">>> PING"))})}if(this.heartbeatIncoming!==0&&i!==0){const l=Math.max(this.heartbeatIncoming,i);this.debug(`check PONG every ${l}ms`),this._ponger=setInterval(()=>{const c=Date.now()-this._lastServerActivityTS;c>l*2&&(this.debug(`did not receive server activity for the last ${c}ms`),this._closeOrDiscardWebsocket())},l)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this.discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState===pr.CONNECTING||this._webSocket.readyState===pr.OPEN)&&this._closeOrDiscardWebsocket()}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}discardWebsocket(){typeof this._webSocket.terminate!="function"&&mE(this._webSocket,o=>this.debug(o)),this._webSocket.terminate()}_transmit(o){const{command:i,headers:s,body:l,binaryBody:c,skipContentLengthHeader:f}=o,p=new fr({command:i,headers:s,body:l,binaryBody:c,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:f});let m=p.serialize();if(this.logRawCommunication?this.debug(`>>> ${m}`):this.debug(`>>> ${p}`),this.forceBinaryWSFrames&&typeof m=="string"&&(m=new TextEncoder().encode(m)),typeof m!="string"||!this.splitLargeFrames)this._webSocket.send(m);else{let g=m;for(;g.length>0;){const v=g.substring(0,this.maxWebSocketChunkSize);g=g.substring(this.maxWebSocketChunkSize),this._webSocket.send(v),this.debug(`chunk sent = ${v.length}, remaining = ${g.length}`)}}}dispose(){if(this.connected)try{const o=Object.assign({},this.disconnectHeaders);o.receipt||(o.receipt=`close-${this._counter++}`),this.watchForReceipt(o.receipt,i=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(i)}),this._transmit({command:"DISCONNECT",headers:o})}catch(o){this.debug(`Ignoring error during disconnect ${o}`)}else(this._webSocket.readyState===pr.CONNECTING||this._webSocket.readyState===pr.OPEN)&&this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&(this._pinger.stop(),this._pinger=void 0),this._ponger&&(clearInterval(this._ponger),this._ponger=void 0)}publish(o){const{destination:i,headers:s,body:l,binaryBody:c,skipContentLengthHeader:f}=o,p=Object.assign({destination:i},s);this._transmit({command:"SEND",headers:p,body:l,binaryBody:c,skipContentLengthHeader:f})}watchForReceipt(o,i){this._receiptWatchers[o]=i}subscribe(o,i,s={}){s=Object.assign({},s),s.id||(s.id=`sub-${this._counter++}`),s.destination=o,this._subscriptions[s.id]=i,this._transmit({command:"SUBSCRIBE",headers:s});const l=this;return{id:s.id,unsubscribe(c){return l.unsubscribe(s.id,c)}}}unsubscribe(o,i={}){i=Object.assign({},i),delete this._subscriptions[o],i.id=o,this._transmit({command:"UNSUBSCRIBE",headers:i})}begin(o){const i=o||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:i}});const s=this;return{id:i,commit(){s.commit(i)},abort(){s.abort(i)}}}commit(o){this._transmit({command:"COMMIT",headers:{transaction:o}})}abort(o){this._transmit({command:"ABORT",headers:{transaction:o}})}ack(o,i,s={}){s=Object.assign({},s),this._connectedVersion===It.V1_2?s.id=o:s["message-id"]=o,s.subscription=i,this._transmit({command:"ACK",headers:s})}nack(o,i,s={}){return s=Object.assign({},s),this._connectedVersion===It.V1_2?s.id=o:s["message-id"]=o,s.subscription=i,this._transmit({command:"NACK",headers:s})}}class wE{get webSocket(){var o;return(o=this._stompHandler)==null?void 0:o._webSocket}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(o){this._disconnectHeaders=o,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===wn.ACTIVE}_changeState(o){this.state=o,this.onChangeState(o)}constructor(o={}){this.stompVersions=It.default,this.connectionTimeout=0,this.reconnectDelay=5e3,this._nextReconnectDelay=0,this.maxReconnectDelay=15*60*1e3,this.reconnectTimeMode=pa.LINEAR,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.heartbeatStrategy=Ci.Interval,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8*1024,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.discardWebsocketOnCommFailure=!1,this.state=wn.INACTIVE;const i=()=>{};this.debug=i,this.beforeConnect=i,this.onConnect=i,this.onDisconnect=i,this.onUnhandledMessage=i,this.onUnhandledReceipt=i,this.onUnhandledFrame=i,this.onStompError=i,this.onWebSocketClose=i,this.onWebSocketError=i,this.logRawCommunication=!1,this.onChangeState=i,this.connectHeaders={},this._disconnectHeaders={},this.configure(o)}configure(o){Object.assign(this,o),this.maxReconnectDelay>0&&this.maxReconnectDelay{if(this.active){this.debug("Already ACTIVE, ignoring request to activate");return}this._changeState(wn.ACTIVE),this._nextReconnectDelay=this.reconnectDelay,this._connect()};this.state===wn.DEACTIVATING?(this.debug("Waiting for deactivation to finish before activating"),this.deactivate().then(()=>{o()})):o()}async _connect(){if(await this.beforeConnect(this),this._stompHandler){this.debug("There is already a stompHandler, skipping the call to connect");return}if(!this.active){this.debug("Client has been marked inactive, will not attempt to connect");return}this.connectionTimeout>0&&(this._connectionWatcher&&clearTimeout(this._connectionWatcher),this._connectionWatcher=setTimeout(()=>{this.connected||(this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect())},this.connectionTimeout)),this.debug("Opening Web Socket...");const o=this._createWebSocket();this._stompHandler=new xE(this,o,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,heartbeatStrategy:this.heartbeatStrategy,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:i=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active){this.debug("STOMP got connected while deactivate was issued, will disconnect now"),this._disposeStompHandler();return}this.onConnect(i)},onDisconnect:i=>{this.onDisconnect(i)},onStompError:i=>{this.onStompError(i)},onWebSocketClose:i=>{this._stompHandler=void 0,this.state===wn.DEACTIVATING&&this._changeState(wn.INACTIVE),this.onWebSocketClose(i),this.active&&this._schedule_reconnect()},onWebSocketError:i=>{this.onWebSocketError(i)},onUnhandledMessage:i=>{this.onUnhandledMessage(i)},onUnhandledReceipt:i=>{this.onUnhandledReceipt(i)},onUnhandledFrame:i=>{this.onUnhandledFrame(i)}}),this._stompHandler.start()}_createWebSocket(){let o;if(this.webSocketFactory)o=this.webSocketFactory();else if(this.brokerURL)o=new WebSocket(this.brokerURL,this.stompVersions.protocolVersions());else throw new Error("Either brokerURL or webSocketFactory must be provided");return o.binaryType="arraybuffer",o}_schedule_reconnect(){this._nextReconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this._nextReconnectDelay}ms`),this._reconnector=setTimeout(()=>{this.reconnectTimeMode===pa.EXPONENTIAL&&(this._nextReconnectDelay=this._nextReconnectDelay*2,this.maxReconnectDelay!==0&&(this._nextReconnectDelay=Math.min(this._nextReconnectDelay,this.maxReconnectDelay))),this._connect()},this._nextReconnectDelay))}async deactivate(o={}){var c;const i=o.force||!1,s=this.active;let l;if(this.state===wn.INACTIVE)return this.debug("Already INACTIVE, nothing more to do"),Promise.resolve();if(this._changeState(wn.DEACTIVATING),this._nextReconnectDelay=0,this._reconnector&&(clearTimeout(this._reconnector),this._reconnector=void 0),this._stompHandler&&this.webSocket.readyState!==pr.CLOSED){const f=this._stompHandler.onWebSocketClose;l=new Promise((p,m)=>{this._stompHandler.onWebSocketClose=g=>{f(g),p()}})}else return this._changeState(wn.INACTIVE),Promise.resolve();return i?(c=this._stompHandler)==null||c.discardWebsocket():s&&this._disposeStompHandler(),l}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&this._stompHandler.dispose()}publish(o){this._checkConnection(),this._stompHandler.publish(o)}_checkConnection(){if(!this.connected)throw new TypeError("There is no underlying STOMP connection")}watchForReceipt(o,i){this._checkConnection(),this._stompHandler.watchForReceipt(o,i)}subscribe(o,i,s={}){return this._checkConnection(),this._stompHandler.subscribe(o,i,s)}unsubscribe(o,i={}){this._checkConnection(),this._stompHandler.unsubscribe(o,i)}begin(o){return this._checkConnection(),this._stompHandler.begin(o)}commit(o){this._checkConnection(),this._stompHandler.commit(o)}abort(o){this._checkConnection(),this._stompHandler.abort(o)}ack(o,i,s={}){this._checkConnection(),this._stompHandler.ack(o,i,s)}nack(o,i,s={}){this._checkConnection(),this._stompHandler.nack(o,i,s)}}var Au={exports:{}},Xs={},Yh;function SE(){return Yh||(Yh=1,J.crypto&&J.crypto.getRandomValues?Xs.randomBytes=function(n){var o=new Uint8Array(n);return J.crypto.getRandomValues(o),o}:Xs.randomBytes=function(n){for(var o=new Array(n),i=0;i=2&&(H=H.slice(2)):S(E)?H=k[4]:E?A&&(H=H.slice(2)):I>=2&&S(M.protocol)&&(H=k[4]),{protocol:E,slashes:A||S(E),slashesCount:I,rest:H}}function P(R,M){if(R==="")return M;for(var k=(M||"/").split("/").slice(0,-1).concat(R.split("/")),E=k.length,A=k[E-1],b=!1,I=0;E--;)k[E]==="."?k.splice(E,1):k[E]===".."?(k.splice(E,1),I++):I&&(E===0&&(b=!0),k.splice(E,1),I--);return b&&k.unshift(""),(A==="."||A==="..")&&k.push(""),k.join("/")}function T(R,M,k){if(R=m(R),R=R.replace(s,""),!(this instanceof T))return new T(R,M,k);var E,A,b,I,H,K,he=g.slice(),Ee=typeof M,X=this,Fe=0;for(Ee!=="object"&&Ee!=="string"&&(k=M,M=null),k&&typeof k!="function"&&(k=o.parse),M=x(M),A=N(R||"",M),E=!A.protocol&&!A.slashes,X.slashes=A.slashes||E&&M.slashes,X.protocol=A.protocol||M.protocol||"",R=A.rest,(A.protocol==="file:"&&(A.slashesCount!==2||p.test(R))||!A.slashes&&(A.protocol||A.slashesCount<2||!S(X.protocol)))&&(he[3]=[/(.*)/,"pathname"]);Fe1?this._listeners[o]=s.slice(0,l).concat(s.slice(l+1)):delete this._listeners[o];return}}},n.prototype.dispatchEvent=function(){var o=arguments[0],i=o.type,s=arguments.length===1?[o]:Array.apply(null,arguments);if(this["on"+i]&&this["on"+i].apply(this,s),i in this._listeners)for(var l=this._listeners[i],c=0;c0){var c="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,c,function(f){l.sendStop=null,f?(l.emit("close",f.code||1006,"Sending error: "+f),l.close()):l.sendScheduleWait()}),this.sendBuffer=[]}},s.prototype._cleanup=function(){this.removeAllListeners()},s.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},Mu=s,Mu}var Bu,um;function RE(){if(um)return Bu;um=1;var n=De(),o=Pt().EventEmitter,i=function(){};function s(l,c,f){o.call(this),this.Receiver=l,this.receiveUrl=c,this.AjaxObject=f,this._scheduleReceiver()}return n(s,o),s.prototype._scheduleReceiver=function(){var l=this,c=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);c.on("message",function(f){l.emit("message",f)}),c.once("close",function(f,p){i("close",f,p,l.pollIsClosing),l.poll=c=null,l.pollIsClosing||(p==="network"?l._scheduleReceiver():(l.emit("close",f||1006,p),l.removeAllListeners()))})},s.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},Bu=s,Bu}var $u,cm;function dy(){if(cm)return $u;cm=1;var n=De(),o=un(),i=bE(),s=RE();function l(c,f,p,m,g){var v=o.addPath(c,f),x=this;i.call(this,c,p),this.poll=new s(m,v,g),this.poll.on("message",function(S){x.emit("message",S)}),this.poll.once("close",function(S,N){x.poll=null,x.emit("close",S,N),x.close()})}return n(l,i),l.prototype.close=function(){i.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},$u=l,$u}var Fu,dm;function Ro(){if(dm)return Fu;dm=1;var n=De(),o=un(),i=dy();function s(c){return function(f,p,m){var g={};typeof p=="string"&&(g.headers={"Content-type":"text/plain"});var v=o.addPath(f,"/xhr_send"),x=new c("POST",v,p,g);return x.once("finish",function(S){if(x=null,S!==200&&S!==204)return m(new Error("http status "+S));m()}),function(){x.close(),x=null;var S=new Error("Aborted");S.code=1e3,m(S)}}}function l(c,f,p,m){i.call(this,c,f,s(m),p,m)}return n(l,i),Fu=l,Fu}var Uu,fm;function Ra(){if(fm)return Uu;fm=1;var n=De(),o=Pt().EventEmitter;function i(s,l){o.call(this);var c=this;this.bufferPosition=0,this.xo=new l("POST",s,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(f,p){c._chunkHandler(f,p),c.xo=null;var m=f===200?"network":"permanent";c.emit("close",null,m),c._cleanup()})}return n(i,o),i.prototype._chunkHandler=function(s,l){if(!(s!==200||!l))for(var c=-1;;this.bufferPosition+=c+1){var f=l.slice(this.bufferPosition);if(c=f.indexOf(` +`),c===-1)break;var p=f.slice(0,c);p&&this.emit("message",p)}},i.prototype._cleanup=function(){this.removeAllListeners()},i.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},Uu=i,Uu}var zu,pm;function fy(){if(pm)return zu;pm=1;var n=Pt().EventEmitter,o=De(),i=mr(),s=un(),l=J.XMLHttpRequest,c=function(){};function f(g,v,x,S){var N=this;n.call(this),setTimeout(function(){N._start(g,v,x,S)},0)}o(f,n),f.prototype._start=function(g,v,x,S){var N=this;try{this.xhr=new l}catch{}if(!this.xhr){this.emit("finish",0,"no xhr support"),this._cleanup();return}v=s.addQuery(v,"t="+ +new Date),this.unloadRef=i.unloadAdd(function(){N._cleanup(!0)});try{this.xhr.open(g,v,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){c("xhr timeout"),N.emit("finish",0,""),N._cleanup(!1)})}catch{this.emit("finish",0,""),this._cleanup(!1);return}if((!S||!S.noCredentials)&&f.supportsCORS&&(this.xhr.withCredentials=!0),S&&S.headers)for(var P in S.headers)this.xhr.setRequestHeader(P,S.headers[P]);this.xhr.onreadystatechange=function(){if(N.xhr){var T=N.xhr,D,q;switch(c("readyState",T.readyState),T.readyState){case 3:try{q=T.status,D=T.responseText}catch{}q===1223&&(q=204),q===200&&D&&D.length>0&&N.emit("chunk",q,D);break;case 4:q=T.status,q===1223&&(q=204),(q===12005||q===12029)&&(q=0),c("finish",q,T.responseText),N.emit("finish",q,T.responseText),N._cleanup(!1);break}}};try{N.xhr.send(x)}catch{N.emit("finish",0,""),N._cleanup(!1)}},f.prototype._cleanup=function(g){if(this.xhr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),g)try{this.xhr.abort()}catch{}this.unloadRef=this.xhr=null}},f.prototype.close=function(){this._cleanup(!0)},f.enabled=!!l;var p=["Active"].concat("Object").join("X");!f.enabled&&p in J&&(l=function(){try{return new J[p]("Microsoft.XMLHTTP")}catch{return null}},f.enabled=!!new l);var m=!1;try{m="withCredentials"in new l}catch{}return f.supportsCORS=m,zu=f,zu}var Hu,hm;function Ta(){if(hm)return Hu;hm=1;var n=De(),o=fy();function i(s,l,c,f){o.call(this,s,l,c,f)}return n(i,o),i.enabled=o.enabled&&o.supportsCORS,Hu=i,Hu}var qu,mm;function Ti(){if(mm)return qu;mm=1;var n=De(),o=fy();function i(s,l,c){o.call(this,s,l,c,{noCredentials:!0})}return n(i,o),i.enabled=o.enabled,qu=i,qu}var Wu,gm;function Ai(){return gm||(gm=1,Wu={isOpera:function(){return J.navigator&&/opera/i.test(J.navigator.userAgent)},isKonqueror:function(){return J.navigator&&/konqueror/i.test(J.navigator.userAgent)},hasDomain:function(){if(!J.document)return!0;try{return!!J.document.domain}catch{return!1}}}),Wu}var Vu,ym;function TE(){if(ym)return Vu;ym=1;var n=De(),o=Ro(),i=Ra(),s=Ta(),l=Ti(),c=Ai();function f(p){if(!l.enabled&&!s.enabled)throw new Error("Transport created when disabled");o.call(this,p,"/xhr_streaming",i,s)}return n(f,o),f.enabled=function(p){return p.nullOrigin||c.isOpera()?!1:s.enabled},f.transportName="xhr-streaming",f.roundTrips=2,f.needBody=!!J.document,Vu=f,Vu}var Gu,vm;function nd(){if(vm)return Gu;vm=1;var n=Pt().EventEmitter,o=De(),i=mr(),s=Ai(),l=un(),c=function(){};function f(p,m,g){var v=this;n.call(this),setTimeout(function(){v._start(p,m,g)},0)}return o(f,n),f.prototype._start=function(p,m,g){var v=this,x=new J.XDomainRequest;m=l.addQuery(m,"t="+ +new Date),x.onerror=function(){v._error()},x.ontimeout=function(){v._error()},x.onprogress=function(){c("progress",x.responseText),v.emit("chunk",200,x.responseText)},x.onload=function(){v.emit("finish",200,x.responseText),v._cleanup(!1)},this.xdr=x,this.unloadRef=i.unloadAdd(function(){v._cleanup(!0)});try{this.xdr.open(p,m),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(g)}catch{this._error()}},f.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},f.prototype._cleanup=function(p){if(this.xdr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,p)try{this.xdr.abort()}catch{}this.unloadRef=this.xdr=null}},f.prototype.close=function(){this._cleanup(!0)},f.enabled=!!(J.XDomainRequest&&s.hasDomain()),Gu=f,Gu}var Xu,xm;function py(){if(xm)return Xu;xm=1;var n=De(),o=Ro(),i=Ra(),s=nd();function l(c){if(!s.enabled)throw new Error("Transport created when disabled");o.call(this,c,"/xhr_streaming",i,s)}return n(l,o),l.enabled=function(c){return c.cookie_needed||c.nullOrigin?!1:s.enabled&&c.sameScheme},l.transportName="xdr-streaming",l.roundTrips=2,Xu=l,Xu}var Qu,wm;function hy(){return wm||(wm=1,Qu=J.EventSource),Qu}var Yu,Sm;function AE(){if(Sm)return Yu;Sm=1;var n=De(),o=Pt().EventEmitter,i=hy(),s=function(){};function l(c){o.call(this);var f=this,p=this.es=new i(c);p.onmessage=function(m){s("message",m.data),f.emit("message",decodeURI(m.data))},p.onerror=function(m){s("error",p.readyState);var g=p.readyState!==2?"network":"permanent";f._cleanup(),f._close(g)}}return n(l,o),l.prototype.abort=function(){this._cleanup(),this._close("user")},l.prototype._cleanup=function(){var c=this.es;c&&(c.onmessage=c.onerror=null,c.close(),this.es=null)},l.prototype._close=function(c){var f=this;setTimeout(function(){f.emit("close",null,c),f.removeAllListeners()},200)},Yu=l,Yu}var Ku,Em;function Cm(){if(Em)return Ku;Em=1;var n=De(),o=Ro(),i=AE(),s=Ta(),l=hy();function c(f){if(!c.enabled())throw new Error("Transport created when disabled");o.call(this,f,"/eventsource",i,s)}return n(c,o),c.enabled=function(){return!!l},c.transportName="eventsource",c.roundTrips=2,Ku=c,Ku}var Ju,km;function my(){return km||(km=1,Ju="1.6.1"),Ju}var Zu={exports:{}},_m;function ji(){return _m||(_m=1,function(n){var o=mr(),i=Ai();n.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){n.exports.WPrefix in J||(J[n.exports.WPrefix]={})},postMessage:function(s,l){J.parent!==J&&J.parent.postMessage(JSON.stringify({windowId:n.exports.currentWindowId,type:s,data:l||""}),"*")},createIframe:function(s,l){var c=J.document.createElement("iframe"),f,p,m=function(){clearTimeout(f);try{c.onload=null}catch{}c.onerror=null},g=function(){c&&(m(),setTimeout(function(){c&&c.parentNode.removeChild(c),c=null},0),o.unloadDel(p))},v=function(S){c&&(g(),l(S))},x=function(S,N){setTimeout(function(){try{c&&c.contentWindow&&c.contentWindow.postMessage(S,N)}catch{}},0)};return c.src=s,c.style.display="none",c.style.position="absolute",c.onerror=function(){v("onerror")},c.onload=function(){clearTimeout(f),f=setTimeout(function(){v("onload timeout")},2e3)},J.document.body.appendChild(c),f=setTimeout(function(){v("timeout")},15e3),p=o.unloadAdd(g),{post:x,cleanup:g,loaded:m}},createHtmlfile:function(s,l){var c=["Active"].concat("Object").join("X"),f=new J[c]("htmlfile"),p,m,g,v=function(){clearTimeout(p),g.onerror=null},x=function(){f&&(v(),o.unloadDel(m),g.parentNode.removeChild(g),g=f=null,CollectGarbage())},S=function(T){f&&(x(),l(T))},N=function(T,D){try{setTimeout(function(){g&&g.contentWindow&&g.contentWindow.postMessage(T,D)},0)}catch{}};f.open(),f.write(' +
+