Page MenuHome GnuPG

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/client/editor/composerwindow.cpp b/client/editor/composerwindow.cpp
index e5a1876..2b87d6d 100644
--- a/client/editor/composerwindow.cpp
+++ b/client/editor/composerwindow.cpp
@@ -1,1678 +1,1679 @@
// SPDX-FileCopyrightText: 2023 g10 code Gmbh
// SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "composerwindow.h"
// Qt includes
#include <QApplication>
#include <QClipboard>
#include <QCloseEvent>
#include <QFileDialog>
#include <QFileInfo>
#include <QInputDialog>
#include <QLabel>
#include <QMenu>
#include <QMimeData>
#include <QPainter>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#include <QPrinter>
#include <QProcess>
#include <QPushButton>
#include <QSplitter>
#include <QStatusBar>
#include <QTimer>
#include <QUrlQuery>
#include <QVBoxLayout>
// KDE includes
#include "identity/identity.h"
#include <KActionCollection>
#include <KCursorSaver>
#include <KEmailAddress>
#include <KIconUtils>
#include <KLineEdit>
#include <KLocalizedString>
#include <KMessageBox>
#include <KMime/Message>
#include <KToolBar>
#include <MimeTreeParserWidgets/MessageViewer>
#include <MimeTreeParserWidgets/MessageViewerDialog>
#include <Sonnet/DictionaryComboBox>
#include <Libkleo/ExpiryChecker>
#include <Libkleo/ExpiryCheckerSettings>
#include <Libkleo/KeyCache>
#include <Libkleo/KeyResolverCore>
#include <Libkleo/KeySelectionCombo>
#include <Libkleo/KeySelectionDialog>
// Gpgme includes
#include <QGpgME/Protocol>
#include <gpgme++/tofuinfo.h>
// App includes
#include "../identity/identitydialog.h"
#include "../identity/identitymanager.h"
#include "attachment/attachmentcontroller.h"
#include "attachment/attachmentmodel.h"
#include "attachment/attachmentview.h"
#include "bodytexteditor.h"
#include "composerviewbase.h"
#include "draft/draftmanager.h"
#include "ews/ewsmessagedispatcher.h"
#include "graphmessagedispatcher.h"
#include "job/inserttextfilejob.h"
#include "job/saveasfilejob.h"
#include "kmcomposerglobalaction.h"
#include "mailtemplates.h"
#include "messagecomposersettings.h"
#include "nearexpirywarning.h"
#include "recipientseditor.h"
#include "signaturecontroller.h"
#include "spellcheckerconfigdialog.h"
#include "websocketclient.h"
using namespace Qt::Literals::StringLiterals;
using namespace std::chrono_literals;
namespace
{
inline bool containsSMIME(unsigned int f)
{
return f & (Kleo::SMIMEFormat | Kleo::SMIMEOpaqueFormat);
}
inline bool containsOpenPGP(unsigned int f)
{
return f & (Kleo::OpenPGPMIMEFormat | Kleo::InlineOpenPGPFormat);
}
auto findSendersUid(const std::string &addrSpec, const std::vector<GpgME::UserID> &userIds)
{
return std::find_if(userIds.cbegin(), userIds.cend(), [&addrSpec](const auto &uid) {
return uid.addrSpec() == addrSpec || (uid.addrSpec().empty() && std::string(uid.email()) == addrSpec)
|| (uid.addrSpec().empty() && (!uid.email() || !*uid.email()) && uid.name() == addrSpec);
});
}
}
ComposerWindow::ComposerWindow(const QString &from, const QString &name, const QByteArray &graphAccessToken, QWidget *parent)
: KXmlGuiWindow(parent)
, mFrom(from)
, mMainWidget(new QWidget(this))
, mComposerBase(new MessageComposer::ComposerViewBase(this))
, mHeadersToEditorSplitter(new QSplitter(Qt::Vertical, mMainWidget))
, mHeadersArea(new QWidget(mHeadersToEditorSplitter))
, mGrid(new QGridLayout(mHeadersArea))
, mLblFrom(new QLabel(i18nc("sender address field", "From:"), mHeadersArea))
, mButtonFrom(new QPushButton(mHeadersArea))
, mRecipientEditor(new RecipientsEditor(mHeadersArea))
, mLblSubject(new QLabel(i18nc("@label:textbox Subject of email.", "Subject:"), mHeadersArea))
, mEdtSubject(new QLineEdit(mHeadersArea))
, mBodyTextEditor(new MessageComposer::BodyTextEditor(mMainWidget))
, mNearExpiryWarning(new NearExpiryWarning(this))
, mGlobalAction(new KMComposerGlobalAction(this, this))
, mKeyCache(Kleo::KeyCache::mutableInstance())
{
connect(mKeyCache.get(), &Kleo::KeyCache::keyListingDone, this, [this](const GpgME::KeyListResult &result) {
Q_UNUSED(result);
mRunKeyResolverTimer->start();
});
bool isNew = false;
mIdentity = IdentityManager::self().fromEmail(from, isNew);
mEdtFrom = new QLabel(mHeadersArea);
if (isNew) {
// fill the idenity with default fields
auto dlg = new KMail::IdentityDialog;
mIdentity.setFullName(name);
mIdentity.setWarnNotEncrypt(true);
dlg->setIdentity(mIdentity);
connect(dlg, &KMail::IdentityDialog::keyListingFinished, this, [this, dlg]() {
dlg->updateIdentity(mIdentity);
IdentityManager::self().updateIdentity(mIdentity);
slotIdentityChanged();
});
} else if (mIdentity.fullName().isEmpty()) {
mIdentity.setFullName(name);
IdentityManager::self().updateIdentity(mIdentity);
}
if (graphAccessToken.isEmpty()) {
- mMessageDispatcher = new EWSMessageDispatcher(this);
+ mMessageDispatcher = new EWSMessageDispatcher(graphAccessToken, this);
} else {
+ // TODO always use the EWSMessageDispatcher?
mMessageDispatcher = new GraphMessageDispatcher(graphAccessToken, this);
}
mComposerBase->setMessageDispatcher(mMessageDispatcher);
mMainWidget->resize(800, 600);
setCentralWidget(mMainWidget);
setWindowTitle(i18nc("@title:window", "Composer"));
setMinimumSize(200, 200);
mHeadersToEditorSplitter->setObjectName(QStringLiteral("mHeadersToEditorSplitter"));
mHeadersToEditorSplitter->setChildrenCollapsible(false);
auto v = new QVBoxLayout(mMainWidget);
v->setContentsMargins({});
v->addWidget(mNearExpiryWarning);
v->addWidget(mHeadersToEditorSplitter);
mHeadersArea->setSizePolicy(mHeadersToEditorSplitter->sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
mHeadersToEditorSplitter->addWidget(mHeadersArea);
const QList<int> defaultSizes{0};
mHeadersToEditorSplitter->setSizes(defaultSizes);
mGrid->setColumnStretch(0, 1);
mGrid->setColumnStretch(1, 100);
mGrid->setRowStretch(3 + 1, 100);
int row = 0;
mRunKeyResolverTimer = new QTimer(this);
mRunKeyResolverTimer->setSingleShot(true);
mRunKeyResolverTimer->setInterval(500ms);
connect(mRunKeyResolverTimer, &QTimer::timeout, this, &ComposerWindow::runKeyResolver);
// From
mLblFrom->setObjectName(QStringLiteral("fromLineLabel"));
mLblFrom->setFixedWidth(mRecipientEditor->setFirstColumnWidth(0));
mLblFrom->setBuddy(mEdtFrom);
auto fromWrapper = new QWidget(mHeadersArea);
auto fromWrapperLayout = new QHBoxLayout(fromWrapper);
fromWrapperLayout->setContentsMargins({});
mEdtFrom->installEventFilter(this);
mEdtFrom->setText(mFrom);
mComposerBase->setFrom(mIdentity.fullName() + u" <" + mFrom + u'>');
mEdtFrom->setObjectName(QStringLiteral("fromLine"));
fromWrapperLayout->addWidget(mEdtFrom);
mComposerBase->setIdentity(mIdentity);
mButtonFrom->setText(i18nc("@action:button", "Configure"));
mButtonFrom->setIcon(QIcon::fromTheme(u"configure-symbolic"_s));
mButtonFrom->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
connect(mButtonFrom, &QPushButton::clicked, this, &ComposerWindow::slotEditIdentity);
fromWrapperLayout->addWidget(mButtonFrom);
mGrid->addWidget(mLblFrom, row, 0);
mGrid->addWidget(fromWrapper, row, 1);
row++;
// Recipients
mGrid->addWidget(mRecipientEditor, row, 0, 1, 2);
mComposerBase->setRecipientsEditor(mRecipientEditor);
mRecipientEditor->setCompletionMode(KCompletion::CompletionPopup);
connect(mRecipientEditor, &RecipientsEditor::lineAdded, this, [this](KPIM::MultiplyingLine *line) {
slotRecipientEditorLineAdded(qobject_cast<RecipientLineNG *>(line));
});
row++;
// Subject
mEdtSubject->setObjectName(u"subjectLine"_s);
mLblSubject->setObjectName(u"subjectLineLabel"_s);
mLblSubject->setBuddy(mEdtSubject);
mGrid->addWidget(mLblSubject, row, 0);
mGrid->addWidget(mEdtSubject, row, 1);
row++;
connect(mEdtSubject, &QLineEdit::textEdited, this, [this]() {
mComposerBase->setSubject(mEdtSubject->text());
});
auto editorWidget = new QWidget();
auto vLayout = new QVBoxLayout(editorWidget);
vLayout->setContentsMargins({});
vLayout->setSpacing(0);
mHeadersToEditorSplitter->addWidget(editorWidget);
// Message widget
auto connectionLossWidget = new KMessageWidget(this);
connectionLossWidget->hide();
connectionLossWidget->setWordWrap(true);
connectionLossWidget->setPosition(KMessageWidget::Position::Header);
vLayout->addWidget(connectionLossWidget);
auto &websocketClient = WebsocketClient::self();
connect(&websocketClient, &WebsocketClient::stateChanged, this, [&websocketClient, connectionLossWidget]() {
if (websocketClient.state() == WebsocketClient::State::Connected) {
connectionLossWidget->hide();
} else {
connectionLossWidget->setText(websocketClient.stateDisplay());
connectionLossWidget->show();
}
});
// Rich text editor
mBodyTextEditor->setProperty("_breeze_borders_sides", QVariant::fromValue(QFlags{Qt::TopEdge}));
mBodyTextEditor->setProperty("_breeze_force_frame", true);
mComposerBase->setEditor(mBodyTextEditor);
vLayout->addWidget(mBodyTextEditor);
auto attachmentModel = new MessageComposer::AttachmentModel(this);
auto attachmentView = new AttachmentView(attachmentModel, mHeadersToEditorSplitter);
attachmentView->hideIfEmpty();
connect(attachmentView, &AttachmentView::modified, this, &ComposerWindow::setModified);
connect(attachmentView, &AttachmentView::errorOccurred, this, &ComposerWindow::slotHandleError);
auto attachmentController = new AttachmentController(attachmentModel, attachmentView, this);
mComposerBase->setAttachmentController(attachmentController);
mComposerBase->setAttachmentModel(attachmentModel);
auto signatureController = new MessageComposer::SignatureController(this);
signatureController->setIdentity(mIdentity);
signatureController->setEditor(mComposerBase->editor());
mComposerBase->setSignatureController(signatureController);
setupStatusBar(attachmentView->widget());
setupActions();
setStandardToolBarMenuEnabled(true);
toolBar(u"mainToolBar"_s)->show();
connect(expiryChecker().get(),
&Kleo::ExpiryChecker::expiryMessage,
this,
[&](const GpgME::Key &key, QString msg, Kleo::ExpiryChecker::ExpiryInformation info, bool isNewMessage) {
Q_UNUSED(isNewMessage);
if (info == Kleo::ExpiryChecker::OwnKeyExpired || info == Kleo::ExpiryChecker::OwnKeyNearExpiry) {
const auto plainMsg = msg.replace(QStringLiteral("<p>"), QStringLiteral(" "))
.replace(QStringLiteral("</p>"), QStringLiteral(" "))
.replace(QStringLiteral("<p align=center>"), QStringLiteral(" "));
mNearExpiryWarning->addInfo(plainMsg);
mNearExpiryWarning->setWarning(info == Kleo::ExpiryChecker::OwnKeyExpired);
mNearExpiryWarning->animatedShow();
}
const QList<KPIM::MultiplyingLine *> lstLines = mRecipientEditor->lines();
for (KPIM::MultiplyingLine *line : lstLines) {
auto recipient = line->data().dynamicCast<Recipient>();
if (recipient->key().primaryFingerprint() == key.primaryFingerprint()) {
auto recipientLine = qobject_cast<RecipientLineNG *>(line);
QString iconName = QStringLiteral("emblem-warning");
if (info == Kleo::ExpiryChecker::OtherKeyExpired) {
mAcceptedSolution = false;
iconName = QStringLiteral("emblem-error");
const auto showCryptoIndicator = true;
const auto encrypt = mEncryptAction->isChecked();
const bool showAllIcons = showCryptoIndicator && encrypt;
if (!showAllIcons) {
recipientLine->setIcon(QIcon(), msg);
return;
}
}
recipientLine->setIcon(QIcon::fromTheme(iconName), msg);
return;
}
}
});
// TODO make it possible to show this
auto dictionaryComboBox = new Sonnet::DictionaryComboBox(this);
dictionaryComboBox->hide();
mComposerBase->setDictionary(dictionaryComboBox);
slotIdentityChanged();
runKeyResolver();
connect(mMessageDispatcher, &MessageDispatcher::errorOccurred, this, [this](const QString &mailId, const QString &errorMessage) {
if (mailId == mComposerBase->mailId()) {
KMessageBox::error(this, errorMessage);
}
});
connect(mMessageDispatcher, &MessageDispatcher::sentSuccessfully, this, [this](const QString &mailId) {
if (mailId == mComposerBase->mailId()) {
auto &draftManager = DraftManager::self();
draftManager.remove(draftManager.draftById(mailId.toUtf8()));
slotCloseWindow();
}
});
connect(mComposerBase, &MessageComposer::ComposerViewBase::failed, this, &ComposerWindow::slotHandleError);
connect(mComposerBase, &MessageComposer::ComposerViewBase::closeWindow, this, &ComposerWindow::slotCloseWindow);
}
void ComposerWindow::slotHandleError(const QString &errorMessage)
{
KMessageBox::error(this, errorMessage);
}
void ComposerWindow::reset(const QString &fromAddress, const QString &name, const QByteArray &graphAccessToken)
{
mMessageDispatcher->deleteLater();
if (graphAccessToken.isEmpty()) {
- mMessageDispatcher = new EWSMessageDispatcher(this);
+ mMessageDispatcher = new EWSMessageDispatcher(graphAccessToken, this);
} else {
mMessageDispatcher = new GraphMessageDispatcher(graphAccessToken, this);
}
mComposerBase->setMessageDispatcher(mMessageDispatcher);
mFrom = fromAddress;
mEdtFrom->setText(mFrom);
mComposerBase->setFrom(mIdentity.fullName() + u" <" + mFrom + u'>');
bool isNew = false;
mIdentity = IdentityManager::self().fromEmail(fromAddress, isNew);
if (isNew) {
// fill the idenity with default fields
auto dlg = new KMail::IdentityDialog;
mIdentity.setFullName(name);
dlg->setIdentity(mIdentity);
connect(dlg, &KMail::IdentityDialog::keyListingFinished, this, [this, dlg]() {
dlg->updateIdentity(mIdentity);
IdentityManager::self().updateIdentity(mIdentity);
});
}
mEdtSubject->setText(QString());
mRecipientEditor->clear();
mComposerBase->editor()->setText(QString{});
mComposerBase->attachmentController()->clear();
const QList<KPIM::MultiplyingLine *> lstLines = mRecipientEditor->lines();
for (KPIM::MultiplyingLine *line : lstLines) {
slotRecipientEditorLineAdded(qobject_cast<RecipientLineNG *>(line));
}
}
void ComposerWindow::setupActions()
{
// Save as draft
auto action = new QAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("Save as Encrypted &Draft"), this);
actionCollection()->addAction(QStringLiteral("save_in_drafts"), action);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::Key_S));
connect(action, &QAction::triggered, this, &ComposerWindow::slotSaveDraft);
// Save as file
action = new QAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("Save as &File"), this);
actionCollection()->addAction(QStringLiteral("save_as_file"), action);
connect(action, &QAction::triggered, this, &ComposerWindow::slotSaveAsFile);
// Insert file
action = new QAction(QIcon::fromTheme(QStringLiteral("document-open")), i18n("&Insert Text File..."), this);
actionCollection()->addAction(QStringLiteral("insert_file"), action);
connect(action, &QAction::triggered, this, &ComposerWindow::slotInsertFile);
// Spellchecking
mAutoSpellCheckingAction = new KToggleAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("&Automatic Spellchecking"), this);
actionCollection()->addAction(QStringLiteral("options_auto_spellchecking"), mAutoSpellCheckingAction);
const bool spellChecking = MessageComposer::MessageComposerSettings::self()->autoSpellChecking();
mAutoSpellCheckingAction->setChecked(spellChecking);
slotAutoSpellCheckingToggled(spellChecking);
connect(mAutoSpellCheckingAction, &KToggleAction::toggled, this, &ComposerWindow::slotAutoSpellCheckingToggled);
connect(mComposerBase->editor(), &MessageComposer::BodyTextEditor::checkSpellingChanged, this, &ComposerWindow::slotAutoSpellCheckingToggled);
action = new QAction(QIcon::fromTheme(QStringLiteral("tools-check-spelling")), i18n("&Spellchecker..."), this);
action->setIconText(i18n("Spellchecker"));
actionCollection()->addAction(QStringLiteral("setup_spellchecker"), action);
connect(action, &QAction::triggered, this, &ComposerWindow::slotSpellcheckConfig);
// Recent actions
mRecentAction = new KRecentFilesAction(QIcon::fromTheme(QStringLiteral("document-open")), i18n("&Insert Recent Text File"), this);
actionCollection()->addAction(QStringLiteral("insert_file_recent"), mRecentAction);
connect(mRecentAction, &KRecentFilesAction::urlSelected, this, &ComposerWindow::slotInsertRecentFile);
connect(mRecentAction, &KRecentFilesAction::recentListCleared, this, &ComposerWindow::slotRecentListFileClear);
const QStringList urls = MessageComposer::MessageComposerSettings::self()->recentUrls();
for (const QString &url : urls) {
mRecentAction->addUrl(QUrl(url));
}
// print
KStandardAction::print(this, &ComposerWindow::slotPrint, actionCollection());
KStandardAction::printPreview(this, &ComposerWindow::slotPrintPreview, actionCollection());
// Send email action
action = new QAction(QIcon::fromTheme(QStringLiteral("mail-send")), i18n("&Send Mail"), this);
actionCollection()->addAction(QStringLiteral("mail_send"), action);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::Key_Return));
connect(action, &QAction::triggered, this, &ComposerWindow::slotSend);
// Toggle rich text
mWordWrapAction = new KToggleAction(i18n("&Wordwrap"), this);
actionCollection()->addAction(QStringLiteral("wordwrap"), mWordWrapAction);
mWordWrapAction->setChecked(MessageComposer::MessageComposerSettings::self()->wordWrap());
connect(mWordWrapAction, &KToggleAction::toggled, this, &ComposerWindow::slotWordWrapToggled);
slotWordWrapToggled(MessageComposer::MessageComposerSettings::self()->wordWrap());
// Encryption action
mEncryptAction = new KToggleAction(QIcon::fromTheme(QStringLiteral("document-encrypt")), i18n("&Encrypt Message"), this);
mEncryptAction->setIconText(i18n("Encrypt"));
actionCollection()->addAction(QStringLiteral("encrypt_message"), mEncryptAction);
connect(mEncryptAction, &KToggleAction::toggled, this, &ComposerWindow::slotEncryptionButtonIconUpdate);
// Signing action
mSignAction = new KToggleAction(QIcon::fromTheme(QStringLiteral("document-sign")), i18n("&Sign Message"), this);
mSignAction->setIconText(i18n("Sign"));
actionCollection()->addAction(QStringLiteral("sign_message"), mSignAction);
connect(mSignAction, &KToggleAction::triggered, this, &ComposerWindow::slotSignToggled);
// Append signature
mAppendSignature = new QAction(i18n("Append S&ignature"), this);
actionCollection()->addAction(QStringLiteral("append_signature"), mAppendSignature);
connect(mAppendSignature, &QAction::triggered, mComposerBase->signatureController(), &MessageComposer::SignatureController::appendSignature);
// Prepend signature
mPrependSignature = new QAction(i18n("Pr&epend Signature"), this);
actionCollection()->addAction(QStringLiteral("prepend_signature"), mPrependSignature);
connect(mPrependSignature, &QAction::triggered, mComposerBase->signatureController(), &MessageComposer::SignatureController::prependSignature);
mInsertSignatureAtCursorPosition = new QAction(i18n("Insert Signature At C&ursor Position"), this);
actionCollection()->addAction(QStringLiteral("insert_signature_at_cursor_position"), mInsertSignatureAtCursorPosition);
connect(mInsertSignatureAtCursorPosition,
&QAction::triggered,
mComposerBase->signatureController(),
&MessageComposer::SignatureController::insertSignatureAtCursor);
action = new QAction(i18n("Paste as Attac&hment"), this);
actionCollection()->addAction(QStringLiteral("paste_att"), action);
connect(action, &QAction::triggered, this, &ComposerWindow::slotPasteAsAttachment);
action = new QAction(i18n("Cl&ean Spaces"), this);
actionCollection()->addAction(QStringLiteral("clean_spaces"), action);
connect(action, &QAction::triggered, mComposerBase->signatureController(), &MessageComposer::SignatureController::cleanSpace);
KStandardAction::close(this, &ComposerWindow::close, actionCollection());
KStandardAction::undo(mGlobalAction, &KMComposerGlobalAction::slotUndo, actionCollection());
KStandardAction::redo(mGlobalAction, &KMComposerGlobalAction::slotRedo, actionCollection());
KStandardAction::cut(mGlobalAction, &KMComposerGlobalAction::slotCut, actionCollection());
KStandardAction::copy(mGlobalAction, &KMComposerGlobalAction::slotCopy, actionCollection());
KStandardAction::paste(mGlobalAction, &KMComposerGlobalAction::slotPaste, actionCollection());
mSelectAll = KStandardAction::selectAll(mGlobalAction, &KMComposerGlobalAction::slotMarkAll, actionCollection());
// mFindText = KStandardAction::find(mRichTextEditorWidget, &TextCustomEditor::RichTextEditorWidget::slotFind, actionCollection());
// mFindNextText = KStandardAction::findNext(mRichTextEditorWidget, &TextCustomEditor::RichTextEditorWidget::slotFindNext, actionCollection());
// mReplaceText = KStandardAction::replace(mRichTextEditorWidget, &TextCustomEditor::RichTextEditorWidget::slotReplace, actionCollection());
mComposerBase->attachmentController()->createActions();
createGUI(u"composerui.rc"_s);
const QList<KPIM::MultiplyingLine *> lstLines = mRecipientEditor->lines();
for (KPIM::MultiplyingLine *line : lstLines) {
slotRecipientEditorLineAdded(qobject_cast<RecipientLineNG *>(line));
}
}
void ComposerWindow::setupStatusBar(QWidget *w)
{
statusBar()->addWidget(w);
mStatusbarLabel = new QLabel(this);
mStatusbarLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
statusBar()->addPermanentWidget(mStatusbarLabel);
mCursorLineLabel = new QLabel(this);
mCursorLineLabel->setTextFormat(Qt::PlainText);
mCursorLineLabel->setText(i18nc("Shows the linenumber of the cursor position.", " Line: %1 ", QStringLiteral(" ")));
statusBar()->addPermanentWidget(mCursorLineLabel);
mCursorColumnLabel = new QLabel(i18n(" Column: %1 ", QStringLiteral(" ")));
mCursorColumnLabel->setTextFormat(Qt::PlainText);
statusBar()->addPermanentWidget(mCursorColumnLabel);
connect(mComposerBase->editor(), &QTextEdit::cursorPositionChanged, this, &ComposerWindow::slotCursorPositionChanged);
slotCursorPositionChanged();
}
void ComposerWindow::reply(const KMime::Message::Ptr &originalMessage)
{
MailTemplates::reply(originalMessage, [this](const KMime::Message::Ptr &message) {
setMessage(message);
Q_EMIT initialized();
});
}
void ComposerWindow::forward(const KMime::Message::Ptr &originalMessage)
{
MailTemplates::forward(originalMessage, [this](const KMime::Message::Ptr &message) {
setMessage(message);
Q_EMIT initialized();
});
}
QString ComposerWindow::mailId() const
{
if (!mComposerBase) {
return {};
}
return mComposerBase->mailId();
}
void ComposerWindow::setMailId(const QString &mailId)
{
if (!mComposerBase) {
return;
}
mComposerBase->setMailId(mailId);
Q_EMIT initialized();
}
void ComposerWindow::setMessage(const KMime::Message::Ptr &msg)
{
mComposerBase->setMessage(msg);
mEdtSubject->setText(mComposerBase->subject());
}
bool ComposerWindow::isComposerModified() const
{
return mComposerBase->editor()->document()->isModified() || mComposerBase->recipientsEditor()->isModified() || mEdtSubject->isModified();
}
void ComposerWindow::setModified(bool isModified)
{
mIsModified = isModified;
mComposerBase->editor()->document()->setModified(isModified);
if (!isModified) {
mComposerBase->recipientsEditor()->clearModified();
mEdtSubject->setModified(false);
}
}
bool ComposerWindow::isModified() const
{
return mIsModified || isComposerModified();
}
void ComposerWindow::setSigning(bool sign, bool setByUser)
{
const bool wasModified = isModified();
if (setByUser) {
setModified(true);
}
if (!mSignAction->isEnabled()) {
sign = false;
}
// check if the user defined a signing key for the current identity
if (sign && !mLastIdentityHasSigningKey) {
if (setByUser) {
KMessageBox::error(this,
i18n("<qt><p>In order to be able to sign "
"this message you first have to "
"define the (OpenPGP or S/MIME) signing key "
"to use.</p>"
"<p>Please select the key to use "
"in the identity configuration.</p>"
"</qt>"),
i18nc("@title:window", "Undefined Signing Key"));
setModified(wasModified);
}
sign = false;
}
// make sure the mSignAction is in the right state
mSignAction->setChecked(sign);
// mark the attachments for (no) signing
// if (canSignEncryptAttachments()) {
// mComposerBase->attachmentModel()->setSignSelected(sign);
//}
}
std::unique_ptr<Kleo::KeyResolverCore> ComposerWindow::fillKeyResolver()
{
auto keyResolverCore = std::make_unique<Kleo::KeyResolverCore>(true, sign());
keyResolverCore->setMinimumValidity(GpgME::UserID::Unknown);
QStringList signingKeys, encryptionKeys;
if (cryptoMessageFormat() & Kleo::AnyOpenPGP) {
if (!mIdentity.pgpSigningKey().isEmpty()) {
signingKeys.push_back(QLatin1String(mIdentity.pgpSigningKey()));
}
if (!mIdentity.pgpEncryptionKey().isEmpty()) {
encryptionKeys.push_back(QLatin1String(mIdentity.pgpEncryptionKey()));
}
}
if (cryptoMessageFormat() & Kleo::AnySMIME) {
if (!mIdentity.smimeSigningKey().isEmpty()) {
signingKeys.push_back(QLatin1String(mIdentity.smimeSigningKey()));
}
if (!mIdentity.smimeEncryptionKey().isEmpty()) {
encryptionKeys.push_back(QLatin1String(mIdentity.smimeEncryptionKey()));
}
}
keyResolverCore->setSender(mIdentity.fullEmailAddr());
keyResolverCore->setSigningKeys(signingKeys);
keyResolverCore->setOverrideKeys({{GpgME::UnknownProtocol, {{keyResolverCore->normalizedSender(), encryptionKeys}}}});
QStringList recipients;
const auto lst = mRecipientEditor->lines();
for (auto line : lst) {
auto recipient = line->data().dynamicCast<Recipient>();
recipients.push_back(recipient->email());
}
keyResolverCore->setRecipients(recipients);
qWarning() << recipients;
return keyResolverCore;
}
void ComposerWindow::slotEncryptionButtonIconUpdate()
{
const auto state = mEncryptAction->isChecked();
auto icon = QIcon::fromTheme(QStringLiteral("document-encrypt"));
QString tooltip;
if (state) {
tooltip = i18nc("@info:tooltip", "Encrypt");
} else {
tooltip = i18nc("@info:tooltip", "Not Encrypt");
icon = QIcon::fromTheme(QStringLiteral("document-decrypt"));
}
if (mAcceptedSolution) {
auto overlay = QIcon::fromTheme(QStringLiteral("emblem-added"));
if (state) {
overlay = QIcon::fromTheme(QStringLiteral("emblem-checked"));
}
icon = KIconUtils::addOverlay(icon, overlay, Qt::BottomRightCorner);
} else {
const auto lst = mRecipientEditor->lines();
bool empty = false;
if (lst.size() == 1) {
const auto line = qobject_cast<RecipientLineNG *>(lst.first());
if (line->recipientsCount() == 0) {
empty = true;
}
}
if (state && !empty) {
auto overlay = QIcon::fromTheme(QStringLiteral("emblem-warning"));
icon = KIconUtils::addOverlay(icon, overlay, Qt::BottomRightCorner);
}
}
mEncryptAction->setIcon(icon);
mEncryptAction->setToolTip(tooltip);
}
void ComposerWindow::runKeyResolver()
{
auto keyResolverCore = fillKeyResolver();
auto result = keyResolverCore->resolve();
const auto lst = mRecipientEditor->lines();
if (lst.size() == 1) {
const auto line = qobject_cast<RecipientLineNG *>(lst.first());
if (line->recipientsCount() == 0) {
mAcceptedSolution = false;
slotEncryptionButtonIconUpdate();
return;
}
}
mAcceptedSolution = result.flags & Kleo::KeyResolverCore::AllResolved;
for (auto line_ : lst) {
auto line = qobject_cast<RecipientLineNG *>(line_);
Q_ASSERT(line);
auto recipient = line->data().dynamicCast<Recipient>();
QString dummy;
QString addrSpec;
if (KEmailAddress::splitAddress(recipient->email(), dummy, addrSpec, dummy) != KEmailAddress::AddressOk) {
addrSpec = recipient->email();
}
auto resolvedKeys = result.solution.encryptionKeys[addrSpec];
GpgME::Key key;
if (resolvedKeys.size() == 0) { // no key found for recipient
// Search for any key, also for not accepted ons, to at least give the user more info.
key = Kleo::KeyCache::instance()->findBestByMailBox(addrSpec.toUtf8().constData(), GpgME::UnknownProtocol, Kleo::KeyCache::KeyUsage::Encrypt);
key.update(); // We need tofu information for key.
recipient->setKey(key);
} else { // A key was found for recipient
key = resolvedKeys.front();
if (recipient->key().primaryFingerprint() != key.primaryFingerprint()) {
key.update(); // We need tofu information for key.
recipient->setKey(key);
}
}
annotateRecipientEditorLineWithCryptoInfo(line);
if (!key.isNull()) {
mExpiryChecker->checkKey(key, Kleo::ExpiryChecker::EncryptionKey);
}
}
slotEncryptionButtonIconUpdate();
}
void ComposerWindow::annotateRecipientEditorLineWithCryptoInfo(RecipientLineNG *line)
{
auto recipient = line->data().dynamicCast<Recipient>();
const auto key = recipient->key();
const auto showCryptoIndicator = true;
const auto encrypt = mEncryptAction->isChecked();
const bool showPositiveIcons = showCryptoIndicator && encrypt;
const bool showAllIcons = showCryptoIndicator && encrypt;
QString dummy;
QString addrSpec;
bool invalidEmail = false;
if (KEmailAddress::splitAddress(recipient->email(), dummy, addrSpec, dummy) != KEmailAddress::AddressOk) {
invalidEmail = true;
addrSpec = recipient->email();
}
if (key.isNull()) {
recipient->setEncryptionAction(Kleo::Impossible);
if (showAllIcons && !invalidEmail) {
const auto icon = QIcon::fromTheme(QStringLiteral("emblem-error"));
line->setIcon(icon, i18nc("@info:tooltip", "No key found for the recipient."));
} else {
line->setIcon(QIcon());
}
line->setProperty("keyStatus", invalidEmail ? InProgress : NoKey);
return;
}
CryptoKeyState keyState = KeyOk;
if (recipient->encryptionAction() != Kleo::DoIt) {
recipient->setEncryptionAction(Kleo::DoIt);
}
QString tooltip;
const auto uids = key.userIDs();
const auto _uid = findSendersUid(addrSpec.toStdString(), uids);
GpgME::UserID uid;
if (_uid == uids.cend()) {
uid = key.userID(0);
} else {
uid = *_uid;
}
const auto trustLevel = Kleo::trustLevel(uid);
switch (trustLevel) {
case Kleo::Level0:
if (uid.tofuInfo().isNull()) {
tooltip = i18nc("@info:tooltip",
"The encryption key is not trusted. It hasn't enough validity. "
"You can sign the key, if you communicated the fingerprint by another channel. "
"Click the icon for details.");
keyState = NoTrusted;
} else {
switch (uid.tofuInfo().validity()) {
case GpgME::TofuInfo::NoHistory:
tooltip = i18nc("@info:tooltip",
"The encryption key is not trusted. "
"It hasn't been used anywhere to guarantee it belongs to the stated person. "
"By using the key will be trusted more. "
"Or you can sign the key, if you communicated the fingerprint by another channel. "
"Click the icon for details.");
break;
case GpgME::TofuInfo::Conflict:
tooltip = i18nc("@info:tooltip",
"The encryption key is not trusted. It has conflicting TOFU data. "
"Click the icon for details.");
keyState = NoKey;
break;
case GpgME::TofuInfo::ValidityUnknown:
tooltip = i18nc("@info:tooltip",
"The encryption key is not trusted. It has unknown validity in TOFU data. "
"Click the icon for details.");
keyState = NoKey;
break;
default:
tooltip = i18nc("@info:tooltip",
"The encryption key is not trusted. The key is marked as bad. "
"Click the icon for details.");
keyState = NoKey;
}
}
break;
case Kleo::Level1:
tooltip = i18nc("@info:tooltip",
"The encryption key is only marginally trusted and hasn't been used enough time to guarantee it belongs to the stated person. "
"By using the key will be trusted more. "
"Or you can sign the key, if you communicated the fingerprint by another channel. "
"Click the icon for details.");
break;
case Kleo::Level2:
if (uid.tofuInfo().isNull()) {
tooltip = i18nc("@info:tooltip",
"The encryption key is only marginally trusted. "
"You can sign the key, if you communicated the fingerprint by another channel. "
"Click the icon for details.");
} else {
tooltip = i18nc("@info:tooltip",
"The encryption key is only marginally trusted, but has been used enough times to be very likely controlled by the stated person. "
"By using the key will be trusted more. "
"Or you can sign the key, if you communicated the fingerprint by another channel. "
"Click the icon for details.");
}
break;
case Kleo::Level3:
tooltip = i18nc("@info:tooltip",
"The encryption key is fully trusted. You can raise the security level, by signing the key. "
"Click the icon for details.");
break;
case Kleo::Level4:
tooltip = i18nc("@info:tooltip",
"The encryption key is ultimately trusted or is signed by another ultimately trusted key. "
"Click the icon for details.");
break;
default:
Q_UNREACHABLE();
}
// Ensure the tooltips are word wrapped
tooltip = u"<div>"_s + tooltip + u"</div>"_s;
if (keyState == NoKey) {
mAcceptedSolution = false;
if (showAllIcons) {
line->setIcon(QIcon::fromTheme(QStringLiteral("emblem-error")), tooltip);
} else {
line->setIcon(QIcon());
}
} else if (trustLevel == Kleo::Level0 && encrypt) {
if (keyState == NoTrusted) {
line->setIcon(QIcon::fromTheme(QStringLiteral("emblem-question")), tooltip);
} else {
line->setIcon(QIcon::fromTheme(QStringLiteral("emblem-warning")), tooltip);
}
} else if (showPositiveIcons) {
// Magically, the icon name maps precisely to each trust level
// line->setIcon(QIcon::fromTheme(QStringLiteral("gpg-key-trust-level-%1").arg(trustLevel)), tooltip);
line->setIcon(QIcon::fromTheme(QStringLiteral("emblem-success")), tooltip);
} else {
line->setIcon(QIcon());
}
if (line->property("keyStatus") != keyState) {
line->setProperty("keyStatus", keyState);
}
}
void ComposerWindow::slotSignToggled(bool on)
{
setSigning(on, true);
}
bool ComposerWindow::sign() const
{
return mSignAction->isChecked();
}
void ComposerWindow::slotSend()
{
if (mComposerBase->to().isEmpty()) {
if (mComposerBase->cc().isEmpty() && mComposerBase->bcc().isEmpty()) {
KMessageBox::information(this,
i18n("You must specify at least one receiver, "
"either in the To: field or as CC or as BCC."));
return;
} else {
const int rc = KMessageBox::questionTwoActions(this,
i18n("To: field is empty. "
"Send message anyway?"),
i18nc("@title:window", "No To: specified"),
KGuiItem(i18n("S&end as Is"), QLatin1String("mail-send")),
KGuiItem(i18n("&Specify the To field"), QLatin1String("edit-rename")));
if (rc == KMessageBox::ButtonCode::SecondaryAction) {
return;
}
}
}
if (mComposerBase->subject().isEmpty()) {
mEdtSubject->setFocus();
const int rc = KMessageBox::questionTwoActions(this,
i18n("You did not specify a subject. "
"Send message anyway?"),
i18nc("@title:window", "No Subject Specified"),
KGuiItem(i18n("S&end as Is"), QStringLiteral("mail-send")),
KGuiItem(i18n("&Specify the Subject"), QStringLiteral("edit-rename")));
if (rc == KMessageBox::ButtonCode::SecondaryAction) {
return;
}
}
KCursorSaver saver(Qt::WaitCursor);
const bool encrypt = mEncryptAction->isChecked();
mComposerBase->setCryptoOptions(sign(), encrypt, cryptoMessageFormat());
mComposerBase->send();
}
void ComposerWindow::changeCryptoAction()
{
if (!QGpgME::openpgp() && !QGpgME::smime()) {
// no crypto whatsoever
mEncryptAction->setEnabled(false);
mSignAction->setEnabled(false);
setSigning(false);
} else {
setSigning(true);
mEncryptAction->setChecked(true);
mComposerBase->setCryptoOptions(true, true, cryptoMessageFormat());
}
}
inline Kleo::chrono::days encryptOwnKeyNearExpiryWarningThresholdInDays()
{
const int num = 30;
return Kleo::chrono::days{qMax(1, num)};
}
inline Kleo::chrono::days encryptKeyNearExpiryWarningThresholdInDays()
{
const int num = 14;
return Kleo::chrono::days{qMax(1, num)};
}
inline Kleo::chrono::days encryptRootCertNearExpiryWarningThresholdInDays()
{
const int num = 14;
return Kleo::chrono::days{qMax(1, num)};
}
inline Kleo::chrono::days encryptChainCertNearExpiryWarningThresholdInDays()
{
const int num = 14;
return Kleo::chrono::days{qMax(1, num)};
}
std::shared_ptr<Kleo::ExpiryChecker> ComposerWindow::expiryChecker()
{
if (!mExpiryChecker) {
mExpiryChecker.reset(new Kleo::ExpiryChecker{Kleo::ExpiryCheckerSettings{encryptOwnKeyNearExpiryWarningThresholdInDays(),
encryptKeyNearExpiryWarningThresholdInDays(),
encryptRootCertNearExpiryWarningThresholdInDays(),
encryptChainCertNearExpiryWarningThresholdInDays()}});
}
return mExpiryChecker;
}
Kleo::CryptoMessageFormat ComposerWindow::cryptoMessageFormat() const
{
return Kleo::AutoFormat;
}
void ComposerWindow::slotEditIdentity()
{
QPointer<KMail::IdentityDialog> dlg = new KMail::IdentityDialog();
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->setIdentity(mIdentity);
dlg->open();
connect(dlg, &KMail::IdentityDialog::accepted, this, [dlg, this]() {
dlg->updateIdentity(mIdentity);
IdentityManager::self().updateIdentity(mIdentity);
IdentityManager::self().writeConfig();
slotIdentityChanged();
});
}
void ComposerWindow::slotIdentityChanged()
{
mComposerBase->setIdentity(mIdentity);
mLastIdentityHasSigningKey = !mIdentity.pgpSigningKey().isEmpty() || !mIdentity.smimeSigningKey().isEmpty();
mLastIdentityHasEncryptionKey = !mIdentity.pgpEncryptionKey().isEmpty() || !mIdentity.smimeEncryptionKey().isEmpty();
mComposerBase->signatureController()->setIdentity(mIdentity);
mComposerBase->dictionary()->setCurrentByDictionaryName(mIdentity.dictionary());
mComposerBase->editor()->setSpellCheckingLanguage(mComposerBase->dictionary()->currentDictionary());
bool bPGPEncryptionKey = !mIdentity.pgpEncryptionKey().isEmpty();
bool bPGPSigningKey = !mIdentity.pgpSigningKey().isEmpty();
bool bSMIMEEncryptionKey = !mIdentity.smimeEncryptionKey().isEmpty();
bool bSMIMESigningKey = !mIdentity.smimeSigningKey().isEmpty();
if (cryptoMessageFormat() & Kleo::AnyOpenPGP) {
if (bPGPEncryptionKey) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(mIdentity.pgpEncryptionKey().constData());
if (key.isNull() || !key.canEncrypt()) {
bPGPEncryptionKey = false;
}
}
if (bPGPSigningKey) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(mIdentity.pgpSigningKey().constData());
if (key.isNull() || !key.canSign()) {
bPGPSigningKey = false;
}
}
} else {
bPGPEncryptionKey = false;
bPGPSigningKey = false;
}
if (cryptoMessageFormat() & Kleo::AnySMIME) {
if (bSMIMEEncryptionKey) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(mIdentity.smimeEncryptionKey().constData());
if (key.isNull() || !key.canEncrypt()) {
bSMIMEEncryptionKey = false;
}
}
if (bSMIMESigningKey) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(mIdentity.smimeSigningKey().constData());
if (key.isNull() || !key.canSign()) {
bSMIMESigningKey = false;
}
}
} else {
bSMIMEEncryptionKey = false;
bSMIMESigningKey = false;
}
bool bNewIdentityHasSigningKey = bPGPSigningKey || bSMIMESigningKey;
bool bNewIdentityHasEncryptionKey = bPGPEncryptionKey || bSMIMEEncryptionKey;
if (!mKeyCache->initialized()) {
// We need to start key listing on our own othweise KMail will crash and we want to wait till the cache is populated.
mKeyCache->startKeyListing();
connect(mKeyCache.get(), &Kleo::KeyCache::keyListingDone, this, [this]() {
checkOwnKeyExpiry(mIdentity);
runKeyResolver();
});
} else {
checkOwnKeyExpiry(mIdentity);
}
// save the state of the sign and encrypt button
if (!bNewIdentityHasEncryptionKey && mLastIdentityHasEncryptionKey) {
mLastEncryptActionState = mEncryptAction->isChecked();
}
mSignAction->setEnabled(bNewIdentityHasSigningKey);
if (!bNewIdentityHasSigningKey && mLastIdentityHasSigningKey) {
mLastSignActionState = sign();
setSigning(false);
}
// restore the last state of the sign and encrypt button
if (bNewIdentityHasSigningKey && !mLastIdentityHasSigningKey) {
setSigning(mLastSignActionState);
}
mLastIdentityHasSigningKey = bNewIdentityHasSigningKey;
mLastIdentityHasEncryptionKey = bNewIdentityHasEncryptionKey;
const KIdentityManagementCore::Signature sig = const_cast<KIdentityManagementCore::Identity &>(mIdentity).signature();
bool isEnabledSignature = sig.isEnabledSignature();
mAppendSignature->setEnabled(isEnabledSignature);
mPrependSignature->setEnabled(isEnabledSignature);
mInsertSignatureAtCursorPosition->setEnabled(isEnabledSignature);
changeCryptoAction();
Q_EMIT identityChanged();
}
void ComposerWindow::checkOwnKeyExpiry(const KIdentityManagementCore::Identity &ident)
{
mNearExpiryWarning->clearInfo();
mNearExpiryWarning->hide();
if (cryptoMessageFormat() & Kleo::AnyOpenPGP) {
if (!ident.pgpEncryptionKey().isEmpty()) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(ident.pgpEncryptionKey().constData());
if (key.isNull() || !key.canEncrypt()) {
mNearExpiryWarning->addInfo(i18nc("The argument is as PGP fingerprint",
"Your selected PGP key (%1) doesn't exist in your keyring or is not suitable for encryption.",
QString::fromUtf8(ident.pgpEncryptionKey())));
mNearExpiryWarning->setWarning(true);
mNearExpiryWarning->show();
} else {
mComposerBase->expiryChecker()->checkKey(key, Kleo::ExpiryChecker::OwnEncryptionKey);
}
}
if (!ident.pgpSigningKey().isEmpty()) {
if (ident.pgpSigningKey() != ident.pgpEncryptionKey()) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(ident.pgpSigningKey().constData());
if (key.isNull() || !key.canSign()) {
mNearExpiryWarning->addInfo(i18nc("The argument is as PGP fingerprint",
"Your selected PGP signing key (%1) doesn't exist in your keyring or is not suitable for signing.",
QString::fromUtf8(ident.pgpSigningKey())));
mNearExpiryWarning->setWarning(true);
mNearExpiryWarning->show();
} else {
mComposerBase->expiryChecker()->checkKey(key, Kleo::ExpiryChecker::OwnSigningKey);
}
}
}
}
if (cryptoMessageFormat() & Kleo::AnySMIME) {
if (!ident.smimeEncryptionKey().isEmpty()) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(ident.smimeEncryptionKey().constData());
if (key.isNull() || !key.canEncrypt()) {
mNearExpiryWarning->addInfo(i18nc("The argument is as SMIME fingerprint",
"Your selected SMIME key (%1) doesn't exist in your keyring or is not suitable for encryption.",
QString::fromUtf8(ident.smimeEncryptionKey())));
mNearExpiryWarning->setWarning(true);
mNearExpiryWarning->show();
} else {
mComposerBase->expiryChecker()->checkKey(key, Kleo::ExpiryChecker::OwnEncryptionKey);
}
}
if (!ident.smimeSigningKey().isEmpty()) {
if (ident.smimeSigningKey() != ident.smimeEncryptionKey()) {
auto const key = mKeyCache->findByKeyIDOrFingerprint(ident.smimeSigningKey().constData());
if (key.isNull() || !key.canSign()) {
mNearExpiryWarning->addInfo(i18nc("The argument is as SMIME fingerprint",
"Your selected SMIME signing key (%1) doesn't exist in your keyring or is not suitable for signing.",
QString::fromUtf8(ident.smimeSigningKey())));
mNearExpiryWarning->setWarning(true);
mNearExpiryWarning->show();
} else {
mComposerBase->expiryChecker()->checkKey(key, Kleo::ExpiryChecker::OwnSigningKey);
}
}
}
}
}
void ComposerWindow::slotCursorPositionChanged()
{
// Change Line/Column info in status bar
const int line = mComposerBase->editor()->linePosition() + 1;
const int col = mComposerBase->editor()->columnNumber() + 1;
QString temp = i18nc("Shows the linenumber of the cursor position.", " Line: %1 ", line);
mCursorLineLabel->setText(temp);
temp = i18n(" Column: %1 ", col);
mCursorColumnLabel->setText(temp);
// Show link target in status bar
/*if (mComposerBase->editor()->textCursor().charFormat().isAnchor()) {
const QString text = mComposerBase->editor()->composerControler()->currentLinkText() + QLatin1String(" -> ")
+ mComposerBase->editor()->composerControler()->currentLinkUrl();
mStatusbarLabel->setText(text);
} else {
mStatusbarLabel->clear();
}*/
}
KIdentityManagementCore::Identity ComposerWindow::identity() const
{
return mIdentity;
}
QString ComposerWindow::subject() const
{
return mEdtSubject->text();
}
QString ComposerWindow::content() const
{
return mComposerBase->editor()->toPlainText();
}
RecipientsEditor *ComposerWindow::recipientsEditor() const
{
return mRecipientEditor;
}
void ComposerWindow::addAttachment(const QList<AttachmentInfo> &infos, bool showWarning)
{
QStringList lst;
for (const AttachmentInfo &info : infos) {
if (showWarning) {
lst.append(info.url.toDisplayString());
}
mComposerBase->addAttachment(info.url, info.comment, false);
}
if (showWarning) {
// TODO
// mAttachmentFromExternalMissing->setAttachmentNames(lst);
// mAttachmentFromExternalMissing->animatedShow();
}
}
void ComposerWindow::addAttachment(const QString &name, KMime::Headers::contentEncoding cte, const QByteArray &data, const QByteArray &mimeType)
{
Q_UNUSED(cte)
mComposerBase->addAttachment(name, name, data, mimeType);
}
void ComposerWindow::insertUrls(const QMimeData *source, const QList<QUrl> &urlList)
{
QStringList urlAdded;
for (const QUrl &url : urlList) {
QString urlStr;
if (url.scheme() == QLatin1String("mailto")) {
urlStr = KEmailAddress::decodeMailtoUrl(url);
} else {
urlStr = url.toDisplayString();
// Workaround #346370
if (urlStr.isEmpty()) {
urlStr = source->text();
}
}
if (!urlAdded.contains(urlStr)) {
mComposerBase->editor()->textCursor().insertText(urlStr + QLatin1Char('\n'));
urlAdded.append(urlStr);
}
}
}
bool ComposerWindow::insertFromMimeData(const QMimeData *source, bool forceAttachment)
{
// If this is a PNG image, either add it as an attachment or as an inline image
if (source->hasHtml() && source->hasText() && !forceAttachment) {
mComposerBase->editor()->insertPlainText(source->text());
return true;
} else if (source->hasImage() && source->hasFormat(QStringLiteral("image/png"))) {
// Get the image data before showing the dialog, since that processes events which can delete
// the QMimeData object behind our back
const QByteArray imageData = source->data(QStringLiteral("image/png"));
if (imageData.isEmpty()) {
return true;
}
// Ok, when we reached this point, the user wants to add the image as an attachment.
// Ask for the filename first.
bool ok;
QString attName = QInputDialog::getText(this, i18n("KMail"), i18n("Name of the attachment:"), QLineEdit::Normal, QString(), &ok);
if (!ok) {
return true;
}
attName = attName.trimmed();
if (attName.isEmpty()) {
KMessageBox::error(this, i18n("Attachment name can't be empty"), i18nc("@title:window", "Invalid Attachment Name"));
return true;
}
addAttachment(attName, KMime::Headers::CEbase64, imageData, "image/png");
return true;
}
// If this is a URL list, add those files as attachments or text
// but do not offer this if we are pasting plain text containing an url, e.g. from a browser
const QList<QUrl> urlList = source->urls();
if (!urlList.isEmpty()) {
// Search if it's message items.
bool allLocalURLs = true;
for (const QUrl &url : urlList) {
if (!url.isLocalFile()) {
allLocalURLs = false;
}
}
if (allLocalURLs || forceAttachment) {
QList<AttachmentInfo> infoList;
infoList.reserve(urlList.count());
for (const QUrl &url : urlList) {
AttachmentInfo info;
info.url = url;
infoList.append(info);
}
addAttachment(infoList, false);
} else {
QMenu p;
const int sizeUrl(urlList.size());
const QAction *addAsTextAction = p.addAction(i18np("Add URL into Message", "Add URLs into Message", sizeUrl));
const QAction *addAsAttachmentAction = p.addAction(i18np("Add File as &Attachment", "Add Files as &Attachment", sizeUrl));
const QAction *selectedAction = p.exec(QCursor::pos());
if (selectedAction == addAsTextAction) {
insertUrls(source, urlList);
} else if (selectedAction == addAsAttachmentAction) {
QList<AttachmentInfo> infoList;
for (const QUrl &url : urlList) {
if (url.isValid()) {
AttachmentInfo info;
info.url = url;
infoList.append(info);
}
}
addAttachment(infoList, false);
}
}
return true;
}
return false;
}
void ComposerWindow::slotSaveDraft()
{
mComposerBase->slotSaveDraft();
}
void ComposerWindow::slotSaveAsFile()
{
auto job = new SaveAsFileJob(this);
job->setParentWidget(this);
job->setHtmlMode(false);
job->setTextDocument(mComposerBase->editor()->document());
job->start();
}
QUrl ComposerWindow::insertFile()
{
const auto fileName = QFileDialog::getOpenFileName(this, i18nc("@title:window", "Insert File"));
return QUrl::fromUserInput(fileName);
}
void ComposerWindow::slotInsertFile()
{
const QUrl u = insertFile();
if (u.isEmpty()) {
return;
}
mRecentAction->addUrl(u);
// Prevent race condition updating list when multiple composers are open
{
QStringList urls = MessageComposer::MessageComposerSettings::self()->recentUrls();
// Prevent config file from growing without bound
// Would be nicer to get this constant from KRecentFilesAction
const int mMaxRecentFiles = 30;
while (urls.count() > mMaxRecentFiles) {
urls.removeLast();
}
urls.prepend(u.toDisplayString());
MessageComposer::MessageComposerSettings::self()->setRecentUrls(urls);
MessageComposer::MessageComposerSettings::self()->save();
}
slotInsertRecentFile(u);
}
void ComposerWindow::slotRecentListFileClear()
{
MessageComposer::MessageComposerSettings::self()->setRecentUrls({});
MessageComposer::MessageComposerSettings::self()->save();
}
void ComposerWindow::slotInsertRecentFile(const QUrl &u)
{
if (u.fileName().isEmpty()) {
return;
}
auto job = new MessageComposer::InsertTextFileJob(mComposerBase->editor(), u);
job->start();
}
void ComposerWindow::slotPrint()
{
QPrinter printer;
QPrintDialog dialog(&printer, this);
dialog.setWindowTitle(i18nc("@title:window", "Print Document"));
if (dialog.exec() != QDialog::Accepted)
return;
printInternal(&printer);
}
void ComposerWindow::slotPrintPreview()
{
auto dialog = new QPrintPreviewDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->resize(800, 750);
dialog->setWindowTitle(i18nc("@title:window", "Print Document"));
QObject::connect(dialog, &QPrintPreviewDialog::paintRequested, this, [this](QPrinter *printer) {
printInternal(printer);
});
dialog->open();
}
void ComposerWindow::printInternal(QPrinter *printer)
{
mComposerBase->generateMessage([printer](const QList<KMime::Message::Ptr> &messages) {
if (messages.isEmpty()) {
return;
}
MimeTreeParser::Widgets::MessageViewer messageViewer;
messageViewer.setMessage(messages[0]);
QPainter painter;
painter.begin(printer);
const auto pageLayout = printer->pageLayout();
const auto pageRect = pageLayout.paintRectPixels(printer->resolution());
const double xscale = pageRect.width() / double(messageViewer.width());
const double yscale = pageRect.height() / double(messageViewer.height());
const double scale = qMin(qMin(xscale, yscale), 1.);
painter.translate(pageRect.x(), pageRect.y());
painter.scale(scale, scale);
messageViewer.print(&painter, pageRect.width());
});
}
void ComposerWindow::slotPasteAsAttachment()
{
const QMimeData *mimeData = QApplication::clipboard()->mimeData();
if (!mimeData) {
return;
}
if (insertFromMimeData(mimeData, true)) {
return;
}
if (mimeData->hasText()) {
bool ok;
const QString attName =
QInputDialog::getText(this, i18n("Insert clipboard text as attachment"), i18n("Name of the attachment:"), QLineEdit::Normal, QString(), &ok);
if (ok) {
mComposerBase->addAttachment(attName, attName, QApplication::clipboard()->text().toUtf8(), "text/plain");
}
return;
}
}
void ComposerWindow::slotWordWrapToggled(bool on)
{
if (on) {
mComposerBase->editor()->enableWordWrap(validateLineWrapWidth());
} else {
disableWordWrap();
}
}
int ComposerWindow::validateLineWrapWidth() const
{
int lineWrap = MessageComposer::MessageComposerSettings::self()->lineWrapWidth();
if ((lineWrap == 0) || (lineWrap > 78)) {
lineWrap = 78;
} else if (lineWrap < 30) {
lineWrap = 30;
}
return lineWrap;
}
void ComposerWindow::disableWordWrap()
{
mComposerBase->editor()->disableWordWrap();
}
void ComposerWindow::slotAutoSpellCheckingToggled(bool enabled)
{
mAutoSpellCheckingAction->setChecked(enabled);
if (mComposerBase->editor()->checkSpellingEnabled() != enabled) {
mComposerBase->editor()->setCheckSpellingEnabled(enabled);
}
// mStatusBarLabelSpellCheckingChangeMode->setToggleMode(enabled);
}
void ComposerWindow::slotSpellcheckConfig()
{
QPointer<SpellCheckerConfigDialog> dialog = new SpellCheckerConfigDialog(this);
if (!mComposerBase->editor()->spellCheckingLanguage().isEmpty()) {
dialog->setLanguage(mComposerBase->editor()->spellCheckingLanguage());
}
if (dialog->exec()) {
mComposerBase->editor()->setSpellCheckingLanguage(dialog->language());
}
delete dialog;
}
void ComposerWindow::closeEvent(QCloseEvent *event)
{
event->ignore();
ComposerWindowFactory::self().clear(this);
}
bool ComposerWindow::queryClose()
{
if (isModified()) {
const QString savebut = i18n("&Save as Draft");
const QString savetext = i18n("Save this message encrypted in your drafts folder. It can then be edited and sent at a later time.");
const int rc = KMessageBox::warningTwoActionsCancel(this,
i18n("Do you want to save the message for later or discard it?"),
i18nc("@title:window", "Close Composer"),
KGuiItem(savebut, QStringLiteral("document-save"), QString(), savetext),
KStandardGuiItem::discard(),
KStandardGuiItem::cancel());
if (rc == KMessageBox::Cancel) {
return false;
} else if (rc == KMessageBox::ButtonCode::PrimaryAction) {
// doSend will close the window. Just return false from this method
slotSaveDraft();
return false;
}
// else fall through: return true
}
mComposerBase->cleanupAutoSave();
return true;
}
void ComposerWindow::slotRecipientEditorLineAdded(RecipientLineNG *line)
{
connect(line, &RecipientLineNG::countChanged, this, [this, line]() {
slotRecipientAdded(line);
});
connect(line, &RecipientLineNG::iconClicked, this, [this, line]() {
slotRecipientLineIconClicked(line);
});
connect(line, &RecipientLineNG::destroyed, this, &ComposerWindow::slotRecipientEditorFocusChanged, Qt::QueuedConnection);
connect(
line,
&RecipientLineNG::activeChanged,
this,
[this, line]() {
slotRecipientFocusLost(line);
},
Qt::QueuedConnection);
slotRecipientEditorFocusChanged();
}
void ComposerWindow::slotRecipientLineIconClicked(RecipientLineNG *line)
{
const auto recipient = line->data().dynamicCast<Recipient>();
if (!recipient->key().isNull()) {
const QString exec = QStandardPaths::findExecutable(QStringLiteral("kleopatra"));
if (exec.isEmpty()
|| !QProcess::startDetached(exec,
{QStringLiteral("--query"),
QString::fromLatin1(recipient->key().primaryFingerprint()),
QStringLiteral("--parent-windowid"),
QString::number(winId())})) {
qCWarning(EDITOR_LOG) << "Unable to execute kleopatra";
}
return;
}
const auto msg = i18nc(
"if in your language something like "
"'certificate(s)' is not possible please "
"use the plural in the translation",
"<qt>No valid and trusted encryption certificate was "
"found for \"%1\".<br/><br/>"
"Select the certificate(s) which should "
"be used for this recipient. If there is no suitable certificate in the list "
"you can also search for external certificates by clicking the button: "
"search for external certificates.</qt>",
recipient->name().isEmpty() ? recipient->email() : recipient->name());
const bool opgp = containsOpenPGP(cryptoMessageFormat());
const bool x509 = containsSMIME(cryptoMessageFormat());
QPointer<Kleo::KeySelectionDialog> dlg = new Kleo::KeySelectionDialog(
i18n("Encryption Key Selection"),
msg,
recipient->email(),
{},
Kleo::KeySelectionDialog::ValidEncryptionKeys | (opgp ? Kleo::KeySelectionDialog::OpenPGPKeys : 0) | (x509 ? Kleo::KeySelectionDialog::SMIMEKeys : 0),
false, // multi-selection
false); // "remember choice" box;
dlg->open();
connect(dlg, &QDialog::accepted, this, [dlg, recipient, line, this]() {
auto key = dlg->selectedKey();
key.update(); // We need tofu information for key.
recipient->setKey(key);
annotateRecipientEditorLineWithCryptoInfo(line);
});
}
void ComposerWindow::slotRecipientEditorFocusChanged()
{
if (!mEncryptAction->isChecked()) {
return;
}
if (mKeyCache->initialized()) {
mRunKeyResolverTimer->stop();
runKeyResolver();
}
}
void ComposerWindow::slotRecipientAdded(RecipientLineNG *line)
{
if (line->recipientsCount() == 0) {
return;
}
if (!mKeyCache->initialized()) {
if (line->property("keyLookupJob").toBool()) {
return;
}
line->setProperty("keyLookupJob", true);
// We need to start key listing on our own othweise KMail will crash and we want to wait till the cache is populated.
connect(mKeyCache.get(), &Kleo::KeyCache::keyListingDone, this, [this, line]() {
slotRecipientAdded(line);
});
return;
}
if (mKeyCache->initialized()) {
mRunKeyResolverTimer->start();
}
}
void ComposerWindow::slotRecipientFocusLost(RecipientLineNG *line)
{
if (line->recipientsCount() == 0) {
return;
}
if (mKeyCache->initialized()) {
mRunKeyResolverTimer->start();
}
}
void ComposerWindow::slotCloseWindow()
{
setModified(false);
mComposerBase->cleanupAutoSave();
hide();
}
diff --git a/client/ews/ewsclient.cpp b/client/ews/ewsclient.cpp
index 692b9f6..d622344 100644
--- a/client/ews/ewsclient.cpp
+++ b/client/ews/ewsclient.cpp
@@ -1,12 +1,14 @@
// SPDX-FileCopyrightText: 2025 g10 Code Gmbh
// SPDX-Contributor: Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: LGPL-2.0-or-later
#include "ewsclient.h"
QHash<QString, QString> EwsClient::folderHash;
-EwsClient::EwsClient(const QString &_email)
+EwsClient::EwsClient(const QString &_email, const QByteArray &_token)
: email(_email)
+ , token(_token)
+ , qnam(new QNetworkAccessManager())
{
}
diff --git a/client/ews/ewsclient.h b/client/ews/ewsclient.h
index 18492a0..ef740ff 100644
--- a/client/ews/ewsclient.h
+++ b/client/ews/ewsclient.h
@@ -1,18 +1,21 @@
// SPDX-FileCopyrightText: 2025 g10 Code Gmbh
// SPDX-Contributor: Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: LGPL-2.0-or-later
#pragma once
#include <QHash>
+#include <QNetworkAccessManager>
#include <QString>
class EwsClient
{
public:
- explicit EwsClient(const QString &email);
+ explicit EwsClient(const QString &email, const QByteArray &token);
QString email;
+ QByteArray token;
+ std::shared_ptr<QNetworkAccessManager> qnam;
static QHash<QString, QString> folderHash;
};
diff --git a/client/ews/ewsmessagedispatcher.cpp b/client/ews/ewsmessagedispatcher.cpp
index c01df84..11aa1b6 100644
--- a/client/ews/ewsmessagedispatcher.cpp
+++ b/client/ews/ewsmessagedispatcher.cpp
@@ -1,42 +1,46 @@
// SPDX-FileCopyrightText: 2024 g10 code GmbH
// SPDX-FileContributor: Carl Schwan <carl.schwan@gnupg.com>
// SPDX-License-Identifier: LGPL-2.0-or-later
#include "ewsmessagedispatcher.h"
#include "ews/ewscreateitemrequest.h"
+#include <QNetworkAccessManager>
+
#include <KLocalizedString>
using namespace Qt::StringLiterals;
-EWSMessageDispatcher::EWSMessageDispatcher(QObject *parent)
+EWSMessageDispatcher::EWSMessageDispatcher(const QByteArray &accessToken, QObject *parent)
: MessageDispatcher(parent)
+ , m_qnam(new QNetworkAccessManager(this))
+ , m_accessToken(accessToken)
{
}
void EWSMessageDispatcher::dispatch(const KMime::Message::Ptr &message, const QString &fromEmail, const QString &mailId)
{
const QByteArray mimeContent = message->encodedContent(true);
EwsItem item;
item.setType(EwsItemTypeMessage);
item.setField(EwsItemFieldMimeContent, mimeContent);
- auto createItemRequest = new EwsCreateItemRequest(EwsClient(fromEmail));
+ auto createItemRequest = new EwsCreateItemRequest(EwsClient(fromEmail, m_accessToken));
createItemRequest->setMessageDisposition(EwsMessageDisposition::EwsDispSendAndSaveCopy);
createItemRequest->setSavedFolderId(EwsId{EwsDistinguishedId::EwsDIdSentItems});
createItemRequest->setItems({item});
connect(createItemRequest, &KJob::result, this, [this, createItemRequest, mailId](KJob *) {
const auto responses = createItemRequest->responses();
if (responses.size() > 0 && responses.at(0).isSuccess()) {
Q_EMIT sentSuccessfully(mailId);
} else if (responses.isEmpty()) {
Q_EMIT errorOccurred(mailId, i18n("No response from EWS server."));
} else {
Q_EMIT errorOccurred(mailId, responses.at(0).responseMessage());
}
});
createItemRequest->start();
}
diff --git a/client/ews/ewsmessagedispatcher.h b/client/ews/ewsmessagedispatcher.h
index b634811..a59bb50 100644
--- a/client/ews/ewsmessagedispatcher.h
+++ b/client/ews/ewsmessagedispatcher.h
@@ -1,23 +1,29 @@
// SPDX-FileCopyrightText: 2024 g10 code GmbH
// SPDX-FileContributor: Carl Schwan <carl.schwan@gnupg.com>
// SPDX-License-Identifier: LGPL-2.0-or-later
#pragma once
#include "messagedispatcher.h"
+class QNetworkAccessManager;
+
/// Implementation of the MessageDispatcher for the ews service
///
/// This will wrap the MIME message inside a SOAP request and forward it
/// to the web addons.
class EWSMessageDispatcher : public MessageDispatcher
{
Q_OBJECT
public:
/// Default constructor
- explicit EWSMessageDispatcher(QObject *parent = nullptr);
+ explicit EWSMessageDispatcher(const QByteArray &accessToken, QObject *parent = nullptr);
/// \copydoc MessageDispatcher::dispatch
void dispatch(const KMime::Message::Ptr &message, const QString &from, const QString &mailId) override;
+
+private:
+ QNetworkAccessManager *const m_qnam;
+ const QByteArray m_accessToken;
};
diff --git a/client/ews/ewsrequest.cpp b/client/ews/ewsrequest.cpp
index fe707a9..a1e4d39 100644
--- a/client/ews/ewsrequest.cpp
+++ b/client/ews/ewsrequest.cpp
@@ -1,308 +1,327 @@
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "ewsrequest.h"
#include <QNetworkReply>
#include <QTemporaryFile>
#include <QUuid>
#include "ewsclient_debug.h"
#include "websocketclient.h"
using namespace Qt::StringLiterals;
EwsRequest::EwsRequest(const EwsClient &client, QObject *parent)
: EwsJob(parent)
, mClient(client)
, mServerVersion(EwsServerVersion::ewsVersion2007Sp1)
{
}
EwsRequest::~EwsRequest() = default;
void EwsRequest::doSend()
{
- auto &client = WebsocketClient::self();
- client.sendEWSRequest(mClient.email, mRequestId, mBody);
- connect(&client, &WebsocketClient::ewsResponseReceived, this, [this](const QString &requestId, const QString &responseBody) {
- if (requestId == mRequestId) {
- requestResult(responseBody);
- }
- });
+ if (mClient.token.isEmpty()) {
+ auto &client = WebsocketClient::self();
+ client.sendEWSRequest(mClient.email, mRequestId, mBody);
+ connect(&client, &WebsocketClient::ewsResponseReceived, this, [this](const QString &requestId, const QString &responseBody) {
+ if (requestId == mRequestId) {
+ requestResult(responseBody);
+ }
+ });
+ } else {
+ qWarning() << "Calling" << "https://outlook.office365.com/EWS/Exchange.asmx" << mClient.token;
+ QNetworkRequest request(QUrl(u"https://outlook.office365.com/EWS/Exchange.asmx"_s));
+ request.setRawHeader("Authorization", "Bearer " + mClient.token);
+ request.setHeader(QNetworkRequest::ContentTypeHeader, u"text/xml"_s);
+
+ auto reply = mClient.qnam->post(request, mBody.toUtf8());
+ connect(reply, &QNetworkReply::finished, this, [this, reply]() {
+ reply->deleteLater();
+
+ if (reply->error() != QNetworkReply::NoError) {
+ qWarning() << reply->error() << reply->errorString() << reply->readAll() << reply->rawHeaderPairs();
+ return;
+ }
+ const auto body = reply->readAll();
+ requestResult(QString::fromUtf8(body));
+ });
+ }
}
void EwsRequest::startSoapDocument(QXmlStreamWriter &writer)
{
writer.writeStartDocument();
writer.writeNamespace(soapEnvNsUri, QStringLiteral("soap"));
writer.writeNamespace(ewsMsgNsUri, QStringLiteral("m"));
writer.writeNamespace(ewsTypeNsUri, QStringLiteral("t"));
// SOAP Envelope
writer.writeStartElement(soapEnvNsUri, QStringLiteral("Envelope"));
// SOAP Header
writer.writeStartElement(soapEnvNsUri, QStringLiteral("Header"));
mServerVersion.writeRequestServerVersion(writer);
writer.writeEndElement();
// SOAP Body
writer.writeStartElement(soapEnvNsUri, QStringLiteral("Body"));
}
void EwsRequest::endSoapDocument(QXmlStreamWriter &writer)
{
// End SOAP Body
writer.writeEndElement();
// End SOAP Envelope
writer.writeEndElement();
writer.writeEndDocument();
}
void EwsRequest::prepare(const QString &body)
{
mBody = body;
mRequestId = QUuid::createUuid().toString(QUuid::WithoutBraces);
}
void EwsRequest::start()
{
}
void EwsRequest::requestResult(const QString &responseBody)
{
mResponseData = responseBody.toUtf8();
QXmlStreamReader reader(mResponseData);
readResponse(reader);
emitResult();
}
bool EwsRequest::readResponse(QXmlStreamReader &reader)
{
if (!reader.readNextStartElement()) {
return setErrorMsg(QStringLiteral("Failed to read EWS request XML"));
}
if ((reader.name() != QLatin1StringView("Envelope")) || (reader.namespaceUri() != soapEnvNsUri)) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - not a SOAP XML"));
}
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != soapEnvNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - not a SOAP XML"));
}
if (reader.name() == QLatin1StringView("Body")) {
if (!readSoapBody(reader)) {
return false;
}
} else if (reader.name() == QLatin1StringView("Header")) {
if (!readHeader(reader)) {
return false;
}
}
}
return true;
}
bool EwsRequest::readSoapBody(QXmlStreamReader &reader)
{
while (reader.readNextStartElement()) {
if ((reader.name() == QLatin1StringView("Fault")) && (reader.namespaceUri() == soapEnvNsUri)) {
return readSoapFault(reader);
}
if (!parseResult(reader)) {
return false;
}
}
return true;
}
QPair<QStringView, QString> EwsRequest::parseNamespacedString(const QString &str, const QXmlStreamNamespaceDeclarations &namespaces)
{
const auto tokens = str.split(QLatin1Char(':'));
switch (tokens.count()) {
case 1:
return {QStringView(), str};
case 2:
for (const auto &ns : namespaces) {
if (ns.prefix() == tokens[0]) {
return {ns.namespaceUri(), tokens[1]};
}
}
/* fall through */
default:
return {};
}
}
EwsResponseCode EwsRequest::parseEwsResponseCode(const QPair<QStringView, QString> &code)
{
if (code.first == ewsTypeNsUri) {
return decodeEwsResponseCode(code.second);
} else {
return EwsResponseCodeUnknown;
}
}
bool EwsRequest::readSoapFault(QXmlStreamReader &reader)
{
QString faultCode;
QString faultString;
while (reader.readNextStartElement()) {
if (reader.name() == QLatin1StringView("faultcode")) {
const auto rawCode = reader.readElementText();
const auto parsedCode = parseEwsResponseCode(parseNamespacedString(rawCode, reader.namespaceDeclarations()));
if (parsedCode != EwsResponseCodeUnknown) {
setEwsResponseCode(parsedCode);
}
faultCode = rawCode;
} else if (reader.name() == QLatin1StringView("faultstring")) {
faultString = reader.readElementText();
}
}
qCWarning(EWSCLI_LOG) << "readSoapFault" << faultCode;
setErrorMsg(faultCode + QStringLiteral(": ") + faultString);
return false;
}
bool EwsRequest::parseResponseMessage(QXmlStreamReader &reader, const QString &reqName, ContentReaderFn contentReader)
{
if (reader.name().toString() != reqName + QStringLiteral("Response") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(reqName + QStringLiteral("Response")));
}
if (!reader.readNextStartElement()) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected a child element in %1 element.").arg(reqName + QStringLiteral("Response")));
}
if (reader.name().toString() != QLatin1StringView("ResponseMessages") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(QStringLiteral("ResponseMessages")));
}
while (reader.readNextStartElement()) {
if (reader.name().toString() != reqName + QStringLiteral("ResponseMessage") || reader.namespaceUri() != ewsMsgNsUri) {
return setErrorMsg(QStringLiteral("Failed to read EWS request - expected %1 element.").arg(reqName + QStringLiteral("ResponseMessage")));
}
if (!contentReader(reader)) {
return false;
}
}
return true;
}
void EwsRequest::setServerVersion(const EwsServerVersion &version)
{
mServerVersion = version;
}
EwsRequest::Response::Response(QXmlStreamReader &reader)
{
static constexpr auto respClasses = std::to_array({
QLatin1StringView("Success"),
QLatin1StringView("Warning"),
QLatin1StringView("Error"),
});
auto respClassRef = reader.attributes().value(QStringLiteral("ResponseClass"));
if (respClassRef.isNull()) {
mClass = EwsResponseParseError;
qCWarning(EWSCLI_LOG) << "ResponseClass attribute not found in response element";
return;
}
unsigned i = 0;
for (const auto &respClass : respClasses) {
if (respClass == respClassRef) {
mClass = static_cast<EwsResponseClass>(i);
break;
}
i++;
}
}
bool EwsRequest::Response::readResponseElement(QXmlStreamReader &reader)
{
if (reader.namespaceUri() != ewsMsgNsUri) {
return false;
}
if (reader.name() == QLatin1StringView("ResponseCode")) {
mCode = reader.readElementText();
} else if (reader.name() == QLatin1StringView("MessageText")) {
mMessage = reader.readElementText();
} else if (reader.name() == QLatin1StringView("DescriptiveLinkKey")) {
reader.skipCurrentElement();
} else if (reader.name() == QLatin1StringView("MessageXml")) {
reader.skipCurrentElement();
} else if (reader.name() == QLatin1StringView("ErrorSubscriptionIds")) {
reader.skipCurrentElement();
} else {
return false;
}
return true;
}
bool EwsRequest::readHeader(QXmlStreamReader &reader)
{
while (reader.readNextStartElement()) {
if (reader.name() == QLatin1StringView("ServerVersionInfo") && reader.namespaceUri() == ewsTypeNsUri) {
EwsServerVersion version(reader);
if (!version.isValid()) {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - error parsing server version.");
return false;
}
mServerVersion = version;
reader.skipCurrentElement();
} else {
reader.skipCurrentElement();
}
}
return true;
}
bool EwsRequest::Response::setErrorMsg(const QString &msg)
{
mClass = EwsResponseParseError;
mCode = QStringLiteral("ResponseParseError");
mMessage = msg;
qCWarningNC(EWSCLI_LOG) << msg;
return false;
}
void EwsRequest::dump() const
{
ewsLogDir.setAutoRemove(false);
if (ewsLogDir.isValid()) {
QTemporaryFile reqDumpFile(ewsLogDir.path() + QStringLiteral("/ews_xmlreqdump_XXXXXXX.xml"));
reqDumpFile.open();
reqDumpFile.setAutoRemove(false);
reqDumpFile.write(mBody.toUtf8());
reqDumpFile.close();
QTemporaryFile resDumpFile(ewsLogDir.path() + QStringLiteral("/ews_xmlresdump_XXXXXXX.xml"));
resDumpFile.open();
resDumpFile.setAutoRemove(false);
resDumpFile.write(mResponseData);
resDumpFile.close();
qCDebug(EWSCLI_LOG) << "request dumped to" << reqDumpFile.fileName();
qCDebug(EWSCLI_LOG) << "response dumped to" << resDumpFile.fileName();
} else {
qCWarning(EWSCLI_LOG) << "failed to dump request and response";
}
}
#include "moc_ewsrequest.cpp"
diff --git a/client/websocketclient.cpp b/client/websocketclient.cpp
index ef6ca6b..cca8fe8 100644
--- a/client/websocketclient.cpp
+++ b/client/websocketclient.cpp
@@ -1,353 +1,353 @@
// SPDX-FileCopyrightText: 2023 g10 code Gmbh
// SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "websocketclient.h"
// Qt headers
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QStandardPaths>
#include <QTimer>
#include <QUuid>
// KDE headers
#include <KLocalizedString>
#include <KMime/Message>
#include <Libkleo/KeyCache>
#include <MimeTreeParserCore/ObjectTreeParser>
// gpgme headers
#include <gpgme++/key.h>
#include "draft/draftmanager.h"
#include "editor/composerwindow.h"
#include "editor/composerwindowfactory.h"
#include "emailviewer.h"
#include "ews/ewsclient.h"
#include "ews/ewsfinditemrequest.h"
#include "ews/ewsgetitemrequest.h"
#include "ews/ewsid.h"
#include "ews/ewsitemshape.h"
#include "ews/ewstypes.h"
#include "gpgol_client_debug.h"
#include "gpgoljs_version.h"
#include "protocol.h"
#include "reencrypt/reencryptjob.h"
#include "websocket_debug.h"
using namespace Qt::Literals::StringLiterals;
namespace
{
QStringList trustedEmails(const std::shared_ptr<const Kleo::KeyCache> &keyCache)
{
QStringList emails;
const auto keys = keyCache->keys();
for (const auto &key : keys) {
for (const auto &userId : key.userIDs()) {
if (key.ownerTrust() == GpgME::Key::Ultimate) {
emails << QString::fromLatin1(userId.email()).toLower();
break;
}
}
}
return emails;
}
}
WebsocketClient &WebsocketClient::self(const QUrl &url, const QString &clientId)
{
static WebsocketClient *client = nullptr;
if (!client && url.isEmpty()) {
qFatal() << "Unable to create a client without an url";
} else if (!client) {
client = new WebsocketClient(url, clientId);
}
return *client;
};
WebsocketClient::WebsocketClient(const QUrl &url, const QString &clientId)
: QObject(nullptr)
, m_webSocket(QWebSocket(QStringLiteral("Client")))
, m_url(url)
, m_clientId(clientId)
, m_state(NotConnected)
, m_stateDisplay(i18nc("@info", "Loading..."))
{
auto globalKeyCache = Kleo::KeyCache::instance();
m_emails = trustedEmails(globalKeyCache);
if (m_emails.isEmpty()) {
qWarning() << "No ultimately keys found in keychain";
return;
}
connect(&m_webSocket, &QWebSocket::connected, this, &WebsocketClient::slotConnected);
connect(&m_webSocket, &QWebSocket::disconnected, this, [this] {
m_state = NotConnected;
m_stateDisplay = i18nc("@info", "Connection to outlook lost due to a disconnection with the broker.");
Q_EMIT stateChanged(m_stateDisplay);
});
connect(&m_webSocket, &QWebSocket::errorOccurred, this, &WebsocketClient::slotErrorOccurred);
connect(&m_webSocket, &QWebSocket::textMessageReceived, this, &WebsocketClient::slotTextMessageReceived);
connect(&m_webSocket, QOverload<const QList<QSslError> &>::of(&QWebSocket::sslErrors), this, [this](const QList<QSslError> &errors) {
// TODO remove
m_webSocket.ignoreSslErrors(errors);
});
QSslConfiguration sslConfiguration;
auto certPath = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QStringLiteral("certificate.pem"));
Q_ASSERT(!certPath.isEmpty());
QFile certFile(certPath);
if (!certFile.open(QIODevice::ReadOnly)) {
qFatal() << "Couldn't read certificate" << certPath;
}
QSslCertificate certificate(&certFile, QSsl::Pem);
certFile.close();
sslConfiguration.addCaCertificate(certificate);
m_webSocket.setSslConfiguration(sslConfiguration);
m_webSocket.open(url);
}
void WebsocketClient::slotConnected()
{
qCInfo(WEBSOCKET_LOG) << "websocket connected";
QJsonDocument doc(QJsonObject{
{"command"_L1, Protocol::commandToString(Protocol::Register)},
{
"arguments"_L1,
QJsonObject{{"emails"_L1, QJsonArray::fromStringList(m_emails)}, {"type"_L1, "nativeclient"_L1}},
},
});
m_webSocket.sendTextMessage(QString::fromUtf8(doc.toJson()));
m_state = NotConnected; /// We still need to connect to the web client
m_stateDisplay = i18nc("@info", "Waiting for web client.");
Q_EMIT stateChanged(m_stateDisplay);
}
void WebsocketClient::slotErrorOccurred(QAbstractSocket::SocketError error)
{
qCWarning(WEBSOCKET_LOG) << error << m_webSocket.errorString();
m_state = NotConnected;
m_stateDisplay = i18nc("@info", "Could not reach the Outlook extension.");
Q_EMIT stateChanged(m_stateDisplay);
reconnect();
}
bool WebsocketClient::sendEWSRequest(const QString &fromEmail, const QString &requestId, const QString &requestBody)
{
KMime::Types::Mailbox mailbox;
mailbox.fromUnicodeString(fromEmail);
const QJsonObject json{
{"command"_L1, Protocol::commandToString(Protocol::Ews)},
{"arguments"_L1,
QJsonObject{
{"body"_L1, requestBody},
{"email"_L1, QString::fromUtf8(mailbox.address())},
{"requestId"_L1, requestId},
}},
};
m_webSocket.sendTextMessage(QString::fromUtf8(QJsonDocument(json).toJson()));
return true;
}
void WebsocketClient::slotTextMessageReceived(QString message)
{
const auto doc = QJsonDocument::fromJson(message.toUtf8());
if (!doc.isObject()) {
qCWarning(WEBSOCKET_LOG) << "invalid text message received" << message;
return;
}
const auto object = doc.object();
const auto command = Protocol::commandFromString(object["command"_L1].toString());
const auto args = object["arguments"_L1].toObject();
switch (command) {
case Protocol::Disconnection:
// disconnection of the web client
m_state = NotConnected;
m_stateDisplay = i18nc("@info", "Connection to the Outlook extension lost. Make sure the extension pane is open.");
Q_EMIT stateChanged(m_stateDisplay);
return;
case Protocol::Connection:
// reconnection of the web client
m_state = Connected;
m_stateDisplay = i18nc("@info", "Connected.");
Q_EMIT stateChanged(m_stateDisplay);
return;
case Protocol::View: {
const auto email = args["email"_L1].toString();
const auto displayName = args["displayName"_L1].toString();
const auto content = args["body"_L1].toString();
const auto graphAccessToken = args["accessToken"_L1].toString().toUtf8();
if (!m_emailViewer) {
m_emailViewer = new EmailViewer(content, email, displayName, graphAccessToken);
m_emailViewer->setAttribute(Qt::WA_DeleteOnClose);
} else {
m_emailViewer->view(content, email, displayName, graphAccessToken);
}
m_emailViewer->show();
m_emailViewer->activateWindow();
m_emailViewer->raise();
return;
}
case Protocol::RestoreAutosave: {
const auto email = args["email"_L1].toString();
const auto displayName = args["displayName"_L1].toString();
const auto graphAccessToken = args["accessToken"_L1].toString().toUtf8();
ComposerWindowFactory::self().restoreAutosave(email, displayName, graphAccessToken);
return;
}
case Protocol::EwsResponse: {
// confirmation that the email was sent
const auto args = object["arguments"_L1].toObject();
Q_EMIT ewsResponseReceived(args["requestId"_L1].toString(), args["body"_L1].toString());
return;
}
case Protocol::Composer:
case Protocol::Reply:
case Protocol::Forward:
case Protocol::OpenDraft: {
const auto email = args["email"_L1].toString();
const auto displayName = args["displayName"_L1].toString();
const auto graphAccessToken = args["accessToken"_L1].toString().toUtf8();
auto dialog = ComposerWindowFactory::self().create(email, displayName, graphAccessToken);
if (command == Protocol::Reply || command == Protocol::Forward) {
const auto content = args["body"_L1].toString();
KMime::Message::Ptr message(new KMime::Message());
message->setContent(KMime::CRLFtoLF(content.toUtf8()));
message->parse();
if (command == Protocol::Reply) {
dialog->reply(message);
} else {
dialog->forward(message);
}
} else if (command == Protocol::OpenDraft) {
const auto draftId = args["id"_L1].toString();
if (draftId.isEmpty()) {
return;
}
const auto draft = DraftManager::self().draftById(draftId.toUtf8());
dialog->setMessage(draft.mime());
}
dialog->show();
dialog->activateWindow();
dialog->raise();
return;
}
case Protocol::DeleteDraft: {
const auto draftId = args["id"_L1].toString();
if (draftId.isEmpty()) {
qWarning() << "Draft not valid";
return;
}
const auto draft = DraftManager::self().draftById(draftId.toUtf8());
if (!draft.isValid()) {
qWarning() << "Draft not valid";
return;
}
if (!DraftManager::self().remove(draft)) {
qCWarning(GPGOL_CLIENT_LOG) << "Could not delete draft";
return;
}
return;
}
case Protocol::Reencrypt: {
reencrypt(args);
return;
}
case Protocol::Info: {
const auto content = args["body"_L1].toString();
KMime::Message::Ptr message(new KMime::Message());
message->setContent(KMime::CRLFtoLF(content.toUtf8()));
message->parse();
MimeTreeParser::ObjectTreeParser treeParser;
treeParser.parseObjectTree(message.get());
const QJsonObject json{{"command"_L1, Protocol::commandToString(Protocol::InfoFetched)},
{"arguments"_L1,
QJsonObject{
{"itemId"_L1, args["itemId"_L1]},
{"email"_L1, args["email"_L1]},
{"encrypted"_L1, treeParser.hasEncryptedParts()},
{"signed"_L1, treeParser.hasSignedParts()},
{"drafts"_L1, DraftManager::self().toJson()},
{"viewerOpen"_L1, !m_emailViewer.isNull()},
{"version"_L1, QStringLiteral(GPGOLJS_VERSION_STRING)},
}}};
m_webSocket.sendTextMessage(QString::fromUtf8(QJsonDocument(json).toJson()));
return;
}
default:
qCWarning(WEBSOCKET_LOG) << "Unhandled command" << command;
}
}
void WebsocketClient::reencrypt(const QJsonObject &args)
{
const auto content = args["body"_L1].toString();
qWarning() << "reecencry" << args["folderId"_L1].toString();
const EwsId folderId(args["folderId"_L1].toString());
- EwsClient client(args["email"_L1].toString());
+ EwsClient client(args["email"_L1].toString(), args["accessToken"_L1].toString().toUtf8());
auto reencryptjob = new ReencryptJob(this, folderId, client);
reencryptjob->start();
}
void WebsocketClient::reconnect()
{
QTimer::singleShot(1000ms, this, [this]() {
m_webSocket.open(m_url);
});
}
WebsocketClient::State WebsocketClient::state() const
{
return m_state;
}
QString WebsocketClient::stateDisplay() const
{
return m_stateDisplay;
}
void WebsocketClient::sendViewerClosed(const QString &email)
{
const QJsonObject json{
{"command"_L1, Protocol::commandToString(Protocol::ViewerClosed)},
{"arguments"_L1, QJsonObject{{"email"_L1, email}}},
};
m_webSocket.sendTextMessage(QString::fromUtf8(QJsonDocument(json).toJson()));
}
void WebsocketClient::sendViewerOpened(const QString &email)
{
const QJsonObject json{
{"command"_L1, Protocol::commandToString(Protocol::ViewerOpened)},
{"arguments"_L1, QJsonObject{{"email"_L1, email}}},
};
m_webSocket.sendTextMessage(QString::fromUtf8(QJsonDocument(json).toJson()));
}
diff --git a/web/dist/assets/index-BjC_RaBp.js b/web/dist/assets/index-BjC_RaBp.js
new file mode 100644
index 0000000..52e5ce0
--- /dev/null
+++ b/web/dist/assets/index-BjC_RaBp.js
@@ -0,0 +1,23 @@
+(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();const bn={"fr-FR":{"Loading...":"Chargement...","This mail is encrypted and signed.":"Ce email est encrypté et signé numériquement","This mail is encrypted.":"Ce email est encrypté"},"de-DE":{"Loading...":"Laden...","This mail is encrypted and signed.":"Diese E-Mail ist verschlüsselt und signiert","This mail is encrypted.":"Diese E-Mail ist verschlüsselt","This mail is signed":"Diese E-Mail ist signiert","This mail is not encrypted nor signed.":"Diese E-Mail ist nicht verschlüsselt und signiert",Decrypt:"Entschlüsseln","View email":"E-Mail anzeigen"}};/**
+* @vue/shared v3.5.13
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**//*! #__NO_SIDE_EFFECTS__ */function Ni(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const de={},kn=[],Tt=()=>{},Ph=()=>!1,co=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Mi=n=>n.startsWith("onUpdate:"),He=Object.assign,xi=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},Nh=Object.prototype.hasOwnProperty,te=(n,e)=>Nh.call(n,e),B=Array.isArray,Rn=n=>lo(n)==="[object Map]",rc=n=>lo(n)==="[object Set]",G=n=>typeof n=="function",pe=n=>typeof n=="string",Jt=n=>typeof n=="symbol",ue=n=>n!==null&&typeof n=="object",oc=n=>(ue(n)||G(n))&&G(n.then)&&G(n.catch),ic=Object.prototype.toString,lo=n=>ic.call(n),Mh=n=>lo(n).slice(8,-1),sc=n=>lo(n)==="[object Object]",Hi=n=>pe(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Jn=Ni(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ho=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},xh=/-(\w)/g,Wt=ho(n=>n.replace(xh,(e,t)=>t?t.toUpperCase():"")),Hh=/\B([A-Z])/g,Cn=ho(n=>n.replace(Hh,"-$1").toLowerCase()),ac=ho(n=>n.charAt(0).toUpperCase()+n.slice(1)),Bo=ho(n=>n?`on${ac(n)}`:""),qt=(n,e)=>!Object.is(n,e),Ko=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},cc=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})},Lh=n=>{const e=parseFloat(n);return isNaN(e)?n:e};let Zs;const uo=()=>Zs||(Zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Li(n){if(B(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],o=pe(r)?Bh(r):Li(r);if(o)for(const i in o)e[i]=o[i]}return e}else if(pe(n)||ue(n))return n}const Uh=/;(?![^(]*\))/g,Dh=/:([^]+)/,Fh=/\/\*[^]*?\*\//g;function Bh(n){const e={};return n.replace(Fh,"").split(Uh).forEach(t=>{if(t){const r=t.split(Dh);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Ui(n){let e="";if(pe(n))e=n;else if(B(n))for(let t=0;t<n.length;t++){const r=Ui(n[t]);r&&(e+=r+" ")}else if(ue(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const Kh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Gh=Ni(Kh);function lc(n){return!!n||n===""}const dc=n=>!!(n&&n.__v_isRef===!0),Ge=n=>pe(n)?n:n==null?"":B(n)||ue(n)&&(n.toString===ic||!G(n.toString))?dc(n)?Ge(n.value):JSON.stringify(n,hc,2):String(n),hc=(n,e)=>dc(e)?hc(n,e.value):Rn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[r,o],i)=>(t[Go(r,i)+" =>"]=o,t),{})}:rc(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Go(t))}:Jt(e)?Go(e):ue(e)&&!B(e)&&!sc(e)?String(e):e,Go=(n,e="")=>{var t;return Jt(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/**
+* @vue/reactivity v3.5.13
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/let Ve;class $h{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ve,!e&&Ve&&(this.index=(Ve.scopes||(Ve.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Ve;try{return Ve=this,e()}finally{Ve=t}}}on(){Ve=this}off(){Ve=this.parent}stop(e){if(this._active){this._active=!1;let t,r;for(t=0,r=this.effects.length;t<r;t++)this.effects[t].stop();for(this.effects.length=0,t=0,r=this.cleanups.length;t<r;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,r=this.scopes.length;t<r;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function qh(){return Ve}let le;const $o=new WeakSet;class uc{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ve&&Ve.active&&Ve.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,$o.has(this)&&($o.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ea(this),pc(this);const e=le,t=rt;le=this,rt=!0;try{return this.fn()}finally{mc(this),le=e,rt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Bi(e);this.deps=this.depsTail=void 0,ea(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?$o.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ri(this)&&this.run()}get dirty(){return ri(this)}}let fc=0,Xn,Zn;function gc(n,e=!1){if(n.flags|=8,e){n.next=Zn,Zn=n;return}n.next=Xn,Xn=n}function Di(){fc++}function Fi(){if(--fc>0)return;if(Zn){let e=Zn;for(Zn=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Xn;){let e=Xn;for(Xn=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function pc(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function mc(n){let e,t=n.depsTail,r=t;for(;r;){const o=r.prevDep;r.version===-1?(r===t&&(t=o),Bi(r),zh(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}n.deps=e,n.depsTail=t}function ri(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Cc(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Cc(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ar))return;n.globalVersion=ar;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!ri(n)){n.flags&=-3;return}const t=le,r=rt;le=n,rt=!0;try{pc(n);const o=n.fn(n._value);(e.version===0||qt(o,n._value))&&(n._value=o,e.version++)}catch(o){throw e.version++,o}finally{le=t,rt=r,mc(n),n.flags&=-3}}function Bi(n,e=!1){const{dep:t,prevSub:r,nextSub:o}=n;if(r&&(r.nextSub=o,n.prevSub=void 0),o&&(o.prevSub=r,n.nextSub=void 0),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let i=t.computed.deps;i;i=i.nextDep)Bi(i,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function zh(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let rt=!0;const yc=[];function Xt(){yc.push(rt),rt=!1}function Zt(){const n=yc.pop();rt=n===void 0?!0:n}function ea(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=le;le=void 0;try{e()}finally{le=t}}}let ar=0;class Vh{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ki{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!le||!rt||le===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==le)t=this.activeLink=new Vh(le,this),le.deps?(t.prevDep=le.depsTail,le.depsTail.nextDep=t,le.depsTail=t):le.deps=le.depsTail=t,Tc(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=le.depsTail,t.nextDep=void 0,le.depsTail.nextDep=t,le.depsTail=t,le.deps===t&&(le.deps=r)}return t}trigger(e){this.version++,ar++,this.notify(e)}notify(e){Di();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Fi()}}}function Tc(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Tc(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const oi=new WeakMap,dn=Symbol(""),ii=Symbol(""),cr=Symbol("");function Ie(n,e,t){if(rt&&le){let r=oi.get(n);r||oi.set(n,r=new Map);let o=r.get(t);o||(r.set(t,o=new Ki),o.map=r,o.key=t),o.track()}}function Pt(n,e,t,r,o,i){const s=oi.get(n);if(!s){ar++;return}const a=c=>{c&&c.trigger()};if(Di(),e==="clear")s.forEach(a);else{const c=B(n),l=c&&Hi(t);if(c&&t==="length"){const d=Number(r);s.forEach((h,p)=>{(p==="length"||p===cr||!Jt(p)&&p>=d)&&a(h)})}else switch((t!==void 0||s.has(void 0))&&a(s.get(t)),l&&a(s.get(cr)),e){case"add":c?l&&a(s.get("length")):(a(s.get(dn)),Rn(n)&&a(s.get(ii)));break;case"delete":c||(a(s.get(dn)),Rn(n)&&a(s.get(ii)));break;case"set":Rn(n)&&a(s.get(dn));break}}Fi()}function wn(n){const e=ee(n);return e===n?e:(Ie(e,"iterate",cr),Je(n)?e:e.map(Ee))}function fo(n){return Ie(n=ee(n),"iterate",cr),n}const jh={__proto__:null,[Symbol.iterator](){return qo(this,Symbol.iterator,Ee)},concat(...n){return wn(this).concat(...n.map(e=>B(e)?wn(e):e))},entries(){return qo(this,"entries",n=>(n[1]=Ee(n[1]),n))},every(n,e){return Et(this,"every",n,e,void 0,arguments)},filter(n,e){return Et(this,"filter",n,e,t=>t.map(Ee),arguments)},find(n,e){return Et(this,"find",n,e,Ee,arguments)},findIndex(n,e){return Et(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Et(this,"findLast",n,e,Ee,arguments)},findLastIndex(n,e){return Et(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Et(this,"forEach",n,e,void 0,arguments)},includes(...n){return zo(this,"includes",n)},indexOf(...n){return zo(this,"indexOf",n)},join(n){return wn(this).join(n)},lastIndexOf(...n){return zo(this,"lastIndexOf",n)},map(n,e){return Et(this,"map",n,e,void 0,arguments)},pop(){return Vn(this,"pop")},push(...n){return Vn(this,"push",n)},reduce(n,...e){return ta(this,"reduce",n,e)},reduceRight(n,...e){return ta(this,"reduceRight",n,e)},shift(){return Vn(this,"shift")},some(n,e){return Et(this,"some",n,e,void 0,arguments)},splice(...n){return Vn(this,"splice",n)},toReversed(){return wn(this).toReversed()},toSorted(n){return wn(this).toSorted(n)},toSpliced(...n){return wn(this).toSpliced(...n)},unshift(...n){return Vn(this,"unshift",n)},values(){return qo(this,"values",Ee)}};function qo(n,e,t){const r=fo(n),o=r[e]();return r!==n&&!Je(n)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=t(i.value)),i}),o}const Wh=Array.prototype;function Et(n,e,t,r,o,i){const s=fo(n),a=s!==n&&!Je(n),c=s[e];if(c!==Wh[e]){const h=c.apply(n,i);return a?Ee(h):h}let l=t;s!==n&&(a?l=function(h,p){return t.call(this,Ee(h),p,n)}:t.length>2&&(l=function(h,p){return t.call(this,h,p,n)}));const d=c.call(s,l,r);return a&&o?o(d):d}function ta(n,e,t,r){const o=fo(n);let i=t;return o!==n&&(Je(n)?t.length>3&&(i=function(s,a,c){return t.call(this,s,a,c,n)}):i=function(s,a,c){return t.call(this,s,Ee(a),c,n)}),o[e](i,...r)}function zo(n,e,t){const r=ee(n);Ie(r,"iterate",cr);const o=r[e](...t);return(o===-1||o===!1)&&zi(t[0])?(t[0]=ee(t[0]),r[e](...t)):o}function Vn(n,e,t=[]){Xt(),Di();const r=ee(n)[e].apply(n,t);return Fi(),Zt(),r}const Yh=Ni("__proto__,__v_isRef,__isVue"),Ac=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Jt));function Qh(n){Jt(n)||(n=String(n));const e=ee(this);return Ie(e,"has",n),e.hasOwnProperty(n)}class wc{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const o=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!o;if(t==="__v_isReadonly")return o;if(t==="__v_isShallow")return i;if(t==="__v_raw")return r===(o?i?su:_c:i?Ec:Ic).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=B(e);if(!o){let c;if(s&&(c=jh[t]))return c;if(t==="hasOwnProperty")return Qh}const a=Reflect.get(e,t,Se(e)?e:r);return(Jt(t)?Ac.has(t):Yh(t))||(o||Ie(e,"get",t),i)?a:Se(a)?s&&Hi(t)?a:a.value:ue(a)?o?Sc(a):$i(a):a}}class vc extends wc{constructor(e=!1){super(!1,e)}set(e,t,r,o){let i=e[t];if(!this._isShallow){const c=un(i);if(!Je(r)&&!un(r)&&(i=ee(i),r=ee(r)),!B(e)&&Se(i)&&!Se(r))return c?!1:(i.value=r,!0)}const s=B(e)&&Hi(t)?Number(t)<e.length:te(e,t),a=Reflect.set(e,t,r,Se(e)?e:o);return e===ee(o)&&(s?qt(r,i)&&Pt(e,"set",t,r):Pt(e,"add",t,r)),a}deleteProperty(e,t){const r=te(e,t);e[t];const o=Reflect.deleteProperty(e,t);return o&&r&&Pt(e,"delete",t,void 0),o}has(e,t){const r=Reflect.has(e,t);return(!Jt(t)||!Ac.has(t))&&Ie(e,"has",t),r}ownKeys(e){return Ie(e,"iterate",B(e)?"length":dn),Reflect.ownKeys(e)}}class Jh extends wc{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Xh=new vc,Zh=new Jh,eu=new vc(!0);const si=n=>n,vr=n=>Reflect.getPrototypeOf(n);function tu(n,e,t){return function(...r){const o=this.__v_raw,i=ee(o),s=Rn(i),a=n==="entries"||n===Symbol.iterator&&s,c=n==="keys"&&s,l=o[n](...r),d=t?si:e?ai:Ee;return!e&&Ie(i,"iterate",c?ii:dn),{next(){const{value:h,done:p}=l.next();return p?{value:h,done:p}:{value:a?[d(h[0]),d(h[1])]:d(h),done:p}},[Symbol.iterator](){return this}}}}function Ir(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function nu(n,e){const t={get(o){const i=this.__v_raw,s=ee(i),a=ee(o);n||(qt(o,a)&&Ie(s,"get",o),Ie(s,"get",a));const{has:c}=vr(s),l=e?si:n?ai:Ee;if(c.call(s,o))return l(i.get(o));if(c.call(s,a))return l(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!n&&Ie(ee(o),"iterate",dn),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=ee(i),a=ee(o);return n||(qt(o,a)&&Ie(s,"has",o),Ie(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,c=ee(a),l=e?si:n?ai:Ee;return!n&&Ie(c,"iterate",dn),a.forEach((d,h)=>o.call(i,l(d),l(h),s))}};return He(t,n?{add:Ir("add"),set:Ir("set"),delete:Ir("delete"),clear:Ir("clear")}:{add(o){!e&&!Je(o)&&!un(o)&&(o=ee(o));const i=ee(this);return vr(i).has.call(i,o)||(i.add(o),Pt(i,"add",o,o)),this},set(o,i){!e&&!Je(i)&&!un(i)&&(i=ee(i));const s=ee(this),{has:a,get:c}=vr(s);let l=a.call(s,o);l||(o=ee(o),l=a.call(s,o));const d=c.call(s,o);return s.set(o,i),l?qt(i,d)&&Pt(s,"set",o,i):Pt(s,"add",o,i),this},delete(o){const i=ee(this),{has:s,get:a}=vr(i);let c=s.call(i,o);c||(o=ee(o),c=s.call(i,o)),a&&a.call(i,o);const l=i.delete(o);return c&&Pt(i,"delete",o,void 0),l},clear(){const o=ee(this),i=o.size!==0,s=o.clear();return i&&Pt(o,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=tu(o,n,e)}),t}function Gi(n,e){const t=nu(n,e);return(r,o,i)=>o==="__v_isReactive"?!n:o==="__v_isReadonly"?n:o==="__v_raw"?r:Reflect.get(te(t,o)&&o in r?t:r,o,i)}const ru={get:Gi(!1,!1)},ou={get:Gi(!1,!0)},iu={get:Gi(!0,!1)};const Ic=new WeakMap,Ec=new WeakMap,_c=new WeakMap,su=new WeakMap;function au(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cu(n){return n.__v_skip||!Object.isExtensible(n)?0:au(Mh(n))}function $i(n){return un(n)?n:qi(n,!1,Xh,ru,Ic)}function lu(n){return qi(n,!1,eu,ou,Ec)}function Sc(n){return qi(n,!0,Zh,iu,_c)}function qi(n,e,t,r,o){if(!ue(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const i=o.get(n);if(i)return i;const s=cu(n);if(s===0)return n;const a=new Proxy(n,s===2?r:t);return o.set(n,a),a}function On(n){return un(n)?On(n.__v_raw):!!(n&&n.__v_isReactive)}function un(n){return!!(n&&n.__v_isReadonly)}function Je(n){return!!(n&&n.__v_isShallow)}function zi(n){return n?!!n.__v_raw:!1}function ee(n){const e=n&&n.__v_raw;return e?ee(e):n}function du(n){return!te(n,"__v_skip")&&Object.isExtensible(n)&&cc(n,"__v_skip",!0),n}const Ee=n=>ue(n)?$i(n):n,ai=n=>ue(n)?Sc(n):n;function Se(n){return n?n.__v_isRef===!0:!1}function _t(n){return hu(n,!1)}function hu(n,e){return Se(n)?n:new uu(n,e)}class uu{constructor(e,t){this.dep=new Ki,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ee(e),this._value=t?e:Ee(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||Je(e)||un(e);e=r?e:ee(e),qt(e,t)&&(this._rawValue=e,this._value=r?e:Ee(e),this.dep.trigger())}}function bt(n){return Se(n)?n.value:n}const fu={get:(n,e,t)=>e==="__v_raw"?n:bt(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const o=n[e];return Se(o)&&!Se(t)?(o.value=t,!0):Reflect.set(n,e,t,r)}};function bc(n){return On(n)?n:new Proxy(n,fu)}class gu{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ki(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ar-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&le!==this)return gc(this,!0),!0}get value(){const e=this.dep.track();return Cc(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function pu(n,e,t=!1){let r,o;return G(n)?r=n:(r=n.get,o=n.set),new gu(r,o,t)}const Er={},Br=new WeakMap;let sn;function mu(n,e=!1,t=sn){if(t){let r=Br.get(t);r||Br.set(t,r=[]),r.push(n)}}function Cu(n,e,t=de){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=t,l=H=>o?H:Je(H)||o===!1||o===0?Kt(H,1):Kt(H);let d,h,p,y,k=!1,S=!1;if(Se(n)?(h=()=>n.value,k=Je(n)):On(n)?(h=()=>l(n),k=!0):B(n)?(S=!0,k=n.some(H=>On(H)||Je(H)),h=()=>n.map(H=>{if(Se(H))return H.value;if(On(H))return l(H);if(G(H))return c?c(H,2):H()})):G(n)?e?h=c?()=>c(n,2):n:h=()=>{if(p){Xt();try{p()}finally{Zt()}}const H=sn;sn=d;try{return c?c(n,3,[y]):n(y)}finally{sn=H}}:h=Tt,e&&o){const H=h,ae=o===!0?1/0:o;h=()=>Kt(H(),ae)}const $=qh(),D=()=>{d.stop(),$&&$.active&&xi($.effects,d)};if(i&&e){const H=e;e=(...ae)=>{H(...ae),D()}}let z=S?new Array(n.length).fill(Er):Er;const Y=H=>{if(!(!(d.flags&1)||!d.dirty&&!H))if(e){const ae=d.run();if(o||k||(S?ae.some((De,we)=>qt(De,z[we])):qt(ae,z))){p&&p();const De=sn;sn=d;try{const we=[ae,z===Er?void 0:S&&z[0]===Er?[]:z,y];c?c(e,3,we):e(...we),z=ae}finally{sn=De}}}else d.run()};return a&&a(Y),d=new uc(h),d.scheduler=s?()=>s(Y,!1):Y,y=H=>mu(H,!1,d),p=d.onStop=()=>{const H=Br.get(d);if(H){if(c)c(H,4);else for(const ae of H)ae();Br.delete(d)}},e?r?Y(!0):z=d.run():s?s(Y.bind(null,!0),!0):d.run(),D.pause=d.pause.bind(d),D.resume=d.resume.bind(d),D.stop=D,D}function Kt(n,e=1/0,t){if(e<=0||!ue(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Se(n))Kt(n.value,e,t);else if(B(n))for(let r=0;r<n.length;r++)Kt(n[r],e,t);else if(rc(n)||Rn(n))n.forEach(r=>{Kt(r,e,t)});else if(sc(n)){for(const r in n)Kt(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Kt(n[r],e,t)}return n}/**
+* @vue/runtime-core v3.5.13
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/function Cr(n,e,t,r){try{return r?n(...r):n()}catch(o){go(o,e,t)}}function At(n,e,t,r){if(G(n)){const o=Cr(n,e,t,r);return o&&oc(o)&&o.catch(i=>{go(i,e,t)}),o}if(B(n)){const o=[];for(let i=0;i<n.length;i++)o.push(At(n[i],e,t,r));return o}}function go(n,e,t,r=!0){const o=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||de;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const d=a.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](n,c,l)===!1)return}a=a.parent}if(i){Xt(),Cr(i,null,10,[n,c,l]),Zt();return}}yu(n,t,o,r,s)}function yu(n,e,t,r=!0,o=!1){if(o)throw n;console.error(n)}const Pe=[];let ut=-1;const Pn=[];let Ft=null,In=0;const kc=Promise.resolve();let Kr=null;function Tu(n){const e=Kr||kc;return n?e.then(this?n.bind(this):n):e}function Au(n){let e=ut+1,t=Pe.length;for(;e<t;){const r=e+t>>>1,o=Pe[r],i=lr(o);i<n||i===n&&o.flags&2?e=r+1:t=r}return e}function Vi(n){if(!(n.flags&1)){const e=lr(n),t=Pe[Pe.length-1];!t||!(n.flags&2)&&e>=lr(t)?Pe.push(n):Pe.splice(Au(e),0,n),n.flags|=1,Rc()}}function Rc(){Kr||(Kr=kc.then(Pc))}function wu(n){B(n)?Pn.push(...n):Ft&&n.id===-1?Ft.splice(In+1,0,n):n.flags&1||(Pn.push(n),n.flags|=1),Rc()}function na(n,e,t=ut+1){for(;t<Pe.length;t++){const r=Pe[t];if(r&&r.flags&2){if(n&&r.id!==n.uid)continue;Pe.splice(t,1),t--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Oc(n){if(Pn.length){const e=[...new Set(Pn)].sort((t,r)=>lr(t)-lr(r));if(Pn.length=0,Ft){Ft.push(...e);return}for(Ft=e,In=0;In<Ft.length;In++){const t=Ft[In];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}Ft=null,In=0}}const lr=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Pc(n){try{for(ut=0;ut<Pe.length;ut++){const e=Pe[ut];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Cr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ut<Pe.length;ut++){const e=Pe[ut];e&&(e.flags&=-2)}ut=-1,Pe.length=0,Oc(),Kr=null,(Pe.length||Pn.length)&&Pc()}}let Ct=null,Nc=null;function Gr(n){const e=Ct;return Ct=n,Nc=n&&n.type.__scopeId||null,e}function vu(n,e=Ct,t){if(!e||n._n)return n;const r=(...o)=>{r._d&&ha(-1);const i=Gr(e);let s;try{s=n(...o)}finally{Gr(i),r._d&&ha(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function rn(n,e,t,r){const o=n.dirs,i=e&&e.dirs;for(let s=0;s<o.length;s++){const a=o[s];i&&(a.oldValue=i[s].value);let c=a.dir[r];c&&(Xt(),At(c,t,8,[n.el,a,n,e]),Zt())}}const Iu=Symbol("_vte"),Eu=n=>n.__isTeleport;function ji(n,e){n.shapeFlag&6&&n.component?(n.transition=e,ji(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Mc(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function $r(n,e,t,r,o=!1){if(B(n)){n.forEach((k,S)=>$r(k,e&&(B(e)?e[S]:e),t,r,o));return}if(er(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&$r(n,e,t,r.component.subTree);return}const i=r.shapeFlag&4?Qi(r.component):r.el,s=o?null:i,{i:a,r:c}=n,l=e&&e.r,d=a.refs===de?a.refs={}:a.refs,h=a.setupState,p=ee(h),y=h===de?()=>!1:k=>te(p,k);if(l!=null&&l!==c&&(pe(l)?(d[l]=null,y(l)&&(h[l]=null)):Se(l)&&(l.value=null)),G(c))Cr(c,a,12,[s,d]);else{const k=pe(c),S=Se(c);if(k||S){const $=()=>{if(n.f){const D=k?y(c)?h[c]:d[c]:c.value;o?B(D)&&xi(D,i):B(D)?D.includes(i)||D.push(i):k?(d[c]=[i],y(c)&&(h[c]=d[c])):(c.value=[i],n.k&&(d[n.k]=c.value))}else k?(d[c]=s,y(c)&&(h[c]=s)):S&&(c.value=s,n.k&&(d[n.k]=s))};s?($.id=-1,qe($,t)):$()}}}uo().requestIdleCallback;uo().cancelIdleCallback;const er=n=>!!n.type.__asyncLoader,xc=n=>n.type.__isKeepAlive;function _u(n,e){Hc(n,"a",e)}function Su(n,e){Hc(n,"da",e)}function Hc(n,e,t=Me){const r=n.__wdc||(n.__wdc=()=>{let o=t;for(;o;){if(o.isDeactivated)return;o=o.parent}return n()});if(po(e,r,t),t){let o=t.parent;for(;o&&o.parent;)xc(o.parent.vnode)&&bu(r,e,t,o),o=o.parent}}function bu(n,e,t,r){const o=po(e,n,r,!0);Uc(()=>{xi(r[e],o)},t)}function po(n,e,t=Me,r=!1){if(t){const o=t[n]||(t[n]=[]),i=e.__weh||(e.__weh=(...s)=>{Xt();const a=yr(t),c=At(e,t,n,s);return a(),Zt(),c});return r?o.unshift(i):o.push(i),i}}const Lt=n=>(e,t=Me)=>{(!hr||n==="sp")&&po(n,(...r)=>e(...r),t)},ku=Lt("bm"),Lc=Lt("m"),Ru=Lt("bu"),Ou=Lt("u"),Pu=Lt("bum"),Uc=Lt("um"),Nu=Lt("sp"),Mu=Lt("rtg"),xu=Lt("rtc");function Hu(n,e=Me){po("ec",n,e)}const Lu=Symbol.for("v-ndc");function Uu(n,e,t,r){let o;const i=t,s=B(n);if(s||pe(n)){const a=s&&On(n);let c=!1;a&&(c=!Je(n),n=fo(n)),o=new Array(n.length);for(let l=0,d=n.length;l<d;l++)o[l]=e(c?Ee(n[l]):n[l],l,void 0,i)}else if(typeof n=="number"){o=new Array(n);for(let a=0;a<n;a++)o[a]=e(a+1,a,void 0,i)}else if(ue(n))if(n[Symbol.iterator])o=Array.from(n,(a,c)=>e(a,c,void 0,i));else{const a=Object.keys(n);o=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const d=a[c];o[c]=e(n[d],d,c,i)}}else o=[];return o}const ci=n=>n?il(n)?Qi(n):ci(n.parent):null,tr=He(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>ci(n.parent),$root:n=>ci(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Fc(n),$forceUpdate:n=>n.f||(n.f=()=>{Vi(n.update)}),$nextTick:n=>n.n||(n.n=Tu.bind(n.proxy)),$watch:n=>sf.bind(n)}),Vo=(n,e)=>n!==de&&!n.__isScriptSetup&&te(n,e),Du={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:r,data:o,props:i,accessCache:s,type:a,appContext:c}=n;let l;if(e[0]!=="$"){const y=s[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return o[e];case 4:return t[e];case 3:return i[e]}else{if(Vo(r,e))return s[e]=1,r[e];if(o!==de&&te(o,e))return s[e]=2,o[e];if((l=n.propsOptions[0])&&te(l,e))return s[e]=3,i[e];if(t!==de&&te(t,e))return s[e]=4,t[e];li&&(s[e]=0)}}const d=tr[e];let h,p;if(d)return e==="$attrs"&&Ie(n.attrs,"get",""),d(n);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==de&&te(t,e))return s[e]=4,t[e];if(p=c.config.globalProperties,te(p,e))return p[e]},set({_:n},e,t){const{data:r,setupState:o,ctx:i}=n;return Vo(o,e)?(o[e]=t,!0):r!==de&&te(r,e)?(r[e]=t,!0):te(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(i[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:o,propsOptions:i}},s){let a;return!!t[s]||n!==de&&te(n,s)||Vo(e,s)||(a=i[0])&&te(a,s)||te(r,s)||te(tr,s)||te(o.config.globalProperties,s)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:te(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function ra(n){return B(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let li=!0;function Fu(n){const e=Fc(n),t=n.proxy,r=n.ctx;li=!1,e.beforeCreate&&oa(e.beforeCreate,n,"bc");const{data:o,computed:i,methods:s,watch:a,provide:c,inject:l,created:d,beforeMount:h,mounted:p,beforeUpdate:y,updated:k,activated:S,deactivated:$,beforeDestroy:D,beforeUnmount:z,destroyed:Y,unmounted:H,render:ae,renderTracked:De,renderTriggered:we,errorCaptured:Ye,serverPrefetch:Ut,expose:Fe,inheritAttrs:tn,components:nn,directives:Tn,filters:V}=e;if(l&&Bu(l,r,null),s)for(const ie in s){const oe=s[ie];G(oe)&&(r[ie]=oe.bind(t))}if(o){const ie=o.call(t,t);ue(ie)&&(n.data=$i(ie))}if(li=!0,i)for(const ie in i){const oe=i[ie],vt=G(oe)?oe.bind(t,t):G(oe.get)?oe.get.bind(t,t):Tt,An=!G(oe)&&G(oe.set)?oe.set.bind(t):Tt,It=Lr({get:vt,set:An});Object.defineProperty(r,ie,{enumerable:!0,configurable:!0,get:()=>It.value,set:Ze=>It.value=Ze})}if(a)for(const ie in a)Dc(a[ie],r,t,ie);if(c){const ie=G(c)?c.call(t):c;Reflect.ownKeys(ie).forEach(oe=>{Vu(oe,ie[oe])})}d&&oa(d,n,"c");function Q(ie,oe){B(oe)?oe.forEach(vt=>ie(vt.bind(t))):oe&&ie(oe.bind(t))}if(Q(ku,h),Q(Lc,p),Q(Ru,y),Q(Ou,k),Q(_u,S),Q(Su,$),Q(Hu,Ye),Q(xu,De),Q(Mu,we),Q(Pu,z),Q(Uc,H),Q(Nu,Ut),B(Fe))if(Fe.length){const ie=n.exposed||(n.exposed={});Fe.forEach(oe=>{Object.defineProperty(ie,oe,{get:()=>t[oe],set:vt=>t[oe]=vt})})}else n.exposed||(n.exposed={});ae&&n.render===Tt&&(n.render=ae),tn!=null&&(n.inheritAttrs=tn),nn&&(n.components=nn),Tn&&(n.directives=Tn),Ut&&Mc(n)}function Bu(n,e,t=Tt){B(n)&&(n=di(n));for(const r in n){const o=n[r];let i;ue(o)?"default"in o?i=xr(o.from||r,o.default,!0):i=xr(o.from||r):i=xr(o),Se(i)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[r]=i}}function oa(n,e,t){At(B(n)?n.map(r=>r.bind(e.proxy)):n.bind(e.proxy),e,t)}function Dc(n,e,t,r){let o=r.includes(".")?Zc(t,r):()=>t[r];if(pe(n)){const i=e[n];G(i)&&Wo(o,i)}else if(G(n))Wo(o,n.bind(t));else if(ue(n))if(B(n))n.forEach(i=>Dc(i,e,t,r));else{const i=G(n.handler)?n.handler.bind(t):e[n.handler];G(i)&&Wo(o,i,n)}}function Fc(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=n.appContext,a=i.get(e);let c;return a?c=a:!o.length&&!t&&!r?c=e:(c={},o.length&&o.forEach(l=>qr(c,l,s,!0)),qr(c,e,s)),ue(e)&&i.set(e,c),c}function qr(n,e,t,r=!1){const{mixins:o,extends:i}=e;i&&qr(n,i,t,!0),o&&o.forEach(s=>qr(n,s,t,!0));for(const s in e)if(!(r&&s==="expose")){const a=Ku[s]||t&&t[s];n[s]=a?a(n[s],e[s]):e[s]}return n}const Ku={data:ia,props:sa,emits:sa,methods:Yn,computed:Yn,beforeCreate:ke,created:ke,beforeMount:ke,mounted:ke,beforeUpdate:ke,updated:ke,beforeDestroy:ke,beforeUnmount:ke,destroyed:ke,unmounted:ke,activated:ke,deactivated:ke,errorCaptured:ke,serverPrefetch:ke,components:Yn,directives:Yn,watch:$u,provide:ia,inject:Gu};function ia(n,e){return e?n?function(){return He(G(n)?n.call(this,this):n,G(e)?e.call(this,this):e)}:e:n}function Gu(n,e){return Yn(di(n),di(e))}function di(n){if(B(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function ke(n,e){return n?[...new Set([].concat(n,e))]:e}function Yn(n,e){return n?He(Object.create(null),n,e):e}function sa(n,e){return n?B(n)&&B(e)?[...new Set([...n,...e])]:He(Object.create(null),ra(n),ra(e??{})):e}function $u(n,e){if(!n)return e;if(!e)return n;const t=He(Object.create(null),n);for(const r in e)t[r]=ke(n[r],e[r]);return t}function Bc(){return{app:null,config:{isNativeTag:Ph,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let qu=0;function zu(n,e){return function(r,o=null){G(r)||(r=He({},r)),o!=null&&!ue(o)&&(o=null);const i=Bc(),s=new WeakSet,a=[];let c=!1;const l=i.app={_uid:qu++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:bf,get config(){return i.config},set config(d){},use(d,...h){return s.has(d)||(d&&G(d.install)?(s.add(d),d.install(l,...h)):G(d)&&(s.add(d),d(l,...h))),l},mixin(d){return i.mixins.includes(d)||i.mixins.push(d),l},component(d,h){return h?(i.components[d]=h,l):i.components[d]},directive(d,h){return h?(i.directives[d]=h,l):i.directives[d]},mount(d,h,p){if(!c){const y=l._ceVNode||Mt(r,o);return y.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),n(y,d,p),c=!0,l._container=d,d.__vue_app__=l,Qi(y.component)}},onUnmount(d){a.push(d)},unmount(){c&&(At(a,l._instance,16),n(null,l._container),delete l._container.__vue_app__)},provide(d,h){return i.provides[d]=h,l},runWithContext(d){const h=Nn;Nn=l;try{return d()}finally{Nn=h}}};return l}}let Nn=null;function Vu(n,e){if(Me){let t=Me.provides;const r=Me.parent&&Me.parent.provides;r===t&&(t=Me.provides=Object.create(r)),t[n]=e}}function xr(n,e,t=!1){const r=Me||Ct;if(r||Nn){const o=Nn?Nn._context.provides:r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&n in o)return o[n];if(arguments.length>1)return t&&G(e)?e.call(r&&r.proxy):e}}const Kc={},Gc=()=>Object.create(Kc),$c=n=>Object.getPrototypeOf(n)===Kc;function ju(n,e,t,r=!1){const o={},i=Gc();n.propsDefaults=Object.create(null),qc(n,e,o,i);for(const s in n.propsOptions[0])s in o||(o[s]=void 0);t?n.props=r?o:lu(o):n.type.props?n.props=o:n.props=i,n.attrs=i}function Wu(n,e,t,r){const{props:o,attrs:i,vnode:{patchFlag:s}}=n,a=ee(o),[c]=n.propsOptions;let l=!1;if((r||s>0)&&!(s&16)){if(s&8){const d=n.vnode.dynamicProps;for(let h=0;h<d.length;h++){let p=d[h];if(mo(n.emitsOptions,p))continue;const y=e[p];if(c)if(te(i,p))y!==i[p]&&(i[p]=y,l=!0);else{const k=Wt(p);o[k]=hi(c,a,k,y,n,!1)}else y!==i[p]&&(i[p]=y,l=!0)}}}else{qc(n,e,o,i)&&(l=!0);let d;for(const h in a)(!e||!te(e,h)&&((d=Cn(h))===h||!te(e,d)))&&(c?t&&(t[h]!==void 0||t[d]!==void 0)&&(o[h]=hi(c,a,h,void 0,n,!0)):delete o[h]);if(i!==a)for(const h in i)(!e||!te(e,h))&&(delete i[h],l=!0)}l&&Pt(n.attrs,"set","")}function qc(n,e,t,r){const[o,i]=n.propsOptions;let s=!1,a;if(e)for(let c in e){if(Jn(c))continue;const l=e[c];let d;o&&te(o,d=Wt(c))?!i||!i.includes(d)?t[d]=l:(a||(a={}))[d]=l:mo(n.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,s=!0)}if(i){const c=ee(t),l=a||de;for(let d=0;d<i.length;d++){const h=i[d];t[h]=hi(o,c,h,l[h],n,!te(l,h))}}return s}function hi(n,e,t,r,o,i){const s=n[t];if(s!=null){const a=te(s,"default");if(a&&r===void 0){const c=s.default;if(s.type!==Function&&!s.skipFactory&&G(c)){const{propsDefaults:l}=o;if(t in l)r=l[t];else{const d=yr(o);r=l[t]=c.call(null,e),d()}}else r=c;o.ce&&o.ce._setProp(t,r)}s[0]&&(i&&!a?r=!1:s[1]&&(r===""||r===Cn(t))&&(r=!0))}return r}const Yu=new WeakMap;function zc(n,e,t=!1){const r=t?Yu:e.propsCache,o=r.get(n);if(o)return o;const i=n.props,s={},a=[];let c=!1;if(!G(n)){const d=h=>{c=!0;const[p,y]=zc(h,e,!0);He(s,p),y&&a.push(...y)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!i&&!c)return ue(n)&&r.set(n,kn),kn;if(B(i))for(let d=0;d<i.length;d++){const h=Wt(i[d]);aa(h)&&(s[h]=de)}else if(i)for(const d in i){const h=Wt(d);if(aa(h)){const p=i[d],y=s[h]=B(p)||G(p)?{type:p}:He({},p),k=y.type;let S=!1,$=!0;if(B(k))for(let D=0;D<k.length;++D){const z=k[D],Y=G(z)&&z.name;if(Y==="Boolean"){S=!0;break}else Y==="String"&&($=!1)}else S=G(k)&&k.name==="Boolean";y[0]=S,y[1]=$,(S||te(y,"default"))&&a.push(h)}}const l=[s,a];return ue(n)&&r.set(n,l),l}function aa(n){return n[0]!=="$"&&!Jn(n)}const Vc=n=>n[0]==="_"||n==="$stable",Wi=n=>B(n)?n.map(gt):[gt(n)],Qu=(n,e,t)=>{if(e._n)return e;const r=vu((...o)=>Wi(e(...o)),t);return r._c=!1,r},jc=(n,e,t)=>{const r=n._ctx;for(const o in n){if(Vc(o))continue;const i=n[o];if(G(i))e[o]=Qu(o,i,r);else if(i!=null){const s=Wi(i);e[o]=()=>s}}},Wc=(n,e)=>{const t=Wi(e);n.slots.default=()=>t},Yc=(n,e,t)=>{for(const r in e)(t||r!=="_")&&(n[r]=e[r])},Ju=(n,e,t)=>{const r=n.slots=Gc();if(n.vnode.shapeFlag&32){const o=e._;o?(Yc(r,e,t),t&&cc(r,"_",o,!0)):jc(e,r)}else e&&Wc(n,e)},Xu=(n,e,t)=>{const{vnode:r,slots:o}=n;let i=!0,s=de;if(r.shapeFlag&32){const a=e._;a?t&&a===1?i=!1:Yc(o,e,t):(i=!e.$stable,jc(e,o)),s=e}else e&&(Wc(n,e),s={default:1});if(i)for(const a in o)!Vc(a)&&s[a]==null&&delete o[a]},qe=ff;function Zu(n){return ef(n)}function ef(n,e){const t=uo();t.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:s,createText:a,createComment:c,setText:l,setElementText:d,parentNode:h,nextSibling:p,setScopeId:y=Tt,insertStaticContent:k}=n,S=(u,g,m,I=null,A=null,v=null,R=void 0,b=null,_=!!g.dynamicChildren)=>{if(u===g)return;u&&!jn(u,g)&&(I=wr(u),Ze(u,A,v,!0),u=null),g.patchFlag===-2&&(_=!1,g.dynamicChildren=null);const{type:E,ref:U,shapeFlag:O}=g;switch(E){case Co:$(u,g,m,I);break;case fn:D(u,g,m,I);break;case Yo:u==null&&z(g,m,I,R);break;case ft:nn(u,g,m,I,A,v,R,b,_);break;default:O&1?ae(u,g,m,I,A,v,R,b,_):O&6?Tn(u,g,m,I,A,v,R,b,_):(O&64||O&128)&&E.process(u,g,m,I,A,v,R,b,_,qn)}U!=null&&A&&$r(U,u&&u.ref,v,g||u,!g)},$=(u,g,m,I)=>{if(u==null)r(g.el=a(g.children),m,I);else{const A=g.el=u.el;g.children!==u.children&&l(A,g.children)}},D=(u,g,m,I)=>{u==null?r(g.el=c(g.children||""),m,I):g.el=u.el},z=(u,g,m,I)=>{[u.el,u.anchor]=k(u.children,g,m,I,u.el,u.anchor)},Y=({el:u,anchor:g},m,I)=>{let A;for(;u&&u!==g;)A=p(u),r(u,m,I),u=A;r(g,m,I)},H=({el:u,anchor:g})=>{let m;for(;u&&u!==g;)m=p(u),o(u),u=m;o(g)},ae=(u,g,m,I,A,v,R,b,_)=>{g.type==="svg"?R="svg":g.type==="math"&&(R="mathml"),u==null?De(g,m,I,A,v,R,b,_):Ut(u,g,A,v,R,b,_)},De=(u,g,m,I,A,v,R,b)=>{let _,E;const{props:U,shapeFlag:O,transition:L,dirs:F}=u;if(_=u.el=s(u.type,v,U&&U.is,U),O&8?d(_,u.children):O&16&&Ye(u.children,_,null,I,A,jo(u,v),R,b),F&&rn(u,null,I,"created"),we(_,u,u.scopeId,R,I),U){for(const ce in U)ce!=="value"&&!Jn(ce)&&i(_,ce,null,U[ce],v,I);"value"in U&&i(_,"value",null,U.value,v),(E=U.onVnodeBeforeMount)&&dt(E,I,u)}F&&rn(u,null,I,"beforeMount");const j=tf(A,L);j&&L.beforeEnter(_),r(_,g,m),((E=U&&U.onVnodeMounted)||j||F)&&qe(()=>{E&&dt(E,I,u),j&&L.enter(_),F&&rn(u,null,I,"mounted")},A)},we=(u,g,m,I,A)=>{if(m&&y(u,m),I)for(let v=0;v<I.length;v++)y(u,I[v]);if(A){let v=A.subTree;if(g===v||tl(v.type)&&(v.ssContent===g||v.ssFallback===g)){const R=A.vnode;we(u,R,R.scopeId,R.slotScopeIds,A.parent)}}},Ye=(u,g,m,I,A,v,R,b,_=0)=>{for(let E=_;E<u.length;E++){const U=u[E]=b?Bt(u[E]):gt(u[E]);S(null,U,g,m,I,A,v,R,b)}},Ut=(u,g,m,I,A,v,R)=>{const b=g.el=u.el;let{patchFlag:_,dynamicChildren:E,dirs:U}=g;_|=u.patchFlag&16;const O=u.props||de,L=g.props||de;let F;if(m&&on(m,!1),(F=L.onVnodeBeforeUpdate)&&dt(F,m,g,u),U&&rn(g,u,m,"beforeUpdate"),m&&on(m,!0),(O.innerHTML&&L.innerHTML==null||O.textContent&&L.textContent==null)&&d(b,""),E?Fe(u.dynamicChildren,E,b,m,I,jo(g,A),v):R||oe(u,g,b,null,m,I,jo(g,A),v,!1),_>0){if(_&16)tn(b,O,L,m,A);else if(_&2&&O.class!==L.class&&i(b,"class",null,L.class,A),_&4&&i(b,"style",O.style,L.style,A),_&8){const j=g.dynamicProps;for(let ce=0;ce<j.length;ce++){const ne=j[ce],Be=O[ne],Ue=L[ne];(Ue!==Be||ne==="value")&&i(b,ne,Be,Ue,A,m)}}_&1&&u.children!==g.children&&d(b,g.children)}else!R&&E==null&&tn(b,O,L,m,A);((F=L.onVnodeUpdated)||U)&&qe(()=>{F&&dt(F,m,g,u),U&&rn(g,u,m,"updated")},I)},Fe=(u,g,m,I,A,v,R)=>{for(let b=0;b<g.length;b++){const _=u[b],E=g[b],U=_.el&&(_.type===ft||!jn(_,E)||_.shapeFlag&70)?h(_.el):m;S(_,E,U,null,I,A,v,R,!0)}},tn=(u,g,m,I,A)=>{if(g!==m){if(g!==de)for(const v in g)!Jn(v)&&!(v in m)&&i(u,v,g[v],null,A,I);for(const v in m){if(Jn(v))continue;const R=m[v],b=g[v];R!==b&&v!=="value"&&i(u,v,b,R,A,I)}"value"in m&&i(u,"value",g.value,m.value,A)}},nn=(u,g,m,I,A,v,R,b,_)=>{const E=g.el=u?u.el:a(""),U=g.anchor=u?u.anchor:a("");let{patchFlag:O,dynamicChildren:L,slotScopeIds:F}=g;F&&(b=b?b.concat(F):F),u==null?(r(E,m,I),r(U,m,I),Ye(g.children||[],m,U,A,v,R,b,_)):O>0&&O&64&&L&&u.dynamicChildren?(Fe(u.dynamicChildren,L,m,A,v,R,b),(g.key!=null||A&&g===A.subTree)&&Qc(u,g,!0)):oe(u,g,m,U,A,v,R,b,_)},Tn=(u,g,m,I,A,v,R,b,_)=>{g.slotScopeIds=b,u==null?g.shapeFlag&512?A.ctx.activate(g,m,I,R,_):V(g,m,I,A,v,R,_):x(u,g,_)},V=(u,g,m,I,A,v,R)=>{const b=u.component=wf(u,I,A);if(xc(u)&&(b.ctx.renderer=qn),vf(b,!1,R),b.asyncDep){if(A&&A.registerDep(b,Q,R),!u.el){const _=b.subTree=Mt(fn);D(null,_,g,m)}}else Q(b,u,g,m,A,v,R)},x=(u,g,m)=>{const I=g.component=u.component;if(hf(u,g,m))if(I.asyncDep&&!I.asyncResolved){ie(I,g,m);return}else I.next=g,I.update();else g.el=u.el,I.vnode=g},Q=(u,g,m,I,A,v,R)=>{const b=()=>{if(u.isMounted){let{next:O,bu:L,u:F,parent:j,vnode:ce}=u;{const ct=Jc(u);if(ct){O&&(O.el=ce.el,ie(u,O,R)),ct.asyncDep.then(()=>{u.isUnmounted||b()});return}}let ne=O,Be;on(u,!1),O?(O.el=ce.el,ie(u,O,R)):O=ce,L&&Ko(L),(Be=O.props&&O.props.onVnodeBeforeUpdate)&&dt(Be,j,O,ce),on(u,!0);const Ue=la(u),at=u.subTree;u.subTree=Ue,S(at,Ue,h(at.el),wr(at),u,A,v),O.el=Ue.el,ne===null&&uf(u,Ue.el),F&&qe(F,A),(Be=O.props&&O.props.onVnodeUpdated)&&qe(()=>dt(Be,j,O,ce),A)}else{let O;const{el:L,props:F}=g,{bm:j,m:ce,parent:ne,root:Be,type:Ue}=u,at=er(g);on(u,!1),j&&Ko(j),!at&&(O=F&&F.onVnodeBeforeMount)&&dt(O,ne,g),on(u,!0);{Be.ce&&Be.ce._injectChildStyle(Ue);const ct=u.subTree=la(u);S(null,ct,m,I,u,A,v),g.el=ct.el}if(ce&&qe(ce,A),!at&&(O=F&&F.onVnodeMounted)){const ct=g;qe(()=>dt(O,ne,ct),A)}(g.shapeFlag&256||ne&&er(ne.vnode)&&ne.vnode.shapeFlag&256)&&u.a&&qe(u.a,A),u.isMounted=!0,g=m=I=null}};u.scope.on();const _=u.effect=new uc(b);u.scope.off();const E=u.update=_.run.bind(_),U=u.job=_.runIfDirty.bind(_);U.i=u,U.id=u.uid,_.scheduler=()=>Vi(U),on(u,!0),E()},ie=(u,g,m)=>{g.component=u;const I=u.vnode.props;u.vnode=g,u.next=null,Wu(u,g.props,I,m),Xu(u,g.children,m),Xt(),na(u),Zt()},oe=(u,g,m,I,A,v,R,b,_=!1)=>{const E=u&&u.children,U=u?u.shapeFlag:0,O=g.children,{patchFlag:L,shapeFlag:F}=g;if(L>0){if(L&128){An(E,O,m,I,A,v,R,b,_);return}else if(L&256){vt(E,O,m,I,A,v,R,b,_);return}}F&8?(U&16&&$n(E,A,v),O!==E&&d(m,O)):U&16?F&16?An(E,O,m,I,A,v,R,b,_):$n(E,A,v,!0):(U&8&&d(m,""),F&16&&Ye(O,m,I,A,v,R,b,_))},vt=(u,g,m,I,A,v,R,b,_)=>{u=u||kn,g=g||kn;const E=u.length,U=g.length,O=Math.min(E,U);let L;for(L=0;L<O;L++){const F=g[L]=_?Bt(g[L]):gt(g[L]);S(u[L],F,m,null,A,v,R,b,_)}E>U?$n(u,A,v,!0,!1,O):Ye(g,m,I,A,v,R,b,_,O)},An=(u,g,m,I,A,v,R,b,_)=>{let E=0;const U=g.length;let O=u.length-1,L=U-1;for(;E<=O&&E<=L;){const F=u[E],j=g[E]=_?Bt(g[E]):gt(g[E]);if(jn(F,j))S(F,j,m,null,A,v,R,b,_);else break;E++}for(;E<=O&&E<=L;){const F=u[O],j=g[L]=_?Bt(g[L]):gt(g[L]);if(jn(F,j))S(F,j,m,null,A,v,R,b,_);else break;O--,L--}if(E>O){if(E<=L){const F=L+1,j=F<U?g[F].el:I;for(;E<=L;)S(null,g[E]=_?Bt(g[E]):gt(g[E]),m,j,A,v,R,b,_),E++}}else if(E>L)for(;E<=O;)Ze(u[E],A,v,!0),E++;else{const F=E,j=E,ce=new Map;for(E=j;E<=L;E++){const Ke=g[E]=_?Bt(g[E]):gt(g[E]);Ke.key!=null&&ce.set(Ke.key,E)}let ne,Be=0;const Ue=L-j+1;let at=!1,ct=0;const zn=new Array(Ue);for(E=0;E<Ue;E++)zn[E]=0;for(E=F;E<=O;E++){const Ke=u[E];if(Be>=Ue){Ze(Ke,A,v,!0);continue}let lt;if(Ke.key!=null)lt=ce.get(Ke.key);else for(ne=j;ne<=L;ne++)if(zn[ne-j]===0&&jn(Ke,g[ne])){lt=ne;break}lt===void 0?Ze(Ke,A,v,!0):(zn[lt-j]=E+1,lt>=ct?ct=lt:at=!0,S(Ke,g[lt],m,null,A,v,R,b,_),Be++)}const Js=at?nf(zn):kn;for(ne=Js.length-1,E=Ue-1;E>=0;E--){const Ke=j+E,lt=g[Ke],Xs=Ke+1<U?g[Ke+1].el:I;zn[E]===0?S(null,lt,m,Xs,A,v,R,b,_):at&&(ne<0||E!==Js[ne]?It(lt,m,Xs,2):ne--)}}},It=(u,g,m,I,A=null)=>{const{el:v,type:R,transition:b,children:_,shapeFlag:E}=u;if(E&6){It(u.component.subTree,g,m,I);return}if(E&128){u.suspense.move(g,m,I);return}if(E&64){R.move(u,g,m,qn);return}if(R===ft){r(v,g,m);for(let O=0;O<_.length;O++)It(_[O],g,m,I);r(u.anchor,g,m);return}if(R===Yo){Y(u,g,m);return}if(I!==2&&E&1&&b)if(I===0)b.beforeEnter(v),r(v,g,m),qe(()=>b.enter(v),A);else{const{leave:O,delayLeave:L,afterLeave:F}=b,j=()=>r(v,g,m),ce=()=>{O(v,()=>{j(),F&&F()})};L?L(v,j,ce):ce()}else r(v,g,m)},Ze=(u,g,m,I=!1,A=!1)=>{const{type:v,props:R,ref:b,children:_,dynamicChildren:E,shapeFlag:U,patchFlag:O,dirs:L,cacheIndex:F}=u;if(O===-2&&(A=!1),b!=null&&$r(b,null,m,u,!0),F!=null&&(g.renderCache[F]=void 0),U&256){g.ctx.deactivate(u);return}const j=U&1&&L,ce=!er(u);let ne;if(ce&&(ne=R&&R.onVnodeBeforeUnmount)&&dt(ne,g,u),U&6)Oh(u.component,m,I);else{if(U&128){u.suspense.unmount(m,I);return}j&&rn(u,null,g,"beforeUnmount"),U&64?u.type.remove(u,g,m,qn,I):E&&!E.hasOnce&&(v!==ft||O>0&&O&64)?$n(E,g,m,!1,!0):(v===ft&&O&384||!A&&U&16)&&$n(_,g,m),I&&Ar(u)}(ce&&(ne=R&&R.onVnodeUnmounted)||j)&&qe(()=>{ne&&dt(ne,g,u),j&&rn(u,null,g,"unmounted")},m)},Ar=u=>{const{type:g,el:m,anchor:I,transition:A}=u;if(g===ft){Rh(m,I);return}if(g===Yo){H(u);return}const v=()=>{o(m),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(u.shapeFlag&1&&A&&!A.persisted){const{leave:R,delayLeave:b}=A,_=()=>R(m,v);b?b(u.el,v,_):_()}else v()},Rh=(u,g)=>{let m;for(;u!==g;)m=p(u),o(u),u=m;o(g)},Oh=(u,g,m)=>{const{bum:I,scope:A,job:v,subTree:R,um:b,m:_,a:E}=u;ca(_),ca(E),I&&Ko(I),A.stop(),v&&(v.flags|=8,Ze(R,u,g,m)),b&&qe(b,g),qe(()=>{u.isUnmounted=!0},g),g&&g.pendingBranch&&!g.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===g.pendingId&&(g.deps--,g.deps===0&&g.resolve())},$n=(u,g,m,I=!1,A=!1,v=0)=>{for(let R=v;R<u.length;R++)Ze(u[R],g,m,I,A)},wr=u=>{if(u.shapeFlag&6)return wr(u.component.subTree);if(u.shapeFlag&128)return u.suspense.next();const g=p(u.anchor||u.el),m=g&&g[Iu];return m?p(m):g};let Fo=!1;const Qs=(u,g,m)=>{u==null?g._vnode&&Ze(g._vnode,null,null,!0):S(g._vnode||null,u,g,null,null,null,m),g._vnode=u,Fo||(Fo=!0,na(),Oc(),Fo=!1)},qn={p:S,um:Ze,m:It,r:Ar,mt:V,mc:Ye,pc:oe,pbc:Fe,n:wr,o:n};return{render:Qs,hydrate:void 0,createApp:zu(Qs)}}function jo({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function on({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function tf(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function Qc(n,e,t=!1){const r=n.children,o=e.children;if(B(r)&&B(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=Bt(o[i]),a.el=s.el),!t&&a.patchFlag!==-2&&Qc(s,a)),a.type===Co&&(a.el=s.el)}}function nf(n){const e=n.slice(),t=[0];let r,o,i,s,a;const c=n.length;for(r=0;r<c;r++){const l=n[r];if(l!==0){if(o=t[t.length-1],n[o]<l){e[r]=o,t.push(r);continue}for(i=0,s=t.length-1;i<s;)a=i+s>>1,n[t[a]]<l?i=a+1:s=a;l<n[t[i]]&&(i>0&&(e[r]=t[i-1]),t[i]=r)}}for(i=t.length,s=t[i-1];i-- >0;)t[i]=s,s=e[s];return t}function Jc(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Jc(e)}function ca(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}const rf=Symbol.for("v-scx"),of=()=>xr(rf);function Wo(n,e,t){return Xc(n,e,t)}function Xc(n,e,t=de){const{immediate:r,deep:o,flush:i,once:s}=t,a=He({},t),c=e&&r||!e&&i!=="post";let l;if(hr){if(i==="sync"){const y=of();l=y.__watcherHandles||(y.__watcherHandles=[])}else if(!c){const y=()=>{};return y.stop=Tt,y.resume=Tt,y.pause=Tt,y}}const d=Me;a.call=(y,k,S)=>At(y,d,k,S);let h=!1;i==="post"?a.scheduler=y=>{qe(y,d&&d.suspense)}:i!=="sync"&&(h=!0,a.scheduler=(y,k)=>{k?y():Vi(y)}),a.augmentJob=y=>{e&&(y.flags|=4),h&&(y.flags|=2,d&&(y.id=d.uid,y.i=d))};const p=Cu(n,e,a);return hr&&(l?l.push(p):c&&p()),p}function sf(n,e,t){const r=this.proxy,o=pe(n)?n.includes(".")?Zc(r,n):()=>r[n]:n.bind(r,r);let i;G(e)?i=e:(i=e.handler,t=e);const s=yr(this),a=Xc(o,i.bind(r),t);return s(),a}function Zc(n,e){const t=e.split(".");return()=>{let r=n;for(let o=0;o<t.length&&r;o++)r=r[t[o]];return r}}const af=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Wt(e)}Modifiers`]||n[`${Cn(e)}Modifiers`];function cf(n,e,...t){if(n.isUnmounted)return;const r=n.vnode.props||de;let o=t;const i=e.startsWith("update:"),s=i&&af(r,e.slice(7));s&&(s.trim&&(o=t.map(d=>pe(d)?d.trim():d)),s.number&&(o=t.map(Lh)));let a,c=r[a=Bo(e)]||r[a=Bo(Wt(e))];!c&&i&&(c=r[a=Bo(Cn(e))]),c&&At(c,n,6,o);const l=r[a+"Once"];if(l){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,At(l,n,6,o)}}function el(n,e,t=!1){const r=e.emitsCache,o=r.get(n);if(o!==void 0)return o;const i=n.emits;let s={},a=!1;if(!G(n)){const c=l=>{const d=el(l,e,!0);d&&(a=!0,He(s,d))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!i&&!a?(ue(n)&&r.set(n,null),null):(B(i)?i.forEach(c=>s[c]=null):He(s,i),ue(n)&&r.set(n,s),s)}function mo(n,e){return!n||!co(e)?!1:(e=e.slice(2).replace(/Once$/,""),te(n,e[0].toLowerCase()+e.slice(1))||te(n,Cn(e))||te(n,e))}function la(n){const{type:e,vnode:t,proxy:r,withProxy:o,propsOptions:[i],slots:s,attrs:a,emit:c,render:l,renderCache:d,props:h,data:p,setupState:y,ctx:k,inheritAttrs:S}=n,$=Gr(n);let D,z;try{if(t.shapeFlag&4){const H=o||r,ae=H;D=gt(l.call(ae,H,d,h,y,p,k)),z=a}else{const H=e;D=gt(H.length>1?H(h,{attrs:a,slots:s,emit:c}):H(h,null)),z=e.props?a:lf(a)}}catch(H){nr.length=0,go(H,n,1),D=Mt(fn)}let Y=D;if(z&&S!==!1){const H=Object.keys(z),{shapeFlag:ae}=Y;H.length&&ae&7&&(i&&H.some(Mi)&&(z=df(z,i)),Y=Hn(Y,z,!1,!0))}return t.dirs&&(Y=Hn(Y,null,!1,!0),Y.dirs=Y.dirs?Y.dirs.concat(t.dirs):t.dirs),t.transition&&ji(Y,t.transition),D=Y,Gr($),D}const lf=n=>{let e;for(const t in n)(t==="class"||t==="style"||co(t))&&((e||(e={}))[t]=n[t]);return e},df=(n,e)=>{const t={};for(const r in n)(!Mi(r)||!(r.slice(9)in e))&&(t[r]=n[r]);return t};function hf(n,e,t){const{props:r,children:o,component:i}=n,{props:s,children:a,patchFlag:c}=e,l=i.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return r?da(r,s,l):!!s;if(c&8){const d=e.dynamicProps;for(let h=0;h<d.length;h++){const p=d[h];if(s[p]!==r[p]&&!mo(l,p))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===s?!1:r?s?da(r,s,l):!0:!!s;return!1}function da(n,e,t){const r=Object.keys(e);if(r.length!==Object.keys(n).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(e[i]!==n[i]&&!mo(t,i))return!0}return!1}function uf({vnode:n,parent:e},t){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===n&&(r.el=n.el),r===n)(n=e.vnode).el=t,e=e.parent;else break}}const tl=n=>n.__isSuspense;function ff(n,e){e&&e.pendingBranch?B(n)?e.effects.push(...n):e.effects.push(n):wu(n)}const ft=Symbol.for("v-fgt"),Co=Symbol.for("v-txt"),fn=Symbol.for("v-cmt"),Yo=Symbol.for("v-stc"),nr=[];let je=null;function $e(n=!1){nr.push(je=n?null:[])}function gf(){nr.pop(),je=nr[nr.length-1]||null}let dr=1;function ha(n,e=!1){dr+=n,n<0&&je&&e&&(je.hasOnce=!0)}function nl(n){return n.dynamicChildren=dr>0?je||kn:null,gf(),dr>0&&je&&je.push(n),n}function Qe(n,e,t,r,o,i){return nl(J(n,e,t,r,o,i,!0))}function pf(n,e,t,r,o){return nl(Mt(n,e,t,r,o,!0))}function rl(n){return n?n.__v_isVNode===!0:!1}function jn(n,e){return n.type===e.type&&n.key===e.key}const ol=({key:n})=>n??null,Hr=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?pe(n)||Se(n)||G(n)?{i:Ct,r:n,k:e,f:!!t}:n:null);function J(n,e=null,t=null,r=0,o=null,i=n===ft?0:1,s=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&ol(e),ref:e&&Hr(e),scopeId:Nc,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ct};return a?(Yi(c,t),i&128&&n.normalize(c)):t&&(c.shapeFlag|=pe(t)?8:16),dr>0&&!s&&je&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&je.push(c),c}const Mt=mf;function mf(n,e=null,t=null,r=0,o=null,i=!1){if((!n||n===Lu)&&(n=fn),rl(n)){const a=Hn(n,e,!0);return t&&Yi(a,t),dr>0&&!i&&je&&(a.shapeFlag&6?je[je.indexOf(n)]=a:je.push(a)),a.patchFlag=-2,a}if(Sf(n)&&(n=n.__vccOpts),e){e=Cf(e);let{class:a,style:c}=e;a&&!pe(a)&&(e.class=Ui(a)),ue(c)&&(zi(c)&&!B(c)&&(c=He({},c)),e.style=Li(c))}const s=pe(n)?1:tl(n)?128:Eu(n)?64:ue(n)?4:G(n)?2:0;return J(n,e,t,r,o,s,i,!0)}function Cf(n){return n?zi(n)||$c(n)?He({},n):n:null}function Hn(n,e,t=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=n,l=e?yf(o||{},e):o,d={__v_isVNode:!0,__v_skip:!0,type:n.type,props:l,key:l&&ol(l),ref:e&&e.ref?t&&i?B(i)?i.concat(Hr(e)):[i,Hr(e)]:Hr(e):i,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==ft?s===-1?16:s|16:s,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Hn(n.ssContent),ssFallback:n.ssFallback&&Hn(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&ji(d,c.clone(d)),d}function an(n=" ",e=0){return Mt(Co,null,n,e)}function Wn(n="",e=!1){return e?($e(),pf(fn,null,n)):Mt(fn,null,n)}function gt(n){return n==null||typeof n=="boolean"?Mt(fn):B(n)?Mt(ft,null,n.slice()):rl(n)?Bt(n):Mt(Co,null,String(n))}function Bt(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Hn(n)}function Yi(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(B(e))t=16;else if(typeof e=="object")if(r&65){const o=e.default;o&&(o._c&&(o._d=!1),Yi(n,o()),o._c&&(o._d=!0));return}else{t=32;const o=e._;!o&&!$c(e)?e._ctx=Ct:o===3&&Ct&&(Ct.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else G(e)?(e={default:e,_ctx:Ct},t=32):(e=String(e),r&64?(t=16,e=[an(e)]):t=8);n.children=e,n.shapeFlag|=t}function yf(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const o in r)if(o==="class")e.class!==r.class&&(e.class=Ui([e.class,r.class]));else if(o==="style")e.style=Li([e.style,r.style]);else if(co(o)){const i=e[o],s=r[o];s&&i!==s&&!(B(i)&&i.includes(s))&&(e[o]=i?[].concat(i,s):s)}else o!==""&&(e[o]=r[o])}return e}function dt(n,e,t,r=null){At(n,e,7,[t,r])}const Tf=Bc();let Af=0;function wf(n,e,t){const r=n.type,o=(e?e.appContext:n.appContext)||Tf,i={uid:Af++,vnode:n,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $h(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:zc(r,o),emitsOptions:el(r,o),emit:null,emitted:null,propsDefaults:de,inheritAttrs:r.inheritAttrs,ctx:de,data:de,props:de,attrs:de,slots:de,refs:de,setupState:de,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=cf.bind(null,i),n.ce&&n.ce(i),i}let Me=null,zr,ui;{const n=uo(),e=(t,r)=>{let o;return(o=n[t])||(o=n[t]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};zr=e("__VUE_INSTANCE_SETTERS__",t=>Me=t),ui=e("__VUE_SSR_SETTERS__",t=>hr=t)}const yr=n=>{const e=Me;return zr(n),n.scope.on(),()=>{n.scope.off(),zr(e)}},ua=()=>{Me&&Me.scope.off(),zr(null)};function il(n){return n.vnode.shapeFlag&4}let hr=!1;function vf(n,e=!1,t=!1){e&&ui(e);const{props:r,children:o}=n.vnode,i=il(n);ju(n,r,i,e),Ju(n,o,t);const s=i?If(n,e):void 0;return e&&ui(!1),s}function If(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,Du);const{setup:r}=t;if(r){Xt();const o=n.setupContext=r.length>1?_f(n):null,i=yr(n),s=Cr(r,n,0,[n.props,o]),a=oc(s);if(Zt(),i(),(a||n.sp)&&!er(n)&&Mc(n),a){if(s.then(ua,ua),e)return s.then(c=>{fa(n,c)}).catch(c=>{go(c,n,0)});n.asyncDep=s}else fa(n,s)}else sl(n)}function fa(n,e,t){G(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:ue(e)&&(n.setupState=bc(e)),sl(n)}function sl(n,e,t){const r=n.type;n.render||(n.render=r.render||Tt);{const o=yr(n);Xt();try{Fu(n)}finally{Zt(),o()}}}const Ef={get(n,e){return Ie(n,"get",""),n[e]}};function _f(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,Ef),slots:n.slots,emit:n.emit,expose:e}}function Qi(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(bc(du(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in tr)return tr[t](n)},has(e,t){return t in e||t in tr}})):n.proxy}function Sf(n){return G(n)&&"__vccOpts"in n}const Lr=(n,e)=>pu(n,e,hr),bf="3.5.13";/**
+* @vue/runtime-dom v3.5.13
+* (c) 2018-present Yuxi (Evan) You and Vue contributors
+* @license MIT
+**/let fi;const ga=typeof window<"u"&&window.trustedTypes;if(ga)try{fi=ga.createPolicy("vue",{createHTML:n=>n})}catch{}const al=fi?n=>fi.createHTML(n):n=>n,kf="http://www.w3.org/2000/svg",Rf="http://www.w3.org/1998/Math/MathML",Rt=typeof document<"u"?document:null,pa=Rt&&Rt.createElement("template"),Of={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,r)=>{const o=e==="svg"?Rt.createElementNS(kf,n):e==="mathml"?Rt.createElementNS(Rf,n):t?Rt.createElement(n,{is:t}):Rt.createElement(n);return n==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:n=>Rt.createTextNode(n),createComment:n=>Rt.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Rt.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,r,o,i){const s=t?t.previousSibling:e.lastChild;if(o&&(o===i||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),t),!(o===i||!(o=o.nextSibling)););else{pa.innerHTML=al(r==="svg"?`<svg>${n}</svg>`:r==="mathml"?`<math>${n}</math>`:n);const a=pa.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[s?s.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Pf=Symbol("_vtc");function Nf(n,e,t){const r=n[Pf];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const ma=Symbol("_vod"),Mf=Symbol("_vsh"),xf=Symbol(""),Hf=/(^|;)\s*display\s*:/;function Lf(n,e,t){const r=n.style,o=pe(t);let i=!1;if(t&&!o){if(e)if(pe(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();t[a]==null&&Ur(r,a,"")}else for(const s in e)t[s]==null&&Ur(r,s,"");for(const s in t)s==="display"&&(i=!0),Ur(r,s,t[s])}else if(o){if(e!==t){const s=r[xf];s&&(t+=";"+s),r.cssText=t,i=Hf.test(t)}}else e&&n.removeAttribute("style");ma in n&&(n[ma]=i?r.display:"",n[Mf]&&(r.display="none"))}const Ca=/\s*!important$/;function Ur(n,e,t){if(B(t))t.forEach(r=>Ur(n,e,r));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const r=Uf(n,e);Ca.test(t)?n.setProperty(Cn(r),t.replace(Ca,""),"important"):n[r]=t}}const ya=["Webkit","Moz","ms"],Qo={};function Uf(n,e){const t=Qo[e];if(t)return t;let r=Wt(e);if(r!=="filter"&&r in n)return Qo[e]=r;r=ac(r);for(let o=0;o<ya.length;o++){const i=ya[o]+r;if(i in n)return Qo[e]=i}return e}const Ta="http://www.w3.org/1999/xlink";function Aa(n,e,t,r,o,i=Gh(e)){r&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(Ta,e.slice(6,e.length)):n.setAttributeNS(Ta,e,t):t==null||i&&!lc(t)?n.removeAttribute(e):n.setAttribute(e,i?"":Jt(t)?String(t):t)}function wa(n,e,t,r,o){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?al(t):t);return}const i=n.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?n.getAttribute("value")||"":n.value,c=t==null?n.type==="checkbox"?"on":"":String(t);(a!==c||!("_value"in n))&&(n.value=c),t==null&&n.removeAttribute(e),n._value=t;return}let s=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=lc(t):t==null&&a==="string"?(t="",s=!0):a==="number"&&(t=0,s=!0)}try{n[e]=t}catch{}s&&n.removeAttribute(o||e)}function Df(n,e,t,r){n.addEventListener(e,t,r)}function Ff(n,e,t,r){n.removeEventListener(e,t,r)}const va=Symbol("_vei");function Bf(n,e,t,r,o=null){const i=n[va]||(n[va]={}),s=i[e];if(r&&s)s.value=r;else{const[a,c]=Kf(e);if(r){const l=i[e]=qf(r,o);Df(n,a,l,c)}else s&&(Ff(n,a,s,c),i[e]=void 0)}}const Ia=/(?:Once|Passive|Capture)$/;function Kf(n){let e;if(Ia.test(n)){e={};let r;for(;r=n.match(Ia);)n=n.slice(0,n.length-r[0].length),e[r[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):Cn(n.slice(2)),e]}let Jo=0;const Gf=Promise.resolve(),$f=()=>Jo||(Gf.then(()=>Jo=0),Jo=Date.now());function qf(n,e){const t=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=t.attached)return;At(zf(r,t.value),e,5,[r])};return t.value=n,t.attached=$f(),t}function zf(n,e){if(B(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(r=>o=>!o._stopped&&r&&r(o))}else return e}const Ea=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Vf=(n,e,t,r,o,i)=>{const s=o==="svg";e==="class"?Nf(n,r,s):e==="style"?Lf(n,t,r):co(e)?Mi(e)||Bf(n,e,t,r,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):jf(n,e,r,s))?(wa(n,e,r),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Aa(n,e,r,s,i,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!pe(r))?wa(n,Wt(e),r,i,e):(e==="true-value"?n._trueValue=r:e==="false-value"&&(n._falseValue=r),Aa(n,e,r,s))};function jf(n,e,t,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in n&&Ea(e)&&G(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=n.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Ea(e)&&pe(t)?!1:e in n}const Wf=He({patchProp:Vf},Of);let _a;function Yf(){return _a||(_a=Zu(Wf))}const Qf=(...n)=>{const e=Yf().createApp(...n),{mount:t}=e;return e.mount=r=>{const o=Xf(r);if(!o)return;const i=e._component;!G(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const s=t(o,!1,Jf(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},e};function Jf(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function Xf(n){return pe(n)?document.querySelector(n):n}function Dt(n){const e=Office.context.displayLanguage;return e in bn&&n in bn[e]?bn[e][n]:n}function et(n,e){const t=Office.context.displayLanguage;return t in bn&&e in bn[t]?bn[t][e]:e}async function Zf(n,e,t){if(e)return new Promise((r,o)=>{const i='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> <soap:Header> <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" /> </soap:Header> <soap:Body> <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> <ItemShape> <t:BaseShape>Default</t:BaseShape> <t:IncludeMimeContent>true</t:IncludeMimeContent> <t:AdditionalProperties> <t:FieldURI FieldURI="item:ParentFolderId"/> </t:AdditionalProperties> </ItemShape> <ItemIds><t:ItemId Id="'+n.itemId+'"/></ItemIds> </GetItem> </soap:Body></soap:Envelope>';Office.context.mailbox.makeEwsRequestAsync(i,s=>{if(s.status!==Office.AsyncResultStatus.Succeeded){const h=s.error;o(h.name+": "+h.message);return}const c=new DOMParser().parseFromString(s.value,"text/xml"),l=c.getElementsByTagName("t:MimeContent")[0].innerHTML,d=c.getElementsByTagName("t:ParentFolderId")[0];r({content:atob(l),folderId:d.getAttribute("Id")})})});{const r=await fetch(`https://graph.microsoft.com/v1.0/me/messages/${n.itemId.replace("/","-")}/$value`,{headers:{Authorization:t}});return r.ok?{content:await r.text(),folderId:""}:{content:"",folderId:""}}}/*! @azure/msal-common v15.4.0 2025-03-25 */const C={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},_r={CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},yn=[C.OPENID_SCOPE,C.PROFILE_SCOPE,C.OFFLINE_ACCESS_SCOPE],Sa=[...yn,C.EMAIL_SCOPE],Oe={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},ba={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},zt={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Sr={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Te={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},ka={PLAIN:"plain",S256:"S256"},cl={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},yo={QUERY:"query",FRAGMENT:"fragment"},eg={QUERY:"query"},ll={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},br={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},_e={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},K={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Ji="appmetadata",tg="client_info",rr="1",Vr={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},ze={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},ye={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},X={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},or={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},Ra={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},kr={httpSuccess:200,httpBadRequest:400},vn={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Xo={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},cn={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},ng={Pop:"pop"},rg=300;/*! @azure/msal-common v15.4.0 2025-03-25 */const Xi="unexpected_error",og="post_request_failed";/*! @azure/msal-common v15.4.0 2025-03-25 */const Oa={[Xi]:"Unexpected error in authentication.",[og]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Z extends Error{constructor(e,t,r){const o=t?`${e}: ${t}`:e;super(o),Object.setPrototypeOf(this,Z.prototype),this.errorCode=e||C.EMPTY_STRING,this.errorMessage=t||C.EMPTY_STRING,this.subError=r||C.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function dl(n,e){return new Z(n,e?`${Oa[n]} ${e}`:Oa[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */const Zi="client_info_decoding_error",hl="client_info_empty_error",es="token_parsing_error",jr="null_or_empty_token",Ot="endpoints_resolution_error",ul="network_error",fl="openid_config_error",gl="hash_not_deserialized",Ln="invalid_state",pl="state_mismatch",gi="state_not_found",ml="nonce_mismatch",ts="auth_time_not_found",Cl="max_age_transpired",ig="multiple_matching_tokens",sg="multiple_matching_accounts",yl="multiple_matching_appMetadata",Tl="request_cannot_be_made",Al="cannot_remove_empty_scope",wl="cannot_append_scopeset",pi="empty_input_scopeset",ag="device_code_polling_cancelled",cg="device_code_expired",lg="device_code_unknown_error",ns="no_account_in_silent_request",vl="invalid_cache_record",rs="invalid_cache_environment",Wr="no_account_found",mi="no_crypto_object",Ci="unexpected_credential_type",dg="invalid_assertion",hg="invalid_client_credential",Vt="token_refresh_required",ug="user_timeout_reached",Il="token_claims_cnf_required_for_signedjwt",El="authorization_code_missing_from_server_response",_l="binding_key_not_removed",Sl="end_session_endpoint_not_supported",os="key_id_missing",bl="no_network_connectivity",kl="user_canceled",fg="missing_tenant_id_error",q="method_not_implemented",yi="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.4.0 2025-03-25 */const Pa={[Zi]:"The client info could not be parsed/decoded correctly",[hl]:"The client info was empty",[es]:"Token cannot be parsed",[jr]:"The token is null or empty",[Ot]:"Endpoints cannot be resolved",[ul]:"Network request failed",[fl]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[gl]:"The hash parameters could not be deserialized",[Ln]:"State was not the expected format",[pl]:"State mismatch error",[gi]:"State not found",[ml]:"Nonce mismatch error",[ts]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Cl]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[ig]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[sg]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[yl]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Tl]:"Token request cannot be made without authorization code or refresh token.",[Al]:"Cannot remove null or empty scope from ScopeSet",[wl]:"Cannot append ScopeSet",[pi]:"Empty input ScopeSet cannot be processed",[ag]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[cg]:"Device code is expired.",[lg]:"Device code stopped polling for unknown reasons.",[ns]:"Please pass an account object, silent flow is not supported without account information",[vl]:"Cache record object was null or undefined.",[rs]:"Invalid environment when attempting to create cache entry",[Wr]:"No account found in cache for given key.",[mi]:"No crypto object detected.",[Ci]:"Unexpected credential type.",[dg]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[hg]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Vt]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ug]:"User defined timeout for device code polling reached",[Il]:"Cannot generate a POP jwt if the token_claims are not populated",[El]:"Server response does not contain an authorization code to proceed",[_l]:"Could not remove the credential's binding key from storage.",[Sl]:"The provided authority does not support logout",[os]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[bl]:"No network connectivity. Check your internet connection.",[kl]:"User cancelled the flow.",[fg]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[q]:"This method has not been implemented",[yi]:"The nested app auth bridge is disabled"};class Gt extends Z{constructor(e,t){super(e,t?`${Pa[e]}: ${t}`:Pa[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Gt.prototype)}}function w(n,e){return new Gt(n,e)}/*! @azure/msal-common v15.4.0 2025-03-25 */const ur={createNewGuid:()=>{throw w(q)},base64Decode:()=>{throw w(q)},base64Encode:()=>{throw w(q)},base64UrlEncode:()=>{throw w(q)},encodeKid:()=>{throw w(q)},async getPublicKeyThumbprint(){throw w(q)},async removeTokenBindingKey(){throw w(q)},async clearKeystore(){throw w(q)},async signJwt(){throw w(q)},async hashString(){throw w(q)}};/*! @azure/msal-common v15.4.0 2025-03-25 */var he;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"})(he||(he={}));class Ht{constructor(e,t,r){this.level=he.Info;const o=()=>{},i=e||Ht.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||o,this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level=typeof i.logLevel=="number"?i.logLevel:he.Info,this.correlationId=i.correlationId||C.EMPTY_STRING,this.packageName=t||C.EMPTY_STRING,this.packageVersion=r||C.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:he.Info}}clone(e,t,r){return new Ht({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const i=`${`[${new Date().toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${he[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,i,t.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(e,t){this.logMessage(e,{logLevel:he.Error,containsPii:!1,correlationId:t||C.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:he.Error,containsPii:!0,correlationId:t||C.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:he.Warning,containsPii:!1,correlationId:t||C.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:he.Warning,containsPii:!0,correlationId:t||C.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:he.Info,containsPii:!1,correlationId:t||C.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:he.Info,containsPii:!0,correlationId:t||C.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:he.Verbose,containsPii:!1,correlationId:t||C.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:he.Verbose,containsPii:!0,correlationId:t||C.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:he.Trace,containsPii:!1,correlationId:t||C.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:he.Trace,containsPii:!0,correlationId:t||C.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Rl="@azure/msal-common",is="15.4.0";/*! @azure/msal-common v15.4.0 2025-03-25 */const ss={None:"none"};/*! @azure/msal-common v15.4.0 2025-03-25 */function Yt(n,e){const t=gg(n);try{const r=e(t);return JSON.parse(r)}catch{throw w(es)}}function gg(n){if(!n)throw w(jr);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw w(es);return t[2]}function Ol(n,e){if(e===0||Date.now()-3e5>n+e)throw w(Cl)}/*! @azure/msal-common v15.4.0 2025-03-25 */function Le(){return Math.round(new Date().getTime()/1e3)}function Na(n){return n.getTime()/1e3}function xt(n){return n?new Date(Number(n)*1e3):new Date}function Yr(n,e){const t=Number(n)||0;return Le()+e>t}function Pl(n){return Number(n)>Le()}/*! @azure/msal-common v15.4.0 2025-03-25 */function ir(n){return[yg(n),Tg(n),Ag(n),wg(n),vg(n)].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}function To(n,e,t,r,o){return{credentialType:K.ID_TOKEN,homeAccountId:n,environment:e,clientId:r,secret:t,realm:o}}function Ao(n,e,t,r,o,i,s,a,c,l,d,h,p,y,k){var $,D;const S={homeAccountId:n,credentialType:K.ACCESS_TOKEN,secret:t,cachedAt:Le().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:r,realm:o,target:i,tokenType:d||X.BEARER};if(h&&(S.userAssertionHash=h),l&&(S.refreshOn=l.toString()),y&&(S.requestedClaims=y,S.requestedClaimsHash=k),(($=S.tokenType)==null?void 0:$.toLowerCase())!==X.BEARER.toLowerCase())switch(S.credentialType=K.ACCESS_TOKEN_WITH_AUTH_SCHEME,S.tokenType){case X.POP:const z=Yt(t,c);if(!((D=z==null?void 0:z.cnf)!=null&&D.kid))throw w(Il);S.keyId=z.cnf.kid;break;case X.SSH:S.keyId=p}return S}function Nl(n,e,t,r,o,i,s){const a={credentialType:K.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:r,secret:t};return i&&(a.userAssertionHash=i),o&&(a.familyId=o),s&&(a.expiresOn=s.toString()),a}function as(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function pg(n){return n?as(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===K.ACCESS_TOKEN||n.credentialType===K.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function mg(n){return n?as(n)&&n.hasOwnProperty("realm")&&n.credentialType===K.ID_TOKEN:!1}function Cg(n){return n?as(n)&&n.credentialType===K.REFRESH_TOKEN:!1}function yg(n){return[n.homeAccountId,n.environment].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}function Tg(n){const e=n.credentialType===K.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}function Ag(n){return(n.target||"").toLowerCase()}function wg(n){return(n.requestedClaimsHash||"").toLowerCase()}function vg(n){return n.tokenType&&n.tokenType.toLowerCase()!==X.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}function Ig(n,e){const t=n.indexOf(ye.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),t&&r}function Eg(n,e){let t=!1;n&&(t=n.indexOf(or.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),t&&r}function _g({environment:n,clientId:e}){return[Ji,n,e].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}function Sg(n,e){return e?n.indexOf(Ji)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function bg(n,e){return e?n.indexOf(Vr.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function Ma(){return Le()+Vr.REFRESH_TIME_SECONDS}function Rr(n,e,t){n.authorization_endpoint=e.authorization_endpoint,n.token_endpoint=e.token_endpoint,n.end_session_endpoint=e.end_session_endpoint,n.issuer=e.issuer,n.endpointsFromNetwork=t,n.jwks_uri=e.jwks_uri}function Zo(n,e,t){n.aliases=e.aliases,n.preferred_cache=e.preferred_cache,n.preferred_network=e.preferred_network,n.aliasesFromNetwork=t}function xa(n){return n.expiresAt<=Le()}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ml="redirect_uri_empty",kg="claims_request_parsing_error",xl="authority_uri_insecure",Qn="url_parse_error",Hl="empty_url_error",Ll="empty_input_scopes_error",Ul="invalid_prompt_value",wo="invalid_claims",Dl="token_request_empty",Fl="logout_request_empty",Bl="invalid_code_challenge_method",vo="pkce_params_missing",cs="invalid_cloud_discovery_metadata",Kl="invalid_authority_metadata",Gl="untrusted_authority",Io="missing_ssh_jwk",$l="missing_ssh_kid",Rg="missing_nonce_authentication_header",Og="invalid_authentication_header",ql="cannot_set_OIDCOptions",zl="cannot_allow_platform_broker",Vl="authority_mismatch";/*! @azure/msal-common v15.4.0 2025-03-25 */const Pg={[Ml]:"A redirect URI is required for all calls, and none has been set.",[kg]:"Could not parse the given claims request object.",[xl]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Qn]:"URL could not be parsed into appropriate segments.",[Hl]:"URL was empty or null.",[Ll]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Ul]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[wo]:"Given claims parameter must be a stringified JSON object.",[Dl]:"Token request was empty and not found in cache.",[Fl]:"The logout request was null or undefined.",[Bl]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[vo]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[cs]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Kl]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Gl]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Io]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[$l]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[Rg]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[Og]:"Invalid authentication header provided",[ql]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[zl]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Vl]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class ls extends Z{constructor(e){super(e,Pg[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,ls.prototype)}}function re(n){return new ls(n)}/*! @azure/msal-common v15.4.0 2025-03-25 */class ot{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0}static startsWith(e,t){return e.indexOf(t)===0}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),o=i=>decodeURIComponent(i.replace(/\+/g," "));return r.forEach(i=>{if(i.trim()){const[s,a]=i.split(/=(.+)/g,2);s&&a&&(t[o(s)]=o(a))}}),t}static trimArrayEntries(e){return e.map(t=>t.trim())}static removeEmptyStringsFromArray(e){return e.filter(t=>!!t)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class fe{constructor(e){const t=e?ot.trimArrayEntries([...e]):[],r=t?ot.removeEmptyStringsFromArray(t):[];if(!r||!r.length)throw re(Ll);this.scopes=new Set,r.forEach(o=>this.scopes.add(o))}static fromString(e){const r=(e||C.EMPTY_STRING).split(" ");return new fe(r)}static createSearchScopes(e){const t=new fe(e);return t.containsOnlyOIDCScopes()?t.removeScope(C.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new fe(t);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(t=>this.containsScope(t))}containsOnlyOIDCScopes(){let e=0;return Sa.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(t=>this.appendScope(t))}catch{throw w(wl)}}removeScope(e){if(!e)throw w(Al);this.scopes.delete(e.trim())}removeOIDCScopes(){Sa.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw w(pi);const t=new Set;return e.scopes.forEach(r=>t.add(r.toLowerCase())),this.scopes.forEach(r=>t.add(r.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw w(pi);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),o=this.getScopeCount();return t.size<o+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):C.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Qr(n,e){if(!n)throw w(hl);try{const t=e(n);return JSON.parse(t)}catch{throw w(Zi)}}function Mn(n){if(!n)throw w(Zi);const e=n.split(_e.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?C.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Ha(n,e){return!!n&&!!e&&n===e.split(".")[1]}function Eo(n,e,t,r){if(r){const{oid:o,sub:i,tid:s,name:a,tfp:c,acr:l}=r,d=s||c||l||"";return{tenantId:d,localAccountId:o||i||"",name:a,isHomeTenant:Ha(d,n)}}else return{tenantId:t,localAccountId:e,isHomeTenant:Ha(t,n)}}function ds(n,e,t,r){let o=n;if(e){const{isHomeTenant:i,...s}=e;o={...n,...s}}if(t){const{isHomeTenant:i,...s}=Eo(n.homeAccountId,n.localAccountId,n.tenantId,t);return o={...o,...s,idTokenClaims:t,idToken:r},o}return o}/*! @azure/msal-common v15.4.0 2025-03-25 */const tt={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.4.0 2025-03-25 */function jl(n){return n&&(n.tid||n.tfp||n.acr)||null}/*! @azure/msal-common v15.4.0 2025-03-25 */const xe={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.4.0 2025-03-25 */class be{generateAccountId(){return[this.homeAccountId,this.environment].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return be.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(_e.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,r){var l,d,h,p,y,k;const o=new be;t.authorityType===tt.Adfs?o.authorityType=br.ADFS_ACCOUNT_TYPE:t.protocolMode===xe.OIDC?o.authorityType=br.GENERIC_ACCOUNT_TYPE:o.authorityType=br.MSSTS_ACCOUNT_TYPE;let i;e.clientInfo&&r&&(i=Qr(e.clientInfo,r)),o.clientInfo=e.clientInfo,o.homeAccountId=e.homeAccountId,o.nativeAccountId=e.nativeAccountId;const s=e.environment||t&&t.getPreferredCache();if(!s)throw w(rs);o.environment=s,o.realm=(i==null?void 0:i.utid)||jl(e.idTokenClaims)||"",o.localAccountId=(i==null?void 0:i.uid)||((l=e.idTokenClaims)==null?void 0:l.oid)||((d=e.idTokenClaims)==null?void 0:d.sub)||"";const a=((h=e.idTokenClaims)==null?void 0:h.preferred_username)||((p=e.idTokenClaims)==null?void 0:p.upn),c=(y=e.idTokenClaims)!=null&&y.emails?e.idTokenClaims.emails[0]:null;if(o.username=a||c||"",o.name=((k=e.idTokenClaims)==null?void 0:k.name)||"",o.cloudGraphHostName=e.cloudGraphHostName,o.msGraphHost=e.msGraphHost,e.tenantProfiles)o.tenantProfiles=e.tenantProfiles;else{const S=Eo(e.homeAccountId,o.localAccountId,o.realm,e.idTokenClaims);o.tenantProfiles=[S]}return o}static createFromAccountInfo(e,t,r){var i;const o=new be;return o.authorityType=e.authorityType||br.GENERIC_ACCOUNT_TYPE,o.homeAccountId=e.homeAccountId,o.localAccountId=e.localAccountId,o.nativeAccountId=e.nativeAccountId,o.realm=e.tenantId,o.environment=e.environment,o.username=e.username,o.name=e.name,o.cloudGraphHostName=t,o.msGraphHost=r,o.tenantProfiles=Array.from(((i=e.tenantProfiles)==null?void 0:i.values())||[]),o}static generateHomeAccountId(e,t,r,o,i){if(!(t===tt.Adfs||t===tt.Dsts)){if(e)try{const s=Qr(e,o.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}r.warning("No client info in response")}return(i==null?void 0:i.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,t,r){if(!e||!t)return!1;let o=!0;if(r){const i=e.idTokenClaims||{},s=t.idTokenClaims||{};o=i.iat===s.iat&&i.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&o}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Wl(n){return n.startsWith("#/")?n.substring(2):n.startsWith("#")||n.startsWith("?")?n.substring(1):n}function Jr(n){if(!n||n.indexOf("=")<0)return null;try{const e=Wl(n),t=Object.fromEntries(new URLSearchParams(e));if(t.code||t.ear_jwe||t.error||t.error_description||t.state)return t}catch{throw w(gl)}return null}function fr(n){const e=new Array;return n.forEach((t,r)=>{e.push(`${r}=${encodeURIComponent(t)}`)}),e.join("&")}/*! @azure/msal-common v15.4.0 2025-03-25 */class W{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw re(Hl);e.includes("#")||(this._urlString=W.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return ot.endsWith(t,"?")?t=t.slice(0,-1):ot.endsWith(t,"?/")&&(t=t.slice(0,-2)),ot.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw re(Qn)}if(!e.HostNameAndPort||!e.PathSegments)throw re(Qn);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw re(xl)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return W.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return e&&r.length!==0&&(r[0]===zt.COMMON||r[0]===zt.ORGANIZATIONS)&&(r[0]=e),W.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw re(Qn);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let o=r.AbsolutePath.split("/");return o=o.filter(i=>i&&i.length>0),r.PathSegments=o,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw re(Qn);return r[2]}static getAbsoluteUrl(e,t){if(e[0]===C.FORWARD_SLASH){const o=new W(t).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new W(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!Jr(e)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Yl={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},La=Yl.endpointMetadata,hs=Yl.instanceDiscoveryMetadata,Ql=new Set;hs.metadata.forEach(n=>{n.aliases.forEach(e=>{Ql.add(e)})});function Ng(n,e){var o;let t;const r=n.canonicalAuthority;if(r){const i=new W(r).getUrlComponents().HostNameAndPort;t=Ua(i,(o=n.cloudDiscoveryMetadata)==null?void 0:o.metadata,ze.CONFIG,e)||Ua(i,hs.metadata,ze.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function Ua(n,e,t,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const o=Xr(e,n);if(o)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${t}, returning aliases`),o.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${t}`)}return null}function Mg(n){return Xr(hs.metadata,n)}function Xr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v15.4.0 2025-03-25 */const Jl="cache_quota_exceeded",us="cache_error_unknown";/*! @azure/msal-common v15.4.0 2025-03-25 */const ei={[Jl]:"Exceeded cache storage capacity.",[us]:"Unexpected error occurred when using cache storage."};class xn extends Error{constructor(e,t){const r=t||(ei[e]?ei[e]:ei[us]);super(`${e}: ${r}`),Object.setPrototypeOf(this,xn.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ti{constructor(e,t,r,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Rl,is),this.staticAuthorityOptions=o}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.sort(o=>o.idTokenClaims?-1:1)[0]:t.length===1?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap(r=>this.getTenantProfilesFromAccountEntity(r,t==null?void 0:t.tenantId,t))}getTenantedAccountInfoByFilter(e,t,r,o){let i=null,s;if(o&&!this.tenantProfileMatchesFilter(r,o))return null;const a=this.getIdToken(e,t,r.tenantId);return a&&(s=Yt(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(s,o))?null:(i=ds(e,r,s,a==null?void 0:a.secret),i)}getTenantProfilesFromAccountEntity(e,t,r){const o=e.getAccountInfo();let i=o.tenantProfiles||new Map;const s=this.getTokenKeys();if(t){const c=i.get(t);if(c)i=new Map([[t,c]]);else return[]}const a=[];return i.forEach(c=>{const l=this.getTenantedAccountInfoByFilter(o,s,c,r);l&&a.push(l)}),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId)||t.name&&e.name!==t.name||t.isHomeTenant!==void 0&&e.isHomeTenant!==t.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,t){return!(t&&(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId)||t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint)||t.username&&!this.matchUsername(e.preferred_username,t.username)||t.name&&!this.matchName(e,t.name)||t.sid&&!this.matchSid(e,t.sid)))}async saveCacheRecord(e,t,r){var o,i,s,a;if(!e)throw w(vl);try{e.account&&await this.setAccount(e.account,t),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,t),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,t),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,t),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(c){throw(o=this.commonLogger)==null||o.error("CacheManager.saveCacheRecord: failed"),c instanceof Error?((i=this.commonLogger)==null||i.errorPii(`CacheManager.saveCacheRecord: ${c.message}`,t),c.name==="QuotaExceededError"||c.name==="NS_ERROR_DOM_QUOTA_REACHED"||c.message.includes("exceeded the quota")?((s=this.commonLogger)==null||s.error("CacheManager.saveCacheRecord: exceeded storage quota",t),new xn(Jl)):new xn(c.name,c.message)):((a=this.commonLogger)==null||a.errorPii(`CacheManager.saveCacheRecord: ${c}`,t),new xn(us))}}async saveAccessToken(e,t){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),i=fe.fromString(e.target),s=[];o.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,r,!1))return;const c=this.getAccessTokenCredential(a);c&&this.credentialMatchesFilter(c,r)&&fe.fromString(c.target).intersectingScopeSets(i)&&s.push(this.removeAccessToken(a))}),await Promise.all(s),await this.setAccessTokenCredential(e,t)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),r=[];return t.forEach(o=>{var c;if(!this.isAccountKey(o,e.homeAccountId))return;const i=this.getAccount(o,this.commonLogger);if(!i||e.homeAccountId&&!this.matchHomeAccountId(i,e.homeAccountId)||e.username&&!this.matchUsername(i.username,e.username)||e.environment&&!this.matchEnvironment(i,e.environment)||e.realm&&!this.matchRealm(i,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(i,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(i,e.authorityType))return;const s={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},a=(c=i.tenantProfiles)==null?void 0:c.filter(l=>this.tenantProfileMatchesFilter(l,s));a&&a.length===0||r.push(i)}),r}isAccountKey(e,t,r){return!(e.split(_e.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||r&&!e.toLowerCase().includes(r.toLowerCase()))}isCredentialKey(e){if(e.split(_e.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(K.ID_TOKEN.toLowerCase())===-1&&t.indexOf(K.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(K.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(K.REFRESH_TOKEN.toLowerCase())>-1){const r=`${K.REFRESH_TOKEN}${_e.CACHE_KEY_SEPARATOR}${this.clientId}${_e.CACHE_KEY_SEPARATOR}`,o=`${K.REFRESH_TOKEN}${_e.CACHE_KEY_SEPARATOR}${rr}${_e.CACHE_KEY_SEPARATOR}`;if(t.indexOf(r.toLowerCase())===-1&&t.indexOf(o.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0}credentialMatchesFilter(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===K.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===X.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))}getAppMetadataFilteredBy(e){const t=this.getKeys(),r={};return t.forEach(o=>{if(!this.isAppMetadata(o))return;const i=this.getAppMetadata(o);i&&(e.environment&&!this.matchEnvironment(i,e.environment)||e.clientId&&!this.matchClientId(i,e.clientId)||(r[o]=i))}),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let r=null;return t.forEach(o=>{if(!this.isAuthorityMetadata(o)||o.indexOf(this.clientId)===-1)return;const i=this.getAuthorityMetadata(o);i&&i.aliases.indexOf(e)!==-1&&(r=i)}),r}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(r=>{t.push(this.removeAccount(r))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),r=e.generateAccountId(),o=[];t.idToken.forEach(i=>{i.indexOf(r)===0&&this.removeIdToken(i)}),t.accessToken.forEach(i=>{i.indexOf(r)===0&&o.push(this.removeAccessToken(i))}),t.refreshToken.forEach(i=>{i.indexOf(r)===0&&this.removeRefreshToken(i)}),await Promise.all(o)}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===X.POP){const o=t.keyId;if(o)try{await this.cryptoImpl.removeTokenBindingKey(o)}catch{throw w(_l)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(t=>{this.isAppMetadata(t)&&this.removeItem(t)}),!0}readAccountFromCache(e){const t=be.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,r,o,i){this.commonLogger.trace("CacheManager - getIdToken called");const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:K.ID_TOKEN,clientId:this.clientId,realm:r},a=this.getIdTokensByFilter(s,t),c=a.size;if(c<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(c>1){let l=a;if(!r){const d=new Map;a.forEach((p,y)=>{p.realm===e.tenantId&&d.set(y,p)});const h=d.size;if(h<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(h===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),d.values().next().value;l=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),l.forEach((d,h)=>{this.removeIdToken(h)}),o&&i&&o.addFields({multiMatchedID:a.size},i),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const r=t&&t.idToken||this.getTokenKeys().idToken,o=new Map;return r.forEach(i=>{if(!this.idTokenKeyMatchesFilter(i,{clientId:this.clientId,...e}))return;const s=this.getIdTokenCredential(i);s&&this.credentialMatchesFilter(s,e)&&o.set(i,s)}),o}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return!(t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1)}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,r,o,i,s){this.commonLogger.trace("CacheManager - getAccessToken called");const a=fe.createSearchScopes(t.scopes),c=t.authenticationScheme||X.BEARER,l=c.toLowerCase()!==X.BEARER.toLowerCase()?K.ACCESS_TOKEN_WITH_AUTH_SCHEME:K.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:o||e.tenantId,target:a,tokenType:c,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},h=r&&r.accessToken||this.getTokenKeys().accessToken,p=[];h.forEach(k=>{if(this.accessTokenKeyMatchesFilter(k,d,!0)){const S=this.getAccessTokenCredential(k);S&&this.credentialMatchesFilter(S,d)&&p.push(S)}});const y=p.length;return y<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):y>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),p.forEach(k=>{this.removeAccessToken(ir(k))}),i&&s&&i.addFields({multiMatchedAT:p.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),p[0])}accessTokenKeyMatchesFilter(e,t,r){const o=e.toLowerCase();if(t.clientId&&o.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&o.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&o.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&o.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target){const i=t.target.asArray();for(let s=0;s<i.length;s++){if(r&&!o.includes(i[s].toLowerCase()))return!1;if(!r&&o.includes(i[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),r=[];return t.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,e,!0))return;const i=this.getAccessTokenCredential(o);i&&this.credentialMatchesFilter(i,e)&&r.push(i)}),r}getRefreshToken(e,t,r,o,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const s=t?rr:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:K.REFRESH_TOKEN,clientId:this.clientId,familyId:s},c=r&&r.refreshToken||this.getTokenKeys().refreshToken,l=[];c.forEach(h=>{if(this.refreshTokenKeyMatchesFilter(h,a)){const p=this.getRefreshTokenCredential(h);p&&this.credentialMatchesFilter(p,a)&&l.push(p)}});const d=l.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(d>1&&o&&i&&o.addFields({multiMatchedRT:d},i),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),l[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return!(t.familyId&&r.indexOf(t.familyId.toLowerCase())===-1||!t.familyId&&t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(t),o=Object.keys(r).map(s=>r[s]),i=o.length;if(i<1)return null;if(i>1)throw w(yl);return o[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===rr)}matchHomeAccountId(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,t){const r=e.oid||e.sub;return t===r}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){var r;return t.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,t){return!!(e&&typeof e=="string"&&(t==null?void 0:t.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const o=Ng(this.staticAuthorityOptions,this.commonLogger);if(o.includes(t)&&o.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!!(e.clientId&&t===e.clientId)}matchFamilyId(e,t){return!!(e.familyId&&t===e.familyId)}matchRealm(e,t){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===t.toLowerCase()}matchNativeAccountId(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||e.preferred_username===t||e.upn===t}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!!(e.authorityType&&t.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,t){return e.credentialType!==K.ACCESS_TOKEN&&e.credentialType!==K.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:fe.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!!(e.tokenType&&e.tokenType===t)}matchKeyId(e,t){return!!(e.keyId&&e.keyId===t)}isAppMetadata(e){return e.indexOf(Ji)!==-1}isAuthorityMetadata(e){return e.indexOf(Vr.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${Vr.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class xg extends Ti{async setAccount(){throw w(q)}getAccount(){throw w(q)}async setIdTokenCredential(){throw w(q)}getIdTokenCredential(){throw w(q)}async setAccessTokenCredential(){throw w(q)}getAccessTokenCredential(){throw w(q)}async setRefreshTokenCredential(){throw w(q)}getRefreshTokenCredential(){throw w(q)}setAppMetadata(){throw w(q)}getAppMetadata(){throw w(q)}setServerTelemetry(){throw w(q)}getServerTelemetry(){throw w(q)}setAuthorityMetadata(){throw w(q)}getAuthorityMetadata(){throw w(q)}getAuthorityMetadataKeys(){throw w(q)}setThrottlingCache(){throw w(q)}getThrottlingCache(){throw w(q)}removeItem(){throw w(q)}getKeys(){throw w(q)}getAccountKeys(){throw w(q)}getTokenKeys(){throw w(q)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Xl={tokenRenewalOffsetSeconds:rg,preventCorsPreflight:!1},Hg={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:he.Info,correlationId:C.EMPTY_STRING},Lg={claimsBasedCachingEnabled:!1},Ug={async sendGetRequestAsync(){throw w(q)},async sendPostRequestAsync(){throw w(q)}},Dg={sku:C.SKU,version:is,cpu:C.EMPTY_STRING,os:C.EMPTY_STRING},Fg={clientSecret:C.EMPTY_STRING,clientAssertion:void 0},Bg={azureCloudInstance:ss.None,tenant:`${C.DEFAULT_COMMON_TENANT}`},Kg={application:{appName:"",appVersion:""}};function Gg({authOptions:n,systemOptions:e,loggerOptions:t,cacheOptions:r,storageInterface:o,networkInterface:i,cryptoInterface:s,clientCredentials:a,libraryInfo:c,telemetry:l,serverTelemetryManager:d,persistencePlugin:h,serializableCache:p}){const y={...Hg,...t};return{authOptions:$g(n),systemOptions:{...Xl,...e},loggerOptions:y,cacheOptions:{...Lg,...r},storageInterface:o||new xg(n.clientId,ur,new Ht(y)),networkInterface:i||Ug,cryptoInterface:s||ur,clientCredentials:a||Fg,libraryInfo:{...Dg,...c},telemetry:{...Kg,...l},serverTelemetryManager:d||null,persistencePlugin:h||null,serializableCache:p||null}}function $g(n){return{clientCapabilities:[],azureCloudOptions:Bg,skipAuthorityMetadataCache:!1,instanceAware:!1,...n}}function Zl(n){return n.authOptions.authority.options.protocolMode===xe.OIDC}/*! @azure/msal-common v15.4.0 2025-03-25 */const nt={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.4.0 2025-03-25 */const gn="client_id",ed="redirect_uri",qg="response_type",zg="response_mode",Vg="grant_type",jg="claims",Wg="scope",Yg="refresh_token",Qg="state",Jg="nonce",Xg="prompt",Zg="code",ep="code_challenge",tp="code_challenge_method",np="code_verifier",rp="client-request-id",op="x-client-SKU",ip="x-client-VER",sp="x-client-OS",ap="x-client-CPU",cp="x-client-current-telemetry",lp="x-client-last-telemetry",dp="x-ms-lib-capability",hp="x-app-name",up="x-app-ver",fp="post_logout_redirect_uri",gp="id_token_hint",pp="client_secret",mp="client_assertion",Cp="client_assertion_type",td="token_type",nd="req_cnf",Da="return_spa_code",yp="nativebroker",Tp="logout_hint",Ap="sid",wp="login_hint",vp="domain_hint",Ip="x-client-xtra-sku",Zr="brk_client_id",eo="brk_redirect_uri",Ai="instance_aware",Ep="ear_jwk",_p="ear_jwe_crypto";/*! @azure/msal-common v15.4.0 2025-03-25 */function _o(n,e,t){if(!e)return;const r=n.get(gn);r&&n.has(Zr)&&(t==null||t.addFields({embeddedClientId:r,embeddedRedirectUri:n.get(ed)},e))}function rd(n,e){n.set(qg,e)}function Sp(n,e){n.set(zg,e||eg.QUERY)}function bp(n){n.set(yp,"1")}function fs(n,e,t=!0,r=yn){t&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const o=t?[...e||[],...r]:e||[],i=new fe(o);n.set(Wg,i.printScopes())}function gs(n,e){n.set(gn,e)}function ps(n,e){n.set(ed,e)}function kp(n,e){n.set(fp,e)}function Rp(n,e){n.set(gp,e)}function Op(n,e){n.set(vp,e)}function Or(n,e){n.set(wp,e)}function to(n,e){n.set(Oe.CCS_HEADER,`UPN:${e}`)}function sr(n,e){n.set(Oe.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function Fa(n,e){n.set(Ap,e)}function ms(n,e,t){const r=dd(e,t);try{JSON.parse(r)}catch{throw re(wo)}n.set(jg,r)}function Cs(n,e){n.set(rp,e)}function ys(n,e){n.set(op,e.sku),n.set(ip,e.version),e.os&&n.set(sp,e.os),e.cpu&&n.set(ap,e.cpu)}function Ts(n,e){e!=null&&e.appName&&n.set(hp,e.appName),e!=null&&e.appVersion&&n.set(up,e.appVersion)}function Pp(n,e){n.set(Xg,e)}function od(n,e){e&&n.set(Qg,e)}function Np(n,e){n.set(Jg,e)}function Mp(n,e,t){if(e&&t)n.set(ep,e),n.set(tp,t);else throw re(vo)}function xp(n,e){n.set(Zg,e)}function Hp(n,e){n.set(Yg,e)}function Lp(n,e){n.set(np,e)}function id(n,e){n.set(pp,e)}function sd(n,e){e&&n.set(mp,e)}function ad(n,e){e&&n.set(Cp,e)}function cd(n,e){n.set(Vg,e)}function As(n){n.set(tg,"1")}function ld(n){n.has(Ai)||n.set(Ai,"true")}function hn(n,e){Object.entries(e).forEach(([t,r])=>{!n.has(t)&&r&&n.set(t,r)})}function dd(n,e){let t;if(!n)t={};else try{t=JSON.parse(n)}catch{throw re(wo)}return e&&e.length>0&&(t.hasOwnProperty(Sr.ACCESS_TOKEN)||(t[Sr.ACCESS_TOKEN]={}),t[Sr.ACCESS_TOKEN][Sr.XMS_CC]={values:e}),JSON.stringify(t)}function ws(n,e){e&&(n.set(td,X.POP),n.set(nd,e))}function hd(n,e){e&&(n.set(td,X.SSH),n.set(nd,e))}function ud(n,e){n.set(cp,e.generateCurrentRequestHeaderValue()),n.set(lp,e.generateLastRequestHeaderValue())}function fd(n){n.set(dp,or.X_MS_LIB_CAPABILITY_VALUE)}function Up(n,e){n.set(Tp,e)}function So(n,e,t){n.has(Zr)||n.set(Zr,e),n.has(eo)||n.set(eo,t)}function Dp(n,e){n.set(Ep,encodeURIComponent(e)),n.set(_p,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Fp(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Bp(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Kp(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v15.4.0 2025-03-25 */const f={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},Gp={InProgress:1};/*! @azure/msal-common v15.4.0 2025-03-25 */const st=(n,e,t,r,o)=>(...i)=>{t.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const a=e+"CallCount";r==null||r.incrementFields({[a]:1},o)}try{const a=n(...i);return s==null||s.end({success:!0}),t.trace(`Returning result from ${e}`),a}catch(a){t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1},a),a}},T=(n,e,t,r,o)=>(...i)=>{t.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const a=e+"CallCount";r==null||r.incrementFields({[a]:1},o)}return r==null||r.setPreQueueTime(e,o),n(...i).then(a=>(t.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),a)).catch(a=>{t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1},a),a})};/*! @azure/msal-common v15.4.0 2025-03-25 */class bo{constructor(e,t,r,o){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=o}async detectRegion(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)t.region_source=vn.ENVIRONMENT_VARIABLE;else{const i=bo.IMDS_OPTIONS;try{const s=await T(this.getRegionFromIMDS.bind(this),f.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(C.IMDS_VERSION,i);if(s.status===kr.httpSuccess&&(r=s.body,t.region_source=vn.IMDS),s.status===kr.httpBadRequest){const a=await T(this.getCurrentVersion.bind(this),f.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(i);if(!a)return t.region_source=vn.FAILED_AUTO_DETECTION,null;const c=await T(this.getRegionFromIMDS.bind(this),f.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,i);c.status===kr.httpSuccess&&(r=c.body,t.region_source=vn.IMDS)}}catch{return t.region_source=vn.FAILED_AUTO_DETECTION,null}}return r||(t.region_source=vn.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,t){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(f.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${C.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,C.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(f.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${C.IMDS_ENDPOINT}?format=json`,e);return r.status===kr.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}bo.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.4.0 2025-03-25 */class ve{constructor(e,t,r,o,i,s,a,c){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=i,this.performanceClient=a,this.correlationId=s,this.managedIdentity=c||!1,this.regionDiscovery=new bo(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(C.CIAM_AUTH_URL))return tt.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case C.ADFS:return tt.Adfs;case C.DSTS:return tt.Dsts}return tt.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new W(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw w(Ot)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw w(Ot)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw w(Ot)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw w(Sl);return this.replacePath(this.metadata.end_session_endpoint)}else throw w(Ot)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw w(Ot)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw w(Ot)}canReplaceTenant(e){return e.PathSegments.length===1&&!ve.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===tt.Default&&this.protocolMode!==xe.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const o=new W(this.metadata.canonical_authority).getUrlComponents(),i=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,c)=>{let l=i[c];if(c===0&&this.canReplaceTenant(o)){const d=new W(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];l!==d&&(this.logger.verbose(`Replacing tenant domain name ${l} with id ${d}`),l=d)}a!==l&&(t=t.replace(`/${l}/`,`/${a}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===tt.Adfs||this.protocolMode===xe.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await T(this.updateCloudDiscoveryMetadata.bind(this),f.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await T(this.updateEndpointMetadata.bind(this),f.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),(i=this.performanceClient)==null||i.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Ma(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==ze.CACHE&&(r==null?void 0:r.source)!==ze.CACHE&&(e.expiresAt=Ma(),e.canonical_authority=this.canonicalAuthority);const o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(o,e),this.metadata=e}async updateEndpointMetadata(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===ze.HARDCODED_VALUES&&(i=this.authorityOptions.azureRegionConfiguration)!=null&&i.azureRegion&&t.metadata){const a=await T(this.updateMetadataWithRegionalInformation.bind(this),f.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);Rr(e,a,!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await T(this.getEndpointMetadataFromNetwork.bind(this),f.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await T(this.updateMetadataWithRegionalInformation.bind(this),f.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),Rr(e,r,!0),ze.NETWORK;throw w(fl,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),Rr(e,t,!1),{source:ze.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const o=this.getEndpointMetadataFromHardcodedValues();if(o)return Rr(e,o,!1),{source:ze.HARDCODED_VALUES,metadata:o};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=xa(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:ze.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new W(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw re(Kl)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(f.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const o=await this.networkInterface.sendGetRequestAsync(t,e);return Fp(o.body)?o.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(o){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${o}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in La?La[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,o,i;(r=this.performanceClient)==null||r.addQueueMeasurement(f.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.azureRegion;if(t){if(t!==C.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=Xo.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,ve.replaceWithRegionalInformation(e,t);const s=await T(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),f.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=Xo.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,ve.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=Xo.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await T(this.getCloudDiscoveryMetadataFromNetwork.bind(this),f.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return Zo(e,r,!0),ze.NETWORK;throw re(Gl)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||C.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||C.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||C.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Zo(e,t,!1),ze.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const o=Mg(this.hostnameAndPort);if(o)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Zo(e,o,!1),ze.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=xa(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),ze.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===tt.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),ve.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=Xr(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),re(cs)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),ve.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${C.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,t);let s,a;if(Bp(i.body))s=i.body,a=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(Kp(i.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${i.status}`),s=i.body,s.error===C.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=Xr(a,this.hostnameAndPort)}catch(i){if(i instanceof Z)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
+Error: ${i.errorCode}
+Error Description: ${i.errorMessage}`);else{const s=i;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
+Error: ${s.name}
+Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=ve.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&W.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==ss.None){const o=t.tenant?t.tenant:C.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return C.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw w(Ot)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Ql.has(e)}static isPublicCloudAuthority(e){return C.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new W(e);o.validateAsUri();const i=o.getUrlComponents();let s=`${t}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(s=`${t}.${C.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=W.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=ve.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=ve.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=ve.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new W(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(C.CIAM_AUTH_URL)){const i=o.HostNameAndPort.split(".")[0];t=`${t}${i}${C.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}ve.reservedTenantDomains=new Set(["{tenant}","{tenantid}",zt.COMMON,zt.CONSUMERS,zt.ORGANIZATIONS]);function $p(n){var o;const r=(o=new W(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case zt.COMMON:case zt.ORGANIZATIONS:case zt.CONSUMERS:return;default:return r}}function gd(n){return n.endsWith(C.FORWARD_SLASH)?n:`${n}${C.FORWARD_SLASH}`}function pd(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw re(cs)}return{canonicalAuthority:n.authority?gd(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v15.4.0 2025-03-25 */async function md(n,e,t,r,o,i,s){s==null||s.addQueueMeasurement(f.AuthorityFactoryCreateDiscoveredInstance,i);const a=ve.transformCIAMAuthority(gd(n)),c=new ve(a,e,t,r,o,i,s);try{return await T(c.resolveEndpointsAsync.bind(c),f.AuthorityResolveEndpointsAsync,o,s,i)(),c}catch{throw w(Ot)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class en extends Z{constructor(e,t,r,o,i){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=i,Object.setPrototypeOf(this,en.prototype)}}/*! @azure/msal-common v15.4.0 2025-03-25 */function ko(n,e,t){var r;return{clientId:n,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:t,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class pt{static generateThrottlingStorageKey(e){return`${or.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var i;const r=pt.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r);return}throw new en(((i=o.errorCodes)==null?void 0:i.join(" "))||C.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(pt.checkResponseStatus(r)||pt.checkResponseForRetryAfter(r)){const o={throttleTime:pt.calculateThrottleTime(parseInt(r.headers[Oe.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(pt.generateThrottlingStorageKey(t),o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Oe.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||or.DEFAULT_THROTTLE_TIME_SECONDS),r+or.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const i=ko(t,r,o),s=this.generateThrottlingStorageKey(i);e.removeItem(s)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ro extends Z{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,Ro.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function Ba(n,e,t){return new Ro(n,e,t)}/*! @azure/msal-common v15.4.0 2025-03-25 */class vs{constructor(e,t){this.config=Gg(e),this.logger=new Ht(this.config.loggerOptions,Rl,is),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Oe.CONTENT_TYPE]=C.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case nt.HOME_ACCOUNT_ID:try{const r=Mn(e.credential);t[Oe.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case nt.UPN:t[Oe.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,i,s){var c;s&&((c=this.performanceClient)==null||c.addQueueMeasurement(s,i));const a=await this.sendPostRequest(o,e,{body:t,headers:r},i);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,t,r,o){var s,a,c;pt.preProcess(this.cacheManager,e);let i;try{i=await T(this.networkClient.sendPostRequestAsync.bind(this.networkClient),f.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const l=i.headers||{};(a=this.performanceClient)==null||a.addFields({refreshTokenSize:((s=i.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:l[Oe.X_MS_HTTP_VERSION]||"",requestId:l[Oe.X_MS_REQUEST_ID]||""},o)}catch(l){if(l instanceof Ro){const d=l.responseHeaders;throw d&&((c=this.performanceClient)==null||c.addFields({httpVerToken:d[Oe.X_MS_HTTP_VERSION]||"",requestId:d[Oe.X_MS_REQUEST_ID]||"",contentTypeHeader:d[Oe.CONTENT_TYPE]||void 0,contentLengthHeader:d[Oe.CONTENT_LENGTH]||void 0,httpStatus:l.httpStatus},o)),l.error}throw l instanceof Z?l:w(ul)}return pt.postProcess(this.cacheManager,e,i),i}async updateAuthority(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(f.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await md(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new Map;return e.embeddedClientId&&So(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&hn(t,e.tokenQueryParameters),Cs(t,e.correlationId),_o(t,e.correlationId,this.performanceClient),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const no="no_tokens_found",Cd="native_account_unavailable",Is="refresh_token_expired",qp="interaction_required",zp="consent_required",Vp="login_required",Oo="bad_token";/*! @azure/msal-common v15.4.0 2025-03-25 */const Ka=[qp,zp,Vp,Oo],jp=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],Wp={[no]:"No refresh token found in the cache. Please sign-in.",[Cd]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Is]:"Refresh token has expired.",[Oo]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Xe extends Z{constructor(e,t,r,o,i,s,a,c){super(e,t,r),Object.setPrototypeOf(this,Xe.prototype),this.timestamp=o||C.EMPTY_STRING,this.traceId=i||C.EMPTY_STRING,this.correlationId=s||C.EMPTY_STRING,this.claims=a||C.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function yd(n,e,t){const r=!!n&&Ka.indexOf(n)>-1,o=!!t&&jp.indexOf(t)>-1,i=!!e&&Ka.some(s=>e.indexOf(s)>-1);return r||i||o}function wi(n){return new Xe(n,Wp[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */class Fn{static setRequestState(e,t,r){const o=Fn.generateLibraryState(e,r);return t?`${o}${C.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw w(mi);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw w(mi);if(!t)throw w(Ln);try{const r=t.split(C.RESOURCE_DELIM),o=r[0],i=r.length>1?r.slice(1).join(C.RESOURCE_DELIM):C.EMPTY_STRING,s=e.base64Decode(o),a=JSON.parse(s);return{userRequestState:i||C.EMPTY_STRING,libraryState:a}}catch{throw w(Ln)}}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Yp={SW:"sw"};class Un{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(f.PopTokenGenerateCnf,e.correlationId);const r=await T(this.generateKid.bind(this),f.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(f.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Yp.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:i,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:l}=r,d=s?new W(s):void 0,h=d==null?void 0:d.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Le(),m:i==null?void 0:i.toUpperCase(),u:h==null?void 0:h.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:h==null?void 0:h.AbsolutePath,q:h!=null&&h.QueryString?[[],h.QueryString]:void 0,client_claims:a||void 0,...o},t,l,r.correlationId)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class Qp{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.4.0 2025-03-25 */class pn{constructor(e,t,r,o,i,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=i,this.persistencePlugin=s,this.performanceClient=a}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||C.NOT_AVAILABLE} - Timestamp: ${e.timestamp||C.NOT_AVAILABLE} - Description: ${e.error_description||C.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||C.NOT_AVAILABLE} - Trace ID: ${e.trace_id||C.NOT_AVAILABLE}`,i=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new en(e.error,o,e.suberror,i,e.status);if(t&&e.status&&e.status>=_r.SERVER_ERROR_RANGE_START&&e.status<=_r.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
+${s}`);return}else if(t&&e.status&&e.status>=_r.CLIENT_ERROR_RANGE_START&&e.status<=_r.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
+${s}`);return}throw yd(e.error,e.error_description,e.suberror)?new Xe(e.error,e.error_description,e.suberror,e.timestamp||C.EMPTY_STRING,e.trace_id||C.EMPTY_STRING,e.correlation_id||C.EMPTY_STRING,e.claims||C.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,t,r,o,i,s,a,c,l){var k;(k=this.performanceClient)==null||k.addQueueMeasurement(f.HandleServerTokenResponse,e.correlation_id);let d;if(e.id_token){if(d=Yt(e.id_token||C.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&d.nonce!==i.nonce)throw w(ml);if(o.maxAge||o.maxAge===0){const S=d.auth_time;if(!S)throw w(ts);Ol(S,o.maxAge)}}this.homeAccountIdentifier=be.generateHomeAccountId(e.client_info||C.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,d);let h;i&&i.state&&(h=Fn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,d,s,i);let y;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),y=new Qp(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(y)),a&&!c&&p.account){const S=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(S))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await pn.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,d,h,void 0,l)}await this.cacheStorage.saveCacheRecord(p,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&y&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(y))}return pn.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,d,h,e,l)}generateCacheRecord(e,t,r,o,i,s,a){const c=t.getPreferredCache();if(!c)throw w(rs);const l=jl(i);let d,h;e.id_token&&i&&(d=To(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),h=Es(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i,e.client_info,c,l,a,void 0,this.logger));let p=null;if(e.access_token){const S=e.scope?fe.fromString(e.scope):new fe(o.scopes||[]),$=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,D=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,z=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,Y=r+$,H=Y+D,ae=z&&z>0?r+z:void 0;p=Ao(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||t.tenant||"",S.printScopes(),Y,H,this.cryptoObj.base64Decode,ae,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let y=null;if(e.refresh_token){let S;if(e.refresh_token_expires_in){const $=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;S=r+$}y=Nl(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,S)}let k=null;return e.foci&&(k={clientId:this.clientId,environment:c,familyId:e.foci}),{account:h,idToken:d,accessToken:p,refreshToken:y,appMetadata:k}}static async generateAuthenticationResult(e,t,r,o,i,s,a,c,l){var Y,H,ae,De,we;let d=C.EMPTY_STRING,h=[],p=null,y,k,S=C.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===X.POP&&!i.popKid){const Ye=new Un(e),{secret:Ut,keyId:Fe}=r.accessToken;if(!Fe)throw w(os);d=await Ye.signPopToken(Ut,Fe,i)}else d=r.accessToken.secret;h=fe.fromString(r.accessToken.target).asArray(),p=xt(r.accessToken.expiresOn),y=xt(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(k=xt(r.accessToken.refreshOn))}r.appMetadata&&(S=r.appMetadata.familyId===rr?rr:"");const $=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",D=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const z=r.account?ds(r.account.getAccountInfo(),void 0,s,(Y=r.idToken)==null?void 0:Y.secret):null;return{authority:t.canonicalAuthority,uniqueId:$,tenantId:D,scopes:h,account:z,idToken:((H=r==null?void 0:r.idToken)==null?void 0:H.secret)||"",idTokenClaims:s||{},accessToken:d,fromCache:o,expiresOn:p,extExpiresOn:y,refreshOn:k,correlationId:i.correlationId,requestId:l||C.EMPTY_STRING,familyId:S,tokenType:((ae=r.accessToken)==null?void 0:ae.tokenType)||C.EMPTY_STRING,state:a?a.userRequestState:C.EMPTY_STRING,cloudGraphHostName:((De=r.account)==null?void 0:De.cloudGraphHostName)||C.EMPTY_STRING,msGraphHost:((we=r.account)==null?void 0:we.msGraphHost)||C.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function Es(n,e,t,r,o,i,s,a,c,l,d){d==null||d.verbose("setCachedAccount called");const p=n.getAccountKeys().find(D=>D.startsWith(t));let y=null;p&&(y=n.getAccount(p));const k=y||be.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:i,environment:s,cloudGraphHostName:c==null?void 0:c.cloud_graph_host_name,msGraphHost:c==null?void 0:c.msgraph_host,nativeAccountId:l},e,r),S=k.tenantProfiles||[],$=a||k.realm;if($&&!S.find(D=>D.tenantId===$)){const D=Eo(t,k.localAccountId,$,o);S.push(D)}return k.tenantProfiles=S,k}/*! @azure/msal-common v15.4.0 2025-03-25 */class Jp{static validateRedirectUri(e){if(!e)throw re(Ml)}static validatePrompt(e){const t=[];for(const r in Te)t.push(Te[r]);if(t.indexOf(e)<0)throw re(Ul)}static validateClaims(e){try{JSON.parse(e)}catch{throw re(wo)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw re(vo);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([ka.PLAIN,ka.S256].indexOf(e)<0)throw re(Bl)}}/*! @azure/msal-common v15.4.0 2025-03-25 */async function Td(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ad extends vs{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,t){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(f.AuthClientAcquireToken,e.correlationId),!e.code)throw w(Tl);const r=Le(),o=await T(this.executeTokenRequest.bind(this),f.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[Oe.X_MS_REQUEST_ID],s=new pn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),T(s.handleServerTokenResponse.bind(s),f.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,i)}getLogoutUri(e){if(!e)throw re(Fl);const t=this.createLogoutUrlQueryString(e);return W.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(f.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=W.appendQueryString(e.tokenEndpoint,r),i=await T(this.createTokenRequestBody.bind(this),f.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=Qr(t.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${_e.CLIENT_INFO_SEPARATOR}${d.utid}`,type:nt.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),c=ko(this.config.authOptions.clientId,t);return T(this.executePostToTokenEndpoint.bind(this),f.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,i,a,c,t.correlationId,f.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthClientCreateTokenRequestBody,e.correlationId);const t=new Map;if(gs(t,e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[gn])||this.config.authOptions.clientId),this.includeRedirectUri?ps(t,e.redirectUri):Jp.validateRedirectUri(e.redirectUri),fs(t,e.scopes,!0,this.oidcDefaultScopes),xp(t,e.code),ys(t,this.config.libraryInfo),Ts(t,this.config.telemetry.application),fd(t),this.serverTelemetryManager&&!Zl(this.config)&&ud(t,this.serverTelemetryManager),e.codeVerifier&&Lp(t,e.codeVerifier),this.config.clientCredentials.clientSecret&&id(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;sd(t,await Td(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),ad(t,s.assertionType)}if(cd(t,ll.AUTHORIZATION_CODE_GRANT),As(t),e.authenticationScheme===X.POP){const s=new Un(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await T(s.generateCnf.bind(s),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ws(t,a)}else if(e.authenticationScheme===X.SSH)if(e.sshJwk)hd(t,e.sshJwk);else throw re(Io);(!ot.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&ms(t,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=Qr(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${_e.CLIENT_INFO_SEPARATOR}${s.utid}`,type:nt.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case nt.HOME_ACCOUNT_ID:try{const s=Mn(r.credential);sr(t,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case nt.UPN:to(t,r.credential);break}return e.embeddedClientId&&So(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&hn(t,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Da])&&hn(t,{[Da]:"1"}),_o(t,e.correlationId,this.performanceClient),fr(t)}createLogoutUrlQueryString(e){const t=new Map;return e.postLogoutRedirectUri&&kp(t,e.postLogoutRedirectUri),e.correlationId&&Cs(t,e.correlationId),e.idTokenHint&&Rp(t,e.idTokenHint),e.state&&od(t,e.state),e.logoutHint&&Up(t,e.logoutHint),e.extraQueryParameters&&hn(t,e.extraQueryParameters),this.config.authOptions.instanceAware&&ld(t),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Xp=300;class Zp extends vs{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(f.RefreshTokenClientAcquireToken,e.correlationId);const t=Le(),r=await T(this.executeTokenRequest.bind(this),f.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[Oe.X_MS_REQUEST_ID],i=new pn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),T(i.handleServerTokenResponse.bind(i),f.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw re(Dl);if((r=this.performanceClient)==null||r.addQueueMeasurement(f.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw w(ns);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof Xe&&o.errorCode===no,s=o instanceof en&&o.errorCode===Ra.INVALID_GRANT_ERROR&&o.subError===Ra.CLIENT_MISMATCH_ERROR;if(i||s)return T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var i,s,a;(i=this.performanceClient)==null||i.addQueueMeasurement(f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=st(this.cacheManager.getRefreshToken.bind(this.cacheManager),f.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw wi(no);if(r.expiresOn&&Yr(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||Xp))throw(s=this.performanceClient)==null||s.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),wi(Is);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||X.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:nt.HOME_ACCOUNT_ID}};try{return await T(this.acquireToken.bind(this),f.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof Xe&&((a=this.performanceClient)==null||a.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),c.subError===Oo)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const l=ir(r);this.cacheManager.removeRefreshToken(l)}throw c}}async executeTokenRequest(e,t){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(f.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=W.appendQueryString(t.tokenEndpoint,r),i=await T(this.createTokenRequestBody.bind(this),f.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a=ko(this.config.authOptions.clientId,e);return T(this.executePostToTokenEndpoint.bind(this),f.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,f.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,i;(r=this.performanceClient)==null||r.addQueueMeasurement(f.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=new Map;if(gs(t,e.embeddedClientId||((o=e.tokenBodyParameters)==null?void 0:o[gn])||this.config.authOptions.clientId),e.redirectUri&&ps(t,e.redirectUri),fs(t,e.scopes,!0,(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes),cd(t,ll.REFRESH_TOKEN_GRANT),As(t),ys(t,this.config.libraryInfo),Ts(t,this.config.telemetry.application),fd(t),this.serverTelemetryManager&&!Zl(this.config)&&ud(t,this.serverTelemetryManager),Hp(t,e.refreshToken),this.config.clientCredentials.clientSecret&&id(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;sd(t,await Td(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),ad(t,s.assertionType)}if(e.authenticationScheme===X.POP){const s=new Un(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await T(s.generateCnf.bind(s),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ws(t,a)}else if(e.authenticationScheme===X.SSH)if(e.sshJwk)hd(t,e.sshJwk);else throw re(Io);if((!ot.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&ms(t,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case nt.HOME_ACCOUNT_ID:try{const s=Mn(e.ccsCredential.credential);sr(t,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case nt.UPN:to(t,e.ccsCredential.credential);break}return e.embeddedClientId&&So(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&hn(t,e.tokenBodyParameters),_o(t,e.correlationId,this.performanceClient),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class em extends vs{constructor(e,t){super(e,t)}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(f.SilentFlowClientAcquireCachedToken,e.correlationId);let t=cn.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!ot.isEmptyObj(e.claims))throw this.setCacheOutcome(cn.FORCE_REFRESH_OR_CLAIMS,e.correlationId),w(Vt);if(!e.account)throw w(ns);const r=e.account.tenantId||$p(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(i){if(Pl(i.cachedAt)||Yr(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(cn.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),w(Vt);i.refreshOn&&Yr(i.refreshOn,0)&&(t=cn.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(cn.NO_CACHED_ACCESS_TOKEN,e.correlationId),w(Vt);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await T(this.generateResultFromCacheRecord.bind(this),f.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==cn.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Yt(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw w(ts);Ol(i,t.maxAge)}return pn.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const tm={sendGetRequestAsync:()=>Promise.reject(w(q)),sendPostRequestAsync:()=>Promise.reject(w(q))};/*! @azure/msal-common v15.4.0 2025-03-25 */function nm(n,e,t,r){var a,c;const o=e.correlationId,i=new Map;gs(i,e.embeddedClientId||((a=e.extraQueryParameters)==null?void 0:a[gn])||n.clientId);const s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(fs(i,s,!0,(c=n.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),ps(i,e.redirectUri),Cs(i,o),Sp(i,e.responseMode),As(i),e.prompt&&(Pp(i,e.prompt),r==null||r.addFields({prompt:e.prompt},o)),e.domainHint&&(Op(i,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},o)),e.prompt!==Te.SELECT_ACCOUNT)if(e.sid&&e.prompt===Te.NONE)t.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),Fa(i,e.sid),r==null||r.addFields({sidFromRequest:!0},o);else if(e.account){const l=im(e.account);let d=sm(e.account);if(d&&e.domainHint&&(t.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),d=null),d){t.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),Or(i,d),r==null||r.addFields({loginHintFromClaim:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(l&&e.prompt===Te.NONE){t.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),Fa(i,l),r==null||r.addFields({sidFromClaim:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)t.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),Or(i,e.loginHint),to(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o);else if(e.account.username){t.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),Or(i,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(t.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),Or(i,e.loginHint),to(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o));else t.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&Np(i,e.nonce),e.state&&od(i,e.state),(e.claims||n.clientCapabilities&&n.clientCapabilities.length>0)&&ms(i,e.claims,n.clientCapabilities),e.embeddedClientId&&So(i,n.clientId,n.redirectUri),n.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Ai))&&ld(i),i}function wd(n,e){const t=fr(e);return W.appendQueryString(n.authorizationEndpoint,t)}function rm(n,e){if(vd(n,e),!n.code)throw w(El);return n}function vd(n,e){if(!n.state||!e)throw n.state?w(gi,"Cached State"):w(gi,"Server State");let t,r;try{t=decodeURIComponent(n.state)}catch{throw w(Ln,n.state)}try{r=decodeURIComponent(e)}catch{throw w(Ln,n.state)}if(t!==r)throw w(pl);if(n.error||n.error_description||n.suberror){const o=om(n);throw yd(n.error,n.error_description,n.suberror)?new Xe(n.error||"",n.error_description,n.suberror,n.timestamp||"",n.trace_id||"",n.correlation_id||"",n.claims||"",o):new en(n.error||"",n.error_description,n.suberror,o)}}function om(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}function im(n){var e;return((e=n.idTokenClaims)==null?void 0:e.sid)||null}function sm(n){var e;return((e=n.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ga=",",Id="|";function am(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:i}=n,s=new Map([[0,[t,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(Ga),a.length<4)return e}else a=Array.from({length:4},()=>Id);return s.forEach((c,l)=>{var d,h;c.length===2&&((d=c[0])!=null&&d.length)&&((h=c[1])!=null&&h.length)&&cm({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(Ga)}function cm(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Id))}class gr{constructor(e,t){this.cacheOutcome=cn.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||C.EMPTY_STRING,this.wrapperVer=e.wrapperVer||C.EMPTY_STRING,this.telemetryCacheKey=ye.CACHE_KEY+_e.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${ye.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(ye.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(ye.VALUE_SEPARATOR);return[ye.SCHEMA_VERSION,s,o].join(ye.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=gr.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(ye.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(ye.VALUE_SEPARATOR),i=e.errors.length,s=t<i?ye.OVERFLOW_TRUE:ye.OVERFLOW_FALSE,a=[i,s].join(ye.VALUE_SEPARATOR);return[ye.SCHEMA_VERSION,e.cacheHits,r,o,a].join(ye.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=ye.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Z?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(ye.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=gr.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const i=e.errors.length;for(t=0;t<i;t++){const s=e.failedRequests[2*t]||C.EMPTY_STRING,a=e.failedRequests[2*t+1]||C.EMPTY_STRING,c=e.errors[t]||C.EMPTY_STRING;if(o+=s.toString().length+a.toString().length+c.length+3,o<ye.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||C.EMPTY_STRING),e.push(this.regionSource||C.EMPTY_STRING),e.push(this.regionOutcome||C.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return am(e)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ed="missing_kid_error",_d="missing_alg_error";/*! @azure/msal-common v15.4.0 2025-03-25 */const lm={[Ed]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[_d]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class _s extends Z{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,_s.prototype)}}function $a(n){return new _s(n,lm[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ss{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw $a(Ed);if(!e.alg)throw $a(_d);const t=new Ss({typ:e.typ||ng.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class qa{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class dm{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Gp.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new qa}}startPerformanceMeasurement(){return new qa}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const bs="pkce_not_created",ks="ear_jwk_empty",Sd="ear_jwe_empty",vi="crypto_nonexistent",Po="empty_navigate_uri",bd="hash_empty_error",Rs="no_state_in_hash",kd="hash_does_not_contain_known_properties",Rd="unable_to_parse_state",Od="state_interaction_type_mismatch",Pd="interaction_in_progress",Nd="popup_window_error",Md="empty_window_error",pr="user_cancelled",hm="monitor_popup_timeout",xd="monitor_window_timeout",Hd="redirect_in_iframe",Ld="block_iframe_reload",Ud="block_nested_popups",um="iframe_closed_prematurely",No="silent_logout_unsupported",Dd="no_account_error",fm="silent_prompt_value_error",Fd="no_token_request_cache_error",Bd="unable_to_parse_token_request_cache_error",gm="auth_request_not_set_error",pm="invalid_cache_type",Mo="non_browser_environment",En="database_not_open",ro="no_network_connectivity",Kd="post_request_failed",Gd="get_request_failed",Ii="failed_to_parse_response",$d="unable_to_load_token",Os="crypto_key_not_found",qd="auth_code_required",zd="auth_code_or_nativeAccountId_required",Vd="spa_code_and_nativeAccountId_present",Ps="database_unavailable",jd="unable_to_acquire_token_from_native_platform",Wd="native_handshake_timeout",Yd="native_extension_not_installed",Ns="native_connection_not_established",oo="uninitialized_public_client_application",Qd="native_prompt_not_supported",Jd="invalid_base64_string",Xd="invalid_pop_token_request",Zd="failed_to_build_headers",eh="failed_to_parse_headers",Dr="failed_to_decrypt_ear_response";/*! @azure/msal-browser v4.9.0 2025-03-25 */const St="For more visit: aka.ms/msaljs/browser-errors",mm={[bs]:"The PKCE code challenge and verifier could not be generated.",[ks]:"No EAR encryption key provided. This is unexpected.",[Sd]:"Server response does not contain ear_jwe property. This is unexpected.",[vi]:"The crypto object or function is not available.",[Po]:"Navigation URI is empty. Please check stack trace for more info.",[bd]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${St}`,[Rs]:"Hash does not contain state. Please verify that the request originated from msal.",[kd]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${St}`,[Rd]:"Unable to parse state. Please verify that the request originated from msal.",[Od]:"Hash contains state but the interaction type does not match the caller.",[Pd]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${St}`,[Nd]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Md]:"window.open returned null or undefined window object.",[pr]:"User cancelled the flow.",[hm]:`Token acquisition in popup failed due to timeout. ${St}`,[xd]:`Token acquisition in iframe failed due to timeout. ${St}`,[Hd]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Ld]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${St}`,[Ud]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[um]:"The iframe being monitored was closed prematurely.",[No]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Dd]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[fm]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Fd]:"No token request found in cache.",[Bd]:"The cached token request could not be parsed.",[gm]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[pm]:"Invalid cache type",[Mo]:"Login and token requests are not supported in non-browser environments.",[En]:"Database is not open!",[ro]:"No network connectivity. Check your internet connection.",[Kd]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[Gd]:"Network request failed. Please check the network trace to determine root cause.",[Ii]:"Failed to parse network response. Check network trace.",[$d]:"Error loading token to cache.",[Os]:"Cryptographic Key or Keypair not found in browser storage.",[qd]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[zd]:"An authorization code or nativeAccountId must be provided to this flow.",[Vd]:"Request cannot contain both spa code and native account id.",[Ps]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[jd]:`Unable to acquire token from native platform. ${St}`,[Wd]:"Timed out while attempting to establish connection to browser extension",[Yd]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Ns]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${St}`,[oo]:`You must call and await the initialize function before attempting to call any other MSAL API. ${St}`,[Qd]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[Jd]:"Invalid base64 encoded string.",[Xd]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Zd]:"Failed to build request headers object.",[eh]:"Failed to parse response headers",[Dr]:"Failed to decrypt ear response"};class Tr extends Z{constructor(e,t){super(e,mm[e],t),Object.setPrototypeOf(this,Tr.prototype),this.name="BrowserAuthError"}}function P(n,e){return new Tr(n,e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Ne={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},Sn={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},ln={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ae={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},za={GET:"GET",POST:"POST"},ge={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},$t={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Pr={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},se={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var M;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(M||(M={}));const Ei={scopes:yn},th="jwk",_i="msal.db",Cm=1,ym=`${_i}.keys`,Ce={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Tm=[Ce.Default,Ce.Skip,Ce.RefreshTokenAndNetwork],Am="msal.browser.log.level",wm="msal.browser.log.pii";/*! @azure/msal-browser v4.9.0 2025-03-25 */function Nr(n){return encodeURIComponent(mr(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Qt(n){return nh(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mr(n){return nh(new TextEncoder().encode(n))}function nh(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */function it(n){return new TextDecoder().decode(jt(n))}function jt(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw P(Jd)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const vm="RSASSA-PKCS1-v1_5",Bn="AES-GCM",rh="HKDF",Ms="SHA-256",Im=2048,Em=new Uint8Array([1,0,1]),Va="0123456789abcdef",ja=new Uint32Array(1),xs="raw",oh="encrypt",Hs="decrypt",_m="deriveKey",Sm="crypto_subtle_undefined",Ls={name:vm,hash:Ms,modulusLength:Im,publicExponent:Em};function bm(n){if(!window)throw P(Mo);if(!window.crypto)throw P(vi);if(!n&&!window.crypto.subtle)throw P(vi,Sm)}async function ih(n,e,t){e==null||e.addQueueMeasurement(f.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(Ms,o)}function km(n){return window.crypto.getRandomValues(n)}function ti(){return window.crypto.getRandomValues(ja),ja[0]}function We(){const n=Date.now(),e=ti()*1024+(ti()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=ti();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=i>>>24,t[13]=i>>>16,t[14]=i>>>8,t[15]=i;let s="";for(let a=0;a<t.length;a++)s+=Va.charAt(t[a]>>>4),s+=Va.charAt(t[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function Rm(n,e){return window.crypto.subtle.generateKey(Ls,n,e)}async function ni(n){return window.crypto.subtle.exportKey(th,n)}async function Om(n,e,t){return window.crypto.subtle.importKey(th,n,Ls,e,t)}async function Pm(n,e){return window.crypto.subtle.sign(Ls,n,e)}async function Us(){const n=await sh(),t={alg:"dir",kty:"oct",k:Qt(new Uint8Array(n))};return mr(JSON.stringify(t))}async function Nm(n){const e=it(n),r=JSON.parse(e).k,o=jt(r);return window.crypto.subtle.importKey(xs,o,Bn,!1,[Hs])}async function Mm(n,e){const t=e.split(".");if(t.length!==5)throw P(Dr,"jwe_length");const r=await Nm(n).catch(()=>{throw P(Dr,"import_key")});try{const o=new TextEncoder().encode(t[0]),i=jt(t[2]),s=jt(t[3]),a=jt(t[4]),c=a.byteLength*8,l=new Uint8Array(s.length+a.length);l.set(s),l.set(a,s.length);const d=await window.crypto.subtle.decrypt({name:Bn,iv:i,tagLength:c,additionalData:o},r,l);return new TextDecoder().decode(d)}catch{throw P(Dr,"decrypt")}}async function sh(){const n=await window.crypto.subtle.generateKey({name:Bn,length:256},!0,[oh,Hs]);return window.crypto.subtle.exportKey(xs,n)}async function Wa(n){return window.crypto.subtle.importKey(xs,n,rh,!1,[_m])}async function ah(n,e,t){return window.crypto.subtle.deriveKey({name:rh,salt:e,hash:Ms,info:new TextEncoder().encode(t)},n,{name:Bn,length:256},!1,[oh,Hs])}async function xm(n,e,t){const r=new TextEncoder().encode(e),o=window.crypto.getRandomValues(new Uint8Array(16)),i=await ah(n,o,t),s=await window.crypto.subtle.encrypt({name:Bn,iv:new Uint8Array(12)},i,r);return{data:Qt(new Uint8Array(s)),nonce:Qt(o)}}async function Hm(n,e,t,r){const o=jt(r),i=await ah(n,jt(e),t),s=await window.crypto.subtle.decrypt({name:Bn,iv:new Uint8Array(12)},i,o);return new TextDecoder().decode(s)}async function ch(n){const e=await ih(n),t=new Uint8Array(e);return Qt(t)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Ds="storage_not_supported",Lm="stubbed_public_client_application_called",lh="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.9.0 2025-03-25 */const Um={[Ds]:"Given storage configuration option was not supported.",[Lm]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[lh]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class Fs extends Z{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Fs.prototype)}}function Bs(n){return new Fs(n,Um[n])}/*! @azure/msal-browser v4.9.0 2025-03-25 */function Dm(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Fm(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Ks(){return window.parent!==window}function Bm(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Ne.POPUP_NAME_PREFIX}.`)===0}function Nt(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Km(){const e=new W(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Gm(){if(W.hashContainsKnownProperties(window.location.hash)&&Ks())throw P(Ld)}function $m(n){if(Ks()&&!n)throw P(Hd)}function qm(){if(Bm())throw P(Ud)}function dh(){if(typeof window>"u")throw P(Mo)}function hh(n){if(!n)throw P(oo)}function Gs(n){dh(),Gm(),qm(),hh(n)}function Ya(n,e){if(Gs(n),$m(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ae.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Bs(lh)}function uh(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function zm(){return We()}/*! @azure/msal-browser v4.9.0 2025-03-25 */class io{navigateInternal(e,t){return io.defaultNavigateWindow(e,t)}navigateExternal(e,t){return io.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Vm{async sendGetRequestAsync(e,t){let r,o={},i=0;const s=Qa(t);try{r=await fetch(e,{method:za.GET,headers:s})}catch{throw P(window.navigator.onLine?Gd:ro)}o=Ja(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw Ba(P(Ii),i,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=Qa(t);let i,s=0,a={};try{i=await fetch(e,{method:za.POST,headers:o,body:r})}catch{throw P(window.navigator.onLine?Kd:ro)}a=Ja(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw Ba(P(Ii),s,a)}}}function Qa(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw P(Zd)}}function Ja(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw P(eh)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const jm=6e4,Si=1e4,Wm=3e4,Ym=2e3;function Qm({auth:n,cache:e,system:t,telemetry:r},o){const i={clientId:C.EMPTY_STRING,authority:`${C.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:C.EMPTY_STRING,authorityMetadata:C.EMPTY_STRING,redirectUri:typeof window<"u"?Nt():"",postLogoutRedirectUri:C.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:xe.AAD,OIDCOptions:{serverResponseType:yo.FRAGMENT,defaultScopes:[C.OPENID_SCOPE,C.PROFILE_SCOPE,C.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:ss.None,tenant:C.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:Ae.SessionStorage,temporaryCacheLocation:Ae.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Ae.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:he.Info,piiLoggingEnabled:!1},l={...{...Xl,loggerOptions:a,networkClient:o?new Vm:tm,navigationClient:new io,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||jm,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Si,navigateFrameWait:0,redirectNavigationTimeout:Wm,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||Ym,pollIntervalMilliseconds:Ne.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},d={application:{appName:C.EMPTY_STRING,appVersion:C.EMPTY_STRING},client:new dm};if((n==null?void 0:n.protocolMode)!==xe.OIDC&&(n!=null&&n.OIDCOptions)&&new Ht(l.loggerOptions).warning(JSON.stringify(re(ql))),n!=null&&n.protocolMode&&n.protocolMode===xe.OIDC&&(l!=null&&l.allowPlatformBroker))throw re(zl);const h={auth:{...i,...n,OIDCOptions:{...i.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...d,...r}};return h.auth.protocolMode===xe.EAR&&(new Ht(l.loggerOptions).warning("EAR Protocol Mode is not yet supported. Overriding to use PKCE auth"),h.auth.protocolMode=xe.AAD),h}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Jm="@azure/msal-browser",Kn="4.9.0";/*! @azure/msal-browser v4.9.0 2025-03-25 */class xo{static loggerCallback(e,t){switch(e){case he.Error:console.error(t);return;case he.Info:console.info(t);return;case he.Verbose:console.debug(t);return;case he.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Qm(e,this.browserEnvironment);let t;try{t=window[Ae.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(Am),o=(c=t==null?void 0:t.getItem(wm))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(he).includes(r)?he[r]:void 0;a&&(s.loggerCallback=xo.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new Ht(s,Jm,Kn),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const kt={UserInteractionRequired:"USER_INTERACTION_REQUIRED",UserCancel:"USER_CANCEL",NoNetwork:"NO_NETWORK",TransientError:"TRANSIENT_ERROR",PersistentError:"PERSISTENT_ERROR",Disabled:"DISABLED",AccountUnavailable:"ACCOUNT_UNAVAILABLE",NestedAppAuthUnavailable:"NESTED_APP_AUTH_UNAVAILABLE"};/*! @azure/msal-browser v4.9.0 2025-03-25 */class Re{static async initializeNestedAppAuthBridge(){if(window===void 0)throw new Error("window is undefined");if(window.nestedAppAuthBridge===void 0)throw new Error("window.nestedAppAuthBridge is undefined");try{window.nestedAppAuthBridge.addEventListener("message",t=>{const r=typeof t=="string"?t:t.data,o=JSON.parse(r),i=Re.bridgeRequests.find(s=>s.requestId===o.requestId);i!==void 0&&(Re.bridgeRequests.splice(Re.bridgeRequests.indexOf(i),1),o.success?i.resolve(o):i.reject(o.error))});const e=await new Promise((t,r)=>{const o=Re.buildRequest("GetInitContext"),i={requestId:o.requestId,method:o.method,resolve:t,reject:r};Re.bridgeRequests.push(i),window.nestedAppAuthBridge.postMessage(JSON.stringify(o))});return Re.validateBridgeResultOrThrow(e.initContext)}catch(e){throw window.console.log(e),e}}getTokenInteractive(e){return this.getToken("GetTokenPopup",e)}getTokenSilent(e){return this.getToken("GetToken",e)}async getToken(e,t){const r=await this.sendRequest(e,{tokenParams:t});return{token:Re.validateBridgeResultOrThrow(r.token),account:Re.validateBridgeResultOrThrow(r.account)}}getHostCapabilities(){return this.capabilities??null}getAccountContext(){return this.accountContext?this.accountContext:null}static buildRequest(e,t){return{messageType:"NestedAppAuthRequest",method:e,requestId:We(),sendTime:Date.now(),clientLibrary:Ne.MSAL_SKU,clientLibraryVersion:Kn,...t}}sendRequest(e,t){const r=Re.buildRequest(e,t);return new Promise((i,s)=>{const a={requestId:r.requestId,method:r.method,resolve:i,reject:s};Re.bridgeRequests.push(a),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))})}static validateBridgeResultOrThrow(e){if(e===void 0)throw{status:kt.NestedAppAuthUnavailable};return e}constructor(e,t,r,o){this.sdkName=e,this.sdkVersion=t,this.accountContext=r,this.capabilities=o}static async create(){const e=await Re.initializeNestedAppAuthBridge();return new Re(e.sdkName,e.sdkVersion,e.accountContext,e.capabilities)}}Re.bridgeRequests=[];/*! @azure/msal-browser v4.9.0 2025-03-25 */class Dn extends xo{constructor(){super(...arguments),this.bridgeProxy=void 0,this.accountContext=null}getModuleName(){return Dn.MODULE_NAME}getId(){return Dn.ID}getBridgeProxy(){return this.bridgeProxy}async initialize(){try{if(typeof window<"u"){typeof window.__initializeNestedAppAuth=="function"&&await window.__initializeNestedAppAuth();const e=await Re.create();this.accountContext=e.getAccountContext(),this.bridgeProxy=e,this.available=e!==void 0}}catch(e){this.logger.infoPii(`Could not initialize Nested App Auth bridge (${e})`)}return this.logger.info(`Nested App Auth Bridge available: ${this.available}`),this.available}}Dn.MODULE_NAME="";Dn.ID="NestedAppOperatingContext";/*! @azure/msal-browser v4.9.0 2025-03-25 */class mn extends xo{getModuleName(){return mn.MODULE_NAME}getId(){return mn.ID}async initialize(){return this.available=typeof window<"u",this.available}}mn.MODULE_NAME="";mn.ID="StandardOperatingContext";/*! @azure/msal-browser v4.9.0 2025-03-25 */class Xm{constructor(){this.dbName=_i,this.version=Cm,this.tableName=ym,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(P(Ps)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(P(En));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(P(En));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(_i),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Ho{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,t){this.cache.set(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Zm{constructor(e){this.inMemoryCache=new Ho,this.indexedDBCache=new Xm,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Tr&&e.errorCode===Ps)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class wt{constructor(e,t,r){this.logger=e,bm(r??!1),this.cache=new Zm(this.logger),this.performanceClient=t}createNewGuid(){return We()}base64Encode(e){return mr(e)}base64Decode(e){return it(e)}base64UrlEncode(e){return Nr(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var d;const t=(d=this.performanceClient)==null?void 0:d.startMeasurement(f.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Rm(wt.EXTRACTABLE,wt.POP_KEY_USAGES),o=await ni(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=Xa(i),a=await this.hashString(s),c=await ni(r.privateKey),l=await Om(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var Y;const i=(Y=this.performanceClient)==null?void 0:Y.startMeasurement(f.CryptoOptsSignJwt,o),s=await this.cache.getItem(t);if(!s)throw P(Os);const a=await ni(s.publicKey),c=Xa(a),l=Nr(JSON.stringify({kid:t})),d=Ss.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),h=Nr(d);e.cnf={jwk:JSON.parse(c)};const p=Nr(JSON.stringify(e)),y=`${h}.${p}`,S=new TextEncoder().encode(y),$=await Pm(s.privateKey,S),D=Qt(new Uint8Array($)),z=`${y}.${D}`;return i&&i.end({success:!0}),z}async hashString(e){return ch(e)}}wt.POP_KEY_USAGES=["sign","verify"];wt.EXTRACTABLE=!0;function Xa(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v4.9.0 2025-03-25 */const eC=24*60*60*1e3,bi={Lax:"Lax",None:"None"};class fh{initialize(){return Promise.resolve()}getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const i=r[o],[s,...a]=decodeURIComponent(i).trim().split("="),c=a.join("=");if(s===t)return c}return""}getUserData(){throw w(q)}setItem(e,t,r,o=!0,i=bi.Lax){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=${i};`;if(r){const a=tC(r);s+=`expires=${a};`}(o||i===bi.None)&&(s+="Secure;"),document.cookie=s}async setUserData(){return Promise.reject(w(q))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function tC(n){const e=new Date;return new Date(e.getTime()+n*eC).toUTCString()}/*! @azure/msal-browser v4.9.0 2025-03-25 */function ki(n){const e=n.getItem($t.ACCOUNT_KEYS);return e?JSON.parse(e):[]}function Ri(n,e){const t=e.getItem(`${$t.TOKEN_KEYS}.${n}`);if(t){const r=JSON.parse(t);if(r&&r.hasOwnProperty("idToken")&&r.hasOwnProperty("accessToken")&&r.hasOwnProperty("refreshToken"))return r}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Za="msal.cache.encryption",nC="msal.broadcast.cache";class rC{constructor(e,t,r){if(!window.localStorage)throw Bs(Ds);this.memoryStorage=new Ho,this.initialized=!1,this.clientId=e,this.logger=t,this.performanceClient=r,this.broadcast=new BroadcastChannel(nC)}async initialize(e){this.initialized=!0;const t=new fh,r=t.getItem(Za);let o={key:"",id:""};if(r)try{o=JSON.parse(r)}catch{}if(o.key&&o.id){const i=st(jt,f.Base64Decode,this.logger,this.performanceClient,e)(o.key);this.encryptionCookie={id:o.id,key:await T(Wa,f.GenerateHKDF,this.logger,this.performanceClient,e)(i)},await T(this.importExistingCache.bind(this),f.ImportExistingCache,this.logger,this.performanceClient,e)(e)}else{this.clear();const i=We(),s=await T(sh,f.GenerateBaseKey,this.logger,this.performanceClient,e)(),a=st(Qt,f.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(s));this.encryptionCookie={id:i,key:await T(Wa,f.GenerateHKDF,this.logger,this.performanceClient,e)(s)};const c={id:i,key:a};t.setItem(Za,JSON.stringify(c),0,!0,bi.None)}this.broadcast.addEventListener("message",this.updateCache.bind(this))}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw P(oo);return this.memoryStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}async setUserData(e,t,r){if(!this.initialized||!this.encryptionCookie)throw P(oo);const{data:o,nonce:i}=await T(xm,f.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,t,this.getContext(e)),s={id:this.encryptionCookie.id,nonce:i,data:o};this.memoryStorage.setItem(e,t),this.setItem(e,JSON.stringify(s)),this.broadcast.postMessage({key:e,value:t,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),ki(this).forEach(r=>this.removeItem(r));const t=Ri(this.clientId,this);t.idToken.forEach(r=>this.removeItem(r)),t.accessToken.forEach(r=>this.removeItem(r)),t.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(C.CACHE_PREFIX)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let t=ki(this);t=await this.importArray(t,e),this.setItem($t.ACCOUNT_KEYS,JSON.stringify(t));const r=Ri(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),this.setItem(`${$t.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}async getItemFromEncryptedCache(e,t){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let o;try{o=JSON.parse(r)}catch{return null}return!o.id||!o.nonce||!o.data?(this.performanceClient.incrementFields({unencryptedCacheCount:1},t),null):o.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},t),null):T(Hm,f.Decrypt,this.logger,this.performanceClient,t)(this.encryptionCookie.key,o.nonce,this.getContext(e),o.data)}async importArray(e,t){const r=[],o=[];return e.forEach(i=>{const s=this.getItemFromEncryptedCache(i,t).then(a=>{a?(this.memoryStorage.setItem(i,a),r.push(i)):this.removeItem(i)});o.push(s)}),await Promise.all(o),r}getContext(e){let t="";return e.includes(this.clientId)&&(t=this.clientId),t}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const t=this.performanceClient.startMeasurement(f.LocalStorageUpdated);t.add({isBackground:!0});const{key:r,value:o,context:i}=e.data;if(!r){this.logger.error("Broadcast event missing key"),t.end({success:!1,errorCode:"noKey"});return}if(i&&i!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${i}`),t.end({success:!1,errorCode:"contextMismatch"});return}o?(this.memoryStorage.setItem(r,o),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),t.end({success:!0})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class oC{constructor(){if(!window.sessionStorage)throw Bs(Ds)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const N={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v4.9.0 2025-03-25 */class so extends Ti{constructor(e,t,r,o,i,s,a){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new Ho,this.browserStorage=ec(e,t.cacheLocation,o,i),this.temporaryCacheStorage=ec(e,t.temporaryCacheLocation,o,i),this.cookieStorage=new fh,this.performanceClient=i,this.eventHandler=s}async initialize(e){await this.browserStorage.initialize(e)}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getAccount(e){this.logger.trace("BrowserCacheManager.getAccount called");const t=this.browserStorage.getUserData(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!be.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):Ti.toObject(new be,r)}async setAccount(e,t){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t);const o=this.addAccountKeyToMap(r);this.cacheConfig.cacheLocation===Ae.LocalStorage&&o&&this.eventHandler.emitEvent(N.ACCOUNT_ADDED,void 0,e.getAccountInfo())}getAccountKeys(){return ki(this.browserStorage)}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();return t.indexOf(e)===-1?(t.push(e),this.browserStorage.setItem($t.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added"),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map"),!1)}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.browserStorage.setItem($t.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}async removeAccountContext(e){await super.removeAccountContext(e),this.cacheConfig.cacheLocation===Ae.LocalStorage&&this.eventHandler.emitEvent(N.ACCOUNT_REMOVED,void 0,e.getAccountInfo())}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,K.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,K.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,K.REFRESH_TOKEN)}getTokenKeys(){return Ri(this.clientId,this.browserStorage)}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case K.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case K.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case K.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),w(Ci)}this.browserStorage.setItem(`${$t.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case K.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case K.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const i=r.accessToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case K.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const s=r.refreshToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),w(Ci)}this.browserStorage.setItem(`${$t.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!mg(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}async setIdTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.ID_TOKEN)}getAccessTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!pg(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}async setAccessTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Cg(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}async setRefreshTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.REFRESH_TOKEN)}getAppMetadata(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Sg(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=_g(e);this.browserStorage.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Ig(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.browserStorage.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&bg(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Pr.WRAPPER_SKU,e),this.internalStorage.setItem(Pr.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Pr.WRAPPER_SKU)||C.EMPTY_STRING,t=this.internalStorage.getItem(Pr.WRAPPER_VER)||C.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(ba.ACTIVE_ACCOUNT_FILTERS),t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(ba.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const r={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(r))}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t);this.eventHandler.emitEvent(N.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Eg(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.browserStorage.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===Ae.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(C.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(C.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(f.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(i))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):ot.startsWith(e,C.CACHE_PREFIX)?e:`${C.CACHE_PREFIX}.${this.clientId}.${e}`}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(ge.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(ge.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(ge.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(ge.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(ge.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,t){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=mr(JSON.stringify(e));if(this.setTemporaryCache(ge.REQUEST_PARAMS,r,!0),t){const o=mr(t);this.setTemporaryCache(ge.VERIFIER,o,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(ge.REQUEST_PARAMS,!0);if(!e)throw P(Fd);const t=this.getTemporaryCache(ge.VERIFIER,!0);let r,o="";try{r=JSON.parse(it(e)),t&&(o=it(t))}catch(i){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${i}`),P(Bd)}return[r,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(ge.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${C.CACHE_PREFIX}.${ge.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${C.CACHE_PREFIX}.${ge.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw P(Pd);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}async hydrateCache(e,t){var a,c,l;const r=To((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const i=Ao((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?Na(e.expiresOn):0,e.extExpiresOn?Na(e.extExpiresOn):0,it,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof xn&&this.performanceClient&&t)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},t)}catch{}throw o}}}function ec(n,e,t,r){try{switch(e){case Ae.LocalStorage:return new rC(n,t,r);case Ae.SessionStorage:return new oC;case Ae.MemoryStorage:default:break}}catch(o){t.error(o)}return new Ho}const gh=(n,e,t,r)=>{const o={cacheLocation:Ae.MemoryStorage,temporaryCacheLocation:Ae.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new so(n,o,ur,e,t,r)};/*! @azure/msal-browser v4.9.0 2025-03-25 */function ph(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function Oi(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function mh(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function Ch(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function yh(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function Th(n,e){e.setActiveAccount(n)}function Ah(n){return n.getActiveAccount()}/*! @azure/msal-browser v4.9.0 2025-03-25 */const iC="msal.broadcast.event";class wh{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ht({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(iC)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||zm();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){var s;const i={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};switch(e){case N.ACCOUNT_ADDED:case N.ACCOUNT_REMOVED:case N.ACTIVE_ACCOUNT_CHANGED:(s=this.broadcastChannel)==null||s.postMessage(i);break;default:this.invokeCallbacks(i);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([t,r],o)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${o}: ${e.eventType}`),t.apply(null,[e]))})}invokeCrossTabCallbacks(e){const t=e.data;this.invokeCallbacks(t)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class vh{constructor(e,t,r,o,i,s,a,c,l){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||We(),this.logger=o.clone(Ne.MSAL_SKU,Kn,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){be.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(be.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return W.getAbsoluteUrl(t,Nt())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new gr(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(f.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=t&&s?this.config.auth.authority.replace(W.getDomainFromUrl(i),t.environment):i,c=ve.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await T(md,f.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw re(Vl);return l}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function $s(n,e,t,r){t.addQueueMeasurement(f.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,i=[...n&&n.scopes||[]],s={...n,correlationId:n.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=X.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===X.SSH){if(!n.sshJwk)throw re(Io);if(!n.sshKid)throw re($l)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!ot.isEmptyObj(n.claims)&&(s.requestedClaimsHash=await ch(n.claims)),s}async function sC(n,e,t,r,o){r.addQueueMeasurement(f.InitializeSilentRequest,n.correlationId);const i=await T($s,f.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...i,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Gn extends vh{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||We(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=W.getAbsoluteUrl(e.postLogoutRedirectUri,Nt())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=W.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Nt())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=W.getAbsoluteUrl(Nt(),Nt())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(f.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Ad(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(f.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Ne.MSAL_SKU,version:Kn,cpu:C.EMPTY_STRING,os:C.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(f.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=Fn.setRequestState(this.browserCrypto,e&&e.state||C.EMPTY_STRING,o),a={...await T($s,f.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||We(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount();return c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),a}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const aC="ContentError",Ih="user_switch";/*! @azure/msal-browser v4.9.0 2025-03-25 */const cC="USER_INTERACTION_REQUIRED",lC="USER_CANCEL",dC="NO_NETWORK",hC="PERSISTENT_ERROR",uC="DISABLED",fC="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v4.9.0 2025-03-25 */const gC=-2147186943,pC={[Ih]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class mt extends Z{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,mt.prototype),this.name="NativeAuthError",this.ext=r}}function _n(n){if(n.ext&&n.ext.status&&(n.ext.status===hC||n.ext.status===uC)||n.ext&&n.ext.error&&n.ext.error===gC)return!0;switch(n.errorCode){case aC:return!0;default:return!1}}function Pi(n,e,t){if(t&&t.status)switch(t.status){case fC:return wi(Cd);case cC:return new Xe(n,e);case lC:return P(pr);case dC:return P(ro)}return new mt(n,pC[n]||e,t)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class yt{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(f.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:Sn.CHANNEL_ID,extensionId:this.extensionId,responseId:We(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new yt(e,t,r,Sn.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new yt(e,t,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Sn.CHANNEL_ID,extensionId:this.extensionId,responseId:We(),body:{method:ln.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(P(Wd)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==Sn.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===ln.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(P(Yd))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const i=t.body.method;if(i===ln.Response){if(!r)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(Pi(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(Pi(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw dl(Xi,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(i===ln.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isPlatformBrokerAvailable(e,t,r,o){if(t.trace("isPlatformBrokerAvailable called"),!e.system.allowPlatformBroker)return t.trace("isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false"),!1;if(!r)return t.trace("isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false"),!1;if(o)switch(o){case X.BEARER:case X.POP:return t.trace("isPlatformBrokerAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isPlatformBrokerAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function mC(n,e){if(!e)return null;try{return Fn.parseRequestState(n,e).libraryState.meta}catch{throw w(Ln)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function ao(n,e,t){const r=Jr(n);if(!r)throw Wl(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),P(kd)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),P(bd));return r}function CC(n,e,t){if(!n.state)throw P(Rs);const r=mC(e,n.state);if(!r)throw P(Rd);if(r.interactionType!==t)throw P(Od)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Eh{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(f.HandleCodeResponse,t.correlationId);let r;try{r=rm(e,t.state)}catch(o){throw o instanceof en&&o.subError===pr?P(pr):o}return T(this.handleCodeResponseFromServer.bind(this),f.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(f.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await T(this.authModule.updateAuthority.bind(this.authModule),f.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(t);i&&(this.authCodeRequest.ccsCredential=i)}return await T(this.authModule.acquireToken.bind(this.authModule),f.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:nt.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:nt.UPN}:null}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class _h extends Gn{async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(se.acquireTokenSilent_silentFlow),r=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new em(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await T(o.acquireCachedToken.bind(o),f.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof Tr&&i.errorCode===Os&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Fr extends vh{constructor(e,t,r,o,i,s,a,c,l,d,h,p){var k;super(e,t,r,o,i,s,c,l,p),this.apiId=a,this.accountId=d,this.nativeMessageHandler=l,this.nativeStorageManager=h,this.silentCacheClient=new _h(e,this.nativeStorageManager,r,o,i,s,c,l,p);const y=this.nativeMessageHandler.getExtensionId()===Sn.PREFERRED_EXTENSION_ID?"chrome":(k=this.nativeMessageHandler.getExtensionId())!=null&&k.length?"unknown":void 0;this.skus=gr.makeExtraSkuString({libraryName:Ne.MSAL_SKU,libraryVersion:Kn,extensionName:y,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Ip]:this.skus}}async acquireToken(e,t){this.performanceClient.addQueueMeasurement(f.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement(f.NativeInteractionClientAcquireToken,e.correlationId),o=Le(),i=this.initializeServerTelemetryManager(this.apiId);try{const s=await this.initializeNativeRequest(e);try{const h=await this.acquireTokensFromCache(this.accountId,s);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),h}catch(h){if(t===Ce.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),h;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=s,c={method:ln.GetToken,request:a},l=await this.nativeMessageHandler.sendMessage(c),d=this.validateNativeResponse(l);return await this.handleNativeResponse(d,s,o).then(h=>(r.end({success:!0,isNativeBroker:!0,requestId:h.requestId}),i.clearNativeBrokerErrorCode(),h)).catch(h=>{throw r.end({success:!1,errorCode:h.errorCode,subErrorCode:h.subError,isNativeBroker:!0}),h})}catch(s){throw s instanceof mt&&i.setNativeBrokerErrorCode(s.errorCode),s}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:fe.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),w(Wr);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw w(Wr);try{const o=this.createSilentCacheRequest(t,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:ln.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof mt&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(c.errorCode),_n(c)))throw c}this.browserStorage.setTemporaryCache(ge.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:se.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ge.NATIVE_REQUEST));const s={method:ln.GetToken,request:i},a=Le();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const d=await this.handleNativeResponse(c,i,a);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),d}catch(c){throw c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var d,h;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Yt(e.id_token,it),i=this.createHomeAccountIdentifier(e,o),s=(d=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:d.homeAccountId;if((h=t.extraParameters)!=null&&h.child_client_id&&e.account.id!==t.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(i!==s&&e.account.id!==t.accountId)throw Pi(Ih);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),c=Es(this.browserStorage,a,i,it,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const l=await this.generateAuthenticationResult(e,t,o,c,a.canonicalAuthority,r);return await this.cacheAccount(c),await this.cacheNativeTokens(e,t,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,t){return be.generateHomeAccountId(e.client_info||C.EMPTY_STRING,tt.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?fe.fromString(e.scope):fe.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===X.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Un(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw w(os);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?fe.fromString(e.scope):fe.fromString(t.scope),l=e.account.properties||{},d=l.UID||r.oid||r.sub||C.EMPTY_STRING,h=l.TenantId||r.tid||C.EMPTY_STRING,p=ds(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const y=await this.generatePopAccessToken(e,t),k=t.tokenType===X.POP?X.POP:X.BEARER;return{authority:i,uniqueId:d,tenantId:h,scopes:c.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:y,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:xt(s+e.expires_in),tokenType:k,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,i,s,a){const c=To(r,t.authority,e.id_token||"",t.clientId,o.tid||""),l=t.tokenType===X.POP?C.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,d=a+l,h=this.generateScopes(e,t),p=Ao(r,t.authority,i,t.clientId,o.tid||s,h.printScopes(),d,0,it,void 0,t.tokenType,void 0,t.keyId),y={idToken:c,accessToken:p};return this.nativeStorageManager.saveCacheRecord(y,this.correlationId,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw dl(Xi,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new W(t);r.validateAsUri();const{scopes:o,...i}=e,s=new fe(o||[]);s.appendScopes(yn);const a=()=>{switch(this.apiId){case se.ssoSilent:case se.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Te.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Te.NONE:case Te.CONSENT:case Te.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),P(Qd)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw P(Xd);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=Sn.MATS_TELEMETRY,e.authenticationScheme===X.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},d=new Un(this.browserCrypto);let h;if(c.keyId)h=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const p=await T(d.generateCnf.bind(d),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);h=p.reqCnfString,c.keyId=p.kid,c.signPopToken=!0}c.reqCnf=h}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(Zr)&&e.extraParameters.hasOwnProperty(eo)&&e.extraParameters.hasOwnProperty(gn);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[eo],r=e.extraParameters[gn]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function Sh(n,e,t,r,o){const i=nm({...n.auth,authority:e},t,r,o);if(ys(i,{sku:Ne.MSAL_SKU,version:Kn,os:"",cpu:""}),n.auth.protocolMode!==xe.OIDC&&Ts(i,n.telemetry.application),t.platformBroker&&(bp(i),t.authenticationScheme===X.POP)){const s=new wt(r,o),a=new Un(s);let c;t.popKid?c=s.encodeKid(t.popKid):c=(await T(a.generateCnf.bind(a),f.PopTokenGenerateCnf,r,o,t.correlationId)(t,r)).reqCnfString,ws(i,c)}return _o(i,t.correlationId,o),i}async function qs(n,e,t,r,o){if(!t.codeChallenge)throw re(vo);const i=await T(Sh,f.GetStandardParams,r,o,t.correlationId)(n,e,t,r,o);return rd(i,cl.CODE),Mp(i,t.codeChallenge,C.S256_CODE_CHALLENGE_METHOD),hn(i,t.extraQueryParameters||{}),wd(e,i)}async function zs(n,e,t,r,o,i){if(!r.earJwk)throw P(ks);const s=await Sh(e,t,r,o,i);rd(s,cl.IDTOKEN_TOKEN_REFRESHTOKEN),Dp(s,r.earJwk);const a=new Map;hn(a,r.extraQueryParameters||{});const c=wd(t,a);return yC(n,c,s)}function yC(n,e,t){const r=n.createElement("form");return r.method="post",r.action=e,t.forEach((o,i)=>{const s=n.createElement("input");s.hidden=!0,s.name=i,s.value=o,r.appendChild(s)}),n.body.appendChild(r),r}async function bh(n,e,t,r,o,i,s,a,c,l){if(!l)throw P(Ns);const d=new wt(a,c),h=new Fr(r,o,d,a,s,r.system.navigationClient,t,c,l,e,i,n.correlationId),{userRequestState:p}=Fn.parseRequestState(d,n.state);return T(h.acquireToken.bind(h),f.NativeInteractionClientAcquireToken,a,c,n.correlationId)({...n,state:p,prompt:void 0})}async function Vs(n,e,t,r,o,i,s,a,c,l,d,h){if(pt.removeThrottle(s,o.auth.clientId,n),e.accountId)return T(bh,f.HandleResponsePlatformBroker,l,d,n.correlationId)(n,e.accountId,r,o,s,a,c,l,d,h);const p={...n,code:e.code||"",codeVerifier:t},y=new Eh(i,s,p,l,d);return await T(y.handleCodeResponse.bind(y),f.HandleCodeResponse,l,d,n.correlationId)(e,n)}async function js(n,e,t,r,o,i,s,a,c,l,d){if(pt.removeThrottle(i,r.auth.clientId,n),vd(e,n.state),!e.ear_jwe)throw P(Sd);if(!n.earJwk)throw P(ks);const h=JSON.parse(await T(Mm,f.DecryptEarResponse,c,l,n.correlationId)(n.earJwk,e.ear_jwe));if(h.accountId)return T(bh,f.HandleResponsePlatformBroker,c,l,n.correlationId)(n,h.accountId,t,r,i,s,a,c,l,d);const p=new pn(r.auth.clientId,i,new wt(c,l),c,null,null,l);p.validateTokenResponse(h);const y={code:"",state:n.state,nonce:n.nonce,client_info:h.client_info,cloud_graph_host_name:h.cloud_graph_host_name,cloud_instance_host_name:h.cloud_instance_host_name,cloud_instance_name:h.cloud_instance_name,msgraph_host:h.msgraph_host};return await T(p.handleServerTokenResponse.bind(p),f.HandleServerTokenResponse,c,l,n.correlationId)(h,o,Le(),n,y,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const TC=32;async function Lo(n,e,t){n.addQueueMeasurement(f.GeneratePkceCodes,t);const r=st(AC,f.GenerateCodeVerifier,e,n,t)(n,e,t),o=await T(wC,f.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function AC(n,e,t){try{const r=new Uint8Array(TC);return st(km,f.GetRandomValues,e,n,t)(r),Qt(r)}catch{throw P(bs)}}async function wC(n,e,t,r){e.addQueueMeasurement(f.GenerateCodeChallengeFromVerifier,r);try{const o=await T(ih,f.Sha256Digest,t,e,r)(n,e,r);return Qt(new Uint8Array(o))}catch{throw P(bs)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class vC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,a,l,d),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c,this.eventHandler=i}acquireToken(e,t){try{const o={popupName:this.generatePopupName(e.scopes||yn,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,o,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),o.popup=this.openSizedPopup("about:blank",o),this.acquireTokenPopupAsync(e,o,t))}catch(r){return Promise.reject(r)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,i))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t,r){this.logger.verbose("acquireTokenPopupAsync called");const o=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,M.Popup);t.popup&&uh(o.authority);const i=yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);return o.platformBroker=i,this.config.auth.protocolMode===xe.EAR?this.executeEarFlow(o,t):this.executeCodeFlow(o,t,r)}async executeCodeFlow(e,t,r){var c;const o=e.correlationId,i=this.initializeServerTelemetryManager(se.acquireTokenPopup),s=r||await T(Lo,f.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),a={...e,codeChallenge:s.challenge};try{const l=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:i,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account}),d=await T(qs,f.GetAuthCodeUrl,this.logger,this.performanceClient,o)(this.config,l.authority,a,this.logger,this.performanceClient),h=this.initiateAuthRequest(d,t);this.eventHandler.emitEvent(N.POPUP_OPENED,M.Popup,{popupWindow:h},null);const p=await this.monitorPopupForHash(h,t.popupWindowParent),y=st(ao,f.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(p,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await T(Vs,f.HandleResponseCode,this.logger,this.performanceClient,o)(e,y,s.verifier,se.acquireTokenPopup,this.config,l,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}catch(l){throw(c=t.popup)==null||c.close(),l instanceof Z&&(l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l)),l}}async executeEarFlow(e,t){const r=e.correlationId,o=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await T(Us,f.GenerateEarKey,this.logger,this.performanceClient,r)(),s={...e,earJwk:i},a=t.popup||this.openPopup("about:blank",t);(await zs(a.document,this.config,o,s,this.logger,this.performanceClient)).submit();const l=await T(this.monitorPopupForHash.bind(this),f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,t.popupWindowParent),d=st(ao,f.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,this.config.auth.OIDCOptions.serverResponseType,this.logger);return T(js,f.HandleResponseEar,this.logger,this.performanceClient,r)(s,d,se.acquireTokenPopup,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}async logoutPopupAsync(e,t,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(N.LOGOUT_START,M.Popup,e);const i=this.initializeServerTelemetryManager(se.logoutPopup);try{await this.clearCacheOnLogout(e.account);const d=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{d.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&d.authority.protocolMode===xe.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Popup,e),o){const y={apiId:se.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},k=W.getAbsoluteUrl(o,Nt());await this.navigationClient.navigateInternal(k,y)}(c=t.popup)==null||c.close();return}}const h=d.getLogoutUri(e);this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Popup,e);const p=this.openPopup(h,t);if(this.eventHandler.emitEvent(N.POPUP_OPENED,M.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const y={apiId:se.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},k=W.getAbsoluteUrl(o,Nt());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${k}`),await this.navigationClient.navigateInternal(k,y)}else this.logger.verbose("No main window navigation requested")}catch(d){throw(l=t.popup)==null||l.close(),d instanceof Z&&(d.setCorrelationId(this.correlationId),i.cacheFailedRequest(d)),this.eventHandler.emitEvent(N.LOGOUT_FAILURE,M.Popup,null,d),this.eventHandler.emitEvent(N.LOGOUT_END,M.Popup),d}this.eventHandler.emitEvent(N.LOGOUT_END,M.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),P(Po)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(P(pr));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===yo.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw P(Md);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),P(Nd)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var y,k,S,$;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(y=r.popupSize)==null?void 0:y.width,d=(k=r.popupSize)==null?void 0:k.height,h=(S=r.popupPosition)==null?void 0:S.top,p=($=r.popupPosition)==null?void 0:$.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Ne.POPUP_WIDTH),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),d=Ne.POPUP_HEIGHT),(!h||h<0||h>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),h=Math.max(0,c/2-Ne.POPUP_HEIGHT/2+s)),(!p||p<0||p>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,a/2-Ne.POPUP_WIDTH/2+i)),o.open(e,t,`width=${l}, height=${d}, top=${h}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,t){return`${Ne.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Ne.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function IC(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class EC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,a,l,d),this.nativeStorage=c}async acquireToken(e){const t=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,M.Redirect);t.platformBroker=yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);const r=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(N.RESTORE_FROM_BFCACHE,M.Redirect))},o=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${o}`),this.browserStorage.setTemporaryCache(ge.ORIGIN_URI,o,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===xe.EAR?await this.executeEarFlow(t):await this.executeCodeFlow(t,e.onRedirectNavigate)}catch(i){throw i instanceof Z&&i.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),i}}async executeCodeFlow(e,t){const r=e.correlationId,o=this.initializeServerTelemetryManager(se.acquireTokenRedirect),i=await T(Lo,f.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...e,codeChallenge:i.challenge};this.browserStorage.cacheAuthorizeRequest(s,i.verifier);try{const a=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),c=await T(qs,f.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,a.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(c,t)}catch(a){throw a instanceof Z&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),a}}async executeEarFlow(e){const t=e.correlationId,r=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await T(Us,f.GenerateEarKey,this.logger,this.performanceClient,t)(),i={...e,earJwk:o};this.browserStorage.cacheAuthorizeRequest(i),(await zs(document,this.config,r,i,this.logger,this.performanceClient)).submit()}async handleRedirectPromise(e="",t,r,o){const i=this.initializeServerTelemetryManager(se.handleRedirectPromise);try{const[s,a]=this.getRedirectResponse(e||"");if(!s)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),IC()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(ge.ORIGIN_URI,!0)||C.EMPTY_STRING,l=W.removeHashFromUrl(c),d=W.removeHashFromUrl(window.location.href);if(l===d&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&Fm(c),await this.handleResponse(s,t,r,i);if(this.config.auth.navigateToLoginRequestUrl){if(!Ks()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(ge.URL_HASH,a,!0);const h={apiId:se.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let p=!0;if(!c||c==="null"){const y=Km();this.browserStorage.setTemporaryCache(ge.ORIGIN_URI,y,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),p=await this.navigationClient.navigateInternal(y,h)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),p=await this.navigationClient.navigateInternal(c,h);if(!p)return await this.handleResponse(s,t,r,i)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(s,t,r,i);return null}catch(s){throw s instanceof Z&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),s}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===yo.QUERY?t=window.location.search:t=window.location.hash);let r=Jr(t);if(r){try{CC(r,this.browserCrypto,M.Redirect)}catch(i){return i instanceof Z&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Dm(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(ge.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ge.URL_HASH)),o&&(r=Jr(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t,r,o){if(!e.state)throw P(Rs);if(e.ear_jwe){const a=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t.correlationId)({requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account});return T(js,f.HandleResponseEar,this.logger,this.performanceClient,t.correlationId)(t,e,se.acquireTokenRedirect,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}const s=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:t.authority});return T(Vs,f.HandleResponseCode,this.logger,this.performanceClient,t.correlationId)(t,e,r,se.acquireTokenRedirect,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:se.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=t||this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),P(Po)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(se.logout);try{this.eventHandler.emitEvent(N.LOGOUT_START,M.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:se.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===xe.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=t.account)==null?void 0:i.homeAccountId),this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Redirect,t);return}}const c=a.getLogoutUri(t);if(this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof Z&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(N.LOGOUT_FAILURE,M.Redirect,null,s),this.eventHandler.emitEvent(N.LOGOUT_END,M.Redirect),s}this.eventHandler.emitEvent(N.LOGOUT_END,M.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return W.getAbsoluteUrl(t,Nt())}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function _C(n,e,t,r,o){if(e.addQueueMeasurement(f.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),P(Po);return o?T(bC,f.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):st(kC,f.SilentHandlerLoadFrameSync,t,e,r)(n)}async function SC(n,e,t,r,o){const i=Ws();if(!i.contentDocument)throw"No document associated with iframe!";return(await zs(i.contentDocument,n,e,t,r,o)).submit(),i}async function tc(n,e,t,r,o,i,s){return r.addQueueMeasurement(f.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e<Si&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Si}ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(d),c(P(xd))},e),d=window.setInterval(()=>{let h="";const p=n.contentWindow;try{h=p?p.location.href:""}catch{}if(!h||h==="about:blank")return;let y="";p&&(s===yo.QUERY?y=p.location.search:y=p.location.hash),window.clearTimeout(l),window.clearInterval(d),a(y)},t)}).finally(()=>{st(RC,f.RemoveHiddenIframe,o,r,i)(n)})}function bC(n,e,t,r){return t.addQueueMeasurement(f.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=Ws();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=n,o(s)},e)})}function kC(n){const e=Ws();return e.src=n,e}function Ws(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function RC(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class OC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d,h){super(e,t,r,o,i,s,c,d,h),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Te.NONE&&t.prompt!==Te.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Te.NONE}`),t.prompt=Te.NONE):t.prompt=Te.NONE;const r=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,M.Silent);return r.platformBroker=yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme),uh(r.authority),this.config.auth.protocolMode===xe.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let t;const r=this.initializeServerTelemetryManager(this.apiId);try{return t=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await T(this.silentTokenHelper.bind(this),f.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(t,e)}catch(o){if(o instanceof Z&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!t||!(o instanceof Z)||o.errorCode!==Ne.INVALID_GRANT_ERROR)throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await T(this.silentTokenHelper.bind(this),f.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(t,e)}}async executeEarFlow(e){const t=e.correlationId,r=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await T(Us,f.GenerateEarKey,this.logger,this.performanceClient,t)(),i={...e,earJwk:o},s=await T(SC,f.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,t)(this.config,r,i,this.logger,this.performanceClient),a=this.config.auth.OIDCOptions.serverResponseType,c=await T(tc,f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,t)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,t,a),l=st(ao,f.DeserializeResponse,this.logger,this.performanceClient,t)(c,a,this.logger);return T(js,f.HandleResponseEar,this.logger,this.performanceClient,t)(i,l,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}logout(){return Promise.reject(P(No))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(f.SilentIframeClientTokenHelper,r);const o=await T(Lo,f.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),i={...t,codeChallenge:o.challenge},s=await T(qs,f.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,i,this.logger,this.performanceClient),a=await T(_C,f.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(s,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await T(tc,f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),d=st(ao,f.DeserializeResponse,this.logger,this.performanceClient,r)(l,c,this.logger);return T(Vs,f.HandleResponseCode,this.logger,this.performanceClient,r)(t,d,o.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class PC extends Gn{async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentRefreshClientAcquireToken,e.correlationId);const t=await T($s,f.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(se.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return T(i.acquireTokenByRefreshToken.bind(i),f.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(P(No))}async createRefreshTokenClient(e){const t=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Zp(t,this.performanceClient)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class NC{constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}async loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw P(Mo);const o=e.correlationId||We(),i=t.id_token?Yt(t.id_token,it):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new ve(ve.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||We()):void 0,c=await this.loadAccount(e,r.clientInfo||t.client_info||"",o,i,a),l=await this.loadIdToken(t,c.homeAccountId,c.environment,c.realm,o),d=await this.loadAccessToken(e,t,c.homeAccountId,c.environment,c.realm,r,o),h=await this.loadRefreshToken(t,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:d,refreshToken:h},i,a)}async loadAccount(e,t,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=be.createFromAccountInfo(e.account);return await this.storage.setAccount(l,r),l}else if(!i||!t&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),P($d);const s=be.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=Es(this.storage,i,s,it,o,t,i.hostnameAndPort,a,void 0,void 0,this.logger);return await this.storage.setAccount(c,r),c}async loadIdToken(e,t,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=To(t,r,e.id_token,this.config.auth.clientId,o);return await this.storage.setIdTokenCredential(s,i),s}async loadAccessToken(e,t,r,o,i,s,a){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=t.scope?fe.fromString(t.scope):new fe(e.scopes),l=s.expiresOn||t.expires_in+Le(),d=s.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+Le(),h=Ao(r,o,t.access_token,this.config.auth.clientId,i,c.printScopes(),l,d,it);return await this.storage.setAccessTokenCredential(h,a),h}async loadRefreshToken(e,t,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Nl(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,t,r,o){var d,h,p;let i="",s=[],a=null,c;t!=null&&t.accessToken&&(i=t.accessToken.secret,s=fe.fromString(t.accessToken.target).asArray(),a=xt(t.accessToken.expiresOn),c=xt(t.accessToken.extendedExpiresOn));const l=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((d=t.idToken)==null?void 0:d.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((h=t.refreshToken)==null?void 0:h.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class MC extends Ad{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class xC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,c,l,d),this.apiId=a}async acquireToken(e){if(!e.code)throw P(qd);const t=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,M.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},i=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),s=new MC(i);this.logger.verbose("Auth code client created");const a=new Eh(s,this.browserStorage,o,this.logger,this.performanceClient);return await T(a.handleCodeResponseFromServer.bind(a),f.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof Z&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(P(No))}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function ht(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Mr(n,e){try{Gs(n)}catch(t){throw e.end({success:!1},t),t}}class Uo{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new wt(this.logger,this.performanceClient):ur,this.eventHandler=new wh(this.logger),this.browserStorage=this.isBrowserEnvironment?new so(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,pd(this.config.auth)):gh(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const t={cacheLocation:Ae.MemoryStorage,temporaryCacheLocation:Ae.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new so(this.config.auth.clientId,t,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new NC(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,t){const r=new Uo(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(N.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowPlatformBroker,o=this.performanceClient.startMeasurement(f.InitializeClientApplication,t);if(this.eventHandler.emitEvent(N.INITIALIZE_START),await T(this.browserStorage.initialize.bind(this.browserStorage),f.InitializeCache,this.logger,this.performanceClient,t)(t),r)try{this.nativeExtensionProvider=await yt.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await T(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),f.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(t),this.initialized=!0,this.eventHandler.emitEvent(N.INITIALIZE_END),o.end({allowPlatformBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),hh(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e;let i=this.performanceClient.startMeasurement(f.AcquireTokenRedirect,(r==null?void 0:r.correlationId)||"");this.eventHandler.emitEvent(N.HANDLE_REDIRECT_START,M.Redirect);let s;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const a=new Fr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,se.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);s=T(a.handleRedirectPromise.bind(a),f.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(this.performanceClient,i.event.correlationId)}else{const[a,c]=this.browserStorage.getCachedRequest(),l=a.correlationId;i.discard(),i=this.performanceClient.startMeasurement(f.AcquireTokenRedirect,l),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const d=this.createRedirectClient(l);s=T(d.handleRedirectPromise.bind(d),f.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(e,a,c,i)}return s.then(a=>(a?(this.browserStorage.resetRequestCache(),t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(N.LOGIN_SUCCESS,M.Redirect,a),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Redirect,a),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),i.end({success:!0,accountType:ht(a.account)})):i.event.errorCode?i.end({success:!1}):i.discard(),this.eventHandler.emitEvent(N.HANDLE_REDIRECT_END,M.Redirect),a)).catch(a=>{this.browserStorage.resetRequestCache();const c=a;throw t.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Redirect,null,c):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Redirect,null,c),this.eventHandler.emitEvent(N.HANDLE_REDIRECT_END,M.Redirect),i.end({success:!1},c),a})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(f.AcquireTokenPreRedirect,t);r.add({accountType:ht(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Ya(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Redirect,e):this.eventHandler.emitEvent(N.LOGIN_START,M.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUsePlatformBroker(e)?s=new Fr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,se.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof mt&&_n(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(c instanceof Xe)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw c}):s=this.createRedirectClient(t).acquireToken(e),await s}catch(s){throw this.browserStorage.resetRequestCache(),r.end({success:!1},s),i?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Redirect,null,s):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Redirect,null,s),s}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(f.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:ht(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Mr(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(a){return Promise.reject(a)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Popup,e):this.eventHandler.emitEvent(N.LOGIN_START,M.Popup,e);let i;const s=this.getPreGeneratedPkceCodes(t);return this.canUsePlatformBroker(e)?i=this.acquireTokenNative({...e,correlationId:t},se.acquireTokenPopup).then(a=>(r.end({success:!0,isNativeBroker:!0,accountType:ht(a.account)}),a)).catch(a=>{if(a instanceof mt&&_n(a))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e,s);if(a instanceof Xe)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e,s);throw a}):i=this.createPopupClient(t).acquireToken(e,s),i.then(a=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(N.LOGIN_SUCCESS,M.Popup,a):this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Popup,a),r.end({success:!0,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:ht(a.account)}),a)).catch(a=>(o.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Popup,null,a):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Popup,null,a),r.end({success:!1},a),Promise.reject(a))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(t)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(f.SsoSilent,t),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:ht(e.account)}),Mr(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(N.SSO_SILENT_START,M.Silent,r);let o;return this.canUsePlatformBroker(r)?o=this.acquireTokenNative(r,se.ssoSilent).catch(a=>{if(a instanceof mt&&_n(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(N.SSO_SILENT_SUCCESS,M.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:ht(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(N.SSO_SILENT_FAILURE,M.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(f.AcquireTokenByCode,t);Mr(this.initialized,r),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_START,M.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw P(Vd);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),i=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_SUCCESS,M.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:ht(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_FAILURE,M.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},se.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof mt&&_n(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:ht(o.account),success:!0}),o}else throw P(jd);else throw P(zd)}catch(o){throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_FAILURE,M.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(f.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(f.AcquireTokenFromCache,e.correlationId),t){case Ce.Default:case Ce.AccessToken:case Ce.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return T(r.acquireToken.bind(r),f.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw w(Vt)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(f.AcquireTokenByRefreshToken,e.correlationId),t){case Ce.Default:case Ce.AccessTokenAndRefreshToken:case Ce.RefreshToken:case Ce.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return T(r.acquireToken.bind(r),f.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw w(Vt)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(f.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return T(t.acquireToken.bind(t),f.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return Ya(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Gs(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return ph(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return Oi(e,this.logger,this.browserStorage)}getAccountByUsername(e){return mh(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return Ch(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return yh(e,this.logger,this.browserStorage)}setActiveAccount(e){Th(e,this.browserStorage)}getActiveAccount(){return Ah(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=be.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r,o){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw P(Ns);return new Fr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,o)}canUsePlatformBroker(e,t){if(this.logger.trace("canUsePlatformBroker called"),!yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isPlatformBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Te.NONE:case Te.CONSENT:case Te.LOGIN:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new vC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new EC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new OC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,se.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new _h(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new PC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new xC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,se.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return dh(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Ae.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==Ae.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?We():C.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Ei})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Ei})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(f.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Mr(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw P(Dd);return r.add({accountType:ht(o)}),this.acquireTokenSilentDeduped(e,o,t).then(i=>(r.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker,accessTokenSize:i.accessToken.length,idTokenSize:i.idToken.length}),{...i,state:e.state,correlationId:t})).catch(i=>{throw i instanceof Z&&i.setCorrelationId(t),r.end({success:!1},i),i})}async acquireTokenSilentDeduped(e,t,r){const o=ko(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},t.homeAccountId),i=JSON.stringify(o),s=this.activeSilentTokenRequests.get(i);if(typeof s>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const a=T(this.acquireTokenSilentAsync.bind(this),f.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},t);return this.activeSilentTokenRequests.set(i,a),a.finally(()=>{this.activeSilentTokenRequests.delete(i)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),s}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(f.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await T(sC,f.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||Ce.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(HC(a,i))if(this.activeIframeRequest)if(i!==Ce.Skip){const[l,d]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${d}`,o.correlationId);const h=this.performanceClient.startMeasurement(f.AwaitConcurrentIframe,o.correlationId);h.add({awaitIframeCorrelationId:d});const p=await l;if(h.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${d} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${d} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),T(this.acquireTokenBySilentIframe.bind(this),f.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(d=>{l=d}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),T(this.acquireTokenBySilentIframe.bind(this),f.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(d=>(l(!0),d)).catch(d=>{throw l(!1),d}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return yt.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,se.acquireTokenSilent_silentFlow,e.account.nativeAccountId,t).catch(async r=>{throw r instanceof mt&&_n(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,w(Vt)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),t===Ce.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),T(this.acquireTokenFromCache.bind(this),f.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Ce.AccessToken)throw r;return this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_NETWORK_START,M.Silent,e),T(this.acquireTokenByRefreshToken.bind(this),f.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await T(Lo,f.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const t=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${t?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!t},e),t}}function HC(n,e){const t=!(n instanceof Xe&&n.subError!==Oo),r=n.errorCode===Ne.INVALID_GRANT_ERROR||n.errorCode===Vt,o=t&&r||n.errorCode===no||n.errorCode===Is,i=Tm.includes(e);return o&&i}/*! @azure/msal-browser v4.9.0 2025-03-25 */function LC(n){return n.status!==void 0}/*! @azure/msal-browser v4.9.0 2025-03-25 */class UC{constructor(e,t,r,o){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=o}toNaaTokenRequest(e){var a;let t;e.extraQueryParameters===void 0?t=new Map:t=new Map(Object.entries(e.extraQueryParameters));const r=e.correlationId||this.crypto.createNewGuid(),o=dd(e.claims,this.clientCapabilities),i=e.scopes||yn;return{platformBrokerId:(a=e.account)==null?void 0:a.homeAccountId,clientId:this.clientId,authority:e.authority,scope:i.join(" "),correlationId:r,claims:ot.isEmptyObj(o)?void 0:o,state:e.state,authenticationScheme:e.authenticationScheme||X.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw w(jr);const o=xt(r+(t.token.expires_in||0)),i=Yt(t.token.id_token,this.crypto.base64Decode),s=this.fromNaaAccountInfo(t.account,t.token.id_token,i),a=t.token.scope||e.scope;return{authority:t.token.authority||s.environment,uniqueId:s.localAccountId,tenantId:s.tenantId,scopes:a.split(" "),account:s,idToken:t.token.id_token,idTokenClaims:i,accessToken:t.token.access_token,fromCache:!1,expiresOn:o,tokenType:e.authenticationScheme||X.BEARER,correlationId:e.correlationId,extExpiresOn:o,state:e.state}}fromNaaAccountInfo(e,t,r){const o=r||e.idTokenClaims,i=e.localAccountId||(o==null?void 0:o.oid)||(o==null?void 0:o.sub)||"",s=e.tenantId||(o==null?void 0:o.tid)||"",a=e.homeAccountId||`${i}.${s}`,c=e.username||(o==null?void 0:o.preferred_username)||"",l=e.name||(o==null?void 0:o.name),d=new Map,h=Eo(a,i,s,o);return d.set(s,h),{homeAccountId:a,environment:e.environment,tenantId:s,username:c,localAccountId:i,name:l,idToken:t,idTokenClaims:o,tenantProfiles:d}}fromBridgeError(e){if(LC(e))switch(e.status){case kt.UserCancel:return new Gt(kl);case kt.NoNetwork:return new Gt(bl);case kt.AccountUnavailable:return new Gt(Wr);case kt.Disabled:return new Gt(yi);case kt.NestedAppAuthUnavailable:return new Gt(e.code||yi,e.description);case kt.TransientError:case kt.PersistentError:return new en(e.code,e.description);case kt.UserInteractionRequired:return new Xe(e.code,e.description);default:return new Z(e.code,e.description)}else return new Z("unknown_error","An unknown error occurred")}toAuthenticationResultFromCache(e,t,r,o,i){if(!t||!r)throw w(jr);const s=Yt(t.secret,this.crypto.base64Decode),a=r.target||o.scopes.join(" ");return{authority:r.environment||e.environment,uniqueId:e.localAccountId,tenantId:e.tenantId,scopes:a.split(" "),account:e,idToken:t.secret,idTokenClaims:s||{},accessToken:r.secret,fromCache:!0,expiresOn:xt(r.expiresOn),extExpiresOn:xt(r.extendedExpiresOn),tokenType:o.authenticationScheme||X.BEARER,correlationId:i,state:o.state}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const nc={unsupportedMethod:{code:"unsupported_method",desc:"This method is not supported in nested app environment."}};class me extends Z{constructor(e,t){super(e,t),Object.setPrototypeOf(this,me.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new me(nc.unsupportedMethod.code,nc.unsupportedMethod.desc)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Ys{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(t!==void 0)this.bridgeProxy=t;else throw new Error("unexpected: bridgeProxy is undefined");this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new wt(this.logger,this.performanceClient,!0):ur,this.eventHandler=new wh(this.logger),this.browserStorage=this.operatingContext.isBrowserEnvironment()?new so(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,pd(this.config.auth)):gh(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler),this.nestedAppAuthAdapter=new UC(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger);const r=this.bridgeProxy.getAccountContext();this.currentAccountContext=r||null}static async createController(e){const t=new Ys(e);return Promise.resolve(t)}async initialize(e){const t=(e==null?void 0:e.correlationId)||We();return await this.browserStorage.initialize(t),Promise.resolve()}ensureValidRequest(e){return e!=null&&e.correlationId?e:{...e,correlationId:this.browserCrypto.createNewGuid()}}async acquireTokenInteractive(e){const t=this.ensureValidRequest(e);this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Popup,t);const r=this.performanceClient.startMeasurement(f.AcquireTokenPopup,t.correlationId);r==null||r.add({nestedAppAuthRequest:!0});try{const o=this.nestedAppAuthAdapter.toNaaTokenRequest(t),i=Le(),s=await this.bridgeProxy.getTokenInteractive(o),a={...this.nestedAppAuthAdapter.fromNaaTokenResponse(o,s,i)};return await this.hydrateCache(a,e),this.currentAccountContext={homeAccountId:a.account.homeAccountId,environment:a.account.environment,tenantId:a.account.tenantId},this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Popup,a),r.add({accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length}),r.end({success:!0,requestId:a.requestId}),a}catch(o){const i=o instanceof Z?o:this.nestedAppAuthAdapter.fromBridgeError(o);throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Popup,null,o),r.end({success:!1},o),i}}async acquireTokenSilentInternal(e){const t=this.ensureValidRequest(e);this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Silent,t);const r=await this.acquireTokenFromCache(t);if(r)return this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,r),r;const o=this.performanceClient.startMeasurement(f.SsoSilent,t.correlationId);o==null||o.increment({visibilityChangeCount:0}),o==null||o.add({nestedAppAuthRequest:!0});try{const i=this.nestedAppAuthAdapter.toNaaTokenRequest(t),s=Le(),a=await this.bridgeProxy.getTokenSilent(i),c=this.nestedAppAuthAdapter.fromNaaTokenResponse(i,a,s);return await this.hydrateCache(c,e),this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,c),o==null||o.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),o==null||o.end({success:!0,requestId:c.requestId}),c}catch(i){const s=i instanceof Z?i:this.nestedAppAuthAdapter.fromBridgeError(i);throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null,i),o==null||o.end({success:!1},i),s}}async acquireTokenFromCache(e){const t=this.performanceClient.startMeasurement(f.AcquireTokenSilent,e.correlationId);if(t==null||t.add({nestedAppAuthRequest:!0}),e.claims)return this.logger.verbose("Claims are present in the request, skipping cache lookup"),null;if(e.forceRefresh)return this.logger.verbose("forceRefresh is set to true, skipping cache lookup"),null;let r=null;switch(e.cacheLookupPolicy||(e.cacheLookupPolicy=Ce.Default),e.cacheLookupPolicy){case Ce.Default:case Ce.AccessToken:case Ce.AccessTokenAndRefreshToken:r=await this.acquireTokenFromCacheInternal(e);break;default:return null}return r?(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,r),t==null||t.add({accessTokenSize:r==null?void 0:r.accessToken.length,idTokenSize:r==null?void 0:r.idToken.length}),t==null||t.end({success:!0}),r):(this.logger.error("Cached tokens are not found for the account, proceeding with silent token request."),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null),t==null||t.end({success:!1}),null)}async acquireTokenFromCacheInternal(e){var c;const t=this.bridgeProxy.getAccountContext()||this.currentAccountContext;let r=null;if(t&&(r=Oi(t,this.logger,this.browserStorage)),!r)return this.logger.verbose("No active account found, falling back to the host"),Promise.resolve(null);this.logger.verbose("active account found, attempting to acquire token silently");const o={...e,correlationId:e.correlationId||this.browserCrypto.createNewGuid(),authority:e.authority||r.environment,scopes:(c=e.scopes)!=null&&c.length?e.scopes:[...yn]},i=this.browserStorage.getTokenKeys(),s=this.browserStorage.getAccessToken(r,o,i,r.tenantId,this.performanceClient,o.correlationId);if(s){if(Pl(s.cachedAt)||Yr(s.expiresOn,this.config.system.tokenRenewalOffsetSeconds))return this.logger.verbose("Cached access token has expired"),Promise.resolve(null)}else return this.logger.verbose("No cached access token found"),Promise.resolve(null);const a=this.browserStorage.getIdToken(r,i,r.tenantId,this.performanceClient,o.correlationId);return a?this.nestedAppAuthAdapter.toAuthenticationResultFromCache(r,a,s,o,o.correlationId):(this.logger.verbose("No cached id token found"),Promise.resolve(null))}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw me.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw me.createUnsupportedError()}acquireTokenNative(e,t,r){throw me.createUnsupportedError()}acquireTokenByRefreshToken(e,t){throw me.createUnsupportedError()}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw me.createUnsupportedError()}removePerformanceCallback(e){throw me.createUnsupportedError()}enableAccountStorageEvents(){throw me.createUnsupportedError()}disableAccountStorageEvents(){throw me.createUnsupportedError()}getAllAccounts(e){return ph(this.logger,this.browserStorage,this.isBrowserEnv(),e)}getAccount(e){return Oi(e,this.logger,this.browserStorage)}getAccountByUsername(e){return mh(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return Ch(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return yh(e,this.logger,this.browserStorage)}setActiveAccount(e){return Th(e,this.browserStorage)}getActiveAccount(){return Ah(this.browserStorage)}handleRedirectPromise(e){return Promise.resolve(null)}loginPopup(e){return this.acquireTokenInteractive(e||Ei)}loginRedirect(e){throw me.createUnsupportedError()}logout(e){throw me.createUnsupportedError()}logoutRedirect(e){throw me.createUnsupportedError()}logoutPopup(e){throw me.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getTokenCache(){throw me.createUnsupportedError()}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("setNavigationClient is not supported in nested app auth")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw me.createUnsupportedError()}getRedirectResponse(){throw me.createUnsupportedError()}async clearCache(e){throw me.createUnsupportedError()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=be.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),this.browserStorage.hydrateCache(e,t)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function DC(n,e){const t=new mn(n);return await t.initialize(),Uo.createController(t,e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Do{static async createPublicClientApplication(e){const t=await DC(e);return new Do(e,t)}constructor(e,t){this.controller=t||new Uo(new mn(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}async function FC(n){const e=new Dn(n);if(await e.initialize(),e.isAvailable()){const t=new Ys(e),r=new Do(n,t);return await r.initialize(),r}return BC(n)}async function BC(n){const e=new Do(n);return await e.initialize(),e}const KC={class:"d-flex gap",id:"app"},GC={key:0,class:"alert alert-error rounded-md p-2 d-flex flex-row gap"},$C={width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"h-32 w-32",style:{color:"rgb(33, 33, 33)"}},qC={key:1,class:"alert alert-warning rounded-md p-2 d-flex flex-row gap"},zC={width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"h-32 w-32",style:{color:"rgb(33, 33, 33)"}},VC={class:"mt-3"},jC=["disabled"],WC={key:1},YC={key:2,class:"draft-container"},QC={key:0,id:"drafts",class:"my-0 list-unstyled gap d-flex"},JC=["onClick"],XC=["onClick"],ZC={class:"sr-only"},ey={key:1},ty={__name:"App",setup(n){const e=_t(""),t=_t(""),r=_t(""),o=_t(""),i=_t(!1),s=_t(!1),a=_t(""),c=_t({encrypted:!1,signed:!1,drafts:[],fetched:!1}),l=_t(null);let d,h=null;const p=Lr(()=>r.value.length>0&&c.value.fetched),y=Lr(()=>(console.log(a.value),a.value?a.value:p.value?c.value.encrypted?c.value.signed?Dt("This mail is encrypted and signed."):Dt("This mail is encrypted."):c.value.signed?Dt("This mail is signed"):Dt("This mail is not encrypted nor signed."):et("Loading placeholder","Loading..."))),k=Lr(()=>p.value?c.value.encrypted?et("@action:button","Decrypt"):et("@action:button","View email"):"");function S(V,x){console.log(V,x),l.value&&l.value.send(JSON.stringify({command:"log",arguments:{message:V,args:JSON.stringify(x)}}))}function $(V){l.value.send(JSON.stringify({command:V,arguments:{body:r.value,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,folderId:o.value,accessToken:h}}))}function D(){$("view")}function z(){$("reply")}function Y(){$("forward")}function H(){l.value.send(JSON.stringify({command:"composer",arguments:{email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function ae(V){l.value.send(JSON.stringify({command:"open-draft",arguments:{id:V,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function De(V){l.value.send(JSON.stringify({command:"delete-draft",arguments:{id:V,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function we(){l.value.send(JSON.stringify({command:"info",arguments:{itemId:Office.context.mailbox.item.itemId,email:Office.context.mailbox.userProfile.emailAddress,body:r.value}}))}function Ye(){l.value.send(JSON.stringify({command:"reencrypt",arguments:{itemId:Office.context.mailbox.item.itemId,email:Office.context.mailbox.userProfile.emailAddress,body:r.value,folderId:o.value,accessToken:h}}))}function Ut(V){const x=new Date(V*1e3);let Q=new Date;return new Date(x).setHours(0,0,0,0)===Q.setHours(0,0,0,0)?x.toLocaleTimeString([],{hour:"numeric",minute:"numeric"}):x.toLocaleDateString()}async function Fe(){try{const V=await Zf(Office.context.mailbox.item,!Office.context.requirements.isSetSupported("NestedAppAuth","1.1"),h);r.value=V.content,o.value=V.folderId,i.value=!0,l.value&&l.value.readyState===WebSocket.OPEN&&we()}catch(V){a.value=V}}async function tn(V){if(h.length>0){const x=await fetch("https://outlook.office365.com/EWS/Exchange.asmx",{body:V.arguments.body,headers:{Authorization:h,ContentType:"text/xml"},method:"POST"});if(x.ok){const Q=await x.text();l.value.send(JSON.stringify({command:"ews-response",arguments:{requestId:V.arguments.requestId,email:Office.context.mailbox.userProfile.emailAddress,body:Q}}));return}S("Error while trying to send email via EWS (using oauth2)",{error:x.status})}else Office.context.mailbox.makeEwsRequestAsync(V.arguments.body,x=>{if(x.error){S("Error while trying to send email via EWS",{error:x.error,value:x.value});return}S("Email sent",{value:x.value}),l.value.send(JSON.stringify({command:"ews-response",arguments:{requestId:V.arguments.requestId,email:Office.context.mailbox.userProfile.emailAddress,body:x.value}}))})}function nn(){console.log("Set socket"),l.value=new WebSocket("wss://localhost:5657"),l.value.addEventListener("open",V=>{e.value="",l.value.send(JSON.stringify({command:"register",arguments:{emails:[Office.context.mailbox.userProfile.emailAddress],type:"webclient"}})),l.value.send(JSON.stringify({command:"restore-autosave",arguments:{email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}})),r.value.length>0&&we()}),l.value.addEventListener("close",V=>{e.value=Dt("Native client was disconnected, reconnecting in 1 second."),console.log(V.reason),setTimeout(function(){nn()},1e3)}),l.value.addEventListener("error",V=>{e.value=Dt("Native client received an error"),l.value.close()}),l.value.addEventListener("message",function(V){const{data:x}=V;console.log(x);const Q=JSON.parse(x);switch(S("Received message from server",{command:Q.command}),Q.command){case"ews":tn(Q);break;case"ews":break;case"viewer-closed":case"viewer-opened":s.value=Q.command==="viewer-opened";break;case"disconnection":e.value=Dt("Native client was disconnected");break;case"connection":e.value="";break;case"info-fetched":const{itemId:ie,encrypted:oe,signed:vt,drafts:An,version:It}=Q.arguments;if(c.value.drafts=An,ie===Office.context.mailbox.item.itemId){c.value.fetched=!0,c.value.encrypted=oe,c.value.signed=vt,s.value=Q.arguments.viewerOpen,s.value&&D();let Ar=new URLSearchParams(document.location.search).get("version");It!==Ar&&(t.value=et("@info","Version mismatch. Make sure you installed the last manifest.xml."))}else c.value.fetched=!1}})}async function Tn(){d=await FC({auth:{clientId:"1d6f4a59-be04-4274-8793-71b4c081eb72",authority:"https://login.microsoftonline.com/common"}});const V={scopes:["Mail.ReadWrite","Mail.Send","openid","profile","https://outlook.office365.com/EWS.AccessAsUser.All"]};try{console.log("Trying to acquire token silently...");const x=await d.acquireTokenSilent(V);console.log("Acquired token silently."),h=x.accessToken}catch(x){console.log(`Unable to acquire token silently: ${x}`)}if(h===null)try{console.log("Trying to acquire token interactively...");const x=await d.acquireTokenPopup(V);console.log("Acquired token interactively."),h=x.accessToken}catch(x){console.error(`Unable to acquire token interactively: ${x}`)}h===null&&(e.value="Unable to acquire access token.")}return Lc(async()=>{Office.context.requirements.isSetSupported("NestedAppAuth","1.1")&&await Tn(),await Fe(),Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged,V=>{Office.context.mailbox.item?Fe():(r.value="",i.value=!1)}),nn()}),(V,x)=>($e(),Qe("div",KC,[e.value.length>0?($e(),Qe("div",GC,[($e(),Qe("svg",$C,x[1]||(x[1]=[J("path",{d:"M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333Zm-.001 10.835a.999.999 0 1 1 0 1.998.999.999 0 0 1 0-1.998ZM11.994 7a.75.75 0 0 1 .744.648l.007.101.004 4.502a.75.75 0 0 1-1.493.103l-.007-.102-.004-4.501a.75.75 0 0 1 .75-.751Z",fill:"currentColor","fill-opacity":"1"},null,-1)]))),J("div",null,Ge(e.value),1)])):Wn("",!0),t.value.length>0?($e(),Qe("div",qC,[($e(),Qe("svg",zC,x[2]||(x[2]=[J("path",{d:"M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z",fill:"currentColor","fill-opacity":"1"},null,-1)]))),J("div",null,Ge(t.value),1)])):Wn("",!0),J("div",null,[J("div",VC,Ge(y.value),1),p.value?($e(),Qe("button",{key:0,class:"w-100 btn rounded-md fa mt-3",onClick:D,disabled:s.value},[x[3]||(x[3]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"M18 5.95a2.5 2.5 0 1 0-1.002-4.9A2.5 2.5 0 0 0 18 5.95M4.5 3h9.535a3.5 3.5 0 0 0 0 1H4.5A1.5 1.5 0 0 0 3 5.5v.302l7 4.118l5.754-3.386c.375.217.795.365 1.241.43l-6.741 3.967a.5.5 0 0 1-.426.038l-.082-.038L3 6.963V13.5A1.5 1.5 0 0 0 4.5 15h11a1.5 1.5 0 0 0 1.5-1.5V6.965a3.5 3.5 0 0 0 1 0V13.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 13.5v-8A2.5 2.5 0 0 1 4.5 3"})],-1)),an(" "+Ge(k.value),1)],8,jC)):Wn("",!0),s.value?($e(),Qe("div",WC,[J("small",null,Ge(bt(et)("@info","Viewer already open.")),1)])):Wn("",!0)]),x[11]||(x[11]=J("hr",{class:"w-100 my-0"},null,-1)),J("button",{class:"w-100 btn rounded-md",onClick:x[0]||(x[0]=Q=>H())},[x[4]||(x[4]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"M15.5 4A2.5 2.5 0 0 1 18 6.5v8a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 14.5v-8A2.5 2.5 0 0 1 4.5 4zM17 7.961l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 7.963V14.5A1.5 1.5 0 0 0 4.5 16h11a1.5 1.5 0 0 0 1.5-1.5zM15.5 5h-11A1.5 1.5 0 0 0 3 6.5v.302l7 4.118l7-4.12v-.3A1.5 1.5 0 0 0 15.5 5"})],-1)),an(" "+Ge(bt(et)("@action:button","New secure email")),1)]),J("button",{class:"w-100 btn rounded-md",onClick:z},[x[5]||(x[5]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"M7.354 3.646a.5.5 0 0 1 0 .708L3.707 8H10.5a7.5 7.5 0 0 1 7.5 7.5a.5.5 0 0 1-1 0A6.5 6.5 0 0 0 10.5 9H3.707l3.647 3.646a.5.5 0 0 1-.708.708l-4.5-4.5a.5.5 0 0 1 0-.708l4.5-4.5a.5.5 0 0 1 .708 0"})],-1)),an(" "+Ge(bt(et)("@action:button","Reply securely")),1)]),J("button",{class:"w-100 btn rounded-md",onClick:Y},[x[6]||(x[6]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"})],-1)),an(" "+Ge(bt(et)("@action:button","Forward securely")),1)]),J("button",{class:"w-100 btn rounded-md d-none",onClick:Ye},[x[7]||(x[7]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"})],-1)),an(" "+Ge(bt(et)("@action:button","Reencrypt")),1)]),p.value?($e(),Qe("div",YC,[x[10]||(x[10]=J("h2",{class:"mb-0"},"Drafts",-1)),c.value.drafts.length>0?($e(),Qe("ul",QC,[($e(!0),Qe(ft,null,Uu(c.value.drafts,Q=>($e(),Qe("li",{key:Q.id,class:"d-flex flex-row"},[J("button",{class:"btn w-100 d-flex flex-row align-items-center rounded-e-md",onClick:ie=>ae(Q.id)},[x[8]||(x[8]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[J("path",{fill:"currentColor",d:"M15.5 3.001a2.5 2.5 0 0 1 2.5 2.5v3.633a2.9 2.9 0 0 0-1-.131V6.962l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 6.964v6.537a1.5 1.5 0 0 0 1.5 1.5h5.484c-.227.3-.4.639-.51 1H4.5a2.5 2.5 0 0 1-2.5-2.5v-8a2.5 2.5 0 0 1 2.5-2.5zm0 1h-11a1.5 1.5 0 0 0-1.5 1.5v.302l7 4.118l7-4.119v-.301a1.5 1.5 0 0 0-1.5-1.5m-4.52 11.376l4.83-4.83a1.87 1.87 0 1 1 2.644 2.646l-4.83 4.829a2.2 2.2 0 0 1-1.02.578l-1.498.374a.89.89 0 0 1-1.079-1.078l.375-1.498a2.2 2.2 0 0 1 .578-1.02"})],-1)),an(" "+Ge(bt(Dt)("Last Modified: ")+Ut(Q.last_modification)),1)],8,JC),J("button",{class:"btn btn-danger ms-auto py-1 rounded-e-md",onClick:ie=>De(Q.id)},[J("span",ZC,Ge(bt(et)("@action:button","Delete")),1),x[9]||(x[9]=J("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"},[J("path",{fill:"currentColor",d:"M10 5h4a2 2 0 1 0-4 0M8.5 5a3.5 3.5 0 1 1 7 0h5.75a.75.75 0 0 1 0 1.5h-1.32l-1.17 12.111A3.75 3.75 0 0 1 15.026 22H8.974a3.75 3.75 0 0 1-3.733-3.389L4.07 6.5H2.75a.75.75 0 0 1 0-1.5zm2 4.75a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0zM14.25 9a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75m-7.516 9.467a2.25 2.25 0 0 0 2.24 2.033h6.052a2.25 2.25 0 0 0 2.24-2.033L18.424 6.5H5.576z"})],-1))],8,XC)]))),128))])):($e(),Qe("p",ey,Ge(bt(et)("Placeholder","No draft found")),1))])):Wn("",!0)]))}},kh=(0,eval)("this"),ny=kh.Office;kh.messages;ny.onReady(()=>{Qf(ty).mount("#app")});
diff --git a/web/dist/assets/index-ClTtgHOX.js b/web/dist/assets/index-ClTtgHOX.js
deleted file mode 100644
index 4c444e1..0000000
--- a/web/dist/assets/index-ClTtgHOX.js
+++ /dev/null
@@ -1,23 +0,0 @@
-(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=t(o);fetch(o.href,i)}})();const bn={"fr-FR":{"Loading...":"Chargement...","This mail is encrypted and signed.":"Ce email est encrypté et signé numériquement","This mail is encrypted.":"Ce email est encrypté"},"de-DE":{"Loading...":"Laden...","This mail is encrypted and signed.":"Diese E-Mail ist verschlüsselt und signiert","This mail is encrypted.":"Diese E-Mail ist verschlüsselt","This mail is signed":"Diese E-Mail ist signiert","This mail is not encrypted nor signed.":"Diese E-Mail ist nicht verschlüsselt und signiert",Decrypt:"Entschlüsseln","View email":"E-Mail anzeigen"}};/**
-* @vue/shared v3.5.13
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**//*! #__NO_SIDE_EFFECTS__ */function Pi(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const ce={},kn=[],wt=()=>{},Ph=()=>!1,ao=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Ni=n=>n.startsWith("onUpdate:"),Le=Object.assign,Mi=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},Nh=Object.prototype.hasOwnProperty,ee=(n,e)=>Nh.call(n,e),B=Array.isArray,Rn=n=>co(n)==="[object Map]",rc=n=>co(n)==="[object Set]",G=n=>typeof n=="function",ge=n=>typeof n=="string",Zt=n=>typeof n=="symbol",he=n=>n!==null&&typeof n=="object",oc=n=>(he(n)||G(n))&&G(n.then)&&G(n.catch),ic=Object.prototype.toString,co=n=>ic.call(n),Mh=n=>co(n).slice(8,-1),sc=n=>co(n)==="[object Object]",xi=n=>ge(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,Jn=Pi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),lo=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},xh=/-(\w)/g,Qt=lo(n=>n.replace(xh,(e,t)=>t?t.toUpperCase():"")),Hh=/\B([A-Z])/g,Cn=lo(n=>n.replace(Hh,"-$1").toLowerCase()),ac=lo(n=>n.charAt(0).toUpperCase()+n.slice(1)),Fo=lo(n=>n?`on${ac(n)}`:""),Vt=(n,e)=>!Object.is(n,e),Bo=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},cc=(n,e,t,r=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:r,value:t})},Lh=n=>{const e=parseFloat(n);return isNaN(e)?n:e};let Zs;const ho=()=>Zs||(Zs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hi(n){if(B(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],o=ge(r)?Bh(r):Hi(r);if(o)for(const i in o)e[i]=o[i]}return e}else if(ge(n)||he(n))return n}const Uh=/;(?![^(]*\))/g,Dh=/:([^]+)/,Fh=/\/\*[^]*?\*\//g;function Bh(n){const e={};return n.replace(Fh,"").split(Uh).forEach(t=>{if(t){const r=t.split(Dh);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Li(n){let e="";if(ge(n))e=n;else if(B(n))for(let t=0;t<n.length;t++){const r=Li(n[t]);r&&(e+=r+" ")}else if(he(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const Kh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Gh=Pi(Kh);function lc(n){return!!n||n===""}const dc=n=>!!(n&&n.__v_isRef===!0),ze=n=>ge(n)?n:n==null?"":B(n)||he(n)&&(n.toString===ic||!G(n.toString))?dc(n)?ze(n.value):JSON.stringify(n,hc,2):String(n),hc=(n,e)=>dc(e)?hc(n,e.value):Rn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[r,o],i)=>(t[Ko(r,i)+" =>"]=o,t),{})}:rc(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Ko(t))}:Zt(e)?Ko(e):he(e)&&!B(e)&&!sc(e)?String(e):e,Ko=(n,e="")=>{var t;return Zt(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/**
-* @vue/reactivity v3.5.13
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/let We;class $h{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=We,!e&&We&&(this.index=(We.scopes||(We.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=We;try{return We=this,e()}finally{We=t}}}on(){We=this}off(){We=this.parent}stop(e){if(this._active){this._active=!1;let t,r;for(t=0,r=this.effects.length;t<r;t++)this.effects[t].stop();for(this.effects.length=0,t=0,r=this.cleanups.length;t<r;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,r=this.scopes.length;t<r;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function zh(){return We}let ae;const Go=new WeakSet;class uc{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,We&&We.active&&We.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Go.has(this)&&(Go.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ea(this),pc(this);const e=ae,t=it;ae=this,it=!0;try{return this.fn()}finally{mc(this),ae=e,it=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Fi(e);this.deps=this.depsTail=void 0,ea(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Go.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ni(this)&&this.run()}get dirty(){return ni(this)}}let fc=0,Xn,Zn;function gc(n,e=!1){if(n.flags|=8,e){n.next=Zn,Zn=n;return}n.next=Xn,Xn=n}function Ui(){fc++}function Di(){if(--fc>0)return;if(Zn){let e=Zn;for(Zn=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Xn;){let e=Xn;for(Xn=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function pc(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function mc(n){let e,t=n.depsTail,r=t;for(;r;){const o=r.prevDep;r.version===-1?(r===t&&(t=o),Fi(r),qh(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}n.deps=e,n.depsTail=t}function ni(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Cc(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function Cc(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ar))return;n.globalVersion=ar;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!ni(n)){n.flags&=-3;return}const t=ae,r=it;ae=n,it=!0;try{pc(n);const o=n.fn(n._value);(e.version===0||Vt(o,n._value))&&(n._value=o,e.version++)}catch(o){throw e.version++,o}finally{ae=t,it=r,mc(n),n.flags&=-3}}function Fi(n,e=!1){const{dep:t,prevSub:r,nextSub:o}=n;if(r&&(r.nextSub=o,n.prevSub=void 0),o&&(o.prevSub=r,n.nextSub=void 0),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let i=t.computed.deps;i;i=i.nextDep)Fi(i,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function qh(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let it=!0;const yc=[];function en(){yc.push(it),it=!1}function tn(){const n=yc.pop();it=n===void 0?!0:n}function ea(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=ae;ae=void 0;try{e()}finally{ae=t}}}let ar=0;class Vh{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Bi{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!ae||!it||ae===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ae)t=this.activeLink=new Vh(ae,this),ae.deps?(t.prevDep=ae.depsTail,ae.depsTail.nextDep=t,ae.depsTail=t):ae.deps=ae.depsTail=t,Tc(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=ae.depsTail,t.nextDep=void 0,ae.depsTail.nextDep=t,ae.depsTail=t,ae.deps===t&&(ae.deps=r)}return t}trigger(e){this.version++,ar++,this.notify(e)}notify(e){Ui();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Di()}}}function Tc(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Tc(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const ri=new WeakMap,dn=Symbol(""),oi=Symbol(""),cr=Symbol("");function Ee(n,e,t){if(it&&ae){let r=ri.get(n);r||ri.set(n,r=new Map);let o=r.get(t);o||(r.set(t,o=new Bi),o.map=r,o.key=t),o.track()}}function Nt(n,e,t,r,o,i){const s=ri.get(n);if(!s){ar++;return}const a=c=>{c&&c.trigger()};if(Ui(),e==="clear")s.forEach(a);else{const c=B(n),l=c&&xi(t);if(c&&t==="length"){const d=Number(r);s.forEach((h,p)=>{(p==="length"||p===cr||!Zt(p)&&p>=d)&&a(h)})}else switch((t!==void 0||s.has(void 0))&&a(s.get(t)),l&&a(s.get(cr)),e){case"add":c?l&&a(s.get("length")):(a(s.get(dn)),Rn(n)&&a(s.get(oi)));break;case"delete":c||(a(s.get(dn)),Rn(n)&&a(s.get(oi)));break;case"set":Rn(n)&&a(s.get(dn));break}}Di()}function wn(n){const e=Z(n);return e===n?e:(Ee(e,"iterate",cr),et(n)?e:e.map(_e))}function uo(n){return Ee(n=Z(n),"iterate",cr),n}const jh={__proto__:null,[Symbol.iterator](){return $o(this,Symbol.iterator,_e)},concat(...n){return wn(this).concat(...n.map(e=>B(e)?wn(e):e))},entries(){return $o(this,"entries",n=>(n[1]=_e(n[1]),n))},every(n,e){return _t(this,"every",n,e,void 0,arguments)},filter(n,e){return _t(this,"filter",n,e,t=>t.map(_e),arguments)},find(n,e){return _t(this,"find",n,e,_e,arguments)},findIndex(n,e){return _t(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return _t(this,"findLast",n,e,_e,arguments)},findLastIndex(n,e){return _t(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return _t(this,"forEach",n,e,void 0,arguments)},includes(...n){return zo(this,"includes",n)},indexOf(...n){return zo(this,"indexOf",n)},join(n){return wn(this).join(n)},lastIndexOf(...n){return zo(this,"lastIndexOf",n)},map(n,e){return _t(this,"map",n,e,void 0,arguments)},pop(){return Vn(this,"pop")},push(...n){return Vn(this,"push",n)},reduce(n,...e){return ta(this,"reduce",n,e)},reduceRight(n,...e){return ta(this,"reduceRight",n,e)},shift(){return Vn(this,"shift")},some(n,e){return _t(this,"some",n,e,void 0,arguments)},splice(...n){return Vn(this,"splice",n)},toReversed(){return wn(this).toReversed()},toSorted(n){return wn(this).toSorted(n)},toSpliced(...n){return wn(this).toSpliced(...n)},unshift(...n){return Vn(this,"unshift",n)},values(){return $o(this,"values",_e)}};function $o(n,e,t){const r=uo(n),o=r[e]();return r!==n&&!et(n)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.value&&(i.value=t(i.value)),i}),o}const Wh=Array.prototype;function _t(n,e,t,r,o,i){const s=uo(n),a=s!==n&&!et(n),c=s[e];if(c!==Wh[e]){const h=c.apply(n,i);return a?_e(h):h}let l=t;s!==n&&(a?l=function(h,p){return t.call(this,_e(h),p,n)}:t.length>2&&(l=function(h,p){return t.call(this,h,p,n)}));const d=c.call(s,l,r);return a&&o?o(d):d}function ta(n,e,t,r){const o=uo(n);let i=t;return o!==n&&(et(n)?t.length>3&&(i=function(s,a,c){return t.call(this,s,a,c,n)}):i=function(s,a,c){return t.call(this,s,_e(a),c,n)}),o[e](i,...r)}function zo(n,e,t){const r=Z(n);Ee(r,"iterate",cr);const o=r[e](...t);return(o===-1||o===!1)&&zi(t[0])?(t[0]=Z(t[0]),r[e](...t)):o}function Vn(n,e,t=[]){en(),Ui();const r=Z(n)[e].apply(n,t);return Di(),tn(),r}const Yh=Pi("__proto__,__v_isRef,__isVue"),Ac=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Zt));function Qh(n){Zt(n)||(n=String(n));const e=Z(this);return Ee(e,"has",n),e.hasOwnProperty(n)}class wc{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const o=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!o;if(t==="__v_isReadonly")return o;if(t==="__v_isShallow")return i;if(t==="__v_raw")return r===(o?i?su:_c:i?Ec:Ic).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=B(e);if(!o){let c;if(s&&(c=jh[t]))return c;if(t==="hasOwnProperty")return Qh}const a=Reflect.get(e,t,be(e)?e:r);return(Zt(t)?Ac.has(t):Yh(t))||(o||Ee(e,"get",t),i)?a:be(a)?s&&xi(t)?a:a.value:he(a)?o?Sc(a):Gi(a):a}}class vc extends wc{constructor(e=!1){super(!1,e)}set(e,t,r,o){let i=e[t];if(!this._isShallow){const c=un(i);if(!et(r)&&!un(r)&&(i=Z(i),r=Z(r)),!B(e)&&be(i)&&!be(r))return c?!1:(i.value=r,!0)}const s=B(e)&&xi(t)?Number(t)<e.length:ee(e,t),a=Reflect.set(e,t,r,be(e)?e:o);return e===Z(o)&&(s?Vt(r,i)&&Nt(e,"set",t,r):Nt(e,"add",t,r)),a}deleteProperty(e,t){const r=ee(e,t);e[t];const o=Reflect.deleteProperty(e,t);return o&&r&&Nt(e,"delete",t,void 0),o}has(e,t){const r=Reflect.has(e,t);return(!Zt(t)||!Ac.has(t))&&Ee(e,"has",t),r}ownKeys(e){return Ee(e,"iterate",B(e)?"length":dn),Reflect.ownKeys(e)}}class Jh extends wc{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Xh=new vc,Zh=new Jh,eu=new vc(!0);const ii=n=>n,wr=n=>Reflect.getPrototypeOf(n);function tu(n,e,t){return function(...r){const o=this.__v_raw,i=Z(o),s=Rn(i),a=n==="entries"||n===Symbol.iterator&&s,c=n==="keys"&&s,l=o[n](...r),d=t?ii:e?si:_e;return!e&&Ee(i,"iterate",c?oi:dn),{next(){const{value:h,done:p}=l.next();return p?{value:h,done:p}:{value:a?[d(h[0]),d(h[1])]:d(h),done:p}},[Symbol.iterator](){return this}}}}function vr(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function nu(n,e){const t={get(o){const i=this.__v_raw,s=Z(i),a=Z(o);n||(Vt(o,a)&&Ee(s,"get",o),Ee(s,"get",a));const{has:c}=wr(s),l=e?ii:n?si:_e;if(c.call(s,o))return l(i.get(o));if(c.call(s,a))return l(i.get(a));i!==s&&i.get(o)},get size(){const o=this.__v_raw;return!n&&Ee(Z(o),"iterate",dn),Reflect.get(o,"size",o)},has(o){const i=this.__v_raw,s=Z(i),a=Z(o);return n||(Vt(o,a)&&Ee(s,"has",o),Ee(s,"has",a)),o===a?i.has(o):i.has(o)||i.has(a)},forEach(o,i){const s=this,a=s.__v_raw,c=Z(a),l=e?ii:n?si:_e;return!n&&Ee(c,"iterate",dn),a.forEach((d,h)=>o.call(i,l(d),l(h),s))}};return Le(t,n?{add:vr("add"),set:vr("set"),delete:vr("delete"),clear:vr("clear")}:{add(o){!e&&!et(o)&&!un(o)&&(o=Z(o));const i=Z(this);return wr(i).has.call(i,o)||(i.add(o),Nt(i,"add",o,o)),this},set(o,i){!e&&!et(i)&&!un(i)&&(i=Z(i));const s=Z(this),{has:a,get:c}=wr(s);let l=a.call(s,o);l||(o=Z(o),l=a.call(s,o));const d=c.call(s,o);return s.set(o,i),l?Vt(i,d)&&Nt(s,"set",o,i):Nt(s,"add",o,i),this},delete(o){const i=Z(this),{has:s,get:a}=wr(i);let c=s.call(i,o);c||(o=Z(o),c=s.call(i,o)),a&&a.call(i,o);const l=i.delete(o);return c&&Nt(i,"delete",o,void 0),l},clear(){const o=Z(this),i=o.size!==0,s=o.clear();return i&&Nt(o,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=tu(o,n,e)}),t}function Ki(n,e){const t=nu(n,e);return(r,o,i)=>o==="__v_isReactive"?!n:o==="__v_isReadonly"?n:o==="__v_raw"?r:Reflect.get(ee(t,o)&&o in r?t:r,o,i)}const ru={get:Ki(!1,!1)},ou={get:Ki(!1,!0)},iu={get:Ki(!0,!1)};const Ic=new WeakMap,Ec=new WeakMap,_c=new WeakMap,su=new WeakMap;function au(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cu(n){return n.__v_skip||!Object.isExtensible(n)?0:au(Mh(n))}function Gi(n){return un(n)?n:$i(n,!1,Xh,ru,Ic)}function lu(n){return $i(n,!1,eu,ou,Ec)}function Sc(n){return $i(n,!0,Zh,iu,_c)}function $i(n,e,t,r,o){if(!he(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const i=o.get(n);if(i)return i;const s=cu(n);if(s===0)return n;const a=new Proxy(n,s===2?r:t);return o.set(n,a),a}function On(n){return un(n)?On(n.__v_raw):!!(n&&n.__v_isReactive)}function un(n){return!!(n&&n.__v_isReadonly)}function et(n){return!!(n&&n.__v_isShallow)}function zi(n){return n?!!n.__v_raw:!1}function Z(n){const e=n&&n.__v_raw;return e?Z(e):n}function du(n){return!ee(n,"__v_skip")&&Object.isExtensible(n)&&cc(n,"__v_skip",!0),n}const _e=n=>he(n)?Gi(n):n,si=n=>he(n)?Sc(n):n;function be(n){return n?n.__v_isRef===!0:!1}function St(n){return hu(n,!1)}function hu(n,e){return be(n)?n:new uu(n,e)}class uu{constructor(e,t){this.dep=new Bi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Z(e),this._value=t?e:_e(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||et(e)||un(e);e=r?e:Z(e),Vt(e,t)&&(this._rawValue=e,this._value=r?e:_e(e),this.dep.trigger())}}function kt(n){return be(n)?n.value:n}const fu={get:(n,e,t)=>e==="__v_raw"?n:kt(Reflect.get(n,e,t)),set:(n,e,t,r)=>{const o=n[e];return be(o)&&!be(t)?(o.value=t,!0):Reflect.set(n,e,t,r)}};function bc(n){return On(n)?n:new Proxy(n,fu)}class gu{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Bi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ar-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ae!==this)return gc(this,!0),!0}get value(){const e=this.dep.track();return Cc(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function pu(n,e,t=!1){let r,o;return G(n)?r=n:(r=n.get,o=n.set),new gu(r,o,t)}const Ir={},Fr=new WeakMap;let sn;function mu(n,e=!1,t=sn){if(t){let r=Fr.get(t);r||Fr.set(t,r=[]),r.push(n)}}function Cu(n,e,t=ce){const{immediate:r,deep:o,once:i,scheduler:s,augmentJob:a,call:c}=t,l=x=>o?x:et(x)||o===!1||o===0?$t(x,1):$t(x);let d,h,p,y,k=!1,b=!1;if(be(n)?(h=()=>n.value,k=et(n)):On(n)?(h=()=>l(n),k=!0):B(n)?(b=!0,k=n.some(x=>On(x)||et(x)),h=()=>n.map(x=>{if(be(x))return x.value;if(On(x))return l(x);if(G(x))return c?c(x,2):x()})):G(n)?e?h=c?()=>c(n,2):n:h=()=>{if(p){en();try{p()}finally{tn()}}const x=sn;sn=d;try{return c?c(n,3,[y]):n(y)}finally{sn=x}}:h=wt,e&&o){const x=h,ie=o===!0?1/0:o;h=()=>$t(x(),ie)}const $=zh(),D=()=>{d.stop(),$&&$.active&&Mi($.effects,d)};if(i&&e){const x=e;e=(...ie)=>{x(...ie),D()}}let q=b?new Array(n.length).fill(Ir):Ir;const W=x=>{if(!(!(d.flags&1)||!d.dirty&&!x))if(e){const ie=d.run();if(o||k||(b?ie.some((Be,ve)=>Vt(Be,q[ve])):Vt(ie,q))){p&&p();const Be=sn;sn=d;try{const ve=[ie,q===Ir?void 0:b&&q[0]===Ir?[]:q,y];c?c(e,3,ve):e(...ve),q=ie}finally{sn=Be}}}else d.run()};return a&&a(W),d=new uc(h),d.scheduler=s?()=>s(W,!1):W,y=x=>mu(x,!1,d),p=d.onStop=()=>{const x=Fr.get(d);if(x){if(c)c(x,4);else for(const ie of x)ie();Fr.delete(d)}},e?r?W(!0):q=d.run():s?s(W.bind(null,!0),!0):d.run(),D.pause=d.pause.bind(d),D.resume=d.resume.bind(d),D.stop=D,D}function $t(n,e=1/0,t){if(e<=0||!he(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,be(n))$t(n.value,e,t);else if(B(n))for(let r=0;r<n.length;r++)$t(n[r],e,t);else if(rc(n)||Rn(n))n.forEach(r=>{$t(r,e,t)});else if(sc(n)){for(const r in n)$t(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&$t(n[r],e,t)}return n}/**
-* @vue/runtime-core v3.5.13
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/function Cr(n,e,t,r){try{return r?n(...r):n()}catch(o){fo(o,e,t)}}function vt(n,e,t,r){if(G(n)){const o=Cr(n,e,t,r);return o&&oc(o)&&o.catch(i=>{fo(i,e,t)}),o}if(B(n)){const o=[];for(let i=0;i<n.length;i++)o.push(vt(n[i],e,t,r));return o}}function fo(n,e,t,r=!0){const o=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||ce;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const d=a.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](n,c,l)===!1)return}a=a.parent}if(i){en(),Cr(i,null,10,[n,c,l]),tn();return}}yu(n,t,o,r,s)}function yu(n,e,t,r=!0,o=!1){if(o)throw n;console.error(n)}const Ne=[];let gt=-1;const Pn=[];let Kt=null,In=0;const kc=Promise.resolve();let Br=null;function Tu(n){const e=Br||kc;return n?e.then(this?n.bind(this):n):e}function Au(n){let e=gt+1,t=Ne.length;for(;e<t;){const r=e+t>>>1,o=Ne[r],i=lr(o);i<n||i===n&&o.flags&2?e=r+1:t=r}return e}function qi(n){if(!(n.flags&1)){const e=lr(n),t=Ne[Ne.length-1];!t||!(n.flags&2)&&e>=lr(t)?Ne.push(n):Ne.splice(Au(e),0,n),n.flags|=1,Rc()}}function Rc(){Br||(Br=kc.then(Pc))}function wu(n){B(n)?Pn.push(...n):Kt&&n.id===-1?Kt.splice(In+1,0,n):n.flags&1||(Pn.push(n),n.flags|=1),Rc()}function na(n,e,t=gt+1){for(;t<Ne.length;t++){const r=Ne[t];if(r&&r.flags&2){if(n&&r.id!==n.uid)continue;Ne.splice(t,1),t--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Oc(n){if(Pn.length){const e=[...new Set(Pn)].sort((t,r)=>lr(t)-lr(r));if(Pn.length=0,Kt){Kt.push(...e);return}for(Kt=e,In=0;In<Kt.length;In++){const t=Kt[In];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}Kt=null,In=0}}const lr=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Pc(n){try{for(gt=0;gt<Ne.length;gt++){const e=Ne[gt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Cr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;gt<Ne.length;gt++){const e=Ne[gt];e&&(e.flags&=-2)}gt=-1,Ne.length=0,Oc(),Br=null,(Ne.length||Pn.length)&&Pc()}}let Tt=null,Nc=null;function Kr(n){const e=Tt;return Tt=n,Nc=n&&n.type.__scopeId||null,e}function vu(n,e=Tt,t){if(!e||n._n)return n;const r=(...o)=>{r._d&&ha(-1);const i=Kr(e);let s;try{s=n(...o)}finally{Kr(i),r._d&&ha(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function rn(n,e,t,r){const o=n.dirs,i=e&&e.dirs;for(let s=0;s<o.length;s++){const a=o[s];i&&(a.oldValue=i[s].value);let c=a.dir[r];c&&(en(),vt(c,t,8,[n.el,a,n,e]),tn())}}const Iu=Symbol("_vte"),Eu=n=>n.__isTeleport;function Vi(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Vi(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Mc(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function Gr(n,e,t,r,o=!1){if(B(n)){n.forEach((k,b)=>Gr(k,e&&(B(e)?e[b]:e),t,r,o));return}if(er(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Gr(n,e,t,r.component.subTree);return}const i=r.shapeFlag&4?Yi(r.component):r.el,s=o?null:i,{i:a,r:c}=n,l=e&&e.r,d=a.refs===ce?a.refs={}:a.refs,h=a.setupState,p=Z(h),y=h===ce?()=>!1:k=>ee(p,k);if(l!=null&&l!==c&&(ge(l)?(d[l]=null,y(l)&&(h[l]=null)):be(l)&&(l.value=null)),G(c))Cr(c,a,12,[s,d]);else{const k=ge(c),b=be(c);if(k||b){const $=()=>{if(n.f){const D=k?y(c)?h[c]:d[c]:c.value;o?B(D)&&Mi(D,i):B(D)?D.includes(i)||D.push(i):k?(d[c]=[i],y(c)&&(h[c]=d[c])):(c.value=[i],n.k&&(d[n.k]=c.value))}else k?(d[c]=s,y(c)&&(h[c]=s)):b&&(c.value=s,n.k&&(d[n.k]=s))};s?($.id=-1,Ve($,t)):$()}}}ho().requestIdleCallback;ho().cancelIdleCallback;const er=n=>!!n.type.__asyncLoader,xc=n=>n.type.__isKeepAlive;function _u(n,e){Hc(n,"a",e)}function Su(n,e){Hc(n,"da",e)}function Hc(n,e,t=xe){const r=n.__wdc||(n.__wdc=()=>{let o=t;for(;o;){if(o.isDeactivated)return;o=o.parent}return n()});if(go(e,r,t),t){let o=t.parent;for(;o&&o.parent;)xc(o.parent.vnode)&&bu(r,e,t,o),o=o.parent}}function bu(n,e,t,r){const o=go(e,n,r,!0);Uc(()=>{Mi(r[e],o)},t)}function go(n,e,t=xe,r=!1){if(t){const o=t[n]||(t[n]=[]),i=e.__weh||(e.__weh=(...s)=>{en();const a=yr(t),c=vt(e,t,n,s);return a(),tn(),c});return r?o.unshift(i):o.push(i),i}}const Ut=n=>(e,t=xe)=>{(!hr||n==="sp")&&go(n,(...r)=>e(...r),t)},ku=Ut("bm"),Lc=Ut("m"),Ru=Ut("bu"),Ou=Ut("u"),Pu=Ut("bum"),Uc=Ut("um"),Nu=Ut("sp"),Mu=Ut("rtg"),xu=Ut("rtc");function Hu(n,e=xe){go("ec",n,e)}const Lu=Symbol.for("v-ndc");function Uu(n,e,t,r){let o;const i=t,s=B(n);if(s||ge(n)){const a=s&&On(n);let c=!1;a&&(c=!et(n),n=uo(n)),o=new Array(n.length);for(let l=0,d=n.length;l<d;l++)o[l]=e(c?_e(n[l]):n[l],l,void 0,i)}else if(typeof n=="number"){o=new Array(n);for(let a=0;a<n;a++)o[a]=e(a+1,a,void 0,i)}else if(he(n))if(n[Symbol.iterator])o=Array.from(n,(a,c)=>e(a,c,void 0,i));else{const a=Object.keys(n);o=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const d=a[c];o[c]=e(n[d],d,c,i)}}else o=[];return o}const ai=n=>n?il(n)?Yi(n):ai(n.parent):null,tr=Le(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>ai(n.parent),$root:n=>ai(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Fc(n),$forceUpdate:n=>n.f||(n.f=()=>{qi(n.update)}),$nextTick:n=>n.n||(n.n=Tu.bind(n.proxy)),$watch:n=>sf.bind(n)}),qo=(n,e)=>n!==ce&&!n.__isScriptSetup&&ee(n,e),Du={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:r,data:o,props:i,accessCache:s,type:a,appContext:c}=n;let l;if(e[0]!=="$"){const y=s[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return o[e];case 4:return t[e];case 3:return i[e]}else{if(qo(r,e))return s[e]=1,r[e];if(o!==ce&&ee(o,e))return s[e]=2,o[e];if((l=n.propsOptions[0])&&ee(l,e))return s[e]=3,i[e];if(t!==ce&&ee(t,e))return s[e]=4,t[e];ci&&(s[e]=0)}}const d=tr[e];let h,p;if(d)return e==="$attrs"&&Ee(n.attrs,"get",""),d(n);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==ce&&ee(t,e))return s[e]=4,t[e];if(p=c.config.globalProperties,ee(p,e))return p[e]},set({_:n},e,t){const{data:r,setupState:o,ctx:i}=n;return qo(o,e)?(o[e]=t,!0):r!==ce&&ee(r,e)?(r[e]=t,!0):ee(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(i[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:r,appContext:o,propsOptions:i}},s){let a;return!!t[s]||n!==ce&&ee(n,s)||qo(e,s)||(a=i[0])&&ee(a,s)||ee(r,s)||ee(tr,s)||ee(o.config.globalProperties,s)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:ee(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function ra(n){return B(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let ci=!0;function Fu(n){const e=Fc(n),t=n.proxy,r=n.ctx;ci=!1,e.beforeCreate&&oa(e.beforeCreate,n,"bc");const{data:o,computed:i,methods:s,watch:a,provide:c,inject:l,created:d,beforeMount:h,mounted:p,beforeUpdate:y,updated:k,activated:b,deactivated:$,beforeDestroy:D,beforeUnmount:q,destroyed:W,unmounted:x,render:ie,renderTracked:Be,renderTriggered:ve,errorCaptured:Je,serverPrefetch:Dt,expose:Ke,inheritAttrs:Ft,components:Tn,directives:Q,filters:U}=e;if(l&&Bu(l,r,null),s)for(const le in s){const re=s[le];G(re)&&(r[le]=re.bind(t))}if(o){const le=o.call(t,t);he(le)&&(n.data=Gi(le))}if(ci=!0,i)for(const le in i){const re=i[le],Et=G(re)?re.bind(t,t):G(re.get)?re.get.bind(t,t):wt,An=!G(re)&&G(re.set)?re.set.bind(t):wt,De=Hr({get:Et,set:An});Object.defineProperty(r,le,{enumerable:!0,configurable:!0,get:()=>De.value,set:Xe=>De.value=Xe})}if(a)for(const le in a)Dc(a[le],r,t,le);if(c){const le=G(c)?c.call(t):c;Reflect.ownKeys(le).forEach(re=>{Vu(re,le[re])})}d&&oa(d,n,"c");function pe(le,re){B(re)?re.forEach(Et=>le(Et.bind(t))):re&&le(re.bind(t))}if(pe(ku,h),pe(Lc,p),pe(Ru,y),pe(Ou,k),pe(_u,b),pe(Su,$),pe(Hu,Je),pe(xu,Be),pe(Mu,ve),pe(Pu,q),pe(Uc,x),pe(Nu,Dt),B(Ke))if(Ke.length){const le=n.exposed||(n.exposed={});Ke.forEach(re=>{Object.defineProperty(le,re,{get:()=>t[re],set:Et=>t[re]=Et})})}else n.exposed||(n.exposed={});ie&&n.render===wt&&(n.render=ie),Ft!=null&&(n.inheritAttrs=Ft),Tn&&(n.components=Tn),Q&&(n.directives=Q),Dt&&Mc(n)}function Bu(n,e,t=wt){B(n)&&(n=li(n));for(const r in n){const o=n[r];let i;he(o)?"default"in o?i=Mr(o.from||r,o.default,!0):i=Mr(o.from||r):i=Mr(o),be(i)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[r]=i}}function oa(n,e,t){vt(B(n)?n.map(r=>r.bind(e.proxy)):n.bind(e.proxy),e,t)}function Dc(n,e,t,r){let o=r.includes(".")?Zc(t,r):()=>t[r];if(ge(n)){const i=e[n];G(i)&&jo(o,i)}else if(G(n))jo(o,n.bind(t));else if(he(n))if(B(n))n.forEach(i=>Dc(i,e,t,r));else{const i=G(n.handler)?n.handler.bind(t):e[n.handler];G(i)&&jo(o,i,n)}}function Fc(n){const e=n.type,{mixins:t,extends:r}=e,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=n.appContext,a=i.get(e);let c;return a?c=a:!o.length&&!t&&!r?c=e:(c={},o.length&&o.forEach(l=>$r(c,l,s,!0)),$r(c,e,s)),he(e)&&i.set(e,c),c}function $r(n,e,t,r=!1){const{mixins:o,extends:i}=e;i&&$r(n,i,t,!0),o&&o.forEach(s=>$r(n,s,t,!0));for(const s in e)if(!(r&&s==="expose")){const a=Ku[s]||t&&t[s];n[s]=a?a(n[s],e[s]):e[s]}return n}const Ku={data:ia,props:sa,emits:sa,methods:Yn,computed:Yn,beforeCreate:Re,created:Re,beforeMount:Re,mounted:Re,beforeUpdate:Re,updated:Re,beforeDestroy:Re,beforeUnmount:Re,destroyed:Re,unmounted:Re,activated:Re,deactivated:Re,errorCaptured:Re,serverPrefetch:Re,components:Yn,directives:Yn,watch:$u,provide:ia,inject:Gu};function ia(n,e){return e?n?function(){return Le(G(n)?n.call(this,this):n,G(e)?e.call(this,this):e)}:e:n}function Gu(n,e){return Yn(li(n),li(e))}function li(n){if(B(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function Re(n,e){return n?[...new Set([].concat(n,e))]:e}function Yn(n,e){return n?Le(Object.create(null),n,e):e}function sa(n,e){return n?B(n)&&B(e)?[...new Set([...n,...e])]:Le(Object.create(null),ra(n),ra(e??{})):e}function $u(n,e){if(!n)return e;if(!e)return n;const t=Le(Object.create(null),n);for(const r in e)t[r]=Re(n[r],e[r]);return t}function Bc(){return{app:null,config:{isNativeTag:Ph,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let zu=0;function qu(n,e){return function(r,o=null){G(r)||(r=Le({},r)),o!=null&&!he(o)&&(o=null);const i=Bc(),s=new WeakSet,a=[];let c=!1;const l=i.app={_uid:zu++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:bf,get config(){return i.config},set config(d){},use(d,...h){return s.has(d)||(d&&G(d.install)?(s.add(d),d.install(l,...h)):G(d)&&(s.add(d),d(l,...h))),l},mixin(d){return i.mixins.includes(d)||i.mixins.push(d),l},component(d,h){return h?(i.components[d]=h,l):i.components[d]},directive(d,h){return h?(i.directives[d]=h,l):i.directives[d]},mount(d,h,p){if(!c){const y=l._ceVNode||xt(r,o);return y.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),n(y,d,p),c=!0,l._container=d,d.__vue_app__=l,Yi(y.component)}},onUnmount(d){a.push(d)},unmount(){c&&(vt(a,l._instance,16),n(null,l._container),delete l._container.__vue_app__)},provide(d,h){return i.provides[d]=h,l},runWithContext(d){const h=Nn;Nn=l;try{return d()}finally{Nn=h}}};return l}}let Nn=null;function Vu(n,e){if(xe){let t=xe.provides;const r=xe.parent&&xe.parent.provides;r===t&&(t=xe.provides=Object.create(r)),t[n]=e}}function Mr(n,e,t=!1){const r=xe||Tt;if(r||Nn){const o=Nn?Nn._context.provides:r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&n in o)return o[n];if(arguments.length>1)return t&&G(e)?e.call(r&&r.proxy):e}}const Kc={},Gc=()=>Object.create(Kc),$c=n=>Object.getPrototypeOf(n)===Kc;function ju(n,e,t,r=!1){const o={},i=Gc();n.propsDefaults=Object.create(null),zc(n,e,o,i);for(const s in n.propsOptions[0])s in o||(o[s]=void 0);t?n.props=r?o:lu(o):n.type.props?n.props=o:n.props=i,n.attrs=i}function Wu(n,e,t,r){const{props:o,attrs:i,vnode:{patchFlag:s}}=n,a=Z(o),[c]=n.propsOptions;let l=!1;if((r||s>0)&&!(s&16)){if(s&8){const d=n.vnode.dynamicProps;for(let h=0;h<d.length;h++){let p=d[h];if(po(n.emitsOptions,p))continue;const y=e[p];if(c)if(ee(i,p))y!==i[p]&&(i[p]=y,l=!0);else{const k=Qt(p);o[k]=di(c,a,k,y,n,!1)}else y!==i[p]&&(i[p]=y,l=!0)}}}else{zc(n,e,o,i)&&(l=!0);let d;for(const h in a)(!e||!ee(e,h)&&((d=Cn(h))===h||!ee(e,d)))&&(c?t&&(t[h]!==void 0||t[d]!==void 0)&&(o[h]=di(c,a,h,void 0,n,!0)):delete o[h]);if(i!==a)for(const h in i)(!e||!ee(e,h))&&(delete i[h],l=!0)}l&&Nt(n.attrs,"set","")}function zc(n,e,t,r){const[o,i]=n.propsOptions;let s=!1,a;if(e)for(let c in e){if(Jn(c))continue;const l=e[c];let d;o&&ee(o,d=Qt(c))?!i||!i.includes(d)?t[d]=l:(a||(a={}))[d]=l:po(n.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,s=!0)}if(i){const c=Z(t),l=a||ce;for(let d=0;d<i.length;d++){const h=i[d];t[h]=di(o,c,h,l[h],n,!ee(l,h))}}return s}function di(n,e,t,r,o,i){const s=n[t];if(s!=null){const a=ee(s,"default");if(a&&r===void 0){const c=s.default;if(s.type!==Function&&!s.skipFactory&&G(c)){const{propsDefaults:l}=o;if(t in l)r=l[t];else{const d=yr(o);r=l[t]=c.call(null,e),d()}}else r=c;o.ce&&o.ce._setProp(t,r)}s[0]&&(i&&!a?r=!1:s[1]&&(r===""||r===Cn(t))&&(r=!0))}return r}const Yu=new WeakMap;function qc(n,e,t=!1){const r=t?Yu:e.propsCache,o=r.get(n);if(o)return o;const i=n.props,s={},a=[];let c=!1;if(!G(n)){const d=h=>{c=!0;const[p,y]=qc(h,e,!0);Le(s,p),y&&a.push(...y)};!t&&e.mixins.length&&e.mixins.forEach(d),n.extends&&d(n.extends),n.mixins&&n.mixins.forEach(d)}if(!i&&!c)return he(n)&&r.set(n,kn),kn;if(B(i))for(let d=0;d<i.length;d++){const h=Qt(i[d]);aa(h)&&(s[h]=ce)}else if(i)for(const d in i){const h=Qt(d);if(aa(h)){const p=i[d],y=s[h]=B(p)||G(p)?{type:p}:Le({},p),k=y.type;let b=!1,$=!0;if(B(k))for(let D=0;D<k.length;++D){const q=k[D],W=G(q)&&q.name;if(W==="Boolean"){b=!0;break}else W==="String"&&($=!1)}else b=G(k)&&k.name==="Boolean";y[0]=b,y[1]=$,(b||ee(y,"default"))&&a.push(h)}}const l=[s,a];return he(n)&&r.set(n,l),l}function aa(n){return n[0]!=="$"&&!Jn(n)}const Vc=n=>n[0]==="_"||n==="$stable",ji=n=>B(n)?n.map(mt):[mt(n)],Qu=(n,e,t)=>{if(e._n)return e;const r=vu((...o)=>ji(e(...o)),t);return r._c=!1,r},jc=(n,e,t)=>{const r=n._ctx;for(const o in n){if(Vc(o))continue;const i=n[o];if(G(i))e[o]=Qu(o,i,r);else if(i!=null){const s=ji(i);e[o]=()=>s}}},Wc=(n,e)=>{const t=ji(e);n.slots.default=()=>t},Yc=(n,e,t)=>{for(const r in e)(t||r!=="_")&&(n[r]=e[r])},Ju=(n,e,t)=>{const r=n.slots=Gc();if(n.vnode.shapeFlag&32){const o=e._;o?(Yc(r,e,t),t&&cc(r,"_",o,!0)):jc(e,r)}else e&&Wc(n,e)},Xu=(n,e,t)=>{const{vnode:r,slots:o}=n;let i=!0,s=ce;if(r.shapeFlag&32){const a=e._;a?t&&a===1?i=!1:Yc(o,e,t):(i=!e.$stable,jc(e,o)),s=e}else e&&(Wc(n,e),s={default:1});if(i)for(const a in o)!Vc(a)&&s[a]==null&&delete o[a]},Ve=ff;function Zu(n){return ef(n)}function ef(n,e){const t=ho();t.__VUE__=!0;const{insert:r,remove:o,patchProp:i,createElement:s,createText:a,createComment:c,setText:l,setElementText:d,parentNode:h,nextSibling:p,setScopeId:y=wt,insertStaticContent:k}=n,b=(u,g,m,I=null,A=null,v=null,R=void 0,S=null,_=!!g.dynamicChildren)=>{if(u===g)return;u&&!jn(u,g)&&(I=Ar(u),Xe(u,A,v,!0),u=null),g.patchFlag===-2&&(_=!1,g.dynamicChildren=null);const{type:E,ref:L,shapeFlag:O}=g;switch(E){case mo:$(u,g,m,I);break;case fn:D(u,g,m,I);break;case Wo:u==null&&q(g,m,I,R);break;case pt:Tn(u,g,m,I,A,v,R,S,_);break;default:O&1?ie(u,g,m,I,A,v,R,S,_):O&6?Q(u,g,m,I,A,v,R,S,_):(O&64||O&128)&&E.process(u,g,m,I,A,v,R,S,_,zn)}L!=null&&A&&Gr(L,u&&u.ref,v,g||u,!g)},$=(u,g,m,I)=>{if(u==null)r(g.el=a(g.children),m,I);else{const A=g.el=u.el;g.children!==u.children&&l(A,g.children)}},D=(u,g,m,I)=>{u==null?r(g.el=c(g.children||""),m,I):g.el=u.el},q=(u,g,m,I)=>{[u.el,u.anchor]=k(u.children,g,m,I,u.el,u.anchor)},W=({el:u,anchor:g},m,I)=>{let A;for(;u&&u!==g;)A=p(u),r(u,m,I),u=A;r(g,m,I)},x=({el:u,anchor:g})=>{let m;for(;u&&u!==g;)m=p(u),o(u),u=m;o(g)},ie=(u,g,m,I,A,v,R,S,_)=>{g.type==="svg"?R="svg":g.type==="math"&&(R="mathml"),u==null?Be(g,m,I,A,v,R,S,_):Dt(u,g,A,v,R,S,_)},Be=(u,g,m,I,A,v,R,S)=>{let _,E;const{props:L,shapeFlag:O,transition:H,dirs:F}=u;if(_=u.el=s(u.type,v,L&&L.is,L),O&8?d(_,u.children):O&16&&Je(u.children,_,null,I,A,Vo(u,v),R,S),F&&rn(u,null,I,"created"),ve(_,u,u.scopeId,R,I),L){for(const se in L)se!=="value"&&!Jn(se)&&i(_,se,null,L[se],v,I);"value"in L&&i(_,"value",null,L.value,v),(E=L.onVnodeBeforeMount)&&ut(E,I,u)}F&&rn(u,null,I,"beforeMount");const V=tf(A,H);V&&H.beforeEnter(_),r(_,g,m),((E=L&&L.onVnodeMounted)||V||F)&&Ve(()=>{E&&ut(E,I,u),V&&H.enter(_),F&&rn(u,null,I,"mounted")},A)},ve=(u,g,m,I,A)=>{if(m&&y(u,m),I)for(let v=0;v<I.length;v++)y(u,I[v]);if(A){let v=A.subTree;if(g===v||tl(v.type)&&(v.ssContent===g||v.ssFallback===g)){const R=A.vnode;ve(u,R,R.scopeId,R.slotScopeIds,A.parent)}}},Je=(u,g,m,I,A,v,R,S,_=0)=>{for(let E=_;E<u.length;E++){const L=u[E]=S?Gt(u[E]):mt(u[E]);b(null,L,g,m,I,A,v,R,S)}},Dt=(u,g,m,I,A,v,R)=>{const S=g.el=u.el;let{patchFlag:_,dynamicChildren:E,dirs:L}=g;_|=u.patchFlag&16;const O=u.props||ce,H=g.props||ce;let F;if(m&&on(m,!1),(F=H.onVnodeBeforeUpdate)&&ut(F,m,g,u),L&&rn(g,u,m,"beforeUpdate"),m&&on(m,!0),(O.innerHTML&&H.innerHTML==null||O.textContent&&H.textContent==null)&&d(S,""),E?Ke(u.dynamicChildren,E,S,m,I,Vo(g,A),v):R||re(u,g,S,null,m,I,Vo(g,A),v,!1),_>0){if(_&16)Ft(S,O,H,m,A);else if(_&2&&O.class!==H.class&&i(S,"class",null,H.class,A),_&4&&i(S,"style",O.style,H.style,A),_&8){const V=g.dynamicProps;for(let se=0;se<V.length;se++){const te=V[se],Ge=O[te],Fe=H[te];(Fe!==Ge||te==="value")&&i(S,te,Ge,Fe,A,m)}}_&1&&u.children!==g.children&&d(S,g.children)}else!R&&E==null&&Ft(S,O,H,m,A);((F=H.onVnodeUpdated)||L)&&Ve(()=>{F&&ut(F,m,g,u),L&&rn(g,u,m,"updated")},I)},Ke=(u,g,m,I,A,v,R)=>{for(let S=0;S<g.length;S++){const _=u[S],E=g[S],L=_.el&&(_.type===pt||!jn(_,E)||_.shapeFlag&70)?h(_.el):m;b(_,E,L,null,I,A,v,R,!0)}},Ft=(u,g,m,I,A)=>{if(g!==m){if(g!==ce)for(const v in g)!Jn(v)&&!(v in m)&&i(u,v,g[v],null,A,I);for(const v in m){if(Jn(v))continue;const R=m[v],S=g[v];R!==S&&v!=="value"&&i(u,v,S,R,A,I)}"value"in m&&i(u,"value",g.value,m.value,A)}},Tn=(u,g,m,I,A,v,R,S,_)=>{const E=g.el=u?u.el:a(""),L=g.anchor=u?u.anchor:a("");let{patchFlag:O,dynamicChildren:H,slotScopeIds:F}=g;F&&(S=S?S.concat(F):F),u==null?(r(E,m,I),r(L,m,I),Je(g.children||[],m,L,A,v,R,S,_)):O>0&&O&64&&H&&u.dynamicChildren?(Ke(u.dynamicChildren,H,m,A,v,R,S),(g.key!=null||A&&g===A.subTree)&&Qc(u,g,!0)):re(u,g,m,L,A,v,R,S,_)},Q=(u,g,m,I,A,v,R,S,_)=>{g.slotScopeIds=S,u==null?g.shapeFlag&512?A.ctx.activate(g,m,I,R,_):U(g,m,I,A,v,R,_):ye(u,g,_)},U=(u,g,m,I,A,v,R)=>{const S=u.component=wf(u,I,A);if(xc(u)&&(S.ctx.renderer=zn),vf(S,!1,R),S.asyncDep){if(A&&A.registerDep(S,pe,R),!u.el){const _=S.subTree=xt(fn);D(null,_,g,m)}}else pe(S,u,g,m,A,v,R)},ye=(u,g,m)=>{const I=g.component=u.component;if(hf(u,g,m))if(I.asyncDep&&!I.asyncResolved){le(I,g,m);return}else I.next=g,I.update();else g.el=u.el,I.vnode=g},pe=(u,g,m,I,A,v,R)=>{const S=()=>{if(u.isMounted){let{next:O,bu:H,u:F,parent:V,vnode:se}=u;{const dt=Jc(u);if(dt){O&&(O.el=se.el,le(u,O,R)),dt.asyncDep.then(()=>{u.isUnmounted||S()});return}}let te=O,Ge;on(u,!1),O?(O.el=se.el,le(u,O,R)):O=se,H&&Bo(H),(Ge=O.props&&O.props.onVnodeBeforeUpdate)&&ut(Ge,V,O,se),on(u,!0);const Fe=la(u),lt=u.subTree;u.subTree=Fe,b(lt,Fe,h(lt.el),Ar(lt),u,A,v),O.el=Fe.el,te===null&&uf(u,Fe.el),F&&Ve(F,A),(Ge=O.props&&O.props.onVnodeUpdated)&&Ve(()=>ut(Ge,V,O,se),A)}else{let O;const{el:H,props:F}=g,{bm:V,m:se,parent:te,root:Ge,type:Fe}=u,lt=er(g);on(u,!1),V&&Bo(V),!lt&&(O=F&&F.onVnodeBeforeMount)&&ut(O,te,g),on(u,!0);{Ge.ce&&Ge.ce._injectChildStyle(Fe);const dt=u.subTree=la(u);b(null,dt,m,I,u,A,v),g.el=dt.el}if(se&&Ve(se,A),!lt&&(O=F&&F.onVnodeMounted)){const dt=g;Ve(()=>ut(O,te,dt),A)}(g.shapeFlag&256||te&&er(te.vnode)&&te.vnode.shapeFlag&256)&&u.a&&Ve(u.a,A),u.isMounted=!0,g=m=I=null}};u.scope.on();const _=u.effect=new uc(S);u.scope.off();const E=u.update=_.run.bind(_),L=u.job=_.runIfDirty.bind(_);L.i=u,L.id=u.uid,_.scheduler=()=>qi(L),on(u,!0),E()},le=(u,g,m)=>{g.component=u;const I=u.vnode.props;u.vnode=g,u.next=null,Wu(u,g.props,I,m),Xu(u,g.children,m),en(),na(u),tn()},re=(u,g,m,I,A,v,R,S,_=!1)=>{const E=u&&u.children,L=u?u.shapeFlag:0,O=g.children,{patchFlag:H,shapeFlag:F}=g;if(H>0){if(H&128){An(E,O,m,I,A,v,R,S,_);return}else if(H&256){Et(E,O,m,I,A,v,R,S,_);return}}F&8?(L&16&&$n(E,A,v),O!==E&&d(m,O)):L&16?F&16?An(E,O,m,I,A,v,R,S,_):$n(E,A,v,!0):(L&8&&d(m,""),F&16&&Je(O,m,I,A,v,R,S,_))},Et=(u,g,m,I,A,v,R,S,_)=>{u=u||kn,g=g||kn;const E=u.length,L=g.length,O=Math.min(E,L);let H;for(H=0;H<O;H++){const F=g[H]=_?Gt(g[H]):mt(g[H]);b(u[H],F,m,null,A,v,R,S,_)}E>L?$n(u,A,v,!0,!1,O):Je(g,m,I,A,v,R,S,_,O)},An=(u,g,m,I,A,v,R,S,_)=>{let E=0;const L=g.length;let O=u.length-1,H=L-1;for(;E<=O&&E<=H;){const F=u[E],V=g[E]=_?Gt(g[E]):mt(g[E]);if(jn(F,V))b(F,V,m,null,A,v,R,S,_);else break;E++}for(;E<=O&&E<=H;){const F=u[O],V=g[H]=_?Gt(g[H]):mt(g[H]);if(jn(F,V))b(F,V,m,null,A,v,R,S,_);else break;O--,H--}if(E>O){if(E<=H){const F=H+1,V=F<L?g[F].el:I;for(;E<=H;)b(null,g[E]=_?Gt(g[E]):mt(g[E]),m,V,A,v,R,S,_),E++}}else if(E>H)for(;E<=O;)Xe(u[E],A,v,!0),E++;else{const F=E,V=E,se=new Map;for(E=V;E<=H;E++){const $e=g[E]=_?Gt(g[E]):mt(g[E]);$e.key!=null&&se.set($e.key,E)}let te,Ge=0;const Fe=H-V+1;let lt=!1,dt=0;const qn=new Array(Fe);for(E=0;E<Fe;E++)qn[E]=0;for(E=F;E<=O;E++){const $e=u[E];if(Ge>=Fe){Xe($e,A,v,!0);continue}let ht;if($e.key!=null)ht=se.get($e.key);else for(te=V;te<=H;te++)if(qn[te-V]===0&&jn($e,g[te])){ht=te;break}ht===void 0?Xe($e,A,v,!0):(qn[ht-V]=E+1,ht>=dt?dt=ht:lt=!0,b($e,g[ht],m,null,A,v,R,S,_),Ge++)}const Js=lt?nf(qn):kn;for(te=Js.length-1,E=Fe-1;E>=0;E--){const $e=V+E,ht=g[$e],Xs=$e+1<L?g[$e+1].el:I;qn[E]===0?b(null,ht,m,Xs,A,v,R,S,_):lt&&(te<0||E!==Js[te]?De(ht,m,Xs,2):te--)}}},De=(u,g,m,I,A=null)=>{const{el:v,type:R,transition:S,children:_,shapeFlag:E}=u;if(E&6){De(u.component.subTree,g,m,I);return}if(E&128){u.suspense.move(g,m,I);return}if(E&64){R.move(u,g,m,zn);return}if(R===pt){r(v,g,m);for(let O=0;O<_.length;O++)De(_[O],g,m,I);r(u.anchor,g,m);return}if(R===Wo){W(u,g,m);return}if(I!==2&&E&1&&S)if(I===0)S.beforeEnter(v),r(v,g,m),Ve(()=>S.enter(v),A);else{const{leave:O,delayLeave:H,afterLeave:F}=S,V=()=>r(v,g,m),se=()=>{O(v,()=>{V(),F&&F()})};H?H(v,V,se):se()}else r(v,g,m)},Xe=(u,g,m,I=!1,A=!1)=>{const{type:v,props:R,ref:S,children:_,dynamicChildren:E,shapeFlag:L,patchFlag:O,dirs:H,cacheIndex:F}=u;if(O===-2&&(A=!1),S!=null&&Gr(S,null,m,u,!0),F!=null&&(g.renderCache[F]=void 0),L&256){g.ctx.deactivate(u);return}const V=L&1&&H,se=!er(u);let te;if(se&&(te=R&&R.onVnodeBeforeUnmount)&&ut(te,g,u),L&6)Oh(u.component,m,I);else{if(L&128){u.suspense.unmount(m,I);return}V&&rn(u,null,g,"beforeUnmount"),L&64?u.type.remove(u,g,m,zn,I):E&&!E.hasOnce&&(v!==pt||O>0&&O&64)?$n(E,g,m,!1,!0):(v===pt&&O&384||!A&&L&16)&&$n(_,g,m),I&&Ys(u)}(se&&(te=R&&R.onVnodeUnmounted)||V)&&Ve(()=>{te&&ut(te,g,u),V&&rn(u,null,g,"unmounted")},m)},Ys=u=>{const{type:g,el:m,anchor:I,transition:A}=u;if(g===pt){Rh(m,I);return}if(g===Wo){x(u);return}const v=()=>{o(m),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(u.shapeFlag&1&&A&&!A.persisted){const{leave:R,delayLeave:S}=A,_=()=>R(m,v);S?S(u.el,v,_):_()}else v()},Rh=(u,g)=>{let m;for(;u!==g;)m=p(u),o(u),u=m;o(g)},Oh=(u,g,m)=>{const{bum:I,scope:A,job:v,subTree:R,um:S,m:_,a:E}=u;ca(_),ca(E),I&&Bo(I),A.stop(),v&&(v.flags|=8,Xe(R,u,g,m)),S&&Ve(S,g),Ve(()=>{u.isUnmounted=!0},g),g&&g.pendingBranch&&!g.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===g.pendingId&&(g.deps--,g.deps===0&&g.resolve())},$n=(u,g,m,I=!1,A=!1,v=0)=>{for(let R=v;R<u.length;R++)Xe(u[R],g,m,I,A)},Ar=u=>{if(u.shapeFlag&6)return Ar(u.component.subTree);if(u.shapeFlag&128)return u.suspense.next();const g=p(u.anchor||u.el),m=g&&g[Iu];return m?p(m):g};let Do=!1;const Qs=(u,g,m)=>{u==null?g._vnode&&Xe(g._vnode,null,null,!0):b(g._vnode||null,u,g,null,null,null,m),g._vnode=u,Do||(Do=!0,na(),Oc(),Do=!1)},zn={p:b,um:Xe,m:De,r:Ys,mt:U,mc:Je,pc:re,pbc:Ke,n:Ar,o:n};return{render:Qs,hydrate:void 0,createApp:qu(Qs)}}function Vo({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function on({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function tf(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function Qc(n,e,t=!1){const r=n.children,o=e.children;if(B(r)&&B(o))for(let i=0;i<r.length;i++){const s=r[i];let a=o[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[i]=Gt(o[i]),a.el=s.el),!t&&a.patchFlag!==-2&&Qc(s,a)),a.type===mo&&(a.el=s.el)}}function nf(n){const e=n.slice(),t=[0];let r,o,i,s,a;const c=n.length;for(r=0;r<c;r++){const l=n[r];if(l!==0){if(o=t[t.length-1],n[o]<l){e[r]=o,t.push(r);continue}for(i=0,s=t.length-1;i<s;)a=i+s>>1,n[t[a]]<l?i=a+1:s=a;l<n[t[i]]&&(i>0&&(e[r]=t[i-1]),t[i]=r)}}for(i=t.length,s=t[i-1];i-- >0;)t[i]=s,s=e[s];return t}function Jc(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Jc(e)}function ca(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}const rf=Symbol.for("v-scx"),of=()=>Mr(rf);function jo(n,e,t){return Xc(n,e,t)}function Xc(n,e,t=ce){const{immediate:r,deep:o,flush:i,once:s}=t,a=Le({},t),c=e&&r||!e&&i!=="post";let l;if(hr){if(i==="sync"){const y=of();l=y.__watcherHandles||(y.__watcherHandles=[])}else if(!c){const y=()=>{};return y.stop=wt,y.resume=wt,y.pause=wt,y}}const d=xe;a.call=(y,k,b)=>vt(y,d,k,b);let h=!1;i==="post"?a.scheduler=y=>{Ve(y,d&&d.suspense)}:i!=="sync"&&(h=!0,a.scheduler=(y,k)=>{k?y():qi(y)}),a.augmentJob=y=>{e&&(y.flags|=4),h&&(y.flags|=2,d&&(y.id=d.uid,y.i=d))};const p=Cu(n,e,a);return hr&&(l?l.push(p):c&&p()),p}function sf(n,e,t){const r=this.proxy,o=ge(n)?n.includes(".")?Zc(r,n):()=>r[n]:n.bind(r,r);let i;G(e)?i=e:(i=e.handler,t=e);const s=yr(this),a=Xc(o,i.bind(r),t);return s(),a}function Zc(n,e){const t=e.split(".");return()=>{let r=n;for(let o=0;o<t.length&&r;o++)r=r[t[o]];return r}}const af=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${Qt(e)}Modifiers`]||n[`${Cn(e)}Modifiers`];function cf(n,e,...t){if(n.isUnmounted)return;const r=n.vnode.props||ce;let o=t;const i=e.startsWith("update:"),s=i&&af(r,e.slice(7));s&&(s.trim&&(o=t.map(d=>ge(d)?d.trim():d)),s.number&&(o=t.map(Lh)));let a,c=r[a=Fo(e)]||r[a=Fo(Qt(e))];!c&&i&&(c=r[a=Fo(Cn(e))]),c&&vt(c,n,6,o);const l=r[a+"Once"];if(l){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,vt(l,n,6,o)}}function el(n,e,t=!1){const r=e.emitsCache,o=r.get(n);if(o!==void 0)return o;const i=n.emits;let s={},a=!1;if(!G(n)){const c=l=>{const d=el(l,e,!0);d&&(a=!0,Le(s,d))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!i&&!a?(he(n)&&r.set(n,null),null):(B(i)?i.forEach(c=>s[c]=null):Le(s,i),he(n)&&r.set(n,s),s)}function po(n,e){return!n||!ao(e)?!1:(e=e.slice(2).replace(/Once$/,""),ee(n,e[0].toLowerCase()+e.slice(1))||ee(n,Cn(e))||ee(n,e))}function la(n){const{type:e,vnode:t,proxy:r,withProxy:o,propsOptions:[i],slots:s,attrs:a,emit:c,render:l,renderCache:d,props:h,data:p,setupState:y,ctx:k,inheritAttrs:b}=n,$=Kr(n);let D,q;try{if(t.shapeFlag&4){const x=o||r,ie=x;D=mt(l.call(ie,x,d,h,y,p,k)),q=a}else{const x=e;D=mt(x.length>1?x(h,{attrs:a,slots:s,emit:c}):x(h,null)),q=e.props?a:lf(a)}}catch(x){nr.length=0,fo(x,n,1),D=xt(fn)}let W=D;if(q&&b!==!1){const x=Object.keys(q),{shapeFlag:ie}=W;x.length&&ie&7&&(i&&x.some(Ni)&&(q=df(q,i)),W=Hn(W,q,!1,!0))}return t.dirs&&(W=Hn(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(t.dirs):t.dirs),t.transition&&Vi(W,t.transition),D=W,Kr($),D}const lf=n=>{let e;for(const t in n)(t==="class"||t==="style"||ao(t))&&((e||(e={}))[t]=n[t]);return e},df=(n,e)=>{const t={};for(const r in n)(!Ni(r)||!(r.slice(9)in e))&&(t[r]=n[r]);return t};function hf(n,e,t){const{props:r,children:o,component:i}=n,{props:s,children:a,patchFlag:c}=e,l=i.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&c>=0){if(c&1024)return!0;if(c&16)return r?da(r,s,l):!!s;if(c&8){const d=e.dynamicProps;for(let h=0;h<d.length;h++){const p=d[h];if(s[p]!==r[p]&&!po(l,p))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===s?!1:r?s?da(r,s,l):!0:!!s;return!1}function da(n,e,t){const r=Object.keys(e);if(r.length!==Object.keys(n).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(e[i]!==n[i]&&!po(t,i))return!0}return!1}function uf({vnode:n,parent:e},t){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===n&&(r.el=n.el),r===n)(n=e.vnode).el=t,e=e.parent;else break}}const tl=n=>n.__isSuspense;function ff(n,e){e&&e.pendingBranch?B(n)?e.effects.push(...n):e.effects.push(n):wu(n)}const pt=Symbol.for("v-fgt"),mo=Symbol.for("v-txt"),fn=Symbol.for("v-cmt"),Wo=Symbol.for("v-stc"),nr=[];let Ye=null;function qe(n=!1){nr.push(Ye=n?null:[])}function gf(){nr.pop(),Ye=nr[nr.length-1]||null}let dr=1;function ha(n,e=!1){dr+=n,n<0&&Ye&&e&&(Ye.hasOnce=!0)}function nl(n){return n.dynamicChildren=dr>0?Ye||kn:null,gf(),dr>0&&Ye&&Ye.push(n),n}function Ze(n,e,t,r,o,i){return nl(Y(n,e,t,r,o,i,!0))}function pf(n,e,t,r,o){return nl(xt(n,e,t,r,o,!0))}function rl(n){return n?n.__v_isVNode===!0:!1}function jn(n,e){return n.type===e.type&&n.key===e.key}const ol=({key:n})=>n??null,xr=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?ge(n)||be(n)||G(n)?{i:Tt,r:n,k:e,f:!!t}:n:null);function Y(n,e=null,t=null,r=0,o=null,i=n===pt?0:1,s=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&ol(e),ref:e&&xr(e),scopeId:Nc,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Tt};return a?(Wi(c,t),i&128&&n.normalize(c)):t&&(c.shapeFlag|=ge(t)?8:16),dr>0&&!s&&Ye&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&Ye.push(c),c}const xt=mf;function mf(n,e=null,t=null,r=0,o=null,i=!1){if((!n||n===Lu)&&(n=fn),rl(n)){const a=Hn(n,e,!0);return t&&Wi(a,t),dr>0&&!i&&Ye&&(a.shapeFlag&6?Ye[Ye.indexOf(n)]=a:Ye.push(a)),a.patchFlag=-2,a}if(Sf(n)&&(n=n.__vccOpts),e){e=Cf(e);let{class:a,style:c}=e;a&&!ge(a)&&(e.class=Li(a)),he(c)&&(zi(c)&&!B(c)&&(c=Le({},c)),e.style=Hi(c))}const s=ge(n)?1:tl(n)?128:Eu(n)?64:he(n)?4:G(n)?2:0;return Y(n,e,t,r,o,s,i,!0)}function Cf(n){return n?zi(n)||$c(n)?Le({},n):n:null}function Hn(n,e,t=!1,r=!1){const{props:o,ref:i,patchFlag:s,children:a,transition:c}=n,l=e?yf(o||{},e):o,d={__v_isVNode:!0,__v_skip:!0,type:n.type,props:l,key:l&&ol(l),ref:e&&e.ref?t&&i?B(i)?i.concat(xr(e)):[i,xr(e)]:xr(e):i,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==pt?s===-1?16:s|16:s,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Hn(n.ssContent),ssFallback:n.ssFallback&&Hn(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&Vi(d,c.clone(d)),d}function an(n=" ",e=0){return xt(mo,null,n,e)}function Wn(n="",e=!1){return e?(qe(),pf(fn,null,n)):xt(fn,null,n)}function mt(n){return n==null||typeof n=="boolean"?xt(fn):B(n)?xt(pt,null,n.slice()):rl(n)?Gt(n):xt(mo,null,String(n))}function Gt(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Hn(n)}function Wi(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(B(e))t=16;else if(typeof e=="object")if(r&65){const o=e.default;o&&(o._c&&(o._d=!1),Wi(n,o()),o._c&&(o._d=!0));return}else{t=32;const o=e._;!o&&!$c(e)?e._ctx=Tt:o===3&&Tt&&(Tt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else G(e)?(e={default:e,_ctx:Tt},t=32):(e=String(e),r&64?(t=16,e=[an(e)]):t=8);n.children=e,n.shapeFlag|=t}function yf(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const o in r)if(o==="class")e.class!==r.class&&(e.class=Li([e.class,r.class]));else if(o==="style")e.style=Hi([e.style,r.style]);else if(ao(o)){const i=e[o],s=r[o];s&&i!==s&&!(B(i)&&i.includes(s))&&(e[o]=i?[].concat(i,s):s)}else o!==""&&(e[o]=r[o])}return e}function ut(n,e,t,r=null){vt(n,e,7,[t,r])}const Tf=Bc();let Af=0;function wf(n,e,t){const r=n.type,o=(e?e.appContext:n.appContext)||Tf,i={uid:Af++,vnode:n,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new $h(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:qc(r,o),emitsOptions:el(r,o),emit:null,emitted:null,propsDefaults:ce,inheritAttrs:r.inheritAttrs,ctx:ce,data:ce,props:ce,attrs:ce,slots:ce,refs:ce,setupState:ce,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=cf.bind(null,i),n.ce&&n.ce(i),i}let xe=null,zr,hi;{const n=ho(),e=(t,r)=>{let o;return(o=n[t])||(o=n[t]=[]),o.push(r),i=>{o.length>1?o.forEach(s=>s(i)):o[0](i)}};zr=e("__VUE_INSTANCE_SETTERS__",t=>xe=t),hi=e("__VUE_SSR_SETTERS__",t=>hr=t)}const yr=n=>{const e=xe;return zr(n),n.scope.on(),()=>{n.scope.off(),zr(e)}},ua=()=>{xe&&xe.scope.off(),zr(null)};function il(n){return n.vnode.shapeFlag&4}let hr=!1;function vf(n,e=!1,t=!1){e&&hi(e);const{props:r,children:o}=n.vnode,i=il(n);ju(n,r,i,e),Ju(n,o,t);const s=i?If(n,e):void 0;return e&&hi(!1),s}function If(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,Du);const{setup:r}=t;if(r){en();const o=n.setupContext=r.length>1?_f(n):null,i=yr(n),s=Cr(r,n,0,[n.props,o]),a=oc(s);if(tn(),i(),(a||n.sp)&&!er(n)&&Mc(n),a){if(s.then(ua,ua),e)return s.then(c=>{fa(n,c)}).catch(c=>{fo(c,n,0)});n.asyncDep=s}else fa(n,s)}else sl(n)}function fa(n,e,t){G(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:he(e)&&(n.setupState=bc(e)),sl(n)}function sl(n,e,t){const r=n.type;n.render||(n.render=r.render||wt);{const o=yr(n);en();try{Fu(n)}finally{tn(),o()}}}const Ef={get(n,e){return Ee(n,"get",""),n[e]}};function _f(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,Ef),slots:n.slots,emit:n.emit,expose:e}}function Yi(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(bc(du(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in tr)return tr[t](n)},has(e,t){return t in e||t in tr}})):n.proxy}function Sf(n){return G(n)&&"__vccOpts"in n}const Hr=(n,e)=>pu(n,e,hr),bf="3.5.13";/**
-* @vue/runtime-dom v3.5.13
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/let ui;const ga=typeof window<"u"&&window.trustedTypes;if(ga)try{ui=ga.createPolicy("vue",{createHTML:n=>n})}catch{}const al=ui?n=>ui.createHTML(n):n=>n,kf="http://www.w3.org/2000/svg",Rf="http://www.w3.org/1998/Math/MathML",Ot=typeof document<"u"?document:null,pa=Ot&&Ot.createElement("template"),Of={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,r)=>{const o=e==="svg"?Ot.createElementNS(kf,n):e==="mathml"?Ot.createElementNS(Rf,n):t?Ot.createElement(n,{is:t}):Ot.createElement(n);return n==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:n=>Ot.createTextNode(n),createComment:n=>Ot.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Ot.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,r,o,i){const s=t?t.previousSibling:e.lastChild;if(o&&(o===i||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),t),!(o===i||!(o=o.nextSibling)););else{pa.innerHTML=al(r==="svg"?`<svg>${n}</svg>`:r==="mathml"?`<math>${n}</math>`:n);const a=pa.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,t)}return[s?s.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Pf=Symbol("_vtc");function Nf(n,e,t){const r=n[Pf];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const ma=Symbol("_vod"),Mf=Symbol("_vsh"),xf=Symbol(""),Hf=/(^|;)\s*display\s*:/;function Lf(n,e,t){const r=n.style,o=ge(t);let i=!1;if(t&&!o){if(e)if(ge(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();t[a]==null&&Lr(r,a,"")}else for(const s in e)t[s]==null&&Lr(r,s,"");for(const s in t)s==="display"&&(i=!0),Lr(r,s,t[s])}else if(o){if(e!==t){const s=r[xf];s&&(t+=";"+s),r.cssText=t,i=Hf.test(t)}}else e&&n.removeAttribute("style");ma in n&&(n[ma]=i?r.display:"",n[Mf]&&(r.display="none"))}const Ca=/\s*!important$/;function Lr(n,e,t){if(B(t))t.forEach(r=>Lr(n,e,r));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const r=Uf(n,e);Ca.test(t)?n.setProperty(Cn(r),t.replace(Ca,""),"important"):n[r]=t}}const ya=["Webkit","Moz","ms"],Yo={};function Uf(n,e){const t=Yo[e];if(t)return t;let r=Qt(e);if(r!=="filter"&&r in n)return Yo[e]=r;r=ac(r);for(let o=0;o<ya.length;o++){const i=ya[o]+r;if(i in n)return Yo[e]=i}return e}const Ta="http://www.w3.org/1999/xlink";function Aa(n,e,t,r,o,i=Gh(e)){r&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(Ta,e.slice(6,e.length)):n.setAttributeNS(Ta,e,t):t==null||i&&!lc(t)?n.removeAttribute(e):n.setAttribute(e,i?"":Zt(t)?String(t):t)}function wa(n,e,t,r,o){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?al(t):t);return}const i=n.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?n.getAttribute("value")||"":n.value,c=t==null?n.type==="checkbox"?"on":"":String(t);(a!==c||!("_value"in n))&&(n.value=c),t==null&&n.removeAttribute(e),n._value=t;return}let s=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=lc(t):t==null&&a==="string"?(t="",s=!0):a==="number"&&(t=0,s=!0)}try{n[e]=t}catch{}s&&n.removeAttribute(o||e)}function Df(n,e,t,r){n.addEventListener(e,t,r)}function Ff(n,e,t,r){n.removeEventListener(e,t,r)}const va=Symbol("_vei");function Bf(n,e,t,r,o=null){const i=n[va]||(n[va]={}),s=i[e];if(r&&s)s.value=r;else{const[a,c]=Kf(e);if(r){const l=i[e]=zf(r,o);Df(n,a,l,c)}else s&&(Ff(n,a,s,c),i[e]=void 0)}}const Ia=/(?:Once|Passive|Capture)$/;function Kf(n){let e;if(Ia.test(n)){e={};let r;for(;r=n.match(Ia);)n=n.slice(0,n.length-r[0].length),e[r[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):Cn(n.slice(2)),e]}let Qo=0;const Gf=Promise.resolve(),$f=()=>Qo||(Gf.then(()=>Qo=0),Qo=Date.now());function zf(n,e){const t=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=t.attached)return;vt(qf(r,t.value),e,5,[r])};return t.value=n,t.attached=$f(),t}function qf(n,e){if(B(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(r=>o=>!o._stopped&&r&&r(o))}else return e}const Ea=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,Vf=(n,e,t,r,o,i)=>{const s=o==="svg";e==="class"?Nf(n,r,s):e==="style"?Lf(n,t,r):ao(e)?Ni(e)||Bf(n,e,t,r,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):jf(n,e,r,s))?(wa(n,e,r),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Aa(n,e,r,s,i,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!ge(r))?wa(n,Qt(e),r,i,e):(e==="true-value"?n._trueValue=r:e==="false-value"&&(n._falseValue=r),Aa(n,e,r,s))};function jf(n,e,t,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in n&&Ea(e)&&G(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=n.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Ea(e)&&ge(t)?!1:e in n}const Wf=Le({patchProp:Vf},Of);let _a;function Yf(){return _a||(_a=Zu(Wf))}const Qf=(...n)=>{const e=Yf().createApp(...n),{mount:t}=e;return e.mount=r=>{const o=Xf(r);if(!o)return;const i=e._component;!G(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const s=t(o,!1,Jf(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},e};function Jf(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function Xf(n){return ge(n)?document.querySelector(n):n}function Bt(n){const e=Office.context.displayLanguage;return e in bn&&n in bn[e]?bn[e][n]:n}function nt(n,e){const t=Office.context.displayLanguage;return t in bn&&e in bn[t]?bn[t][e]:e}async function Zf(n,e,t){if(e)return new Promise((r,o)=>{const i='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> <soap:Header> <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" /> </soap:Header> <soap:Body> <GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"> <ItemShape> <t:BaseShape>Default</t:BaseShape> <t:IncludeMimeContent>true</t:IncludeMimeContent> <t:AdditionalProperties> <t:FieldURI FieldURI="item:ParentFolderId"/> </t:AdditionalProperties> </ItemShape> <ItemIds><t:ItemId Id="'+n.itemId+'"/></ItemIds> </GetItem> </soap:Body></soap:Envelope>';Office.context.mailbox.makeEwsRequestAsync(i,s=>{if(s.status!==Office.AsyncResultStatus.Succeeded){const h=s.error;o(h.name+": "+h.message);return}const c=new DOMParser().parseFromString(s.value,"text/xml"),l=c.getElementsByTagName("t:MimeContent")[0].innerHTML,d=c.getElementsByTagName("t:ParentFolderId")[0];r({content:atob(l),folderId:d.getAttribute("Id")})})});{const r=await fetch(`https://graph.microsoft.com/v1.0/me/messages/${n.itemId}/$value`,{headers:{Authorization:t}});return r.ok?{content:await r.text(),folderId:""}:{content:"",folderId:""}}}/*! @azure/msal-common v15.4.0 2025-03-25 */const C={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Er={CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},yn=[C.OPENID_SCOPE,C.PROFILE_SCOPE,C.OFFLINE_ACCESS_SCOPE],Sa=[...yn,C.EMAIL_SCOPE],Pe={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},ba={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},jt={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},_r={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Ae={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},ka={PLAIN:"plain",S256:"S256"},cl={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},Co={QUERY:"query",FRAGMENT:"fragment"},eg={QUERY:"query"},ll={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},Sr={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",GENERIC_ACCOUNT_TYPE:"Generic"},Se={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},K={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Qi="appmetadata",tg="client_info",rr="1",qr={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},je={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Te={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},J={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},or={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},Ra={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},br={httpSuccess:200,httpBadRequest:400},vn={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Jo={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},cn={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},ng={Pop:"pop"},rg=300;/*! @azure/msal-common v15.4.0 2025-03-25 */const Ji="unexpected_error",og="post_request_failed";/*! @azure/msal-common v15.4.0 2025-03-25 */const Oa={[Ji]:"Unexpected error in authentication.",[og]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class X extends Error{constructor(e,t,r){const o=t?`${e}: ${t}`:e;super(o),Object.setPrototypeOf(this,X.prototype),this.errorCode=e||C.EMPTY_STRING,this.errorMessage=t||C.EMPTY_STRING,this.subError=r||C.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function dl(n,e){return new X(n,e?`${Oa[n]} ${e}`:Oa[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */const Xi="client_info_decoding_error",hl="client_info_empty_error",Zi="token_parsing_error",Vr="null_or_empty_token",Pt="endpoints_resolution_error",ul="network_error",fl="openid_config_error",gl="hash_not_deserialized",Ln="invalid_state",pl="state_mismatch",fi="state_not_found",ml="nonce_mismatch",es="auth_time_not_found",Cl="max_age_transpired",ig="multiple_matching_tokens",sg="multiple_matching_accounts",yl="multiple_matching_appMetadata",Tl="request_cannot_be_made",Al="cannot_remove_empty_scope",wl="cannot_append_scopeset",gi="empty_input_scopeset",ag="device_code_polling_cancelled",cg="device_code_expired",lg="device_code_unknown_error",ts="no_account_in_silent_request",vl="invalid_cache_record",ns="invalid_cache_environment",jr="no_account_found",pi="no_crypto_object",mi="unexpected_credential_type",dg="invalid_assertion",hg="invalid_client_credential",Wt="token_refresh_required",ug="user_timeout_reached",Il="token_claims_cnf_required_for_signedjwt",El="authorization_code_missing_from_server_response",_l="binding_key_not_removed",Sl="end_session_endpoint_not_supported",rs="key_id_missing",bl="no_network_connectivity",kl="user_canceled",fg="missing_tenant_id_error",z="method_not_implemented",Ci="nested_app_auth_bridge_disabled";/*! @azure/msal-common v15.4.0 2025-03-25 */const Pa={[Xi]:"The client info could not be parsed/decoded correctly",[hl]:"The client info was empty",[Zi]:"Token cannot be parsed",[Vr]:"The token is null or empty",[Pt]:"Endpoints cannot be resolved",[ul]:"Network request failed",[fl]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[gl]:"The hash parameters could not be deserialized",[Ln]:"State was not the expected format",[pl]:"State mismatch error",[fi]:"State not found",[ml]:"Nonce mismatch error",[es]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Cl]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[ig]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[sg]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[yl]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Tl]:"Token request cannot be made without authorization code or refresh token.",[Al]:"Cannot remove null or empty scope from ScopeSet",[wl]:"Cannot append ScopeSet",[gi]:"Empty input ScopeSet cannot be processed",[ag]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[cg]:"Device code is expired.",[lg]:"Device code stopped polling for unknown reasons.",[ts]:"Please pass an account object, silent flow is not supported without account information",[vl]:"Cache record object was null or undefined.",[ns]:"Invalid environment when attempting to create cache entry",[jr]:"No account found in cache for given key.",[pi]:"No crypto object detected.",[mi]:"Unexpected credential type.",[dg]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[hg]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[Wt]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ug]:"User defined timeout for device code polling reached",[Il]:"Cannot generate a POP jwt if the token_claims are not populated",[El]:"Server response does not contain an authorization code to proceed",[_l]:"Could not remove the credential's binding key from storage.",[Sl]:"The provided authority does not support logout",[rs]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[bl]:"No network connectivity. Check your internet connection.",[kl]:"User cancelled the flow.",[fg]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[z]:"This method has not been implemented",[Ci]:"The nested app auth bridge is disabled"};class zt extends X{constructor(e,t){super(e,t?`${Pa[e]}: ${t}`:Pa[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,zt.prototype)}}function w(n,e){return new zt(n,e)}/*! @azure/msal-common v15.4.0 2025-03-25 */const ur={createNewGuid:()=>{throw w(z)},base64Decode:()=>{throw w(z)},base64Encode:()=>{throw w(z)},base64UrlEncode:()=>{throw w(z)},encodeKid:()=>{throw w(z)},async getPublicKeyThumbprint(){throw w(z)},async removeTokenBindingKey(){throw w(z)},async clearKeystore(){throw w(z)},async signJwt(){throw w(z)},async hashString(){throw w(z)}};/*! @azure/msal-common v15.4.0 2025-03-25 */var de;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"})(de||(de={}));class Lt{constructor(e,t,r){this.level=de.Info;const o=()=>{},i=e||Lt.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||o,this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level=typeof i.logLevel=="number"?i.logLevel:de.Info,this.correlationId=i.correlationId||C.EMPTY_STRING,this.packageName=t||C.EMPTY_STRING,this.packageVersion=r||C.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:de.Info}}clone(e,t,r){return new Lt({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const i=`${`[${new Date().toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${de[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,i,t.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(e,t){this.logMessage(e,{logLevel:de.Error,containsPii:!1,correlationId:t||C.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:de.Error,containsPii:!0,correlationId:t||C.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:de.Warning,containsPii:!1,correlationId:t||C.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:de.Warning,containsPii:!0,correlationId:t||C.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:de.Info,containsPii:!1,correlationId:t||C.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:de.Info,containsPii:!0,correlationId:t||C.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:de.Verbose,containsPii:!1,correlationId:t||C.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:de.Verbose,containsPii:!0,correlationId:t||C.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:de.Trace,containsPii:!1,correlationId:t||C.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:de.Trace,containsPii:!0,correlationId:t||C.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Rl="@azure/msal-common",os="15.4.0";/*! @azure/msal-common v15.4.0 2025-03-25 */const is={None:"none"};/*! @azure/msal-common v15.4.0 2025-03-25 */function Jt(n,e){const t=gg(n);try{const r=e(t);return JSON.parse(r)}catch{throw w(Zi)}}function gg(n){if(!n)throw w(Vr);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw w(Zi);return t[2]}function Ol(n,e){if(e===0||Date.now()-3e5>n+e)throw w(Cl)}/*! @azure/msal-common v15.4.0 2025-03-25 */function Ue(){return Math.round(new Date().getTime()/1e3)}function Na(n){return n.getTime()/1e3}function Ht(n){return n?new Date(Number(n)*1e3):new Date}function Wr(n,e){const t=Number(n)||0;return Ue()+e>t}function Pl(n){return Number(n)>Ue()}/*! @azure/msal-common v15.4.0 2025-03-25 */function ir(n){return[yg(n),Tg(n),Ag(n),wg(n),vg(n)].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}function yo(n,e,t,r,o){return{credentialType:K.ID_TOKEN,homeAccountId:n,environment:e,clientId:r,secret:t,realm:o}}function To(n,e,t,r,o,i,s,a,c,l,d,h,p,y,k){var $,D;const b={homeAccountId:n,credentialType:K.ACCESS_TOKEN,secret:t,cachedAt:Ue().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:r,realm:o,target:i,tokenType:d||J.BEARER};if(h&&(b.userAssertionHash=h),l&&(b.refreshOn=l.toString()),y&&(b.requestedClaims=y,b.requestedClaimsHash=k),(($=b.tokenType)==null?void 0:$.toLowerCase())!==J.BEARER.toLowerCase())switch(b.credentialType=K.ACCESS_TOKEN_WITH_AUTH_SCHEME,b.tokenType){case J.POP:const q=Jt(t,c);if(!((D=q==null?void 0:q.cnf)!=null&&D.kid))throw w(Il);b.keyId=q.cnf.kid;break;case J.SSH:b.keyId=p}return b}function Nl(n,e,t,r,o,i,s){const a={credentialType:K.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:r,secret:t};return i&&(a.userAssertionHash=i),o&&(a.familyId=o),s&&(a.expiresOn=s.toString()),a}function ss(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function pg(n){return n?ss(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===K.ACCESS_TOKEN||n.credentialType===K.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function mg(n){return n?ss(n)&&n.hasOwnProperty("realm")&&n.credentialType===K.ID_TOKEN:!1}function Cg(n){return n?ss(n)&&n.credentialType===K.REFRESH_TOKEN:!1}function yg(n){return[n.homeAccountId,n.environment].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}function Tg(n){const e=n.credentialType===K.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}function Ag(n){return(n.target||"").toLowerCase()}function wg(n){return(n.requestedClaimsHash||"").toLowerCase()}function vg(n){return n.tokenType&&n.tokenType.toLowerCase()!==J.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}function Ig(n,e){const t=n.indexOf(Te.CACHE_KEY)===0;let r=!0;return e&&(r=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),t&&r}function Eg(n,e){let t=!1;n&&(t=n.indexOf(or.THROTTLING_PREFIX)===0);let r=!0;return e&&(r=e.hasOwnProperty("throttleTime")),t&&r}function _g({environment:n,clientId:e}){return[Qi,n,e].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}function Sg(n,e){return e?n.indexOf(Qi)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function bg(n,e){return e?n.indexOf(qr.CACHE_KEY)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function Ma(){return Ue()+qr.REFRESH_TIME_SECONDS}function kr(n,e,t){n.authorization_endpoint=e.authorization_endpoint,n.token_endpoint=e.token_endpoint,n.end_session_endpoint=e.end_session_endpoint,n.issuer=e.issuer,n.endpointsFromNetwork=t,n.jwks_uri=e.jwks_uri}function Xo(n,e,t){n.aliases=e.aliases,n.preferred_cache=e.preferred_cache,n.preferred_network=e.preferred_network,n.aliasesFromNetwork=t}function xa(n){return n.expiresAt<=Ue()}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ml="redirect_uri_empty",kg="claims_request_parsing_error",xl="authority_uri_insecure",Qn="url_parse_error",Hl="empty_url_error",Ll="empty_input_scopes_error",Ul="invalid_prompt_value",Ao="invalid_claims",Dl="token_request_empty",Fl="logout_request_empty",Bl="invalid_code_challenge_method",wo="pkce_params_missing",as="invalid_cloud_discovery_metadata",Kl="invalid_authority_metadata",Gl="untrusted_authority",vo="missing_ssh_jwk",$l="missing_ssh_kid",Rg="missing_nonce_authentication_header",Og="invalid_authentication_header",zl="cannot_set_OIDCOptions",ql="cannot_allow_platform_broker",Vl="authority_mismatch";/*! @azure/msal-common v15.4.0 2025-03-25 */const Pg={[Ml]:"A redirect URI is required for all calls, and none has been set.",[kg]:"Could not parse the given claims request object.",[xl]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Qn]:"URL could not be parsed into appropriate segments.",[Hl]:"URL was empty or null.",[Ll]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Ul]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Ao]:"Given claims parameter must be a stringified JSON object.",[Dl]:"Token request was empty and not found in cache.",[Fl]:"The logout request was null or undefined.",[Bl]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[wo]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[as]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[Kl]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[Gl]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[vo]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[$l]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[Rg]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[Og]:"Invalid authentication header provided",[zl]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[ql]:"Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",[Vl]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class cs extends X{constructor(e){super(e,Pg[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,cs.prototype)}}function ne(n){return new cs(n)}/*! @azure/msal-common v15.4.0 2025-03-25 */class st{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0}static startsWith(e,t){return e.indexOf(t)===0}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),o=i=>decodeURIComponent(i.replace(/\+/g," "));return r.forEach(i=>{if(i.trim()){const[s,a]=i.split(/=(.+)/g,2);s&&a&&(t[o(s)]=o(a))}}),t}static trimArrayEntries(e){return e.map(t=>t.trim())}static removeEmptyStringsFromArray(e){return e.filter(t=>!!t)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class ue{constructor(e){const t=e?st.trimArrayEntries([...e]):[],r=t?st.removeEmptyStringsFromArray(t):[];if(!r||!r.length)throw ne(Ll);this.scopes=new Set,r.forEach(o=>this.scopes.add(o))}static fromString(e){const r=(e||C.EMPTY_STRING).split(" ");return new ue(r)}static createSearchScopes(e){const t=new ue(e);return t.containsOnlyOIDCScopes()?t.removeScope(C.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new ue(t);return e?r.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(t=>this.containsScope(t))}containsOnlyOIDCScopes(){let e=0;return Sa.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(t=>this.appendScope(t))}catch{throw w(wl)}}removeScope(e){if(!e)throw w(Al);this.scopes.delete(e.trim())}removeOIDCScopes(){Sa.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw w(gi);const t=new Set;return e.scopes.forEach(r=>t.add(r.toLowerCase())),this.scopes.forEach(r=>t.add(r.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw w(gi);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),o=this.getScopeCount();return t.size<o+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):C.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Yr(n,e){if(!n)throw w(hl);try{const t=e(n);return JSON.parse(t)}catch{throw w(Xi)}}function Mn(n){if(!n)throw w(Xi);const e=n.split(Se.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?C.EMPTY_STRING:e[1]}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Ha(n,e){return!!n&&!!e&&n===e.split(".")[1]}function Io(n,e,t,r){if(r){const{oid:o,sub:i,tid:s,name:a,tfp:c,acr:l}=r,d=s||c||l||"";return{tenantId:d,localAccountId:o||i||"",name:a,isHomeTenant:Ha(d,n)}}else return{tenantId:t,localAccountId:e,isHomeTenant:Ha(t,n)}}function ls(n,e,t,r){let o=n;if(e){const{isHomeTenant:i,...s}=e;o={...n,...s}}if(t){const{isHomeTenant:i,...s}=Io(n.homeAccountId,n.localAccountId,n.tenantId,t);return o={...o,...s,idTokenClaims:t,idToken:r},o}return o}/*! @azure/msal-common v15.4.0 2025-03-25 */const rt={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v15.4.0 2025-03-25 */function jl(n){return n&&(n.tid||n.tfp||n.acr)||null}/*! @azure/msal-common v15.4.0 2025-03-25 */const He={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};/*! @azure/msal-common v15.4.0 2025-03-25 */class ke{generateAccountId(){return[this.homeAccountId,this.environment].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return ke.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map(e=>[e.tenantId,e]))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(Se.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,r){var l,d,h,p,y,k;const o=new ke;t.authorityType===rt.Adfs?o.authorityType=Sr.ADFS_ACCOUNT_TYPE:t.protocolMode===He.OIDC?o.authorityType=Sr.GENERIC_ACCOUNT_TYPE:o.authorityType=Sr.MSSTS_ACCOUNT_TYPE;let i;e.clientInfo&&r&&(i=Yr(e.clientInfo,r)),o.clientInfo=e.clientInfo,o.homeAccountId=e.homeAccountId,o.nativeAccountId=e.nativeAccountId;const s=e.environment||t&&t.getPreferredCache();if(!s)throw w(ns);o.environment=s,o.realm=(i==null?void 0:i.utid)||jl(e.idTokenClaims)||"",o.localAccountId=(i==null?void 0:i.uid)||((l=e.idTokenClaims)==null?void 0:l.oid)||((d=e.idTokenClaims)==null?void 0:d.sub)||"";const a=((h=e.idTokenClaims)==null?void 0:h.preferred_username)||((p=e.idTokenClaims)==null?void 0:p.upn),c=(y=e.idTokenClaims)!=null&&y.emails?e.idTokenClaims.emails[0]:null;if(o.username=a||c||"",o.name=((k=e.idTokenClaims)==null?void 0:k.name)||"",o.cloudGraphHostName=e.cloudGraphHostName,o.msGraphHost=e.msGraphHost,e.tenantProfiles)o.tenantProfiles=e.tenantProfiles;else{const b=Io(e.homeAccountId,o.localAccountId,o.realm,e.idTokenClaims);o.tenantProfiles=[b]}return o}static createFromAccountInfo(e,t,r){var i;const o=new ke;return o.authorityType=e.authorityType||Sr.GENERIC_ACCOUNT_TYPE,o.homeAccountId=e.homeAccountId,o.localAccountId=e.localAccountId,o.nativeAccountId=e.nativeAccountId,o.realm=e.tenantId,o.environment=e.environment,o.username=e.username,o.name=e.name,o.cloudGraphHostName=t,o.msGraphHost=r,o.tenantProfiles=Array.from(((i=e.tenantProfiles)==null?void 0:i.values())||[]),o}static generateHomeAccountId(e,t,r,o,i){if(!(t===rt.Adfs||t===rt.Dsts)){if(e)try{const s=Yr(e,o.base64Decode);if(s.uid&&s.utid)return`${s.uid}.${s.utid}`}catch{}r.warning("No client info in response")}return(i==null?void 0:i.sub)||""}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,t,r){if(!e||!t)return!1;let o=!0;if(r){const i=e.idTokenClaims||{},s=t.idTokenClaims||{};o=i.iat===s.iat&&i.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&o}}/*! @azure/msal-common v15.4.0 2025-03-25 */function Wl(n){return n.startsWith("#/")?n.substring(2):n.startsWith("#")||n.startsWith("?")?n.substring(1):n}function Qr(n){if(!n||n.indexOf("=")<0)return null;try{const e=Wl(n),t=Object.fromEntries(new URLSearchParams(e));if(t.code||t.ear_jwe||t.error||t.error_description||t.state)return t}catch{throw w(gl)}return null}function fr(n){const e=new Array;return n.forEach((t,r)=>{e.push(`${r}=${encodeURIComponent(t)}`)}),e.join("&")}/*! @azure/msal-common v15.4.0 2025-03-25 */class j{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw ne(Hl);e.includes("#")||(this._urlString=j.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return st.endsWith(t,"?")?t=t.slice(0,-1):st.endsWith(t,"?/")&&(t=t.slice(0,-2)),st.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw ne(Qn)}if(!e.HostNameAndPort||!e.PathSegments)throw ne(Qn);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw ne(xl)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return j.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return e&&r.length!==0&&(r[0]===jt.COMMON||r[0]===jt.ORGANIZATIONS)&&(r[0]=e),j.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw ne(Qn);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let o=r.AbsolutePath.split("/");return o=o.filter(i=>i&&i.length>0),r.PathSegments=o,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw ne(Qn);return r[2]}static getAbsoluteUrl(e,t){if(e[0]===C.FORWARD_SLASH){const o=new j(t).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new j(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!Qr(e)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Yl={endpointMetadata:{"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},La=Yl.endpointMetadata,ds=Yl.instanceDiscoveryMetadata,Ql=new Set;ds.metadata.forEach(n=>{n.aliases.forEach(e=>{Ql.add(e)})});function Ng(n,e){var o;let t;const r=n.canonicalAuthority;if(r){const i=new j(r).getUrlComponents().HostNameAndPort;t=Ua(i,(o=n.cloudDiscoveryMetadata)==null?void 0:o.metadata,je.CONFIG,e)||Ua(i,ds.metadata,je.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function Ua(n,e,t,r){if(r==null||r.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const o=Jr(e,n);if(o)return r==null||r.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${t}, returning aliases`),o.aliases;r==null||r.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${t}`)}return null}function Mg(n){return Jr(ds.metadata,n)}function Jr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(r.aliases.includes(e))return r}return null}/*! @azure/msal-common v15.4.0 2025-03-25 */const Jl="cache_quota_exceeded",hs="cache_error_unknown";/*! @azure/msal-common v15.4.0 2025-03-25 */const Zo={[Jl]:"Exceeded cache storage capacity.",[hs]:"Unexpected error occurred when using cache storage."};class xn extends Error{constructor(e,t){const r=t||(Zo[e]?Zo[e]:Zo[hs]);super(`${e}: ${r}`),Object.setPrototypeOf(this,xn.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}/*! @azure/msal-common v15.4.0 2025-03-25 */class yi{constructor(e,t,r,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Rl,os),this.staticAuthorityOptions=o}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.sort(o=>o.idTokenClaims?-1:1)[0]:t.length===1?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap(r=>this.getTenantProfilesFromAccountEntity(r,t==null?void 0:t.tenantId,t))}getTenantedAccountInfoByFilter(e,t,r,o){let i=null,s;if(o&&!this.tenantProfileMatchesFilter(r,o))return null;const a=this.getIdToken(e,t,r.tenantId);return a&&(s=Jt(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(s,o))?null:(i=ls(e,r,s,a==null?void 0:a.secret),i)}getTenantProfilesFromAccountEntity(e,t,r){const o=e.getAccountInfo();let i=o.tenantProfiles||new Map;const s=this.getTokenKeys();if(t){const c=i.get(t);if(c)i=new Map([[t,c]]);else return[]}const a=[];return i.forEach(c=>{const l=this.getTenantedAccountInfoByFilter(o,s,c,r);l&&a.push(l)}),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId)||t.name&&e.name!==t.name||t.isHomeTenant!==void 0&&e.isHomeTenant!==t.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,t){return!(t&&(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId)||t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint)||t.username&&!this.matchUsername(e.preferred_username,t.username)||t.name&&!this.matchName(e,t.name)||t.sid&&!this.matchSid(e,t.sid)))}async saveCacheRecord(e,t,r){var o,i,s,a;if(!e)throw w(vl);try{e.account&&await this.setAccount(e.account,t),e.idToken&&(r==null?void 0:r.idToken)!==!1&&await this.setIdTokenCredential(e.idToken,t),e.accessToken&&(r==null?void 0:r.accessToken)!==!1&&await this.saveAccessToken(e.accessToken,t),e.refreshToken&&(r==null?void 0:r.refreshToken)!==!1&&await this.setRefreshTokenCredential(e.refreshToken,t),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(c){throw(o=this.commonLogger)==null||o.error("CacheManager.saveCacheRecord: failed"),c instanceof Error?((i=this.commonLogger)==null||i.errorPii(`CacheManager.saveCacheRecord: ${c.message}`,t),c.name==="QuotaExceededError"||c.name==="NS_ERROR_DOM_QUOTA_REACHED"||c.message.includes("exceeded the quota")?((s=this.commonLogger)==null||s.error("CacheManager.saveCacheRecord: exceeded storage quota",t),new xn(Jl)):new xn(c.name,c.message)):((a=this.commonLogger)==null||a.errorPii(`CacheManager.saveCacheRecord: ${c}`,t),new xn(hs))}}async saveAccessToken(e,t){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},o=this.getTokenKeys(),i=ue.fromString(e.target),s=[];o.accessToken.forEach(a=>{if(!this.accessTokenKeyMatchesFilter(a,r,!1))return;const c=this.getAccessTokenCredential(a);c&&this.credentialMatchesFilter(c,r)&&ue.fromString(c.target).intersectingScopeSets(i)&&s.push(this.removeAccessToken(a))}),await Promise.all(s),await this.setAccessTokenCredential(e,t)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),r=[];return t.forEach(o=>{var c;if(!this.isAccountKey(o,e.homeAccountId))return;const i=this.getAccount(o,this.commonLogger);if(!i||e.homeAccountId&&!this.matchHomeAccountId(i,e.homeAccountId)||e.username&&!this.matchUsername(i.username,e.username)||e.environment&&!this.matchEnvironment(i,e.environment)||e.realm&&!this.matchRealm(i,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(i,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(i,e.authorityType))return;const s={localAccountId:e==null?void 0:e.localAccountId,name:e==null?void 0:e.name},a=(c=i.tenantProfiles)==null?void 0:c.filter(l=>this.tenantProfileMatchesFilter(l,s));a&&a.length===0||r.push(i)}),r}isAccountKey(e,t,r){return!(e.split(Se.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||r&&!e.toLowerCase().includes(r.toLowerCase()))}isCredentialKey(e){if(e.split(Se.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(K.ID_TOKEN.toLowerCase())===-1&&t.indexOf(K.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(K.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(K.REFRESH_TOKEN.toLowerCase())>-1){const r=`${K.REFRESH_TOKEN}${Se.CACHE_KEY_SEPARATOR}${this.clientId}${Se.CACHE_KEY_SEPARATOR}`,o=`${K.REFRESH_TOKEN}${Se.CACHE_KEY_SEPARATOR}${rr}${Se.CACHE_KEY_SEPARATOR}`;if(t.indexOf(r.toLowerCase())===-1&&t.indexOf(o.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0}credentialMatchesFilter(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===K.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===J.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))}getAppMetadataFilteredBy(e){const t=this.getKeys(),r={};return t.forEach(o=>{if(!this.isAppMetadata(o))return;const i=this.getAppMetadata(o);i&&(e.environment&&!this.matchEnvironment(i,e.environment)||e.clientId&&!this.matchClientId(i,e.clientId)||(r[o]=i))}),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let r=null;return t.forEach(o=>{if(!this.isAuthorityMetadata(o)||o.indexOf(this.clientId)===-1)return;const i=this.getAuthorityMetadata(o);i&&i.aliases.indexOf(e)!==-1&&(r=i)}),r}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(r=>{t.push(this.removeAccount(r))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),r=e.generateAccountId(),o=[];t.idToken.forEach(i=>{i.indexOf(r)===0&&this.removeIdToken(i)}),t.accessToken.forEach(i=>{i.indexOf(r)===0&&o.push(this.removeAccessToken(i))}),t.refreshToken.forEach(i=>{i.indexOf(r)===0&&this.removeRefreshToken(i)}),await Promise.all(o)}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===K.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===J.POP){const o=t.keyId;if(o)try{await this.cryptoImpl.removeTokenBindingKey(o)}catch{throw w(_l)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(t=>{this.isAppMetadata(t)&&this.removeItem(t)}),!0}readAccountFromCache(e){const t=ke.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,r,o,i){this.commonLogger.trace("CacheManager - getIdToken called");const s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:K.ID_TOKEN,clientId:this.clientId,realm:r},a=this.getIdTokensByFilter(s,t),c=a.size;if(c<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(c>1){let l=a;if(!r){const d=new Map;a.forEach((p,y)=>{p.realm===e.tenantId&&d.set(y,p)});const h=d.size;if(h<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(h===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),d.values().next().value;l=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),l.forEach((d,h)=>{this.removeIdToken(h)}),o&&i&&o.addFields({multiMatchedID:a.size},i),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const r=t&&t.idToken||this.getTokenKeys().idToken,o=new Map;return r.forEach(i=>{if(!this.idTokenKeyMatchesFilter(i,{clientId:this.clientId,...e}))return;const s=this.getIdTokenCredential(i);s&&this.credentialMatchesFilter(s,e)&&o.set(i,s)}),o}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return!(t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1)}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,r,o,i,s){this.commonLogger.trace("CacheManager - getAccessToken called");const a=ue.createSearchScopes(t.scopes),c=t.authenticationScheme||J.BEARER,l=c.toLowerCase()!==J.BEARER.toLowerCase()?K.ACCESS_TOKEN_WITH_AUTH_SCHEME:K.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:l,clientId:this.clientId,realm:o||e.tenantId,target:a,tokenType:c,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},h=r&&r.accessToken||this.getTokenKeys().accessToken,p=[];h.forEach(k=>{if(this.accessTokenKeyMatchesFilter(k,d,!0)){const b=this.getAccessTokenCredential(k);b&&this.credentialMatchesFilter(b,d)&&p.push(b)}});const y=p.length;return y<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):y>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),p.forEach(k=>{this.removeAccessToken(ir(k))}),i&&s&&i.addFields({multiMatchedAT:p.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),p[0])}accessTokenKeyMatchesFilter(e,t,r){const o=e.toLowerCase();if(t.clientId&&o.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&o.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&o.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&o.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target){const i=t.target.asArray();for(let s=0;s<i.length;s++){if(r&&!o.includes(i[s].toLowerCase()))return!1;if(!r&&o.includes(i[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),r=[];return t.accessToken.forEach(o=>{if(!this.accessTokenKeyMatchesFilter(o,e,!0))return;const i=this.getAccessTokenCredential(o);i&&this.credentialMatchesFilter(i,e)&&r.push(i)}),r}getRefreshToken(e,t,r,o,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const s=t?rr:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:K.REFRESH_TOKEN,clientId:this.clientId,familyId:s},c=r&&r.refreshToken||this.getTokenKeys().refreshToken,l=[];c.forEach(h=>{if(this.refreshTokenKeyMatchesFilter(h,a)){const p=this.getRefreshTokenCredential(h);p&&this.credentialMatchesFilter(p,a)&&l.push(p)}});const d=l.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(d>1&&o&&i&&o.addFields({multiMatchedRT:d},i),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),l[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return!(t.familyId&&r.indexOf(t.familyId.toLowerCase())===-1||!t.familyId&&t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(t),o=Object.keys(r).map(s=>r[s]),i=o.length;if(i<1)return null;if(i>1)throw w(yl);return o[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===rr)}matchHomeAccountId(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,t){const r=e.oid||e.sub;return t===r}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){var r;return t.toLowerCase()===((r=e.name)==null?void 0:r.toLowerCase())}matchUsername(e,t){return!!(e&&typeof e=="string"&&(t==null?void 0:t.toLowerCase())===e.toLowerCase())}matchUserAssertionHash(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const o=Ng(this.staticAuthorityOptions,this.commonLogger);if(o.includes(t)&&o.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!!(e.clientId&&t===e.clientId)}matchFamilyId(e,t){return!!(e.familyId&&t===e.familyId)}matchRealm(e,t){var r;return((r=e.realm)==null?void 0:r.toLowerCase())===t.toLowerCase()}matchNativeAccountId(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||e.preferred_username===t||e.upn===t}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!!(e.authorityType&&t.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,t){return e.credentialType!==K.ACCESS_TOKEN&&e.credentialType!==K.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:ue.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!!(e.tokenType&&e.tokenType===t)}matchKeyId(e,t){return!!(e.keyId&&e.keyId===t)}isAppMetadata(e){return e.indexOf(Qi)!==-1}isAuthorityMetadata(e){return e.indexOf(qr.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${qr.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class xg extends yi{async setAccount(){throw w(z)}getAccount(){throw w(z)}async setIdTokenCredential(){throw w(z)}getIdTokenCredential(){throw w(z)}async setAccessTokenCredential(){throw w(z)}getAccessTokenCredential(){throw w(z)}async setRefreshTokenCredential(){throw w(z)}getRefreshTokenCredential(){throw w(z)}setAppMetadata(){throw w(z)}getAppMetadata(){throw w(z)}setServerTelemetry(){throw w(z)}getServerTelemetry(){throw w(z)}setAuthorityMetadata(){throw w(z)}getAuthorityMetadata(){throw w(z)}getAuthorityMetadataKeys(){throw w(z)}setThrottlingCache(){throw w(z)}getThrottlingCache(){throw w(z)}removeItem(){throw w(z)}getKeys(){throw w(z)}getAccountKeys(){throw w(z)}getTokenKeys(){throw w(z)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Xl={tokenRenewalOffsetSeconds:rg,preventCorsPreflight:!1},Hg={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:de.Info,correlationId:C.EMPTY_STRING},Lg={claimsBasedCachingEnabled:!1},Ug={async sendGetRequestAsync(){throw w(z)},async sendPostRequestAsync(){throw w(z)}},Dg={sku:C.SKU,version:os,cpu:C.EMPTY_STRING,os:C.EMPTY_STRING},Fg={clientSecret:C.EMPTY_STRING,clientAssertion:void 0},Bg={azureCloudInstance:is.None,tenant:`${C.DEFAULT_COMMON_TENANT}`},Kg={application:{appName:"",appVersion:""}};function Gg({authOptions:n,systemOptions:e,loggerOptions:t,cacheOptions:r,storageInterface:o,networkInterface:i,cryptoInterface:s,clientCredentials:a,libraryInfo:c,telemetry:l,serverTelemetryManager:d,persistencePlugin:h,serializableCache:p}){const y={...Hg,...t};return{authOptions:$g(n),systemOptions:{...Xl,...e},loggerOptions:y,cacheOptions:{...Lg,...r},storageInterface:o||new xg(n.clientId,ur,new Lt(y)),networkInterface:i||Ug,cryptoInterface:s||ur,clientCredentials:a||Fg,libraryInfo:{...Dg,...c},telemetry:{...Kg,...l},serverTelemetryManager:d||null,persistencePlugin:h||null,serializableCache:p||null}}function $g(n){return{clientCapabilities:[],azureCloudOptions:Bg,skipAuthorityMetadataCache:!1,instanceAware:!1,...n}}function Zl(n){return n.authOptions.authority.options.protocolMode===He.OIDC}/*! @azure/msal-common v15.4.0 2025-03-25 */const ot={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v15.4.0 2025-03-25 */const gn="client_id",ed="redirect_uri",zg="response_type",qg="response_mode",Vg="grant_type",jg="claims",Wg="scope",Yg="refresh_token",Qg="state",Jg="nonce",Xg="prompt",Zg="code",ep="code_challenge",tp="code_challenge_method",np="code_verifier",rp="client-request-id",op="x-client-SKU",ip="x-client-VER",sp="x-client-OS",ap="x-client-CPU",cp="x-client-current-telemetry",lp="x-client-last-telemetry",dp="x-ms-lib-capability",hp="x-app-name",up="x-app-ver",fp="post_logout_redirect_uri",gp="id_token_hint",pp="client_secret",mp="client_assertion",Cp="client_assertion_type",td="token_type",nd="req_cnf",Da="return_spa_code",yp="nativebroker",Tp="logout_hint",Ap="sid",wp="login_hint",vp="domain_hint",Ip="x-client-xtra-sku",Xr="brk_client_id",Zr="brk_redirect_uri",Ti="instance_aware",Ep="ear_jwk",_p="ear_jwe_crypto";/*! @azure/msal-common v15.4.0 2025-03-25 */function Eo(n,e,t){if(!e)return;const r=n.get(gn);r&&n.has(Xr)&&(t==null||t.addFields({embeddedClientId:r,embeddedRedirectUri:n.get(ed)},e))}function rd(n,e){n.set(zg,e)}function Sp(n,e){n.set(qg,e||eg.QUERY)}function bp(n){n.set(yp,"1")}function us(n,e,t=!0,r=yn){t&&!r.includes("openid")&&!e.includes("openid")&&r.push("openid");const o=t?[...e||[],...r]:e||[],i=new ue(o);n.set(Wg,i.printScopes())}function fs(n,e){n.set(gn,e)}function gs(n,e){n.set(ed,e)}function kp(n,e){n.set(fp,e)}function Rp(n,e){n.set(gp,e)}function Op(n,e){n.set(vp,e)}function Rr(n,e){n.set(wp,e)}function eo(n,e){n.set(Pe.CCS_HEADER,`UPN:${e}`)}function sr(n,e){n.set(Pe.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function Fa(n,e){n.set(Ap,e)}function ps(n,e,t){const r=dd(e,t);try{JSON.parse(r)}catch{throw ne(Ao)}n.set(jg,r)}function ms(n,e){n.set(rp,e)}function Cs(n,e){n.set(op,e.sku),n.set(ip,e.version),e.os&&n.set(sp,e.os),e.cpu&&n.set(ap,e.cpu)}function ys(n,e){e!=null&&e.appName&&n.set(hp,e.appName),e!=null&&e.appVersion&&n.set(up,e.appVersion)}function Pp(n,e){n.set(Xg,e)}function od(n,e){e&&n.set(Qg,e)}function Np(n,e){n.set(Jg,e)}function Mp(n,e,t){if(e&&t)n.set(ep,e),n.set(tp,t);else throw ne(wo)}function xp(n,e){n.set(Zg,e)}function Hp(n,e){n.set(Yg,e)}function Lp(n,e){n.set(np,e)}function id(n,e){n.set(pp,e)}function sd(n,e){e&&n.set(mp,e)}function ad(n,e){e&&n.set(Cp,e)}function cd(n,e){n.set(Vg,e)}function Ts(n){n.set(tg,"1")}function ld(n){n.has(Ti)||n.set(Ti,"true")}function hn(n,e){Object.entries(e).forEach(([t,r])=>{!n.has(t)&&r&&n.set(t,r)})}function dd(n,e){let t;if(!n)t={};else try{t=JSON.parse(n)}catch{throw ne(Ao)}return e&&e.length>0&&(t.hasOwnProperty(_r.ACCESS_TOKEN)||(t[_r.ACCESS_TOKEN]={}),t[_r.ACCESS_TOKEN][_r.XMS_CC]={values:e}),JSON.stringify(t)}function As(n,e){e&&(n.set(td,J.POP),n.set(nd,e))}function hd(n,e){e&&(n.set(td,J.SSH),n.set(nd,e))}function ud(n,e){n.set(cp,e.generateCurrentRequestHeaderValue()),n.set(lp,e.generateLastRequestHeaderValue())}function fd(n){n.set(dp,or.X_MS_LIB_CAPABILITY_VALUE)}function Up(n,e){n.set(Tp,e)}function _o(n,e,t){n.has(Xr)||n.set(Xr,e),n.has(Zr)||n.set(Zr,t)}function Dp(n,e){n.set(Ep,encodeURIComponent(e)),n.set(_p,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Fp(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Bp(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v15.4.0 2025-03-25 */function Kp(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v15.4.0 2025-03-25 */const f={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",NetworkClientSendPostRequestAsync:"networkClientSendPostRequestAsync",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",InitializeCache:"initializeCache",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",GetAuthCodeUrl:"getAuthCodeUrl",GetStandardParams:"getStandardParams",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",HandleResponseEar:"handleResponseEar",HandleResponsePlatformBroker:"handleResponsePlatformBroker",HandleResponseCode:"handleResponseCode",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",ImportExistingCache:"importExistingCache",SetUserData:"setUserData",LocalStorageUpdated:"localStorageUpdated",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues",GenerateHKDF:"generateHKDF",GenerateBaseKey:"generateBaseKey",Base64Decode:"base64Decode",UrlEncodeArr:"urlEncodeArr",Encrypt:"encrypt",Decrypt:"decrypt",GenerateEarKey:"generateEarKey",DecryptEarResponse:"decryptEarResponse"},Gp={InProgress:1};/*! @azure/msal-common v15.4.0 2025-03-25 */const ct=(n,e,t,r,o)=>(...i)=>{t.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const a=e+"CallCount";r==null||r.incrementFields({[a]:1},o)}try{const a=n(...i);return s==null||s.end({success:!0}),t.trace(`Returning result from ${e}`),a}catch(a){t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1},a),a}},T=(n,e,t,r,o)=>(...i)=>{t.trace(`Executing function ${e}`);const s=r==null?void 0:r.startMeasurement(e,o);if(o){const a=e+"CallCount";r==null||r.incrementFields({[a]:1},o)}return r==null||r.setPreQueueTime(e,o),n(...i).then(a=>(t.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),a)).catch(a=>{t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1},a),a})};/*! @azure/msal-common v15.4.0 2025-03-25 */class So{constructor(e,t,r,o){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=o}async detectRegion(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.RegionDiscoveryDetectRegion,this.correlationId);let r=e;if(r)t.region_source=vn.ENVIRONMENT_VARIABLE;else{const i=So.IMDS_OPTIONS;try{const s=await T(this.getRegionFromIMDS.bind(this),f.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(C.IMDS_VERSION,i);if(s.status===br.httpSuccess&&(r=s.body,t.region_source=vn.IMDS),s.status===br.httpBadRequest){const a=await T(this.getCurrentVersion.bind(this),f.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(i);if(!a)return t.region_source=vn.FAILED_AUTO_DETECTION,null;const c=await T(this.getRegionFromIMDS.bind(this),f.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,i);c.status===br.httpSuccess&&(r=c.body,t.region_source=vn.IMDS)}}catch{return t.region_source=vn.FAILED_AUTO_DETECTION,null}}return r||(t.region_source=vn.FAILED_AUTO_DETECTION),r||null}async getRegionFromIMDS(e,t){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(f.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${C.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,C.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(f.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${C.IMDS_ENDPOINT}?format=json`,e);return r.status===br.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}}So.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v15.4.0 2025-03-25 */class Ie{constructor(e,t,r,o,i,s,a,c){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=i,this.performanceClient=a,this.correlationId=s,this.managedIdentity=c||!1,this.regionDiscovery=new So(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(C.CIAM_AUTH_URL))return rt.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case C.ADFS:return rt.Adfs;case C.DSTS:return rt.Dsts}return rt.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new j(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw w(Pt)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw w(Pt)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw w(Pt)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw w(Sl);return this.replacePath(this.metadata.end_session_endpoint)}else throw w(Pt)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw w(Pt)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw w(Pt)}canReplaceTenant(e){return e.PathSegments.length===1&&!Ie.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===rt.Default&&this.protocolMode!==He.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const o=new j(this.metadata.canonical_authority).getUrlComponents(),i=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,c)=>{let l=i[c];if(c===0&&this.canReplaceTenant(o)){const d=new j(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];l!==d&&(this.logger.verbose(`Replacing tenant domain name ${l} with id ${d}`),l=d)}a!==l&&(t=t.replace(`/${l}/`,`/${a}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===rt.Adfs||this.protocolMode===He.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await T(this.updateCloudDiscoveryMetadata.bind(this),f.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await T(this.updateEndpointMetadata.bind(this),f.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),(i=this.performanceClient)==null||i.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Ma(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==je.CACHE&&(r==null?void 0:r.source)!==je.CACHE&&(e.expiresAt=Ma(),e.canonical_authority=this.canonicalAuthority);const o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(o,e),this.metadata=e}async updateEndpointMetadata(e){var o,i,s;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===je.HARDCODED_VALUES&&(i=this.authorityOptions.azureRegionConfiguration)!=null&&i.azureRegion&&t.metadata){const a=await T(this.updateMetadataWithRegionalInformation.bind(this),f.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);kr(e,a,!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await T(this.getEndpointMetadataFromNetwork.bind(this),f.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(r=await T(this.updateMetadataWithRegionalInformation.bind(this),f.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),kr(e,r,!0),je.NETWORK;throw w(fl,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),kr(e,t,!1),{source:je.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const o=this.getEndpointMetadataFromHardcodedValues();if(o)return kr(e,o,!1),{source:je.HARDCODED_VALUES,metadata:o};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=xa(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:je.CACHE}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new j(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw ne(Kl)}return null}async getEndpointMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(f.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const o=await this.networkInterface.sendGetRequestAsync(t,e);return Fp(o.body)?o.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(o){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${o}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in La?La[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){var r,o,i;(r=this.performanceClient)==null||r.addQueueMeasurement(f.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.azureRegion;if(t){if(t!==C.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=Jo.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,Ie.replaceWithRegionalInformation(e,t);const s=await T(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),f.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((i=this.authorityOptions.azureRegionConfiguration)==null?void 0:i.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=Jo.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,Ie.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=Jo.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await T(this.getCloudDiscoveryMetadataFromNetwork.bind(this),f.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return Xo(e,r,!0),je.NETWORK;throw ne(Gl)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||C.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||C.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||C.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Xo(e,t,!1),je.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const o=Mg(this.hostnameAndPort);if(o)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Xo(e,o,!1),je.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const r=xa(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!r?(this.logger.verbose("Found cloud discovery metadata in the cache."),je.CACHE):(r&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===rt.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Ie.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=Jr(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),ne(as)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Ie.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${C.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,t);let s,a;if(Bp(i.body))s=i.body,a=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(Kp(i.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${i.status}`),s=i.body,s.error===C.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=Jr(a,this.hostnameAndPort)}catch(i){if(i instanceof X)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
-Error: ${i.errorCode}
-Error Description: ${i.errorMessage}`);else{const s=i;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
-Error: ${s.name}
-Error Description: ${s.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Ie.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&j.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==is.None){const o=t.tenant?t.tenant:C.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return C.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw w(Pt)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Ql.has(e)}static isPublicCloudAuthority(e){return C.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new j(e);o.validateAsUri();const i=o.getUrlComponents();let s=`${t}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(s=`${t}.${C.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=j.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:s}).urlString;return r?`${a}?${r}`:a}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Ie.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Ie.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Ie.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new j(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(C.CIAM_AUTH_URL)){const i=o.HostNameAndPort.split(".")[0];t=`${t}${i}${C.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Ie.reservedTenantDomains=new Set(["{tenant}","{tenantid}",jt.COMMON,jt.CONSUMERS,jt.ORGANIZATIONS]);function $p(n){var o;const r=(o=new j(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case jt.COMMON:case jt.ORGANIZATIONS:case jt.CONSUMERS:return;default:return r}}function gd(n){return n.endsWith(C.FORWARD_SLASH)?n:`${n}${C.FORWARD_SLASH}`}function pd(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw ne(as)}return{canonicalAuthority:n.authority?gd(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v15.4.0 2025-03-25 */async function md(n,e,t,r,o,i,s){s==null||s.addQueueMeasurement(f.AuthorityFactoryCreateDiscoveredInstance,i);const a=Ie.transformCIAMAuthority(gd(n)),c=new Ie(a,e,t,r,o,i,s);try{return await T(c.resolveEndpointsAsync.bind(c),f.AuthorityResolveEndpointsAsync,o,s,i)(),c}catch{throw w(Pt)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class nn extends X{constructor(e,t,r,o,i){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=i,Object.setPrototypeOf(this,nn.prototype)}}/*! @azure/msal-common v15.4.0 2025-03-25 */function bo(n,e,t){var r;return{clientId:n,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:t,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||((r=e.tokenBodyParameters)==null?void 0:r.clientId)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ct{static generateThrottlingStorageKey(e){return`${or.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var i;const r=Ct.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r);return}throw new nn(((i=o.errorCodes)==null?void 0:i.join(" "))||C.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(Ct.checkResponseStatus(r)||Ct.checkResponseForRetryAfter(r)){const o={throttleTime:Ct.calculateThrottleTime(parseInt(r.headers[Pe.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Ct.generateThrottlingStorageKey(t),o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Pe.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||or.DEFAULT_THROTTLE_TIME_SECONDS),r+or.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const i=bo(t,r,o),s=this.generateThrottlingStorageKey(i);e.removeItem(s)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class ko extends X{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,ko.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function Ba(n,e,t){return new ko(n,e,t)}/*! @azure/msal-common v15.4.0 2025-03-25 */class ws{constructor(e,t){this.config=Gg(e),this.logger=new Lt(this.config.loggerOptions,Rl,os),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Pe.CONTENT_TYPE]=C.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case ot.HOME_ACCOUNT_ID:try{const r=Mn(e.credential);t[Pe.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case ot.UPN:t[Pe.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,i,s){var c;s&&((c=this.performanceClient)==null||c.addQueueMeasurement(s,i));const a=await this.sendPostRequest(o,e,{body:t,headers:r},i);return this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async sendPostRequest(e,t,r,o){var s,a,c;Ct.preProcess(this.cacheManager,e);let i;try{i=await T(this.networkClient.sendPostRequestAsync.bind(this.networkClient),f.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const l=i.headers||{};(a=this.performanceClient)==null||a.addFields({refreshTokenSize:((s=i.body.refresh_token)==null?void 0:s.length)||0,httpVerToken:l[Pe.X_MS_HTTP_VERSION]||"",requestId:l[Pe.X_MS_REQUEST_ID]||""},o)}catch(l){if(l instanceof ko){const d=l.responseHeaders;throw d&&((c=this.performanceClient)==null||c.addFields({httpVerToken:d[Pe.X_MS_HTTP_VERSION]||"",requestId:d[Pe.X_MS_REQUEST_ID]||"",contentTypeHeader:d[Pe.CONTENT_TYPE]||void 0,contentLengthHeader:d[Pe.CONTENT_LENGTH]||void 0,httpStatus:l.httpStatus},o)),l.error}throw l instanceof X?l:w(ul)}return Ct.postProcess(this.cacheManager,e,i),i}async updateAuthority(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(f.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await md(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new Map;return e.embeddedClientId&&_o(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&hn(t,e.tokenQueryParameters),ms(t,e.correlationId),Eo(t,e.correlationId,this.performanceClient),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const to="no_tokens_found",Cd="native_account_unavailable",vs="refresh_token_expired",zp="interaction_required",qp="consent_required",Vp="login_required",Ro="bad_token";/*! @azure/msal-common v15.4.0 2025-03-25 */const Ka=[zp,qp,Vp,Ro],jp=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],Wp={[to]:"No refresh token found in the cache. Please sign-in.",[Cd]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[vs]:"Refresh token has expired.",[Ro]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class tt extends X{constructor(e,t,r,o,i,s,a,c){super(e,t,r),Object.setPrototypeOf(this,tt.prototype),this.timestamp=o||C.EMPTY_STRING,this.traceId=i||C.EMPTY_STRING,this.correlationId=s||C.EMPTY_STRING,this.claims=a||C.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function yd(n,e,t){const r=!!n&&Ka.indexOf(n)>-1,o=!!t&&jp.indexOf(t)>-1,i=!!e&&Ka.some(s=>e.indexOf(s)>-1);return r||i||o}function Ai(n){return new tt(n,Wp[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */class Fn{static setRequestState(e,t,r){const o=Fn.generateLibraryState(e,r);return t?`${o}${C.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw w(pi);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw w(pi);if(!t)throw w(Ln);try{const r=t.split(C.RESOURCE_DELIM),o=r[0],i=r.length>1?r.slice(1).join(C.RESOURCE_DELIM):C.EMPTY_STRING,s=e.base64Decode(o),a=JSON.parse(s);return{userRequestState:i||C.EMPTY_STRING,libraryState:a}}catch{throw w(Ln)}}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Yp={SW:"sw"};class Un{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(f.PopTokenGenerateCnf,e.correlationId);const r=await T(this.generateKid.bind(this),f.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(f.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Yp.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:i,resourceRequestUri:s,shrClaims:a,shrNonce:c,shrOptions:l}=r,d=s?new j(s):void 0,h=d==null?void 0:d.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:Ue(),m:i==null?void 0:i.toUpperCase(),u:h==null?void 0:h.HostNameAndPort,nonce:c||this.cryptoUtils.createNewGuid(),p:h==null?void 0:h.AbsolutePath,q:h!=null&&h.QueryString?[[],h.QueryString]:void 0,client_claims:a||void 0,...o},t,l,r.correlationId)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class Qp{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v15.4.0 2025-03-25 */class pn{constructor(e,t,r,o,i,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=i,this.persistencePlugin=s,this.performanceClient=a}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||C.NOT_AVAILABLE} - Timestamp: ${e.timestamp||C.NOT_AVAILABLE} - Description: ${e.error_description||C.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||C.NOT_AVAILABLE} - Trace ID: ${e.trace_id||C.NOT_AVAILABLE}`,i=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,s=new nn(e.error,o,e.suberror,i,e.status);if(t&&e.status&&e.status>=Er.SERVER_ERROR_RANGE_START&&e.status<=Er.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
-${s}`);return}else if(t&&e.status&&e.status>=Er.CLIENT_ERROR_RANGE_START&&e.status<=Er.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
-${s}`);return}throw yd(e.error,e.error_description,e.suberror)?new tt(e.error,e.error_description,e.suberror,e.timestamp||C.EMPTY_STRING,e.trace_id||C.EMPTY_STRING,e.correlation_id||C.EMPTY_STRING,e.claims||C.EMPTY_STRING,i):s}}async handleServerTokenResponse(e,t,r,o,i,s,a,c,l){var k;(k=this.performanceClient)==null||k.addQueueMeasurement(f.HandleServerTokenResponse,e.correlation_id);let d;if(e.id_token){if(d=Jt(e.id_token||C.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&d.nonce!==i.nonce)throw w(ml);if(o.maxAge||o.maxAge===0){const b=d.auth_time;if(!b)throw w(es);Ol(b,o.maxAge)}}this.homeAccountIdentifier=ke.generateHomeAccountId(e.client_info||C.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,d);let h;i&&i.state&&(h=Fn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,d,s,i);let y;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),y=new Qp(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(y)),a&&!c&&p.account){const b=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(b))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await pn.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,d,h,void 0,l)}await this.cacheStorage.saveCacheRecord(p,o.correlationId,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&y&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(y))}return pn.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,d,h,e,l)}generateCacheRecord(e,t,r,o,i,s,a){const c=t.getPreferredCache();if(!c)throw w(ns);const l=jl(i);let d,h;e.id_token&&i&&(d=yo(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),h=Is(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,i,e.client_info,c,l,a,void 0,this.logger));let p=null;if(e.access_token){const b=e.scope?ue.fromString(e.scope):new ue(o.scopes||[]),$=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,D=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,q=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,W=r+$,x=W+D,ie=q&&q>0?r+q:void 0;p=To(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||t.tenant||"",b.printScopes(),W,x,this.cryptoObj.base64Decode,ie,e.token_type,s,e.key_id,o.claims,o.requestedClaimsHash)}let y=null;if(e.refresh_token){let b;if(e.refresh_token_expires_in){const $=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;b=r+$}y=Nl(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,b)}let k=null;return e.foci&&(k={clientId:this.clientId,environment:c,familyId:e.foci}),{account:h,idToken:d,accessToken:p,refreshToken:y,appMetadata:k}}static async generateAuthenticationResult(e,t,r,o,i,s,a,c,l){var W,x,ie,Be,ve;let d=C.EMPTY_STRING,h=[],p=null,y,k,b=C.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===J.POP&&!i.popKid){const Je=new Un(e),{secret:Dt,keyId:Ke}=r.accessToken;if(!Ke)throw w(rs);d=await Je.signPopToken(Dt,Ke,i)}else d=r.accessToken.secret;h=ue.fromString(r.accessToken.target).asArray(),p=Ht(r.accessToken.expiresOn),y=Ht(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(k=Ht(r.accessToken.refreshOn))}r.appMetadata&&(b=r.appMetadata.familyId===rr?rr:"");const $=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",D=(s==null?void 0:s.tid)||"";c!=null&&c.spa_accountid&&r.account&&(r.account.nativeAccountId=c==null?void 0:c.spa_accountid);const q=r.account?ls(r.account.getAccountInfo(),void 0,s,(W=r.idToken)==null?void 0:W.secret):null;return{authority:t.canonicalAuthority,uniqueId:$,tenantId:D,scopes:h,account:q,idToken:((x=r==null?void 0:r.idToken)==null?void 0:x.secret)||"",idTokenClaims:s||{},accessToken:d,fromCache:o,expiresOn:p,extExpiresOn:y,refreshOn:k,correlationId:i.correlationId,requestId:l||C.EMPTY_STRING,familyId:b,tokenType:((ie=r.accessToken)==null?void 0:ie.tokenType)||C.EMPTY_STRING,state:a?a.userRequestState:C.EMPTY_STRING,cloudGraphHostName:((Be=r.account)==null?void 0:Be.cloudGraphHostName)||C.EMPTY_STRING,msGraphHost:((ve=r.account)==null?void 0:ve.msGraphHost)||C.EMPTY_STRING,code:c==null?void 0:c.spa_code,fromNativeBroker:!1}}}function Is(n,e,t,r,o,i,s,a,c,l,d){d==null||d.verbose("setCachedAccount called");const p=n.getAccountKeys().find(D=>D.startsWith(t));let y=null;p&&(y=n.getAccount(p));const k=y||ke.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:i,environment:s,cloudGraphHostName:c==null?void 0:c.cloud_graph_host_name,msGraphHost:c==null?void 0:c.msgraph_host,nativeAccountId:l},e,r),b=k.tenantProfiles||[],$=a||k.realm;if($&&!b.find(D=>D.tenantId===$)){const D=Io(t,k.localAccountId,$,o);b.push(D)}return k.tenantProfiles=b,k}/*! @azure/msal-common v15.4.0 2025-03-25 */class Jp{static validateRedirectUri(e){if(!e)throw ne(Ml)}static validatePrompt(e){const t=[];for(const r in Ae)t.push(Ae[r]);if(t.indexOf(e)<0)throw ne(Ul)}static validateClaims(e){try{JSON.parse(e)}catch{throw ne(Ao)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw ne(wo);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([ka.PLAIN,ka.S256].indexOf(e)<0)throw ne(Bl)}}/*! @azure/msal-common v15.4.0 2025-03-25 */async function Td(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v15.4.0 2025-03-25 */class Ad extends ws{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async acquireToken(e,t){var a,c;if((a=this.performanceClient)==null||a.addQueueMeasurement(f.AuthClientAcquireToken,e.correlationId),!e.code)throw w(Tl);const r=Ue(),o=await T(this.executeTokenRequest.bind(this),f.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),i=(c=o.headers)==null?void 0:c[Pe.X_MS_REQUEST_ID],s=new pn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(o.body),T(s.handleServerTokenResponse.bind(s),f.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,i)}getLogoutUri(e){if(!e)throw ne(Fl);const t=this.createLogoutUrlQueryString(e);return j.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var l;(l=this.performanceClient)==null||l.addQueueMeasurement(f.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=j.appendQueryString(e.tokenEndpoint,r),i=await T(this.createTokenRequestBody.bind(this),f.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=Yr(t.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${d.uid}${Se.CLIENT_INFO_SEPARATOR}${d.utid}`,type:ot.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),c=bo(this.config.authOptions.clientId,t);return T(this.executePostToTokenEndpoint.bind(this),f.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,i,a,c,t.correlationId,f.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,i;(o=this.performanceClient)==null||o.addQueueMeasurement(f.AuthClientCreateTokenRequestBody,e.correlationId);const t=new Map;if(fs(t,e.embeddedClientId||((i=e.tokenBodyParameters)==null?void 0:i[gn])||this.config.authOptions.clientId),this.includeRedirectUri?gs(t,e.redirectUri):Jp.validateRedirectUri(e.redirectUri),us(t,e.scopes,!0,this.oidcDefaultScopes),xp(t,e.code),Cs(t,this.config.libraryInfo),ys(t,this.config.telemetry.application),fd(t),this.serverTelemetryManager&&!Zl(this.config)&&ud(t,this.serverTelemetryManager),e.codeVerifier&&Lp(t,e.codeVerifier),this.config.clientCredentials.clientSecret&&id(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;sd(t,await Td(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),ad(t,s.assertionType)}if(cd(t,ll.AUTHORIZATION_CODE_GRANT),Ts(t),e.authenticationScheme===J.POP){const s=new Un(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await T(s.generateCnf.bind(s),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,As(t,a)}else if(e.authenticationScheme===J.SSH)if(e.sshJwk)hd(t,e.sshJwk);else throw ne(vo);(!st.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&ps(t,e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const s=Yr(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${s.uid}${Se.CLIENT_INFO_SEPARATOR}${s.utid}`,type:ot.HOME_ACCOUNT_ID}}catch(s){this.logger.verbose("Could not parse client info for CCS Header: "+s)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case ot.HOME_ACCOUNT_ID:try{const s=Mn(r.credential);sr(t,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case ot.UPN:eo(t,r.credential);break}return e.embeddedClientId&&_o(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&hn(t,e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Da])&&hn(t,{[Da]:"1"}),Eo(t,e.correlationId,this.performanceClient),fr(t)}createLogoutUrlQueryString(e){const t=new Map;return e.postLogoutRedirectUri&&kp(t,e.postLogoutRedirectUri),e.correlationId&&ms(t,e.correlationId),e.idTokenHint&&Rp(t,e.idTokenHint),e.state&&od(t,e.state),e.logoutHint&&Up(t,e.logoutHint),e.extraQueryParameters&&hn(t,e.extraQueryParameters),this.config.authOptions.instanceAware&&ld(t),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Xp=300;class Zp extends ws{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(f.RefreshTokenClientAcquireToken,e.correlationId);const t=Ue(),r=await T(this.executeTokenRequest.bind(this),f.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(a=r.headers)==null?void 0:a[Pe.X_MS_REQUEST_ID],i=new pn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(r.body),T(i.handleServerTokenResponse.bind(i),f.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw ne(Dl);if((r=this.performanceClient)==null||r.addQueueMeasurement(f.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw w(ts);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const i=o instanceof tt&&o.errorCode===to,s=o instanceof nn&&o.errorCode===Ra.INVALID_GRANT_ERROR&&o.subError===Ra.CLIENT_MISMATCH_ERROR;if(i||s)return T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return T(this.acquireTokenWithCachedRefreshToken.bind(this),f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var i,s,a;(i=this.performanceClient)==null||i.addQueueMeasurement(f.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=ct(this.cacheManager.getRefreshToken.bind(this.cacheManager),f.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw Ai(to);if(r.expiresOn&&Wr(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||Xp))throw(s=this.performanceClient)==null||s.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),Ai(vs);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||J.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:ot.HOME_ACCOUNT_ID}};try{return await T(this.acquireToken.bind(this),f.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof tt&&((a=this.performanceClient)==null||a.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),c.subError===Ro)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const l=ir(r);this.cacheManager.removeRefreshToken(l)}throw c}}async executeTokenRequest(e,t){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(f.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=j.appendQueryString(t.tokenEndpoint,r),i=await T(this.createTokenRequestBody.bind(this),f.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a=bo(this.config.authOptions.clientId,e);return T(this.executePostToTokenEndpoint.bind(this),f.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,i,s,a,e.correlationId,f.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,i;(r=this.performanceClient)==null||r.addQueueMeasurement(f.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=new Map;if(fs(t,e.embeddedClientId||((o=e.tokenBodyParameters)==null?void 0:o[gn])||this.config.authOptions.clientId),e.redirectUri&&gs(t,e.redirectUri),us(t,e.scopes,!0,(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes),cd(t,ll.REFRESH_TOKEN_GRANT),Ts(t),Cs(t,this.config.libraryInfo),ys(t,this.config.telemetry.application),fd(t),this.serverTelemetryManager&&!Zl(this.config)&&ud(t,this.serverTelemetryManager),Hp(t,e.refreshToken),this.config.clientCredentials.clientSecret&&id(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const s=this.config.clientCredentials.clientAssertion;sd(t,await Td(s.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),ad(t,s.assertionType)}if(e.authenticationScheme===J.POP){const s=new Un(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await T(s.generateCnf.bind(s),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,As(t,a)}else if(e.authenticationScheme===J.SSH)if(e.sshJwk)hd(t,e.sshJwk);else throw ne(vo);if((!st.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&ps(t,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case ot.HOME_ACCOUNT_ID:try{const s=Mn(e.ccsCredential.credential);sr(t,s)}catch(s){this.logger.verbose("Could not parse home account ID for CCS Header: "+s)}break;case ot.UPN:eo(t,e.ccsCredential.credential);break}return e.embeddedClientId&&_o(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&hn(t,e.tokenBodyParameters),Eo(t,e.correlationId,this.performanceClient),fr(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class em extends ws{constructor(e,t){super(e,t)}async acquireCachedToken(e){var c;(c=this.performanceClient)==null||c.addQueueMeasurement(f.SilentFlowClientAcquireCachedToken,e.correlationId);let t=cn.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!st.isEmptyObj(e.claims))throw this.setCacheOutcome(cn.FORCE_REFRESH_OR_CLAIMS,e.correlationId),w(Wt);if(!e.account)throw w(ts);const r=e.account.tenantId||$p(e.authority),o=this.cacheManager.getTokenKeys(),i=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(i){if(Pl(i.cachedAt)||Wr(i.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(cn.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),w(Wt);i.refreshOn&&Wr(i.refreshOn,0)&&(t=cn.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(cn.NO_CACHED_ACCESS_TOKEN,e.correlationId),w(Wt);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account),accessToken:i,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await T(this.generateResultFromCacheRecord.bind(this),f.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==cn.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(f.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Jt(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const i=r==null?void 0:r.auth_time;if(!i)throw w(es);Ol(i,t.maxAge)}return pn.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const tm={sendGetRequestAsync:()=>Promise.reject(w(z)),sendPostRequestAsync:()=>Promise.reject(w(z))};/*! @azure/msal-common v15.4.0 2025-03-25 */function nm(n,e,t,r){var a,c;const o=e.correlationId,i=new Map;fs(i,e.embeddedClientId||((a=e.extraQueryParameters)==null?void 0:a[gn])||n.clientId);const s=[...e.scopes||[],...e.extraScopesToConsent||[]];if(us(i,s,!0,(c=n.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),gs(i,e.redirectUri),ms(i,o),Sp(i,e.responseMode),Ts(i),e.prompt&&(Pp(i,e.prompt),r==null||r.addFields({prompt:e.prompt},o)),e.domainHint&&(Op(i,e.domainHint),r==null||r.addFields({domainHintFromRequest:!0},o)),e.prompt!==Ae.SELECT_ACCOUNT)if(e.sid&&e.prompt===Ae.NONE)t.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),Fa(i,e.sid),r==null||r.addFields({sidFromRequest:!0},o);else if(e.account){const l=im(e.account);let d=sm(e.account);if(d&&e.domainHint&&(t.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),d=null),d){t.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),Rr(i,d),r==null||r.addFields({loginHintFromClaim:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(l&&e.prompt===Ae.NONE){t.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),Fa(i,l),r==null||r.addFields({sidFromClaim:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)t.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),Rr(i,e.loginHint),eo(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o);else if(e.account.username){t.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),Rr(i,e.account.username),r==null||r.addFields({loginHintFromUpn:!0},o);try{const h=Mn(e.account.homeAccountId);sr(i,h)}catch{t.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(t.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),Rr(i,e.loginHint),eo(i,e.loginHint),r==null||r.addFields({loginHintFromRequest:!0},o));else t.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&Np(i,e.nonce),e.state&&od(i,e.state),(e.claims||n.clientCapabilities&&n.clientCapabilities.length>0)&&ps(i,e.claims,n.clientCapabilities),e.embeddedClientId&&_o(i,n.clientId,n.redirectUri),n.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(Ti))&&ld(i),i}function wd(n,e){const t=fr(e);return j.appendQueryString(n.authorizationEndpoint,t)}function rm(n,e){if(vd(n,e),!n.code)throw w(El);return n}function vd(n,e){if(!n.state||!e)throw n.state?w(fi,"Cached State"):w(fi,"Server State");let t,r;try{t=decodeURIComponent(n.state)}catch{throw w(Ln,n.state)}try{r=decodeURIComponent(e)}catch{throw w(Ln,n.state)}if(t!==r)throw w(pl);if(n.error||n.error_description||n.suberror){const o=om(n);throw yd(n.error,n.error_description,n.suberror)?new tt(n.error||"",n.error_description,n.suberror,n.timestamp||"",n.trace_id||"",n.correlation_id||"",n.claims||"",o):new nn(n.error||"",n.error_description,n.suberror,o)}}function om(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}function im(n){var e;return((e=n.idTokenClaims)==null?void 0:e.sid)||null}function sm(n){var e;return((e=n.idTokenClaims)==null?void 0:e.login_hint)||null}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ga=",",Id="|";function am(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:i}=n,s=new Map([[0,[t,r]],[2,[o,i]]]);let a=[];if(e!=null&&e.length){if(a=e.split(Ga),a.length<4)return e}else a=Array.from({length:4},()=>Id);return s.forEach((c,l)=>{var d,h;c.length===2&&((d=c[0])!=null&&d.length)&&((h=c[1])!=null&&h.length)&&cm({skuArr:a,index:l,skuName:c[0],skuVersion:c[1]})}),a.join(Ga)}function cm(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Id))}class gr{constructor(e,t){this.cacheOutcome=cn.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||C.EMPTY_STRING,this.wrapperVer=e.wrapperVer||C.EMPTY_STRING,this.telemetryCacheKey=Te.CACHE_KEY+Se.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Te.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Te.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),s=[e,i].join(Te.VALUE_SEPARATOR);return[Te.SCHEMA_VERSION,s,o].join(Te.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=gr.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Te.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Te.VALUE_SEPARATOR),i=e.errors.length,s=t<i?Te.OVERFLOW_TRUE:Te.OVERFLOW_FALSE,a=[i,s].join(Te.VALUE_SEPARATOR);return[Te.SCHEMA_VERSION,e.cacheHits,r,o,a].join(Te.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Te.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof X?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Te.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=gr.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const i=e.errors.length;for(t=0;t<i;t++){const s=e.failedRequests[2*t]||C.EMPTY_STRING,a=e.failedRequests[2*t+1]||C.EMPTY_STRING,c=e.errors[t]||C.EMPTY_STRING;if(o+=s.toString().length+a.toString().length+c.length+3,o<Te.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||C.EMPTY_STRING),e.push(this.regionSource||C.EMPTY_STRING),e.push(this.regionOutcome||C.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return am(e)}}/*! @azure/msal-common v15.4.0 2025-03-25 */const Ed="missing_kid_error",_d="missing_alg_error";/*! @azure/msal-common v15.4.0 2025-03-25 */const lm={[Ed]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[_d]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class Es extends X{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,Es.prototype)}}function $a(n){return new Es(n,lm[n])}/*! @azure/msal-common v15.4.0 2025-03-25 */class _s{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw $a(Ed);if(!e.alg)throw $a(_d);const t=new _s({typ:e.typ||ng.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v15.4.0 2025-03-25 */class za{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class dm{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Gp.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new za}}startPerformanceMeasurement(){return new za}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Ss="pkce_not_created",bs="ear_jwk_empty",Sd="ear_jwe_empty",wi="crypto_nonexistent",Oo="empty_navigate_uri",bd="hash_empty_error",ks="no_state_in_hash",kd="hash_does_not_contain_known_properties",Rd="unable_to_parse_state",Od="state_interaction_type_mismatch",Pd="interaction_in_progress",Nd="popup_window_error",Md="empty_window_error",pr="user_cancelled",hm="monitor_popup_timeout",xd="monitor_window_timeout",Hd="redirect_in_iframe",Ld="block_iframe_reload",Ud="block_nested_popups",um="iframe_closed_prematurely",Po="silent_logout_unsupported",Dd="no_account_error",fm="silent_prompt_value_error",Fd="no_token_request_cache_error",Bd="unable_to_parse_token_request_cache_error",gm="auth_request_not_set_error",pm="invalid_cache_type",No="non_browser_environment",En="database_not_open",no="no_network_connectivity",Kd="post_request_failed",Gd="get_request_failed",vi="failed_to_parse_response",$d="unable_to_load_token",Rs="crypto_key_not_found",zd="auth_code_required",qd="auth_code_or_nativeAccountId_required",Vd="spa_code_and_nativeAccountId_present",Os="database_unavailable",jd="unable_to_acquire_token_from_native_platform",Wd="native_handshake_timeout",Yd="native_extension_not_installed",Ps="native_connection_not_established",ro="uninitialized_public_client_application",Qd="native_prompt_not_supported",Jd="invalid_base64_string",Xd="invalid_pop_token_request",Zd="failed_to_build_headers",eh="failed_to_parse_headers",Ur="failed_to_decrypt_ear_response";/*! @azure/msal-browser v4.9.0 2025-03-25 */const bt="For more visit: aka.ms/msaljs/browser-errors",mm={[Ss]:"The PKCE code challenge and verifier could not be generated.",[bs]:"No EAR encryption key provided. This is unexpected.",[Sd]:"Server response does not contain ear_jwe property. This is unexpected.",[wi]:"The crypto object or function is not available.",[Oo]:"Navigation URI is empty. Please check stack trace for more info.",[bd]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${bt}`,[ks]:"Hash does not contain state. Please verify that the request originated from msal.",[kd]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${bt}`,[Rd]:"Unable to parse state. Please verify that the request originated from msal.",[Od]:"Hash contains state but the interaction type does not match the caller.",[Pd]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${bt}`,[Nd]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Md]:"window.open returned null or undefined window object.",[pr]:"User cancelled the flow.",[hm]:`Token acquisition in popup failed due to timeout. ${bt}`,[xd]:`Token acquisition in iframe failed due to timeout. ${bt}`,[Hd]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Ld]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${bt}`,[Ud]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[um]:"The iframe being monitored was closed prematurely.",[Po]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Dd]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[fm]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Fd]:"No token request found in cache.",[Bd]:"The cached token request could not be parsed.",[gm]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[pm]:"Invalid cache type",[No]:"Login and token requests are not supported in non-browser environments.",[En]:"Database is not open!",[no]:"No network connectivity. Check your internet connection.",[Kd]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[Gd]:"Network request failed. Please check the network trace to determine root cause.",[vi]:"Failed to parse network response. Check network trace.",[$d]:"Error loading token to cache.",[Rs]:"Cryptographic Key or Keypair not found in browser storage.",[zd]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[qd]:"An authorization code or nativeAccountId must be provided to this flow.",[Vd]:"Request cannot contain both spa code and native account id.",[Os]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[jd]:`Unable to acquire token from native platform. ${bt}`,[Wd]:"Timed out while attempting to establish connection to browser extension",[Yd]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Ps]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${bt}`,[ro]:`You must call and await the initialize function before attempting to call any other MSAL API. ${bt}`,[Qd]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[Jd]:"Invalid base64 encoded string.",[Xd]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[Zd]:"Failed to build request headers object.",[eh]:"Failed to parse response headers",[Ur]:"Failed to decrypt ear response"};class Tr extends X{constructor(e,t){super(e,mm[e],t),Object.setPrototypeOf(this,Tr.prototype),this.name="BrowserAuthError"}}function P(n,e){return new Tr(n,e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Me={INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},Sn={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},ln={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},we={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},qa={GET:"GET",POST:"POST"},fe={ORIGIN_URI:"request.origin",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",VERIFIER:"code.verifier",INTERACTION_STATUS_KEY:"interaction.status",NATIVE_REQUEST:"request.native"},qt={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Or={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},oe={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var M;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(M||(M={}));const Ii={scopes:yn},th="jwk",Ei="msal.db",Cm=1,ym=`${Ei}.keys`,Ce={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Tm=[Ce.Default,Ce.Skip,Ce.RefreshTokenAndNetwork],Am="msal.browser.log.level",wm="msal.browser.log.pii";/*! @azure/msal-browser v4.9.0 2025-03-25 */function Pr(n){return encodeURIComponent(mr(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Xt(n){return nh(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mr(n){return nh(new TextEncoder().encode(n))}function nh(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */function at(n){return new TextDecoder().decode(Yt(n))}function Yt(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw P(Jd)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const vm="RSASSA-PKCS1-v1_5",Bn="AES-GCM",rh="HKDF",Ns="SHA-256",Im=2048,Em=new Uint8Array([1,0,1]),Va="0123456789abcdef",ja=new Uint32Array(1),Ms="raw",oh="encrypt",xs="decrypt",_m="deriveKey",Sm="crypto_subtle_undefined",Hs={name:vm,hash:Ns,modulusLength:Im,publicExponent:Em};function bm(n){if(!window)throw P(No);if(!window.crypto)throw P(wi);if(!n&&!window.crypto.subtle)throw P(wi,Sm)}async function ih(n,e,t){e==null||e.addQueueMeasurement(f.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(Ns,o)}function km(n){return window.crypto.getRandomValues(n)}function ei(){return window.crypto.getRandomValues(ja),ja[0]}function Qe(){const n=Date.now(),e=ei()*1024+(ei()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,i=ei();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=i>>>24,t[13]=i>>>16,t[14]=i>>>8,t[15]=i;let s="";for(let a=0;a<t.length;a++)s+=Va.charAt(t[a]>>>4),s+=Va.charAt(t[a]&15),(a===3||a===5||a===7||a===9)&&(s+="-");return s}async function Rm(n,e){return window.crypto.subtle.generateKey(Hs,n,e)}async function ti(n){return window.crypto.subtle.exportKey(th,n)}async function Om(n,e,t){return window.crypto.subtle.importKey(th,n,Hs,e,t)}async function Pm(n,e){return window.crypto.subtle.sign(Hs,n,e)}async function Ls(){const n=await sh(),t={alg:"dir",kty:"oct",k:Xt(new Uint8Array(n))};return mr(JSON.stringify(t))}async function Nm(n){const e=at(n),r=JSON.parse(e).k,o=Yt(r);return window.crypto.subtle.importKey(Ms,o,Bn,!1,[xs])}async function Mm(n,e){const t=e.split(".");if(t.length!==5)throw P(Ur,"jwe_length");const r=await Nm(n).catch(()=>{throw P(Ur,"import_key")});try{const o=new TextEncoder().encode(t[0]),i=Yt(t[2]),s=Yt(t[3]),a=Yt(t[4]),c=a.byteLength*8,l=new Uint8Array(s.length+a.length);l.set(s),l.set(a,s.length);const d=await window.crypto.subtle.decrypt({name:Bn,iv:i,tagLength:c,additionalData:o},r,l);return new TextDecoder().decode(d)}catch{throw P(Ur,"decrypt")}}async function sh(){const n=await window.crypto.subtle.generateKey({name:Bn,length:256},!0,[oh,xs]);return window.crypto.subtle.exportKey(Ms,n)}async function Wa(n){return window.crypto.subtle.importKey(Ms,n,rh,!1,[_m])}async function ah(n,e,t){return window.crypto.subtle.deriveKey({name:rh,salt:e,hash:Ns,info:new TextEncoder().encode(t)},n,{name:Bn,length:256},!1,[oh,xs])}async function xm(n,e,t){const r=new TextEncoder().encode(e),o=window.crypto.getRandomValues(new Uint8Array(16)),i=await ah(n,o,t),s=await window.crypto.subtle.encrypt({name:Bn,iv:new Uint8Array(12)},i,r);return{data:Xt(new Uint8Array(s)),nonce:Xt(o)}}async function Hm(n,e,t,r){const o=Yt(r),i=await ah(n,Yt(e),t),s=await window.crypto.subtle.decrypt({name:Bn,iv:new Uint8Array(12)},i,o);return new TextDecoder().decode(s)}async function ch(n){const e=await ih(n),t=new Uint8Array(e);return Xt(t)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Us="storage_not_supported",Lm="stubbed_public_client_application_called",lh="in_mem_redirect_unavailable";/*! @azure/msal-browser v4.9.0 2025-03-25 */const Um={[Us]:"Given storage configuration option was not supported.",[Lm]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[lh]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class Ds extends X{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Ds.prototype)}}function Fs(n){return new Ds(n,Um[n])}/*! @azure/msal-browser v4.9.0 2025-03-25 */function Dm(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function Fm(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Bs(){return window.parent!==window}function Bm(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Me.POPUP_NAME_PREFIX}.`)===0}function Mt(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Km(){const e=new j(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Gm(){if(j.hashContainsKnownProperties(window.location.hash)&&Bs())throw P(Ld)}function $m(n){if(Bs()&&!n)throw P(Hd)}function zm(){if(Bm())throw P(Ud)}function dh(){if(typeof window>"u")throw P(No)}function hh(n){if(!n)throw P(ro)}function Ks(n){dh(),Gm(),zm(),hh(n)}function Ya(n,e){if(Ks(n),$m(e.system.allowRedirectInIframe),e.cache.cacheLocation===we.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Fs(lh)}function uh(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function qm(){return Qe()}/*! @azure/msal-browser v4.9.0 2025-03-25 */class oo{navigateInternal(e,t){return oo.defaultNavigateWindow(e,t)}navigateExternal(e,t){return oo.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Vm{async sendGetRequestAsync(e,t){let r,o={},i=0;const s=Qa(t);try{r=await fetch(e,{method:qa.GET,headers:s})}catch{throw P(window.navigator.onLine?Gd:no)}o=Ja(r.headers);try{return i=r.status,{headers:o,body:await r.json(),status:i}}catch{throw Ba(P(vi),i,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=Qa(t);let i,s=0,a={};try{i=await fetch(e,{method:qa.POST,headers:o,body:r})}catch{throw P(window.navigator.onLine?Kd:no)}a=Ja(i.headers);try{return s=i.status,{headers:a,body:await i.json(),status:s}}catch{throw Ba(P(vi),s,a)}}}function Qa(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw P(Zd)}}function Ja(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw P(eh)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const jm=6e4,_i=1e4,Wm=3e4,Ym=2e3;function Qm({auth:n,cache:e,system:t,telemetry:r},o){const i={clientId:C.EMPTY_STRING,authority:`${C.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:C.EMPTY_STRING,authorityMetadata:C.EMPTY_STRING,redirectUri:typeof window<"u"?Mt():"",postLogoutRedirectUri:C.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:He.AAD,OIDCOptions:{serverResponseType:Co.FRAGMENT,defaultScopes:[C.OPENID_SCOPE,C.PROFILE_SCOPE,C.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:is.None,tenant:C.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},s={cacheLocation:we.SessionStorage,temporaryCacheLocation:we.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===we.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:de.Info,piiLoggingEnabled:!1},l={...{...Xl,loggerOptions:a,networkClient:o?new Vm:tm,navigationClient:new oo,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||jm,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||_i,navigateFrameWait:0,redirectNavigationTimeout:Wm,asyncPopups:!1,allowRedirectInIframe:!1,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||Ym,pollIntervalMilliseconds:Me.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},d={application:{appName:C.EMPTY_STRING,appVersion:C.EMPTY_STRING},client:new dm};if((n==null?void 0:n.protocolMode)!==He.OIDC&&(n!=null&&n.OIDCOptions)&&new Lt(l.loggerOptions).warning(JSON.stringify(ne(zl))),n!=null&&n.protocolMode&&n.protocolMode===He.OIDC&&(l!=null&&l.allowPlatformBroker))throw ne(ql);const h={auth:{...i,...n,OIDCOptions:{...i.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:l,telemetry:{...d,...r}};return h.auth.protocolMode===He.EAR&&(new Lt(l.loggerOptions).warning("EAR Protocol Mode is not yet supported. Overriding to use PKCE auth"),h.auth.protocolMode=He.AAD),h}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Jm="@azure/msal-browser",Kn="4.9.0";/*! @azure/msal-browser v4.9.0 2025-03-25 */class Mo{static loggerCallback(e,t){switch(e){case de.Error:console.error(t);return;case de.Info:console.info(t);return;case de.Verbose:console.debug(t);return;case de.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var c;this.browserEnvironment=typeof window<"u",this.config=Qm(e,this.browserEnvironment);let t;try{t=window[we.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(Am),o=(c=t==null?void 0:t.getItem(wm))==null?void 0:c.toLowerCase(),i=o==="true"?!0:o==="false"?!1:void 0,s={...this.config.system.loggerOptions},a=r&&Object.keys(de).includes(r)?de[r]:void 0;a&&(s.loggerCallback=Mo.loggerCallback,s.logLevel=a),i!==void 0&&(s.piiLoggingEnabled=i),this.logger=new Lt(s,Jm,Kn),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Rt={UserInteractionRequired:"USER_INTERACTION_REQUIRED",UserCancel:"USER_CANCEL",NoNetwork:"NO_NETWORK",TransientError:"TRANSIENT_ERROR",PersistentError:"PERSISTENT_ERROR",Disabled:"DISABLED",AccountUnavailable:"ACCOUNT_UNAVAILABLE",NestedAppAuthUnavailable:"NESTED_APP_AUTH_UNAVAILABLE"};/*! @azure/msal-browser v4.9.0 2025-03-25 */class Oe{static async initializeNestedAppAuthBridge(){if(window===void 0)throw new Error("window is undefined");if(window.nestedAppAuthBridge===void 0)throw new Error("window.nestedAppAuthBridge is undefined");try{window.nestedAppAuthBridge.addEventListener("message",t=>{const r=typeof t=="string"?t:t.data,o=JSON.parse(r),i=Oe.bridgeRequests.find(s=>s.requestId===o.requestId);i!==void 0&&(Oe.bridgeRequests.splice(Oe.bridgeRequests.indexOf(i),1),o.success?i.resolve(o):i.reject(o.error))});const e=await new Promise((t,r)=>{const o=Oe.buildRequest("GetInitContext"),i={requestId:o.requestId,method:o.method,resolve:t,reject:r};Oe.bridgeRequests.push(i),window.nestedAppAuthBridge.postMessage(JSON.stringify(o))});return Oe.validateBridgeResultOrThrow(e.initContext)}catch(e){throw window.console.log(e),e}}getTokenInteractive(e){return this.getToken("GetTokenPopup",e)}getTokenSilent(e){return this.getToken("GetToken",e)}async getToken(e,t){const r=await this.sendRequest(e,{tokenParams:t});return{token:Oe.validateBridgeResultOrThrow(r.token),account:Oe.validateBridgeResultOrThrow(r.account)}}getHostCapabilities(){return this.capabilities??null}getAccountContext(){return this.accountContext?this.accountContext:null}static buildRequest(e,t){return{messageType:"NestedAppAuthRequest",method:e,requestId:Qe(),sendTime:Date.now(),clientLibrary:Me.MSAL_SKU,clientLibraryVersion:Kn,...t}}sendRequest(e,t){const r=Oe.buildRequest(e,t);return new Promise((i,s)=>{const a={requestId:r.requestId,method:r.method,resolve:i,reject:s};Oe.bridgeRequests.push(a),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))})}static validateBridgeResultOrThrow(e){if(e===void 0)throw{status:Rt.NestedAppAuthUnavailable};return e}constructor(e,t,r,o){this.sdkName=e,this.sdkVersion=t,this.accountContext=r,this.capabilities=o}static async create(){const e=await Oe.initializeNestedAppAuthBridge();return new Oe(e.sdkName,e.sdkVersion,e.accountContext,e.capabilities)}}Oe.bridgeRequests=[];/*! @azure/msal-browser v4.9.0 2025-03-25 */class Dn extends Mo{constructor(){super(...arguments),this.bridgeProxy=void 0,this.accountContext=null}getModuleName(){return Dn.MODULE_NAME}getId(){return Dn.ID}getBridgeProxy(){return this.bridgeProxy}async initialize(){try{if(typeof window<"u"){typeof window.__initializeNestedAppAuth=="function"&&await window.__initializeNestedAppAuth();const e=await Oe.create();this.accountContext=e.getAccountContext(),this.bridgeProxy=e,this.available=e!==void 0}}catch(e){this.logger.infoPii(`Could not initialize Nested App Auth bridge (${e})`)}return this.logger.info(`Nested App Auth Bridge available: ${this.available}`),this.available}}Dn.MODULE_NAME="";Dn.ID="NestedAppOperatingContext";/*! @azure/msal-browser v4.9.0 2025-03-25 */class mn extends Mo{getModuleName(){return mn.MODULE_NAME}getId(){return mn.ID}async initialize(){return this.available=typeof window<"u",this.available}}mn.MODULE_NAME="";mn.ID="StandardOperatingContext";/*! @azure/msal-browser v4.9.0 2025-03-25 */class Xm{constructor(){this.dbName=Ei,this.version=Cm,this.tableName=ym,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const i=o;this.db=i.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(P(Os)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(P(En));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),r()}),a.addEventListener("error",c=>{this.closeConnection(),o(c)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(P(En));const i=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();i.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),i.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(P(En));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const c=a;this.closeConnection(),t(c.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),r(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(Ei),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class xo{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,t){this.cache.set(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Zm{constructor(e){this.inMemoryCache=new xo,this.indexedDBCache=new Xm,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Tr&&e.errorCode===Os)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class It{constructor(e,t,r){this.logger=e,bm(r??!1),this.cache=new Zm(this.logger),this.performanceClient=t}createNewGuid(){return Qe()}base64Encode(e){return mr(e)}base64Decode(e){return at(e)}base64UrlEncode(e){return Pr(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var d;const t=(d=this.performanceClient)==null?void 0:d.startMeasurement(f.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Rm(It.EXTRACTABLE,It.POP_KEY_USAGES),o=await ti(r.publicKey),i={e:o.e,kty:o.kty,n:o.n},s=Xa(i),a=await this.hashString(s),c=await ti(r.privateKey),l=await Om(c,!1,["sign"]);return await this.cache.setItem(a,{privateKey:l,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var W;const i=(W=this.performanceClient)==null?void 0:W.startMeasurement(f.CryptoOptsSignJwt,o),s=await this.cache.getItem(t);if(!s)throw P(Rs);const a=await ti(s.publicKey),c=Xa(a),l=Pr(JSON.stringify({kid:t})),d=_s.getShrHeaderString({...r==null?void 0:r.header,alg:a.alg,kid:l}),h=Pr(d);e.cnf={jwk:JSON.parse(c)};const p=Pr(JSON.stringify(e)),y=`${h}.${p}`,b=new TextEncoder().encode(y),$=await Pm(s.privateKey,b),D=Xt(new Uint8Array($)),q=`${y}.${D}`;return i&&i.end({success:!0}),q}async hashString(e){return ch(e)}}It.POP_KEY_USAGES=["sign","verify"];It.EXTRACTABLE=!0;function Xa(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v4.9.0 2025-03-25 */const eC=24*60*60*1e3,Si={Lax:"Lax",None:"None"};class fh{initialize(){return Promise.resolve()}getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const i=r[o],[s,...a]=decodeURIComponent(i).trim().split("="),c=a.join("=");if(s===t)return c}return""}getUserData(){throw w(z)}setItem(e,t,r,o=!0,i=Si.Lax){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=${i};`;if(r){const a=tC(r);s+=`expires=${a};`}(o||i===Si.None)&&(s+="Secure;"),document.cookie=s}async setUserData(){return Promise.reject(w(z))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function tC(n){const e=new Date;return new Date(e.getTime()+n*eC).toUTCString()}/*! @azure/msal-browser v4.9.0 2025-03-25 */function bi(n){const e=n.getItem(qt.ACCOUNT_KEYS);return e?JSON.parse(e):[]}function ki(n,e){const t=e.getItem(`${qt.TOKEN_KEYS}.${n}`);if(t){const r=JSON.parse(t);if(r&&r.hasOwnProperty("idToken")&&r.hasOwnProperty("accessToken")&&r.hasOwnProperty("refreshToken"))return r}return{idToken:[],accessToken:[],refreshToken:[]}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const Za="msal.cache.encryption",nC="msal.broadcast.cache";class rC{constructor(e,t,r){if(!window.localStorage)throw Fs(Us);this.memoryStorage=new xo,this.initialized=!1,this.clientId=e,this.logger=t,this.performanceClient=r,this.broadcast=new BroadcastChannel(nC)}async initialize(e){this.initialized=!0;const t=new fh,r=t.getItem(Za);let o={key:"",id:""};if(r)try{o=JSON.parse(r)}catch{}if(o.key&&o.id){const i=ct(Yt,f.Base64Decode,this.logger,this.performanceClient,e)(o.key);this.encryptionCookie={id:o.id,key:await T(Wa,f.GenerateHKDF,this.logger,this.performanceClient,e)(i)},await T(this.importExistingCache.bind(this),f.ImportExistingCache,this.logger,this.performanceClient,e)(e)}else{this.clear();const i=Qe(),s=await T(sh,f.GenerateBaseKey,this.logger,this.performanceClient,e)(),a=ct(Xt,f.UrlEncodeArr,this.logger,this.performanceClient,e)(new Uint8Array(s));this.encryptionCookie={id:i,key:await T(Wa,f.GenerateHKDF,this.logger,this.performanceClient,e)(s)};const c={id:i,key:a};t.setItem(Za,JSON.stringify(c),0,!0,Si.None)}this.broadcast.addEventListener("message",this.updateCache.bind(this))}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw P(ro);return this.memoryStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}async setUserData(e,t,r){if(!this.initialized||!this.encryptionCookie)throw P(ro);const{data:o,nonce:i}=await T(xm,f.Encrypt,this.logger,this.performanceClient,r)(this.encryptionCookie.key,t,this.getContext(e)),s={id:this.encryptionCookie.id,nonce:i,data:o};this.memoryStorage.setItem(e,t),this.setItem(e,JSON.stringify(s)),this.broadcast.postMessage({key:e,value:t,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),bi(this).forEach(r=>this.removeItem(r));const t=ki(this.clientId,this);t.idToken.forEach(r=>this.removeItem(r)),t.accessToken.forEach(r=>this.removeItem(r)),t.refreshToken.forEach(r=>this.removeItem(r)),this.getKeys().forEach(r=>{(r.startsWith(C.CACHE_PREFIX)||r.indexOf(this.clientId)!==-1)&&this.removeItem(r)})}async importExistingCache(e){if(!this.encryptionCookie)return;let t=bi(this);t=await this.importArray(t,e),this.setItem(qt.ACCOUNT_KEYS,JSON.stringify(t));const r=ki(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),this.setItem(`${qt.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}async getItemFromEncryptedCache(e,t){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let o;try{o=JSON.parse(r)}catch{return null}return!o.id||!o.nonce||!o.data?(this.performanceClient.incrementFields({unencryptedCacheCount:1},t),null):o.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},t),null):T(Hm,f.Decrypt,this.logger,this.performanceClient,t)(this.encryptionCookie.key,o.nonce,this.getContext(e),o.data)}async importArray(e,t){const r=[],o=[];return e.forEach(i=>{const s=this.getItemFromEncryptedCache(i,t).then(a=>{a?(this.memoryStorage.setItem(i,a),r.push(i)):this.removeItem(i)});o.push(s)}),await Promise.all(o),r}getContext(e){let t="";return e.includes(this.clientId)&&(t=this.clientId),t}updateCache(e){this.logger.trace("Updating internal cache from broadcast event");const t=this.performanceClient.startMeasurement(f.LocalStorageUpdated);t.add({isBackground:!0});const{key:r,value:o,context:i}=e.data;if(!r){this.logger.error("Broadcast event missing key"),t.end({success:!1,errorCode:"noKey"});return}if(i&&i!==this.clientId){this.logger.trace(`Ignoring broadcast event from clientId: ${i}`),t.end({success:!1,errorCode:"contextMismatch"});return}o?(this.memoryStorage.setItem(r,o),this.logger.verbose("Updated item in internal cache")):(this.memoryStorage.removeItem(r),this.logger.verbose("Removed item from internal cache")),t.end({success:!0})}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class oC{constructor(){if(!window.sessionStorage)throw Fs(Us)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const N={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v4.9.0 2025-03-25 */class io extends yi{constructor(e,t,r,o,i,s,a){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new xo,this.browserStorage=ec(e,t.cacheLocation,o,i),this.temporaryCacheStorage=ec(e,t.temporaryCacheLocation,o,i),this.cookieStorage=new fh,this.performanceClient=i,this.eventHandler=s}async initialize(e){await this.browserStorage.initialize(e)}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getAccount(e){this.logger.trace("BrowserCacheManager.getAccount called");const t=this.browserStorage.getUserData(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!ke.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):yi.toObject(new ke,r)}async setAccount(e,t){this.logger.trace("BrowserCacheManager.setAccount called");const r=e.generateAccountKey();await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t);const o=this.addAccountKeyToMap(r);this.cacheConfig.cacheLocation===we.LocalStorage&&o&&this.eventHandler.emitEvent(N.ACCOUNT_ADDED,void 0,e.getAccountInfo())}getAccountKeys(){return bi(this.browserStorage)}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();return t.indexOf(e)===-1?(t.push(e),this.browserStorage.setItem(qt.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added"),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map"),!1)}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.browserStorage.setItem(qt.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}async removeAccountContext(e){await super.removeAccountContext(e),this.cacheConfig.cacheLocation===we.LocalStorage&&this.eventHandler.emitEvent(N.ACCOUNT_REMOVED,void 0,e.getAccountInfo())}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,K.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,K.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,K.REFRESH_TOKEN)}getTokenKeys(){return ki(this.clientId,this.browserStorage)}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case K.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case K.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case K.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),w(mi)}this.browserStorage.setItem(`${qt.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case K.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case K.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const i=r.accessToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case K.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const s=r.refreshToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),w(mi)}this.browserStorage.setItem(`${qt.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!mg(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}async setIdTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.ID_TOKEN)}getAccessTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!pg(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}async setAccessTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.browserStorage.getUserData(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Cg(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,K.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}async setRefreshTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const r=ir(e);await T(this.browserStorage.setUserData.bind(this.browserStorage),f.SetUserData,this.logger,this.performanceClient)(r,JSON.stringify(e),t),this.addTokenKey(r,K.REFRESH_TOKEN)}getAppMetadata(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Sg(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=_g(e);this.browserStorage.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Ig(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.browserStorage.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&bg(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Or.WRAPPER_SKU,e),this.internalStorage.setItem(Or.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Or.WRAPPER_SKU)||C.EMPTY_STRING,t=this.internalStorage.getItem(Or.WRAPPER_VER)||C.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(ba.ACTIVE_ACCOUNT_FILTERS),t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found"),null;const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(ba.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("setActiveAccount: Active account set");const r={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(r))}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t);this.eventHandler.emitEvent(N.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e){const t=this.browserStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!Eg(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.browserStorage.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const i=this.cookieStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),i}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===we.LocalStorage){const i=this.browserStorage.getItem(r);if(i)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),i}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(C.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(C.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(f.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(i=>{const s=this.getAccessTokenCredential(i);s!=null&&s.requestedClaimsHash&&i.includes(s.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(i))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):st.startsWith(e,C.CACHE_PREFIX)?e:`${C.CACHE_PREFIX}.${this.clientId}.${e}`}resetRequestCache(){this.logger.trace("BrowserCacheManager.resetRequestCache called"),this.removeTemporaryItem(this.generateCacheKey(fe.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(fe.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(fe.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(fe.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(fe.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cacheAuthorizeRequest(e,t){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called");const r=mr(JSON.stringify(e));if(this.setTemporaryCache(fe.REQUEST_PARAMS,r,!0),t){const o=mr(t);this.setTemporaryCache(fe.VERIFIER,o,!0)}}getCachedRequest(){this.logger.trace("BrowserCacheManager.getCachedRequest called");const e=this.getTemporaryCache(fe.REQUEST_PARAMS,!0);if(!e)throw P(Fd);const t=this.getTemporaryCache(fe.VERIFIER,!0);let r,o="";try{r=JSON.parse(at(e)),t&&(o=at(t))}catch(i){throw this.logger.errorPii(`Attempted to parse: ${e}`),this.logger.error(`Parsing cached token request threw with error: ${i}`),P(Bd)}return[r,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(fe.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${C.CACHE_PREFIX}.${fe.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${C.CACHE_PREFIX}.${fe.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw P(Pd);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}async hydrateCache(e,t){var a,c,l;const r=yo((a=e.account)==null?void 0:a.homeAccountId,(c=e.account)==null?void 0:c.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const i=To((l=e.account)==null?void 0:l.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?Na(e.expiresOn):0,e.extExpiresOn?Na(e.extExpiresOn):0,at,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),s={idToken:r,accessToken:i};return this.saveCacheRecord(s,e.correlationId)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof xn&&this.performanceClient&&t)try{const i=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:i.refreshToken.length,cacheIdCount:i.idToken.length,cacheAtCount:i.accessToken.length},t)}catch{}throw o}}}function ec(n,e,t,r){try{switch(e){case we.LocalStorage:return new rC(n,t,r);case we.SessionStorage:return new oC;case we.MemoryStorage:default:break}}catch(o){t.error(o)}return new xo}const gh=(n,e,t,r)=>{const o={cacheLocation:we.MemoryStorage,temporaryCacheLocation:we.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new io(n,o,ur,e,t,r)};/*! @azure/msal-browser v4.9.0 2025-03-25 */function ph(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function Ri(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function mh(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function Ch(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function yh(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function Th(n,e){e.setActiveAccount(n)}function Ah(n){return n.getActiveAccount()}/*! @azure/msal-browser v4.9.0 2025-03-25 */const iC="msal.broadcast.event";class wh{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Lt({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel(iC)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||qm();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){var s;const i={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};switch(e){case N.ACCOUNT_ADDED:case N.ACCOUNT_REMOVED:case N.ACTIVE_ACCOUNT_CHANGED:(s=this.broadcastChannel)==null||s.postMessage(i);break;default:this.invokeCallbacks(i);break}}invokeCallbacks(e){this.eventCallbacks.forEach(([t,r],o)=>{(r.length===0||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback ${o}: ${e.eventType}`),t.apply(null,[e]))})}invokeCrossTabCallbacks(e){const t=e.data;this.invokeCallbacks(t)}subscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){var e;(e=this.broadcastChannel)==null||e.removeEventListener("message",this.invokeCrossTabCallbacks)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class vh{constructor(e,t,r,o,i,s,a,c,l){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=i,this.navigationClient=s,this.nativeMessageHandler=c,this.correlationId=l||Qe(),this.logger=o.clone(Me.MSAL_SKU,Kn,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){ke.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(ke.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return j.getAbsoluteUrl(t,Mt())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new gr(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(f.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.requestAuthority||this.config.auth.authority,s=r!=null&&r.length?r==="true":this.config.auth.instanceAware,a=t&&s?this.config.auth.authority.replace(j.getDomainFromUrl(i),t.environment):i,c=Ie.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),l=await T(md,f.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(c,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!l.isAlias(t.environment))throw ne(Vl);return l}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function Gs(n,e,t,r){t.addQueueMeasurement(f.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,i=[...n&&n.scopes||[]],s={...n,correlationId:n.correlationId,authority:o,scopes:i};if(!s.authenticationScheme)s.authenticationScheme=J.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(s.authenticationScheme===J.SSH){if(!n.sshJwk)throw ne(vo);if(!n.sshKid)throw ne($l)}r.verbose(`Authentication Scheme set to "${s.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!st.isEmptyObj(n.claims)&&(s.requestedClaimsHash=await ch(n.claims)),s}async function sC(n,e,t,r,o){r.addQueueMeasurement(f.InitializeSilentRequest,n.correlationId);const i=await T(Gs,f.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...i,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Gn extends vh{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||Qe(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=j.getAbsoluteUrl(e.postLogoutRedirectUri,Mt())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=j.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Mt())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=j.getAbsoluteUrl(Mt(),Mt())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(f.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Ad(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}=e;this.performanceClient.addQueueMeasurement(f.StandardInteractionClientGetClientConfiguration,this.correlationId);const a=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:s}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:a,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Me.MSAL_SKU,version:Kn,cpu:C.EMPTY_STRING,os:C.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(f.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=Fn.setRequestState(this.browserCrypto,e&&e.state||C.EMPTY_STRING,o),a={...await T(Gs,f.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:i,nonce:e.nonce||Qe(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return a;const c=e.account||this.browserStorage.getActiveAccount();return c&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${c.homeAccountId}`,this.correlationId),a.account=c),a}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const aC="ContentError",Ih="user_switch";/*! @azure/msal-browser v4.9.0 2025-03-25 */const cC="USER_INTERACTION_REQUIRED",lC="USER_CANCEL",dC="NO_NETWORK",hC="PERSISTENT_ERROR",uC="DISABLED",fC="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v4.9.0 2025-03-25 */const gC=-2147186943,pC={[Ih]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class yt extends X{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,yt.prototype),this.name="NativeAuthError",this.ext=r}}function _n(n){if(n.ext&&n.ext.status&&(n.ext.status===hC||n.ext.status===uC)||n.ext&&n.ext.error&&n.ext.error===gC)return!0;switch(n.errorCode){case aC:return!0;default:return!1}}function Oi(n,e,t){if(t&&t.status)switch(t.status){case fC:return Ai(Cd);case cC:return new tt(n,e);case lC:return P(pr);case dC:return P(no)}return new yt(n,pC[n]||e,t)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class At{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(f.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:Sn.CHANNEL_ID,extensionId:this.extensionId,responseId:Qe(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new At(e,t,r,Sn.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const i=new At(e,t,r);return await i.sendHandshakeRequest(),i}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:Sn.CHANNEL_ID,extensionId:this.extensionId,responseId:Qe(),body:{method:ln.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(P(Wd)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==Sn.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===ln.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(P(Yd))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const i=t.body.method;if(i===ln.Response){if(!r)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")r.reject(Oi(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?r.reject(Oi(s.result.code,s.result.description,s.result.ext)):r.resolve(s.result);else throw dl(Ji,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(i===ln.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(i){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${i}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(i):o&&o.reject(i)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isPlatformBrokerAvailable(e,t,r,o){if(t.trace("isPlatformBrokerAvailable called"),!e.system.allowPlatformBroker)return t.trace("isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false"),!1;if(!r)return t.trace("isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false"),!1;if(o)switch(o){case J.BEARER:case J.POP:return t.trace("isPlatformBrokerAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isPlatformBrokerAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function mC(n,e){if(!e)return null;try{return Fn.parseRequestState(n,e).libraryState.meta}catch{throw w(Ln)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function so(n,e,t){const r=Qr(n);if(!r)throw Wl(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),P(kd)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),P(bd));return r}function CC(n,e,t){if(!n.state)throw P(ks);const r=mC(e,n.state);if(!r)throw P(Rd);if(r.interactionType!==t)throw P(Od)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Eh{constructor(e,t,r,o,i){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=i}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(f.HandleCodeResponse,t.correlationId);let r;try{r=rm(e,t.state)}catch(o){throw o instanceof nn&&o.subError===pr?P(pr):o}return T(this.handleCodeResponseFromServer.bind(this),f.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(f.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await T(this.authModule.updateAuthority.bind(this.authModule),f.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const i=this.createCcsCredentials(t);i&&(this.authCodeRequest.ccsCredential=i)}return await T(this.authModule.acquireToken.bind(this.authModule),f.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:ot.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:ot.UPN}:null}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class _h extends Gn{async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(oe.acquireTokenSilent_silentFlow),r=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new em(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const s=(await T(o.acquireCachedToken.bind(o),f.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),s}catch(i){throw i instanceof Tr&&i.errorCode===Rs&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),i}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Dr extends vh{constructor(e,t,r,o,i,s,a,c,l,d,h,p){var k;super(e,t,r,o,i,s,c,l,p),this.apiId=a,this.accountId=d,this.nativeMessageHandler=l,this.nativeStorageManager=h,this.silentCacheClient=new _h(e,this.nativeStorageManager,r,o,i,s,c,l,p);const y=this.nativeMessageHandler.getExtensionId()===Sn.PREFERRED_EXTENSION_ID?"chrome":(k=this.nativeMessageHandler.getExtensionId())!=null&&k.length?"unknown":void 0;this.skus=gr.makeExtraSkuString({libraryName:Me.MSAL_SKU,libraryVersion:Kn,extensionName:y,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[Ip]:this.skus}}async acquireToken(e,t){this.performanceClient.addQueueMeasurement(f.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const r=this.performanceClient.startMeasurement(f.NativeInteractionClientAcquireToken,e.correlationId),o=Ue(),i=this.initializeServerTelemetryManager(this.apiId);try{const s=await this.initializeNativeRequest(e);try{const h=await this.acquireTokensFromCache(this.accountId,s);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),h}catch(h){if(t===Ce.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy"),h;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=s,c={method:ln.GetToken,request:a},l=await this.nativeMessageHandler.sendMessage(c),d=this.validateNativeResponse(l);return await this.handleNativeResponse(d,s,o).then(h=>(r.end({success:!0,isNativeBroker:!0,requestId:h.requestId}),i.clearNativeBrokerErrorCode(),h)).catch(h=>{throw r.end({success:!1,errorCode:h.errorCode,subErrorCode:h.subError,isNativeBroker:!0}),h})}catch(s){throw s instanceof yt&&i.setNativeBrokerErrorCode(s.errorCode),s}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:ue.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),w(jr);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw w(jr);try{const o=this.createSilentCacheRequest(t,r),i=await this.silentCacheClient.acquireToken(o),s={...r,idTokenClaims:i==null?void 0:i.idTokenClaims,idToken:i==null?void 0:i.idToken};return{...i,account:s}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),i={method:ln.GetToken,request:o};try{const c=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(c)}catch(c){if(c instanceof yt&&(this.initializeServerTelemetryManager(this.apiId).setNativeBrokerErrorCode(c.errorCode),_n(c)))throw c}this.browserStorage.setTemporaryCache(fe.NATIVE_REQUEST,JSON.stringify(o),!0);const s={apiId:oe.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,s)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...i}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(fe.NATIVE_REQUEST));const s={method:ln.GetToken,request:i},a=Ue();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const c=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(c);const d=await this.handleNativeResponse(c,i,a);return this.initializeServerTelemetryManager(this.apiId).clearNativeBrokerErrorCode(),d}catch(c){throw c}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var d,h;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Jt(e.id_token,at),i=this.createHomeAccountIdentifier(e,o),s=(d=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:d.homeAccountId;if((h=t.extraParameters)!=null&&h.child_client_id&&e.account.id!==t.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch");else if(i!==s&&e.account.id!==t.accountId)throw Oi(Ih);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),c=Is(this.browserStorage,a,i,at,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger);e.expires_in=Number(e.expires_in);const l=await this.generateAuthenticationResult(e,t,o,c,a.canonicalAuthority,r);return await this.cacheAccount(c),await this.cacheNativeTokens(e,t,i,o,e.access_token,l.tenantId,r),l}createHomeAccountIdentifier(e,t){return ke.generateHomeAccountId(e.client_info||C.EMPTY_STRING,rt.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?ue.fromString(e.scope):ue.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===J.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Un(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw w(rs);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,i,s){const a=this.addTelemetryFromNativeResponse(e),c=e.scope?ue.fromString(e.scope):ue.fromString(t.scope),l=e.account.properties||{},d=l.UID||r.oid||r.sub||C.EMPTY_STRING,h=l.TenantId||r.tid||C.EMPTY_STRING,p=ls(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const y=await this.generatePopAccessToken(e,t),k=t.tokenType===J.POP?J.POP:J.BEARER;return{authority:i,uniqueId:d,tenantId:h,scopes:c.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:y,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:Ht(s+e.expires_in),tokenType:k,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}async cacheAccount(e){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,i,s,a){const c=yo(r,t.authority,e.id_token||"",t.clientId,o.tid||""),l=t.tokenType===J.POP?C.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,d=a+l,h=this.generateScopes(e,t),p=To(r,t.authority,i,t.clientId,o.tid||s,h.printScopes(),d,0,at,void 0,t.tokenType,void 0,t.keyId),y={idToken:c,accessToken:p};return this.nativeStorageManager.saveCacheRecord(y,this.correlationId,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw dl(Ji,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new j(t);r.validateAsUri();const{scopes:o,...i}=e,s=new ue(o||[]);s.appendScopes(yn);const a=()=>{switch(this.apiId){case oe.ssoSilent:case oe.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Ae.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Ae.NONE:case Ae.CONSENT:case Ae.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),P(Qd)}},c={...i,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw P(Xd);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=Sn.MATS_TELEMETRY,e.authenticationScheme===J.POP){const l={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},d=new Un(this.browserCrypto);let h;if(c.keyId)h=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const p=await T(d.generateCnf.bind(d),f.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(l,this.logger);h=p.reqCnfString,c.keyId=p.kid,c.signPopToken=!0}c.reqCnf=h}return this.addRequestSKUs(c),c}handleExtraBrokerParams(e){var i;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(Xr)&&e.extraParameters.hasOwnProperty(Zr)&&e.extraParameters.hasOwnProperty(gn);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Zr],r=e.extraParameters[gn]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(i=this.performanceClient)==null||i.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function Sh(n,e,t,r,o){const i=nm({...n.auth,authority:e},t,r,o);if(Cs(i,{sku:Me.MSAL_SKU,version:Kn,os:"",cpu:""}),n.auth.protocolMode!==He.OIDC&&ys(i,n.telemetry.application),t.platformBroker&&(bp(i),t.authenticationScheme===J.POP)){const s=new It(r,o),a=new Un(s);let c;t.popKid?c=s.encodeKid(t.popKid):c=(await T(a.generateCnf.bind(a),f.PopTokenGenerateCnf,r,o,t.correlationId)(t,r)).reqCnfString,As(i,c)}return Eo(i,t.correlationId,o),i}async function $s(n,e,t,r,o){if(!t.codeChallenge)throw ne(wo);const i=await T(Sh,f.GetStandardParams,r,o,t.correlationId)(n,e,t,r,o);return rd(i,cl.CODE),Mp(i,t.codeChallenge,C.S256_CODE_CHALLENGE_METHOD),hn(i,t.extraQueryParameters||{}),wd(e,i)}async function zs(n,e,t,r,o,i){if(!r.earJwk)throw P(bs);const s=await Sh(e,t,r,o,i);rd(s,cl.IDTOKEN_TOKEN_REFRESHTOKEN),Dp(s,r.earJwk);const a=new Map;hn(a,r.extraQueryParameters||{});const c=wd(t,a);return yC(n,c,s)}function yC(n,e,t){const r=n.createElement("form");return r.method="post",r.action=e,t.forEach((o,i)=>{const s=n.createElement("input");s.hidden=!0,s.name=i,s.value=o,r.appendChild(s)}),n.body.appendChild(r),r}async function bh(n,e,t,r,o,i,s,a,c,l){if(!l)throw P(Ps);const d=new It(a,c),h=new Dr(r,o,d,a,s,r.system.navigationClient,t,c,l,e,i,n.correlationId),{userRequestState:p}=Fn.parseRequestState(d,n.state);return T(h.acquireToken.bind(h),f.NativeInteractionClientAcquireToken,a,c,n.correlationId)({...n,state:p,prompt:void 0})}async function qs(n,e,t,r,o,i,s,a,c,l,d,h){if(Ct.removeThrottle(s,o.auth.clientId,n),e.accountId)return T(bh,f.HandleResponsePlatformBroker,l,d,n.correlationId)(n,e.accountId,r,o,s,a,c,l,d,h);const p={...n,code:e.code||"",codeVerifier:t},y=new Eh(i,s,p,l,d);return await T(y.handleCodeResponse.bind(y),f.HandleCodeResponse,l,d,n.correlationId)(e,n)}async function Vs(n,e,t,r,o,i,s,a,c,l,d){if(Ct.removeThrottle(i,r.auth.clientId,n),vd(e,n.state),!e.ear_jwe)throw P(Sd);if(!n.earJwk)throw P(bs);const h=JSON.parse(await T(Mm,f.DecryptEarResponse,c,l,n.correlationId)(n.earJwk,e.ear_jwe));if(h.accountId)return T(bh,f.HandleResponsePlatformBroker,c,l,n.correlationId)(n,h.accountId,t,r,i,s,a,c,l,d);const p=new pn(r.auth.clientId,i,new It(c,l),c,null,null,l);p.validateTokenResponse(h);const y={code:"",state:n.state,nonce:n.nonce,client_info:h.client_info,cloud_graph_host_name:h.cloud_graph_host_name,cloud_instance_host_name:h.cloud_instance_host_name,cloud_instance_name:h.cloud_instance_name,msgraph_host:h.msgraph_host};return await T(p.handleServerTokenResponse.bind(p),f.HandleServerTokenResponse,c,l,n.correlationId)(h,o,Ue(),n,y,void 0,void 0,void 0,void 0)}/*! @azure/msal-browser v4.9.0 2025-03-25 */const TC=32;async function Ho(n,e,t){n.addQueueMeasurement(f.GeneratePkceCodes,t);const r=ct(AC,f.GenerateCodeVerifier,e,n,t)(n,e,t),o=await T(wC,f.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function AC(n,e,t){try{const r=new Uint8Array(TC);return ct(km,f.GetRandomValues,e,n,t)(r),Xt(r)}catch{throw P(Ss)}}async function wC(n,e,t,r){e.addQueueMeasurement(f.GenerateCodeChallengeFromVerifier,r);try{const o=await T(ih,f.Sha256Digest,t,e,r)(n,e,r);return Xt(new Uint8Array(o))}catch{throw P(Ss)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class vC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,a,l,d),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=c,this.eventHandler=i}acquireToken(e,t){try{const o={popupName:this.generatePopupName(e.scopes||yn,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.performanceClient.addFields({isAsyncPopup:this.config.system.asyncPopups},this.correlationId),this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,o,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),o.popup=this.openSizedPopup("about:blank",o),this.acquireTokenPopupAsync(e,o,t))}catch(r){return Promise.reject(r)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,i=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,i)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,i))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t,r){this.logger.verbose("acquireTokenPopupAsync called");const o=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,M.Popup);t.popup&&uh(o.authority);const i=At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);return o.platformBroker=i,this.config.auth.protocolMode===He.EAR?this.executeEarFlow(o,t):this.executeCodeFlow(o,t,r)}async executeCodeFlow(e,t,r){var c;const o=e.correlationId,i=this.initializeServerTelemetryManager(oe.acquireTokenPopup),s=r||await T(Ho,f.GeneratePkceCodes,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),a={...e,codeChallenge:s.challenge};try{const l=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,o)({serverTelemetryManager:i,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account}),d=await T($s,f.GetAuthCodeUrl,this.logger,this.performanceClient,o)(this.config,l.authority,a,this.logger,this.performanceClient),h=this.initiateAuthRequest(d,t);this.eventHandler.emitEvent(N.POPUP_OPENED,M.Popup,{popupWindow:h},null);const p=await this.monitorPopupForHash(h,t.popupWindowParent),y=ct(so,f.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(p,this.config.auth.OIDCOptions.serverResponseType,this.logger);return await T(qs,f.HandleResponseCode,this.logger,this.performanceClient,o)(e,y,s.verifier,oe.acquireTokenPopup,this.config,l,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}catch(l){throw(c=t.popup)==null||c.close(),l instanceof X&&(l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l)),l}}async executeEarFlow(e,t){const r=e.correlationId,o=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,r)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),i=await T(Ls,f.GenerateEarKey,this.logger,this.performanceClient,r)(),s={...e,earJwk:i},a=t.popup||this.openPopup("about:blank",t);(await zs(a.document,this.config,o,s,this.logger,this.performanceClient)).submit();const l=await T(this.monitorPopupForHash.bind(this),f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,t.popupWindowParent),d=ct(so,f.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(l,this.config.auth.OIDCOptions.serverResponseType,this.logger);return T(Vs,f.HandleResponseEar,this.logger,this.performanceClient,r)(s,d,oe.acquireTokenPopup,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}async logoutPopupAsync(e,t,r,o){var s,a,c,l;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(N.LOGOUT_START,M.Popup,e);const i=this.initializeServerTelemetryManager(oe.logoutPopup);try{await this.clearCacheOnLogout(e.account);const d=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:r,account:e.account||void 0});try{d.authority.endSessionEndpoint}catch{if((s=e.account)!=null&&s.homeAccountId&&e.postLogoutRedirectUri&&d.authority.protocolMode===He.OIDC){if(this.browserStorage.removeAccount((a=e.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Popup,e),o){const y={apiId:oe.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},k=j.getAbsoluteUrl(o,Mt());await this.navigationClient.navigateInternal(k,y)}(c=t.popup)==null||c.close();return}}const h=d.getLogoutUri(e);this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Popup,e);const p=this.openPopup(h,t);if(this.eventHandler.emitEvent(N.POPUP_OPENED,M.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const y={apiId:oe.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},k=j.getAbsoluteUrl(o,Mt());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${k}`),await this.navigationClient.navigateInternal(k,y)}else this.logger.verbose("No main window navigation requested")}catch(d){throw(l=t.popup)==null||l.close(),d instanceof X&&(d.setCorrelationId(this.correlationId),i.cacheFailedRequest(d)),this.eventHandler.emitEvent(N.LOGOUT_FAILURE,M.Popup,null,d),this.eventHandler.emitEvent(N.LOGOUT_END,M.Popup),d}this.eventHandler.emitEvent(N.LOGOUT_END,M.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),P(Oo)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const i=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(i),o(P(pr));return}let s="";try{s=e.location.href}catch{}if(!s||s==="about:blank")return;clearInterval(i);let a="";const c=this.config.auth.OIDCOptions.serverResponseType;e&&(c===Co.QUERY?a=e.location.search:a=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(a)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw P(Md);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),P(Nd)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var y,k,b,$;const i=o.screenLeft?o.screenLeft:o.screenX,s=o.screenTop?o.screenTop:o.screenY,a=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(y=r.popupSize)==null?void 0:y.width,d=(k=r.popupSize)==null?void 0:k.height,h=(b=r.popupPosition)==null?void 0:b.top,p=($=r.popupPosition)==null?void 0:$.left;return(!l||l<0||l>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=Me.POPUP_WIDTH),(!d||d<0||d>c)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),d=Me.POPUP_HEIGHT),(!h||h<0||h>c)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),h=Math.max(0,c/2-Me.POPUP_HEIGHT/2+s)),(!p||p<0||p>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,a/2-Me.POPUP_WIDTH/2+i)),o.open(e,t,`width=${l}, height=${d}, top=${h}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow)}generatePopupName(e,t){return`${Me.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Me.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function IC(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class EC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,a,l,d),this.nativeStorage=c}async acquireToken(e){const t=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,M.Redirect);t.platformBroker=At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);const r=i=>{i.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.resetRequestCache(),this.eventHandler.emitEvent(N.RESTORE_FROM_BFCACHE,M.Redirect))},o=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii(`Redirect start page: ${o}`),this.browserStorage.setTemporaryCache(fe.ORIGIN_URI,o,!0),window.addEventListener("pageshow",r);try{this.config.auth.protocolMode===He.EAR?await this.executeEarFlow(t):await this.executeCodeFlow(t,e.onRedirectNavigate)}catch(i){throw i instanceof X&&i.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",r),i}}async executeCodeFlow(e,t){const r=e.correlationId,o=this.initializeServerTelemetryManager(oe.acquireTokenRedirect),i=await T(Ho,f.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),s={...e,codeChallenge:i.challenge};this.browserStorage.cacheAuthorizeRequest(s,i.verifier);try{const a=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:s.authority,requestAzureCloudOptions:s.azureCloudOptions,requestExtraQueryParameters:s.extraQueryParameters,account:s.account}),c=await T($s,f.GetAuthCodeUrl,this.logger,this.performanceClient,e.correlationId)(this.config,a.authority,s,this.logger,this.performanceClient);return await this.initiateAuthRequest(c,t)}catch(a){throw a instanceof X&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),a}}async executeEarFlow(e){const t=e.correlationId,r=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await T(Ls,f.GenerateEarKey,this.logger,this.performanceClient,t)(),i={...e,earJwk:o};this.browserStorage.cacheAuthorizeRequest(i),(await zs(document,this.config,r,i,this.logger,this.performanceClient)).submit()}async handleRedirectPromise(e="",t,r,o){const i=this.initializeServerTelemetryManager(oe.handleRedirectPromise);try{const[s,a]=this.getRedirectResponse(e||"");if(!s)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.resetRequestCache(),IC()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(fe.ORIGIN_URI,!0)||C.EMPTY_STRING,l=j.removeHashFromUrl(c),d=j.removeHashFromUrl(window.location.href);if(l===d&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&Fm(c),await this.handleResponse(s,t,r,i);if(this.config.auth.navigateToLoginRequestUrl){if(!Bs()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(fe.URL_HASH,a,!0);const h={apiId:oe.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let p=!0;if(!c||c==="null"){const y=Km();this.browserStorage.setTemporaryCache(fe.ORIGIN_URI,y,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),p=await this.navigationClient.navigateInternal(y,h)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),p=await this.navigationClient.navigateInternal(c,h);if(!p)return await this.handleResponse(s,t,r,i)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(s,t,r,i);return null}catch(s){throw s instanceof X&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),s}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Co.QUERY?t=window.location.search:t=window.location.hash);let r=Qr(t);if(r){try{CC(r,this.browserCrypto,M.Redirect)}catch(i){return i instanceof X&&this.logger.error(`Interaction type validation failed due to ${i.errorCode}: ${i.errorMessage}`),[null,""]}return Dm(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(fe.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(fe.URL_HASH)),o&&(r=Qr(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t,r,o){if(!e.state)throw P(ks);if(e.ear_jwe){const a=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t.correlationId)({requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account});return T(Vs,f.HandleResponseEar,this.logger,this.performanceClient,t.correlationId)(t,e,oe.acquireTokenRedirect,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}const s=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:t.authority});return T(qs,f.HandleResponseCode,this.logger,this.performanceClient,t.correlationId)(t,e,r,oe.acquireTokenRedirect,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:oe.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=t||this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),o(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await this.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await this.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),P(Oo)}async logout(e){var o,i;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(oe.logout);try{this.eventHandler.emitEvent(N.LOGOUT_START,M.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:oe.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(a.authority.protocolMode===He.OIDC)try{a.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((i=t.account)==null?void 0:i.homeAccountId),this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Redirect,t);return}}const c=a.getLogoutUri(t);if(this.eventHandler.emitEvent(N.LOGOUT_SUCCESS,M.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(c)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(c,s);return}}catch(s){throw s instanceof X&&(s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s)),this.eventHandler.emitEvent(N.LOGOUT_FAILURE,M.Redirect,null,s),this.eventHandler.emitEvent(N.LOGOUT_END,M.Redirect),s}this.eventHandler.emitEvent(N.LOGOUT_END,M.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return j.getAbsoluteUrl(t,Mt())}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function _C(n,e,t,r,o){if(e.addQueueMeasurement(f.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),P(Oo);return o?T(bC,f.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):ct(kC,f.SilentHandlerLoadFrameSync,t,e,r)(n)}async function SC(n,e,t,r,o){const i=js();if(!i.contentDocument)throw"No document associated with iframe!";return(await zs(i.contentDocument,n,e,t,r,o)).submit(),i}async function tc(n,e,t,r,o,i,s){return r.addQueueMeasurement(f.SilentHandlerMonitorIframeForHash,i),new Promise((a,c)=>{e<_i&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${_i}ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(d),c(P(xd))},e),d=window.setInterval(()=>{let h="";const p=n.contentWindow;try{h=p?p.location.href:""}catch{}if(!h||h==="about:blank")return;let y="";p&&(s===Co.QUERY?y=p.location.search:y=p.location.hash),window.clearTimeout(l),window.clearInterval(d),a(y)},t)}).finally(()=>{ct(RC,f.RemoveHiddenIframe,o,r,i)(n)})}function bC(n,e,t,r){return t.addQueueMeasurement(f.SilentHandlerLoadFrame,r),new Promise((o,i)=>{const s=js();window.setTimeout(()=>{if(!s){i("Unable to load iframe");return}s.src=n,o(s)},e)})}function kC(n){const e=js();return e.src=n,e}function js(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function RC(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class OC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d,h){super(e,t,r,o,i,s,c,d,h),this.apiId=a,this.nativeStorage=l}async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Ae.NONE&&t.prompt!==Ae.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Ae.NONE}`),t.prompt=Ae.NONE):t.prompt=Ae.NONE;const r=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,M.Silent);return r.platformBroker=At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme),uh(r.authority),this.config.auth.protocolMode===He.EAR?this.executeEarFlow(r):this.executeCodeFlow(r)}async executeCodeFlow(e){let t;const r=this.initializeServerTelemetryManager(this.apiId);try{return t=await T(this.createAuthCodeClient.bind(this),f.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await T(this.silentTokenHelper.bind(this),f.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(t,e)}catch(o){if(o instanceof X&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),!t||!(o instanceof X)||o.errorCode!==Me.INVALID_GRANT_ERROR)throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await T(this.silentTokenHelper.bind(this),f.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(t,e)}}async executeEarFlow(e){const t=e.correlationId,r=await T(this.getDiscoveredAuthority.bind(this),f.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,t)({requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),o=await T(Ls,f.GenerateEarKey,this.logger,this.performanceClient,t)(),i={...e,earJwk:o},s=await T(SC,f.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,t)(this.config,r,i,this.logger,this.performanceClient),a=this.config.auth.OIDCOptions.serverResponseType,c=await T(tc,f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,t)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,t,a),l=ct(so,f.DeserializeResponse,this.logger,this.performanceClient,t)(c,a,this.logger);return T(Vs,f.HandleResponseEar,this.logger,this.performanceClient,t)(i,l,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}logout(){return Promise.reject(P(Po))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(f.SilentIframeClientTokenHelper,r);const o=await T(Ho,f.GeneratePkceCodes,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),i={...t,codeChallenge:o.challenge},s=await T($s,f.GetAuthCodeUrl,this.logger,this.performanceClient,r)(this.config,e.authority,i,this.logger,this.performanceClient),a=await T(_C,f.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(s,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),c=this.config.auth.OIDCOptions.serverResponseType,l=await T(tc,f.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,c),d=ct(so,f.DeserializeResponse,this.logger,this.performanceClient,r)(l,c,this.logger);return T(qs,f.HandleResponseCode,this.logger,this.performanceClient,r)(t,d,o.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.nativeMessageHandler)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class PC extends Gn{async acquireToken(e){this.performanceClient.addQueueMeasurement(f.SilentRefreshClientAcquireToken,e.correlationId);const t=await T(Gs,f.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(oe.acquireTokenSilent_silentFlow),i=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return T(i.acquireTokenByRefreshToken.bind(i),f.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(s=>{throw s.setCorrelationId(this.correlationId),o.cacheFailedRequest(s),s})}logout(){return Promise.reject(P(Po))}async createRefreshTokenClient(e){const t=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Zp(t,this.performanceClient)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class NC{constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}async loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw P(No);const o=e.correlationId||Qe(),i=t.id_token?Jt(t.id_token,at):void 0,s={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.authority?new Ie(Ie.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Qe()):void 0,c=await this.loadAccount(e,r.clientInfo||t.client_info||"",o,i,a),l=await this.loadIdToken(t,c.homeAccountId,c.environment,c.realm,o),d=await this.loadAccessToken(e,t,c.homeAccountId,c.environment,c.realm,r,o),h=await this.loadRefreshToken(t,c.homeAccountId,c.environment,o);return this.generateAuthenticationResult(e,{account:c,idToken:l,accessToken:d,refreshToken:h},i,a)}async loadAccount(e,t,r,o,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const l=ke.createFromAccountInfo(e.account);return await this.storage.setAccount(l,r),l}else if(!i||!t&&!o)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),P($d);const s=ke.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,o),a=o==null?void 0:o.tid,c=Is(this.storage,i,s,at,o,t,i.hostnameAndPort,a,void 0,void 0,this.logger);return await this.storage.setAccount(c,r),c}async loadIdToken(e,t,r,o,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=yo(t,r,e.id_token,this.config.auth.clientId,o);return await this.storage.setIdTokenCredential(s,i),s}async loadAccessToken(e,t,r,o,i,s,a){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const c=t.scope?ue.fromString(t.scope):new ue(e.scopes),l=s.expiresOn||t.expires_in+Ue(),d=s.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+Ue(),h=To(r,o,t.access_token,this.config.auth.clientId,i,c.printScopes(),l,d,at);return await this.storage.setAccessTokenCredential(h,a),h}async loadRefreshToken(e,t,r,o){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Nl(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return await this.storage.setRefreshTokenCredential(i,o),i}generateAuthenticationResult(e,t,r,o){var d,h,p;let i="",s=[],a=null,c;t!=null&&t.accessToken&&(i=t.accessToken.secret,s=ue.fromString(t.accessToken.target).asArray(),a=Ht(t.accessToken.expiresOn),c=Ht(t.accessToken.extendedExpiresOn));const l=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:l.getAccountInfo(),idToken:((d=t.idToken)==null?void 0:d.secret)||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:c,familyId:((h=t.refreshToken)==null?void 0:h.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:l.cloudGraphHostName||"",msGraphHost:l.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class MC extends Ad{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class xC extends Gn{constructor(e,t,r,o,i,s,a,c,l,d){super(e,t,r,o,i,s,c,l,d),this.apiId=a}async acquireToken(e){if(!e.code)throw P(zd);const t=await T(this.initializeAuthorizationRequest.bind(this),f.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,M.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},i=await T(this.getClientConfiguration.bind(this),f.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),s=new MC(i);this.logger.verbose("Auth code client created");const a=new Eh(s,this.browserStorage,o,this.logger,this.performanceClient);return await T(a.handleCodeResponseFromServer.bind(a),f.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof X&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(P(Po))}}/*! @azure/msal-browser v4.9.0 2025-03-25 */function ft(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Nr(n,e){try{Ks(n)}catch(t){throw e.end({success:!1},t),t}}class Lo{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new It(this.logger,this.performanceClient):ur,this.eventHandler=new wh(this.logger),this.browserStorage=this.isBrowserEnvironment?new io(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,pd(this.config.auth)):gh(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const t={cacheLocation:we.MemoryStorage,temporaryCacheLocation:we.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new io(this.config.auth.clientId,t,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.tokenCache=new NC(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,t){const r=new Lo(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(N.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowPlatformBroker,o=this.performanceClient.startMeasurement(f.InitializeClientApplication,t);if(this.eventHandler.emitEvent(N.INITIALIZE_START),await T(this.browserStorage.initialize.bind(this.browserStorage),f.InitializeCache,this.logger,this.performanceClient,t)(t),r)try{this.nativeExtensionProvider=await At.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await T(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),f.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(t),this.initialized=!0,this.eventHandler.emitEvent(N.INITIALIZE_END),o.end({allowPlatformBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),hh(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e;let i=this.performanceClient.startMeasurement(f.AcquireTokenRedirect,(r==null?void 0:r.correlationId)||"");this.eventHandler.emitEvent(N.HANDLE_REDIRECT_START,M.Redirect);let s;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const a=new Dr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,oe.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);s=T(a.handleRedirectPromise.bind(a),f.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(this.performanceClient,i.event.correlationId)}else{const[a,c]=this.browserStorage.getCachedRequest(),l=a.correlationId;i.discard(),i=this.performanceClient.startMeasurement(f.AcquireTokenRedirect,l),this.logger.trace("handleRedirectPromise - acquiring token from web flow");const d=this.createRedirectClient(l);s=T(d.handleRedirectPromise.bind(d),f.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,i.event.correlationId)(e,a,c,i)}return s.then(a=>(a?(this.browserStorage.resetRequestCache(),t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(N.LOGIN_SUCCESS,M.Redirect,a),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Redirect,a),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),i.end({success:!0,accountType:ft(a.account)})):i.event.errorCode?i.end({success:!1}):i.discard(),this.eventHandler.emitEvent(N.HANDLE_REDIRECT_END,M.Redirect),a)).catch(a=>{this.browserStorage.resetRequestCache();const c=a;throw t.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Redirect,null,c):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Redirect,null,c),this.eventHandler.emitEvent(N.HANDLE_REDIRECT_END,M.Redirect),i.end({success:!1},c),a})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(f.AcquireTokenPreRedirect,t);r.add({accountType:ft(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=s=>{const a=typeof o=="function"?o(s):void 0;return a!==!1?r.end({success:!0}):r.discard(),a};else{const s=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=a=>{const c=typeof s=="function"?s(a):void 0;return c!==!1?r.end({success:!0}):r.discard(),c}}const i=this.getAllAccounts().length>0;try{Ya(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Redirect,e):this.eventHandler.emitEvent(N.LOGIN_START,M.Redirect,e);let s;return this.nativeExtensionProvider&&this.canUsePlatformBroker(e)?s=new Dr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,oe.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(c=>{if(c instanceof yt&&_n(c))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(c instanceof tt)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw c}):s=this.createRedirectClient(t).acquireToken(e),await s}catch(s){throw this.browserStorage.resetRequestCache(),r.end({success:!1},s),i?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Redirect,null,s):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Redirect,null,s),s}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(f.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:ft(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Nr(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(a){return Promise.reject(a)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Popup,e):this.eventHandler.emitEvent(N.LOGIN_START,M.Popup,e);let i;const s=this.getPreGeneratedPkceCodes(t);return this.canUsePlatformBroker(e)?i=this.acquireTokenNative({...e,correlationId:t},oe.acquireTokenPopup).then(a=>(r.end({success:!0,isNativeBroker:!0,accountType:ft(a.account)}),a)).catch(a=>{if(a instanceof yt&&_n(a))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e,s);if(a instanceof tt)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e,s);throw a}):i=this.createPopupClient(t).acquireToken(e,s),i.then(a=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(N.LOGIN_SUCCESS,M.Popup,a):this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Popup,a),r.end({success:!0,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:ft(a.account)}),a)).catch(a=>(o.length>0?this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Popup,null,a):this.eventHandler.emitEvent(N.LOGIN_FAILURE,M.Popup,null,a),r.end({success:!1},a),Promise.reject(a))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.asyncPopups&&await this.preGeneratePkceCodes(t)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var i,s;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(f.SsoSilent,t),(i=this.ssoSilentMeasurement)==null||i.add({scenarioId:e.scenarioId,accountType:ft(e.account)}),Nr(this.initialized,this.ssoSilentMeasurement),(s=this.ssoSilentMeasurement)==null||s.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(N.SSO_SILENT_START,M.Silent,r);let o;return this.canUsePlatformBroker(r)?o=this.acquireTokenNative(r,oe.ssoSilent).catch(a=>{if(a instanceof yt&&_n(a))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw a}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(a=>{var c;return this.eventHandler.emitEvent(N.SSO_SILENT_SUCCESS,M.Silent,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!0,isNativeBroker:a.fromNativeBroker,accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length,accountType:ft(a.account)}),a}).catch(a=>{var c;throw this.eventHandler.emitEvent(N.SSO_SILENT_FAILURE,M.Silent,null,a),(c=this.ssoSilentMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(f.AcquireTokenByCode,t);Nr(this.initialized,r),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_START,M.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw P(Vd);if(e.code){const o=e.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),i=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_SUCCESS,M.Silent,s),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:s.fromNativeBroker,accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length,accountType:ft(s.account)}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_FAILURE,M.Silent,null,s),r.end({success:!1},s),s}),this.hybridAuthCodeResponses.set(o,i)),await i}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},oe.acquireTokenByCode,e.nativeAccountId).catch(i=>{throw i instanceof yt&&_n(i)&&(this.nativeExtensionProvider=void 0),i});return r.end({accountType:ft(o.account),success:!0}),o}else throw P(jd);else throw P(qd)}catch(o){throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_BY_CODE_FAILURE,M.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(f.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(i=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker}),i}).catch(i=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!1},i),i}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(f.AcquireTokenFromCache,e.correlationId),t){case Ce.Default:case Ce.AccessToken:case Ce.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return T(r.acquireToken.bind(r),f.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw w(Wt)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(f.AcquireTokenByRefreshToken,e.correlationId),t){case Ce.Default:case Ce.AccessTokenAndRefreshToken:case Ce.RefreshToken:case Ce.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return T(r.acquireToken.bind(r),f.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw w(Wt)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(f.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return T(t.acquireToken.bind(t),f.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return Ya(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Ks(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return ph(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return Ri(e,this.logger,this.browserStorage)}getAccountByUsername(e){return mh(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return Ch(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return yh(e,this.logger,this.browserStorage)}setActiveAccount(e){Th(e,this.browserStorage)}getActiveAccount(){return Ah(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=ke.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r,o){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw P(Ps);return new Dr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e,o)}canUsePlatformBroker(e,t){if(this.logger.trace("canUsePlatformBroker called"),!At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isPlatformBrokerAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Ae.NONE:case Ae.CONSENT:case Ae.LOGIN:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow");break;default:return this.logger.trace(`canUsePlatformBroker: prompt = ${e.prompt} is not compatible with platform broker flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new vC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new EC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new OC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,oe.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new _h(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new PC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new xC(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,oe.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return dh(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){if(this.config.cache.cacheLocation!==we.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.subscribeCrossTab()}disableAccountStorageEvents(){if(this.config.cache.cacheLocation!==we.LocalStorage){this.logger.info("Account storage events are only available when cacheLocation is set to localStorage");return}this.eventHandler.unsubscribeCrossTab()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Qe():C.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Ii})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Ii})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(f.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Nr(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw P(Dd);return r.add({accountType:ft(o)}),this.acquireTokenSilentDeduped(e,o,t).then(i=>(r.end({success:!0,fromCache:i.fromCache,isNativeBroker:i.fromNativeBroker,accessTokenSize:i.accessToken.length,idTokenSize:i.idToken.length}),{...i,state:e.state,correlationId:t})).catch(i=>{throw i instanceof X&&i.setCorrelationId(t),r.end({success:!1},i),i})}async acquireTokenSilentDeduped(e,t,r){const o=bo(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},t.homeAccountId),i=JSON.stringify(o),s=this.activeSilentTokenRequests.get(i);if(typeof s>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const a=T(this.acquireTokenSilentAsync.bind(this),f.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},t);return this.activeSilentTokenRequests.set(i,a),a.finally(()=>{this.activeSilentTokenRequests.delete(i)})}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),s}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(f.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await T(sC,f.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),i=e.cacheLookupPolicy||Ce.Default;return this.acquireTokenSilentNoIframe(o,i).catch(async a=>{if(HC(a,i))if(this.activeIframeRequest)if(i!==Ce.Skip){const[l,d]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${d}`,o.correlationId);const h=this.performanceClient.startMeasurement(f.AwaitConcurrentIframe,o.correlationId);h.add({awaitIframeCorrelationId:d});const p=await l;if(h.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${d} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${d} failed. Interaction is required.`),a}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),T(this.acquireTokenBySilentIframe.bind(this),f.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let l;return this.activeIframeRequest=[new Promise(d=>{l=d}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),T(this.acquireTokenBySilentIframe.bind(this),f.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(d=>(l(!0),d)).catch(d=>{throw l(!1),d}).finally(()=>{this.activeIframeRequest=void 0})}else throw a}).then(a=>(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,a),e.correlationId&&this.performanceClient.addFields({fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker},e.correlationId),a)).catch(a=>{throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null,a),a}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return At.isPlatformBrokerAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,oe.acquireTokenSilent_silentFlow,e.account.nativeAccountId,t).catch(async r=>{throw r instanceof yt&&_n(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,w(Wt)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),t===Ce.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache"),T(this.acquireTokenFromCache.bind(this),f.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Ce.AccessToken)throw r;return this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_NETWORK_START,M.Silent,e),T(this.acquireTokenByRefreshToken.bind(this),f.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes"),this.pkceCode=await T(Ho,f.GeneratePkceCodes,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes");const t=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`${t?"Found":"Did not find"} pre-generated PKCE codes`),this.performanceClient.addFields({usePreGeneratedPkce:!!t},e),t}}function HC(n,e){const t=!(n instanceof tt&&n.subError!==Ro),r=n.errorCode===Me.INVALID_GRANT_ERROR||n.errorCode===Wt,o=t&&r||n.errorCode===to||n.errorCode===vs,i=Tm.includes(e);return o&&i}/*! @azure/msal-browser v4.9.0 2025-03-25 */function LC(n){return n.status!==void 0}/*! @azure/msal-browser v4.9.0 2025-03-25 */class UC{constructor(e,t,r,o){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=o}toNaaTokenRequest(e){var a;let t;e.extraQueryParameters===void 0?t=new Map:t=new Map(Object.entries(e.extraQueryParameters));const r=e.correlationId||this.crypto.createNewGuid(),o=dd(e.claims,this.clientCapabilities),i=e.scopes||yn;return{platformBrokerId:(a=e.account)==null?void 0:a.homeAccountId,clientId:this.clientId,authority:e.authority,scope:i.join(" "),correlationId:r,claims:st.isEmptyObj(o)?void 0:o,state:e.state,authenticationScheme:e.authenticationScheme||J.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw w(Vr);const o=Ht(r+(t.token.expires_in||0)),i=Jt(t.token.id_token,this.crypto.base64Decode),s=this.fromNaaAccountInfo(t.account,t.token.id_token,i),a=t.token.scope||e.scope;return{authority:t.token.authority||s.environment,uniqueId:s.localAccountId,tenantId:s.tenantId,scopes:a.split(" "),account:s,idToken:t.token.id_token,idTokenClaims:i,accessToken:t.token.access_token,fromCache:!1,expiresOn:o,tokenType:e.authenticationScheme||J.BEARER,correlationId:e.correlationId,extExpiresOn:o,state:e.state}}fromNaaAccountInfo(e,t,r){const o=r||e.idTokenClaims,i=e.localAccountId||(o==null?void 0:o.oid)||(o==null?void 0:o.sub)||"",s=e.tenantId||(o==null?void 0:o.tid)||"",a=e.homeAccountId||`${i}.${s}`,c=e.username||(o==null?void 0:o.preferred_username)||"",l=e.name||(o==null?void 0:o.name),d=new Map,h=Io(a,i,s,o);return d.set(s,h),{homeAccountId:a,environment:e.environment,tenantId:s,username:c,localAccountId:i,name:l,idToken:t,idTokenClaims:o,tenantProfiles:d}}fromBridgeError(e){if(LC(e))switch(e.status){case Rt.UserCancel:return new zt(kl);case Rt.NoNetwork:return new zt(bl);case Rt.AccountUnavailable:return new zt(jr);case Rt.Disabled:return new zt(Ci);case Rt.NestedAppAuthUnavailable:return new zt(e.code||Ci,e.description);case Rt.TransientError:case Rt.PersistentError:return new nn(e.code,e.description);case Rt.UserInteractionRequired:return new tt(e.code,e.description);default:return new X(e.code,e.description)}else return new X("unknown_error","An unknown error occurred")}toAuthenticationResultFromCache(e,t,r,o,i){if(!t||!r)throw w(Vr);const s=Jt(t.secret,this.crypto.base64Decode),a=r.target||o.scopes.join(" ");return{authority:r.environment||e.environment,uniqueId:e.localAccountId,tenantId:e.tenantId,scopes:a.split(" "),account:e,idToken:t.secret,idTokenClaims:s||{},accessToken:r.secret,fromCache:!0,expiresOn:Ht(r.expiresOn),extExpiresOn:Ht(r.extendedExpiresOn),tokenType:o.authenticationScheme||J.BEARER,correlationId:i,state:o.state}}}/*! @azure/msal-browser v4.9.0 2025-03-25 */const nc={unsupportedMethod:{code:"unsupported_method",desc:"This method is not supported in nested app environment."}};class me extends X{constructor(e,t){super(e,t),Object.setPrototypeOf(this,me.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new me(nc.unsupportedMethod.code,nc.unsupportedMethod.desc)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Ws{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(t!==void 0)this.bridgeProxy=t;else throw new Error("unexpected: bridgeProxy is undefined");this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new It(this.logger,this.performanceClient,!0):ur,this.eventHandler=new wh(this.logger),this.browserStorage=this.operatingContext.isBrowserEnvironment()?new io(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,pd(this.config.auth)):gh(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler),this.nestedAppAuthAdapter=new UC(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger);const r=this.bridgeProxy.getAccountContext();this.currentAccountContext=r||null}static async createController(e){const t=new Ws(e);return Promise.resolve(t)}async initialize(e){const t=(e==null?void 0:e.correlationId)||Qe();return await this.browserStorage.initialize(t),Promise.resolve()}ensureValidRequest(e){return e!=null&&e.correlationId?e:{...e,correlationId:this.browserCrypto.createNewGuid()}}async acquireTokenInteractive(e){const t=this.ensureValidRequest(e);this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Popup,t);const r=this.performanceClient.startMeasurement(f.AcquireTokenPopup,t.correlationId);r==null||r.add({nestedAppAuthRequest:!0});try{const o=this.nestedAppAuthAdapter.toNaaTokenRequest(t),i=Ue(),s=await this.bridgeProxy.getTokenInteractive(o),a={...this.nestedAppAuthAdapter.fromNaaTokenResponse(o,s,i)};return await this.hydrateCache(a,e),this.currentAccountContext={homeAccountId:a.account.homeAccountId,environment:a.account.environment,tenantId:a.account.tenantId},this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Popup,a),r.add({accessTokenSize:a.accessToken.length,idTokenSize:a.idToken.length}),r.end({success:!0,requestId:a.requestId}),a}catch(o){const i=o instanceof X?o:this.nestedAppAuthAdapter.fromBridgeError(o);throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Popup,null,o),r.end({success:!1},o),i}}async acquireTokenSilentInternal(e){const t=this.ensureValidRequest(e);this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_START,M.Silent,t);const r=await this.acquireTokenFromCache(t);if(r)return this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,r),r;const o=this.performanceClient.startMeasurement(f.SsoSilent,t.correlationId);o==null||o.increment({visibilityChangeCount:0}),o==null||o.add({nestedAppAuthRequest:!0});try{const i=this.nestedAppAuthAdapter.toNaaTokenRequest(t),s=Ue(),a=await this.bridgeProxy.getTokenSilent(i),c=this.nestedAppAuthAdapter.fromNaaTokenResponse(i,a,s);return await this.hydrateCache(c,e),this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,c),o==null||o.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),o==null||o.end({success:!0,requestId:c.requestId}),c}catch(i){const s=i instanceof X?i:this.nestedAppAuthAdapter.fromBridgeError(i);throw this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null,i),o==null||o.end({success:!1},i),s}}async acquireTokenFromCache(e){const t=this.performanceClient.startMeasurement(f.AcquireTokenSilent,e.correlationId);if(t==null||t.add({nestedAppAuthRequest:!0}),e.claims)return this.logger.verbose("Claims are present in the request, skipping cache lookup"),null;if(e.forceRefresh)return this.logger.verbose("forceRefresh is set to true, skipping cache lookup"),null;let r=null;switch(e.cacheLookupPolicy||(e.cacheLookupPolicy=Ce.Default),e.cacheLookupPolicy){case Ce.Default:case Ce.AccessToken:case Ce.AccessTokenAndRefreshToken:r=await this.acquireTokenFromCacheInternal(e);break;default:return null}return r?(this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_SUCCESS,M.Silent,r),t==null||t.add({accessTokenSize:r==null?void 0:r.accessToken.length,idTokenSize:r==null?void 0:r.idToken.length}),t==null||t.end({success:!0}),r):(this.logger.error("Cached tokens are not found for the account, proceeding with silent token request."),this.eventHandler.emitEvent(N.ACQUIRE_TOKEN_FAILURE,M.Silent,null),t==null||t.end({success:!1}),null)}async acquireTokenFromCacheInternal(e){var c;const t=this.bridgeProxy.getAccountContext()||this.currentAccountContext;let r=null;if(t&&(r=Ri(t,this.logger,this.browserStorage)),!r)return this.logger.verbose("No active account found, falling back to the host"),Promise.resolve(null);this.logger.verbose("active account found, attempting to acquire token silently");const o={...e,correlationId:e.correlationId||this.browserCrypto.createNewGuid(),authority:e.authority||r.environment,scopes:(c=e.scopes)!=null&&c.length?e.scopes:[...yn]},i=this.browserStorage.getTokenKeys(),s=this.browserStorage.getAccessToken(r,o,i,r.tenantId,this.performanceClient,o.correlationId);if(s){if(Pl(s.cachedAt)||Wr(s.expiresOn,this.config.system.tokenRenewalOffsetSeconds))return this.logger.verbose("Cached access token has expired"),Promise.resolve(null)}else return this.logger.verbose("No cached access token found"),Promise.resolve(null);const a=this.browserStorage.getIdToken(r,i,r.tenantId,this.performanceClient,o.correlationId);return a?this.nestedAppAuthAdapter.toAuthenticationResultFromCache(r,a,s,o,o.correlationId):(this.logger.verbose("No cached id token found"),Promise.resolve(null))}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw me.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw me.createUnsupportedError()}acquireTokenNative(e,t,r){throw me.createUnsupportedError()}acquireTokenByRefreshToken(e,t){throw me.createUnsupportedError()}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw me.createUnsupportedError()}removePerformanceCallback(e){throw me.createUnsupportedError()}enableAccountStorageEvents(){throw me.createUnsupportedError()}disableAccountStorageEvents(){throw me.createUnsupportedError()}getAllAccounts(e){return ph(this.logger,this.browserStorage,this.isBrowserEnv(),e)}getAccount(e){return Ri(e,this.logger,this.browserStorage)}getAccountByUsername(e){return mh(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return Ch(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return yh(e,this.logger,this.browserStorage)}setActiveAccount(e){return Th(e,this.browserStorage)}getActiveAccount(){return Ah(this.browserStorage)}handleRedirectPromise(e){return Promise.resolve(null)}loginPopup(e){return this.acquireTokenInteractive(e||Ii)}loginRedirect(e){throw me.createUnsupportedError()}logout(e){throw me.createUnsupportedError()}logoutRedirect(e){throw me.createUnsupportedError()}logoutPopup(e){throw me.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getTokenCache(){throw me.createUnsupportedError()}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("setNavigationClient is not supported in nested app auth")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw me.createUnsupportedError()}getRedirectResponse(){throw me.createUnsupportedError()}async clearCache(e){throw me.createUnsupportedError()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=ke.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),this.browserStorage.hydrateCache(e,t)}}/*! @azure/msal-browser v4.9.0 2025-03-25 */async function DC(n,e){const t=new mn(n);return await t.initialize(),Lo.createController(t,e)}/*! @azure/msal-browser v4.9.0 2025-03-25 */class Uo{static async createPublicClientApplication(e){const t=await DC(e);return new Uo(e,t)}constructor(e,t){this.controller=t||new Lo(new mn(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}async function FC(n){const e=new Dn(n);if(await e.initialize(),e.isAvailable()){const t=new Ws(e),r=new Uo(n,t);return await r.initialize(),r}return BC(n)}async function BC(n){const e=new Uo(n);return await e.initialize(),e}const KC={class:"d-flex gap",id:"app"},GC={key:0,class:"alert alert-error rounded-md p-2 d-flex flex-row gap"},$C={width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"h-32 w-32",style:{color:"rgb(33, 33, 33)"}},zC={key:1,class:"alert alert-warning rounded-md p-2 d-flex flex-row gap"},qC={width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"h-32 w-32",style:{color:"rgb(33, 33, 33)"}},VC={class:"mt-3"},jC=["disabled"],WC={key:1},YC={key:2,class:"draft-container"},QC={key:0,id:"drafts",class:"my-0 list-unstyled gap d-flex"},JC=["onClick"],XC=["onClick"],ZC={class:"sr-only"},ey={key:1},ty={__name:"App",setup(n){const e=St(""),t=St(""),r=St(""),o=St(""),i=St(!1),s=St(!1),a=St(""),c=St({encrypted:!1,signed:!1,drafts:[],fetched:!1}),l=St(null);let d,h=null;const p=Hr(()=>r.value.length>0&&c.value.fetched),y=Hr(()=>(console.log(a.value),a.value?a.value:p.value?c.value.encrypted?c.value.signed?Bt("This mail is encrypted and signed."):Bt("This mail is encrypted."):c.value.signed?Bt("This mail is signed"):Bt("This mail is not encrypted nor signed."):nt("Loading placeholder","Loading..."))),k=Hr(()=>p.value?c.value.encrypted?nt("@action:button","Decrypt"):nt("@action:button","View email"):"");function b(Q,U){console.log(Q,U),l.value&&l.value.send(JSON.stringify({command:"log",arguments:{message:Q,args:JSON.stringify(U)}}))}function $(Q){l.value.send(JSON.stringify({command:Q,arguments:{body:r.value,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,folderId:o.value,accessToken:h}}))}function D(){$("view")}function q(){$("reply")}function W(){$("forward")}function x(){l.value.send(JSON.stringify({command:"composer",arguments:{email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function ie(Q){l.value.send(JSON.stringify({command:"open-draft",arguments:{id:Q,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function Be(Q){l.value.send(JSON.stringify({command:"delete-draft",arguments:{id:Q,email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}}))}function ve(){l.value.send(JSON.stringify({command:"info",arguments:{itemId:Office.context.mailbox.item.itemId,email:Office.context.mailbox.userProfile.emailAddress,body:r.value}}))}function Je(){l.value.send(JSON.stringify({command:"reencrypt",arguments:{itemId:Office.context.mailbox.item.itemId,email:Office.context.mailbox.userProfile.emailAddress,body:r.value,folderId:o.value}}))}function Dt(Q){const U=new Date(Q*1e3);let ye=new Date;return new Date(U).setHours(0,0,0,0)===ye.setHours(0,0,0,0)?U.toLocaleTimeString([],{hour:"numeric",minute:"numeric"}):U.toLocaleDateString()}async function Ke(){try{const Q=await Zf(Office.context.mailbox.item,!Office.context.requirements.isSetSupported("NestedAppAuth","1.1"),h);r.value=Q.content,o.value=Q.folderId,i.value=!0,l.value&&l.value.readyState===WebSocket.OPEN&&ve()}catch(Q){a.value=Q}}function Ft(){console.log("Set socket"),l.value=new WebSocket("wss://localhost:5657"),l.value.addEventListener("open",Q=>{e.value="",l.value.send(JSON.stringify({command:"register",arguments:{emails:[Office.context.mailbox.userProfile.emailAddress],type:"webclient"}})),l.value.send(JSON.stringify({command:"restore-autosave",arguments:{email:Office.context.mailbox.userProfile.emailAddress,displayName:Office.context.mailbox.userProfile.displayName,accessToken:h}})),r.value.length>0&&ve()}),l.value.addEventListener("close",Q=>{e.value=Bt("Native client was disconnected, reconnecting in 1 second."),console.log(Q.reason),setTimeout(function(){Ft()},1e3)}),l.value.addEventListener("error",Q=>{e.value=Bt("Native client received an error"),l.value.close()}),l.value.addEventListener("message",function(Q){const{data:U}=Q;console.log(U);const ye=JSON.parse(U);switch(b("Received message from server",{command:ye.command}),ye.command){case"ews":Office.context.mailbox.makeEwsRequestAsync(ye.arguments.body,De=>{if(De.error){b("Error while trying to send email via EWS",{error:De.error,value:De.value});return}b("Email sent",{value:De.value}),l.value.send(JSON.stringify({command:"ews-response",arguments:{requestId:ye.arguments.requestId,email:Office.context.mailbox.userProfile.emailAddress,body:De.value}}))});break;case"ews":break;case"viewer-closed":case"viewer-opened":s.value=ye.command==="viewer-opened";break;case"disconnection":e.value=Bt("Native client was disconnected");break;case"connection":e.value="";break;case"info-fetched":const{itemId:pe,encrypted:le,signed:re,drafts:Et,version:An}=ye.arguments;if(c.value.drafts=Et,pe===Office.context.mailbox.item.itemId){c.value.fetched=!0,c.value.encrypted=le,c.value.signed=re,s.value=ye.arguments.viewerOpen,s.value&&D();let Xe=new URLSearchParams(document.location.search).get("version");An!==Xe&&(t.value=nt("@info","Version mismatch. Make sure you installed the last manifest.xml."))}else c.value.fetched=!1}})}async function Tn(){d=await FC({auth:{clientId:"1d6f4a59-be04-4274-8793-71b4c081eb72",authority:"https://login.microsoftonline.com/common"}});const Q={scopes:["Mail.ReadWrite","Mail.Send","openid","profile"]};try{console.log("Trying to acquire token silently...");const U=await d.acquireTokenSilent(Q);console.log("Acquired token silently."),h=U.accessToken}catch(U){console.log(`Unable to acquire token silently: ${U}`)}if(h===null)try{console.log("Trying to acquire token interactively...");const U=await d.acquireTokenPopup(Q);console.log("Acquired token interactively."),h=U.accessToken}catch(U){console.error(`Unable to acquire token interactively: ${U}`)}h===null&&(e.value="Unable to acquire access token.")}return Lc(async()=>{Office.context.requirements.isSetSupported("NestedAppAuth","1.1")&&await Tn(),await Ke(),Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged,Q=>{Office.context.mailbox.item?Ke():(r.value="",i.value=!1)}),Ft()}),(Q,U)=>(qe(),Ze("div",KC,[e.value.length>0?(qe(),Ze("div",GC,[(qe(),Ze("svg",$C,U[1]||(U[1]=[Y("path",{d:"M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333Zm-.001 10.835a.999.999 0 1 1 0 1.998.999.999 0 0 1 0-1.998ZM11.994 7a.75.75 0 0 1 .744.648l.007.101.004 4.502a.75.75 0 0 1-1.493.103l-.007-.102-.004-4.501a.75.75 0 0 1 .75-.751Z",fill:"currentColor","fill-opacity":"1"},null,-1)]))),Y("div",null,ze(e.value),1)])):Wn("",!0),t.value.length>0?(qe(),Ze("div",zC,[(qe(),Ze("svg",qC,U[2]||(U[2]=[Y("path",{d:"M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z",fill:"currentColor","fill-opacity":"1"},null,-1)]))),Y("div",null,ze(t.value),1)])):Wn("",!0),Y("div",null,[Y("div",VC,ze(y.value),1),p.value?(qe(),Ze("button",{key:0,class:"w-100 btn rounded-md fa mt-3",onClick:D,disabled:s.value},[U[3]||(U[3]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"M18 5.95a2.5 2.5 0 1 0-1.002-4.9A2.5 2.5 0 0 0 18 5.95M4.5 3h9.535a3.5 3.5 0 0 0 0 1H4.5A1.5 1.5 0 0 0 3 5.5v.302l7 4.118l5.754-3.386c.375.217.795.365 1.241.43l-6.741 3.967a.5.5 0 0 1-.426.038l-.082-.038L3 6.963V13.5A1.5 1.5 0 0 0 4.5 15h11a1.5 1.5 0 0 0 1.5-1.5V6.965a3.5 3.5 0 0 0 1 0V13.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 13.5v-8A2.5 2.5 0 0 1 4.5 3"})],-1)),an(" "+ze(k.value),1)],8,jC)):Wn("",!0),s.value?(qe(),Ze("div",WC,[Y("small",null,ze(kt(nt)("@info","Viewer already open.")),1)])):Wn("",!0)]),U[11]||(U[11]=Y("hr",{class:"w-100 my-0"},null,-1)),Y("button",{class:"w-100 btn rounded-md",onClick:U[0]||(U[0]=ye=>x())},[U[4]||(U[4]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"M15.5 4A2.5 2.5 0 0 1 18 6.5v8a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 14.5v-8A2.5 2.5 0 0 1 4.5 4zM17 7.961l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 7.963V14.5A1.5 1.5 0 0 0 4.5 16h11a1.5 1.5 0 0 0 1.5-1.5zM15.5 5h-11A1.5 1.5 0 0 0 3 6.5v.302l7 4.118l7-4.12v-.3A1.5 1.5 0 0 0 15.5 5"})],-1)),an(" "+ze(kt(nt)("@action:button","New secure email")),1)]),Y("button",{class:"w-100 btn rounded-md",onClick:q},[U[5]||(U[5]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"M7.354 3.646a.5.5 0 0 1 0 .708L3.707 8H10.5a7.5 7.5 0 0 1 7.5 7.5a.5.5 0 0 1-1 0A6.5 6.5 0 0 0 10.5 9H3.707l3.647 3.646a.5.5 0 0 1-.708.708l-4.5-4.5a.5.5 0 0 1 0-.708l4.5-4.5a.5.5 0 0 1 .708 0"})],-1)),an(" "+ze(kt(nt)("@action:button","Reply securely")),1)]),Y("button",{class:"w-100 btn rounded-md",onClick:W},[U[6]||(U[6]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"})],-1)),an(" "+ze(kt(nt)("@action:button","Forward securely")),1)]),Y("button",{class:"w-100 btn rounded-md d-none",onClick:Je},[U[7]||(U[7]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"})],-1)),an(" "+ze(kt(nt)("@action:button","Reencrypt")),1)]),p.value?(qe(),Ze("div",YC,[U[10]||(U[10]=Y("h2",{class:"mb-0"},"Drafts",-1)),c.value.drafts.length>0?(qe(),Ze("ul",QC,[(qe(!0),Ze(pt,null,Uu(c.value.drafts,ye=>(qe(),Ze("li",{key:ye.id,class:"d-flex flex-row"},[Y("button",{class:"btn w-100 d-flex flex-row align-items-center rounded-e-md",onClick:pe=>ie(ye.id)},[U[8]||(U[8]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.5em",height:"1.5em",viewBox:"0 0 20 20"},[Y("path",{fill:"currentColor",d:"M15.5 3.001a2.5 2.5 0 0 1 2.5 2.5v3.633a2.9 2.9 0 0 0-1-.131V6.962l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 6.964v6.537a1.5 1.5 0 0 0 1.5 1.5h5.484c-.227.3-.4.639-.51 1H4.5a2.5 2.5 0 0 1-2.5-2.5v-8a2.5 2.5 0 0 1 2.5-2.5zm0 1h-11a1.5 1.5 0 0 0-1.5 1.5v.302l7 4.118l7-4.119v-.301a1.5 1.5 0 0 0-1.5-1.5m-4.52 11.376l4.83-4.83a1.87 1.87 0 1 1 2.644 2.646l-4.83 4.829a2.2 2.2 0 0 1-1.02.578l-1.498.374a.89.89 0 0 1-1.079-1.078l.375-1.498a2.2 2.2 0 0 1 .578-1.02"})],-1)),an(" "+ze(kt(Bt)("Last Modified: ")+Dt(ye.last_modification)),1)],8,JC),Y("button",{class:"btn btn-danger ms-auto py-1 rounded-e-md",onClick:pe=>Be(ye.id)},[Y("span",ZC,ze(kt(nt)("@action:button","Delete")),1),U[9]||(U[9]=Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"},[Y("path",{fill:"currentColor",d:"M10 5h4a2 2 0 1 0-4 0M8.5 5a3.5 3.5 0 1 1 7 0h5.75a.75.75 0 0 1 0 1.5h-1.32l-1.17 12.111A3.75 3.75 0 0 1 15.026 22H8.974a3.75 3.75 0 0 1-3.733-3.389L4.07 6.5H2.75a.75.75 0 0 1 0-1.5zm2 4.75a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0zM14.25 9a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75m-7.516 9.467a2.25 2.25 0 0 0 2.24 2.033h6.052a2.25 2.25 0 0 0 2.24-2.033L18.424 6.5H5.576z"})],-1))],8,XC)]))),128))])):(qe(),Ze("p",ey,ze(kt(nt)("Placeholder","No draft found")),1))])):Wn("",!0)]))}},kh=(0,eval)("this"),ny=kh.Office;kh.messages;ny.onReady(()=>{Qf(ty).mount("#app")});
diff --git a/web/dist/index.html b/web/dist/index.html
index b7e1f86..3d41d93 100644
--- a/web/dist/index.html
+++ b/web/dist/index.html
@@ -1,12 +1,12 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Encryption information</title>
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.js"></script>
- <script type="module" crossorigin src="/assets/index-ClTtgHOX.js"></script>
+ <script type="module" crossorigin src="/assets/index-BjC_RaBp.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Dw30ndEI.css">
</head>
<body id="app">
</body>
</html>
\ No newline at end of file
diff --git a/web/src/App.vue b/web/src/App.vue
index 26dd5f9..f23ffa8 100644
--- a/web/src/App.vue
+++ b/web/src/App.vue
@@ -1,439 +1,468 @@
<!--
SPDX-FileCopyrightText: 2025 g10 code GmbH
SPDX-Contributor: Carl Schwan <carl.schwan@gnupg.com>
SPDX-License-Identifier: GPL-2.0-or-later
-->
<script setup>
import {computed, onMounted, ref} from "vue"
import {i18n, i18nc} from './services/i18n.js'
import {download} from "./services/email.js";
import {createNestablePublicClientApplication} from "@azure/msal-browser";
/* global Office */
const error = ref('')
const versionWarning = ref('')
const content = ref('')
const folderId = ref('')
const hasSelection = ref(false)
const viewerOpen = ref(false)
const loadingError = ref('')
const status = ref({
encrypted: false,
signed: false,
drafts: [],
fetched: false,
})
const socket = ref(null)
let pca = undefined;
let accessToken = null;
const loaded = computed(() => {
return content.value.length > 0 && status.value.fetched
})
const statusText = computed(() => {
console.log(loadingError.value)
if (loadingError.value) {
return loadingError.value;
}
if (!loaded.value) {
return i18nc("Loading placeholder", "Loading...");
}
if (status.value.encrypted) {
return status.value.signed ? i18n("This mail is encrypted and signed.") : i18n("This mail is encrypted.");
}
if (status.value.signed) {
return i18n("This mail is signed")
}
return i18n("This mail is not encrypted nor signed.");
})
const decryptButtonText = computed(() => {
if (!loaded.value) {
return '';
}
if (status.value.encrypted) {
return i18nc("@action:button", "Decrypt")
}
return i18nc("@action:button", "View email")
})
function gpgolLog(message, args) {
console.log(message, args);
if (socket.value) {
socket.value.send(JSON.stringify({
command: "log",
arguments: {
message,
args: JSON.stringify(args),
},
}));
}
}
function genericMailAction(command) {
socket.value.send(JSON.stringify({
command,
arguments: {
body: content.value,
email: Office.context.mailbox.userProfile.emailAddress,
displayName: Office.context.mailbox.userProfile.displayName,
folderId: folderId.value,
accessToken,
}
}));
}
function view() {
genericMailAction('view');
}
function reply() {
genericMailAction('reply');
}
function forward() {
genericMailAction('forward');
}
function newEmail() {
socket.value.send(JSON.stringify({
command: 'composer',
arguments: {
email: Office.context.mailbox.userProfile.emailAddress,
displayName: Office.context.mailbox.userProfile.displayName,
accessToken,
}
}));
}
function openDraft(id) {
socket.value.send(JSON.stringify({
command: 'open-draft',
arguments: {
id,
email: Office.context.mailbox.userProfile.emailAddress,
displayName: Office.context.mailbox.userProfile.displayName,
accessToken,
}
}));
}
function deleteDraft(id) {
socket.value.send(JSON.stringify({
command: 'delete-draft',
arguments: {
id: id,
email: Office.context.mailbox.userProfile.emailAddress,
displayName: Office.context.mailbox.userProfile.displayName,
accessToken,
}
}));
// TODO this.status.drafts.splice(this.status.drafts.findIndex((draft) => draft.id === id), 1);
}
function info() {
socket.value.send(JSON.stringify({
command: 'info',
arguments: {
itemId: Office.context.mailbox.item.itemId,
email: Office.context.mailbox.userProfile.emailAddress,
body: content.value,
}
}));
}
function reencrypt() {
socket.value.send(JSON.stringify({
command: 'reencrypt',
arguments: {
itemId: Office.context.mailbox.item.itemId,
email: Office.context.mailbox.userProfile.emailAddress,
body: content.value,
folderId: folderId.value,
+ accessToken,
}
}));
}
function displayDate(timestamp) {
const date = new Date(timestamp * 1000);
let todayDate = new Date();
if ((new Date(date)).setHours(0, 0, 0, 0) === todayDate.setHours(0, 0, 0, 0)) {
return date.toLocaleTimeString([], {
hour: 'numeric',
minute: 'numeric',
});
} else {
return date.toLocaleDateString();
}
}
async function downloadContent() {
try {
const result = await download(Office.context.mailbox.item, !Office.context.requirements.isSetSupported("NestedAppAuth", "1.1"), accessToken);
content.value = result.content;
folderId.value = result.folderId;
hasSelection.value = true;
if (socket.value && socket.value.readyState === WebSocket.OPEN) {
info();
}
} catch (error) {
loadingError.value = error;
}
}
+async function executeEws(message) {
+ if (accessToken.length > 0) {
+ const response = await fetch("https://outlook.office365.com/EWS/Exchange.asmx", {
+ body: message.arguments.body,
+ headers: {
+ Authorization: accessToken,
+ ContentType: 'text/xml',
+ },
+ method: "POST",
+ });
+ if (response.ok) {
+ const content = await response.text();
+ socket.value.send(JSON.stringify({
+ command: 'ews-response',
+ arguments: {
+ requestId: message.arguments.requestId,
+ email: Office.context.mailbox.userProfile.emailAddress,
+ body: content,
+ },
+ }));
+ return;
+ }
+ gpgolLog("Error while trying to send email via EWS (using oauth2)", {error: response.status});
+ } else {
+ Office.context.mailbox.makeEwsRequestAsync(message.arguments.body, (asyncResult) => {
+ if (asyncResult.error) {
+ gpgolLog("Error while trying to send email via EWS", {error: asyncResult.error, value: asyncResult.value,});
+ return;
+ }
+
+ gpgolLog("Email sent", {value: asyncResult.value});
+ // let the client known that the email was sent
+ socket.value.send(JSON.stringify({
+ command: 'ews-response',
+ arguments: {
+ requestId: message.arguments.requestId,
+ email: Office.context.mailbox.userProfile.emailAddress,
+ body: asyncResult.value,
+ }
+ }));
+ });
+ }
+}
+
function webSocketConnect() {
console.log("Set socket")
socket.value = new WebSocket("wss://localhost:5657");
// Connection opened
socket.value.addEventListener("open", (event) => {
error.value = '';
socket.value.send(JSON.stringify({
command: "register",
arguments: {
emails: [Office.context.mailbox.userProfile.emailAddress],
type: 'webclient',
},
}));
socket.value.send(JSON.stringify({
command: 'restore-autosave',
arguments: {
email: Office.context.mailbox.userProfile.emailAddress,
displayName: Office.context.mailbox.userProfile.displayName,
accessToken,
}
}));
if (content.value.length > 0) {
info()
}
});
socket.value.addEventListener("close", (event) => {
error.value = i18n("Native client was disconnected, reconnecting in 1 second.");
console.log(event.reason)
setTimeout(function () {
webSocketConnect();
}, 1000);
});
socket.value.addEventListener("error", (event) => {
error.value = i18n("Native client received an error");
socket.value.close();
});
// Listen for messages
- socket.value.addEventListener("message", function (result) {
+ socket.value.addEventListener("message", function (result) {
const {data} = result;
console.log(data);
const message = JSON.parse(data);
gpgolLog("Received message from server", {command: message.command});
switch (message.command) {
case 'ews':
- Office.context.mailbox.makeEwsRequestAsync(message.arguments.body, (asyncResult) => {
- if (asyncResult.error) {
- gpgolLog("Error while trying to send email via EWS", {error: asyncResult.error, value: asyncResult.value,});
- return;
- }
-
- gpgolLog("Email sent", {value: asyncResult.value});
- // let the client known that the email was sent
- socket.value.send(JSON.stringify({
- command: 'ews-response',
- arguments: {
- requestId: message.arguments.requestId,
- email: Office.context.mailbox.userProfile.emailAddress,
- body: asyncResult.value,
- }
- }));
- });
+ executeEws(message);
break;
case 'ews':
break;
case 'viewer-closed':
case 'viewer-opened':
viewerOpen.value = message.command === 'viewer-opened';
break;
case 'disconnection':
error.value = i18n("Native client was disconnected")
break;
case 'connection':
error.value = '';
break;
case 'info-fetched':
const {itemId, encrypted, signed, drafts, version} = message.arguments;
status.value.drafts = drafts;
if (itemId === Office.context.mailbox.item.itemId) {
status.value.fetched = true;
status.value.encrypted = encrypted;
status.value.signed = signed;
viewerOpen.value = message.arguments.viewerOpen;
if (viewerOpen.value) {
view();
}
let params = new URLSearchParams(document.location.search);
let manifestVersion = params.get("version");
if (version !== manifestVersion) {
versionWarning.value = i18nc("@info", "Version mismatch. Make sure you installed the last manifest.xml.")
}
} else {
status.value.fetched = false;
}
}
});
}
async function auth() {
pca = await createNestablePublicClientApplication({
auth: {
clientId: "1d6f4a59-be04-4274-8793-71b4c081eb72",
authority: "https://login.microsoftonline.com/common"
},
});
// Specify minimum scopes needed for the access token.
const tokenRequest = {
- scopes: ["Mail.ReadWrite", "Mail.Send", "openid", "profile"],
+ scopes: ["Mail.ReadWrite", "Mail.Send", "openid", "profile", "https://outlook.office365.com/EWS.AccessAsUser.All"],
};
try {
console.log("Trying to acquire token silently...");
const userAccount = await pca.acquireTokenSilent(tokenRequest);
console.log("Acquired token silently.");
accessToken = userAccount.accessToken;
} catch (error) {
console.log(`Unable to acquire token silently: ${error}`);
}
if (accessToken === null) {
// Acquire token silent failure. Send an interactive request via popup.
try {
console.log("Trying to acquire token interactively...");
const userAccount = await pca.acquireTokenPopup(tokenRequest);
console.log("Acquired token interactively.");
accessToken = userAccount.accessToken;
} catch (popupError) {
// Acquire token interactive failure.
console.error( `Unable to acquire token interactively: ${popupError}`);
}
}
// Log error if both silent and popup requests failed.
if (accessToken === null) {
error.value = `Unable to acquire access token.`;
}
}
onMounted(async () => {
if (Office.context.requirements.isSetSupported("NestedAppAuth", "1.1")) {
await auth();
}
await downloadContent();
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, (eventArgs) => {
if (Office.context.mailbox.item) {
downloadContent();
} else {
content.value = '';
hasSelection.value = false;
}
});
webSocketConnect();
})
</script>
<template>
<div class="d-flex gap" id="app">
<div class="alert alert-error rounded-md p-2 d-flex flex-row gap" v-if="error.length > 0">
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="h-32 w-32"
style="color: rgb(33, 33, 33);"><!----> <!---->
<path
d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333Zm-.001 10.835a.999.999 0 1 1 0 1.998.999.999 0 0 1 0-1.998ZM11.994 7a.75.75 0 0 1 .744.648l.007.101.004 4.502a.75.75 0 0 1-1.493.103l-.007-.102-.004-4.501a.75.75 0 0 1 .75-.751Z"
fill="currentColor" fill-opacity="1"></path>
</svg>
<div>{{ error }}</div>
</div>
<div class="alert alert-warning rounded-md p-2 d-flex flex-row gap" v-if="versionWarning.length > 0">
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="h-32 w-32"
style="color: rgb(33, 33, 33);"><!----> <!---->
<path
d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z"
fill="currentColor" fill-opacity="1"></path>
</svg>
<div>{{ versionWarning }}</div>
</div>
<div>
<div class="mt-3">
{{ statusText }}
</div>
<button v-if="loaded" class="w-100 btn rounded-md fa mt-3" @click="view" :disabled="viewerOpen">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="M18 5.95a2.5 2.5 0 1 0-1.002-4.9A2.5 2.5 0 0 0 18 5.95M4.5 3h9.535a3.5 3.5 0 0 0 0 1H4.5A1.5 1.5 0 0 0 3 5.5v.302l7 4.118l5.754-3.386c.375.217.795.365 1.241.43l-6.741 3.967a.5.5 0 0 1-.426.038l-.082-.038L3 6.963V13.5A1.5 1.5 0 0 0 4.5 15h11a1.5 1.5 0 0 0 1.5-1.5V6.965a3.5 3.5 0 0 0 1 0V13.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 13.5v-8A2.5 2.5 0 0 1 4.5 3"/>
</svg>
{{ decryptButtonText }}
</button>
<div v-if="viewerOpen"><small>{{ i18nc("@info", "Viewer already open.") }}</small></div>
</div>
<hr class="w-100 my-0"/>
<button class="w-100 btn rounded-md" @click="newEmail()">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="M15.5 4A2.5 2.5 0 0 1 18 6.5v8a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 14.5v-8A2.5 2.5 0 0 1 4.5 4zM17 7.961l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 7.963V14.5A1.5 1.5 0 0 0 4.5 16h11a1.5 1.5 0 0 0 1.5-1.5zM15.5 5h-11A1.5 1.5 0 0 0 3 6.5v.302l7 4.118l7-4.12v-.3A1.5 1.5 0 0 0 15.5 5"/>
</svg>
{{ i18nc("@action:button", "New secure email") }}
</button>
<button class="w-100 btn rounded-md" @click="reply">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="M7.354 3.646a.5.5 0 0 1 0 .708L3.707 8H10.5a7.5 7.5 0 0 1 7.5 7.5a.5.5 0 0 1-1 0A6.5 6.5 0 0 0 10.5 9H3.707l3.647 3.646a.5.5 0 0 1-.708.708l-4.5-4.5a.5.5 0 0 1 0-.708l4.5-4.5a.5.5 0 0 1 .708 0"/>
</svg>
{{ i18nc("@action:button", "Reply securely") }}
</button>
<button class="w-100 btn rounded-md" @click="forward">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"/>
</svg>
{{ i18nc("@action:button", "Forward securely") }}
</button>
<button class="w-100 btn rounded-md d-none" @click="reencrypt">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="m16.293 9l-3.39 3.39a.5.5 0 0 0 .639.765l.069-.058l4.243-4.243a.5.5 0 0 0 .057-.638l-.057-.07l-4.243-4.242a.5.5 0 0 0-.765.638l.058.07L16.293 8H10a7.5 7.5 0 0 0-7.496 7.258L2.5 15.5a.5.5 0 0 0 1 0a6.5 6.5 0 0 1 6.267-6.496L10 9z"/>
</svg>
{{ i18nc("@action:button", "Reencrypt") }}
</button>
<div class="draft-container" v-if="loaded">
<h2 class="mb-0">Drafts</h2>
<ul v-if="status.drafts.length > 0" id="drafts" class="my-0 list-unstyled gap d-flex">
<li v-for="draft in status.drafts" :key="draft.id" class="d-flex flex-row">
<button class="btn w-100 d-flex flex-row align-items-center rounded-e-md" @click="openDraft(draft.id)">
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 20 20">
<path fill="currentColor"
d="M15.5 3.001a2.5 2.5 0 0 1 2.5 2.5v3.633a2.9 2.9 0 0 0-1-.131V6.962l-6.746 3.97a.5.5 0 0 1-.426.038l-.082-.038L3 6.964v6.537a1.5 1.5 0 0 0 1.5 1.5h5.484c-.227.3-.4.639-.51 1H4.5a2.5 2.5 0 0 1-2.5-2.5v-8a2.5 2.5 0 0 1 2.5-2.5zm0 1h-11a1.5 1.5 0 0 0-1.5 1.5v.302l7 4.118l7-4.119v-.301a1.5 1.5 0 0 0-1.5-1.5m-4.52 11.376l4.83-4.83a1.87 1.87 0 1 1 2.644 2.646l-4.83 4.829a2.2 2.2 0 0 1-1.02.578l-1.498.374a.89.89 0 0 1-1.079-1.078l.375-1.498a2.2 2.2 0 0 1 .578-1.02"/>
</svg>
{{ i18n("Last Modified: ") + displayDate(draft.last_modification) }}
</button>
<button class="btn btn-danger ms-auto py-1 rounded-e-md" @click="deleteDraft(draft.id)">
<span class="sr-only">{{ i18nc("@action:button", "Delete") }}</span>
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
<path fill="currentColor"
d="M10 5h4a2 2 0 1 0-4 0M8.5 5a3.5 3.5 0 1 1 7 0h5.75a.75.75 0 0 1 0 1.5h-1.32l-1.17 12.111A3.75 3.75 0 0 1 15.026 22H8.974a3.75 3.75 0 0 1-3.733-3.389L4.07 6.5H2.75a.75.75 0 0 1 0-1.5zm2 4.75a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0zM14.25 9a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75m-7.516 9.467a2.25 2.25 0 0 0 2.24 2.033h6.052a2.25 2.25 0 0 0 2.24-2.033L18.424 6.5H5.576z"/>
</svg>
</button>
</li>
</ul>
<p v-else>{{ i18nc("Placeholder", "No draft found") }}</p>
</div>
</div>
</template>
<style scoped>
</style>
\ No newline at end of file
diff --git a/web/src/vue.global.v3.5.13.js b/web/src/vue.global.v3.5.13.js
deleted file mode 100644
index ba3fbfb..0000000
--- a/web/src/vue.global.v3.5.13.js
+++ /dev/null
@@ -1,18096 +0,0 @@
-/**
-* vue v3.5.13
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/
-var Vue = (function (exports) {
- 'use strict';
-
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function makeMap(str) {
- const map = /* @__PURE__ */ Object.create(null);
- for (const key of str.split(",")) map[key] = 1;
- return (val) => val in map;
- }
-
- const EMPTY_OBJ = Object.freeze({}) ;
- const EMPTY_ARR = Object.freeze([]) ;
- const NOOP = () => {
- };
- const NO = () => false;
- const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
- (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
- const isModelListener = (key) => key.startsWith("onUpdate:");
- const extend = Object.assign;
- const remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
- const isArray = Array.isArray;
- const isMap = (val) => toTypeString(val) === "[object Map]";
- const isSet = (val) => toTypeString(val) === "[object Set]";
- const isDate = (val) => toTypeString(val) === "[object Date]";
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
- const isFunction = (val) => typeof val === "function";
- const isString = (val) => typeof val === "string";
- const isSymbol = (val) => typeof val === "symbol";
- const isObject = (val) => val !== null && typeof val === "object";
- const isPromise = (val) => {
- return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
- };
- const objectToString = Object.prototype.toString;
- const toTypeString = (value) => objectToString.call(value);
- const toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- const isReservedProp = /* @__PURE__ */ makeMap(
- // the leading comma is intentional so empty string "" is also included
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
- );
- const isBuiltInDirective = /* @__PURE__ */ makeMap(
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
- );
- const cacheStringFunction = (fn) => {
- const cache = /* @__PURE__ */ Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- const camelizeRE = /-(\w)/g;
- const camelize = cacheStringFunction(
- (str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- }
- );
- const hyphenateRE = /\B([A-Z])/g;
- const hyphenate = cacheStringFunction(
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
- );
- const capitalize = cacheStringFunction((str) => {
- return str.charAt(0).toUpperCase() + str.slice(1);
- });
- const toHandlerKey = cacheStringFunction(
- (str) => {
- const s = str ? `on${capitalize(str)}` : ``;
- return s;
- }
- );
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
- const invokeArrayFns = (fns, ...arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](...arg);
- }
- };
- const def = (obj, key, value, writable = false) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- writable,
- value
- });
- };
- const looseToNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- const toNumber = (val) => {
- const n = isString(val) ? Number(val) : NaN;
- return isNaN(n) ? val : n;
- };
- let _globalThis;
- const getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- function genCacheKey(source, options) {
- return source + JSON.stringify(
- options,
- (_, val) => typeof val === "function" ? val.toString() : val
- );
- }
-
- const PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `NEED_HYDRATION`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
- };
-
- const slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
- };
-
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
- const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
-
- const range = 2;
- function generateCodeFrame(source, start = 0, end = source.length) {
- start = Math.max(0, Math.min(start, source.length));
- end = Math.max(0, Math.min(end, source.length));
- if (start > end) return "";
- let lines = source.split(/(\r?\n)/);
- const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
- lines = lines.filter((_, idx) => idx % 2 === 0);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
- if (count >= start) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length) continue;
- const line = j + 1;
- res.push(
- `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
- );
- const lineLength = lines[j].length;
- const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
- if (j === i) {
- const pad = start - (count - (lineLength + newLineSeqLength));
- const length = Math.max(
- 1,
- end > count ? lineLength - pad : end - start
- );
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + newLineSeqLength;
- }
- }
- break;
- }
- }
- return res.join("\n");
- }
-
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isString(value) || isObject(value)) {
- return value;
- }
- }
- const listDelimiterRE = /;(?![^(]*\))/g;
- const propertyDelimiterRE = /:([^]+)/;
- const styleCommentRE = /\/\*[^]*?\*\//g;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- if (!styles) return "";
- if (isString(styles)) return styles;
- let ret = "";
- for (const key in styles) {
- const value = styles[key];
- if (isString(value) || typeof value === "number") {
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- function normalizeProps(props) {
- if (!props) return null;
- let { class: klass, style } = props;
- if (klass && !isString(klass)) {
- props.class = normalizeClass(klass);
- }
- if (style) {
- props.style = normalizeStyle(style);
- }
- return props;
- }
-
- const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
- const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
- const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
- const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
- const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
- const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
- const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
- const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
-
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- const isBooleanAttr = /* @__PURE__ */ makeMap(
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
- );
- function includeBooleanAttr(value) {
- return !!value || value === "";
- }
- const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
- `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
- );
- const isKnownSvgAttr = /* @__PURE__ */ makeMap(
- `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
- );
- function isRenderableAttrValue(value) {
- if (value == null) {
- return false;
- }
- const type = typeof value;
- return type === "string" || type === "number" || type === "boolean";
- }
-
- const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
- function getEscapedCssVarName(key, doubleEscape) {
- return key.replace(
- cssVarNameEscapeSymbolsRE,
- (s) => `\\${s}`
- );
- }
-
- function looseCompareArrays(a, b) {
- if (a.length !== b.length) return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b) return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isSymbol(a);
- bValidType = isSymbol(b);
- if (aValidType || bValidType) {
- return a === b;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex((item) => looseEqual(item, val));
- }
-
- const isRef$1 = (val) => {
- return !!(val && val["__v_isRef"] === true);
- };
- const toDisplayString = (val) => {
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
- };
- const replacer = (_key, val) => {
- if (isRef$1(val)) {
- return replacer(_key, val.value);
- } else if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce(
- (entries, [key, val2], i) => {
- entries[stringifySymbol(key, i) + " =>"] = val2;
- return entries;
- },
- {}
- )
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
- };
- } else if (isSymbol(val)) {
- return stringifySymbol(val);
- } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
- return String(val);
- }
- return val;
- };
- const stringifySymbol = (v, i = "") => {
- var _a;
- return (
- // Symbol.description in es2019+ so we need to cast here to pass
- // the lib: es2016 check
- isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
- );
- };
-
- function warn$2(msg, ...args) {
- console.warn(`[Vue warn] ${msg}`, ...args);
- }
-
- let activeEffectScope;
- class EffectScope {
- constructor(detached = false) {
- this.detached = detached;
- /**
- * @internal
- */
- this._active = true;
- /**
- * @internal
- */
- this.effects = [];
- /**
- * @internal
- */
- this.cleanups = [];
- this._isPaused = false;
- this.parent = activeEffectScope;
- if (!detached && activeEffectScope) {
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
- this
- ) - 1;
- }
- }
- get active() {
- return this._active;
- }
- pause() {
- if (this._active) {
- this._isPaused = true;
- let i, l;
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].pause();
- }
- }
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].pause();
- }
- }
- }
- /**
- * Resumes the effect scope, including all child scopes and effects.
- */
- resume() {
- if (this._active) {
- if (this._isPaused) {
- this._isPaused = false;
- let i, l;
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].resume();
- }
- }
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].resume();
- }
- }
- }
- }
- run(fn) {
- if (this._active) {
- const currentEffectScope = activeEffectScope;
- try {
- activeEffectScope = this;
- return fn();
- } finally {
- activeEffectScope = currentEffectScope;
- }
- } else {
- warn$2(`cannot run an inactive effect scope.`);
- }
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- on() {
- activeEffectScope = this;
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- off() {
- activeEffectScope = this.parent;
- }
- stop(fromParent) {
- if (this._active) {
- this._active = false;
- let i, l;
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].stop();
- }
- this.effects.length = 0;
- for (i = 0, l = this.cleanups.length; i < l; i++) {
- this.cleanups[i]();
- }
- this.cleanups.length = 0;
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].stop(true);
- }
- this.scopes.length = 0;
- }
- if (!this.detached && this.parent && !fromParent) {
- const last = this.parent.scopes.pop();
- if (last && last !== this) {
- this.parent.scopes[this.index] = last;
- last.index = this.index;
- }
- }
- this.parent = void 0;
- }
- }
- }
- function effectScope(detached) {
- return new EffectScope(detached);
- }
- function getCurrentScope() {
- return activeEffectScope;
- }
- function onScopeDispose(fn, failSilently = false) {
- if (activeEffectScope) {
- activeEffectScope.cleanups.push(fn);
- } else if (!failSilently) {
- warn$2(
- `onScopeDispose() is called when there is no active effect scope to be associated with.`
- );
- }
- }
-
- let activeSub;
- const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
- class ReactiveEffect {
- constructor(fn) {
- this.fn = fn;
- /**
- * @internal
- */
- this.deps = void 0;
- /**
- * @internal
- */
- this.depsTail = void 0;
- /**
- * @internal
- */
- this.flags = 1 | 4;
- /**
- * @internal
- */
- this.next = void 0;
- /**
- * @internal
- */
- this.cleanup = void 0;
- this.scheduler = void 0;
- if (activeEffectScope && activeEffectScope.active) {
- activeEffectScope.effects.push(this);
- }
- }
- pause() {
- this.flags |= 64;
- }
- resume() {
- if (this.flags & 64) {
- this.flags &= ~64;
- if (pausedQueueEffects.has(this)) {
- pausedQueueEffects.delete(this);
- this.trigger();
- }
- }
- }
- /**
- * @internal
- */
- notify() {
- if (this.flags & 2 && !(this.flags & 32)) {
- return;
- }
- if (!(this.flags & 8)) {
- batch(this);
- }
- }
- run() {
- if (!(this.flags & 1)) {
- return this.fn();
- }
- this.flags |= 2;
- cleanupEffect(this);
- prepareDeps(this);
- const prevEffect = activeSub;
- const prevShouldTrack = shouldTrack;
- activeSub = this;
- shouldTrack = true;
- try {
- return this.fn();
- } finally {
- if (activeSub !== this) {
- warn$2(
- "Active effect was not restored correctly - this is likely a Vue internal bug."
- );
- }
- cleanupDeps(this);
- activeSub = prevEffect;
- shouldTrack = prevShouldTrack;
- this.flags &= ~2;
- }
- }
- stop() {
- if (this.flags & 1) {
- for (let link = this.deps; link; link = link.nextDep) {
- removeSub(link);
- }
- this.deps = this.depsTail = void 0;
- cleanupEffect(this);
- this.onStop && this.onStop();
- this.flags &= ~1;
- }
- }
- trigger() {
- if (this.flags & 64) {
- pausedQueueEffects.add(this);
- } else if (this.scheduler) {
- this.scheduler();
- } else {
- this.runIfDirty();
- }
- }
- /**
- * @internal
- */
- runIfDirty() {
- if (isDirty(this)) {
- this.run();
- }
- }
- get dirty() {
- return isDirty(this);
- }
- }
- let batchDepth = 0;
- let batchedSub;
- let batchedComputed;
- function batch(sub, isComputed = false) {
- sub.flags |= 8;
- if (isComputed) {
- sub.next = batchedComputed;
- batchedComputed = sub;
- return;
- }
- sub.next = batchedSub;
- batchedSub = sub;
- }
- function startBatch() {
- batchDepth++;
- }
- function endBatch() {
- if (--batchDepth > 0) {
- return;
- }
- if (batchedComputed) {
- let e = batchedComputed;
- batchedComputed = void 0;
- while (e) {
- const next = e.next;
- e.next = void 0;
- e.flags &= ~8;
- e = next;
- }
- }
- let error;
- while (batchedSub) {
- let e = batchedSub;
- batchedSub = void 0;
- while (e) {
- const next = e.next;
- e.next = void 0;
- e.flags &= ~8;
- if (e.flags & 1) {
- try {
- ;
- e.trigger();
- } catch (err) {
- if (!error) error = err;
- }
- }
- e = next;
- }
- }
- if (error) throw error;
- }
- function prepareDeps(sub) {
- for (let link = sub.deps; link; link = link.nextDep) {
- link.version = -1;
- link.prevActiveLink = link.dep.activeLink;
- link.dep.activeLink = link;
- }
- }
- function cleanupDeps(sub) {
- let head;
- let tail = sub.depsTail;
- let link = tail;
- while (link) {
- const prev = link.prevDep;
- if (link.version === -1) {
- if (link === tail) tail = prev;
- removeSub(link);
- removeDep(link);
- } else {
- head = link;
- }
- link.dep.activeLink = link.prevActiveLink;
- link.prevActiveLink = void 0;
- link = prev;
- }
- sub.deps = head;
- sub.depsTail = tail;
- }
- function isDirty(sub) {
- for (let link = sub.deps; link; link = link.nextDep) {
- if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
- return true;
- }
- }
- if (sub._dirty) {
- return true;
- }
- return false;
- }
- function refreshComputed(computed) {
- if (computed.flags & 4 && !(computed.flags & 16)) {
- return;
- }
- computed.flags &= ~16;
- if (computed.globalVersion === globalVersion) {
- return;
- }
- computed.globalVersion = globalVersion;
- const dep = computed.dep;
- computed.flags |= 2;
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
- computed.flags &= ~2;
- return;
- }
- const prevSub = activeSub;
- const prevShouldTrack = shouldTrack;
- activeSub = computed;
- shouldTrack = true;
- try {
- prepareDeps(computed);
- const value = computed.fn(computed._value);
- if (dep.version === 0 || hasChanged(value, computed._value)) {
- computed._value = value;
- dep.version++;
- }
- } catch (err) {
- dep.version++;
- throw err;
- } finally {
- activeSub = prevSub;
- shouldTrack = prevShouldTrack;
- cleanupDeps(computed);
- computed.flags &= ~2;
- }
- }
- function removeSub(link, soft = false) {
- const { dep, prevSub, nextSub } = link;
- if (prevSub) {
- prevSub.nextSub = nextSub;
- link.prevSub = void 0;
- }
- if (nextSub) {
- nextSub.prevSub = prevSub;
- link.nextSub = void 0;
- }
- if (dep.subsHead === link) {
- dep.subsHead = nextSub;
- }
- if (dep.subs === link) {
- dep.subs = prevSub;
- if (!prevSub && dep.computed) {
- dep.computed.flags &= ~4;
- for (let l = dep.computed.deps; l; l = l.nextDep) {
- removeSub(l, true);
- }
- }
- }
- if (!soft && !--dep.sc && dep.map) {
- dep.map.delete(dep.key);
- }
- }
- function removeDep(link) {
- const { prevDep, nextDep } = link;
- if (prevDep) {
- prevDep.nextDep = nextDep;
- link.prevDep = void 0;
- }
- if (nextDep) {
- nextDep.prevDep = prevDep;
- link.nextDep = void 0;
- }
- }
- function effect(fn, options) {
- if (fn.effect instanceof ReactiveEffect) {
- fn = fn.effect.fn;
- }
- const e = new ReactiveEffect(fn);
- if (options) {
- extend(e, options);
- }
- try {
- e.run();
- } catch (err) {
- e.stop();
- throw err;
- }
- const runner = e.run.bind(e);
- runner.effect = e;
- return runner;
- }
- function stop(runner) {
- runner.effect.stop();
- }
- let shouldTrack = true;
- const trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function cleanupEffect(e) {
- const { cleanup } = e;
- e.cleanup = void 0;
- if (cleanup) {
- const prevSub = activeSub;
- activeSub = void 0;
- try {
- cleanup();
- } finally {
- activeSub = prevSub;
- }
- }
- }
-
- let globalVersion = 0;
- class Link {
- constructor(sub, dep) {
- this.sub = sub;
- this.dep = dep;
- this.version = dep.version;
- this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
- }
- }
- class Dep {
- constructor(computed) {
- this.computed = computed;
- this.version = 0;
- /**
- * Link between this dep and the current active effect
- */
- this.activeLink = void 0;
- /**
- * Doubly linked list representing the subscribing effects (tail)
- */
- this.subs = void 0;
- /**
- * For object property deps cleanup
- */
- this.map = void 0;
- this.key = void 0;
- /**
- * Subscriber counter
- */
- this.sc = 0;
- {
- this.subsHead = void 0;
- }
- }
- track(debugInfo) {
- if (!activeSub || !shouldTrack || activeSub === this.computed) {
- return;
- }
- let link = this.activeLink;
- if (link === void 0 || link.sub !== activeSub) {
- link = this.activeLink = new Link(activeSub, this);
- if (!activeSub.deps) {
- activeSub.deps = activeSub.depsTail = link;
- } else {
- link.prevDep = activeSub.depsTail;
- activeSub.depsTail.nextDep = link;
- activeSub.depsTail = link;
- }
- addSub(link);
- } else if (link.version === -1) {
- link.version = this.version;
- if (link.nextDep) {
- const next = link.nextDep;
- next.prevDep = link.prevDep;
- if (link.prevDep) {
- link.prevDep.nextDep = next;
- }
- link.prevDep = activeSub.depsTail;
- link.nextDep = void 0;
- activeSub.depsTail.nextDep = link;
- activeSub.depsTail = link;
- if (activeSub.deps === link) {
- activeSub.deps = next;
- }
- }
- }
- if (activeSub.onTrack) {
- activeSub.onTrack(
- extend(
- {
- effect: activeSub
- },
- debugInfo
- )
- );
- }
- return link;
- }
- trigger(debugInfo) {
- this.version++;
- globalVersion++;
- this.notify(debugInfo);
- }
- notify(debugInfo) {
- startBatch();
- try {
- if (true) {
- for (let head = this.subsHead; head; head = head.nextSub) {
- if (head.sub.onTrigger && !(head.sub.flags & 8)) {
- head.sub.onTrigger(
- extend(
- {
- effect: head.sub
- },
- debugInfo
- )
- );
- }
- }
- }
- for (let link = this.subs; link; link = link.prevSub) {
- if (link.sub.notify()) {
- ;
- link.sub.dep.notify();
- }
- }
- } finally {
- endBatch();
- }
- }
- }
- function addSub(link) {
- link.dep.sc++;
- if (link.sub.flags & 4) {
- const computed = link.dep.computed;
- if (computed && !link.dep.subs) {
- computed.flags |= 4 | 16;
- for (let l = computed.deps; l; l = l.nextDep) {
- addSub(l);
- }
- }
- const currentTail = link.dep.subs;
- if (currentTail !== link) {
- link.prevSub = currentTail;
- if (currentTail) currentTail.nextSub = link;
- }
- if (link.dep.subsHead === void 0) {
- link.dep.subsHead = link;
- }
- link.dep.subs = link;
- }
- }
- const targetMap = /* @__PURE__ */ new WeakMap();
- const ITERATE_KEY = Symbol(
- "Object iterate"
- );
- const MAP_KEY_ITERATE_KEY = Symbol(
- "Map keys iterate"
- );
- const ARRAY_ITERATE_KEY = Symbol(
- "Array iterate"
- );
- function track(target, type, key) {
- if (shouldTrack && activeSub) {
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Dep());
- dep.map = depsMap;
- dep.key = key;
- }
- {
- dep.track({
- target,
- type,
- key
- });
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- globalVersion++;
- return;
- }
- const run = (dep) => {
- if (dep) {
- {
- dep.trigger({
- target,
- type,
- key,
- newValue,
- oldValue,
- oldTarget
- });
- }
- }
- };
- startBatch();
- if (type === "clear") {
- depsMap.forEach(run);
- } else {
- const targetIsArray = isArray(target);
- const isArrayIndex = targetIsArray && isIntegerKey(key);
- if (targetIsArray && key === "length") {
- const newLength = Number(newValue);
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
- run(dep);
- }
- });
- } else {
- if (key !== void 0 || depsMap.has(void 0)) {
- run(depsMap.get(key));
- }
- if (isArrayIndex) {
- run(depsMap.get(ARRAY_ITERATE_KEY));
- }
- switch (type) {
- case "add":
- if (!targetIsArray) {
- run(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- run(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (isArrayIndex) {
- run(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!targetIsArray) {
- run(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- run(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (isMap(target)) {
- run(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- }
- endBatch();
- }
- function getDepFromReactive(object, key) {
- const depMap = targetMap.get(object);
- return depMap && depMap.get(key);
- }
-
- function reactiveReadArray(array) {
- const raw = toRaw(array);
- if (raw === array) return raw;
- track(raw, "iterate", ARRAY_ITERATE_KEY);
- return isShallow(array) ? raw : raw.map(toReactive);
- }
- function shallowReadArray(arr) {
- track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
- return arr;
- }
- const arrayInstrumentations = {
- __proto__: null,
- [Symbol.iterator]() {
- return iterator(this, Symbol.iterator, toReactive);
- },
- concat(...args) {
- return reactiveReadArray(this).concat(
- ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
- );
- },
- entries() {
- return iterator(this, "entries", (value) => {
- value[1] = toReactive(value[1]);
- return value;
- });
- },
- every(fn, thisArg) {
- return apply(this, "every", fn, thisArg, void 0, arguments);
- },
- filter(fn, thisArg) {
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
- },
- find(fn, thisArg) {
- return apply(this, "find", fn, thisArg, toReactive, arguments);
- },
- findIndex(fn, thisArg) {
- return apply(this, "findIndex", fn, thisArg, void 0, arguments);
- },
- findLast(fn, thisArg) {
- return apply(this, "findLast", fn, thisArg, toReactive, arguments);
- },
- findLastIndex(fn, thisArg) {
- return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
- },
- // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
- forEach(fn, thisArg) {
- return apply(this, "forEach", fn, thisArg, void 0, arguments);
- },
- includes(...args) {
- return searchProxy(this, "includes", args);
- },
- indexOf(...args) {
- return searchProxy(this, "indexOf", args);
- },
- join(separator) {
- return reactiveReadArray(this).join(separator);
- },
- // keys() iterator only reads `length`, no optimisation required
- lastIndexOf(...args) {
- return searchProxy(this, "lastIndexOf", args);
- },
- map(fn, thisArg) {
- return apply(this, "map", fn, thisArg, void 0, arguments);
- },
- pop() {
- return noTracking(this, "pop");
- },
- push(...args) {
- return noTracking(this, "push", args);
- },
- reduce(fn, ...args) {
- return reduce(this, "reduce", fn, args);
- },
- reduceRight(fn, ...args) {
- return reduce(this, "reduceRight", fn, args);
- },
- shift() {
- return noTracking(this, "shift");
- },
- // slice could use ARRAY_ITERATE but also seems to beg for range tracking
- some(fn, thisArg) {
- return apply(this, "some", fn, thisArg, void 0, arguments);
- },
- splice(...args) {
- return noTracking(this, "splice", args);
- },
- toReversed() {
- return reactiveReadArray(this).toReversed();
- },
- toSorted(comparer) {
- return reactiveReadArray(this).toSorted(comparer);
- },
- toSpliced(...args) {
- return reactiveReadArray(this).toSpliced(...args);
- },
- unshift(...args) {
- return noTracking(this, "unshift", args);
- },
- values() {
- return iterator(this, "values", toReactive);
- }
- };
- function iterator(self, method, wrapValue) {
- const arr = shallowReadArray(self);
- const iter = arr[method]();
- if (arr !== self && !isShallow(self)) {
- iter._next = iter.next;
- iter.next = () => {
- const result = iter._next();
- if (result.value) {
- result.value = wrapValue(result.value);
- }
- return result;
- };
- }
- return iter;
- }
- const arrayProto = Array.prototype;
- function apply(self, method, fn, thisArg, wrappedRetFn, args) {
- const arr = shallowReadArray(self);
- const needsWrap = arr !== self && !isShallow(self);
- const methodFn = arr[method];
- if (methodFn !== arrayProto[method]) {
- const result2 = methodFn.apply(self, args);
- return needsWrap ? toReactive(result2) : result2;
- }
- let wrappedFn = fn;
- if (arr !== self) {
- if (needsWrap) {
- wrappedFn = function(item, index) {
- return fn.call(this, toReactive(item), index, self);
- };
- } else if (fn.length > 2) {
- wrappedFn = function(item, index) {
- return fn.call(this, item, index, self);
- };
- }
- }
- const result = methodFn.call(arr, wrappedFn, thisArg);
- return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
- }
- function reduce(self, method, fn, args) {
- const arr = shallowReadArray(self);
- let wrappedFn = fn;
- if (arr !== self) {
- if (!isShallow(self)) {
- wrappedFn = function(acc, item, index) {
- return fn.call(this, acc, toReactive(item), index, self);
- };
- } else if (fn.length > 3) {
- wrappedFn = function(acc, item, index) {
- return fn.call(this, acc, item, index, self);
- };
- }
- }
- return arr[method](wrappedFn, ...args);
- }
- function searchProxy(self, method, args) {
- const arr = toRaw(self);
- track(arr, "iterate", ARRAY_ITERATE_KEY);
- const res = arr[method](...args);
- if ((res === -1 || res === false) && isProxy(args[0])) {
- args[0] = toRaw(args[0]);
- return arr[method](...args);
- }
- return res;
- }
- function noTracking(self, method, args = []) {
- pauseTracking();
- startBatch();
- const res = toRaw(self)[method].apply(self, args);
- endBatch();
- resetTracking();
- return res;
- }
-
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
- const builtInSymbols = new Set(
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
- );
- function hasOwnProperty(key) {
- if (!isSymbol(key)) key = String(key);
- const obj = toRaw(this);
- track(obj, "has", key);
- return obj.hasOwnProperty(key);
- }
- class BaseReactiveHandler {
- constructor(_isReadonly = false, _isShallow = false) {
- this._isReadonly = _isReadonly;
- this._isShallow = _isShallow;
- }
- get(target, key, receiver) {
- if (key === "__v_skip") return target["__v_skip"];
- const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_isShallow") {
- return isShallow2;
- } else if (key === "__v_raw") {
- if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
- // this means the receiver is a user proxy of the reactive proxy
- Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
- return target;
- }
- return;
- }
- const targetIsArray = isArray(target);
- if (!isReadonly2) {
- let fn;
- if (targetIsArray && (fn = arrayInstrumentations[key])) {
- return fn;
- }
- if (key === "hasOwnProperty") {
- return hasOwnProperty;
- }
- }
- const res = Reflect.get(
- target,
- key,
- // if this is a proxy wrapping a ref, return methods using the raw ref
- // as receiver so that we don't have to call `toRaw` on the ref in all
- // its class methods
- isRef(target) ? target : receiver
- );
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (isShallow2) {
- return res;
- }
- if (isRef(res)) {
- return targetIsArray && isIntegerKey(key) ? res : res.value;
- }
- if (isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive(res);
- }
- return res;
- }
- }
- class MutableReactiveHandler extends BaseReactiveHandler {
- constructor(isShallow2 = false) {
- super(false, isShallow2);
- }
- set(target, key, value, receiver) {
- let oldValue = target[key];
- if (!this._isShallow) {
- const isOldValueReadonly = isReadonly(oldValue);
- if (!isShallow(value) && !isReadonly(value)) {
- oldValue = toRaw(oldValue);
- value = toRaw(value);
- }
- if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
- if (isOldValueReadonly) {
- return false;
- } else {
- oldValue.value = value;
- return true;
- }
- }
- }
- const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
- const result = Reflect.set(
- target,
- key,
- value,
- isRef(target) ? target : receiver
- );
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- }
- return result;
- }
- deleteProperty(target, key) {
- const hadKey = hasOwn(target, key);
- const oldValue = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- }
- has(target, key) {
- const result = Reflect.has(target, key);
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- ownKeys(target) {
- track(
- target,
- "iterate",
- isArray(target) ? "length" : ITERATE_KEY
- );
- return Reflect.ownKeys(target);
- }
- }
- class ReadonlyReactiveHandler extends BaseReactiveHandler {
- constructor(isShallow2 = false) {
- super(true, isShallow2);
- }
- set(target, key) {
- {
- warn$2(
- `Set operation on key "${String(key)}" failed: target is readonly.`,
- target
- );
- }
- return true;
- }
- deleteProperty(target, key) {
- {
- warn$2(
- `Delete operation on key "${String(key)}" failed: target is readonly.`,
- target
- );
- }
- return true;
- }
- }
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
-
- const toShallow = (value) => value;
- const getProto = (v) => Reflect.getPrototypeOf(v);
- function createIterableMethod(method, isReadonly2, isShallow2) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(
- rawTarget,
- "iterate",
- isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
- );
- return {
- // iterator protocol
- next() {
- const { value, done } = innerIterator.next();
- return done ? { value, done } : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- // iterable protocol
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- warn$2(
- `${capitalize(type)} operation ${key}failed: target is readonly.`,
- toRaw(this)
- );
- }
- return type === "delete" ? false : type === "clear" ? void 0 : this;
- };
- }
- function createInstrumentations(readonly, shallow) {
- const instrumentations = {
- get(key) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!readonly) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "get", key);
- }
- track(rawTarget, "get", rawKey);
- }
- const { has } = getProto(rawTarget);
- const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
- if (has.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- },
- get size() {
- const target = this["__v_raw"];
- !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- },
- has(key) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!readonly) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "has", key);
- }
- track(rawTarget, "has", rawKey);
- }
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- },
- forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw(target);
- const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
- !readonly && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- }
- };
- extend(
- instrumentations,
- readonly ? {
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear")
- } : {
- add(value) {
- if (!shallow && !isShallow(value) && !isReadonly(value)) {
- value = toRaw(value);
- }
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- },
- set(key, value) {
- if (!shallow && !isShallow(value) && !isReadonly(value)) {
- value = toRaw(value);
- }
- const target = toRaw(this);
- const { has, get } = getProto(target);
- let hadKey = has.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has.call(target, key);
- } else {
- checkIdentityKeys(target, has, key);
- }
- const oldValue = get.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value, oldValue);
- }
- return this;
- },
- delete(key) {
- const target = toRaw(this);
- const { has, get } = getProto(target);
- let hadKey = has.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has.call(target, key);
- } else {
- checkIdentityKeys(target, has, key);
- }
- const oldValue = get ? get.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue);
- }
- return result;
- },
- clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
- const result = target.clear();
- if (hadItems) {
- trigger(
- target,
- "clear",
- void 0,
- void 0,
- oldTarget
- );
- }
- return result;
- }
- }
- );
- const iteratorMethods = [
- "keys",
- "values",
- "entries",
- Symbol.iterator
- ];
- iteratorMethods.forEach((method) => {
- instrumentations[method] = createIterableMethod(method, readonly, shallow);
- });
- return instrumentations;
- }
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = createInstrumentations(isReadonly2, shallow);
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(
- hasOwn(instrumentations, key) && key in target ? instrumentations : target,
- key,
- receiver
- );
- };
- }
- const mutableCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, false)
- };
- const shallowCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, true)
- };
- const readonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, false)
- };
- const shallowReadonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, true)
- };
- function checkIdentityKeys(target, has, key) {
- const rawKey = toRaw(key);
- if (rawKey !== key && has.call(target, rawKey)) {
- const type = toRawType(target);
- warn$2(
- `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
- );
- }
- }
-
- const reactiveMap = /* @__PURE__ */ new WeakMap();
- const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
- const readonlyMap = /* @__PURE__ */ new WeakMap();
- const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1 /* COMMON */;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2 /* COLLECTION */;
- default:
- return 0 /* INVALID */;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
- }
- function reactive(target) {
- if (isReadonly(target)) {
- return target;
- }
- return createReactiveObject(
- target,
- false,
- mutableHandlers,
- mutableCollectionHandlers,
- reactiveMap
- );
- }
- function shallowReactive(target) {
- return createReactiveObject(
- target,
- false,
- shallowReactiveHandlers,
- shallowCollectionHandlers,
- shallowReactiveMap
- );
- }
- function readonly(target) {
- return createReactiveObject(
- target,
- true,
- readonlyHandlers,
- readonlyCollectionHandlers,
- readonlyMap
- );
- }
- function shallowReadonly(target) {
- return createReactiveObject(
- target,
- true,
- shallowReadonlyHandlers,
- shallowReadonlyCollectionHandlers,
- shallowReadonlyMap
- );
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject(target)) {
- {
- warn$2(
- `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
- target
- )}`
- );
- }
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0 /* INVALID */) {
- return target;
- }
- const proxy = new Proxy(
- target,
- targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
- );
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive(value) {
- if (isReadonly(value)) {
- return isReactive(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isShallow(value) {
- return !!(value && value["__v_isShallow"]);
- }
- function isProxy(value) {
- return value ? !!value["__v_raw"] : false;
- }
- function toRaw(observed) {
- const raw = observed && observed["__v_raw"];
- return raw ? toRaw(raw) : observed;
- }
- function markRaw(value) {
- if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
- def(value, "__v_skip", true);
- }
- return value;
- }
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
-
- function isRef(r) {
- return r ? r["__v_isRef"] === true : false;
- }
- function ref(value) {
- return createRef(value, false);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- function createRef(rawValue, shallow) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- class RefImpl {
- constructor(value, isShallow2) {
- this.dep = new Dep();
- this["__v_isRef"] = true;
- this["__v_isShallow"] = false;
- this._rawValue = isShallow2 ? value : toRaw(value);
- this._value = isShallow2 ? value : toReactive(value);
- this["__v_isShallow"] = isShallow2;
- }
- get value() {
- {
- this.dep.track({
- target: this,
- type: "get",
- key: "value"
- });
- }
- return this._value;
- }
- set value(newValue) {
- const oldValue = this._rawValue;
- const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
- newValue = useDirectValue ? newValue : toRaw(newValue);
- if (hasChanged(newValue, oldValue)) {
- this._rawValue = newValue;
- this._value = useDirectValue ? newValue : toReactive(newValue);
- {
- this.dep.trigger({
- target: this,
- type: "set",
- key: "value",
- newValue,
- oldValue
- });
- }
- }
- }
- }
- function triggerRef(ref2) {
- if (ref2.dep) {
- {
- ref2.dep.trigger({
- target: ref2,
- type: "set",
- key: "value",
- newValue: ref2._value
- });
- }
- }
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- function toValue(source) {
- return isFunction(source) ? source() : unref(source);
- }
- const shallowUnwrapHandlers = {
- get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- class CustomRefImpl {
- constructor(factory) {
- this["__v_isRef"] = true;
- this._value = void 0;
- const dep = this.dep = new Dep();
- const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
- this._get = get;
- this._set = set;
- }
- get value() {
- return this._value = this._get();
- }
- set value(newVal) {
- this._set(newVal);
- }
- }
- function customRef(factory) {
- return new CustomRefImpl(factory);
- }
- function toRefs(object) {
- if (!isProxy(object)) {
- warn$2(`toRefs() expects a reactive object but received a plain one.`);
- }
- const ret = isArray(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = propertyToRef(object, key);
- }
- return ret;
- }
- class ObjectRefImpl {
- constructor(_object, _key, _defaultValue) {
- this._object = _object;
- this._key = _key;
- this._defaultValue = _defaultValue;
- this["__v_isRef"] = true;
- this._value = void 0;
- }
- get value() {
- const val = this._object[this._key];
- return this._value = val === void 0 ? this._defaultValue : val;
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- get dep() {
- return getDepFromReactive(toRaw(this._object), this._key);
- }
- }
- class GetterRefImpl {
- constructor(_getter) {
- this._getter = _getter;
- this["__v_isRef"] = true;
- this["__v_isReadonly"] = true;
- this._value = void 0;
- }
- get value() {
- return this._value = this._getter();
- }
- }
- function toRef(source, key, defaultValue) {
- if (isRef(source)) {
- return source;
- } else if (isFunction(source)) {
- return new GetterRefImpl(source);
- } else if (isObject(source) && arguments.length > 1) {
- return propertyToRef(source, key, defaultValue);
- } else {
- return ref(source);
- }
- }
- function propertyToRef(source, key, defaultValue) {
- const val = source[key];
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
- }
-
- class ComputedRefImpl {
- constructor(fn, setter, isSSR) {
- this.fn = fn;
- this.setter = setter;
- /**
- * @internal
- */
- this._value = void 0;
- /**
- * @internal
- */
- this.dep = new Dep(this);
- /**
- * @internal
- */
- this.__v_isRef = true;
- // TODO isolatedDeclarations "__v_isReadonly"
- // A computed is also a subscriber that tracks other deps
- /**
- * @internal
- */
- this.deps = void 0;
- /**
- * @internal
- */
- this.depsTail = void 0;
- /**
- * @internal
- */
- this.flags = 16;
- /**
- * @internal
- */
- this.globalVersion = globalVersion - 1;
- /**
- * @internal
- */
- this.next = void 0;
- // for backwards compat
- this.effect = this;
- this["__v_isReadonly"] = !setter;
- this.isSSR = isSSR;
- }
- /**
- * @internal
- */
- notify() {
- this.flags |= 16;
- if (!(this.flags & 8) && // avoid infinite self recursion
- activeSub !== this) {
- batch(this, true);
- return true;
- }
- }
- get value() {
- const link = this.dep.track({
- target: this,
- type: "get",
- key: "value"
- }) ;
- refreshComputed(this);
- if (link) {
- link.version = this.dep.version;
- }
- return this._value;
- }
- set value(newValue) {
- if (this.setter) {
- this.setter(newValue);
- } else {
- warn$2("Write operation failed: computed value is readonly");
- }
- }
- }
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
- let getter;
- let setter;
- if (isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- const cRef = new ComputedRefImpl(getter, setter, isSSR);
- if (debugOptions && !isSSR) {
- cRef.onTrack = debugOptions.onTrack;
- cRef.onTrigger = debugOptions.onTrigger;
- }
- return cRef;
- }
-
- const TrackOpTypes = {
- "GET": "get",
- "HAS": "has",
- "ITERATE": "iterate"
- };
- const TriggerOpTypes = {
- "SET": "set",
- "ADD": "add",
- "DELETE": "delete",
- "CLEAR": "clear"
- };
-
- const INITIAL_WATCHER_VALUE = {};
- const cleanupMap = /* @__PURE__ */ new WeakMap();
- let activeWatcher = void 0;
- function getCurrentWatcher() {
- return activeWatcher;
- }
- function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
- if (owner) {
- let cleanups = cleanupMap.get(owner);
- if (!cleanups) cleanupMap.set(owner, cleanups = []);
- cleanups.push(cleanupFn);
- } else if (!failSilently) {
- warn$2(
- `onWatcherCleanup() was called when there was no active watcher to associate with.`
- );
- }
- }
- function watch$1(source, cb, options = EMPTY_OBJ) {
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
- const warnInvalidSource = (s) => {
- (options.onWarn || warn$2)(
- `Invalid watch source: `,
- s,
- `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
- );
- };
- const reactiveGetter = (source2) => {
- if (deep) return source2;
- if (isShallow(source2) || deep === false || deep === 0)
- return traverse(source2, 1);
- return traverse(source2);
- };
- let effect;
- let getter;
- let cleanup;
- let boundCleanup;
- let forceTrigger = false;
- let isMultiSource = false;
- if (isRef(source)) {
- getter = () => source.value;
- forceTrigger = isShallow(source);
- } else if (isReactive(source)) {
- getter = () => reactiveGetter(source);
- forceTrigger = true;
- } else if (isArray(source)) {
- isMultiSource = true;
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
- getter = () => source.map((s) => {
- if (isRef(s)) {
- return s.value;
- } else if (isReactive(s)) {
- return reactiveGetter(s);
- } else if (isFunction(s)) {
- return call ? call(s, 2) : s();
- } else {
- warnInvalidSource(s);
- }
- });
- } else if (isFunction(source)) {
- if (cb) {
- getter = call ? () => call(source, 2) : source;
- } else {
- getter = () => {
- if (cleanup) {
- pauseTracking();
- try {
- cleanup();
- } finally {
- resetTracking();
- }
- }
- const currentEffect = activeWatcher;
- activeWatcher = effect;
- try {
- return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
- } finally {
- activeWatcher = currentEffect;
- }
- };
- }
- } else {
- getter = NOOP;
- warnInvalidSource(source);
- }
- if (cb && deep) {
- const baseGetter = getter;
- const depth = deep === true ? Infinity : deep;
- getter = () => traverse(baseGetter(), depth);
- }
- const scope = getCurrentScope();
- const watchHandle = () => {
- effect.stop();
- if (scope && scope.active) {
- remove(scope.effects, effect);
- }
- };
- if (once && cb) {
- const _cb = cb;
- cb = (...args) => {
- _cb(...args);
- watchHandle();
- };
- }
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
- const job = (immediateFirstRun) => {
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
- return;
- }
- if (cb) {
- const newValue = effect.run();
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
- if (cleanup) {
- cleanup();
- }
- const currentWatcher = activeWatcher;
- activeWatcher = effect;
- try {
- const args = [
- newValue,
- // pass undefined as the old value when it's changed for the first time
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
- boundCleanup
- ];
- call ? call(cb, 3, args) : (
- // @ts-expect-error
- cb(...args)
- );
- oldValue = newValue;
- } finally {
- activeWatcher = currentWatcher;
- }
- }
- } else {
- effect.run();
- }
- };
- if (augmentJob) {
- augmentJob(job);
- }
- effect = new ReactiveEffect(getter);
- effect.scheduler = scheduler ? () => scheduler(job, false) : job;
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
- cleanup = effect.onStop = () => {
- const cleanups = cleanupMap.get(effect);
- if (cleanups) {
- if (call) {
- call(cleanups, 4);
- } else {
- for (const cleanup2 of cleanups) cleanup2();
- }
- cleanupMap.delete(effect);
- }
- };
- {
- effect.onTrack = options.onTrack;
- effect.onTrigger = options.onTrigger;
- }
- if (cb) {
- if (immediate) {
- job(true);
- } else {
- oldValue = effect.run();
- }
- } else if (scheduler) {
- scheduler(job.bind(null, true), true);
- } else {
- effect.run();
- }
- watchHandle.pause = effect.pause.bind(effect);
- watchHandle.resume = effect.resume.bind(effect);
- watchHandle.stop = watchHandle;
- return watchHandle;
- }
- function traverse(value, depth = Infinity, seen) {
- if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
- return value;
- }
- seen = seen || /* @__PURE__ */ new Set();
- if (seen.has(value)) {
- return value;
- }
- seen.add(value);
- depth--;
- if (isRef(value)) {
- traverse(value.value, depth, seen);
- } else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- traverse(value[i], depth, seen);
- }
- } else if (isSet(value) || isMap(value)) {
- value.forEach((v) => {
- traverse(v, depth, seen);
- });
- } else if (isPlainObject(value)) {
- for (const key in value) {
- traverse(value[key], depth, seen);
- }
- for (const key of Object.getOwnPropertySymbols(value)) {
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
- traverse(value[key], depth, seen);
- }
- }
- }
- return value;
- }
-
- const stack$1 = [];
- function pushWarningContext(vnode) {
- stack$1.push(vnode);
- }
- function popWarningContext() {
- stack$1.pop();
- }
- let isWarning = false;
- function warn$1(msg, ...args) {
- if (isWarning) return;
- isWarning = true;
- pauseTracking();
- const instance = stack$1.length ? stack$1[stack$1.length - 1].component : null;
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
- const trace = getComponentTrace();
- if (appWarnHandler) {
- callWithErrorHandling(
- appWarnHandler,
- instance,
- 11,
- [
- // eslint-disable-next-line no-restricted-syntax
- msg + args.map((a) => {
- var _a, _b;
- return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
- }).join(""),
- instance && instance.proxy,
- trace.map(
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
- ).join("\n"),
- trace
- ]
- );
- } else {
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
- if (trace.length && // avoid spamming console during tests
- true) {
- warnArgs.push(`
-`, ...formatTrace(trace));
- }
- console.warn(...warnArgs);
- }
- resetTracking();
- isWarning = false;
- }
- function getComponentTrace() {
- let currentVNode = stack$1[stack$1.length - 1];
- if (!currentVNode) {
- return [];
- }
- const normalizedStack = [];
- while (currentVNode) {
- const last = normalizedStack[0];
- if (last && last.vnode === currentVNode) {
- last.recurseCount++;
- } else {
- normalizedStack.push({
- vnode: currentVNode,
- recurseCount: 0
- });
- }
- const parentInstance = currentVNode.component && currentVNode.component.parent;
- currentVNode = parentInstance && parentInstance.vnode;
- }
- return normalizedStack;
- }
- function formatTrace(trace) {
- const logs = [];
- trace.forEach((entry, i) => {
- logs.push(...i === 0 ? [] : [`
-`], ...formatTraceEntry(entry));
- });
- return logs;
- }
- function formatTraceEntry({ vnode, recurseCount }) {
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
- const isRoot = vnode.component ? vnode.component.parent == null : false;
- const open = ` at <${formatComponentName(
- vnode.component,
- vnode.type,
- isRoot
- )}`;
- const close = `>` + postfix;
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
- }
- function formatProps(props) {
- const res = [];
- const keys = Object.keys(props);
- keys.slice(0, 3).forEach((key) => {
- res.push(...formatProp(key, props[key]));
- });
- if (keys.length > 3) {
- res.push(` ...`);
- }
- return res;
- }
- function formatProp(key, value, raw) {
- if (isString(value)) {
- value = JSON.stringify(value);
- return raw ? value : [`${key}=${value}`];
- } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
- return raw ? value : [`${key}=${value}`];
- } else if (isRef(value)) {
- value = formatProp(key, toRaw(value.value), true);
- return raw ? value : [`${key}=Ref<`, value, `>`];
- } else if (isFunction(value)) {
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
- } else {
- value = toRaw(value);
- return raw ? value : [`${key}=`, value];
- }
- }
- function assertNumber(val, type) {
- if (val === void 0) {
- return;
- } else if (typeof val !== "number") {
- warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
- } else if (isNaN(val)) {
- warn$1(`${type} is NaN - the duration expression might be incorrect.`);
- }
- }
-
- const ErrorCodes = {
- "SETUP_FUNCTION": 0,
- "0": "SETUP_FUNCTION",
- "RENDER_FUNCTION": 1,
- "1": "RENDER_FUNCTION",
- "NATIVE_EVENT_HANDLER": 5,
- "5": "NATIVE_EVENT_HANDLER",
- "COMPONENT_EVENT_HANDLER": 6,
- "6": "COMPONENT_EVENT_HANDLER",
- "VNODE_HOOK": 7,
- "7": "VNODE_HOOK",
- "DIRECTIVE_HOOK": 8,
- "8": "DIRECTIVE_HOOK",
- "TRANSITION_HOOK": 9,
- "9": "TRANSITION_HOOK",
- "APP_ERROR_HANDLER": 10,
- "10": "APP_ERROR_HANDLER",
- "APP_WARN_HANDLER": 11,
- "11": "APP_WARN_HANDLER",
- "FUNCTION_REF": 12,
- "12": "FUNCTION_REF",
- "ASYNC_COMPONENT_LOADER": 13,
- "13": "ASYNC_COMPONENT_LOADER",
- "SCHEDULER": 14,
- "14": "SCHEDULER",
- "COMPONENT_UPDATE": 15,
- "15": "COMPONENT_UPDATE",
- "APP_UNMOUNT_CLEANUP": 16,
- "16": "APP_UNMOUNT_CLEANUP"
- };
- const ErrorTypeStrings$1 = {
- ["sp"]: "serverPrefetch hook",
- ["bc"]: "beforeCreate hook",
- ["c"]: "created hook",
- ["bm"]: "beforeMount hook",
- ["m"]: "mounted hook",
- ["bu"]: "beforeUpdate hook",
- ["u"]: "updated",
- ["bum"]: "beforeUnmount hook",
- ["um"]: "unmounted hook",
- ["a"]: "activated hook",
- ["da"]: "deactivated hook",
- ["ec"]: "errorCaptured hook",
- ["rtc"]: "renderTracked hook",
- ["rtg"]: "renderTriggered hook",
- [0]: "setup function",
- [1]: "render function",
- [2]: "watcher getter",
- [3]: "watcher callback",
- [4]: "watcher cleanup function",
- [5]: "native event handler",
- [6]: "component event handler",
- [7]: "vnode hook",
- [8]: "directive hook",
- [9]: "transition hook",
- [10]: "app errorHandler",
- [11]: "app warnHandler",
- [12]: "ref function",
- [13]: "async component loader",
- [14]: "scheduler flush",
- [15]: "component update",
- [16]: "app unmount cleanup function"
- };
- function callWithErrorHandling(fn, instance, type, args) {
- try {
- return args ? fn(...args) : fn();
- } catch (err) {
- handleError(err, instance, type);
- }
- }
- function callWithAsyncErrorHandling(fn, instance, type, args) {
- if (isFunction(fn)) {
- const res = callWithErrorHandling(fn, instance, type, args);
- if (res && isPromise(res)) {
- res.catch((err) => {
- handleError(err, instance, type);
- });
- }
- return res;
- }
- if (isArray(fn)) {
- const values = [];
- for (let i = 0; i < fn.length; i++) {
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
- }
- return values;
- } else {
- warn$1(
- `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
- );
- }
- }
- function handleError(err, instance, type, throwInDev = true) {
- const contextVNode = instance ? instance.vnode : null;
- const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
- if (instance) {
- let cur = instance.parent;
- const exposedInstance = instance.proxy;
- const errorInfo = ErrorTypeStrings$1[type] ;
- while (cur) {
- const errorCapturedHooks = cur.ec;
- if (errorCapturedHooks) {
- for (let i = 0; i < errorCapturedHooks.length; i++) {
- if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
- return;
- }
- }
- }
- cur = cur.parent;
- }
- if (errorHandler) {
- pauseTracking();
- callWithErrorHandling(errorHandler, null, 10, [
- err,
- exposedInstance,
- errorInfo
- ]);
- resetTracking();
- return;
- }
- }
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
- }
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
- {
- const info = ErrorTypeStrings$1[type];
- if (contextVNode) {
- pushWarningContext(contextVNode);
- }
- warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
- if (contextVNode) {
- popWarningContext();
- }
- if (throwInDev) {
- throw err;
- } else {
- console.error(err);
- }
- }
- }
-
- const queue = [];
- let flushIndex = -1;
- const pendingPostFlushCbs = [];
- let activePostFlushCbs = null;
- let postFlushIndex = 0;
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
- let currentFlushPromise = null;
- const RECURSION_LIMIT = 100;
- function nextTick(fn) {
- const p = currentFlushPromise || resolvedPromise;
- return fn ? p.then(this ? fn.bind(this) : fn) : p;
- }
- function findInsertionIndex(id) {
- let start = flushIndex + 1;
- let end = queue.length;
- while (start < end) {
- const middle = start + end >>> 1;
- const middleJob = queue[middle];
- const middleJobId = getId(middleJob);
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
- start = middle + 1;
- } else {
- end = middle;
- }
- }
- return start;
- }
- function queueJob(job) {
- if (!(job.flags & 1)) {
- const jobId = getId(job);
- const lastJob = queue[queue.length - 1];
- if (!lastJob || // fast path when the job id is larger than the tail
- !(job.flags & 2) && jobId >= getId(lastJob)) {
- queue.push(job);
- } else {
- queue.splice(findInsertionIndex(jobId), 0, job);
- }
- job.flags |= 1;
- queueFlush();
- }
- }
- function queueFlush() {
- if (!currentFlushPromise) {
- currentFlushPromise = resolvedPromise.then(flushJobs);
- }
- }
- function queuePostFlushCb(cb) {
- if (!isArray(cb)) {
- if (activePostFlushCbs && cb.id === -1) {
- activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
- } else if (!(cb.flags & 1)) {
- pendingPostFlushCbs.push(cb);
- cb.flags |= 1;
- }
- } else {
- pendingPostFlushCbs.push(...cb);
- }
- queueFlush();
- }
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- for (; i < queue.length; i++) {
- const cb = queue[i];
- if (cb && cb.flags & 2) {
- if (instance && cb.id !== instance.uid) {
- continue;
- }
- if (checkRecursiveUpdates(seen, cb)) {
- continue;
- }
- queue.splice(i, 1);
- i--;
- if (cb.flags & 4) {
- cb.flags &= ~1;
- }
- cb();
- if (!(cb.flags & 4)) {
- cb.flags &= ~1;
- }
- }
- }
- }
- function flushPostFlushCbs(seen) {
- if (pendingPostFlushCbs.length) {
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
- (a, b) => getId(a) - getId(b)
- );
- pendingPostFlushCbs.length = 0;
- if (activePostFlushCbs) {
- activePostFlushCbs.push(...deduped);
- return;
- }
- activePostFlushCbs = deduped;
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
- const cb = activePostFlushCbs[postFlushIndex];
- if (checkRecursiveUpdates(seen, cb)) {
- continue;
- }
- if (cb.flags & 4) {
- cb.flags &= ~1;
- }
- if (!(cb.flags & 8)) cb();
- cb.flags &= ~1;
- }
- activePostFlushCbs = null;
- postFlushIndex = 0;
- }
- }
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
- function flushJobs(seen) {
- {
- seen = seen || /* @__PURE__ */ new Map();
- }
- const check = (job) => checkRecursiveUpdates(seen, job) ;
- try {
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job && !(job.flags & 8)) {
- if (check(job)) {
- continue;
- }
- if (job.flags & 4) {
- job.flags &= ~1;
- }
- callWithErrorHandling(
- job,
- job.i,
- job.i ? 15 : 14
- );
- if (!(job.flags & 4)) {
- job.flags &= ~1;
- }
- }
- }
- } finally {
- for (; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job) {
- job.flags &= ~1;
- }
- }
- flushIndex = -1;
- queue.length = 0;
- flushPostFlushCbs(seen);
- currentFlushPromise = null;
- if (queue.length || pendingPostFlushCbs.length) {
- flushJobs(seen);
- }
- }
- }
- function checkRecursiveUpdates(seen, fn) {
- const count = seen.get(fn) || 0;
- if (count > RECURSION_LIMIT) {
- const instance = fn.i;
- const componentName = instance && getComponentName(instance.type);
- handleError(
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
- null,
- 10
- );
- return true;
- }
- seen.set(fn, count + 1);
- return false;
- }
-
- let isHmrUpdating = false;
- const hmrDirtyComponents = /* @__PURE__ */ new Map();
- {
- getGlobalThis().__VUE_HMR_RUNTIME__ = {
- createRecord: tryWrap(createRecord),
- rerender: tryWrap(rerender),
- reload: tryWrap(reload)
- };
- }
- const map = /* @__PURE__ */ new Map();
- function registerHMR(instance) {
- const id = instance.type.__hmrId;
- let record = map.get(id);
- if (!record) {
- createRecord(id, instance.type);
- record = map.get(id);
- }
- record.instances.add(instance);
- }
- function unregisterHMR(instance) {
- map.get(instance.type.__hmrId).instances.delete(instance);
- }
- function createRecord(id, initialDef) {
- if (map.has(id)) {
- return false;
- }
- map.set(id, {
- initialDef: normalizeClassComponent(initialDef),
- instances: /* @__PURE__ */ new Set()
- });
- return true;
- }
- function normalizeClassComponent(component) {
- return isClassComponent(component) ? component.__vccOpts : component;
- }
- function rerender(id, newRender) {
- const record = map.get(id);
- if (!record) {
- return;
- }
- record.initialDef.render = newRender;
- [...record.instances].forEach((instance) => {
- if (newRender) {
- instance.render = newRender;
- normalizeClassComponent(instance.type).render = newRender;
- }
- instance.renderCache = [];
- isHmrUpdating = true;
- instance.update();
- isHmrUpdating = false;
- });
- }
- function reload(id, newComp) {
- const record = map.get(id);
- if (!record) return;
- newComp = normalizeClassComponent(newComp);
- updateComponentDef(record.initialDef, newComp);
- const instances = [...record.instances];
- for (let i = 0; i < instances.length; i++) {
- const instance = instances[i];
- const oldComp = normalizeClassComponent(instance.type);
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
- if (!dirtyInstances) {
- if (oldComp !== record.initialDef) {
- updateComponentDef(oldComp, newComp);
- }
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
- }
- dirtyInstances.add(instance);
- instance.appContext.propsCache.delete(instance.type);
- instance.appContext.emitsCache.delete(instance.type);
- instance.appContext.optionsCache.delete(instance.type);
- if (instance.ceReload) {
- dirtyInstances.add(instance);
- instance.ceReload(newComp.styles);
- dirtyInstances.delete(instance);
- } else if (instance.parent) {
- queueJob(() => {
- isHmrUpdating = true;
- instance.parent.update();
- isHmrUpdating = false;
- dirtyInstances.delete(instance);
- });
- } else if (instance.appContext.reload) {
- instance.appContext.reload();
- } else if (typeof window !== "undefined") {
- window.location.reload();
- } else {
- console.warn(
- "[HMR] Root or manually mounted instance modified. Full reload required."
- );
- }
- if (instance.root.ce && instance !== instance.root) {
- instance.root.ce._removeChildStyle(oldComp);
- }
- }
- queuePostFlushCb(() => {
- hmrDirtyComponents.clear();
- });
- }
- function updateComponentDef(oldComp, newComp) {
- extend(oldComp, newComp);
- for (const key in oldComp) {
- if (key !== "__file" && !(key in newComp)) {
- delete oldComp[key];
- }
- }
- }
- function tryWrap(fn) {
- return (id, arg) => {
- try {
- return fn(id, arg);
- } catch (e) {
- console.error(e);
- console.warn(
- `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
- );
- }
- };
- }
-
- let devtools$1;
- let buffer = [];
- let devtoolsNotInstalled = false;
- function emit$1(event, ...args) {
- if (devtools$1) {
- devtools$1.emit(event, ...args);
- } else if (!devtoolsNotInstalled) {
- buffer.push({ event, args });
- }
- }
- function setDevtoolsHook$1(hook, target) {
- var _a, _b;
- devtools$1 = hook;
- if (devtools$1) {
- devtools$1.enabled = true;
- buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
- buffer = [];
- } else if (
- // handle late devtools injection - only do this if we are in an actual
- // browser environment to avoid the timer handle stalling test runner exit
- // (#4815)
- typeof window !== "undefined" && // some envs mock window but not fully
- window.HTMLElement && // also exclude jsdom
- // eslint-disable-next-line no-restricted-syntax
- !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
- ) {
- const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
- replay.push((newHook) => {
- setDevtoolsHook$1(newHook, target);
- });
- setTimeout(() => {
- if (!devtools$1) {
- target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
- devtoolsNotInstalled = true;
- buffer = [];
- }
- }, 3e3);
- } else {
- devtoolsNotInstalled = true;
- buffer = [];
- }
- }
- function devtoolsInitApp(app, version) {
- emit$1("app:init" /* APP_INIT */, app, version, {
- Fragment,
- Text,
- Comment,
- Static
- });
- }
- function devtoolsUnmountApp(app) {
- emit$1("app:unmount" /* APP_UNMOUNT */, app);
- }
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
- const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
- const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:removed" /* COMPONENT_REMOVED */
- );
- const devtoolsComponentRemoved = (component) => {
- if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
- !devtools$1.cleanupBuffer(component)) {
- _devtoolsComponentRemoved(component);
- }
- };
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function createDevtoolsComponentHook(hook) {
- return (component) => {
- emit$1(
- hook,
- component.appContext.app,
- component.uid,
- component.parent ? component.parent.uid : void 0,
- component
- );
- };
- }
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
- function createDevtoolsPerformanceHook(hook) {
- return (component, type, time) => {
- emit$1(hook, component.appContext.app, component.uid, component, type, time);
- };
- }
- function devtoolsComponentEmit(component, event, params) {
- emit$1(
- "component:emit" /* COMPONENT_EMIT */,
- component.appContext.app,
- component,
- event,
- params
- );
- }
-
- let currentRenderingInstance = null;
- let currentScopeId = null;
- function setCurrentRenderingInstance(instance) {
- const prev = currentRenderingInstance;
- currentRenderingInstance = instance;
- currentScopeId = instance && instance.type.__scopeId || null;
- return prev;
- }
- function pushScopeId(id) {
- currentScopeId = id;
- }
- function popScopeId() {
- currentScopeId = null;
- }
- const withScopeId = (_id) => withCtx;
- function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
- if (!ctx) return fn;
- if (fn._n) {
- return fn;
- }
- const renderFnWithContext = (...args) => {
- if (renderFnWithContext._d) {
- setBlockTracking(-1);
- }
- const prevInstance = setCurrentRenderingInstance(ctx);
- let res;
- try {
- res = fn(...args);
- } finally {
- setCurrentRenderingInstance(prevInstance);
- if (renderFnWithContext._d) {
- setBlockTracking(1);
- }
- }
- {
- devtoolsComponentUpdated(ctx);
- }
- return res;
- };
- renderFnWithContext._n = true;
- renderFnWithContext._c = true;
- renderFnWithContext._d = true;
- return renderFnWithContext;
- }
-
- function validateDirectiveName(name) {
- if (isBuiltInDirective(name)) {
- warn$1("Do not use built-in directive ids as custom directive id: " + name);
- }
- }
- function withDirectives(vnode, directives) {
- if (currentRenderingInstance === null) {
- warn$1(`withDirectives can only be used inside render functions.`);
- return vnode;
- }
- const instance = getComponentPublicInstance(currentRenderingInstance);
- const bindings = vnode.dirs || (vnode.dirs = []);
- for (let i = 0; i < directives.length; i++) {
- let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
- if (dir) {
- if (isFunction(dir)) {
- dir = {
- mounted: dir,
- updated: dir
- };
- }
- if (dir.deep) {
- traverse(value);
- }
- bindings.push({
- dir,
- instance,
- value,
- oldValue: void 0,
- arg,
- modifiers
- });
- }
- }
- return vnode;
- }
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
- const bindings = vnode.dirs;
- const oldBindings = prevVNode && prevVNode.dirs;
- for (let i = 0; i < bindings.length; i++) {
- const binding = bindings[i];
- if (oldBindings) {
- binding.oldValue = oldBindings[i].value;
- }
- let hook = binding.dir[name];
- if (hook) {
- pauseTracking();
- callWithAsyncErrorHandling(hook, instance, 8, [
- vnode.el,
- binding,
- vnode,
- prevVNode
- ]);
- resetTracking();
- }
- }
- }
-
- const TeleportEndKey = Symbol("_vte");
- const isTeleport = (type) => type.__isTeleport;
- const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
- const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
- const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
- const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
- const resolveTarget = (props, select) => {
- const targetSelector = props && props.to;
- if (isString(targetSelector)) {
- if (!select) {
- warn$1(
- `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
- );
- return null;
- } else {
- const target = select(targetSelector);
- if (!target && !isTeleportDisabled(props)) {
- warn$1(
- `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
- );
- }
- return target;
- }
- } else {
- if (!targetSelector && !isTeleportDisabled(props)) {
- warn$1(`Invalid Teleport target: ${targetSelector}`);
- }
- return targetSelector;
- }
- };
- const TeleportImpl = {
- name: "Teleport",
- __isTeleport: true,
- process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
- const {
- mc: mountChildren,
- pc: patchChildren,
- pbc: patchBlockChildren,
- o: { insert, querySelector, createText, createComment }
- } = internals;
- const disabled = isTeleportDisabled(n2.props);
- let { shapeFlag, children, dynamicChildren } = n2;
- if (isHmrUpdating) {
- optimized = false;
- dynamicChildren = null;
- }
- if (n1 == null) {
- const placeholder = n2.el = createComment("teleport start") ;
- const mainAnchor = n2.anchor = createComment("teleport end") ;
- insert(placeholder, container, anchor);
- insert(mainAnchor, container, anchor);
- const mount = (container2, anchor2) => {
- if (shapeFlag & 16) {
- if (parentComponent && parentComponent.isCE) {
- parentComponent.ce._teleportTarget = container2;
- }
- mountChildren(
- children,
- container2,
- anchor2,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const mountToTarget = () => {
- const target = n2.target = resolveTarget(n2.props, querySelector);
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
- if (target) {
- if (namespace !== "svg" && isTargetSVG(target)) {
- namespace = "svg";
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
- namespace = "mathml";
- }
- if (!disabled) {
- mount(target, targetAnchor);
- updateCssVars(n2, false);
- }
- } else if (!disabled) {
- warn$1(
- "Invalid Teleport target on mount:",
- target,
- `(${typeof target})`
- );
- }
- };
- if (disabled) {
- mount(container, mainAnchor);
- updateCssVars(n2, true);
- }
- if (isTeleportDeferred(n2.props)) {
- queuePostRenderEffect(() => {
- mountToTarget();
- n2.el.__isMounted = true;
- }, parentSuspense);
- } else {
- mountToTarget();
- }
- } else {
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
- queuePostRenderEffect(() => {
- TeleportImpl.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- delete n1.el.__isMounted;
- }, parentSuspense);
- return;
- }
- n2.el = n1.el;
- n2.targetStart = n1.targetStart;
- const mainAnchor = n2.anchor = n1.anchor;
- const target = n2.target = n1.target;
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
- const wasDisabled = isTeleportDisabled(n1.props);
- const currentContainer = wasDisabled ? container : target;
- const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
- if (namespace === "svg" || isTargetSVG(target)) {
- namespace = "svg";
- } else if (namespace === "mathml" || isTargetMathML(target)) {
- namespace = "mathml";
- }
- if (dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- currentContainer,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds
- );
- traverseStaticChildren(n1, n2, true);
- } else if (!optimized) {
- patchChildren(
- n1,
- n2,
- currentContainer,
- currentAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- false
- );
- }
- if (disabled) {
- if (!wasDisabled) {
- moveTeleport(
- n2,
- container,
- mainAnchor,
- internals,
- 1
- );
- } else {
- if (n2.props && n1.props && n2.props.to !== n1.props.to) {
- n2.props.to = n1.props.to;
- }
- }
- } else {
- if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
- const nextTarget = n2.target = resolveTarget(
- n2.props,
- querySelector
- );
- if (nextTarget) {
- moveTeleport(
- n2,
- nextTarget,
- null,
- internals,
- 0
- );
- } else {
- warn$1(
- "Invalid Teleport target on update:",
- target,
- `(${typeof target})`
- );
- }
- } else if (wasDisabled) {
- moveTeleport(
- n2,
- target,
- targetAnchor,
- internals,
- 1
- );
- }
- }
- updateCssVars(n2, disabled);
- }
- },
- remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
- const {
- shapeFlag,
- children,
- anchor,
- targetStart,
- targetAnchor,
- target,
- props
- } = vnode;
- if (target) {
- hostRemove(targetStart);
- hostRemove(targetAnchor);
- }
- doRemove && hostRemove(anchor);
- if (shapeFlag & 16) {
- const shouldRemove = doRemove || !isTeleportDisabled(props);
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- unmount(
- child,
- parentComponent,
- parentSuspense,
- shouldRemove,
- !!child.dynamicChildren
- );
- }
- }
- },
- move: moveTeleport,
- hydrate: hydrateTeleport
- };
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
- if (moveType === 0) {
- insert(vnode.targetAnchor, container, parentAnchor);
- }
- const { el, anchor, shapeFlag, children, props } = vnode;
- const isReorder = moveType === 2;
- if (isReorder) {
- insert(el, container, parentAnchor);
- }
- if (!isReorder || isTeleportDisabled(props)) {
- if (shapeFlag & 16) {
- for (let i = 0; i < children.length; i++) {
- move(
- children[i],
- container,
- parentAnchor,
- 2
- );
- }
- }
- }
- if (isReorder) {
- insert(anchor, container, parentAnchor);
- }
- }
- function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
- o: { nextSibling, parentNode, querySelector, insert, createText }
- }, hydrateChildren) {
- const target = vnode.target = resolveTarget(
- vnode.props,
- querySelector
- );
- if (target) {
- const disabled = isTeleportDisabled(vnode.props);
- const targetNode = target._lpa || target.firstChild;
- if (vnode.shapeFlag & 16) {
- if (disabled) {
- vnode.anchor = hydrateChildren(
- nextSibling(node),
- vnode,
- parentNode(node),
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- vnode.targetStart = targetNode;
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
- } else {
- vnode.anchor = nextSibling(node);
- let targetAnchor = targetNode;
- while (targetAnchor) {
- if (targetAnchor && targetAnchor.nodeType === 8) {
- if (targetAnchor.data === "teleport start anchor") {
- vnode.targetStart = targetAnchor;
- } else if (targetAnchor.data === "teleport anchor") {
- vnode.targetAnchor = targetAnchor;
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
- break;
- }
- }
- targetAnchor = nextSibling(targetAnchor);
- }
- if (!vnode.targetAnchor) {
- prepareAnchor(target, vnode, createText, insert);
- }
- hydrateChildren(
- targetNode && nextSibling(targetNode),
- vnode,
- target,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- }
- }
- updateCssVars(vnode, disabled);
- }
- return vnode.anchor && nextSibling(vnode.anchor);
- }
- const Teleport = TeleportImpl;
- function updateCssVars(vnode, isDisabled) {
- const ctx = vnode.ctx;
- if (ctx && ctx.ut) {
- let node, anchor;
- if (isDisabled) {
- node = vnode.el;
- anchor = vnode.anchor;
- } else {
- node = vnode.targetStart;
- anchor = vnode.targetAnchor;
- }
- while (node && node !== anchor) {
- if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
- node = node.nextSibling;
- }
- ctx.ut();
- }
- }
- function prepareAnchor(target, vnode, createText, insert) {
- const targetStart = vnode.targetStart = createText("");
- const targetAnchor = vnode.targetAnchor = createText("");
- targetStart[TeleportEndKey] = targetAnchor;
- if (target) {
- insert(targetStart, target);
- insert(targetAnchor, target);
- }
- return targetAnchor;
- }
-
- const leaveCbKey = Symbol("_leaveCb");
- const enterCbKey$1 = Symbol("_enterCb");
- function useTransitionState() {
- const state = {
- isMounted: false,
- isLeaving: false,
- isUnmounting: false,
- leavingVNodes: /* @__PURE__ */ new Map()
- };
- onMounted(() => {
- state.isMounted = true;
- });
- onBeforeUnmount(() => {
- state.isUnmounting = true;
- });
- return state;
- }
- const TransitionHookValidator = [Function, Array];
- const BaseTransitionPropsValidators = {
- mode: String,
- appear: Boolean,
- persisted: Boolean,
- // enter
- onBeforeEnter: TransitionHookValidator,
- onEnter: TransitionHookValidator,
- onAfterEnter: TransitionHookValidator,
- onEnterCancelled: TransitionHookValidator,
- // leave
- onBeforeLeave: TransitionHookValidator,
- onLeave: TransitionHookValidator,
- onAfterLeave: TransitionHookValidator,
- onLeaveCancelled: TransitionHookValidator,
- // appear
- onBeforeAppear: TransitionHookValidator,
- onAppear: TransitionHookValidator,
- onAfterAppear: TransitionHookValidator,
- onAppearCancelled: TransitionHookValidator
- };
- const recursiveGetSubtree = (instance) => {
- const subTree = instance.subTree;
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
- };
- const BaseTransitionImpl = {
- name: `BaseTransition`,
- props: BaseTransitionPropsValidators,
- setup(props, { slots }) {
- const instance = getCurrentInstance();
- const state = useTransitionState();
- return () => {
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
- if (!children || !children.length) {
- return;
- }
- const child = findNonCommentChild(children);
- const rawProps = toRaw(props);
- const { mode } = rawProps;
- if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
- warn$1(`invalid <transition> mode: ${mode}`);
- }
- if (state.isLeaving) {
- return emptyPlaceholder(child);
- }
- const innerChild = getInnerChild$1(child);
- if (!innerChild) {
- return emptyPlaceholder(child);
- }
- let enterHooks = resolveTransitionHooks(
- innerChild,
- rawProps,
- state,
- instance,
- // #11061, ensure enterHooks is fresh after clone
- (hooks) => enterHooks = hooks
- );
- if (innerChild.type !== Comment) {
- setTransitionHooks(innerChild, enterHooks);
- }
- let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
- let leavingHooks = resolveTransitionHooks(
- oldInnerChild,
- rawProps,
- state,
- instance
- );
- setTransitionHooks(oldInnerChild, leavingHooks);
- if (mode === "out-in" && innerChild.type !== Comment) {
- state.isLeaving = true;
- leavingHooks.afterLeave = () => {
- state.isLeaving = false;
- if (!(instance.job.flags & 8)) {
- instance.update();
- }
- delete leavingHooks.afterLeave;
- oldInnerChild = void 0;
- };
- return emptyPlaceholder(child);
- } else if (mode === "in-out" && innerChild.type !== Comment) {
- leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
- const leavingVNodesCache = getLeavingNodesForType(
- state,
- oldInnerChild
- );
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
- el[leaveCbKey] = () => {
- earlyRemove();
- el[leaveCbKey] = void 0;
- delete enterHooks.delayedLeave;
- oldInnerChild = void 0;
- };
- enterHooks.delayedLeave = () => {
- delayedLeave();
- delete enterHooks.delayedLeave;
- oldInnerChild = void 0;
- };
- };
- } else {
- oldInnerChild = void 0;
- }
- } else if (oldInnerChild) {
- oldInnerChild = void 0;
- }
- return child;
- };
- }
- };
- function findNonCommentChild(children) {
- let child = children[0];
- if (children.length > 1) {
- let hasFound = false;
- for (const c of children) {
- if (c.type !== Comment) {
- if (hasFound) {
- warn$1(
- "<transition> can only be used on a single element or component. Use <transition-group> for lists."
- );
- break;
- }
- child = c;
- hasFound = true;
- }
- }
- }
- return child;
- }
- const BaseTransition = BaseTransitionImpl;
- function getLeavingNodesForType(state, vnode) {
- const { leavingVNodes } = state;
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
- if (!leavingVNodesCache) {
- leavingVNodesCache = /* @__PURE__ */ Object.create(null);
- leavingVNodes.set(vnode.type, leavingVNodesCache);
- }
- return leavingVNodesCache;
- }
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
- const {
- appear,
- mode,
- persisted = false,
- onBeforeEnter,
- onEnter,
- onAfterEnter,
- onEnterCancelled,
- onBeforeLeave,
- onLeave,
- onAfterLeave,
- onLeaveCancelled,
- onBeforeAppear,
- onAppear,
- onAfterAppear,
- onAppearCancelled
- } = props;
- const key = String(vnode.key);
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
- const callHook = (hook, args) => {
- hook && callWithAsyncErrorHandling(
- hook,
- instance,
- 9,
- args
- );
- };
- const callAsyncHook = (hook, args) => {
- const done = args[1];
- callHook(hook, args);
- if (isArray(hook)) {
- if (hook.every((hook2) => hook2.length <= 1)) done();
- } else if (hook.length <= 1) {
- done();
- }
- };
- const hooks = {
- mode,
- persisted,
- beforeEnter(el) {
- let hook = onBeforeEnter;
- if (!state.isMounted) {
- if (appear) {
- hook = onBeforeAppear || onBeforeEnter;
- } else {
- return;
- }
- }
- if (el[leaveCbKey]) {
- el[leaveCbKey](
- true
- /* cancelled */
- );
- }
- const leavingVNode = leavingVNodesCache[key];
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
- leavingVNode.el[leaveCbKey]();
- }
- callHook(hook, [el]);
- },
- enter(el) {
- let hook = onEnter;
- let afterHook = onAfterEnter;
- let cancelHook = onEnterCancelled;
- if (!state.isMounted) {
- if (appear) {
- hook = onAppear || onEnter;
- afterHook = onAfterAppear || onAfterEnter;
- cancelHook = onAppearCancelled || onEnterCancelled;
- } else {
- return;
- }
- }
- let called = false;
- const done = el[enterCbKey$1] = (cancelled) => {
- if (called) return;
- called = true;
- if (cancelled) {
- callHook(cancelHook, [el]);
- } else {
- callHook(afterHook, [el]);
- }
- if (hooks.delayedLeave) {
- hooks.delayedLeave();
- }
- el[enterCbKey$1] = void 0;
- };
- if (hook) {
- callAsyncHook(hook, [el, done]);
- } else {
- done();
- }
- },
- leave(el, remove) {
- const key2 = String(vnode.key);
- if (el[enterCbKey$1]) {
- el[enterCbKey$1](
- true
- /* cancelled */
- );
- }
- if (state.isUnmounting) {
- return remove();
- }
- callHook(onBeforeLeave, [el]);
- let called = false;
- const done = el[leaveCbKey] = (cancelled) => {
- if (called) return;
- called = true;
- remove();
- if (cancelled) {
- callHook(onLeaveCancelled, [el]);
- } else {
- callHook(onAfterLeave, [el]);
- }
- el[leaveCbKey] = void 0;
- if (leavingVNodesCache[key2] === vnode) {
- delete leavingVNodesCache[key2];
- }
- };
- leavingVNodesCache[key2] = vnode;
- if (onLeave) {
- callAsyncHook(onLeave, [el, done]);
- } else {
- done();
- }
- },
- clone(vnode2) {
- const hooks2 = resolveTransitionHooks(
- vnode2,
- props,
- state,
- instance,
- postClone
- );
- if (postClone) postClone(hooks2);
- return hooks2;
- }
- };
- return hooks;
- }
- function emptyPlaceholder(vnode) {
- if (isKeepAlive(vnode)) {
- vnode = cloneVNode(vnode);
- vnode.children = null;
- return vnode;
- }
- }
- function getInnerChild$1(vnode) {
- if (!isKeepAlive(vnode)) {
- if (isTeleport(vnode.type) && vnode.children) {
- return findNonCommentChild(vnode.children);
- }
- return vnode;
- }
- if (vnode.component) {
- return vnode.component.subTree;
- }
- const { shapeFlag, children } = vnode;
- if (children) {
- if (shapeFlag & 16) {
- return children[0];
- }
- if (shapeFlag & 32 && isFunction(children.default)) {
- return children.default();
- }
- }
- }
- function setTransitionHooks(vnode, hooks) {
- if (vnode.shapeFlag & 6 && vnode.component) {
- vnode.transition = hooks;
- setTransitionHooks(vnode.component.subTree, hooks);
- } else if (vnode.shapeFlag & 128) {
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
- } else {
- vnode.transition = hooks;
- }
- }
- function getTransitionRawChildren(children, keepComment = false, parentKey) {
- let ret = [];
- let keyedFragmentCount = 0;
- for (let i = 0; i < children.length; i++) {
- let child = children[i];
- const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
- if (child.type === Fragment) {
- if (child.patchFlag & 128) keyedFragmentCount++;
- ret = ret.concat(
- getTransitionRawChildren(child.children, keepComment, key)
- );
- } else if (keepComment || child.type !== Comment) {
- ret.push(key != null ? cloneVNode(child, { key }) : child);
- }
- }
- if (keyedFragmentCount > 1) {
- for (let i = 0; i < ret.length; i++) {
- ret[i].patchFlag = -2;
- }
- }
- return ret;
- }
-
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function defineComponent(options, extraOptions) {
- return isFunction(options) ? (
- // #8236: extend call and options.name access are considered side-effects
- // by Rollup, so we have to wrap it in a pure-annotated IIFE.
- /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
- ) : options;
- }
-
- function useId() {
- const i = getCurrentInstance();
- if (i) {
- return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
- } else {
- warn$1(
- `useId() is called when there is no active component instance to be associated with.`
- );
- }
- return "";
- }
- function markAsyncBoundary(instance) {
- instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
- }
-
- const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
- function useTemplateRef(key) {
- const i = getCurrentInstance();
- const r = shallowRef(null);
- if (i) {
- const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
- let desc;
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
- warn$1(`useTemplateRef('${key}') already exists.`);
- } else {
- Object.defineProperty(refs, key, {
- enumerable: true,
- get: () => r.value,
- set: (val) => r.value = val
- });
- }
- } else {
- warn$1(
- `useTemplateRef() is called when there is no active component instance to be associated with.`
- );
- }
- const ret = readonly(r) ;
- {
- knownTemplateRefs.add(ret);
- }
- return ret;
- }
-
- function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
- if (isArray(rawRef)) {
- rawRef.forEach(
- (r, i) => setRef(
- r,
- oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
- parentSuspense,
- vnode,
- isUnmount
- )
- );
- return;
- }
- if (isAsyncWrapper(vnode) && !isUnmount) {
- if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
- setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
- }
- return;
- }
- const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
- const value = isUnmount ? null : refValue;
- const { i: owner, r: ref } = rawRef;
- if (!owner) {
- warn$1(
- `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
- );
- return;
- }
- const oldRef = oldRawRef && oldRawRef.r;
- const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
- const setupState = owner.setupState;
- const rawSetupState = toRaw(setupState);
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
- {
- if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
- warn$1(
- `Template ref "${key}" used on a non-ref value. It will not work in the production build.`
- );
- }
- if (knownTemplateRefs.has(rawSetupState[key])) {
- return false;
- }
- }
- return hasOwn(rawSetupState, key);
- };
- if (oldRef != null && oldRef !== ref) {
- if (isString(oldRef)) {
- refs[oldRef] = null;
- if (canSetSetupRef(oldRef)) {
- setupState[oldRef] = null;
- }
- } else if (isRef(oldRef)) {
- oldRef.value = null;
- }
- }
- if (isFunction(ref)) {
- callWithErrorHandling(ref, owner, 12, [value, refs]);
- } else {
- const _isString = isString(ref);
- const _isRef = isRef(ref);
- if (_isString || _isRef) {
- const doSet = () => {
- if (rawRef.f) {
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
- if (isUnmount) {
- isArray(existing) && remove(existing, refValue);
- } else {
- if (!isArray(existing)) {
- if (_isString) {
- refs[ref] = [refValue];
- if (canSetSetupRef(ref)) {
- setupState[ref] = refs[ref];
- }
- } else {
- ref.value = [refValue];
- if (rawRef.k) refs[rawRef.k] = ref.value;
- }
- } else if (!existing.includes(refValue)) {
- existing.push(refValue);
- }
- }
- } else if (_isString) {
- refs[ref] = value;
- if (canSetSetupRef(ref)) {
- setupState[ref] = value;
- }
- } else if (_isRef) {
- ref.value = value;
- if (rawRef.k) refs[rawRef.k] = value;
- } else {
- warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
- }
- };
- if (value) {
- doSet.id = -1;
- queuePostRenderEffect(doSet, parentSuspense);
- } else {
- doSet();
- }
- } else {
- warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
- }
- }
- }
-
- let hasLoggedMismatchError = false;
- const logMismatchError = () => {
- if (hasLoggedMismatchError) {
- return;
- }
- console.error("Hydration completed but contains mismatches.");
- hasLoggedMismatchError = true;
- };
- const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
- const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
- const getContainerType = (container) => {
- if (container.nodeType !== 1) return void 0;
- if (isSVGContainer(container)) return "svg";
- if (isMathMLContainer(container)) return "mathml";
- return void 0;
- };
- const isComment = (node) => node.nodeType === 8;
- function createHydrationFunctions(rendererInternals) {
- const {
- mt: mountComponent,
- p: patch,
- o: {
- patchProp,
- createText,
- nextSibling,
- parentNode,
- remove,
- insert,
- createComment
- }
- } = rendererInternals;
- const hydrate = (vnode, container) => {
- if (!container.hasChildNodes()) {
- warn$1(
- `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
- );
- patch(null, vnode, container);
- flushPostFlushCbs();
- container._vnode = vnode;
- return;
- }
- hydrateNode(container.firstChild, vnode, null, null, null);
- flushPostFlushCbs();
- container._vnode = vnode;
- };
- const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
- optimized = optimized || !!vnode.dynamicChildren;
- const isFragmentStart = isComment(node) && node.data === "[";
- const onMismatch = () => handleMismatch(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- isFragmentStart
- );
- const { type, ref, shapeFlag, patchFlag } = vnode;
- let domType = node.nodeType;
- vnode.el = node;
- {
- def(node, "__vnode", vnode, true);
- def(node, "__vueParentComponent", parentComponent, true);
- }
- if (patchFlag === -2) {
- optimized = false;
- vnode.dynamicChildren = null;
- }
- let nextNode = null;
- switch (type) {
- case Text:
- if (domType !== 3) {
- if (vnode.children === "") {
- insert(vnode.el = createText(""), parentNode(node), node);
- nextNode = node;
- } else {
- nextNode = onMismatch();
- }
- } else {
- if (node.data !== vnode.children) {
- warn$1(
- `Hydration text mismatch in`,
- node.parentNode,
- `
- - rendered on server: ${JSON.stringify(
- node.data
- )}
- - expected on client: ${JSON.stringify(vnode.children)}`
- );
- logMismatchError();
- node.data = vnode.children;
- }
- nextNode = nextSibling(node);
- }
- break;
- case Comment:
- if (isTemplateNode(node)) {
- nextNode = nextSibling(node);
- replaceNode(
- vnode.el = node.content.firstChild,
- node,
- parentComponent
- );
- } else if (domType !== 8 || isFragmentStart) {
- nextNode = onMismatch();
- } else {
- nextNode = nextSibling(node);
- }
- break;
- case Static:
- if (isFragmentStart) {
- node = nextSibling(node);
- domType = node.nodeType;
- }
- if (domType === 1 || domType === 3) {
- nextNode = node;
- const needToAdoptContent = !vnode.children.length;
- for (let i = 0; i < vnode.staticCount; i++) {
- if (needToAdoptContent)
- vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
- if (i === vnode.staticCount - 1) {
- vnode.anchor = nextNode;
- }
- nextNode = nextSibling(nextNode);
- }
- return isFragmentStart ? nextSibling(nextNode) : nextNode;
- } else {
- onMismatch();
- }
- break;
- case Fragment:
- if (!isFragmentStart) {
- nextNode = onMismatch();
- } else {
- nextNode = hydrateFragment(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- }
- break;
- default:
- if (shapeFlag & 1) {
- if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
- nextNode = onMismatch();
- } else {
- nextNode = hydrateElement(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- }
- } else if (shapeFlag & 6) {
- vnode.slotScopeIds = slotScopeIds;
- const container = parentNode(node);
- if (isFragmentStart) {
- nextNode = locateClosingAnchor(node);
- } else if (isComment(node) && node.data === "teleport start") {
- nextNode = locateClosingAnchor(node, node.data, "teleport end");
- } else {
- nextNode = nextSibling(node);
- }
- mountComponent(
- vnode,
- container,
- null,
- parentComponent,
- parentSuspense,
- getContainerType(container),
- optimized
- );
- if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
- let subTree;
- if (isFragmentStart) {
- subTree = createVNode(Fragment);
- subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
- } else {
- subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
- }
- subTree.el = node;
- vnode.component.subTree = subTree;
- }
- } else if (shapeFlag & 64) {
- if (domType !== 8) {
- nextNode = onMismatch();
- } else {
- nextNode = vnode.type.hydrate(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized,
- rendererInternals,
- hydrateChildren
- );
- }
- } else if (shapeFlag & 128) {
- nextNode = vnode.type.hydrate(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- getContainerType(parentNode(node)),
- slotScopeIds,
- optimized,
- rendererInternals,
- hydrateNode
- );
- } else {
- warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
- }
- }
- if (ref != null) {
- setRef(ref, null, parentSuspense, vnode);
- }
- return nextNode;
- };
- const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
- optimized = optimized || !!vnode.dynamicChildren;
- const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
- const forcePatch = type === "input" || type === "option";
- {
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "created");
- }
- let needCallTransitionHooks = false;
- if (isTemplateNode(el)) {
- needCallTransitionHooks = needTransition(
- null,
- // no need check parentSuspense in hydration
- transition
- ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
- const content = el.content.firstChild;
- if (needCallTransitionHooks) {
- transition.beforeEnter(content);
- }
- replaceNode(content, el, parentComponent);
- vnode.el = el = content;
- }
- if (shapeFlag & 16 && // skip if element has innerHTML / textContent
- !(props && (props.innerHTML || props.textContent))) {
- let next = hydrateChildren(
- el.firstChild,
- vnode,
- el,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- let hasWarned = false;
- while (next) {
- if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
- if (!hasWarned) {
- warn$1(
- `Hydration children mismatch on`,
- el,
- `
-Server rendered element contains more child nodes than client vdom.`
- );
- hasWarned = true;
- }
- logMismatchError();
- }
- const cur = next;
- next = next.nextSibling;
- remove(cur);
- }
- } else if (shapeFlag & 8) {
- let clientText = vnode.children;
- if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
- clientText = clientText.slice(1);
- }
- if (el.textContent !== clientText) {
- if (!isMismatchAllowed(el, 0 /* TEXT */)) {
- warn$1(
- `Hydration text content mismatch on`,
- el,
- `
- - rendered on server: ${el.textContent}
- - expected on client: ${vnode.children}`
- );
- logMismatchError();
- }
- el.textContent = vnode.children;
- }
- }
- if (props) {
- {
- const isCustomElement = el.tagName.includes("-");
- for (const key in props) {
- if (// #11189 skip if this node has directives that have created hooks
- // as it could have mutated the DOM in any possible way
- !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
- logMismatchError();
- }
- if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
- key[0] === "." || isCustomElement) {
- patchProp(el, key, null, props[key], void 0, parentComponent);
- }
- }
- }
- }
- let vnodeHooks;
- if (vnodeHooks = props && props.onVnodeBeforeMount) {
- invokeVNodeHook(vnodeHooks, parentComponent, vnode);
- }
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
- }
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
- queueEffectWithSuspense(() => {
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
- needCallTransitionHooks && transition.enter(el);
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
- }, parentSuspense);
- }
- }
- return el.nextSibling;
- };
- const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
- optimized = optimized || !!parentVNode.dynamicChildren;
- const children = parentVNode.children;
- const l = children.length;
- let hasWarned = false;
- for (let i = 0; i < l; i++) {
- const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
- const isText = vnode.type === Text;
- if (node) {
- if (isText && !optimized) {
- if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
- insert(
- createText(
- node.data.slice(vnode.children.length)
- ),
- container,
- nextSibling(node)
- );
- node.data = vnode.children;
- }
- }
- node = hydrateNode(
- node,
- vnode,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- } else if (isText && !vnode.children) {
- insert(vnode.el = createText(""), container);
- } else {
- if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
- if (!hasWarned) {
- warn$1(
- `Hydration children mismatch on`,
- container,
- `
-Server rendered element contains fewer child nodes than client vdom.`
- );
- hasWarned = true;
- }
- logMismatchError();
- }
- patch(
- null,
- vnode,
- container,
- null,
- parentComponent,
- parentSuspense,
- getContainerType(container),
- slotScopeIds
- );
- }
- }
- return node;
- };
- const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
- const { slotScopeIds: fragmentSlotScopeIds } = vnode;
- if (fragmentSlotScopeIds) {
- slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
- }
- const container = parentNode(node);
- const next = hydrateChildren(
- nextSibling(node),
- vnode,
- container,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- if (next && isComment(next) && next.data === "]") {
- return nextSibling(vnode.anchor = next);
- } else {
- logMismatchError();
- insert(vnode.anchor = createComment(`]`), container, next);
- return next;
- }
- };
- const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
- if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
- warn$1(
- `Hydration node mismatch:
-- rendered on server:`,
- node,
- node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
- `
-- expected on client:`,
- vnode.type
- );
- logMismatchError();
- }
- vnode.el = null;
- if (isFragment) {
- const end = locateClosingAnchor(node);
- while (true) {
- const next2 = nextSibling(node);
- if (next2 && next2 !== end) {
- remove(next2);
- } else {
- break;
- }
- }
- }
- const next = nextSibling(node);
- const container = parentNode(node);
- remove(node);
- patch(
- null,
- vnode,
- container,
- next,
- parentComponent,
- parentSuspense,
- getContainerType(container),
- slotScopeIds
- );
- if (parentComponent) {
- parentComponent.vnode.el = vnode.el;
- updateHOCHostEl(parentComponent, vnode.el);
- }
- return next;
- };
- const locateClosingAnchor = (node, open = "[", close = "]") => {
- let match = 0;
- while (node) {
- node = nextSibling(node);
- if (node && isComment(node)) {
- if (node.data === open) match++;
- if (node.data === close) {
- if (match === 0) {
- return nextSibling(node);
- } else {
- match--;
- }
- }
- }
- }
- return node;
- };
- const replaceNode = (newNode, oldNode, parentComponent) => {
- const parentNode2 = oldNode.parentNode;
- if (parentNode2) {
- parentNode2.replaceChild(newNode, oldNode);
- }
- let parent = parentComponent;
- while (parent) {
- if (parent.vnode.el === oldNode) {
- parent.vnode.el = parent.subTree.el = newNode;
- }
- parent = parent.parent;
- }
- };
- const isTemplateNode = (node) => {
- return node.nodeType === 1 && node.tagName === "TEMPLATE";
- };
- return [hydrate, hydrateNode];
- }
- function propHasMismatch(el, key, clientValue, vnode, instance) {
- let mismatchType;
- let mismatchKey;
- let actual;
- let expected;
- if (key === "class") {
- actual = el.getAttribute("class");
- expected = normalizeClass(clientValue);
- if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
- mismatchType = 2 /* CLASS */;
- mismatchKey = `class`;
- }
- } else if (key === "style") {
- actual = el.getAttribute("style") || "";
- expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
- const actualMap = toStyleMap(actual);
- const expectedMap = toStyleMap(expected);
- if (vnode.dirs) {
- for (const { dir, value } of vnode.dirs) {
- if (dir.name === "show" && !value) {
- expectedMap.set("display", "none");
- }
- }
- }
- if (instance) {
- resolveCssVars(instance, vnode, expectedMap);
- }
- if (!isMapEqual(actualMap, expectedMap)) {
- mismatchType = 3 /* STYLE */;
- mismatchKey = "style";
- }
- } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
- if (isBooleanAttr(key)) {
- actual = el.hasAttribute(key);
- expected = includeBooleanAttr(clientValue);
- } else if (clientValue == null) {
- actual = el.hasAttribute(key);
- expected = false;
- } else {
- if (el.hasAttribute(key)) {
- actual = el.getAttribute(key);
- } else if (key === "value" && el.tagName === "TEXTAREA") {
- actual = el.value;
- } else {
- actual = false;
- }
- expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
- }
- if (actual !== expected) {
- mismatchType = 4 /* ATTRIBUTE */;
- mismatchKey = key;
- }
- }
- if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
- const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
- const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
- const postSegment = `
- - rendered on server: ${format(actual)}
- - expected on client: ${format(expected)}
- Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
- You should fix the source of the mismatch.`;
- {
- warn$1(preSegment, el, postSegment);
- }
- return true;
- }
- return false;
- }
- function toClassSet(str) {
- return new Set(str.trim().split(/\s+/));
- }
- function isSetEqual(a, b) {
- if (a.size !== b.size) {
- return false;
- }
- for (const s of a) {
- if (!b.has(s)) {
- return false;
- }
- }
- return true;
- }
- function toStyleMap(str) {
- const styleMap = /* @__PURE__ */ new Map();
- for (const item of str.split(";")) {
- let [key, value] = item.split(":");
- key = key.trim();
- value = value && value.trim();
- if (key && value) {
- styleMap.set(key, value);
- }
- }
- return styleMap;
- }
- function isMapEqual(a, b) {
- if (a.size !== b.size) {
- return false;
- }
- for (const [key, value] of a) {
- if (value !== b.get(key)) {
- return false;
- }
- }
- return true;
- }
- function resolveCssVars(instance, vnode, expectedMap) {
- const root = instance.subTree;
- if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
- const cssVars = instance.getCssVars();
- for (const key in cssVars) {
- expectedMap.set(
- `--${getEscapedCssVarName(key)}`,
- String(cssVars[key])
- );
- }
- }
- if (vnode === root && instance.parent) {
- resolveCssVars(instance.parent, instance.vnode, expectedMap);
- }
- }
- const allowMismatchAttr = "data-allow-mismatch";
- const MismatchTypeString = {
- [0 /* TEXT */]: "text",
- [1 /* CHILDREN */]: "children",
- [2 /* CLASS */]: "class",
- [3 /* STYLE */]: "style",
- [4 /* ATTRIBUTE */]: "attribute"
- };
- function isMismatchAllowed(el, allowedType) {
- if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
- while (el && !el.hasAttribute(allowMismatchAttr)) {
- el = el.parentElement;
- }
- }
- const allowedAttr = el && el.getAttribute(allowMismatchAttr);
- if (allowedAttr == null) {
- return false;
- } else if (allowedAttr === "") {
- return true;
- } else {
- const list = allowedAttr.split(",");
- if (allowedType === 0 /* TEXT */ && list.includes("children")) {
- return true;
- }
- return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
- }
- }
-
- const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
- const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
- const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
- const id = requestIdleCallback(hydrate, { timeout });
- return () => cancelIdleCallback(id);
- };
- function elementIsVisibleInViewport(el) {
- const { top, left, bottom, right } = el.getBoundingClientRect();
- const { innerHeight, innerWidth } = window;
- return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
- }
- const hydrateOnVisible = (opts) => (hydrate, forEach) => {
- const ob = new IntersectionObserver((entries) => {
- for (const e of entries) {
- if (!e.isIntersecting) continue;
- ob.disconnect();
- hydrate();
- break;
- }
- }, opts);
- forEach((el) => {
- if (!(el instanceof Element)) return;
- if (elementIsVisibleInViewport(el)) {
- hydrate();
- ob.disconnect();
- return false;
- }
- ob.observe(el);
- });
- return () => ob.disconnect();
- };
- const hydrateOnMediaQuery = (query) => (hydrate) => {
- if (query) {
- const mql = matchMedia(query);
- if (mql.matches) {
- hydrate();
- } else {
- mql.addEventListener("change", hydrate, { once: true });
- return () => mql.removeEventListener("change", hydrate);
- }
- }
- };
- const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
- if (isString(interactions)) interactions = [interactions];
- let hasHydrated = false;
- const doHydrate = (e) => {
- if (!hasHydrated) {
- hasHydrated = true;
- teardown();
- hydrate();
- e.target.dispatchEvent(new e.constructor(e.type, e));
- }
- };
- const teardown = () => {
- forEach((el) => {
- for (const i of interactions) {
- el.removeEventListener(i, doHydrate);
- }
- });
- };
- forEach((el) => {
- for (const i of interactions) {
- el.addEventListener(i, doHydrate, { once: true });
- }
- });
- return teardown;
- };
- function forEachElement(node, cb) {
- if (isComment(node) && node.data === "[") {
- let depth = 1;
- let next = node.nextSibling;
- while (next) {
- if (next.nodeType === 1) {
- const result = cb(next);
- if (result === false) {
- break;
- }
- } else if (isComment(next)) {
- if (next.data === "]") {
- if (--depth === 0) break;
- } else if (next.data === "[") {
- depth++;
- }
- }
- next = next.nextSibling;
- }
- } else {
- cb(node);
- }
- }
-
- const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function defineAsyncComponent(source) {
- if (isFunction(source)) {
- source = { loader: source };
- }
- const {
- loader,
- loadingComponent,
- errorComponent,
- delay = 200,
- hydrate: hydrateStrategy,
- timeout,
- // undefined = never times out
- suspensible = true,
- onError: userOnError
- } = source;
- let pendingRequest = null;
- let resolvedComp;
- let retries = 0;
- const retry = () => {
- retries++;
- pendingRequest = null;
- return load();
- };
- const load = () => {
- let thisRequest;
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
- err = err instanceof Error ? err : new Error(String(err));
- if (userOnError) {
- return new Promise((resolve, reject) => {
- const userRetry = () => resolve(retry());
- const userFail = () => reject(err);
- userOnError(err, userRetry, userFail, retries + 1);
- });
- } else {
- throw err;
- }
- }).then((comp) => {
- if (thisRequest !== pendingRequest && pendingRequest) {
- return pendingRequest;
- }
- if (!comp) {
- warn$1(
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
- );
- }
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
- comp = comp.default;
- }
- if (comp && !isObject(comp) && !isFunction(comp)) {
- throw new Error(`Invalid async component load result: ${comp}`);
- }
- resolvedComp = comp;
- return comp;
- }));
- };
- return defineComponent({
- name: "AsyncComponentWrapper",
- __asyncLoader: load,
- __asyncHydrate(el, instance, hydrate) {
- const doHydrate = hydrateStrategy ? () => {
- const teardown = hydrateStrategy(
- hydrate,
- (cb) => forEachElement(el, cb)
- );
- if (teardown) {
- (instance.bum || (instance.bum = [])).push(teardown);
- }
- } : hydrate;
- if (resolvedComp) {
- doHydrate();
- } else {
- load().then(() => !instance.isUnmounted && doHydrate());
- }
- },
- get __asyncResolved() {
- return resolvedComp;
- },
- setup() {
- const instance = currentInstance;
- markAsyncBoundary(instance);
- if (resolvedComp) {
- return () => createInnerComp(resolvedComp, instance);
- }
- const onError = (err) => {
- pendingRequest = null;
- handleError(
- err,
- instance,
- 13,
- !errorComponent
- );
- };
- if (suspensible && instance.suspense || false) {
- return load().then((comp) => {
- return () => createInnerComp(comp, instance);
- }).catch((err) => {
- onError(err);
- return () => errorComponent ? createVNode(errorComponent, {
- error: err
- }) : null;
- });
- }
- const loaded = ref(false);
- const error = ref();
- const delayed = ref(!!delay);
- if (delay) {
- setTimeout(() => {
- delayed.value = false;
- }, delay);
- }
- if (timeout != null) {
- setTimeout(() => {
- if (!loaded.value && !error.value) {
- const err = new Error(
- `Async component timed out after ${timeout}ms.`
- );
- onError(err);
- error.value = err;
- }
- }, timeout);
- }
- load().then(() => {
- loaded.value = true;
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
- instance.parent.update();
- }
- }).catch((err) => {
- onError(err);
- error.value = err;
- });
- return () => {
- if (loaded.value && resolvedComp) {
- return createInnerComp(resolvedComp, instance);
- } else if (error.value && errorComponent) {
- return createVNode(errorComponent, {
- error: error.value
- });
- } else if (loadingComponent && !delayed.value) {
- return createVNode(loadingComponent);
- }
- };
- }
- });
- }
- function createInnerComp(comp, parent) {
- const { ref: ref2, props, children, ce } = parent.vnode;
- const vnode = createVNode(comp, props, children);
- vnode.ref = ref2;
- vnode.ce = ce;
- delete parent.vnode.ce;
- return vnode;
- }
-
- const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
- const KeepAliveImpl = {
- name: `KeepAlive`,
- // Marker for special handling inside the renderer. We are not using a ===
- // check directly on KeepAlive in the renderer, because importing it directly
- // would prevent it from being tree-shaken.
- __isKeepAlive: true,
- props: {
- include: [String, RegExp, Array],
- exclude: [String, RegExp, Array],
- max: [String, Number]
- },
- setup(props, { slots }) {
- const instance = getCurrentInstance();
- const sharedContext = instance.ctx;
- const cache = /* @__PURE__ */ new Map();
- const keys = /* @__PURE__ */ new Set();
- let current = null;
- {
- instance.__v_cache = cache;
- }
- const parentSuspense = instance.suspense;
- const {
- renderer: {
- p: patch,
- m: move,
- um: _unmount,
- o: { createElement }
- }
- } = sharedContext;
- const storageContainer = createElement("div");
- sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
- const instance2 = vnode.component;
- move(vnode, container, anchor, 0, parentSuspense);
- patch(
- instance2.vnode,
- vnode,
- container,
- anchor,
- instance2,
- parentSuspense,
- namespace,
- vnode.slotScopeIds,
- optimized
- );
- queuePostRenderEffect(() => {
- instance2.isDeactivated = false;
- if (instance2.a) {
- invokeArrayFns(instance2.a);
- }
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
- if (vnodeHook) {
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
- }
- }, parentSuspense);
- {
- devtoolsComponentAdded(instance2);
- }
- };
- sharedContext.deactivate = (vnode) => {
- const instance2 = vnode.component;
- invalidateMount(instance2.m);
- invalidateMount(instance2.a);
- move(vnode, storageContainer, null, 1, parentSuspense);
- queuePostRenderEffect(() => {
- if (instance2.da) {
- invokeArrayFns(instance2.da);
- }
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
- if (vnodeHook) {
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
- }
- instance2.isDeactivated = true;
- }, parentSuspense);
- {
- devtoolsComponentAdded(instance2);
- }
- };
- function unmount(vnode) {
- resetShapeFlag(vnode);
- _unmount(vnode, instance, parentSuspense, true);
- }
- function pruneCache(filter) {
- cache.forEach((vnode, key) => {
- const name = getComponentName(vnode.type);
- if (name && !filter(name)) {
- pruneCacheEntry(key);
- }
- });
- }
- function pruneCacheEntry(key) {
- const cached = cache.get(key);
- if (cached && (!current || !isSameVNodeType(cached, current))) {
- unmount(cached);
- } else if (current) {
- resetShapeFlag(current);
- }
- cache.delete(key);
- keys.delete(key);
- }
- watch(
- () => [props.include, props.exclude],
- ([include, exclude]) => {
- include && pruneCache((name) => matches(include, name));
- exclude && pruneCache((name) => !matches(exclude, name));
- },
- // prune post-render after `current` has been updated
- { flush: "post", deep: true }
- );
- let pendingCacheKey = null;
- const cacheSubtree = () => {
- if (pendingCacheKey != null) {
- if (isSuspense(instance.subTree.type)) {
- queuePostRenderEffect(() => {
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
- }, instance.subTree.suspense);
- } else {
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
- }
- }
- };
- onMounted(cacheSubtree);
- onUpdated(cacheSubtree);
- onBeforeUnmount(() => {
- cache.forEach((cached) => {
- const { subTree, suspense } = instance;
- const vnode = getInnerChild(subTree);
- if (cached.type === vnode.type && cached.key === vnode.key) {
- resetShapeFlag(vnode);
- const da = vnode.component.da;
- da && queuePostRenderEffect(da, suspense);
- return;
- }
- unmount(cached);
- });
- });
- return () => {
- pendingCacheKey = null;
- if (!slots.default) {
- return current = null;
- }
- const children = slots.default();
- const rawVNode = children[0];
- if (children.length > 1) {
- {
- warn$1(`KeepAlive should contain exactly one component child.`);
- }
- current = null;
- return children;
- } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
- current = null;
- return rawVNode;
- }
- let vnode = getInnerChild(rawVNode);
- if (vnode.type === Comment) {
- current = null;
- return vnode;
- }
- const comp = vnode.type;
- const name = getComponentName(
- isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
- );
- const { include, exclude, max } = props;
- if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
- vnode.shapeFlag &= ~256;
- current = vnode;
- return rawVNode;
- }
- const key = vnode.key == null ? comp : vnode.key;
- const cachedVNode = cache.get(key);
- if (vnode.el) {
- vnode = cloneVNode(vnode);
- if (rawVNode.shapeFlag & 128) {
- rawVNode.ssContent = vnode;
- }
- }
- pendingCacheKey = key;
- if (cachedVNode) {
- vnode.el = cachedVNode.el;
- vnode.component = cachedVNode.component;
- if (vnode.transition) {
- setTransitionHooks(vnode, vnode.transition);
- }
- vnode.shapeFlag |= 512;
- keys.delete(key);
- keys.add(key);
- } else {
- keys.add(key);
- if (max && keys.size > parseInt(max, 10)) {
- pruneCacheEntry(keys.values().next().value);
- }
- }
- vnode.shapeFlag |= 256;
- current = vnode;
- return isSuspense(rawVNode.type) ? rawVNode : vnode;
- };
- }
- };
- const KeepAlive = KeepAliveImpl;
- function matches(pattern, name) {
- if (isArray(pattern)) {
- return pattern.some((p) => matches(p, name));
- } else if (isString(pattern)) {
- return pattern.split(",").includes(name);
- } else if (isRegExp(pattern)) {
- pattern.lastIndex = 0;
- return pattern.test(name);
- }
- return false;
- }
- function onActivated(hook, target) {
- registerKeepAliveHook(hook, "a", target);
- }
- function onDeactivated(hook, target) {
- registerKeepAliveHook(hook, "da", target);
- }
- function registerKeepAliveHook(hook, type, target = currentInstance) {
- const wrappedHook = hook.__wdc || (hook.__wdc = () => {
- let current = target;
- while (current) {
- if (current.isDeactivated) {
- return;
- }
- current = current.parent;
- }
- return hook();
- });
- injectHook(type, wrappedHook, target);
- if (target) {
- let current = target.parent;
- while (current && current.parent) {
- if (isKeepAlive(current.parent.vnode)) {
- injectToKeepAliveRoot(wrappedHook, type, target, current);
- }
- current = current.parent;
- }
- }
- }
- function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
- const injected = injectHook(
- type,
- hook,
- keepAliveRoot,
- true
- /* prepend */
- );
- onUnmounted(() => {
- remove(keepAliveRoot[type], injected);
- }, target);
- }
- function resetShapeFlag(vnode) {
- vnode.shapeFlag &= ~256;
- vnode.shapeFlag &= ~512;
- }
- function getInnerChild(vnode) {
- return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
- }
-
- function injectHook(type, hook, target = currentInstance, prepend = false) {
- if (target) {
- const hooks = target[type] || (target[type] = []);
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
- pauseTracking();
- const reset = setCurrentInstance(target);
- const res = callWithAsyncErrorHandling(hook, target, type, args);
- reset();
- resetTracking();
- return res;
- });
- if (prepend) {
- hooks.unshift(wrappedHook);
- } else {
- hooks.push(wrappedHook);
- }
- return wrappedHook;
- } else {
- const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
- warn$1(
- `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
- );
- }
- }
- const createHook = (lifecycle) => (hook, target = currentInstance) => {
- if (!isInSSRComponentSetup || lifecycle === "sp") {
- injectHook(lifecycle, (...args) => hook(...args), target);
- }
- };
- const onBeforeMount = createHook("bm");
- const onMounted = createHook("m");
- const onBeforeUpdate = createHook(
- "bu"
- );
- const onUpdated = createHook("u");
- const onBeforeUnmount = createHook(
- "bum"
- );
- const onUnmounted = createHook("um");
- const onServerPrefetch = createHook(
- "sp"
- );
- const onRenderTriggered = createHook("rtg");
- const onRenderTracked = createHook("rtc");
- function onErrorCaptured(hook, target = currentInstance) {
- injectHook("ec", hook, target);
- }
-
- const COMPONENTS = "components";
- const DIRECTIVES = "directives";
- function resolveComponent(name, maybeSelfReference) {
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
- }
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
- function resolveDynamicComponent(component) {
- if (isString(component)) {
- return resolveAsset(COMPONENTS, component, false) || component;
- } else {
- return component || NULL_DYNAMIC_COMPONENT;
- }
- }
- function resolveDirective(name) {
- return resolveAsset(DIRECTIVES, name);
- }
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
- const instance = currentRenderingInstance || currentInstance;
- if (instance) {
- const Component = instance.type;
- if (type === COMPONENTS) {
- const selfName = getComponentName(
- Component,
- false
- );
- if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
- return Component;
- }
- }
- const res = (
- // local registration
- // check instance[type] first which is resolved for options API
- resolve(instance[type] || Component[type], name) || // global registration
- resolve(instance.appContext[type], name)
- );
- if (!res && maybeSelfReference) {
- return Component;
- }
- if (warnMissing && !res) {
- const extra = type === COMPONENTS ? `
-If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
- }
- return res;
- } else {
- warn$1(
- `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
- );
- }
- }
- function resolve(registry, name) {
- return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
- }
-
- function renderList(source, renderItem, cache, index) {
- let ret;
- const cached = cache && cache[index];
- const sourceIsArray = isArray(source);
- if (sourceIsArray || isString(source)) {
- const sourceIsReactiveArray = sourceIsArray && isReactive(source);
- let needsWrap = false;
- if (sourceIsReactiveArray) {
- needsWrap = !isShallow(source);
- source = shallowReadArray(source);
- }
- ret = new Array(source.length);
- for (let i = 0, l = source.length; i < l; i++) {
- ret[i] = renderItem(
- needsWrap ? toReactive(source[i]) : source[i],
- i,
- void 0,
- cached && cached[i]
- );
- }
- } else if (typeof source === "number") {
- if (!Number.isInteger(source)) {
- warn$1(`The v-for range expect an integer value but got ${source}.`);
- }
- ret = new Array(source);
- for (let i = 0; i < source; i++) {
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
- }
- } else if (isObject(source)) {
- if (source[Symbol.iterator]) {
- ret = Array.from(
- source,
- (item, i) => renderItem(item, i, void 0, cached && cached[i])
- );
- } else {
- const keys = Object.keys(source);
- ret = new Array(keys.length);
- for (let i = 0, l = keys.length; i < l; i++) {
- const key = keys[i];
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
- }
- }
- } else {
- ret = [];
- }
- if (cache) {
- cache[index] = ret;
- }
- return ret;
- }
-
- function createSlots(slots, dynamicSlots) {
- for (let i = 0; i < dynamicSlots.length; i++) {
- const slot = dynamicSlots[i];
- if (isArray(slot)) {
- for (let j = 0; j < slot.length; j++) {
- slots[slot[j].name] = slot[j].fn;
- }
- } else if (slot) {
- slots[slot.name] = slot.key ? (...args) => {
- const res = slot.fn(...args);
- if (res) res.key = slot.key;
- return res;
- } : slot.fn;
- }
- }
- return slots;
- }
-
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
- if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
- if (name !== "default") props.name = name;
- return openBlock(), createBlock(
- Fragment,
- null,
- [createVNode("slot", props, fallback && fallback())],
- 64
- );
- }
- let slot = slots[name];
- if (slot && slot.length > 1) {
- warn$1(
- `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
- );
- slot = () => [];
- }
- if (slot && slot._c) {
- slot._d = false;
- }
- openBlock();
- const validSlotContent = slot && ensureValidVNode(slot(props));
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
- // key attached in the `createSlots` helper, respect that
- validSlotContent && validSlotContent.key;
- const rendered = createBlock(
- Fragment,
- {
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
- (!validSlotContent && fallback ? "_fb" : "")
- },
- validSlotContent || (fallback ? fallback() : []),
- validSlotContent && slots._ === 1 ? 64 : -2
- );
- if (!noSlotted && rendered.scopeId) {
- rendered.slotScopeIds = [rendered.scopeId + "-s"];
- }
- if (slot && slot._c) {
- slot._d = true;
- }
- return rendered;
- }
- function ensureValidVNode(vnodes) {
- return vnodes.some((child) => {
- if (!isVNode(child)) return true;
- if (child.type === Comment) return false;
- if (child.type === Fragment && !ensureValidVNode(child.children))
- return false;
- return true;
- }) ? vnodes : null;
- }
-
- function toHandlers(obj, preserveCaseIfNecessary) {
- const ret = {};
- if (!isObject(obj)) {
- warn$1(`v-on with no argument expects an object value.`);
- return ret;
- }
- for (const key in obj) {
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
- }
- return ret;
- }
-
- const getPublicInstance = (i) => {
- if (!i) return null;
- if (isStatefulComponent(i)) return getComponentPublicInstance(i);
- return getPublicInstance(i.parent);
- };
- const publicPropertiesMap = (
- // Move PURE marker to new line to workaround compiler discarding it
- // due to type annotation
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
- $: (i) => i,
- $el: (i) => i.vnode.el,
- $data: (i) => i.data,
- $props: (i) => shallowReadonly(i.props) ,
- $attrs: (i) => shallowReadonly(i.attrs) ,
- $slots: (i) => shallowReadonly(i.slots) ,
- $refs: (i) => shallowReadonly(i.refs) ,
- $parent: (i) => getPublicInstance(i.parent),
- $root: (i) => getPublicInstance(i.root),
- $host: (i) => i.ce,
- $emit: (i) => i.emit,
- $options: (i) => resolveMergedOptions(i) ,
- $forceUpdate: (i) => i.f || (i.f = () => {
- queueJob(i.update);
- }),
- $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
- $watch: (i) => instanceWatch.bind(i)
- })
- );
- const isReservedPrefix = (key) => key === "_" || key === "$";
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
- const PublicInstanceProxyHandlers = {
- get({ _: instance }, key) {
- if (key === "__v_skip") {
- return true;
- }
- const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
- if (key === "__isVue") {
- return true;
- }
- let normalizedProps;
- if (key[0] !== "$") {
- const n = accessCache[key];
- if (n !== void 0) {
- switch (n) {
- case 1 /* SETUP */:
- return setupState[key];
- case 2 /* DATA */:
- return data[key];
- case 4 /* CONTEXT */:
- return ctx[key];
- case 3 /* PROPS */:
- return props[key];
- }
- } else if (hasSetupBinding(setupState, key)) {
- accessCache[key] = 1 /* SETUP */;
- return setupState[key];
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
- accessCache[key] = 2 /* DATA */;
- return data[key];
- } else if (
- // only cache other properties when instance has declared (thus stable)
- // props
- (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
- ) {
- accessCache[key] = 3 /* PROPS */;
- return props[key];
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
- accessCache[key] = 4 /* CONTEXT */;
- return ctx[key];
- } else if (shouldCacheAccess) {
- accessCache[key] = 0 /* OTHER */;
- }
- }
- const publicGetter = publicPropertiesMap[key];
- let cssModule, globalProperties;
- if (publicGetter) {
- if (key === "$attrs") {
- track(instance.attrs, "get", "");
- markAttrsAccessed();
- } else if (key === "$slots") {
- track(instance, "get", key);
- }
- return publicGetter(instance);
- } else if (
- // css module (injected by vue-loader)
- (cssModule = type.__cssModules) && (cssModule = cssModule[key])
- ) {
- return cssModule;
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
- accessCache[key] = 4 /* CONTEXT */;
- return ctx[key];
- } else if (
- // global properties
- globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
- ) {
- {
- return globalProperties[key];
- }
- } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
- // to infinite warning loop
- key.indexOf("__v") !== 0)) {
- if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
- warn$1(
- `Property ${JSON.stringify(
- key
- )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
- );
- } else if (instance === currentRenderingInstance) {
- warn$1(
- `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
- );
- }
- }
- },
- set({ _: instance }, key, value) {
- const { data, setupState, ctx } = instance;
- if (hasSetupBinding(setupState, key)) {
- setupState[key] = value;
- return true;
- } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
- warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
- return false;
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
- data[key] = value;
- return true;
- } else if (hasOwn(instance.props, key)) {
- warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
- return false;
- }
- if (key[0] === "$" && key.slice(1) in instance) {
- warn$1(
- `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
- );
- return false;
- } else {
- if (key in instance.appContext.config.globalProperties) {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- value
- });
- } else {
- ctx[key] = value;
- }
- }
- return true;
- },
- has({
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
- }, key) {
- let normalizedProps;
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
- },
- defineProperty(target, key, descriptor) {
- if (descriptor.get != null) {
- target._.accessCache[key] = 0;
- } else if (hasOwn(descriptor, "value")) {
- this.set(target, key, descriptor.value, null);
- }
- return Reflect.defineProperty(target, key, descriptor);
- }
- };
- {
- PublicInstanceProxyHandlers.ownKeys = (target) => {
- warn$1(
- `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
- );
- return Reflect.ownKeys(target);
- };
- }
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
- get(target, key) {
- if (key === Symbol.unscopables) {
- return;
- }
- return PublicInstanceProxyHandlers.get(target, key, target);
- },
- has(_, key) {
- const has = key[0] !== "_" && !isGloballyAllowed(key);
- if (!has && PublicInstanceProxyHandlers.has(_, key)) {
- warn$1(
- `Property ${JSON.stringify(
- key
- )} should not start with _ which is a reserved prefix for Vue internals.`
- );
- }
- return has;
- }
- });
- function createDevRenderContext(instance) {
- const target = {};
- Object.defineProperty(target, `_`, {
- configurable: true,
- enumerable: false,
- get: () => instance
- });
- Object.keys(publicPropertiesMap).forEach((key) => {
- Object.defineProperty(target, key, {
- configurable: true,
- enumerable: false,
- get: () => publicPropertiesMap[key](instance),
- // intercepted by the proxy so no need for implementation,
- // but needed to prevent set errors
- set: NOOP
- });
- });
- return target;
- }
- function exposePropsOnRenderContext(instance) {
- const {
- ctx,
- propsOptions: [propsOptions]
- } = instance;
- if (propsOptions) {
- Object.keys(propsOptions).forEach((key) => {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => instance.props[key],
- set: NOOP
- });
- });
- }
- }
- function exposeSetupStateOnRenderContext(instance) {
- const { ctx, setupState } = instance;
- Object.keys(toRaw(setupState)).forEach((key) => {
- if (!setupState.__isScriptSetup) {
- if (isReservedPrefix(key[0])) {
- warn$1(
- `setup() return property ${JSON.stringify(
- key
- )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
- );
- return;
- }
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => setupState[key],
- set: NOOP
- });
- }
- });
- }
-
- const warnRuntimeUsage = (method) => warn$1(
- `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
- );
- function defineProps() {
- {
- warnRuntimeUsage(`defineProps`);
- }
- return null;
- }
- function defineEmits() {
- {
- warnRuntimeUsage(`defineEmits`);
- }
- return null;
- }
- function defineExpose(exposed) {
- {
- warnRuntimeUsage(`defineExpose`);
- }
- }
- function defineOptions(options) {
- {
- warnRuntimeUsage(`defineOptions`);
- }
- }
- function defineSlots() {
- {
- warnRuntimeUsage(`defineSlots`);
- }
- return null;
- }
- function defineModel() {
- {
- warnRuntimeUsage("defineModel");
- }
- }
- function withDefaults(props, defaults) {
- {
- warnRuntimeUsage(`withDefaults`);
- }
- return null;
- }
- function useSlots() {
- return getContext().slots;
- }
- function useAttrs() {
- return getContext().attrs;
- }
- function getContext() {
- const i = getCurrentInstance();
- if (!i) {
- warn$1(`useContext() called without active instance.`);
- }
- return i.setupContext || (i.setupContext = createSetupContext(i));
- }
- function normalizePropsOrEmits(props) {
- return isArray(props) ? props.reduce(
- (normalized, p) => (normalized[p] = null, normalized),
- {}
- ) : props;
- }
- function mergeDefaults(raw, defaults) {
- const props = normalizePropsOrEmits(raw);
- for (const key in defaults) {
- if (key.startsWith("__skip")) continue;
- let opt = props[key];
- if (opt) {
- if (isArray(opt) || isFunction(opt)) {
- opt = props[key] = { type: opt, default: defaults[key] };
- } else {
- opt.default = defaults[key];
- }
- } else if (opt === null) {
- opt = props[key] = { default: defaults[key] };
- } else {
- warn$1(`props default key "${key}" has no corresponding declaration.`);
- }
- if (opt && defaults[`__skip_${key}`]) {
- opt.skipFactory = true;
- }
- }
- return props;
- }
- function mergeModels(a, b) {
- if (!a || !b) return a || b;
- if (isArray(a) && isArray(b)) return a.concat(b);
- return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
- }
- function createPropsRestProxy(props, excludedKeys) {
- const ret = {};
- for (const key in props) {
- if (!excludedKeys.includes(key)) {
- Object.defineProperty(ret, key, {
- enumerable: true,
- get: () => props[key]
- });
- }
- }
- return ret;
- }
- function withAsyncContext(getAwaitable) {
- const ctx = getCurrentInstance();
- if (!ctx) {
- warn$1(
- `withAsyncContext called without active current instance. This is likely a bug.`
- );
- }
- let awaitable = getAwaitable();
- unsetCurrentInstance();
- if (isPromise(awaitable)) {
- awaitable = awaitable.catch((e) => {
- setCurrentInstance(ctx);
- throw e;
- });
- }
- return [awaitable, () => setCurrentInstance(ctx)];
- }
-
- function createDuplicateChecker() {
- const cache = /* @__PURE__ */ Object.create(null);
- return (type, key) => {
- if (cache[key]) {
- warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
- } else {
- cache[key] = type;
- }
- };
- }
- let shouldCacheAccess = true;
- function applyOptions(instance) {
- const options = resolveMergedOptions(instance);
- const publicThis = instance.proxy;
- const ctx = instance.ctx;
- shouldCacheAccess = false;
- if (options.beforeCreate) {
- callHook$1(options.beforeCreate, instance, "bc");
- }
- const {
- // state
- data: dataOptions,
- computed: computedOptions,
- methods,
- watch: watchOptions,
- provide: provideOptions,
- inject: injectOptions,
- // lifecycle
- created,
- beforeMount,
- mounted,
- beforeUpdate,
- updated,
- activated,
- deactivated,
- beforeDestroy,
- beforeUnmount,
- destroyed,
- unmounted,
- render,
- renderTracked,
- renderTriggered,
- errorCaptured,
- serverPrefetch,
- // public API
- expose,
- inheritAttrs,
- // assets
- components,
- directives,
- filters
- } = options;
- const checkDuplicateProperties = createDuplicateChecker() ;
- {
- const [propsOptions] = instance.propsOptions;
- if (propsOptions) {
- for (const key in propsOptions) {
- checkDuplicateProperties("Props" /* PROPS */, key);
- }
- }
- }
- if (injectOptions) {
- resolveInjections(injectOptions, ctx, checkDuplicateProperties);
- }
- if (methods) {
- for (const key in methods) {
- const methodHandler = methods[key];
- if (isFunction(methodHandler)) {
- {
- Object.defineProperty(ctx, key, {
- value: methodHandler.bind(publicThis),
- configurable: true,
- enumerable: true,
- writable: true
- });
- }
- {
- checkDuplicateProperties("Methods" /* METHODS */, key);
- }
- } else {
- warn$1(
- `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
- );
- }
- }
- }
- if (dataOptions) {
- if (!isFunction(dataOptions)) {
- warn$1(
- `The data option must be a function. Plain object usage is no longer supported.`
- );
- }
- const data = dataOptions.call(publicThis, publicThis);
- if (isPromise(data)) {
- warn$1(
- `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
- );
- }
- if (!isObject(data)) {
- warn$1(`data() should return an object.`);
- } else {
- instance.data = reactive(data);
- {
- for (const key in data) {
- checkDuplicateProperties("Data" /* DATA */, key);
- if (!isReservedPrefix(key[0])) {
- Object.defineProperty(ctx, key, {
- configurable: true,
- enumerable: true,
- get: () => data[key],
- set: NOOP
- });
- }
- }
- }
- }
- }
- shouldCacheAccess = true;
- if (computedOptions) {
- for (const key in computedOptions) {
- const opt = computedOptions[key];
- const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
- if (get === NOOP) {
- warn$1(`Computed property "${key}" has no getter.`);
- }
- const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
- warn$1(
- `Write operation failed: computed property "${key}" is readonly.`
- );
- } ;
- const c = computed({
- get,
- set
- });
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => c.value,
- set: (v) => c.value = v
- });
- {
- checkDuplicateProperties("Computed" /* COMPUTED */, key);
- }
- }
- }
- if (watchOptions) {
- for (const key in watchOptions) {
- createWatcher(watchOptions[key], ctx, publicThis, key);
- }
- }
- if (provideOptions) {
- const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
- Reflect.ownKeys(provides).forEach((key) => {
- provide(key, provides[key]);
- });
- }
- if (created) {
- callHook$1(created, instance, "c");
- }
- function registerLifecycleHook(register, hook) {
- if (isArray(hook)) {
- hook.forEach((_hook) => register(_hook.bind(publicThis)));
- } else if (hook) {
- register(hook.bind(publicThis));
- }
- }
- registerLifecycleHook(onBeforeMount, beforeMount);
- registerLifecycleHook(onMounted, mounted);
- registerLifecycleHook(onBeforeUpdate, beforeUpdate);
- registerLifecycleHook(onUpdated, updated);
- registerLifecycleHook(onActivated, activated);
- registerLifecycleHook(onDeactivated, deactivated);
- registerLifecycleHook(onErrorCaptured, errorCaptured);
- registerLifecycleHook(onRenderTracked, renderTracked);
- registerLifecycleHook(onRenderTriggered, renderTriggered);
- registerLifecycleHook(onBeforeUnmount, beforeUnmount);
- registerLifecycleHook(onUnmounted, unmounted);
- registerLifecycleHook(onServerPrefetch, serverPrefetch);
- if (isArray(expose)) {
- if (expose.length) {
- const exposed = instance.exposed || (instance.exposed = {});
- expose.forEach((key) => {
- Object.defineProperty(exposed, key, {
- get: () => publicThis[key],
- set: (val) => publicThis[key] = val
- });
- });
- } else if (!instance.exposed) {
- instance.exposed = {};
- }
- }
- if (render && instance.render === NOOP) {
- instance.render = render;
- }
- if (inheritAttrs != null) {
- instance.inheritAttrs = inheritAttrs;
- }
- if (components) instance.components = components;
- if (directives) instance.directives = directives;
- }
- function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
- if (isArray(injectOptions)) {
- injectOptions = normalizeInject(injectOptions);
- }
- for (const key in injectOptions) {
- const opt = injectOptions[key];
- let injected;
- if (isObject(opt)) {
- if ("default" in opt) {
- injected = inject(
- opt.from || key,
- opt.default,
- true
- );
- } else {
- injected = inject(opt.from || key);
- }
- } else {
- injected = inject(opt);
- }
- if (isRef(injected)) {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => injected.value,
- set: (v) => injected.value = v
- });
- } else {
- ctx[key] = injected;
- }
- {
- checkDuplicateProperties("Inject" /* INJECT */, key);
- }
- }
- }
- function callHook$1(hook, instance, type) {
- callWithAsyncErrorHandling(
- isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
- instance,
- type
- );
- }
- function createWatcher(raw, ctx, publicThis, key) {
- let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
- if (isString(raw)) {
- const handler = ctx[raw];
- if (isFunction(handler)) {
- {
- watch(getter, handler);
- }
- } else {
- warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
- }
- } else if (isFunction(raw)) {
- {
- watch(getter, raw.bind(publicThis));
- }
- } else if (isObject(raw)) {
- if (isArray(raw)) {
- raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
- } else {
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
- if (isFunction(handler)) {
- watch(getter, handler, raw);
- } else {
- warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
- }
- }
- } else {
- warn$1(`Invalid watch option: "${key}"`, raw);
- }
- }
- function resolveMergedOptions(instance) {
- const base = instance.type;
- const { mixins, extends: extendsOptions } = base;
- const {
- mixins: globalMixins,
- optionsCache: cache,
- config: { optionMergeStrategies }
- } = instance.appContext;
- const cached = cache.get(base);
- let resolved;
- if (cached) {
- resolved = cached;
- } else if (!globalMixins.length && !mixins && !extendsOptions) {
- {
- resolved = base;
- }
- } else {
- resolved = {};
- if (globalMixins.length) {
- globalMixins.forEach(
- (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
- );
- }
- mergeOptions(resolved, base, optionMergeStrategies);
- }
- if (isObject(base)) {
- cache.set(base, resolved);
- }
- return resolved;
- }
- function mergeOptions(to, from, strats, asMixin = false) {
- const { mixins, extends: extendsOptions } = from;
- if (extendsOptions) {
- mergeOptions(to, extendsOptions, strats, true);
- }
- if (mixins) {
- mixins.forEach(
- (m) => mergeOptions(to, m, strats, true)
- );
- }
- for (const key in from) {
- if (asMixin && key === "expose") {
- warn$1(
- `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
- );
- } else {
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
- to[key] = strat ? strat(to[key], from[key]) : from[key];
- }
- }
- return to;
- }
- const internalOptionMergeStrats = {
- data: mergeDataFn,
- props: mergeEmitsOrPropsOptions,
- emits: mergeEmitsOrPropsOptions,
- // objects
- methods: mergeObjectOptions,
- computed: mergeObjectOptions,
- // lifecycle
- beforeCreate: mergeAsArray$1,
- created: mergeAsArray$1,
- beforeMount: mergeAsArray$1,
- mounted: mergeAsArray$1,
- beforeUpdate: mergeAsArray$1,
- updated: mergeAsArray$1,
- beforeDestroy: mergeAsArray$1,
- beforeUnmount: mergeAsArray$1,
- destroyed: mergeAsArray$1,
- unmounted: mergeAsArray$1,
- activated: mergeAsArray$1,
- deactivated: mergeAsArray$1,
- errorCaptured: mergeAsArray$1,
- serverPrefetch: mergeAsArray$1,
- // assets
- components: mergeObjectOptions,
- directives: mergeObjectOptions,
- // watch
- watch: mergeWatchOptions,
- // provide / inject
- provide: mergeDataFn,
- inject: mergeInject
- };
- function mergeDataFn(to, from) {
- if (!from) {
- return to;
- }
- if (!to) {
- return from;
- }
- return function mergedDataFn() {
- return (extend)(
- isFunction(to) ? to.call(this, this) : to,
- isFunction(from) ? from.call(this, this) : from
- );
- };
- }
- function mergeInject(to, from) {
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
- }
- function normalizeInject(raw) {
- if (isArray(raw)) {
- const res = {};
- for (let i = 0; i < raw.length; i++) {
- res[raw[i]] = raw[i];
- }
- return res;
- }
- return raw;
- }
- function mergeAsArray$1(to, from) {
- return to ? [...new Set([].concat(to, from))] : from;
- }
- function mergeObjectOptions(to, from) {
- return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
- }
- function mergeEmitsOrPropsOptions(to, from) {
- if (to) {
- if (isArray(to) && isArray(from)) {
- return [.../* @__PURE__ */ new Set([...to, ...from])];
- }
- return extend(
- /* @__PURE__ */ Object.create(null),
- normalizePropsOrEmits(to),
- normalizePropsOrEmits(from != null ? from : {})
- );
- } else {
- return from;
- }
- }
- function mergeWatchOptions(to, from) {
- if (!to) return from;
- if (!from) return to;
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
- for (const key in from) {
- merged[key] = mergeAsArray$1(to[key], from[key]);
- }
- return merged;
- }
-
- function createAppContext() {
- return {
- app: null,
- config: {
- isNativeTag: NO,
- performance: false,
- globalProperties: {},
- optionMergeStrategies: {},
- errorHandler: void 0,
- warnHandler: void 0,
- compilerOptions: {}
- },
- mixins: [],
- components: {},
- directives: {},
- provides: /* @__PURE__ */ Object.create(null),
- optionsCache: /* @__PURE__ */ new WeakMap(),
- propsCache: /* @__PURE__ */ new WeakMap(),
- emitsCache: /* @__PURE__ */ new WeakMap()
- };
- }
- let uid$1 = 0;
- function createAppAPI(render, hydrate) {
- return function createApp(rootComponent, rootProps = null) {
- if (!isFunction(rootComponent)) {
- rootComponent = extend({}, rootComponent);
- }
- if (rootProps != null && !isObject(rootProps)) {
- warn$1(`root props passed to app.mount() must be an object.`);
- rootProps = null;
- }
- const context = createAppContext();
- const installedPlugins = /* @__PURE__ */ new WeakSet();
- const pluginCleanupFns = [];
- let isMounted = false;
- const app = context.app = {
- _uid: uid$1++,
- _component: rootComponent,
- _props: rootProps,
- _container: null,
- _context: context,
- _instance: null,
- version,
- get config() {
- return context.config;
- },
- set config(v) {
- {
- warn$1(
- `app.config cannot be replaced. Modify individual options instead.`
- );
- }
- },
- use(plugin, ...options) {
- if (installedPlugins.has(plugin)) {
- warn$1(`Plugin has already been applied to target app.`);
- } else if (plugin && isFunction(plugin.install)) {
- installedPlugins.add(plugin);
- plugin.install(app, ...options);
- } else if (isFunction(plugin)) {
- installedPlugins.add(plugin);
- plugin(app, ...options);
- } else {
- warn$1(
- `A plugin must either be a function or an object with an "install" function.`
- );
- }
- return app;
- },
- mixin(mixin) {
- {
- if (!context.mixins.includes(mixin)) {
- context.mixins.push(mixin);
- } else {
- warn$1(
- "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
- );
- }
- }
- return app;
- },
- component(name, component) {
- {
- validateComponentName(name, context.config);
- }
- if (!component) {
- return context.components[name];
- }
- if (context.components[name]) {
- warn$1(`Component "${name}" has already been registered in target app.`);
- }
- context.components[name] = component;
- return app;
- },
- directive(name, directive) {
- {
- validateDirectiveName(name);
- }
- if (!directive) {
- return context.directives[name];
- }
- if (context.directives[name]) {
- warn$1(`Directive "${name}" has already been registered in target app.`);
- }
- context.directives[name] = directive;
- return app;
- },
- mount(rootContainer, isHydrate, namespace) {
- if (!isMounted) {
- if (rootContainer.__vue_app__) {
- warn$1(
- `There is already an app instance mounted on the host container.
- If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
- );
- }
- const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
- vnode.appContext = context;
- if (namespace === true) {
- namespace = "svg";
- } else if (namespace === false) {
- namespace = void 0;
- }
- {
- context.reload = () => {
- render(
- cloneVNode(vnode),
- rootContainer,
- namespace
- );
- };
- }
- if (isHydrate && hydrate) {
- hydrate(vnode, rootContainer);
- } else {
- render(vnode, rootContainer, namespace);
- }
- isMounted = true;
- app._container = rootContainer;
- rootContainer.__vue_app__ = app;
- {
- app._instance = vnode.component;
- devtoolsInitApp(app, version);
- }
- return getComponentPublicInstance(vnode.component);
- } else {
- warn$1(
- `App has already been mounted.
-If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
- );
- }
- },
- onUnmount(cleanupFn) {
- if (typeof cleanupFn !== "function") {
- warn$1(
- `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}`
- );
- }
- pluginCleanupFns.push(cleanupFn);
- },
- unmount() {
- if (isMounted) {
- callWithAsyncErrorHandling(
- pluginCleanupFns,
- app._instance,
- 16
- );
- render(null, app._container);
- {
- app._instance = null;
- devtoolsUnmountApp(app);
- }
- delete app._container.__vue_app__;
- } else {
- warn$1(`Cannot unmount an app that is not mounted.`);
- }
- },
- provide(key, value) {
- if (key in context.provides) {
- warn$1(
- `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
- );
- }
- context.provides[key] = value;
- return app;
- },
- runWithContext(fn) {
- const lastApp = currentApp;
- currentApp = app;
- try {
- return fn();
- } finally {
- currentApp = lastApp;
- }
- }
- };
- return app;
- };
- }
- let currentApp = null;
-
- function provide(key, value) {
- if (!currentInstance) {
- {
- warn$1(`provide() can only be used inside setup().`);
- }
- } else {
- let provides = currentInstance.provides;
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
- if (parentProvides === provides) {
- provides = currentInstance.provides = Object.create(parentProvides);
- }
- provides[key] = value;
- }
- }
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
- const instance = currentInstance || currentRenderingInstance;
- if (instance || currentApp) {
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
- if (provides && key in provides) {
- return provides[key];
- } else if (arguments.length > 1) {
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
- } else {
- warn$1(`injection "${String(key)}" not found.`);
- }
- } else {
- warn$1(`inject() can only be used inside setup() or functional components.`);
- }
- }
- function hasInjectionContext() {
- return !!(currentInstance || currentRenderingInstance || currentApp);
- }
-
- const internalObjectProto = {};
- const createInternalObject = () => Object.create(internalObjectProto);
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
-
- function initProps(instance, rawProps, isStateful, isSSR = false) {
- const props = {};
- const attrs = createInternalObject();
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
- setFullProps(instance, rawProps, props, attrs);
- for (const key in instance.propsOptions[0]) {
- if (!(key in props)) {
- props[key] = void 0;
- }
- }
- {
- validateProps(rawProps || {}, props, instance);
- }
- if (isStateful) {
- instance.props = isSSR ? props : shallowReactive(props);
- } else {
- if (!instance.type.props) {
- instance.props = attrs;
- } else {
- instance.props = props;
- }
- }
- instance.attrs = attrs;
- }
- function isInHmrContext(instance) {
- while (instance) {
- if (instance.type.__hmrId) return true;
- instance = instance.parent;
- }
- }
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
- const {
- props,
- attrs,
- vnode: { patchFlag }
- } = instance;
- const rawCurrentProps = toRaw(props);
- const [options] = instance.propsOptions;
- let hasAttrsChanged = false;
- if (
- // always force full diff in dev
- // - #1942 if hmr is enabled with sfc component
- // - vite#872 non-sfc component used by sfc component
- !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
- ) {
- if (patchFlag & 8) {
- const propsToUpdate = instance.vnode.dynamicProps;
- for (let i = 0; i < propsToUpdate.length; i++) {
- let key = propsToUpdate[i];
- if (isEmitListener(instance.emitsOptions, key)) {
- continue;
- }
- const value = rawProps[key];
- if (options) {
- if (hasOwn(attrs, key)) {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- } else {
- const camelizedKey = camelize(key);
- props[camelizedKey] = resolvePropValue(
- options,
- rawCurrentProps,
- camelizedKey,
- value,
- instance,
- false
- );
- }
- } else {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- } else {
- if (setFullProps(instance, rawProps, props, attrs)) {
- hasAttrsChanged = true;
- }
- let kebabKey;
- for (const key in rawCurrentProps) {
- if (!rawProps || // for camelCase
- !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
- // and converted to camelCase (#955)
- ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
- if (options) {
- if (rawPrevProps && // for camelCase
- (rawPrevProps[key] !== void 0 || // for kebab-case
- rawPrevProps[kebabKey] !== void 0)) {
- props[key] = resolvePropValue(
- options,
- rawCurrentProps,
- key,
- void 0,
- instance,
- true
- );
- }
- } else {
- delete props[key];
- }
- }
- }
- if (attrs !== rawCurrentProps) {
- for (const key in attrs) {
- if (!rawProps || !hasOwn(rawProps, key) && true) {
- delete attrs[key];
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (hasAttrsChanged) {
- trigger(instance.attrs, "set", "");
- }
- {
- validateProps(rawProps || {}, props, instance);
- }
- }
- function setFullProps(instance, rawProps, props, attrs) {
- const [options, needCastKeys] = instance.propsOptions;
- let hasAttrsChanged = false;
- let rawCastValues;
- if (rawProps) {
- for (let key in rawProps) {
- if (isReservedProp(key)) {
- continue;
- }
- const value = rawProps[key];
- let camelKey;
- if (options && hasOwn(options, camelKey = camelize(key))) {
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
- props[camelKey] = value;
- } else {
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
- }
- } else if (!isEmitListener(instance.emitsOptions, key)) {
- if (!(key in attrs) || value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (needCastKeys) {
- const rawCurrentProps = toRaw(props);
- const castValues = rawCastValues || EMPTY_OBJ;
- for (let i = 0; i < needCastKeys.length; i++) {
- const key = needCastKeys[i];
- props[key] = resolvePropValue(
- options,
- rawCurrentProps,
- key,
- castValues[key],
- instance,
- !hasOwn(castValues, key)
- );
- }
- }
- return hasAttrsChanged;
- }
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
- const opt = options[key];
- if (opt != null) {
- const hasDefault = hasOwn(opt, "default");
- if (hasDefault && value === void 0) {
- const defaultValue = opt.default;
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
- const { propsDefaults } = instance;
- if (key in propsDefaults) {
- value = propsDefaults[key];
- } else {
- const reset = setCurrentInstance(instance);
- value = propsDefaults[key] = defaultValue.call(
- null,
- props
- );
- reset();
- }
- } else {
- value = defaultValue;
- }
- if (instance.ce) {
- instance.ce._setProp(key, value);
- }
- }
- if (opt[0 /* shouldCast */]) {
- if (isAbsent && !hasDefault) {
- value = false;
- } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
- value = true;
- }
- }
- }
- return value;
- }
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
- function normalizePropsOptions(comp, appContext, asMixin = false) {
- const cache = asMixin ? mixinPropsCache : appContext.propsCache;
- const cached = cache.get(comp);
- if (cached) {
- return cached;
- }
- const raw = comp.props;
- const normalized = {};
- const needCastKeys = [];
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendProps = (raw2) => {
- hasExtends = true;
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
- extend(normalized, props);
- if (keys) needCastKeys.push(...keys);
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendProps);
- }
- if (comp.extends) {
- extendProps(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendProps);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject(comp)) {
- cache.set(comp, EMPTY_ARR);
- }
- return EMPTY_ARR;
- }
- if (isArray(raw)) {
- for (let i = 0; i < raw.length; i++) {
- if (!isString(raw[i])) {
- warn$1(`props must be strings when using array syntax.`, raw[i]);
- }
- const normalizedKey = camelize(raw[i]);
- if (validatePropName(normalizedKey)) {
- normalized[normalizedKey] = EMPTY_OBJ;
- }
- }
- } else if (raw) {
- if (!isObject(raw)) {
- warn$1(`invalid props options`, raw);
- }
- for (const key in raw) {
- const normalizedKey = camelize(key);
- if (validatePropName(normalizedKey)) {
- const opt = raw[key];
- const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
- const propType = prop.type;
- let shouldCast = false;
- let shouldCastTrue = true;
- if (isArray(propType)) {
- for (let index = 0; index < propType.length; ++index) {
- const type = propType[index];
- const typeName = isFunction(type) && type.name;
- if (typeName === "Boolean") {
- shouldCast = true;
- break;
- } else if (typeName === "String") {
- shouldCastTrue = false;
- }
- }
- } else {
- shouldCast = isFunction(propType) && propType.name === "Boolean";
- }
- prop[0 /* shouldCast */] = shouldCast;
- prop[1 /* shouldCastTrue */] = shouldCastTrue;
- if (shouldCast || hasOwn(prop, "default")) {
- needCastKeys.push(normalizedKey);
- }
- }
- }
- }
- const res = [normalized, needCastKeys];
- if (isObject(comp)) {
- cache.set(comp, res);
- }
- return res;
- }
- function validatePropName(key) {
- if (key[0] !== "$" && !isReservedProp(key)) {
- return true;
- } else {
- warn$1(`Invalid prop name: "${key}" is a reserved property.`);
- }
- return false;
- }
- function getType(ctor) {
- if (ctor === null) {
- return "null";
- }
- if (typeof ctor === "function") {
- return ctor.name || "";
- } else if (typeof ctor === "object") {
- const name = ctor.constructor && ctor.constructor.name;
- return name || "";
- }
- return "";
- }
- function validateProps(rawProps, props, instance) {
- const resolvedValues = toRaw(props);
- const options = instance.propsOptions[0];
- const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
- for (const key in options) {
- let opt = options[key];
- if (opt == null) continue;
- validateProp(
- key,
- resolvedValues[key],
- opt,
- shallowReadonly(resolvedValues) ,
- !camelizePropsKey.includes(key)
- );
- }
- }
- function validateProp(name, value, prop, props, isAbsent) {
- const { type, required, validator, skipCheck } = prop;
- if (required && isAbsent) {
- warn$1('Missing required prop: "' + name + '"');
- return;
- }
- if (value == null && !required) {
- return;
- }
- if (type != null && type !== true && !skipCheck) {
- let isValid = false;
- const types = isArray(type) ? type : [type];
- const expectedTypes = [];
- for (let i = 0; i < types.length && !isValid; i++) {
- const { valid, expectedType } = assertType(value, types[i]);
- expectedTypes.push(expectedType || "");
- isValid = valid;
- }
- if (!isValid) {
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
- return;
- }
- }
- if (validator && !validator(value, props)) {
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
- }
- }
- const isSimpleType = /* @__PURE__ */ makeMap(
- "String,Number,Boolean,Function,Symbol,BigInt"
- );
- function assertType(value, type) {
- let valid;
- const expectedType = getType(type);
- if (expectedType === "null") {
- valid = value === null;
- } else if (isSimpleType(expectedType)) {
- const t = typeof value;
- valid = t === expectedType.toLowerCase();
- if (!valid && t === "object") {
- valid = value instanceof type;
- }
- } else if (expectedType === "Object") {
- valid = isObject(value);
- } else if (expectedType === "Array") {
- valid = isArray(value);
- } else {
- valid = value instanceof type;
- }
- return {
- valid,
- expectedType
- };
- }
- function getInvalidTypeMessage(name, value, expectedTypes) {
- if (expectedTypes.length === 0) {
- return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
- }
- let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
- const expectedType = expectedTypes[0];
- const receivedType = toRawType(value);
- const expectedValue = styleValue(value, expectedType);
- const receivedValue = styleValue(value, receivedType);
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
- message += ` with value ${expectedValue}`;
- }
- message += `, got ${receivedType} `;
- if (isExplicable(receivedType)) {
- message += `with value ${receivedValue}.`;
- }
- return message;
- }
- function styleValue(value, type) {
- if (type === "String") {
- return `"${value}"`;
- } else if (type === "Number") {
- return `${Number(value)}`;
- } else {
- return `${value}`;
- }
- }
- function isExplicable(type) {
- const explicitTypes = ["string", "number", "boolean"];
- return explicitTypes.some((elem) => type.toLowerCase() === elem);
- }
- function isBoolean(...args) {
- return args.some((elem) => elem.toLowerCase() === "boolean");
- }
-
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
- const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
- const normalizeSlot = (key, rawSlot, ctx) => {
- if (rawSlot._n) {
- return rawSlot;
- }
- const normalized = withCtx((...args) => {
- if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
- warn$1(
- `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
- );
- }
- return normalizeSlotValue(rawSlot(...args));
- }, ctx);
- normalized._c = false;
- return normalized;
- };
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
- const ctx = rawSlots._ctx;
- for (const key in rawSlots) {
- if (isInternalKey(key)) continue;
- const value = rawSlots[key];
- if (isFunction(value)) {
- slots[key] = normalizeSlot(key, value, ctx);
- } else if (value != null) {
- {
- warn$1(
- `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
- );
- }
- const normalized = normalizeSlotValue(value);
- slots[key] = () => normalized;
- }
- }
- };
- const normalizeVNodeSlots = (instance, children) => {
- if (!isKeepAlive(instance.vnode) && true) {
- warn$1(
- `Non-function value encountered for default slot. Prefer function slots for better performance.`
- );
- }
- const normalized = normalizeSlotValue(children);
- instance.slots.default = () => normalized;
- };
- const assignSlots = (slots, children, optimized) => {
- for (const key in children) {
- if (optimized || key !== "_") {
- slots[key] = children[key];
- }
- }
- };
- const initSlots = (instance, children, optimized) => {
- const slots = instance.slots = createInternalObject();
- if (instance.vnode.shapeFlag & 32) {
- const type = children._;
- if (type) {
- assignSlots(slots, children, optimized);
- if (optimized) {
- def(slots, "_", type, true);
- }
- } else {
- normalizeObjectSlots(children, slots);
- }
- } else if (children) {
- normalizeVNodeSlots(instance, children);
- }
- };
- const updateSlots = (instance, children, optimized) => {
- const { vnode, slots } = instance;
- let needDeletionCheck = true;
- let deletionComparisonTarget = EMPTY_OBJ;
- if (vnode.shapeFlag & 32) {
- const type = children._;
- if (type) {
- if (isHmrUpdating) {
- assignSlots(slots, children, optimized);
- trigger(instance, "set", "$slots");
- } else if (optimized && type === 1) {
- needDeletionCheck = false;
- } else {
- assignSlots(slots, children, optimized);
- }
- } else {
- needDeletionCheck = !children.$stable;
- normalizeObjectSlots(children, slots);
- }
- deletionComparisonTarget = children;
- } else if (children) {
- normalizeVNodeSlots(instance, children);
- deletionComparisonTarget = { default: 1 };
- }
- if (needDeletionCheck) {
- for (const key in slots) {
- if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
- delete slots[key];
- }
- }
- }
- };
-
- let supported;
- let perf;
- function startMeasure(instance, type) {
- if (instance.appContext.config.performance && isSupported()) {
- perf.mark(`vue-${type}-${instance.uid}`);
- }
- {
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
- }
- }
- function endMeasure(instance, type) {
- if (instance.appContext.config.performance && isSupported()) {
- const startTag = `vue-${type}-${instance.uid}`;
- const endTag = startTag + `:end`;
- perf.mark(endTag);
- perf.measure(
- `<${formatComponentName(instance, instance.type)}> ${type}`,
- startTag,
- endTag
- );
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- }
- {
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
- }
- }
- function isSupported() {
- if (supported !== void 0) {
- return supported;
- }
- if (typeof window !== "undefined" && window.performance) {
- supported = true;
- perf = window.performance;
- } else {
- supported = false;
- }
- return supported;
- }
-
- const queuePostRenderEffect = queueEffectWithSuspense ;
- function createRenderer(options) {
- return baseCreateRenderer(options);
- }
- function createHydrationRenderer(options) {
- return baseCreateRenderer(options, createHydrationFunctions);
- }
- function baseCreateRenderer(options, createHydrationFns) {
- const target = getGlobalThis();
- target.__VUE__ = true;
- {
- setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
- }
- const {
- insert: hostInsert,
- remove: hostRemove,
- patchProp: hostPatchProp,
- createElement: hostCreateElement,
- createText: hostCreateText,
- createComment: hostCreateComment,
- setText: hostSetText,
- setElementText: hostSetElementText,
- parentNode: hostParentNode,
- nextSibling: hostNextSibling,
- setScopeId: hostSetScopeId = NOOP,
- insertStaticContent: hostInsertStaticContent
- } = options;
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
- if (n1 === n2) {
- return;
- }
- if (n1 && !isSameVNodeType(n1, n2)) {
- anchor = getNextHostNode(n1);
- unmount(n1, parentComponent, parentSuspense, true);
- n1 = null;
- }
- if (n2.patchFlag === -2) {
- optimized = false;
- n2.dynamicChildren = null;
- }
- const { type, ref, shapeFlag } = n2;
- switch (type) {
- case Text:
- processText(n1, n2, container, anchor);
- break;
- case Comment:
- processCommentNode(n1, n2, container, anchor);
- break;
- case Static:
- if (n1 == null) {
- mountStaticNode(n2, container, anchor, namespace);
- } else {
- patchStaticNode(n1, n2, container, namespace);
- }
- break;
- case Fragment:
- processFragment(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- break;
- default:
- if (shapeFlag & 1) {
- processElement(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (shapeFlag & 6) {
- processComponent(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (shapeFlag & 64) {
- type.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- } else if (shapeFlag & 128) {
- type.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- } else {
- warn$1("Invalid VNode type:", type, `(${typeof type})`);
- }
- }
- if (ref != null && parentComponent) {
- setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
- }
- };
- const processText = (n1, n2, container, anchor) => {
- if (n1 == null) {
- hostInsert(
- n2.el = hostCreateText(n2.children),
- container,
- anchor
- );
- } else {
- const el = n2.el = n1.el;
- if (n2.children !== n1.children) {
- hostSetText(el, n2.children);
- }
- }
- };
- const processCommentNode = (n1, n2, container, anchor) => {
- if (n1 == null) {
- hostInsert(
- n2.el = hostCreateComment(n2.children || ""),
- container,
- anchor
- );
- } else {
- n2.el = n1.el;
- }
- };
- const mountStaticNode = (n2, container, anchor, namespace) => {
- [n2.el, n2.anchor] = hostInsertStaticContent(
- n2.children,
- container,
- anchor,
- namespace,
- n2.el,
- n2.anchor
- );
- };
- const patchStaticNode = (n1, n2, container, namespace) => {
- if (n2.children !== n1.children) {
- const anchor = hostNextSibling(n1.anchor);
- removeStaticNode(n1);
- [n2.el, n2.anchor] = hostInsertStaticContent(
- n2.children,
- container,
- anchor,
- namespace
- );
- } else {
- n2.el = n1.el;
- n2.anchor = n1.anchor;
- }
- };
- const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
- let next;
- while (el && el !== anchor) {
- next = hostNextSibling(el);
- hostInsert(el, container, nextSibling);
- el = next;
- }
- hostInsert(anchor, container, nextSibling);
- };
- const removeStaticNode = ({ el, anchor }) => {
- let next;
- while (el && el !== anchor) {
- next = hostNextSibling(el);
- hostRemove(el);
- el = next;
- }
- hostRemove(anchor);
- };
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- if (n2.type === "svg") {
- namespace = "svg";
- } else if (n2.type === "math") {
- namespace = "mathml";
- }
- if (n1 == null) {
- mountElement(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- patchElement(
- n1,
- n2,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- let el;
- let vnodeHook;
- const { props, shapeFlag, transition, dirs } = vnode;
- el = vnode.el = hostCreateElement(
- vnode.type,
- namespace,
- props && props.is,
- props
- );
- if (shapeFlag & 8) {
- hostSetElementText(el, vnode.children);
- } else if (shapeFlag & 16) {
- mountChildren(
- vnode.children,
- el,
- null,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(vnode, namespace),
- slotScopeIds,
- optimized
- );
- }
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "created");
- }
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
- if (props) {
- for (const key in props) {
- if (key !== "value" && !isReservedProp(key)) {
- hostPatchProp(el, key, null, props[key], namespace, parentComponent);
- }
- }
- if ("value" in props) {
- hostPatchProp(el, "value", null, props.value, namespace);
- }
- if (vnodeHook = props.onVnodeBeforeMount) {
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
- }
- }
- {
- def(el, "__vnode", vnode, true);
- def(el, "__vueParentComponent", parentComponent, true);
- }
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
- }
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
- if (needCallTransitionHooks) {
- transition.beforeEnter(el);
- }
- hostInsert(el, container, anchor);
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
- needCallTransitionHooks && transition.enter(el);
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
- }, parentSuspense);
- }
- };
- const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
- if (scopeId) {
- hostSetScopeId(el, scopeId);
- }
- if (slotScopeIds) {
- for (let i = 0; i < slotScopeIds.length; i++) {
- hostSetScopeId(el, slotScopeIds[i]);
- }
- }
- if (parentComponent) {
- let subTree = parentComponent.subTree;
- if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
- subTree = filterSingleRoot(subTree.children) || subTree;
- }
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
- const parentVNode = parentComponent.vnode;
- setScopeId(
- el,
- parentVNode,
- parentVNode.scopeId,
- parentVNode.slotScopeIds,
- parentComponent.parent
- );
- }
- }
- };
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
- for (let i = start; i < children.length; i++) {
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
- patch(
- null,
- child,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- const el = n2.el = n1.el;
- {
- el.__vnode = n2;
- }
- let { patchFlag, dynamicChildren, dirs } = n2;
- patchFlag |= n1.patchFlag & 16;
- const oldProps = n1.props || EMPTY_OBJ;
- const newProps = n2.props || EMPTY_OBJ;
- let vnodeHook;
- parentComponent && toggleRecurse(parentComponent, false);
- if (vnodeHook = newProps.onVnodeBeforeUpdate) {
- invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
- }
- if (dirs) {
- invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
- }
- parentComponent && toggleRecurse(parentComponent, true);
- if (isHmrUpdating) {
- patchFlag = 0;
- optimized = false;
- dynamicChildren = null;
- }
- if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
- hostSetElementText(el, "");
- }
- if (dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- el,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(n2, namespace),
- slotScopeIds
- );
- {
- traverseStaticChildren(n1, n2);
- }
- } else if (!optimized) {
- patchChildren(
- n1,
- n2,
- el,
- null,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(n2, namespace),
- slotScopeIds,
- false
- );
- }
- if (patchFlag > 0) {
- if (patchFlag & 16) {
- patchProps(el, oldProps, newProps, parentComponent, namespace);
- } else {
- if (patchFlag & 2) {
- if (oldProps.class !== newProps.class) {
- hostPatchProp(el, "class", null, newProps.class, namespace);
- }
- }
- if (patchFlag & 4) {
- hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
- }
- if (patchFlag & 8) {
- const propsToUpdate = n2.dynamicProps;
- for (let i = 0; i < propsToUpdate.length; i++) {
- const key = propsToUpdate[i];
- const prev = oldProps[key];
- const next = newProps[key];
- if (next !== prev || key === "value") {
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
- }
- }
- }
- }
- if (patchFlag & 1) {
- if (n1.children !== n2.children) {
- hostSetElementText(el, n2.children);
- }
- }
- } else if (!optimized && dynamicChildren == null) {
- patchProps(el, oldProps, newProps, parentComponent, namespace);
- }
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
- }, parentSuspense);
- }
- };
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
- for (let i = 0; i < newChildren.length; i++) {
- const oldVNode = oldChildren[i];
- const newVNode = newChildren[i];
- const container = (
- // oldVNode may be an errored async setup() component inside Suspense
- // which will not have a mounted element
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
- // of the Fragment itself so it can move its children.
- (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
- // which also requires the correct parent container
- !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
- // In other cases, the parent container is not actually used so we
- // just pass the block element here to avoid a DOM parentNode call.
- fallbackContainer
- )
- );
- patch(
- oldVNode,
- newVNode,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- true
- );
- }
- };
- const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
- if (oldProps !== newProps) {
- if (oldProps !== EMPTY_OBJ) {
- for (const key in oldProps) {
- if (!isReservedProp(key) && !(key in newProps)) {
- hostPatchProp(
- el,
- key,
- oldProps[key],
- null,
- namespace,
- parentComponent
- );
- }
- }
- }
- for (const key in newProps) {
- if (isReservedProp(key)) continue;
- const next = newProps[key];
- const prev = oldProps[key];
- if (next !== prev && key !== "value") {
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
- }
- }
- if ("value" in newProps) {
- hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
- }
- }
- };
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
- const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
- let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
- if (
- // #5523 dev root fragment may inherit directives
- isHmrUpdating || patchFlag & 2048
- ) {
- patchFlag = 0;
- optimized = false;
- dynamicChildren = null;
- }
- if (fragmentSlotScopeIds) {
- slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
- }
- if (n1 == null) {
- hostInsert(fragmentStartAnchor, container, anchor);
- hostInsert(fragmentEndAnchor, container, anchor);
- mountChildren(
- // #10007
- // such fragment like `<></>` will be compiled into
- // a fragment which doesn't have a children.
- // In this case fallback to an empty array
- n2.children || [],
- container,
- fragmentEndAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
- // of renderSlot() with no valid children
- n1.dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- container,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds
- );
- {
- traverseStaticChildren(n1, n2);
- }
- } else {
- patchChildren(
- n1,
- n2,
- container,
- fragmentEndAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- }
- };
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- n2.slotScopeIds = slotScopeIds;
- if (n1 == null) {
- if (n2.shapeFlag & 512) {
- parentComponent.ctx.activate(
- n2,
- container,
- anchor,
- namespace,
- optimized
- );
- } else {
- mountComponent(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- optimized
- );
- }
- } else {
- updateComponent(n1, n2, optimized);
- }
- };
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
- const instance = (initialVNode.component = createComponentInstance(
- initialVNode,
- parentComponent,
- parentSuspense
- ));
- if (instance.type.__hmrId) {
- registerHMR(instance);
- }
- {
- pushWarningContext(initialVNode);
- startMeasure(instance, `mount`);
- }
- if (isKeepAlive(initialVNode)) {
- instance.ctx.renderer = internals;
- }
- {
- {
- startMeasure(instance, `init`);
- }
- setupComponent(instance, false, optimized);
- {
- endMeasure(instance, `init`);
- }
- }
- if (instance.asyncDep) {
- if (isHmrUpdating) initialVNode.el = null;
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
- if (!initialVNode.el) {
- const placeholder = instance.subTree = createVNode(Comment);
- processCommentNode(null, placeholder, container, anchor);
- }
- } else {
- setupRenderEffect(
- instance,
- initialVNode,
- container,
- anchor,
- parentSuspense,
- namespace,
- optimized
- );
- }
- {
- popWarningContext();
- endMeasure(instance, `mount`);
- }
- };
- const updateComponent = (n1, n2, optimized) => {
- const instance = n2.component = n1.component;
- if (shouldUpdateComponent(n1, n2, optimized)) {
- if (instance.asyncDep && !instance.asyncResolved) {
- {
- pushWarningContext(n2);
- }
- updateComponentPreRender(instance, n2, optimized);
- {
- popWarningContext();
- }
- return;
- } else {
- instance.next = n2;
- instance.update();
- }
- } else {
- n2.el = n1.el;
- instance.vnode = n2;
- }
- };
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
- const componentUpdateFn = () => {
- if (!instance.isMounted) {
- let vnodeHook;
- const { el, props } = initialVNode;
- const { bm, m, parent, root, type } = instance;
- const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
- toggleRecurse(instance, false);
- if (bm) {
- invokeArrayFns(bm);
- }
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
- invokeVNodeHook(vnodeHook, parent, initialVNode);
- }
- toggleRecurse(instance, true);
- if (el && hydrateNode) {
- const hydrateSubTree = () => {
- {
- startMeasure(instance, `render`);
- }
- instance.subTree = renderComponentRoot(instance);
- {
- endMeasure(instance, `render`);
- }
- {
- startMeasure(instance, `hydrate`);
- }
- hydrateNode(
- el,
- instance.subTree,
- instance,
- parentSuspense,
- null
- );
- {
- endMeasure(instance, `hydrate`);
- }
- };
- if (isAsyncWrapperVNode && type.__asyncHydrate) {
- type.__asyncHydrate(
- el,
- instance,
- hydrateSubTree
- );
- } else {
- hydrateSubTree();
- }
- } else {
- if (root.ce) {
- root.ce._injectChildStyle(type);
- }
- {
- startMeasure(instance, `render`);
- }
- const subTree = instance.subTree = renderComponentRoot(instance);
- {
- endMeasure(instance, `render`);
- }
- {
- startMeasure(instance, `patch`);
- }
- patch(
- null,
- subTree,
- container,
- anchor,
- instance,
- parentSuspense,
- namespace
- );
- {
- endMeasure(instance, `patch`);
- }
- initialVNode.el = subTree.el;
- }
- if (m) {
- queuePostRenderEffect(m, parentSuspense);
- }
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
- const scopedInitialVNode = initialVNode;
- queuePostRenderEffect(
- () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
- parentSuspense
- );
- }
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
- }
- instance.isMounted = true;
- {
- devtoolsComponentAdded(instance);
- }
- initialVNode = container = anchor = null;
- } else {
- let { next, bu, u, parent, vnode } = instance;
- {
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
- if (nonHydratedAsyncRoot) {
- if (next) {
- next.el = vnode.el;
- updateComponentPreRender(instance, next, optimized);
- }
- nonHydratedAsyncRoot.asyncDep.then(() => {
- if (!instance.isUnmounted) {
- componentUpdateFn();
- }
- });
- return;
- }
- }
- let originNext = next;
- let vnodeHook;
- {
- pushWarningContext(next || instance.vnode);
- }
- toggleRecurse(instance, false);
- if (next) {
- next.el = vnode.el;
- updateComponentPreRender(instance, next, optimized);
- } else {
- next = vnode;
- }
- if (bu) {
- invokeArrayFns(bu);
- }
- if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
- invokeVNodeHook(vnodeHook, parent, next, vnode);
- }
- toggleRecurse(instance, true);
- {
- startMeasure(instance, `render`);
- }
- const nextTree = renderComponentRoot(instance);
- {
- endMeasure(instance, `render`);
- }
- const prevTree = instance.subTree;
- instance.subTree = nextTree;
- {
- startMeasure(instance, `patch`);
- }
- patch(
- prevTree,
- nextTree,
- // parent may have changed if it's in a teleport
- hostParentNode(prevTree.el),
- // anchor may have changed if it's in a fragment
- getNextHostNode(prevTree),
- instance,
- parentSuspense,
- namespace
- );
- {
- endMeasure(instance, `patch`);
- }
- next.el = nextTree.el;
- if (originNext === null) {
- updateHOCHostEl(instance, nextTree.el);
- }
- if (u) {
- queuePostRenderEffect(u, parentSuspense);
- }
- if (vnodeHook = next.props && next.props.onVnodeUpdated) {
- queuePostRenderEffect(
- () => invokeVNodeHook(vnodeHook, parent, next, vnode),
- parentSuspense
- );
- }
- {
- devtoolsComponentUpdated(instance);
- }
- {
- popWarningContext();
- }
- }
- };
- instance.scope.on();
- const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
- instance.scope.off();
- const update = instance.update = effect.run.bind(effect);
- const job = instance.job = effect.runIfDirty.bind(effect);
- job.i = instance;
- job.id = instance.uid;
- effect.scheduler = () => queueJob(job);
- toggleRecurse(instance, true);
- {
- effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
- effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
- }
- update();
- };
- const updateComponentPreRender = (instance, nextVNode, optimized) => {
- nextVNode.component = instance;
- const prevProps = instance.vnode.props;
- instance.vnode = nextVNode;
- instance.next = null;
- updateProps(instance, nextVNode.props, prevProps, optimized);
- updateSlots(instance, nextVNode.children, optimized);
- pauseTracking();
- flushPreFlushCbs(instance);
- resetTracking();
- };
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
- const c1 = n1 && n1.children;
- const prevShapeFlag = n1 ? n1.shapeFlag : 0;
- const c2 = n2.children;
- const { patchFlag, shapeFlag } = n2;
- if (patchFlag > 0) {
- if (patchFlag & 128) {
- patchKeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- return;
- } else if (patchFlag & 256) {
- patchUnkeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- return;
- }
- }
- if (shapeFlag & 8) {
- if (prevShapeFlag & 16) {
- unmountChildren(c1, parentComponent, parentSuspense);
- }
- if (c2 !== c1) {
- hostSetElementText(container, c2);
- }
- } else {
- if (prevShapeFlag & 16) {
- if (shapeFlag & 16) {
- patchKeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- unmountChildren(c1, parentComponent, parentSuspense, true);
- }
- } else {
- if (prevShapeFlag & 8) {
- hostSetElementText(container, "");
- }
- if (shapeFlag & 16) {
- mountChildren(
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- }
- }
- };
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- c1 = c1 || EMPTY_ARR;
- c2 = c2 || EMPTY_ARR;
- const oldLength = c1.length;
- const newLength = c2.length;
- const commonLength = Math.min(oldLength, newLength);
- let i;
- for (i = 0; i < commonLength; i++) {
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- patch(
- c1[i],
- nextChild,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- if (oldLength > newLength) {
- unmountChildren(
- c1,
- parentComponent,
- parentSuspense,
- true,
- false,
- commonLength
- );
- } else {
- mountChildren(
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- commonLength
- );
- }
- };
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- let i = 0;
- const l2 = c2.length;
- let e1 = c1.length - 1;
- let e2 = l2 - 1;
- while (i <= e1 && i <= e2) {
- const n1 = c1[i];
- const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- if (isSameVNodeType(n1, n2)) {
- patch(
- n1,
- n2,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- break;
- }
- i++;
- }
- while (i <= e1 && i <= e2) {
- const n1 = c1[e1];
- const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
- if (isSameVNodeType(n1, n2)) {
- patch(
- n1,
- n2,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- break;
- }
- e1--;
- e2--;
- }
- if (i > e1) {
- if (i <= e2) {
- const nextPos = e2 + 1;
- const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
- while (i <= e2) {
- patch(
- null,
- c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- i++;
- }
- }
- } else if (i > e2) {
- while (i <= e1) {
- unmount(c1[i], parentComponent, parentSuspense, true);
- i++;
- }
- } else {
- const s1 = i;
- const s2 = i;
- const keyToNewIndexMap = /* @__PURE__ */ new Map();
- for (i = s2; i <= e2; i++) {
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- if (nextChild.key != null) {
- if (keyToNewIndexMap.has(nextChild.key)) {
- warn$1(
- `Duplicate keys found during update:`,
- JSON.stringify(nextChild.key),
- `Make sure keys are unique.`
- );
- }
- keyToNewIndexMap.set(nextChild.key, i);
- }
- }
- let j;
- let patched = 0;
- const toBePatched = e2 - s2 + 1;
- let moved = false;
- let maxNewIndexSoFar = 0;
- const newIndexToOldIndexMap = new Array(toBePatched);
- for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
- for (i = s1; i <= e1; i++) {
- const prevChild = c1[i];
- if (patched >= toBePatched) {
- unmount(prevChild, parentComponent, parentSuspense, true);
- continue;
- }
- let newIndex;
- if (prevChild.key != null) {
- newIndex = keyToNewIndexMap.get(prevChild.key);
- } else {
- for (j = s2; j <= e2; j++) {
- if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
- newIndex = j;
- break;
- }
- }
- }
- if (newIndex === void 0) {
- unmount(prevChild, parentComponent, parentSuspense, true);
- } else {
- newIndexToOldIndexMap[newIndex - s2] = i + 1;
- if (newIndex >= maxNewIndexSoFar) {
- maxNewIndexSoFar = newIndex;
- } else {
- moved = true;
- }
- patch(
- prevChild,
- c2[newIndex],
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- patched++;
- }
- }
- const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
- j = increasingNewIndexSequence.length - 1;
- for (i = toBePatched - 1; i >= 0; i--) {
- const nextIndex = s2 + i;
- const nextChild = c2[nextIndex];
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
- if (newIndexToOldIndexMap[i] === 0) {
- patch(
- null,
- nextChild,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (moved) {
- if (j < 0 || i !== increasingNewIndexSequence[j]) {
- move(nextChild, container, anchor, 2);
- } else {
- j--;
- }
- }
- }
- }
- };
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
- const { el, type, transition, children, shapeFlag } = vnode;
- if (shapeFlag & 6) {
- move(vnode.component.subTree, container, anchor, moveType);
- return;
- }
- if (shapeFlag & 128) {
- vnode.suspense.move(container, anchor, moveType);
- return;
- }
- if (shapeFlag & 64) {
- type.move(vnode, container, anchor, internals);
- return;
- }
- if (type === Fragment) {
- hostInsert(el, container, anchor);
- for (let i = 0; i < children.length; i++) {
- move(children[i], container, anchor, moveType);
- }
- hostInsert(vnode.anchor, container, anchor);
- return;
- }
- if (type === Static) {
- moveStaticNode(vnode, container, anchor);
- return;
- }
- const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
- if (needTransition2) {
- if (moveType === 0) {
- transition.beforeEnter(el);
- hostInsert(el, container, anchor);
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
- } else {
- const { leave, delayLeave, afterLeave } = transition;
- const remove2 = () => hostInsert(el, container, anchor);
- const performLeave = () => {
- leave(el, () => {
- remove2();
- afterLeave && afterLeave();
- });
- };
- if (delayLeave) {
- delayLeave(el, remove2, performLeave);
- } else {
- performLeave();
- }
- }
- } else {
- hostInsert(el, container, anchor);
- }
- };
- const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
- const {
- type,
- props,
- ref,
- children,
- dynamicChildren,
- shapeFlag,
- patchFlag,
- dirs,
- cacheIndex
- } = vnode;
- if (patchFlag === -2) {
- optimized = false;
- }
- if (ref != null) {
- setRef(ref, null, parentSuspense, vnode, true);
- }
- if (cacheIndex != null) {
- parentComponent.renderCache[cacheIndex] = void 0;
- }
- if (shapeFlag & 256) {
- parentComponent.ctx.deactivate(vnode);
- return;
- }
- const shouldInvokeDirs = shapeFlag & 1 && dirs;
- const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
- let vnodeHook;
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
- }
- if (shapeFlag & 6) {
- unmountComponent(vnode.component, parentSuspense, doRemove);
- } else {
- if (shapeFlag & 128) {
- vnode.suspense.unmount(parentSuspense, doRemove);
- return;
- }
- if (shouldInvokeDirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
- }
- if (shapeFlag & 64) {
- vnode.type.remove(
- vnode,
- parentComponent,
- parentSuspense,
- internals,
- doRemove
- );
- } else if (dynamicChildren && // #5154
- // when v-once is used inside a block, setBlockTracking(-1) marks the
- // parent block with hasOnce: true
- // so that it doesn't take the fast path during unmount - otherwise
- // components nested in v-once are never unmounted.
- !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
- (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
- unmountChildren(
- dynamicChildren,
- parentComponent,
- parentSuspense,
- false,
- true
- );
- } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
- unmountChildren(children, parentComponent, parentSuspense);
- }
- if (doRemove) {
- remove(vnode);
- }
- }
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
- }, parentSuspense);
- }
- };
- const remove = (vnode) => {
- const { type, el, anchor, transition } = vnode;
- if (type === Fragment) {
- if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
- vnode.children.forEach((child) => {
- if (child.type === Comment) {
- hostRemove(child.el);
- } else {
- remove(child);
- }
- });
- } else {
- removeFragment(el, anchor);
- }
- return;
- }
- if (type === Static) {
- removeStaticNode(vnode);
- return;
- }
- const performRemove = () => {
- hostRemove(el);
- if (transition && !transition.persisted && transition.afterLeave) {
- transition.afterLeave();
- }
- };
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
- const { leave, delayLeave } = transition;
- const performLeave = () => leave(el, performRemove);
- if (delayLeave) {
- delayLeave(vnode.el, performRemove, performLeave);
- } else {
- performLeave();
- }
- } else {
- performRemove();
- }
- };
- const removeFragment = (cur, end) => {
- let next;
- while (cur !== end) {
- next = hostNextSibling(cur);
- hostRemove(cur);
- cur = next;
- }
- hostRemove(end);
- };
- const unmountComponent = (instance, parentSuspense, doRemove) => {
- if (instance.type.__hmrId) {
- unregisterHMR(instance);
- }
- const { bum, scope, job, subTree, um, m, a } = instance;
- invalidateMount(m);
- invalidateMount(a);
- if (bum) {
- invokeArrayFns(bum);
- }
- scope.stop();
- if (job) {
- job.flags |= 8;
- unmount(subTree, instance, parentSuspense, doRemove);
- }
- if (um) {
- queuePostRenderEffect(um, parentSuspense);
- }
- queuePostRenderEffect(() => {
- instance.isUnmounted = true;
- }, parentSuspense);
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
- parentSuspense.deps--;
- if (parentSuspense.deps === 0) {
- parentSuspense.resolve();
- }
- }
- {
- devtoolsComponentRemoved(instance);
- }
- };
- const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
- for (let i = start; i < children.length; i++) {
- unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
- }
- };
- const getNextHostNode = (vnode) => {
- if (vnode.shapeFlag & 6) {
- return getNextHostNode(vnode.component.subTree);
- }
- if (vnode.shapeFlag & 128) {
- return vnode.suspense.next();
- }
- const el = hostNextSibling(vnode.anchor || vnode.el);
- const teleportEnd = el && el[TeleportEndKey];
- return teleportEnd ? hostNextSibling(teleportEnd) : el;
- };
- let isFlushing = false;
- const render = (vnode, container, namespace) => {
- if (vnode == null) {
- if (container._vnode) {
- unmount(container._vnode, null, null, true);
- }
- } else {
- patch(
- container._vnode || null,
- vnode,
- container,
- null,
- null,
- null,
- namespace
- );
- }
- container._vnode = vnode;
- if (!isFlushing) {
- isFlushing = true;
- flushPreFlushCbs();
- flushPostFlushCbs();
- isFlushing = false;
- }
- };
- const internals = {
- p: patch,
- um: unmount,
- m: move,
- r: remove,
- mt: mountComponent,
- mc: mountChildren,
- pc: patchChildren,
- pbc: patchBlockChildren,
- n: getNextHostNode,
- o: options
- };
- let hydrate;
- let hydrateNode;
- if (createHydrationFns) {
- [hydrate, hydrateNode] = createHydrationFns(
- internals
- );
- }
- return {
- render,
- hydrate,
- createApp: createAppAPI(render, hydrate)
- };
- }
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
- }
- function toggleRecurse({ effect, job }, allowed) {
- if (allowed) {
- effect.flags |= 32;
- job.flags |= 4;
- } else {
- effect.flags &= ~32;
- job.flags &= ~4;
- }
- }
- function needTransition(parentSuspense, transition) {
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
- }
- function traverseStaticChildren(n1, n2, shallow = false) {
- const ch1 = n1.children;
- const ch2 = n2.children;
- if (isArray(ch1) && isArray(ch2)) {
- for (let i = 0; i < ch1.length; i++) {
- const c1 = ch1[i];
- let c2 = ch2[i];
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
- c2.el = c1.el;
- }
- if (!shallow && c2.patchFlag !== -2)
- traverseStaticChildren(c1, c2);
- }
- if (c2.type === Text) {
- c2.el = c1.el;
- }
- if (c2.type === Comment && !c2.el) {
- c2.el = c1.el;
- }
- }
- }
- }
- function getSequence(arr) {
- const p = arr.slice();
- const result = [0];
- let i, j, u, v, c;
- const len = arr.length;
- for (i = 0; i < len; i++) {
- const arrI = arr[i];
- if (arrI !== 0) {
- j = result[result.length - 1];
- if (arr[j] < arrI) {
- p[i] = j;
- result.push(i);
- continue;
- }
- u = 0;
- v = result.length - 1;
- while (u < v) {
- c = u + v >> 1;
- if (arr[result[c]] < arrI) {
- u = c + 1;
- } else {
- v = c;
- }
- }
- if (arrI < arr[result[u]]) {
- if (u > 0) {
- p[i] = result[u - 1];
- }
- result[u] = i;
- }
- }
- }
- u = result.length;
- v = result[u - 1];
- while (u-- > 0) {
- result[u] = v;
- v = p[v];
- }
- return result;
- }
- function locateNonHydratedAsyncRoot(instance) {
- const subComponent = instance.subTree.component;
- if (subComponent) {
- if (subComponent.asyncDep && !subComponent.asyncResolved) {
- return subComponent;
- } else {
- return locateNonHydratedAsyncRoot(subComponent);
- }
- }
- }
- function invalidateMount(hooks) {
- if (hooks) {
- for (let i = 0; i < hooks.length; i++)
- hooks[i].flags |= 8;
- }
- }
-
- const ssrContextKey = Symbol.for("v-scx");
- const useSSRContext = () => {
- {
- warn$1(`useSSRContext() is not supported in the global build.`);
- }
- };
-
- function watchEffect(effect, options) {
- return doWatch(effect, null, options);
- }
- function watchPostEffect(effect, options) {
- return doWatch(
- effect,
- null,
- extend({}, options, { flush: "post" })
- );
- }
- function watchSyncEffect(effect, options) {
- return doWatch(
- effect,
- null,
- extend({}, options, { flush: "sync" })
- );
- }
- function watch(source, cb, options) {
- if (!isFunction(cb)) {
- warn$1(
- `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
- );
- }
- return doWatch(source, cb, options);
- }
- function doWatch(source, cb, options = EMPTY_OBJ) {
- const { immediate, deep, flush, once } = options;
- if (!cb) {
- if (immediate !== void 0) {
- warn$1(
- `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- if (deep !== void 0) {
- warn$1(
- `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- if (once !== void 0) {
- warn$1(
- `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
- );
- }
- }
- const baseWatchOptions = extend({}, options);
- baseWatchOptions.onWarn = warn$1;
- const instance = currentInstance;
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
- let isPre = false;
- if (flush === "post") {
- baseWatchOptions.scheduler = (job) => {
- queuePostRenderEffect(job, instance && instance.suspense);
- };
- } else if (flush !== "sync") {
- isPre = true;
- baseWatchOptions.scheduler = (job, isFirstRun) => {
- if (isFirstRun) {
- job();
- } else {
- queueJob(job);
- }
- };
- }
- baseWatchOptions.augmentJob = (job) => {
- if (cb) {
- job.flags |= 4;
- }
- if (isPre) {
- job.flags |= 2;
- if (instance) {
- job.id = instance.uid;
- job.i = instance;
- }
- }
- };
- const watchHandle = watch$1(source, cb, baseWatchOptions);
- return watchHandle;
- }
- function instanceWatch(source, value, options) {
- const publicThis = this.proxy;
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
- let cb;
- if (isFunction(value)) {
- cb = value;
- } else {
- cb = value.handler;
- options = value;
- }
- const reset = setCurrentInstance(this);
- const res = doWatch(getter, cb.bind(publicThis), options);
- reset();
- return res;
- }
- function createPathGetter(ctx, path) {
- const segments = path.split(".");
- return () => {
- let cur = ctx;
- for (let i = 0; i < segments.length && cur; i++) {
- cur = cur[segments[i]];
- }
- return cur;
- };
- }
-
- function useModel(props, name, options = EMPTY_OBJ) {
- const i = getCurrentInstance();
- if (!i) {
- warn$1(`useModel() called without active instance.`);
- return ref();
- }
- const camelizedName = camelize(name);
- if (!i.propsOptions[0][camelizedName]) {
- warn$1(`useModel() called with prop "${name}" which is not declared.`);
- return ref();
- }
- const hyphenatedName = hyphenate(name);
- const modifiers = getModelModifiers(props, camelizedName);
- const res = customRef((track, trigger) => {
- let localValue;
- let prevSetValue = EMPTY_OBJ;
- let prevEmittedValue;
- watchSyncEffect(() => {
- const propValue = props[camelizedName];
- if (hasChanged(localValue, propValue)) {
- localValue = propValue;
- trigger();
- }
- });
- return {
- get() {
- track();
- return options.get ? options.get(localValue) : localValue;
- },
- set(value) {
- const emittedValue = options.set ? options.set(value) : value;
- if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
- return;
- }
- const rawProps = i.vnode.props;
- if (!(rawProps && // check if parent has passed v-model
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
- localValue = value;
- trigger();
- }
- i.emit(`update:${name}`, emittedValue);
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
- trigger();
- }
- prevSetValue = value;
- prevEmittedValue = emittedValue;
- }
- };
- });
- res[Symbol.iterator] = () => {
- let i2 = 0;
- return {
- next() {
- if (i2 < 2) {
- return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
- } else {
- return { done: true };
- }
- }
- };
- };
- return res;
- }
- const getModelModifiers = (props, modelName) => {
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
- };
-
- function emit(instance, event, ...rawArgs) {
- if (instance.isUnmounted) return;
- const props = instance.vnode.props || EMPTY_OBJ;
- {
- const {
- emitsOptions,
- propsOptions: [propsOptions]
- } = instance;
- if (emitsOptions) {
- if (!(event in emitsOptions) && true) {
- if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
- warn$1(
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
- );
- }
- } else {
- const validator = emitsOptions[event];
- if (isFunction(validator)) {
- const isValid = validator(...rawArgs);
- if (!isValid) {
- warn$1(
- `Invalid event arguments: event validation failed for event "${event}".`
- );
- }
- }
- }
- }
- }
- let args = rawArgs;
- const isModelListener = event.startsWith("update:");
- const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
- if (modifiers) {
- if (modifiers.trim) {
- args = rawArgs.map((a) => isString(a) ? a.trim() : a);
- }
- if (modifiers.number) {
- args = rawArgs.map(looseToNumber);
- }
- }
- {
- devtoolsComponentEmit(instance, event, args);
- }
- {
- const lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
- warn$1(
- `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
- instance,
- instance.type
- )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
- event
- )}" instead of "${event}".`
- );
- }
- }
- let handlerName;
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
- props[handlerName = toHandlerKey(camelize(event))];
- if (!handler && isModelListener) {
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
- }
- if (handler) {
- callWithAsyncErrorHandling(
- handler,
- instance,
- 6,
- args
- );
- }
- const onceHandler = props[handlerName + `Once`];
- if (onceHandler) {
- if (!instance.emitted) {
- instance.emitted = {};
- } else if (instance.emitted[handlerName]) {
- return;
- }
- instance.emitted[handlerName] = true;
- callWithAsyncErrorHandling(
- onceHandler,
- instance,
- 6,
- args
- );
- }
- }
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
- const cache = appContext.emitsCache;
- const cached = cache.get(comp);
- if (cached !== void 0) {
- return cached;
- }
- const raw = comp.emits;
- let normalized = {};
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendEmits = (raw2) => {
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
- if (normalizedFromExtend) {
- hasExtends = true;
- extend(normalized, normalizedFromExtend);
- }
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendEmits);
- }
- if (comp.extends) {
- extendEmits(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendEmits);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject(comp)) {
- cache.set(comp, null);
- }
- return null;
- }
- if (isArray(raw)) {
- raw.forEach((key) => normalized[key] = null);
- } else {
- extend(normalized, raw);
- }
- if (isObject(comp)) {
- cache.set(comp, normalized);
- }
- return normalized;
- }
- function isEmitListener(options, key) {
- if (!options || !isOn(key)) {
- return false;
- }
- key = key.slice(2).replace(/Once$/, "");
- return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
- }
-
- let accessedAttrs = false;
- function markAttrsAccessed() {
- accessedAttrs = true;
- }
- function renderComponentRoot(instance) {
- const {
- type: Component,
- vnode,
- proxy,
- withProxy,
- propsOptions: [propsOptions],
- slots,
- attrs,
- emit,
- render,
- renderCache,
- props,
- data,
- setupState,
- ctx,
- inheritAttrs
- } = instance;
- const prev = setCurrentRenderingInstance(instance);
- let result;
- let fallthroughAttrs;
- {
- accessedAttrs = false;
- }
- try {
- if (vnode.shapeFlag & 4) {
- const proxyToUse = withProxy || proxy;
- const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
- get(target, key, receiver) {
- warn$1(
- `Property '${String(
- key
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
- );
- return Reflect.get(target, key, receiver);
- }
- }) : proxyToUse;
- result = normalizeVNode(
- render.call(
- thisProxy,
- proxyToUse,
- renderCache,
- true ? shallowReadonly(props) : props,
- setupState,
- data,
- ctx
- )
- );
- fallthroughAttrs = attrs;
- } else {
- const render2 = Component;
- if (attrs === props) {
- markAttrsAccessed();
- }
- result = normalizeVNode(
- render2.length > 1 ? render2(
- true ? shallowReadonly(props) : props,
- true ? {
- get attrs() {
- markAttrsAccessed();
- return shallowReadonly(attrs);
- },
- slots,
- emit
- } : { attrs, slots, emit }
- ) : render2(
- true ? shallowReadonly(props) : props,
- null
- )
- );
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
- }
- } catch (err) {
- blockStack.length = 0;
- handleError(err, instance, 1);
- result = createVNode(Comment);
- }
- let root = result;
- let setRoot = void 0;
- if (result.patchFlag > 0 && result.patchFlag & 2048) {
- [root, setRoot] = getChildRoot(result);
- }
- if (fallthroughAttrs && inheritAttrs !== false) {
- const keys = Object.keys(fallthroughAttrs);
- const { shapeFlag } = root;
- if (keys.length) {
- if (shapeFlag & (1 | 6)) {
- if (propsOptions && keys.some(isModelListener)) {
- fallthroughAttrs = filterModelListeners(
- fallthroughAttrs,
- propsOptions
- );
- }
- root = cloneVNode(root, fallthroughAttrs, false, true);
- } else if (!accessedAttrs && root.type !== Comment) {
- const allAttrs = Object.keys(attrs);
- const eventAttrs = [];
- const extraAttrs = [];
- for (let i = 0, l = allAttrs.length; i < l; i++) {
- const key = allAttrs[i];
- if (isOn(key)) {
- if (!isModelListener(key)) {
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
- }
- } else {
- extraAttrs.push(key);
- }
- }
- if (extraAttrs.length) {
- warn$1(
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
- );
- }
- if (eventAttrs.length) {
- warn$1(
- `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
- );
- }
- }
- }
- }
- if (vnode.dirs) {
- if (!isElementRoot(root)) {
- warn$1(
- `Runtime directive used on component with non-element root node. The directives will not function as intended.`
- );
- }
- root = cloneVNode(root, null, false, true);
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
- }
- if (vnode.transition) {
- if (!isElementRoot(root)) {
- warn$1(
- `Component inside <Transition> renders non-element root node that cannot be animated.`
- );
- }
- setTransitionHooks(root, vnode.transition);
- }
- if (setRoot) {
- setRoot(root);
- } else {
- result = root;
- }
- setCurrentRenderingInstance(prev);
- return result;
- }
- const getChildRoot = (vnode) => {
- const rawChildren = vnode.children;
- const dynamicChildren = vnode.dynamicChildren;
- const childRoot = filterSingleRoot(rawChildren, false);
- if (!childRoot) {
- return [vnode, void 0];
- } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
- return getChildRoot(childRoot);
- }
- const index = rawChildren.indexOf(childRoot);
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
- const setRoot = (updatedRoot) => {
- rawChildren[index] = updatedRoot;
- if (dynamicChildren) {
- if (dynamicIndex > -1) {
- dynamicChildren[dynamicIndex] = updatedRoot;
- } else if (updatedRoot.patchFlag > 0) {
- vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
- }
- }
- };
- return [normalizeVNode(childRoot), setRoot];
- };
- function filterSingleRoot(children, recurse = true) {
- let singleRoot;
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (isVNode(child)) {
- if (child.type !== Comment || child.children === "v-if") {
- if (singleRoot) {
- return;
- } else {
- singleRoot = child;
- if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
- return filterSingleRoot(singleRoot.children);
- }
- }
- }
- } else {
- return;
- }
- }
- return singleRoot;
- }
- const getFunctionalFallthrough = (attrs) => {
- let res;
- for (const key in attrs) {
- if (key === "class" || key === "style" || isOn(key)) {
- (res || (res = {}))[key] = attrs[key];
- }
- }
- return res;
- };
- const filterModelListeners = (attrs, props) => {
- const res = {};
- for (const key in attrs) {
- if (!isModelListener(key) || !(key.slice(9) in props)) {
- res[key] = attrs[key];
- }
- }
- return res;
- };
- const isElementRoot = (vnode) => {
- return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
- };
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
- const { props: prevProps, children: prevChildren, component } = prevVNode;
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
- const emits = component.emitsOptions;
- if ((prevChildren || nextChildren) && isHmrUpdating) {
- return true;
- }
- if (nextVNode.dirs || nextVNode.transition) {
- return true;
- }
- if (optimized && patchFlag >= 0) {
- if (patchFlag & 1024) {
- return true;
- }
- if (patchFlag & 16) {
- if (!prevProps) {
- return !!nextProps;
- }
- return hasPropsChanged(prevProps, nextProps, emits);
- } else if (patchFlag & 8) {
- const dynamicProps = nextVNode.dynamicProps;
- for (let i = 0; i < dynamicProps.length; i++) {
- const key = dynamicProps[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
- return true;
- }
- }
- }
- } else {
- if (prevChildren || nextChildren) {
- if (!nextChildren || !nextChildren.$stable) {
- return true;
- }
- }
- if (prevProps === nextProps) {
- return false;
- }
- if (!prevProps) {
- return !!nextProps;
- }
- if (!nextProps) {
- return true;
- }
- return hasPropsChanged(prevProps, nextProps, emits);
- }
- return false;
- }
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
- const nextKeys = Object.keys(nextProps);
- if (nextKeys.length !== Object.keys(prevProps).length) {
- return true;
- }
- for (let i = 0; i < nextKeys.length; i++) {
- const key = nextKeys[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
- return true;
- }
- }
- return false;
- }
- function updateHOCHostEl({ vnode, parent }, el) {
- while (parent) {
- const root = parent.subTree;
- if (root.suspense && root.suspense.activeBranch === vnode) {
- root.el = vnode.el;
- }
- if (root === vnode) {
- (vnode = parent.vnode).el = el;
- parent = parent.parent;
- } else {
- break;
- }
- }
- }
-
- const isSuspense = (type) => type.__isSuspense;
- let suspenseId = 0;
- const SuspenseImpl = {
- name: "Suspense",
- // In order to make Suspense tree-shakable, we need to avoid importing it
- // directly in the renderer. The renderer checks for the __isSuspense flag
- // on a vnode's type and calls the `process` method, passing in renderer
- // internals.
- __isSuspense: true,
- process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
- if (n1 == null) {
- mountSuspense(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
- } else {
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
- n2.suspense = n1.suspense;
- n2.suspense.vnode = n2;
- n2.el = n1.el;
- return;
- }
- patchSuspense(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
- }
- },
- hydrate: hydrateSuspense,
- normalize: normalizeSuspenseChildren
- };
- const Suspense = SuspenseImpl ;
- function triggerEvent(vnode, name) {
- const eventListener = vnode.props && vnode.props[name];
- if (isFunction(eventListener)) {
- eventListener();
- }
- }
- function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
- const {
- p: patch,
- o: { createElement }
- } = rendererInternals;
- const hiddenContainer = createElement("div");
- const suspense = vnode.suspense = createSuspenseBoundary(
- vnode,
- parentSuspense,
- parentComponent,
- container,
- hiddenContainer,
- anchor,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
- patch(
- null,
- suspense.pendingBranch = vnode.ssContent,
- hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds
- );
- if (suspense.deps > 0) {
- triggerEvent(vnode, "onPending");
- triggerEvent(vnode, "onFallback");
- patch(
- null,
- vnode.ssFallback,
- container,
- anchor,
- parentComponent,
- null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds
- );
- setActiveBranch(suspense, vnode.ssFallback);
- } else {
- suspense.resolve(false, true);
- }
- }
- function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
- const suspense = n2.suspense = n1.suspense;
- suspense.vnode = n2;
- n2.el = n1.el;
- const newBranch = n2.ssContent;
- const newFallback = n2.ssFallback;
- const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
- if (pendingBranch) {
- suspense.pendingBranch = newBranch;
- if (isSameVNodeType(newBranch, pendingBranch)) {
- patch(
- pendingBranch,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- } else if (isInFallback) {
- if (!isHydrating) {
- patch(
- activeBranch,
- newFallback,
- container,
- anchor,
- parentComponent,
- null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newFallback);
- }
- }
- } else {
- suspense.pendingId = suspenseId++;
- if (isHydrating) {
- suspense.isHydrating = false;
- suspense.activeBranch = pendingBranch;
- } else {
- unmount(pendingBranch, parentComponent, suspense);
- }
- suspense.deps = 0;
- suspense.effects.length = 0;
- suspense.hiddenContainer = createElement("div");
- if (isInFallback) {
- patch(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- } else {
- patch(
- activeBranch,
- newFallback,
- container,
- anchor,
- parentComponent,
- null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newFallback);
- }
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
- patch(
- activeBranch,
- newBranch,
- container,
- anchor,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- suspense.resolve(true);
- } else {
- patch(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- }
- }
- }
- } else {
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
- patch(
- activeBranch,
- newBranch,
- container,
- anchor,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newBranch);
- } else {
- triggerEvent(n2, "onPending");
- suspense.pendingBranch = newBranch;
- if (newBranch.shapeFlag & 512) {
- suspense.pendingId = newBranch.component.suspenseId;
- } else {
- suspense.pendingId = suspenseId++;
- }
- patch(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- } else {
- const { timeout, pendingId } = suspense;
- if (timeout > 0) {
- setTimeout(() => {
- if (suspense.pendingId === pendingId) {
- suspense.fallback(newFallback);
- }
- }, timeout);
- } else if (timeout === 0) {
- suspense.fallback(newFallback);
- }
- }
- }
- }
- }
- let hasWarned = false;
- function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
- if (!hasWarned) {
- hasWarned = true;
- console[console.info ? "info" : "log"](
- `<Suspense> is an experimental feature and its API will likely change.`
- );
- }
- const {
- p: patch,
- m: move,
- um: unmount,
- n: next,
- o: { parentNode, remove }
- } = rendererInternals;
- let parentSuspenseId;
- const isSuspensible = isVNodeSuspensible(vnode);
- if (isSuspensible) {
- if (parentSuspense && parentSuspense.pendingBranch) {
- parentSuspenseId = parentSuspense.pendingId;
- parentSuspense.deps++;
- }
- }
- const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
- {
- assertNumber(timeout, `Suspense timeout`);
- }
- const initialAnchor = anchor;
- const suspense = {
- vnode,
- parent: parentSuspense,
- parentComponent,
- namespace,
- container,
- hiddenContainer,
- deps: 0,
- pendingId: suspenseId++,
- timeout: typeof timeout === "number" ? timeout : -1,
- activeBranch: null,
- pendingBranch: null,
- isInFallback: !isHydrating,
- isHydrating,
- isUnmounted: false,
- effects: [],
- resolve(resume = false, sync = false) {
- {
- if (!resume && !suspense.pendingBranch) {
- throw new Error(
- `suspense.resolve() is called without a pending branch.`
- );
- }
- if (suspense.isUnmounted) {
- throw new Error(
- `suspense.resolve() is called on an already unmounted suspense boundary.`
- );
- }
- }
- const {
- vnode: vnode2,
- activeBranch,
- pendingBranch,
- pendingId,
- effects,
- parentComponent: parentComponent2,
- container: container2
- } = suspense;
- let delayEnter = false;
- if (suspense.isHydrating) {
- suspense.isHydrating = false;
- } else if (!resume) {
- delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
- if (delayEnter) {
- activeBranch.transition.afterLeave = () => {
- if (pendingId === suspense.pendingId) {
- move(
- pendingBranch,
- container2,
- anchor === initialAnchor ? next(activeBranch) : anchor,
- 0
- );
- queuePostFlushCb(effects);
- }
- };
- }
- if (activeBranch) {
- if (parentNode(activeBranch.el) === container2) {
- anchor = next(activeBranch);
- }
- unmount(activeBranch, parentComponent2, suspense, true);
- }
- if (!delayEnter) {
- move(pendingBranch, container2, anchor, 0);
- }
- }
- setActiveBranch(suspense, pendingBranch);
- suspense.pendingBranch = null;
- suspense.isInFallback = false;
- let parent = suspense.parent;
- let hasUnresolvedAncestor = false;
- while (parent) {
- if (parent.pendingBranch) {
- parent.effects.push(...effects);
- hasUnresolvedAncestor = true;
- break;
- }
- parent = parent.parent;
- }
- if (!hasUnresolvedAncestor && !delayEnter) {
- queuePostFlushCb(effects);
- }
- suspense.effects = [];
- if (isSuspensible) {
- if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
- parentSuspense.deps--;
- if (parentSuspense.deps === 0 && !sync) {
- parentSuspense.resolve();
- }
- }
- }
- triggerEvent(vnode2, "onResolve");
- },
- fallback(fallbackVNode) {
- if (!suspense.pendingBranch) {
- return;
- }
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
- triggerEvent(vnode2, "onFallback");
- const anchor2 = next(activeBranch);
- const mountFallback = () => {
- if (!suspense.isInFallback) {
- return;
- }
- patch(
- null,
- fallbackVNode,
- container2,
- anchor2,
- parentComponent2,
- null,
- // fallback tree will not have suspense context
- namespace2,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, fallbackVNode);
- };
- const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
- if (delayEnter) {
- activeBranch.transition.afterLeave = mountFallback;
- }
- suspense.isInFallback = true;
- unmount(
- activeBranch,
- parentComponent2,
- null,
- // no suspense so unmount hooks fire now
- true
- // shouldRemove
- );
- if (!delayEnter) {
- mountFallback();
- }
- },
- move(container2, anchor2, type) {
- suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
- suspense.container = container2;
- },
- next() {
- return suspense.activeBranch && next(suspense.activeBranch);
- },
- registerDep(instance, setupRenderEffect, optimized2) {
- const isInPendingSuspense = !!suspense.pendingBranch;
- if (isInPendingSuspense) {
- suspense.deps++;
- }
- const hydratedEl = instance.vnode.el;
- instance.asyncDep.catch((err) => {
- handleError(err, instance, 0);
- }).then((asyncSetupResult) => {
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
- return;
- }
- instance.asyncResolved = true;
- const { vnode: vnode2 } = instance;
- {
- pushWarningContext(vnode2);
- }
- handleSetupResult(instance, asyncSetupResult, false);
- if (hydratedEl) {
- vnode2.el = hydratedEl;
- }
- const placeholder = !hydratedEl && instance.subTree.el;
- setupRenderEffect(
- instance,
- vnode2,
- // component may have been moved before resolve.
- // if this is not a hydration, instance.subTree will be the comment
- // placeholder.
- parentNode(hydratedEl || instance.subTree.el),
- // anchor will not be used if this is hydration, so only need to
- // consider the comment placeholder case.
- hydratedEl ? null : next(instance.subTree),
- suspense,
- namespace,
- optimized2
- );
- if (placeholder) {
- remove(placeholder);
- }
- updateHOCHostEl(instance, vnode2.el);
- {
- popWarningContext();
- }
- if (isInPendingSuspense && --suspense.deps === 0) {
- suspense.resolve();
- }
- });
- },
- unmount(parentSuspense2, doRemove) {
- suspense.isUnmounted = true;
- if (suspense.activeBranch) {
- unmount(
- suspense.activeBranch,
- parentComponent,
- parentSuspense2,
- doRemove
- );
- }
- if (suspense.pendingBranch) {
- unmount(
- suspense.pendingBranch,
- parentComponent,
- parentSuspense2,
- doRemove
- );
- }
- }
- };
- return suspense;
- }
- function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
- const suspense = vnode.suspense = createSuspenseBoundary(
- vnode,
- parentSuspense,
- parentComponent,
- node.parentNode,
- // eslint-disable-next-line no-restricted-globals
- document.createElement("div"),
- null,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals,
- true
- );
- const result = hydrateNode(
- node,
- suspense.pendingBranch = vnode.ssContent,
- parentComponent,
- suspense,
- slotScopeIds,
- optimized
- );
- if (suspense.deps === 0) {
- suspense.resolve(false, true);
- }
- return result;
- }
- function normalizeSuspenseChildren(vnode) {
- const { shapeFlag, children } = vnode;
- const isSlotChildren = shapeFlag & 32;
- vnode.ssContent = normalizeSuspenseSlot(
- isSlotChildren ? children.default : children
- );
- vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
- }
- function normalizeSuspenseSlot(s) {
- let block;
- if (isFunction(s)) {
- const trackBlock = isBlockTreeEnabled && s._c;
- if (trackBlock) {
- s._d = false;
- openBlock();
- }
- s = s();
- if (trackBlock) {
- s._d = true;
- block = currentBlock;
- closeBlock();
- }
- }
- if (isArray(s)) {
- const singleChild = filterSingleRoot(s);
- if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
- warn$1(`<Suspense> slots expect a single root node.`);
- }
- s = singleChild;
- }
- s = normalizeVNode(s);
- if (block && !s.dynamicChildren) {
- s.dynamicChildren = block.filter((c) => c !== s);
- }
- return s;
- }
- function queueEffectWithSuspense(fn, suspense) {
- if (suspense && suspense.pendingBranch) {
- if (isArray(fn)) {
- suspense.effects.push(...fn);
- } else {
- suspense.effects.push(fn);
- }
- } else {
- queuePostFlushCb(fn);
- }
- }
- function setActiveBranch(suspense, branch) {
- suspense.activeBranch = branch;
- const { vnode, parentComponent } = suspense;
- let el = branch.el;
- while (!el && branch.component) {
- branch = branch.component.subTree;
- el = branch.el;
- }
- vnode.el = el;
- if (parentComponent && parentComponent.subTree === vnode) {
- parentComponent.vnode.el = el;
- updateHOCHostEl(parentComponent, el);
- }
- }
- function isVNodeSuspensible(vnode) {
- const suspensible = vnode.props && vnode.props.suspensible;
- return suspensible != null && suspensible !== false;
- }
-
- const Fragment = Symbol.for("v-fgt");
- const Text = Symbol.for("v-txt");
- const Comment = Symbol.for("v-cmt");
- const Static = Symbol.for("v-stc");
- const blockStack = [];
- let currentBlock = null;
- function openBlock(disableTracking = false) {
- blockStack.push(currentBlock = disableTracking ? null : []);
- }
- function closeBlock() {
- blockStack.pop();
- currentBlock = blockStack[blockStack.length - 1] || null;
- }
- let isBlockTreeEnabled = 1;
- function setBlockTracking(value, inVOnce = false) {
- isBlockTreeEnabled += value;
- if (value < 0 && currentBlock && inVOnce) {
- currentBlock.hasOnce = true;
- }
- }
- function setupBlock(vnode) {
- vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
- closeBlock();
- if (isBlockTreeEnabled > 0 && currentBlock) {
- currentBlock.push(vnode);
- }
- return vnode;
- }
- function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
- return setupBlock(
- createBaseVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- shapeFlag,
- true
- )
- );
- }
- function createBlock(type, props, children, patchFlag, dynamicProps) {
- return setupBlock(
- createVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- true
- )
- );
- }
- function isVNode(value) {
- return value ? value.__v_isVNode === true : false;
- }
- function isSameVNodeType(n1, n2) {
- if (n2.shapeFlag & 6 && n1.component) {
- const dirtyInstances = hmrDirtyComponents.get(n2.type);
- if (dirtyInstances && dirtyInstances.has(n1.component)) {
- n1.shapeFlag &= ~256;
- n2.shapeFlag &= ~512;
- return false;
- }
- }
- return n1.type === n2.type && n1.key === n2.key;
- }
- let vnodeArgsTransformer;
- function transformVNodeArgs(transformer) {
- vnodeArgsTransformer = transformer;
- }
- const createVNodeWithArgsTransform = (...args) => {
- return _createVNode(
- ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
- );
- };
- const normalizeKey = ({ key }) => key != null ? key : null;
- const normalizeRef = ({
- ref,
- ref_key,
- ref_for
- }) => {
- if (typeof ref === "number") {
- ref = "" + ref;
- }
- return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
- };
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
- const vnode = {
- __v_isVNode: true,
- __v_skip: true,
- type,
- props,
- key: props && normalizeKey(props),
- ref: props && normalizeRef(props),
- scopeId: currentScopeId,
- slotScopeIds: null,
- children,
- component: null,
- suspense: null,
- ssContent: null,
- ssFallback: null,
- dirs: null,
- transition: null,
- el: null,
- anchor: null,
- target: null,
- targetStart: null,
- targetAnchor: null,
- staticCount: 0,
- shapeFlag,
- patchFlag,
- dynamicProps,
- dynamicChildren: null,
- appContext: null,
- ctx: currentRenderingInstance
- };
- if (needFullChildrenNormalization) {
- normalizeChildren(vnode, children);
- if (shapeFlag & 128) {
- type.normalize(vnode);
- }
- } else if (children) {
- vnode.shapeFlag |= isString(children) ? 8 : 16;
- }
- if (vnode.key !== vnode.key) {
- warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
- }
- if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
- !isBlockNode && // has current parent block
- currentBlock && // presence of a patch flag indicates this node needs patching on updates.
- // component nodes also should always be patched, because even if the
- // component doesn't need to update, it needs to persist the instance on to
- // the next vnode so that it can be properly unmounted later.
- (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
- // vnode should not be considered dynamic due to handler caching.
- vnode.patchFlag !== 32) {
- currentBlock.push(vnode);
- }
- return vnode;
- }
- const createVNode = createVNodeWithArgsTransform ;
- function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
- if (!type || type === NULL_DYNAMIC_COMPONENT) {
- if (!type) {
- warn$1(`Invalid vnode type when creating vnode: ${type}.`);
- }
- type = Comment;
- }
- if (isVNode(type)) {
- const cloned = cloneVNode(
- type,
- props,
- true
- /* mergeRef: true */
- );
- if (children) {
- normalizeChildren(cloned, children);
- }
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
- if (cloned.shapeFlag & 6) {
- currentBlock[currentBlock.indexOf(type)] = cloned;
- } else {
- currentBlock.push(cloned);
- }
- }
- cloned.patchFlag = -2;
- return cloned;
- }
- if (isClassComponent(type)) {
- type = type.__vccOpts;
- }
- if (props) {
- props = guardReactiveProps(props);
- let { class: klass, style } = props;
- if (klass && !isString(klass)) {
- props.class = normalizeClass(klass);
- }
- if (isObject(style)) {
- if (isProxy(style) && !isArray(style)) {
- style = extend({}, style);
- }
- props.style = normalizeStyle(style);
- }
- }
- const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
- if (shapeFlag & 4 && isProxy(type)) {
- type = toRaw(type);
- warn$1(
- `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
- `
-Component that was made reactive: `,
- type
- );
- }
- return createBaseVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- shapeFlag,
- isBlockNode,
- true
- );
- }
- function guardReactiveProps(props) {
- if (!props) return null;
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
- }
- function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
- const { props, ref, patchFlag, children, transition } = vnode;
- const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
- const cloned = {
- __v_isVNode: true,
- __v_skip: true,
- type: vnode.type,
- props: mergedProps,
- key: mergedProps && normalizeKey(mergedProps),
- ref: extraProps && extraProps.ref ? (
- // #2078 in the case of <component :is="vnode" ref="extra"/>
- // if the vnode itself already has a ref, cloneVNode will need to merge
- // the refs so the single vnode can be set on multiple refs
- mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
- ) : ref,
- scopeId: vnode.scopeId,
- slotScopeIds: vnode.slotScopeIds,
- children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
- target: vnode.target,
- targetStart: vnode.targetStart,
- targetAnchor: vnode.targetAnchor,
- staticCount: vnode.staticCount,
- shapeFlag: vnode.shapeFlag,
- // if the vnode is cloned with extra props, we can no longer assume its
- // existing patch flag to be reliable and need to add the FULL_PROPS flag.
- // note: preserve flag for fragments since they use the flag for children
- // fast paths only.
- patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
- dynamicProps: vnode.dynamicProps,
- dynamicChildren: vnode.dynamicChildren,
- appContext: vnode.appContext,
- dirs: vnode.dirs,
- transition,
- // These should technically only be non-null on mounted VNodes. However,
- // they *should* be copied for kept-alive vnodes. So we just always copy
- // them since them being non-null during a mount doesn't affect the logic as
- // they will simply be overwritten.
- component: vnode.component,
- suspense: vnode.suspense,
- ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
- ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
- el: vnode.el,
- anchor: vnode.anchor,
- ctx: vnode.ctx,
- ce: vnode.ce
- };
- if (transition && cloneTransition) {
- setTransitionHooks(
- cloned,
- transition.clone(cloned)
- );
- }
- return cloned;
- }
- function deepCloneVNode(vnode) {
- const cloned = cloneVNode(vnode);
- if (isArray(vnode.children)) {
- cloned.children = vnode.children.map(deepCloneVNode);
- }
- return cloned;
- }
- function createTextVNode(text = " ", flag = 0) {
- return createVNode(Text, null, text, flag);
- }
- function createStaticVNode(content, numberOfNodes) {
- const vnode = createVNode(Static, null, content);
- vnode.staticCount = numberOfNodes;
- return vnode;
- }
- function createCommentVNode(text = "", asBlock = false) {
- return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
- }
- function normalizeVNode(child) {
- if (child == null || typeof child === "boolean") {
- return createVNode(Comment);
- } else if (isArray(child)) {
- return createVNode(
- Fragment,
- null,
- // #3666, avoid reference pollution when reusing vnode
- child.slice()
- );
- } else if (isVNode(child)) {
- return cloneIfMounted(child);
- } else {
- return createVNode(Text, null, String(child));
- }
- }
- function cloneIfMounted(child) {
- return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
- }
- function normalizeChildren(vnode, children) {
- let type = 0;
- const { shapeFlag } = vnode;
- if (children == null) {
- children = null;
- } else if (isArray(children)) {
- type = 16;
- } else if (typeof children === "object") {
- if (shapeFlag & (1 | 64)) {
- const slot = children.default;
- if (slot) {
- slot._c && (slot._d = false);
- normalizeChildren(vnode, slot());
- slot._c && (slot._d = true);
- }
- return;
- } else {
- type = 32;
- const slotFlag = children._;
- if (!slotFlag && !isInternalObject(children)) {
- children._ctx = currentRenderingInstance;
- } else if (slotFlag === 3 && currentRenderingInstance) {
- if (currentRenderingInstance.slots._ === 1) {
- children._ = 1;
- } else {
- children._ = 2;
- vnode.patchFlag |= 1024;
- }
- }
- }
- } else if (isFunction(children)) {
- children = { default: children, _ctx: currentRenderingInstance };
- type = 32;
- } else {
- children = String(children);
- if (shapeFlag & 64) {
- type = 16;
- children = [createTextVNode(children)];
- } else {
- type = 8;
- }
- }
- vnode.children = children;
- vnode.shapeFlag |= type;
- }
- function mergeProps(...args) {
- const ret = {};
- for (let i = 0; i < args.length; i++) {
- const toMerge = args[i];
- for (const key in toMerge) {
- if (key === "class") {
- if (ret.class !== toMerge.class) {
- ret.class = normalizeClass([ret.class, toMerge.class]);
- }
- } else if (key === "style") {
- ret.style = normalizeStyle([ret.style, toMerge.style]);
- } else if (isOn(key)) {
- const existing = ret[key];
- const incoming = toMerge[key];
- if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
- ret[key] = existing ? [].concat(existing, incoming) : incoming;
- }
- } else if (key !== "") {
- ret[key] = toMerge[key];
- }
- }
- }
- return ret;
- }
- function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
- callWithAsyncErrorHandling(hook, instance, 7, [
- vnode,
- prevVNode
- ]);
- }
-
- const emptyAppContext = createAppContext();
- let uid = 0;
- function createComponentInstance(vnode, parent, suspense) {
- const type = vnode.type;
- const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
- const instance = {
- uid: uid++,
- vnode,
- type,
- parent,
- appContext,
- root: null,
- // to be immediately set
- next: null,
- subTree: null,
- // will be set synchronously right after creation
- effect: null,
- update: null,
- // will be set synchronously right after creation
- job: null,
- scope: new EffectScope(
- true
- /* detached */
- ),
- render: null,
- proxy: null,
- exposed: null,
- exposeProxy: null,
- withProxy: null,
- provides: parent ? parent.provides : Object.create(appContext.provides),
- ids: parent ? parent.ids : ["", 0, 0],
- accessCache: null,
- renderCache: [],
- // local resolved assets
- components: null,
- directives: null,
- // resolved props and emits options
- propsOptions: normalizePropsOptions(type, appContext),
- emitsOptions: normalizeEmitsOptions(type, appContext),
- // emit
- emit: null,
- // to be set immediately
- emitted: null,
- // props default value
- propsDefaults: EMPTY_OBJ,
- // inheritAttrs
- inheritAttrs: type.inheritAttrs,
- // state
- ctx: EMPTY_OBJ,
- data: EMPTY_OBJ,
- props: EMPTY_OBJ,
- attrs: EMPTY_OBJ,
- slots: EMPTY_OBJ,
- refs: EMPTY_OBJ,
- setupState: EMPTY_OBJ,
- setupContext: null,
- // suspense related
- suspense,
- suspenseId: suspense ? suspense.pendingId : 0,
- asyncDep: null,
- asyncResolved: false,
- // lifecycle hooks
- // not using enums here because it results in computed properties
- isMounted: false,
- isUnmounted: false,
- isDeactivated: false,
- bc: null,
- c: null,
- bm: null,
- m: null,
- bu: null,
- u: null,
- um: null,
- bum: null,
- da: null,
- a: null,
- rtg: null,
- rtc: null,
- ec: null,
- sp: null
- };
- {
- instance.ctx = createDevRenderContext(instance);
- }
- instance.root = parent ? parent.root : instance;
- instance.emit = emit.bind(null, instance);
- if (vnode.ce) {
- vnode.ce(instance);
- }
- return instance;
- }
- let currentInstance = null;
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
- let internalSetCurrentInstance;
- let setInSSRSetupState;
- {
- internalSetCurrentInstance = (i) => {
- currentInstance = i;
- };
- setInSSRSetupState = (v) => {
- isInSSRComponentSetup = v;
- };
- }
- const setCurrentInstance = (instance) => {
- const prev = currentInstance;
- internalSetCurrentInstance(instance);
- instance.scope.on();
- return () => {
- instance.scope.off();
- internalSetCurrentInstance(prev);
- };
- };
- const unsetCurrentInstance = () => {
- currentInstance && currentInstance.scope.off();
- internalSetCurrentInstance(null);
- };
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
- function validateComponentName(name, { isNativeTag }) {
- if (isBuiltInTag(name) || isNativeTag(name)) {
- warn$1(
- "Do not use built-in or reserved HTML elements as component id: " + name
- );
- }
- }
- function isStatefulComponent(instance) {
- return instance.vnode.shapeFlag & 4;
- }
- let isInSSRComponentSetup = false;
- function setupComponent(instance, isSSR = false, optimized = false) {
- isSSR && setInSSRSetupState(isSSR);
- const { props, children } = instance.vnode;
- const isStateful = isStatefulComponent(instance);
- initProps(instance, props, isStateful, isSSR);
- initSlots(instance, children, optimized);
- const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
- isSSR && setInSSRSetupState(false);
- return setupResult;
- }
- function setupStatefulComponent(instance, isSSR) {
- var _a;
- const Component = instance.type;
- {
- if (Component.name) {
- validateComponentName(Component.name, instance.appContext.config);
- }
- if (Component.components) {
- const names = Object.keys(Component.components);
- for (let i = 0; i < names.length; i++) {
- validateComponentName(names[i], instance.appContext.config);
- }
- }
- if (Component.directives) {
- const names = Object.keys(Component.directives);
- for (let i = 0; i < names.length; i++) {
- validateDirectiveName(names[i]);
- }
- }
- if (Component.compilerOptions && isRuntimeOnly()) {
- warn$1(
- `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
- );
- }
- }
- instance.accessCache = /* @__PURE__ */ Object.create(null);
- instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
- {
- exposePropsOnRenderContext(instance);
- }
- const { setup } = Component;
- if (setup) {
- pauseTracking();
- const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
- const reset = setCurrentInstance(instance);
- const setupResult = callWithErrorHandling(
- setup,
- instance,
- 0,
- [
- shallowReadonly(instance.props) ,
- setupContext
- ]
- );
- const isAsyncSetup = isPromise(setupResult);
- resetTracking();
- reset();
- if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
- markAsyncBoundary(instance);
- }
- if (isAsyncSetup) {
- setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
- if (isSSR) {
- return setupResult.then((resolvedResult) => {
- handleSetupResult(instance, resolvedResult, isSSR);
- }).catch((e) => {
- handleError(e, instance, 0);
- });
- } else {
- instance.asyncDep = setupResult;
- if (!instance.suspense) {
- const name = (_a = Component.name) != null ? _a : "Anonymous";
- warn$1(
- `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
- );
- }
- }
- } else {
- handleSetupResult(instance, setupResult, isSSR);
- }
- } else {
- finishComponentSetup(instance, isSSR);
- }
- }
- function handleSetupResult(instance, setupResult, isSSR) {
- if (isFunction(setupResult)) {
- {
- instance.render = setupResult;
- }
- } else if (isObject(setupResult)) {
- if (isVNode(setupResult)) {
- warn$1(
- `setup() should not return VNodes directly - return a render function instead.`
- );
- }
- {
- instance.devtoolsRawSetupState = setupResult;
- }
- instance.setupState = proxyRefs(setupResult);
- {
- exposeSetupStateOnRenderContext(instance);
- }
- } else if (setupResult !== void 0) {
- warn$1(
- `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
- );
- }
- finishComponentSetup(instance, isSSR);
- }
- let compile$1;
- let installWithProxy;
- function registerRuntimeCompiler(_compile) {
- compile$1 = _compile;
- installWithProxy = (i) => {
- if (i.render._rc) {
- i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
- }
- };
- }
- const isRuntimeOnly = () => !compile$1;
- function finishComponentSetup(instance, isSSR, skipOptions) {
- const Component = instance.type;
- if (!instance.render) {
- if (!isSSR && compile$1 && !Component.render) {
- const template = Component.template || resolveMergedOptions(instance).template;
- if (template) {
- {
- startMeasure(instance, `compile`);
- }
- const { isCustomElement, compilerOptions } = instance.appContext.config;
- const { delimiters, compilerOptions: componentCompilerOptions } = Component;
- const finalCompilerOptions = extend(
- extend(
- {
- isCustomElement,
- delimiters
- },
- compilerOptions
- ),
- componentCompilerOptions
- );
- Component.render = compile$1(template, finalCompilerOptions);
- {
- endMeasure(instance, `compile`);
- }
- }
- }
- instance.render = Component.render || NOOP;
- if (installWithProxy) {
- installWithProxy(instance);
- }
- }
- {
- const reset = setCurrentInstance(instance);
- pauseTracking();
- try {
- applyOptions(instance);
- } finally {
- resetTracking();
- reset();
- }
- }
- if (!Component.render && instance.render === NOOP && !isSSR) {
- if (!compile$1 && Component.template) {
- warn$1(
- `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
- );
- } else {
- warn$1(`Component is missing template or render function: `, Component);
- }
- }
- }
- const attrsProxyHandlers = {
- get(target, key) {
- markAttrsAccessed();
- track(target, "get", "");
- return target[key];
- },
- set() {
- warn$1(`setupContext.attrs is readonly.`);
- return false;
- },
- deleteProperty() {
- warn$1(`setupContext.attrs is readonly.`);
- return false;
- }
- } ;
- function getSlotsProxy(instance) {
- return new Proxy(instance.slots, {
- get(target, key) {
- track(instance, "get", "$slots");
- return target[key];
- }
- });
- }
- function createSetupContext(instance) {
- const expose = (exposed) => {
- {
- if (instance.exposed) {
- warn$1(`expose() should be called only once per setup().`);
- }
- if (exposed != null) {
- let exposedType = typeof exposed;
- if (exposedType === "object") {
- if (isArray(exposed)) {
- exposedType = "array";
- } else if (isRef(exposed)) {
- exposedType = "ref";
- }
- }
- if (exposedType !== "object") {
- warn$1(
- `expose() should be passed a plain object, received ${exposedType}.`
- );
- }
- }
- }
- instance.exposed = exposed || {};
- };
- {
- let attrsProxy;
- let slotsProxy;
- return Object.freeze({
- get attrs() {
- return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
- },
- get slots() {
- return slotsProxy || (slotsProxy = getSlotsProxy(instance));
- },
- get emit() {
- return (event, ...args) => instance.emit(event, ...args);
- },
- expose
- });
- }
- }
- function getComponentPublicInstance(instance) {
- if (instance.exposed) {
- return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
- get(target, key) {
- if (key in target) {
- return target[key];
- } else if (key in publicPropertiesMap) {
- return publicPropertiesMap[key](instance);
- }
- },
- has(target, key) {
- return key in target || key in publicPropertiesMap;
- }
- }));
- } else {
- return instance.proxy;
- }
- }
- const classifyRE = /(?:^|[-_])(\w)/g;
- const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
- function getComponentName(Component, includeInferred = true) {
- return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
- }
- function formatComponentName(instance, Component, isRoot = false) {
- let name = getComponentName(Component);
- if (!name && Component.__file) {
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
- if (match) {
- name = match[1];
- }
- }
- if (!name && instance && instance.parent) {
- const inferFromRegistry = (registry) => {
- for (const key in registry) {
- if (registry[key] === Component) {
- return key;
- }
- }
- };
- name = inferFromRegistry(
- instance.components || instance.parent.type.components
- ) || inferFromRegistry(instance.appContext.components);
- }
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
- }
- function isClassComponent(value) {
- return isFunction(value) && "__vccOpts" in value;
- }
-
- const computed = (getterOrOptions, debugOptions) => {
- const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
- {
- const i = getCurrentInstance();
- if (i && i.appContext.config.warnRecursiveComputed) {
- c._warnRecursive = true;
- }
- }
- return c;
- };
-
- function h(type, propsOrChildren, children) {
- const l = arguments.length;
- if (l === 2) {
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
- if (isVNode(propsOrChildren)) {
- return createVNode(type, null, [propsOrChildren]);
- }
- return createVNode(type, propsOrChildren);
- } else {
- return createVNode(type, null, propsOrChildren);
- }
- } else {
- if (l > 3) {
- children = Array.prototype.slice.call(arguments, 2);
- } else if (l === 3 && isVNode(children)) {
- children = [children];
- }
- return createVNode(type, propsOrChildren, children);
- }
- }
-
- function initCustomFormatter() {
- if (typeof window === "undefined") {
- return;
- }
- const vueStyle = { style: "color:#3ba776" };
- const numberStyle = { style: "color:#1677ff" };
- const stringStyle = { style: "color:#f5222d" };
- const keywordStyle = { style: "color:#eb2f96" };
- const formatter = {
- __vue_custom_formatter: true,
- header(obj) {
- if (!isObject(obj)) {
- return null;
- }
- if (obj.__isVue) {
- return ["div", vueStyle, `VueInstance`];
- } else if (isRef(obj)) {
- return [
- "div",
- {},
- ["span", vueStyle, genRefFlag(obj)],
- "<",
- // avoid debugger accessing value affecting behavior
- formatValue("_value" in obj ? obj._value : obj),
- `>`
- ];
- } else if (isReactive(obj)) {
- return [
- "div",
- {},
- ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
- "<",
- formatValue(obj),
- `>${isReadonly(obj) ? ` (readonly)` : ``}`
- ];
- } else if (isReadonly(obj)) {
- return [
- "div",
- {},
- ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
- "<",
- formatValue(obj),
- ">"
- ];
- }
- return null;
- },
- hasBody(obj) {
- return obj && obj.__isVue;
- },
- body(obj) {
- if (obj && obj.__isVue) {
- return [
- "div",
- {},
- ...formatInstance(obj.$)
- ];
- }
- }
- };
- function formatInstance(instance) {
- const blocks = [];
- if (instance.type.props && instance.props) {
- blocks.push(createInstanceBlock("props", toRaw(instance.props)));
- }
- if (instance.setupState !== EMPTY_OBJ) {
- blocks.push(createInstanceBlock("setup", instance.setupState));
- }
- if (instance.data !== EMPTY_OBJ) {
- blocks.push(createInstanceBlock("data", toRaw(instance.data)));
- }
- const computed = extractKeys(instance, "computed");
- if (computed) {
- blocks.push(createInstanceBlock("computed", computed));
- }
- const injected = extractKeys(instance, "inject");
- if (injected) {
- blocks.push(createInstanceBlock("injected", injected));
- }
- blocks.push([
- "div",
- {},
- [
- "span",
- {
- style: keywordStyle.style + ";opacity:0.66"
- },
- "$ (internal): "
- ],
- ["object", { object: instance }]
- ]);
- return blocks;
- }
- function createInstanceBlock(type, target) {
- target = extend({}, target);
- if (!Object.keys(target).length) {
- return ["span", {}];
- }
- return [
- "div",
- { style: "line-height:1.25em;margin-bottom:0.6em" },
- [
- "div",
- {
- style: "color:#476582"
- },
- type
- ],
- [
- "div",
- {
- style: "padding-left:1.25em"
- },
- ...Object.keys(target).map((key) => {
- return [
- "div",
- {},
- ["span", keywordStyle, key + ": "],
- formatValue(target[key], false)
- ];
- })
- ]
- ];
- }
- function formatValue(v, asRaw = true) {
- if (typeof v === "number") {
- return ["span", numberStyle, v];
- } else if (typeof v === "string") {
- return ["span", stringStyle, JSON.stringify(v)];
- } else if (typeof v === "boolean") {
- return ["span", keywordStyle, v];
- } else if (isObject(v)) {
- return ["object", { object: asRaw ? toRaw(v) : v }];
- } else {
- return ["span", stringStyle, String(v)];
- }
- }
- function extractKeys(instance, type) {
- const Comp = instance.type;
- if (isFunction(Comp)) {
- return;
- }
- const extracted = {};
- for (const key in instance.ctx) {
- if (isKeyOfType(Comp, key, type)) {
- extracted[key] = instance.ctx[key];
- }
- }
- return extracted;
- }
- function isKeyOfType(Comp, key, type) {
- const opts = Comp[type];
- if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
- return true;
- }
- if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
- return true;
- }
- if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
- return true;
- }
- }
- function genRefFlag(v) {
- if (isShallow(v)) {
- return `ShallowRef`;
- }
- if (v.effect) {
- return `ComputedRef`;
- }
- return `Ref`;
- }
- if (window.devtoolsFormatters) {
- window.devtoolsFormatters.push(formatter);
- } else {
- window.devtoolsFormatters = [formatter];
- }
- }
-
- function withMemo(memo, render, cache, index) {
- const cached = cache[index];
- if (cached && isMemoSame(cached, memo)) {
- return cached;
- }
- const ret = render();
- ret.memo = memo.slice();
- ret.cacheIndex = index;
- return cache[index] = ret;
- }
- function isMemoSame(cached, memo) {
- const prev = cached.memo;
- if (prev.length != memo.length) {
- return false;
- }
- for (let i = 0; i < prev.length; i++) {
- if (hasChanged(prev[i], memo[i])) {
- return false;
- }
- }
- if (isBlockTreeEnabled > 0 && currentBlock) {
- currentBlock.push(cached);
- }
- return true;
- }
-
- const version = "3.5.13";
- const warn = warn$1 ;
- const ErrorTypeStrings = ErrorTypeStrings$1 ;
- const devtools = devtools$1 ;
- const setDevtoolsHook = setDevtoolsHook$1 ;
- const ssrUtils = null;
- const resolveFilter = null;
- const compatUtils = null;
- const DeprecationTypes = null;
-
- let policy = void 0;
- const tt = typeof window !== "undefined" && window.trustedTypes;
- if (tt) {
- try {
- policy = /* @__PURE__ */ tt.createPolicy("vue", {
- createHTML: (val) => val
- });
- } catch (e) {
- warn(`Error creating trusted types policy: ${e}`);
- }
- }
- const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
- const svgNS = "http://www.w3.org/2000/svg";
- const mathmlNS = "http://www.w3.org/1998/Math/MathML";
- const doc = typeof document !== "undefined" ? document : null;
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
- const nodeOps = {
- insert: (child, parent, anchor) => {
- parent.insertBefore(child, anchor || null);
- },
- remove: (child) => {
- const parent = child.parentNode;
- if (parent) {
- parent.removeChild(child);
- }
- },
- createElement: (tag, namespace, is, props) => {
- const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
- if (tag === "select" && props && props.multiple != null) {
- el.setAttribute("multiple", props.multiple);
- }
- return el;
- },
- createText: (text) => doc.createTextNode(text),
- createComment: (text) => doc.createComment(text),
- setText: (node, text) => {
- node.nodeValue = text;
- },
- setElementText: (el, text) => {
- el.textContent = text;
- },
- parentNode: (node) => node.parentNode,
- nextSibling: (node) => node.nextSibling,
- querySelector: (selector) => doc.querySelector(selector),
- setScopeId(el, id) {
- el.setAttribute(id, "");
- },
- // __UNSAFE__
- // Reason: innerHTML.
- // Static content here can only come from compiled templates.
- // As long as the user only uses trusted templates, this is safe.
- insertStaticContent(content, parent, anchor, namespace, start, end) {
- const before = anchor ? anchor.previousSibling : parent.lastChild;
- if (start && (start === end || start.nextSibling)) {
- while (true) {
- parent.insertBefore(start.cloneNode(true), anchor);
- if (start === end || !(start = start.nextSibling)) break;
- }
- } else {
- templateContainer.innerHTML = unsafeToTrustedHTML(
- namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
- );
- const template = templateContainer.content;
- if (namespace === "svg" || namespace === "mathml") {
- const wrapper = template.firstChild;
- while (wrapper.firstChild) {
- template.appendChild(wrapper.firstChild);
- }
- template.removeChild(wrapper);
- }
- parent.insertBefore(template, anchor);
- }
- return [
- // first
- before ? before.nextSibling : parent.firstChild,
- // last
- anchor ? anchor.previousSibling : parent.lastChild
- ];
- }
- };
-
- const TRANSITION$1 = "transition";
- const ANIMATION = "animation";
- const vtcKey = Symbol("_vtc");
- const DOMTransitionPropsValidators = {
- name: String,
- type: String,
- css: {
- type: Boolean,
- default: true
- },
- duration: [String, Number, Object],
- enterFromClass: String,
- enterActiveClass: String,
- enterToClass: String,
- appearFromClass: String,
- appearActiveClass: String,
- appearToClass: String,
- leaveFromClass: String,
- leaveActiveClass: String,
- leaveToClass: String
- };
- const TransitionPropsValidators = /* @__PURE__ */ extend(
- {},
- BaseTransitionPropsValidators,
- DOMTransitionPropsValidators
- );
- const decorate$1 = (t) => {
- t.displayName = "Transition";
- t.props = TransitionPropsValidators;
- return t;
- };
- const Transition = /* @__PURE__ */ decorate$1(
- (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
- );
- const callHook = (hook, args = []) => {
- if (isArray(hook)) {
- hook.forEach((h2) => h2(...args));
- } else if (hook) {
- hook(...args);
- }
- };
- const hasExplicitCallback = (hook) => {
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
- };
- function resolveTransitionProps(rawProps) {
- const baseProps = {};
- for (const key in rawProps) {
- if (!(key in DOMTransitionPropsValidators)) {
- baseProps[key] = rawProps[key];
- }
- }
- if (rawProps.css === false) {
- return baseProps;
- }
- const {
- name = "v",
- type,
- duration,
- enterFromClass = `${name}-enter-from`,
- enterActiveClass = `${name}-enter-active`,
- enterToClass = `${name}-enter-to`,
- appearFromClass = enterFromClass,
- appearActiveClass = enterActiveClass,
- appearToClass = enterToClass,
- leaveFromClass = `${name}-leave-from`,
- leaveActiveClass = `${name}-leave-active`,
- leaveToClass = `${name}-leave-to`
- } = rawProps;
- const durations = normalizeDuration(duration);
- const enterDuration = durations && durations[0];
- const leaveDuration = durations && durations[1];
- const {
- onBeforeEnter,
- onEnter,
- onEnterCancelled,
- onLeave,
- onLeaveCancelled,
- onBeforeAppear = onBeforeEnter,
- onAppear = onEnter,
- onAppearCancelled = onEnterCancelled
- } = baseProps;
- const finishEnter = (el, isAppear, done, isCancelled) => {
- el._enterCancelled = isCancelled;
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
- done && done();
- };
- const finishLeave = (el, done) => {
- el._isLeaving = false;
- removeTransitionClass(el, leaveFromClass);
- removeTransitionClass(el, leaveToClass);
- removeTransitionClass(el, leaveActiveClass);
- done && done();
- };
- const makeEnterHook = (isAppear) => {
- return (el, done) => {
- const hook = isAppear ? onAppear : onEnter;
- const resolve = () => finishEnter(el, isAppear, done);
- callHook(hook, [el, resolve]);
- nextFrame(() => {
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
- if (!hasExplicitCallback(hook)) {
- whenTransitionEnds(el, type, enterDuration, resolve);
- }
- });
- };
- };
- return extend(baseProps, {
- onBeforeEnter(el) {
- callHook(onBeforeEnter, [el]);
- addTransitionClass(el, enterFromClass);
- addTransitionClass(el, enterActiveClass);
- },
- onBeforeAppear(el) {
- callHook(onBeforeAppear, [el]);
- addTransitionClass(el, appearFromClass);
- addTransitionClass(el, appearActiveClass);
- },
- onEnter: makeEnterHook(false),
- onAppear: makeEnterHook(true),
- onLeave(el, done) {
- el._isLeaving = true;
- const resolve = () => finishLeave(el, done);
- addTransitionClass(el, leaveFromClass);
- if (!el._enterCancelled) {
- forceReflow();
- addTransitionClass(el, leaveActiveClass);
- } else {
- addTransitionClass(el, leaveActiveClass);
- forceReflow();
- }
- nextFrame(() => {
- if (!el._isLeaving) {
- return;
- }
- removeTransitionClass(el, leaveFromClass);
- addTransitionClass(el, leaveToClass);
- if (!hasExplicitCallback(onLeave)) {
- whenTransitionEnds(el, type, leaveDuration, resolve);
- }
- });
- callHook(onLeave, [el, resolve]);
- },
- onEnterCancelled(el) {
- finishEnter(el, false, void 0, true);
- callHook(onEnterCancelled, [el]);
- },
- onAppearCancelled(el) {
- finishEnter(el, true, void 0, true);
- callHook(onAppearCancelled, [el]);
- },
- onLeaveCancelled(el) {
- finishLeave(el);
- callHook(onLeaveCancelled, [el]);
- }
- });
- }
- function normalizeDuration(duration) {
- if (duration == null) {
- return null;
- } else if (isObject(duration)) {
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
- } else {
- const n = NumberOf(duration);
- return [n, n];
- }
- }
- function NumberOf(val) {
- const res = toNumber(val);
- {
- assertNumber(res, "<transition> explicit duration");
- }
- return res;
- }
- function addTransitionClass(el, cls) {
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
- (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
- }
- function removeTransitionClass(el, cls) {
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
- const _vtc = el[vtcKey];
- if (_vtc) {
- _vtc.delete(cls);
- if (!_vtc.size) {
- el[vtcKey] = void 0;
- }
- }
- }
- function nextFrame(cb) {
- requestAnimationFrame(() => {
- requestAnimationFrame(cb);
- });
- }
- let endId = 0;
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
- const id = el._endId = ++endId;
- const resolveIfNotStale = () => {
- if (id === el._endId) {
- resolve();
- }
- };
- if (explicitTimeout != null) {
- return setTimeout(resolveIfNotStale, explicitTimeout);
- }
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
- if (!type) {
- return resolve();
- }
- const endEvent = type + "end";
- let ended = 0;
- const end = () => {
- el.removeEventListener(endEvent, onEnd);
- resolveIfNotStale();
- };
- const onEnd = (e) => {
- if (e.target === el && ++ended >= propCount) {
- end();
- }
- };
- setTimeout(() => {
- if (ended < propCount) {
- end();
- }
- }, timeout + 1);
- el.addEventListener(endEvent, onEnd);
- }
- function getTransitionInfo(el, expectedType) {
- const styles = window.getComputedStyle(el);
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
- const transitionDelays = getStyleProperties(`${TRANSITION$1}Delay`);
- const transitionDurations = getStyleProperties(`${TRANSITION$1}Duration`);
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
- const animationTimeout = getTimeout(animationDelays, animationDurations);
- let type = null;
- let timeout = 0;
- let propCount = 0;
- if (expectedType === TRANSITION$1) {
- if (transitionTimeout > 0) {
- type = TRANSITION$1;
- timeout = transitionTimeout;
- propCount = transitionDurations.length;
- }
- } else if (expectedType === ANIMATION) {
- if (animationTimeout > 0) {
- type = ANIMATION;
- timeout = animationTimeout;
- propCount = animationDurations.length;
- }
- } else {
- timeout = Math.max(transitionTimeout, animationTimeout);
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION$1 : ANIMATION : null;
- propCount = type ? type === TRANSITION$1 ? transitionDurations.length : animationDurations.length : 0;
- }
- const hasTransform = type === TRANSITION$1 && /\b(transform|all)(,|$)/.test(
- getStyleProperties(`${TRANSITION$1}Property`).toString()
- );
- return {
- type,
- timeout,
- propCount,
- hasTransform
- };
- }
- function getTimeout(delays, durations) {
- while (delays.length < durations.length) {
- delays = delays.concat(delays);
- }
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
- }
- function toMs(s) {
- if (s === "auto") return 0;
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
- }
- function forceReflow() {
- return document.body.offsetHeight;
- }
-
- function patchClass(el, value, isSVG) {
- const transitionClasses = el[vtcKey];
- if (transitionClasses) {
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
- }
- if (value == null) {
- el.removeAttribute("class");
- } else if (isSVG) {
- el.setAttribute("class", value);
- } else {
- el.className = value;
- }
- }
-
- const vShowOriginalDisplay = Symbol("_vod");
- const vShowHidden = Symbol("_vsh");
- const vShow = {
- beforeMount(el, { value }, { transition }) {
- el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
- if (transition && value) {
- transition.beforeEnter(el);
- } else {
- setDisplay(el, value);
- }
- },
- mounted(el, { value }, { transition }) {
- if (transition && value) {
- transition.enter(el);
- }
- },
- updated(el, { value, oldValue }, { transition }) {
- if (!value === !oldValue) return;
- if (transition) {
- if (value) {
- transition.beforeEnter(el);
- setDisplay(el, true);
- transition.enter(el);
- } else {
- transition.leave(el, () => {
- setDisplay(el, false);
- });
- }
- } else {
- setDisplay(el, value);
- }
- },
- beforeUnmount(el, { value }) {
- setDisplay(el, value);
- }
- };
- {
- vShow.name = "show";
- }
- function setDisplay(el, value) {
- el.style.display = value ? el[vShowOriginalDisplay] : "none";
- el[vShowHidden] = !value;
- }
-
- const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
- function useCssVars(getter) {
- const instance = getCurrentInstance();
- if (!instance) {
- warn(`useCssVars is called without current active component instance.`);
- return;
- }
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
- Array.from(
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
- ).forEach((node) => setVarsOnNode(node, vars));
- };
- {
- instance.getCssVars = () => getter(instance.proxy);
- }
- const setVars = () => {
- const vars = getter(instance.proxy);
- if (instance.ce) {
- setVarsOnNode(instance.ce, vars);
- } else {
- setVarsOnVNode(instance.subTree, vars);
- }
- updateTeleports(vars);
- };
- onBeforeUpdate(() => {
- queuePostFlushCb(setVars);
- });
- onMounted(() => {
- watch(setVars, NOOP, { flush: "post" });
- const ob = new MutationObserver(setVars);
- ob.observe(instance.subTree.el.parentNode, { childList: true });
- onUnmounted(() => ob.disconnect());
- });
- }
- function setVarsOnVNode(vnode, vars) {
- if (vnode.shapeFlag & 128) {
- const suspense = vnode.suspense;
- vnode = suspense.activeBranch;
- if (suspense.pendingBranch && !suspense.isHydrating) {
- suspense.effects.push(() => {
- setVarsOnVNode(suspense.activeBranch, vars);
- });
- }
- }
- while (vnode.component) {
- vnode = vnode.component.subTree;
- }
- if (vnode.shapeFlag & 1 && vnode.el) {
- setVarsOnNode(vnode.el, vars);
- } else if (vnode.type === Fragment) {
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
- } else if (vnode.type === Static) {
- let { el, anchor } = vnode;
- while (el) {
- setVarsOnNode(el, vars);
- if (el === anchor) break;
- el = el.nextSibling;
- }
- }
- }
- function setVarsOnNode(el, vars) {
- if (el.nodeType === 1) {
- const style = el.style;
- let cssText = "";
- for (const key in vars) {
- style.setProperty(`--${key}`, vars[key]);
- cssText += `--${key}: ${vars[key]};`;
- }
- style[CSS_VAR_TEXT] = cssText;
- }
- }
-
- const displayRE = /(^|;)\s*display\s*:/;
- function patchStyle(el, prev, next) {
- const style = el.style;
- const isCssString = isString(next);
- let hasControlledDisplay = false;
- if (next && !isCssString) {
- if (prev) {
- if (!isString(prev)) {
- for (const key in prev) {
- if (next[key] == null) {
- setStyle(style, key, "");
- }
- }
- } else {
- for (const prevStyle of prev.split(";")) {
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
- if (next[key] == null) {
- setStyle(style, key, "");
- }
- }
- }
- }
- for (const key in next) {
- if (key === "display") {
- hasControlledDisplay = true;
- }
- setStyle(style, key, next[key]);
- }
- } else {
- if (isCssString) {
- if (prev !== next) {
- const cssVarText = style[CSS_VAR_TEXT];
- if (cssVarText) {
- next += ";" + cssVarText;
- }
- style.cssText = next;
- hasControlledDisplay = displayRE.test(next);
- }
- } else if (prev) {
- el.removeAttribute("style");
- }
- }
- if (vShowOriginalDisplay in el) {
- el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
- if (el[vShowHidden]) {
- style.display = "none";
- }
- }
- }
- const semicolonRE = /[^\\];\s*$/;
- const importantRE = /\s*!important$/;
- function setStyle(style, name, val) {
- if (isArray(val)) {
- val.forEach((v) => setStyle(style, name, v));
- } else {
- if (val == null) val = "";
- {
- if (semicolonRE.test(val)) {
- warn(
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
- );
- }
- }
- if (name.startsWith("--")) {
- style.setProperty(name, val);
- } else {
- const prefixed = autoPrefix(style, name);
- if (importantRE.test(val)) {
- style.setProperty(
- hyphenate(prefixed),
- val.replace(importantRE, ""),
- "important"
- );
- } else {
- style[prefixed] = val;
- }
- }
- }
- }
- const prefixes = ["Webkit", "Moz", "ms"];
- const prefixCache = {};
- function autoPrefix(style, rawName) {
- const cached = prefixCache[rawName];
- if (cached) {
- return cached;
- }
- let name = camelize(rawName);
- if (name !== "filter" && name in style) {
- return prefixCache[rawName] = name;
- }
- name = capitalize(name);
- for (let i = 0; i < prefixes.length; i++) {
- const prefixed = prefixes[i] + name;
- if (prefixed in style) {
- return prefixCache[rawName] = prefixed;
- }
- }
- return rawName;
- }
-
- const xlinkNS = "http://www.w3.org/1999/xlink";
- function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
- if (isSVG && key.startsWith("xlink:")) {
- if (value == null) {
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
- } else {
- el.setAttributeNS(xlinkNS, key, value);
- }
- } else {
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
- el.removeAttribute(key);
- } else {
- el.setAttribute(
- key,
- isBoolean ? "" : isSymbol(value) ? String(value) : value
- );
- }
- }
- }
-
- function patchDOMProp(el, key, value, parentComponent, attrName) {
- if (key === "innerHTML" || key === "textContent") {
- if (value != null) {
- el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
- }
- return;
- }
- const tag = el.tagName;
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
- !tag.includes("-")) {
- const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
- const newValue = value == null ? (
- // #11647: value should be set as empty string for null and undefined,
- // but <input type="checkbox"> should be set as 'on'.
- el.type === "checkbox" ? "on" : ""
- ) : String(value);
- if (oldValue !== newValue || !("_value" in el)) {
- el.value = newValue;
- }
- if (value == null) {
- el.removeAttribute(key);
- }
- el._value = value;
- return;
- }
- let needRemove = false;
- if (value === "" || value == null) {
- const type = typeof el[key];
- if (type === "boolean") {
- value = includeBooleanAttr(value);
- } else if (value == null && type === "string") {
- value = "";
- needRemove = true;
- } else if (type === "number") {
- value = 0;
- needRemove = true;
- }
- }
- try {
- el[key] = value;
- } catch (e) {
- if (!needRemove) {
- warn(
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
- e
- );
- }
- }
- needRemove && el.removeAttribute(attrName || key);
- }
-
- function addEventListener(el, event, handler, options) {
- el.addEventListener(event, handler, options);
- }
- function removeEventListener(el, event, handler, options) {
- el.removeEventListener(event, handler, options);
- }
- const veiKey = Symbol("_vei");
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
- const invokers = el[veiKey] || (el[veiKey] = {});
- const existingInvoker = invokers[rawName];
- if (nextValue && existingInvoker) {
- existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
- } else {
- const [name, options] = parseName(rawName);
- if (nextValue) {
- const invoker = invokers[rawName] = createInvoker(
- sanitizeEventValue(nextValue, rawName) ,
- instance
- );
- addEventListener(el, name, invoker, options);
- } else if (existingInvoker) {
- removeEventListener(el, name, existingInvoker, options);
- invokers[rawName] = void 0;
- }
- }
- }
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
- function parseName(name) {
- let options;
- if (optionsModifierRE.test(name)) {
- options = {};
- let m;
- while (m = name.match(optionsModifierRE)) {
- name = name.slice(0, name.length - m[0].length);
- options[m[0].toLowerCase()] = true;
- }
- }
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
- return [event, options];
- }
- let cachedNow = 0;
- const p = /* @__PURE__ */ Promise.resolve();
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
- function createInvoker(initialValue, instance) {
- const invoker = (e) => {
- if (!e._vts) {
- e._vts = Date.now();
- } else if (e._vts <= invoker.attached) {
- return;
- }
- callWithAsyncErrorHandling(
- patchStopImmediatePropagation(e, invoker.value),
- instance,
- 5,
- [e]
- );
- };
- invoker.value = initialValue;
- invoker.attached = getNow();
- return invoker;
- }
- function sanitizeEventValue(value, propName) {
- if (isFunction(value) || isArray(value)) {
- return value;
- }
- warn(
- `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
-Expected function or array of functions, received type ${typeof value}.`
- );
- return NOOP;
- }
- function patchStopImmediatePropagation(e, value) {
- if (isArray(value)) {
- const originalStop = e.stopImmediatePropagation;
- e.stopImmediatePropagation = () => {
- originalStop.call(e);
- e._stopped = true;
- };
- return value.map(
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
- );
- } else {
- return value;
- }
- }
-
- const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
- key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
- const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
- const isSVG = namespace === "svg";
- if (key === "class") {
- patchClass(el, nextValue, isSVG);
- } else if (key === "style") {
- patchStyle(el, prevValue, nextValue);
- } else if (isOn(key)) {
- if (!isModelListener(key)) {
- patchEvent(el, key, prevValue, nextValue, parentComponent);
- }
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
- patchDOMProp(el, key, nextValue);
- if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
- patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
- }
- } else if (
- // #11081 force set props for possible async custom element
- el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
- ) {
- patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
- } else {
- if (key === "true-value") {
- el._trueValue = nextValue;
- } else if (key === "false-value") {
- el._falseValue = nextValue;
- }
- patchAttr(el, key, nextValue, isSVG);
- }
- };
- function shouldSetAsProp(el, key, value, isSVG) {
- if (isSVG) {
- if (key === "innerHTML" || key === "textContent") {
- return true;
- }
- if (key in el && isNativeOn(key) && isFunction(value)) {
- return true;
- }
- return false;
- }
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
- return false;
- }
- if (key === "form") {
- return false;
- }
- if (key === "list" && el.tagName === "INPUT") {
- return false;
- }
- if (key === "type" && el.tagName === "TEXTAREA") {
- return false;
- }
- if (key === "width" || key === "height") {
- const tag = el.tagName;
- if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
- return false;
- }
- }
- if (isNativeOn(key) && isString(value)) {
- return false;
- }
- return key in el;
- }
-
- const REMOVAL = {};
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function defineCustomElement(options, extraOptions, _createApp) {
- const Comp = defineComponent(options, extraOptions);
- if (isPlainObject(Comp)) extend(Comp, extraOptions);
- class VueCustomElement extends VueElement {
- constructor(initialProps) {
- super(Comp, initialProps, _createApp);
- }
- }
- VueCustomElement.def = Comp;
- return VueCustomElement;
- }
- /*! #__NO_SIDE_EFFECTS__ */
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
- return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
- };
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
- };
- class VueElement extends BaseClass {
- constructor(_def, _props = {}, _createApp = createApp) {
- super();
- this._def = _def;
- this._props = _props;
- this._createApp = _createApp;
- this._isVueCE = true;
- /**
- * @internal
- */
- this._instance = null;
- /**
- * @internal
- */
- this._app = null;
- /**
- * @internal
- */
- this._nonce = this._def.nonce;
- this._connected = false;
- this._resolved = false;
- this._numberProps = null;
- this._styleChildren = /* @__PURE__ */ new WeakSet();
- this._ob = null;
- if (this.shadowRoot && _createApp !== createApp) {
- this._root = this.shadowRoot;
- } else {
- if (this.shadowRoot) {
- warn(
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
- );
- }
- if (_def.shadowRoot !== false) {
- this.attachShadow({ mode: "open" });
- this._root = this.shadowRoot;
- } else {
- this._root = this;
- }
- }
- if (!this._def.__asyncLoader) {
- this._resolveProps(this._def);
- }
- }
- connectedCallback() {
- if (!this.isConnected) return;
- if (!this.shadowRoot) {
- this._parseSlots();
- }
- this._connected = true;
- let parent = this;
- while (parent = parent && (parent.parentNode || parent.host)) {
- if (parent instanceof VueElement) {
- this._parent = parent;
- break;
- }
- }
- if (!this._instance) {
- if (this._resolved) {
- this._setParent();
- this._update();
- } else {
- if (parent && parent._pendingResolve) {
- this._pendingResolve = parent._pendingResolve.then(() => {
- this._pendingResolve = void 0;
- this._resolveDef();
- });
- } else {
- this._resolveDef();
- }
- }
- }
- }
- _setParent(parent = this._parent) {
- if (parent) {
- this._instance.parent = parent._instance;
- this._instance.provides = parent._instance.provides;
- }
- }
- disconnectedCallback() {
- this._connected = false;
- nextTick(() => {
- if (!this._connected) {
- if (this._ob) {
- this._ob.disconnect();
- this._ob = null;
- }
- this._app && this._app.unmount();
- if (this._instance) this._instance.ce = void 0;
- this._app = this._instance = null;
- }
- });
- }
- /**
- * resolve inner component definition (handle possible async component)
- */
- _resolveDef() {
- if (this._pendingResolve) {
- return;
- }
- for (let i = 0; i < this.attributes.length; i++) {
- this._setAttr(this.attributes[i].name);
- }
- this._ob = new MutationObserver((mutations) => {
- for (const m of mutations) {
- this._setAttr(m.attributeName);
- }
- });
- this._ob.observe(this, { attributes: true });
- const resolve = (def, isAsync = false) => {
- this._resolved = true;
- this._pendingResolve = void 0;
- const { props, styles } = def;
- let numberProps;
- if (props && !isArray(props)) {
- for (const key in props) {
- const opt = props[key];
- if (opt === Number || opt && opt.type === Number) {
- if (key in this._props) {
- this._props[key] = toNumber(this._props[key]);
- }
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
- }
- }
- }
- this._numberProps = numberProps;
- if (isAsync) {
- this._resolveProps(def);
- }
- if (this.shadowRoot) {
- this._applyStyles(styles);
- } else if (styles) {
- warn(
- "Custom element style injection is not supported when using shadowRoot: false"
- );
- }
- this._mount(def);
- };
- const asyncDef = this._def.__asyncLoader;
- if (asyncDef) {
- this._pendingResolve = asyncDef().then(
- (def) => resolve(this._def = def, true)
- );
- } else {
- resolve(this._def);
- }
- }
- _mount(def) {
- if (!def.name) {
- def.name = "VueElement";
- }
- this._app = this._createApp(def);
- if (def.configureApp) {
- def.configureApp(this._app);
- }
- this._app._ceVNode = this._createVNode();
- this._app.mount(this._root);
- const exposed = this._instance && this._instance.exposed;
- if (!exposed) return;
- for (const key in exposed) {
- if (!hasOwn(this, key)) {
- Object.defineProperty(this, key, {
- // unwrap ref to be consistent with public instance behavior
- get: () => unref(exposed[key])
- });
- } else {
- warn(`Exposed property "${key}" already exists on custom element.`);
- }
- }
- }
- _resolveProps(def) {
- const { props } = def;
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
- for (const key of Object.keys(this)) {
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
- this._setProp(key, this[key]);
- }
- }
- for (const key of declaredPropKeys.map(camelize)) {
- Object.defineProperty(this, key, {
- get() {
- return this._getProp(key);
- },
- set(val) {
- this._setProp(key, val, true, true);
- }
- });
- }
- }
- _setAttr(key) {
- if (key.startsWith("data-v-")) return;
- const has = this.hasAttribute(key);
- let value = has ? this.getAttribute(key) : REMOVAL;
- const camelKey = camelize(key);
- if (has && this._numberProps && this._numberProps[camelKey]) {
- value = toNumber(value);
- }
- this._setProp(camelKey, value, false, true);
- }
- /**
- * @internal
- */
- _getProp(key) {
- return this._props[key];
- }
- /**
- * @internal
- */
- _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
- if (val !== this._props[key]) {
- if (val === REMOVAL) {
- delete this._props[key];
- } else {
- this._props[key] = val;
- if (key === "key" && this._app) {
- this._app._ceVNode.key = val;
- }
- }
- if (shouldUpdate && this._instance) {
- this._update();
- }
- if (shouldReflect) {
- const ob = this._ob;
- ob && ob.disconnect();
- if (val === true) {
- this.setAttribute(hyphenate(key), "");
- } else if (typeof val === "string" || typeof val === "number") {
- this.setAttribute(hyphenate(key), val + "");
- } else if (!val) {
- this.removeAttribute(hyphenate(key));
- }
- ob && ob.observe(this, { attributes: true });
- }
- }
- }
- _update() {
- render(this._createVNode(), this._root);
- }
- _createVNode() {
- const baseProps = {};
- if (!this.shadowRoot) {
- baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
- }
- const vnode = createVNode(this._def, extend(baseProps, this._props));
- if (!this._instance) {
- vnode.ce = (instance) => {
- this._instance = instance;
- instance.ce = this;
- instance.isCE = true;
- {
- instance.ceReload = (newStyles) => {
- if (this._styles) {
- this._styles.forEach((s) => this._root.removeChild(s));
- this._styles.length = 0;
- }
- this._applyStyles(newStyles);
- this._instance = null;
- this._update();
- };
- }
- const dispatch = (event, args) => {
- this.dispatchEvent(
- new CustomEvent(
- event,
- isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
- )
- );
- };
- instance.emit = (event, ...args) => {
- dispatch(event, args);
- if (hyphenate(event) !== event) {
- dispatch(hyphenate(event), args);
- }
- };
- this._setParent();
- };
- }
- return vnode;
- }
- _applyStyles(styles, owner) {
- if (!styles) return;
- if (owner) {
- if (owner === this._def || this._styleChildren.has(owner)) {
- return;
- }
- this._styleChildren.add(owner);
- }
- const nonce = this._nonce;
- for (let i = styles.length - 1; i >= 0; i--) {
- const s = document.createElement("style");
- if (nonce) s.setAttribute("nonce", nonce);
- s.textContent = styles[i];
- this.shadowRoot.prepend(s);
- {
- if (owner) {
- if (owner.__hmrId) {
- if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
- let entry = this._childStyles.get(owner.__hmrId);
- if (!entry) {
- this._childStyles.set(owner.__hmrId, entry = []);
- }
- entry.push(s);
- }
- } else {
- (this._styles || (this._styles = [])).push(s);
- }
- }
- }
- }
- /**
- * Only called when shadowRoot is false
- */
- _parseSlots() {
- const slots = this._slots = {};
- let n;
- while (n = this.firstChild) {
- const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
- (slots[slotName] || (slots[slotName] = [])).push(n);
- this.removeChild(n);
- }
- }
- /**
- * Only called when shadowRoot is false
- */
- _renderSlots() {
- const outlets = (this._teleportTarget || this).querySelectorAll("slot");
- const scopeId = this._instance.type.__scopeId;
- for (let i = 0; i < outlets.length; i++) {
- const o = outlets[i];
- const slotName = o.getAttribute("name") || "default";
- const content = this._slots[slotName];
- const parent = o.parentNode;
- if (content) {
- for (const n of content) {
- if (scopeId && n.nodeType === 1) {
- const id = scopeId + "-s";
- const walker = document.createTreeWalker(n, 1);
- n.setAttribute(id, "");
- let child;
- while (child = walker.nextNode()) {
- child.setAttribute(id, "");
- }
- }
- parent.insertBefore(n, o);
- }
- } else {
- while (o.firstChild) parent.insertBefore(o.firstChild, o);
- }
- parent.removeChild(o);
- }
- }
- /**
- * @internal
- */
- _injectChildStyle(comp) {
- this._applyStyles(comp.styles, comp);
- }
- /**
- * @internal
- */
- _removeChildStyle(comp) {
- {
- this._styleChildren.delete(comp);
- if (this._childStyles && comp.__hmrId) {
- const oldStyles = this._childStyles.get(comp.__hmrId);
- if (oldStyles) {
- oldStyles.forEach((s) => this._root.removeChild(s));
- oldStyles.length = 0;
- }
- }
- }
- }
- }
- function useHost(caller) {
- const instance = getCurrentInstance();
- const el = instance && instance.ce;
- if (el) {
- return el;
- } else {
- if (!instance) {
- warn(
- `${caller || "useHost"} called without an active component instance.`
- );
- } else {
- warn(
- `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
- );
- }
- }
- return null;
- }
- function useShadowRoot() {
- const el = useHost("useShadowRoot") ;
- return el && el.shadowRoot;
- }
-
- function useCssModule(name = "$style") {
- {
- {
- warn(`useCssModule() is not supported in the global build.`);
- }
- return EMPTY_OBJ;
- }
- }
-
- const positionMap = /* @__PURE__ */ new WeakMap();
- const newPositionMap = /* @__PURE__ */ new WeakMap();
- const moveCbKey = Symbol("_moveCb");
- const enterCbKey = Symbol("_enterCb");
- const decorate = (t) => {
- delete t.props.mode;
- return t;
- };
- const TransitionGroupImpl = /* @__PURE__ */ decorate({
- name: "TransitionGroup",
- props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
- tag: String,
- moveClass: String
- }),
- setup(props, { slots }) {
- const instance = getCurrentInstance();
- const state = useTransitionState();
- let prevChildren;
- let children;
- onUpdated(() => {
- if (!prevChildren.length) {
- return;
- }
- const moveClass = props.moveClass || `${props.name || "v"}-move`;
- if (!hasCSSTransform(
- prevChildren[0].el,
- instance.vnode.el,
- moveClass
- )) {
- return;
- }
- prevChildren.forEach(callPendingCbs);
- prevChildren.forEach(recordPosition);
- const movedChildren = prevChildren.filter(applyTranslation);
- forceReflow();
- movedChildren.forEach((c) => {
- const el = c.el;
- const style = el.style;
- addTransitionClass(el, moveClass);
- style.transform = style.webkitTransform = style.transitionDuration = "";
- const cb = el[moveCbKey] = (e) => {
- if (e && e.target !== el) {
- return;
- }
- if (!e || /transform$/.test(e.propertyName)) {
- el.removeEventListener("transitionend", cb);
- el[moveCbKey] = null;
- removeTransitionClass(el, moveClass);
- }
- };
- el.addEventListener("transitionend", cb);
- });
- });
- return () => {
- const rawProps = toRaw(props);
- const cssTransitionProps = resolveTransitionProps(rawProps);
- let tag = rawProps.tag || Fragment;
- prevChildren = [];
- if (children) {
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (child.el && child.el instanceof Element) {
- prevChildren.push(child);
- setTransitionHooks(
- child,
- resolveTransitionHooks(
- child,
- cssTransitionProps,
- state,
- instance
- )
- );
- positionMap.set(
- child,
- child.el.getBoundingClientRect()
- );
- }
- }
- }
- children = slots.default ? getTransitionRawChildren(slots.default()) : [];
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (child.key != null) {
- setTransitionHooks(
- child,
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
- );
- } else if (child.type !== Text) {
- warn(`<TransitionGroup> children must be keyed.`);
- }
- }
- return createVNode(tag, null, children);
- };
- }
- });
- const TransitionGroup = TransitionGroupImpl;
- function callPendingCbs(c) {
- const el = c.el;
- if (el[moveCbKey]) {
- el[moveCbKey]();
- }
- if (el[enterCbKey]) {
- el[enterCbKey]();
- }
- }
- function recordPosition(c) {
- newPositionMap.set(c, c.el.getBoundingClientRect());
- }
- function applyTranslation(c) {
- const oldPos = positionMap.get(c);
- const newPos = newPositionMap.get(c);
- const dx = oldPos.left - newPos.left;
- const dy = oldPos.top - newPos.top;
- if (dx || dy) {
- const s = c.el.style;
- s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
- s.transitionDuration = "0s";
- return c;
- }
- }
- function hasCSSTransform(el, root, moveClass) {
- const clone = el.cloneNode();
- const _vtc = el[vtcKey];
- if (_vtc) {
- _vtc.forEach((cls) => {
- cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
- });
- }
- moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
- clone.style.display = "none";
- const container = root.nodeType === 1 ? root : root.parentNode;
- container.appendChild(clone);
- const { hasTransform } = getTransitionInfo(clone);
- container.removeChild(clone);
- return hasTransform;
- }
-
- const getModelAssigner = (vnode) => {
- const fn = vnode.props["onUpdate:modelValue"] || false;
- return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
- };
- function onCompositionStart(e) {
- e.target.composing = true;
- }
- function onCompositionEnd(e) {
- const target = e.target;
- if (target.composing) {
- target.composing = false;
- target.dispatchEvent(new Event("input"));
- }
- }
- const assignKey = Symbol("_assign");
- const vModelText = {
- created(el, { modifiers: { lazy, trim, number } }, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- const castToNumber = number || vnode.props && vnode.props.type === "number";
- addEventListener(el, lazy ? "change" : "input", (e) => {
- if (e.target.composing) return;
- let domValue = el.value;
- if (trim) {
- domValue = domValue.trim();
- }
- if (castToNumber) {
- domValue = looseToNumber(domValue);
- }
- el[assignKey](domValue);
- });
- if (trim) {
- addEventListener(el, "change", () => {
- el.value = el.value.trim();
- });
- }
- if (!lazy) {
- addEventListener(el, "compositionstart", onCompositionStart);
- addEventListener(el, "compositionend", onCompositionEnd);
- addEventListener(el, "change", onCompositionEnd);
- }
- },
- // set value on mounted so it's after min/max for type="range"
- mounted(el, { value }) {
- el.value = value == null ? "" : value;
- },
- beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- if (el.composing) return;
- const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
- const newValue = value == null ? "" : value;
- if (elValue === newValue) {
- return;
- }
- if (document.activeElement === el && el.type !== "range") {
- if (lazy && value === oldValue) {
- return;
- }
- if (trim && el.value.trim() === newValue) {
- return;
- }
- }
- el.value = newValue;
- }
- };
- const vModelCheckbox = {
- // #4096 array checkboxes need to be deep traversed
- deep: true,
- created(el, _, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- addEventListener(el, "change", () => {
- const modelValue = el._modelValue;
- const elementValue = getValue(el);
- const checked = el.checked;
- const assign = el[assignKey];
- if (isArray(modelValue)) {
- const index = looseIndexOf(modelValue, elementValue);
- const found = index !== -1;
- if (checked && !found) {
- assign(modelValue.concat(elementValue));
- } else if (!checked && found) {
- const filtered = [...modelValue];
- filtered.splice(index, 1);
- assign(filtered);
- }
- } else if (isSet(modelValue)) {
- const cloned = new Set(modelValue);
- if (checked) {
- cloned.add(elementValue);
- } else {
- cloned.delete(elementValue);
- }
- assign(cloned);
- } else {
- assign(getCheckboxValue(el, checked));
- }
- });
- },
- // set initial checked on mount to wait for true-value/false-value
- mounted: setChecked,
- beforeUpdate(el, binding, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- setChecked(el, binding, vnode);
- }
- };
- function setChecked(el, { value, oldValue }, vnode) {
- el._modelValue = value;
- let checked;
- if (isArray(value)) {
- checked = looseIndexOf(value, vnode.props.value) > -1;
- } else if (isSet(value)) {
- checked = value.has(vnode.props.value);
- } else {
- if (value === oldValue) return;
- checked = looseEqual(value, getCheckboxValue(el, true));
- }
- if (el.checked !== checked) {
- el.checked = checked;
- }
- }
- const vModelRadio = {
- created(el, { value }, vnode) {
- el.checked = looseEqual(value, vnode.props.value);
- el[assignKey] = getModelAssigner(vnode);
- addEventListener(el, "change", () => {
- el[assignKey](getValue(el));
- });
- },
- beforeUpdate(el, { value, oldValue }, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- if (value !== oldValue) {
- el.checked = looseEqual(value, vnode.props.value);
- }
- }
- };
- const vModelSelect = {
- // <select multiple> value need to be deep traversed
- deep: true,
- created(el, { value, modifiers: { number } }, vnode) {
- const isSetModel = isSet(value);
- addEventListener(el, "change", () => {
- const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
- (o) => number ? looseToNumber(getValue(o)) : getValue(o)
- );
- el[assignKey](
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
- );
- el._assigning = true;
- nextTick(() => {
- el._assigning = false;
- });
- });
- el[assignKey] = getModelAssigner(vnode);
- },
- // set value in mounted & updated because <select> relies on its children
- // <option>s.
- mounted(el, { value }) {
- setSelected(el, value);
- },
- beforeUpdate(el, _binding, vnode) {
- el[assignKey] = getModelAssigner(vnode);
- },
- updated(el, { value }) {
- if (!el._assigning) {
- setSelected(el, value);
- }
- }
- };
- function setSelected(el, value) {
- const isMultiple = el.multiple;
- const isArrayValue = isArray(value);
- if (isMultiple && !isArrayValue && !isSet(value)) {
- warn(
- `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
- );
- return;
- }
- for (let i = 0, l = el.options.length; i < l; i++) {
- const option = el.options[i];
- const optionValue = getValue(option);
- if (isMultiple) {
- if (isArrayValue) {
- const optionType = typeof optionValue;
- if (optionType === "string" || optionType === "number") {
- option.selected = value.some((v) => String(v) === String(optionValue));
- } else {
- option.selected = looseIndexOf(value, optionValue) > -1;
- }
- } else {
- option.selected = value.has(optionValue);
- }
- } else if (looseEqual(getValue(option), value)) {
- if (el.selectedIndex !== i) el.selectedIndex = i;
- return;
- }
- }
- if (!isMultiple && el.selectedIndex !== -1) {
- el.selectedIndex = -1;
- }
- }
- function getValue(el) {
- return "_value" in el ? el._value : el.value;
- }
- function getCheckboxValue(el, checked) {
- const key = checked ? "_trueValue" : "_falseValue";
- return key in el ? el[key] : checked;
- }
- const vModelDynamic = {
- created(el, binding, vnode) {
- callModelHook(el, binding, vnode, null, "created");
- },
- mounted(el, binding, vnode) {
- callModelHook(el, binding, vnode, null, "mounted");
- },
- beforeUpdate(el, binding, vnode, prevVNode) {
- callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
- },
- updated(el, binding, vnode, prevVNode) {
- callModelHook(el, binding, vnode, prevVNode, "updated");
- }
- };
- function resolveDynamicModel(tagName, type) {
- switch (tagName) {
- case "SELECT":
- return vModelSelect;
- case "TEXTAREA":
- return vModelText;
- default:
- switch (type) {
- case "checkbox":
- return vModelCheckbox;
- case "radio":
- return vModelRadio;
- default:
- return vModelText;
- }
- }
- }
- function callModelHook(el, binding, vnode, prevVNode, hook) {
- const modelToUse = resolveDynamicModel(
- el.tagName,
- vnode.props && vnode.props.type
- );
- const fn = modelToUse[hook];
- fn && fn(el, binding, vnode, prevVNode);
- }
-
- const systemModifiers = ["ctrl", "shift", "alt", "meta"];
- const modifierGuards = {
- stop: (e) => e.stopPropagation(),
- prevent: (e) => e.preventDefault(),
- self: (e) => e.target !== e.currentTarget,
- ctrl: (e) => !e.ctrlKey,
- shift: (e) => !e.shiftKey,
- alt: (e) => !e.altKey,
- meta: (e) => !e.metaKey,
- left: (e) => "button" in e && e.button !== 0,
- middle: (e) => "button" in e && e.button !== 1,
- right: (e) => "button" in e && e.button !== 2,
- exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
- };
- const withModifiers = (fn, modifiers) => {
- const cache = fn._withMods || (fn._withMods = {});
- const cacheKey = modifiers.join(".");
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
- for (let i = 0; i < modifiers.length; i++) {
- const guard = modifierGuards[modifiers[i]];
- if (guard && guard(event, modifiers)) return;
- }
- return fn(event, ...args);
- });
- };
- const keyNames = {
- esc: "escape",
- space: " ",
- up: "arrow-up",
- left: "arrow-left",
- right: "arrow-right",
- down: "arrow-down",
- delete: "backspace"
- };
- const withKeys = (fn, modifiers) => {
- const cache = fn._withKeys || (fn._withKeys = {});
- const cacheKey = modifiers.join(".");
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
- if (!("key" in event)) {
- return;
- }
- const eventKey = hyphenate(event.key);
- if (modifiers.some(
- (k) => k === eventKey || keyNames[k] === eventKey
- )) {
- return fn(event);
- }
- });
- };
-
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
- let renderer;
- let enabledHydration = false;
- function ensureRenderer() {
- return renderer || (renderer = createRenderer(rendererOptions));
- }
- function ensureHydrationRenderer() {
- renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
- enabledHydration = true;
- return renderer;
- }
- const render = (...args) => {
- ensureRenderer().render(...args);
- };
- const hydrate = (...args) => {
- ensureHydrationRenderer().hydrate(...args);
- };
- const createApp = (...args) => {
- const app = ensureRenderer().createApp(...args);
- {
- injectNativeTagCheck(app);
- injectCompilerOptionsCheck(app);
- }
- const { mount } = app;
- app.mount = (containerOrSelector) => {
- const container = normalizeContainer(containerOrSelector);
- if (!container) return;
- const component = app._component;
- if (!isFunction(component) && !component.render && !component.template) {
- component.template = container.innerHTML;
- }
- if (container.nodeType === 1) {
- container.textContent = "";
- }
- const proxy = mount(container, false, resolveRootNamespace(container));
- if (container instanceof Element) {
- container.removeAttribute("v-cloak");
- container.setAttribute("data-v-app", "");
- }
- return proxy;
- };
- return app;
- };
- const createSSRApp = (...args) => {
- const app = ensureHydrationRenderer().createApp(...args);
- {
- injectNativeTagCheck(app);
- injectCompilerOptionsCheck(app);
- }
- const { mount } = app;
- app.mount = (containerOrSelector) => {
- const container = normalizeContainer(containerOrSelector);
- if (container) {
- return mount(container, true, resolveRootNamespace(container));
- }
- };
- return app;
- };
- function resolveRootNamespace(container) {
- if (container instanceof SVGElement) {
- return "svg";
- }
- if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
- return "mathml";
- }
- }
- function injectNativeTagCheck(app) {
- Object.defineProperty(app.config, "isNativeTag", {
- value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
- writable: false
- });
- }
- function injectCompilerOptionsCheck(app) {
- if (isRuntimeOnly()) {
- const isCustomElement = app.config.isCustomElement;
- Object.defineProperty(app.config, "isCustomElement", {
- get() {
- return isCustomElement;
- },
- set() {
- warn(
- `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
- );
- }
- });
- const compilerOptions = app.config.compilerOptions;
- const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
-- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
-- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
-- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
- Object.defineProperty(app.config, "compilerOptions", {
- get() {
- warn(msg);
- return compilerOptions;
- },
- set() {
- warn(msg);
- }
- });
- }
- }
- function normalizeContainer(container) {
- if (isString(container)) {
- const res = document.querySelector(container);
- if (!res) {
- warn(
- `Failed to mount app: mount target selector "${container}" returned null.`
- );
- }
- return res;
- }
- if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
- warn(
- `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
- );
- }
- return container;
- }
- const initDirectivesForSSR = NOOP;
-
- function initDev() {
- {
- {
- console.info(
- `You are running a development build of Vue.
-Make sure to use the production build (*.prod.js) when deploying for production.`
- );
- }
- initCustomFormatter();
- }
- }
-
- const FRAGMENT = Symbol(`Fragment` );
- const TELEPORT = Symbol(`Teleport` );
- const SUSPENSE = Symbol(`Suspense` );
- const KEEP_ALIVE = Symbol(`KeepAlive` );
- const BASE_TRANSITION = Symbol(
- `BaseTransition`
- );
- const OPEN_BLOCK = Symbol(`openBlock` );
- const CREATE_BLOCK = Symbol(`createBlock` );
- const CREATE_ELEMENT_BLOCK = Symbol(
- `createElementBlock`
- );
- const CREATE_VNODE = Symbol(`createVNode` );
- const CREATE_ELEMENT_VNODE = Symbol(
- `createElementVNode`
- );
- const CREATE_COMMENT = Symbol(
- `createCommentVNode`
- );
- const CREATE_TEXT = Symbol(
- `createTextVNode`
- );
- const CREATE_STATIC = Symbol(
- `createStaticVNode`
- );
- const RESOLVE_COMPONENT = Symbol(
- `resolveComponent`
- );
- const RESOLVE_DYNAMIC_COMPONENT = Symbol(
- `resolveDynamicComponent`
- );
- const RESOLVE_DIRECTIVE = Symbol(
- `resolveDirective`
- );
- const RESOLVE_FILTER = Symbol(
- `resolveFilter`
- );
- const WITH_DIRECTIVES = Symbol(
- `withDirectives`
- );
- const RENDER_LIST = Symbol(`renderList` );
- const RENDER_SLOT = Symbol(`renderSlot` );
- const CREATE_SLOTS = Symbol(`createSlots` );
- const TO_DISPLAY_STRING = Symbol(
- `toDisplayString`
- );
- const MERGE_PROPS = Symbol(`mergeProps` );
- const NORMALIZE_CLASS = Symbol(
- `normalizeClass`
- );
- const NORMALIZE_STYLE = Symbol(
- `normalizeStyle`
- );
- const NORMALIZE_PROPS = Symbol(
- `normalizeProps`
- );
- const GUARD_REACTIVE_PROPS = Symbol(
- `guardReactiveProps`
- );
- const TO_HANDLERS = Symbol(`toHandlers` );
- const CAMELIZE = Symbol(`camelize` );
- const CAPITALIZE = Symbol(`capitalize` );
- const TO_HANDLER_KEY = Symbol(
- `toHandlerKey`
- );
- const SET_BLOCK_TRACKING = Symbol(
- `setBlockTracking`
- );
- const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
- const POP_SCOPE_ID = Symbol(`popScopeId` );
- const WITH_CTX = Symbol(`withCtx` );
- const UNREF = Symbol(`unref` );
- const IS_REF = Symbol(`isRef` );
- const WITH_MEMO = Symbol(`withMemo` );
- const IS_MEMO_SAME = Symbol(`isMemoSame` );
- const helperNameMap = {
- [FRAGMENT]: `Fragment`,
- [TELEPORT]: `Teleport`,
- [SUSPENSE]: `Suspense`,
- [KEEP_ALIVE]: `KeepAlive`,
- [BASE_TRANSITION]: `BaseTransition`,
- [OPEN_BLOCK]: `openBlock`,
- [CREATE_BLOCK]: `createBlock`,
- [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
- [CREATE_VNODE]: `createVNode`,
- [CREATE_ELEMENT_VNODE]: `createElementVNode`,
- [CREATE_COMMENT]: `createCommentVNode`,
- [CREATE_TEXT]: `createTextVNode`,
- [CREATE_STATIC]: `createStaticVNode`,
- [RESOLVE_COMPONENT]: `resolveComponent`,
- [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
- [RESOLVE_DIRECTIVE]: `resolveDirective`,
- [RESOLVE_FILTER]: `resolveFilter`,
- [WITH_DIRECTIVES]: `withDirectives`,
- [RENDER_LIST]: `renderList`,
- [RENDER_SLOT]: `renderSlot`,
- [CREATE_SLOTS]: `createSlots`,
- [TO_DISPLAY_STRING]: `toDisplayString`,
- [MERGE_PROPS]: `mergeProps`,
- [NORMALIZE_CLASS]: `normalizeClass`,
- [NORMALIZE_STYLE]: `normalizeStyle`,
- [NORMALIZE_PROPS]: `normalizeProps`,
- [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
- [TO_HANDLERS]: `toHandlers`,
- [CAMELIZE]: `camelize`,
- [CAPITALIZE]: `capitalize`,
- [TO_HANDLER_KEY]: `toHandlerKey`,
- [SET_BLOCK_TRACKING]: `setBlockTracking`,
- [PUSH_SCOPE_ID]: `pushScopeId`,
- [POP_SCOPE_ID]: `popScopeId`,
- [WITH_CTX]: `withCtx`,
- [UNREF]: `unref`,
- [IS_REF]: `isRef`,
- [WITH_MEMO]: `withMemo`,
- [IS_MEMO_SAME]: `isMemoSame`
- };
- function registerRuntimeHelpers(helpers) {
- Object.getOwnPropertySymbols(helpers).forEach((s) => {
- helperNameMap[s] = helpers[s];
- });
- }
-
- const locStub = {
- start: { line: 1, column: 1, offset: 0 },
- end: { line: 1, column: 1, offset: 0 },
- source: ""
- };
- function createRoot(children, source = "") {
- return {
- type: 0,
- source,
- children,
- helpers: /* @__PURE__ */ new Set(),
- components: [],
- directives: [],
- hoists: [],
- imports: [],
- cached: [],
- temps: 0,
- codegenNode: void 0,
- loc: locStub
- };
- }
- function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
- if (context) {
- if (isBlock) {
- context.helper(OPEN_BLOCK);
- context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
- } else {
- context.helper(getVNodeHelper(context.inSSR, isComponent));
- }
- if (directives) {
- context.helper(WITH_DIRECTIVES);
- }
- }
- return {
- type: 13,
- tag,
- props,
- children,
- patchFlag,
- dynamicProps,
- directives,
- isBlock,
- disableTracking,
- isComponent,
- loc
- };
- }
- function createArrayExpression(elements, loc = locStub) {
- return {
- type: 17,
- loc,
- elements
- };
- }
- function createObjectExpression(properties, loc = locStub) {
- return {
- type: 15,
- loc,
- properties
- };
- }
- function createObjectProperty(key, value) {
- return {
- type: 16,
- loc: locStub,
- key: isString(key) ? createSimpleExpression(key, true) : key,
- value
- };
- }
- function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
- return {
- type: 4,
- loc,
- content,
- isStatic,
- constType: isStatic ? 3 : constType
- };
- }
- function createCompoundExpression(children, loc = locStub) {
- return {
- type: 8,
- loc,
- children
- };
- }
- function createCallExpression(callee, args = [], loc = locStub) {
- return {
- type: 14,
- loc,
- callee,
- arguments: args
- };
- }
- function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
- return {
- type: 18,
- params,
- returns,
- newline,
- isSlot,
- loc
- };
- }
- function createConditionalExpression(test, consequent, alternate, newline = true) {
- return {
- type: 19,
- test,
- consequent,
- alternate,
- newline,
- loc: locStub
- };
- }
- function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
- return {
- type: 20,
- index,
- value,
- needPauseTracking,
- inVOnce,
- needArraySpread: false,
- loc: locStub
- };
- }
- function createBlockStatement(body) {
- return {
- type: 21,
- body,
- loc: locStub
- };
- }
- function getVNodeHelper(ssr, isComponent) {
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
- }
- function getVNodeBlockHelper(ssr, isComponent) {
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
- }
- function convertToBlock(node, { helper, removeHelper, inSSR }) {
- if (!node.isBlock) {
- node.isBlock = true;
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
- helper(OPEN_BLOCK);
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
- }
- }
-
- const defaultDelimitersOpen = new Uint8Array([123, 123]);
- const defaultDelimitersClose = new Uint8Array([125, 125]);
- function isTagStartChar(c) {
- return c >= 97 && c <= 122 || c >= 65 && c <= 90;
- }
- function isWhitespace(c) {
- return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
- }
- function isEndOfTagSection(c) {
- return c === 47 || c === 62 || isWhitespace(c);
- }
- function toCharCodes(str) {
- const ret = new Uint8Array(str.length);
- for (let i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret;
- }
- const Sequences = {
- Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
- // CDATA[
- CdataEnd: new Uint8Array([93, 93, 62]),
- // ]]>
- CommentEnd: new Uint8Array([45, 45, 62]),
- // `-->`
- ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
- // `<\/script`
- StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
- // `</style`
- TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
- // `</title`
- TextareaEnd: new Uint8Array([
- 60,
- 47,
- 116,
- 101,
- 120,
- 116,
- 97,
- 114,
- 101,
- 97
- ])
- // `</textarea
- };
- class Tokenizer {
- constructor(stack, cbs) {
- this.stack = stack;
- this.cbs = cbs;
- /** The current state the tokenizer is in. */
- this.state = 1;
- /** The read buffer. */
- this.buffer = "";
- /** The beginning of the section that is currently being read. */
- this.sectionStart = 0;
- /** The index within the buffer that we are currently looking at. */
- this.index = 0;
- /** The start of the last entity. */
- this.entityStart = 0;
- /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */
- this.baseState = 1;
- /** For special parsing behavior inside of script and style tags. */
- this.inRCDATA = false;
- /** For disabling RCDATA tags handling */
- this.inXML = false;
- /** For disabling interpolation parsing in v-pre */
- this.inVPre = false;
- /** Record newline positions for fast line / column calculation */
- this.newlines = [];
- this.mode = 0;
- this.delimiterOpen = defaultDelimitersOpen;
- this.delimiterClose = defaultDelimitersClose;
- this.delimiterIndex = -1;
- this.currentSequence = void 0;
- this.sequenceIndex = 0;
- }
- get inSFCRoot() {
- return this.mode === 2 && this.stack.length === 0;
- }
- reset() {
- this.state = 1;
- this.mode = 0;
- this.buffer = "";
- this.sectionStart = 0;
- this.index = 0;
- this.baseState = 1;
- this.inRCDATA = false;
- this.currentSequence = void 0;
- this.newlines.length = 0;
- this.delimiterOpen = defaultDelimitersOpen;
- this.delimiterClose = defaultDelimitersClose;
- }
- /**
- * Generate Position object with line / column information using recorded
- * newline positions. We know the index is always going to be an already
- * processed index, so all the newlines up to this index should have been
- * recorded.
- */
- getPos(index) {
- let line = 1;
- let column = index + 1;
- for (let i = this.newlines.length - 1; i >= 0; i--) {
- const newlineIndex = this.newlines[i];
- if (index > newlineIndex) {
- line = i + 2;
- column = index - newlineIndex;
- break;
- }
- }
- return {
- column,
- line,
- offset: index
- };
- }
- peek() {
- return this.buffer.charCodeAt(this.index + 1);
- }
- stateText(c) {
- if (c === 60) {
- if (this.index > this.sectionStart) {
- this.cbs.ontext(this.sectionStart, this.index);
- }
- this.state = 5;
- this.sectionStart = this.index;
- } else if (!this.inVPre && c === this.delimiterOpen[0]) {
- this.state = 2;
- this.delimiterIndex = 0;
- this.stateInterpolationOpen(c);
- }
- }
- stateInterpolationOpen(c) {
- if (c === this.delimiterOpen[this.delimiterIndex]) {
- if (this.delimiterIndex === this.delimiterOpen.length - 1) {
- const start = this.index + 1 - this.delimiterOpen.length;
- if (start > this.sectionStart) {
- this.cbs.ontext(this.sectionStart, start);
- }
- this.state = 3;
- this.sectionStart = start;
- } else {
- this.delimiterIndex++;
- }
- } else if (this.inRCDATA) {
- this.state = 32;
- this.stateInRCDATA(c);
- } else {
- this.state = 1;
- this.stateText(c);
- }
- }
- stateInterpolation(c) {
- if (c === this.delimiterClose[0]) {
- this.state = 4;
- this.delimiterIndex = 0;
- this.stateInterpolationClose(c);
- }
- }
- stateInterpolationClose(c) {
- if (c === this.delimiterClose[this.delimiterIndex]) {
- if (this.delimiterIndex === this.delimiterClose.length - 1) {
- this.cbs.oninterpolation(this.sectionStart, this.index + 1);
- if (this.inRCDATA) {
- this.state = 32;
- } else {
- this.state = 1;
- }
- this.sectionStart = this.index + 1;
- } else {
- this.delimiterIndex++;
- }
- } else {
- this.state = 3;
- this.stateInterpolation(c);
- }
- }
- stateSpecialStartSequence(c) {
- const isEnd = this.sequenceIndex === this.currentSequence.length;
- const isMatch = isEnd ? (
- // If we are at the end of the sequence, make sure the tag name has ended
- isEndOfTagSection(c)
- ) : (
- // Otherwise, do a case-insensitive comparison
- (c | 32) === this.currentSequence[this.sequenceIndex]
- );
- if (!isMatch) {
- this.inRCDATA = false;
- } else if (!isEnd) {
- this.sequenceIndex++;
- return;
- }
- this.sequenceIndex = 0;
- this.state = 6;
- this.stateInTagName(c);
- }
- /** Look for an end tag. For <title> and <textarea>, also decode entities. */
- stateInRCDATA(c) {
- if (this.sequenceIndex === this.currentSequence.length) {
- if (c === 62 || isWhitespace(c)) {
- const endOfText = this.index - this.currentSequence.length;
- if (this.sectionStart < endOfText) {
- const actualIndex = this.index;
- this.index = endOfText;
- this.cbs.ontext(this.sectionStart, endOfText);
- this.index = actualIndex;
- }
- this.sectionStart = endOfText + 2;
- this.stateInClosingTagName(c);
- this.inRCDATA = false;
- return;
- }
- this.sequenceIndex = 0;
- }
- if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
- this.sequenceIndex += 1;
- } else if (this.sequenceIndex === 0) {
- if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
- if (!this.inVPre && c === this.delimiterOpen[0]) {
- this.state = 2;
- this.delimiterIndex = 0;
- this.stateInterpolationOpen(c);
- }
- } else if (this.fastForwardTo(60)) {
- this.sequenceIndex = 1;
- }
- } else {
- this.sequenceIndex = Number(c === 60);
- }
- }
- stateCDATASequence(c) {
- if (c === Sequences.Cdata[this.sequenceIndex]) {
- if (++this.sequenceIndex === Sequences.Cdata.length) {
- this.state = 28;
- this.currentSequence = Sequences.CdataEnd;
- this.sequenceIndex = 0;
- this.sectionStart = this.index + 1;
- }
- } else {
- this.sequenceIndex = 0;
- this.state = 23;
- this.stateInDeclaration(c);
- }
- }
- /**
- * When we wait for one specific character, we can speed things up
- * by skipping through the buffer until we find it.
- *
- * @returns Whether the character was found.
- */
- fastForwardTo(c) {
- while (++this.index < this.buffer.length) {
- const cc = this.buffer.charCodeAt(this.index);
- if (cc === 10) {
- this.newlines.push(this.index);
- }
- if (cc === c) {
- return true;
- }
- }
- this.index = this.buffer.length - 1;
- return false;
- }
- /**
- * Comments and CDATA end with `-->` and `]]>`.
- *
- * Their common qualities are:
- * - Their end sequences have a distinct character they start with.
- * - That character is then repeated, so we have to check multiple repeats.
- * - All characters but the start character of the sequence can be skipped.
- */
- stateInCommentLike(c) {
- if (c === this.currentSequence[this.sequenceIndex]) {
- if (++this.sequenceIndex === this.currentSequence.length) {
- if (this.currentSequence === Sequences.CdataEnd) {
- this.cbs.oncdata(this.sectionStart, this.index - 2);
- } else {
- this.cbs.oncomment(this.sectionStart, this.index - 2);
- }
- this.sequenceIndex = 0;
- this.sectionStart = this.index + 1;
- this.state = 1;
- }
- } else if (this.sequenceIndex === 0) {
- if (this.fastForwardTo(this.currentSequence[0])) {
- this.sequenceIndex = 1;
- }
- } else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
- this.sequenceIndex = 0;
- }
- }
- startSpecial(sequence, offset) {
- this.enterRCDATA(sequence, offset);
- this.state = 31;
- }
- enterRCDATA(sequence, offset) {
- this.inRCDATA = true;
- this.currentSequence = sequence;
- this.sequenceIndex = offset;
- }
- stateBeforeTagName(c) {
- if (c === 33) {
- this.state = 22;
- this.sectionStart = this.index + 1;
- } else if (c === 63) {
- this.state = 24;
- this.sectionStart = this.index + 1;
- } else if (isTagStartChar(c)) {
- this.sectionStart = this.index;
- if (this.mode === 0) {
- this.state = 6;
- } else if (this.inSFCRoot) {
- this.state = 34;
- } else if (!this.inXML) {
- if (c === 116) {
- this.state = 30;
- } else {
- this.state = c === 115 ? 29 : 6;
- }
- } else {
- this.state = 6;
- }
- } else if (c === 47) {
- this.state = 8;
- } else {
- this.state = 1;
- this.stateText(c);
- }
- }
- stateInTagName(c) {
- if (isEndOfTagSection(c)) {
- this.handleTagName(c);
- }
- }
- stateInSFCRootTagName(c) {
- if (isEndOfTagSection(c)) {
- const tag = this.buffer.slice(this.sectionStart, this.index);
- if (tag !== "template") {
- this.enterRCDATA(toCharCodes(`</` + tag), 0);
- }
- this.handleTagName(c);
- }
- }
- handleTagName(c) {
- this.cbs.onopentagname(this.sectionStart, this.index);
- this.sectionStart = -1;
- this.state = 11;
- this.stateBeforeAttrName(c);
- }
- stateBeforeClosingTagName(c) {
- if (isWhitespace(c)) ; else if (c === 62) {
- {
- this.cbs.onerr(14, this.index);
- }
- this.state = 1;
- this.sectionStart = this.index + 1;
- } else {
- this.state = isTagStartChar(c) ? 9 : 27;
- this.sectionStart = this.index;
- }
- }
- stateInClosingTagName(c) {
- if (c === 62 || isWhitespace(c)) {
- this.cbs.onclosetag(this.sectionStart, this.index);
- this.sectionStart = -1;
- this.state = 10;
- this.stateAfterClosingTagName(c);
- }
- }
- stateAfterClosingTagName(c) {
- if (c === 62) {
- this.state = 1;
- this.sectionStart = this.index + 1;
- }
- }
- stateBeforeAttrName(c) {
- if (c === 62) {
- this.cbs.onopentagend(this.index);
- if (this.inRCDATA) {
- this.state = 32;
- } else {
- this.state = 1;
- }
- this.sectionStart = this.index + 1;
- } else if (c === 47) {
- this.state = 7;
- if (this.peek() !== 62) {
- this.cbs.onerr(22, this.index);
- }
- } else if (c === 60 && this.peek() === 47) {
- this.cbs.onopentagend(this.index);
- this.state = 5;
- this.sectionStart = this.index;
- } else if (!isWhitespace(c)) {
- if (c === 61) {
- this.cbs.onerr(
- 19,
- this.index
- );
- }
- this.handleAttrStart(c);
- }
- }
- handleAttrStart(c) {
- if (c === 118 && this.peek() === 45) {
- this.state = 13;
- this.sectionStart = this.index;
- } else if (c === 46 || c === 58 || c === 64 || c === 35) {
- this.cbs.ondirname(this.index, this.index + 1);
- this.state = 14;
- this.sectionStart = this.index + 1;
- } else {
- this.state = 12;
- this.sectionStart = this.index;
- }
- }
- stateInSelfClosingTag(c) {
- if (c === 62) {
- this.cbs.onselfclosingtag(this.index);
- this.state = 1;
- this.sectionStart = this.index + 1;
- this.inRCDATA = false;
- } else if (!isWhitespace(c)) {
- this.state = 11;
- this.stateBeforeAttrName(c);
- }
- }
- stateInAttrName(c) {
- if (c === 61 || isEndOfTagSection(c)) {
- this.cbs.onattribname(this.sectionStart, this.index);
- this.handleAttrNameEnd(c);
- } else if (c === 34 || c === 39 || c === 60) {
- this.cbs.onerr(
- 17,
- this.index
- );
- }
- }
- stateInDirName(c) {
- if (c === 61 || isEndOfTagSection(c)) {
- this.cbs.ondirname(this.sectionStart, this.index);
- this.handleAttrNameEnd(c);
- } else if (c === 58) {
- this.cbs.ondirname(this.sectionStart, this.index);
- this.state = 14;
- this.sectionStart = this.index + 1;
- } else if (c === 46) {
- this.cbs.ondirname(this.sectionStart, this.index);
- this.state = 16;
- this.sectionStart = this.index + 1;
- }
- }
- stateInDirArg(c) {
- if (c === 61 || isEndOfTagSection(c)) {
- this.cbs.ondirarg(this.sectionStart, this.index);
- this.handleAttrNameEnd(c);
- } else if (c === 91) {
- this.state = 15;
- } else if (c === 46) {
- this.cbs.ondirarg(this.sectionStart, this.index);
- this.state = 16;
- this.sectionStart = this.index + 1;
- }
- }
- stateInDynamicDirArg(c) {
- if (c === 93) {
- this.state = 14;
- } else if (c === 61 || isEndOfTagSection(c)) {
- this.cbs.ondirarg(this.sectionStart, this.index + 1);
- this.handleAttrNameEnd(c);
- {
- this.cbs.onerr(
- 27,
- this.index
- );
- }
- }
- }
- stateInDirModifier(c) {
- if (c === 61 || isEndOfTagSection(c)) {
- this.cbs.ondirmodifier(this.sectionStart, this.index);
- this.handleAttrNameEnd(c);
- } else if (c === 46) {
- this.cbs.ondirmodifier(this.sectionStart, this.index);
- this.sectionStart = this.index + 1;
- }
- }
- handleAttrNameEnd(c) {
- this.sectionStart = this.index;
- this.state = 17;
- this.cbs.onattribnameend(this.index);
- this.stateAfterAttrName(c);
- }
- stateAfterAttrName(c) {
- if (c === 61) {
- this.state = 18;
- } else if (c === 47 || c === 62) {
- this.cbs.onattribend(0, this.sectionStart);
- this.sectionStart = -1;
- this.state = 11;
- this.stateBeforeAttrName(c);
- } else if (!isWhitespace(c)) {
- this.cbs.onattribend(0, this.sectionStart);
- this.handleAttrStart(c);
- }
- }
- stateBeforeAttrValue(c) {
- if (c === 34) {
- this.state = 19;
- this.sectionStart = this.index + 1;
- } else if (c === 39) {
- this.state = 20;
- this.sectionStart = this.index + 1;
- } else if (!isWhitespace(c)) {
- this.sectionStart = this.index;
- this.state = 21;
- this.stateInAttrValueNoQuotes(c);
- }
- }
- handleInAttrValue(c, quote) {
- if (c === quote || this.fastForwardTo(quote)) {
- this.cbs.onattribdata(this.sectionStart, this.index);
- this.sectionStart = -1;
- this.cbs.onattribend(
- quote === 34 ? 3 : 2,
- this.index + 1
- );
- this.state = 11;
- }
- }
- stateInAttrValueDoubleQuotes(c) {
- this.handleInAttrValue(c, 34);
- }
- stateInAttrValueSingleQuotes(c) {
- this.handleInAttrValue(c, 39);
- }
- stateInAttrValueNoQuotes(c) {
- if (isWhitespace(c) || c === 62) {
- this.cbs.onattribdata(this.sectionStart, this.index);
- this.sectionStart = -1;
- this.cbs.onattribend(1, this.index);
- this.state = 11;
- this.stateBeforeAttrName(c);
- } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) {
- this.cbs.onerr(
- 18,
- this.index
- );
- } else ;
- }
- stateBeforeDeclaration(c) {
- if (c === 91) {
- this.state = 26;
- this.sequenceIndex = 0;
- } else {
- this.state = c === 45 ? 25 : 23;
- }
- }
- stateInDeclaration(c) {
- if (c === 62 || this.fastForwardTo(62)) {
- this.state = 1;
- this.sectionStart = this.index + 1;
- }
- }
- stateInProcessingInstruction(c) {
- if (c === 62 || this.fastForwardTo(62)) {
- this.cbs.onprocessinginstruction(this.sectionStart, this.index);
- this.state = 1;
- this.sectionStart = this.index + 1;
- }
- }
- stateBeforeComment(c) {
- if (c === 45) {
- this.state = 28;
- this.currentSequence = Sequences.CommentEnd;
- this.sequenceIndex = 2;
- this.sectionStart = this.index + 1;
- } else {
- this.state = 23;
- }
- }
- stateInSpecialComment(c) {
- if (c === 62 || this.fastForwardTo(62)) {
- this.cbs.oncomment(this.sectionStart, this.index);
- this.state = 1;
- this.sectionStart = this.index + 1;
- }
- }
- stateBeforeSpecialS(c) {
- if (c === Sequences.ScriptEnd[3]) {
- this.startSpecial(Sequences.ScriptEnd, 4);
- } else if (c === Sequences.StyleEnd[3]) {
- this.startSpecial(Sequences.StyleEnd, 4);
- } else {
- this.state = 6;
- this.stateInTagName(c);
- }
- }
- stateBeforeSpecialT(c) {
- if (c === Sequences.TitleEnd[3]) {
- this.startSpecial(Sequences.TitleEnd, 4);
- } else if (c === Sequences.TextareaEnd[3]) {
- this.startSpecial(Sequences.TextareaEnd, 4);
- } else {
- this.state = 6;
- this.stateInTagName(c);
- }
- }
- startEntity() {
- }
- stateInEntity() {
- }
- /**
- * Iterates through the buffer, calling the function corresponding to the current state.
- *
- * States that are more likely to be hit are higher up, as a performance improvement.
- */
- parse(input) {
- this.buffer = input;
- while (this.index < this.buffer.length) {
- const c = this.buffer.charCodeAt(this.index);
- if (c === 10) {
- this.newlines.push(this.index);
- }
- switch (this.state) {
- case 1: {
- this.stateText(c);
- break;
- }
- case 2: {
- this.stateInterpolationOpen(c);
- break;
- }
- case 3: {
- this.stateInterpolation(c);
- break;
- }
- case 4: {
- this.stateInterpolationClose(c);
- break;
- }
- case 31: {
- this.stateSpecialStartSequence(c);
- break;
- }
- case 32: {
- this.stateInRCDATA(c);
- break;
- }
- case 26: {
- this.stateCDATASequence(c);
- break;
- }
- case 19: {
- this.stateInAttrValueDoubleQuotes(c);
- break;
- }
- case 12: {
- this.stateInAttrName(c);
- break;
- }
- case 13: {
- this.stateInDirName(c);
- break;
- }
- case 14: {
- this.stateInDirArg(c);
- break;
- }
- case 15: {
- this.stateInDynamicDirArg(c);
- break;
- }
- case 16: {
- this.stateInDirModifier(c);
- break;
- }
- case 28: {
- this.stateInCommentLike(c);
- break;
- }
- case 27: {
- this.stateInSpecialComment(c);
- break;
- }
- case 11: {
- this.stateBeforeAttrName(c);
- break;
- }
- case 6: {
- this.stateInTagName(c);
- break;
- }
- case 34: {
- this.stateInSFCRootTagName(c);
- break;
- }
- case 9: {
- this.stateInClosingTagName(c);
- break;
- }
- case 5: {
- this.stateBeforeTagName(c);
- break;
- }
- case 17: {
- this.stateAfterAttrName(c);
- break;
- }
- case 20: {
- this.stateInAttrValueSingleQuotes(c);
- break;
- }
- case 18: {
- this.stateBeforeAttrValue(c);
- break;
- }
- case 8: {
- this.stateBeforeClosingTagName(c);
- break;
- }
- case 10: {
- this.stateAfterClosingTagName(c);
- break;
- }
- case 29: {
- this.stateBeforeSpecialS(c);
- break;
- }
- case 30: {
- this.stateBeforeSpecialT(c);
- break;
- }
- case 21: {
- this.stateInAttrValueNoQuotes(c);
- break;
- }
- case 7: {
- this.stateInSelfClosingTag(c);
- break;
- }
- case 23: {
- this.stateInDeclaration(c);
- break;
- }
- case 22: {
- this.stateBeforeDeclaration(c);
- break;
- }
- case 25: {
- this.stateBeforeComment(c);
- break;
- }
- case 24: {
- this.stateInProcessingInstruction(c);
- break;
- }
- case 33: {
- this.stateInEntity();
- break;
- }
- }
- this.index++;
- }
- this.cleanup();
- this.finish();
- }
- /**
- * Remove data that has already been consumed from the buffer.
- */
- cleanup() {
- if (this.sectionStart !== this.index) {
- if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) {
- this.cbs.ontext(this.sectionStart, this.index);
- this.sectionStart = this.index;
- } else if (this.state === 19 || this.state === 20 || this.state === 21) {
- this.cbs.onattribdata(this.sectionStart, this.index);
- this.sectionStart = this.index;
- }
- }
- }
- finish() {
- this.handleTrailingData();
- this.cbs.onend();
- }
- /** Handle any trailing data. */
- handleTrailingData() {
- const endIndex = this.buffer.length;
- if (this.sectionStart >= endIndex) {
- return;
- }
- if (this.state === 28) {
- if (this.currentSequence === Sequences.CdataEnd) {
- this.cbs.oncdata(this.sectionStart, endIndex);
- } else {
- this.cbs.oncomment(this.sectionStart, endIndex);
- }
- } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else {
- this.cbs.ontext(this.sectionStart, endIndex);
- }
- }
- emitCodePoint(cp, consumed) {
- }
- }
-
- function defaultOnError(error) {
- throw error;
- }
- function defaultOnWarn(msg) {
- console.warn(`[Vue warn] ${msg.message}`);
- }
- function createCompilerError(code, loc, messages, additionalMessage) {
- const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ;
- const error = new SyntaxError(String(msg));
- error.code = code;
- error.loc = loc;
- return error;
- }
- const errorMessages = {
- // parse errors
- [0]: "Illegal comment.",
- [1]: "CDATA section is allowed only in XML context.",
- [2]: "Duplicate attribute.",
- [3]: "End tag cannot have attributes.",
- [4]: "Illegal '/' in tags.",
- [5]: "Unexpected EOF in tag.",
- [6]: "Unexpected EOF in CDATA section.",
- [7]: "Unexpected EOF in comment.",
- [8]: "Unexpected EOF in script.",
- [9]: "Unexpected EOF in tag.",
- [10]: "Incorrectly closed comment.",
- [11]: "Incorrectly opened comment.",
- [12]: "Illegal tag name. Use '&lt;' to print '<'.",
- [13]: "Attribute value was expected.",
- [14]: "End tag name was expected.",
- [15]: "Whitespace was expected.",
- [16]: "Unexpected '<!--' in comment.",
- [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
- [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
- [19]: "Attribute name cannot start with '='.",
- [21]: "'<?' is allowed only in XML context.",
- [20]: `Unexpected null character.`,
- [22]: "Illegal '/' in tags.",
- // Vue-specific parse errors
- [23]: "Invalid end tag.",
- [24]: "Element is missing end tag.",
- [25]: "Interpolation end sign was not found.",
- [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
- [26]: "Legal directive name was expected.",
- // transform errors
- [28]: `v-if/v-else-if is missing expression.`,
- [29]: `v-if/else branches must use unique keys.`,
- [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
- [31]: `v-for is missing expression.`,
- [32]: `v-for has invalid expression.`,
- [33]: `<template v-for> key should be placed on the <template> tag.`,
- [34]: `v-bind is missing expression.`,
- [52]: `v-bind with same-name shorthand only allows static argument.`,
- [35]: `v-on is missing expression.`,
- [36]: `Unexpected custom directive on <slot> outlet.`,
- [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
- [38]: `Duplicate slot names found. `,
- [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
- [40]: `v-slot can only be used on components or <template> tags.`,
- [41]: `v-model is missing expression.`,
- [42]: `v-model value must be a valid JavaScript member expression.`,
- [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
- [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
-Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
- [45]: `Error parsing JavaScript expression: `,
- [46]: `<KeepAlive> expects exactly one child component.`,
- [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
- // generic errors
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
- [48]: `ES module mode is not supported in this build of compiler.`,
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
- [50]: `"scopeId" option is only supported in module mode.`,
- // just to fulfill types
- [53]: ``
- };
-
- const isStaticExp = (p) => p.type === 4 && p.isStatic;
- function isCoreComponent(tag) {
- switch (tag) {
- case "Teleport":
- case "teleport":
- return TELEPORT;
- case "Suspense":
- case "suspense":
- return SUSPENSE;
- case "KeepAlive":
- case "keep-alive":
- return KEEP_ALIVE;
- case "BaseTransition":
- case "base-transition":
- return BASE_TRANSITION;
- }
- }
- const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
- const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
- const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
- const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
- const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
- const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
- const isMemberExpressionBrowser = (exp) => {
- const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
- let state = 0 /* inMemberExp */;
- let stateStack = [];
- let currentOpenBracketCount = 0;
- let currentOpenParensCount = 0;
- let currentStringType = null;
- for (let i = 0; i < path.length; i++) {
- const char = path.charAt(i);
- switch (state) {
- case 0 /* inMemberExp */:
- if (char === "[") {
- stateStack.push(state);
- state = 1 /* inBrackets */;
- currentOpenBracketCount++;
- } else if (char === "(") {
- stateStack.push(state);
- state = 2 /* inParens */;
- currentOpenParensCount++;
- } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
- return false;
- }
- break;
- case 1 /* inBrackets */:
- if (char === `'` || char === `"` || char === "`") {
- stateStack.push(state);
- state = 3 /* inString */;
- currentStringType = char;
- } else if (char === `[`) {
- currentOpenBracketCount++;
- } else if (char === `]`) {
- if (!--currentOpenBracketCount) {
- state = stateStack.pop();
- }
- }
- break;
- case 2 /* inParens */:
- if (char === `'` || char === `"` || char === "`") {
- stateStack.push(state);
- state = 3 /* inString */;
- currentStringType = char;
- } else if (char === `(`) {
- currentOpenParensCount++;
- } else if (char === `)`) {
- if (i === path.length - 1) {
- return false;
- }
- if (!--currentOpenParensCount) {
- state = stateStack.pop();
- }
- }
- break;
- case 3 /* inString */:
- if (char === currentStringType) {
- state = stateStack.pop();
- currentStringType = null;
- }
- break;
- }
- }
- return !currentOpenBracketCount && !currentOpenParensCount;
- };
- const isMemberExpression = isMemberExpressionBrowser ;
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
- const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
- const isFnExpression = isFnExpressionBrowser ;
- function assert(condition, msg) {
- if (!condition) {
- throw new Error(msg || `unexpected compiler condition`);
- }
- }
- function findDir(node, name, allowEmpty = false) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
- return p;
- }
- }
- }
- function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 6) {
- if (dynamicOnly) continue;
- if (p.name === name && (p.value || allowEmpty)) {
- return p;
- }
- } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) {
- return p;
- }
- }
- }
- function isStaticArgOf(arg, name) {
- return !!(arg && isStaticExp(arg) && arg.content === name);
- }
- function hasDynamicKeyVBind(node) {
- return node.props.some(
- (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
- p.arg.type !== 4 || // v-bind:[_ctx.foo]
- !p.arg.isStatic)
- // v-bind:[foo]
- );
- }
- function isText$1(node) {
- return node.type === 5 || node.type === 2;
- }
- function isVSlot(p) {
- return p.type === 7 && p.name === "slot";
- }
- function isTemplateNode(node) {
- return node.type === 1 && node.tagType === 3;
- }
- function isSlotOutlet(node) {
- return node.type === 1 && node.tagType === 2;
- }
- const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
- function getUnnormalizedProps(props, callPath = []) {
- if (props && !isString(props) && props.type === 14) {
- const callee = props.callee;
- if (!isString(callee) && propsHelperSet.has(callee)) {
- return getUnnormalizedProps(
- props.arguments[0],
- callPath.concat(props)
- );
- }
- }
- return [props, callPath];
- }
- function injectProp(node, prop, context) {
- let propsWithInjection;
- let props = node.type === 13 ? node.props : node.arguments[2];
- let callPath = [];
- let parentCall;
- if (props && !isString(props) && props.type === 14) {
- const ret = getUnnormalizedProps(props);
- props = ret[0];
- callPath = ret[1];
- parentCall = callPath[callPath.length - 1];
- }
- if (props == null || isString(props)) {
- propsWithInjection = createObjectExpression([prop]);
- } else if (props.type === 14) {
- const first = props.arguments[0];
- if (!isString(first) && first.type === 15) {
- if (!hasProp(prop, first)) {
- first.properties.unshift(prop);
- }
- } else {
- if (props.callee === TO_HANDLERS) {
- propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
- createObjectExpression([prop]),
- props
- ]);
- } else {
- props.arguments.unshift(createObjectExpression([prop]));
- }
- }
- !propsWithInjection && (propsWithInjection = props);
- } else if (props.type === 15) {
- if (!hasProp(prop, props)) {
- props.properties.unshift(prop);
- }
- propsWithInjection = props;
- } else {
- propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
- createObjectExpression([prop]),
- props
- ]);
- if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
- parentCall = callPath[callPath.length - 2];
- }
- }
- if (node.type === 13) {
- if (parentCall) {
- parentCall.arguments[0] = propsWithInjection;
- } else {
- node.props = propsWithInjection;
- }
- } else {
- if (parentCall) {
- parentCall.arguments[0] = propsWithInjection;
- } else {
- node.arguments[2] = propsWithInjection;
- }
- }
- }
- function hasProp(prop, props) {
- let result = false;
- if (prop.key.type === 4) {
- const propKeyName = prop.key.content;
- result = props.properties.some(
- (p) => p.key.type === 4 && p.key.content === propKeyName
- );
- }
- return result;
- }
- function toValidAssetId(name, type) {
- return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
- return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString();
- })}`;
- }
- function getMemoedVNodeCall(node) {
- if (node.type === 14 && node.callee === WITH_MEMO) {
- return node.arguments[1].returns;
- } else {
- return node;
- }
- }
- const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
-
- const defaultParserOptions = {
- parseMode: "base",
- ns: 0,
- delimiters: [`{{`, `}}`],
- getNamespace: () => 0,
- isVoidTag: NO,
- isPreTag: NO,
- isIgnoreNewlineTag: NO,
- isCustomElement: NO,
- onError: defaultOnError,
- onWarn: defaultOnWarn,
- comments: true,
- prefixIdentifiers: false
- };
- let currentOptions = defaultParserOptions;
- let currentRoot = null;
- let currentInput = "";
- let currentOpenTag = null;
- let currentProp = null;
- let currentAttrValue = "";
- let currentAttrStartIndex = -1;
- let currentAttrEndIndex = -1;
- let inPre = 0;
- let inVPre = false;
- let currentVPreBoundary = null;
- const stack = [];
- const tokenizer = new Tokenizer(stack, {
- onerr: emitError,
- ontext(start, end) {
- onText(getSlice(start, end), start, end);
- },
- ontextentity(char, start, end) {
- onText(char, start, end);
- },
- oninterpolation(start, end) {
- if (inVPre) {
- return onText(getSlice(start, end), start, end);
- }
- let innerStart = start + tokenizer.delimiterOpen.length;
- let innerEnd = end - tokenizer.delimiterClose.length;
- while (isWhitespace(currentInput.charCodeAt(innerStart))) {
- innerStart++;
- }
- while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {
- innerEnd--;
- }
- let exp = getSlice(innerStart, innerEnd);
- if (exp.includes("&")) {
- {
- exp = currentOptions.decodeEntities(exp, false);
- }
- }
- addNode({
- type: 5,
- content: createExp(exp, false, getLoc(innerStart, innerEnd)),
- loc: getLoc(start, end)
- });
- },
- onopentagname(start, end) {
- const name = getSlice(start, end);
- currentOpenTag = {
- type: 1,
- tag: name,
- ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns),
- tagType: 0,
- // will be refined on tag close
- props: [],
- children: [],
- loc: getLoc(start - 1, end),
- codegenNode: void 0
- };
- },
- onopentagend(end) {
- endOpenTag(end);
- },
- onclosetag(start, end) {
- const name = getSlice(start, end);
- if (!currentOptions.isVoidTag(name)) {
- let found = false;
- for (let i = 0; i < stack.length; i++) {
- const e = stack[i];
- if (e.tag.toLowerCase() === name.toLowerCase()) {
- found = true;
- if (i > 0) {
- emitError(24, stack[0].loc.start.offset);
- }
- for (let j = 0; j <= i; j++) {
- const el = stack.shift();
- onCloseTag(el, end, j < i);
- }
- break;
- }
- }
- if (!found) {
- emitError(23, backTrack(start, 60));
- }
- }
- },
- onselfclosingtag(end) {
- const name = currentOpenTag.tag;
- currentOpenTag.isSelfClosing = true;
- endOpenTag(end);
- if (stack[0] && stack[0].tag === name) {
- onCloseTag(stack.shift(), end);
- }
- },
- onattribname(start, end) {
- currentProp = {
- type: 6,
- name: getSlice(start, end),
- nameLoc: getLoc(start, end),
- value: void 0,
- loc: getLoc(start)
- };
- },
- ondirname(start, end) {
- const raw = getSlice(start, end);
- const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2);
- if (!inVPre && name === "") {
- emitError(26, start);
- }
- if (inVPre || name === "") {
- currentProp = {
- type: 6,
- name: raw,
- nameLoc: getLoc(start, end),
- value: void 0,
- loc: getLoc(start)
- };
- } else {
- currentProp = {
- type: 7,
- name,
- rawName: raw,
- exp: void 0,
- arg: void 0,
- modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
- loc: getLoc(start)
- };
- if (name === "pre") {
- inVPre = tokenizer.inVPre = true;
- currentVPreBoundary = currentOpenTag;
- const props = currentOpenTag.props;
- for (let i = 0; i < props.length; i++) {
- if (props[i].type === 7) {
- props[i] = dirToAttr(props[i]);
- }
- }
- }
- }
- },
- ondirarg(start, end) {
- if (start === end) return;
- const arg = getSlice(start, end);
- if (inVPre) {
- currentProp.name += arg;
- setLocEnd(currentProp.nameLoc, end);
- } else {
- const isStatic = arg[0] !== `[`;
- currentProp.arg = createExp(
- isStatic ? arg : arg.slice(1, -1),
- isStatic,
- getLoc(start, end),
- isStatic ? 3 : 0
- );
- }
- },
- ondirmodifier(start, end) {
- const mod = getSlice(start, end);
- if (inVPre) {
- currentProp.name += "." + mod;
- setLocEnd(currentProp.nameLoc, end);
- } else if (currentProp.name === "slot") {
- const arg = currentProp.arg;
- if (arg) {
- arg.content += "." + mod;
- setLocEnd(arg.loc, end);
- }
- } else {
- const exp = createSimpleExpression(mod, true, getLoc(start, end));
- currentProp.modifiers.push(exp);
- }
- },
- onattribdata(start, end) {
- currentAttrValue += getSlice(start, end);
- if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
- currentAttrEndIndex = end;
- },
- onattribentity(char, start, end) {
- currentAttrValue += char;
- if (currentAttrStartIndex < 0) currentAttrStartIndex = start;
- currentAttrEndIndex = end;
- },
- onattribnameend(end) {
- const start = currentProp.loc.start.offset;
- const name = getSlice(start, end);
- if (currentProp.type === 7) {
- currentProp.rawName = name;
- }
- if (currentOpenTag.props.some(
- (p) => (p.type === 7 ? p.rawName : p.name) === name
- )) {
- emitError(2, start);
- }
- },
- onattribend(quote, end) {
- if (currentOpenTag && currentProp) {
- setLocEnd(currentProp.loc, end);
- if (quote !== 0) {
- if (currentAttrValue.includes("&")) {
- currentAttrValue = currentOptions.decodeEntities(
- currentAttrValue,
- true
- );
- }
- if (currentProp.type === 6) {
- if (currentProp.name === "class") {
- currentAttrValue = condense(currentAttrValue).trim();
- }
- if (quote === 1 && !currentAttrValue) {
- emitError(13, end);
- }
- currentProp.value = {
- type: 2,
- content: currentAttrValue,
- loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1)
- };
- if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") {
- tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
- }
- } else {
- let expParseMode = 0 /* Normal */;
- currentProp.exp = createExp(
- currentAttrValue,
- false,
- getLoc(currentAttrStartIndex, currentAttrEndIndex),
- 0,
- expParseMode
- );
- if (currentProp.name === "for") {
- currentProp.forParseResult = parseForExpression(currentProp.exp);
- }
- }
- }
- if (currentProp.type !== 7 || currentProp.name !== "pre") {
- currentOpenTag.props.push(currentProp);
- }
- }
- currentAttrValue = "";
- currentAttrStartIndex = currentAttrEndIndex = -1;
- },
- oncomment(start, end) {
- if (currentOptions.comments) {
- addNode({
- type: 3,
- content: getSlice(start, end),
- loc: getLoc(start - 4, end + 3)
- });
- }
- },
- onend() {
- const end = currentInput.length;
- if (tokenizer.state !== 1) {
- switch (tokenizer.state) {
- case 5:
- case 8:
- emitError(5, end);
- break;
- case 3:
- case 4:
- emitError(
- 25,
- tokenizer.sectionStart
- );
- break;
- case 28:
- if (tokenizer.currentSequence === Sequences.CdataEnd) {
- emitError(6, end);
- } else {
- emitError(7, end);
- }
- break;
- case 6:
- case 7:
- case 9:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- // "
- case 20:
- // '
- case 21:
- emitError(9, end);
- break;
- }
- }
- for (let index = 0; index < stack.length; index++) {
- onCloseTag(stack[index], end - 1);
- emitError(24, stack[index].loc.start.offset);
- }
- },
- oncdata(start, end) {
- if (stack[0].ns !== 0) {
- onText(getSlice(start, end), start, end);
- } else {
- emitError(1, start - 9);
- }
- },
- onprocessinginstruction(start) {
- if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
- emitError(
- 21,
- start - 1
- );
- }
- }
- });
- const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- const stripParensRE = /^\(|\)$/g;
- function parseForExpression(input) {
- const loc = input.loc;
- const exp = input.content;
- const inMatch = exp.match(forAliasRE);
- if (!inMatch) return;
- const [, LHS, RHS] = inMatch;
- const createAliasExpression = (content, offset, asParam = false) => {
- const start = loc.start.offset + offset;
- const end = start + content.length;
- return createExp(
- content,
- false,
- getLoc(start, end),
- 0,
- asParam ? 1 /* Params */ : 0 /* Normal */
- );
- };
- const result = {
- source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
- value: void 0,
- key: void 0,
- index: void 0,
- finalized: false
- };
- let valueContent = LHS.trim().replace(stripParensRE, "").trim();
- const trimmedOffset = LHS.indexOf(valueContent);
- const iteratorMatch = valueContent.match(forIteratorRE);
- if (iteratorMatch) {
- valueContent = valueContent.replace(forIteratorRE, "").trim();
- const keyContent = iteratorMatch[1].trim();
- let keyOffset;
- if (keyContent) {
- keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
- result.key = createAliasExpression(keyContent, keyOffset, true);
- }
- if (iteratorMatch[2]) {
- const indexContent = iteratorMatch[2].trim();
- if (indexContent) {
- result.index = createAliasExpression(
- indexContent,
- exp.indexOf(
- indexContent,
- result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
- ),
- true
- );
- }
- }
- }
- if (valueContent) {
- result.value = createAliasExpression(valueContent, trimmedOffset, true);
- }
- return result;
- }
- function getSlice(start, end) {
- return currentInput.slice(start, end);
- }
- function endOpenTag(end) {
- if (tokenizer.inSFCRoot) {
- currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
- }
- addNode(currentOpenTag);
- const { tag, ns } = currentOpenTag;
- if (ns === 0 && currentOptions.isPreTag(tag)) {
- inPre++;
- }
- if (currentOptions.isVoidTag(tag)) {
- onCloseTag(currentOpenTag, end);
- } else {
- stack.unshift(currentOpenTag);
- if (ns === 1 || ns === 2) {
- tokenizer.inXML = true;
- }
- }
- currentOpenTag = null;
- }
- function onText(content, start, end) {
- {
- const tag = stack[0] && stack[0].tag;
- if (tag !== "script" && tag !== "style" && content.includes("&")) {
- content = currentOptions.decodeEntities(content, false);
- }
- }
- const parent = stack[0] || currentRoot;
- const lastNode = parent.children[parent.children.length - 1];
- if (lastNode && lastNode.type === 2) {
- lastNode.content += content;
- setLocEnd(lastNode.loc, end);
- } else {
- parent.children.push({
- type: 2,
- content,
- loc: getLoc(start, end)
- });
- }
- }
- function onCloseTag(el, end, isImplied = false) {
- if (isImplied) {
- setLocEnd(el.loc, backTrack(end, 60));
- } else {
- setLocEnd(el.loc, lookAhead(end, 62) + 1);
- }
- if (tokenizer.inSFCRoot) {
- if (el.children.length) {
- el.innerLoc.end = extend({}, el.children[el.children.length - 1].loc.end);
- } else {
- el.innerLoc.end = extend({}, el.innerLoc.start);
- }
- el.innerLoc.source = getSlice(
- el.innerLoc.start.offset,
- el.innerLoc.end.offset
- );
- }
- const { tag, ns, children } = el;
- if (!inVPre) {
- if (tag === "slot") {
- el.tagType = 2;
- } else if (isFragmentTemplate(el)) {
- el.tagType = 3;
- } else if (isComponent(el)) {
- el.tagType = 1;
- }
- }
- if (!tokenizer.inRCDATA) {
- el.children = condenseWhitespace(children);
- }
- if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
- const first = children[0];
- if (first && first.type === 2) {
- first.content = first.content.replace(/^\r?\n/, "");
- }
- }
- if (ns === 0 && currentOptions.isPreTag(tag)) {
- inPre--;
- }
- if (currentVPreBoundary === el) {
- inVPre = tokenizer.inVPre = false;
- currentVPreBoundary = null;
- }
- if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
- tokenizer.inXML = false;
- }
- }
- function lookAhead(index, c) {
- let i = index;
- while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++;
- return i;
- }
- function backTrack(index, c) {
- let i = index;
- while (currentInput.charCodeAt(i) !== c && i >= 0) i--;
- return i;
- }
- const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]);
- function isFragmentTemplate({ tag, props }) {
- if (tag === "template") {
- for (let i = 0; i < props.length; i++) {
- if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) {
- return true;
- }
- }
- }
- return false;
- }
- function isComponent({ tag, props }) {
- if (currentOptions.isCustomElement(tag)) {
- return false;
- }
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
- return true;
- }
- for (let i = 0; i < props.length; i++) {
- const p = props[i];
- if (p.type === 6) {
- if (p.name === "is" && p.value) {
- if (p.value.content.startsWith("vue:")) {
- return true;
- }
- }
- }
- }
- return false;
- }
- function isUpperCase(c) {
- return c > 64 && c < 91;
- }
- const windowsNewlineRE = /\r\n/g;
- function condenseWhitespace(nodes, tag) {
- const shouldCondense = currentOptions.whitespace !== "preserve";
- let removedWhitespace = false;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (node.type === 2) {
- if (!inPre) {
- if (isAllWhitespace(node.content)) {
- const prev = nodes[i - 1] && nodes[i - 1].type;
- const next = nodes[i + 1] && nodes[i + 1].type;
- if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
- removedWhitespace = true;
- nodes[i] = null;
- } else {
- node.content = " ";
- }
- } else if (shouldCondense) {
- node.content = condense(node.content);
- }
- } else {
- node.content = node.content.replace(windowsNewlineRE, "\n");
- }
- }
- }
- return removedWhitespace ? nodes.filter(Boolean) : nodes;
- }
- function isAllWhitespace(str) {
- for (let i = 0; i < str.length; i++) {
- if (!isWhitespace(str.charCodeAt(i))) {
- return false;
- }
- }
- return true;
- }
- function hasNewlineChar(str) {
- for (let i = 0; i < str.length; i++) {
- const c = str.charCodeAt(i);
- if (c === 10 || c === 13) {
- return true;
- }
- }
- return false;
- }
- function condense(str) {
- let ret = "";
- let prevCharIsWhitespace = false;
- for (let i = 0; i < str.length; i++) {
- if (isWhitespace(str.charCodeAt(i))) {
- if (!prevCharIsWhitespace) {
- ret += " ";
- prevCharIsWhitespace = true;
- }
- } else {
- ret += str[i];
- prevCharIsWhitespace = false;
- }
- }
- return ret;
- }
- function addNode(node) {
- (stack[0] || currentRoot).children.push(node);
- }
- function getLoc(start, end) {
- return {
- start: tokenizer.getPos(start),
- // @ts-expect-error allow late attachment
- end: end == null ? end : tokenizer.getPos(end),
- // @ts-expect-error allow late attachment
- source: end == null ? end : getSlice(start, end)
- };
- }
- function cloneLoc(loc) {
- return getLoc(loc.start.offset, loc.end.offset);
- }
- function setLocEnd(loc, end) {
- loc.end = tokenizer.getPos(end);
- loc.source = getSlice(loc.start.offset, end);
- }
- function dirToAttr(dir) {
- const attr = {
- type: 6,
- name: dir.rawName,
- nameLoc: getLoc(
- dir.loc.start.offset,
- dir.loc.start.offset + dir.rawName.length
- ),
- value: void 0,
- loc: dir.loc
- };
- if (dir.exp) {
- const loc = dir.exp.loc;
- if (loc.end.offset < dir.loc.end.offset) {
- loc.start.offset--;
- loc.start.column--;
- loc.end.offset++;
- loc.end.column++;
- }
- attr.value = {
- type: 2,
- content: dir.exp.content,
- loc
- };
- }
- return attr;
- }
- function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
- const exp = createSimpleExpression(content, isStatic, loc, constType);
- return exp;
- }
- function emitError(code, index, message) {
- currentOptions.onError(
- createCompilerError(code, getLoc(index, index), void 0, message)
- );
- }
- function reset() {
- tokenizer.reset();
- currentOpenTag = null;
- currentProp = null;
- currentAttrValue = "";
- currentAttrStartIndex = -1;
- currentAttrEndIndex = -1;
- stack.length = 0;
- }
- function baseParse(input, options) {
- reset();
- currentInput = input;
- currentOptions = extend({}, defaultParserOptions);
- if (options) {
- let key;
- for (key in options) {
- if (options[key] != null) {
- currentOptions[key] = options[key];
- }
- }
- }
- {
- if (!currentOptions.decodeEntities) {
- throw new Error(
- `[@vue/compiler-core] decodeEntities option is required in browser builds.`
- );
- }
- }
- tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
- tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
- const delimiters = options && options.delimiters;
- if (delimiters) {
- tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
- tokenizer.delimiterClose = toCharCodes(delimiters[1]);
- }
- const root = currentRoot = createRoot([], input);
- tokenizer.parse(currentInput);
- root.loc = getLoc(0, input.length);
- root.children = condenseWhitespace(root.children);
- currentRoot = null;
- return root;
- }
-
- function cacheStatic(root, context) {
- walk(
- root,
- void 0,
- context,
- // Root node is unfortunately non-hoistable due to potential parent
- // fallthrough attributes.
- isSingleElementRoot(root, root.children[0])
- );
- }
- function isSingleElementRoot(root, child) {
- const { children } = root;
- return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
- }
- function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
- const { children } = node;
- const toCache = [];
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (child.type === 1 && child.tagType === 0) {
- const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
- if (constantType > 0) {
- if (constantType >= 2) {
- child.codegenNode.patchFlag = -1;
- toCache.push(child);
- continue;
- }
- } else {
- const codegenNode = child.codegenNode;
- if (codegenNode.type === 13) {
- const flag = codegenNode.patchFlag;
- if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
- const props = getNodeProps(child);
- if (props) {
- codegenNode.props = context.hoist(props);
- }
- }
- if (codegenNode.dynamicProps) {
- codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
- }
- }
- }
- } else if (child.type === 12) {
- const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
- if (constantType >= 2) {
- toCache.push(child);
- continue;
- }
- }
- if (child.type === 1) {
- const isComponent = child.tagType === 1;
- if (isComponent) {
- context.scopes.vSlot++;
- }
- walk(child, node, context, false, inFor);
- if (isComponent) {
- context.scopes.vSlot--;
- }
- } else if (child.type === 11) {
- walk(child, node, context, child.children.length === 1, true);
- } else if (child.type === 9) {
- for (let i2 = 0; i2 < child.branches.length; i2++) {
- walk(
- child.branches[i2],
- node,
- context,
- child.branches[i2].children.length === 1,
- inFor
- );
- }
- }
- }
- let cachedAsArray = false;
- if (toCache.length === children.length && node.type === 1) {
- if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
- node.codegenNode.children = getCacheExpression(
- createArrayExpression(node.codegenNode.children)
- );
- cachedAsArray = true;
- } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
- const slot = getSlotNode(node.codegenNode, "default");
- if (slot) {
- slot.returns = getCacheExpression(
- createArrayExpression(slot.returns)
- );
- cachedAsArray = true;
- }
- } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) {
- const slotName = findDir(node, "slot", true);
- const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
- if (slot) {
- slot.returns = getCacheExpression(
- createArrayExpression(slot.returns)
- );
- cachedAsArray = true;
- }
- }
- }
- if (!cachedAsArray) {
- for (const child of toCache) {
- child.codegenNode = context.cache(child.codegenNode);
- }
- }
- function getCacheExpression(value) {
- const exp = context.cache(value);
- if (inFor && context.hmr) {
- exp.needArraySpread = true;
- }
- return exp;
- }
- function getSlotNode(node2, name) {
- if (node2.children && !isArray(node2.children) && node2.children.type === 15) {
- const slot = node2.children.properties.find(
- (p) => p.key === name || p.key.content === name
- );
- return slot && slot.value;
- }
- }
- if (toCache.length && context.transformHoist) {
- context.transformHoist(children, context, node);
- }
- }
- function getConstantType(node, context) {
- const { constantCache } = context;
- switch (node.type) {
- case 1:
- if (node.tagType !== 0) {
- return 0;
- }
- const cached = constantCache.get(node);
- if (cached !== void 0) {
- return cached;
- }
- const codegenNode = node.codegenNode;
- if (codegenNode.type !== 13) {
- return 0;
- }
- if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") {
- return 0;
- }
- if (codegenNode.patchFlag === void 0) {
- let returnType2 = 3;
- const generatedPropsType = getGeneratedPropsConstantType(node, context);
- if (generatedPropsType === 0) {
- constantCache.set(node, 0);
- return 0;
- }
- if (generatedPropsType < returnType2) {
- returnType2 = generatedPropsType;
- }
- for (let i = 0; i < node.children.length; i++) {
- const childType = getConstantType(node.children[i], context);
- if (childType === 0) {
- constantCache.set(node, 0);
- return 0;
- }
- if (childType < returnType2) {
- returnType2 = childType;
- }
- }
- if (returnType2 > 1) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7 && p.name === "bind" && p.exp) {
- const expType = getConstantType(p.exp, context);
- if (expType === 0) {
- constantCache.set(node, 0);
- return 0;
- }
- if (expType < returnType2) {
- returnType2 = expType;
- }
- }
- }
- }
- if (codegenNode.isBlock) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7) {
- constantCache.set(node, 0);
- return 0;
- }
- }
- context.removeHelper(OPEN_BLOCK);
- context.removeHelper(
- getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)
- );
- codegenNode.isBlock = false;
- context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
- }
- constantCache.set(node, returnType2);
- return returnType2;
- } else {
- constantCache.set(node, 0);
- return 0;
- }
- case 2:
- case 3:
- return 3;
- case 9:
- case 11:
- case 10:
- return 0;
- case 5:
- case 12:
- return getConstantType(node.content, context);
- case 4:
- return node.constType;
- case 8:
- let returnType = 3;
- for (let i = 0; i < node.children.length; i++) {
- const child = node.children[i];
- if (isString(child) || isSymbol(child)) {
- continue;
- }
- const childType = getConstantType(child, context);
- if (childType === 0) {
- return 0;
- } else if (childType < returnType) {
- returnType = childType;
- }
- }
- return returnType;
- case 20:
- return 2;
- default:
- return 0;
- }
- }
- const allowHoistedHelperSet = /* @__PURE__ */ new Set([
- NORMALIZE_CLASS,
- NORMALIZE_STYLE,
- NORMALIZE_PROPS,
- GUARD_REACTIVE_PROPS
- ]);
- function getConstantTypeOfHelperCall(value, context) {
- if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
- const arg = value.arguments[0];
- if (arg.type === 4) {
- return getConstantType(arg, context);
- } else if (arg.type === 14) {
- return getConstantTypeOfHelperCall(arg, context);
- }
- }
- return 0;
- }
- function getGeneratedPropsConstantType(node, context) {
- let returnType = 3;
- const props = getNodeProps(node);
- if (props && props.type === 15) {
- const { properties } = props;
- for (let i = 0; i < properties.length; i++) {
- const { key, value } = properties[i];
- const keyType = getConstantType(key, context);
- if (keyType === 0) {
- return keyType;
- }
- if (keyType < returnType) {
- returnType = keyType;
- }
- let valueType;
- if (value.type === 4) {
- valueType = getConstantType(value, context);
- } else if (value.type === 14) {
- valueType = getConstantTypeOfHelperCall(value, context);
- } else {
- valueType = 0;
- }
- if (valueType === 0) {
- return valueType;
- }
- if (valueType < returnType) {
- returnType = valueType;
- }
- }
- }
- return returnType;
- }
- function getNodeProps(node) {
- const codegenNode = node.codegenNode;
- if (codegenNode.type === 13) {
- return codegenNode.props;
- }
- }
-
- function createTransformContext(root, {
- filename = "",
- prefixIdentifiers = false,
- hoistStatic = false,
- hmr = false,
- cacheHandlers = false,
- nodeTransforms = [],
- directiveTransforms = {},
- transformHoist = null,
- isBuiltInComponent = NOOP,
- isCustomElement = NOOP,
- expressionPlugins = [],
- scopeId = null,
- slotted = true,
- ssr = false,
- inSSR = false,
- ssrCssVars = ``,
- bindingMetadata = EMPTY_OBJ,
- inline = false,
- isTS = false,
- onError = defaultOnError,
- onWarn = defaultOnWarn,
- compatConfig
- }) {
- const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
- const context = {
- // options
- filename,
- selfName: nameMatch && capitalize(camelize(nameMatch[1])),
- prefixIdentifiers,
- hoistStatic,
- hmr,
- cacheHandlers,
- nodeTransforms,
- directiveTransforms,
- transformHoist,
- isBuiltInComponent,
- isCustomElement,
- expressionPlugins,
- scopeId,
- slotted,
- ssr,
- inSSR,
- ssrCssVars,
- bindingMetadata,
- inline,
- isTS,
- onError,
- onWarn,
- compatConfig,
- // state
- root,
- helpers: /* @__PURE__ */ new Map(),
- components: /* @__PURE__ */ new Set(),
- directives: /* @__PURE__ */ new Set(),
- hoists: [],
- imports: [],
- cached: [],
- constantCache: /* @__PURE__ */ new WeakMap(),
- temps: 0,
- identifiers: /* @__PURE__ */ Object.create(null),
- scopes: {
- vFor: 0,
- vSlot: 0,
- vPre: 0,
- vOnce: 0
- },
- parent: null,
- grandParent: null,
- currentNode: root,
- childIndex: 0,
- inVOnce: false,
- // methods
- helper(name) {
- const count = context.helpers.get(name) || 0;
- context.helpers.set(name, count + 1);
- return name;
- },
- removeHelper(name) {
- const count = context.helpers.get(name);
- if (count) {
- const currentCount = count - 1;
- if (!currentCount) {
- context.helpers.delete(name);
- } else {
- context.helpers.set(name, currentCount);
- }
- }
- },
- helperString(name) {
- return `_${helperNameMap[context.helper(name)]}`;
- },
- replaceNode(node) {
- {
- if (!context.currentNode) {
- throw new Error(`Node being replaced is already removed.`);
- }
- if (!context.parent) {
- throw new Error(`Cannot replace root node.`);
- }
- }
- context.parent.children[context.childIndex] = context.currentNode = node;
- },
- removeNode(node) {
- if (!context.parent) {
- throw new Error(`Cannot remove root node.`);
- }
- const list = context.parent.children;
- const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;
- if (removalIndex < 0) {
- throw new Error(`node being removed is not a child of current parent`);
- }
- if (!node || node === context.currentNode) {
- context.currentNode = null;
- context.onNodeRemoved();
- } else {
- if (context.childIndex > removalIndex) {
- context.childIndex--;
- context.onNodeRemoved();
- }
- }
- context.parent.children.splice(removalIndex, 1);
- },
- onNodeRemoved: NOOP,
- addIdentifiers(exp) {
- },
- removeIdentifiers(exp) {
- },
- hoist(exp) {
- if (isString(exp)) exp = createSimpleExpression(exp);
- context.hoists.push(exp);
- const identifier = createSimpleExpression(
- `_hoisted_${context.hoists.length}`,
- false,
- exp.loc,
- 2
- );
- identifier.hoisted = exp;
- return identifier;
- },
- cache(exp, isVNode = false, inVOnce = false) {
- const cacheExp = createCacheExpression(
- context.cached.length,
- exp,
- isVNode,
- inVOnce
- );
- context.cached.push(cacheExp);
- return cacheExp;
- }
- };
- return context;
- }
- function transform(root, options) {
- const context = createTransformContext(root, options);
- traverseNode(root, context);
- if (options.hoistStatic) {
- cacheStatic(root, context);
- }
- if (!options.ssr) {
- createRootCodegen(root, context);
- }
- root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]);
- root.components = [...context.components];
- root.directives = [...context.directives];
- root.imports = context.imports;
- root.hoists = context.hoists;
- root.temps = context.temps;
- root.cached = context.cached;
- root.transformed = true;
- }
- function createRootCodegen(root, context) {
- const { helper } = context;
- const { children } = root;
- if (children.length === 1) {
- const child = children[0];
- if (isSingleElementRoot(root, child) && child.codegenNode) {
- const codegenNode = child.codegenNode;
- if (codegenNode.type === 13) {
- convertToBlock(codegenNode, context);
- }
- root.codegenNode = codegenNode;
- } else {
- root.codegenNode = child;
- }
- } else if (children.length > 1) {
- let patchFlag = 64;
- if (children.filter((c) => c.type !== 3).length === 1) {
- patchFlag |= 2048;
- }
- root.codegenNode = createVNodeCall(
- context,
- helper(FRAGMENT),
- void 0,
- root.children,
- patchFlag,
- void 0,
- void 0,
- true,
- void 0,
- false
- );
- } else ;
- }
- function traverseChildren(parent, context) {
- let i = 0;
- const nodeRemoved = () => {
- i--;
- };
- for (; i < parent.children.length; i++) {
- const child = parent.children[i];
- if (isString(child)) continue;
- context.grandParent = context.parent;
- context.parent = parent;
- context.childIndex = i;
- context.onNodeRemoved = nodeRemoved;
- traverseNode(child, context);
- }
- }
- function traverseNode(node, context) {
- context.currentNode = node;
- const { nodeTransforms } = context;
- const exitFns = [];
- for (let i2 = 0; i2 < nodeTransforms.length; i2++) {
- const onExit = nodeTransforms[i2](node, context);
- if (onExit) {
- if (isArray(onExit)) {
- exitFns.push(...onExit);
- } else {
- exitFns.push(onExit);
- }
- }
- if (!context.currentNode) {
- return;
- } else {
- node = context.currentNode;
- }
- }
- switch (node.type) {
- case 3:
- if (!context.ssr) {
- context.helper(CREATE_COMMENT);
- }
- break;
- case 5:
- if (!context.ssr) {
- context.helper(TO_DISPLAY_STRING);
- }
- break;
- // for container types, further traverse downwards
- case 9:
- for (let i2 = 0; i2 < node.branches.length; i2++) {
- traverseNode(node.branches[i2], context);
- }
- break;
- case 10:
- case 11:
- case 1:
- case 0:
- traverseChildren(node, context);
- break;
- }
- context.currentNode = node;
- let i = exitFns.length;
- while (i--) {
- exitFns[i]();
- }
- }
- function createStructuralDirectiveTransform(name, fn) {
- const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
- return (node, context) => {
- if (node.type === 1) {
- const { props } = node;
- if (node.tagType === 3 && props.some(isVSlot)) {
- return;
- }
- const exitFns = [];
- for (let i = 0; i < props.length; i++) {
- const prop = props[i];
- if (prop.type === 7 && matches(prop.name)) {
- props.splice(i, 1);
- i--;
- const onExit = fn(node, prop, context);
- if (onExit) exitFns.push(onExit);
- }
- }
- return exitFns;
- }
- };
- }
-
- const PURE_ANNOTATION = `/*@__PURE__*/`;
- const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
- function createCodegenContext(ast, {
- mode = "function",
- prefixIdentifiers = mode === "module",
- sourceMap = false,
- filename = `template.vue.html`,
- scopeId = null,
- optimizeImports = false,
- runtimeGlobalName = `Vue`,
- runtimeModuleName = `vue`,
- ssrRuntimeModuleName = "vue/server-renderer",
- ssr = false,
- isTS = false,
- inSSR = false
- }) {
- const context = {
- mode,
- prefixIdentifiers,
- sourceMap,
- filename,
- scopeId,
- optimizeImports,
- runtimeGlobalName,
- runtimeModuleName,
- ssrRuntimeModuleName,
- ssr,
- isTS,
- inSSR,
- source: ast.source,
- code: ``,
- column: 1,
- line: 1,
- offset: 0,
- indentLevel: 0,
- pure: false,
- map: void 0,
- helper(key) {
- return `_${helperNameMap[key]}`;
- },
- push(code, newlineIndex = -2 /* None */, node) {
- context.code += code;
- },
- indent() {
- newline(++context.indentLevel);
- },
- deindent(withoutNewLine = false) {
- if (withoutNewLine) {
- --context.indentLevel;
- } else {
- newline(--context.indentLevel);
- }
- },
- newline() {
- newline(context.indentLevel);
- }
- };
- function newline(n) {
- context.push("\n" + ` `.repeat(n), 0 /* Start */);
- }
- return context;
- }
- function generate(ast, options = {}) {
- const context = createCodegenContext(ast, options);
- if (options.onContextCreated) options.onContextCreated(context);
- const {
- mode,
- push,
- prefixIdentifiers,
- indent,
- deindent,
- newline,
- scopeId,
- ssr
- } = context;
- const helpers = Array.from(ast.helpers);
- const hasHelpers = helpers.length > 0;
- const useWithBlock = !prefixIdentifiers && mode !== "module";
- const preambleContext = context;
- {
- genFunctionPreamble(ast, preambleContext);
- }
- const functionName = ssr ? `ssrRender` : `render`;
- const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"];
- const signature = args.join(", ");
- {
- push(`function ${functionName}(${signature}) {`);
- }
- indent();
- if (useWithBlock) {
- push(`with (_ctx) {`);
- indent();
- if (hasHelpers) {
- push(
- `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue
-`,
- -1 /* End */
- );
- newline();
- }
- }
- if (ast.components.length) {
- genAssets(ast.components, "component", context);
- if (ast.directives.length || ast.temps > 0) {
- newline();
- }
- }
- if (ast.directives.length) {
- genAssets(ast.directives, "directive", context);
- if (ast.temps > 0) {
- newline();
- }
- }
- if (ast.temps > 0) {
- push(`let `);
- for (let i = 0; i < ast.temps; i++) {
- push(`${i > 0 ? `, ` : ``}_temp${i}`);
- }
- }
- if (ast.components.length || ast.directives.length || ast.temps) {
- push(`
-`, 0 /* Start */);
- newline();
- }
- if (!ssr) {
- push(`return `);
- }
- if (ast.codegenNode) {
- genNode(ast.codegenNode, context);
- } else {
- push(`null`);
- }
- if (useWithBlock) {
- deindent();
- push(`}`);
- }
- deindent();
- push(`}`);
- return {
- ast,
- code: context.code,
- preamble: ``,
- map: context.map ? context.map.toJSON() : void 0
- };
- }
- function genFunctionPreamble(ast, context) {
- const {
- ssr,
- prefixIdentifiers,
- push,
- newline,
- runtimeModuleName,
- runtimeGlobalName,
- ssrRuntimeModuleName
- } = context;
- const VueBinding = runtimeGlobalName;
- const helpers = Array.from(ast.helpers);
- if (helpers.length > 0) {
- {
- push(`const _Vue = ${VueBinding}
-`, -1 /* End */);
- if (ast.hoists.length) {
- const staticHelpers = [
- CREATE_VNODE,
- CREATE_ELEMENT_VNODE,
- CREATE_COMMENT,
- CREATE_TEXT,
- CREATE_STATIC
- ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", ");
- push(`const { ${staticHelpers} } = _Vue
-`, -1 /* End */);
- }
- }
- }
- genHoists(ast.hoists, context);
- newline();
- push(`return `);
- }
- function genAssets(assets, type, { helper, push, newline, isTS }) {
- const resolver = helper(
- type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE
- );
- for (let i = 0; i < assets.length; i++) {
- let id = assets[i];
- const maybeSelfReference = id.endsWith("__self");
- if (maybeSelfReference) {
- id = id.slice(0, -6);
- }
- push(
- `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`
- );
- if (i < assets.length - 1) {
- newline();
- }
- }
- }
- function genHoists(hoists, context) {
- if (!hoists.length) {
- return;
- }
- context.pure = true;
- const { push, newline } = context;
- newline();
- for (let i = 0; i < hoists.length; i++) {
- const exp = hoists[i];
- if (exp) {
- push(`const _hoisted_${i + 1} = `);
- genNode(exp, context);
- newline();
- }
- }
- context.pure = false;
- }
- function isText(n) {
- return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
- }
- function genNodeListAsArray(nodes, context) {
- const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
- context.push(`[`);
- multilines && context.indent();
- genNodeList(nodes, context, multilines);
- multilines && context.deindent();
- context.push(`]`);
- }
- function genNodeList(nodes, context, multilines = false, comma = true) {
- const { push, newline } = context;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (isString(node)) {
- push(node, -3 /* Unknown */);
- } else if (isArray(node)) {
- genNodeListAsArray(node, context);
- } else {
- genNode(node, context);
- }
- if (i < nodes.length - 1) {
- if (multilines) {
- comma && push(",");
- newline();
- } else {
- comma && push(", ");
- }
- }
- }
- }
- function genNode(node, context) {
- if (isString(node)) {
- context.push(node, -3 /* Unknown */);
- return;
- }
- if (isSymbol(node)) {
- context.push(context.helper(node));
- return;
- }
- switch (node.type) {
- case 1:
- case 9:
- case 11:
- assert(
- node.codegenNode != null,
- `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
- );
- genNode(node.codegenNode, context);
- break;
- case 2:
- genText(node, context);
- break;
- case 4:
- genExpression(node, context);
- break;
- case 5:
- genInterpolation(node, context);
- break;
- case 12:
- genNode(node.codegenNode, context);
- break;
- case 8:
- genCompoundExpression(node, context);
- break;
- case 3:
- genComment(node, context);
- break;
- case 13:
- genVNodeCall(node, context);
- break;
- case 14:
- genCallExpression(node, context);
- break;
- case 15:
- genObjectExpression(node, context);
- break;
- case 17:
- genArrayExpression(node, context);
- break;
- case 18:
- genFunctionExpression(node, context);
- break;
- case 19:
- genConditionalExpression(node, context);
- break;
- case 20:
- genCacheExpression(node, context);
- break;
- case 21:
- genNodeList(node.body, context, true, false);
- break;
- // SSR only types
- case 22:
- break;
- case 23:
- break;
- case 24:
- break;
- case 25:
- break;
- case 26:
- break;
- /* v8 ignore start */
- case 10:
- break;
- default:
- {
- assert(false, `unhandled codegen node type: ${node.type}`);
- const exhaustiveCheck = node;
- return exhaustiveCheck;
- }
- }
- }
- function genText(node, context) {
- context.push(JSON.stringify(node.content), -3 /* Unknown */, node);
- }
- function genExpression(node, context) {
- const { content, isStatic } = node;
- context.push(
- isStatic ? JSON.stringify(content) : content,
- -3 /* Unknown */,
- node
- );
- }
- function genInterpolation(node, context) {
- const { push, helper, pure } = context;
- if (pure) push(PURE_ANNOTATION);
- push(`${helper(TO_DISPLAY_STRING)}(`);
- genNode(node.content, context);
- push(`)`);
- }
- function genCompoundExpression(node, context) {
- for (let i = 0; i < node.children.length; i++) {
- const child = node.children[i];
- if (isString(child)) {
- context.push(child, -3 /* Unknown */);
- } else {
- genNode(child, context);
- }
- }
- }
- function genExpressionAsPropertyKey(node, context) {
- const { push } = context;
- if (node.type === 8) {
- push(`[`);
- genCompoundExpression(node, context);
- push(`]`);
- } else if (node.isStatic) {
- const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content);
- push(text, -2 /* None */, node);
- } else {
- push(`[${node.content}]`, -3 /* Unknown */, node);
- }
- }
- function genComment(node, context) {
- const { push, helper, pure } = context;
- if (pure) {
- push(PURE_ANNOTATION);
- }
- push(
- `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`,
- -3 /* Unknown */,
- node
- );
- }
- function genVNodeCall(node, context) {
- const { push, helper, pure } = context;
- const {
- tag,
- props,
- children,
- patchFlag,
- dynamicProps,
- directives,
- isBlock,
- disableTracking,
- isComponent
- } = node;
- let patchFlagString;
- if (patchFlag) {
- {
- if (patchFlag < 0) {
- patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
- } else {
- const flagNames = Object.keys(PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => PatchFlagNames[n]).join(`, `);
- patchFlagString = patchFlag + ` /* ${flagNames} */`;
- }
- }
- }
- if (directives) {
- push(helper(WITH_DIRECTIVES) + `(`);
- }
- if (isBlock) {
- push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
- }
- if (pure) {
- push(PURE_ANNOTATION);
- }
- const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent);
- push(helper(callHelper) + `(`, -2 /* None */, node);
- genNodeList(
- genNullableArgs([tag, props, children, patchFlagString, dynamicProps]),
- context
- );
- push(`)`);
- if (isBlock) {
- push(`)`);
- }
- if (directives) {
- push(`, `);
- genNode(directives, context);
- push(`)`);
- }
- }
- function genNullableArgs(args) {
- let i = args.length;
- while (i--) {
- if (args[i] != null) break;
- }
- return args.slice(0, i + 1).map((arg) => arg || `null`);
- }
- function genCallExpression(node, context) {
- const { push, helper, pure } = context;
- const callee = isString(node.callee) ? node.callee : helper(node.callee);
- if (pure) {
- push(PURE_ANNOTATION);
- }
- push(callee + `(`, -2 /* None */, node);
- genNodeList(node.arguments, context);
- push(`)`);
- }
- function genObjectExpression(node, context) {
- const { push, indent, deindent, newline } = context;
- const { properties } = node;
- if (!properties.length) {
- push(`{}`, -2 /* None */, node);
- return;
- }
- const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
- push(multilines ? `{` : `{ `);
- multilines && indent();
- for (let i = 0; i < properties.length; i++) {
- const { key, value } = properties[i];
- genExpressionAsPropertyKey(key, context);
- push(`: `);
- genNode(value, context);
- if (i < properties.length - 1) {
- push(`,`);
- newline();
- }
- }
- multilines && deindent();
- push(multilines ? `}` : ` }`);
- }
- function genArrayExpression(node, context) {
- genNodeListAsArray(node.elements, context);
- }
- function genFunctionExpression(node, context) {
- const { push, indent, deindent } = context;
- const { params, returns, body, newline, isSlot } = node;
- if (isSlot) {
- push(`_${helperNameMap[WITH_CTX]}(`);
- }
- push(`(`, -2 /* None */, node);
- if (isArray(params)) {
- genNodeList(params, context);
- } else if (params) {
- genNode(params, context);
- }
- push(`) => `);
- if (newline || body) {
- push(`{`);
- indent();
- }
- if (returns) {
- if (newline) {
- push(`return `);
- }
- if (isArray(returns)) {
- genNodeListAsArray(returns, context);
- } else {
- genNode(returns, context);
- }
- } else if (body) {
- genNode(body, context);
- }
- if (newline || body) {
- deindent();
- push(`}`);
- }
- if (isSlot) {
- push(`)`);
- }
- }
- function genConditionalExpression(node, context) {
- const { test, consequent, alternate, newline: needNewline } = node;
- const { push, indent, deindent, newline } = context;
- if (test.type === 4) {
- const needsParens = !isSimpleIdentifier(test.content);
- needsParens && push(`(`);
- genExpression(test, context);
- needsParens && push(`)`);
- } else {
- push(`(`);
- genNode(test, context);
- push(`)`);
- }
- needNewline && indent();
- context.indentLevel++;
- needNewline || push(` `);
- push(`? `);
- genNode(consequent, context);
- context.indentLevel--;
- needNewline && newline();
- needNewline || push(` `);
- push(`: `);
- const isNested = alternate.type === 19;
- if (!isNested) {
- context.indentLevel++;
- }
- genNode(alternate, context);
- if (!isNested) {
- context.indentLevel--;
- }
- needNewline && deindent(
- true
- /* without newline */
- );
- }
- function genCacheExpression(node, context) {
- const { push, helper, indent, deindent, newline } = context;
- const { needPauseTracking, needArraySpread } = node;
- if (needArraySpread) {
- push(`[...(`);
- }
- push(`_cache[${node.index}] || (`);
- if (needPauseTracking) {
- indent();
- push(`${helper(SET_BLOCK_TRACKING)}(-1`);
- if (node.inVOnce) push(`, true`);
- push(`),`);
- newline();
- push(`(`);
- }
- push(`_cache[${node.index}] = `);
- genNode(node.value, context);
- if (needPauseTracking) {
- push(`).cacheIndex = ${node.index},`);
- newline();
- push(`${helper(SET_BLOCK_TRACKING)}(1),`);
- newline();
- push(`_cache[${node.index}]`);
- deindent();
- }
- push(`)`);
- if (needArraySpread) {
- push(`)]`);
- }
- }
-
- const prohibitedKeywordRE = new RegExp(
- "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
- );
- const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
- function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
- const exp = node.content;
- if (!exp.trim()) {
- return;
- }
- try {
- new Function(
- asRawStatements ? ` ${exp} ` : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`
- );
- } catch (e) {
- let message = e.message;
- const keywordMatch = exp.replace(stripStringRE, "").match(prohibitedKeywordRE);
- if (keywordMatch) {
- message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
- }
- context.onError(
- createCompilerError(
- 45,
- node.loc,
- void 0,
- message
- )
- );
- }
- }
-
- const transformExpression = (node, context) => {
- if (node.type === 5) {
- node.content = processExpression(
- node.content,
- context
- );
- } else if (node.type === 1) {
- const memo = findDir(node, "memo");
- for (let i = 0; i < node.props.length; i++) {
- const dir = node.props[i];
- if (dir.type === 7 && dir.name !== "for") {
- const exp = dir.exp;
- const arg = dir.arg;
- if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
- !(memo && arg && arg.type === 4 && arg.content === "key")) {
- dir.exp = processExpression(
- exp,
- context,
- // slot args must be processed as function params
- dir.name === "slot"
- );
- }
- if (arg && arg.type === 4 && !arg.isStatic) {
- dir.arg = processExpression(arg, context);
- }
- }
- }
- }
- };
- function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
- {
- {
- validateBrowserExpression(node, context, asParams, asRawStatements);
- }
- return node;
- }
- }
-
- const transformIf = createStructuralDirectiveTransform(
- /^(if|else|else-if)$/,
- (node, dir, context) => {
- return processIf(node, dir, context, (ifNode, branch, isRoot) => {
- const siblings = context.parent.children;
- let i = siblings.indexOf(ifNode);
- let key = 0;
- while (i-- >= 0) {
- const sibling = siblings[i];
- if (sibling && sibling.type === 9) {
- key += sibling.branches.length;
- }
- }
- return () => {
- if (isRoot) {
- ifNode.codegenNode = createCodegenNodeForBranch(
- branch,
- key,
- context
- );
- } else {
- const parentCondition = getParentCondition(ifNode.codegenNode);
- parentCondition.alternate = createCodegenNodeForBranch(
- branch,
- key + ifNode.branches.length - 1,
- context
- );
- }
- };
- });
- }
- );
- function processIf(node, dir, context, processCodegen) {
- if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
- const loc = dir.exp ? dir.exp.loc : node.loc;
- context.onError(
- createCompilerError(28, dir.loc)
- );
- dir.exp = createSimpleExpression(`true`, false, loc);
- }
- if (dir.exp) {
- validateBrowserExpression(dir.exp, context);
- }
- if (dir.name === "if") {
- const branch = createIfBranch(node, dir);
- const ifNode = {
- type: 9,
- loc: cloneLoc(node.loc),
- branches: [branch]
- };
- context.replaceNode(ifNode);
- if (processCodegen) {
- return processCodegen(ifNode, branch, true);
- }
- } else {
- const siblings = context.parent.children;
- const comments = [];
- let i = siblings.indexOf(node);
- while (i-- >= -1) {
- const sibling = siblings[i];
- if (sibling && sibling.type === 3) {
- context.removeNode(sibling);
- comments.unshift(sibling);
- continue;
- }
- if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
- context.removeNode(sibling);
- continue;
- }
- if (sibling && sibling.type === 9) {
- if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
- context.onError(
- createCompilerError(30, node.loc)
- );
- }
- context.removeNode();
- const branch = createIfBranch(node, dir);
- if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
- !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) {
- branch.children = [...comments, ...branch.children];
- }
- {
- const key = branch.userKey;
- if (key) {
- sibling.branches.forEach(({ userKey }) => {
- if (isSameKey(userKey, key)) {
- context.onError(
- createCompilerError(
- 29,
- branch.userKey.loc
- )
- );
- }
- });
- }
- }
- sibling.branches.push(branch);
- const onExit = processCodegen && processCodegen(sibling, branch, false);
- traverseNode(branch, context);
- if (onExit) onExit();
- context.currentNode = null;
- } else {
- context.onError(
- createCompilerError(30, node.loc)
- );
- }
- break;
- }
- }
- }
- function createIfBranch(node, dir) {
- const isTemplateIf = node.tagType === 3;
- return {
- type: 10,
- loc: node.loc,
- condition: dir.name === "else" ? void 0 : dir.exp,
- children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
- userKey: findProp(node, `key`),
- isTemplateIf
- };
- }
- function createCodegenNodeForBranch(branch, keyIndex, context) {
- if (branch.condition) {
- return createConditionalExpression(
- branch.condition,
- createChildrenCodegenNode(branch, keyIndex, context),
- // make sure to pass in asBlock: true so that the comment node call
- // closes the current block.
- createCallExpression(context.helper(CREATE_COMMENT), [
- '"v-if"' ,
- "true"
- ])
- );
- } else {
- return createChildrenCodegenNode(branch, keyIndex, context);
- }
- }
- function createChildrenCodegenNode(branch, keyIndex, context) {
- const { helper } = context;
- const keyProperty = createObjectProperty(
- `key`,
- createSimpleExpression(
- `${keyIndex}`,
- false,
- locStub,
- 2
- )
- );
- const { children } = branch;
- const firstChild = children[0];
- const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
- if (needFragmentWrapper) {
- if (children.length === 1 && firstChild.type === 11) {
- const vnodeCall = firstChild.codegenNode;
- injectProp(vnodeCall, keyProperty, context);
- return vnodeCall;
- } else {
- let patchFlag = 64;
- if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
- patchFlag |= 2048;
- }
- return createVNodeCall(
- context,
- helper(FRAGMENT),
- createObjectExpression([keyProperty]),
- children,
- patchFlag,
- void 0,
- void 0,
- true,
- false,
- false,
- branch.loc
- );
- }
- } else {
- const ret = firstChild.codegenNode;
- const vnodeCall = getMemoedVNodeCall(ret);
- if (vnodeCall.type === 13) {
- convertToBlock(vnodeCall, context);
- }
- injectProp(vnodeCall, keyProperty, context);
- return ret;
- }
- }
- function isSameKey(a, b) {
- if (!a || a.type !== b.type) {
- return false;
- }
- if (a.type === 6) {
- if (a.value.content !== b.value.content) {
- return false;
- }
- } else {
- const exp = a.exp;
- const branchExp = b.exp;
- if (exp.type !== branchExp.type) {
- return false;
- }
- if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
- return false;
- }
- }
- return true;
- }
- function getParentCondition(node) {
- while (true) {
- if (node.type === 19) {
- if (node.alternate.type === 19) {
- node = node.alternate;
- } else {
- return node;
- }
- } else if (node.type === 20) {
- node = node.value;
- }
- }
- }
-
- const transformBind = (dir, _node, context) => {
- const { modifiers, loc } = dir;
- const arg = dir.arg;
- let { exp } = dir;
- if (exp && exp.type === 4 && !exp.content.trim()) {
- {
- exp = void 0;
- }
- }
- if (!exp) {
- if (arg.type !== 4 || !arg.isStatic) {
- context.onError(
- createCompilerError(
- 52,
- arg.loc
- )
- );
- return {
- props: [
- createObjectProperty(arg, createSimpleExpression("", true, loc))
- ]
- };
- }
- transformBindShorthand(dir);
- exp = dir.exp;
- }
- if (arg.type !== 4) {
- arg.children.unshift(`(`);
- arg.children.push(`) || ""`);
- } else if (!arg.isStatic) {
- arg.content = `${arg.content} || ""`;
- }
- if (modifiers.some((mod) => mod.content === "camel")) {
- if (arg.type === 4) {
- if (arg.isStatic) {
- arg.content = camelize(arg.content);
- } else {
- arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
- }
- } else {
- arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
- arg.children.push(`)`);
- }
- }
- if (!context.inSSR) {
- if (modifiers.some((mod) => mod.content === "prop")) {
- injectPrefix(arg, ".");
- }
- if (modifiers.some((mod) => mod.content === "attr")) {
- injectPrefix(arg, "^");
- }
- }
- return {
- props: [createObjectProperty(arg, exp)]
- };
- };
- const transformBindShorthand = (dir, context) => {
- const arg = dir.arg;
- const propName = camelize(arg.content);
- dir.exp = createSimpleExpression(propName, false, arg.loc);
- };
- const injectPrefix = (arg, prefix) => {
- if (arg.type === 4) {
- if (arg.isStatic) {
- arg.content = prefix + arg.content;
- } else {
- arg.content = `\`${prefix}\${${arg.content}}\``;
- }
- } else {
- arg.children.unshift(`'${prefix}' + (`);
- arg.children.push(`)`);
- }
- };
-
- const transformFor = createStructuralDirectiveTransform(
- "for",
- (node, dir, context) => {
- const { helper, removeHelper } = context;
- return processFor(node, dir, context, (forNode) => {
- const renderExp = createCallExpression(helper(RENDER_LIST), [
- forNode.source
- ]);
- const isTemplate = isTemplateNode(node);
- const memo = findDir(node, "memo");
- const keyProp = findProp(node, `key`, false, true);
- const isDirKey = keyProp && keyProp.type === 7;
- if (isDirKey && !keyProp.exp) {
- transformBindShorthand(keyProp);
- }
- let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
- const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
- const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
- const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
- forNode.codegenNode = createVNodeCall(
- context,
- helper(FRAGMENT),
- void 0,
- renderExp,
- fragmentFlag,
- void 0,
- void 0,
- true,
- !isStableFragment,
- false,
- node.loc
- );
- return () => {
- let childBlock;
- const { children } = forNode;
- if (isTemplate) {
- node.children.some((c) => {
- if (c.type === 1) {
- const key = findProp(c, "key");
- if (key) {
- context.onError(
- createCompilerError(
- 33,
- key.loc
- )
- );
- return true;
- }
- }
- });
- }
- const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
- const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
- if (slotOutlet) {
- childBlock = slotOutlet.codegenNode;
- if (isTemplate && keyProperty) {
- injectProp(childBlock, keyProperty, context);
- }
- } else if (needFragmentWrapper) {
- childBlock = createVNodeCall(
- context,
- helper(FRAGMENT),
- keyProperty ? createObjectExpression([keyProperty]) : void 0,
- node.children,
- 64,
- void 0,
- void 0,
- true,
- void 0,
- false
- );
- } else {
- childBlock = children[0].codegenNode;
- if (isTemplate && keyProperty) {
- injectProp(childBlock, keyProperty, context);
- }
- if (childBlock.isBlock !== !isStableFragment) {
- if (childBlock.isBlock) {
- removeHelper(OPEN_BLOCK);
- removeHelper(
- getVNodeBlockHelper(context.inSSR, childBlock.isComponent)
- );
- } else {
- removeHelper(
- getVNodeHelper(context.inSSR, childBlock.isComponent)
- );
- }
- }
- childBlock.isBlock = !isStableFragment;
- if (childBlock.isBlock) {
- helper(OPEN_BLOCK);
- helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
- } else {
- helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
- }
- }
- if (memo) {
- const loop = createFunctionExpression(
- createForLoopParams(forNode.parseResult, [
- createSimpleExpression(`_cached`)
- ])
- );
- loop.body = createBlockStatement([
- createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
- createCompoundExpression([
- `if (_cached`,
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
- ` && ${context.helperString(
- IS_MEMO_SAME
- )}(_cached, _memo)) return _cached`
- ]),
- createCompoundExpression([`const _item = `, childBlock]),
- createSimpleExpression(`_item.memo = _memo`),
- createSimpleExpression(`return _item`)
- ]);
- renderExp.arguments.push(
- loop,
- createSimpleExpression(`_cache`),
- createSimpleExpression(String(context.cached.length))
- );
- context.cached.push(null);
- } else {
- renderExp.arguments.push(
- createFunctionExpression(
- createForLoopParams(forNode.parseResult),
- childBlock,
- true
- )
- );
- }
- };
- });
- }
- );
- function processFor(node, dir, context, processCodegen) {
- if (!dir.exp) {
- context.onError(
- createCompilerError(31, dir.loc)
- );
- return;
- }
- const parseResult = dir.forParseResult;
- if (!parseResult) {
- context.onError(
- createCompilerError(32, dir.loc)
- );
- return;
- }
- finalizeForParseResult(parseResult, context);
- const { addIdentifiers, removeIdentifiers, scopes } = context;
- const { source, value, key, index } = parseResult;
- const forNode = {
- type: 11,
- loc: dir.loc,
- source,
- valueAlias: value,
- keyAlias: key,
- objectIndexAlias: index,
- parseResult,
- children: isTemplateNode(node) ? node.children : [node]
- };
- context.replaceNode(forNode);
- scopes.vFor++;
- const onExit = processCodegen && processCodegen(forNode);
- return () => {
- scopes.vFor--;
- if (onExit) onExit();
- };
- }
- function finalizeForParseResult(result, context) {
- if (result.finalized) return;
- {
- validateBrowserExpression(result.source, context);
- if (result.key) {
- validateBrowserExpression(
- result.key,
- context,
- true
- );
- }
- if (result.index) {
- validateBrowserExpression(
- result.index,
- context,
- true
- );
- }
- if (result.value) {
- validateBrowserExpression(
- result.value,
- context,
- true
- );
- }
- }
- result.finalized = true;
- }
- function createForLoopParams({ value, key, index }, memoArgs = []) {
- return createParamsList([value, key, index, ...memoArgs]);
- }
- function createParamsList(args) {
- let i = args.length;
- while (i--) {
- if (args[i]) break;
- }
- return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false));
- }
-
- const defaultFallback = createSimpleExpression(`undefined`, false);
- const trackSlotScopes = (node, context) => {
- if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
- const vSlot = findDir(node, "slot");
- if (vSlot) {
- vSlot.exp;
- context.scopes.vSlot++;
- return () => {
- context.scopes.vSlot--;
- };
- }
- }
- };
- const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
- props,
- children,
- false,
- true,
- children.length ? children[0].loc : loc
- );
- function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
- context.helper(WITH_CTX);
- const { children, loc } = node;
- const slotsProperties = [];
- const dynamicSlots = [];
- let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
- const onComponentSlot = findDir(node, "slot", true);
- if (onComponentSlot) {
- const { arg, exp } = onComponentSlot;
- if (arg && !isStaticExp(arg)) {
- hasDynamicSlots = true;
- }
- slotsProperties.push(
- createObjectProperty(
- arg || createSimpleExpression("default", true),
- buildSlotFn(exp, void 0, children, loc)
- )
- );
- }
- let hasTemplateSlots = false;
- let hasNamedDefaultSlot = false;
- const implicitDefaultChildren = [];
- const seenSlotNames = /* @__PURE__ */ new Set();
- let conditionalBranchIndex = 0;
- for (let i = 0; i < children.length; i++) {
- const slotElement = children[i];
- let slotDir;
- if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
- if (slotElement.type !== 3) {
- implicitDefaultChildren.push(slotElement);
- }
- continue;
- }
- if (onComponentSlot) {
- context.onError(
- createCompilerError(37, slotDir.loc)
- );
- break;
- }
- hasTemplateSlots = true;
- const { children: slotChildren, loc: slotLoc } = slotElement;
- const {
- arg: slotName = createSimpleExpression(`default`, true),
- exp: slotProps,
- loc: dirLoc
- } = slotDir;
- let staticSlotName;
- if (isStaticExp(slotName)) {
- staticSlotName = slotName ? slotName.content : `default`;
- } else {
- hasDynamicSlots = true;
- }
- const vFor = findDir(slotElement, "for");
- const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc);
- let vIf;
- let vElse;
- if (vIf = findDir(slotElement, "if")) {
- hasDynamicSlots = true;
- dynamicSlots.push(
- createConditionalExpression(
- vIf.exp,
- buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++),
- defaultFallback
- )
- );
- } else if (vElse = findDir(
- slotElement,
- /^else(-if)?$/,
- true
- /* allowEmpty */
- )) {
- let j = i;
- let prev;
- while (j--) {
- prev = children[j];
- if (prev.type !== 3) {
- break;
- }
- }
- if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
- let conditional = dynamicSlots[dynamicSlots.length - 1];
- while (conditional.alternate.type === 19) {
- conditional = conditional.alternate;
- }
- conditional.alternate = vElse.exp ? createConditionalExpression(
- vElse.exp,
- buildDynamicSlot(
- slotName,
- slotFunction,
- conditionalBranchIndex++
- ),
- defaultFallback
- ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
- } else {
- context.onError(
- createCompilerError(30, vElse.loc)
- );
- }
- } else if (vFor) {
- hasDynamicSlots = true;
- const parseResult = vFor.forParseResult;
- if (parseResult) {
- finalizeForParseResult(parseResult, context);
- dynamicSlots.push(
- createCallExpression(context.helper(RENDER_LIST), [
- parseResult.source,
- createFunctionExpression(
- createForLoopParams(parseResult),
- buildDynamicSlot(slotName, slotFunction),
- true
- )
- ])
- );
- } else {
- context.onError(
- createCompilerError(
- 32,
- vFor.loc
- )
- );
- }
- } else {
- if (staticSlotName) {
- if (seenSlotNames.has(staticSlotName)) {
- context.onError(
- createCompilerError(
- 38,
- dirLoc
- )
- );
- continue;
- }
- seenSlotNames.add(staticSlotName);
- if (staticSlotName === "default") {
- hasNamedDefaultSlot = true;
- }
- }
- slotsProperties.push(createObjectProperty(slotName, slotFunction));
- }
- }
- if (!onComponentSlot) {
- const buildDefaultSlotProperty = (props, children2) => {
- const fn = buildSlotFn(props, void 0, children2, loc);
- return createObjectProperty(`default`, fn);
- };
- if (!hasTemplateSlots) {
- slotsProperties.push(buildDefaultSlotProperty(void 0, children));
- } else if (implicitDefaultChildren.length && // #3766
- // with whitespace: 'preserve', whitespaces between slots will end up in
- // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
- implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) {
- if (hasNamedDefaultSlot) {
- context.onError(
- createCompilerError(
- 39,
- implicitDefaultChildren[0].loc
- )
- );
- } else {
- slotsProperties.push(
- buildDefaultSlotProperty(void 0, implicitDefaultChildren)
- );
- }
- }
- }
- const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1;
- let slots = createObjectExpression(
- slotsProperties.concat(
- createObjectProperty(
- `_`,
- // 2 = compiled but dynamic = can skip normalization, but must run diff
- // 1 = compiled and static = can skip normalization AND diff as optimized
- createSimpleExpression(
- slotFlag + (` /* ${slotFlagsText[slotFlag]} */` ),
- false
- )
- )
- ),
- loc
- );
- if (dynamicSlots.length) {
- slots = createCallExpression(context.helper(CREATE_SLOTS), [
- slots,
- createArrayExpression(dynamicSlots)
- ]);
- }
- return {
- slots,
- hasDynamicSlots
- };
- }
- function buildDynamicSlot(name, fn, index) {
- const props = [
- createObjectProperty(`name`, name),
- createObjectProperty(`fn`, fn)
- ];
- if (index != null) {
- props.push(
- createObjectProperty(`key`, createSimpleExpression(String(index), true))
- );
- }
- return createObjectExpression(props);
- }
- function hasForwardedSlots(children) {
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- switch (child.type) {
- case 1:
- if (child.tagType === 2 || hasForwardedSlots(child.children)) {
- return true;
- }
- break;
- case 9:
- if (hasForwardedSlots(child.branches)) return true;
- break;
- case 10:
- case 11:
- if (hasForwardedSlots(child.children)) return true;
- break;
- }
- }
- return false;
- }
- function isNonWhitespaceContent(node) {
- if (node.type !== 2 && node.type !== 12)
- return true;
- return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
- }
-
- const directiveImportMap = /* @__PURE__ */ new WeakMap();
- const transformElement = (node, context) => {
- return function postTransformElement() {
- node = context.currentNode;
- if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
- return;
- }
- const { tag, props } = node;
- const isComponent = node.tagType === 1;
- let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
- const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
- let vnodeProps;
- let vnodeChildren;
- let patchFlag = 0;
- let vnodeDynamicProps;
- let dynamicPropNames;
- let vnodeDirectives;
- let shouldUseBlock = (
- // dynamic component may resolve to plain elements
- isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block
- // updates inside get proper isSVG flag at runtime. (#639, #643)
- // This is technically web-specific, but splitting the logic out of core
- // leads to too much unnecessary complexity.
- (tag === "svg" || tag === "foreignObject" || tag === "math")
- );
- if (props.length > 0) {
- const propsBuildResult = buildProps(
- node,
- context,
- void 0,
- isComponent,
- isDynamicComponent
- );
- vnodeProps = propsBuildResult.props;
- patchFlag = propsBuildResult.patchFlag;
- dynamicPropNames = propsBuildResult.dynamicPropNames;
- const directives = propsBuildResult.directives;
- vnodeDirectives = directives && directives.length ? createArrayExpression(
- directives.map((dir) => buildDirectiveArgs(dir, context))
- ) : void 0;
- if (propsBuildResult.shouldUseBlock) {
- shouldUseBlock = true;
- }
- }
- if (node.children.length > 0) {
- if (vnodeTag === KEEP_ALIVE) {
- shouldUseBlock = true;
- patchFlag |= 1024;
- if (node.children.length > 1) {
- context.onError(
- createCompilerError(46, {
- start: node.children[0].loc.start,
- end: node.children[node.children.length - 1].loc.end,
- source: ""
- })
- );
- }
- }
- const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling
- vnodeTag !== TELEPORT && // explained above.
- vnodeTag !== KEEP_ALIVE;
- if (shouldBuildAsSlots) {
- const { slots, hasDynamicSlots } = buildSlots(node, context);
- vnodeChildren = slots;
- if (hasDynamicSlots) {
- patchFlag |= 1024;
- }
- } else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
- const child = node.children[0];
- const type = child.type;
- const hasDynamicTextChild = type === 5 || type === 8;
- if (hasDynamicTextChild && getConstantType(child, context) === 0) {
- patchFlag |= 1;
- }
- if (hasDynamicTextChild || type === 2) {
- vnodeChildren = child;
- } else {
- vnodeChildren = node.children;
- }
- } else {
- vnodeChildren = node.children;
- }
- }
- if (dynamicPropNames && dynamicPropNames.length) {
- vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
- }
- node.codegenNode = createVNodeCall(
- context,
- vnodeTag,
- vnodeProps,
- vnodeChildren,
- patchFlag === 0 ? void 0 : patchFlag,
- vnodeDynamicProps,
- vnodeDirectives,
- !!shouldUseBlock,
- false,
- isComponent,
- node.loc
- );
- };
- };
- function resolveComponentType(node, context, ssr = false) {
- let { tag } = node;
- const isExplicitDynamic = isComponentTag(tag);
- const isProp = findProp(
- node,
- "is",
- false,
- true
- /* allow empty */
- );
- if (isProp) {
- if (isExplicitDynamic || false) {
- let exp;
- if (isProp.type === 6) {
- exp = isProp.value && createSimpleExpression(isProp.value.content, true);
- } else {
- exp = isProp.exp;
- if (!exp) {
- exp = createSimpleExpression(`is`, false, isProp.arg.loc);
- }
- }
- if (exp) {
- return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
- exp
- ]);
- }
- } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
- tag = isProp.value.content.slice(4);
- }
- }
- const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
- if (builtIn) {
- if (!ssr) context.helper(builtIn);
- return builtIn;
- }
- context.helper(RESOLVE_COMPONENT);
- context.components.add(tag);
- return toValidAssetId(tag, `component`);
- }
- function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
- const { tag, loc: elementLoc, children } = node;
- let properties = [];
- const mergeArgs = [];
- const runtimeDirectives = [];
- const hasChildren = children.length > 0;
- let shouldUseBlock = false;
- let patchFlag = 0;
- let hasRef = false;
- let hasClassBinding = false;
- let hasStyleBinding = false;
- let hasHydrationEventBinding = false;
- let hasDynamicKeys = false;
- let hasVnodeHook = false;
- const dynamicPropNames = [];
- const pushMergeArg = (arg) => {
- if (properties.length) {
- mergeArgs.push(
- createObjectExpression(dedupeProperties(properties), elementLoc)
- );
- properties = [];
- }
- if (arg) mergeArgs.push(arg);
- };
- const pushRefVForMarker = () => {
- if (context.scopes.vFor > 0) {
- properties.push(
- createObjectProperty(
- createSimpleExpression("ref_for", true),
- createSimpleExpression("true")
- )
- );
- }
- };
- const analyzePatchFlag = ({ key, value }) => {
- if (isStaticExp(key)) {
- const name = key.content;
- const isEventHandler = isOn(name);
- if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click
- // dedicated fast path.
- name.toLowerCase() !== "onclick" && // omit v-model handlers
- name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks
- !isReservedProp(name)) {
- hasHydrationEventBinding = true;
- }
- if (isEventHandler && isReservedProp(name)) {
- hasVnodeHook = true;
- }
- if (isEventHandler && value.type === 14) {
- value = value.arguments[0];
- }
- if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
- return;
- }
- if (name === "ref") {
- hasRef = true;
- } else if (name === "class") {
- hasClassBinding = true;
- } else if (name === "style") {
- hasStyleBinding = true;
- } else if (name !== "key" && !dynamicPropNames.includes(name)) {
- dynamicPropNames.push(name);
- }
- if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) {
- dynamicPropNames.push(name);
- }
- } else {
- hasDynamicKeys = true;
- }
- };
- for (let i = 0; i < props.length; i++) {
- const prop = props[i];
- if (prop.type === 6) {
- const { loc, name, nameLoc, value } = prop;
- let isStatic = true;
- if (name === "ref") {
- hasRef = true;
- pushRefVForMarker();
- }
- if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || false)) {
- continue;
- }
- properties.push(
- createObjectProperty(
- createSimpleExpression(name, true, nameLoc),
- createSimpleExpression(
- value ? value.content : "",
- isStatic,
- value ? value.loc : loc
- )
- )
- );
- } else {
- const { name, arg, exp, loc, modifiers } = prop;
- const isVBind = name === "bind";
- const isVOn = name === "on";
- if (name === "slot") {
- if (!isComponent) {
- context.onError(
- createCompilerError(40, loc)
- );
- }
- continue;
- }
- if (name === "once" || name === "memo") {
- continue;
- }
- if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || false)) {
- continue;
- }
- if (isVOn && ssr) {
- continue;
- }
- if (
- // #938: elements with dynamic keys should be forced into blocks
- isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked
- // before children
- isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update")
- ) {
- shouldUseBlock = true;
- }
- if (isVBind && isStaticArgOf(arg, "ref")) {
- pushRefVForMarker();
- }
- if (!arg && (isVBind || isVOn)) {
- hasDynamicKeys = true;
- if (exp) {
- if (isVBind) {
- pushRefVForMarker();
- pushMergeArg();
- mergeArgs.push(exp);
- } else {
- pushMergeArg({
- type: 14,
- loc,
- callee: context.helper(TO_HANDLERS),
- arguments: isComponent ? [exp] : [exp, `true`]
- });
- }
- } else {
- context.onError(
- createCompilerError(
- isVBind ? 34 : 35,
- loc
- )
- );
- }
- continue;
- }
- if (isVBind && modifiers.some((mod) => mod.content === "prop")) {
- patchFlag |= 32;
- }
- const directiveTransform = context.directiveTransforms[name];
- if (directiveTransform) {
- const { props: props2, needRuntime } = directiveTransform(prop, node, context);
- !ssr && props2.forEach(analyzePatchFlag);
- if (isVOn && arg && !isStaticExp(arg)) {
- pushMergeArg(createObjectExpression(props2, elementLoc));
- } else {
- properties.push(...props2);
- }
- if (needRuntime) {
- runtimeDirectives.push(prop);
- if (isSymbol(needRuntime)) {
- directiveImportMap.set(prop, needRuntime);
- }
- }
- } else if (!isBuiltInDirective(name)) {
- runtimeDirectives.push(prop);
- if (hasChildren) {
- shouldUseBlock = true;
- }
- }
- }
- }
- let propsExpression = void 0;
- if (mergeArgs.length) {
- pushMergeArg();
- if (mergeArgs.length > 1) {
- propsExpression = createCallExpression(
- context.helper(MERGE_PROPS),
- mergeArgs,
- elementLoc
- );
- } else {
- propsExpression = mergeArgs[0];
- }
- } else if (properties.length) {
- propsExpression = createObjectExpression(
- dedupeProperties(properties),
- elementLoc
- );
- }
- if (hasDynamicKeys) {
- patchFlag |= 16;
- } else {
- if (hasClassBinding && !isComponent) {
- patchFlag |= 2;
- }
- if (hasStyleBinding && !isComponent) {
- patchFlag |= 4;
- }
- if (dynamicPropNames.length) {
- patchFlag |= 8;
- }
- if (hasHydrationEventBinding) {
- patchFlag |= 32;
- }
- }
- if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
- patchFlag |= 512;
- }
- if (!context.inSSR && propsExpression) {
- switch (propsExpression.type) {
- case 15:
- let classKeyIndex = -1;
- let styleKeyIndex = -1;
- let hasDynamicKey = false;
- for (let i = 0; i < propsExpression.properties.length; i++) {
- const key = propsExpression.properties[i].key;
- if (isStaticExp(key)) {
- if (key.content === "class") {
- classKeyIndex = i;
- } else if (key.content === "style") {
- styleKeyIndex = i;
- }
- } else if (!key.isHandlerKey) {
- hasDynamicKey = true;
- }
- }
- const classProp = propsExpression.properties[classKeyIndex];
- const styleProp = propsExpression.properties[styleKeyIndex];
- if (!hasDynamicKey) {
- if (classProp && !isStaticExp(classProp.value)) {
- classProp.value = createCallExpression(
- context.helper(NORMALIZE_CLASS),
- [classProp.value]
- );
- }
- if (styleProp && // the static style is compiled into an object,
- // so use `hasStyleBinding` to ensure that it is a dynamic style binding
- (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
- // v-bind:style with static literal object
- styleProp.value.type === 17)) {
- styleProp.value = createCallExpression(
- context.helper(NORMALIZE_STYLE),
- [styleProp.value]
- );
- }
- } else {
- propsExpression = createCallExpression(
- context.helper(NORMALIZE_PROPS),
- [propsExpression]
- );
- }
- break;
- case 14:
- break;
- default:
- propsExpression = createCallExpression(
- context.helper(NORMALIZE_PROPS),
- [
- createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
- propsExpression
- ])
- ]
- );
- break;
- }
- }
- return {
- props: propsExpression,
- directives: runtimeDirectives,
- patchFlag,
- dynamicPropNames,
- shouldUseBlock
- };
- }
- function dedupeProperties(properties) {
- const knownProps = /* @__PURE__ */ new Map();
- const deduped = [];
- for (let i = 0; i < properties.length; i++) {
- const prop = properties[i];
- if (prop.key.type === 8 || !prop.key.isStatic) {
- deduped.push(prop);
- continue;
- }
- const name = prop.key.content;
- const existing = knownProps.get(name);
- if (existing) {
- if (name === "style" || name === "class" || isOn(name)) {
- mergeAsArray(existing, prop);
- }
- } else {
- knownProps.set(name, prop);
- deduped.push(prop);
- }
- }
- return deduped;
- }
- function mergeAsArray(existing, incoming) {
- if (existing.value.type === 17) {
- existing.value.elements.push(incoming.value);
- } else {
- existing.value = createArrayExpression(
- [existing.value, incoming.value],
- existing.loc
- );
- }
- }
- function buildDirectiveArgs(dir, context) {
- const dirArgs = [];
- const runtime = directiveImportMap.get(dir);
- if (runtime) {
- dirArgs.push(context.helperString(runtime));
- } else {
- {
- context.helper(RESOLVE_DIRECTIVE);
- context.directives.add(dir.name);
- dirArgs.push(toValidAssetId(dir.name, `directive`));
- }
- }
- const { loc } = dir;
- if (dir.exp) dirArgs.push(dir.exp);
- if (dir.arg) {
- if (!dir.exp) {
- dirArgs.push(`void 0`);
- }
- dirArgs.push(dir.arg);
- }
- if (Object.keys(dir.modifiers).length) {
- if (!dir.arg) {
- if (!dir.exp) {
- dirArgs.push(`void 0`);
- }
- dirArgs.push(`void 0`);
- }
- const trueExpression = createSimpleExpression(`true`, false, loc);
- dirArgs.push(
- createObjectExpression(
- dir.modifiers.map(
- (modifier) => createObjectProperty(modifier, trueExpression)
- ),
- loc
- )
- );
- }
- return createArrayExpression(dirArgs, dir.loc);
- }
- function stringifyDynamicPropNames(props) {
- let propsNamesString = `[`;
- for (let i = 0, l = props.length; i < l; i++) {
- propsNamesString += JSON.stringify(props[i]);
- if (i < l - 1) propsNamesString += ", ";
- }
- return propsNamesString + `]`;
- }
- function isComponentTag(tag) {
- return tag === "component" || tag === "Component";
- }
-
- const transformSlotOutlet = (node, context) => {
- if (isSlotOutlet(node)) {
- const { children, loc } = node;
- const { slotName, slotProps } = processSlotOutlet(node, context);
- const slotArgs = [
- context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
- slotName,
- "{}",
- "undefined",
- "true"
- ];
- let expectedLen = 2;
- if (slotProps) {
- slotArgs[2] = slotProps;
- expectedLen = 3;
- }
- if (children.length) {
- slotArgs[3] = createFunctionExpression([], children, false, false, loc);
- expectedLen = 4;
- }
- if (context.scopeId && !context.slotted) {
- expectedLen = 5;
- }
- slotArgs.splice(expectedLen);
- node.codegenNode = createCallExpression(
- context.helper(RENDER_SLOT),
- slotArgs,
- loc
- );
- }
- };
- function processSlotOutlet(node, context) {
- let slotName = `"default"`;
- let slotProps = void 0;
- const nonNameProps = [];
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 6) {
- if (p.value) {
- if (p.name === "name") {
- slotName = JSON.stringify(p.value.content);
- } else {
- p.name = camelize(p.name);
- nonNameProps.push(p);
- }
- }
- } else {
- if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
- if (p.exp) {
- slotName = p.exp;
- } else if (p.arg && p.arg.type === 4) {
- const name = camelize(p.arg.content);
- slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);
- }
- } else {
- if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
- p.arg.content = camelize(p.arg.content);
- }
- nonNameProps.push(p);
- }
- }
- }
- if (nonNameProps.length > 0) {
- const { props, directives } = buildProps(
- node,
- context,
- nonNameProps,
- false,
- false
- );
- slotProps = props;
- if (directives.length) {
- context.onError(
- createCompilerError(
- 36,
- directives[0].loc
- )
- );
- }
- }
- return {
- slotName,
- slotProps
- };
- }
-
- const transformOn$1 = (dir, node, context, augmentor) => {
- const { loc, modifiers, arg } = dir;
- if (!dir.exp && !modifiers.length) {
- context.onError(createCompilerError(35, loc));
- }
- let eventName;
- if (arg.type === 4) {
- if (arg.isStatic) {
- let rawName = arg.content;
- if (rawName.startsWith("vnode")) {
- context.onError(createCompilerError(51, arg.loc));
- }
- if (rawName.startsWith("vue:")) {
- rawName = `vnode-${rawName.slice(4)}`;
- }
- const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
- // for non-element and vnode lifecycle event listeners, auto convert
- // it to camelCase. See issue #2249
- toHandlerKey(camelize(rawName))
- ) : (
- // preserve case for plain element listeners that have uppercase
- // letters, as these may be custom elements' custom events
- `on:${rawName}`
- );
- eventName = createSimpleExpression(eventString, true, arg.loc);
- } else {
- eventName = createCompoundExpression([
- `${context.helperString(TO_HANDLER_KEY)}(`,
- arg,
- `)`
- ]);
- }
- } else {
- eventName = arg;
- eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
- eventName.children.push(`)`);
- }
- let exp = dir.exp;
- if (exp && !exp.content.trim()) {
- exp = void 0;
- }
- let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
- if (exp) {
- const isMemberExp = isMemberExpression(exp);
- const isInlineStatement = !(isMemberExp || isFnExpression(exp));
- const hasMultipleStatements = exp.content.includes(`;`);
- {
- validateBrowserExpression(
- exp,
- context,
- false,
- hasMultipleStatements
- );
- }
- if (isInlineStatement || shouldCache && isMemberExp) {
- exp = createCompoundExpression([
- `${isInlineStatement ? `$event` : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
- exp,
- hasMultipleStatements ? `}` : `)`
- ]);
- }
- }
- let ret = {
- props: [
- createObjectProperty(
- eventName,
- exp || createSimpleExpression(`() => {}`, false, loc)
- )
- ]
- };
- if (augmentor) {
- ret = augmentor(ret);
- }
- if (shouldCache) {
- ret.props[0].value = context.cache(ret.props[0].value);
- }
- ret.props.forEach((p) => p.key.isHandlerKey = true);
- return ret;
- };
-
- const transformText = (node, context) => {
- if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
- return () => {
- const children = node.children;
- let currentContainer = void 0;
- let hasText = false;
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (isText$1(child)) {
- hasText = true;
- for (let j = i + 1; j < children.length; j++) {
- const next = children[j];
- if (isText$1(next)) {
- if (!currentContainer) {
- currentContainer = children[i] = createCompoundExpression(
- [child],
- child.loc
- );
- }
- currentContainer.children.push(` + `, next);
- children.splice(j, 1);
- j--;
- } else {
- currentContainer = void 0;
- break;
- }
- }
- }
- }
- if (!hasText || // if this is a plain element with a single text child, leave it
- // as-is since the runtime has dedicated fast path for this by directly
- // setting textContent of the element.
- // for component root it's always normalized anyway.
- children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
- // custom directives can potentially add DOM elements arbitrarily,
- // we need to avoid setting textContent of the element at runtime
- // to avoid accidentally overwriting the DOM elements added
- // by the user through custom directives.
- !node.props.find(
- (p) => p.type === 7 && !context.directiveTransforms[p.name]
- ) && // in compat mode, <template> tags with no special directives
- // will be rendered as a fragment so its children must be
- // converted into vnodes.
- true)) {
- return;
- }
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (isText$1(child) || child.type === 8) {
- const callArgs = [];
- if (child.type !== 2 || child.content !== " ") {
- callArgs.push(child);
- }
- if (!context.ssr && getConstantType(child, context) === 0) {
- callArgs.push(
- 1 + (` /* ${PatchFlagNames[1]} */` )
- );
- }
- children[i] = {
- type: 12,
- content: child,
- loc: child.loc,
- codegenNode: createCallExpression(
- context.helper(CREATE_TEXT),
- callArgs
- )
- };
- }
- }
- };
- }
- };
-
- const seen$1 = /* @__PURE__ */ new WeakSet();
- const transformOnce = (node, context) => {
- if (node.type === 1 && findDir(node, "once", true)) {
- if (seen$1.has(node) || context.inVOnce || context.inSSR) {
- return;
- }
- seen$1.add(node);
- context.inVOnce = true;
- context.helper(SET_BLOCK_TRACKING);
- return () => {
- context.inVOnce = false;
- const cur = context.currentNode;
- if (cur.codegenNode) {
- cur.codegenNode = context.cache(
- cur.codegenNode,
- true,
- true
- );
- }
- };
- }
- };
-
- const transformModel$1 = (dir, node, context) => {
- const { exp, arg } = dir;
- if (!exp) {
- context.onError(
- createCompilerError(41, dir.loc)
- );
- return createTransformProps();
- }
- const rawExp = exp.loc.source.trim();
- const expString = exp.type === 4 ? exp.content : rawExp;
- const bindingType = context.bindingMetadata[rawExp];
- if (bindingType === "props" || bindingType === "props-aliased") {
- context.onError(createCompilerError(44, exp.loc));
- return createTransformProps();
- }
- const maybeRef = false;
- if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
- context.onError(
- createCompilerError(42, exp.loc)
- );
- return createTransformProps();
- }
- const propName = arg ? arg : createSimpleExpression("modelValue", true);
- const eventName = arg ? isStaticExp(arg) ? `onUpdate:${camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`;
- let assignmentExp;
- const eventArg = context.isTS ? `($event: any)` : `$event`;
- {
- assignmentExp = createCompoundExpression([
- `${eventArg} => ((`,
- exp,
- `) = $event)`
- ]);
- }
- const props = [
- // modelValue: foo
- createObjectProperty(propName, dir.exp),
- // "onUpdate:modelValue": $event => (foo = $event)
- createObjectProperty(eventName, assignmentExp)
- ];
- if (dir.modifiers.length && node.tagType === 1) {
- const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
- const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
- props.push(
- createObjectProperty(
- modifiersKey,
- createSimpleExpression(
- `{ ${modifiers} }`,
- false,
- dir.loc,
- 2
- )
- )
- );
- }
- return createTransformProps(props);
- };
- function createTransformProps(props = []) {
- return { props };
- }
-
- const seen = /* @__PURE__ */ new WeakSet();
- const transformMemo = (node, context) => {
- if (node.type === 1) {
- const dir = findDir(node, "memo");
- if (!dir || seen.has(node)) {
- return;
- }
- seen.add(node);
- return () => {
- const codegenNode = node.codegenNode || context.currentNode.codegenNode;
- if (codegenNode && codegenNode.type === 13) {
- if (node.tagType !== 1) {
- convertToBlock(codegenNode, context);
- }
- node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
- dir.exp,
- createFunctionExpression(void 0, codegenNode),
- `_cache`,
- String(context.cached.length)
- ]);
- context.cached.push(null);
- }
- };
- }
- };
-
- function getBaseTransformPreset(prefixIdentifiers) {
- return [
- [
- transformOnce,
- transformIf,
- transformMemo,
- transformFor,
- ...[],
- ...[transformExpression] ,
- transformSlotOutlet,
- transformElement,
- trackSlotScopes,
- transformText
- ],
- {
- on: transformOn$1,
- bind: transformBind,
- model: transformModel$1
- }
- ];
- }
- function baseCompile(source, options = {}) {
- const onError = options.onError || defaultOnError;
- const isModuleMode = options.mode === "module";
- {
- if (options.prefixIdentifiers === true) {
- onError(createCompilerError(47));
- } else if (isModuleMode) {
- onError(createCompilerError(48));
- }
- }
- const prefixIdentifiers = false;
- if (options.cacheHandlers) {
- onError(createCompilerError(49));
- }
- if (options.scopeId && !isModuleMode) {
- onError(createCompilerError(50));
- }
- const resolvedOptions = extend({}, options, {
- prefixIdentifiers
- });
- const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
- const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
- transform(
- ast,
- extend({}, resolvedOptions, {
- nodeTransforms: [
- ...nodeTransforms,
- ...options.nodeTransforms || []
- // user transforms
- ],
- directiveTransforms: extend(
- {},
- directiveTransforms,
- options.directiveTransforms || {}
- // user transforms
- )
- })
- );
- return generate(ast, resolvedOptions);
- }
-
- const noopDirectiveTransform = () => ({ props: [] });
-
- const V_MODEL_RADIO = Symbol(`vModelRadio` );
- const V_MODEL_CHECKBOX = Symbol(
- `vModelCheckbox`
- );
- const V_MODEL_TEXT = Symbol(`vModelText` );
- const V_MODEL_SELECT = Symbol(
- `vModelSelect`
- );
- const V_MODEL_DYNAMIC = Symbol(
- `vModelDynamic`
- );
- const V_ON_WITH_MODIFIERS = Symbol(
- `vOnModifiersGuard`
- );
- const V_ON_WITH_KEYS = Symbol(
- `vOnKeysGuard`
- );
- const V_SHOW = Symbol(`vShow` );
- const TRANSITION = Symbol(`Transition` );
- const TRANSITION_GROUP = Symbol(
- `TransitionGroup`
- );
- registerRuntimeHelpers({
- [V_MODEL_RADIO]: `vModelRadio`,
- [V_MODEL_CHECKBOX]: `vModelCheckbox`,
- [V_MODEL_TEXT]: `vModelText`,
- [V_MODEL_SELECT]: `vModelSelect`,
- [V_MODEL_DYNAMIC]: `vModelDynamic`,
- [V_ON_WITH_MODIFIERS]: `withModifiers`,
- [V_ON_WITH_KEYS]: `withKeys`,
- [V_SHOW]: `vShow`,
- [TRANSITION]: `Transition`,
- [TRANSITION_GROUP]: `TransitionGroup`
- });
-
- let decoder;
- function decodeHtmlBrowser(raw, asAttr = false) {
- if (!decoder) {
- decoder = document.createElement("div");
- }
- if (asAttr) {
- decoder.innerHTML = `<div foo="${raw.replace(/"/g, "&quot;")}">`;
- return decoder.children[0].getAttribute("foo");
- } else {
- decoder.innerHTML = raw;
- return decoder.textContent;
- }
- }
-
- const parserOptions = {
- parseMode: "html",
- isVoidTag,
- isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
- isPreTag: (tag) => tag === "pre",
- isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
- decodeEntities: decodeHtmlBrowser ,
- isBuiltInComponent: (tag) => {
- if (tag === "Transition" || tag === "transition") {
- return TRANSITION;
- } else if (tag === "TransitionGroup" || tag === "transition-group") {
- return TRANSITION_GROUP;
- }
- },
- // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
- getNamespace(tag, parent, rootNamespace) {
- let ns = parent ? parent.ns : rootNamespace;
- if (parent && ns === 2) {
- if (parent.tag === "annotation-xml") {
- if (tag === "svg") {
- return 1;
- }
- if (parent.props.some(
- (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
- )) {
- ns = 0;
- }
- } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
- ns = 0;
- }
- } else if (parent && ns === 1) {
- if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
- ns = 0;
- }
- }
- if (ns === 0) {
- if (tag === "svg") {
- return 1;
- }
- if (tag === "math") {
- return 2;
- }
- }
- return ns;
- }
- };
-
- const transformStyle = (node) => {
- if (node.type === 1) {
- node.props.forEach((p, i) => {
- if (p.type === 6 && p.name === "style" && p.value) {
- node.props[i] = {
- type: 7,
- name: `bind`,
- arg: createSimpleExpression(`style`, true, p.loc),
- exp: parseInlineCSS(p.value.content, p.loc),
- modifiers: [],
- loc: p.loc
- };
- }
- });
- }
- };
- const parseInlineCSS = (cssText, loc) => {
- const normalized = parseStringStyle(cssText);
- return createSimpleExpression(
- JSON.stringify(normalized),
- false,
- loc,
- 3
- );
- };
-
- function createDOMCompilerError(code, loc) {
- return createCompilerError(
- code,
- loc,
- DOMErrorMessages
- );
- }
- const DOMErrorMessages = {
- [53]: `v-html is missing expression.`,
- [54]: `v-html will override element children.`,
- [55]: `v-text is missing expression.`,
- [56]: `v-text will override element children.`,
- [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
- [58]: `v-model argument is not supported on plain elements.`,
- [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
- [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
- [61]: `v-show is missing expression.`,
- [62]: `<Transition> expects exactly one child element or component.`,
- [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
- };
-
- const transformVHtml = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(
- createDOMCompilerError(53, loc)
- );
- }
- if (node.children.length) {
- context.onError(
- createDOMCompilerError(54, loc)
- );
- node.children.length = 0;
- }
- return {
- props: [
- createObjectProperty(
- createSimpleExpression(`innerHTML`, true, loc),
- exp || createSimpleExpression("", true)
- )
- ]
- };
- };
-
- const transformVText = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(
- createDOMCompilerError(55, loc)
- );
- }
- if (node.children.length) {
- context.onError(
- createDOMCompilerError(56, loc)
- );
- node.children.length = 0;
- }
- return {
- props: [
- createObjectProperty(
- createSimpleExpression(`textContent`, true),
- exp ? getConstantType(exp, context) > 0 ? exp : createCallExpression(
- context.helperString(TO_DISPLAY_STRING),
- [exp],
- loc
- ) : createSimpleExpression("", true)
- )
- ]
- };
- };
-
- const transformModel = (dir, node, context) => {
- const baseResult = transformModel$1(dir, node, context);
- if (!baseResult.props.length || node.tagType === 1) {
- return baseResult;
- }
- if (dir.arg) {
- context.onError(
- createDOMCompilerError(
- 58,
- dir.arg.loc
- )
- );
- }
- function checkDuplicatedValue() {
- const value = findDir(node, "bind");
- if (value && isStaticArgOf(value.arg, "value")) {
- context.onError(
- createDOMCompilerError(
- 60,
- value.loc
- )
- );
- }
- }
- const { tag } = node;
- const isCustomElement = context.isCustomElement(tag);
- if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
- let directiveToUse = V_MODEL_TEXT;
- let isInvalidType = false;
- if (tag === "input" || isCustomElement) {
- const type = findProp(node, `type`);
- if (type) {
- if (type.type === 7) {
- directiveToUse = V_MODEL_DYNAMIC;
- } else if (type.value) {
- switch (type.value.content) {
- case "radio":
- directiveToUse = V_MODEL_RADIO;
- break;
- case "checkbox":
- directiveToUse = V_MODEL_CHECKBOX;
- break;
- case "file":
- isInvalidType = true;
- context.onError(
- createDOMCompilerError(
- 59,
- dir.loc
- )
- );
- break;
- default:
- checkDuplicatedValue();
- break;
- }
- }
- } else if (hasDynamicKeyVBind(node)) {
- directiveToUse = V_MODEL_DYNAMIC;
- } else {
- checkDuplicatedValue();
- }
- } else if (tag === "select") {
- directiveToUse = V_MODEL_SELECT;
- } else {
- checkDuplicatedValue();
- }
- if (!isInvalidType) {
- baseResult.needRuntime = context.helper(directiveToUse);
- }
- } else {
- context.onError(
- createDOMCompilerError(
- 57,
- dir.loc
- )
- );
- }
- baseResult.props = baseResult.props.filter(
- (p) => !(p.key.type === 4 && p.key.content === "modelValue")
- );
- return baseResult;
- };
-
- const isEventOptionModifier = /* @__PURE__ */ makeMap(`passive,once,capture`);
- const isNonKeyModifier = /* @__PURE__ */ makeMap(
- // event propagation management
- `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
- );
- const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
- const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
- const resolveModifiers = (key, modifiers, context, loc) => {
- const keyModifiers = [];
- const nonKeyModifiers = [];
- const eventOptionModifiers = [];
- for (let i = 0; i < modifiers.length; i++) {
- const modifier = modifiers[i].content;
- if (isEventOptionModifier(modifier)) {
- eventOptionModifiers.push(modifier);
- } else {
- if (maybeKeyModifier(modifier)) {
- if (isStaticExp(key)) {
- if (isKeyboardEvent(key.content.toLowerCase())) {
- keyModifiers.push(modifier);
- } else {
- nonKeyModifiers.push(modifier);
- }
- } else {
- keyModifiers.push(modifier);
- nonKeyModifiers.push(modifier);
- }
- } else {
- if (isNonKeyModifier(modifier)) {
- nonKeyModifiers.push(modifier);
- } else {
- keyModifiers.push(modifier);
- }
- }
- }
- }
- return {
- keyModifiers,
- nonKeyModifiers,
- eventOptionModifiers
- };
- };
- const transformClick = (key, event) => {
- const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
- return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
- `(`,
- key,
- `) === "onClick" ? "${event}" : (`,
- key,
- `)`
- ]) : key;
- };
- const transformOn = (dir, node, context) => {
- return transformOn$1(dir, node, context, (baseResult) => {
- const { modifiers } = dir;
- if (!modifiers.length) return baseResult;
- let { key, value: handlerExp } = baseResult.props[0];
- const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
- if (nonKeyModifiers.includes("right")) {
- key = transformClick(key, `onContextmenu`);
- }
- if (nonKeyModifiers.includes("middle")) {
- key = transformClick(key, `onMouseup`);
- }
- if (nonKeyModifiers.length) {
- handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
- handlerExp,
- JSON.stringify(nonKeyModifiers)
- ]);
- }
- if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
- (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
- handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
- handlerExp,
- JSON.stringify(keyModifiers)
- ]);
- }
- if (eventOptionModifiers.length) {
- const modifierPostfix = eventOptionModifiers.map(capitalize).join("");
- key = isStaticExp(key) ? createSimpleExpression(`${key.content}${modifierPostfix}`, true) : createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
- }
- return {
- props: [createObjectProperty(key, handlerExp)]
- };
- });
- };
-
- const transformShow = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(
- createDOMCompilerError(61, loc)
- );
- }
- return {
- props: [],
- needRuntime: context.helper(V_SHOW)
- };
- };
-
- const transformTransition = (node, context) => {
- if (node.type === 1 && node.tagType === 1) {
- const component = context.isBuiltInComponent(node.tag);
- if (component === TRANSITION) {
- return () => {
- if (!node.children.length) {
- return;
- }
- if (hasMultipleChildren(node)) {
- context.onError(
- createDOMCompilerError(
- 62,
- {
- start: node.children[0].loc.start,
- end: node.children[node.children.length - 1].loc.end,
- source: ""
- }
- )
- );
- }
- const child = node.children[0];
- if (child.type === 1) {
- for (const p of child.props) {
- if (p.type === 7 && p.name === "show") {
- node.props.push({
- type: 6,
- name: "persisted",
- nameLoc: node.loc,
- value: void 0,
- loc: node.loc
- });
- }
- }
- }
- };
- }
- }
- };
- function hasMultipleChildren(node) {
- const children = node.children = node.children.filter(
- (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
- );
- const child = children[0];
- return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
- }
-
- const ignoreSideEffectTags = (node, context) => {
- if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
- context.onError(
- createDOMCompilerError(
- 63,
- node.loc
- )
- );
- context.removeNode();
- }
- };
-
- function isValidHTMLNesting(parent, child) {
- if (parent in onlyValidChildren) {
- return onlyValidChildren[parent].has(child);
- }
- if (child in onlyValidParents) {
- return onlyValidParents[child].has(parent);
- }
- if (parent in knownInvalidChildren) {
- if (knownInvalidChildren[parent].has(child)) return false;
- }
- if (child in knownInvalidParents) {
- if (knownInvalidParents[child].has(parent)) return false;
- }
- return true;
- }
- const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
- const emptySet = /* @__PURE__ */ new Set([]);
- const onlyValidChildren = {
- head: /* @__PURE__ */ new Set([
- "base",
- "basefront",
- "bgsound",
- "link",
- "meta",
- "title",
- "noscript",
- "noframes",
- "style",
- "script",
- "template"
- ]),
- optgroup: /* @__PURE__ */ new Set(["option"]),
- select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
- // table
- table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
- tr: /* @__PURE__ */ new Set(["td", "th"]),
- colgroup: /* @__PURE__ */ new Set(["col"]),
- tbody: /* @__PURE__ */ new Set(["tr"]),
- thead: /* @__PURE__ */ new Set(["tr"]),
- tfoot: /* @__PURE__ */ new Set(["tr"]),
- // these elements can not have any children elements
- script: emptySet,
- iframe: emptySet,
- option: emptySet,
- textarea: emptySet,
- style: emptySet,
- title: emptySet
- };
- const onlyValidParents = {
- // sections
- html: emptySet,
- body: /* @__PURE__ */ new Set(["html"]),
- head: /* @__PURE__ */ new Set(["html"]),
- // table
- td: /* @__PURE__ */ new Set(["tr"]),
- colgroup: /* @__PURE__ */ new Set(["table"]),
- caption: /* @__PURE__ */ new Set(["table"]),
- tbody: /* @__PURE__ */ new Set(["table"]),
- tfoot: /* @__PURE__ */ new Set(["table"]),
- col: /* @__PURE__ */ new Set(["colgroup"]),
- th: /* @__PURE__ */ new Set(["tr"]),
- thead: /* @__PURE__ */ new Set(["table"]),
- tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
- // data list
- dd: /* @__PURE__ */ new Set(["dl", "div"]),
- dt: /* @__PURE__ */ new Set(["dl", "div"]),
- // other
- figcaption: /* @__PURE__ */ new Set(["figure"]),
- // li: new Set(["ul", "ol"]),
- summary: /* @__PURE__ */ new Set(["details"]),
- area: /* @__PURE__ */ new Set(["map"])
- };
- const knownInvalidChildren = {
- p: /* @__PURE__ */ new Set([
- "address",
- "article",
- "aside",
- "blockquote",
- "center",
- "details",
- "dialog",
- "dir",
- "div",
- "dl",
- "fieldset",
- "figure",
- "footer",
- "form",
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- "header",
- "hgroup",
- "hr",
- "li",
- "main",
- "nav",
- "menu",
- "ol",
- "p",
- "pre",
- "section",
- "table",
- "ul"
- ]),
- svg: /* @__PURE__ */ new Set([
- "b",
- "blockquote",
- "br",
- "code",
- "dd",
- "div",
- "dl",
- "dt",
- "em",
- "embed",
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "h6",
- "hr",
- "i",
- "img",
- "li",
- "menu",
- "meta",
- "ol",
- "p",
- "pre",
- "ruby",
- "s",
- "small",
- "span",
- "strong",
- "sub",
- "sup",
- "table",
- "u",
- "ul",
- "var"
- ])
- };
- const knownInvalidParents = {
- a: /* @__PURE__ */ new Set(["a"]),
- button: /* @__PURE__ */ new Set(["button"]),
- dd: /* @__PURE__ */ new Set(["dd", "dt"]),
- dt: /* @__PURE__ */ new Set(["dd", "dt"]),
- form: /* @__PURE__ */ new Set(["form"]),
- li: /* @__PURE__ */ new Set(["li"]),
- h1: headings,
- h2: headings,
- h3: headings,
- h4: headings,
- h5: headings,
- h6: headings
- };
-
- const validateHtmlNesting = (node, context) => {
- if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
- const error = new SyntaxError(
- `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
- );
- error.loc = node.loc;
- context.onWarn(error);
- }
- };
-
- const DOMNodeTransforms = [
- transformStyle,
- ...[transformTransition, validateHtmlNesting]
- ];
- const DOMDirectiveTransforms = {
- cloak: noopDirectiveTransform,
- html: transformVHtml,
- text: transformVText,
- model: transformModel,
- // override compiler-core
- on: transformOn,
- // override compiler-core
- show: transformShow
- };
- function compile(src, options = {}) {
- return baseCompile(
- src,
- extend({}, parserOptions, options, {
- nodeTransforms: [
- // ignore <script> and <tag>
- // this is not put inside DOMNodeTransforms because that list is used
- // by compiler-ssr to generate vnode fallback branches
- ignoreSideEffectTags,
- ...DOMNodeTransforms,
- ...options.nodeTransforms || []
- ],
- directiveTransforms: extend(
- {},
- DOMDirectiveTransforms,
- options.directiveTransforms || {}
- ),
- transformHoist: null
- })
- );
- }
-
- {
- initDev();
- }
- const compileCache = /* @__PURE__ */ Object.create(null);
- function compileToFunction(template, options) {
- if (!isString(template)) {
- if (template.nodeType) {
- template = template.innerHTML;
- } else {
- warn(`invalid template option: `, template);
- return NOOP;
- }
- }
- const key = genCacheKey(template, options);
- const cached = compileCache[key];
- if (cached) {
- return cached;
- }
- if (template[0] === "#") {
- const el = document.querySelector(template);
- if (!el) {
- warn(`Template element not found or is empty: ${template}`);
- }
- template = el ? el.innerHTML : ``;
- }
- const opts = extend(
- {
- hoistStatic: true,
- onError: onError ,
- onWarn: (e) => onError(e, true)
- },
- options
- );
- if (!opts.isCustomElement && typeof customElements !== "undefined") {
- opts.isCustomElement = (tag) => !!customElements.get(tag);
- }
- const { code } = compile(template, opts);
- function onError(err, asWarning = false) {
- const message = asWarning ? err.message : `Template compilation error: ${err.message}`;
- const codeFrame = err.loc && generateCodeFrame(
- template,
- err.loc.start.offset,
- err.loc.end.offset
- );
- warn(codeFrame ? `${message}
-${codeFrame}` : message);
- }
- const render = new Function(code)() ;
- render._rc = true;
- return compileCache[key] = render;
- }
- registerRuntimeCompiler(compileToFunction);
-
- exports.BaseTransition = BaseTransition;
- exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
- exports.Comment = Comment;
- exports.DeprecationTypes = DeprecationTypes;
- exports.EffectScope = EffectScope;
- exports.ErrorCodes = ErrorCodes;
- exports.ErrorTypeStrings = ErrorTypeStrings;
- exports.Fragment = Fragment;
- exports.KeepAlive = KeepAlive;
- exports.ReactiveEffect = ReactiveEffect;
- exports.Static = Static;
- exports.Suspense = Suspense;
- exports.Teleport = Teleport;
- exports.Text = Text;
- exports.TrackOpTypes = TrackOpTypes;
- exports.Transition = Transition;
- exports.TransitionGroup = TransitionGroup;
- exports.TriggerOpTypes = TriggerOpTypes;
- exports.VueElement = VueElement;
- exports.assertNumber = assertNumber;
- exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
- exports.callWithErrorHandling = callWithErrorHandling;
- exports.camelize = camelize;
- exports.capitalize = capitalize;
- exports.cloneVNode = cloneVNode;
- exports.compatUtils = compatUtils;
- exports.compile = compileToFunction;
- exports.computed = computed;
- exports.createApp = createApp;
- exports.createBlock = createBlock;
- exports.createCommentVNode = createCommentVNode;
- exports.createElementBlock = createElementBlock;
- exports.createElementVNode = createBaseVNode;
- exports.createHydrationRenderer = createHydrationRenderer;
- exports.createPropsRestProxy = createPropsRestProxy;
- exports.createRenderer = createRenderer;
- exports.createSSRApp = createSSRApp;
- exports.createSlots = createSlots;
- exports.createStaticVNode = createStaticVNode;
- exports.createTextVNode = createTextVNode;
- exports.createVNode = createVNode;
- exports.customRef = customRef;
- exports.defineAsyncComponent = defineAsyncComponent;
- exports.defineComponent = defineComponent;
- exports.defineCustomElement = defineCustomElement;
- exports.defineEmits = defineEmits;
- exports.defineExpose = defineExpose;
- exports.defineModel = defineModel;
- exports.defineOptions = defineOptions;
- exports.defineProps = defineProps;
- exports.defineSSRCustomElement = defineSSRCustomElement;
- exports.defineSlots = defineSlots;
- exports.devtools = devtools;
- exports.effect = effect;
- exports.effectScope = effectScope;
- exports.getCurrentInstance = getCurrentInstance;
- exports.getCurrentScope = getCurrentScope;
- exports.getCurrentWatcher = getCurrentWatcher;
- exports.getTransitionRawChildren = getTransitionRawChildren;
- exports.guardReactiveProps = guardReactiveProps;
- exports.h = h;
- exports.handleError = handleError;
- exports.hasInjectionContext = hasInjectionContext;
- exports.hydrate = hydrate;
- exports.hydrateOnIdle = hydrateOnIdle;
- exports.hydrateOnInteraction = hydrateOnInteraction;
- exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
- exports.hydrateOnVisible = hydrateOnVisible;
- exports.initCustomFormatter = initCustomFormatter;
- exports.initDirectivesForSSR = initDirectivesForSSR;
- exports.inject = inject;
- exports.isMemoSame = isMemoSame;
- exports.isProxy = isProxy;
- exports.isReactive = isReactive;
- exports.isReadonly = isReadonly;
- exports.isRef = isRef;
- exports.isRuntimeOnly = isRuntimeOnly;
- exports.isShallow = isShallow;
- exports.isVNode = isVNode;
- exports.markRaw = markRaw;
- exports.mergeDefaults = mergeDefaults;
- exports.mergeModels = mergeModels;
- exports.mergeProps = mergeProps;
- exports.nextTick = nextTick;
- exports.normalizeClass = normalizeClass;
- exports.normalizeProps = normalizeProps;
- exports.normalizeStyle = normalizeStyle;
- exports.onActivated = onActivated;
- exports.onBeforeMount = onBeforeMount;
- exports.onBeforeUnmount = onBeforeUnmount;
- exports.onBeforeUpdate = onBeforeUpdate;
- exports.onDeactivated = onDeactivated;
- exports.onErrorCaptured = onErrorCaptured;
- exports.onMounted = onMounted;
- exports.onRenderTracked = onRenderTracked;
- exports.onRenderTriggered = onRenderTriggered;
- exports.onScopeDispose = onScopeDispose;
- exports.onServerPrefetch = onServerPrefetch;
- exports.onUnmounted = onUnmounted;
- exports.onUpdated = onUpdated;
- exports.onWatcherCleanup = onWatcherCleanup;
- exports.openBlock = openBlock;
- exports.popScopeId = popScopeId;
- exports.provide = provide;
- exports.proxyRefs = proxyRefs;
- exports.pushScopeId = pushScopeId;
- exports.queuePostFlushCb = queuePostFlushCb;
- exports.reactive = reactive;
- exports.readonly = readonly;
- exports.ref = ref;
- exports.registerRuntimeCompiler = registerRuntimeCompiler;
- exports.render = render;
- exports.renderList = renderList;
- exports.renderSlot = renderSlot;
- exports.resolveComponent = resolveComponent;
- exports.resolveDirective = resolveDirective;
- exports.resolveDynamicComponent = resolveDynamicComponent;
- exports.resolveFilter = resolveFilter;
- exports.resolveTransitionHooks = resolveTransitionHooks;
- exports.setBlockTracking = setBlockTracking;
- exports.setDevtoolsHook = setDevtoolsHook;
- exports.setTransitionHooks = setTransitionHooks;
- exports.shallowReactive = shallowReactive;
- exports.shallowReadonly = shallowReadonly;
- exports.shallowRef = shallowRef;
- exports.ssrContextKey = ssrContextKey;
- exports.ssrUtils = ssrUtils;
- exports.stop = stop;
- exports.toDisplayString = toDisplayString;
- exports.toHandlerKey = toHandlerKey;
- exports.toHandlers = toHandlers;
- exports.toRaw = toRaw;
- exports.toRef = toRef;
- exports.toRefs = toRefs;
- exports.toValue = toValue;
- exports.transformVNodeArgs = transformVNodeArgs;
- exports.triggerRef = triggerRef;
- exports.unref = unref;
- exports.useAttrs = useAttrs;
- exports.useCssModule = useCssModule;
- exports.useCssVars = useCssVars;
- exports.useHost = useHost;
- exports.useId = useId;
- exports.useModel = useModel;
- exports.useSSRContext = useSSRContext;
- exports.useShadowRoot = useShadowRoot;
- exports.useSlots = useSlots;
- exports.useTemplateRef = useTemplateRef;
- exports.useTransitionState = useTransitionState;
- exports.vModelCheckbox = vModelCheckbox;
- exports.vModelDynamic = vModelDynamic;
- exports.vModelRadio = vModelRadio;
- exports.vModelSelect = vModelSelect;
- exports.vModelText = vModelText;
- exports.vShow = vShow;
- exports.version = version;
- exports.warn = warn;
- exports.watch = watch;
- exports.watchEffect = watchEffect;
- exports.watchPostEffect = watchPostEffect;
- exports.watchSyncEffect = watchSyncEffect;
- exports.withAsyncContext = withAsyncContext;
- exports.withCtx = withCtx;
- exports.withDefaults = withDefaults;
- exports.withDirectives = withDirectives;
- exports.withKeys = withKeys;
- exports.withMemo = withMemo;
- exports.withModifiers = withModifiers;
- exports.withScopeId = withScopeId;
-
- return exports;
-
-})({});

File Metadata

Mime Type
text/x-diff
Expires
Fri, Dec 12, 11:51 AM (1 d, 22 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a5/3d/b59049f04b40a2f4946eda2931a2

Event Timeline